Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2017-04-08 01:25:45 +0300
committerMarek Safar <marek.safar@gmail.com>2017-04-11 13:25:37 +0300
commit07adebd8bf94f2c4310421460940fd6c873b24d5 (patch)
tree892b2e79bcf3b03736269e1c233739d14c8a6c62 /mcs/class/referencesource
parent9635b9cea0515432fead4c370b0533db91861bfe (diff)
Updates referencesource to .NET 4.7
Diffstat (limited to 'mcs/class/referencesource')
-rw-r--r--mcs/class/referencesource/System.Activities.Core.Presentation/SR.Designer.cs2
-rw-r--r--mcs/class/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/MorphHelpers.cs2
-rw-r--r--mcs/class/referencesource/System.Activities.Core.Presentation/System/Activities/Presentation/DynamicArgumentDesigner.xaml.cs2
-rw-r--r--mcs/class/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/SqlCommandAsyncResult.cs4
-rw-r--r--mcs/class/referencesource/System.Activities/System/Activities/Debugger/StateManager.cs5
-rw-r--r--mcs/class/referencesource/System.Activities/System/Activities/Debugger/Symbol/SymbolHelper.cs49
-rw-r--r--mcs/class/referencesource/System.Activities/System/Activities/Runtime/ActivityExecutor.cs2
-rw-r--r--mcs/class/referencesource/System.Activities/System/Activities/Runtime/ActivityInstanceMap.cs2
-rw-r--r--mcs/class/referencesource/System.Activities/System/Activities/Statements/MethodExecutor.cs4
-rw-r--r--mcs/class/referencesource/System.Activities/System/Activities/Statements/MethodResolver.cs2
-rw-r--r--mcs/class/referencesource/System.Activities/System/Activities/WorkflowApplication.cs6
-rw-r--r--mcs/class/referencesource/System.Activities/System/Activities/WorkflowPersistenceContext.cs2
-rw-r--r--mcs/class/referencesource/System.ComponentModel.DataAnnotations/DataAnnotationsResources.resx291
-rw-r--r--mcs/class/referencesource/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Resources.txt16
-rw-r--r--mcs/class/referencesource/System.Configuration/System/Configuration/BaseConfigurationRecord.cs33
-rw-r--r--mcs/class/referencesource/System.Configuration/System/Configuration/Internal/InternalConfigHost.cs2
-rw-r--r--mcs/class/referencesource/System.Configuration/System/Configuration/MgmtConfigurationRecord.cs13
-rw-r--r--mcs/class/referencesource/System.Core/Microsoft/Win32/SafeHandles/NCryptSafeHandles.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System.Core.txt35
-rw-r--r--mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/EventDescriptor.cs4
-rw-r--r--mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventLogSession.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventMetadata.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventOpcode.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventRecord.cs4
-rw-r--r--mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/ProviderMetadata.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/IO/BufferedStream2.cs4
-rw-r--r--mcs/class/referencesource/System.Core/System/IO/LogStream.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedView.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedViewAccessor.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedViewStream.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/IO/Pipes/PipeStream.cs6
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Enumerable.cs4
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Channels/AsynchronousChannel.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Channels/SynchronousChannel.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/AggregationMinMaxHelpers.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/EmptyEnumerable.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/EnumerableWrapperWeakToStrong.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/OrderedParallelQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/ParallelEnumerableWrapper.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/ParallelQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/RangeEnumerable.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/RepeatEnumerable.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/ArrayMergeHelper.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/AsynchronousChannelMergeEnumerator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/DefaultMergeHelper.cs4
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/MergeEnumerator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/MergeExecutor.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/OrderPreservingMergeHelper.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/OrderPreservingPipeliningMergeHelper.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/SynchronousChannelMergeEnumerator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/HashRepartitionEnumerator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/HashRepartitionStream.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/OrderedHashRepartitionEnumerator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/OrderedHashRepartitionStream.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/PartitionedDataSource.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/PartitionedStream.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/UnorderedHashRepartitionStream.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/AssociativeAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/ExceptQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/GroupJoinQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/HashJoinQueryOperatorEnumerator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/IntersectQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/JoinQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/UnionQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/ZipQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/BinaryQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/CountAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalAverageAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalMinMaxAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalSumAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleAverageAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleMinMaxAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleSumAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatAverageAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatMinMaxAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatSumAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperatorEnumerator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntAverageAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntMinMaxAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntSumAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongAverageAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongCountAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongMinMaxAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongSumAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalAverageAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalMinMaxAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalSumAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleAverageAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleMinMaxAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleSumAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatAverageAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatMinMaxAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatSumAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntAverageAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntMinMaxAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntSumAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongAverageAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongMinMaxAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongSumAggregationOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/ListQueryResults.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/OrderingQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/QueryExecutionOption.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/PartitionedStreamMerger.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/PartitionerQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOpeningEnumerator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOperatorEnumerator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryResults.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QuerySettings.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/ScanQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/AnyAllSearchOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ConcatQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ContainsSearchOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/DefaultIfEmptyQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/DistinctQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ElementAtQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/FirstQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ForAllOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/GroupByQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/IndexedSelectQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/IndexedWhereQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/LastQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ReverseQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SelectManyQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SelectQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SingleQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SortQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipWhileQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/WhereQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/UnaryQueryOperator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/CancellationState.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingPipeliningSpoolingTask.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingSpoolingTask.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryLifecycle.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryTask.cs4
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryTaskGroupState.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/Scheduling.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/SpoolingTask.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/SpoolingTaskBase.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/CancellableEnumerable.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ExceptionAggregator.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ExchangeUtilities.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/FixedMaxHeap.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/GrowingArray.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/HashLookup.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ListChunk.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Lookup.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/PLINQETWProvider.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Pair.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/PairComparer.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ReverseComparer.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Shared.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Sorting.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/TraceHelpers.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Util.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Wrapper.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/WrapperEqualityComparer.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/ParallelEnumerable.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Linq/SequenceQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Core/System/Security/Cryptography/BCryptNative.cs6
-rw-r--r--mcs/class/referencesource/System.Core/System/Security/Cryptography/CngAlgorithm.cs38
-rw-r--r--mcs/class/referencesource/System.Core/System/Security/Cryptography/CngKey.cs51
-rw-r--r--mcs/class/referencesource/System.Core/System/Security/Cryptography/CngKeyBlobFormat.cs18
-rw-r--r--mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDiffieHellman.cs86
-rw-r--r--mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDiffieHellmanCng.cs78
-rw-r--r--mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDiffieHellmanCngPublicKey.cs101
-rw-r--r--mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDiffieHellmanPublicKey.cs25
-rw-r--r--mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDsa.cs102
-rw-r--r--mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDsaCng.cs31
-rw-r--r--mcs/class/referencesource/System.Core/System/Security/Cryptography/NCryptNative.cs117
-rw-r--r--mcs/class/referencesource/System.Core/System/Security/Cryptography/Rfc4050KeyFormatter.cs271
-rw-r--r--mcs/class/referencesource/System.Core/System/threading/Tasks/TaskExtensions.cs2
-rw-r--r--mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/DataRowComparer.cs2
-rw-r--r--mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/DataRowExtensions.cs2
-rw-r--r--mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/DataSetUtil.cs4
-rw-r--r--mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/DataTableExtensions.cs4
-rw-r--r--mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/EnumerableRowCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/EnumerableRowCollectionExtensions.cs4
-rw-r--r--mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/LinqDataView.cs4
-rw-r--r--mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/OrderedEnumerableRowCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/SortExpressionBuilder.cs4
-rw-r--r--mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/TypedTableBase.cs2
-rw-r--r--mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/TypedTableBaseExtensions.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/AspNet/BuildProviderUtils.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/AspNet/EntityDesignerBuildProvider.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/AspNet/EntityModelBuildProvider.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/AspNet/MappingModelBuildProvider.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/AspNet/StorageModelBuildProvider.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/Common/EDesignUtil.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/Common/MetadataItemSerializer.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/Common/MetadataUtil.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/Common/OneToOneMappingSerializer.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/Common/UniqueIdentifierService.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityCodeGenerator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityDesignerUtils.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityFrameworkVersions.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityModelSchemaGenerator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaFilterEntry.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaGenerator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaGenerator/EntityStoreSchemaGenerator.DbObjectKey.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaGenerator/EntityStoreSchemaGenerator.LoadMethodSessionState.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityViewGeneration/EntityViewGenerationConstants.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityViewGeneration/EntityViewGenerator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/MetadataExtensionMethods.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/MetadataItemCollectionFactory.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/BidirectionalDictionary.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/EnglishPluralizationService.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/EntityDesignPluralizationHandler.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/PluralizationServiceUtil.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/EntityStoreSchemaGeneratorDatabaseSchemaLoader.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/FunctionDetailsReader.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/RelationshipDetailsCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/RelationshipDetailsRow.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/TableDetailsCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/TableDetailsRow.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/EdmToObjectNamespaceMap.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/AssociationTypeEmitter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/AttributeEmitter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/ClientApiGenerator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/CommentEmitter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/ComplexTypeEmitter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/Emitter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/EntityContainerEmitter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/EntityTypeEmitter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/FixUp.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/FixUpCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/MetadataItemEmitter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/NamespaceEmitter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/NavigationPropertyEmitter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/PropertyEmitter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/PropertyEmitterBase.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/SchemaTypeEmitter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/StructuredTypeEmitter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/TypeReference.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/Utils.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/EntityClassGenerator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/LazyTextWriterCreator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/PropertyGeneratedEventArgs.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/TypeGeneratedEventArgs.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/AbstractExpressions.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Aggregates.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/BasicCommandTreeVisitor.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/BasicExpressionVisitor.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbCommandTree.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbDeleteCommandTree.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbExpressionVisitor.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbExpressionVisitor_TResultType.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbFunctionCommandTree.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbInsertCommandTree.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbLambda.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbModificationClause.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbModificationCommandTree.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbQueryCommandTree.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbSetClause.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbUpdateCommandTree.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DefaultExpressionVisitor.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBindings.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/DbExpressionBuilder.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/EdmFunctions.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/Internal/ArgumentValidation.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/Internal/EnumerableValidator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/Row.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/Spatial/SpatialEdmFunctions.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/DbExpressionRules.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionCopier.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionDumper.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionKeyGen.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionList.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionPrinter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ParameterRetriever.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/PatternMatchRules.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/Validator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ViewSimplifier.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/XmlExpressionDumper.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/OperatorExpressions.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/RelationalExpressions.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ValueExpressions.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/DataRecord.cs6
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/DataRecordInfo.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/DbCommandDefinition.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/DbProviderManifest.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/DbProviderServices.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/DbXmlEnabledProviderManifest.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntityRecordInfo.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/AliasedExpr.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/AstNode.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/BuiltInExpr.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/CaseExpr.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/Command.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/ConstructorExpr.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/CreateRefExpr.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/DotExpr.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/FunctionDefinition.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/GroupAggregateExpr.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/GroupPartitionExpr.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/Identifier.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/Literal.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/MethodExpr.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/NamespaceImport.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/NavigationExpr.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/ParenExpr.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/QueryExpr.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/QueryParameter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/QueryStatement.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/RefExpr.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/TypeDefinition.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlErrorHelper.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlLexer.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlLexerHelpers.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlParser.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlParserHelpers.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlQuery.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/EntitySqlParser.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/FunctionOverloadResolver.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/ParseResult.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/ParserOptions.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/SemanticAnalyzer.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/SemanticResolver.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/StaticContext.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/TypeResolver.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntityUtil.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/FieldMetadata.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/FieldNameLookup.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/DbTypeMap.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/ColumnMapKeyBuilder.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/CompensatingCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/Coordinator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/CoordinatorFactory.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/CoordinatorScratchpad.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/RecordState.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/RecordStateFactory.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/RecordStateScratchpad.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/Shaper.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/ShaperFactory.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/Translator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/Util.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/MultipartIdentifier.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/CompiledQueryCacheEntry.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/CompiledQueryCacheKey.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/EntityClientCacheKey.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/EntitySqlQueryCacheKey.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/LinqQueryCacheKey.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/QueryCacheEntry.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/QueryCacheKey.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/QueryCacheManager.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/ShaperFactoryQueryCacheKey.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/AliasGenerator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/BoolExpr.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Clause.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/ConversionContext.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Converter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/DomainConstraint.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/IdentifierService.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/KnowledgeBase.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Literal.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/NegationPusher.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Sentence.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Simplifier.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Solver.cs8
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Vertex.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Visitor.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/ByValueEqualityComparer.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/CommandHelper.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/DisposableCollectionWrapper.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Helpers.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/InternalBase.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/KeyToListMap.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Memoizer.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/MetadataHelper.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/ModifiableIteratorCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Pair.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Set.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Singleton.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/StringUtil.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/ThreadSafeList.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/TrailingSpaceComparer.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/TreePrinter.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/DbConnectionOptions.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/DbParameterCollectionHelper.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/DbParameterHelper.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityAdapter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityCommand.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityCommandDefinition.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityConnection.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityConnectionStringBuilder.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityDataReader.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityParameter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityParameterCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityProviderFactory.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityProviderServices.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityTransaction.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/NameValuePair.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityCommandCompilationException.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityCommandExecutionException.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityException.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityKey.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/BooleanFacetDescriptionElement.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ByteFacetDescriptionElement.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/CollectionTypeElement.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Documentation.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainer.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerAssociationSet.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerAssociationSetEnd.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerEntitySet.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerEntitySetDefiningQuery.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerRelationshipSet.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerRelationshipSetEnd.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityKeyElement.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FacetDescriptionElement.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FacetEnabledSchemaElement.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FilteredSchemaElementLookUpTable.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Function.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FunctionCommandText.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FunctionImportElement.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/IntegerFacetDescriptionElement.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ItemType.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/KeyProperty.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ModelFunction.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ModelFunctionTypeElement.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/NavigationProperty.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/OnOperation.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Parameter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/PrimitiveSchema.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Property.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReferenceSchema.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReferenceTypeElement.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReferentialConstraint.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReferentialConstraintRoleElement.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Relationship.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/RelationshipEnd.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/RelationshipEndCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReturnType.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReturnValue.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/RowTypeElement.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/RowTypePropertyElement.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ScalarType.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Schema.cs10
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaComplexType.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaElement.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaElementLookUpTable.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaElementLookUpTableEnumerator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaEnumMember.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaEnumType.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaLookupTable.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaManager.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaType.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SridFacetDescriptionElement.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/StructuredProperty.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/StructuredType.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TextElement.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TypeElement.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TypeRefElement.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TypeUsageBuilder.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Utils.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ValidationHelper.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/XmlSchemaResource.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/EntitySqlException.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/InternalMappingException.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/InvalidCommandTreeException.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/BaseMetadataMappingVisitor.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/DefaultObjectMappingItemCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/EntityViewContainer.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/EntityViewGenerationAttribute.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/FunctionImportMapping.ReturnTypeRenameMapping.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/FunctionImportMapping.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/FunctionImportMappingComposable.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/FunctionImportMappingNonComposable.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Mapping.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/MappingItemCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/MetadataMappingHasherVisitor.HashSourceBuilder.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/MetadataMappingHasherVisitor.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectAssociationEndMapping.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectComplexPropertyMapping.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectMemberMapping.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectNavigationPropertyMapping.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectPropertyMapping.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectTypeMapping.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageAssociationSetMapping.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageAssociationTypeMapping.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageComplexPropertyMapping.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageComplexTypeMapping.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageConditionPropertyMapping.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageEndPropertyMapping.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageEntityContainerMapping.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageEntitySetMapping.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageEntityTypeMapping.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingFragment.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingItemCollection.ViewDictionary.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingItemCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingItemLoader.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageModificationFunctionMapping.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StoragePropertyMapping.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageScalarPropertyMapping.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageSetMapping.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageTypeMapping.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/AssociationSetMetadata.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/ChangeNode.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/CompositeKey.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/DynamicUpdateCommand.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/ExtractedStateEntry.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/ExtractorMetadata.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/FunctionMappingTranslator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/FunctionUpdateCommand.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Graph.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/KeyManager.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.Evaluator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.ExtentPlaceholderCreator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.JoinPropagator.JoinPredicateVisitor.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.JoinPropagator.SubstitutingCloneVisitor.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.JoinPropagator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/PropagatorResult.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/RecordConverter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/RelationshipConstraintValidator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/SourceInterpreter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/TableChangeProcessor.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UndirectedGraph.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateCommand.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateCommandOrderer.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateCompiler.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateExpressionVisitor.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateTranslator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/ViewLoader.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/BasicViewGenerator.cs6
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CellCreator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CellPartitioner.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CellTreeSimplifier.cs6
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ConfigViewGenerator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/AliasedSlot.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/BooleanProjectedSlot.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/CaseCqlBlock.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/CqlBlock.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/CqlIdentifiers.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/CqlWriter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/ExtentCqlBlock.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/JoinCqlBlock.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/SlotInfo.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/UnionCqlBlock.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGenerator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/DiscriminatorMap.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/GeneratedView.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/FragmentQuery.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/FragmentQueryKB.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/FragmentQueryProcessor.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/QueryRewriter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RewritingPass.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RewritingProcessor.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RewritingSimplifier.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RewritingValidator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RoleBoolean.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/Tile.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/BoolExpression.cs6
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/BoolExpressionVisitors.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/BoolLiteral.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CaseStatement.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CaseStatementProjectedSlot.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/Cell.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellIdBoolean.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellLabel.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellQuery.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellTreeNode.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellTreeNodeVisitors.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/Constant.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ConstantProjectedSlot.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/Domain.cs6
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ErrorLog.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/LeafCellTreeNode.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/LeftCellWrapper.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberDomainMap.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberMaps.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberPath.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberProjectedSlot.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberProjectionIndex.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberRestriction.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/NegatedConstant.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/OpCellTreeNode.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ProjectedSlot.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/QualifiedCellIdBoolean.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ScalarConstant.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ScalarRestriction.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/TypeConstant.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/TypeRestriction.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/WithStatement.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Utils/ExceptionHelpers.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Utils/ExternalCalls.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/BasicCellRelation.cs6
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/BasicKeyConstraint.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/CellRelation.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ErrorPatternMatcher.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ExtentKey.cs6
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ForeignConstraint.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/KeyConstraint.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/SchemaConstraints.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ViewCellRelation.cs6
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ViewCellSlot.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ViewKeyConstraint.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ViewGenResults.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ViewGenerator.cs6
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ViewgenContext.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ViewgenGatekeeper.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewValidator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/MappingException.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/AspProxy.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/CacheForPrimitiveTypes.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ClrPerspective.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Converter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/CustomAssemblyResolver.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/DefaultAssemblyResolver.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AssociationEndMember.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AssociationSet.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AssociationSetEnd.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AssociationType.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/CollectionType.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ComplexType.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Documentation.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmConstants.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmFunction.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmMember.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmProperty.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmType.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntityContainer.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntitySet.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntitySetBase.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntitySetBaseCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntityType.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntityTypeBase.cs6
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EnumMember.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EnumType.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Facet.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FacetDescription.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FacetValueContainer.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FacetValues.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FilteredReadOnlyMetadataCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FunctionParameter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/GlobalItem.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ItemCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/LightweightCodeGenerator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MemberCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataCollection.cs6
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataItem.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataItem_Static.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataProperty.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataPropertyAttribute.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataPropertyCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataPropertyvalue.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/NavigationProperty.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/NavigationPropertyAccessor.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/PrimitiveType.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Provider/ClrProviderManifest.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Provider/EdmProviderManifest.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Provider/EdmProviderManifestFunctionBuilder.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Provider/EdmProviderManifestSpatialFunctions.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ReadOnlyMetadataCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RefType.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ReferentialConstraint.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RelationshipEndMember.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RelationshipSet.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RelationshipType.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RowType.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/SafeLink.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/SafeLinkCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/SimpleType.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/StructuralType.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/TypeUsage.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/util.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmError.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmItemCollection.OcAssemblyCache.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmItemCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmItemError.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmSchemaError.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmValidator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Helper.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MappingMetadataHelper.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoader.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderComposite.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderCompositeFile.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderCompositeResource.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderFile.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderResource.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderXmlReaderWrapper.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataCache.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataWorkspace.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ModelPerspective.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectHelper.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectItemCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/AssemblyCache.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/AssemblyCacheEntry.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ImmutableAssemblyCacheEntry.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/KnownAssembliesSet.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/KnownAssemblyEntry.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/LoadMessageLogger.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/LockedAssemblyCache.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/MetadataAssemblyHelper.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/MutableAssemblyCacheEntry.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemAssemblyLoader.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemAttributeAssemblyLoader.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemCachedAssemblyLoader.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemConventionAssemblyLoader.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemLoadingSessionData.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemNoOpAssemblyLoader.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Perspective.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/StoreItemCollection.Loader.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/StoreItemCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/TargetPerspective.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/TypeHelpers.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/TypeSemantics.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/MetadataException.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/ObjectNotFoundException.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/AdditionalEntityFunctions.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/CompiledQuery.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/ComplexObject.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmComplexPropertyAttribute.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmComplexTypeAttribute.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmEntityTypeAttribute.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmEnumTypeAttribute.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmFunctionAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmPropertyAttribute.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmRelationshipNavigationPropertyAttribute.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmRelationshipRoleAttribute.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmScalarPropertyAttribute.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmSchemaAttribute.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmTypeAttribute.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EntityCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EntityObject.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EntityReference.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EntityReference_TResultType.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelatedEnd.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelationshipFixer.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelationshipManager.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelationshipNavigation.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/StructuralObject.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataRecordObjectView.cs12
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/BindingContext.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/CompiledELinqQueryState.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ELinqQueryState.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ExpressionConverter.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ExpressionVisitorHelpers.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/Funcletizer.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/InitializerFacet.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/LinqExpressionNormalizer.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/MethodCallTranslator.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ObjectQueryProvider.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/OrderByLifter.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ReflectionUtil.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/SpatialMethodCallTranslator.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/SpatialPropertyTranslator.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/Translator.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/TypeSystem.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/EntityEntry.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/EntityFunctions.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/FieldDescriptor.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/BaseEntityWrapper.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/ComplexTypeMaterializer.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntityProxyFactory.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntityProxyTypeInfo.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntitySqlQueryBuilder.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntitySqlQueryState.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntityWrapper.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntityWrapperFactory.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/LazyLoadBehavior.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/LightweightEntityWrapper.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/NullEntityWrapper.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/ObjectFullSpanRewriter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/ObjectQueryExecutionPlan.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/ObjectQueryState.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/ObjectSpanRewriter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/TransactionManager.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectContext.cs12
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectMaterializedEventArgs.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectParameter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectParameterCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectQuery.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectQuery_EntitySqlExtensions.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectQuery_TResultType.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectResult.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectResult_TResultType.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectSet.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntry.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntryBaseUpdatableDataRecord.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntryDbDataRecord.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntryDbUpdatableDataRecord.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntryOriginalDbUpdatableDataRecord.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateManager.cs8
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateManagerMetadata.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectView.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectViewEntityCollectionData.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectViewFactory.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectViewListener.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectViewQueryResultData.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ProxyDataContractResolver.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/RelationshipEntry.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/RelationshipWrapper.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Span.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/SpanIndex.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/SqlClient/SqlFunctions.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Objects/SqlClient/SqlSpatialFunctions.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/OptimisticConcurrencyException.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/PropertyConstraintException.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/ProviderIncompatibleException.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/AncillaryOps.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ColumnMap.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ColumnMapCopier.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ColumnMapFactory.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ColumnMapVisitor.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Command.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Dump.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ExplicitDiscriminatorMap.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Metadata.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/NodeCounter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/NodeInfo.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Nodes.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/OpCopier.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Ops.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/PhysicalOps.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/RelOps.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/RelPropertyHelper.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Rule.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/RulePatternOps.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/RuleProcessor.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ScalarOps.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Vars.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Visitors.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/AggregatePushdown.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/CTreeGenerator.cs6
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/CodeGen.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ColumnMapProcessor.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ColumnMapTranslator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/CommandPlan.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ConstraintManager.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ITreeGenerator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/JoinElimination.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/JoinGraph.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/KeyPullup.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/NestPullup.cs6
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/NominalTypeEliminator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/Normalizer.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PlanCompiler.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PlanCompilerUtil.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PreProcessor.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/Predicate.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ProjectionPruner.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PropertyPushdownHelper.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PropertyRef.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ProviderCommandInfoUtils.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/StructuredTypeInfo.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/SubqueryTrackingVisitor.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/TransformationRules.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/TypeInfo.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/TypeUtils.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/VarInfo.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/VarRefManager.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/VarRemapper.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/ResultAssembly/BridgeDataReader.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Query/ResultAssembly/BridgeDataRecord.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DbGeography.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DbGeographyWellKnownValue.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DbGeometry.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DbGeometryWellKnownValue.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DbSpatialServices.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DefaultSpatialServices.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/ExtensionMethods.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/Internal/SpatialExceptions.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/SpatialHelpers.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/IDbSpatialValue.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/DmlSqlGenerator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/JoinSymbol.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/OptionalColumn.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/Sql8ConformanceChecker.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/Sql8ExpressionRewriter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlBuilder.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlFunctionCallHandler.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlGenerator.cs6
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlSelectClauseBuilder.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlSelectStatement.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlWriter.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/Symbol.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SymbolPair.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SymbolTable.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SymbolUsageManager.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/TopClause.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlProviderManifest.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlProviderServices.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlProviderUtilities.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlSpatialDataReader.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlSpatialServices.Generated.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlSpatialServices.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlTypesAssembly.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlVersion.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/System/Data/UpdateException.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Entity/Util/AppSettings.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Linq/ChangeConflicts.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Linq/ChangeDirector.cs22
-rw-r--r--mcs/class/referencesource/System.Data.Linq/ChangeProcessor.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Linq/ChangeTracker.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Linq/CompiledQuery.cs32
-rw-r--r--mcs/class/referencesource/System.Data.Linq/DataContext.cs20
-rw-r--r--mcs/class/referencesource/System.Data.Linq/DataShape.cs8
-rw-r--r--mcs/class/referencesource/System.Data.Linq/DbConvert.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Linq/Mapping/MetaModel.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Linq/Provider/IProvider.cs28
-rw-r--r--mcs/class/referencesource/System.Data.Linq/SqlClient/Common/SqlVisitor.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Linq/SqlClient/Query/Funcletizer.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Linq/SqlClient/Query/QueryConverter.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Linq/SqlClient/Query/SqlBinder.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Linq/SqlClient/Query/SqlComparer.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Linq/SqlClient/Query/SqlDeflator.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Linq/SqlClient/Query/SqlFlattener.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Linq/SqlClient/Query/SqlMethodCallConverter.cs6
-rw-r--r--mcs/class/referencesource/System.Data.Linq/SqlClient/Reader/ObjectReaderCompiler.cs28
-rw-r--r--mcs/class/referencesource/System.Data.Linq/SqlClient/SqlMethods.cs16
-rw-r--r--mcs/class/referencesource/System.Data.Linq/SqlClient/SqlProvider.cs4
-rw-r--r--mcs/class/referencesource/System.Data.Linq/SqlClient/SqlTypeSystemProvider.cs2
-rw-r--r--mcs/class/referencesource/System.Data.Linq/Types.cs18
-rw-r--r--mcs/class/referencesource/System.Data.Linq/misc/SecurityUtils.cs6
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/GenerateHelper.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/IteratorDescriptor.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/OptimizerPatterns.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/StaticDataManager.cs4
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/TailCallAnalyzer.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlILAnnotation.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlILConstructAnalyzer.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlILModule.cs4
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlILOptimizerVisitor.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlIlTypeHelper.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlIlVisitor.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/ListBase.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Pair.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilBinary.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilChoice.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilCloneVisitor.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilDataSource.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilExpression.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilFactory.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilFunction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilInvoke.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilInvokeEarlyBound.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilInvokeLateBound.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilIterator.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilList.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilLiteral.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilLoop.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilName.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilNode.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilParameter.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilPatternFactory.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilPatternVisitor.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilReference.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilReplaceVisitor.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilScopedVisitor.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilSortKey.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilStrConcat.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilTargetType.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilTernary.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilTypeChecker.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilUnary.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilValidationVisitor.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilVisitor.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilXmlReader.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilXmlWriter.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/SubstitutionList.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/WhitespaceRule.cs4
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QueryReaderSettings.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/ContentIterators.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/DecimalFormatter.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/DocumentOrderComparer.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/DodSequenceMerge.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/EarlyBoundInfo.cs4
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/NumberFormatter.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/RtfNavigator.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/SetIterators.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/SiblingIterators.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/StringConcat.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/TreeIterators.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/WhitespaceRuleLookup.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/WhitespaceRuleReader.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlAggregates.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlAttributeCache.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlCollation.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlExtensionFunction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlILIndex.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlILStorageConverter.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlIterators.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlNavigatorFilter.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlNavigatorStack.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlQueryContext.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlQueryOutput.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlQueryRuntime.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlQuerySequence.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlQueryStaticData.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlRawWriterWrapper.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlSequenceWriter.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlSortKey.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlSortKeyAccumulator.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XslNumber.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XsltConvert.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XsltFunctions.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XsltLibrary.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/SourceLineInfo.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathBuilder.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathCompileException.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathParser.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathQilFactory.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathScanner.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPathConvert.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlILCommand.cs4
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlIlGenerator.cs4
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlQualifiedNameTest.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlQueryCardinality.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlQueryType.cs4
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlQueryTypeFactory.cs4
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XslException.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/Compiler.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/CompilerScopeManager.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/Focus.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/InvokeGenerator.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/KeyMatchBuilder.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/Keywords.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/MatcherBuilder.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/OutputScopeManager.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/QilGenerator.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/QilGeneratorEnv.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/QilStrConcatenator.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/Scripts.cs4
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/Stylesheet.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XPathPatternBuilder.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XPathPatternParser.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XslAst.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XslAstAnalyzer.cs4
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XslVisitor.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XsltInput.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XsltLoader.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XsltQilFactory.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Action.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ActionFrame.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ApplyImportsAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ApplyTemplatesAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/AttributeAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/AttributeSetAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Avt.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/AvtEvent.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/BeginEvent.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/BuilderInfo.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CallTemplateAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ChooseAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CommentAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CompiledAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Compiler.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ContainerAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyAttributesAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyCodeAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyNamespacesAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyNodesetAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyOfAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/DbgCompiler.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/DocumentScope.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ElementAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/EndEvent.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Event.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ForeachAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/HtmlProps.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/IfAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/InputScope.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/InputScopeManager.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/MessageAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NamespaceDecl.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NamespaceEvent.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NavigatorInput.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NavigatorOutput.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NewInstructionAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NumberAction.cs4
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/OutKeywords.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/OutputScope.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/OutputScopeManager.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/PrefixQname.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ProcessingInstructionAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Processor.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ReaderOutput.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/RecordBuilder.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/RootAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/SequentialOutput.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/SortAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/StateMachine.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/StringOutput.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Stylesheet.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TemplateAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TemplateBaseAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TemplateLookupAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Templatemanager.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TextAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TextEvent.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TextOnlyOutput.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TextOutput.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TheQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/UseAttributesetsAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ValueOfAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/VariableAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/WithParamAction.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/WriterOutput.cs2
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/XsltCompileContext.cs4
-rw-r--r--mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/XsltOutput.cs2
-rw-r--r--mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/MemoryRecordBuffer.cs6
-rw-r--r--mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/MetadataUtilsSmi.cs4
-rw-r--r--mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiConnection.cs4
-rw-r--r--mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiContext.cs4
-rw-r--r--mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiContextFactory.cs4
-rw-r--r--mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiEventSink.cs4
-rw-r--r--mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiEventSink_Default.cs4
-rw-r--r--mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiEventSink_DeferedProcessing.cs4
-rw-r--r--mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiEventStream.cs4
-rw-r--r--mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiGettersStream.cs4
-rw-r--r--mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiMetaData.cs4
-rw-r--r--mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiMetaDataProperty.cs4
-rw-r--r--mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiRecordBuffer.cs4
-rw-r--r--mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiRequestExecutor.cs4
-rw-r--r--mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiSettersStream.cs4
-rw-r--r--mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiTypedGetterSetter.cs4
-rw-r--r--mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiXetterAccessMap.cs4
-rw-r--r--mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SqlDataRecord.cs8
-rw-r--r--mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SqlRecordBuffer.cs6
-rw-r--r--mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SqlTriggerContext.cs4
-rw-r--r--mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/ValueUtilsSmi.cs4
-rw-r--r--mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/sqlcontext.cs4
-rw-r--r--mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/sqlpipe.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/BaseCollection.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/CodeGen/StrongTypingException.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/CodeGen/datacache.cs8
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/ColumnTypeConverter.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/ActivityCorrelator.cs2
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/AdapterUtil.cs46
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/BigIntegerStorage.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/BooleanStorage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/ByteStorage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/CharStorage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DBCommand.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DBCommandBuilder.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DBConnection.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DBConnectionString.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DBDataPermission.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DBDataPermissionAttribute.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DBParameter.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DBSchemaRow.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DBSchemaTable.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DataAdapter.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DataColumnMapping.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DataColumnMappingCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DataRecordInternal.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DataStorage.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DataTableMapping.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DataTableMappingCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DateTimeOffsetStorage.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DateTimeStorage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DbConnectionOptions.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DbConnectionPoolKey.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DbConnectionStringBuilder.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DbConnectionStringCommon.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DbDataAdapter.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DbDataReader.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DbDataSourceEnumerator.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DbException.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DbParameterCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DbProviderConfigurationHandler.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DbProviderFactories.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DbProviderFactoriesConfigurationHandler.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DbProviderFactory.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DbProviderSpecificTypePropertyAttribute.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DbTransaction.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DecimalStorage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/DoubleStorage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/FieldNameLookup.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/GreenMethods.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/HandlerBase.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/Int16Storage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/Int32Storage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/Int64Storage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/MultipartIdentifier.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/NameValuePair.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/NameValuePermission.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/ObjectStorage.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/RowUpdatedEventArgs.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/RowUpdatingEventArgs.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/SByteStorage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/SQLConvert.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLBinaryStorage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLByteStorage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLBytesStorage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLCharsStorage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLDateTimeStorage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLDecimalStorage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLDoubleStorage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLGuidStorage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLInt16Storage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLInt32Storage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLInt64Storage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLMoneyStorage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLSingleStorage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLStringStorage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQlBooleanStorage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SqlUDTStorage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SqlXmlStorage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/SafeNativeMethods.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/SchemaTableColumn.cs2
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/SchemaTableOptionalColumn.cs2
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/SingleStorage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/StringStorage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/System.Data_BID.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/TimeSpanStorage.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/UInt16Storage.cs8
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/UInt32Storage.cs8
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/UInt64Storage.cs8
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/UnsafeNativeMethods.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/dbdatarecord.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Common/dbenumerator.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Constraint.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/ConstraintCollection.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/ConstraintConverter.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/ConstraintEnumerator.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DBConcurrencyException.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataColumn.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataColumnChangeEvent.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataColumnCollection.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataColumnPropertyDescriptor.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataError.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataException.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataKey.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataRelation.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataRelationCollection.cs8
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataRelationPropertyDescriptor.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataRow.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataRowChangeEvent.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataRowCollection.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataRowView.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataSet.cs8
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataSysAttribute.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataTable.cs16
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataTableClearEvent.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataTableCollection.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataTableNewRowEvent.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataTablePropertyDescriptor.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataTableReader.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataTableReaderListener.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataTableTypeConverter.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataView.cs10
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataViewListener.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataViewManager.cs8
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataViewManagerListItemTypeDescriptor.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataViewSetting.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DataViewSettingCollection.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/DefaultValueTypeConverter.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/FillErrorEventArgs.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Filter/AggregateNode.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Filter/BinaryNode.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Filter/ConstNode.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Filter/DataExpression.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Filter/ExpressionNode.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Filter/ExpressionParser.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Filter/FilterException.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Filter/FunctionNode.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Filter/LookupNode.cs8
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Filter/NameNode.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Filter/Operators.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Filter/UnaryNode.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Filter/ZeroOpNode.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/ForeignKeyConstraint.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/MergeFailedEvent.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Merger.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/DbDataRecord.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/Odbc32.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcCommand.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcCommandBuilder.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnection.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionFactory.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionHandle.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionOpen.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionPoolProviderInfo.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionString.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionStringbuilder.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcDataAdapter.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcDataReader.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcEnvironment.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcEnvironmentHandle.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcError.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcErrorCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcException.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcFactory.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcHandle.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcInfoMessageEvent.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcParameter.cs8
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcParameterCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcPermission.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcReferenceCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcRowUpdatingEvent.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcStatementHandle.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcTransaction.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcUtils.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/odbcmetadatacollectionnames.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/odbcmetadatacolumnnames.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Odbc/odbcmetadatafactory.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/ColumnBinding.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/DBBindings.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/DBPropSet.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OLEDB_Enum.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OLEDB_Util.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbCommand.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbCommandBuilder.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbConnection.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbConnectionFactory.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbConnectionInternal.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbConnectionPoolGroupProviderInfo.cs2
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbDataAdapter.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbDataReader.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbEnumerator.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbError.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbErrorCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbException.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbFactory.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbInfoMessageEvent.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbMetaDataFactory.cs2
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbParameter.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbParameterCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbPermission.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbPropertySetGuid.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbReferenceCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbRowUpdatedEvent.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbRowUpdatingEvent.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbSchemaGuid.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbStruct.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbTransaction.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbWrapper.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/OledbConnectionStringbuilder.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/PropertyIDSet.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/PropertyInfoSet.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/RowBinding.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/SafeHandles.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/oledbconnectionstring.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/oledbmetadatacollectionnames.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OleDb/oledbmetadatacolumnnames.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/OperationAbortedException.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/PrimaryKeyTypeConverter.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/PropertyCollection.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/ProviderBase/DataReaderContainer.cs2
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbBuffer.cs2
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionClosed.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionFactory.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionHelper.cs2
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionInternal.cs8
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPool.cs42
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolCounters.cs2
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolGroup.cs2
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolGroupProviderInfo.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolIdentity.cs2
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolOptions.cs2
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataCollectionNames.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataColumnNames.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataFactory.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbParameterCollectionHelper.cs2
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbParameterHelper.cs2
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbReferenceCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/ProviderBase/SchemaMapping.cs2
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/ProviderBase/TimeoutTimer.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/ProviderBase/WrappedIUnknown.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Range.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/RbTree.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/RecordManager.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/RecordsAffectedEventArgs.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/RelatedView.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/RelationshipConverter.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLBinary.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLBoolean.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLByte.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLBytes.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLChars.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLDateTime.cs30
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLDecimal.cs92
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLDouble.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLFileStream.cs8
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLGuid.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLInt16.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLInt32.cs8
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLInt64.cs8
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLMoney.cs14
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLResource.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLSingle.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLString.cs8
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLUtility.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SQLTypes/SqlCharStream.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SQLTypes/SqlTypesSchemaImporter.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SQLTypes/SqlXml.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SQLTypes/UnsafeNativeMethods.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Select.cs12
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Selection.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SimpleType.cs10
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Sql/SqlDataSourceEnumerator.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Sql/SqlFacetAttribute.cs8
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Sql/SqlFunctionAttribute.cs8
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Sql/SqlGenericUtil.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Sql/SqlMetaData.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Sql/SqlMethodAttribute.cs8
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Sql/SqlNotificationRequest.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Sql/SqlProcedureAttribute.cs8
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Sql/SqlTriggerAttribute.cs8
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Sql/SqlUserDefinedAggregateAttribute.cs10
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Sql/SqlUserDefinedTypeAttribute.cs10
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Sql/invalidudtexception.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Sql/sqlnorm.cs10
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/Sql/sqlser.cs10
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/RowsCopiedEventArgs.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlBuffer.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlBulkCopy.cs20
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlBulkCopyColumnMapping.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlBulkCopyColumnMappingCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlCachedBuffer.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientFactory.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientMetaDataCollectionNames.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientPermission.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientSymmetricKey.cs8
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientWrapperSmiStream.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientWrapperSmiStreamChars.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlColumnEncryptionCngProvider.cs2
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlColumnEncryptionCspProvider.cs2
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlCommand.cs12
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlCommandBuilder.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlCommandSet.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnection.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionFactory.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionPoolGroupProviderInfo.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionPoolKey.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionPoolProviderInfo.cs2
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionString.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionStringBuilder.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionTimeoutErrorInternal.cs2
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlCredential.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDataAdapter.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDataReader.cs14
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDataReaderSmi.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDelegatedTransaction.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDependency.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDependencyListener.cs12
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDependencyUtils.cs16
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlEnums.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlError.cs8
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlErrorCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlException.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlInfoMessageEvent.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlInternalConnection.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlInternalConnectionSmi.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlInternalConnectionTds.cs73
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlNotificationEventArgs.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlParameter.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlParameterCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlReferenceCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlRowUpdatedEvent.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlRowUpdatingEvent.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlSequentialTextReader.cs2
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlStatistics.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlStream.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlTransaction.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlUdtInfo.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlUtil.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsEnums.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParameterSetter.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParser.cs27
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserHelperClasses.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserSafeHandles.cs7
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserSessionPool.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserStateObject.cs16
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserStaticMethods.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsRecordBufferSetter.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsValueSetter.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/assemblycache.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/sqlinternaltransaction.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/SqlClient/sqlmetadatafactory.cs2
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/StateChangeEvent.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/UniqueConstraint.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/XDRSchema.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/XMLDiffLoader.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/XMLSchema.cs10
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/XmlDataLoader.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/XmlKeywords.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/XmlToDatasetMap.cs14
-rw-r--r--mcs/class/referencesource/System.Data/System/Data/xmlsaver.cs10
-rw-r--r--mcs/class/referencesource/System.Data/System/NewXml/BaseTreeIterator.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/NewXml/DataDocumentXPathNavigator.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/NewXml/DataPointer.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/NewXml/DataSetMappper.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/NewXml/RegionIterator.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/NewXml/TreeIterator.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/NewXml/XPathNodePointer.cs6
-rw-r--r--mcs/class/referencesource/System.Data/System/NewXml/XmlBoundElement.cs4
-rw-r--r--mcs/class/referencesource/System.Data/System/NewXml/XmlDataDocument.cs26
-rw-r--r--mcs/class/referencesource/System.Data/System/NewXml/XmlDataImplementation.cs4
-rw-r--r--mcs/class/referencesource/System.Data/bid/inc/cs/bidPrivateBase.cs4
-rw-r--r--mcs/class/referencesource/System.Data/system.data.txt168
-rw-r--r--mcs/class/referencesource/System.IdentityModel.Selectors/infocard/common/managed/InfoCardCryptoHelper.cs2
-rw-r--r--mcs/class/referencesource/System.IdentityModel/System/AppContextDefaultValues.cs5
-rw-r--r--mcs/class/referencesource/System.IdentityModel/System/IdentityModel/Claims/Claim.cs2
-rw-r--r--mcs/class/referencesource/System.IdentityModel/System/IdentityModel/Claims/X509CertificateClaimSet.cs10
-rw-r--r--mcs/class/referencesource/System.IdentityModel/System/IdentityModel/CryptoHelper.cs6
-rw-r--r--mcs/class/referencesource/System.IdentityModel/System/IdentityModel/LocalAppContextSwitches.cs20
-rw-r--r--mcs/class/referencesource/System.IdentityModel/System/IdentityModel/RsaEncryptionCookieTransform.cs125
-rw-r--r--mcs/class/referencesource/System.IdentityModel/System/IdentityModel/RsaSignatureCookieTransform.cs9
-rw-r--r--mcs/class/referencesource/System.IdentityModel/System/IdentityModel/SecurityUtils.cs10
-rw-r--r--mcs/class/referencesource/System.IdentityModel/System/IdentityModel/SspiWrapper.cs14
-rw-r--r--mcs/class/referencesource/System.IdentityModel/System/IdentityModel/Tokens/Saml2SecurityTokenHandler.cs2
-rw-r--r--mcs/class/referencesource/System.IdentityModel/System/IdentityModel/Tokens/SamlSecurityTokenHandler.cs2
-rw-r--r--mcs/class/referencesource/System.IdentityModel/System/IdentityModel/Tokens/X509AsymmetricSecurityKey.cs78
-rw-r--r--mcs/class/referencesource/System.IdentityModel/System/IdentityModel/X509Util.cs33
-rw-r--r--mcs/class/referencesource/System.Net/net/PeerToPeer/Collaboration/ContactManager.cs2
-rw-r--r--mcs/class/referencesource/System.Net/net/PeerToPeer/Collaboration/PeerNearMe.cs6
-rw-r--r--mcs/class/referencesource/System.Net/net/PeerToPeer/PeerName.cs2
-rw-r--r--mcs/class/referencesource/System.Net/net/PeerToPeer/PeerNameResolver.cs8
-rw-r--r--mcs/class/referencesource/System.Numerics/System.Numerics.txt6
-rw-r--r--mcs/class/referencesource/System.Numerics/System/Numerics/Complex.cs8
-rw-r--r--mcs/class/referencesource/System.Runtime.Caching/R.resx183
-rw-r--r--mcs/class/referencesource/System.Runtime.Caching/Resources/R.Designer.cs9
-rw-r--r--mcs/class/referencesource/System.Runtime.Caching/System/Caching/CacheMemoryMonitor.cs3
-rw-r--r--mcs/class/referencesource/System.Runtime.Caching/System/Caching/Configuration/ConfigUtil.cs15
-rw-r--r--mcs/class/referencesource/System.Runtime.Caching/System/Caching/MemoryCache.cs39
-rw-r--r--mcs/class/referencesource/System.Runtime.Caching/System/Caching/MemoryCacheStatistics.cs4
-rw-r--r--mcs/class/referencesource/System.Runtime.DurableInstancing/System/Runtime/DurableInstancing/InstanceHandle.cs2
-rw-r--r--mcs/class/referencesource/System.Runtime.DurableInstancing/System/Runtime/DurableInstancing/InstancePersistenceContext.cs2
-rw-r--r--mcs/class/referencesource/System.Runtime.Serialization/System.Runtime.Serialization.txt35
-rw-r--r--mcs/class/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Configuration/SerializationSectionGroup.cs2
-rw-r--r--mcs/class/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Json/JsonEncodingStreamWrapper.cs2
-rw-r--r--mcs/class/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Json/XmlJsonWriter.cs77
-rw-r--r--mcs/class/referencesource/System.Runtime.Serialization/System/Xml/EncodingStreamWrapper.cs8
-rw-r--r--mcs/class/referencesource/System.Runtime.Serialization/System/Xml/UniqueID.cs2
-rw-r--r--mcs/class/referencesource/System.Runtime.Serialization/System/Xml/ValueHandle.cs2
-rw-r--r--mcs/class/referencesource/System.Runtime.Serialization/System/Xml/XmlBaseReader.cs4
-rw-r--r--mcs/class/referencesource/System.Runtime.Serialization/System/Xml/XmlConverter.cs6
-rw-r--r--mcs/class/referencesource/System.Runtime.Serialization/System/Xml/XmlDictionaryWriter.cs14
-rw-r--r--mcs/class/referencesource/System.Runtime.Serialization/System/Xml/XmlMtomReader.cs8
-rw-r--r--mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/BufferedReceiveManager.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/DurableInstanceManager.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/PersistenceContext.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/PersistenceProviderDirectory.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/WorkflowServiceInstance.cs14
-rw-r--r--mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/InternalSendMessage.cs10
-rw-r--r--mcs/class/referencesource/System.ServiceModel.Channels/System/ServiceModel/Channels/UdpChannelBase.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel.Channels/System/ServiceModel/Channels/UdpOutputChannel.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel.Discovery/System/ServiceModel/Discovery/AnnouncementService.cs12
-rw-r--r--mcs/class/referencesource/System.ServiceModel.Discovery/System/ServiceModel/Discovery/DiscoveryProxy.cs32
-rw-r--r--mcs/class/referencesource/System.ServiceModel.Discovery/System/ServiceModel/Discovery/DiscoveryService.cs20
-rw-r--r--mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/AsyncResult.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/DiagnosticTraceBase.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EtwDiagnosticTrace.cs16
-rw-r--r--mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/MruCache.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/ThreadNeutralSemaphore.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/TraceLevelHelper.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel.Routing/System/ServiceModel/Routing/RoutingService.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Description/WebHttpBehavior.cs20
-rw-r--r--mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Description/WebScriptEnablingBehavior.cs8
-rw-r--r--mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Dispatcher/HttpUnhandledOperationInvoker.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Dispatcher/WebHttpDispatchOperationSelector.cs10
-rw-r--r--mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Web/HttpDateParse.cs8
-rw-r--r--mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Web/WebOperationContext.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/WebHttpBinding.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/Configuration/ServiceModelActivationSectionGroup.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/ListenerUnsafeNativeMethods.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/Utility.cs14
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Administration/ProviderBase.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/AppContextDefaultValues.Default.cs6
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/AddressHeader.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/AddressHeaderCollection.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/BinaryMessageEncoder.cs16
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/BufferedOutputAsyncStream.cs12
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/CompositeDuplexBindingElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/Connection.cs6
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionDemuxer.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionModeReader.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionPool.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ContentOnlyMessage.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/FramingChannels.cs26
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/FramingDecoders.cs38
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpChannelFactory.cs12
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpChannelHelpers.cs12
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpPipeline.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpTransportBindingElement.cs8
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpsChannelFactory.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IdlingCommunicationPool.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InitialServerConnectionReader.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InputChannel.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InternalDuplexBindingElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InternalDuplexChannelListener.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/Message.cs67
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageBuffer.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageEncodingBindingElement.cs8
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageEncodingBindingElementImporter.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageFault.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageHeaders.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OneWayChannelFactory.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OneWayChannelListener.cs18
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OverlappedContext.cs24
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerCustomResolverBindingElement.cs10
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerFlooder.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerNeighborManager.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PipeConnection.cs10
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ReliableChannelBinder.cs6
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ReplyChannel.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/RequestChannel.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/RequestContextBase.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SecurityBindingElementImporter.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ServiceChannelProxy.cs8
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SessionConnectionReader.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SharedConnectionListener.cs22
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SingletonConnectionReader.cs10
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SocketConnection.cs68
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SslStreamSecurityBindingElement.cs8
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SslStreamSecurityUpgradeProvider.cs18
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StandardBindingImporter.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamSecurityUpgradeAcceptorAsyncResult.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamSecurityUpgradeInitiatorAsyncResult.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamedFramingRequestChannel.cs16
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SynchronizedMessageSource.cs6
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportBindingElement.cs6
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportBindingElementImporter.cs6
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportDuplexSessionChannel.cs14
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportManager.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportSecurityHelpers.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/UnsafeNativeMethods.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/UriPrefixTable.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/WindowsStreamSecurityBindingElement.cs8
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/WindowsStreamSecurityUpgradeProvider.cs10
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ClientBase.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/BinaryMessageEncodingElement.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CallbackDebugElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CallbackTimeoutsElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ClientCredentialsElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ClientViaElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CommonEndpointBehaviorElement.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CommonServiceBehaviorElement.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CompositeDuplexElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ConnectionOrientedTransportElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/DataContractSerializerElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/EndpointBehaviorElement.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/HttpTransportElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/HttpsTransportElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IdentityElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IssuedTokenClientElement.cs6
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IssuedTokenServiceElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/MtomMessageEncodingElement.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/NamedPipeTransportElement.cs6
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/OneWayElement.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/PeerTransportElement.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/PrivacyNoticeElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ReliableMessagingVersionConverter.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ReliableSessionElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/RemoveBehaviorElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SecurityElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SecurityElementBase.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceAuthorizationElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceBehaviorElement.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceCredentialsElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceDebugElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceMetadataPublishingElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelConfigurationElementCollection.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelExtensionCollectionElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelSectionGroup.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceSecurityAuditElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceThrottlingElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceTimeoutsElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SslStreamSecurityElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/StandardBindingCollectionElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/StandardEndpointCollectionElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TcpTransportElement.cs8
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TextMessageEncodingElement.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactedBatchingElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactionFlowElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactionProtocolConverter.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransportElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/WindowsStreamSecurityElement.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ClientClassGenerator.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ConfigWriter.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ImportedPolicyConversionContext.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/MessageContractExporter.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/MetadataSection.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/PolicyReader.cs6
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ServiceEndpoint.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/SoapHelper.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/TaskOperationDescriptionValidator.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/TypeLoader.cs14
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/WsdlExporter.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/WsdlImporter.cs6
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/TraceUtility.cs8
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ActionMessageFilterTable.cs8
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/DuplexChannelBinder.cs29
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/EndpointAddressMessageFilter.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/EndpointAddressMessageFilterTable.cs8
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ImmutableDispatchRuntime.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/InputChannelBinder.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/MessageFilterTable.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/OperationInvokerBehavior.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/OutputChannelBinder.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrefixEndpointAddressMessageFilter.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrefixEndpointAddressMessageFilterTable.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrimitiveOperationFormatter.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryFunctions.cs6
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryNode.cs14
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryProcessor.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QuerySelectOp.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QuerySubExprEliminator.cs6
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryUtil.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ReplyChannelBinder.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/SecurityValidationBehavior.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/SeekableMessageNavigator.cs14
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/StreamFormatter.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/XPathMessageContext.cs6
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/EndpointAddress.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/FaultReason.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/LocalAppContextSwitches.cs11
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/OperationContext.cs18
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/OperationContextScope.cs43
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/CryptoHelper.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecuritySessionSecurityTokenProvider.cs4
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecurityUtils.cs8
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/TlsnegoTokenAuthenticator.cs11
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/TlsnegoTokenProvider.cs11
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSSecurityPolicy.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSTrustServiceContract.cs2
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelAppSettings.cs17
-rw-r--r--mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Syndication/Rss20FeedFormatter.cs12
-rw-r--r--mcs/class/referencesource/System.Web.ApplicationServices/ApplicationServicesStrings.resx183
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/AnnotationBase.cs4437
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/AnnotationCollection.cs844
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/ArrowAnnotation.cs471
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/CalloutAnnotation.cs1901
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/GroupAnnotation.cs995
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/ImageAnnotation.cs730
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/LineAnnotation.cs910
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/PolygonAnnotation.cs1739
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/RectangleAnnotation.cs722
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/TextAnnotation.cs1263
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Borders3D/Borders3D.cs784
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Borders3D/EmbedBorder.cs1102
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Borders3D/EmbossBorder.cs268
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/AreaChart.cs1647
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/BarChart.cs2351
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/BoxPlotChart.cs1856
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/BubbleChart.cs497
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/ChartTypeRegistry.cs453
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/ColumnChart.cs1414
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/DoughnutChart.cs143
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/ErrorBarChart.cs1887
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/FastLineChart.cs738
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/FastPointChart.cs700
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/FunnelChart.cs3044
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/KagiChart.cs996
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/LineChart.cs2472
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/PieChart.cs5703
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/PointAndFigureChart.cs913
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/PointChart.cs1822
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/PolarChart.cs271
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/RadarChart.cs1685
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/RangeChart.cs1820
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/RenkoChart.cs722
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/StackedAreaChart.cs1695
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/StackedBarChart.cs2156
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/StackedColumnChart.cs2023
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/StepLineChart.cs409
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/StockChart.cs1957
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/ThreeLineBreakChart.cs716
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/AnnotationConverters.cs136
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/AxesArrayConverter.cs94
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/AxisConverters.cs691
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/CustomAttributesConverters.cs985
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/DataManagerConverters.cs899
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/ElementPositionConverter.cs140
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/LegendConverters.cs502
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/DataManager/DataManager.cs1183
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/DataManager/DataPoint.cs7044
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/DataManager/DataSeries.cs2694
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/EditorNames.cs263
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/FormulaHelpers.cs1636
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/FormulaRegistry.cs201
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/GeneralFormulas.cs193
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/Oscillator.cs686
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/PriceIndicators.cs1174
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/StatisticalAnalysis.cs2189
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/TechGeneralIndicators.cs876
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/TimeSeriesAndForecasting.cs647
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/VolumeIndicator.cs527
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/Axis.cs6508
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/AxisLabels.cs941
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/AxisScale.cs2369
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/AxisScaleBreaks.cs1108
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/AxisScaleSegments.cs1014
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/AxisScrollBar.cs1952
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/AxisScrollZoom.cs1770
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/BaseClasses.cs403
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/BaseCollections.cs619
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/BaseInterfaces.cs80
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/Chart.cs4361
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartArea.cs3157
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartArea3D.cs2239
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartAreaAxes.cs1986
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartAreaCircular.cs109
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartAreaCollection.cs107
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartAreaCursor.cs1682
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartElement.cs1458
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartGraphics.cs5779
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartGraphics3D.cs4735
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartRenderingEngine.cs853
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartSerializer.cs789
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/CommonElements.cs327
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/Constants.cs28
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/DataManipulator.cs3495
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/FormulaData.cs1312
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/GdiGraphics.cs732
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/GridTickMarks.cs2046
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/IChartRenderingEngine.cs536
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/ImageMap.cs891
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/Label.cs3002
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/Legend.cs6284
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/LegendColumns.cs2909
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/Matrix3D.cs1222
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/NamedImageCollection.cs175
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/Selection.cs3495
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/SmartLabels.cs1710
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/Statistics.cs1671
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/StripLine.cs1616
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/SubAxis.cs823
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/General/Title.cs2237
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/SR.cs12528
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/SRCategoryAttribute.cs26
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/SRDescriptionAttribute.cs41
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/ColorPalette.cs396
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/CustomAttributesRegistry.cs1974
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/ElementPosition.cs535
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/ImageLoader.cs421
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/KeywordsRegistry.cs495
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/ValueConverter.cs194
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/XmlSerializer.cs3274
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/WebForm/AssemblyInfo.cs27
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/WebForm/ChartWebControl.cs3408
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/WebForm/Converters/MapAreaCoordinatesConverter.cs103
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/WebForm/FxCopExclusionsByDesign.cs553
-rw-r--r--mcs/class/referencesource/System.Web.DataVisualization/WebForm/General/ChartHttpHandler.cs2158
-rw-r--r--mcs/class/referencesource/System.Web.DynamicData/DynamicData/DynamicDataExtensions.cs2
-rw-r--r--mcs/class/referencesource/System.Web.DynamicData/DynamicData/DynamicDataManager.cs2
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityConnectionStringBuilderItem.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceConfigureObjectContext.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceConfigureObjectContextPanel.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceConfigureObjectContextPanel.designer.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceContainerNameConverter.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceContainerNameItem.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDataSelection.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDataSelectionPanel.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDataSelectionPanel.designer.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDesigner.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDesignerHelper.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceEntitySetNameConverter.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceEntitySetNameItem.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceEntityTypeFilterConverter.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceEntityTypeFilterItem.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceState.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceStatementEditor.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceStatementEditorForm.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceWizardForm.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDesignerDataSourceView.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/DesignerForm.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/RTLAwareMessageBox.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/ResourceDescriptionAttribute.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/TaskFormBase.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/UIHelper.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/WizardForm.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/WizardPanel.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/WizardPanelChangingEventArgs.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSource.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceChangedEventArgs.cs2
-rw-r--r--mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceChangingEventArgs.cs2
-rw-r--r--mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceColumn.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceContextCreatedEventArgs.cs2
-rw-r--r--mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceContextCreatingEventArgs.cs2
-rw-r--r--mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceContextDisposingEventArgs.cs2
-rw-r--r--mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceMemberPath.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceQueryBuilder.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceReferenceGroup.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceSelectedEventArgs.cs2
-rw-r--r--mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceSelectingEventArgs.cs2
-rw-r--r--mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceUtil.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceValidationException.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceView.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceViewSchema.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceWrapper.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceWrapperCollection.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceWrapperPropertyDescriptor.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/ResourceDescriptionAttribute.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/ResourceDisplayNameAttribute.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/WebControlParameterProxy.cs2
-rw-r--r--mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/Design/AppliedDeviceFiltersDialog.cs2
-rw-r--r--mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/Design/Util/GenericUI.cs2
-rw-r--r--mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/Design/Util/MSHTMLHost.cs6
-rw-r--r--mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/MobilePage.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/ObjectList.cs2
-rw-r--r--mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/SessionViewState.cs2
-rw-r--r--mcs/class/referencesource/System.Web.Services/System.Web.Services.txt477
-rw-r--r--mcs/class/referencesource/System.Web.Services/System/Web/Services/Description/SoapProtocolImporter.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Services/System/Web/Services/Discovery/DiscoveryDocument.cs2
-rw-r--r--mcs/class/referencesource/System.Web.Services/System/Web/Services/Discovery/DiscoveryDocumentReference.cs2
-rw-r--r--mcs/class/referencesource/System.Web.Services/System/Web/Services/Discovery/DynamicVirtualDiscoSearcher.cs2
-rw-r--r--mcs/class/referencesource/System.Web.Services/System/Web/Services/Protocols/ClientProtocol.cs2
-rw-r--r--mcs/class/referencesource/System.Web.Services/System/Web/Services/Protocols/LogicalMethodInfo.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Services/System/Web/Services/Protocols/Scalars.cs4
-rw-r--r--mcs/class/referencesource/System.Web.Services/System/Web/Services/Protocols/SoapException.cs2
-rw-r--r--mcs/class/referencesource/System.Web/AspNetEventSource.cs6
-rw-r--r--mcs/class/referencesource/System.Web/Cache/CacheDependency.cs173
-rw-r--r--mcs/class/referencesource/System.Web/Cache/CacheEntry.cs38
-rw-r--r--mcs/class/referencesource/System.Web/Cache/OutputCache.cs84
-rw-r--r--mcs/class/referencesource/System.Web/Cache/SqlCacheDependency.cs25
-rw-r--r--mcs/class/referencesource/System.Web/Cache/cache.cs1744
-rw-r--r--mcs/class/referencesource/System.Web/CachedPathData.cs23
-rw-r--r--mcs/class/referencesource/System.Web/Compilation/BuildManager.cs6
-rw-r--r--mcs/class/referencesource/System.Web/Compilation/BuildResultCache.cs37
-rw-r--r--mcs/class/referencesource/System.Web/Compilation/CompilationLock.cs2
-rw-r--r--mcs/class/referencesource/System.Web/Compilation/ResourceExpressionBuilder.cs12
-rw-r--r--mcs/class/referencesource/System.Web/Configuration/CacheSection.cs39
-rw-r--r--mcs/class/referencesource/System.Web/Configuration/HandlerFactoryCache.cs3
-rw-r--r--mcs/class/referencesource/System.Web/Configuration/HttpCapabilitiesEvaluator.cs12
-rw-r--r--mcs/class/referencesource/System.Web/Configuration/MetabaseServerConfig.cs5
-rw-r--r--mcs/class/referencesource/System.Web/Configuration/ProcessHostMapPath.cs5
-rw-r--r--mcs/class/referencesource/System.Web/Configuration/ProvidersHelper.cs37
-rw-r--r--mcs/class/referencesource/System.Web/Configuration/SessionStateSection.cs2
-rw-r--r--mcs/class/referencesource/System.Web/FileChangesMonitor.cs6
-rw-r--r--mcs/class/referencesource/System.Web/Hosting/ApplicationManager.cs85
-rw-r--r--mcs/class/referencesource/System.Web/Hosting/HostingEnvironment.cs78
-rw-r--r--mcs/class/referencesource/System.Web/Hosting/IIS7WorkerRequest.cs2
-rw-r--r--mcs/class/referencesource/System.Web/Hosting/ISAPIWorkerRequest.cs4
-rw-r--r--mcs/class/referencesource/System.Web/Hosting/MapPathBasedVirtualPathProvider.cs4
-rw-r--r--mcs/class/referencesource/System.Web/Hosting/ObjectCacheHost.cs18
-rw-r--r--mcs/class/referencesource/System.Web/Hosting/SuspendManager.cs10
-rw-r--r--mcs/class/referencesource/System.Web/HttpApplication.cs16
-rw-r--r--mcs/class/referencesource/System.Web/HttpBufferlessInputStream.cs2
-rw-r--r--mcs/class/referencesource/System.Web/HttpCachePolicy.cs6
-rw-r--r--mcs/class/referencesource/System.Web/HttpContext.cs4
-rw-r--r--mcs/class/referencesource/System.Web/HttpCookie.cs2
-rw-r--r--mcs/class/referencesource/System.Web/HttpCookieCollection.cs15
-rw-r--r--mcs/class/referencesource/System.Web/HttpRequest.cs7
-rw-r--r--mcs/class/referencesource/System.Web/HttpResponse.cs16
-rw-r--r--mcs/class/referencesource/System.Web/HttpRuntime.cs63
-rw-r--r--mcs/class/referencesource/System.Web/InternalApis/NDP_Common/inc/StrongNameHelpers.cs40
-rw-r--r--mcs/class/referencesource/System.Web/LegacyAspNetSynchronizationContext.cs4
-rw-r--r--mcs/class/referencesource/System.Web/Management/WebEvents.cs10
-rw-r--r--mcs/class/referencesource/System.Web/PipelineModuleStepContainer.cs2
-rw-r--r--mcs/class/referencesource/System.Web/Routing/Route.cs2
-rw-r--r--mcs/class/referencesource/System.Web/Routing/RouteCollection.cs6
-rw-r--r--mcs/class/referencesource/System.Web/Security/ADMembershipProvider.cs38
-rw-r--r--mcs/class/referencesource/System.Web/Security/Cryptography/CryptoAlgorithms.cs2
-rw-r--r--mcs/class/referencesource/System.Web/Security/FileAuthorizationModule.cs11
-rw-r--r--mcs/class/referencesource/System.Web/Security/Membership.cs20
-rw-r--r--mcs/class/referencesource/System.Web/Security/RoleClaimProvider.cs2
-rw-r--r--mcs/class/referencesource/System.Web/State/InProcStateClientManager.cs28
-rw-r--r--mcs/class/referencesource/System.Web/State/SessionStateModule.cs61
-rw-r--r--mcs/class/referencesource/System.Web/State/StateRuntime.cs36
-rw-r--r--mcs/class/referencesource/System.Web/State/StateWorkerRequest.cs2
-rw-r--r--mcs/class/referencesource/System.Web/System.Web.txt24
-rw-r--r--mcs/class/referencesource/System.Web/ThreadContext.cs6
-rw-r--r--mcs/class/referencesource/System.Web/UI/DataSourceCache.cs10
-rw-r--r--mcs/class/referencesource/System.Web/UI/HTMLTextWriter.cs2
-rw-r--r--mcs/class/referencesource/System.Web/UI/ObjectStateFormatter.cs4
-rw-r--r--mcs/class/referencesource/System.Web/UI/Page.cs4
-rw-r--r--mcs/class/referencesource/System.Web/UI/WebControls/AdRotator.cs6
-rw-r--r--mcs/class/referencesource/System.Web/UI/WebControls/ChangePassword.cs12
-rw-r--r--mcs/class/referencesource/System.Web/UI/WebControls/DetailsView.cs2
-rw-r--r--mcs/class/referencesource/System.Web/UI/WebControls/PasswordRecovery.cs4
-rw-r--r--mcs/class/referencesource/System.Web/UI/WebControls/Wizard.cs4
-rw-r--r--mcs/class/referencesource/System.Web/UI/WebControls/xml.cs13
-rw-r--r--mcs/class/referencesource/System.Web/UI/WebParts/CatalogZoneBase.cs2
-rw-r--r--mcs/class/referencesource/System.Web/UI/WebParts/EditorPart.cs2
-rw-r--r--mcs/class/referencesource/System.Web/UI/WebParts/EditorZoneBase.cs2
-rw-r--r--mcs/class/referencesource/System.Web/UI/WebParts/WebPartManager.cs2
-rw-r--r--mcs/class/referencesource/System.Web/UI/WebParts/WebPartZoneBase.cs4
-rw-r--r--mcs/class/referencesource/System.Web/UnsafeNativeMethods.cs2
-rw-r--r--mcs/class/referencesource/System.Web/Util/AppSettings.cs14
-rw-r--r--mcs/class/referencesource/System.Web/Util/AppVerifier.cs2
-rw-r--r--mcs/class/referencesource/System.Web/Util/AspCompat.cs4
-rw-r--r--mcs/class/referencesource/System.Web/Util/BinaryCompatibility.cs10
-rw-r--r--mcs/class/referencesource/System.Web/Util/DateTimeUtil.cs30
-rw-r--r--mcs/class/referencesource/System.Web/Util/ParseHttpDate.cs2
-rw-r--r--mcs/class/referencesource/System.Web/Util/SecUtil.cs13
-rw-r--r--mcs/class/referencesource/System.Web/Util/VersionUtil.cs1
-rw-r--r--mcs/class/referencesource/System.Web/cacheexpires.cspp1328
-rw-r--r--mcs/class/referencesource/System.Web/cacheusage.cspp1537
-rw-r--r--mcs/class/referencesource/System.Web/httpserverutility.cs2
-rw-r--r--mcs/class/referencesource/System.Web/misc/SecurityUtils.cs6
-rw-r--r--mcs/class/referencesource/System.Workflow.Activities/Common/BasePropertyDescriptor.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.Activities/Common/CompModHelpers.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.Activities/Common/CompilerHelpers.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.Activities/Common/DelegateTypeInfo.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.Activities/Common/NativeMethods.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.Activities/Common/TypeSystemHelpers.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.Activities/Common/ValidationHelpers.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.Activities/Common/Walker.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.Activities/Common/userdatakeys.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.Activities/LocalService/FollowerQueueCreator.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Compiler/TypeSystem/DesignTimeType.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/CommandSet.cs4
-rw-r--r--mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/Dialogs/ThemeConfigurationDialog.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/Dialogs/WorkflowPageSetupDialog.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/MenuCommands.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/ReferenceService.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/StructuredCompositeActivityDesigner.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/WorkflowView.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.ComponentModel/Shared/BasePropertyDescriptor.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.ComponentModel/Shared/CompModHelpers.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.ComponentModel/Shared/CompilerHelpers.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.ComponentModel/Shared/DelegateTypeInfo.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.ComponentModel/Shared/NativeMethods.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.ComponentModel/Shared/TypeSystemHelpers.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.ComponentModel/Shared/ValidationHelpers.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.ComponentModel/Shared/Walker.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.ComponentModel/Shared/userdatakeys.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.Runtime/ExecutorLocksHeldException.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.Runtime/Hosting/WorkflowWebHostingModule.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.Runtime/System/Activities/Statements/Interop.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.Runtime/WorkflowEventArgs.cs2
-rw-r--r--mcs/class/referencesource/System.Workflow.Runtime/WorkflowExecutor.cs14
-rw-r--r--mcs/class/referencesource/System.WorkflowServices/System/ServiceModel/WorkflowServiceHost.cs2
-rw-r--r--mcs/class/referencesource/System.WorkflowServices/System/Workflow/Activities/Design/OperationPickerDialog.cs2
-rw-r--r--mcs/class/referencesource/System.WorkflowServices/System/Workflow/Runtime/Hosting/SynchronizationContextWorkflowSchedulerService.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/InternalApis/NDP_Common/inc/Win8Helpers.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Base64Decoder.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Base64Encoder.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/BinHexDecoder.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/BinHexEncoder.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/BinaryXml/SqlUtils.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/BinaryXml/XmlBinaryReader.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/BinaryXml/XmlBinaryReaderAsync.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/BitStack.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Bits.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/ByteStack.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathDocumentBuilder.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathDocumentIterator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathDocumentNavigator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathNode.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathNodeHelper.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathNodeInfoAtom.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/CharEntityEncoderFallback.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/HtmlEncodedRawTextWriter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/HtmlTernaryTree.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/HtmlUtf8RawTextWriter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/IncrementalReadDecoders.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/QueryOutputWriter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/QueryOutputWriterV1.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/ReadContentAsBinaryHelper.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/ReadOnlyTernaryTree.cs4
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/SecureStringHasher.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/TextEncodedRawTextWriter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/TextUtf8RawTextWriter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/ValidatingReaderNodeData.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlAsyncCheckReader.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlAsyncCheckWriter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlAutoDetectWriter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlCharCheckingReader.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlCharCheckingWriter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlEncodedRawTextWriter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlEventCache.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlParserContext.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlRawWriter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlReader.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlReaderSettings.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlSubtreeReader.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlTextEncoder.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlTextReader.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlTextReaderImpl.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlTextReaderImplHelpers.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlTextWriter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlUtf8RawTextWriter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlValidatingReader.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlValidatingReaderImpl.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWellFormedWriter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWellFormedWriterHelpers.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWrappingReader.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWrappingWriter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWriter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWriterAsync.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWriterSettings.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XsdCachingReader.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Core/XsdValidatingReader.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/DiagnosticsSwitches.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/DocumentSchemaValidator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/DocumentXPathNavigator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/DocumentXmlWriter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/DomNameTable.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XPathNodeList.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlAttributeCollection.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlCDataSection.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlCharacterData.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlChildEnumerator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlChildNodes.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlComment.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlDeclaration.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlDocument.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlDocumentFragment.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlDocumentType.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlDomTextWriter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlElement.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlElementList.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlEntity.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlEntityReference.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlImplementation.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlLinkedNode.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlLoader.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlName.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNamedNodemap.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNode.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNodeChangedEventArgs.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNodeList.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNodeReader.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNotation.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlProcessingInstruction.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlSignificantWhiteSpace.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlText.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlUnspecifiedAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlWhitespace.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/EmptyEnumerator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/HWStack.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/IXmlLineInfo.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/LineInfo.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/NameTable.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Ref.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Resolvers/XmlPreloadedResolver.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Resolvers/XmlPreloadedResolverAsync.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/Asttree.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/AutoValidator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/BaseProcessor.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/BaseValidator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/BitSet.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/Chameleonkey.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/CompiledidEntityConstraint.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/ConstraintStruct.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/ContentValidator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/DataTypeImplementation.cs4
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/DtdParser.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/DtdValidator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/FacetChecker.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/Inference/Infer.cs4
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/Inference/XmlSchemaInferenceException.cs4
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/NamespaceList.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/Parser.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/Preprocessor.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaAttDef.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaCollectionCompiler.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaCollectionpreProcessor.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaDeclBase.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaElementDecl.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaEntity.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaInfo.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaNames.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaNamespacemanager.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaNotation.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaSetCompiler.cs6
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/ValidationEventArgs.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/ValidationState.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XdrBuilder.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XdrValidator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlAtomicValue.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchema.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAll.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAnnotated.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAnnotation.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAny.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAnyAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAppInfo.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAttributeGroup.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAttributeGroupref.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaChoice.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaCollection.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaCompilationSettings.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaComplexContent.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaComplexContentExtension.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaComplexContentRestriction.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaComplexType.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaDataType.cs4
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaDocumentation.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaElement.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaException.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaExternal.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaFacet.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaGroup.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaGroupRef.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaIdEntityConstraint.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaImport.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaInclude.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaInfo.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaNotation.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaObject.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaObjectCollection.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaObjectTable.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaParticle.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaRedefine.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSequence.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSet.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleContent.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleContentExtension.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleContentRestriction.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleType.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleTypeList.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleTypeRestriction.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleTypeUnion.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSubstitutionGroup.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaType.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaValidationException.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaValidator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlValueConverter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XsdBuilder.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XsdDateTime.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XsdDuration.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Schema/XsdValidator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/Advanced/SchemaImporterExtension.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/CodeExporter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/CodeGenerator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/CodeIdentifier.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/CodeIdentifiers.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/Compilation.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/Compiler.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/ConfigurationStrings.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/DateTimeSerializationSection.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/SchemaImporterExtensionElement.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/SchemaImporterExtensionElementCollection.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/SchemaImporterExtensionsSection.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/SerializationSectionGroup.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/ImportContext.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/Mappings.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/Models.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/NameTable.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/PrimitiveXmlSerializers.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/SchemaImporter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/SchemaObjectWriter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapAttributeAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapAttributeOverrides.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapAttributes.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapCodeExporter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapElementAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapEnumAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapIgnoreAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapIncludeAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapReflectionImporter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapSchemaExporter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapSchemaImporter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapSchemamember.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapTypeAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/SourceInfo.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/Types.cs4
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAnyAttributeAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAnyElementAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAnyElementAttributes.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlArrayAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlArrayItemAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlArrayItemAttributes.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAttributeAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAttributeOverrides.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAttributes.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlChoiceIdentifierAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlCodeExporter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlElementAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlElementAttributes.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlEnumAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlIgnoreAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlIncludeAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlMapping.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlMemberMapping.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlMembersMapping.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlNamespaceDeclarationsAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlReflectionImporter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlReflectionMember.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlRootAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSchemaExporter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSchemaImporter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSchemaProviderAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSchemas.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationGeneratedCode.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationILGen.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationReader.cs4
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationReaderILGen.cs4
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationWriter.cs4
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationWriterILGen.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializer.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializerAssemblyAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializerFactory.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializerNamespaces.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializerVersionAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlTextAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlTypeAttribute.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlTypeMapping.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/Xmlcustomformatter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/_Events.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Serialization/indentedWriter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/ValidateNames.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/AbsoluteQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/AttributeQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Axis.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/BaseAxisQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/BooleanExpr.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/BooleanFunctions.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/CacheAxisQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/CacheChildrenQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/CacheOutputQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ChildrenQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ClonableStack.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/CompiledXPathExpr.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ContextQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/DescendantBaseQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/DescendantQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/DescendantoverDescendantQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/DocumentorderQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/EmptyQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ExtensionQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Filter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/FilterQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/FollowingQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/FollowingSibling.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ForwardPositionQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Function.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/FunctionQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Group.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/GroupQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/IdQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/IteratorFilter.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/LogicalExpr.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/MergeFilterQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/NamespaceQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/NodeFunctions.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/NumberFunctions.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/NumericExpr.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Operand.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/OperandQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Operator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ParentQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/PrecedingQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/PrecedingSibling.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Query.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/QueryBuilder.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ResetableIterator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ReversePositionQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Root.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/SortQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/StringFunctions.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/UnionExpr.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ValueQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Variable.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/VariableQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathAncestorIterator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathAncestorQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathArrayIterator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathAxisIterator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathChildIterator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathDescendantIterator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathEmptyIterator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathMultyIterator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathParser.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathScanner.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathSelectionIterator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathSelfQuery.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathSingletonIterator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathDocument.cs4
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathException.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathExpr.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathItem.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathNavigator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathNavigatorKeyComparer.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathNavigatorReader.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathNodeIterator.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XmlCharType.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XmlComplianceUtil.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XmlConvert.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XmlDownloadManager.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XmlEncoding.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XmlException.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XmlNamespacemanager.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XmlNullResolver.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XmlQualifiedName.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XmlResolver.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XmlSecureResolver.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/XmlUrlResolver.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Xslt/XslCompiledTransform.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Xslt/XslTransform.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Xslt/XsltArgumentList.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Xslt/XsltContext.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Xslt/XsltException.cs2
-rw-r--r--mcs/class/referencesource/System.Xml/System/Xml/Xslt/XsltSettings.cs2
-rw-r--r--mcs/class/referencesource/System/System.txt23
-rw-r--r--mcs/class/referencesource/System/compmod/microsoft/win32/UnsafeNativeMethods.cs6
-rw-r--r--mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeEventLogReadHandle.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeEventLogWriteHandle.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeFileMapViewHandle.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeFileMappingHandle.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeLibraryHandle.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeLocalMemHandle.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeTimerHandle.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeUserTokenHandle.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeArgumentReferenceExpression.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeArrayCreateExpression.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeArrayIndexerExpression.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeAssignStatement.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeAttachEventStatement.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeAttributeArgument.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeAttributeArgumentCollection.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeAttributeDeclaration.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeAttributeDeclarationCollection.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeBinaryOperatorExpression.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeCastExpression.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeCatchClause.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeCatchClauseCollection.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeChecksumPragma.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeComment.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeCommentStatement.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeCommentStatementCollection.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeCompileUnit.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeConditionStatement.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeConstructor.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeDefaultValueExpression.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeDelegateCreateExpression.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeDelegateInvokeExpression.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeDirectionExpression.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeDirectiveCollection.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeEntryPointMethod.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeEventReferenceExpression.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeExpressionCollection.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeExpressionStatement.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeFieldReferenceExpression.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeGotoStatement.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeIndexerExpression.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeIterationStatement.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeLabeledStatement.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeLinePragma.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeMemberEvent.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeMemberField.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeMemberMethod.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeMemberProperty.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeMethodInvokeExpression.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeMethodReturnStatement.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeNamespace.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeNamespaceCollection.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeNamespaceImport.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeNamespaceImportCollection.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeObject.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeObjectCreateExpression.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeParameterDeclarationExpression.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeParameterDeclarationExpressionCollection.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodePrimitiveExpression.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodePropertyReferenceExpression.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeRegionDirective.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeRemoveEventStatement.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeSnippetCompileUnit.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeSnippetExpression.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeSnippetStatement.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeSnippetTypeMember.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeStatement.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeStatementCollection.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeThrowExceptionStatement.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeTryCatchFinallyStatement.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeTypeConstructor.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeTypeDeclaration.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeTypeDeclarationCollection.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeTypeDelegate.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeTypeMember.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeTypeMemberCollection.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeTypeOfExpression.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeTypeParameter.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeTypeParameterCollection.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeTypeReference.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeTypeReferenceCollection.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeTypeReferenceExpression.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeVariableDeclarationStatement.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/CodeVariableReferenceExpression.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/codemethodreferenceexpression.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeCompiler.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeDOMProvider.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeDomConfigurationHandler.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeGenerator.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeGeneratorOptions.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeValidator.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/compiler/CompilerError.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/compiler/CompilerErrorCollection.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/compiler/CompilerInfo.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/compiler/CompilerParameters.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/compiler/CompilerResults.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/compiler/Executor.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/compiler/GeneratedCodeAttribute.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/compiler/IndentTextWriter.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/compiler/RedistVersionInfo.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/codedom/compiler/TempFiles.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/collections/generic/stack.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/collections/objectmodel/observablecollection.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/collections/specialized/marshalinghelpers.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/componentmodel/AsyncOperation.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/componentmodel/MemberDescriptor.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/componentmodel/PropertyDescriptor.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/componentmodel/design/DesignerVerb.cs2
-rw-r--r--mcs/class/referencesource/System/compmod/system/diagnostics/assertwrapper.cs8
-rw-r--r--mcs/class/referencesource/System/misc/ClientUtils.cs6
-rw-r--r--mcs/class/referencesource/System/misc/SecurityUtils.cs6
-rw-r--r--mcs/class/referencesource/System/misc/externdll.cs1
-rw-r--r--mcs/class/referencesource/System/net/System/Net/Cache/HttpRequestCacheValidator.cs2
-rw-r--r--mcs/class/referencesource/System/net/System/Net/Cache/IERequestCache.cs2
-rw-r--r--mcs/class/referencesource/System/net/System/Net/Cache/RequestCachePolicy.cs4
-rw-r--r--mcs/class/referencesource/System/net/System/Net/Configuration/DefaultProxySection.cs2
-rw-r--r--mcs/class/referencesource/System/net/System/Net/Configuration/TimeoutValidationAttribute.cs4
-rw-r--r--mcs/class/referencesource/System/net/System/Net/FtpWebRequest.cs10
-rw-r--r--mcs/class/referencesource/System/net/System/Net/HttpListenerRequest.cs131
-rw-r--r--mcs/class/referencesource/System/net/System/Net/HttpWebRequest.cs34
-rw-r--r--mcs/class/referencesource/System/net/System/Net/Internal.cs2
-rw-r--r--mcs/class/referencesource/System/net/System/Net/SecureProtocols/NegotiateStream.cs10
-rw-r--r--mcs/class/referencesource/System/net/System/Net/SecureProtocols/SslEnumTypes.cs8
-rw-r--r--mcs/class/referencesource/System/net/System/Net/SecureProtocols/SslStream.cs83
-rw-r--r--mcs/class/referencesource/System/net/System/Net/SecureProtocols/_FixedSizeReader.cs4
-rw-r--r--mcs/class/referencesource/System/net/System/Net/SecureProtocols/_NegoStream.cs12
-rw-r--r--mcs/class/referencesource/System/net/System/Net/SecureProtocols/_SslState.cs67
-rw-r--r--mcs/class/referencesource/System/net/System/Net/SecureProtocols/_SslStream.cs17
-rw-r--r--mcs/class/referencesource/System/net/System/Net/ServicePoint.cs2
-rw-r--r--mcs/class/referencesource/System/net/System/Net/ServicePointManager.cs427
-rw-r--r--mcs/class/referencesource/System/net/System/Net/Sockets/NetworkStream.cs14
-rw-r--r--mcs/class/referencesource/System/net/System/Net/Sockets/Socket.cs12
-rw-r--r--mcs/class/referencesource/System/net/System/Net/UnsafeNativeMethods.cs116
-rw-r--r--mcs/class/referencesource/System/net/System/Net/WebRequest.cs2
-rw-r--r--mcs/class/referencesource/System/net/System/Net/WebSockets/WebSocketHttpListenerDuplexStream.cs12
-rw-r--r--mcs/class/referencesource/System/net/System/Net/WebUtility.cs4
-rw-r--r--mcs/class/referencesource/System/net/System/Net/_AuthenticationState.cs2
-rw-r--r--mcs/class/referencesource/System/net/System/Net/_ChunkParser.cs2
-rw-r--r--mcs/class/referencesource/System/net/System/Net/_CommandStream.cs8
-rw-r--r--mcs/class/referencesource/System/net/System/Net/_ConnectStream.cs18
-rw-r--r--mcs/class/referencesource/System/net/System/Net/_Connection.cs20
-rw-r--r--mcs/class/referencesource/System/net/System/Net/_ContextAwareResult.cs2
-rw-r--r--mcs/class/referencesource/System/net/System/Net/_DigestClient.cs2
-rw-r--r--mcs/class/referencesource/System/net/System/Net/_HTTPDateParse.cs4
-rw-r--r--mcs/class/referencesource/System/net/System/Net/_LazyAsyncResult.cs2
-rw-r--r--mcs/class/referencesource/System/net/System/Net/_ListenerResponseStream.cs2
-rw-r--r--mcs/class/referencesource/System/net/System/Net/_NativeSSPI.cs11
-rw-r--r--mcs/class/referencesource/System/net/System/Net/_SSPIWrapper.cs58
-rw-r--r--mcs/class/referencesource/System/net/System/Net/_SafeNetHandles.cs121
-rw-r--r--mcs/class/referencesource/System/net/System/Net/_SecureChannel.cs193
-rw-r--r--mcs/class/referencesource/System/net/System/Net/_TLSstream.cs14
-rw-r--r--mcs/class/referencesource/System/net/System/Net/_TimerThread.cs2
-rw-r--r--mcs/class/referencesource/System/net/System/Net/mail/MailHeaderInfo.cs6
-rw-r--r--mcs/class/referencesource/System/net/System/Net/mail/SmtpClient.cs2
-rw-r--r--mcs/class/referencesource/System/net/System/Net/mail/SmtpTransport.cs2
-rw-r--r--mcs/class/referencesource/System/net/System/Net/mail/smtpconnection.cs4
-rw-r--r--mcs/class/referencesource/System/net/System/URI.cs30
-rw-r--r--mcs/class/referencesource/System/regex/system/text/regularexpressions/Regex.cs10
-rw-r--r--mcs/class/referencesource/System/regex/system/text/regularexpressions/RegexCompiler.cs4
-rw-r--r--mcs/class/referencesource/System/regex/system/text/regularexpressions/RegexGroup.cs21
-rw-r--r--mcs/class/referencesource/System/regex/system/text/regularexpressions/RegexGroupCollection.cs3
-rw-r--r--mcs/class/referencesource/System/regex/system/text/regularexpressions/RegexMatch.cs2
-rw-r--r--mcs/class/referencesource/System/services/monitoring/system/diagnosticts/EventLog.cs12
-rw-r--r--mcs/class/referencesource/System/services/monitoring/system/diagnosticts/EventLogEntry.cs2
-rw-r--r--mcs/class/referencesource/System/services/monitoring/system/diagnosticts/EventLogEntryCollection.cs2
-rw-r--r--mcs/class/referencesource/System/services/monitoring/system/diagnosticts/EventLogInternal.cs22
-rw-r--r--mcs/class/referencesource/System/services/monitoring/system/diagnosticts/ProcessManager.cs2
-rw-r--r--mcs/class/referencesource/System/services/monitoring/system/diagnosticts/SharedUtils.cs2
-rw-r--r--mcs/class/referencesource/System/services/timers/system/timers/Timer.cs2
-rw-r--r--mcs/class/referencesource/System/sys/AppContextDefaultValues.Defaults.cs11
-rw-r--r--mcs/class/referencesource/System/sys/LocalAppContextSwitches.cs25
-rw-r--r--mcs/class/referencesource/System/sys/system/IO/ports/SerialStream.cs10
-rw-r--r--mcs/class/referencesource/System/sys/system/Media/SoundPlayer.cs2
-rw-r--r--mcs/class/referencesource/System/sys/system/collections/concurrent/BlockingCollection.cs2
-rw-r--r--mcs/class/referencesource/System/sys/system/collections/concurrent/ConcurrentBag.cs2
-rw-r--r--mcs/class/referencesource/System/sys/system/threading/Barrier.cs2
-rw-r--r--mcs/class/referencesource/System/sys/system/windows/markup/ValueSerializerAttribute.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/InternalApis/NDP_Common/inc/StrongNameHelpers.cs40
-rw-r--r--mcs/class/referencesource/mscorlib/microsoft/win32/oavariantlib.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/microsoft/win32/safehandles/saferegistryhandle.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/mscorlib.txt682
-rw-r--r--mcs/class/referencesource/mscorlib/system/AggregateException.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/AppContext/AppContext.cs87
-rw-r--r--mcs/class/referencesource/mscorlib/system/AppContext/AppContextDefaultValues.Defaults.cs10
-rw-r--r--mcs/class/referencesource/mscorlib/system/AppContext/AppContextDefaultValues.DesktopOverrides.cs50
-rw-r--r--mcs/class/referencesource/mscorlib/system/AppContext/AppContextSwitches.cs10
-rw-r--r--mcs/class/referencesource/mscorlib/system/Lazy.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/appdomain.cs25
-rw-r--r--mcs/class/referencesource/mscorlib/system/appdomainattributes.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/appdomainunloadedexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/argiterator.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/array.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/badimageformatexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/cannotunloadappdomainexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/Concurrent/CDSCollectionETWBCLProvider.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/Concurrent/ConcurrentDictionary.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/Concurrent/ConcurrentQueue.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/Concurrent/ConcurrentStack.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/Concurrent/IProducerConsumerCollection.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/Concurrent/OrderablePartitioner.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/Concurrent/Partitioner.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/Concurrent/PartitionerStatic.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/arraylist.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/bitarray.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/caseinsensitivecomparer.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/caseinsensitivehashcodeprovider.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/collectionbase.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/comparer.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/compatiblecomparer.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/dictionarybase.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/dictionaryentry.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/emptyreadonlydictionaryinternal.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/generic/arraysorthelper.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/generic/comparer.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/generic/debugview.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/generic/dictionary.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/generic/equalitycomparer.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/generic/keynotfoundexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/generic/keyvaluepair.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/generic/list.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/hashtable.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/keyvaluepairs.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/listdictionaryinternal.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/objectmodel/collection.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/objectmodel/keyedcollection.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/objectmodel/readonlycollection.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/queue.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/readonlycollectionbase.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/sortedlist.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/stack.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/structuralcomparisons.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/delegate.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/diagnostics/contracts/contracts.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/diagnostics/contracts/contractsbcl.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/diagnostics/eventing/TraceLogging/EventPayload.cs5
-rw-r--r--mcs/class/referencesource/mscorlib/system/diagnostics/eventing/activitytracker.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/diagnostics/eventing/eventdescriptor.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/diagnostics/eventing/eventsource.cs31
-rw-r--r--mcs/class/referencesource/mscorlib/system/diagnostics/eventing/frameworkeventsource.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/exception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/executionengineexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/globalization/Persiancalendar.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/globalization/calendar.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/globalization/calendardata.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/globalization/culturedata.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/globalization/cultureinfo.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/globalization/datetimeparse.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/globalization/eastasianlunisolarcalendar.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/globalization/hebrewnumber.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/globalization/regioninfo.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/globalization/stringinfo.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/globalization/taiwancalendar.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/globalization/textelementenumerator.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/globalization/textinfo.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/globalization/timespanformat.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/globalization/timespanparse.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/globalization/umalquracalendar.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/__consolestream.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/__error.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/bufferedstream.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/directory.cs153
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/directoryinfo.cs115
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/directorynotfoundexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/driveinfo.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/drivenotfoundexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/endofstreamexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/file.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/fileinfo.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/fileloadexception.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/filenotfoundexception.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/filestream.cs22
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/filesystemenumerable.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/filesysteminfo.cs39
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/ioexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/isolatedstorage/isolatedstorage.cs6
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/isolatedstorage/isolatedstorageexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/isolatedstorage/isolatedstoragefile.cs12
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/isolatedstorage/isolatedstoragefilestream.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/longpath.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/memorystream.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/path.cs24
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/pathinternal.cs645
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/pathtoolongexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/pinnedbuffermemorystream.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/stringreader.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/stringwriter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/textreader.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/textwriter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/unmanagedmemoryaccessor.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/unmanagedmemorystream.cs6
-rw-r--r--mcs/class/referencesource/mscorlib/system/io/unmanagedmemorystreamwrapper.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/object.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/progress.cs10
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/Associates.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/ConstructorInfo.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/__filters.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/ambiguousmatchexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/assembly.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/assemblyattributes.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/assemblyname.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/assemblynameproxy.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/customattribute.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/customattributeformatexception.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/defaultmemberattribute.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/aqnbuilder.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/assemblybuilder.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/assemblybuilderdata.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/constructorbuilder.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/customattributebuilder.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/dynamicilgenerator.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/dynamicmethod.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/enumbuilder.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/eventbuilder.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/eventtoken.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/fieldbuilder.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/fieldtoken.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/generictypeparameterbuilder.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/ilgenerator.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/label.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/localbuilder.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/methodbuilder.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/methodbuilderinstantiation.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/methodrental.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/methodtoken.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/modulebuilder.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/modulebuilderdata.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/opcode.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/opcodes.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/parameterbuilder.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/parametertoken.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/propertybuilder.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/propertytoken.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/signaturehelper.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/signaturetoken.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/stringtoken.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/symbolmethod.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/symboltype.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/typebuilder.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/typebuilderinstantiation.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/typetoken.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/unmanagedmarshal.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/emit/xxxontypebuilderinstantiation.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/eventinfo.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/fieldinfo.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/introspectionextensions.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/invalidfiltercriteriaexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/loaderallocator.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/manifestresourceinfo.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/mdconstant.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/mdimport.cs6
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/memberinfo.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/memberinfoserializationholder.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/methodbase.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/methodbody.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/methodinfo.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/missing.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/module.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/obfuscateassemblyattribute.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/obfuscationattribute.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/parameterinfo.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/parametermodifier.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/pointer.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/propertyinfo.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/reflectioncontext.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/reflectiontypeloadexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/strongnamekeypair.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/targetexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/targetinvocationexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/targetparametercountexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/typedelegator.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/reflection/typeinfo.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/resources/__fastresourcecomparer.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/resources/filebasedresourcegroveler.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/resources/manifestbasedresourcegroveler.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/resources/missingmanifestresourceexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/resources/missingsatelliteassemblyexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/resources/neutralresourceslanguageattribute.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/resources/resourcefallbackmanager.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/resources/resourcemanager.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/resources/resourcereader.cs17
-rw-r--r--mcs/class/referencesource/mscorlib/system/resources/resourceset.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/resources/resourcewriter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/resources/runtimeresourceset.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/resources/satellitecontractversionattribute.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/rttype.cs6
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/compilerservices/ConditionalWeakTable.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/compilerservices/YieldAwaitable.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/compilerservices/compilationrelaxations.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/compilerservices/runtimehelpers.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/corruptingexceptioncommon.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionnotification.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/attributes.cs6
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/gchandle.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/attributes.cs6
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/bindablevectortocollectionadapter.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/bindablevectortolistadapter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clrikeyvaluepairimpl.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clripropertyvalueimpl.cs8
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clrireferenceimpl.cs6
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/custompropertyimpl.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/dictionarytomapadapter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/enumeratortoiteratoradapter.cs6
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/eventregistrationtoken.cs6
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/eventregistrationtokentable.cs6
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/icustompropertyprovider.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/imapviewtoireadonlydictionaryadapter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ireadonlydictionarytoimapviewadapter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ireadonlylisttoivectorviewadapter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iteratortoenumeratoradapter.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ivectorviewtoireadonlylistadapter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtobindablevectoradapter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtobindablevectorviewadapter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtovectoradapter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/managedactivationfactory.cs6
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/maptocollectionadapter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/maptodictionaryadapter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/mapviewtoreadonlycollectionadapter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectortocollectionadapter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectortolistadapter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectorviewtoreadonlycollectionadapter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/windowsruntimemarshal.cs6
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/windowsruntimemetadata.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/winrtclassactivator.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/remoting/activationservices.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/remoting/channelservices.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/remoting/channelsinkstacks.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/remoting/clientsponsor.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/remoting/configuration.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/remoting/context.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/remoting/crossappdomainchannel.cs10
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/remoting/crosscontextchannel.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/remoting/identityholder.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/remoting/lease.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/remoting/leasemanager.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/remoting/message.cs6
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/remoting/objref.cs8
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/remoting/realproxy.cs8
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/remoting/remotingattributes.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/remoting/remotingproxy.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/remoting/remotingservices.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/remoting/soapinteroptypes.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/remoting/synchronizeddispatch.cs40
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/remoting/urlattribute.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/serialization/formatters/soapfault.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/serialization/formatterservices.cs44
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/serialization/safeserializationmanager.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/serialization/streamingcontext.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/versioning/binarycompatibility.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/versioning/multitargetinghelpers.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtimehandles.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/accesscontrol/acl.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/accesscontrol/securitydescriptor.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/attributes.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/builtinpermissionsets.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/claims/Claim.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/claims/ClaimsIdentity.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/claims/ClaimsPrincipal.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/claims/RoleClaimProvider.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/codeaccesspermission.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/codeaccesssecurityengine.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/asymmetricalgorithm.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/asymmetrickeyexchangedeformatter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/asymmetrickeyexchangeformatter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/asymmetricsignaturedeformatter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/asymmetricsignatureformatter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/base64transforms.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/crypto.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/cryptoapitransform.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/cryptoconfig.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/cryptostream.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/derivebytes.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/des.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/descryptoserviceprovider.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/dsa.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/dsacryptoserviceprovider.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/dsasignaturedeformatter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/dsasignatureformatter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/hashalgorithm.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/hmac.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/hmacmd5.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/hmacripemd160.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/hmacsha1.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/hmacsha256.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/hmacsha384.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/hmacsha512.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/icspasymmetricalgorithm.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/keyedhashalgorithm.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/mactripledes.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/md5.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/md5cryptoserviceprovider.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/passwordderivebytes.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/pkcs1maskgenerationmethod.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/randomnumbergenerator.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/rc2.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/rc2cryptoserviceprovider.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/rfc2898derivebytes.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/rijndael.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/rijndaelmanaged.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/rijndaelmanagedtransform.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/ripemd160.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/ripemd160managed.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/rngcryptoserviceprovider.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/rsa.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/rsacryptoserviceprovider.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/rsaoaepkeyexchangedeformatter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/rsaoaepkeyexchangeformatter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/rsapkcs1keyexchangedeformatter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/rsapkcs1keyexchangeformatter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/rsapkcs1signaturedeformatter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/rsapkcs1signatureformatter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/safecryptohandles.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/sha1.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/sha1cryptoserviceprovider.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/sha1managed.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/sha256.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/sha256managed.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/sha384.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/sha384managed.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/sha512.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/sha512managed.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/signaturedescription.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/symmetricalgorithm.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/tripledes.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/tripledescryptoserviceprovider.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/cryptography/utils.cs18
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/framesecuritydescriptor.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/hostprotectionexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/hostsecuritymanager.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/namedpermissionset.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/permissionlistset.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/permissions/environmentpermission.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/permissions/filedialogpermission.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/permissions/fileiopermission.cs33
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/permissions/gacidentitypermission.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/permissions/hostprotectionpermission.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/permissions/isolatedstoragefilepermission.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/permissions/isolatedstoragepermission.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/permissions/keycontainerpermission.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/permissions/permissionattributes.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/permissions/principalpermission.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/permissions/publisheridentitypermission.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/permissions/reflectionpermission.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/permissions/registrypermission.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/permissions/securitypermission.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/permissions/siteidentitypermission.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/permissions/strongnameidentitypermission.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/permissions/strongnamepublickeyblob.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/permissions/uipermission.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/permissions/urlidentitypermission.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/permissions/zoneidentitypermission.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/permissionset.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/permissionsetenumerator.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/permissionsettriple.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/permissiontoken.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/allmembershipcondition.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/applicationdirectory.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/applicationdirectorymembershipcondition.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/applicationsecurityinfo.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/applicationsecuritymanager.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/applicationtrust.cs6
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/assemblyevidencefactory.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/codegroup.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/evidence.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/evidencebase.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/evidencetypedescriptor.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/filecodegroup.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/firstmatchcodegroup.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/gac.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/gacmembershipcondition.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/hash.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/hashmembershipcondition.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/iapplicationtrustmanager.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/netcodegroup.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/pefileevidencefactory.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/permissionrequestevidence.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/policyexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/policylevel.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/policystatement.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/publisher.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/publishermembershipcondition.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/site.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/sitemembershipcondition.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/strongname.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/strongnamemembershipcondition.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/unioncodegroup.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/url.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/urlmembershipcondition.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/zone.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policy/zonemembershipcondition.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/policymanager.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/principal/genericidentity.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/principal/genericprincipal.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/principal/identitynotmappedexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/principal/identityreference.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/principal/ircollection.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/principal/ntaccount.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/principal/sid.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/principal/win32.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/principal/windowsidentity.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/principal/windowsimpersonationcontext.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/principal/windowsprincipal.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/readonlypermissionset.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/safesecurityhandles.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/securestring.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/securitycontext.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/securitydocument.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/securityelement.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/securityexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/securitymanager.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/securityruntime.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/securitystate.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/util/config.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/util/hex.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/util/parser.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/util/sitestring.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/util/stringexpressionset.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/util/tokenbasedset.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/util/tokenbasedsetenumerator.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/util/tokenizer.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/util/urlstring.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/util/xmlutil.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/verificationexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/security/xmlsyntaxexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/string.cs12
-rw-r--r--mcs/class/referencesource/mscorlib/system/stubhelpers.cs115
-rw-r--r--mcs/class/referencesource/mscorlib/system/text/asciiencoding.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/text/encoding.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/text/iso2022encoding.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/text/unicodeencoding.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/text/utf32encoding.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/text/utf7encoding.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/text/utf8encoding.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/CDSsyncETWBCLProvider.cs10
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/CancellationToken.cs6
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/CancellationTokenRegistration.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/CancellationTokenSource.cs8
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/CountdownEvent.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/LazyInitializer.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/ManualResetEventSlim.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/SemaphoreSlim.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/SpinLock.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/SpinWait.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/Tasks/BeginEndAwaitableAdapter.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/Tasks/ConcurrentExclusiveSchedulerPair.cs6
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/Tasks/Future.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/Tasks/FutureFactory.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/Tasks/Parallel.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/Tasks/ParallelLoopState.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/Tasks/ParallelRangeManager.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/Tasks/ProducerConsumerQueues.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/Tasks/TPLETWProvider.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskCanceledException.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskCompletionSource.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskContinuation.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskExceptionHolder.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskFactory.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskScheduler.cs49
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskSchedulerException.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskToApm.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/Tasks/ThreadPoolTaskScheduler.cs5
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/ThreadLocal.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/abandonedmutexexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/asynclocal.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/autoresetevent.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/compressedstack.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/eventwaithandle.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs6
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/hostexecutioncontextmanager.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/interlocked.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/lockcookie.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/lockrecursionexception.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/manualresetevent.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/monitor.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/mutex.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/overlapped.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/readerwriterlock.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/semaphorefullexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/synchronizationcontext.cs6
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/synchronizationlockexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/thread.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/threadabortexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/threadinterruptedexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/threadpool.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/threadstartexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/threadstateexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/timeout.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/timer.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/volatile.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/waithandle.cs4
-rw-r--r--mcs/class/referencesource/mscorlib/system/threading/waithandlecannotbeopenedexception.cs2
-rw-r--r--mcs/class/referencesource/mscorlib/system/type.cs2
3081 files changed, 197891 insertions, 8353 deletions
diff --git a/mcs/class/referencesource/System.Activities.Core.Presentation/SR.Designer.cs b/mcs/class/referencesource/System.Activities.Core.Presentation/SR.Designer.cs
index d61d6e68afd..a1d8f4cfbb6 100644
--- a/mcs/class/referencesource/System.Activities.Core.Presentation/SR.Designer.cs
+++ b/mcs/class/referencesource/System.Activities.Core.Presentation/SR.Designer.cs
@@ -839,7 +839,7 @@ namespace System.Activities.Core.Presentation {
}
/// <summary>
- /// Looks up a localized string similar to ActivityDelegate arguments don&apos;t match. Check your activity configuration to make sure it is in [....] with the declared ActivityDelegate..
+ /// Looks up a localized string similar to ActivityDelegate arguments don&apos;t match. Check your activity configuration to make sure it is in sync with the declared ActivityDelegate..
/// </summary>
internal static string WrongNumberOfArgumentsForActivityDelegate {
get {
diff --git a/mcs/class/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/MorphHelpers.cs b/mcs/class/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/MorphHelpers.cs
index 11ae9394f06..2fd2fdc5c07 100644
--- a/mcs/class/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/MorphHelpers.cs
+++ b/mcs/class/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/MorphHelpers.cs
@@ -55,7 +55,7 @@ namespace System.Activities.Core.Presentation
{
morphed.Expression = morphedExpression;
}
- //[....]
+ //Microsoft
}
}
diff --git a/mcs/class/referencesource/System.Activities.Core.Presentation/System/Activities/Presentation/DynamicArgumentDesigner.xaml.cs b/mcs/class/referencesource/System.Activities.Core.Presentation/System/Activities/Presentation/DynamicArgumentDesigner.xaml.cs
index 9c989f039c8..a9d222366ef 100644
--- a/mcs/class/referencesource/System.Activities.Core.Presentation/System/Activities/Presentation/DynamicArgumentDesigner.xaml.cs
+++ b/mcs/class/referencesource/System.Activities.Core.Presentation/System/Activities/Presentation/DynamicArgumentDesigner.xaml.cs
@@ -560,7 +560,7 @@ namespace System.Activities.Presentation
}
else
{
- //[....]
+ //Microsoft
entry.Expression = null;
}
diff --git a/mcs/class/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/SqlCommandAsyncResult.cs b/mcs/class/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/SqlCommandAsyncResult.cs
index 8335154acf1..3fadf8b2016 100644
--- a/mcs/class/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/SqlCommandAsyncResult.cs
+++ b/mcs/class/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/SqlCommandAsyncResult.cs
@@ -118,7 +118,7 @@ namespace System.Activities.DurableInstancing
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)
@@ -171,7 +171,7 @@ namespace System.Activities.DurableInstancing
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))
diff --git a/mcs/class/referencesource/System.Activities/System/Activities/Debugger/StateManager.cs b/mcs/class/referencesource/System.Activities/System/Activities/Debugger/StateManager.cs
index 36717244851..1a3a2fb07a2 100644
--- a/mcs/class/referencesource/System.Activities/System/Activities/Debugger/StateManager.cs
+++ b/mcs/class/referencesource/System.Activities/System/Activities/Debugger/StateManager.cs
@@ -37,7 +37,6 @@ namespace System.Activities.Debugger
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;
@@ -681,7 +680,7 @@ namespace System.Activities.Debugger
[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");
@@ -791,7 +790,7 @@ namespace System.Activities.Debugger
if (checksumBytes != null)
{
- documentWriter.SetCheckSum(new Guid(Md5Identifier), checksumBytes);
+ documentWriter.SetCheckSum(SymbolHelper.ChecksumProviderId, checksumBytes);
}
}
return documentWriter;
diff --git a/mcs/class/referencesource/System.Activities/System/Activities/Debugger/Symbol/SymbolHelper.cs b/mcs/class/referencesource/System.Activities/System/Activities/Debugger/Symbol/SymbolHelper.cs
index 9e021231c55..00aaa7e97ca 100644
--- a/mcs/class/referencesource/System.Activities/System/Activities/Debugger/Symbol/SymbolHelper.cs
+++ b/mcs/class/referencesource/System.Activities/System/Activities/Debugger/Symbol/SymbolHelper.cs
@@ -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)
{
@@ -61,8 +79,6 @@ namespace System.Activities.Debugger.Symbol
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");
@@ -71,8 +87,10 @@ namespace System.Activities.Debugger.Symbol
{
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)
@@ -108,7 +126,28 @@ namespace System.Activities.Debugger.Symbol
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();
+ }
}
}
}
diff --git a/mcs/class/referencesource/System.Activities/System/Activities/Runtime/ActivityExecutor.cs b/mcs/class/referencesource/System.Activities/System/Activities/Runtime/ActivityExecutor.cs
index b9cf8fe7e52..417960427bf 100644
--- a/mcs/class/referencesource/System.Activities/System/Activities/Runtime/ActivityExecutor.cs
+++ b/mcs/class/referencesource/System.Activities/System/Activities/Runtime/ActivityExecutor.cs
@@ -1921,7 +1921,7 @@ namespace System.Activities.Runtime
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)
{
diff --git a/mcs/class/referencesource/System.Activities/System/Activities/Runtime/ActivityInstanceMap.cs b/mcs/class/referencesource/System.Activities/System/Activities/Runtime/ActivityInstanceMap.cs
index 7c4cae273d7..c4983a022b0 100644
--- a/mcs/class/referencesource/System.Activities/System/Activities/Runtime/ActivityInstanceMap.cs
+++ b/mcs/class/referencesource/System.Activities/System/Activities/Runtime/ActivityInstanceMap.cs
@@ -599,7 +599,7 @@ namespace System.Activities.Runtime
}
// 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
diff --git a/mcs/class/referencesource/System.Activities/System/Activities/Statements/MethodExecutor.cs b/mcs/class/referencesource/System.Activities/System/Activities/Statements/MethodExecutor.cs
index 3819a0e6429..432dd9efc81 100644
--- a/mcs/class/referencesource/System.Activities/System/Activities/Statements/MethodExecutor.cs
+++ b/mcs/class/referencesource/System.Activities/System/Activities/Statements/MethodExecutor.cs
@@ -114,12 +114,12 @@ namespace System.Activities.Statements
}
}
- 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",
diff --git a/mcs/class/referencesource/System.Activities/System/Activities/Statements/MethodResolver.cs b/mcs/class/referencesource/System.Activities/System/Activities/Statements/MethodResolver.cs
index 2a7b1084b33..5181f4f2a65 100644
--- a/mcs/class/referencesource/System.Activities/System/Activities/Statements/MethodResolver.cs
+++ b/mcs/class/referencesource/System.Activities/System/Activities/Statements/MethodResolver.cs
@@ -355,7 +355,7 @@ namespace System.Activities.Statements
{
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;
}
diff --git a/mcs/class/referencesource/System.Activities/System/Activities/WorkflowApplication.cs b/mcs/class/referencesource/System.Activities/System/Activities/WorkflowApplication.cs
index ff9b74d7295..952c17975ba 100644
--- a/mcs/class/referencesource/System.Activities/System/Activities/WorkflowApplication.cs
+++ b/mcs/class/referencesource/System.Activities/System/Activities/WorkflowApplication.cs
@@ -367,7 +367,7 @@ namespace System.Activities
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)
@@ -1100,7 +1100,7 @@ namespace System.Activities
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
@@ -3867,7 +3867,7 @@ namespace System.Activities
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))
diff --git a/mcs/class/referencesource/System.Activities/System/Activities/WorkflowPersistenceContext.cs b/mcs/class/referencesource/System.Activities/System/Activities/WorkflowPersistenceContext.cs
index d056669a4e9..78f8b612763 100644
--- a/mcs/class/referencesource/System.Activities/System/Activities/WorkflowPersistenceContext.cs
+++ b/mcs/class/referencesource/System.Activities/System/Activities/WorkflowPersistenceContext.cs
@@ -74,7 +74,7 @@ namespace System.Activities
{
// 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)
diff --git a/mcs/class/referencesource/System.ComponentModel.DataAnnotations/DataAnnotationsResources.resx b/mcs/class/referencesource/System.ComponentModel.DataAnnotations/DataAnnotationsResources.resx
new file mode 100644
index 00000000000..11b1bd4c040
--- /dev/null
+++ b/mcs/class/referencesource/System.ComponentModel.DataAnnotations/DataAnnotationsResources.resx
@@ -0,0 +1,291 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <data name="AssociatedMetadataTypeTypeDescriptor_MetadataTypeContainsUnknownProperties" xml:space="preserve">
+ <value>The associated metadata type for type '{0}' contains the following unknown properties or fields: {1}. Please make sure that the names of these members match the names of the properties on the main type.</value>
+ </data>
+ <data name="AttributeStore_Type_Must_Be_Public" xml:space="preserve">
+ <value>The type '{0}' must be public.</value>
+ </data>
+ <data name="AttributeStore_Unknown_Method" xml:space="preserve">
+ <value>The type '{0}' does not contain a public method named '{1}'.</value>
+ </data>
+ <data name="AttributeStore_Unknown_Property" xml:space="preserve">
+ <value>The type '{0}' does not contain a public property named '{1}'.</value>
+ </data>
+ <data name="CustomValidationAttribute_Method_Must_Return_ValidationResult" xml:space="preserve">
+ <value>The CustomValidationAttribute method '{0}' in type '{1}' must return System.ComponentModel.DataAnnotations.ValidationResult. Use System.ComponentModel.DataAnnotations.ValidationResult.Success to represent success.</value>
+ </data>
+ <data name="CustomValidationAttribute_Method_Not_Found" xml:space="preserve">
+ <value>The CustomValidationAttribute method '{0}' does not exist in type '{1}' or is not public and static.</value>
+ </data>
+ <data name="CustomValidationAttribute_Method_Required" xml:space="preserve">
+ <value>The CustomValidationAttribute.Method was not specified.</value>
+ </data>
+ <data name="CustomValidationAttribute_Method_Signature" xml:space="preserve">
+ <value>The CustomValidationAttribute method '{0}' in type '{1}' must match the expected signature: public static ValidationResult {0}(object value, ValidationContext context). The value can be strongly typed. The ValidationContext parameter is optional.</value>
+ </data>
+ <data name="CustomValidationAttribute_Type_Must_Be_Public" xml:space="preserve">
+ <value>The custom validation type '{0}' must be public.</value>
+ </data>
+ <data name="CustomValidationAttribute_ValidationError" xml:space="preserve">
+ <value>{0} is not valid.</value>
+ </data>
+ <data name="CustomValidationAttribute_ValidatorType_Required" xml:space="preserve">
+ <value>The CustomValidationAttribute.ValidatorType was not specified.</value>
+ </data>
+ <data name="DataTypeAttribute_EmptyDataTypeString" xml:space="preserve">
+ <value>The custom DataType string cannot be null or empty.</value>
+ </data>
+ <data name="LocalizableString_LocalizationFailed" xml:space="preserve">
+ <value>Cannot retrieve property '{0}' because localization failed. Type '{1}' is not public or does not contain a public static string property with the name '{2}'.</value>
+ </data>
+ <data name="Validator_Property_Value_Wrong_Type" xml:space="preserve">
+ <value>The value for property '{0}' must be of type '{1}'.</value>
+ </data>
+ <data name="RangeAttribute_ArbitraryTypeNotIComparable" xml:space="preserve">
+ <value>The type {0} must implement {1}.</value>
+ </data>
+ <data name="RangeAttribute_MinGreaterThanMax" xml:space="preserve">
+ <value>The maximum value '{0}' must be greater than or equal to the minimum value '{1}'.</value>
+ </data>
+ <data name="RangeAttribute_Must_Set_Min_And_Max" xml:space="preserve">
+ <value>The minimum and maximum values must be set.</value>
+ </data>
+ <data name="RangeAttribute_Must_Set_Operand_Type" xml:space="preserve">
+ <value>The OperandType must be set when strings are used for minimum and maximum values.</value>
+ </data>
+ <data name="RangeAttribute_ValidationError" xml:space="preserve">
+ <value>The field {0} must be between {1} and {2}.</value>
+ </data>
+ <data name="RegexAttribute_ValidationError" xml:space="preserve">
+ <value>The field {0} must match the regular expression '{1}'.</value>
+ </data>
+ <data name="RegularExpressionAttribute_Empty_Pattern" xml:space="preserve">
+ <value>The pattern must be set to a valid regular expression.</value>
+ </data>
+ <data name="RequiredAttribute_ValidationError" xml:space="preserve">
+ <value>The {0} field is required.</value>
+ </data>
+ <data name="StringLengthAttribute_InvalidMaxLength" xml:space="preserve">
+ <value>The maximum length must be a nonnegative integer.</value>
+ </data>
+ <data name="StringLengthAttribute_ValidationError" xml:space="preserve">
+ <value>The field {0} must be a string with a maximum length of {1}.</value>
+ </data>
+ <data name="UIHintImplementation_ControlParameterKeyIsNotAString" xml:space="preserve">
+ <value>The key parameter at position {0} with value '{1}' is not a string. Every key control parameter must be a string.</value>
+ </data>
+ <data name="UIHintImplementation_ControlParameterKeyIsNull" xml:space="preserve">
+ <value>The key parameter at position {0} is null. Every key control parameter must be a string.</value>
+ </data>
+ <data name="UIHintImplementation_NeedEvenNumberOfControlParameters" xml:space="preserve">
+ <value>The number of control parameters must be even.</value>
+ </data>
+ <data name="UIHintImplementation_ControlParameterKeyOccursMoreThanOnce" xml:space="preserve">
+ <value>The key parameter at position {0} with value '{1}' occurs more than once.</value>
+ </data>
+ <data name="ValidationAttribute_Cannot_Set_ErrorMessage_And_Resource" xml:space="preserve">
+ <value>Either ErrorMessageString or ErrorMessageResourceName must be set, but not both.</value>
+ </data>
+ <data name="ValidationAttribute_NeedBothResourceTypeAndResourceName" xml:space="preserve">
+ <value>Both ErrorMessageResourceType and ErrorMessageResourceName need to be set on this attribute.</value>
+ </data>
+ <data name="ValidationAttribute_ResourcePropertyNotStringType" xml:space="preserve">
+ <value>The property '{0}' on resource type '{1}' is not a string type.</value>
+ </data>
+ <data name="ValidationAttribute_ResourceTypeDoesNotHaveProperty" xml:space="preserve">
+ <value>The resource type '{0}' does not have an accessible static property named '{1}'.</value>
+ </data>
+ <data name="ValidationAttribute_ValidationError" xml:space="preserve">
+ <value>The field {0} is invalid.</value>
+ </data>
+ <data name="ValidationContext_Must_Be_Method" xml:space="preserve">
+ <value>The ValidationContext for the type '{0}', member name '{1}' must provide the MethodInfo.</value>
+ </data>
+ <data name="EnumDataTypeAttribute_TypeNeedsToBeAnEnum" xml:space="preserve">
+ <value>The type '{0}' needs to represent an enumeration type.</value>
+ </data>
+ <data name="EnumDataTypeAttribute_TypeCannotBeNull" xml:space="preserve">
+ <value>The type provided for EnumDataTypeAttribute cannot be null.</value>
+ </data>
+ <data name="MetadataTypeAttribute_TypeCannotBeNull" xml:space="preserve">
+ <value>MetadataClassType cannot be null.</value>
+ </data>
+ <data name="DisplayAttribute_PropertyNotSet" xml:space="preserve">
+ <value>The {0} property has not been set. Use the {1} method to get the value.</value>
+ </data>
+ <data name="ValidationContextServiceContainer_ItemAlreadyExists" xml:space="preserve">
+ <value>A service of type '{0}' already exists in the container.</value>
+ </data>
+ <data name="Validator_InstanceMustMatchValidationContextInstance" xml:space="preserve">
+ <value>The instance provided must match the ObjectInstance on the ValidationContext supplied.</value>
+ </data>
+ <data name="ValidationAttribute_IsValid_NotImplemented" xml:space="preserve">
+ <value>IsValid(object value) has not been implemented by this class. The preferred entry point is GetValidationResult() and classes should override IsValid(object value, ValidationContext context).</value>
+ </data>
+ <data name="CustomValidationAttribute_Type_Conversion_Failed" xml:space="preserve">
+ <value>Could not convert the value of type '{0}' to '{1}' as expected by method {2}.{3}.</value>
+ </data>
+ <data name="StringLengthAttribute_ValidationErrorIncludingMinimum" xml:space="preserve">
+ <value>The field {0} must be a string with a minimum length of {2} and a maximum length of {1}.</value>
+ </data>
+ <data name="CreditCardAttribute_Invalid" xml:space="preserve">
+ <value>The {0} field is not a valid credit card number.</value>
+ </data>
+ <data name="EmailAddressAttribute_Invalid" xml:space="preserve">
+ <value>The {0} field is not a valid e-mail address.</value>
+ </data>
+ <data name="FileExtensionsAttribute_Invalid" xml:space="preserve">
+ <value>The {0} field only accepts files with the following extensions: {1}</value>
+ </data>
+ <data name="UrlAttribute_Invalid" xml:space="preserve">
+ <value>The {0} field is not a valid fully-qualified http, https, or ftp URL.</value>
+ </data>
+ <data name="CompareAttribute_MustMatch" xml:space="preserve">
+ <value>'{0}' and '{1}' do not match.</value>
+ </data>
+ <data name="Common_NullOrEmpty" xml:space="preserve">
+ <value>Value cannot be null or empty.</value>
+ </data>
+ <data name="CompareAttribute_UnknownProperty" xml:space="preserve">
+ <value>Could not find a property named {0}.</value>
+ </data>
+ <data name="Common_PropertyNotFound" xml:space="preserve">
+ <value>The property {0}.{1} could not be found.</value>
+ </data>
+ <data name="PhoneAttribute_Invalid" xml:space="preserve">
+ <value>The {0} field is not a valid phone number.</value>
+ </data>
+ <data name="MaxLengthAttribute_InvalidMaxLength" xml:space="preserve">
+ <value>MaxLengthAttribute must have a Length value that is greater than zero. Use MaxLength() without parameters to indicate that the string or array can have the maximum allowable length.</value>
+ </data>
+ <data name="MaxLengthAttribute_ValidationError" xml:space="preserve">
+ <value>The field {0} must be a string or array type with a maximum length of '{1}'.</value>
+ </data>
+ <data name="MinLengthAttribute_InvalidMinLength" xml:space="preserve">
+ <value>MinLengthAttribute must have a Length value that is zero or greater.</value>
+ </data>
+ <data name="MinLengthAttribute_ValidationError" xml:space="preserve">
+ <value>The field {0} must be a string or array type with a minimum length of '{1}'.</value>
+ </data>
+ <data name="ArgumentIsNullOrWhitespace" xml:space="preserve">
+ <value>The argument '{0}' cannot be null, empty or contain only white space.</value>
+ </data>
+</root> \ No newline at end of file
diff --git a/mcs/class/referencesource/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Resources.txt b/mcs/class/referencesource/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Resources.txt
new file mode 100644
index 00000000000..ecbd61f15a0
--- /dev/null
+++ b/mcs/class/referencesource/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Resources.txt
@@ -0,0 +1,16 @@
+; NOTE: don't use \", use ' instead
+; NOTE: don't use #, use ; instead for comments
+; NOTE: leave the [strings] alone
+
+MaxLengthAttribute_ValidationError=The field {0} must be a string or array type with a maximum length of '{1}'.
+
+## ExceptionType=InvalidOperationException
+MaxLengthAttribute_InvalidMaxLength=MaxLengthAttribute must have a Length value that is greater than zero. Use MaxLength() without parameters to indicate that the string or array can have the maximum allowable length.
+
+MinLengthAttribute_ValidationError=The field {0} must be a string or array type with a minimum length of '{1}'.
+
+## ExceptionType=InvalidOperationException
+MinLengthAttribute_InvalidMinLength=MinLengthAttribute must have a Length value that is zero or greater.
+
+## ExceptionType=ArgumentException
+ArgumentIsNullOrWhitespace=The argument '{0}' cannot be null, empty or contain only white space. \ No newline at end of file
diff --git a/mcs/class/referencesource/System.Configuration/System/Configuration/BaseConfigurationRecord.cs b/mcs/class/referencesource/System.Configuration/System/Configuration/BaseConfigurationRecord.cs
index c378f1d68b1..4b30c4caffe 100644
--- a/mcs/class/referencesource/System.Configuration/System/Configuration/BaseConfigurationRecord.cs
+++ b/mcs/class/referencesource/System.Configuration/System/Configuration/BaseConfigurationRecord.cs
@@ -4124,9 +4124,12 @@ namespace System.Configuration {
//
const string ProtectedConfigurationSectionTypeName = "System.Configuration.ProtectedConfigurationSection, " + AssemblyRef.SystemConfiguration;
internal const string RESERVED_SECTION_PROTECTED_CONFIGURATION = "configProtectedData";
+ internal const string Microsoft_CONFIGURATION_SECTION = ConfigurationStringConstants.WinformsApplicationConfigurationSectionName;
+ const string SystemConfigurationSectionTypeName = "System.Configuration.AppSettingsSection, " + AssemblyRef.SystemConfiguration;
internal static bool IsImplicitSection(string configKey) {
- if (configKey == RESERVED_SECTION_PROTECTED_CONFIGURATION) {
+ if (string.Equals(configKey, RESERVED_SECTION_PROTECTED_CONFIGURATION, StringComparison.Ordinal) ||
+ string.Equals(configKey, Microsoft_CONFIGURATION_SECTION, StringComparison.Ordinal)) {
return true;
}
else {
@@ -4172,6 +4175,34 @@ namespace System.Configuration {
null, // filename
-1); // lineNumber
}
+
+ factoryRecord = (FactoryRecord)factoryList[Microsoft_CONFIGURATION_SECTION];
+
+ // If the user has mistakenly declared an implicit section, we should leave the factoryRecord
+ // alone because it contains the error and the error will be thrown later.
+ if (factoryRecord != null)
+ {
+ Debug.Assert(factoryRecord.HasErrors, "If the user has mistakenly declared an implicit section, we should have recorded an error.");
+ }
+ else
+ {
+ factoryList[Microsoft_CONFIGURATION_SECTION] =
+ new FactoryRecord(
+ Microsoft_CONFIGURATION_SECTION, // configKey
+ string.Empty, // group
+ Microsoft_CONFIGURATION_SECTION, // name
+ SystemConfigurationSectionTypeName, // factoryTypeName
+ true, // allowLocation
+ ConfigurationAllowDefinition.Everywhere, // allowDefinition
+ ConfigurationAllowExeDefinition.MachineToApplication, // allowExeDefinition
+ OverrideModeSetting.SectionDefault, // overrideModeDefault
+ true, // restartOnExternalChanges
+ true, // requirePermission
+ true, // isFromTrustedConfig
+ true, // isUndeclared
+ null, // filename
+ -1); // lineNumber
+ }
}
}
diff --git a/mcs/class/referencesource/System.Configuration/System/Configuration/Internal/InternalConfigHost.cs b/mcs/class/referencesource/System.Configuration/System/Configuration/Internal/InternalConfigHost.cs
index 962ac400dcd..128702ad542 100644
--- a/mcs/class/referencesource/System.Configuration/System/Configuration/Internal/InternalConfigHost.cs
+++ b/mcs/class/referencesource/System.Configuration/System/Configuration/Internal/InternalConfigHost.cs
@@ -69,7 +69,7 @@ namespace System.Configuration.Internal {
[SuppressMessage("Microsoft.Security", "CA2106:SecureAsserts", Justification = "The callers don't leak this information.")]
static internal string StaticGetStreamNameForConfigSource(string streamName, string configSource) {
//
- // Note ([....] 7/08/05):
+ // Note (Microsoft 7/08/05):
// RemoteWebConfigurationHost also redirects GetStreamNameForConfigSource to this
// method, and that means streamName is referring to a path that's on the remote
// machine. The problem is that Path.GetFullPath will demand FileIOPermission on
diff --git a/mcs/class/referencesource/System.Configuration/System/Configuration/MgmtConfigurationRecord.cs b/mcs/class/referencesource/System.Configuration/System/Configuration/MgmtConfigurationRecord.cs
index 748bf3a8adf..f3ec52b9de8 100644
--- a/mcs/class/referencesource/System.Configuration/System/Configuration/MgmtConfigurationRecord.cs
+++ b/mcs/class/referencesource/System.Configuration/System/Configuration/MgmtConfigurationRecord.cs
@@ -1743,8 +1743,17 @@ namespace System.Configuration {
saveMode == ConfigurationSaveMode.Full) {
// Note: we won't use RawXml if saveMode == Full because Full means we want to
// write all properties, and RawXml may not have all properties.
- ConfigurationSection parentConfigSection = FindImmediateParentSection(configSection);
- updatedXml = configSection.SerializeSection(parentConfigSection, configSection.SectionInformation.Name, saveMode);
+
+ // 'System.Windows.Forms.ApplicationConfiguration' is declared as an implicit section. Saving this section definition without declaration in machine .config file is causing IIS
+ // and "wcfservice' project creation failed. See bug #297811 for more details. Following fix exclude this section empty definition in the machine.config while saving it.
+ if (String.Equals(configSection.SectionInformation.Name, ConfigurationStringConstants.WinformsApplicationConfigurationSectionName, StringComparison.Ordinal) &&
+ String.Equals(configSection._configRecord.ConfigPath, ClientConfigurationHost.MachineConfigName, StringComparison.Ordinal)) {
+ updatedXml = null;
+ }
+ else {
+ ConfigurationSection parentConfigSection = FindImmediateParentSection(configSection);
+ updatedXml = configSection.SerializeSection(parentConfigSection, configSection.SectionInformation.Name, saveMode);
+ }
ValidateSectionXml(updatedXml, configKey);
}
else {
diff --git a/mcs/class/referencesource/System.Core/Microsoft/Win32/SafeHandles/NCryptSafeHandles.cs b/mcs/class/referencesource/System.Core/Microsoft/Win32/SafeHandles/NCryptSafeHandles.cs
index 9e09c9feb6e..ab3a042e02e 100644
--- a/mcs/class/referencesource/System.Core/Microsoft/Win32/SafeHandles/NCryptSafeHandles.cs
+++ b/mcs/class/referencesource/System.Core/Microsoft/Win32/SafeHandles/NCryptSafeHandles.cs
@@ -263,7 +263,7 @@ namespace Microsoft.Win32.SafeHandles {
T duplicate = new T();
// We need to do this operation in a CER in order to ensure that everybody's state stays consistent
- // with the current view of the world. If the state of the various handles gets out of [....], then
+ // with the current view of the world. If the state of the various handles gets out of sync, then
// we'll end up leaking since reference counts will not be set up properly.
RuntimeHelpers.PrepareConstrainedRegions();
try { }
diff --git a/mcs/class/referencesource/System.Core/System.Core.txt b/mcs/class/referencesource/System.Core/System.Core.txt
index e2d5fa71447..00695316d45 100644
--- a/mcs/class/referencesource/System.Core/System.Core.txt
+++ b/mcs/class/referencesource/System.Core/System.Core.txt
@@ -96,6 +96,7 @@ IO_IO_SharingViolation_File=The process cannot access the file '{0}' because it
IO_IO_SharingViolation_NoFileName=The process cannot access the file because it is being used by another process.
IO_IO_PipeBroken=Pipe is broken.
IO_IO_InvalidPipeHandle=Invalid pipe handle.
+IO_OperationAborted=IO operation was aborted unexpectedly.
;
; DirectoryNotFoundException
;
@@ -382,3 +383,37 @@ NotSupported_MMViewStreamsFixedLength=MemoryMappedViewStreams are fixed length.
ObjectDisposed_ViewAccessorClosed=Cannot access a closed accessor.
ObjectDisposed_StreamIsClosed=Cannot access a closed Stream.
+;
+; 4.6.x string (only add at the end)
+;
+NotSupported_Method=Method not supported.
+NotSupported_SubclassOverride=Method not supported. Derived class must override.
+Cryptography_ArgDSARequiresDSAKey=Keys used with the DSACng algorithm must have an algorithm group of DSA.
+Cryptography_ArgRSAaRequiresRSAKey=Keys used with the RSACng algorithm must have an algorithm group of RSA.
+Cryptography_CngKeyWrongAlgorithm=This key is for algorithm '{0}'. Expected '{1}'.
+Cryptography_DSA_HashTooShort=The supplied hash cannot be shorter in length than the DSA key's Q value.
+Cryptography_HashAlgorithmNameNullOrEmpty=The hash algorithm name cannot be null or empty.
+Cryptography_InvalidDsaParameters_MissingFields=The specified DSA parameters are not valid; P, Q, G and Y are all required.
+Cryptography_InvalidDsaParameters_MismatchedPGY=The specified DSA parameters are not valid; P, G and Y must be the same length (the key size).
+Cryptography_InvalidDsaParameters_MismatchedQX=The specified DSA parameters are not valid; Q and X (if present) must be the same length.
+Cryptography_InvalidDsaParameters_MismatchedPJ=The specified DSA parameters are not valid; J (if present) must be shorter than P.
+Cryptography_InvalidDsaParameters_SeedRestriction_ShortKey=The specified DSA parameters are not valid; Seed, if present, must be 20 bytes long for keys shorter than 1024 bits.
+Cryptography_InvalidDsaParameters_QRestriction_ShortKey=The specified DSA parameters are not valid; Q must be 20 bytes long for keys shorter than 1024 bits.
+Cryptography_InvalidDsaParameters_QRestriction_LargeKey=The specified DSA parameters are not valid; Q's length must be one of 20, 32 or 64 bytes.
+Cryptography_InvalidRsaParameters=The specified RSA parameters are not valid; both Exponent and Modulus are required fields.
+Cryptography_InvalidSignatureAlgorithm=The hash algorithm is not supported for signatures. Only MD5, SHA1, SHA256,SHA384, and SHA512 are supported at this time.
+Cryptography_KeyBlobParsingError=Key Blob not in expected format.
+Cryptography_NotSupportedKeyAlgorithm=Key Algorithm is not supported.
+Cryptography_NotValidPublicOrPrivateKey=Key is not a valid public or private key.
+Cryptography_NotValidPrivateKey=Key is not a valid private key.
+Cryptography_UnexpectedTransformTruncation=CNG provider unexpectedly terminated encryption or decryption prematurely.
+Cryptography_UnsupportedPaddingMode=The specified PaddingMode is not supported.
+Cryptography_WeakKey=Specified key is a known weak key for this algorithm and cannot be used.
+Cryptography_CurveNotSupported=The specified curve '{0}' or its parameters are not valid for this platform.
+Cryptography_InvalidCurve=The specified curve '{0}' is not valid for this platform.
+Cryptography_InvalidCurveOid=The specified Oid is not valid. The Oid.FriendlyName or Oid.Value property must be set.
+Cryptography_InvalidCurveKeyParameters=The specified key parameters are not valid. Q.X and Q.Y are required fields. Q.X, Q.Y must be the same length. If D is specified it must be the same length as Q.X and Q.Y for named curves or the same length as Order for explicit curves.
+Cryptography_InvalidECCharacteristic2Curve=The specified Characteristic2 curve parameters are not valid. Polynomial, A, B, G.X, G.Y, and Order are required. A, B, G.X, G.Y must be the same length, and the same length as Q.X, Q.Y and D if those are specified. Seed, Cofactor and Hash are optional. Other parameters are not allowed.
+Cryptography_InvalidECPrimeCurve=The specified prime curve parameters are not valid. Prime, A, B, G.X, G.Y and Order are required and must be the same length, and the same length as Q.X, Q.Y and D if those are specified. Seed, Cofactor and Hash are optional. Other parameters are not allowed.
+Cryptography_InvalidECNamedCurve=The specified named curve parameters are not valid. Only the Oid parameter must be set.
+Cryptography_UnknownHashAlgorithm='{0}' is not a known hash algorithm.
diff --git a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/EventDescriptor.cs b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/EventDescriptor.cs
index 767fdd4cd85..cfe9bd24a40 100644
--- a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/EventDescriptor.cs
+++ b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/EventDescriptor.cs
@@ -28,7 +28,7 @@ namespace System.Diagnostics.Eventing
[FieldOffset(8)]
private long m_keywords;
- [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "opcode", Justification = "[....]: Shipped public in 3.5, breaking change to fix now.")]
+ [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "opcode", Justification = "Microsoft: Shipped public in 3.5, breaking change to fix now.")]
public EventDescriptor(
int id,
byte version,
@@ -98,7 +98,7 @@ namespace System.Diagnostics.Eventing
}
}
- [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "[....]: Shipped public in 3.5, breaking change to fix now.")]
+ [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "Microsoft: Shipped public in 3.5, breaking change to fix now.")]
public byte Opcode
{
get
diff --git a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventLogSession.cs b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventLogSession.cs
index 6515e3d87aa..408bce798c0 100644
--- a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventLogSession.cs
+++ b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventLogSession.cs
@@ -52,7 +52,7 @@ namespace System.Diagnostics.Eventing.Reader {
internal EventLogHandle renderContextHandleSystem = EventLogHandle.Zero;
internal EventLogHandle renderContextHandleUser = EventLogHandle.Zero;
- //the dummy [....] object for the two contextes.
+ //the dummy sync object for the two contextes.
private object syncObject = null;
private string server;
diff --git a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventMetadata.cs b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventMetadata.cs
index 4aa1910d960..ce3f4c8d049 100644
--- a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventMetadata.cs
+++ b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventMetadata.cs
@@ -86,7 +86,7 @@ namespace System.Diagnostics.Eventing.Reader {
}
}
- [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "[....]: Shipped public in 3.5, breaking change to fix now.")]
+ [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "Microsoft: Shipped public in 3.5, breaking change to fix now.")]
public EventOpcode Opcode {
get {
return new EventOpcode(this.opcode, this.pmReference);
diff --git a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventOpcode.cs b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventOpcode.cs
index c597a47c226..f930037c34e 100644
--- a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventOpcode.cs
+++ b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventOpcode.cs
@@ -20,7 +20,7 @@ using System.Diagnostics.CodeAnalysis;
namespace System.Diagnostics.Eventing.Reader {
[System.Security.Permissions.HostProtection(MayLeakOnAbort = true)]
- [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "[....]: Shipped public in 3.5, breaking change to fix now.")]
+ [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "Microsoft: Shipped public in 3.5, breaking change to fix now.")]
public sealed class EventOpcode {
private int value;
private string name;
diff --git a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventRecord.cs b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventRecord.cs
index e50e1f0e493..c81eb96bfa0 100644
--- a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventRecord.cs
+++ b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventRecord.cs
@@ -30,7 +30,7 @@ namespace System.Diagnostics.Eventing.Reader {
public abstract byte? Level { get; }
public abstract int? Task { get; }
- [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "[....]: Shipped public in 3.5, breaking change to fix now.")]
+ [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "Microsoft: Shipped public in 3.5, breaking change to fix now.")]
public abstract short? Opcode { get; }
public abstract long? Keywords { get; }
@@ -55,7 +55,7 @@ namespace System.Diagnostics.Eventing.Reader {
public abstract string LevelDisplayName { get; }
- [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "[....]: Shipped public in 3.5, breaking change to fix now.")]
+ [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "Microsoft: Shipped public in 3.5, breaking change to fix now.")]
public abstract string OpcodeDisplayName { get; }
public abstract string TaskDisplayName { get; }
public abstract IEnumerable<string> KeywordsDisplayNames { get; }
diff --git a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/ProviderMetadata.cs b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/ProviderMetadata.cs
index fc82c705836..b1cf7fc07cb 100644
--- a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/ProviderMetadata.cs
+++ b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/ProviderMetadata.cs
@@ -440,7 +440,7 @@ namespace System.Diagnostics.Eventing.Reader {
}
}
- [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcodes", Justification = "[....]: Shipped public in 3.5, breaking change to fix now.")]
+ [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcodes", Justification = "Microsoft: Shipped public in 3.5, breaking change to fix now.")]
public IList<EventOpcode> Opcodes {
get {
List<EventOpcode> eo;
diff --git a/mcs/class/referencesource/System.Core/System/IO/BufferedStream2.cs b/mcs/class/referencesource/System.Core/System/IO/BufferedStream2.cs
index d958460110f..ba1e49453bd 100644
--- a/mcs/class/referencesource/System.Core/System/IO/BufferedStream2.cs
+++ b/mcs/class/referencesource/System.Core/System/IO/BufferedStream2.cs
@@ -265,7 +265,7 @@ internal abstract class BufferedStream2 : Stream
// (either synchronously or asynchronously) before the first one
// returns. This would involve some sort of complex buffer locking
// that we probably don't want to get into, at least not in V1.
- // If we did a [....] read to fill the buffer, we could avoid the
+ // If we did a sync read to fill the buffer, we could avoid the
// problem, and any async read less than 64K gets turned into a
// synchronous read by NT anyways... --
@@ -508,7 +508,7 @@ internal abstract class BufferedStream2 : Stream
// Reading is done by blocks from the file, but someone could read
// 1 byte from the buffer then write. At that point, the OS's file
- // pointer is out of [....] with the stream's position. All write
+ // pointer is out of sync with the stream's position. All write
// functions should call this function to preserve the position in the file.
[MethodImplAttribute(MethodImplOptions.Synchronized)]
protected void FlushRead() {
diff --git a/mcs/class/referencesource/System.Core/System/IO/LogStream.cs b/mcs/class/referencesource/System.Core/System/IO/LogStream.cs
index 69179635a8e..37b0623d37d 100644
--- a/mcs/class/referencesource/System.Core/System/IO/LogStream.cs
+++ b/mcs/class/referencesource/System.Core/System/IO/LogStream.cs
@@ -278,7 +278,7 @@ internal class LogStream : BufferedStream2
}
if (r == 0) {
- // We should never silently ---- an error here without some
+ // We should never silently swallow an error here without some
// extra work. We must make sure that BeginWriteCore won't return an
// IAsyncResult that will cause EndWrite to block, since the OS won't
// call AsyncFSCallback for us.
diff --git a/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedView.cs b/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedView.cs
index 98e30f009f5..a88b941d0c7 100644
--- a/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedView.cs
+++ b/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedView.cs
@@ -167,7 +167,7 @@ namespace System.IO.MemoryMappedFiles {
}
- // Flushes the changes such that they are in [....] with the FileStream bits (ones obtained
+ // Flushes the changes such that they are in sync with the FileStream bits (ones obtained
// with the win32 ReadFile and WriteFile functions). Need to call FileStream's Flush to
// flush to the disk.
// NOTE: This will flush all bytes before and after the view up until an offset that is a multiple
diff --git a/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedViewAccessor.cs b/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedViewAccessor.cs
index 3df123c5509..c79b81dfe1a 100644
--- a/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedViewAccessor.cs
+++ b/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedViewAccessor.cs
@@ -76,7 +76,7 @@ namespace System.IO.MemoryMappedFiles {
}
}
- // Flushes the changes such that they are in [....] with the FileStream bits (ones obtained
+ // Flushes the changes such that they are in sync with the FileStream bits (ones obtained
// with the win32 ReadFile and WriteFile functions). Need to call FileStream's Flush to
// flush to the disk.
// NOTE: This will flush all bytes before and after the view up until an offset that is a
diff --git a/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedViewStream.cs b/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedViewStream.cs
index 283048b069c..c531a45d5ca 100644
--- a/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedViewStream.cs
+++ b/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedViewStream.cs
@@ -78,7 +78,7 @@ namespace System.IO.MemoryMappedFiles {
}
}
- // Flushes the changes such that they are in [....] with the FileStream bits (ones obtained
+ // Flushes the changes such that they are in sync with the FileStream bits (ones obtained
// with the win32 ReadFile and WriteFile functions). Need to call FileStream's Flush to
// flush to the disk.
// NOTE: This will flush all bytes before and after the view up until an offset that is a
diff --git a/mcs/class/referencesource/System.Core/System/IO/Pipes/PipeStream.cs b/mcs/class/referencesource/System.Core/System/IO/Pipes/PipeStream.cs
index d3b913c00ac..02018024c39 100644
--- a/mcs/class/referencesource/System.Core/System/IO/Pipes/PipeStream.cs
+++ b/mcs/class/referencesource/System.Core/System/IO/Pipes/PipeStream.cs
@@ -256,7 +256,7 @@ namespace System.IO.Pipes {
CheckReadOperations();
if (!m_isAsync) {
- // special case when this is called for [....] broken pipes because otherwise Stream's
+ // special case when this is called for sync broken pipes because otherwise Stream's
// Begin/EndRead hang. Reads return 0 bytes in this case so we can call the user's
// callback immediately
if (m_state == PipeState.Broken) {
@@ -645,7 +645,7 @@ namespace System.IO.Pipes {
}
if (r == 0) {
- // We should never silently ---- an error here without some
+ // We should never silently swallow an error here without some
// extra work. We must make sure that BeginReadCore won't return an
// IAsyncResult that will cause EndRead to block, since the OS won't
// call AsyncPSCallback for us.
@@ -695,7 +695,7 @@ namespace System.IO.Pipes {
}
if (r == 0) {
- // We should never silently ---- an error here without some
+ // We should never silently swallow an error here without some
// extra work. We must make sure that BeginWriteCore won't return an
// IAsyncResult that will cause EndWrite to block, since the OS won't
// call AsyncPSCallback for us.
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Enumerable.cs b/mcs/class/referencesource/System.Core/System/Linq/Enumerable.cs
index d1dc03000a9..aef6a32d8ec 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Enumerable.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Enumerable.cs
@@ -2152,7 +2152,7 @@ namespace System.Linq
internal int InternalGetHashCode(TKey key)
{
- //[....] DevDivBugs 171937. work around comparer implementations that throw when passed null
+ //Microsoft DevDivBugs 171937. work around comparer implementations that throw when passed null
return (key == null) ? 0 : comparer.GetHashCode(key) & 0x7FFFFFFF;
}
@@ -2370,7 +2370,7 @@ namespace System.Linq
internal int InternalGetHashCode(TElement value)
{
- //[....] DevDivBugs 171937. work around comparer implementations that throw when passed null
+ //Microsoft DevDivBugs 171937. work around comparer implementations that throw when passed null
return (value == null) ? 0 : comparer.GetHashCode(value) & 0x7FFFFFFF;
}
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Channels/AsynchronousChannel.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Channels/AsynchronousChannel.cs
index d249e8749f3..0024bf3c90c 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Channels/AsynchronousChannel.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Channels/AsynchronousChannel.cs
@@ -7,7 +7,7 @@
//
// AsynchronousOneToOneChannel.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Channels/SynchronousChannel.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Channels/SynchronousChannel.cs
index ac27781a039..79cdc7a9b01 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Channels/SynchronousChannel.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Channels/SynchronousChannel.cs
@@ -7,7 +7,7 @@
//
// SynchronousChannel.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/AggregationMinMaxHelpers.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/AggregationMinMaxHelpers.cs
index af69de8aa37..3d560db8ca9 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/AggregationMinMaxHelpers.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/AggregationMinMaxHelpers.cs
@@ -7,7 +7,7 @@
//
// AggregationMinMaxHelpers.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/EmptyEnumerable.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/EmptyEnumerable.cs
index 56c3c621c83..0d3335d7d3e 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/EmptyEnumerable.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/EmptyEnumerable.cs
@@ -7,7 +7,7 @@
//
// EmptyEnumerable.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/EnumerableWrapperWeakToStrong.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/EnumerableWrapperWeakToStrong.cs
index 95dbb1e0e65..6d7ec46c713 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/EnumerableWrapperWeakToStrong.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/EnumerableWrapperWeakToStrong.cs
@@ -7,7 +7,7 @@
//
// EnumerableWrapperWeakToStrong.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/OrderedParallelQuery.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/OrderedParallelQuery.cs
index 07e4c2a1f5a..70167618e2d 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/OrderedParallelQuery.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/OrderedParallelQuery.cs
@@ -7,7 +7,7 @@
//
// OrderedParallelQuery.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/ParallelEnumerableWrapper.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/ParallelEnumerableWrapper.cs
index 8c5fb1912a8..31d072f3b07 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/ParallelEnumerableWrapper.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/ParallelEnumerableWrapper.cs
@@ -7,7 +7,7 @@
//
// ParallelEnumerableWrapper.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/ParallelQuery.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/ParallelQuery.cs
index 9503c3043f0..b9a9477a706 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/ParallelQuery.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/ParallelQuery.cs
@@ -7,7 +7,7 @@
//
// ParallelQuery.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// ParallelQuery is an abstract class that represents a PLINQ query.
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/RangeEnumerable.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/RangeEnumerable.cs
index 1bb58a81f1f..8c580844613 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/RangeEnumerable.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/RangeEnumerable.cs
@@ -7,7 +7,7 @@
//
// RangeEnumerable.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/RepeatEnumerable.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/RepeatEnumerable.cs
index 1998eabb085..6951c939b73 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/RepeatEnumerable.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/RepeatEnumerable.cs
@@ -7,7 +7,7 @@
//
// RepeatEnumerable.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/ArrayMergeHelper.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/ArrayMergeHelper.cs
index 97559c5fd41..feebc57bf3f 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/ArrayMergeHelper.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/ArrayMergeHelper.cs
@@ -7,7 +7,7 @@
//
// ArrayMergeHelper.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/AsynchronousChannelMergeEnumerator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/AsynchronousChannelMergeEnumerator.cs
index 599f13ae481..b76d1e42705 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/AsynchronousChannelMergeEnumerator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/AsynchronousChannelMergeEnumerator.cs
@@ -7,7 +7,7 @@
//
// AsynchronousChannelMergeEnumerator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/DefaultMergeHelper.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/DefaultMergeHelper.cs
index d1115094aa8..b288fffec16 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/DefaultMergeHelper.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/DefaultMergeHelper.cs
@@ -7,7 +7,7 @@
//
// DefaultMergeHelper.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
@@ -32,7 +32,7 @@ namespace System.Linq.Parallel
private QueryTaskGroupState m_taskGroupState; // State shared among tasks.
private PartitionedStream<TInputOutput, TIgnoreKey> m_partitions; // Source partitions.
private AsynchronousChannel<TInputOutput>[] m_asyncChannels; // Destination channels (async).
- private SynchronousChannel<TInputOutput>[] m_syncChannels; // Destination channels ([....]).
+ private SynchronousChannel<TInputOutput>[] m_syncChannels; // Destination channels (sync).
private IEnumerator<TInputOutput> m_channelEnumerator; // Output enumerator.
private TaskScheduler m_taskScheduler; // The task manager to execute the query.
private bool m_ignoreOutput; // Whether we're enumerating "for effect".
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/MergeEnumerator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/MergeEnumerator.cs
index 8fac0d62c9e..da0298ce180 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/MergeEnumerator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/MergeEnumerator.cs
@@ -7,7 +7,7 @@
//
// MergeEnumerator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/MergeExecutor.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/MergeExecutor.cs
index f3136f12e33..2e0d8d90167 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/MergeExecutor.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/MergeExecutor.cs
@@ -7,7 +7,7 @@
//
// MergeExecutor.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/OrderPreservingMergeHelper.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/OrderPreservingMergeHelper.cs
index d456534525d..b7015a48d73 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/OrderPreservingMergeHelper.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/OrderPreservingMergeHelper.cs
@@ -7,7 +7,7 @@
//
// OrderPreservingMergeHelper.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/OrderPreservingPipeliningMergeHelper.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/OrderPreservingPipeliningMergeHelper.cs
index f9fc2bc4907..5da2671db26 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/OrderPreservingPipeliningMergeHelper.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/OrderPreservingPipeliningMergeHelper.cs
@@ -7,7 +7,7 @@
//
// OrderPreservingPipeliningMergeHelper.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/SynchronousChannelMergeEnumerator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/SynchronousChannelMergeEnumerator.cs
index ba302d41696..0bdc6ea7c4c 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/SynchronousChannelMergeEnumerator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/SynchronousChannelMergeEnumerator.cs
@@ -7,7 +7,7 @@
//
// SynchronousChannelMergeEnumerator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/HashRepartitionEnumerator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/HashRepartitionEnumerator.cs
index 5f8cd482ee8..001eb1b3153 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/HashRepartitionEnumerator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/HashRepartitionEnumerator.cs
@@ -7,7 +7,7 @@
//
// HashRepartitionEnumerator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/HashRepartitionStream.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/HashRepartitionStream.cs
index 96aaf2d4cee..949e4f41974 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/HashRepartitionStream.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/HashRepartitionStream.cs
@@ -7,7 +7,7 @@
//
// HashPartitionedStream.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/OrderedHashRepartitionEnumerator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/OrderedHashRepartitionEnumerator.cs
index 39ca3fb0320..35865feb936 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/OrderedHashRepartitionEnumerator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/OrderedHashRepartitionEnumerator.cs
@@ -7,7 +7,7 @@
//
// OrderedHashRepartitionEnumerator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/OrderedHashRepartitionStream.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/OrderedHashRepartitionStream.cs
index f12862e8fe8..dfd79fd6891 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/OrderedHashRepartitionStream.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/OrderedHashRepartitionStream.cs
@@ -7,7 +7,7 @@
//
// OrderedHashRepartitionStream.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/PartitionedDataSource.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/PartitionedDataSource.cs
index e9f639c79d2..2f661a9e36f 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/PartitionedDataSource.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/PartitionedDataSource.cs
@@ -7,7 +7,7 @@
//
// PartitionedDataSource.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/PartitionedStream.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/PartitionedStream.cs
index dd6c687fea9..fc7477fe3b3 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/PartitionedStream.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/PartitionedStream.cs
@@ -7,7 +7,7 @@
//
// PartitionedStream.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/UnorderedHashRepartitionStream.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/UnorderedHashRepartitionStream.cs
index b8d1e6be923..7edc4d07da8 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/UnorderedHashRepartitionStream.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/UnorderedHashRepartitionStream.cs
@@ -7,7 +7,7 @@
//
// UnorderedHashRepartitionStream.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/AssociativeAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/AssociativeAggregationOperator.cs
index 6df8e3e6c08..add046683ad 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/AssociativeAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/AssociativeAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// AssociativeAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/ExceptQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/ExceptQueryOperator.cs
index d84be6b56c2..c8a8d2206ab 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/ExceptQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/ExceptQueryOperator.cs
@@ -7,7 +7,7 @@
//
// ExceptQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/GroupJoinQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/GroupJoinQueryOperator.cs
index a56fe2f6710..60b6befd6a5 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/GroupJoinQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/GroupJoinQueryOperator.cs
@@ -7,7 +7,7 @@
//
// GroupJoinQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/HashJoinQueryOperatorEnumerator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/HashJoinQueryOperatorEnumerator.cs
index 88196b52650..e09d4d92b33 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/HashJoinQueryOperatorEnumerator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/HashJoinQueryOperatorEnumerator.cs
@@ -7,7 +7,7 @@
//
// HashJoinQueryOperatorEnumerator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/IntersectQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/IntersectQueryOperator.cs
index 86979515448..3ce35c451c4 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/IntersectQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/IntersectQueryOperator.cs
@@ -7,7 +7,7 @@
//
// IntersectQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/JoinQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/JoinQueryOperator.cs
index a80990550f2..9dbd672ec47 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/JoinQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/JoinQueryOperator.cs
@@ -7,7 +7,7 @@
//
// JoinQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/UnionQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/UnionQueryOperator.cs
index 8dec8d4d72c..0c09ce1fbf1 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/UnionQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/UnionQueryOperator.cs
@@ -7,7 +7,7 @@
//
// UnionQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/ZipQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/ZipQueryOperator.cs
index 3b2d74cfdcb..3465f80d43d 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/ZipQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/ZipQueryOperator.cs
@@ -7,7 +7,7 @@
//
// ZipQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/BinaryQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/BinaryQueryOperator.cs
index f159f1c2575..3beed03e1ec 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/BinaryQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/BinaryQueryOperator.cs
@@ -7,7 +7,7 @@
//
// BinaryQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/CountAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/CountAggregationOperator.cs
index 84ae158c3c8..95b660b22f5 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/CountAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/CountAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// CountAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalAverageAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalAverageAggregationOperator.cs
index f7e86aaa2fe..d321018d7c0 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalAverageAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalAverageAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// DecimalAverageAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalMinMaxAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalMinMaxAggregationOperator.cs
index 55e2f78e885..eaa22795ffd 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalMinMaxAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalMinMaxAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// DecimalMinMaxAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalSumAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalSumAggregationOperator.cs
index 17d0658b9cd..30560fecc3a 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalSumAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalSumAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// DecimalSumAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleAverageAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleAverageAggregationOperator.cs
index 5d6aa8e41a8..dba1e102131 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleAverageAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleAverageAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// DoubleAverageAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleMinMaxAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleMinMaxAggregationOperator.cs
index 85c2e84cc23..a7cd5df6580 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleMinMaxAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleMinMaxAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// DoubleMinMaxAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleSumAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleSumAggregationOperator.cs
index c464be0957f..b2477cfd7d0 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleSumAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleSumAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// DoubleSumAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatAverageAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatAverageAggregationOperator.cs
index 8d310b488b4..d2d294f1f0b 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatAverageAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatAverageAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// FloatAverageAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatMinMaxAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatMinMaxAggregationOperator.cs
index 1cc5d0d25b9..10be7b55eff 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatMinMaxAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatMinMaxAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// FloatMinMaxAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatSumAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatSumAggregationOperator.cs
index 03949d7aa0e..ecf0656a9d2 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatSumAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatSumAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// FloatSumAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperator.cs
index 31ba533d8cc..865ccaac7bd 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// InlinedAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperatorEnumerator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperatorEnumerator.cs
index 416844cfbec..b53d200df55 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperatorEnumerator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperatorEnumerator.cs
@@ -7,7 +7,7 @@
//
// InlinedAggregationOperatorEnumerator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntAverageAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntAverageAggregationOperator.cs
index 9733071e8c3..88a779aeb6c 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntAverageAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntAverageAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// IntAverageAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntMinMaxAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntMinMaxAggregationOperator.cs
index 5bd686ab5d1..469a9034603 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntMinMaxAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntMinMaxAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// IntMinMaxAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntSumAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntSumAggregationOperator.cs
index f57f4ec529c..28b5048b0c3 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntSumAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntSumAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// IntSumAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongAverageAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongAverageAggregationOperator.cs
index 61478be33bc..3de0feed309 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongAverageAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongAverageAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// LongAverageAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongCountAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongCountAggregationOperator.cs
index 4332cee8375..1c1ecc3a3ad 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongCountAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongCountAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// CountAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongMinMaxAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongMinMaxAggregationOperator.cs
index 0c7bdfbd861..bb45b5b837d 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongMinMaxAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongMinMaxAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// LongMinMaxAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongSumAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongSumAggregationOperator.cs
index df856cc34bf..bc29d47ba62 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongSumAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongSumAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// LongSumAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalAverageAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalAverageAggregationOperator.cs
index 246aa40dcd3..cdaf0301e96 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalAverageAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalAverageAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// NullableDecimalAverageAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalMinMaxAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalMinMaxAggregationOperator.cs
index 8d78b129de1..abbacb4e2fc 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalMinMaxAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalMinMaxAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// NullableDecimalMinMaxAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalSumAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalSumAggregationOperator.cs
index 2602c9eb2eb..5c32e0cc871 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalSumAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalSumAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// NullableDecimalSumAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleAverageAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleAverageAggregationOperator.cs
index 69b52aaa373..44eb13ad651 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleAverageAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleAverageAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// NullableDoubleAverageAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleMinMaxAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleMinMaxAggregationOperator.cs
index 7b44277649e..a2a7fcb3e4a 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleMinMaxAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleMinMaxAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// NullableDoubleMinMaxAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleSumAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleSumAggregationOperator.cs
index 9f92f75d1ea..f1ced299faa 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleSumAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleSumAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// NullableDoubleSumAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatAverageAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatAverageAggregationOperator.cs
index 2b7c0d4524a..b33baf58aa3 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatAverageAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatAverageAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// NullableFloatAverageAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatMinMaxAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatMinMaxAggregationOperator.cs
index b1b8064e067..8180ef53427 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatMinMaxAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatMinMaxAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// NullableFloatMinMaxAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatSumAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatSumAggregationOperator.cs
index d2ea8a423d3..d4aa289c0f7 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatSumAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatSumAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// NullableFloatSumAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntAverageAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntAverageAggregationOperator.cs
index 4604a595f5b..ea9bcd10da3 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntAverageAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntAverageAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// NullableIntAverageAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntMinMaxAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntMinMaxAggregationOperator.cs
index 5c57d26b0b0..6ff77bd7ed9 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntMinMaxAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntMinMaxAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// NullableIntMinMaxAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntSumAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntSumAggregationOperator.cs
index c00fdb01d69..14389d8fc1b 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntSumAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntSumAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// NullableIntSumAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongAverageAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongAverageAggregationOperator.cs
index ddf75c89fee..bacb98750b6 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongAverageAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongAverageAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// NullableLongAverageAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongMinMaxAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongMinMaxAggregationOperator.cs
index 7d4e369d90c..824bb98a49e 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongMinMaxAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongMinMaxAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// NullableLongMinMaxAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongSumAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongSumAggregationOperator.cs
index 97e53a64eaa..313e7c18255 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongSumAggregationOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongSumAggregationOperator.cs
@@ -7,7 +7,7 @@
//
// NullableLongSumAggregationOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/ListQueryResults.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/ListQueryResults.cs
index 55069c3b3cf..e55d313c01d 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/ListQueryResults.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/ListQueryResults.cs
@@ -7,7 +7,7 @@
//
// ListQueryResults.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/OrderingQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/OrderingQueryOperator.cs
index 08ae2840d33..24e19ae3639 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/OrderingQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/OrderingQueryOperator.cs
@@ -7,7 +7,7 @@
//
// OrderingQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/QueryExecutionOption.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/QueryExecutionOption.cs
index 1bef24bedac..8ddc796458a 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/QueryExecutionOption.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/QueryExecutionOption.cs
@@ -7,7 +7,7 @@
//
// QueryExecutionOption.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/PartitionedStreamMerger.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/PartitionedStreamMerger.cs
index 282c6cd90c2..77682f6954e 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/PartitionedStreamMerger.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/PartitionedStreamMerger.cs
@@ -7,7 +7,7 @@
//
// PartitionedStreamMerger.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/PartitionerQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/PartitionerQueryOperator.cs
index c239cb7e4f4..62ed43dba2c 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/PartitionerQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/PartitionerQueryOperator.cs
@@ -7,7 +7,7 @@
//
// PartitionerQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOpeningEnumerator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOpeningEnumerator.cs
index 570b9e4ab05..4ed5e6f2f80 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOpeningEnumerator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOpeningEnumerator.cs
@@ -7,7 +7,7 @@
//
// QueryOpeningEnumerator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOperator.cs
index c83015bb314..60d656c1e02 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOperator.cs
@@ -7,7 +7,7 @@
//
// QueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOperatorEnumerator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOperatorEnumerator.cs
index db776f87878..6f78b8177a5 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOperatorEnumerator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOperatorEnumerator.cs
@@ -7,7 +7,7 @@
//
// QueryOperatorEnumerator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryResults.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryResults.cs
index cee66591f77..d062a698ec3 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryResults.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryResults.cs
@@ -7,7 +7,7 @@
//
// QueryResults.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QuerySettings.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QuerySettings.cs
index 08f410f9821..84b6c8826cd 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QuerySettings.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QuerySettings.cs
@@ -7,7 +7,7 @@
//
// QuerySettings.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/ScanQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/ScanQueryOperator.cs
index e70b13e18a9..1310302c208 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/ScanQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/ScanQueryOperator.cs
@@ -7,7 +7,7 @@
//
// ScanQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/AnyAllSearchOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/AnyAllSearchOperator.cs
index fd4b201e7c5..2dc5b284f3c 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/AnyAllSearchOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/AnyAllSearchOperator.cs
@@ -7,7 +7,7 @@
//
// AnyAllSearchOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ConcatQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ConcatQueryOperator.cs
index 6f8c4a521f5..28cdf90facd 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ConcatQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ConcatQueryOperator.cs
@@ -7,7 +7,7 @@
//
// ConcatQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ContainsSearchOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ContainsSearchOperator.cs
index 78de1005198..b417480520b 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ContainsSearchOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ContainsSearchOperator.cs
@@ -7,7 +7,7 @@
//
// ContainsSearchOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/DefaultIfEmptyQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/DefaultIfEmptyQueryOperator.cs
index 9a03469950e..6611cc28063 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/DefaultIfEmptyQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/DefaultIfEmptyQueryOperator.cs
@@ -7,7 +7,7 @@
//
// DefaultIfEmptyQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/DistinctQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/DistinctQueryOperator.cs
index 4de47cea4e9..fc5ecd5f7eb 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/DistinctQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/DistinctQueryOperator.cs
@@ -7,7 +7,7 @@
//
// DistinctQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ElementAtQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ElementAtQueryOperator.cs
index 0560b753f52..70660e9fc8f 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ElementAtQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ElementAtQueryOperator.cs
@@ -7,7 +7,7 @@
//
// ElementAtQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/FirstQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/FirstQueryOperator.cs
index 38c143c5f13..8181237ca9f 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/FirstQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/FirstQueryOperator.cs
@@ -7,7 +7,7 @@
//
// FirstQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ForAllOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ForAllOperator.cs
index 86761040257..825d755f494 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ForAllOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ForAllOperator.cs
@@ -7,7 +7,7 @@
//
// ForAllQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/GroupByQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/GroupByQueryOperator.cs
index ed3b2f44066..ab4d272540d 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/GroupByQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/GroupByQueryOperator.cs
@@ -7,7 +7,7 @@
//
// GroupByQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/IndexedSelectQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/IndexedSelectQueryOperator.cs
index f1d0e5ef3e5..1a304e4598b 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/IndexedSelectQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/IndexedSelectQueryOperator.cs
@@ -7,7 +7,7 @@
//
// IndexedSelectQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/IndexedWhereQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/IndexedWhereQueryOperator.cs
index a4d65f3cfb6..fddb9926020 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/IndexedWhereQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/IndexedWhereQueryOperator.cs
@@ -7,7 +7,7 @@
//
// IndexedWhereQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/LastQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/LastQueryOperator.cs
index 8b354de110a..f4a74d0c71a 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/LastQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/LastQueryOperator.cs
@@ -7,7 +7,7 @@
//
// LastQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ReverseQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ReverseQueryOperator.cs
index d66add1195f..9f4a4eece69 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ReverseQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ReverseQueryOperator.cs
@@ -7,7 +7,7 @@
//
// ReverseQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SelectManyQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SelectManyQueryOperator.cs
index 741bb24cd86..8a4c0f3e7d1 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SelectManyQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SelectManyQueryOperator.cs
@@ -7,7 +7,7 @@
//
// SelectManyQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SelectQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SelectQueryOperator.cs
index 2301c1d0646..7eaa46765f1 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SelectQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SelectQueryOperator.cs
@@ -7,7 +7,7 @@
//
// SelectQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SingleQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SingleQueryOperator.cs
index d5539ceaf8d..c2cb9d451fa 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SingleQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SingleQueryOperator.cs
@@ -7,7 +7,7 @@
//
// SingleQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SortQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SortQueryOperator.cs
index 02d220bce78..ce2235d9cda 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SortQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SortQueryOperator.cs
@@ -7,7 +7,7 @@
//
// SortQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipQueryOperator.cs
index c0c708a7c38..67a70ce8f18 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipQueryOperator.cs
@@ -7,7 +7,7 @@
//
// TakeOrSkipQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipWhileQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipWhileQueryOperator.cs
index a04bf2bfb9c..64f089adc01 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipWhileQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipWhileQueryOperator.cs
@@ -7,7 +7,7 @@
//
// TakeOrSkipWhileQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/WhereQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/WhereQueryOperator.cs
index 3ec343a9f0f..d447915d871 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/WhereQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/WhereQueryOperator.cs
@@ -7,7 +7,7 @@
//
// WhereQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/UnaryQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/UnaryQueryOperator.cs
index b66aa49f721..0baa5ad628d 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/UnaryQueryOperator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/UnaryQueryOperator.cs
@@ -7,7 +7,7 @@
//
// UnaryQueryOperator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/CancellationState.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/CancellationState.cs
index c084abb4b73..e84bced8117 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/CancellationState.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/CancellationState.cs
@@ -7,7 +7,7 @@
//
// CancellationState.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// A bag of cancellation-related items that are passed around as a group.
//
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingPipeliningSpoolingTask.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingPipeliningSpoolingTask.cs
index 598d1e13aa3..2137a9ba274 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingPipeliningSpoolingTask.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingPipeliningSpoolingTask.cs
@@ -7,7 +7,7 @@
//
// OrderPreservingPipeliningSpoolingTask.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingSpoolingTask.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingSpoolingTask.cs
index 478533db208..20c75157119 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingSpoolingTask.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingSpoolingTask.cs
@@ -7,7 +7,7 @@
//
// OrderPreservingSpoolingTask.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryLifecycle.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryLifecycle.cs
index 92ead1bfb7f..3f0e70731b5 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryLifecycle.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryLifecycle.cs
@@ -7,7 +7,7 @@
//
// QueryLifecycle.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// A convenient place to put things associated with entire queries and their lifecycle events.
//
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryTask.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryTask.cs
index 97dc14d53cc..7ca188a354f 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryTask.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryTask.cs
@@ -7,7 +7,7 @@
//
// QueryTask.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
@@ -88,7 +88,7 @@ namespace System.Linq.Parallel
}
//-----------------------------------------------------------------------------------
- // Common function called regardless of [....] or async execution. Just wraps some
+ // Common function called regardless of sync or async execution. Just wraps some
// amount of tracing around the call to the real work API.
//
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryTaskGroupState.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryTaskGroupState.cs
index f3666afb068..bb802725bbb 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryTaskGroupState.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryTaskGroupState.cs
@@ -7,7 +7,7 @@
//
// QueryTaskGroupState.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/Scheduling.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/Scheduling.cs
index f43d3fdd52f..306b5411b33 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/Scheduling.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/Scheduling.cs
@@ -7,7 +7,7 @@
//
// Scheduling.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Infrastructure for setting up concurrent work, marshaling exceptions, determining
// the recommended degree-of-parallelism, and so forth.
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/SpoolingTask.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/SpoolingTask.cs
index ab614a04733..a8016015088 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/SpoolingTask.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/SpoolingTask.cs
@@ -7,7 +7,7 @@
//
// SpoolingTask.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/SpoolingTaskBase.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/SpoolingTaskBase.cs
index fdbe37adf1e..26d878fe0bc 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/SpoolingTaskBase.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/SpoolingTaskBase.cs
@@ -7,7 +7,7 @@
//
// SpoolingTaskBase.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/CancellableEnumerable.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/CancellableEnumerable.cs
index fc3855ea7be..8eb45c4ba21 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/CancellableEnumerable.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/CancellableEnumerable.cs
@@ -7,7 +7,7 @@
//
// CancellableEnumerable.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ExceptionAggregator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ExceptionAggregator.cs
index 7423b7edab9..1a9b354fea2 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ExceptionAggregator.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ExceptionAggregator.cs
@@ -7,7 +7,7 @@
//
// ExceptionAggregator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ExchangeUtilities.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ExchangeUtilities.cs
index 7df87b5a4cf..c52cec2fabf 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ExchangeUtilities.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ExchangeUtilities.cs
@@ -7,7 +7,7 @@
//
// ExchangeUtilities.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/FixedMaxHeap.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/FixedMaxHeap.cs
index 74f4f6fb636..43547483f5b 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/FixedMaxHeap.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/FixedMaxHeap.cs
@@ -7,7 +7,7 @@
//
// FixedMaxHeap.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/GrowingArray.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/GrowingArray.cs
index 7e431a8d215..ccb3d1f97a2 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/GrowingArray.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/GrowingArray.cs
@@ -7,7 +7,7 @@
//
// GrowingArray.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/HashLookup.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/HashLookup.cs
index 5cbd0bb5e60..8251e6c6bea 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/HashLookup.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/HashLookup.cs
@@ -7,7 +7,7 @@
//
// HashLookup.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ListChunk.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ListChunk.cs
index 2b0b099c6d9..8ae36104498 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ListChunk.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ListChunk.cs
@@ -7,7 +7,7 @@
//
// ListChunk.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Lookup.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Lookup.cs
index e3b1561f616..4b7a65c5cff 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Lookup.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Lookup.cs
@@ -7,7 +7,7 @@
//
// Lookup.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/PLINQETWProvider.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/PLINQETWProvider.cs
index 294a86d542b..bbfec3cd6e7 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/PLINQETWProvider.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/PLINQETWProvider.cs
@@ -7,7 +7,7 @@
//
// PlinqEtwProvider.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// EventSource for PLINQ.
//
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Pair.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Pair.cs
index 57ed99389bd..0c8ed3672e0 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Pair.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Pair.cs
@@ -7,7 +7,7 @@
//
// Pair.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/PairComparer.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/PairComparer.cs
index 99cf8fd1d65..ea0cc96ad13 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/PairComparer.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/PairComparer.cs
@@ -7,7 +7,7 @@
//
// PairComparer.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ReverseComparer.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ReverseComparer.cs
index b9ad3cced19..e8e81bd325a 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ReverseComparer.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ReverseComparer.cs
@@ -7,7 +7,7 @@
//
// ReverseComparer.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Shared.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Shared.cs
index ebe1953110b..28da58a616d 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Shared.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Shared.cs
@@ -7,7 +7,7 @@
//
// Shared.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Sorting.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Sorting.cs
index 5007e479c74..2b8e3376840 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Sorting.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Sorting.cs
@@ -7,7 +7,7 @@
//
// Sorting.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Support for sorting.
//
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/TraceHelpers.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/TraceHelpers.cs
index 5c1ad9f452d..00202eb30bc 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/TraceHelpers.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/TraceHelpers.cs
@@ -7,7 +7,7 @@
//
// TraceHelpers.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Common routines used to trace information about execution, the state of things, etc.
//
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Util.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Util.cs
index b877250e9b4..e15b085aa9f 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Util.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Util.cs
@@ -7,7 +7,7 @@
//
// Util.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Wrapper.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Wrapper.cs
index c96085b02b3..4878dedf2b7 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Wrapper.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Wrapper.cs
@@ -7,7 +7,7 @@
//
// Wrapper.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/WrapperEqualityComparer.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/WrapperEqualityComparer.cs
index c2cb403cec4..38fa75ba4bc 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/WrapperEqualityComparer.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/WrapperEqualityComparer.cs
@@ -7,7 +7,7 @@
//
// WrapperEqualityComparer.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/mcs/class/referencesource/System.Core/System/Linq/ParallelEnumerable.cs b/mcs/class/referencesource/System.Core/System/Linq/ParallelEnumerable.cs
index 89dd8d7697b..daa567abe08 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/ParallelEnumerable.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/ParallelEnumerable.cs
@@ -7,7 +7,7 @@
//
// ParallelEnumerable.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// The standard IEnumerable-based LINQ-to-Objects query provider. This class basically
// mirrors the System.Linq.Enumerable class, but (1) takes as input a special "parallel
diff --git a/mcs/class/referencesource/System.Core/System/Linq/SequenceQuery.cs b/mcs/class/referencesource/System.Core/System/Linq/SequenceQuery.cs
index 365a490d06d..1979d553630 100644
--- a/mcs/class/referencesource/System.Core/System/Linq/SequenceQuery.cs
+++ b/mcs/class/referencesource/System.Core/System/Linq/SequenceQuery.cs
@@ -96,7 +96,7 @@ namespace System.Linq {
// critical (which was the original annotation when porting to silverlight) would violate
// fxcop security rules if the interface isn't also critical. However, transparent code
// can't access this anyway for Mix since we're not exposing AsQueryable().
- // [....]: the above assertion no longer holds. Now making AsQueryable() public again
+ // Microsoft: the above assertion no longer holds. Now making AsQueryable() public again
// the security fallout of which will need to be re-examined.
object IQueryProvider.Execute(Expression expression){
if (expression == null)
diff --git a/mcs/class/referencesource/System.Core/System/Security/Cryptography/BCryptNative.cs b/mcs/class/referencesource/System.Core/System/Security/Cryptography/BCryptNative.cs
index f4d5ebecbcf..52532d2e2f3 100644
--- a/mcs/class/referencesource/System.Core/System/Security/Cryptography/BCryptNative.cs
+++ b/mcs/class/referencesource/System.Core/System/Security/Cryptography/BCryptNative.cs
@@ -75,9 +75,11 @@ namespace System.Security.Cryptography {
/// Well known algorithm names
/// </summary>
internal static class AlgorithmName {
+ public const string ECDH = "ECDH"; // BCRYPT_ECDH_ALGORITHM
public const string ECDHP256 = "ECDH_P256"; // BCRYPT_ECDH_P256_ALGORITHM
public const string ECDHP384 = "ECDH_P384"; // BCRYPT_ECDH_P384_ALGORITHM
public const string ECDHP521 = "ECDH_P521"; // BCRYPT_ECDH_P521_ALGORITHM
+ public const string ECDsa = "ECDSA"; // BCRYPT_ECDSA_ALGORITHM
public const string ECDsaP256 = "ECDSA_P256"; // BCRYPT_ECDSA_P256_ALGORITHM
public const string ECDsaP384 = "ECDSA_P384"; // BCRYPT_ECDSA_P384_ALGORITHM
public const string ECDsaP521 = "ECDSA_P521"; // BCRYPT_ECDSA_P521_ALGORITHM
@@ -183,6 +185,10 @@ namespace System.Security.Cryptography {
internal const string BCRYPT_ECCPUBLIC_BLOB = "ECCPUBLICBLOB";
internal const string BCRYPT_ECCPRIVATE_BLOB = "ECCPRIVATEBLOB";
+ internal const string BCRYPT_ECC_CURVE_NISTP256 = "nistP256";
+ internal const string BCRYPT_ECC_CURVE_NISTP384 = "nistP384";
+ internal const string BCRYPT_ECC_CURVE_NISTP521 = "nistP521";
+
/// <summary>
/// Well known BCrypt provider names
/// </summary>
diff --git a/mcs/class/referencesource/System.Core/System/Security/Cryptography/CngAlgorithm.cs b/mcs/class/referencesource/System.Core/System/Security/Cryptography/CngAlgorithm.cs
index 5cfafbab887..4b83b7687db 100644
--- a/mcs/class/referencesource/System.Core/System/Security/Cryptography/CngAlgorithm.cs
+++ b/mcs/class/referencesource/System.Core/System/Security/Cryptography/CngAlgorithm.cs
@@ -17,9 +17,11 @@ namespace System.Security.Cryptography {
[Serializable]
[System.Security.Permissions.HostProtection(MayLeakOnAbort = true)]
public sealed class CngAlgorithm : IEquatable<CngAlgorithm> {
+ private static volatile CngAlgorithm s_ecdh;
private static volatile CngAlgorithm s_ecdhp256;
private static volatile CngAlgorithm s_ecdhp384;
private static volatile CngAlgorithm s_ecdhp521;
+ private static volatile CngAlgorithm s_ecdsa;
private static volatile CngAlgorithm s_ecdsap256;
private static volatile CngAlgorithm s_ecdsap384;
private static volatile CngAlgorithm s_ecdsap521;
@@ -110,6 +112,18 @@ namespace System.Security.Cryptography {
}
}
+ public static CngAlgorithm ECDiffieHellman {
+ get {
+ Contract.Ensures(Contract.Result<CngAlgorithm>() != null);
+
+ if (s_ecdh == null) {
+ s_ecdh = new CngAlgorithm(BCryptNative.AlgorithmName.ECDH);
+ }
+
+ return s_ecdh;
+ }
+ }
+
public static CngAlgorithm ECDiffieHellmanP256 {
get {
Contract.Ensures(Contract.Result<CngAlgorithm>() != null);
@@ -146,6 +160,18 @@ namespace System.Security.Cryptography {
}
}
+ public static CngAlgorithm ECDsa {
+ get {
+ Contract.Ensures(Contract.Result<CngAlgorithm>() != null);
+
+ if (s_ecdsa == null) {
+ s_ecdsa = new CngAlgorithm(BCryptNative.AlgorithmName.ECDsa);
+ }
+
+ return s_ecdsa;
+ }
+ }
+
public static CngAlgorithm ECDsaP256 {
get {
Contract.Ensures(Contract.Result<CngAlgorithm>() != null);
@@ -241,17 +267,5 @@ namespace System.Security.Cryptography {
return s_sha512;
}
}
-
- public static CngAlgorithm ECDiffieHellman {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public static CngAlgorithm ECDsa {
- get {
- throw new NotImplementedException ();
- }
- }
}
}
diff --git a/mcs/class/referencesource/System.Core/System/Security/Cryptography/CngKey.cs b/mcs/class/referencesource/System.Core/System/Security/Cryptography/CngKey.cs
index 2429495c819..9bcc12360ba 100644
--- a/mcs/class/referencesource/System.Core/System/Security/Cryptography/CngKey.cs
+++ b/mcs/class/referencesource/System.Core/System/Security/Cryptography/CngKey.cs
@@ -30,7 +30,7 @@ namespace System.Security.Cryptography {
/// Managed representation of an NCrypt key
/// </summary>
[System.Security.Permissions.HostProtection(MayLeakOnAbort = true)]
- public sealed class CngKey : IDisposable {
+ public sealed partial class CngKey : IDisposable {
#if MONO
public CngAlgorithmGroup AlgorithmGroup {
[SecuritySafeCritical]
@@ -300,6 +300,15 @@ namespace System.Security.Cryptography {
return (CngExportPolicies)policy;
}
+
+ internal set {
+ var property = new CngProperty(
+ NCryptNative.KeyPropertyName.ExportPolicy,
+ BitConverter.GetBytes((int)value),
+ CngPropertyOptions.Persist);
+
+ SetProperty(property);
+ }
}
/// <summary>
@@ -403,6 +412,23 @@ namespace System.Security.Cryptography {
[SecuritySafeCritical]
get {
Contract.Assert(m_keyHandle != null);
+
+ // First, try the Win10+ Public Key Length property, it matches the purpose
+ // of this property better when it and Length disagree.
+ int keySize = 0;
+
+ NCryptNative.ErrorCode errorCode = NCryptNative.GetPropertyAsInt(
+ m_keyHandle,
+ NCryptNative.KeyPropertyName.PublicKeyLength,
+ CngPropertyOptions.None,
+ ref keySize);
+
+ // If the new property reports it was successful, use it.
+ // Otherwise, ask the old question.
+ if (errorCode == NCryptNative.ErrorCode.Success) {
+ return keySize;
+ }
+
return NCryptNative.GetPropertyAsDWord(m_keyHandle,
NCryptNative.KeyPropertyName.Length,
CngPropertyOptions.None);
@@ -730,10 +756,20 @@ namespace System.Security.Cryptography {
return Import(keyBlob, format, CngProvider.MicrosoftSoftwareKeyStorageProvider);
}
- [SecuritySafeCritical]
+ internal static CngKey Import(byte[] keyBlob, string curveName, CngKeyBlobFormat format) {
+ Contract.Ensures(Contract.Result<CngKey>() != null);
+ return Import(keyBlob, curveName, format, CngProvider.MicrosoftSoftwareKeyStorageProvider);
+ }
+
public static CngKey Import(byte[] keyBlob, CngKeyBlobFormat format, CngProvider provider) {
Contract.Ensures(Contract.Result<CngKey>() != null);
+ return Import(keyBlob, null, format, provider);
+ }
+ [SecuritySafeCritical]
+ internal static CngKey Import(byte[] keyBlob, string curveName, CngKeyBlobFormat format, CngProvider provider)
+ {
+ Contract.Ensures(Contract.Result<CngKey>() != null);
if (keyBlob == null) {
throw new ArgumentNullException("keyBlob");
}
@@ -753,6 +789,7 @@ namespace System.Security.Cryptography {
// permission. Since we won't know the name of the key until it's too late, we demand a full Import
// rather than one scoped to the key.
bool safeKeyImport = format == CngKeyBlobFormat.EccPublicBlob ||
+ format == CngKeyBlobFormat.EccFullPublicBlob ||
format == CngKeyBlobFormat.GenericPublicBlob;
if (!safeKeyImport) {
@@ -761,11 +798,17 @@ namespace System.Security.Cryptography {
// Import the key into the KSP
SafeNCryptProviderHandle kspHandle = NCryptNative.OpenStorageProvider(provider.Provider);
- SafeNCryptKeyHandle keyHandle = NCryptNative.ImportKey(kspHandle, keyBlob, format.Format);
+ SafeNCryptKeyHandle keyHandle;
+
+ if (curveName == null) {
+ keyHandle = NCryptNative.ImportKey(kspHandle, keyBlob, format.Format);
+ } else {
+ keyHandle = ECCng.ImportKeyBlob(format.Format, keyBlob, curveName, kspHandle);
+ }
// Prepare the key for use
CngKey key = new CngKey(kspHandle, keyHandle);
-
+
// We can't tell directly if an OpaqueTransport blob imported as an ephemeral key or not
key.IsEphemeral = format != CngKeyBlobFormat.OpaqueTransportBlob;
diff --git a/mcs/class/referencesource/System.Core/System/Security/Cryptography/CngKeyBlobFormat.cs b/mcs/class/referencesource/System.Core/System/Security/Cryptography/CngKeyBlobFormat.cs
index 8ee5e598f41..171e71c4a5a 100644
--- a/mcs/class/referencesource/System.Core/System/Security/Cryptography/CngKeyBlobFormat.cs
+++ b/mcs/class/referencesource/System.Core/System/Security/Cryptography/CngKeyBlobFormat.cs
@@ -20,6 +20,8 @@ namespace System.Security.Cryptography {
public sealed class CngKeyBlobFormat : IEquatable<CngKeyBlobFormat> {
private static volatile CngKeyBlobFormat s_eccPrivate;
private static volatile CngKeyBlobFormat s_eccPublic;
+ private static volatile CngKeyBlobFormat s_eccFullPrivate;
+ private static volatile CngKeyBlobFormat s_eccFullPublic;
private static volatile CngKeyBlobFormat s_genericPrivate;
private static volatile CngKeyBlobFormat s_genericPublic;
private static volatile CngKeyBlobFormat s_opaqueTransport;
@@ -121,13 +123,25 @@ namespace System.Security.Cryptography {
public static CngKeyBlobFormat EccFullPrivateBlob {
get {
- throw new NotImplementedException ();
+ Contract.Ensures(Contract.Result<CngKeyBlobFormat>() != null);
+
+ if (s_eccFullPrivate == null) {
+ s_eccFullPrivate = new CngKeyBlobFormat("ECCFULLPRIVATEBLOB"); // BCRYPT_ECCFULLPRIVATE_BLOB
+ }
+
+ return s_eccFullPrivate;
}
}
public static CngKeyBlobFormat EccFullPublicBlob {
get {
- throw new NotImplementedException ();
+ Contract.Ensures(Contract.Result<CngKeyBlobFormat>() != null);
+
+ if (s_eccFullPublic == null) {
+ s_eccFullPublic = new CngKeyBlobFormat("ECCFULLPUBLICBLOB"); // BCRYPT_ECCFULLPUBLIC_BLOB
+ }
+
+ return s_eccFullPublic;
}
}
diff --git a/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDiffieHellman.cs b/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDiffieHellman.cs
index 39a279372b4..36e999cb7de 100644
--- a/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDiffieHellman.cs
+++ b/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDiffieHellman.cs
@@ -41,6 +41,52 @@ namespace System.Security.Cryptography {
return CryptoConfig.CreateFromName(algorithm) as ECDiffieHellman;
}
+ /// <summary>
+ /// Creates a new instance of the default implementation of the Elliptic Curve Diffie-Hellman Algorithm
+ /// (ECDH) with a newly generated key over the specified curve.
+ /// </summary>
+ /// <param name="curve">The curve to use for key generation.</param>
+ /// <returns>A new instance of the default implementation of this class.</returns>
+ public static ECDiffieHellman Create(ECCurve curve)
+ {
+ ECDiffieHellman ecdh = Create();
+
+ if (ecdh != null) {
+ try {
+ ecdh.GenerateKey(curve);
+ }
+ catch {
+ ecdh.Dispose();
+ throw;
+ }
+ }
+
+ return ecdh;
+ }
+
+ /// <summary>
+ /// Creates a new instance of the default implementation of the Elliptic Curve Diffie-Hellman Algorithm
+ /// (ECDH) using the specified ECParameters as the key.
+ /// </summary>
+ /// <param name="parameters">The parameters representing the key to use.</param>
+ /// <returns>A new instance of the default implementation of this class.</returns>
+ public static ECDiffieHellman Create(ECParameters parameters)
+ {
+ ECDiffieHellman ecdh = Create();
+
+ if (ecdh != null) {
+ try {
+ ecdh.ImportParameters(parameters);
+ }
+ catch {
+ ecdh.Dispose();
+ throw;
+ }
+ }
+
+ return ecdh;
+ }
+
//
// Key derivation
//
@@ -142,5 +188,45 @@ namespace System.Security.Cryptography {
{
return new NotImplementedException(SR.GetString(SR.NotSupported_SubclassOverride));
}
+
+ /// <summary>
+ /// When overridden in a derived class, exports the named or explicit ECParameters for an ECCurve.
+ /// If the curve has a name, the Curve property will contain named curve parameters, otherwise it
+ /// will contain explicit parameters.
+ /// </summary>
+ /// <param name="includePrivateParameters">true to include private parameters, otherwise, false.</param>
+ /// <returns>The ECParameters representing the point on the curve for this key.</returns>
+ public virtual ECParameters ExportParameters(bool includePrivateParameters)
+ {
+ throw DerivedClassMustOverride();
+ }
+
+ /// <summary>
+ /// When overridden in a derived class, exports the explicit ECParameters for an ECCurve.
+ /// </summary>
+ /// <param name="includePrivateParameters">true to include private parameters, otherwise, false.</param>
+ /// <returns>The ECParameters representing the point on the curve for this key, using the explicit curve format.</returns>
+ public virtual ECParameters ExportExplicitParameters(bool includePrivateParameters)
+ {
+ throw DerivedClassMustOverride();
+ }
+
+ /// <summary>
+ /// When overridden in a derived class, imports the specified ECParameters.
+ /// </summary>
+ /// <param name="parameters">The curve parameters.</param>
+ public virtual void ImportParameters(ECParameters parameters)
+ {
+ throw DerivedClassMustOverride();
+ }
+
+ /// <summary>
+ /// When overridden in a derived class, generates a new public/private keypair for the specified curve.
+ /// </summary>
+ /// <param name="curve">The curve to use.</param>
+ public virtual void GenerateKey(ECCurve curve)
+ {
+ throw new NotSupportedException(SR.GetString(SR.NotSupported_SubclassOverride));
+ }
}
}
diff --git a/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDiffieHellmanCng.cs b/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDiffieHellmanCng.cs
index 4a555dae543..5b741341b51 100644
--- a/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDiffieHellmanCng.cs
+++ b/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDiffieHellmanCng.cs
@@ -60,6 +60,11 @@ namespace System.Security.Cryptography {
KeySize = keySize;
}
+ public ECDiffieHellmanCng(ECCurve curve) {
+ // GenerateKey will already do all of the validation we need.
+ GenerateKey(curve);
+ }
+
[SecuritySafeCritical]
public ECDiffieHellmanCng(CngKey key) {
Contract.Ensures(LegalKeySizesValue != null);
@@ -286,7 +291,7 @@ namespace System.Security.Cryptography {
public override ECDiffieHellmanPublicKey PublicKey {
get {
Contract.Ensures(Contract.Result<ECDiffieHellmanPublicKey>() != null);
- return new ECDiffieHellmanCngPublicKey(Key);
+ return ECDiffieHellmanCngPublicKey.FromKey(Key);
}
}
@@ -534,6 +539,19 @@ namespace System.Security.Cryptography {
}
}
+ public override void GenerateKey(ECCurve curve) {
+ curve.Validate();
+
+ if (m_key != null) {
+ m_key.Dispose();
+ m_key = null;
+ }
+
+ CngKey newKey = CngKey.Create(curve, name => CngKey.EcdhCurveNameToAlgorithm(name));
+ m_key = newKey;
+ KeySizeValue = newKey.KeySize;
+ }
+
//
// XML Import
//
@@ -554,7 +572,14 @@ namespace System.Security.Cryptography {
throw new ArgumentOutOfRangeException("format");
}
- Key = Rfc4050KeyFormatter.FromXml(xml);
+ bool isEcdh;
+ ECParameters ecParams = Rfc4050KeyFormatter.FromXml(xml, out isEcdh);
+
+ if (!isEcdh) {
+ throw new ArgumentException(SR.GetString(SR.Cryptography_ArgECDHRequiresECDHKey), "xml");
+ }
+
+ ImportParameters(ecParams);
}
//
@@ -576,7 +601,54 @@ namespace System.Security.Cryptography {
throw new ArgumentOutOfRangeException("format");
}
- return Rfc4050KeyFormatter.ToXml(Key);
+ ECParameters ecParams = ExportParameters(false);
+ return Rfc4050KeyFormatter.ToXml(ecParams, isEcdh: true);
+ }
+
+ /// <summary>
+ /// ImportParameters will replace the existing key that this object is working with by creating a
+ /// new CngKey. If the parameters contains only Q, then only a public key will be imported.
+ /// If the parameters also contains D, then a full key pair will be imported.
+ /// The parameters Curve value specifies the type of the curve to import.
+ /// </summary>
+ /// <exception cref="CryptographicException">
+ /// if <paramref name="parameters" /> does not contain valid values.
+ /// </exception>
+ /// <exception cref="NotSupportedException">
+ /// if <paramref name="parameters" /> references a curve that cannot be imported.
+ /// </exception>
+ /// <exception cref="PlatformNotSupportedException">
+ /// if <paramref name="parameters" /> references a curve that is not supported by this platform.
+ /// </exception>
+ public override void ImportParameters(ECParameters parameters) {
+ Key = ECCng.ImportEcdhParameters(ref parameters);
+ }
+
+ /// <summary>
+ /// Exports the key and explicit curve parameters used by the ECC object into an <see cref="ECParameters"/> object.
+ /// </summary>
+ /// <exception cref="CryptographicException">
+ /// if there was an issue obtaining the curve values.
+ /// </exception>
+ /// <exception cref="PlatformNotSupportedException">
+ /// if explicit export is not supported by this platform. Windows 10 or higher is required.
+ /// </exception>
+ /// <returns>The key and explicit curve parameters used by the ECC object.</returns>
+ public override ECParameters ExportExplicitParameters(bool includePrivateParameters) {
+ return ECCng.ExportExplicitParameters(Key, includePrivateParameters);
+ }
+
+ /// <summary>
+ /// Exports the key used by the ECC object into an <see cref="ECParameters"/> object.
+ /// If the key was created as a named curve, the Curve property will contain named curve parameters
+ /// otherwise it will contain explicit parameters.
+ /// </summary>
+ /// <exception cref="CryptographicException">
+ /// if there was an issue obtaining the curve values.
+ /// </exception>
+ /// <returns>The key and named curve parameters used by the ECC object.</returns>
+ public override ECParameters ExportParameters(bool includePrivateParameters) {
+ return ECCng.ExportParameters(Key, includePrivateParameters);
}
}
}
diff --git a/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDiffieHellmanCngPublicKey.cs b/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDiffieHellmanCngPublicKey.cs
index 67232bb0e90..0417c4fcc71 100644
--- a/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDiffieHellmanCngPublicKey.cs
+++ b/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDiffieHellmanCngPublicKey.cs
@@ -18,35 +18,20 @@ namespace System.Security.Cryptography {
[Serializable]
[System.Security.Permissions.HostProtection(MayLeakOnAbort = true)]
public sealed class ECDiffieHellmanCngPublicKey : ECDiffieHellmanPublicKey {
- [NonSerialized]
- private CngKey m_key;
private CngKeyBlobFormat m_format;
+ [OptionalField] private string m_curveName;
/// <summary>
/// Wrap a CNG key
/// </summary>
[SecuritySafeCritical]
- internal ECDiffieHellmanCngPublicKey(CngKey key) : base(key.Export(CngKeyBlobFormat.EccPublicBlob)) {
- Contract.Requires(key != null && key.AlgorithmGroup == CngAlgorithmGroup.ECDiffieHellman);
+ internal ECDiffieHellmanCngPublicKey(byte[] keyBlob, string curveName, CngKeyBlobFormat format) : base(keyBlob) {
+ Contract.Requires(format != null);
Contract.Ensures(m_format != null);
- m_format = CngKeyBlobFormat.EccPublicBlob;
-
- //
- // We need to make a copy of the key to prevent the situation where the ECDiffieHellmanCng algorithm
- // object is disposed (this disposing its key) before the ECDiffieHellmanCngPublic key is disposed.
- //
- // Accessing the handle in partial trust is safe because we're not exposing it back out to user code
- //
-
- new SecurityPermission(SecurityPermissionFlag.UnmanagedCode).Assert();
-
- // This looks odd, but .Handle returns a duplicate, so we need to dispose it
- using (SafeNCryptKeyHandle importKey = key.Handle) {
- m_key = CngKey.Open(importKey, key.IsEphemeral ? CngKeyHandleOpenOptions.EphemeralKey : CngKeyHandleOpenOptions.None);
- }
-
- CodeAccessPermission.RevertAssert();
+ m_format = format;
+ // Can be null for P256, P384, P521, or an explicit blob
+ m_curveName = curveName;
}
/// <summary>
@@ -65,16 +50,7 @@ namespace System.Security.Cryptography {
/// Clean up the key
/// </summary>
protected override void Dispose(bool disposing) {
- try {
- if (disposing) {
- if (m_key != null) {
- m_key.Dispose();
- }
- }
- }
- finally {
- base.Dispose(disposing);
- }
+ base.Dispose(disposing);
}
/// <summary>
@@ -89,15 +65,26 @@ namespace System.Security.Cryptography {
throw new ArgumentNullException("format");
}
+ // Verify that the key can import successfully, because we did in the past.
using (CngKey imported = CngKey.Import(publicKeyBlob, format)) {
if (imported.AlgorithmGroup != CngAlgorithmGroup.ECDiffieHellman) {
throw new ArgumentException(SR.GetString(SR.Cryptography_ArgECDHRequiresECDHKey));
}
- return new ECDiffieHellmanCngPublicKey(imported);
+ return new ECDiffieHellmanCngPublicKey(publicKeyBlob, null, format);
}
}
+ internal static ECDiffieHellmanCngPublicKey FromKey(CngKey key) {
+ Contract.Requires(key != null && key.AlgorithmGroup == CngAlgorithmGroup.ECDiffieHellman);
+ Contract.Ensures(Contract.Result<ECDiffieHellmanCngPublicKey>() != null);
+
+ CngKeyBlobFormat format;
+ string curveName;
+ byte[] blob = ECCng.ExportKeyBlob(key, false, out format, out curveName);
+ return new ECDiffieHellmanCngPublicKey(blob, curveName, format);
+ }
+
/// <summary>
/// Hydrate a public key from XML
///
@@ -110,13 +97,17 @@ namespace System.Security.Cryptography {
throw new ArgumentNullException("xml");
}
- using (CngKey imported = Rfc4050KeyFormatter.FromXml(xml)) {
- if (imported.AlgorithmGroup != CngAlgorithmGroup.ECDiffieHellman) {
- throw new ArgumentException(SR.GetString(SR.Cryptography_ArgECDHRequiresECDHKey), "xml");
- }
+ bool isEcdh;
+ ECParameters parameters = Rfc4050KeyFormatter.FromXml(xml, out isEcdh);
- return new ECDiffieHellmanCngPublicKey(imported);
+ if (!isEcdh) {
+ throw new ArgumentException(SR.GetString(SR.Cryptography_ArgECDHRequiresECDHKey), "xml");
}
+
+ CngKeyBlobFormat format;
+ string curveName;
+ byte[] blob = ECCng.EcdhParametersToBlob(ref parameters, out format, out curveName);
+ return new ECDiffieHellmanCngPublicKey(blob, curveName, format);
}
/// <summary>
@@ -127,7 +118,7 @@ namespace System.Security.Cryptography {
Contract.Ensures(Contract.Result<CngKey>() != null);
Contract.Assert(m_format != null);
- return CngKey.Import(ToByteArray(), BlobFormat);
+ return CngKey.Import(ToByteArray(), m_curveName, BlobFormat);
}
/// <summary>
@@ -139,11 +130,39 @@ namespace System.Security.Cryptography {
public override string ToXmlString() {
Contract.Ensures(!String.IsNullOrEmpty(Contract.Result<string>()));
- if (m_key == null) {
- m_key = Import();
+ ECParameters ecParams = ExportParameters();
+ return Rfc4050KeyFormatter.ToXml(ecParams, isEcdh: true);
+ }
+
+ /// <summary>
+ /// Exports the key and explicit curve parameters used by the ECC object into an <see cref="ECParameters"/> object.
+ /// </summary>
+ /// <exception cref="CryptographicException">
+ /// if there was an issue obtaining the curve values.
+ /// </exception>
+ /// <exception cref="PlatformNotSupportedException">
+ /// if explicit export is not supported by this platform. Windows 10 or higher is required.
+ /// </exception>
+ /// <returns>The key and explicit curve parameters used by the ECC object.</returns>
+ public override ECParameters ExportExplicitParameters() {
+ using (CngKey key = Import()) {
+ return ECCng.ExportExplicitParameters(key, includePrivateParameters: false);
}
+ }
- return Rfc4050KeyFormatter.ToXml(m_key);
+ /// <summary>
+ /// Exports the key used by the ECC object into an <see cref="ECParameters"/> object.
+ /// If the key was created as a named curve, the Curve property will contain named curve parameters
+ /// otherwise it will contain explicit parameters.
+ /// </summary>
+ /// <exception cref="CryptographicException">
+ /// if there was an issue obtaining the curve values.
+ /// </exception>
+ /// <returns>The key and named curve parameters used by the ECC object.</returns>
+ public override ECParameters ExportParameters() {
+ using (CngKey key = Import()) {
+ return ECCng.ExportParameters(key, includePrivateParameters: false);
+ }
}
}
}
diff --git a/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDiffieHellmanPublicKey.cs b/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDiffieHellmanPublicKey.cs
index 91e89d8be9c..62b83951fd7 100644
--- a/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDiffieHellmanPublicKey.cs
+++ b/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDiffieHellmanPublicKey.cs
@@ -17,6 +17,10 @@ namespace System.Security.Cryptography {
public abstract class ECDiffieHellmanPublicKey : IDisposable {
private byte[] m_keyBlob;
+ protected ECDiffieHellmanPublicKey() {
+ m_keyBlob = new byte[0];
+ }
+
protected ECDiffieHellmanPublicKey(byte[] keyBlob) {
Contract.Ensures(m_keyBlob != null);
@@ -41,9 +45,26 @@ namespace System.Security.Cryptography {
}
// This method must be implemented by derived classes. In order to conform to the contract, it cannot be abstract.
- public virtual string ToXmlString()
- {
+ public virtual string ToXmlString() {
throw new NotImplementedException(SR.GetString(SR.NotSupported_SubclassOverride));
}
+
+ /// <summary>
+ /// When overridden in a derived class, exports the named or explicit ECParameters for an ECCurve.
+ /// If the curve has a name, the Curve property will contain named curve parameters, otherwise it
+ /// will contain explicit parameters.
+ /// </summary>
+ /// <returns>The ECParameters representing the point on the curve for this key.</returns>
+ public virtual ECParameters ExportParameters() {
+ throw new NotSupportedException(SR.GetString(SR.NotSupported_SubclassOverride));
+ }
+
+ /// <summary>
+ /// When overridden in a derived class, exports the explicit ECParameters for an ECCurve.
+ /// </summary>
+ /// <returns>The ECParameters representing the point on the curve for this key, using the explicit curve format.</returns>
+ public virtual ECParameters ExportExplicitParameters() {
+ throw new NotSupportedException(SR.GetString(SR.NotSupported_SubclassOverride));
+ }
}
}
diff --git a/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDsa.cs b/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDsa.cs
index 04f11603a17..b0c7b521a88 100644
--- a/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDsa.cs
+++ b/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDsa.cs
@@ -41,34 +41,48 @@ namespace System.Security.Cryptography {
return CryptoConfig.CreateFromName(algorithm) as ECDsa;
}
- public static ECDsa Create (ECCurve curve)
- {
- throw new NotImplementedException ();
- }
-
- public static ECDsa Create (ECParameters parameters)
- {
- throw new NotImplementedException ();
- }
-
- public virtual ECParameters ExportExplicitParameters (bool includePrivateParameters)
- {
- throw new NotImplementedException ();
- }
-
- public virtual ECParameters ExportParameters (bool includePrivateParameters)
- {
- throw new NotImplementedException ();
- }
+ /// <summary>
+ /// Creates a new instance of the default implementation of the Elliptic Curve Digital Signature Algorithm
+ /// (ECDSA) with a newly generated key over the specified curve.
+ /// </summary>
+ /// <param name="curve">The curve to use for key generation.</param>
+ /// <returns>A new instance of the default implementation of this class.</returns>
+ public static ECDsa Create(ECCurve curve) {
+ ECDsa ecdsa = Create();
+
+ if (ecdsa != null) {
+ try {
+ ecdsa.GenerateKey(curve);
+ }
+ catch {
+ ecdsa.Dispose();
+ throw;
+ }
+ }
- public virtual void GenerateKey (ECCurve curve)
- {
- throw new NotImplementedException ();
- }
+ return ecdsa;
+ }
+
+ /// <summary>
+ /// Creates a new instance of the default implementation of the Elliptic Curve Digital Signature Algorithm
+ /// (ECDSA) using the specified ECParameters as the key.
+ /// </summary>
+ /// <param name="parameters">The parameters representing the key to use.</param>
+ /// <returns>A new instance of the default implementation of this class.</returns>
+ public static ECDsa Create(ECParameters parameters) {
+ ECDsa ecdsa = Create();
+
+ if (ecdsa != null) {
+ try {
+ ecdsa.ImportParameters(parameters);
+ }
+ catch {
+ ecdsa.Dispose();
+ throw;
+ }
+ }
- public virtual void ImportParameters (ECParameters parameters)
- {
- throw new NotImplementedException ();
+ return ecdsa;
}
//
@@ -160,6 +174,42 @@ namespace System.Security.Cryptography {
return VerifyHash(hash, signature);
}
+ /// <summary>
+ /// When overridden in a derived class, exports the named or explicit ECParameters for an ECCurve.
+ /// If the curve has a name, the Curve property will contain named curve parameters, otherwise it
+ /// will contain explicit parameters.
+ /// </summary>
+ /// <param name="includePrivateParameters">true to include private parameters, otherwise, false.</param>
+ /// <returns>The ECParameters representing the point on the curve for this key.</returns>
+ public virtual ECParameters ExportParameters(bool includePrivateParameters) {
+ throw new NotSupportedException(SR.GetString(SR.NotSupported_SubclassOverride));
+ }
+
+ /// <summary>
+ /// When overridden in a derived class, exports the explicit ECParameters for an ECCurve.
+ /// </summary>
+ /// <param name="includePrivateParameters">true to include private parameters, otherwise, false.</param>
+ /// <returns>The ECParameters representing the point on the curve for this key, using the explicit curve format.</returns>
+ public virtual ECParameters ExportExplicitParameters(bool includePrivateParameters) {
+ throw new NotSupportedException(SR.GetString(SR.NotSupported_SubclassOverride));
+ }
+
+ /// <summary>
+ /// When overridden in a derived class, imports the specified ECParameters.
+ /// </summary>
+ /// <param name="parameters">The curve parameters.</param>
+ public virtual void ImportParameters(ECParameters parameters) {
+ throw new NotSupportedException(SR.GetString(SR.NotSupported_SubclassOverride));
+ }
+
+ /// <summary>
+ /// When overridden in a derived class, generates a new public/private keypair for the specified curve.
+ /// </summary>
+ /// <param name="curve">The curve to use.</param>
+ public virtual void GenerateKey(ECCurve curve) {
+ throw new NotSupportedException(SR.GetString(SR.NotSupported_SubclassOverride));
+ }
+
private static Exception DerivedClassMustOverride() {
return new NotImplementedException(SR.GetString(SR.NotSupported_SubclassOverride));
}
diff --git a/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDsaCng.cs b/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDsaCng.cs
index b0267ab9983..cd8283a9f64 100644
--- a/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDsaCng.cs
+++ b/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDsaCng.cs
@@ -17,7 +17,7 @@ namespace System.Security.Cryptography {
/// Wrapper for NCrypt's implementation of elliptic curve DSA
/// </summary>
[System.Security.Permissions.HostProtection(MayLeakOnAbort = true)]
- public sealed class ECDsaCng : ECDsa {
+ public sealed partial class ECDsaCng : ECDsa {
#if MONO
public ECDsaCng() : this(521) {
}
@@ -77,6 +77,11 @@ namespace System.Security.Cryptography {
KeySize = keySize;
}
+ public ECDsaCng(ECCurve curve) {
+ // GenerateKey will already do all of the validation we need.
+ GenerateKey(curve);
+ }
+
[SecuritySafeCritical]
public ECDsaCng(CngKey key) {
Contract.Ensures(LegalKeySizesValue != null);
@@ -266,7 +271,13 @@ namespace System.Security.Cryptography {
throw new ArgumentOutOfRangeException("format");
}
- Key = Rfc4050KeyFormatter.FromXml(xml);
+ bool isEcdh;
+ ECParameters parameters = Rfc4050KeyFormatter.FromXml(xml, out isEcdh);
+
+ // .NET 4.6.2 allowed ECDsaCng to wrap ECDH keys because of interop with non-Windows PFX files.
+ // As a result XML marked as ECDiffieHellman loaded just fine, so no check should be done on the
+ // key type.
+ ImportParameters(parameters);
}
//
@@ -364,7 +375,8 @@ namespace System.Security.Cryptography {
throw new ArgumentOutOfRangeException("format");
}
- return Rfc4050KeyFormatter.ToXml(Key);
+ ECParameters ecParams = ExportParameters(false);
+ return Rfc4050KeyFormatter.ToXml(ecParams, isEcdh: false);
}
//
@@ -440,6 +452,19 @@ namespace System.Security.Cryptography {
}
}
+ public override void GenerateKey(ECCurve curve) {
+ curve.Validate();
+
+ if (m_key != null) {
+ m_key.Dispose();
+ m_key = null;
+ }
+
+ CngKey newKey = CngKey.Create(curve, name => CngKey.EcdsaCurveNameToAlgorithm(name));
+ m_key = newKey;
+ KeySizeValue = newKey.KeySize;
+ }
+
/// <summary>
/// Helper property to get the NCrypt key handle
/// </summary>
diff --git a/mcs/class/referencesource/System.Core/System/Security/Cryptography/NCryptNative.cs b/mcs/class/referencesource/System.Core/System/Security/Cryptography/NCryptNative.cs
index 9faf5ee01b1..6110d4e4f5f 100644
--- a/mcs/class/referencesource/System.Core/System/Security/Cryptography/NCryptNative.cs
+++ b/mcs/class/referencesource/System.Core/System/Security/Cryptography/NCryptNative.cs
@@ -147,6 +147,7 @@ namespace System.Security.Cryptography {
internal const string Length = "Length"; // NCRYPT_LENGTH_PROPERTY
internal const string Name = "Name"; // NCRYPT_NAME_PROPERTY
internal const string ParentWindowHandle = "HWND Handle"; // NCRYPT_WINDOW_HANDLE_PROPERTY
+ internal const string PublicKeyLength = "PublicKeyLength"; // NCRYPT_PUBLIC_KEY_LENGTH (Win10+)
internal const string ProviderHandle = "Provider Handle"; // NCRYPT_PROVIDER_HANDLE_PROPERTY
internal const string UIPolicy = "UI Policy"; // NCRYPT_UI_POLICY_PROPERTY
internal const string UniqueName = "Unique Name"; // NCRYPT_UNIQUE_NAME_PROPERTY
@@ -277,6 +278,17 @@ namespace System.Security.Cryptography {
CngPropertyOptions dwFlags);
/// <summary>
+ /// Get the value of a property of an NCrypt object
+ /// </summary>
+ [DllImport("ncrypt.dll", CharSet = CharSet.Unicode)]
+ internal static extern ErrorCode NCryptGetProperty(SafeNCryptHandle hObject,
+ string pszProperty,
+ ref int pbOutput,
+ int cbOutput,
+ [Out] out int pcbResult,
+ CngPropertyOptions dwFlags);
+
+ /// <summary>
/// Get the value of a pointer property of an NCrypt object
/// </summary>
[DllImport("ncrypt.dll", CharSet = CharSet.Unicode)]
@@ -435,7 +447,7 @@ namespace System.Security.Cryptography {
internal static extern ErrorCode NCryptDecrypt(SafeNCryptKeyHandle hKey,
[In, MarshalAs(UnmanagedType.LPArray)] byte[] pbInput,
int cbInput,
- [In] ref BCryptNative.BCRYPT_PKCS1_PADDING_INFO pvPadding,
+ IntPtr pvPaddingZero,
[Out, MarshalAs(UnmanagedType.LPArray)] byte[] pbOutput,
int cbOutput,
[Out] out int pcbResult,
@@ -455,7 +467,7 @@ namespace System.Security.Cryptography {
internal static extern ErrorCode NCryptEncrypt(SafeNCryptKeyHandle hKey,
[In, MarshalAs(UnmanagedType.LPArray)] byte[] pbInput,
int cbInput,
- [In] ref BCryptNative.BCRYPT_PKCS1_PADDING_INFO pvPadding,
+ IntPtr pvPaddingZero,
[Out, MarshalAs(UnmanagedType.LPArray)] byte[] pbOutput,
int cbOutput,
[Out] out int pcbResult,
@@ -582,7 +594,7 @@ namespace System.Security.Cryptography {
data,
ref pkcs1Info,
AsymmetricPaddingMode.Pkcs1,
- UnsafeNativeMethods.NCryptDecrypt);
+ Pkcs1PaddingDecryptionWrapper);
}
/// <summary>
@@ -604,6 +616,27 @@ namespace System.Security.Cryptography {
UnsafeNativeMethods.NCryptDecrypt);
}
+ [SecurityCritical]
+ private static ErrorCode Pkcs1PaddingDecryptionWrapper(SafeNCryptKeyHandle hKey,
+ byte[] pbInput,
+ int cbInput,
+ ref BCryptNative.BCRYPT_PKCS1_PADDING_INFO pvPadding,
+ byte[] pbOutput,
+ int cbOutput,
+ out int pcbResult,
+ AsymmetricPaddingMode dwFlags)
+ {
+ Debug.Assert(dwFlags == AsymmetricPaddingMode.Pkcs1, "dwFlags == AsymmetricPaddingMode.Pkcs1");
+
+ // This method exists to match a generic-based delegate (the ref parameter), but in PKCS#1 mode
+ // the value for pvPadding must be NULL with keys in the Smart Card KSP.
+ //
+ // Passing the ref PKCS1 (signature) padding info will work for software keys, which ignore the value;
+ // but hardware keys fail if it's any value other than NULL (and PKCS#1 was specified).
+
+ return UnsafeNativeMethods.NCryptDecrypt(hKey, pbInput, cbInput, IntPtr.Zero, pbOutput, cbOutput, out pcbResult, dwFlags);
+ }
+
/// <summary>
/// Generic encryption method, wrapped by decryption calls for specific padding modes
/// </summary>
@@ -679,7 +712,27 @@ namespace System.Security.Cryptography {
data,
ref pkcs1Info,
AsymmetricPaddingMode.Pkcs1,
- UnsafeNativeMethods.NCryptEncrypt);
+ Pkcs1PaddingEncryptionWrapper);
+ }
+
+ [SecurityCritical]
+ private static ErrorCode Pkcs1PaddingEncryptionWrapper(SafeNCryptKeyHandle hKey,
+ byte[] pbInput,
+ int cbInput,
+ ref BCryptNative.BCRYPT_PKCS1_PADDING_INFO pvPadding,
+ byte[] pbOutput,
+ int cbOutput,
+ out int pcbResult,
+ AsymmetricPaddingMode dwFlags) {
+ Debug.Assert(dwFlags == AsymmetricPaddingMode.Pkcs1, "dwFlags == AsymmetricPaddingMode.Pkcs1");
+
+ // This method exists to match a generic-based delegate (the ref parameter), but in PKCS#1 mode
+ // the value for pvPadding must be NULL with keys in the Smart Card KSP.
+ //
+ // Passing the ref PKCS1 (signature) padding info will work for software keys, which ignore the value;
+ // but hardware keys fail if it's any value other than NULL (and PKCS#1 was specified).
+
+ return UnsafeNativeMethods.NCryptEncrypt(hKey, pbInput, cbInput, IntPtr.Zero, pbOutput, cbOutput, out pcbResult, dwFlags);
}
/// <summary>
@@ -1347,6 +1400,32 @@ namespace System.Security.Cryptography {
}
}
+ [SecurityCritical]
+ internal static ErrorCode GetPropertyAsInt(SafeNCryptHandle ncryptObject,
+ string propertyName,
+ CngPropertyOptions propertyOptions,
+ ref int propertyValue) {
+ Contract.Requires(ncryptObject != null);
+ Contract.Requires(propertyName != null);
+
+ int cbResult;
+
+ ErrorCode errorCode = UnsafeNativeMethods.NCryptGetProperty(
+ ncryptObject,
+ propertyName,
+ ref propertyValue,
+ sizeof(int),
+ out cbResult,
+ propertyOptions);
+
+ if (errorCode == ErrorCode.Success)
+ {
+ System.Diagnostics.Debug.Assert(cbResult == sizeof(int), "Expected cbResult=4, got " + cbResult);
+ }
+
+ return errorCode;
+ }
+
/// <summary>
/// Get the value of a pointer NCrypt property
/// </summary>
@@ -1466,6 +1545,36 @@ namespace System.Security.Cryptography {
return keyHandle;
}
+ [System.Security.SecurityCritical]
+ internal static SafeNCryptKeyHandle ImportKey(SafeNCryptProviderHandle provider,
+ byte[] keyBlob,
+ string format,
+ IntPtr pParametersList) {
+ Contract.Requires(provider != null);
+ Contract.Requires(keyBlob != null);
+ Contract.Requires(!String.IsNullOrEmpty(format));
+ Contract.Ensures(Contract.Result<SafeNCryptKeyHandle>() != null &&
+ !Contract.Result<SafeNCryptKeyHandle>().IsInvalid &&
+ !Contract.Result<SafeNCryptKeyHandle>().IsClosed);
+
+ SafeNCryptKeyHandle keyHandle = null;
+ ErrorCode error = UnsafeNativeMethods.NCryptImportKey(provider,
+ IntPtr.Zero,
+ format,
+ pParametersList,
+ out keyHandle,
+ keyBlob,
+ keyBlob.Length,
+ 0);
+
+ if (error != ErrorCode.Success)
+ {
+ throw new CryptographicException((int)error);
+ }
+
+ return keyHandle;
+ }
+
/// <summary>
/// Open an existing key
/// </summary>
diff --git a/mcs/class/referencesource/System.Core/System/Security/Cryptography/Rfc4050KeyFormatter.cs b/mcs/class/referencesource/System.Core/System/Security/Cryptography/Rfc4050KeyFormatter.cs
index 1660bd45dde..111da8d3d16 100644
--- a/mcs/class/referencesource/System.Core/System/Security/Cryptography/Rfc4050KeyFormatter.cs
+++ b/mcs/class/referencesource/System.Core/System/Security/Cryptography/Rfc4050KeyFormatter.cs
@@ -18,7 +18,7 @@ using Microsoft.Win32.SafeHandles;
namespace System.Security.Cryptography {
/// <summary>
- /// Utility class to convert NCrypt keys into XML and back using a format similar to the one described
+ /// Utility class to convert ECC keys into XML and back using a format similar to the one described
/// in RFC 4050 (http://www.ietf.org/rfc/rfc4050.txt).
///
/// #RFC4050ECKeyFormat
@@ -41,6 +41,7 @@ namespace System.Security.Cryptography {
private const string ECDsaRoot = "ECDSAKeyValue";
private const string NamedCurveElement = "NamedCurve";
private const string Namespace = "http://www.w3.org/2001/04/xmldsig-more#";
+ private const string OidUrnPrefix = "urn:oid:";
private const string PublicKeyRoot = "PublicKey";
private const string UrnAttribute = "URN";
private const string ValueAttribute = "Value";
@@ -52,17 +53,19 @@ namespace System.Security.Cryptography {
private const string XsiNamespace = "http://www.w3.org/2001/XMLSchema-instance";
private const string XsiNamespacePrefix = "xsi";
- private const string Prime256CurveUrn = "urn:oid:1.2.840.10045.3.1.7";
- private const string Prime384CurveUrn = "urn:oid:1.3.132.0.34";
- private const string Prime521CurveUrn = "urn:oid:1.3.132.0.35";
+ private const string ECDSA_P256_OID_VALUE = "1.2.840.10045.3.1.7"; // nistP256 or secP256r1
+ private const string ECDSA_P384_OID_VALUE = "1.3.132.0.34"; // nistP384 or secP384r1
+ private const string ECDSA_P521_OID_VALUE = "1.3.132.0.35"; // nistP521 or secP521r1
/// <summary>
/// Restore a key from XML
/// </summary>
- internal static CngKey FromXml(string xml) {
+ internal static ECParameters FromXml(string xml, out bool isEcdh) {
Contract.Requires(xml != null);
Contract.Ensures(Contract.Result<CngKey>() != null);
+ ECParameters parameters = new ECParameters();
+
// Load the XML into an XPathNavigator to access sub elements
using (TextReader textReader = new StringReader(xml))
using (XmlTextReader xmlReader = new XmlTextReader(textReader)) {
@@ -76,70 +79,22 @@ namespace System.Security.Cryptography {
}
// First figure out which algorithm this key belongs to
- CngAlgorithm algorithm = ReadAlgorithm(navigator);
+ parameters.Curve = ReadCurve(navigator, out isEcdh);
// Then read out the public key value
if (!navigator.MoveToNext(XPathNodeType.Element)) {
throw new ArgumentException(SR.GetString(SR.Cryptography_MissingPublicKey));
}
- BigInteger x;
- BigInteger y;
- ReadPublicKey(navigator, out x, out y);
-
- // Finally, convert them into a key blob to import into a CngKey
- byte[] keyBlob = NCryptNative.BuildEccPublicBlob(algorithm.Algorithm, x, y);
- return CngKey.Import(keyBlob, CngKeyBlobFormat.EccPublicBlob);
- }
- }
-
- /// <summary>
- /// Map a curve URN to the size of the key associated with the curve
- /// </summary>
- [SuppressMessage("Microsoft.Usage", "CA2208:InstantiateArgumentExceptionsCorrectly", Justification = "The parameters to the exception are in the correct order")]
- private static int GetKeySize(string urn) {
- Contract.Requires(!String.IsNullOrEmpty(urn));
- Contract.Ensures(Contract.Result<int>() > 0);
-
- switch (urn) {
- case Prime256CurveUrn:
- return 256;
-
- case Prime384CurveUrn:
- return 384;
-
- case Prime521CurveUrn:
- return 521;
-
- default:
- throw new ArgumentException(SR.GetString(SR.Cryptography_UnknownEllipticCurve), "algorithm");
- }
- }
-
- /// <summary>
- /// Get the OID which represents an elliptic curve
- /// </summary>
- private static string GetCurveUrn(CngAlgorithm algorithm) {
- Contract.Requires(algorithm != null);
-
- if (algorithm == CngAlgorithm.ECDsaP256 || algorithm == CngAlgorithm.ECDiffieHellmanP256) {
- return Prime256CurveUrn;
- }
- else if (algorithm == CngAlgorithm.ECDsaP384 || algorithm == CngAlgorithm.ECDiffieHellmanP384) {
- return Prime384CurveUrn;
- }
- else if (algorithm == CngAlgorithm.ECDsaP521 || algorithm == CngAlgorithm.ECDiffieHellmanP521) {
- return Prime521CurveUrn;
- }
- else {
- throw new ArgumentException(SR.GetString(SR.Cryptography_UnknownEllipticCurve), "algorithm");
+ ReadPublicKey(navigator, ref parameters);
+ return parameters;
}
}
/// <summary>
- /// Determine which ECC algorithm the key refers to
+ /// Determine which ECC curve the key refers to
/// </summary>
- private static CngAlgorithm ReadAlgorithm(XPathNavigator navigator) {
+ private static ECCurve ReadCurve(XPathNavigator navigator, out bool isEcdh) {
Contract.Requires(navigator != null);
Contract.Ensures(Contract.Result<CngAlgorithm>() != null);
@@ -176,48 +131,27 @@ namespace System.Security.Cryptography {
throw new ArgumentException(SR.GetString(SR.Cryptography_MissingDomainParameters));
}
- int keySize = GetKeySize(navigator.Value);
+ string oidUrn = navigator.Value;
+ if (!oidUrn.StartsWith(OidUrnPrefix, StringComparison.OrdinalIgnoreCase)) {
+ throw new ArgumentException(SR.GetString(SR.Cryptography_UnknownEllipticCurve));
+ }
+
// position the navigator at the end of the domain parameters
navigator.MoveToParent(); // NamedCurve
navigator.MoveToParent(); // DomainParameters
- //
- // Given the algorithm type and key size, we can now map back to a CNG algorithm ID
- //
-
- if (isDHKey) {
- if (keySize == 256) {
- return CngAlgorithm.ECDiffieHellmanP256;
- }
- else if (keySize == 384) {
- return CngAlgorithm.ECDiffieHellmanP384;
- }
- else {
- Debug.Assert(keySize == 521, "keySize == 521");
- return CngAlgorithm.ECDiffieHellmanP521;
- }
- }
- else {
- Debug.Assert(isDsaKey, "isDsaKey");
-
- if (keySize == 256) {
- return CngAlgorithm.ECDsaP256;
- }
- else if (keySize == 384) {
- return CngAlgorithm.ECDsaP384;
- }
- else {
- Debug.Assert(keySize == 521, "keySize == 521");
- return CngAlgorithm.ECDsaP521;
- }
- }
+ // The out-bool only works because we have either/or. If a third type of data is handled
+ // then a more complex signal is required.
+ Debug.Assert(isDHKey || isDsaKey);
+ isEcdh = isDHKey;
+ return ECCurve.CreateFromValue(oidUrn.Substring(OidUrnPrefix.Length));
}
/// <summary>
/// Read the x and y components of the public key
/// </summary>
- private static void ReadPublicKey(XPathNavigator navigator, out BigInteger x, out BigInteger y) {
+ private static void ReadPublicKey(XPathNavigator navigator, ref ECParameters parameters) {
Contract.Requires(navigator != null);
if (navigator.NamespaceURI != Namespace) {
@@ -238,7 +172,7 @@ namespace System.Security.Cryptography {
throw new ArgumentException(SR.GetString(SR.Cryptography_MissingPublicKey));
}
- x = BigInteger.Parse(navigator.Value, CultureInfo.InvariantCulture);
+ BigInteger x = BigInteger.Parse(navigator.Value, CultureInfo.InvariantCulture);
navigator.MoveToParent();
// Then the y parameter
@@ -249,36 +183,158 @@ namespace System.Security.Cryptography {
throw new ArgumentException(SR.GetString(SR.Cryptography_MissingPublicKey));
}
- y = BigInteger.Parse(navigator.Value, CultureInfo.InvariantCulture);
+ BigInteger y = BigInteger.Parse(navigator.Value, CultureInfo.InvariantCulture);
+
+ byte[] xBytes = x.ToByteArray();
+ byte[] yBytes = y.ToByteArray();
+
+ int xLen = xBytes.Length;
+ int yLen = yBytes.Length;
+
+ // If the last byte of X is 0x00 that's a padding byte by BigInteger to indicate X is
+ // a positive number with the highest bit in the most significant byte set. We can't count
+ // that in the length of the number.
+ if (xLen > 0 && xBytes[xLen - 1] == 0)
+ {
+ xLen--;
+ }
+
+ // Ditto for Y.
+ if (yLen > 0 && yBytes[yLen - 1] == 0)
+ {
+ yLen--;
+ }
+
+ // Q.X and Q.Y have to be the same length. They ultimately have to be the right length for the curve,
+ // but that requires more knowledge than we have. So we'll ask the system. If it doesn't know, just make
+ // them match each other.
+ int requiredLength = Math.Max(xLen, yLen);
+
+ try {
+ using (ECDsa ecdsa = ECDsa.Create(parameters.Curve)) {
+ // Convert the bit value of keysize to a byte value.
+ // EC curves can have non-mod-8 keysizes (e.g. 521), so the +7 is really necessary.
+ int curveLength = (ecdsa.KeySize + 7) / 8;
+
+ // We could just use this answer, but if the user has formatted the input to be
+ // too long, maybe they know something we don't.
+ requiredLength = Math.Max(requiredLength, curveLength);
+ }
+ }
+ catch (ArgumentException) { /* Curve had invalid data, like an empty OID */ }
+ catch (CryptographicException) { /* The system failed to generate a key for the curve */ }
+ catch (NotSupportedException) { /* An unknown curve type was requested */ }
+
+ // There is a chance that the curve is known to Windows but not allowed for ECDH
+ // (curve25519 is known to be in this state). Since RFC4050 is officially only
+ // concerned with ECDSA, and the only known example of this problem does not have
+ // an OID, it is not worth trying to generate the curve under ECDH as a fallback.
+
+ // Since BigInteger does Little Endian and Array.Resize maintains indexes when growing,
+ // just Array.Resize, then Array.Reverse. We could optimize this to be 1N instead of 2N,
+ // but this isn't a very hot codepath, so use tried-and-true methods.
+ Array.Resize(ref xBytes, requiredLength);
+ Array.Resize(ref yBytes, requiredLength);
+ Array.Reverse(xBytes);
+ Array.Reverse(yBytes);
+
+ parameters.Q.X = xBytes;
+ parameters.Q.Y = yBytes;
}
/// <summary>
/// Serialize out information about the elliptic curve
/// </summary>
- private static void WriteDomainParameters(XmlWriter writer, CngKey key) {
+ private static void WriteDomainParameters(XmlWriter writer, ref ECParameters parameters) {
Contract.Requires(writer != null);
- Contract.Requires(key != null && (key.AlgorithmGroup == CngAlgorithmGroup.ECDsa || key.AlgorithmGroup == CngAlgorithmGroup.ECDiffieHellman));
+
+ Oid curveOid = parameters.Curve.Oid;
+
+ if (!parameters.Curve.IsNamed || curveOid == null)
+ throw new ArgumentException(SR.GetString(SR.Cryptography_UnknownEllipticCurve));
+
+ string oidValue = curveOid.Value;
+
+ // If the OID didn't specify a value, use the mutable FriendlyName behavior of
+ // resolving the value without throwing an exception.
+ if (string.IsNullOrEmpty(oidValue))
+ {
+ // The name strings for the 3 NIST curves from Win7 changed in Win10, but the Win10
+ // names are what we use. This fallback supports Win7-Win8.1 resolution
+ switch (curveOid.FriendlyName)
+ {
+ case BCryptNative.BCRYPT_ECC_CURVE_NISTP256:
+ oidValue = ECDSA_P256_OID_VALUE;
+ break;
+
+ case BCryptNative.BCRYPT_ECC_CURVE_NISTP384:
+ oidValue = ECDSA_P384_OID_VALUE;
+ break;
+
+ case BCryptNative.BCRYPT_ECC_CURVE_NISTP521:
+ oidValue = ECDSA_P521_OID_VALUE;
+ break;
+
+ default:
+ Oid resolver = new Oid();
+ resolver.FriendlyName = curveOid.FriendlyName;
+ oidValue = resolver.Value;
+ break;
+ }
+ }
+
+ if (string.IsNullOrEmpty(oidValue))
+ throw new ArgumentException(SR.GetString(SR.Cryptography_UnknownEllipticCurve));
writer.WriteStartElement(DomainParametersRoot);
// We always use OIDs for the named prime curves
writer.WriteStartElement(NamedCurveElement);
- writer.WriteAttributeString(UrnAttribute, GetCurveUrn(key.Algorithm));
+ writer.WriteAttributeString(UrnAttribute, OidUrnPrefix + oidValue);
writer.WriteEndElement(); // </NamedCurve>
writer.WriteEndElement(); // </DomainParameters>
}
- private static void WritePublicKeyValue(XmlWriter writer, CngKey key) {
+ private static void WritePublicKeyValue(XmlWriter writer, ref ECParameters parameters) {
Contract.Requires(writer != null);
- Contract.Requires(key != null && (key.AlgorithmGroup == CngAlgorithmGroup.ECDsa || key.AlgorithmGroup == CngAlgorithmGroup.ECDiffieHellman));
-
+
writer.WriteStartElement(PublicKeyRoot);
- byte[] exportedKey = key.Export(CngKeyBlobFormat.EccPublicBlob);
- BigInteger x;
- BigInteger y;
- NCryptNative.UnpackEccPublicBlob(exportedKey, out x, out y);
+ byte[] providedX = parameters.Q.X;
+ byte[] providedY = parameters.Q.Y;
+
+ int xSize = providedX.Length;
+ int ySize = providedY.Length;
+ const byte SignBit = 0x80;
+
+ // BigInteger will interpret a byte[] number as negative if the most significant bit is set.
+ // Since we're still in Big Endian at this point that means checking val[0].
+ // If the high bit is set, we need to extract into a byte[] with a padding zero to keep the
+ // sign bit cleared.
+
+ if ((providedX[0] & SignBit) == SignBit) {
+ xSize++;
+ }
+
+ if ((providedY[0] & SignBit) == SignBit) {
+ ySize++;
+ }
+
+ // We can't just use the arrays that are passed in even when the number wasn't negative,
+ // because we need to reverse the bytes to load into BigInteger.
+ byte[] xBytes = new byte[xSize];
+ byte[] yBytes = new byte[ySize];
+
+ // If the size grew then the offset will be 1, otherwise 0.
+ Buffer.BlockCopy(providedX, 0, xBytes, xSize - providedX.Length, providedX.Length);
+ Buffer.BlockCopy(providedY, 0, yBytes, ySize - providedY.Length, providedY.Length);
+
+ Array.Reverse(xBytes);
+ Array.Reverse(yBytes);
+
+ BigInteger x = new BigInteger(xBytes);
+ BigInteger y = new BigInteger(yBytes);
writer.WriteStartElement(XElement);
writer.WriteAttributeString(ValueAttribute, x.ToString("R", CultureInfo.InvariantCulture));
@@ -296,10 +352,11 @@ namespace System.Security.Cryptography {
/// <summary>
/// Convert a key to XML
/// </summary>
- internal static string ToXml(CngKey key) {
- Contract.Requires(key != null && (key.AlgorithmGroup == CngAlgorithmGroup.ECDsa || key.AlgorithmGroup == CngAlgorithmGroup.ECDiffieHellman));
+ internal static string ToXml(ECParameters parameters, bool isEcdh) {
Contract.Ensures(Contract.Result<String>() != null);
+ parameters.Validate();
+
StringBuilder keyXml = new StringBuilder();
XmlWriterSettings settings = new XmlWriterSettings();
@@ -309,11 +366,11 @@ namespace System.Security.Cryptography {
using (XmlWriter writer = XmlWriter.Create(keyXml, settings)) {
// The root element depends upon the type of key
- string rootElement = key.AlgorithmGroup == CngAlgorithmGroup.ECDsa ? ECDsaRoot : ECDHRoot;
+ string rootElement = isEcdh ? ECDHRoot : ECDsaRoot;
writer.WriteStartElement(rootElement, Namespace);
- WriteDomainParameters(writer, key);
- WritePublicKeyValue(writer, key);
+ WriteDomainParameters(writer, ref parameters);
+ WritePublicKeyValue(writer, ref parameters);
writer.WriteEndElement(); // root element
}
diff --git a/mcs/class/referencesource/System.Core/System/threading/Tasks/TaskExtensions.cs b/mcs/class/referencesource/System.Core/System/threading/Tasks/TaskExtensions.cs
index 2853b837a17..11c673bf587 100644
--- a/mcs/class/referencesource/System.Core/System/threading/Tasks/TaskExtensions.cs
+++ b/mcs/class/referencesource/System.Core/System/threading/Tasks/TaskExtensions.cs
@@ -7,7 +7,7 @@
//
// TaskExtensions.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Extensions to Task/Task<TResult> classes
//
diff --git a/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/DataRowComparer.cs b/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/DataRowComparer.cs
index 83d84faa2d6..20ee67a6372 100644
--- a/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/DataRowComparer.cs
+++ b/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/DataRowComparer.cs
@@ -2,7 +2,7 @@
// <copyright file="DataRowComparer.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <owner current="true" primary="false">spather</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/DataRowExtensions.cs b/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/DataRowExtensions.cs
index 172aaa05574..c1321fd25fa 100644
--- a/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/DataRowExtensions.cs
+++ b/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/DataRowExtensions.cs
@@ -2,7 +2,7 @@
// <copyright file="DataRowExtenstions.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <owner current="true" primary="false">spather</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/DataSetUtil.cs b/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/DataSetUtil.cs
index 16c100fd31a..cbb567e0b0d 100644
--- a/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/DataSetUtil.cs
+++ b/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/DataSetUtil.cs
@@ -2,8 +2,8 @@
// <copyright file="DataSetUtil.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/DataTableExtensions.cs b/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/DataTableExtensions.cs
index f9d681be626..9c02c11dfdc 100644
--- a/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/DataTableExtensions.cs
+++ b/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/DataTableExtensions.cs
@@ -2,8 +2,8 @@
// <copyright file="DataTableExtenstions.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/EnumerableRowCollection.cs b/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/EnumerableRowCollection.cs
index 6ef1b93e86b..2aa098fd133 100644
--- a/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/EnumerableRowCollection.cs
+++ b/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/EnumerableRowCollection.cs
@@ -2,8 +2,8 @@
// <copyright file="GenericEnumRowCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/EnumerableRowCollectionExtensions.cs b/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/EnumerableRowCollectionExtensions.cs
index d4b54919cda..cc1ff7a8032 100644
--- a/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/EnumerableRowCollectionExtensions.cs
+++ b/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/EnumerableRowCollectionExtensions.cs
@@ -2,8 +2,8 @@
// <copyright file="EnumRowCollectionExtensions.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/LinqDataView.cs b/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/LinqDataView.cs
index 5b563588867..13f891636e0 100644
--- a/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/LinqDataView.cs
+++ b/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/LinqDataView.cs
@@ -2,8 +2,8 @@
// <copyright file="LinqDataView.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/OrderedEnumerableRowCollection.cs b/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/OrderedEnumerableRowCollection.cs
index 3deed3f8bf7..a09a082e895 100644
--- a/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/OrderedEnumerableRowCollection.cs
+++ b/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/OrderedEnumerableRowCollection.cs
@@ -2,8 +2,8 @@
// <copyright file="OrderedEnumerableRowCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/SortExpressionBuilder.cs b/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/SortExpressionBuilder.cs
index da6192b17a9..e7f2aca7a3f 100644
--- a/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/SortExpressionBuilder.cs
+++ b/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/SortExpressionBuilder.cs
@@ -2,8 +2,8 @@
// <copyright file="EnumerableDataTable.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/TypedTableBase.cs b/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/TypedTableBase.cs
index 2d8289f8955..4a4a0ee70a8 100644
--- a/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/TypedTableBase.cs
+++ b/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/TypedTableBase.cs
@@ -2,7 +2,7 @@
// <copyright file="TypedTableBase.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <owner current="true" primary="false">spather</owner>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/TypedTableBaseExtensions.cs b/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/TypedTableBaseExtensions.cs
index 4b9b7e51e4e..5d6b9e6d9e3 100644
--- a/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/TypedTableBaseExtensions.cs
+++ b/mcs/class/referencesource/System.Data.DataSetExtensions/System/Data/TypedTableBaseExtensions.cs
@@ -2,8 +2,8 @@
// <copyright file="EnumRowCollectionExtensions.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/AspNet/BuildProviderUtils.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/AspNet/BuildProviderUtils.cs
index 3111c8566d0..338e6d617b8 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/AspNet/BuildProviderUtils.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/AspNet/BuildProviderUtils.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/AspNet/EntityDesignerBuildProvider.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/AspNet/EntityDesignerBuildProvider.cs
index 09e66a21b8b..1a4745d4882 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/AspNet/EntityDesignerBuildProvider.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/AspNet/EntityDesignerBuildProvider.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/AspNet/EntityModelBuildProvider.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/AspNet/EntityModelBuildProvider.cs
index 8223ed93996..3abf99539a0 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/AspNet/EntityModelBuildProvider.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/AspNet/EntityModelBuildProvider.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/AspNet/MappingModelBuildProvider.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/AspNet/MappingModelBuildProvider.cs
index 2c51a286690..018bbedf895 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/AspNet/MappingModelBuildProvider.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/AspNet/MappingModelBuildProvider.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/AspNet/StorageModelBuildProvider.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/AspNet/StorageModelBuildProvider.cs
index f79a5ba3ae2..0cc45631095 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/AspNet/StorageModelBuildProvider.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/AspNet/StorageModelBuildProvider.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/Common/EDesignUtil.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/Common/EDesignUtil.cs
index ce09de026ac..4a3cf74b90d 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/Common/EDesignUtil.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/Common/EDesignUtil.cs
@@ -2,8 +2,8 @@
// <copyright file="EDesignUtil.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
namespace System.Data.Entity.Design.Common {
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/Common/MetadataItemSerializer.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/Common/MetadataItemSerializer.cs
index f285bbca538..7fb8a1be677 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/Common/MetadataItemSerializer.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/Common/MetadataItemSerializer.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Data.Common;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/Common/MetadataUtil.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/Common/MetadataUtil.cs
index 2039e6a1dd5..9f11c4c7872 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/Common/MetadataUtil.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/Common/MetadataUtil.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/Common/OneToOneMappingSerializer.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/Common/OneToOneMappingSerializer.cs
index fac123e4322..e5b6fccbfdb 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/Common/OneToOneMappingSerializer.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/Common/OneToOneMappingSerializer.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
using System.Data.Common;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/Common/UniqueIdentifierService.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/Common/UniqueIdentifierService.cs
index 2ceeb737cba..eeb5403117c 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/Common/UniqueIdentifierService.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/Common/UniqueIdentifierService.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityCodeGenerator.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityCodeGenerator.cs
index 2f8d3a152f2..db62698c5f3 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityCodeGenerator.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityCodeGenerator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
//#define ENABLE_TEMPLATE_DEBUGGING
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityDesignerUtils.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityDesignerUtils.cs
index 3d8b9c43828..e0d234d5330 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityDesignerUtils.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityDesignerUtils.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.IO;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityFrameworkVersions.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityFrameworkVersions.cs
index 587e68dbcc8..6fd70791f70 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityFrameworkVersions.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityFrameworkVersions.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityModelSchemaGenerator.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityModelSchemaGenerator.cs
index 537a769ccc7..827b1a25632 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityModelSchemaGenerator.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityModelSchemaGenerator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaFilterEntry.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaFilterEntry.cs
index ed03f56754a..b086b3fbc0b 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaFilterEntry.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaFilterEntry.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaGenerator.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaGenerator.cs
index 57f59c4422b..4b1c9d0469d 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaGenerator.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaGenerator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaGenerator/EntityStoreSchemaGenerator.DbObjectKey.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaGenerator/EntityStoreSchemaGenerator.DbObjectKey.cs
index e059181a345..78d87ade517 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaGenerator/EntityStoreSchemaGenerator.DbObjectKey.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaGenerator/EntityStoreSchemaGenerator.DbObjectKey.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Diagnostics;
namespace System.Data.Entity.Design
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaGenerator/EntityStoreSchemaGenerator.LoadMethodSessionState.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaGenerator/EntityStoreSchemaGenerator.LoadMethodSessionState.cs
index 6a360dbcb7d..2b1460a25fa 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaGenerator/EntityStoreSchemaGenerator.LoadMethodSessionState.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaGenerator/EntityStoreSchemaGenerator.LoadMethodSessionState.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Entity.Design.Common;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityViewGeneration/EntityViewGenerationConstants.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityViewGeneration/EntityViewGenerationConstants.cs
index 69f9e7f3dfe..fbb3711e95d 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityViewGeneration/EntityViewGenerationConstants.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityViewGeneration/EntityViewGenerationConstants.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityViewGeneration/EntityViewGenerator.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityViewGeneration/EntityViewGenerator.cs
index 8102ba33858..027c7eb9338 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityViewGeneration/EntityViewGenerator.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityViewGeneration/EntityViewGenerator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/MetadataExtensionMethods.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/MetadataExtensionMethods.cs
index 05fadc535b2..3c0325be07a 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/MetadataExtensionMethods.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/MetadataExtensionMethods.cs
@@ -4,7 +4,7 @@
// </copyright>
//
// @owner willa
-// @backupOwner [....]
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Entity.Design
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/MetadataItemCollectionFactory.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/MetadataItemCollectionFactory.cs
index 4f496c57f39..a0bd90d32cc 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/MetadataItemCollectionFactory.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/MetadataItemCollectionFactory.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Entity.Design
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/BidirectionalDictionary.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/BidirectionalDictionary.cs
index 1085686e0fb..f40b624560d 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/BidirectionalDictionary.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/BidirectionalDictionary.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/EnglishPluralizationService.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/EnglishPluralizationService.cs
index a0885995af5..2ca6171af2a 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/EnglishPluralizationService.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/EnglishPluralizationService.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/EntityDesignPluralizationHandler.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/EntityDesignPluralizationHandler.cs
index ccd70127bbe..547983643f4 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/EntityDesignPluralizationHandler.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/EntityDesignPluralizationHandler.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/PluralizationServiceUtil.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/PluralizationServiceUtil.cs
index 5002205ed4b..59a95d917e1 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/PluralizationServiceUtil.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/PluralizationServiceUtil.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/EntityStoreSchemaGeneratorDatabaseSchemaLoader.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/EntityStoreSchemaGeneratorDatabaseSchemaLoader.cs
index 49d484d13c3..697013be797 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/EntityStoreSchemaGeneratorDatabaseSchemaLoader.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/EntityStoreSchemaGeneratorDatabaseSchemaLoader.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
using System.Globalization;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/FunctionDetailsReader.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/FunctionDetailsReader.cs
index 95a9c2eb1fc..6b0c5c767b7 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/FunctionDetailsReader.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/FunctionDetailsReader.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/RelationshipDetailsCollection.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/RelationshipDetailsCollection.cs
index 8f13e94ac13..9b8f93b6f7d 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/RelationshipDetailsCollection.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/RelationshipDetailsCollection.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
using System.Xml;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/RelationshipDetailsRow.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/RelationshipDetailsRow.cs
index 4d202670c6b..892fa572d8c 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/RelationshipDetailsRow.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/RelationshipDetailsRow.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
using System.Xml;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/TableDetailsCollection.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/TableDetailsCollection.cs
index 5eca9413a1d..b79aee2c9a7 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/TableDetailsCollection.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/TableDetailsCollection.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
using System.Xml;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/TableDetailsRow.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/TableDetailsRow.cs
index cd3ca3660de..ad95e0103f8 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/TableDetailsRow.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/TableDetailsRow.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
using System.Xml;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/EdmToObjectNamespaceMap.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/EdmToObjectNamespaceMap.cs
index c45935e9a87..2a5277fad16 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/EdmToObjectNamespaceMap.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/EdmToObjectNamespaceMap.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/AssociationTypeEmitter.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/AssociationTypeEmitter.cs
index ae05595adf1..5b87e6fdcbe 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/AssociationTypeEmitter.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/AssociationTypeEmitter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/AttributeEmitter.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/AttributeEmitter.cs
index 45124ca359b..f52b61f1834 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/AttributeEmitter.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/AttributeEmitter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.CodeDom;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/ClientApiGenerator.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/ClientApiGenerator.cs
index d4ec4cf42fd..2c4663dfab4 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/ClientApiGenerator.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/ClientApiGenerator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/CommentEmitter.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/CommentEmitter.cs
index d898e70127b..d2942485f81 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/CommentEmitter.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/CommentEmitter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/ComplexTypeEmitter.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/ComplexTypeEmitter.cs
index 7f369223020..3785fefafc7 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/ComplexTypeEmitter.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/ComplexTypeEmitter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/Emitter.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/Emitter.cs
index aad4ff051ff..28f5daf8534 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/Emitter.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/Emitter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/EntityContainerEmitter.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/EntityContainerEmitter.cs
index 2aebd4d83ab..928d13c2e41 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/EntityContainerEmitter.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/EntityContainerEmitter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/EntityTypeEmitter.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/EntityTypeEmitter.cs
index f4cf839d8e4..d842bb38f6e 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/EntityTypeEmitter.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/EntityTypeEmitter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/FixUp.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/FixUp.cs
index 2058e54f8a8..c6fd702e21f 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/FixUp.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/FixUp.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/FixUpCollection.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/FixUpCollection.cs
index 86a73f3ae56..d32878775ee 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/FixUpCollection.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/FixUpCollection.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/MetadataItemEmitter.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/MetadataItemEmitter.cs
index aaf1e80cef2..bbb721431b0 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/MetadataItemEmitter.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/MetadataItemEmitter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------using System;
using System.Collections.Generic;
using System.Text;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/NamespaceEmitter.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/NamespaceEmitter.cs
index e200f5d2aad..171726227af 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/NamespaceEmitter.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/NamespaceEmitter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/NavigationPropertyEmitter.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/NavigationPropertyEmitter.cs
index 121868eb65c..ef0104ca7a2 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/NavigationPropertyEmitter.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/NavigationPropertyEmitter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/PropertyEmitter.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/PropertyEmitter.cs
index bbcb468e272..78c8d78e59e 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/PropertyEmitter.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/PropertyEmitter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.CodeDom;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/PropertyEmitterBase.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/PropertyEmitterBase.cs
index aab6dc7315a..04a9326d5df 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/PropertyEmitterBase.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/PropertyEmitterBase.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/SchemaTypeEmitter.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/SchemaTypeEmitter.cs
index e74471f3f29..348ddae3b90 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/SchemaTypeEmitter.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/SchemaTypeEmitter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/StructuredTypeEmitter.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/StructuredTypeEmitter.cs
index 2689c5b99fe..3af30235c2e 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/StructuredTypeEmitter.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/StructuredTypeEmitter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/TypeReference.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/TypeReference.cs
index 9381d82cfc3..9336dbf7bf3 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/TypeReference.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/TypeReference.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/Utils.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/Utils.cs
index a85445adb77..e35e67cbb96 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/Utils.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/Utils.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/EntityClassGenerator.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/EntityClassGenerator.cs
index cd27ddb9729..6f530f56b99 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/EntityClassGenerator.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/EntityClassGenerator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/LazyTextWriterCreator.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/LazyTextWriterCreator.cs
index 70e90b89bc1..a6f6f05895a 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/LazyTextWriterCreator.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/LazyTextWriterCreator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/PropertyGeneratedEventArgs.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/PropertyGeneratedEventArgs.cs
index d80bd5d6433..5bbb41588c9 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/PropertyGeneratedEventArgs.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/PropertyGeneratedEventArgs.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Data;
diff --git a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/TypeGeneratedEventArgs.cs b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/TypeGeneratedEventArgs.cs
index d4133aadc47..63e42956a97 100644
--- a/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/TypeGeneratedEventArgs.cs
+++ b/mcs/class/referencesource/System.Data.Entity.Design/System/Data/EntityModel/TypeGeneratedEventArgs.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Data;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/AbstractExpressions.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/AbstractExpressions.cs
index 32f66a9344b..7b5d7192be6 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/AbstractExpressions.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/AbstractExpressions.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Aggregates.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Aggregates.cs
index 4be1672ebc4..13a5cb17c20 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Aggregates.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Aggregates.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/BasicCommandTreeVisitor.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/BasicCommandTreeVisitor.cs
index 065b1f15dbb..b2c449026d7 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/BasicCommandTreeVisitor.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/BasicCommandTreeVisitor.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/BasicExpressionVisitor.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/BasicExpressionVisitor.cs
index 62816a81522..524792543b8 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/BasicExpressionVisitor.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/BasicExpressionVisitor.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.CommandTrees
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbCommandTree.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbCommandTree.cs
index ffbe27823cd..86b6ed9527c 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbCommandTree.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbCommandTree.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.CommandTrees
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbDeleteCommandTree.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbDeleteCommandTree.cs
index bd2a0cd47b8..22ccf2dafb2 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbDeleteCommandTree.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbDeleteCommandTree.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....], [....]
-// @backupOwner [....]
+// @owner Microsoft, Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbExpressionVisitor.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbExpressionVisitor.cs
index 819515f3c8e..3fe00156b2e 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbExpressionVisitor.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbExpressionVisitor.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbExpressionVisitor_TResultType.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbExpressionVisitor_TResultType.cs
index add22219762..0fde73b97b9 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbExpressionVisitor_TResultType.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbExpressionVisitor_TResultType.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbFunctionCommandTree.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbFunctionCommandTree.cs
index cb0d6513de0..219ab1ae728 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbFunctionCommandTree.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbFunctionCommandTree.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbInsertCommandTree.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbInsertCommandTree.cs
index 4d3d41e5c13..10dbfbaf87b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbInsertCommandTree.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbInsertCommandTree.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....], [....]
-// @backupOwner [....]
+// @owner Microsoft, Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbLambda.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbLambda.cs
index db7105b543a..0a15743828f 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbLambda.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbLambda.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbModificationClause.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbModificationClause.cs
index c9ea82ce3e5..71eecb4b2e3 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbModificationClause.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbModificationClause.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbModificationCommandTree.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbModificationCommandTree.cs
index 67f0bc2ea91..b129bb2efe0 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbModificationCommandTree.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbModificationCommandTree.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....], [....]
-// @backupOwner [....]
+// @owner Microsoft, Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbQueryCommandTree.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbQueryCommandTree.cs
index 0816cae1336..56039e69fa0 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbQueryCommandTree.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbQueryCommandTree.cs
@@ -4,8 +4,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbSetClause.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbSetClause.cs
index 4b97556f1cb..82794eccdcf 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbSetClause.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbSetClause.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbUpdateCommandTree.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbUpdateCommandTree.cs
index 65e72e88ded..4e486f0be9c 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbUpdateCommandTree.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbUpdateCommandTree.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....], [....]
-// @backupOwner [....]
+// @owner Microsoft, Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DefaultExpressionVisitor.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DefaultExpressionVisitor.cs
index 3eaea9451a6..520d5dcd062 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DefaultExpressionVisitor.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DefaultExpressionVisitor.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.CommandTrees
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBindings.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBindings.cs
index 6b24b054e97..7c39a76a79e 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBindings.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBindings.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/DbExpressionBuilder.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/DbExpressionBuilder.cs
index 018822d2543..6db0404e3d4 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/DbExpressionBuilder.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/DbExpressionBuilder.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.CommandTrees.ExpressionBuilder
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/EdmFunctions.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/EdmFunctions.cs
index 564193b7f14..026dac11951 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/EdmFunctions.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/EdmFunctions.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.CommandTrees.ExpressionBuilder
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/Internal/ArgumentValidation.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/Internal/ArgumentValidation.cs
index c0e80490b00..02c45b47103 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/Internal/ArgumentValidation.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/Internal/ArgumentValidation.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.CommandTrees.ExpressionBuilder.Internal
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/Internal/EnumerableValidator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/Internal/EnumerableValidator.cs
index 77c9bbb4289..9010a31ed64 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/Internal/EnumerableValidator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/Internal/EnumerableValidator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.CommandTrees.ExpressionBuilder.Internal
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/Row.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/Row.cs
index 6b2e6f37290..17f4e26153e 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/Row.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/Row.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/Spatial/SpatialEdmFunctions.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/Spatial/SpatialEdmFunctions.cs
index 10c2e874893..70a627702be 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/Spatial/SpatialEdmFunctions.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/Spatial/SpatialEdmFunctions.cs
@@ -5,7 +5,7 @@
// </copyright>
//
// @owner willa
-// @backupOwner [....]
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.CommandTrees.ExpressionBuilder.Spatial
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/DbExpressionRules.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/DbExpressionRules.cs
index 92fb84d99b0..5227cd0671a 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/DbExpressionRules.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/DbExpressionRules.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common.CommandTrees;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionCopier.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionCopier.cs
index 72b70059826..764d80a4dd0 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionCopier.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionCopier.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.CommandTrees.Internal
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionDumper.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionDumper.cs
index 020ea578ff5..3f57a0ac574 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionDumper.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionDumper.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionKeyGen.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionKeyGen.cs
index d769ea83514..3e9e050e2f4 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionKeyGen.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionKeyGen.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
// @backupOwner venkatja
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionList.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionList.cs
index b7c12c7df8d..15d0c154a33 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionList.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionList.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionPrinter.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionPrinter.cs
index 17c708d70a7..11f70731f26 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionPrinter.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionPrinter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.CommandTrees.Internal
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ParameterRetriever.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ParameterRetriever.cs
index 89396b7b631..29005dc5285 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ParameterRetriever.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ParameterRetriever.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/PatternMatchRules.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/PatternMatchRules.cs
index 33f8a8a7fec..66e3a0286e2 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/PatternMatchRules.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/PatternMatchRules.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common.CommandTrees;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/Validator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/Validator.cs
index 75ddb262618..182e5859205 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/Validator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/Validator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.CommandTrees.Internal
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ViewSimplifier.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ViewSimplifier.cs
index 485339fce69..3a65b24a550 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ViewSimplifier.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ViewSimplifier.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....], [....]
-// @backupOwner [....]
+// @owner Microsoft, Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common.CommandTrees;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/XmlExpressionDumper.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/XmlExpressionDumper.cs
index e5ed294bc08..c50dad6b3cc 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/XmlExpressionDumper.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/XmlExpressionDumper.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/OperatorExpressions.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/OperatorExpressions.cs
index d3bfc50dcfb..45e38490419 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/OperatorExpressions.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/OperatorExpressions.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/RelationalExpressions.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/RelationalExpressions.cs
index 05f52debacd..a6e626c2f74 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/RelationalExpressions.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/RelationalExpressions.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ValueExpressions.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ValueExpressions.cs
index 7d9bef3d974..7546835ecf8 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ValueExpressions.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ValueExpressions.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.CommandTrees
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/DataRecord.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/DataRecord.cs
index 22945e86e3b..b2d286185fc 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/DataRecord.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/DataRecord.cs
@@ -2,8 +2,8 @@
// <copyright file="DataRecord.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Objects
@@ -426,7 +426,7 @@ namespace System.Data.Objects
}
#region ICustomTypeDescriptor implementation
- //[[....]] Reference: http://msdn.microsoft.com/msdnmag/issues/05/04/NETMatters/
+ //[Microsoft] Reference: http://msdn.microsoft.com/msdnmag/issues/05/04/NETMatters/
//Holds all of the PropertyDescriptors for the PrimitiveType objects in _values
private PropertyDescriptorCollection _propertyDescriptors = null;
private FilterCache _filterCache;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/DataRecordInfo.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/DataRecordInfo.cs
index b5fcf313e14..9e892e98d2c 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/DataRecordInfo.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/DataRecordInfo.cs
@@ -2,8 +2,8 @@
// <copyright file="DataRecordInfo.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/DbCommandDefinition.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/DbCommandDefinition.cs
index af5490530a0..ed4b28e278f 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/DbCommandDefinition.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/DbCommandDefinition.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/DbProviderManifest.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/DbProviderManifest.cs
index 4258cb147ac..b043bb4024c 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/DbProviderManifest.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/DbProviderManifest.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/DbProviderServices.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/DbProviderServices.cs
index 6647b41a615..e12c1c8cdcd 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/DbProviderServices.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/DbProviderServices.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Data.SqlClient;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/DbXmlEnabledProviderManifest.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/DbXmlEnabledProviderManifest.cs
index b06d9eb2f2f..456a6d5cefa 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/DbXmlEnabledProviderManifest.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/DbXmlEnabledProviderManifest.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntityRecordInfo.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntityRecordInfo.cs
index fac34b50bbf..d98de0bc844 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntityRecordInfo.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntityRecordInfo.cs
@@ -2,8 +2,8 @@
// <copyright file="EntityRecordInfo.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/AliasedExpr.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/AliasedExpr.cs
index df9f6e839e8..102e5da5381 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/AliasedExpr.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/AliasedExpr.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql.AST
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/AstNode.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/AstNode.cs
index e9d15458b5a..f0532e26f9d 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/AstNode.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/AstNode.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql.AST
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/BuiltInExpr.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/BuiltInExpr.cs
index fde232bf339..66f3ca72ce6 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/BuiltInExpr.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/BuiltInExpr.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql.AST
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/CaseExpr.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/CaseExpr.cs
index e1cae1bea62..b04a7662407 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/CaseExpr.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/CaseExpr.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql.AST
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/Command.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/Command.cs
index 905d1de7c58..a984def3d33 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/Command.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/Command.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql.AST
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/ConstructorExpr.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/ConstructorExpr.cs
index e347d8e49de..8f4e103e7f7 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/ConstructorExpr.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/ConstructorExpr.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql.AST
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/CreateRefExpr.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/CreateRefExpr.cs
index 0757273be82..365783ede12 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/CreateRefExpr.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/CreateRefExpr.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql.AST
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/DotExpr.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/DotExpr.cs
index cdd820cf252..1d5b129ea4e 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/DotExpr.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/DotExpr.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql.AST
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/FunctionDefinition.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/FunctionDefinition.cs
index 3331eacd646..c42aebb7699 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/FunctionDefinition.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/FunctionDefinition.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql.AST
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/GroupAggregateExpr.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/GroupAggregateExpr.cs
index 2806c7f4322..2288453136e 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/GroupAggregateExpr.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/GroupAggregateExpr.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql.AST
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/GroupPartitionExpr.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/GroupPartitionExpr.cs
index 128f9605e57..892604a9638 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/GroupPartitionExpr.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/GroupPartitionExpr.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql.AST
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/Identifier.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/Identifier.cs
index 027fecca652..bf7ea32b8dc 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/Identifier.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/Identifier.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql.AST
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/Literal.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/Literal.cs
index 5616b92626a..b29f3a6ea6c 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/Literal.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/Literal.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql.AST
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/MethodExpr.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/MethodExpr.cs
index dd49950d785..b95887f0a82 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/MethodExpr.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/MethodExpr.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql.AST
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/NamespaceImport.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/NamespaceImport.cs
index bfc5b74067f..d6ad4143209 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/NamespaceImport.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/NamespaceImport.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql.AST
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/NavigationExpr.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/NavigationExpr.cs
index e57134ce2be..b9ece452630 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/NavigationExpr.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/NavigationExpr.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql.AST
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/ParenExpr.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/ParenExpr.cs
index f7e6751028c..724fe2fef2b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/ParenExpr.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/ParenExpr.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql.AST
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/QueryExpr.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/QueryExpr.cs
index 2929b1ac288..ab258763caa 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/QueryExpr.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/QueryExpr.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql.AST
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/QueryParameter.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/QueryParameter.cs
index 42000a87285..0913e91f95d 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/QueryParameter.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/QueryParameter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql.AST
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/QueryStatement.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/QueryStatement.cs
index d417b7cd2be..4567c4fdebc 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/QueryStatement.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/QueryStatement.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql.AST
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/RefExpr.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/RefExpr.cs
index ecb09bd2b9d..9a3478111da 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/RefExpr.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/RefExpr.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql.AST
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/TypeDefinition.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/TypeDefinition.cs
index bb6f19e8185..c7bf3a98bbd 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/TypeDefinition.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/TypeDefinition.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql.AST
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlErrorHelper.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlErrorHelper.cs
index 681bf9fe753..0e53206e9c0 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlErrorHelper.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlErrorHelper.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlLexer.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlLexer.cs
index ddb98d334b2..8d8c09279c1 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlLexer.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlLexer.cs
@@ -15,8 +15,8 @@ namespace System.Data.Common.EntitySql
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//----------------------------------------------------------------------------*/
using System;
using System.Globalization;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlLexerHelpers.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlLexerHelpers.cs
index 23dcbc379d3..47780762363 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlLexerHelpers.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlLexerHelpers.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlParser.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlParser.cs
index 1049adebd58..d6ba939fb4b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlParser.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlParser.cs
@@ -27,8 +27,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------------*/
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlParserHelpers.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlParserHelpers.cs
index 901fbd4ec14..9dcc68e1834 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlParserHelpers.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlParserHelpers.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlQuery.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlQuery.cs
index e6891500876..8c8fbe0d752 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlQuery.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlQuery.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/EntitySqlParser.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/EntitySqlParser.cs
index 17b62f5bb6b..a6f018832cc 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/EntitySqlParser.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/EntitySqlParser.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/FunctionOverloadResolver.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/FunctionOverloadResolver.cs
index fe00e0c485c..0207198e650 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/FunctionOverloadResolver.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/FunctionOverloadResolver.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/ParseResult.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/ParseResult.cs
index fdbf4be14a1..77fa73c4548 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/ParseResult.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/ParseResult.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/ParserOptions.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/ParserOptions.cs
index cdfc03cda08..bf61750a919 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/ParserOptions.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/ParserOptions.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/SemanticAnalyzer.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/SemanticAnalyzer.cs
index 43bd38b5fb1..51130912b75 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/SemanticAnalyzer.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/SemanticAnalyzer.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/SemanticResolver.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/SemanticResolver.cs
index ddc2fe1ede2..9009be6405f 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/SemanticResolver.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/SemanticResolver.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/StaticContext.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/StaticContext.cs
index 810e2dde4a4..1000b4d4dff 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/StaticContext.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/StaticContext.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/TypeResolver.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/TypeResolver.cs
index 53052c6f947..99d2fcb2f2d 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/TypeResolver.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntitySql/TypeResolver.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntityUtil.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntityUtil.cs
index 273ba8bf547..0198bed47db 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntityUtil.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/EntityUtil.cs
@@ -2,7 +2,7 @@
// <copyright file="EntityUtil.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/FieldMetadata.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/FieldMetadata.cs
index 5ed39f1716c..f9c967c809f 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/FieldMetadata.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/FieldMetadata.cs
@@ -2,8 +2,8 @@
// <copyright file="FieldMetadata.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/FieldNameLookup.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/FieldNameLookup.cs
index e65c7390d7e..8d7177d5dde 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/FieldNameLookup.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/FieldNameLookup.cs
@@ -2,8 +2,8 @@
// <copyright file="FieldNameLookup.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/DbTypeMap.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/DbTypeMap.cs
index 65ab8650c8c..7a85d27b4f7 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/DbTypeMap.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/DbTypeMap.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
using System.Text;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/ColumnMapKeyBuilder.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/ColumnMapKeyBuilder.cs
index 19041a0c3c1..af3717ef8aa 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/ColumnMapKeyBuilder.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/ColumnMapKeyBuilder.cs
@@ -2,8 +2,8 @@
// <copyright file="ColumnMapKeyBuilder.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/CompensatingCollection.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/CompensatingCollection.cs
index 8526686cd3b..3b48e5f40e1 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/CompensatingCollection.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/CompensatingCollection.cs
@@ -2,8 +2,8 @@
// <copyright file="CompensatingCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common.Internal.Materialization
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/Coordinator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/Coordinator.cs
index 23be3839d6e..93a4e6c9006 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/Coordinator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/Coordinator.cs
@@ -2,8 +2,8 @@
// <copyright file="Coordinator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/CoordinatorFactory.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/CoordinatorFactory.cs
index 0ec0331c82c..b6807fa204b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/CoordinatorFactory.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/CoordinatorFactory.cs
@@ -2,8 +2,8 @@
// <copyright file="CoordinatorFactory.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/CoordinatorScratchpad.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/CoordinatorScratchpad.cs
index d2f81f02f8f..96323de312c 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/CoordinatorScratchpad.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/CoordinatorScratchpad.cs
@@ -2,8 +2,8 @@
// <copyright file="CoordinatorScratchpad.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/RecordState.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/RecordState.cs
index 096fd66153b..b2c725f9872 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/RecordState.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/RecordState.cs
@@ -2,7 +2,7 @@
// <copyright file="RecordState.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/RecordStateFactory.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/RecordStateFactory.cs
index 69904d04f81..0df64e38043 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/RecordStateFactory.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/RecordStateFactory.cs
@@ -2,7 +2,7 @@
// <copyright file="recordstatefactory.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/RecordStateScratchpad.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/RecordStateScratchpad.cs
index 7a5f65e0d44..796548170c0 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/RecordStateScratchpad.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/RecordStateScratchpad.cs
@@ -2,7 +2,7 @@
// <copyright file="RecordStateScratchpad.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/Shaper.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/Shaper.cs
index 659e0e1c4d5..db09b27ac82 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/Shaper.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/Shaper.cs
@@ -2,8 +2,8 @@
// <copyright file="Shaper.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common.Internal.Materialization
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/ShaperFactory.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/ShaperFactory.cs
index 0a4c89a46ce..3fd39f9d2b4 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/ShaperFactory.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/ShaperFactory.cs
@@ -2,8 +2,8 @@
// <copyright file="ShaperFactory.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Data.Common.QueryCache;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/Translator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/Translator.cs
index 065d41fc195..13268cda981 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/Translator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/Translator.cs
@@ -2,8 +2,8 @@
// <copyright file="Translator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common.Internal.Materialization
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/Util.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/Util.cs
index fd7cac415ba..a968ae5ff25 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/Util.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/Util.cs
@@ -2,7 +2,7 @@
// <copyright file="Util.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Data.Metadata.Edm;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/MultipartIdentifier.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/MultipartIdentifier.cs
index 53cef9b2883..b4f9fb47850 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/MultipartIdentifier.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Internal/MultipartIdentifier.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/CompiledQueryCacheEntry.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/CompiledQueryCacheEntry.cs
index 64adc859ece..d127840310e 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/CompiledQueryCacheEntry.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/CompiledQueryCacheEntry.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
namespace System.Data.Common.QueryCache
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/CompiledQueryCacheKey.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/CompiledQueryCacheKey.cs
index 2654fe187be..bd601d72ae1 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/CompiledQueryCacheKey.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/CompiledQueryCacheKey.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
namespace System.Data.Common.QueryCache
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/EntityClientCacheKey.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/EntityClientCacheKey.cs
index e1558153425..f779d4bc6c5 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/EntityClientCacheKey.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/EntityClientCacheKey.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
namespace System.Data.Common.QueryCache
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/EntitySqlQueryCacheKey.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/EntitySqlQueryCacheKey.cs
index e522b27cb61..c768adabf19 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/EntitySqlQueryCacheKey.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/EntitySqlQueryCacheKey.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
namespace System.Data.Common.QueryCache
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/LinqQueryCacheKey.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/LinqQueryCacheKey.cs
index 48e751b3acc..eda5cfd72ae 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/LinqQueryCacheKey.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/LinqQueryCacheKey.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
// @backupOwner venkatja
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/QueryCacheEntry.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/QueryCacheEntry.cs
index 095192735be..b24ea21c6f8 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/QueryCacheEntry.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/QueryCacheEntry.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
namespace System.Data.Common.QueryCache
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/QueryCacheKey.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/QueryCacheKey.cs
index 4619758aede..28884ac06de 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/QueryCacheKey.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/QueryCacheKey.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
namespace System.Data.Common.QueryCache
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/QueryCacheManager.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/QueryCacheManager.cs
index 1b0ccd787d2..7bbc1a39204 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/QueryCacheManager.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/QueryCacheManager.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
namespace System.Data.Common.QueryCache
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/ShaperFactoryQueryCacheKey.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/ShaperFactoryQueryCacheKey.cs
index 4b47edc6e0a..dd3826daef8 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/ShaperFactoryQueryCacheKey.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/QueryCache/ShaperFactoryQueryCacheKey.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/AliasGenerator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/AliasGenerator.cs
index 670f5e62d27..5417635a7e7 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/AliasGenerator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/AliasGenerator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/BoolExpr.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/BoolExpr.cs
index c06db3a12ae..4ddc93a1577 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/BoolExpr.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/BoolExpr.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Clause.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Clause.cs
index 510cf51b493..f06cf05f8a3 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Clause.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Clause.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/ConversionContext.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/ConversionContext.cs
index ba6cb2b8359..944a59a9a6e 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/ConversionContext.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/ConversionContext.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Converter.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Converter.cs
index c5bf383114b..893ab5a697f 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Converter.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Converter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/DomainConstraint.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/DomainConstraint.cs
index aa8d12e3cf8..0b69ae68647 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/DomainConstraint.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/DomainConstraint.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/IdentifierService.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/IdentifierService.cs
index 36d5bd11865..bfe37791df3 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/IdentifierService.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/IdentifierService.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/KnowledgeBase.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/KnowledgeBase.cs
index cb9d5569cd0..1fc9e9fd918 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/KnowledgeBase.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/KnowledgeBase.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Literal.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Literal.cs
index 372a0cfa3ad..90f18519cfa 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Literal.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Literal.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/NegationPusher.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/NegationPusher.cs
index 4a86fee78f8..0123003f256 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/NegationPusher.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/NegationPusher.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Sentence.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Sentence.cs
index 2b6716c3e68..92c7f9bee54 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Sentence.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Sentence.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Simplifier.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Simplifier.cs
index 2bad66e2616..b591a6645e2 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Simplifier.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Simplifier.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Solver.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Solver.cs
index d9769c5f3d4..8d0f77d7292 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Solver.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Solver.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
@@ -315,7 +315,7 @@ namespace System.Data.Common.Utils.Boolean
{
if (x.IsSink())
{
- // [....] nodes '1' and '0' each have one static instance; use reference
+ // sync nodes '1' and '0' each have one static instance; use reference
return x.Equals(y);
}
@@ -338,7 +338,7 @@ namespace System.Data.Common.Utils.Boolean
public int GetHashCode(Vertex vertex)
{
- // [....] nodes '1' and '0' each have one static instance; use reference
+ // sync nodes '1' and '0' each have one static instance; use reference
if (vertex.IsSink())
{
return vertex.GetHashCode();
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Vertex.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Vertex.cs
index 6806a73b293..38b8b5f8756 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Vertex.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Vertex.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Visitor.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Visitor.cs
index d4f25a816e4..b02fa5d12a2 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Visitor.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Visitor.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/ByValueEqualityComparer.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/ByValueEqualityComparer.cs
index 4cd2051c074..0be82c0865f 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/ByValueEqualityComparer.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/ByValueEqualityComparer.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/CommandHelper.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/CommandHelper.cs
index 39952ce672e..1163bf8f891 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/CommandHelper.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/CommandHelper.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common.Utils
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/DisposableCollectionWrapper.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/DisposableCollectionWrapper.cs
index 2096b088732..73f8b6299b3 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/DisposableCollectionWrapper.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/DisposableCollectionWrapper.cs
@@ -2,8 +2,8 @@
// <copyright file="DisposableCollectionWrapper.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
using System.Linq;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Helpers.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Helpers.cs
index 98a32e33eb7..232648f3e22 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Helpers.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Helpers.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/InternalBase.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/InternalBase.cs
index 44fe649dcb8..a35fdc2da4c 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/InternalBase.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/InternalBase.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/KeyToListMap.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/KeyToListMap.cs
index aaa2b0df35d..12a2a1333f3 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/KeyToListMap.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/KeyToListMap.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Memoizer.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Memoizer.cs
index f9f9d1d34d6..84395cf4cd7 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Memoizer.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Memoizer.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....], [....]
+// @owner Microsoft, Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/MetadataHelper.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/MetadataHelper.cs
index 8d7a31911c0..299763a4be3 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/MetadataHelper.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/MetadataHelper.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/ModifiableIteratorCollection.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/ModifiableIteratorCollection.cs
index 06db634abe4..17f7d6b5619 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/ModifiableIteratorCollection.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/ModifiableIteratorCollection.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Pair.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Pair.cs
index 78e1362f76e..4e671634668 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Pair.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Pair.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Set.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Set.cs
index 4b9b0fac334..4eead566ce4 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Set.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Set.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Singleton.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Singleton.cs
index cb7a53fc97c..9d5282ada31 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Singleton.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/Singleton.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/StringUtil.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/StringUtil.cs
index bdd52eaa5dc..79e347e3843 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/StringUtil.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/StringUtil.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/ThreadSafeList.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/ThreadSafeList.cs
index e867acd6f4c..1a26a4a102b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/ThreadSafeList.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/ThreadSafeList.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/TrailingSpaceComparer.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/TrailingSpaceComparer.cs
index 87929e26b72..261894900c9 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/TrailingSpaceComparer.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/TrailingSpaceComparer.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/TreePrinter.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/TreePrinter.cs
index fd2ab6566ee..dd2a101c588 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/TreePrinter.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Common/Utils/TreePrinter.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/DbConnectionOptions.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/DbConnectionOptions.cs
index 1a2aaea185e..4e0339f8842 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/DbConnectionOptions.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/DbConnectionOptions.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityClient
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/DbParameterCollectionHelper.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/DbParameterCollectionHelper.cs
index 4a9dc1f4858..a23005d3f2b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/DbParameterCollectionHelper.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/DbParameterCollectionHelper.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityClient
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/DbParameterHelper.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/DbParameterHelper.cs
index c56ef6076c6..6d34f8a1a4b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/DbParameterHelper.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/DbParameterHelper.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityAdapter.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityAdapter.cs
index 5a175d33d38..3881760b311 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityAdapter.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityAdapter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityClient
{
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityCommand.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityCommand.cs
index 84e2df32c93..ea6a1d39172 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityCommand.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityCommand.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityClient
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityCommandDefinition.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityCommandDefinition.cs
index 0f00c170eee..c0f9ea4308e 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityCommandDefinition.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityCommandDefinition.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
namespace System.Data.EntityClient {
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityConnection.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityConnection.cs
index 38de95d81a8..eb3909609c7 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityConnection.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityConnection.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityConnectionStringBuilder.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityConnectionStringBuilder.cs
index 22ba703d396..f6061e4879d 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityConnectionStringBuilder.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityConnectionStringBuilder.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityClient
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityDataReader.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityDataReader.cs
index f79b0546cf7..14b88c927f2 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityDataReader.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityDataReader.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityClient
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityParameter.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityParameter.cs
index 17c7aa10513..33fd948217e 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityParameter.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityParameter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityClient
{
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityParameterCollection.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityParameterCollection.cs
index 8303a917246..72b8c1bc9f2 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityParameterCollection.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityParameterCollection.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityProviderFactory.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityProviderFactory.cs
index f633d9b29d9..5687ab06d48 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityProviderFactory.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityProviderFactory.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityProviderServices.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityProviderServices.cs
index aa7b9d3a396..579cf6ba8bf 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityProviderServices.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityProviderServices.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
namespace System.Data.EntityClient {
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityTransaction.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityTransaction.cs
index 69c5466918e..ffaeda4db37 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityTransaction.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/EntityTransaction.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
using System.Text;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/NameValuePair.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/NameValuePair.cs
index 19ec74327d7..3d548d1059b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/NameValuePair.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityClient/NameValuePair.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
namespace System.Data.EntityClient
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityCommandCompilationException.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityCommandCompilationException.cs
index 6f88b770024..0975cf1d46b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityCommandCompilationException.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityCommandCompilationException.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityCommandExecutionException.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityCommandExecutionException.cs
index b464bf4d1d8..db9a7c62e02 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityCommandExecutionException.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityCommandExecutionException.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityException.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityException.cs
index 4060610bb93..84fd61e5c54 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityException.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityException.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityKey.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityKey.cs
index 249249a77c8..84c60eb7e87 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityKey.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityKey.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/BooleanFacetDescriptionElement.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/BooleanFacetDescriptionElement.cs
index 99ee5aa7289..f48665f8b5a 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/BooleanFacetDescriptionElement.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/BooleanFacetDescriptionElement.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ByteFacetDescriptionElement.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ByteFacetDescriptionElement.cs
index 8beec13112b..f9a3f58dc7b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ByteFacetDescriptionElement.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ByteFacetDescriptionElement.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/CollectionTypeElement.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/CollectionTypeElement.cs
index 987631ed9e9..e59c739447d 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/CollectionTypeElement.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/CollectionTypeElement.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Documentation.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Documentation.cs
index 855c7b9ab32..6edbe3939c2 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Documentation.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Documentation.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainer.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainer.cs
index 89d93ac8f85..1fd96226030 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainer.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainer.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerAssociationSet.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerAssociationSet.cs
index d3bf53f969f..1123c77d653 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerAssociationSet.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerAssociationSet.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerAssociationSetEnd.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerAssociationSetEnd.cs
index 9c1aa9ee3c8..94a82e4a503 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerAssociationSetEnd.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerAssociationSetEnd.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerEntitySet.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerEntitySet.cs
index 84f1077ffea..058927b46f9 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerEntitySet.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerEntitySet.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerEntitySetDefiningQuery.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerEntitySetDefiningQuery.cs
index e28c9e24530..a8e156eb9d4 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerEntitySetDefiningQuery.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerEntitySetDefiningQuery.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerRelationshipSet.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerRelationshipSet.cs
index 1a97aa2eb36..dca3bc5e3c3 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerRelationshipSet.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerRelationshipSet.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerRelationshipSetEnd.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerRelationshipSetEnd.cs
index 1d1ece88367..05d03efff65 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerRelationshipSetEnd.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerRelationshipSetEnd.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityKeyElement.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityKeyElement.cs
index 07445c95132..2126b2a9cc7 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityKeyElement.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityKeyElement.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FacetDescriptionElement.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FacetDescriptionElement.cs
index 49f2b7a865f..eb40d3dc23c 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FacetDescriptionElement.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FacetDescriptionElement.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FacetEnabledSchemaElement.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FacetEnabledSchemaElement.cs
index fc032324166..bb05b4a3e0b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FacetEnabledSchemaElement.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FacetEnabledSchemaElement.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FilteredSchemaElementLookUpTable.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FilteredSchemaElementLookUpTable.cs
index 1f831a311b6..3e5c9917d77 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FilteredSchemaElementLookUpTable.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FilteredSchemaElementLookUpTable.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Function.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Function.cs
index 30a10dceeb1..a037456cdcb 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Function.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Function.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FunctionCommandText.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FunctionCommandText.cs
index 2ce12d5387d..de1322b8ec1 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FunctionCommandText.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FunctionCommandText.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FunctionImportElement.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FunctionImportElement.cs
index 9839bdd1fc1..a1847012ca8 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FunctionImportElement.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FunctionImportElement.cs
@@ -4,7 +4,7 @@
// </copyright>
//
// @owner willa
-// @backupOwner [....]
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
{
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/IntegerFacetDescriptionElement.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/IntegerFacetDescriptionElement.cs
index 8e5edae4bc9..1e2c8644b09 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/IntegerFacetDescriptionElement.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/IntegerFacetDescriptionElement.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ItemType.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ItemType.cs
index 3a5149eef52..47d691af50e 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ItemType.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ItemType.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/KeyProperty.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/KeyProperty.cs
index bc0940010fb..7f79e877484 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/KeyProperty.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/KeyProperty.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ModelFunction.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ModelFunction.cs
index a44097e954b..1b62350a0c2 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ModelFunction.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ModelFunction.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ModelFunctionTypeElement.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ModelFunctionTypeElement.cs
index 97449e9f05a..89348cb9374 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ModelFunctionTypeElement.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ModelFunctionTypeElement.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/NavigationProperty.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/NavigationProperty.cs
index 3909de58609..796497f2851 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/NavigationProperty.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/NavigationProperty.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/OnOperation.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/OnOperation.cs
index 53f19784b37..b1dbc31b21c 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/OnOperation.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/OnOperation.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Parameter.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Parameter.cs
index 87bb5caf5f7..b290e9a7402 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Parameter.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Parameter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/PrimitiveSchema.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/PrimitiveSchema.cs
index 6a7c4c12102..bda27b31eba 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/PrimitiveSchema.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/PrimitiveSchema.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
{
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Property.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Property.cs
index 20550a805f4..54e40080652 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Property.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Property.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReferenceSchema.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReferenceSchema.cs
index d55c26c74d8..5965358fd4f 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReferenceSchema.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReferenceSchema.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReferenceTypeElement.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReferenceTypeElement.cs
index 38d5da73bf7..40e555cfcdf 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReferenceTypeElement.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReferenceTypeElement.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
{
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReferentialConstraint.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReferentialConstraint.cs
index 64ac3051caa..66d00ca22a4 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReferentialConstraint.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReferentialConstraint.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReferentialConstraintRoleElement.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReferentialConstraintRoleElement.cs
index d3634f435d6..f6ed7efc20a 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReferentialConstraintRoleElement.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReferentialConstraintRoleElement.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Relationship.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Relationship.cs
index b8c9f47ad89..5091d573a39 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Relationship.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Relationship.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/RelationshipEnd.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/RelationshipEnd.cs
index fb1f5f1cf97..e1806d8a657 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/RelationshipEnd.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/RelationshipEnd.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/RelationshipEndCollection.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/RelationshipEndCollection.cs
index e9ec6b5660e..15314c5f434 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/RelationshipEndCollection.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/RelationshipEndCollection.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReturnType.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReturnType.cs
index 0a04f994fff..fd81011ad40 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReturnType.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReturnType.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReturnValue.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReturnValue.cs
index 7ac9a584e35..07c82622a4b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReturnValue.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReturnValue.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/RowTypeElement.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/RowTypeElement.cs
index 99783ac47fb..b7742c27699 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/RowTypeElement.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/RowTypeElement.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/RowTypePropertyElement.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/RowTypePropertyElement.cs
index e17b0b9f0e6..cdbd4108a22 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/RowTypePropertyElement.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/RowTypePropertyElement.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ScalarType.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ScalarType.cs
index 7e2f1be5383..16d543e005b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ScalarType.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ScalarType.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Schema.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Schema.cs
index adb7b34c74d..636fc889fa3 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Schema.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Schema.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
@@ -540,13 +540,13 @@ namespace System.Data.EntityModel.SchemaObjectModel
}
}
- // ISSUE: jthunter-03/14/05 - The [....] "schemas" don't follow the ".Store" assembly
+ // ISSUE: jthunter-03/14/05 - The Sync "schemas" don't follow the ".Store" assembly
// naming convention but need to have the right StoreNamespace reported.
//
private static readonly string[] ClientNamespaceOfSchemasMissingStoreSuffix =
{
- "System.Storage.[....].Utility",
- "System.Storage.[....].Services"
+ "System.Storage.Sync.Utility",
+ "System.Storage.Sync.Services"
};
/// <summary>
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaComplexType.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaComplexType.cs
index 1c4aa5f7a37..2a768a1cb4e 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaComplexType.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaComplexType.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaElement.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaElement.cs
index eed8906e8fd..79be13fdd4f 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaElement.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaElement.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaElementLookUpTable.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaElementLookUpTable.cs
index 044bb35f30b..25bb4f749ba 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaElementLookUpTable.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaElementLookUpTable.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaElementLookUpTableEnumerator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaElementLookUpTableEnumerator.cs
index 428a071ab5b..fdcacf10dda 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaElementLookUpTableEnumerator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaElementLookUpTableEnumerator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaEnumMember.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaEnumMember.cs
index 6e680d0b7ed..ad6c82d1e56 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaEnumMember.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaEnumMember.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Metadata.Edm;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaEnumType.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaEnumType.cs
index 9c3b3153bf4..073088e111f 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaEnumType.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaEnumType.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaLookupTable.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaLookupTable.cs
index 3b550b8e67c..e6ea1117a1c 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaLookupTable.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaLookupTable.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaManager.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaManager.cs
index fbb7a3ae91f..1afb48b5dc6 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaManager.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaManager.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaType.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaType.cs
index 5e830ffb92f..f20a2965197 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaType.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaType.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SridFacetDescriptionElement.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SridFacetDescriptionElement.cs
index 23f186522b9..09196b79ed8 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SridFacetDescriptionElement.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SridFacetDescriptionElement.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/StructuredProperty.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/StructuredProperty.cs
index fb95425bf7a..20c9da2701c 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/StructuredProperty.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/StructuredProperty.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/StructuredType.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/StructuredType.cs
index c95e93da89e..887d8266891 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/StructuredType.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/StructuredType.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TextElement.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TextElement.cs
index 87637e60599..914cb26e5a6 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TextElement.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TextElement.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TypeElement.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TypeElement.cs
index 36d8b5c773b..d0f548aef8b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TypeElement.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TypeElement.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
{
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TypeRefElement.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TypeRefElement.cs
index 12e7e50dd5a..29ca6faa028 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TypeRefElement.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TypeRefElement.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TypeUsageBuilder.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TypeUsageBuilder.cs
index 6db83bb2cfd..62786cbaa9d 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TypeUsageBuilder.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TypeUsageBuilder.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Utils.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Utils.cs
index 61003c00172..dd342543448 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Utils.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Utils.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ValidationHelper.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ValidationHelper.cs
index 1095504e147..a9ea0c73140 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ValidationHelper.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ValidationHelper.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/XmlSchemaResource.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/XmlSchemaResource.cs
index eb3f3763f0c..151fed0e617 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/XmlSchemaResource.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/XmlSchemaResource.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Diagnostics;
using System.Data.Mapping;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/EntitySqlException.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/EntitySqlException.cs
index d9a0c3b2469..006f095191c 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/EntitySqlException.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/EntitySqlException.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/InternalMappingException.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/InternalMappingException.cs
index 0626e41a033..22f12f72ea9 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/InternalMappingException.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/InternalMappingException.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/InvalidCommandTreeException.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/InvalidCommandTreeException.cs
index 42e6cf01a1c..c078834631a 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/InvalidCommandTreeException.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/InvalidCommandTreeException.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/BaseMetadataMappingVisitor.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/BaseMetadataMappingVisitor.cs
index 44b985c6c3c..52c82e3c702 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/BaseMetadataMappingVisitor.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/BaseMetadataMappingVisitor.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/DefaultObjectMappingItemCollection.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/DefaultObjectMappingItemCollection.cs
index cc0286ea664..e57eacff796 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/DefaultObjectMappingItemCollection.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/DefaultObjectMappingItemCollection.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping {
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/EntityViewContainer.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/EntityViewContainer.cs
index 080a4486d7d..5d4e87e276e 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/EntityViewContainer.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/EntityViewContainer.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/EntityViewGenerationAttribute.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/EntityViewGenerationAttribute.cs
index d6caaa76c35..5e6c8a3f8de 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/EntityViewGenerationAttribute.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/EntityViewGenerationAttribute.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/FunctionImportMapping.ReturnTypeRenameMapping.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/FunctionImportMapping.ReturnTypeRenameMapping.cs
index 1b9cf0e5d67..18bffc41dc0 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/FunctionImportMapping.ReturnTypeRenameMapping.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/FunctionImportMapping.ReturnTypeRenameMapping.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/FunctionImportMapping.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/FunctionImportMapping.cs
index 610975820e8..6c3a297b64a 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/FunctionImportMapping.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/FunctionImportMapping.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
// @backupOwner willa
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/FunctionImportMappingComposable.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/FunctionImportMappingComposable.cs
index f0507d2946f..7e278377ff9 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/FunctionImportMappingComposable.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/FunctionImportMappingComposable.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
// @backupOwner willa
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/FunctionImportMappingNonComposable.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/FunctionImportMappingNonComposable.cs
index 88677a82ae6..a2c85076ab9 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/FunctionImportMappingNonComposable.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/FunctionImportMappingNonComposable.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
// @backupOwner willa
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Mapping.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Mapping.cs
index 17f4c59dce0..b6d419b7b52 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Mapping.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Mapping.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Metadata.Edm;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/MappingItemCollection.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/MappingItemCollection.cs
index c03c1cd57f2..aa74a7c7e7b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/MappingItemCollection.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/MappingItemCollection.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/MetadataMappingHasherVisitor.HashSourceBuilder.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/MetadataMappingHasherVisitor.HashSourceBuilder.cs
index d6f03a94a15..6a9f710c2ae 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/MetadataMappingHasherVisitor.HashSourceBuilder.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/MetadataMappingHasherVisitor.HashSourceBuilder.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/MetadataMappingHasherVisitor.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/MetadataMappingHasherVisitor.cs
index 864c5b5084d..bd42445d12b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/MetadataMappingHasherVisitor.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/MetadataMappingHasherVisitor.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectAssociationEndMapping.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectAssociationEndMapping.cs
index 1500adf78f3..694846f4987 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectAssociationEndMapping.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectAssociationEndMapping.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectComplexPropertyMapping.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectComplexPropertyMapping.cs
index fd72adf2af8..a2f034b38de 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectComplexPropertyMapping.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectComplexPropertyMapping.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectMemberMapping.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectMemberMapping.cs
index c6e1ac21542..02bb198649e 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectMemberMapping.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectMemberMapping.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectNavigationPropertyMapping.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectNavigationPropertyMapping.cs
index f77723f4c9c..09b9789d7de 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectNavigationPropertyMapping.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectNavigationPropertyMapping.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectPropertyMapping.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectPropertyMapping.cs
index c0a9472f995..61ff5df9971 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectPropertyMapping.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectPropertyMapping.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectTypeMapping.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectTypeMapping.cs
index ebe68f678d3..c0f7e7e40e7 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectTypeMapping.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ObjectTypeMapping.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping {
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageAssociationSetMapping.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageAssociationSetMapping.cs
index 577d30411bf..f2a4f7f28c7 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageAssociationSetMapping.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageAssociationSetMapping.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageAssociationTypeMapping.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageAssociationTypeMapping.cs
index 391865cf6ac..8ef29bd37f3 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageAssociationTypeMapping.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageAssociationTypeMapping.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....], [....]
+// @owner Microsoft, Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageComplexPropertyMapping.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageComplexPropertyMapping.cs
index bcc504de838..afa203d1820 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageComplexPropertyMapping.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageComplexPropertyMapping.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageComplexTypeMapping.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageComplexTypeMapping.cs
index a8fe6a6109d..cefcdbf047a 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageComplexTypeMapping.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageComplexTypeMapping.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....], [....]
+// @owner Microsoft, Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageConditionPropertyMapping.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageConditionPropertyMapping.cs
index d0ee0d38d05..5bdf08056e5 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageConditionPropertyMapping.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageConditionPropertyMapping.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageEndPropertyMapping.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageEndPropertyMapping.cs
index a9481990ec9..b9e1f19bca0 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageEndPropertyMapping.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageEndPropertyMapping.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageEntityContainerMapping.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageEntityContainerMapping.cs
index 65b8286e3c6..79082acd442 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageEntityContainerMapping.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageEntityContainerMapping.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageEntitySetMapping.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageEntitySetMapping.cs
index 59d2e3812c3..c96d6f796f9 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageEntitySetMapping.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageEntitySetMapping.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageEntityTypeMapping.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageEntityTypeMapping.cs
index 41575121e4e..6ed006dca51 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageEntityTypeMapping.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageEntityTypeMapping.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingFragment.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingFragment.cs
index faa501be935..6c5a11d38b9 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingFragment.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingFragment.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingItemCollection.ViewDictionary.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingItemCollection.ViewDictionary.cs
index c7a1eb015d3..dcdbffffe33 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingItemCollection.ViewDictionary.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingItemCollection.ViewDictionary.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingItemCollection.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingItemCollection.cs
index 3bb5addcabe..5dc0385243b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingItemCollection.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingItemCollection.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Concurrent;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingItemLoader.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingItemLoader.cs
index e065c9ab993..2c808ecf2f7 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingItemLoader.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingItemLoader.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageModificationFunctionMapping.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageModificationFunctionMapping.cs
index 50e659c6bfa..32eb36cb785 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageModificationFunctionMapping.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageModificationFunctionMapping.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StoragePropertyMapping.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StoragePropertyMapping.cs
index 455de50204d..b428ed32e4e 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StoragePropertyMapping.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StoragePropertyMapping.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageScalarPropertyMapping.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageScalarPropertyMapping.cs
index 84ed3c3e316..16b34ed9a5b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageScalarPropertyMapping.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageScalarPropertyMapping.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageSetMapping.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageSetMapping.cs
index d281639e816..4da03bddad0 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageSetMapping.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageSetMapping.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageTypeMapping.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageTypeMapping.cs
index 8d379b49851..b5f07a835d5 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageTypeMapping.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/StorageTypeMapping.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/AssociationSetMetadata.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/AssociationSetMetadata.cs
index a3936e775ad..5037b183ad4 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/AssociationSetMetadata.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/AssociationSetMetadata.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Metadata.Edm;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/ChangeNode.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/ChangeNode.cs
index 0008c3ea0d6..1eabff48fc8 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/ChangeNode.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/ChangeNode.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Metadata.Edm;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/CompositeKey.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/CompositeKey.cs
index bb2195d49e9..b44dafdadae 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/CompositeKey.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/CompositeKey.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common.Utils;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/DynamicUpdateCommand.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/DynamicUpdateCommand.cs
index 0318d986854..3e46e43dd30 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/DynamicUpdateCommand.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/DynamicUpdateCommand.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/ExtractedStateEntry.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/ExtractedStateEntry.cs
index 82a4dd8e5b1..aeac41b95be 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/ExtractedStateEntry.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/ExtractedStateEntry.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/ExtractorMetadata.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/ExtractorMetadata.cs
index 5f4cc16d35d..9f7c9321943 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/ExtractorMetadata.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/ExtractorMetadata.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping.Update.Internal
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/FunctionMappingTranslator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/FunctionMappingTranslator.cs
index 5b4e5b7ad3d..38dfb65d034 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/FunctionMappingTranslator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/FunctionMappingTranslator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping.Update.Internal
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/FunctionUpdateCommand.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/FunctionUpdateCommand.cs
index 8f5b8ae908a..a735b2cba46 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/FunctionUpdateCommand.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/FunctionUpdateCommand.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping.Update.Internal
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Graph.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Graph.cs
index 72db96c3fdd..984fdc72751 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Graph.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Graph.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common.Utils;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/KeyManager.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/KeyManager.cs
index 3027ad55fb0..c742f977e9f 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/KeyManager.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/KeyManager.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.Evaluator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.Evaluator.cs
index eb4d369acfb..0e43c6cadaa 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.Evaluator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.Evaluator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping.Update.Internal
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.ExtentPlaceholderCreator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.ExtentPlaceholderCreator.cs
index 578920ab53f..a45bf47ee0a 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.ExtentPlaceholderCreator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.ExtentPlaceholderCreator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping.Update.Internal
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.JoinPropagator.JoinPredicateVisitor.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.JoinPropagator.JoinPredicateVisitor.cs
index 48daf01bcb7..c8845f55599 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.JoinPropagator.JoinPredicateVisitor.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.JoinPropagator.JoinPredicateVisitor.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common.CommandTrees;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.JoinPropagator.SubstitutingCloneVisitor.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.JoinPropagator.SubstitutingCloneVisitor.cs
index cc924cef2a8..f4fa3a2a072 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.JoinPropagator.SubstitutingCloneVisitor.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.JoinPropagator.SubstitutingCloneVisitor.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.JoinPropagator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.JoinPropagator.cs
index e8af9fc114a..30ad18fab4b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.JoinPropagator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.JoinPropagator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.cs
index 799d01892fc..56ad4f94302 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping.Update.Internal
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/PropagatorResult.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/PropagatorResult.cs
index 44b50357633..4cf4b525290 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/PropagatorResult.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/PropagatorResult.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Metadata.Edm;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/RecordConverter.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/RecordConverter.cs
index 81ff164b67e..e6dfbe7aefb 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/RecordConverter.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/RecordConverter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping.Update.Internal
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/RelationshipConstraintValidator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/RelationshipConstraintValidator.cs
index e1e72226d4a..aa5e72d1dde 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/RelationshipConstraintValidator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/RelationshipConstraintValidator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping.Update.Internal
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/SourceInterpreter.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/SourceInterpreter.cs
index 9718ca9fef0..245956fb066 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/SourceInterpreter.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/SourceInterpreter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/TableChangeProcessor.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/TableChangeProcessor.cs
index 4567d472cb5..3acae097f5c 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/TableChangeProcessor.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/TableChangeProcessor.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping.Update.Internal
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UndirectedGraph.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UndirectedGraph.cs
index 055dcffd42b..0d0e4713385 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UndirectedGraph.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UndirectedGraph.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common.Utils;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateCommand.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateCommand.cs
index 2aa865a3b22..4de147195c1 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateCommand.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateCommand.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Metadata.Edm;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateCommandOrderer.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateCommandOrderer.cs
index 00104653455..79ed22c377a 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateCommandOrderer.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateCommandOrderer.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping.Update.Internal
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateCompiler.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateCompiler.cs
index 97eb4d5b00d..925fd2017d8 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateCompiler.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateCompiler.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
// For the purposes of the update compiler, the member name fully describes the member
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateExpressionVisitor.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateExpressionVisitor.cs
index f5643a33bf3..9260ac82643 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateExpressionVisitor.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateExpressionVisitor.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping.Update.Internal
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateTranslator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateTranslator.cs
index ca37def4e4d..73d15d4f5b8 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateTranslator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateTranslator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/ViewLoader.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/ViewLoader.cs
index 98564d69de3..487d6c24da4 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/ViewLoader.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/ViewLoader.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common.CommandTrees;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/BasicViewGenerator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/BasicViewGenerator.cs
index 180d906b6c0..e623485215b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/BasicViewGenerator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/BasicViewGenerator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping.ViewGeneration
@@ -131,7 +131,7 @@ namespace System.Data.Mapping.ViewGeneration
foreach (LeafCellTreeNode childNode in rootNode.Children)
{
// A cell may contain P, P.PA -- we return P
- // CHANGE_[....]_FEATURE_COMPOSITION Need to fix for composition!!
+ // CHANGE_Microsoft_FEATURE_COMPOSITION Need to fix for composition!!
EntitySetBase extent = childNode.LeftCellWrapper.RightCellQuery.Extent; // relation or extent to group by
Debug.Assert(extent != null, "Each cell must have a right extent");
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CellCreator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CellCreator.cs
index c046b6313be..e58f58fd666 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CellCreator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CellCreator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common.Utils;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CellPartitioner.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CellPartitioner.cs
index 5d0c913eeb7..e4e322dc8fa 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CellPartitioner.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CellPartitioner.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CellTreeSimplifier.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CellTreeSimplifier.cs
index 38b12707c68..a842a88a7bf 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CellTreeSimplifier.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CellTreeSimplifier.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common.Utils;
@@ -277,7 +277,7 @@ namespace System.Data.Mapping.ViewGeneration
}
// effects: Given a list of node, produces a new list in which all
// leaf nodes of the same extent are adjacent to each other. Non-leaf
- // nodes are also adjacent to each other. CHANGE_[....]_IMPROVE: Merge with GroupByRightExtent
+ // nodes are also adjacent to each other. CHANGE_Microsoft_IMPROVE: Merge with GroupByRightExtent
private static List<CellTreeNode> GroupLeafChildrenByExtent(List<CellTreeNode> nodes)
{
// Keep track of leaf cells for each extent
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ConfigViewGenerator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ConfigViewGenerator.cs
index 47c59a98a64..f771247ae0e 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ConfigViewGenerator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ConfigViewGenerator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common.Utils;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/AliasedSlot.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/AliasedSlot.cs
index 6bb05a2b699..499b17c2622 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/AliasedSlot.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/AliasedSlot.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Linq;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/BooleanProjectedSlot.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/BooleanProjectedSlot.cs
index 79a030bafca..113e28387d8 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/BooleanProjectedSlot.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/BooleanProjectedSlot.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Mapping.ViewGeneration.Structures;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/CaseCqlBlock.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/CaseCqlBlock.cs
index 950e3e963b5..e8ba88d0a35 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/CaseCqlBlock.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/CaseCqlBlock.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Mapping.ViewGeneration.Structures;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/CqlBlock.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/CqlBlock.cs
index 98164a94b99..7c4eba699f1 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/CqlBlock.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/CqlBlock.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Linq;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/CqlIdentifiers.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/CqlIdentifiers.cs
index 9c7734fb805..c4db94301f8 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/CqlIdentifiers.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/CqlIdentifiers.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/CqlWriter.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/CqlWriter.cs
index 81fc0288469..429ed1b1fca 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/CqlWriter.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/CqlWriter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Text.RegularExpressions;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/ExtentCqlBlock.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/ExtentCqlBlock.cs
index f85ee235972..c4a67914078 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/ExtentCqlBlock.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/ExtentCqlBlock.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Text;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/JoinCqlBlock.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/JoinCqlBlock.cs
index 45c0a5f078f..408f2a90b15 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/JoinCqlBlock.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/JoinCqlBlock.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common.CommandTrees;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/SlotInfo.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/SlotInfo.cs
index eb2afc5c045..3d33ff07f6b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/SlotInfo.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/SlotInfo.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common.CommandTrees;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/UnionCqlBlock.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/UnionCqlBlock.cs
index 2c7b8c23f0c..95dffb4d6d2 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/UnionCqlBlock.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/UnionCqlBlock.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGenerator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGenerator.cs
index 00988416f9e..37005f747e9 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGenerator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGenerator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/DiscriminatorMap.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/DiscriminatorMap.cs
index 0c7848e3f5c..5abadcbd1ca 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/DiscriminatorMap.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/DiscriminatorMap.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common.CommandTrees;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/GeneratedView.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/GeneratedView.cs
index 3c2c331ced4..bec352a06e0 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/GeneratedView.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/GeneratedView.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping.ViewGeneration
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/FragmentQuery.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/FragmentQuery.cs
index 934e2018a15..6c94e503845 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/FragmentQuery.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/FragmentQuery.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/FragmentQueryKB.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/FragmentQueryKB.cs
index cffda30fdaf..ae6ec412009 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/FragmentQueryKB.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/FragmentQueryKB.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/FragmentQueryProcessor.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/FragmentQueryProcessor.cs
index 01754ba8ca3..f13c6dc4798 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/FragmentQueryProcessor.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/FragmentQueryProcessor.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/QueryRewriter.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/QueryRewriter.cs
index d209d9f8086..60fc38179a9 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/QueryRewriter.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/QueryRewriter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping.ViewGeneration.QueryRewriting
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RewritingPass.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RewritingPass.cs
index 860db188a7b..ae9abeb5c8f 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RewritingPass.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RewritingPass.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RewritingProcessor.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RewritingProcessor.cs
index df892676b9c..41c4e1dd90b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RewritingProcessor.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RewritingProcessor.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RewritingSimplifier.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RewritingSimplifier.cs
index 55d91edbd42..4a28e458c96 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RewritingSimplifier.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RewritingSimplifier.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RewritingValidator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RewritingValidator.cs
index 4f1d21f57c7..588dfe0f4d2 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RewritingValidator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RewritingValidator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping.ViewGeneration.Validation
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RoleBoolean.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RoleBoolean.cs
index 8a1ae2c20ed..2f944c42fd3 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RoleBoolean.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RoleBoolean.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping.ViewGeneration.Structures
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/Tile.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/Tile.cs
index 8d490f590c4..c949b568161 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/Tile.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/Tile.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/BoolExpression.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/BoolExpression.cs
index c44639280ba..3fd29a627d6 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/BoolExpression.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/BoolExpression.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
@@ -366,7 +366,7 @@ namespace System.Data.Mapping.ViewGeneration.Structures
// effects: Given a list of bools, returns a list of boolean expressions where each
// boolean in bools has been ANDed with conjunct
- // CHANGE_[....]_IMPROVE: replace with lambda pattern
+ // CHANGE_Microsoft_IMPROVE: replace with lambda pattern
internal static List<BoolExpression> AddConjunctionToBools(List<BoolExpression> bools,
BoolExpression conjunct)
{
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/BoolExpressionVisitors.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/BoolExpressionVisitors.cs
index fc4c1968033..ade70afbb46 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/BoolExpressionVisitors.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/BoolExpressionVisitors.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/BoolLiteral.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/BoolLiteral.cs
index babeaa62fd9..64fdf537271 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/BoolLiteral.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/BoolLiteral.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common.CommandTrees;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CaseStatement.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CaseStatement.cs
index 1c12511787b..6e6e4d40d28 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CaseStatement.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CaseStatement.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common.CommandTrees;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CaseStatementProjectedSlot.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CaseStatementProjectedSlot.cs
index ee74e3a1b5a..8cdc34aed52 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CaseStatementProjectedSlot.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CaseStatementProjectedSlot.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Mapping.ViewGeneration.CqlGeneration;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/Cell.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/Cell.cs
index 8fa4646bffc..d7bc3432204 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/Cell.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/Cell.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common.Utils;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellIdBoolean.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellIdBoolean.cs
index 251f86b8e6c..97740718c4b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellIdBoolean.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellIdBoolean.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping.ViewGeneration.Structures
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellLabel.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellLabel.cs
index 4cc45bfd87a..bf02ac8aaaa 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellLabel.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellLabel.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellQuery.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellQuery.cs
index 43f8b68149a..3ed84c6123b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellQuery.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellQuery.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellTreeNode.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellTreeNode.cs
index 6bce7b75eec..ecb925ac2aa 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellTreeNode.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellTreeNode.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping.ViewGeneration.Structures
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellTreeNodeVisitors.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellTreeNodeVisitors.cs
index 2c78985a09d..351a941659e 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellTreeNodeVisitors.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellTreeNodeVisitors.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/Constant.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/Constant.cs
index a77b8a4ab8a..c90fbb6688a 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/Constant.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/Constant.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping.ViewGeneration.Structures
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ConstantProjectedSlot.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ConstantProjectedSlot.cs
index 93a14b96481..4c9c27cbdd5 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ConstantProjectedSlot.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ConstantProjectedSlot.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Mapping.ViewGeneration.CqlGeneration;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/Domain.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/Domain.cs
index 244c548fcda..57b4f8fab6d 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/Domain.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/Domain.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
@@ -177,7 +177,7 @@ namespace System.Data.Mapping.ViewGeneration.Structures
// effect: returns the default value for the member
// if the member is nullable and has no default, changes default value to CellConstant.NULL and returns true
// if the mebmer is not nullable and has no default, returns false
- // CHANGE_[....]_FEATURE_DEFAULT_VALUES: return the right default once metadata supports it
+ // CHANGE_Microsoft_FEATURE_DEFAULT_VALUES: return the right default once metadata supports it
internal static bool TryGetDefaultValueForMemberPath(MemberPath memberPath, out Constant defaultConstant)
{
object defaultValue = memberPath.DefaultValue;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ErrorLog.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ErrorLog.cs
index 6b312d1eee2..ba65fe75cdb 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ErrorLog.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ErrorLog.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping.ViewGeneration.Structures
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/LeafCellTreeNode.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/LeafCellTreeNode.cs
index bf49103be6a..5b37f45fcd3 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/LeafCellTreeNode.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/LeafCellTreeNode.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/LeftCellWrapper.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/LeftCellWrapper.cs
index 66778f77413..a67833981cb 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/LeftCellWrapper.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/LeftCellWrapper.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberDomainMap.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberDomainMap.cs
index 83dbe8c0051..47e31c66e03 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberDomainMap.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberDomainMap.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping.ViewGeneration.Structures
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberMaps.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberMaps.cs
index 3fed309b1e0..5ecce1d3129 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberMaps.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberMaps.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberPath.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberPath.cs
index ad0dff46855..ba48a1389b0 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberPath.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberPath.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberProjectedSlot.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberProjectedSlot.cs
index a58b3771257..b17ce971f8a 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberProjectedSlot.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberProjectedSlot.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberProjectionIndex.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberProjectionIndex.cs
index b508995fe82..d36c26c239b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberProjectionIndex.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberProjectionIndex.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberRestriction.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberRestriction.cs
index 797e1e67553..fc63a292611 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberRestriction.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberRestriction.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/NegatedConstant.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/NegatedConstant.cs
index fa8f05cfa42..9c671fe6b49 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/NegatedConstant.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/NegatedConstant.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping.ViewGeneration.Structures
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/OpCellTreeNode.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/OpCellTreeNode.cs
index 362e9ff8444..231b1563cb2 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/OpCellTreeNode.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/OpCellTreeNode.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ProjectedSlot.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ProjectedSlot.cs
index 5fda4c615d8..48e2157c280 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ProjectedSlot.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ProjectedSlot.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping.ViewGeneration.Structures
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/QualifiedCellIdBoolean.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/QualifiedCellIdBoolean.cs
index b9800cf93c2..8ad476f8713 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/QualifiedCellIdBoolean.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/QualifiedCellIdBoolean.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common.CommandTrees;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ScalarConstant.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ScalarConstant.cs
index a7219d6e2e8..dca95d8251a 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ScalarConstant.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ScalarConstant.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Text;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ScalarRestriction.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ScalarRestriction.cs
index 722aa09c792..59fa8a68f43 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ScalarRestriction.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ScalarRestriction.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/TypeConstant.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/TypeConstant.cs
index 6dd961fd257..703f8109623 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/TypeConstant.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/TypeConstant.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Text;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/TypeRestriction.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/TypeRestriction.cs
index c4cb20d7394..a17ef9ea303 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/TypeRestriction.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/TypeRestriction.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common.CommandTrees;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/WithStatement.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/WithStatement.cs
index d609a2fe78b..2d262cf77be 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/WithStatement.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/WithStatement.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common.CommandTrees;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Utils/ExceptionHelpers.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Utils/ExceptionHelpers.cs
index 8166c317f57..fffdf5ad153 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Utils/ExceptionHelpers.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Utils/ExceptionHelpers.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Text;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Utils/ExternalCalls.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Utils/ExternalCalls.cs
index befe9b356bc..5fb40d8716e 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Utils/ExternalCalls.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Utils/ExternalCalls.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/BasicCellRelation.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/BasicCellRelation.cs
index 36603532697..fbd9c76e843 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/BasicCellRelation.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/BasicCellRelation.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.Bharani1729
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
@@ -88,7 +88,7 @@ namespace System.Data.Mapping.ViewGeneration.Validation
{
AssociationSet relationshipSet = m_cellQuery.Extent as AssociationSet;
// Gather all members of all keys
- // CHANGE_[....]_FEATURE_KEYS: assume that an Entity has exactly one key. Otherwise we
+ // CHANGE_Microsoft_FEATURE_KEYS: assume that an Entity has exactly one key. Otherwise we
// have to take a cross-product of all keys
// Keep track of all the key members for the association in a set
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/BasicKeyConstraint.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/BasicKeyConstraint.cs
index b52c62ee46c..299fe131dae 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/BasicKeyConstraint.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/BasicKeyConstraint.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/CellRelation.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/CellRelation.cs
index 1824b2900aa..ac9c66cb674 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/CellRelation.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/CellRelation.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ErrorPatternMatcher.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ErrorPatternMatcher.cs
index 918b7ff0db8..b57ab576fc8 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ErrorPatternMatcher.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ErrorPatternMatcher.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ExtentKey.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ExtentKey.cs
index eceb6063eff..a89bf827153 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ExtentKey.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ExtentKey.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
@@ -49,7 +49,7 @@ namespace System.Data.Mapping.ViewGeneration.Structures
// -- prefix is prepended to the entity's key fields to get the full memberpath
internal static List<ExtentKey> GetKeysForEntityType(MemberPath prefix, EntityType entityType)
{
- // CHANGE_[....]_MULTIPLE_KEYS: currently there is a single key only. Need to support
+ // CHANGE_Microsoft_MULTIPLE_KEYS: currently there is a single key only. Need to support
// keys inside complex types + unique keys
ExtentKey key = GetPrimaryKeyForEntityType(prefix, entityType);
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ForeignConstraint.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ForeignConstraint.cs
index b4cbd320229..28c9c71a945 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ForeignConstraint.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ForeignConstraint.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/KeyConstraint.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/KeyConstraint.cs
index 7de84425340..e9de9dcdb0b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/KeyConstraint.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/KeyConstraint.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common.Utils;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/SchemaConstraints.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/SchemaConstraints.cs
index a3eb207a5c3..8e43ff8f0d3 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/SchemaConstraints.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/SchemaConstraints.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ViewCellRelation.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ViewCellRelation.cs
index be91192de83..dc4799b9aee 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ViewCellRelation.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ViewCellRelation.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
@@ -62,7 +62,7 @@ namespace System.Data.Mapping.ViewGeneration.Validation
// null if it does not find the slot in the left or right side of the viewrelation
internal ViewCellSlot LookupViewSlot(MemberProjectedSlot slot)
{
- // CHANGE_[....]_IMPROVE: We could have a dictionary to speed this up
+ // CHANGE_Microsoft_IMPROVE: We could have a dictionary to speed this up
foreach (ViewCellSlot viewSlot in m_slots)
{
// If the left or right slots are equal, return the viewSlot
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ViewCellSlot.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ViewCellSlot.cs
index 9b9fe692111..fea993596f7 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ViewCellSlot.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ViewCellSlot.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping.ViewGeneration.Validation
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ViewKeyConstraint.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ViewKeyConstraint.cs
index 704c122b1b9..a8898c241a3 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ViewKeyConstraint.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ViewKeyConstraint.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping.ViewGeneration.Validation
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validator.cs
index a8b380e66cb..497a193d435 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ViewGenResults.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ViewGenResults.cs
index 1061c52a563..a0348faf796 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ViewGenResults.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ViewGenResults.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common.Utils;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ViewGenerator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ViewGenerator.cs
index 8c5618e7a68..96d9d83e985 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ViewGenerator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ViewGenerator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common.CommandTrees;
@@ -492,7 +492,7 @@ namespace System.Data.Mapping.ViewGeneration
{
// Partition cells by extent -- extent is the top node in
- // the tree. Even for compositions for now? CHANGE_[....]_FEATURE_COMPOSITION
+ // the tree. Even for compositions for now? CHANGE_Microsoft_FEATURE_COMPOSITION
KeyToListMap<EntitySetBase, Cell> extentCellMap =
new KeyToListMap<EntitySetBase, Cell>(EqualityComparer<EntitySetBase>.Default);
foreach (Cell cell in cells)
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ViewgenContext.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ViewgenContext.cs
index 50bb0142b12..b23ecf6a9ef 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ViewgenContext.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ViewgenContext.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping.ViewGeneration
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ViewgenGatekeeper.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ViewgenGatekeeper.cs
index f7a1d411304..20bf0b8be66 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ViewgenGatekeeper.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ViewgenGatekeeper.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewValidator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewValidator.cs
index 2ab3c302c64..cce9f4315c5 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewValidator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Mapping/ViewValidator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Mapping
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/MappingException.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/MappingException.cs
index 4c8e9d1c52f..0cd23d838ab 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/MappingException.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/MappingException.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/AspProxy.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/AspProxy.cs
index cf39195f055..440497527a6 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/AspProxy.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/AspProxy.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/CacheForPrimitiveTypes.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/CacheForPrimitiveTypes.cs
index 100159b7cc1..cc3c04e0ccf 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/CacheForPrimitiveTypes.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/CacheForPrimitiveTypes.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ClrPerspective.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ClrPerspective.cs
index 708896590ab..96cb27bb729 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ClrPerspective.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ClrPerspective.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Converter.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Converter.cs
index eb4e61ec3a1..40d2b765ea6 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Converter.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Converter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/CustomAssemblyResolver.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/CustomAssemblyResolver.cs
index 2ed13e505f8..608bdd56cf8 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/CustomAssemblyResolver.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/CustomAssemblyResolver.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
{
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/DefaultAssemblyResolver.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/DefaultAssemblyResolver.cs
index a5abcab9c54..134045feeaa 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/DefaultAssemblyResolver.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/DefaultAssemblyResolver.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Reflection;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AssociationEndMember.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AssociationEndMember.cs
index 48490fa5ea5..33511243f75 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AssociationEndMember.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AssociationEndMember.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AssociationSet.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AssociationSet.cs
index e0d165556ca..64df1f868d9 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AssociationSet.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AssociationSet.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AssociationSetEnd.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AssociationSetEnd.cs
index 3fe246c32f3..b6c5cbd435f 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AssociationSetEnd.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AssociationSetEnd.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AssociationType.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AssociationType.cs
index bc728310577..f12462b1cfc 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AssociationType.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AssociationType.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/CollectionType.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/CollectionType.cs
index 27f49ab651e..debab768619 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/CollectionType.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/CollectionType.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ComplexType.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ComplexType.cs
index b3aa9751cd0..ad0fe21a19d 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ComplexType.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ComplexType.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common;
using System.Threading;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Documentation.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Documentation.cs
index 38f6d3d350c..c036a9c0e7c 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Documentation.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Documentation.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmConstants.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmConstants.cs
index 45ce070b209..b85a830d454 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmConstants.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmConstants.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmFunction.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmFunction.cs
index a9c0b1672d0..29632cdfbfe 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmFunction.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmFunction.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmMember.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmMember.cs
index 2a5f5c8d8ea..e04b0142996 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmMember.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmMember.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmProperty.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmProperty.cs
index 0d42381f47b..b1529dde633 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmProperty.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmProperty.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmType.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmType.cs
index 39a25ab7478..c324b5475cf 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmType.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmType.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common;
using System.Globalization;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntityContainer.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntityContainer.cs
index e04b365e3f8..a51c2f59ceb 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntityContainer.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntityContainer.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntitySet.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntitySet.cs
index d22fccf9b12..500c7b26949 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntitySet.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntitySet.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntitySetBase.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntitySetBase.cs
index 0679dfe8aa3..8b09606a6fe 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntitySetBase.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntitySetBase.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntitySetBaseCollection.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntitySetBaseCollection.cs
index 72ba6079dd3..e0a884a8455 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntitySetBaseCollection.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntitySetBaseCollection.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntityType.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntityType.cs
index 65f780409a5..60d95712d4f 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntityType.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntityType.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntityTypeBase.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntityTypeBase.cs
index d3776b976ee..da5951871ce 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntityTypeBase.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntityTypeBase.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
{
@@ -80,7 +80,7 @@ namespace System.Data.Metadata.Edm
}
_keyMemberNames = keyNames;
}
- Debug.Assert(_keyMemberNames.Length == this.KeyMembers.Count, "This list is out of [....] with the key members count. This property was called before all the keymembers were added");
+ Debug.Assert(_keyMemberNames.Length == this.KeyMembers.Count, "This list is out of sync with the key members count. This property was called before all the keymembers were added");
return _keyMemberNames;
}
}
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EnumMember.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EnumMember.cs
index da510a866b1..ef089ea63df 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EnumMember.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EnumMember.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EnumType.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EnumType.cs
index 29488511a7d..1c4df323c56 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EnumType.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EnumType.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Facet.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Facet.cs
index 5e985eb5ac0..af7f7551704 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Facet.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Facet.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FacetDescription.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FacetDescription.cs
index 3bb0c373d3d..4a8670c2768 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FacetDescription.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FacetDescription.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FacetValueContainer.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FacetValueContainer.cs
index ef7173e62f1..d87d9a59303 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FacetValueContainer.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FacetValueContainer.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FacetValues.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FacetValues.cs
index 93cba7cd887..25cf2a8c4ce 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FacetValues.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FacetValues.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FilteredReadOnlyMetadataCollection.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FilteredReadOnlyMetadataCollection.cs
index 6595c460229..a29f99ad926 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FilteredReadOnlyMetadataCollection.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FilteredReadOnlyMetadataCollection.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FunctionParameter.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FunctionParameter.cs
index 005a5db5697..326e416c81e 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FunctionParameter.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FunctionParameter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/GlobalItem.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/GlobalItem.cs
index 1e1e1517d0c..4b768e48171 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/GlobalItem.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/GlobalItem.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ItemCollection.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ItemCollection.cs
index d04aa073116..de0b94047e1 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ItemCollection.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ItemCollection.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/LightweightCodeGenerator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/LightweightCodeGenerator.cs
index fc0e9e2a595..cc60a7a0f0a 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/LightweightCodeGenerator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/LightweightCodeGenerator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MemberCollection.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MemberCollection.cs
index c2f9cbd869a..155f6555977 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MemberCollection.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MemberCollection.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataCollection.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataCollection.cs
index 36535c8a099..e62dd919b71 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataCollection.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataCollection.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
@@ -28,7 +28,7 @@ namespace System.Data.Metadata.Edm
// The way the collection supports both case sensitive and insensitive search is that it maintains two lists: one list
// for keep tracking of the order (the ordered list) and another list sorted case sensitively (the sorted list) by the
// identity of the item. When a look up on ordinal is requested, the ordered list is used. When a look up on the name
- // is requested, the sorted list is used. The two list must be kept in [....] for all update operations. For case
+ // is requested, the sorted list is used. The two list must be kept in sync for all update operations. For case
// sensitive name lookup, the sorted list is searched. For case insensitive name lookup, a binary search is used on the
// sorted list to find the match.
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataItem.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataItem.cs
index a99c0292b85..04e93f76499 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataItem.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataItem.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataItem_Static.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataItem_Static.cs
index 126c4b7a946..e8da22d701c 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataItem_Static.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataItem_Static.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Data.Common;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataProperty.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataProperty.cs
index b8ac93d079a..0fe365f08d7 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataProperty.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataProperty.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataPropertyAttribute.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataPropertyAttribute.cs
index 471301f36f7..3e0684456cb 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataPropertyAttribute.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataPropertyAttribute.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataPropertyCollection.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataPropertyCollection.cs
index 6ae1221508b..b8119608c96 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataPropertyCollection.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataPropertyCollection.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataPropertyvalue.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataPropertyvalue.cs
index 26897499b44..8fdb0eca6f5 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataPropertyvalue.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataPropertyvalue.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/NavigationProperty.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/NavigationProperty.cs
index 721725925b8..e8525f7cca0 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/NavigationProperty.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/NavigationProperty.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
using System.Data.Common;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/NavigationPropertyAccessor.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/NavigationPropertyAccessor.cs
index 52a8949ac7b..d9e8da11dad 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/NavigationPropertyAccessor.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/NavigationPropertyAccessor.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/PrimitiveType.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/PrimitiveType.cs
index 5e644eb5637..89ccf2a65bb 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/PrimitiveType.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/PrimitiveType.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
using System.Data.Common;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Provider/ClrProviderManifest.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Provider/ClrProviderManifest.cs
index 82627c4857b..126408018f4 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Provider/ClrProviderManifest.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Provider/ClrProviderManifest.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Provider/EdmProviderManifest.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Provider/EdmProviderManifest.cs
index cb2f50ddb49..372fabbcadc 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Provider/EdmProviderManifest.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Provider/EdmProviderManifest.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Provider/EdmProviderManifestFunctionBuilder.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Provider/EdmProviderManifestFunctionBuilder.cs
index fbbf97d8c33..69d4bf334f7 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Provider/EdmProviderManifestFunctionBuilder.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Provider/EdmProviderManifestFunctionBuilder.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Provider/EdmProviderManifestSpatialFunctions.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Provider/EdmProviderManifestSpatialFunctions.cs
index 19fc7d19693..b34b1578674 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Provider/EdmProviderManifestSpatialFunctions.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Provider/EdmProviderManifestSpatialFunctions.cs
@@ -4,7 +4,7 @@
// </copyright>
//
// @owner willa
-// @backupOwner [....]
+// @backupOwner Microsoft
//--------------------------------------------------------------------------
// This file is automatically generated and should not be changed directly.
//
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ReadOnlyMetadataCollection.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ReadOnlyMetadataCollection.cs
index 3f60afa5930..cc964f3ee3a 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ReadOnlyMetadataCollection.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ReadOnlyMetadataCollection.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RefType.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RefType.cs
index d33335f4ea1..8c8184cbb8e 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RefType.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RefType.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ReferentialConstraint.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ReferentialConstraint.cs
index 71295ba55d0..051d7bfea91 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ReferentialConstraint.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ReferentialConstraint.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RelationshipEndMember.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RelationshipEndMember.cs
index 4a635d82d00..81225a715aa 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RelationshipEndMember.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RelationshipEndMember.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RelationshipSet.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RelationshipSet.cs
index f4714eccfd9..39ba5e07a9c 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RelationshipSet.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RelationshipSet.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RelationshipType.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RelationshipType.cs
index 46c0107a694..1e3b042741d 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RelationshipType.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RelationshipType.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RowType.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RowType.cs
index 0b954067dfe..3285477da06 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RowType.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RowType.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/SafeLink.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/SafeLink.cs
index 22e4126b516..563a8b5d1c3 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/SafeLink.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/SafeLink.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/SafeLinkCollection.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/SafeLinkCollection.cs
index 39a0c85d911..43b3fa00f50 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/SafeLinkCollection.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/SafeLinkCollection.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/SimpleType.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/SimpleType.cs
index 554cbcdc72e..82c07fbd460 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/SimpleType.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/SimpleType.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/StructuralType.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/StructuralType.cs
index 66fe1c7e222..dea24673fb9 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/StructuralType.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/StructuralType.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/TypeUsage.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/TypeUsage.cs
index 29308e0a41e..308c2bc680f 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/TypeUsage.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/TypeUsage.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/util.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/util.cs
index b54adc330fe..3ea3b7036a0 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/util.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Edm/util.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmError.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmError.cs
index 883a09574b6..e2915eed001 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmError.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmError.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmItemCollection.OcAssemblyCache.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmItemCollection.OcAssemblyCache.cs
index b6cf2394825..19f0082a323 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmItemCollection.OcAssemblyCache.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmItemCollection.OcAssemblyCache.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
using System.Reflection;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmItemCollection.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmItemCollection.cs
index 570ad901c22..ca1d2be4049 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmItemCollection.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmItemCollection.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
{
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmItemError.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmItemError.cs
index feee36878f6..c18d3a5cab4 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmItemError.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmItemError.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmSchemaError.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmSchemaError.cs
index 7769c09386f..e6a143183d7 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmSchemaError.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmSchemaError.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmValidator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmValidator.cs
index 45822d9d4fe..9aca70f7026 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmValidator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/EdmValidator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Helper.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Helper.cs
index 392270ccdfe..ac6358abfd6 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Helper.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Helper.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MappingMetadataHelper.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MappingMetadataHelper.cs
index 80fefe07773..38916861f8d 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MappingMetadataHelper.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MappingMetadataHelper.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
{
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoader.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoader.cs
index d393a6b4d57..215b129f8b7 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoader.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoader.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderComposite.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderComposite.cs
index 0338f5466c8..3f1a54b1f42 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderComposite.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderComposite.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderCompositeFile.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderCompositeFile.cs
index f81c3bffddd..77769e7606f 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderCompositeFile.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderCompositeFile.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderCompositeResource.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderCompositeResource.cs
index 959e6617f94..344a60e79a2 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderCompositeResource.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderCompositeResource.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderFile.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderFile.cs
index 3fd746c44ae..ca04d7a87a4 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderFile.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderFile.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderResource.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderResource.cs
index 7b6927c6403..419e2f1f078 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderResource.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderResource.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderXmlReaderWrapper.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderXmlReaderWrapper.cs
index 8624eb4bf3f..e83fa0c9aea 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderXmlReaderWrapper.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderXmlReaderWrapper.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataCache.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataCache.cs
index d9701d51016..340a26d7fc0 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataCache.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataCache.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataWorkspace.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataWorkspace.cs
index 0652558289b..831428feee1 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataWorkspace.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/MetadataWorkspace.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ModelPerspective.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ModelPerspective.cs
index 855de302a69..90cc7b12fbf 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ModelPerspective.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ModelPerspective.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectHelper.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectHelper.cs
index 6d966224dfa..abde1abf26a 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectHelper.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectHelper.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Mapping;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectItemCollection.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectItemCollection.cs
index ccbb10a4351..2c79eb40dff 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectItemCollection.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectItemCollection.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/AssemblyCache.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/AssemblyCache.cs
index 02d09f98b3f..1c8a8b9fe2e 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/AssemblyCache.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/AssemblyCache.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/AssemblyCacheEntry.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/AssemblyCacheEntry.cs
index fdaab763c81..b5c6ec4f62f 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/AssemblyCacheEntry.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/AssemblyCacheEntry.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ImmutableAssemblyCacheEntry.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ImmutableAssemblyCacheEntry.cs
index e6804614e98..f21a4759737 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ImmutableAssemblyCacheEntry.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ImmutableAssemblyCacheEntry.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/KnownAssembliesSet.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/KnownAssembliesSet.cs
index 608f707ef5d..116233108c4 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/KnownAssembliesSet.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/KnownAssembliesSet.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/KnownAssemblyEntry.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/KnownAssemblyEntry.cs
index 2a59d2d691f..ca0b6bd3763 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/KnownAssemblyEntry.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/KnownAssemblyEntry.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/LoadMessageLogger.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/LoadMessageLogger.cs
index 91104516465..e4501a21494 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/LoadMessageLogger.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/LoadMessageLogger.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
{
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/LockedAssemblyCache.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/LockedAssemblyCache.cs
index 43ef352dbf7..a81ccee2cee 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/LockedAssemblyCache.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/LockedAssemblyCache.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/MetadataAssemblyHelper.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/MetadataAssemblyHelper.cs
index 7229c3b838d..ebaad4ec189 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/MetadataAssemblyHelper.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/MetadataAssemblyHelper.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Reflection;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/MutableAssemblyCacheEntry.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/MutableAssemblyCacheEntry.cs
index e17dcb2205f..f44d9d1d13f 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/MutableAssemblyCacheEntry.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/MutableAssemblyCacheEntry.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemAssemblyLoader.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemAssemblyLoader.cs
index a394eecea5a..bbadb7cc55a 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemAssemblyLoader.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemAssemblyLoader.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemAttributeAssemblyLoader.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemAttributeAssemblyLoader.cs
index 610f1f067a7..c54f6bbd703 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemAttributeAssemblyLoader.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemAttributeAssemblyLoader.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemCachedAssemblyLoader.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemCachedAssemblyLoader.cs
index d1db7caebf5..9cf8fae6e23 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemCachedAssemblyLoader.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemCachedAssemblyLoader.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemConventionAssemblyLoader.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemConventionAssemblyLoader.cs
index d6f3c2dda73..a336bab049f 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemConventionAssemblyLoader.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemConventionAssemblyLoader.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemLoadingSessionData.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemLoadingSessionData.cs
index bfb63d99f7b..f033bc47697 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemLoadingSessionData.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemLoadingSessionData.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Reflection;
using System.Linq;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemNoOpAssemblyLoader.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemNoOpAssemblyLoader.cs
index 87c4d7d3e88..45a60e927b3 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemNoOpAssemblyLoader.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemNoOpAssemblyLoader.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Reflection;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Perspective.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Perspective.cs
index b3834ecef35..c8f6ff31241 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Perspective.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/Perspective.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Diagnostics;
using System.Linq;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/StoreItemCollection.Loader.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/StoreItemCollection.Loader.cs
index ede35e32192..0583ffef5d1 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/StoreItemCollection.Loader.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/StoreItemCollection.Loader.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
{
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/StoreItemCollection.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/StoreItemCollection.cs
index 8d3db3692bf..585dfca18ec 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/StoreItemCollection.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/StoreItemCollection.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
{
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/TargetPerspective.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/TargetPerspective.cs
index 372a6d86707..4f52bfdd8df 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/TargetPerspective.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/TargetPerspective.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/TypeHelpers.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/TypeHelpers.cs
index a3f8e6394f6..a08529d31d2 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/TypeHelpers.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/TypeHelpers.cs
@@ -3,8 +3,8 @@
// Copyright(c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Common
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/TypeSemantics.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/TypeSemantics.cs
index 5142269bafd..0c0df556007 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/TypeSemantics.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Metadata/TypeSemantics.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/MetadataException.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/MetadataException.cs
index 67eafde4e53..bd0cfb075da 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/MetadataException.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/MetadataException.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/ObjectNotFoundException.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/ObjectNotFoundException.cs
index d0496ab15c0..9247b2e59f0 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/ObjectNotFoundException.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/ObjectNotFoundException.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....], nkline
+// @owner Microsoft, nkline
//---------------------------------------------------------------------
namespace System.Data
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/AdditionalEntityFunctions.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/AdditionalEntityFunctions.cs
index 2ca2abe88df..36c949997b7 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/AdditionalEntityFunctions.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/AdditionalEntityFunctions.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects
{
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/CompiledQuery.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/CompiledQuery.cs
index 96f6bb6be5c..c3f31fb4bce 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/CompiledQuery.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/CompiledQuery.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupowner [....]
+// @owner Microsoft
+// @backupowner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/ComplexObject.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/ComplexObject.cs
index c63108a6311..fd606f81862 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/ComplexObject.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/ComplexObject.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data;
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmComplexPropertyAttribute.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmComplexPropertyAttribute.cs
index 61a7498be43..857cc043263 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmComplexPropertyAttribute.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmComplexPropertyAttribute.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.DataClasses
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmComplexTypeAttribute.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmComplexTypeAttribute.cs
index 6f4d556f028..05f2fcc7183 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmComplexTypeAttribute.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmComplexTypeAttribute.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.DataClasses
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmEntityTypeAttribute.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmEntityTypeAttribute.cs
index 495c0fdeea6..79b9c4bc363 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmEntityTypeAttribute.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmEntityTypeAttribute.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmEnumTypeAttribute.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmEnumTypeAttribute.cs
index 01e1acce12f..208b57f3c93 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmEnumTypeAttribute.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmEnumTypeAttribute.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.DataClasses
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmFunctionAttribute.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmFunctionAttribute.cs
index af990b078a7..59029670ee6 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmFunctionAttribute.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmFunctionAttribute.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.DataClasses
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmPropertyAttribute.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmPropertyAttribute.cs
index 0897a9d25f0..e9d2886280c 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmPropertyAttribute.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmPropertyAttribute.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.DataClasses
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmRelationshipNavigationPropertyAttribute.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmRelationshipNavigationPropertyAttribute.cs
index e94eeb442a5..3ce5465541b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmRelationshipNavigationPropertyAttribute.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmRelationshipNavigationPropertyAttribute.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmRelationshipRoleAttribute.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmRelationshipRoleAttribute.cs
index fb36665f8a8..45694e6225f 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmRelationshipRoleAttribute.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmRelationshipRoleAttribute.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Metadata.Edm; //for RelationshipMultiplicity
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmScalarPropertyAttribute.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmScalarPropertyAttribute.cs
index 13d23f82d18..ddf8d939879 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmScalarPropertyAttribute.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmScalarPropertyAttribute.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.DataClasses
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmSchemaAttribute.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmSchemaAttribute.cs
index eec9c4c9a52..e52f3355498 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmSchemaAttribute.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmSchemaAttribute.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmTypeAttribute.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmTypeAttribute.cs
index 097fd72cbde..cdac8049791 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmTypeAttribute.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmTypeAttribute.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.DataClasses
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EntityCollection.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EntityCollection.cs
index 0f1f0cc6044..4b1da9fd42b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EntityCollection.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EntityCollection.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.DataClasses
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EntityObject.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EntityObject.cs
index 08e8dd69a86..028698fe9db 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EntityObject.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EntityObject.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data;
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EntityReference.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EntityReference.cs
index 5a7b1c84e6f..48acf77e563 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EntityReference.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EntityReference.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.DataClasses
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EntityReference_TResultType.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EntityReference_TResultType.cs
index c18e9638f80..29b355682d0 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EntityReference_TResultType.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EntityReference_TResultType.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.DataClasses
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelatedEnd.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelatedEnd.cs
index e89a660d4bc..073c79de299 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelatedEnd.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelatedEnd.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.DataClasses
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelationshipFixer.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelationshipFixer.cs
index 4621064d8c9..40b72aed27d 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelationshipFixer.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelationshipFixer.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Metadata.Edm;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelationshipManager.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelationshipManager.cs
index 32c09239795..dd3a408546d 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelationshipManager.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelationshipManager.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.DataClasses
{
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelationshipNavigation.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelationshipNavigation.cs
index 66dcba0ec64..82295b74317 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelationshipNavigation.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelationshipNavigation.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/StructuralObject.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/StructuralObject.cs
index 900af0333f1..acda94e3dc9 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/StructuralObject.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/StructuralObject.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data;
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataRecordObjectView.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataRecordObjectView.cs
index 5869bf86b55..f00b88296fd 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataRecordObjectView.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/DataRecordObjectView.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections;
@@ -63,8 +63,8 @@ namespace System.Data.Objects
/// <remarks>
/// The algorithm here is lifted from System.Windows.Forms.ListBindingHelper,
/// from the GetTypedIndexer method.
- /// The Entity Framework could not take a dependency on [....],
- /// so we lifted the appropriate parts from the [....] code here.
+ /// The Entity Framework could not take a dependency on Microsoft,
+ /// so we lifted the appropriate parts from the Microsoft code here.
/// Not the best, but much better than guessing as to what algorithm is proper for data binding.
/// </remarks>
private static PropertyInfo GetTypedIndexer(Type type)
@@ -106,8 +106,8 @@ namespace System.Data.Objects
/// <remarks>
/// The algorithm here is lifted from System.Windows.Forms.ListBindingHelper,
/// from the GetListItemType(object) method.
- /// The Entity Framework could not take a dependency on [....],
- /// so we lifted the appropriate parts from the [....] code here.
+ /// The Entity Framework could not take a dependency on Microsoft,
+ /// so we lifted the appropriate parts from the Microsoft code here.
/// Not the best, but much better than guessing as to what algorithm is proper for data binding.
/// </remarks>
private static Type GetListItemType(Type type)
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/BindingContext.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/BindingContext.cs
index eeb849f9b40..5a3cb738b77 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/BindingContext.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/BindingContext.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
//---------------------------------------------------------------------
using CqtExpression = System.Data.Common.CommandTrees.DbExpression;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/CompiledELinqQueryState.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/CompiledELinqQueryState.cs
index 0b7aa97d39b..d072e7c3b08 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/CompiledELinqQueryState.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/CompiledELinqQueryState.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.ELinq
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ELinqQueryState.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ELinqQueryState.cs
index 6a68bcb8bb7..ec98b5bb6f2 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ELinqQueryState.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ELinqQueryState.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.ELinq
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ExpressionConverter.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ExpressionConverter.cs
index 95c65e884cc..424cc99feb2 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ExpressionConverter.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ExpressionConverter.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.ELinq
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ExpressionVisitorHelpers.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ExpressionVisitorHelpers.cs
index 3f0060f417c..90853b14302 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ExpressionVisitorHelpers.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ExpressionVisitorHelpers.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
//---------------------------------------------------------------------
namespace System.Linq.Expressions.Internal
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/Funcletizer.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/Funcletizer.cs
index 7b45f33dd05..ab12b11cca7 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/Funcletizer.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/Funcletizer.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.ELinq
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/InitializerFacet.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/InitializerFacet.cs
index b6e7adc53dd..207b739739f 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/InitializerFacet.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/InitializerFacet.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.ELinq
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/LinqExpressionNormalizer.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/LinqExpressionNormalizer.cs
index 1a2e9d353d6..e6042b498d4 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/LinqExpressionNormalizer.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/LinqExpressionNormalizer.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....], [....]
+// @owner Microsoft, Microsoft
//---------------------------------------------------------------------
using System.Linq.Expressions;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/MethodCallTranslator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/MethodCallTranslator.cs
index 247357fb46a..b0f2bbade55 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/MethodCallTranslator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/MethodCallTranslator.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....], [....]
+// @owner Microsoft, Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.ELinq
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ObjectQueryProvider.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ObjectQueryProvider.cs
index fafc18ce088..9999435a982 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ObjectQueryProvider.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ObjectQueryProvider.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.ELinq
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/OrderByLifter.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/OrderByLifter.cs
index e32e423a285..cf0ccb54b5f 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/OrderByLifter.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/OrderByLifter.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.ELinq
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ReflectionUtil.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ReflectionUtil.cs
index 86559d6b40f..95a9af21f4c 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ReflectionUtil.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ReflectionUtil.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
//---------------------------------------------------------------------
using System.Reflection;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/SpatialMethodCallTranslator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/SpatialMethodCallTranslator.cs
index 2eb958f024b..cfcc26232ae 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/SpatialMethodCallTranslator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/SpatialMethodCallTranslator.cs
@@ -4,7 +4,7 @@
// </copyright>
//
// @owner willa
-// @backupOwner [....]
+// @backupOwner Microsoft
//--------------------------------------------------------------------------
// This file is automatically generated and should not be changed directly.
//
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/SpatialPropertyTranslator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/SpatialPropertyTranslator.cs
index c16cee7d523..84dc51270c9 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/SpatialPropertyTranslator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/SpatialPropertyTranslator.cs
@@ -4,7 +4,7 @@
// </copyright>
//
// @owner willa
-// @backupOwner [....]
+// @backupOwner Microsoft
//--------------------------------------------------------------------------
// This file is automatically generated and should not be changed directly.
//
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/Translator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/Translator.cs
index 53ae3be397b..5a4f283f1fb 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/Translator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/Translator.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....], [....]
+// @owner Microsoft, Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.ELinq
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/TypeSystem.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/TypeSystem.cs
index 1d0e4a7f1a5..f7fbc08f6eb 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/TypeSystem.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ELinq/TypeSystem.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.ELinq
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/EntityEntry.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/EntityEntry.cs
index efeddc67439..ef96bb42499 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/EntityEntry.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/EntityEntry.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects
{
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/EntityFunctions.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/EntityFunctions.cs
index 879f3af5c95..51a6eea6aab 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/EntityFunctions.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/EntityFunctions.cs
@@ -10,8 +10,8 @@
// Changes to this file will be lost if the code is regenerated.
// </auto-generated>
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/FieldDescriptor.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/FieldDescriptor.cs
index fd5ef4e00e6..f2bb8cf6f3c 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/FieldDescriptor.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/FieldDescriptor.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/BaseEntityWrapper.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/BaseEntityWrapper.cs
index 7c4e91ac333..8278f03a91e 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/BaseEntityWrapper.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/BaseEntityWrapper.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections;
using System.Data.Objects.DataClasses;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/ComplexTypeMaterializer.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/ComplexTypeMaterializer.cs
index 44f963f3afe..d4916b2c5e3 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/ComplexTypeMaterializer.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/ComplexTypeMaterializer.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Metadata.Edm;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntityProxyFactory.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntityProxyFactory.cs
index 0de1b08a45e..385cb5b231e 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntityProxyFactory.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntityProxyFactory.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.Internal
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntityProxyTypeInfo.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntityProxyTypeInfo.cs
index a301deb0389..67b9ce1f7b3 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntityProxyTypeInfo.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntityProxyTypeInfo.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.Internal
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntitySqlQueryBuilder.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntitySqlQueryBuilder.cs
index eb994d42543..f757170e47d 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntitySqlQueryBuilder.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntitySqlQueryBuilder.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.Internal
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntitySqlQueryState.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntitySqlQueryState.cs
index 63b4ca4e6c9..40d6b1f6215 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntitySqlQueryState.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntitySqlQueryState.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntityWrapper.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntityWrapper.cs
index 8f06e08b9a1..95f18d39a28 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntityWrapper.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntityWrapper.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections;
using System.Data.Objects.DataClasses;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntityWrapperFactory.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntityWrapperFactory.cs
index bfbb201b702..a337615dea5 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntityWrapperFactory.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntityWrapperFactory.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Objects.DataClasses;
using System.Data.Metadata.Edm;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/LazyLoadBehavior.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/LazyLoadBehavior.cs
index 06276f9342e..6806c05cd53 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/LazyLoadBehavior.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/LazyLoadBehavior.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/LightweightEntityWrapper.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/LightweightEntityWrapper.cs
index 76cae2fa8b8..874b4c0d0f3 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/LightweightEntityWrapper.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/LightweightEntityWrapper.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections;
using System.Data.Objects.DataClasses;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/NullEntityWrapper.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/NullEntityWrapper.cs
index 0273238b70c..9590660d0a3 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/NullEntityWrapper.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/NullEntityWrapper.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.Internal
{
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/ObjectFullSpanRewriter.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/ObjectFullSpanRewriter.cs
index d8a4c861e68..2d54ed02ce6 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/ObjectFullSpanRewriter.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/ObjectFullSpanRewriter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupowner [....]
+// @owner Microsoft
+// @backupowner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.Internal
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/ObjectQueryExecutionPlan.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/ObjectQueryExecutionPlan.cs
index 78f35d03389..43ca9793677 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/ObjectQueryExecutionPlan.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/ObjectQueryExecutionPlan.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.Internal
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/ObjectQueryState.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/ObjectQueryState.cs
index 06d5d0841de..8c958ea14f8 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/ObjectQueryState.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/ObjectQueryState.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects.Internal
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/ObjectSpanRewriter.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/ObjectSpanRewriter.cs
index 3dcb85b7c0b..2469adc8bb7 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/ObjectSpanRewriter.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/ObjectSpanRewriter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupowner [....]
+// @owner Microsoft
+// @backupowner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/TransactionManager.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/TransactionManager.cs
index 240963625a3..92352278e91 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/TransactionManager.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Internal/TransactionManager.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
//
// Internal class used to manage ObjectStateManager's transactions for
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectContext.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectContext.cs
index df6204519f7..49b58de7cd1 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectContext.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectContext.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects
@@ -3034,7 +3034,7 @@ namespace System.Data.Objects
/// <param name="query">The query specified in the server's native query language.</param>
/// <param name="parameters">The parameter values to use for the query.</param>
/// <returns>An IEnumerable sequence of objects.</returns>
- [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "[....]: Generic parameters are required for strong-typing of the return type.")]
+ [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "Microsoft: Generic parameters are required for strong-typing of the return type.")]
public ObjectResult<TElement> ExecuteStoreQuery<TElement>(string commandText, params object[] parameters)
{
return ExecuteStoreQueryInternal<TElement>(commandText, null /*entitySetName*/, MergeOption.AppendOnly, parameters);
@@ -3049,7 +3049,7 @@ namespace System.Data.Objects
/// <param name="entitySetName">The entity set in which results should be tracked. Null indicates there is no entity set.</param>
/// <param name="mergeOption">Merge option to use for entity results.</param>
/// <returns>The translated sequence of objects</returns>
- [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "[....]: Generic parameters are required for strong-typing of the return type.")]
+ [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "Microsoft: Generic parameters are required for strong-typing of the return type.")]
public ObjectResult<TEntity> ExecuteStoreQuery<TEntity>(string commandText, string entitySetName, MergeOption mergeOption, params object[] parameters)
{
EntityUtil.CheckStringArgument(entitySetName, "entitySetName");
@@ -3106,7 +3106,7 @@ namespace System.Data.Objects
/// <param name="reader">The DbDataReader to translate</param>
/// <param name="mergeOption">Merge option to use for entity results.</param>
/// <returns>The translated sequence of objects</returns>
- [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "[....]: Generic parameters are required for strong-typing of the return type.")]
+ [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "Microsoft: Generic parameters are required for strong-typing of the return type.")]
public ObjectResult<TElement> Translate<TElement>(DbDataReader reader)
{
// SQLBUDT 447285: Ensure the assembly containing the entity's CLR type
@@ -3130,7 +3130,7 @@ namespace System.Data.Objects
/// <param name="entitySetName">The entity set in which results should be tracked. Null indicates there is no entity set.</param>
/// <param name="mergeOption">Merge option to use for entity results.</param>
/// <returns>The translated sequence of objects</returns>
- [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "[....]: Generic parameters are required for strong-typing of the return type.")]
+ [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "Microsoft: Generic parameters are required for strong-typing of the return type.")]
public ObjectResult<TEntity> Translate<TEntity>(DbDataReader reader, string entitySetName, MergeOption mergeOption)
{
EntityUtil.CheckStringArgument(entitySetName, "entitySetName");
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectMaterializedEventArgs.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectMaterializedEventArgs.cs
index 4b269fba20d..26bd5a01271 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectMaterializedEventArgs.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectMaterializedEventArgs.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectParameter.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectParameter.cs
index 2939ae7b9c5..4390811bc92 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectParameter.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectParameter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupowner [....]
+// @owner Microsoft
+// @backupowner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectParameterCollection.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectParameterCollection.cs
index bd314d2e182..7efb20d55eb 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectParameterCollection.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectParameterCollection.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupowner [....]
+// @owner Microsoft
+// @backupowner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectQuery.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectQuery.cs
index bd28684250e..b8041ee41a4 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectQuery.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectQuery.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupowner [....]
+// @owner Microsoft
+// @backupowner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectQuery_EntitySqlExtensions.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectQuery_EntitySqlExtensions.cs
index 36d85f3ee3e..10c751301fb 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectQuery_EntitySqlExtensions.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectQuery_EntitySqlExtensions.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupowner [....]
+// @owner Microsoft
+// @backupowner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectQuery_TResultType.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectQuery_TResultType.cs
index bb459b66117..e5acd60fe9d 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectQuery_TResultType.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectQuery_TResultType.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupowner [....]
+// @owner Microsoft
+// @backupowner Microsoft
//---------------------------------------------------------------------
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectResult.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectResult.cs
index 4b3bcb8682f..0c11979211b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectResult.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectResult.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupowner [....]
+// @owner Microsoft
+// @backupowner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectResult_TResultType.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectResult_TResultType.cs
index 4b764e2361e..89643315a00 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectResult_TResultType.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectResult_TResultType.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupowner [....]
+// @owner Microsoft
+// @backupowner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectSet.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectSet.cs
index 94ffdbcabbf..3d5c4a02cfd 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectSet.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectSet.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
// ObjectSet<TEntity> is a wrapper around ObjectQuery<TEntity> and CUD
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntry.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntry.cs
index 388559d75c1..5d069e2ba1a 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntry.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntry.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
using System.Data.Common;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntryBaseUpdatableDataRecord.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntryBaseUpdatableDataRecord.cs
index 72e6a8ce1bf..3006ec9202b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntryBaseUpdatableDataRecord.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntryBaseUpdatableDataRecord.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.ComponentModel;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntryDbDataRecord.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntryDbDataRecord.cs
index cda0af00f54..5b763db4a06 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntryDbDataRecord.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntryDbDataRecord.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntryDbUpdatableDataRecord.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntryDbUpdatableDataRecord.cs
index 08a0551c5dd..768828d897b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntryDbUpdatableDataRecord.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntryDbUpdatableDataRecord.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.ComponentModel;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntryOriginalDbUpdatableDataRecord.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntryOriginalDbUpdatableDataRecord.cs
index 56c4c0f8abc..e16a62b70f7 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntryOriginalDbUpdatableDataRecord.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntryOriginalDbUpdatableDataRecord.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.ComponentModel;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateManager.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateManager.cs
index 9657c208b61..84289151819 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateManager.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateManager.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects
@@ -2131,7 +2131,7 @@ namespace System.Data.Objects
_inRelationshipFixup = false;
}
- // Keeping the entity and entry keys in [....].
+ // Keeping the entity and entry keys in sync.
entry.EntityKey = value;
//Internally, entry.EntityKey asserts that entry._entityKey and entityWithKey.EntityKey are equal.
@@ -3553,7 +3553,7 @@ namespace System.Data.Objects
reference.IsForeignKey &&
reference.IsDependentEndOfReferentialConstraint(checkIdentifying: false))
{
- // Ensure that the cached FK value on the reference is in [....] because it is possible that we
+ // Ensure that the cached FK value on the reference is in sync because it is possible that we
// didn't take any actions above that would cause this to be set.
reference.SetCachedForeignKey(ForeignKeyFactory.CreateKeyFromForeignKeyValues(entry, reference), entry);
}
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateManagerMetadata.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateManagerMetadata.cs
index 2f078289be0..81e861695a4 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateManagerMetadata.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateManagerMetadata.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectView.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectView.cs
index acd5c3aa2f0..0adbd0b501d 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectView.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectView.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectViewEntityCollectionData.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectViewEntityCollectionData.cs
index de89b3a48ad..0f91fb37dd5 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectViewEntityCollectionData.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectViewEntityCollectionData.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectViewFactory.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectViewFactory.cs
index 9c803f7bd00..94bed62f1d2 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectViewFactory.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectViewFactory.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectViewListener.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectViewListener.cs
index 326ca561b7b..f26e293c8f2 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectViewListener.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectViewListener.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectViewQueryResultData.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectViewQueryResultData.cs
index 1f1eb295822..dd79ce4348c 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectViewQueryResultData.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ObjectViewQueryResultData.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ProxyDataContractResolver.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ProxyDataContractResolver.cs
index 251a18ed5db..4435cbc8293 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ProxyDataContractResolver.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/ProxyDataContractResolver.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/RelationshipEntry.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/RelationshipEntry.cs
index d3a7e941801..de19216f66b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/RelationshipEntry.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/RelationshipEntry.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects
{
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/RelationshipWrapper.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/RelationshipWrapper.cs
index e3f4a297ffa..2aa42ba86b8 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/RelationshipWrapper.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/RelationshipWrapper.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Span.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Span.cs
index c74e95d9534..28482f31eac 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Span.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/Span.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Objects
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/SpanIndex.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/SpanIndex.cs
index 921eed60239..151f06a2207 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/SpanIndex.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/SpanIndex.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupowner [....]
+// @owner Microsoft
+// @backupowner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/SqlClient/SqlFunctions.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/SqlClient/SqlFunctions.cs
index d5745f56802..0d9a53bd26d 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/SqlClient/SqlFunctions.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/SqlClient/SqlFunctions.cs
@@ -10,8 +10,8 @@
// Changes to this file will be lost if the code is regenerated.
// </auto-generated>
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/SqlClient/SqlSpatialFunctions.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/SqlClient/SqlSpatialFunctions.cs
index 3dd9e3aade4..1c1dd30bbc7 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/SqlClient/SqlSpatialFunctions.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Objects/SqlClient/SqlSpatialFunctions.cs
@@ -10,8 +10,8 @@
// Changes to this file will be lost if the code is regenerated.
// </auto-generated>
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/OptimisticConcurrencyException.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/OptimisticConcurrencyException.cs
index 6a38eb00ca4..9a911e5d22f 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/OptimisticConcurrencyException.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/OptimisticConcurrencyException.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
//---------------------------------------------------------------------
namespace System.Data
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/PropertyConstraintException.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/PropertyConstraintException.cs
index 034e96170dc..ff231df5ab0 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/PropertyConstraintException.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/PropertyConstraintException.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/ProviderIncompatibleException.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/ProviderIncompatibleException.cs
index f15b3a5ed1a..8b3a5dad12a 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/ProviderIncompatibleException.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/ProviderIncompatibleException.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/AncillaryOps.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/AncillaryOps.cs
index e2f4c3ad4fe..624c6db1709 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/AncillaryOps.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/AncillaryOps.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ColumnMap.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ColumnMap.cs
index 5616d7744d4..541441845ea 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ColumnMap.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ColumnMap.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ColumnMapCopier.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ColumnMapCopier.cs
index edc63cc517d..723aeae7fb6 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ColumnMapCopier.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ColumnMapCopier.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ColumnMapFactory.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ColumnMapFactory.cs
index 7ba71b13236..b000d40e872 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ColumnMapFactory.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ColumnMapFactory.cs
@@ -2,8 +2,8 @@
// <copyright file="ColumnMapFactory.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ColumnMapVisitor.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ColumnMapVisitor.cs
index 5f717d4cd5e..1c95e226b35 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ColumnMapVisitor.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ColumnMapVisitor.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Query.InternalTrees
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Command.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Command.cs
index 7f16a5a68b8..0dabf7fa15f 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Command.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Command.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Dump.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Dump.cs
index a7fecfd71ad..8933a9946b9 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Dump.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Dump.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ExplicitDiscriminatorMap.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ExplicitDiscriminatorMap.cs
index 9376a4d3e2a..594d9d4e639 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ExplicitDiscriminatorMap.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ExplicitDiscriminatorMap.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Metadata.Edm;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Metadata.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Metadata.cs
index acb8bc50b0e..5ee20c008a7 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Metadata.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Metadata.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/NodeCounter.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/NodeCounter.cs
index 77690a6ad45..5261c4858a8 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/NodeCounter.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/NodeCounter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/NodeInfo.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/NodeInfo.cs
index c169ff2f18b..0043eb94b84 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/NodeInfo.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/NodeInfo.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Nodes.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Nodes.cs
index 639678818a5..d8c3bcc4a1e 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Nodes.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Nodes.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/OpCopier.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/OpCopier.cs
index d083bf8e4ce..864ae4f80f5 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/OpCopier.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/OpCopier.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
// Interesting cases: Unnest
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Ops.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Ops.cs
index 5f2ef19de41..ffa517fde81 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Ops.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Ops.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Query.InternalTrees
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/PhysicalOps.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/PhysicalOps.cs
index 4a6c5529579..932a39e142b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/PhysicalOps.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/PhysicalOps.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/RelOps.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/RelOps.cs
index 2f69f2fe693..4e513fd7cb2 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/RelOps.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/RelOps.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/RelPropertyHelper.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/RelPropertyHelper.cs
index 75ff8542388..de5fb678ff0 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/RelPropertyHelper.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/RelPropertyHelper.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Rule.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Rule.cs
index b75f77f8b35..b766b729d32 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Rule.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Rule.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/RulePatternOps.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/RulePatternOps.cs
index add95f18902..ec10161a885 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/RulePatternOps.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/RulePatternOps.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/RuleProcessor.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/RuleProcessor.cs
index 98e34449614..2d43a1cb77b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/RuleProcessor.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/RuleProcessor.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ScalarOps.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ScalarOps.cs
index f02af32dc52..c9c554ad622 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ScalarOps.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ScalarOps.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Vars.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Vars.cs
index b9f865f5e79..de6ed142500 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Vars.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Vars.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Visitors.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Visitors.cs
index 6dc5c0f5f8f..73d0a5de3eb 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Visitors.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Visitors.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Query.InternalTrees
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/AggregatePushdown.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/AggregatePushdown.cs
index 9bf364d3b25..db69808fa2a 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/AggregatePushdown.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/AggregatePushdown.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/CTreeGenerator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/CTreeGenerator.cs
index 62aa38cecdc..98e9d1d3b67 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/CTreeGenerator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/CTreeGenerator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
//using System.Diagnostics; // Please use PlanCompiler.Assert instead of Debug.Assert in this class...
@@ -1047,7 +1047,7 @@ namespace System.Data.Query.PlanCompiler
/// <returns></returns>
public override DbExpression Visit(SoftCastOp op, Node n)
{
- // [....] 9/21/06 - temporarily removing check here
+ // Microsoft 9/21/06 - temporarily removing check here
// because the assert wrongly fails in some cases where the types are promotable,
// but the facets are not. Put this back when that issue is solved.
//
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/CodeGen.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/CodeGen.cs
index 6d762ddeffe..2d8ad0d3272 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/CodeGen.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/CodeGen.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ColumnMapProcessor.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ColumnMapProcessor.cs
index e325373041b..d2d6aa35c8b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ColumnMapProcessor.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ColumnMapProcessor.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ColumnMapTranslator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ColumnMapTranslator.cs
index a6b1ad7614e..793729bde9f 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ColumnMapTranslator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ColumnMapTranslator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/CommandPlan.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/CommandPlan.cs
index 3cbfa654fa9..afafe618836 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/CommandPlan.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/CommandPlan.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ConstraintManager.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ConstraintManager.cs
index 70c0f09db55..483fd2d0050 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ConstraintManager.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ConstraintManager.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ITreeGenerator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ITreeGenerator.cs
index a3244777792..6998a556822 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ITreeGenerator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ITreeGenerator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
//using System.Diagnostics; // Please use PlanCompiler.Assert instead of Debug.Assert in this class...
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/JoinElimination.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/JoinElimination.cs
index f157f9cf3f3..82daa4395ed 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/JoinElimination.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/JoinElimination.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/JoinGraph.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/JoinGraph.cs
index 170d81de80a..fe5e6dbd5c6 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/JoinGraph.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/JoinGraph.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/KeyPullup.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/KeyPullup.cs
index 976c8adc17f..7a39349c20b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/KeyPullup.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/KeyPullup.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/NestPullup.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/NestPullup.cs
index 41b2629eb7f..875f213c416 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/NestPullup.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/NestPullup.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
@@ -2161,7 +2161,7 @@ namespace System.Data.Query.PlanCompiler
KeyVec drivingNodeKeys = Command.PullupKeys(drivingNode);
if (drivingNodeKeys.NoKeys)
{
- // [....]: In this case we used to wrap drivingNode into a projection that would also project Edm.NewGuid() thus giving us a synthetic key.
+ // Microsoft: In this case we used to wrap drivingNode into a projection that would also project Edm.NewGuid() thus giving us a synthetic key.
// This solution did not work however due to a bug in SQL Server that allowed pulling non-deterministic functions above joins and applies, thus
// producing incorrect results. SQL Server bug was filed in "sqlbuvsts01\Sql Server" database as #725272.
// The only known path how we can get a keyless drivingNode is if
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/NominalTypeEliminator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/NominalTypeEliminator.cs
index 5cdb77d5493..1b248fc5991 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/NominalTypeEliminator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/NominalTypeEliminator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/Normalizer.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/Normalizer.cs
index f41d761c763..f780e6b3ca9 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/Normalizer.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/Normalizer.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PlanCompiler.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PlanCompiler.cs
index 32bdecec29a..f58f7ff5467 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PlanCompiler.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PlanCompiler.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PlanCompilerUtil.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PlanCompilerUtil.cs
index 4a92d1bbd4e..7a3f91e6440 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PlanCompilerUtil.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PlanCompilerUtil.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PreProcessor.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PreProcessor.cs
index b3a359ed137..412249a1bc1 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PreProcessor.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PreProcessor.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
//using System.Diagnostics; // Please use PlanCompiler.Assert instead of Debug.Assert in this class...
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/Predicate.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/Predicate.cs
index f977e3a03e2..39bbeb37ee6 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/Predicate.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/Predicate.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ProjectionPruner.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ProjectionPruner.cs
index 9c91918b7a3..412494ef050 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ProjectionPruner.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ProjectionPruner.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PropertyPushdownHelper.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PropertyPushdownHelper.cs
index 32bcd16df9e..c45c29b820c 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PropertyPushdownHelper.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PropertyPushdownHelper.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PropertyRef.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PropertyRef.cs
index f23a813a395..103296c7384 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PropertyRef.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PropertyRef.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ProviderCommandInfoUtils.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ProviderCommandInfoUtils.cs
index 4d81cb04525..1e1978f87fb 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ProviderCommandInfoUtils.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ProviderCommandInfoUtils.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/StructuredTypeInfo.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/StructuredTypeInfo.cs
index 149274a41c7..688911b9b7e 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/StructuredTypeInfo.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/StructuredTypeInfo.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/SubqueryTrackingVisitor.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/SubqueryTrackingVisitor.cs
index 6ec1d822c10..437a0cc3ed9 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/SubqueryTrackingVisitor.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/SubqueryTrackingVisitor.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/TransformationRules.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/TransformationRules.cs
index 99ace7694c4..947bb1ef397 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/TransformationRules.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/TransformationRules.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/TypeInfo.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/TypeInfo.cs
index b7621060205..d87b08c64e0 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/TypeInfo.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/TypeInfo.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/TypeUtils.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/TypeUtils.cs
index c0bc872b570..daf8c53a8a5 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/TypeUtils.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/TypeUtils.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/VarInfo.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/VarInfo.cs
index a3c7575f3b6..b207bd75bb0 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/VarInfo.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/VarInfo.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/VarRefManager.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/VarRefManager.cs
index cea3d2d8690..a996bbc08a7 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/VarRefManager.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/VarRefManager.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/VarRemapper.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/VarRemapper.cs
index e700c541620..df62621b53b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/VarRemapper.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/VarRemapper.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/ResultAssembly/BridgeDataReader.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/ResultAssembly/BridgeDataReader.cs
index 0e2c6696e9e..1fb083d0501 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/ResultAssembly/BridgeDataReader.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/ResultAssembly/BridgeDataReader.cs
@@ -2,8 +2,8 @@
// <copyright file="BridgeDataReader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Query.ResultAssembly {
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/ResultAssembly/BridgeDataRecord.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/ResultAssembly/BridgeDataRecord.cs
index 2e8af6ba690..997a264799f 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Query/ResultAssembly/BridgeDataRecord.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Query/ResultAssembly/BridgeDataRecord.cs
@@ -2,8 +2,8 @@
// <copyright file="BridgeDataRecord.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.Query.ResultAssembly {
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DbGeography.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DbGeography.cs
index 43a680f7b72..37ed063d3e3 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DbGeography.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DbGeography.cs
@@ -4,7 +4,7 @@
// </copyright>
//
// @owner willa
-// @backupOwner [....]
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Data.Common.Internal;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DbGeographyWellKnownValue.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DbGeographyWellKnownValue.cs
index 575afd3e354..38cab49fe4f 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DbGeographyWellKnownValue.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DbGeographyWellKnownValue.cs
@@ -4,7 +4,7 @@
// </copyright>
//
// @owner willa
-// @backupOwner [....]
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Runtime.Serialization;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DbGeometry.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DbGeometry.cs
index 53b79d8ac9c..8dd32169848 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DbGeometry.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DbGeometry.cs
@@ -4,7 +4,7 @@
// </copyright>
//
// @owner willa
-// @backupOwner [....]
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Data.Common.Internal;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DbGeometryWellKnownValue.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DbGeometryWellKnownValue.cs
index ec64ff97912..411faca568a 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DbGeometryWellKnownValue.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DbGeometryWellKnownValue.cs
@@ -4,7 +4,7 @@
// </copyright>
//
// @owner willa
-// @backupOwner [....]
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Runtime.Serialization;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DbSpatialServices.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DbSpatialServices.cs
index e248ee0ca3e..2650b3e44c7 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DbSpatialServices.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DbSpatialServices.cs
@@ -4,7 +4,7 @@
// </copyright>
//
// @owner willa
-// @backupOwner [....]
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Data.Common.Utils;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DefaultSpatialServices.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DefaultSpatialServices.cs
index 0552d5a0a06..70768b84164 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DefaultSpatialServices.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/DefaultSpatialServices.cs
@@ -4,7 +4,7 @@
// </copyright>
//
// @owner willa
-// @backupOwner [....]
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Data.Common.Internal;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/ExtensionMethods.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/ExtensionMethods.cs
index 010b131af8d..47f88556662 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/ExtensionMethods.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/ExtensionMethods.cs
@@ -4,7 +4,7 @@
// </copyright>
//
// @owner willa
-// @backupOwner [....]
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Data.Spatial.Internal;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/Internal/SpatialExceptions.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/Internal/SpatialExceptions.cs
index bd77441379f..2a9a718bbf1 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/Internal/SpatialExceptions.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/Internal/SpatialExceptions.cs
@@ -4,7 +4,7 @@
// </copyright>
//
// @owner willa
-// @backupOwner [....]
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
namespace System.Data.Spatial.Internal
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/SpatialHelpers.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/SpatialHelpers.cs
index df940de7589..af25ebd1aef 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/SpatialHelpers.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/Spatial/SpatialHelpers.cs
@@ -4,7 +4,7 @@
// </copyright>
//
// @owner willa
-// @backupOwner [....]
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Diagnostics;
using System.Data.Metadata.Edm;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/IDbSpatialValue.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/IDbSpatialValue.cs
index 9334ccfa3ca..ab7dd297ca6 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/IDbSpatialValue.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/IDbSpatialValue.cs
@@ -4,7 +4,7 @@
// </copyright>
//
// @owner willa
-// @backupOwner [....]
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Data.Spatial;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/DmlSqlGenerator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/DmlSqlGenerator.cs
index b17cc173428..204292f95b3 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/DmlSqlGenerator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/DmlSqlGenerator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.SqlClient.SqlGen
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/JoinSymbol.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/JoinSymbol.cs
index 1d60e429917..75d80785795 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/JoinSymbol.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/JoinSymbol.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/OptionalColumn.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/OptionalColumn.cs
index b2c88e582ab..9670a2365ea 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/OptionalColumn.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/OptionalColumn.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/Sql8ConformanceChecker.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/Sql8ConformanceChecker.cs
index 9b6d3bc90d0..ce48bf2d0a9 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/Sql8ConformanceChecker.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/Sql8ConformanceChecker.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.SqlClient.SqlGen
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/Sql8ExpressionRewriter.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/Sql8ExpressionRewriter.cs
index 1fa8b4ca66f..f5493efc861 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/Sql8ExpressionRewriter.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/Sql8ExpressionRewriter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlBuilder.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlBuilder.cs
index c680a0dc14c..f4ffc565d7d 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlBuilder.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlBuilder.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlFunctionCallHandler.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlFunctionCallHandler.cs
index f749d5cf2da..2fb8259d8d9 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlFunctionCallHandler.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlFunctionCallHandler.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.SqlClient.SqlGen
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlGenerator.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlGenerator.cs
index b09cca65743..2547d7bd2b2 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlGenerator.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlGenerator.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.SqlClient.SqlGen
@@ -2495,7 +2495,7 @@ namespace System.Data.SqlClient.SqlGen
//Create the resulting statement
//See CreateNewSelectStatement, it is very similar
- //Future Enhancement ([....]): Refactor to avoid duplication with CreateNewSelectStatement if we
+ //Future Enhancement (Microsoft): Refactor to avoid duplication with CreateNewSelectStatement if we
// don't switch to using ExtensionExpression here
SqlSelectStatement result = new SqlSelectStatement();
result.From.Append("( ");
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlSelectClauseBuilder.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlSelectClauseBuilder.cs
index 8c3b203bda9..83d2b247986 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlSelectClauseBuilder.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlSelectClauseBuilder.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlSelectStatement.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlSelectStatement.cs
index d44940d8d7f..3893137a57b 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlSelectStatement.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlSelectStatement.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlWriter.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlWriter.cs
index f8e4e2f0649..43973838759 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlWriter.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlWriter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/Symbol.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/Symbol.cs
index f5e8f20b300..5257812e00d 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/Symbol.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/Symbol.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SymbolPair.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SymbolPair.cs
index 5624db4cb12..b1684aa77e2 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SymbolPair.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SymbolPair.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SymbolTable.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SymbolTable.cs
index b47c8e69f0b..3cf8d038db9 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SymbolTable.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SymbolTable.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SymbolUsageManager.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SymbolUsageManager.cs
index d0572b75eda..7f9152076a6 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SymbolUsageManager.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SymbolUsageManager.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/TopClause.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/TopClause.cs
index 5bd2c195a01..e09e2252f9c 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/TopClause.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/TopClause.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlProviderManifest.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlProviderManifest.cs
index 3a0a4d3d06b..2553a4a330d 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlProviderManifest.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlProviderManifest.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlProviderServices.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlProviderServices.cs
index aa28e6af8ca..a917faa6c45 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlProviderServices.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlProviderServices.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlProviderUtilities.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlProviderUtilities.cs
index 283abf3e60a..425b97d10a2 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlProviderUtilities.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlProviderUtilities.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlSpatialDataReader.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlSpatialDataReader.cs
index 607dd1e2486..ef7b9c6a12d 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlSpatialDataReader.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlSpatialDataReader.cs
@@ -4,7 +4,7 @@
// </copyright>
//
// @owner willa
-// @backupOwner [....]
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Data.Common.Utils;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlSpatialServices.Generated.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlSpatialServices.Generated.cs
index 4007c814665..6d749c83ac2 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlSpatialServices.Generated.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlSpatialServices.Generated.cs
@@ -4,7 +4,7 @@
// </copyright>
//
// @owner willa
-// @backupOwner [....]
+// @backupOwner Microsoft
//--------------------------------------------------------------------------
// This file is automatically generated and should not be changed directly.
//
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlSpatialServices.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlSpatialServices.cs
index cd5a2dec06b..d9e78705069 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlSpatialServices.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlSpatialServices.cs
@@ -4,7 +4,7 @@
// </copyright>
//
// @owner willa
-// @backupOwner [....]
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlTypesAssembly.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlTypesAssembly.cs
index ee3eff1e56b..c9213bb2555 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlTypesAssembly.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlTypesAssembly.cs
@@ -4,7 +4,7 @@
// </copyright>
//
// @owner willa
-// @backupOwner [....]
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlVersion.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlVersion.cs
index 360a2599070..e9fc500e2f6 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlVersion.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/SqlClient/SqlVersion.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.SqlClient
diff --git a/mcs/class/referencesource/System.Data.Entity/System/Data/UpdateException.cs b/mcs/class/referencesource/System.Data.Entity/System/Data/UpdateException.cs
index 7a1698868fb..739893c6754 100644
--- a/mcs/class/referencesource/System.Data.Entity/System/Data/UpdateException.cs
+++ b/mcs/class/referencesource/System.Data.Entity/System/Data/UpdateException.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data
diff --git a/mcs/class/referencesource/System.Data.Entity/Util/AppSettings.cs b/mcs/class/referencesource/System.Data.Entity/Util/AppSettings.cs
index 9877ddace71..2617ed2dfc2 100644
--- a/mcs/class/referencesource/System.Data.Entity/Util/AppSettings.cs
+++ b/mcs/class/referencesource/System.Data.Entity/Util/AppSettings.cs
@@ -4,7 +4,7 @@
// </copyright>
//
// @owner daobando
-// @backupOwner [....]
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Specialized;
diff --git a/mcs/class/referencesource/System.Data.Linq/ChangeConflicts.cs b/mcs/class/referencesource/System.Data.Linq/ChangeConflicts.cs
index 81533527201..5ce354335c7 100644
--- a/mcs/class/referencesource/System.Data.Linq/ChangeConflicts.cs
+++ b/mcs/class/referencesource/System.Data.Linq/ChangeConflicts.cs
@@ -279,7 +279,7 @@ namespace System.Data.Linq {
private void ResolveDelete() {
Debug.Assert(this.IsDeleted);
// If the user is attempting to update an entity that no longer exists
- // in the database, we first need to [....] the delete into the local cache.
+ // in the database, we first need to sync the delete into the local cache.
if (!trackedObject.IsDeleted) {
trackedObject.ConvertToDeleted();
}
@@ -287,7 +287,7 @@ namespace System.Data.Linq {
// As the object have been deleted, it needs to leave the cache
this.Session.Context.Services.RemoveCachedObjectLike(trackedObject.Type, trackedObject.Original);
- // Now that our cache is in [....], we accept the changes
+ // Now that our cache is in sync, we accept the changes
this.trackedObject.AcceptChanges();
this.isResolved = true;
}
diff --git a/mcs/class/referencesource/System.Data.Linq/ChangeDirector.cs b/mcs/class/referencesource/System.Data.Linq/ChangeDirector.cs
index 96fc7db3bb7..74f9bf15133 100644
--- a/mcs/class/referencesource/System.Data.Linq/ChangeDirector.cs
+++ b/mcs/class/referencesource/System.Data.Linq/ChangeDirector.cs
@@ -45,14 +45,14 @@ namespace System.Data.Linq {
private enum AutoSyncBehavior { ApplyNewAutoSync, RollbackSavedValues }
DataContext context;
- [SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Justification="[....]: FxCop bug Dev10:423110 -- List<KeyValuePair<object, object>> is not supposed to be flagged as a violation.")]
+ [SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Justification="Microsoft: FxCop bug Dev10:423110 -- List<KeyValuePair<object, object>> is not supposed to be flagged as a violation.")]
List<KeyValuePair<TrackedObject, object[]>> syncRollbackItems;
internal StandardChangeDirector(DataContext context) {
this.context = context;
}
- [SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Justification="[....]: FxCop bug Dev10:423110 -- List<KeyValuePair<object, object>> is not supposed to be flagged as a violation.")]
+ [SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Justification="Microsoft: FxCop bug Dev10:423110 -- List<KeyValuePair<object, object>> is not supposed to be flagged as a violation.")]
private List<KeyValuePair<TrackedObject, object[]>> SyncRollbackItems {
get {
if (syncRollbackItems == null) {
@@ -89,7 +89,7 @@ namespace System.Data.Linq {
IEnumerable<object> facts = (IEnumerable<object>)this.context.Provider.Execute(cmd).ReturnValue;
object[] syncResults = (object[])facts.FirstOrDefault();
if (syncResults != null) {
- // [....] any auto gen or computed members
+ // sync any auto gen or computed members
AutoSyncMembers(syncResults, item, UpdateType.Insert, AutoSyncBehavior.ApplyNewAutoSync);
return 1;
}
@@ -142,7 +142,7 @@ namespace System.Data.Linq {
IEnumerable<object> facts = (IEnumerable<object>)this.context.Provider.Execute(cmd).ReturnValue;
object[] syncResults = (object[])facts.FirstOrDefault();
if (syncResults != null) {
- // [....] any auto gen or computed members
+ // sync any auto gen or computed members
AutoSyncMembers(syncResults, item, UpdateType.Update, AutoSyncBehavior.ApplyNewAutoSync);
return 1;
}
@@ -204,7 +204,7 @@ namespace System.Data.Linq {
}
}
- [SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Justification="[....]: FxCop bug Dev10:423110 -- List<KeyValuePair<object, object>> is not supposed to be flagged as a violation.")]
+ [SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Justification="Microsoft: FxCop bug Dev10:423110 -- List<KeyValuePair<object, object>> is not supposed to be flagged as a violation.")]
internal override void RollbackAutoSync() {
// Rolls back any AutoSync values that may have been set already
// Those values are no longer valid since the transaction will be rolled back on the server
@@ -222,7 +222,7 @@ namespace System.Data.Linq {
}
}
- [SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Justification="[....]: FxCop bug Dev10:423110 -- List<KeyValuePair<object, object>> is not supposed to be flagged as a violation.")]
+ [SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Justification="Microsoft: FxCop bug Dev10:423110 -- List<KeyValuePair<object, object>> is not supposed to be flagged as a violation.")]
internal override void ClearAutoSyncRollback() {
this.syncRollbackItems = null;
}
@@ -260,7 +260,7 @@ namespace System.Data.Linq {
private static List<MetaDataMember> GetAutoSyncMembers(MetaType metaType, UpdateType updateType) {
List<MetaDataMember> membersToSync = new List<MetaDataMember>();
foreach (MetaDataMember metaMember in metaType.PersistentDataMembers.OrderBy(m => m.Ordinal)) {
- // add all auto generated members for the specified update type to the auto-[....] list
+ // add all auto generated members for the specified update type to the auto-sync list
if ((updateType == UpdateType.Insert && metaMember.AutoSync == AutoSync.OnInsert) ||
(updateType == UpdateType.Update && metaMember.AutoSync == AutoSync.OnUpdate) ||
metaMember.AutoSync == AutoSync.Always) {
@@ -272,14 +272,14 @@ namespace System.Data.Linq {
/// <summary>
/// Synchronize the specified item by copying in data from the specified results.
- /// Used to [....] members after successful insert or update, but also used to rollback to previous values if a failure
+ /// Used to sync members after successful insert or update, but also used to rollback to previous values if a failure
/// occurs on other entities in the same SubmitChanges batch.
/// </summary>
/// <param name="autoSyncBehavior">
- /// If AutoSyncBehavior.ApplyNewAutoSync, the current value of the property is saved before the [....] occurs. This is used for normal synchronization after a successful update/insert.
- /// Otherwise, the current value is not saved. This is used for rollback operations when something in the SubmitChanges batch failed, rendering the previously-[....]'d values invalid.
+ /// If AutoSyncBehavior.ApplyNewAutoSync, the current value of the property is saved before the sync occurs. This is used for normal synchronization after a successful update/insert.
+ /// Otherwise, the current value is not saved. This is used for rollback operations when something in the SubmitChanges batch failed, rendering the previously-sync'd values invalid.
/// </param>
- [SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Justification="[....]: FxCop bug Dev10:423110 -- List<KeyValuePair<object, object>> is not supposed to be flagged as a violation.")]
+ [SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Justification="Microsoft: FxCop bug Dev10:423110 -- List<KeyValuePair<object, object>> is not supposed to be flagged as a violation.")]
private void AutoSyncMembers(object[] syncResults, TrackedObject item, UpdateType updateType, AutoSyncBehavior autoSyncBehavior) {
System.Diagnostics.Debug.Assert(item != null);
System.Diagnostics.Debug.Assert(item.IsNew || item.IsPossiblyModified, "AutoSyncMembers should only be called for new and modified objects.");
diff --git a/mcs/class/referencesource/System.Data.Linq/ChangeProcessor.cs b/mcs/class/referencesource/System.Data.Linq/ChangeProcessor.cs
index 4eaa79b5a06..0affa3cb60a 100644
--- a/mcs/class/referencesource/System.Data.Linq/ChangeProcessor.cs
+++ b/mcs/class/referencesource/System.Data.Linq/ChangeProcessor.cs
@@ -115,9 +115,9 @@ namespace System.Data.Linq {
// if we have accumulated any failed updates, throw the exception now
if (conflicts.Count > 0) {
- // First we need to rollback any value that have already been auto-[....]'d, since the values are no longer valid on the server
+ // First we need to rollback any value that have already been auto-sync'd, since the values are no longer valid on the server
changeDirector.RollbackAutoSync();
- // Also rollback any dependent items that were [....]'d, since their parent values may have been rolled back
+ // Also rollback any dependent items that were sync'd, since their parent values may have been rolled back
foreach (TrackedObject syncDependentItem in syncDependentItems) {
Debug.Assert(syncDependentItem.IsNew || syncDependentItem.IsPossiblyModified, "SynchDependent data should only be rolled back for new and modified objects.");
syncDependentItem.SynchDependentData();
diff --git a/mcs/class/referencesource/System.Data.Linq/ChangeTracker.cs b/mcs/class/referencesource/System.Data.Linq/ChangeTracker.cs
index 76d80426bb1..4e850afa9b4 100644
--- a/mcs/class/referencesource/System.Data.Linq/ChangeTracker.cs
+++ b/mcs/class/referencesource/System.Data.Linq/ChangeTracker.cs
@@ -560,7 +560,7 @@ namespace System.Data.Linq {
}
}
- // Return value indicates whether or not any data was actually [....]'d
+ // Return value indicates whether or not any data was actually sync'd
internal override bool SynchDependentData() {
bool valueWasSet = false;
diff --git a/mcs/class/referencesource/System.Data.Linq/CompiledQuery.cs b/mcs/class/referencesource/System.Data.Linq/CompiledQuery.cs
index 275883b0227..ee789b785f3 100644
--- a/mcs/class/referencesource/System.Data.Linq/CompiledQuery.cs
+++ b/mcs/class/referencesource/System.Data.Linq/CompiledQuery.cs
@@ -31,7 +31,7 @@ namespace System.Data.Linq {
get { return this.query; }
}
- [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "[....]: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
+ [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Microsoft: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
public static Func<TArg0, TResult> Compile<TArg0, TResult>(Expression<Func<TArg0, TResult>> query) where TArg0 : DataContext {
if (query == null) {
Error.ArgumentNull("query");
@@ -44,7 +44,7 @@ namespace System.Data.Linq {
}
}
- [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "[....]: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
+ [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Microsoft: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
public static Func<TArg0, TArg1, TResult> Compile<TArg0, TArg1, TResult>(Expression<Func<TArg0, TArg1, TResult>> query) where TArg0 : DataContext {
if (query == null) {
Error.ArgumentNull("query");
@@ -57,7 +57,7 @@ namespace System.Data.Linq {
}
}
- [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "[....]: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
+ [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Microsoft: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
public static Func<TArg0, TArg1, TArg2, TResult> Compile<TArg0, TArg1, TArg2, TResult>(Expression<Func<TArg0, TArg1, TArg2, TResult>> query) where TArg0 : DataContext {
if (query == null) {
Error.ArgumentNull("query");
@@ -70,7 +70,7 @@ namespace System.Data.Linq {
}
}
- [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "[....]: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
+ [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Microsoft: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
public static Func<TArg0, TArg1, TArg2, TArg3, TResult> Compile<TArg0, TArg1, TArg2, TArg3, TResult>(Expression<Func<TArg0, TArg1, TArg2, TArg3, TResult>> query) where TArg0 : DataContext {
if (query == null) {
Error.ArgumentNull("query");
@@ -83,7 +83,7 @@ namespace System.Data.Linq {
}
}
- [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "[....]: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
+ [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Microsoft: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
public static Func<TArg0, TArg1, TArg2, TArg3, TArg4, TResult> Compile<TArg0, TArg1, TArg2, TArg3, TArg4, TResult>(Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TResult>> query) where TArg0 : DataContext {
if (query == null) {
Error.ArgumentNull("query");
@@ -96,7 +96,7 @@ namespace System.Data.Linq {
}
}
- [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "[....]: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
+ [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Microsoft: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
public static Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TResult> Compile<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TResult>(Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TResult>> query) where TArg0 : DataContext {
if (query == null) {
Error.ArgumentNull("query");
@@ -109,7 +109,7 @@ namespace System.Data.Linq {
}
}
- [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "[....]: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
+ [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Microsoft: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
public static Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult> Compile<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult>(Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult>> query) where TArg0 : DataContext {
if (query == null) {
Error.ArgumentNull("query");
@@ -122,7 +122,7 @@ namespace System.Data.Linq {
}
}
- [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "[....]: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
+ [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Microsoft: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
public static Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult> Compile<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult>(Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult>> query) where TArg0 : DataContext {
if (query == null) {
Error.ArgumentNull("query");
@@ -135,7 +135,7 @@ namespace System.Data.Linq {
}
}
- [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "[....]: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
+ [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Microsoft: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
public static Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TResult> Compile<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TResult>(Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TResult>> query) where TArg0 : DataContext {
if (query == null) {
Error.ArgumentNull("query");
@@ -148,7 +148,7 @@ namespace System.Data.Linq {
}
}
- [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "[....]: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
+ [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Microsoft: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
public static Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TResult> Compile<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TResult>(Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TResult>> query) where TArg0 : DataContext {
if (query == null) {
Error.ArgumentNull("query");
@@ -161,7 +161,7 @@ namespace System.Data.Linq {
}
}
- [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "[....]: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
+ [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Microsoft: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
public static Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TResult> Compile<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TResult>(Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TResult>> query) where TArg0 : DataContext {
if (query == null) {
Error.ArgumentNull("query");
@@ -174,7 +174,7 @@ namespace System.Data.Linq {
}
}
- [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "[....]: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
+ [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Microsoft: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
public static Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TResult> Compile<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TResult>(Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TResult>> query) where TArg0 : DataContext {
if (query == null) {
Error.ArgumentNull("query");
@@ -187,7 +187,7 @@ namespace System.Data.Linq {
}
}
- [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "[....]: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
+ [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Microsoft: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
public static Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TResult> Compile<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TResult>(Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TResult>> query) where TArg0 : DataContext {
if (query == null) {
Error.ArgumentNull("query");
@@ -200,7 +200,7 @@ namespace System.Data.Linq {
}
}
- [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "[....]: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
+ [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Microsoft: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
public static Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TResult> Compile<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TResult>(Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TResult>> query) where TArg0 : DataContext {
if (query == null) {
Error.ArgumentNull("query");
@@ -213,7 +213,7 @@ namespace System.Data.Linq {
}
}
- [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "[....]: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
+ [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Microsoft: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
public static Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TResult> Compile<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TResult>(Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TResult>> query) where TArg0 : DataContext {
if (query == null) {
Error.ArgumentNull("query");
@@ -226,7 +226,7 @@ namespace System.Data.Linq {
}
}
- [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "[....]: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
+ [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Microsoft: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
public static Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TResult> Compile<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TResult>(Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TResult>> query) where TArg0 : DataContext {
if (query == null) {
Error.ArgumentNull("query");
diff --git a/mcs/class/referencesource/System.Data.Linq/DataContext.cs b/mcs/class/referencesource/System.Data.Linq/DataContext.cs
index 5d7fb47e71f..822c6ea1bef 100644
--- a/mcs/class/referencesource/System.Data.Linq/DataContext.cs
+++ b/mcs/class/referencesource/System.Data.Linq/DataContext.cs
@@ -352,7 +352,7 @@ namespace System.Data.Linq {
/// <typeparam name="TEntity">The type of the entity objects. In case of a persistent hierarchy
/// the entity specified must be the base type of the hierarchy.</typeparam>
/// <returns></returns>
- [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "[....]: Generic parameters are required for strong-typing of the return type.")]
+ [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "Microsoft: Generic parameters are required for strong-typing of the return type.")]
public Table<TEntity> GetTable<TEntity>() where TEntity : class {
CheckDispose();
MetaTable metaTable = this.services.Model.GetTable(typeof(TEntity));
@@ -483,7 +483,7 @@ namespace System.Data.Linq {
/// You can override this method to implement common conflict resolution behaviors.
/// </summary>
/// <param name="failureMode">Determines how SubmitChanges handles conflicts.</param>
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "[....]: In the middle of attempting to rollback a transaction, outer transaction is thrown.")]
+ [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Microsoft: In the middle of attempting to rollback a transaction, outer transaction is thrown.")]
public virtual void SubmitChanges(ConflictMode failureMode) {
CheckDispose();
CheckNotInSubmitChanges();
@@ -718,7 +718,7 @@ namespace System.Data.Linq {
/// <param name="query">The query specified in the server's native query language.</param>
/// <param name="parameters">The parameter values to use for the query.</param>
/// <returns>An IEnumerable sequence of objects.</returns>
- [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "[....]: Generic parameters are required for strong-typing of the return type.")]
+ [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "Microsoft: Generic parameters are required for strong-typing of the return type.")]
public IEnumerable<TResult> ExecuteQuery<TResult>(string query, params object[] parameters) {
CheckDispose();
if (query == null) {
@@ -786,7 +786,7 @@ namespace System.Data.Linq {
/// <param name="methodInfo">The reflection MethodInfo for the method to invoke.</param>
/// <param name="parameters">The parameters for the method call.</param>
/// <returns>The returned query object</returns>
- [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "[....]: Generic parameters are required for strong-typing of the return type.")]
+ [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "Microsoft: Generic parameters are required for strong-typing of the return type.")]
internal protected IQueryable<TResult> CreateMethodCallQuery<TResult>(object instance, MethodInfo methodInfo, params object[] parameters) {
CheckDispose();
if (instance == null) {
@@ -884,7 +884,7 @@ namespace System.Data.Linq {
/// <typeparam name="TResult">The element type of the resulting sequence</typeparam>
/// <param name="reader">The DbDataReader to translate</param>
/// <returns>The translated sequence of objects</returns>
- [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "[....]: Generic parameters are required for strong-typing of the return type.")]
+ [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "Microsoft: Generic parameters are required for strong-typing of the return type.")]
public IEnumerable<TResult> Translate<TResult>(DbDataReader reader) {
CheckDispose();
return (IEnumerable<TResult>)this.Translate(typeof(TResult), reader);
@@ -999,7 +999,7 @@ namespace System.Data.Linq {
/// ITable is the common interface for DataContext tables. It can be used as the source
/// of a dynamic/runtime-generated query.
/// </summary>
- [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification="[....]: Meant to represent a database table which is delayed loaded and doesn't provide collection semantics.")]
+ [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification="Microsoft: Meant to represent a database table which is delayed loaded and doesn't provide collection semantics.")]
public interface ITable : IQueryable {
/// <summary>
/// The DataContext containing this Table.
@@ -1102,7 +1102,7 @@ namespace System.Data.Linq {
/// persisted in the database. Use it as a source of queries and to add/insert and remove/delete entities.
/// </summary>
/// <typeparam name="TEntity"></typeparam>
- [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification="[....]: Meant to represent a database table which is delayed loaded and doesn't provide collection semantics.")]
+ [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification="Microsoft: Meant to represent a database table which is delayed loaded and doesn't provide collection semantics.")]
public sealed class Table<TEntity> : IQueryable<TEntity>, IQueryProvider, IEnumerable<TEntity>, IQueryable, IEnumerable, ITable, IListSource, ITable<TEntity>
where TEntity : class {
DataContext context;
@@ -1156,7 +1156,7 @@ namespace System.Data.Linq {
return (IQueryable)Activator.CreateInstance(dqType, new object[] { this.context, expression });
}
- [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "[....]: Generic parameters are required for strong-typing of the return type.")]
+ [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "Microsoft: Generic parameters are required for strong-typing of the return type.")]
IQueryable<TResult> IQueryProvider.CreateQuery<TResult>(Expression expression) {
if (expression == null) {
throw Error.ArgumentNull("expression");
@@ -1171,7 +1171,7 @@ namespace System.Data.Linq {
return this.context.Provider.Execute(expression).ReturnValue;
}
- [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "[....]: Generic parameters are required for strong-typing of the return type.")]
+ [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "Microsoft: Generic parameters are required for strong-typing of the return type.")]
TResult IQueryProvider.Execute<TResult>(Expression expression) {
return (TResult)this.context.Provider.Execute(expression).ReturnValue;
}
@@ -1680,7 +1680,7 @@ namespace System.Data.Linq {
}
}
- [SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes", Justification = "[....]: Types are never compared to each other. When comparisons happen it is against the entities that are represented by these constructs.")]
+ [SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes", Justification = "Microsoft: Types are never compared to each other. When comparisons happen it is against the entities that are represented by these constructs.")]
public struct ModifiedMemberInfo {
MemberInfo member;
object current;
diff --git a/mcs/class/referencesource/System.Data.Linq/DataShape.cs b/mcs/class/referencesource/System.Data.Linq/DataShape.cs
index e46bb6ee15c..9993d417b49 100644
--- a/mcs/class/referencesource/System.Data.Linq/DataShape.cs
+++ b/mcs/class/referencesource/System.Data.Linq/DataShape.cs
@@ -17,8 +17,8 @@ namespace System.Data.Linq {
/// <summary>
/// Describe a property that is automatically loaded when the containing instance is loaded
/// </summary>
- [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "[....]: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
- [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", Justification = "[....]: Need to provide static typing.")]
+ [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Microsoft: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", Justification = "Microsoft: Need to provide static typing.")]
public void LoadWith<T>(Expression<Func<T, object>> expression) {
if (expression == null) {
throw Error.ArgumentNull("expression");
@@ -41,8 +41,8 @@ namespace System.Data.Linq {
/// <summary>
/// Place a subquery on the given association.
/// </summary>
- [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "[....]: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
- [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", Justification = "[....]: Need to provide static typing.")]
+ [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "Microsoft: Generic types are an important part of Linq APIs and they could not exist without nested generic support.")]
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", Justification = "Microsoft: Need to provide static typing.")]
public void AssociateWith<T>(Expression<Func<T, object>> expression) {
if (expression == null) {
throw Error.ArgumentNull("expression");
diff --git a/mcs/class/referencesource/System.Data.Linq/DbConvert.cs b/mcs/class/referencesource/System.Data.Linq/DbConvert.cs
index 03af1adc404..7d21b20de9b 100644
--- a/mcs/class/referencesource/System.Data.Linq/DbConvert.cs
+++ b/mcs/class/referencesource/System.Data.Linq/DbConvert.cs
@@ -15,12 +15,12 @@ namespace System.Data.Linq {
public static class DBConvert {
private static Type[] StringArg = new Type[] { typeof(string) };
- [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "[....]: Generic parameters are required for strong-typing of the return type.")]
+ [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "Microsoft: Generic parameters are required for strong-typing of the return type.")]
public static T ChangeType<T>(object value) {
return (T)ChangeType(value, typeof(T));
}
- [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification = "[....]: Cast is dependent on node type and casts do not happen unecessarily in a single code path.")]
+ [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification = "Microsoft: Cast is dependent on node type and casts do not happen unecessarily in a single code path.")]
[SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "These issues are related to our use of if-then and case statements for node types, which adds to the complexity count however when reviewed they are easy to navigate and understand.")]
public static object ChangeType(object value, Type type) {
if (value == null)
diff --git a/mcs/class/referencesource/System.Data.Linq/Mapping/MetaModel.cs b/mcs/class/referencesource/System.Data.Linq/Mapping/MetaModel.cs
index d07e222bafd..68b69b3defc 100644
--- a/mcs/class/referencesource/System.Data.Linq/Mapping/MetaModel.cs
+++ b/mcs/class/referencesource/System.Data.Linq/Mapping/MetaModel.cs
@@ -501,7 +501,7 @@ namespace System.Data.Linq.Mapping {
/// </summary>
/// <param name="instance">The instance to set the value into.</param>
/// <param name="value">The value to set.</param>
- [SuppressMessage("Microsoft.Design", "CA1007:UseGenericsWhereAppropriate", Justification="[....]: Needs to handle classes and structs.")]
+ [SuppressMessage("Microsoft.Design", "CA1007:UseGenericsWhereAppropriate", Justification="Microsoft: Needs to handle classes and structs.")]
[SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference", Justification="Unknown reason.")]
public abstract void SetBoxedValue(ref object instance, object value);
/// <summary>
diff --git a/mcs/class/referencesource/System.Data.Linq/Provider/IProvider.cs b/mcs/class/referencesource/System.Data.Linq/Provider/IProvider.cs
index 56eccaa93be..98438415b0c 100644
--- a/mcs/class/referencesource/System.Data.Linq/Provider/IProvider.cs
+++ b/mcs/class/referencesource/System.Data.Linq/Provider/IProvider.cs
@@ -140,8 +140,8 @@ namespace System.Data.Linq.Provider {
/// <param name="item"></param>
/// <param name="resultSelector"></param>
/// <returns></returns>
- [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "item", Justification = "[....]: The method is being used to represent a method signature")]
- [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "resultSelector", Justification = "[....]: The method is being used to represent a method signature")]
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "item", Justification = "Microsoft: The method is being used to represent a method signature")]
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "resultSelector", Justification = "Microsoft: The method is being used to represent a method signature")]
public static TResult Insert<TEntity, TResult>(TEntity item, Func<TEntity, TResult> resultSelector) {
throw new NotImplementedException();
}
@@ -152,7 +152,7 @@ namespace System.Data.Linq.Provider {
/// <typeparam name="TEntity"></typeparam>
/// <param name="item"></param>
/// <returns></returns>
- [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "item", Justification = "[....]: The method is being used to represent a method signature")]
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "item", Justification = "Microsoft: The method is being used to represent a method signature")]
public static int Insert<TEntity>(TEntity item) {
throw new NotImplementedException();
}
@@ -166,9 +166,9 @@ namespace System.Data.Linq.Provider {
/// <param name="check"></param>
/// <param name="resultSelector"></param>
/// <returns></returns>
- [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "item", Justification = "[....]: The method is being used to represent a method signature")]
- [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "check", Justification = "[....]: The method is being used to represent a method signature")]
- [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "resultSelector", Justification = "[....]: The method is being used to represent a method signature")]
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "item", Justification = "Microsoft: The method is being used to represent a method signature")]
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "check", Justification = "Microsoft: The method is being used to represent a method signature")]
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "resultSelector", Justification = "Microsoft: The method is being used to represent a method signature")]
public static TResult Update<TEntity, TResult>(TEntity item, Func<TEntity, bool> check, Func<TEntity, TResult> resultSelector) {
throw new NotImplementedException();
}
@@ -181,8 +181,8 @@ namespace System.Data.Linq.Provider {
/// <param name="item"></param>
/// <param name="resultSelector"></param>
/// <returns></returns>
- [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "item", Justification = "[....]: The method is being used to represent a method signature")]
- [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "resultSelector", Justification = "[....]: The method is being used to represent a method signature")]
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "item", Justification = "Microsoft: The method is being used to represent a method signature")]
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "resultSelector", Justification = "Microsoft: The method is being used to represent a method signature")]
public static TResult Update<TEntity, TResult>(TEntity item, Func<TEntity, TResult> resultSelector) {
throw new NotImplementedException();
}
@@ -194,8 +194,8 @@ namespace System.Data.Linq.Provider {
/// <param name="item"></param>
/// <param name="check"></param>
/// <returns></returns>
- [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "item", Justification = "[....]: The method is being used to represent a method signature")]
- [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "check", Justification = "[....]: The method is being used to represent a method signature")]
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "item", Justification = "Microsoft: The method is being used to represent a method signature")]
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "check", Justification = "Microsoft: The method is being used to represent a method signature")]
public static int Update<TEntity>(TEntity item, Func<TEntity, bool> check) {
throw new NotImplementedException();
}
@@ -206,7 +206,7 @@ namespace System.Data.Linq.Provider {
/// <typeparam name="TEntity"></typeparam>
/// <param name="item"></param>
/// <returns></returns>
- [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "item", Justification = "[....]: The method is being used to represent a method signature")]
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "item", Justification = "Microsoft: The method is being used to represent a method signature")]
public static int Update<TEntity>(TEntity item) {
throw new NotImplementedException();
}
@@ -218,8 +218,8 @@ namespace System.Data.Linq.Provider {
/// <param name="item"></param>
/// <param name="check"></param>
/// <returns></returns>
- [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "item", Justification = "[....]: The method is being used to represent a method signature")]
- [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "check", Justification = "[....]: The method is being used to represent a method signature")]
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "item", Justification = "Microsoft: The method is being used to represent a method signature")]
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "check", Justification = "Microsoft: The method is being used to represent a method signature")]
public static int Delete<TEntity>(TEntity item, Func<TEntity, bool> check) {
throw new NotImplementedException();
}
@@ -230,7 +230,7 @@ namespace System.Data.Linq.Provider {
/// <typeparam name="TEntity"></typeparam>
/// <param name="item"></param>
/// <returns></returns>
- [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "item", Justification = "[....]: The method is being used to represent a method signature")]
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "item", Justification = "Microsoft: The method is being used to represent a method signature")]
public static int Delete<TEntity>(TEntity item) {
throw new NotImplementedException();
}
diff --git a/mcs/class/referencesource/System.Data.Linq/SqlClient/Common/SqlVisitor.cs b/mcs/class/referencesource/System.Data.Linq/SqlClient/Common/SqlVisitor.cs
index 9f35835e429..87d874585ce 100644
--- a/mcs/class/referencesource/System.Data.Linq/SqlClient/Common/SqlVisitor.cs
+++ b/mcs/class/referencesource/System.Data.Linq/SqlClient/Common/SqlVisitor.cs
@@ -9,7 +9,7 @@ namespace System.Data.Linq.SqlClient {
int nDepth;
// Visit a SqlNode
- [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification="[....]: Cast is dependent on node type and casts do not happen unecessarily in a single code path.")]
+ [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification="Microsoft: Cast is dependent on node type and casts do not happen unecessarily in a single code path.")]
[SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "These issues are related to our use of if-then and case statements for node types, which adds to the complexity count however when reviewed they are easy to navigate and understand.")]
[SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "These issues are related to our use of if-then and case statements for node types, which adds to the complexity count however when reviewed they are easy to navigate and understand.")]
internal virtual SqlNode Visit(SqlNode node) {
diff --git a/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/Funcletizer.cs b/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/Funcletizer.cs
index 57d09b761ad..50ccc2c6d09 100644
--- a/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/Funcletizer.cs
+++ b/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/Funcletizer.cs
@@ -142,7 +142,7 @@ namespace System.Data.Linq.SqlClient {
}
[SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "These issues are related to our use of if-then and case statements for node types, which adds to the complexity count however when reviewed they are easy to navigate and understand.")]
- [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification = "[....]: Cast is dependent on node type and casts do not happen unecessarily in a single code path.")]
+ [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification = "Microsoft: Cast is dependent on node type and casts do not happen unecessarily in a single code path.")]
internal virtual Expression Visit(Expression exp) {
if (exp == null)
return exp;
diff --git a/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/QueryConverter.cs b/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/QueryConverter.cs
index 55ae51ee957..a9135481d56 100644
--- a/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/QueryConverter.cs
+++ b/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/QueryConverter.cs
@@ -143,7 +143,7 @@ namespace System.Data.Linq.SqlClient {
return result;
}
- [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification = "[....]: Cast is dependent on node type and casts do not happen unecessarily in a single code path.")]
+ [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification = "Microsoft: Cast is dependent on node type and casts do not happen unecessarily in a single code path.")]
[SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "These issues are related to our use of if-then and case statements for node types, which adds to the complexity count however when reviewed they are easy to navigate and understand.")]
private SqlNode VisitInner(Expression node) {
if (node == null) return null;
diff --git a/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/SqlBinder.cs b/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/SqlBinder.cs
index 26645270af2..6d5c6e6156b 100644
--- a/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/SqlBinder.cs
+++ b/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/SqlBinder.cs
@@ -1266,7 +1266,7 @@ namespace System.Data.Linq.SqlClient {
throw Error.UnexpectedNode(node.NodeType);
}
- [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification = "[....]: Cast is dependent on node type and casts do not happen unecessarily in a single code path.")]
+ [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification = "Microsoft: Cast is dependent on node type and casts do not happen unecessarily in a single code path.")]
[SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "These issues are related to our use of if-then and case statements for node types, which adds to the complexity count however when reviewed they are easy to navigate and understand.")]
[SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "These issues are related to our use of if-then and case statements for node types, which adds to the complexity count however when reviewed they are easy to navigate and understand.")]
internal SqlExpression ConvertToFetchedExpression(SqlNode node) {
diff --git a/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/SqlComparer.cs b/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/SqlComparer.cs
index 06a76c701a1..d70c0becbe9 100644
--- a/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/SqlComparer.cs
+++ b/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/SqlComparer.cs
@@ -13,7 +13,7 @@ namespace System.Data.Linq.SqlClient {
internal SqlComparer() {
}
- [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification = "[....]: Cast is dependent on node type and casts do not happen unecessarily in a single code path.")]
+ [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification = "Microsoft: Cast is dependent on node type and casts do not happen unecessarily in a single code path.")]
[SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "These issues are related to our use of if-then and case statements for node types, which adds to the complexity count however when reviewed they are easy to navigate and understand.")]
[SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Justification = "These issues are related to our use of if-then and case statements for node types, which adds to the complexity count however when reviewed they are easy to navigate and understand.")]
[SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "These issues are related to our use of if-then and case statements for node types, which adds to the complexity count however when reviewed they are easy to navigate and understand.")]
diff --git a/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/SqlDeflator.cs b/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/SqlDeflator.cs
index b290c007cd7..ed4f0e66eca 100644
--- a/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/SqlDeflator.cs
+++ b/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/SqlDeflator.cs
@@ -236,7 +236,7 @@ namespace System.Data.Linq.SqlClient {
return select;
}
- [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification="[....]: Cast is dependent on node type and casts do not happen unecessarily in a single code path.")]
+ [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification="Microsoft: Cast is dependent on node type and casts do not happen unecessarily in a single code path.")]
private void CheckJoinCondition(SqlExpression expr) {
switch (expr.NodeType) {
case SqlNodeType.And: {
diff --git a/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/SqlFlattener.cs b/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/SqlFlattener.cs
index 9b7d7de01af..9717a97a0cc 100644
--- a/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/SqlFlattener.cs
+++ b/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/SqlFlattener.cs
@@ -20,7 +20,7 @@ namespace System.Data.Linq.SqlClient {
}
class Visitor : SqlVisitor {
- [SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "[....]: part of our standard visitor pattern")]
+ [SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Microsoft: part of our standard visitor pattern")]
SqlFactory sql;
SqlColumnizer columnizer;
bool isTopLevel;
diff --git a/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/SqlMethodCallConverter.cs b/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/SqlMethodCallConverter.cs
index ddbca5a93db..79be6fe37eb 100644
--- a/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/SqlMethodCallConverter.cs
+++ b/mcs/class/referencesource/System.Data.Linq/SqlClient/Query/SqlMethodCallConverter.cs
@@ -939,7 +939,7 @@ namespace System.Data.Linq.SqlClient {
//Recognized pattern has set return value so return
if (returnValue != null) {
- // Assert here to verify that actual translation stays in [....] with
+ // Assert here to verify that actual translation stays in sync with
// method support logic
Debug.Assert(GetMethodSupport(mc) == MethodSupport.Method);
return returnValue;
@@ -973,7 +973,7 @@ namespace System.Data.Linq.SqlClient {
returnValue = TranslateDateTimeOffsetInstanceMethod(mc);
}
if (returnValue != null) {
- // Assert here to verify that actual translation stays in [....] with
+ // Assert here to verify that actual translation stays in sync with
// method support logic
Debug.Assert(GetMethodSupport(mc) == MethodSupport.Method);
return returnValue;
@@ -2159,7 +2159,7 @@ namespace System.Data.Linq.SqlClient {
throw GetMethodSupportException(mc);
}
- [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "[....]: These issues are related to our use of if-then and case statements for node types, which adds to the complexity count however when reviewed they are easy to navigate and understand.")]
+ [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Microsoft: These issues are related to our use of if-then and case statements for node types, which adds to the complexity count however when reviewed they are easy to navigate and understand.")]
internal override SqlNode VisitMember(SqlMember m) {
SqlExpression exp = this.VisitExpression(m.Expression);
MemberInfo member = m.Member;
diff --git a/mcs/class/referencesource/System.Data.Linq/SqlClient/Reader/ObjectReaderCompiler.cs b/mcs/class/referencesource/System.Data.Linq/SqlClient/Reader/ObjectReaderCompiler.cs
index 44139f927c2..70507c24596 100644
--- a/mcs/class/referencesource/System.Data.Linq/SqlClient/Reader/ObjectReaderCompiler.cs
+++ b/mcs/class/referencesource/System.Data.Linq/SqlClient/Reader/ObjectReaderCompiler.cs
@@ -35,18 +35,18 @@ namespace System.Data.Linq.SqlClient {
[SuppressMessage("Microsoft.Design", "CA1012:AbstractTypesShouldNotHaveConstructors", Justification = "Unknown reason.")]
public abstract class ObjectMaterializer<TDataReader> where TDataReader : DbDataReader {
// These are public fields rather than properties for access speed
- [SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields", Justification = "[....]: This is a public type that is not intended for public use.")]
+ [SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields", Justification = "Microsoft: This is a public type that is not intended for public use.")]
public int[] Ordinals;
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Globals", Justification = "Spelling is correct.")]
- [SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields", Justification = "[....]: This is a public type that is not intended for public use.")]
+ [SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields", Justification = "Microsoft: This is a public type that is not intended for public use.")]
public object[] Globals;
- [SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields", Justification = "[....]: This is a public type that is not intended for public use.")]
+ [SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields", Justification = "Microsoft: This is a public type that is not intended for public use.")]
public object[] Locals;
- [SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields", Justification = "[....]: This is a public type that is not intended for public use.")]
+ [SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields", Justification = "Microsoft: This is a public type that is not intended for public use.")]
public object[] Arguments;
- [SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields", Justification = "[....]: This is a public type that is not intended for public use.")]
+ [SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields", Justification = "Microsoft: This is a public type that is not intended for public use.")]
public TDataReader DataReader;
- [SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields", Justification = "[....]: This is a public type that is not intended for public use.")]
+ [SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields", Justification = "Microsoft: This is a public type that is not intended for public use.")]
public DbDataReader BufferReader;
public ObjectMaterializer() {
@@ -57,16 +57,16 @@ namespace System.Data.Linq.SqlClient {
public abstract void SendEntityMaterialized(int globalMetaType, object instance);
public abstract IEnumerable ExecuteSubQuery(int iSubQuery, object[] args);
- [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "[....]: Generic parameters are required for strong-typing of the return type.")]
+ [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "Microsoft: Generic parameters are required for strong-typing of the return type.")]
public abstract IEnumerable<T> GetLinkSource<T>(int globalLink, int localFactory, object[] keyValues);
- [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "[....]: Generic parameters are required for strong-typing of the return type.")]
+ [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "Microsoft: Generic parameters are required for strong-typing of the return type.")]
public abstract IEnumerable<T> GetNestedLinkSource<T>(int globalLink, int localFactory, object instance);
public abstract bool Read();
public abstract bool CanDeferLoad { get; }
[SuppressMessage("Microsoft.Design", "CA1000:DoNotDeclareStaticMembersOnGenericTypes", Justification = "xiaoruda: The method has to be static because it's used in our generated code and there is no instance of the type.")]
- [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "[....]: Generic parameters are required for strong-typing of the return type.")]
+ [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "Microsoft: Generic parameters are required for strong-typing of the return type.")]
public static IEnumerable<TOutput> Convert<TOutput>(IEnumerable source) {
foreach (object value in source) {
yield return DBConvert.ChangeType<TOutput>(value);
@@ -717,7 +717,7 @@ namespace System.Data.Linq.SqlClient {
return this.Generate(node, null);
}
- [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification = "[....]: Cast is dependent on node type and casts do not happen unecessarily in a single code path.")]
+ [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification = "Microsoft: Cast is dependent on node type and casts do not happen unecessarily in a single code path.")]
[SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "These issues are related to our use of if-then and case statements for node types, which adds to the complexity count however when reviewed they are easy to navigate and understand.")]
private Type Generate(SqlNode node, LocalBuilder locInstance) {
#if DEBUG
@@ -2212,7 +2212,7 @@ namespace System.Data.Linq.SqlClient {
}
}
- [SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", Justification = "[....]: The variable tc for which the rule fires is used in both a Debug.Assert and in a switch statement")]
+ [SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", Justification = "Microsoft: The variable tc for which the rule fires is used in both a Debug.Assert and in a switch statement")]
private void GenerateArrayAssign(Type type) {
// This method was copied out of the expression compiler codebase.
// Since DLINQ doesn't currently consume array indexers most of this
@@ -2263,7 +2263,7 @@ namespace System.Data.Linq.SqlClient {
}
}
- [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "address", Justification = "[....]: See comments in source. Usage commented out to improve code coverage test")]
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "address", Justification = "Microsoft: See comments in source. Usage commented out to improve code coverage test")]
private Type GenerateArrayAccess(Type type, bool address) {
// This method was copied out of the expression compiler codebase.
// Since DLINQ doesn't currently consume array indexers most of this
@@ -2517,7 +2517,7 @@ namespace System.Data.Linq.SqlClient {
get { return this.BufferReader != null; }
}
- [SuppressMessage("Microsoft.Globalization", "CA1306:SetLocaleForDataTypes", Justification = "[....]: Used only as a buffer and never used for string comparison.")]
+ [SuppressMessage("Microsoft.Globalization", "CA1306:SetLocaleForDataTypes", Justification = "Microsoft: Used only as a buffer and never used for string comparison.")]
internal void Buffer() {
if (this.BufferReader == null && (this.hasCurrentRow || !this.hasRead)) {
if (this.session.IsBuffered) {
@@ -2801,7 +2801,7 @@ namespace System.Data.Linq.SqlClient {
get { return this.buffer != null; }
}
- [SuppressMessage("Microsoft.Globalization", "CA1306:SetLocaleForDataTypes", Justification = "[....]: Used only as a buffer and never used for string comparison.")]
+ [SuppressMessage("Microsoft.Globalization", "CA1306:SetLocaleForDataTypes", Justification = "Microsoft: Used only as a buffer and never used for string comparison.")]
public void Buffer() {
if (this.buffer == null) {
if (this.currentReader != null && !this.currentReader.IsBuffered) {
diff --git a/mcs/class/referencesource/System.Data.Linq/SqlClient/SqlMethods.cs b/mcs/class/referencesource/System.Data.Linq/SqlClient/SqlMethods.cs
index e11bca1e8a5..da3696d31d1 100644
--- a/mcs/class/referencesource/System.Data.Linq/SqlClient/SqlMethods.cs
+++ b/mcs/class/referencesource/System.Data.Linq/SqlClient/SqlMethods.cs
@@ -562,8 +562,8 @@ namespace System.Data.Linq.SqlClient {
/// <param name="match_expression">The string that is to be matched.</param>
/// <param name="pattern">The pattern which may involve wildcards %,_,[,],^.</param>
/// <returns>true if there is a match.</returns>
- [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "pattern", Justification = "[....]: Method is a placeholder for a server-side method.")]
- [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "matchExpression", Justification = "[....]: Method is a placeholder for a server-side method.")]
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "pattern", Justification = "Microsoft: Method is a placeholder for a server-side method.")]
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "matchExpression", Justification = "Microsoft: Method is a placeholder for a server-side method.")]
public static bool Like(string matchExpression, string pattern) {
throw Error.SqlMethodOnlyForSql(MethodInfo.GetCurrentMethod());
}
@@ -576,9 +576,9 @@ namespace System.Data.Linq.SqlClient {
/// <param name="pattern">The pattern which may involve wildcards %,_,[,],^.</param>
/// <param name="escape_character">The escape character to use in front of %,_,[,],^ if they are not used as wildcards.</param>
/// <returns>true if there is a match.</returns>
- [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "pattern", Justification = "[....]: Method is a placeholder for a server-side method.")]
- [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "matchExpression", Justification = "[....]: Method is a placeholder for a server-side method.")]
- [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "escapeCharacter", Justification = "[....]: Method is a placeholder for a server-side method.")]
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "pattern", Justification = "Microsoft: Method is a placeholder for a server-side method.")]
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "matchExpression", Justification = "Microsoft: Method is a placeholder for a server-side method.")]
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "escapeCharacter", Justification = "Microsoft: Method is a placeholder for a server-side method.")]
public static bool Like(string matchExpression, string pattern, char escapeCharacter) {
throw Error.SqlMethodOnlyForSql(MethodInfo.GetCurrentMethod());
}
@@ -591,7 +591,7 @@ namespace System.Data.Linq.SqlClient {
/// </summary>
/// <param name="value">The string to take the length of.</param>
/// <returns>length of the string</returns>
- [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "value", Justification = "[....]: Method is a placeholder for a server-side method.")]
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "value", Justification = "Microsoft: Method is a placeholder for a server-side method.")]
internal static int RawLength(string value) {
throw Error.SqlMethodOnlyForSql(MethodInfo.GetCurrentMethod());
}
@@ -602,7 +602,7 @@ namespace System.Data.Linq.SqlClient {
/// </summary>
/// <param name="value">The byte array to take the length of.</param>
/// <returns>length of the array</returns>
- [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "value", Justification = "[....]: Method is a placeholder for a server-side method.")]
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "value", Justification = "Microsoft: Method is a placeholder for a server-side method.")]
internal static int RawLength(byte[] value) {
throw Error.SqlMethodOnlyForSql(MethodInfo.GetCurrentMethod());
}
@@ -613,7 +613,7 @@ namespace System.Data.Linq.SqlClient {
/// </summary>
/// <param name="value">The Binary value to take the length of.</param>
/// <returns>length of the Binary</returns>
- [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "value", Justification = "[....]: Method is a placeholder for a server-side method.")]
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "value", Justification = "Microsoft: Method is a placeholder for a server-side method.")]
internal static int RawLength(Binary value) {
throw Error.SqlMethodOnlyForSql(MethodInfo.GetCurrentMethod());
}
diff --git a/mcs/class/referencesource/System.Data.Linq/SqlClient/SqlProvider.cs b/mcs/class/referencesource/System.Data.Linq/SqlClient/SqlProvider.cs
index f3dce0d1cfc..437759cb900 100644
--- a/mcs/class/referencesource/System.Data.Linq/SqlClient/SqlProvider.cs
+++ b/mcs/class/referencesource/System.Data.Linq/SqlClient/SqlProvider.cs
@@ -738,7 +738,7 @@ namespace System.Data.Linq.SqlClient {
}
}
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification="[....]: Code needs to return false regarless of exception.")]
+ [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification="Microsoft: Code needs to return false regarless of exception.")]
[ResourceExposure(ResourceScope.None)] // Exposure is via other methods that set dbName.
[ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)] // File.Exists method call.
bool IProvider.DatabaseExists() {
@@ -1779,7 +1779,7 @@ namespace System.Data.Linq.SqlClient {
IObjectReaderSession session;
int iReturnParameter = -1;
object value;
- [SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "[....]: used in an assert in ReturnValue.set")]
+ [SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Microsoft: used in an assert in ReturnValue.set")]
bool useReturnValue;
bool isDisposed;
diff --git a/mcs/class/referencesource/System.Data.Linq/SqlClient/SqlTypeSystemProvider.cs b/mcs/class/referencesource/System.Data.Linq/SqlClient/SqlTypeSystemProvider.cs
index 06bb4d3af7c..f71e8659778 100644
--- a/mcs/class/referencesource/System.Data.Linq/SqlClient/SqlTypeSystemProvider.cs
+++ b/mcs/class/referencesource/System.Data.Linq/SqlClient/SqlTypeSystemProvider.cs
@@ -1316,7 +1316,7 @@ namespace System.Data.Linq.SqlClient {
}
}
- [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification = "[....]: Cast is dependent on node type and casts do not happen unecessarily in a single code path.")]
+ [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification = "Microsoft: Cast is dependent on node type and casts do not happen unecessarily in a single code path.")]
internal override ProviderType GetBestType(ProviderType typeA, ProviderType typeB) {
// first determine the type precedence
SqlType bestType = (SqlType)(typeA.ComparePrecedenceTo(typeB) > 0 ? typeA : typeB);
diff --git a/mcs/class/referencesource/System.Data.Linq/Types.cs b/mcs/class/referencesource/System.Data.Linq/Types.cs
index c6d89a01061..d132e20d55e 100644
--- a/mcs/class/referencesource/System.Data.Linq/Types.cs
+++ b/mcs/class/referencesource/System.Data.Linq/Types.cs
@@ -17,7 +17,7 @@ namespace System.Data.Linq {
internal static readonly IEnumerable<T> Assigned = (IEnumerable<T>)new T[] { };
}
- [SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes", Justification = "[....]: Types are never compared to each other. When comparisons happen it is against the entities that are represented by these constructs.")]
+ [SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes", Justification = "Microsoft: Types are never compared to each other. When comparisons happen it is against the entities that are represented by these constructs.")]
public struct Link<T> {
T underlyingValue;
IEnumerable<T> source;
@@ -80,7 +80,7 @@ namespace System.Data.Linq {
}
}
- [SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes", Justification="[....]: Types are never compared to each other. When comparisons happen it is against the entities that are represented by these constructs.")]
+ [SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes", Justification="Microsoft: Types are never compared to each other. When comparisons happen it is against the entities that are represented by these constructs.")]
public struct EntityRef<TEntity>
where TEntity : class {
IEnumerable<TEntity> source;
@@ -146,7 +146,7 @@ namespace System.Data.Linq {
}
}
- [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification="[....]: Naming chosen to represent a different concept from a collection because it is delayed loaded.")]
+ [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification="Microsoft: Naming chosen to represent a different concept from a collection because it is delayed loaded.")]
public sealed class EntitySet<TEntity> : IList, IList<TEntity>, IListSource
where TEntity : class {
IEnumerable<TEntity> source;
@@ -213,7 +213,7 @@ namespace System.Data.Linq {
}
}
- [SuppressMessage("Microsoft.Naming", "CA1725:ParameterNamesShouldMatchBaseDeclaration", MessageId = "0#", Justification = "[....]: Naming the parameter entity makes it more discoverable because it is clear what type of data should be added to this collection.")]
+ [SuppressMessage("Microsoft.Naming", "CA1725:ParameterNamesShouldMatchBaseDeclaration", MessageId = "0#", Justification = "Microsoft: Naming the parameter entity makes it more discoverable because it is clear what type of data should be added to this collection.")]
public void Add(TEntity entity) {
if (entity == null) {
throw Error.ArgumentNull("entity");
@@ -279,7 +279,7 @@ namespace System.Data.Linq {
OnListChanged(ListChangedType.Reset, 0);
}
- [SuppressMessage("Microsoft.Naming", "CA1725:ParameterNamesShouldMatchBaseDeclaration", MessageId = "0#", Justification = "[....]: Naming the parameter entity makes it more discoverable because it is clear what type of data should be added to this collection.")]
+ [SuppressMessage("Microsoft.Naming", "CA1725:ParameterNamesShouldMatchBaseDeclaration", MessageId = "0#", Justification = "Microsoft: Naming the parameter entity makes it more discoverable because it is clear what type of data should be added to this collection.")]
public bool Contains(TEntity entity) {
return IndexOf(entity) >= 0;
}
@@ -311,13 +311,13 @@ namespace System.Data.Linq {
}
}
- [SuppressMessage("Microsoft.Naming", "CA1725:ParameterNamesShouldMatchBaseDeclaration", MessageId = "0#", Justification = "[....]: Naming the parameter entity makes it more discoverable because it is clear what type of data should be added to this collection.")]
+ [SuppressMessage("Microsoft.Naming", "CA1725:ParameterNamesShouldMatchBaseDeclaration", MessageId = "0#", Justification = "Microsoft: Naming the parameter entity makes it more discoverable because it is clear what type of data should be added to this collection.")]
public int IndexOf(TEntity entity) {
Load();
return entities.IndexOf(entity);
}
- [SuppressMessage("Microsoft.Naming", "CA1725:ParameterNamesShouldMatchBaseDeclaration", MessageId = "1#", Justification = "[....]: Naming the parameter entity makes it more discoverable because it is clear what type of data should be added to this collection.")]
+ [SuppressMessage("Microsoft.Naming", "CA1725:ParameterNamesShouldMatchBaseDeclaration", MessageId = "1#", Justification = "Microsoft: Naming the parameter entity makes it more discoverable because it is clear what type of data should be added to this collection.")]
public void Insert(int index, TEntity entity) {
Load();
if (index < 0 || index > Count)
@@ -406,7 +406,7 @@ namespace System.Data.Linq {
isModified = true;
}
- [SuppressMessage("Microsoft.Naming", "CA1725:ParameterNamesShouldMatchBaseDeclaration", MessageId = "0#", Justification = "[....]: Naming the parameter entity makes it more discoverable because it is clear what type of data should be added to this collection.")]
+ [SuppressMessage("Microsoft.Naming", "CA1725:ParameterNamesShouldMatchBaseDeclaration", MessageId = "0#", Justification = "Microsoft: Naming the parameter entity makes it more discoverable because it is clear what type of data should be added to this collection.")]
public bool Remove(TEntity entity) {
if (entity == null || entity == onRemoveEntity) return false;
CheckModify();
@@ -758,7 +758,7 @@ namespace System.Data.Linq {
}
}
- [SuppressMessage("Microsoft.Naming", "CA1724:TypeNamesShouldNotMatchNamespaces", Justification = "[....]: The name clearly describes function and the namespace is under a DLinq namespace which will make the distinction clear.")]
+ [SuppressMessage("Microsoft.Naming", "CA1724:TypeNamesShouldNotMatchNamespaces", Justification = "Microsoft: The name clearly describes function and the namespace is under a DLinq namespace which will make the distinction clear.")]
[DataContract]
[Serializable]
public sealed class Binary : IEquatable<Binary> {
diff --git a/mcs/class/referencesource/System.Data.Linq/misc/SecurityUtils.cs b/mcs/class/referencesource/System.Data.Linq/misc/SecurityUtils.cs
index e4a511ff143..7a86773c1a8 100644
--- a/mcs/class/referencesource/System.Data.Linq/misc/SecurityUtils.cs
+++ b/mcs/class/referencesource/System.Data.Linq/misc/SecurityUtils.cs
@@ -8,11 +8,11 @@
*/
-#if WINFORMS_NAMESPACE
+#if Microsoft_NAMESPACE
namespace System.Windows.Forms
#elif DRAWING_NAMESPACE
namespace System.Drawing
-#elif WINFORMS_PUBLIC_GRAPHICS_LIBRARY
+#elif Microsoft_PUBLIC_GRAPHICS_LIBRARY
namespace System.Internal
#elif SYSTEM_NAMESPACE
namespace System
@@ -137,7 +137,7 @@ namespace System.Windows.Forms
return Activator.CreateInstance(type, flags, null, args, null);
}
-#if (!WINFORMS_NAMESPACE)
+#if (!Microsoft_NAMESPACE)
/// <devdoc>
/// This helper method provides safe access to Activator.CreateInstance.
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/GenerateHelper.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/GenerateHelper.cs
index 6490ddfb9d5..39335876220 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/GenerateHelper.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/GenerateHelper.cs
@@ -2,7 +2,7 @@
// <copyright file="GenerateHelper.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Globalization;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/IteratorDescriptor.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/IteratorDescriptor.cs
index c99ee63ec1a..3f284be5aa5 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/IteratorDescriptor.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/IteratorDescriptor.cs
@@ -2,7 +2,7 @@
// <copyright file="IteratorDescriptor.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/OptimizerPatterns.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/OptimizerPatterns.cs
index 85589508b48..064edcd7546 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/OptimizerPatterns.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/OptimizerPatterns.cs
@@ -2,7 +2,7 @@
// <copyright file="OptimizerPatterns.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/StaticDataManager.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/StaticDataManager.cs
index 366f26d8d41..c04cebf1e9c 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/StaticDataManager.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/StaticDataManager.cs
@@ -2,8 +2,8 @@
// <copyright file="StaticDataManager.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/TailCallAnalyzer.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/TailCallAnalyzer.cs
index 343293ebbea..86ab9c3a27a 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/TailCallAnalyzer.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/TailCallAnalyzer.cs
@@ -2,7 +2,7 @@
// <copyright file="TailCallAnalyzer.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlILAnnotation.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlILAnnotation.cs
index d029da0d72d..5c339d4f0ed 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlILAnnotation.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlILAnnotation.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlILAnnotation.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlILConstructAnalyzer.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlILConstructAnalyzer.cs
index c2c530141d0..26daac8b9ab 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlILConstructAnalyzer.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlILConstructAnalyzer.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlILConstructAnalyzer.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Xml;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlILModule.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlILModule.cs
index 2df1e23e2ee..e47912e447c 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlILModule.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlILModule.cs
@@ -2,8 +2,8 @@
// <copyright file="XmlILModule.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlILOptimizerVisitor.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlILOptimizerVisitor.cs
index f671178fc0c..8216171736a 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlILOptimizerVisitor.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlILOptimizerVisitor.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlILOptimizerVisitor.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlIlTypeHelper.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlIlTypeHelper.cs
index 90b2c09d0b6..3bb04f749cf 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlIlTypeHelper.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlIlTypeHelper.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlIlTypeHelper.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlIlVisitor.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlIlVisitor.cs
index 786be8983fc..f33d6a9c58c 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlIlVisitor.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlIlVisitor.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlIlVisitor.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Xml;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/ListBase.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/ListBase.cs
index dbabda6f904..9e9364891bb 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/ListBase.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/ListBase.cs
@@ -2,7 +2,7 @@
// <copyright file="ListBase.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Xml;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Pair.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Pair.cs
index 4cc21c06adb..46a8ad5e5aa 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Pair.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Pair.cs
@@ -2,7 +2,7 @@
// <copyright file="Pair.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilBinary.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilBinary.cs
index 1121c090b9d..c1982324c23 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilBinary.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilBinary.cs
@@ -2,7 +2,7 @@
// <copyright file="QilBinary.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilChoice.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilChoice.cs
index b9645a0c167..25139afcd5f 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilChoice.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilChoice.cs
@@ -2,7 +2,7 @@
// <copyright file="QilLoop.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilCloneVisitor.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilCloneVisitor.cs
index 12da6caa44b..540ef9b57fa 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilCloneVisitor.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilCloneVisitor.cs
@@ -2,7 +2,7 @@
// <copyright file="QilCloneVisitor.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilDataSource.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilDataSource.cs
index 49f29d1d4b6..ae4964e2c4a 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilDataSource.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilDataSource.cs
@@ -2,7 +2,7 @@
// <copyright file="QilDataSource.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilExpression.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilExpression.cs
index f2050d46d5e..08aacbff040 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilExpression.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilExpression.cs
@@ -2,7 +2,7 @@
// <copyright file="QilExpression.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilFactory.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilFactory.cs
index 743ae9829e1..8d941c65971 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilFactory.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilFactory.cs
@@ -2,7 +2,7 @@
// <copyright file="QilFactory.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilFunction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilFunction.cs
index c08b149dc3f..6cbfabcc8ef 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilFunction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilFunction.cs
@@ -2,7 +2,7 @@
// <copyright file="QilFunction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilInvoke.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilInvoke.cs
index a99d6b5ed13..4d8970b40c5 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilInvoke.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilInvoke.cs
@@ -2,7 +2,7 @@
// <copyright file="QilInvoke.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilInvokeEarlyBound.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilInvokeEarlyBound.cs
index 4acb8d3e594..4a880719157 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilInvokeEarlyBound.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilInvokeEarlyBound.cs
@@ -2,7 +2,7 @@
// <copyright file="QilInvokeEarlyBound.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilInvokeLateBound.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilInvokeLateBound.cs
index 57ffa618967..33b9dd55c47 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilInvokeLateBound.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilInvokeLateBound.cs
@@ -2,7 +2,7 @@
// <copyright file="QilInvokeLateBound.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilIterator.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilIterator.cs
index 04e1cdb890f..51eafb5339a 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilIterator.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilIterator.cs
@@ -2,7 +2,7 @@
// <copyright file="QilIterator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilList.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilList.cs
index 8ac1d26c989..63f8858680b 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilList.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilList.cs
@@ -2,7 +2,7 @@
// <copyright file="QilList.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilLiteral.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilLiteral.cs
index b20c678d8a3..ac2480a4a29 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilLiteral.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilLiteral.cs
@@ -2,7 +2,7 @@
// <copyright file="QilLiteral.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilLoop.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilLoop.cs
index 73702017f5e..aeb4e0274a9 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilLoop.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilLoop.cs
@@ -2,7 +2,7 @@
// <copyright file="QilLoop.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilName.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilName.cs
index 1558795a5ed..7387507ce8f 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilName.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilName.cs
@@ -2,7 +2,7 @@
// <copyright file="QilName.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilNode.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilNode.cs
index 40201b07105..6eefb53f22a 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilNode.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilNode.cs
@@ -2,7 +2,7 @@
// <copyright file="QilNode.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilParameter.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilParameter.cs
index 357800ea0cb..3fdcf6c0225 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilParameter.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilParameter.cs
@@ -2,7 +2,7 @@
// <copyright file="QilParameter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilPatternFactory.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilPatternFactory.cs
index 5798d4c337b..28cdbe3359d 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilPatternFactory.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilPatternFactory.cs
@@ -2,7 +2,7 @@
// <copyright file="QilPatternFactory.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilPatternVisitor.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilPatternVisitor.cs
index 4b86398a2bc..bdd237a488d 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilPatternVisitor.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilPatternVisitor.cs
@@ -2,7 +2,7 @@
// <copyright file="QilPatternVisitor.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilReference.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilReference.cs
index bf28cf11f9f..f06089201a6 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilReference.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilReference.cs
@@ -2,7 +2,7 @@
// <copyright file="QilReference.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilReplaceVisitor.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilReplaceVisitor.cs
index e335154607b..3c422a89197 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilReplaceVisitor.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilReplaceVisitor.cs
@@ -2,7 +2,7 @@
// <copyright file="QilReplaceVisitor.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilScopedVisitor.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilScopedVisitor.cs
index a3bcfd59df9..556a6d33127 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilScopedVisitor.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilScopedVisitor.cs
@@ -2,7 +2,7 @@
// <copyright file="QilScopedVisitor.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilSortKey.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilSortKey.cs
index a7d76b24256..c4b8b9211b9 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilSortKey.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilSortKey.cs
@@ -2,7 +2,7 @@
// <copyright file="QilSortKey.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilStrConcat.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilStrConcat.cs
index 011075c452d..17395597416 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilStrConcat.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilStrConcat.cs
@@ -2,7 +2,7 @@
// <copyright file="QilStrConcat.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilTargetType.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilTargetType.cs
index ae27ad547ca..de1bcc1e61a 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilTargetType.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilTargetType.cs
@@ -2,7 +2,7 @@
// <copyright file="QilTargetType.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilTernary.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilTernary.cs
index 317891a507e..493f12eaf9f 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilTernary.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilTernary.cs
@@ -2,7 +2,7 @@
// <copyright file="QilTernary.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilTypeChecker.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilTypeChecker.cs
index 850c4c8d8ad..0d10556e9a9 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilTypeChecker.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilTypeChecker.cs
@@ -2,7 +2,7 @@
// <copyright file="QilTypeChecker.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilUnary.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilUnary.cs
index 4980715effa..4d1fbed67ae 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilUnary.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilUnary.cs
@@ -2,7 +2,7 @@
// <copyright file="QilUnary.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilValidationVisitor.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilValidationVisitor.cs
index 678bf547f28..9ebe9a2dca2 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilValidationVisitor.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilValidationVisitor.cs
@@ -2,7 +2,7 @@
// <copyright file="QilValidationVisitor.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilVisitor.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilVisitor.cs
index ce86057f349..5e5b5543e02 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilVisitor.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilVisitor.cs
@@ -2,7 +2,7 @@
// <copyright file="QilVisitor.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilXmlReader.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilXmlReader.cs
index 5a53a3e95f4..eebd0d843f5 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilXmlReader.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilXmlReader.cs
@@ -2,7 +2,7 @@
// <copyright file="QilXmlReader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilXmlWriter.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilXmlWriter.cs
index 83253ea5a44..e53c663f9b6 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilXmlWriter.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilXmlWriter.cs
@@ -2,7 +2,7 @@
// <copyright file="QilXmlWriter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/SubstitutionList.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/SubstitutionList.cs
index 223e5fbafc4..32868e6a185 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/SubstitutionList.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/SubstitutionList.cs
@@ -2,7 +2,7 @@
// <copyright file="SubstitutionList.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/WhitespaceRule.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/WhitespaceRule.cs
index ca7ed1811dd..914f12963d3 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/WhitespaceRule.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/WhitespaceRule.cs
@@ -2,8 +2,8 @@
// <copyright file="WhitespaceRule.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QueryReaderSettings.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QueryReaderSettings.cs
index d8ed8752b98..26cd3fc5d16 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QueryReaderSettings.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/QueryReaderSettings.cs
@@ -2,7 +2,7 @@
// <copyright file="QueryReaderSettings.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/ContentIterators.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/ContentIterators.cs
index e13600336e4..02b7678ee77 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/ContentIterators.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/ContentIterators.cs
@@ -2,7 +2,7 @@
// <copyright file="ContentIterators.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Xml;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/DecimalFormatter.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/DecimalFormatter.cs
index 0662261d144..43f6ee62986 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/DecimalFormatter.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/DecimalFormatter.cs
@@ -2,7 +2,7 @@
// <copyright file="DecimalFormatter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/DocumentOrderComparer.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/DocumentOrderComparer.cs
index 07abd470b52..0d074a55dff 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/DocumentOrderComparer.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/DocumentOrderComparer.cs
@@ -2,7 +2,7 @@
// <copyright file="DocumentOrderComparer.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/DodSequenceMerge.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/DodSequenceMerge.cs
index 39928a7b450..89d23000546 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/DodSequenceMerge.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/DodSequenceMerge.cs
@@ -2,7 +2,7 @@
// <copyright file="DodSequenceMerge.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/EarlyBoundInfo.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/EarlyBoundInfo.cs
index e6e31f979fe..790cf997728 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/EarlyBoundInfo.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/EarlyBoundInfo.cs
@@ -2,8 +2,8 @@
// <copyright file="EarlyBoundInfo.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/NumberFormatter.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/NumberFormatter.cs
index 2aef5b0dad1..500a168de43 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/NumberFormatter.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/NumberFormatter.cs
@@ -2,7 +2,7 @@
// <copyright file="NumberFormatter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/RtfNavigator.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/RtfNavigator.cs
index f31249e1657..42e3c1960c3 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/RtfNavigator.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/RtfNavigator.cs
@@ -2,7 +2,7 @@
// <copyright file="RtfNavigator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Threading;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/SetIterators.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/SetIterators.cs
index 62a4e859263..dbf8c20c85d 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/SetIterators.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/SetIterators.cs
@@ -2,7 +2,7 @@
// <copyright file="SetIterators.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Xml;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/SiblingIterators.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/SiblingIterators.cs
index d48459e9edf..06c38ce39e5 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/SiblingIterators.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/SiblingIterators.cs
@@ -2,7 +2,7 @@
// <copyright file="SiblingIterators.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Xml;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/StringConcat.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/StringConcat.cs
index 6b41ec7c66c..b20f293db23 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/StringConcat.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/StringConcat.cs
@@ -2,7 +2,7 @@
// <copyright file="StringConcat.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/TreeIterators.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/TreeIterators.cs
index a3cdf490311..05afae41b5d 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/TreeIterators.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/TreeIterators.cs
@@ -2,7 +2,7 @@
// <copyright file="TreeIterators.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.ComponentModel;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/WhitespaceRuleLookup.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/WhitespaceRuleLookup.cs
index 3aa9ab53505..5a7dea1a30a 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/WhitespaceRuleLookup.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/WhitespaceRuleLookup.cs
@@ -2,7 +2,7 @@
// <copyright file="WhitespaceRuleLookup.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Xml;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/WhitespaceRuleReader.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/WhitespaceRuleReader.cs
index 4668e15222d..17207a41823 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/WhitespaceRuleReader.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/WhitespaceRuleReader.cs
@@ -2,7 +2,7 @@
// <copyright file="WhitespaceRuleReader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.IO;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlAggregates.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlAggregates.cs
index 902ffdf86e3..7c4d0394b17 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlAggregates.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlAggregates.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlAggregates.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Xml;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlAttributeCache.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlAttributeCache.cs
index 6f39cb3e4de..c35eb8fc2fa 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlAttributeCache.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlAttributeCache.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlAttributeCache.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.Runtime {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlCollation.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlCollation.cs
index 956c2a654bf..e06f6d90279 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlCollation.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlCollation.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlCollation.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlExtensionFunction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlExtensionFunction.cs
index d51ded1fa47..0425c8e83bb 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlExtensionFunction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlExtensionFunction.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlExtensionFunction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlILIndex.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlILIndex.cs
index f0390457323..679637e171f 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlILIndex.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlILIndex.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlILIndex.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlILStorageConverter.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlILStorageConverter.cs
index 222ec5c0506..ad7f029edc7 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlILStorageConverter.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlILStorageConverter.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlILStorageConverter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlIterators.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlIterators.cs
index 24e3a96a89c..d5f189c21d7 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlIterators.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlIterators.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlIterators.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Xml;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlNavigatorFilter.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlNavigatorFilter.cs
index 6b8eb8264cb..2e91ddc8a3b 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlNavigatorFilter.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlNavigatorFilter.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlNavigatorFilter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Xml;
using System.Xml.XPath;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlNavigatorStack.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlNavigatorStack.cs
index 214b75582de..ab5d5cdc8b4 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlNavigatorStack.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlNavigatorStack.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlNavigatorStack.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Xml;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlQueryContext.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlQueryContext.cs
index ca621b66b06..644bfa8c254 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlQueryContext.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlQueryContext.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlQueryContext.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlQueryOutput.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlQueryOutput.cs
index 6fd3ce9e508..275b9e2bc7c 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlQueryOutput.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlQueryOutput.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlQueryOutput.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
using System.ComponentModel;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlQueryRuntime.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlQueryRuntime.cs
index 782a2e12caa..15d5db990d9 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlQueryRuntime.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlQueryRuntime.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlQueryRuntime.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.IO;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlQuerySequence.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlQuerySequence.cs
index 2c01291b697..727040cd6b0 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlQuerySequence.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlQuerySequence.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlQuerySequence.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlQueryStaticData.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlQueryStaticData.cs
index b3bae005fa0..7ca2d40b9f9 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlQueryStaticData.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlQueryStaticData.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlQueryStaticData.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlRawWriterWrapper.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlRawWriterWrapper.cs
index c8766cfd044..f08e0effed0 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlRawWriterWrapper.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlRawWriterWrapper.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlRawWriterWrapper.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.IO;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlSequenceWriter.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlSequenceWriter.cs
index f5538b75e47..1b974e927d7 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlSequenceWriter.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlSequenceWriter.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSequenceWriter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlSortKey.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlSortKey.cs
index 772ffd6b440..793d287c5aa 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlSortKey.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlSortKey.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSortKey.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlSortKeyAccumulator.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlSortKeyAccumulator.cs
index 3516c67242c..d1f241b3a8e 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlSortKeyAccumulator.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XmlSortKeyAccumulator.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSortKeyAccumulator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XslNumber.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XslNumber.cs
index 343dd36d75f..631232ac84a 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XslNumber.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XslNumber.cs
@@ -2,7 +2,7 @@
// <copyright file="XslNumber.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XsltConvert.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XsltConvert.cs
index 885ccaca9f7..93752e860db 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XsltConvert.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XsltConvert.cs
@@ -2,7 +2,7 @@
// <copyright file="XsltConvert.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XsltFunctions.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XsltFunctions.cs
index 3459ae30e46..dedefabe745 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XsltFunctions.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XsltFunctions.cs
@@ -2,7 +2,7 @@
// <copyright file="XsltFunctions.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.IO;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XsltLibrary.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XsltLibrary.cs
index 6f9b8236b0e..0f148d6ee32 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XsltLibrary.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XsltLibrary.cs
@@ -2,7 +2,7 @@
// <copyright file="XsltLibrary.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Specialized;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/SourceLineInfo.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/SourceLineInfo.cs
index 0e665909055..46f24679de5 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/SourceLineInfo.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/SourceLineInfo.cs
@@ -2,7 +2,7 @@
// <copyright file="SourceLineInfo.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathBuilder.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathBuilder.cs
index b2ef65f8cc8..6a4814e2dc4 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathBuilder.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathBuilder.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathBuilder.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathCompileException.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathCompileException.cs
index 570a32cf4e5..81e25627a1e 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathCompileException.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathCompileException.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathCompileException.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Runtime.Serialization;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathParser.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathParser.cs
index 5167754890a..7b6b554295d 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathParser.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathParser.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathParser.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathQilFactory.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathQilFactory.cs
index 6afc15b2f28..1bfc274411e 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathQilFactory.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathQilFactory.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathQilFactory.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathScanner.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathScanner.cs
index 996dbaa4e10..11f966e07f3 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathScanner.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathScanner.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathScanner.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <spec>http://www.w3.org/TR/xpath#exprlex</spec>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPathConvert.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPathConvert.cs
index 3da62858024..e3ebb5fadd0 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPathConvert.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPathConvert.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathConvert.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
/**
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlILCommand.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlILCommand.cs
index 684b75fea5b..f0117615d41 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlILCommand.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlILCommand.cs
@@ -2,8 +2,8 @@
// <copyright file="XmlILCommand.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="false">Microsoft</owner>
// <spec>http://webdata/xml/specs/querylowlevel.xml</spec>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlIlGenerator.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlIlGenerator.cs
index 4075e22a22c..5952f556bee 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlIlGenerator.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlIlGenerator.cs
@@ -2,8 +2,8 @@
// <copyright file="XmlIlGenerator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlQualifiedNameTest.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlQualifiedNameTest.cs
index 394d5273ae6..d82d7ad7162 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlQualifiedNameTest.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlQualifiedNameTest.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlQualifiedNameTest.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlQueryCardinality.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlQueryCardinality.cs
index 7c655463061..c8131e706a1 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlQueryCardinality.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlQueryCardinality.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlQueryCardinality.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlQueryType.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlQueryType.cs
index 4e7c0eb7447..84692be81c7 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlQueryType.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlQueryType.cs
@@ -2,8 +2,8 @@
// <copyright file="XmlQueryType.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlQueryTypeFactory.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlQueryTypeFactory.cs
index 14cd425cb06..2548bb2d53f 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlQueryTypeFactory.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlQueryTypeFactory.cs
@@ -2,8 +2,8 @@
// <copyright file="XmlQueryTypeFactory.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XslException.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XslException.cs
index e0016a461ab..d76797354b6 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XslException.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XslException.cs
@@ -2,7 +2,7 @@
// <copyright file="XslException.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.CodeDom.Compiler;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/Compiler.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/Compiler.cs
index 624f7b9d05d..68fb7af2a60 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/Compiler.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/Compiler.cs
@@ -2,7 +2,7 @@
// <copyright file="Compiler.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.CodeDom.Compiler;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/CompilerScopeManager.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/CompilerScopeManager.cs
index c8bd252ef5e..4704df6db04 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/CompilerScopeManager.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/CompilerScopeManager.cs
@@ -2,7 +2,7 @@
// <copyright file="CompilerScopeManager.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/Focus.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/Focus.cs
index d93962dbb7e..a110803de28 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/Focus.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/Focus.cs
@@ -2,7 +2,7 @@
// <copyright file="Focus.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/InvokeGenerator.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/InvokeGenerator.cs
index 0f82b468ebc..a323e01e8d8 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/InvokeGenerator.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/InvokeGenerator.cs
@@ -2,7 +2,7 @@
// <copyright file="InvokeGenerator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/KeyMatchBuilder.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/KeyMatchBuilder.cs
index 404e153aec1..4417d0be015 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/KeyMatchBuilder.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/KeyMatchBuilder.cs
@@ -2,7 +2,7 @@
// <copyright file="KeyMatchBuilder.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/Keywords.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/Keywords.cs
index 66d1532a191..0ab7f5dcd0c 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/Keywords.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/Keywords.cs
@@ -2,7 +2,7 @@
// <copyright file="Keywords.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Xml;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/MatcherBuilder.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/MatcherBuilder.cs
index 70f110b6f57..22715a24743 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/MatcherBuilder.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/MatcherBuilder.cs
@@ -2,7 +2,7 @@
// <copyright file="MatcherBuilder.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/OutputScopeManager.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/OutputScopeManager.cs
index 4bdfe9285a9..07506f55861 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/OutputScopeManager.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/OutputScopeManager.cs
@@ -2,7 +2,7 @@
// <copyright file="OutputScopeManager.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/QilGenerator.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/QilGenerator.cs
index d29bc0ca3bf..f73f9ab588b 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/QilGenerator.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/QilGenerator.cs
@@ -2,7 +2,7 @@
// <copyright file="QilGenerator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <spec>http://www.w3.org/TR/xslt.html</spec>
// <spec>http://www.w3.org/TR/xslt20/</spec>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/QilGeneratorEnv.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/QilGeneratorEnv.cs
index 7f0d17f22ed..2f606d8cfbb 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/QilGeneratorEnv.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/QilGeneratorEnv.cs
@@ -2,7 +2,7 @@
// <copyright file="QilGeneratorEnv.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/QilStrConcatenator.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/QilStrConcatenator.cs
index ba2c0dc228c..fe1f4dd3108 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/QilStrConcatenator.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/QilStrConcatenator.cs
@@ -2,7 +2,7 @@
// <copyright file="QilStrConcatenator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Diagnostics;
using System.Xml;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/Scripts.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/Scripts.cs
index 45359ba4bf3..e1f52082528 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/Scripts.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/Scripts.cs
@@ -2,7 +2,7 @@
// <copyright file="Scripts.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <spec>http://devdiv/Documents/Whidbey/CLR/CurrentSpecs/BCL/CodeDom%20Activation.doc</spec>
//------------------------------------------------------------------------------
@@ -305,7 +305,7 @@ namespace System.Xml.Xsl.Xslt {
// If GenerateInMemory == true, then CodeDom loads the compiled assembly using Assembly.Load(byte[])
// instead of Assembly.Load(AssemblyName). That means the assembly will be loaded in the anonymous
- // context (http://blogs.msdn.com/[....]/archive/2003/05/29/57143.aspx), and its dependencies can only
+ // context (http://blogs.msdn.com/Microsoft/archive/2003/05/29/57143.aspx), and its dependencies can only
// be loaded from the Load context or using AssemblyResolve event. However we want to use the LoadFrom
// context to preload all dependencies specified by <ms:assembly href="uri-reference"/>, so we turn off
// GenerateInMemory here.
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/Stylesheet.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/Stylesheet.cs
index d2b5a731c8d..96f094bd769 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/Stylesheet.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/Stylesheet.cs
@@ -2,7 +2,7 @@
// <copyright file="Stylesheet.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XPathPatternBuilder.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XPathPatternBuilder.cs
index 8143836c495..efad6709d85 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XPathPatternBuilder.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XPathPatternBuilder.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathPatternBuilder.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XPathPatternParser.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XPathPatternParser.cs
index ad786e07fa4..4a88b7656cd 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XPathPatternParser.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XPathPatternParser.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathPatternParser.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XslAst.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XslAst.cs
index 758047ceff6..b1dc09df06e 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XslAst.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XslAst.cs
@@ -2,7 +2,7 @@
// <copyright file="XslAst.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Text;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XslAstAnalyzer.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XslAstAnalyzer.cs
index e94a5891aae..87f96419f90 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XslAstAnalyzer.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XslAstAnalyzer.cs
@@ -2,7 +2,7 @@
// <copyright file="XslAstAnalyzer.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Globalization;
@@ -668,7 +668,7 @@ namespace System.Xml.Xsl.Xslt {
if (node.Select != null) {
if (node.Content.Count != 0) {
// In case of incorrect stylesheet, variable or parameter may have both a 'select' attribute and non-empty content
- // NOTE: This code must be in [....] with recovery logic in QilGenerator
+ // NOTE: This code must be in sync with recovery logic in QilGenerator
result = xpathAnalyzer.Analyze(node.Select) | VisitChildren(node) | XslFlags.AnyType;
typeDonor = null;
} else {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XslVisitor.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XslVisitor.cs
index 5311a8321ad..28c95f3a31d 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XslVisitor.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XslVisitor.cs
@@ -2,7 +2,7 @@
// <copyright file="XslVisitor.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.Xslt {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XsltInput.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XsltInput.cs
index 93128517418..b50961a4378 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XsltInput.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XsltInput.cs
@@ -2,7 +2,7 @@
// <copyright file="XsltInput.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
//#define XSLT2
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XsltLoader.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XsltLoader.cs
index 1bf0ee63a83..c2037e36f1d 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XsltLoader.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XsltLoader.cs
@@ -2,7 +2,7 @@
// <copyright file="XsltLoader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
//#define XSLT2
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XsltQilFactory.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XsltQilFactory.cs
index 4fcca15bf41..78e9e6db9e2 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XsltQilFactory.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XsltQilFactory.cs
@@ -2,7 +2,7 @@
// <copyright file="XsltQilFactory.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Action.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Action.cs
index ead808b5fb2..31c38905c80 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Action.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Action.cs
@@ -2,7 +2,7 @@
// <copyright file="Action.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ActionFrame.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ActionFrame.cs
index 21f5fb062ed..d76ef099667 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ActionFrame.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ActionFrame.cs
@@ -2,7 +2,7 @@
// <copyright file="ActionFrame.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ApplyImportsAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ApplyImportsAction.cs
index fada5fa3053..db9430ed1a0 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ApplyImportsAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ApplyImportsAction.cs
@@ -2,7 +2,7 @@
// <copyright file="ApplyImportsAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ApplyTemplatesAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ApplyTemplatesAction.cs
index a81dd223fd6..0cecb4220cd 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ApplyTemplatesAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ApplyTemplatesAction.cs
@@ -2,7 +2,7 @@
// <copyright file="ApplyTemplatesAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/AttributeAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/AttributeAction.cs
index f85ccb33348..c26a03b4428 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/AttributeAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/AttributeAction.cs
@@ -2,7 +2,7 @@
// <copyright file="AttributeAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/AttributeSetAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/AttributeSetAction.cs
index c227f0287a8..ede0aef7509 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/AttributeSetAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/AttributeSetAction.cs
@@ -2,7 +2,7 @@
// <copyright file="AttributeSetAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Avt.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Avt.cs
index 6b2cdcac86f..282c31f4b24 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Avt.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Avt.cs
@@ -2,7 +2,7 @@
// <copyright file="Avt.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/AvtEvent.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/AvtEvent.cs
index f88243fafc1..687eaad3e6e 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/AvtEvent.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/AvtEvent.cs
@@ -2,7 +2,7 @@
// <copyright file="AvtEvent.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/BeginEvent.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/BeginEvent.cs
index 2cf53f05f8e..95ca244b9a9 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/BeginEvent.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/BeginEvent.cs
@@ -2,7 +2,7 @@
// <copyright file="BeginEvent.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/BuilderInfo.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/BuilderInfo.cs
index 20886ec8cbd..3f0644ff70d 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/BuilderInfo.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/BuilderInfo.cs
@@ -2,7 +2,7 @@
// <copyright file="BuilderInfo.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CallTemplateAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CallTemplateAction.cs
index b21604d00c6..70354f28d14 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CallTemplateAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CallTemplateAction.cs
@@ -2,7 +2,7 @@
// <copyright file="CallTemplateAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ChooseAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ChooseAction.cs
index 0bc97075869..85cc21906ab 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ChooseAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ChooseAction.cs
@@ -2,7 +2,7 @@
// <copyright file="ChooseAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CommentAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CommentAction.cs
index 32dabbf8bc9..67c7503bf01 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CommentAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CommentAction.cs
@@ -2,7 +2,7 @@
// <copyright file="CommentAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CompiledAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CompiledAction.cs
index 51ae00815e3..c6476fe6054 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CompiledAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CompiledAction.cs
@@ -2,7 +2,7 @@
// <copyright file="CompiledAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Compiler.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Compiler.cs
index a7b486debff..ddca70f8c51 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Compiler.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Compiler.cs
@@ -2,7 +2,7 @@
// <copyright file="Compiler.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ContainerAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ContainerAction.cs
index 35fb38f4b13..52af349a134 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ContainerAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ContainerAction.cs
@@ -2,7 +2,7 @@
// <copyright file="ContainerAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyAction.cs
index 12f1ed03fef..cb7d325be0e 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyAction.cs
@@ -2,7 +2,7 @@
// <copyright file="CopyAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyAttributesAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyAttributesAction.cs
index 47f8d3cd614..ed717e944f0 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyAttributesAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyAttributesAction.cs
@@ -2,7 +2,7 @@
// <copyright file="CopyAttributesAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyCodeAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyCodeAction.cs
index 073e16956f0..b46cf13ded3 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyCodeAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyCodeAction.cs
@@ -2,7 +2,7 @@
// <copyright file="CopyCodeAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyNamespacesAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyNamespacesAction.cs
index b3e3e34abfe..cebaadebf1c 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyNamespacesAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyNamespacesAction.cs
@@ -2,7 +2,7 @@
// <copyright file="CopyNamespacesAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyNodesetAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyNodesetAction.cs
index 3d9a487a570..4c7457f01b2 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyNodesetAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyNodesetAction.cs
@@ -2,7 +2,7 @@
// <copyright file="CopyNodeSetAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyOfAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyOfAction.cs
index 5207f98bda8..ed5e721af24 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyOfAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/CopyOfAction.cs
@@ -2,7 +2,7 @@
// <copyright file="CopyOfAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/DbgCompiler.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/DbgCompiler.cs
index 8190e5578fc..c39c6d2b7fd 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/DbgCompiler.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/DbgCompiler.cs
@@ -2,7 +2,7 @@
// <copyright file="DbgCompiler.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/DocumentScope.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/DocumentScope.cs
index 61089758161..8a47aa8262a 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/DocumentScope.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/DocumentScope.cs
@@ -2,7 +2,7 @@
// <copyright file="DocumentScope.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ElementAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ElementAction.cs
index 0df55f379b7..26ff1bc9f48 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ElementAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ElementAction.cs
@@ -2,7 +2,7 @@
// <copyright file="ElementAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/EndEvent.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/EndEvent.cs
index 266f2177a6b..70f1c8d33ad 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/EndEvent.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/EndEvent.cs
@@ -2,7 +2,7 @@
// <copyright file="EndEvent.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Event.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Event.cs
index d97f6440d87..62b638fe044 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Event.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Event.cs
@@ -2,7 +2,7 @@
// <copyright file="Event.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ForeachAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ForeachAction.cs
index a932cab372f..bc12dbe72df 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ForeachAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ForeachAction.cs
@@ -2,7 +2,7 @@
// <copyright file="ForEachAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/HtmlProps.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/HtmlProps.cs
index 81eac3d356e..e60a2f88030 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/HtmlProps.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/HtmlProps.cs
@@ -2,7 +2,7 @@
// <copyright file="HtmlProps.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/IfAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/IfAction.cs
index c224c066157..71001f3a275 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/IfAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/IfAction.cs
@@ -2,7 +2,7 @@
// <copyright file="IfAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/InputScope.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/InputScope.cs
index 39236053db8..66b85807e71 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/InputScope.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/InputScope.cs
@@ -2,7 +2,7 @@
// <copyright file="InputScope.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/InputScopeManager.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/InputScopeManager.cs
index b1c1afae2b8..2cbbdc32fa0 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/InputScopeManager.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/InputScopeManager.cs
@@ -2,7 +2,7 @@
// <copyright file="InputScopeManager.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/MessageAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/MessageAction.cs
index e2807e7fba5..d8da70f8c54 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/MessageAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/MessageAction.cs
@@ -2,7 +2,7 @@
// <copyright file="MessageAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NamespaceDecl.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NamespaceDecl.cs
index 71dab6766c1..9329cbfef20 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NamespaceDecl.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NamespaceDecl.cs
@@ -2,7 +2,7 @@
// <copyright file="NamespaceDecl.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NamespaceEvent.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NamespaceEvent.cs
index 1420c525b73..eeeeb6faf26 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NamespaceEvent.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NamespaceEvent.cs
@@ -2,7 +2,7 @@
// <copyright file="NameSpaceEvent.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NavigatorInput.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NavigatorInput.cs
index 563aaf5f2b0..ce6688e4d1d 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NavigatorInput.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NavigatorInput.cs
@@ -2,7 +2,7 @@
// <copyright file="NavigatorInput.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NavigatorOutput.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NavigatorOutput.cs
index d722905f142..f29c63dd60d 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NavigatorOutput.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NavigatorOutput.cs
@@ -2,7 +2,7 @@
// <copyright file="NavigatorOutput.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NewInstructionAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NewInstructionAction.cs
index 5f84c647b8f..53769e70676 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NewInstructionAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NewInstructionAction.cs
@@ -2,7 +2,7 @@
// <copyright file="newinstructionaction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NumberAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NumberAction.cs
index 553b74574bd..85038e93bad 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NumberAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/NumberAction.cs
@@ -2,7 +2,7 @@
// <copyright file="NumberAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
@@ -417,7 +417,7 @@ namespace System.Xml.Xsl.XsltOld {
}
}
- // [....]: perf.
+ // Microsoft: perf.
// for each call to xsl:number Format() will build new NumberingFormat object.
// in case of no AVTs we can build this object at compile time and reuse it on execution time.
// even partial step in this d---- will be usefull (when cFormats == 0)
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/OutKeywords.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/OutKeywords.cs
index dadea9c702d..266ce00384f 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/OutKeywords.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/OutKeywords.cs
@@ -2,7 +2,7 @@
// <copyright file="OutKeywords.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/OutputScope.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/OutputScope.cs
index 7de7e8bfb0c..e27e57e040a 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/OutputScope.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/OutputScope.cs
@@ -2,7 +2,7 @@
// <copyright file="OutputScope.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/OutputScopeManager.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/OutputScopeManager.cs
index dfefae8392d..a5e15260349 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/OutputScopeManager.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/OutputScopeManager.cs
@@ -2,7 +2,7 @@
// <copyright file="OutputScopeManager.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/PrefixQname.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/PrefixQname.cs
index 062f765e955..ed1beb49ea4 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/PrefixQname.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/PrefixQname.cs
@@ -2,7 +2,7 @@
// <copyright file="PrefixQName.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ProcessingInstructionAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ProcessingInstructionAction.cs
index 40a5ae886ba..4bcf3d01a10 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ProcessingInstructionAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ProcessingInstructionAction.cs
@@ -2,7 +2,7 @@
// <copyright file="ProcessingInstructionAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Processor.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Processor.cs
index 740dc7db76c..9a86ec723bd 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Processor.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Processor.cs
@@ -2,7 +2,7 @@
// <copyright file="Processor.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ReaderOutput.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ReaderOutput.cs
index b8f45d089fa..4829e224ddc 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ReaderOutput.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ReaderOutput.cs
@@ -2,7 +2,7 @@
// <copyright file="ReaderOutput.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/RecordBuilder.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/RecordBuilder.cs
index 1ca00932541..ff1e8bb6845 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/RecordBuilder.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/RecordBuilder.cs
@@ -2,7 +2,7 @@
// <copyright file="RecordBuilder.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/RootAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/RootAction.cs
index f1fc2fcf3d7..72cc4990b29 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/RootAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/RootAction.cs
@@ -2,7 +2,7 @@
// <copyright file="RootAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/SequentialOutput.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/SequentialOutput.cs
index 1f376524722..11ada9cad93 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/SequentialOutput.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/SequentialOutput.cs
@@ -2,7 +2,7 @@
// <copyright file="SequentialOutput.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/SortAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/SortAction.cs
index 7eac8559c3d..deebec1923b 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/SortAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/SortAction.cs
@@ -2,7 +2,7 @@
// <copyright file="SortAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/StateMachine.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/StateMachine.cs
index bf0e413c9dc..a8c602bb256 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/StateMachine.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/StateMachine.cs
@@ -2,7 +2,7 @@
// <copyright file="StateMachine.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/StringOutput.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/StringOutput.cs
index 4a1f20f7806..b4c69f80ccc 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/StringOutput.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/StringOutput.cs
@@ -2,7 +2,7 @@
// <copyright file="StringOutput.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Stylesheet.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Stylesheet.cs
index 9cc9876d603..0bf9d41dfc8 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Stylesheet.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Stylesheet.cs
@@ -2,7 +2,7 @@
// <copyright file="Stylesheet.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TemplateAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TemplateAction.cs
index b4eedce6b4b..f728fec60e7 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TemplateAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TemplateAction.cs
@@ -2,7 +2,7 @@
// <copyright file="TemplateAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TemplateBaseAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TemplateBaseAction.cs
index bdd82f3b872..3ac17a2ddcf 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TemplateBaseAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TemplateBaseAction.cs
@@ -2,7 +2,7 @@
// <copyright file="TemplateBaseAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TemplateLookupAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TemplateLookupAction.cs
index d8168cbd654..063d58991c4 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TemplateLookupAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TemplateLookupAction.cs
@@ -2,7 +2,7 @@
// <copyright file="TemplateLookupAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Templatemanager.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Templatemanager.cs
index b54551b6c09..36811a5b483 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Templatemanager.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Templatemanager.cs
@@ -2,7 +2,7 @@
// <copyright file="TemplateManager.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TextAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TextAction.cs
index d7b20787056..f93e6025ef9 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TextAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TextAction.cs
@@ -2,7 +2,7 @@
// <copyright file="TextAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TextEvent.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TextEvent.cs
index 7f57aaa9329..480f72fcb42 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TextEvent.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TextEvent.cs
@@ -2,7 +2,7 @@
// <copyright file="TextEvent.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TextOnlyOutput.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TextOnlyOutput.cs
index cf608ab7232..e4a18741d46 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TextOnlyOutput.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TextOnlyOutput.cs
@@ -2,7 +2,7 @@
// <copyright file="TextOnlyOutput.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TextOutput.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TextOutput.cs
index ca039a1740e..2fa2cb546e6 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TextOutput.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TextOutput.cs
@@ -2,7 +2,7 @@
// <copyright file="TextOutput.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TheQuery.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TheQuery.cs
index 206b6dbd5cc..08238b490b9 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TheQuery.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/TheQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="TheQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/UseAttributesetsAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/UseAttributesetsAction.cs
index fbc23881296..6d1838f9e40 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/UseAttributesetsAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/UseAttributesetsAction.cs
@@ -2,7 +2,7 @@
// <copyright file="UseAttributeSetsAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ValueOfAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ValueOfAction.cs
index d0fc7e3b70a..ac4d48f6954 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ValueOfAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ValueOfAction.cs
@@ -2,7 +2,7 @@
// <copyright file="ValueOfAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/VariableAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/VariableAction.cs
index 95f60635325..e57a2599968 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/VariableAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/VariableAction.cs
@@ -2,7 +2,7 @@
// <copyright file="VariableAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/WithParamAction.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/WithParamAction.cs
index 175d2409f54..c02c45ea8dc 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/WithParamAction.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/WithParamAction.cs
@@ -2,7 +2,7 @@
// <copyright file="WithParamAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/WriterOutput.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/WriterOutput.cs
index 3778c9dc2e8..57a02cfa1e5 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/WriterOutput.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/WriterOutput.cs
@@ -2,7 +2,7 @@
// <copyright file="WriterOutput.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/XsltCompileContext.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/XsltCompileContext.cs
index a6c74c175da..6e7a9a33be2 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/XsltCompileContext.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/XsltCompileContext.cs
@@ -2,7 +2,7 @@
// <copyright file="XsltCompileContext.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
@@ -467,7 +467,7 @@ namespace System.Xml.Xsl.XsltOld {
if (typeof(XPathNodeIterator).IsAssignableFrom(type)) {
return XPathResultType.NodeSet;
}
- // [....]: It be better to check that type is realy object and otherwise return XPathResultType.Error
+ // Microsoft: It be better to check that type is realy object and otherwise return XPathResultType.Error
return XPathResultType.Any;
case TypeCode.DateTime :
return XPathResultType.Error;
diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/XsltOutput.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/XsltOutput.cs
index 45197e4c25b..0df2f0ab5d1 100644
--- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/XsltOutput.cs
+++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/XsltOutput.cs
@@ -2,7 +2,7 @@
// <copyright file="XsltOutput.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
diff --git a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/MemoryRecordBuffer.cs b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/MemoryRecordBuffer.cs
index 1a7317d87fd..54c1f5b0433 100644
--- a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/MemoryRecordBuffer.cs
+++ b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/MemoryRecordBuffer.cs
@@ -2,9 +2,9 @@
// <copyright file="MemoryRecordBuffer.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace Microsoft.SqlServer.Server {
diff --git a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/MetadataUtilsSmi.cs b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/MetadataUtilsSmi.cs
index 2a267bd1220..776bc2cfcc7 100644
--- a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/MetadataUtilsSmi.cs
+++ b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/MetadataUtilsSmi.cs
@@ -2,8 +2,8 @@
// <copyright file="MetaDataUtilsSmi.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace Microsoft.SqlServer.Server {
diff --git a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiConnection.cs b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiConnection.cs
index 593b27447a4..7907a61aa49 100644
--- a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiConnection.cs
+++ b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiConnection.cs
@@ -2,8 +2,8 @@
// <copyright file="SmiConnection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace Microsoft.SqlServer.Server {
diff --git a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiContext.cs b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiContext.cs
index 413e2a2cfd5..5c500135f66 100644
--- a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiContext.cs
+++ b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiContext.cs
@@ -2,8 +2,8 @@
// <copyright file="SmiContext.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace Microsoft.SqlServer.Server {
diff --git a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiContextFactory.cs b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiContextFactory.cs
index 7554c93938e..df636c29561 100644
--- a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiContextFactory.cs
+++ b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiContextFactory.cs
@@ -2,8 +2,8 @@
// <copyright file="SmiContextFactory.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace Microsoft.SqlServer.Server {
diff --git a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiEventSink.cs b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiEventSink.cs
index c7d2556b17e..4c282253975 100644
--- a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiEventSink.cs
+++ b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiEventSink.cs
@@ -2,8 +2,8 @@
// <copyright file="SmiEventSink.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace Microsoft.SqlServer.Server {
diff --git a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiEventSink_Default.cs b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiEventSink_Default.cs
index 089ced09eb5..8a0dfdae53f 100644
--- a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiEventSink_Default.cs
+++ b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiEventSink_Default.cs
@@ -2,8 +2,8 @@
// <copyright file="SmiEventSink_Default.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace Microsoft.SqlServer.Server {
diff --git a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiEventSink_DeferedProcessing.cs b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiEventSink_DeferedProcessing.cs
index 624a6dfa116..80f1b99bbff 100644
--- a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiEventSink_DeferedProcessing.cs
+++ b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiEventSink_DeferedProcessing.cs
@@ -2,8 +2,8 @@
// <copyright file="SmiEventSink_DeferedProcessing.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace Microsoft.SqlServer.Server {
diff --git a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiEventStream.cs b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiEventStream.cs
index baaeda5c044..9daeb29c4f9 100644
--- a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiEventStream.cs
+++ b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiEventStream.cs
@@ -2,8 +2,8 @@
// <copyright file="SmiEventStream.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace Microsoft.SqlServer.Server {
diff --git a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiGettersStream.cs b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiGettersStream.cs
index c904b107b97..f81df24681c 100644
--- a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiGettersStream.cs
+++ b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiGettersStream.cs
@@ -2,8 +2,8 @@
// <copyright file="SmiGettersStream.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace Microsoft.SqlServer.Server {
diff --git a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiMetaData.cs b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiMetaData.cs
index ed861e021c3..49b2e68c10a 100644
--- a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiMetaData.cs
+++ b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiMetaData.cs
@@ -2,8 +2,8 @@
// <copyright file="SmiMetaData.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace Microsoft.SqlServer.Server {
diff --git a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiMetaDataProperty.cs b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiMetaDataProperty.cs
index b4fc70fd114..1ea6845ef9c 100644
--- a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiMetaDataProperty.cs
+++ b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiMetaDataProperty.cs
@@ -2,8 +2,8 @@
// <copyright file="SmiMetaData.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace Microsoft.SqlServer.Server {
diff --git a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiRecordBuffer.cs b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiRecordBuffer.cs
index 8221833271a..3be8d997429 100644
--- a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiRecordBuffer.cs
+++ b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiRecordBuffer.cs
@@ -2,8 +2,8 @@
// <copyright file="SmiRecordBuffer.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace Microsoft.SqlServer.Server {
diff --git a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiRequestExecutor.cs b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiRequestExecutor.cs
index 4bf089f2272..947907293cf 100644
--- a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiRequestExecutor.cs
+++ b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiRequestExecutor.cs
@@ -2,8 +2,8 @@
// <copyright file="SmiRequestExecutor.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace Microsoft.SqlServer.Server {
diff --git a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiSettersStream.cs b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiSettersStream.cs
index c32aa7f2793..95428f6d851 100644
--- a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiSettersStream.cs
+++ b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiSettersStream.cs
@@ -2,8 +2,8 @@
// <copyright file="SmiSettersStream.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace Microsoft.SqlServer.Server {
diff --git a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiTypedGetterSetter.cs b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiTypedGetterSetter.cs
index ca6a630fde2..14a25627a83 100644
--- a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiTypedGetterSetter.cs
+++ b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiTypedGetterSetter.cs
@@ -2,8 +2,8 @@
// <copyright file="SmiTypedGetterSetter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiXetterAccessMap.cs b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiXetterAccessMap.cs
index 075099219c9..d782ff587f8 100644
--- a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiXetterAccessMap.cs
+++ b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SmiXetterAccessMap.cs
@@ -2,8 +2,8 @@
// <copyright file="SmiXetterAccessMap.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace Microsoft.SqlServer.Server {
diff --git a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SqlDataRecord.cs b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SqlDataRecord.cs
index 9bb16a1e57f..eba515f8e55 100644
--- a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SqlDataRecord.cs
+++ b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SqlDataRecord.cs
@@ -2,10 +2,10 @@
// <copyright file="SmiMetaData.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace Microsoft.SqlServer.Server {
diff --git a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SqlRecordBuffer.cs b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SqlRecordBuffer.cs
index b719507e84b..2882b8fe9e5 100644
--- a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SqlRecordBuffer.cs
+++ b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SqlRecordBuffer.cs
@@ -2,9 +2,9 @@
// <copyright file="SqlRecordBuffer.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace Microsoft.SqlServer.Server {
diff --git a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SqlTriggerContext.cs b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SqlTriggerContext.cs
index 4ab4a259ee9..f89c1a83b21 100644
--- a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SqlTriggerContext.cs
+++ b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/SqlTriggerContext.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlTriggerContext.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
// <owner current="true" primary="false">daltodov</owner>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/ValueUtilsSmi.cs b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/ValueUtilsSmi.cs
index 6d9b8cbe2f9..b2a867c59ec 100644
--- a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/ValueUtilsSmi.cs
+++ b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/ValueUtilsSmi.cs
@@ -2,8 +2,8 @@
// <copyright file="ValueUtilsSmi.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace Microsoft.SqlServer.Server {
diff --git a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/sqlcontext.cs b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/sqlcontext.cs
index 0696bedbbeb..5634702a714 100644
--- a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/sqlcontext.cs
+++ b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/sqlcontext.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlContext.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
// <owner current="true" primary="false">daltodov</owner>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/sqlpipe.cs b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/sqlpipe.cs
index d1b39923ff6..a8abcbd16f6 100644
--- a/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/sqlpipe.cs
+++ b/mcs/class/referencesource/System.Data/Microsoft/SqlServer/Server/sqlpipe.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlPipe.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
// <owner current="true" primary="false">daltodov</owner>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data/System/Data/BaseCollection.cs b/mcs/class/referencesource/System.Data/System/Data/BaseCollection.cs
index af0bc90efa7..90a3c41bfda 100644
--- a/mcs/class/referencesource/System.Data/System/Data/BaseCollection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/BaseCollection.cs
@@ -2,9 +2,9 @@
// <copyright file="BaseCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/CodeGen/StrongTypingException.cs b/mcs/class/referencesource/System.Data/System/Data/CodeGen/StrongTypingException.cs
index 7fcf6f07ab3..0dd45248dc2 100644
--- a/mcs/class/referencesource/System.Data/System/Data/CodeGen/StrongTypingException.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/CodeGen/StrongTypingException.cs
@@ -2,9 +2,9 @@
// <copyright file="StrongTypingException.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/CodeGen/datacache.cs b/mcs/class/referencesource/System.Data/System/Data/CodeGen/datacache.cs
index 0fc7ca1a9d7..a3f2098060c 100644
--- a/mcs/class/referencesource/System.Data/System/Data/CodeGen/datacache.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/CodeGen/datacache.cs
@@ -2,9 +2,9 @@
// <copyright file="datacache.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
@@ -351,7 +351,7 @@ namespace System.Data {
}
dataTableClass.Members.Add(constructor);
- //\\ internal <TableName>DataTableClass(DataTable table) : base(table.TableName) { // [....] : Assuming incoming table always associated with DataSet
+ //\\ internal <TableName>DataTableClass(DataTable table) : base(table.TableName) { // Microsoft : Assuming incoming table always associated with DataSet
//\\ if (table.CaseSensitive != table.DataSet.CaseSensitive)
//\\ this.CaseSensitive = table.CaseSensitive;
//\\ if (table.Locale.ToString() != table.DataSet.Locale.ToString())
diff --git a/mcs/class/referencesource/System.Data/System/Data/ColumnTypeConverter.cs b/mcs/class/referencesource/System.Data/System/Data/ColumnTypeConverter.cs
index 69df720e184..c3fb2cbdf26 100644
--- a/mcs/class/referencesource/System.Data/System/Data/ColumnTypeConverter.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/ColumnTypeConverter.cs
@@ -2,9 +2,9 @@
// <copyright file="ColumnTypeConverter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
/*
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/ActivityCorrelator.cs b/mcs/class/referencesource/System.Data/System/Data/Common/ActivityCorrelator.cs
index 4fc17b4ebdd..e40cbc2c505 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/ActivityCorrelator.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/ActivityCorrelator.cs
@@ -2,7 +2,7 @@
// <copyright file="ActivityCorrelator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/AdapterUtil.cs b/mcs/class/referencesource/System.Data/System/Data/Common/AdapterUtil.cs
index 1ba61d95a6a..4801e47b5a5 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/AdapterUtil.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/AdapterUtil.cs
@@ -2,8 +2,8 @@
// <copyright file="AdapterUtil.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
@@ -1836,7 +1836,8 @@ namespace System.Data.Common {
internal const int DefaultCommandTimeout = 30;
internal const int DefaultConnectionTimeout = DbConnectionStringDefaults.ConnectTimeout;
internal const float FailoverTimeoutStep = 0.08F; // fraction of timeout to use for fast failover connections
- internal const int FirstTransparentAttemptTimeout = 500; // The first login attempt in Transparent network IP Resolution
+ internal const float FailoverTimeoutStepForTnir = 0.125F; // Fraction of timeout to use in case of Transparent Network IP resolution.
+ internal const int MinimumTimeoutForTnirMs = 500; // The first login attempt in Transparent network IP Resolution
// security issue, don't rely upon static public readonly values - AS/URT 109635
static internal readonly String StrEmpty = ""; // String.Empty
@@ -1993,7 +1994,7 @@ namespace System.Data.Common {
return resultString.ToString();
}
- private static readonly string hexDigits = "0123456789abcdef";
+ private const string hexDigits = "0123456789abcdef";
static internal byte[] ByteArrayFromString(string hexString, string dataTypeName) {
if ((hexString.Length & 0x1) != 0) {
@@ -2550,5 +2551,42 @@ namespace System.Data.Common {
return _systemDataVersion;
}
+
+ static internal readonly string[] AzureSqlServerEndpoints = {Res.GetString(Res.AZURESQL_GenericEndpoint),
+ Res.GetString(Res.AZURESQL_GermanEndpoint),
+ Res.GetString(Res.AZURESQL_UsGovEndpoint),
+ Res.GetString(Res.AZURESQL_ChinaEndpoint)};
+
+ // This method assumes dataSource parameter is in TCP connection string format.
+ static internal bool IsAzureSqlServerEndpoint(string dataSource)
+ {
+ // remove server port
+ int i = dataSource.LastIndexOf(',');
+ if (i >= 0)
+ {
+ dataSource = dataSource.Substring(0, i);
+ }
+
+ // check for the instance name
+ i = dataSource.LastIndexOf('\\');
+ if (i >= 0)
+ {
+ dataSource = dataSource.Substring(0, i);
+ }
+
+ // trim redundant whitespaces
+ dataSource = dataSource.Trim();
+
+ // check if servername end with any azure endpoints
+ for (i = 0; i < AzureSqlServerEndpoints.Length; i++)
+ {
+ if (dataSource.EndsWith(AzureSqlServerEndpoints[i], StringComparison.OrdinalIgnoreCase))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
}
}
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/BigIntegerStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/BigIntegerStorage.cs
index d3544903d86..e26e965964b 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/BigIntegerStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/BigIntegerStorage.cs
@@ -2,8 +2,8 @@
// <copyright file="BigIntStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/BooleanStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/BooleanStorage.cs
index de174a86bbc..cc64c9506da 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/BooleanStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/BooleanStorage.cs
@@ -2,9 +2,9 @@
// <copyright file="BooleanStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/ByteStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/ByteStorage.cs
index 12a9df123c7..d41d1576bc7 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/ByteStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/ByteStorage.cs
@@ -2,9 +2,9 @@
// <copyright file="ByteStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/CharStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/CharStorage.cs
index b03c0df2c2b..f1baf809a6c 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/CharStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/CharStorage.cs
@@ -2,9 +2,9 @@
// <copyright file="CharStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DBCommand.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DBCommand.cs
index 3a2e01b2620..cc4399fe385 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DBCommand.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DBCommand.cs
@@ -2,8 +2,8 @@
// <copyright file="DbCommand.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DBCommandBuilder.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DBCommandBuilder.cs
index 9744b25b2cf..4205f95998a 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DBCommandBuilder.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DBCommandBuilder.cs
@@ -2,8 +2,8 @@
// <copyright file="CommandBuilder.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DBConnection.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DBConnection.cs
index e9967e0c0b1..52f04500598 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DBConnection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DBConnection.cs
@@ -2,9 +2,9 @@
// <copyright file="DbConnection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DBConnectionString.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DBConnectionString.cs
index e2e362e7a24..6085d61c98c 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DBConnectionString.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DBConnectionString.cs
@@ -2,8 +2,8 @@
// <copyright file="DBConnectionString.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
@@ -251,7 +251,7 @@ namespace System.Data.Common {
//Debug.WriteLine("14/15/16 this AllowOnly and entry AllowOnly but no restrictions");
}
- // verify _hasPassword & _parsetable are in [....] between Everett/Whidbey
+ // verify _hasPassword & _parsetable are in sync between Everett/Whidbey
Debug.Assert(!_hasPassword || ContainsKey(KEY.Password) || ContainsKey(KEY.Pwd), "OnDeserialized password mismatch this");
Debug.Assert(null == entry || !entry._hasPassword || entry.ContainsKey(KEY.Password) || entry.ContainsKey(KEY.Pwd), "OnDeserialized password mismatch entry");
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DBDataPermission.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DBDataPermission.cs
index 46c2906efac..ed6140309e9 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DBDataPermission.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DBDataPermission.cs
@@ -2,8 +2,8 @@
// <copyright file="DBDataPermission.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DBDataPermissionAttribute.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DBDataPermissionAttribute.cs
index 239da95b5cd..adf242c5b60 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DBDataPermissionAttribute.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DBDataPermissionAttribute.cs
@@ -2,8 +2,8 @@
// <copyright file="DBDataPermissionAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DBParameter.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DBParameter.cs
index be9208922d4..4a0ba35742c 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DBParameter.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DBParameter.cs
@@ -2,8 +2,8 @@
// <copyright file="DbParameter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DBSchemaRow.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DBSchemaRow.cs
index 06cf3ac1477..25850cffe0c 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DBSchemaRow.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DBSchemaRow.cs
@@ -2,8 +2,8 @@
// <copyright file="DBSchemaRow.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DBSchemaTable.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DBSchemaTable.cs
index 8a548a5fa94..c6c8917273a 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DBSchemaTable.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DBSchemaTable.cs
@@ -2,8 +2,8 @@
// <copyright file="DBSchemaTable.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DataAdapter.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DataAdapter.cs
index 1dbda974752..e36220920bd 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DataAdapter.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DataAdapter.cs
@@ -2,8 +2,8 @@
// <copyright file="DataAdapter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DataColumnMapping.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DataColumnMapping.cs
index acaf957c51a..f6a843e2cb2 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DataColumnMapping.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DataColumnMapping.cs
@@ -2,8 +2,8 @@
// <copyright file="DataColumnMapping.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DataColumnMappingCollection.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DataColumnMappingCollection.cs
index 6156160922b..b37e7560329 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DataColumnMappingCollection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DataColumnMappingCollection.cs
@@ -2,8 +2,8 @@
// <copyright file="DataColumnMappingCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DataRecordInternal.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DataRecordInternal.cs
index 9c8a7d31ece..659db8d52fd 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DataRecordInternal.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DataRecordInternal.cs
@@ -2,8 +2,8 @@
// <copyright file="DataRecordInternal.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DataStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DataStorage.cs
index 69087c233be..cf66ff06e91 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DataStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DataStorage.cs
@@ -2,8 +2,8 @@
// <copyright file="DataStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DataTableMapping.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DataTableMapping.cs
index 96567755f36..bbb0276ca4a 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DataTableMapping.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DataTableMapping.cs
@@ -2,8 +2,8 @@
// <copyright file="DataTableMapping.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DataTableMappingCollection.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DataTableMappingCollection.cs
index 9ef08940450..a235804a3ae 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DataTableMappingCollection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DataTableMappingCollection.cs
@@ -2,8 +2,8 @@
// <copyright file="DataTableMappingCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DateTimeOffsetStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DateTimeOffsetStorage.cs
index b92e6fc6fa5..457dc17f2a1 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DateTimeOffsetStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DateTimeOffsetStorage.cs
@@ -2,8 +2,8 @@
// <copyright file="DateTimeOffsetStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DateTimeStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DateTimeStorage.cs
index cce489890e5..4ff7014c5b1 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DateTimeStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DateTimeStorage.cs
@@ -2,9 +2,9 @@
// <copyright file="DateTimeStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DbConnectionOptions.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DbConnectionOptions.cs
index 6f283876b38..d139e28e95a 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DbConnectionOptions.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DbConnectionOptions.cs
@@ -2,8 +2,8 @@
// <copyright file="DBConnectionOptions.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DbConnectionPoolKey.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DbConnectionPoolKey.cs
index 9142ef6dd15..6ab3ddbb13b 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DbConnectionPoolKey.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DbConnectionPoolKey.cs
@@ -2,8 +2,8 @@
// <copyright file="ConnectionPoolKey.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DbConnectionStringBuilder.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DbConnectionStringBuilder.cs
index 780bd97c98a..42755929e29 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DbConnectionStringBuilder.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DbConnectionStringBuilder.cs
@@ -2,8 +2,8 @@
// <copyright file="DbConnectionStringBuilder.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DbConnectionStringCommon.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DbConnectionStringCommon.cs
index 24be05dfc29..6327c29e86d 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DbConnectionStringCommon.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DbConnectionStringCommon.cs
@@ -2,8 +2,8 @@
// <copyright file="DbConnectionStringBuilder.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DbDataAdapter.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DbDataAdapter.cs
index 2db82311110..0950ab8f2c3 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DbDataAdapter.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DbDataAdapter.cs
@@ -2,8 +2,8 @@
// <copyright file="DbDataAdapter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DbDataReader.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DbDataReader.cs
index abee96850cb..c4c8318d0c4 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DbDataReader.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DbDataReader.cs
@@ -2,8 +2,8 @@
// <copyright file="DbDataReader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DbDataSourceEnumerator.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DbDataSourceEnumerator.cs
index 8b2f5d6e1a7..4071a35a8d9 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DbDataSourceEnumerator.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DbDataSourceEnumerator.cs
@@ -2,8 +2,8 @@
// <copyright file="DbDataSourceEnumerator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DbException.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DbException.cs
index f113037622f..0a912d55283 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DbException.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DbException.cs
@@ -2,8 +2,8 @@
// <copyright file="DbException.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DbParameterCollection.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DbParameterCollection.cs
index b4e5bb234fb..2f400cca1a4 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DbParameterCollection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DbParameterCollection.cs
@@ -2,8 +2,8 @@
// <copyright file="DbParameterCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DbProviderConfigurationHandler.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DbProviderConfigurationHandler.cs
index 6411c47e8b1..92ec37fcd53 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DbProviderConfigurationHandler.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DbProviderConfigurationHandler.cs
@@ -2,8 +2,8 @@
// <copyright file="DbProviderConfigurationHandler.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DbProviderFactories.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DbProviderFactories.cs
index 7490e8ac3b8..9d3253620ef 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DbProviderFactories.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DbProviderFactories.cs
@@ -2,8 +2,8 @@
// <copyright file="DbProviderFactories.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DbProviderFactoriesConfigurationHandler.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DbProviderFactoriesConfigurationHandler.cs
index 505e734cef0..56d1a7188f5 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DbProviderFactoriesConfigurationHandler.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DbProviderFactoriesConfigurationHandler.cs
@@ -2,8 +2,8 @@
// <copyright file="DbProviderFactoriesConfigurationHandler.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DbProviderFactory.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DbProviderFactory.cs
index 4235679cc6b..f0c8fd47880 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DbProviderFactory.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DbProviderFactory.cs
@@ -2,8 +2,8 @@
// <copyright file="DbProviderFactory.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DbProviderSpecificTypePropertyAttribute.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DbProviderSpecificTypePropertyAttribute.cs
index a213939a24d..1f13d32d66a 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DbProviderSpecificTypePropertyAttribute.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DbProviderSpecificTypePropertyAttribute.cs
@@ -2,8 +2,8 @@
// <copyright file="DBProviderSupportedClasses.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DbTransaction.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DbTransaction.cs
index 467e740f820..8a3ae904611 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DbTransaction.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DbTransaction.cs
@@ -2,8 +2,8 @@
// <copyright file="DbTransaction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DecimalStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DecimalStorage.cs
index b9f8f678493..b8aeda1b852 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DecimalStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DecimalStorage.cs
@@ -2,9 +2,9 @@
// <copyright file="DecimalStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/DoubleStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/DoubleStorage.cs
index 15af90c023e..b11514c7dc8 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/DoubleStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/DoubleStorage.cs
@@ -2,9 +2,9 @@
// <copyright file="DoubleStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/FieldNameLookup.cs b/mcs/class/referencesource/System.Data/System/Data/Common/FieldNameLookup.cs
index 41df2b1aa24..5ae72879599 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/FieldNameLookup.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/FieldNameLookup.cs
@@ -2,8 +2,8 @@
// <copyright file="FieldNameLookup.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/GreenMethods.cs b/mcs/class/referencesource/System.Data/System/Data/Common/GreenMethods.cs
index 8aff41ed34e..ced5a58d80a 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/GreenMethods.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/GreenMethods.cs
@@ -2,8 +2,8 @@
// <copyright file="GreenMethods.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/HandlerBase.cs b/mcs/class/referencesource/System.Data/System/Data/Common/HandlerBase.cs
index 99945fe78ce..3762aa48836 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/HandlerBase.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/HandlerBase.cs
@@ -2,8 +2,8 @@
// <copyright file="HandlerBase.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/Int16Storage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/Int16Storage.cs
index 8d1d0b2a075..0c62a2043fb 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/Int16Storage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/Int16Storage.cs
@@ -2,9 +2,9 @@
// <copyright file="Int16Storage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/Int32Storage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/Int32Storage.cs
index 870bd1093f9..1a59d7e12ae 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/Int32Storage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/Int32Storage.cs
@@ -2,9 +2,9 @@
// <copyright file="Int32Storage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/Int64Storage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/Int64Storage.cs
index f5006299217..26a81b6fa17 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/Int64Storage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/Int64Storage.cs
@@ -2,9 +2,9 @@
// <copyright file="Int64Storage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/MultipartIdentifier.cs b/mcs/class/referencesource/System.Data/System/Data/Common/MultipartIdentifier.cs
index 531dfa1dfa6..a2a0770434f 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/MultipartIdentifier.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/MultipartIdentifier.cs
@@ -2,8 +2,8 @@
// <copyright file="CommandBuilder.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/NameValuePair.cs b/mcs/class/referencesource/System.Data/System/Data/Common/NameValuePair.cs
index bcf18890893..f0b7cdc17f4 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/NameValuePair.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/NameValuePair.cs
@@ -2,8 +2,8 @@
// <copyright file="NameValuePair.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/NameValuePermission.cs b/mcs/class/referencesource/System.Data/System/Data/Common/NameValuePermission.cs
index 9f705d25688..f2088dba955 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/NameValuePermission.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/NameValuePermission.cs
@@ -2,8 +2,8 @@
// <copyright file="NameValuePermission.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/ObjectStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/ObjectStorage.cs
index f4c90546b0a..eb3a09d9cc0 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/ObjectStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/ObjectStorage.cs
@@ -2,8 +2,8 @@
// <copyright file="ObjectStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/RowUpdatedEventArgs.cs b/mcs/class/referencesource/System.Data/System/Data/Common/RowUpdatedEventArgs.cs
index 04af7fa7e77..132952ed769 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/RowUpdatedEventArgs.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/RowUpdatedEventArgs.cs
@@ -2,8 +2,8 @@
// <copyright file="RowUpdatedEventArgs.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/RowUpdatingEventArgs.cs b/mcs/class/referencesource/System.Data/System/Data/Common/RowUpdatingEventArgs.cs
index 1f6c6918c18..50c8c049277 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/RowUpdatingEventArgs.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/RowUpdatingEventArgs.cs
@@ -2,8 +2,8 @@
// <copyright file="RowUpdatingEventArgs.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/SByteStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/SByteStorage.cs
index 0ef3d5edb07..66b54659780 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/SByteStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/SByteStorage.cs
@@ -2,9 +2,9 @@
// <copyright file="SByteStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/SQLConvert.cs b/mcs/class/referencesource/System.Data/System/Data/Common/SQLConvert.cs
index 4c1b691fc06..19b823a39f8 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/SQLConvert.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/SQLConvert.cs
@@ -2,8 +2,8 @@
// <copyright file="SQLConvert.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLBinaryStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLBinaryStorage.cs
index 75243557089..33d7466b168 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLBinaryStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLBinaryStorage.cs
@@ -2,9 +2,9 @@
// <copyright file="SQLBinaryStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLByteStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLByteStorage.cs
index d8f70c87ad3..45382a0d366 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLByteStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLByteStorage.cs
@@ -2,9 +2,9 @@
// <copyright file="SQLByteStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLBytesStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLBytesStorage.cs
index da7d794b73c..b4ce97d90cb 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLBytesStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLBytesStorage.cs
@@ -2,9 +2,9 @@
// <copyright file="SQLBytesStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLCharsStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLCharsStorage.cs
index c8af7abb433..79e094e2c99 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLCharsStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLCharsStorage.cs
@@ -2,9 +2,9 @@
// <copyright file="SQLCharsStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLDateTimeStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLDateTimeStorage.cs
index 60753ae432a..96a18718a0f 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLDateTimeStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLDateTimeStorage.cs
@@ -2,9 +2,9 @@
// <copyright file="SQLDateTimeStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLDecimalStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLDecimalStorage.cs
index e6a92bf1bff..c451931a0cf 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLDecimalStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLDecimalStorage.cs
@@ -2,9 +2,9 @@
// <copyright file="SQLDecimalStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLDoubleStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLDoubleStorage.cs
index 8833b829fdd..3062b3edba8 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLDoubleStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLDoubleStorage.cs
@@ -2,9 +2,9 @@
// <copyright file="SQLDoubleStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLGuidStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLGuidStorage.cs
index 79c81806038..0c4f3a3dd98 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLGuidStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLGuidStorage.cs
@@ -2,9 +2,9 @@
// <copyright file="SQLGuidStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLInt16Storage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLInt16Storage.cs
index aff67bae529..9168c4d61cf 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLInt16Storage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLInt16Storage.cs
@@ -2,9 +2,9 @@
// <copyright file="SQLInt16Storage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLInt32Storage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLInt32Storage.cs
index 4a31af610c8..f4c94d5e4c6 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLInt32Storage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLInt32Storage.cs
@@ -2,9 +2,9 @@
// <copyright file="SQLInt32Storage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLInt64Storage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLInt64Storage.cs
index eb608d33842..06720cb35ec 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLInt64Storage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLInt64Storage.cs
@@ -2,9 +2,9 @@
// <copyright file="SQLInt64Storage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLMoneyStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLMoneyStorage.cs
index fc4a344a326..184c9bccdd3 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLMoneyStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLMoneyStorage.cs
@@ -2,9 +2,9 @@
// <copyright file="SQLMoneyStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLSingleStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLSingleStorage.cs
index d6c69725ea2..56cc3e690dc 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLSingleStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLSingleStorage.cs
@@ -2,9 +2,9 @@
// <copyright file="SQLSingleStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLStringStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLStringStorage.cs
index 7201b55c57f..0e4611fbe3f 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLStringStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQLStringStorage.cs
@@ -2,9 +2,9 @@
// <copyright file="SQLStringStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQlBooleanStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQlBooleanStorage.cs
index 53fd2a92aac..c0b0dac31b4 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQlBooleanStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SQlBooleanStorage.cs
@@ -2,9 +2,9 @@
// <copyright file="SQLBooleanStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SqlUDTStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SqlUDTStorage.cs
index 1637442fe71..f2a8c84a1e5 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SqlUDTStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SqlUDTStorage.cs
@@ -2,9 +2,9 @@
// <copyright file="SqlUDTStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SqlXmlStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SqlXmlStorage.cs
index 4d1c965757b..3edd5bdaa53 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SqlXmlStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/SQLTypes/SqlXmlStorage.cs
@@ -2,9 +2,9 @@
// <copyright file="SqlXmlStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/SafeNativeMethods.cs b/mcs/class/referencesource/System.Data/System/Data/Common/SafeNativeMethods.cs
index 5f8bf6d36ce..5e1c0ffc321 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/SafeNativeMethods.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/SafeNativeMethods.cs
@@ -2,9 +2,9 @@
// <copyright file="SafeNativeMethods.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/SchemaTableColumn.cs b/mcs/class/referencesource/System.Data/System/Data/Common/SchemaTableColumn.cs
index 69df0612c08..3995656fb8f 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/SchemaTableColumn.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/SchemaTableColumn.cs
@@ -2,7 +2,7 @@
// <copyright file="SchemaTableColumn.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/SchemaTableOptionalColumn.cs b/mcs/class/referencesource/System.Data/System/Data/Common/SchemaTableOptionalColumn.cs
index 80a96191906..c4ab9bc5a16 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/SchemaTableOptionalColumn.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/SchemaTableOptionalColumn.cs
@@ -2,7 +2,7 @@
// <copyright file="SchemaTableOptionalColumn.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/SingleStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/SingleStorage.cs
index 1f1c8b4511b..2379ea7583a 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/SingleStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/SingleStorage.cs
@@ -2,9 +2,9 @@
// <copyright file="SingleStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/StringStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/StringStorage.cs
index 7125e5d8561..2885f9b9ac7 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/StringStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/StringStorage.cs
@@ -2,9 +2,9 @@
// <copyright file="StringStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/System.Data_BID.cs b/mcs/class/referencesource/System.Data/System/Data/Common/System.Data_BID.cs
index 9646eb88b49..389ba7f7fc7 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/System.Data_BID.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/System.Data_BID.cs
@@ -2,8 +2,8 @@
// <copyright file="System.Data_BID.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//-----------------------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/TimeSpanStorage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/TimeSpanStorage.cs
index bf931fc4744..b46bf5fb2eb 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/TimeSpanStorage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/TimeSpanStorage.cs
@@ -2,9 +2,9 @@
// <copyright file="TimeSpanStorage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/UInt16Storage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/UInt16Storage.cs
index 5bafd626be9..06320a1b7ef 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/UInt16Storage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/UInt16Storage.cs
@@ -2,9 +2,9 @@
// <copyright file="UInt16Storage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
@@ -15,7 +15,7 @@ namespace System.Data.Common {
internal sealed class UInt16Storage : DataStorage {
- private static readonly UInt16 defaultValue = UInt16.MinValue;
+ private const UInt16 defaultValue = UInt16.MinValue;
private UInt16[] values;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/UInt32Storage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/UInt32Storage.cs
index d2701c49d7e..69cb7ef12ea 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/UInt32Storage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/UInt32Storage.cs
@@ -2,9 +2,9 @@
// <copyright file="UInt32Storage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
@@ -15,7 +15,7 @@ namespace System.Data.Common {
internal sealed class UInt32Storage : DataStorage {
- private static readonly UInt32 defaultValue = UInt32.MinValue;
+ private const UInt32 defaultValue = UInt32.MinValue;
private UInt32[] values;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/UInt64Storage.cs b/mcs/class/referencesource/System.Data/System/Data/Common/UInt64Storage.cs
index 1242f279c0e..b5e6f7b1bc3 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/UInt64Storage.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/UInt64Storage.cs
@@ -2,9 +2,9 @@
// <copyright file="UInt64Storage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
@@ -15,7 +15,7 @@ namespace System.Data.Common {
internal sealed class UInt64Storage : DataStorage {
- private static readonly UInt64 defaultValue = UInt64.MinValue;
+ private const UInt64 defaultValue = UInt64.MinValue;
private UInt64[] values;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/UnsafeNativeMethods.cs b/mcs/class/referencesource/System.Data/System/Data/Common/UnsafeNativeMethods.cs
index 0c368cfcabe..7fc1d8bc0a0 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/UnsafeNativeMethods.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/UnsafeNativeMethods.cs
@@ -2,9 +2,9 @@
// <copyright file="UnsafeNativeMethods.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/dbdatarecord.cs b/mcs/class/referencesource/System.Data/System/Data/Common/dbdatarecord.cs
index 7c140b1afd5..2f56981aa41 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/dbdatarecord.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/dbdatarecord.cs
@@ -2,8 +2,8 @@
// <copyright file="DbDataRecord.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/dbenumerator.cs b/mcs/class/referencesource/System.Data/System/Data/Common/dbenumerator.cs
index 758d6062953..5377586b7de 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Common/dbenumerator.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Common/dbenumerator.cs
@@ -2,8 +2,8 @@
// <copyright file="dbenumerator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Constraint.cs b/mcs/class/referencesource/System.Data/System/Data/Constraint.cs
index ff25eb8f650..0d9bd2e24e4 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Constraint.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Constraint.cs
@@ -2,9 +2,9 @@
// <copyright file="Constraint.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/ConstraintCollection.cs b/mcs/class/referencesource/System.Data/System/Data/ConstraintCollection.cs
index 357723bae1b..a387337887a 100644
--- a/mcs/class/referencesource/System.Data/System/Data/ConstraintCollection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/ConstraintCollection.cs
@@ -2,9 +2,9 @@
// <copyright file="ConstraintCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/ConstraintConverter.cs b/mcs/class/referencesource/System.Data/System/Data/ConstraintConverter.cs
index 176866fa5f7..1564f89dd0b 100644
--- a/mcs/class/referencesource/System.Data/System/Data/ConstraintConverter.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/ConstraintConverter.cs
@@ -2,9 +2,9 @@
// <copyright file="ConstraintConverter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/ConstraintEnumerator.cs b/mcs/class/referencesource/System.Data/System/Data/ConstraintEnumerator.cs
index 72c20a47433..8e4c2b9913f 100644
--- a/mcs/class/referencesource/System.Data/System/Data/ConstraintEnumerator.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/ConstraintEnumerator.cs
@@ -2,9 +2,9 @@
// <copyright file="ConstraintEnumerator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/DBConcurrencyException.cs b/mcs/class/referencesource/System.Data/System/Data/DBConcurrencyException.cs
index a7724df44d8..5197faec730 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DBConcurrencyException.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DBConcurrencyException.cs
@@ -2,8 +2,8 @@
// <copyright file="DBConcurrencyException.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataColumn.cs b/mcs/class/referencesource/System.Data/System/Data/DataColumn.cs
index 09a0e8df307..91a24307d36 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataColumn.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataColumn.cs
@@ -2,8 +2,8 @@
// <copyright file="DataColumn.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataColumnChangeEvent.cs b/mcs/class/referencesource/System.Data/System/Data/DataColumnChangeEvent.cs
index 080d166c7ca..2c05d2f253b 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataColumnChangeEvent.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataColumnChangeEvent.cs
@@ -2,9 +2,9 @@
// <copyright file="DataColumnChangeEvent.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataColumnCollection.cs b/mcs/class/referencesource/System.Data/System/Data/DataColumnCollection.cs
index 4a8f8119c9d..d486143a9ab 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataColumnCollection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataColumnCollection.cs
@@ -2,9 +2,9 @@
// <copyright file="DataColumnCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataColumnPropertyDescriptor.cs b/mcs/class/referencesource/System.Data/System/Data/DataColumnPropertyDescriptor.cs
index 48d581f5730..e99ccf43b8d 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataColumnPropertyDescriptor.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataColumnPropertyDescriptor.cs
@@ -2,9 +2,9 @@
// <copyright file="DataColumnPropertyDescriptor.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataError.cs b/mcs/class/referencesource/System.Data/System/Data/DataError.cs
index ca3cae694e2..5cd3c802253 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataError.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataError.cs
@@ -2,9 +2,9 @@
// <copyright file="DataError.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataException.cs b/mcs/class/referencesource/System.Data/System/Data/DataException.cs
index f8de1c1bfff..50f42cbe732 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataException.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataException.cs
@@ -2,8 +2,8 @@
// <copyright file="DataException.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
@@ -13,7 +13,7 @@ namespace System.Data {
using System.Globalization;
using System.Runtime.Serialization;
- // [....]: This functions are major point of localization.
+ // Microsoft: This functions are major point of localization.
// We need to have a rules to enforce consistency there.
// The dangerous point there are the string arguments of the exported (internal) methods.
// This string can be argument, table or constraint name but never text of exception itself.
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataKey.cs b/mcs/class/referencesource/System.Data/System/Data/DataKey.cs
index a5f4cb57a5f..6581279d490 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataKey.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataKey.cs
@@ -2,9 +2,9 @@
// <copyright file="DataKey.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataRelation.cs b/mcs/class/referencesource/System.Data/System/Data/DataRelation.cs
index 3838ca9adfb..e63034c1113 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataRelation.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataRelation.cs
@@ -2,9 +2,9 @@
// <copyright file="DataRelation.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
/*****************************************************************************************************
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataRelationCollection.cs b/mcs/class/referencesource/System.Data/System/Data/DataRelationCollection.cs
index baec5ee4493..44a1d6d2b2c 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataRelationCollection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataRelationCollection.cs
@@ -2,9 +2,9 @@
// <copyright file="DataRelationCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
@@ -250,7 +250,7 @@ namespace System.Data {
OnCollectionChanging(RefreshEventArgs);
for (int i = count - 1; i >= 0; i--) {
inTransition = this[i];
- RemoveCore(inTransition); // [....] : No need to go for try catch here and this will surely not throw any exception
+ RemoveCore(inTransition); // Microsoft : No need to go for try catch here and this will surely not throw any exception
}
OnCollectionChanged(RefreshEventArgs);
inTransition = null;
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataRelationPropertyDescriptor.cs b/mcs/class/referencesource/System.Data/System/Data/DataRelationPropertyDescriptor.cs
index c80abf5a9f7..b3885050e49 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataRelationPropertyDescriptor.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataRelationPropertyDescriptor.cs
@@ -2,9 +2,9 @@
// <copyright file="DataRelationPropertyDescriptor.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataRow.cs b/mcs/class/referencesource/System.Data/System/Data/DataRow.cs
index 557f5e44887..acfadee9030 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataRow.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataRow.cs
@@ -2,8 +2,8 @@
// <copyright file="DataRow.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataRowChangeEvent.cs b/mcs/class/referencesource/System.Data/System/Data/DataRowChangeEvent.cs
index 444f9360264..01a56d236e1 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataRowChangeEvent.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataRowChangeEvent.cs
@@ -2,9 +2,9 @@
// <copyright file="DataRowChangeEvent.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataRowCollection.cs b/mcs/class/referencesource/System.Data/System/Data/DataRowCollection.cs
index 81d040e4287..dbed8bf4008 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataRowCollection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataRowCollection.cs
@@ -2,9 +2,9 @@
// <copyright file="DataRowCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataRowView.cs b/mcs/class/referencesource/System.Data/System/Data/DataRowView.cs
index 64eb89f9ac3..0597645639a 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataRowView.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataRowView.cs
@@ -2,8 +2,8 @@
// <copyright file="DataRowView.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataSet.cs b/mcs/class/referencesource/System.Data/System/Data/DataSet.cs
index d3f0497f22e..4f14761eaf0 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataSet.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataSet.cs
@@ -2,8 +2,8 @@
// <copyright file="DataSet.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
@@ -1107,7 +1107,7 @@ namespace System.Data {
try {
DataSet ds = (DataSet)Activator.CreateInstance(this.GetType(), true);
- if (ds.Tables.Count > 0) // [....] : To clean up all the schema in strong typed dataset.
+ if (ds.Tables.Count > 0) // Microsoft : To clean up all the schema in strong typed dataset.
ds.Reset();
//copy some original dataset properties
@@ -3089,7 +3089,7 @@ namespace System.Data {
}
}
- // [....]: may be better to rewrite this as nonrecursive?
+ // Microsoft: may be better to rewrite this as nonrecursive?
internal DataTable FindTable(DataTable baseTable, PropertyDescriptor[] props, int propStart) {
if (props.Length < propStart + 1)
return baseTable;
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataSysAttribute.cs b/mcs/class/referencesource/System.Data/System/Data/DataSysAttribute.cs
index c0763fca757..6022e8f8bfb 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataSysAttribute.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataSysAttribute.cs
@@ -2,8 +2,8 @@
// <copyright file="DataSysAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
/*
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataTable.cs b/mcs/class/referencesource/System.Data/System/Data/DataTable.cs
index 24673fa5c51..6c841445c7a 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataTable.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataTable.cs
@@ -2,8 +2,8 @@
// <copyright file="DataTable.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
@@ -1893,7 +1893,7 @@ namespace System.Data {
}
}
}
- fInitInProgress = false; // [....] : 77890. It is must that we set off this flag after calling FinishInitxxx();
+ fInitInProgress = false; // Microsoft : 77890. It is must that we set off this flag after calling FinishInitxxx();
if (delayedSetPrimaryKey != null) {
PrimaryKey = delayedSetPrimaryKey;
delayedSetPrimaryKey = null;
@@ -2150,7 +2150,7 @@ namespace System.Data {
Bid.ScopeEnter(out hscp, "<ds.DataTable.Clone|INFO> %d#, cloneDS=%d\n", ObjectID, (cloneDS != null) ? cloneDS.ObjectID : 0);
try {
DataTable clone = CreateInstance();
- if (clone.Columns.Count > 0) // [....] : To clean up all the schema in strong typed dataset.
+ if (clone.Columns.Count > 0) // Microsoft : To clean up all the schema in strong typed dataset.
clone.Reset();
return CloneTo(clone, cloneDS, false);
}
@@ -2225,8 +2225,8 @@ namespace System.Data {
clone._caseSensitiveUserSet = _caseSensitiveUserSet;
clone.displayExpression = displayExpression;
- clone.typeName = typeName; //[....]
- clone.repeatableElement = repeatableElement; //[....]
+ clone.typeName = typeName; //Microsoft
+ clone.repeatableElement = repeatableElement; //Microsoft
clone.MinimumCapacity = MinimumCapacity;
clone.RemotingFormat = RemotingFormat;
// clone.SerializeHierarchy = SerializeHierarchy;
@@ -5541,8 +5541,8 @@ namespace System.Data {
throw ExceptionBuilder.DataTableInferenceNotSupported();
}
- // [....] xmlload.InferSchema(xdoc, null);
- // [....] xmlload.LoadData(xdoc);
+ // Microsoft xmlload.InferSchema(xdoc, null);
+ // Microsoft xmlload.LoadData(xdoc);
}
}
RestoreConstraint(originalEnforceConstraint);
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataTableClearEvent.cs b/mcs/class/referencesource/System.Data/System/Data/DataTableClearEvent.cs
index a942a9336c3..30233029196 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataTableClearEvent.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataTableClearEvent.cs
@@ -2,8 +2,8 @@
// <copyright file="DataTableClearEvent.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataTableCollection.cs b/mcs/class/referencesource/System.Data/System/Data/DataTableCollection.cs
index abe20b7f930..b42df0df4e1 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataTableCollection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataTableCollection.cs
@@ -2,9 +2,9 @@
// <copyright file="DataTableCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataTableNewRowEvent.cs b/mcs/class/referencesource/System.Data/System/Data/DataTableNewRowEvent.cs
index bfd0fcd7ae3..db994c7c2b6 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataTableNewRowEvent.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataTableNewRowEvent.cs
@@ -2,8 +2,8 @@
// <copyright file="DataTableNewRowEvent.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataTablePropertyDescriptor.cs b/mcs/class/referencesource/System.Data/System/Data/DataTablePropertyDescriptor.cs
index a5ffd176ba4..3d9f30c6397 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataTablePropertyDescriptor.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataTablePropertyDescriptor.cs
@@ -2,9 +2,9 @@
// <copyright file="DataTablePropertyDescriptor.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataTableReader.cs b/mcs/class/referencesource/System.Data/System/Data/DataTableReader.cs
index 90d9af9f04f..475e6f72155 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataTableReader.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataTableReader.cs
@@ -2,9 +2,9 @@
// <copyright file="DataTableReader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataTableReaderListener.cs b/mcs/class/referencesource/System.Data/System/Data/DataTableReaderListener.cs
index 66b1c720d51..545909a4fe0 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataTableReaderListener.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataTableReaderListener.cs
@@ -2,8 +2,8 @@
// <copyright file="DataTableReaderListener.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataTableTypeConverter.cs b/mcs/class/referencesource/System.Data/System/Data/DataTableTypeConverter.cs
index b5a9ed888ee..dc1425682eb 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataTableTypeConverter.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataTableTypeConverter.cs
@@ -2,9 +2,9 @@
// <copyright file="DataTableTypeConverter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataView.cs b/mcs/class/referencesource/System.Data/System/Data/DataView.cs
index fb93c55a290..69c0ce2b662 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataView.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataView.cs
@@ -2,8 +2,8 @@
// <copyright file="DataView.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
@@ -166,7 +166,7 @@ namespace System.Data {
/// <summary>
/// Allow construction of DataView with <see cref="System.Predicate&lt;DataRow&gt;"/> and <see cref="System.Comparison&lt;DataRow&gt;"/>
/// </summary>
- /// <remarks>This is a copy of the other DataView ctor and needs to be kept in [....]</remarks>
+ /// <remarks>This is a copy of the other DataView ctor and needs to be kept in sync</remarks>
internal DataView(DataTable table, System.Predicate<DataRow> predicate, System.Comparison<DataRow> comparison, DataViewRowState RowState) {
GC.SuppressFinalize(this);
Bid.Trace("<ds.DataView.DataView|API> %d#, table=%d, RowState=%d{ds.DataViewRowState}\n",
@@ -1294,7 +1294,7 @@ namespace System.Data {
if (ListChangedType.Reset != e.ListChangedType) {
OnListChanged(e);
}
- if (addNewRow != null && index.RecordCount == 0) { // [....] : 83032 Clear the newly added row as the underlying index is reset.
+ if (addNewRow != null && index.RecordCount == 0) { // Microsoft : 83032 Clear the newly added row as the underlying index is reset.
FinishAddNew(false);
}
if (ListChangedType.Reset == e.ListChangedType) {
@@ -1511,7 +1511,7 @@ namespace System.Data {
dataViewManager.nViews++;
DataViewSetting dataViewSetting = dataViewManager.DataViewSettings[table];
try {
- // [....]: check that we will not do unnesasary operation here if dataViewSetting.Sort == this.Sort ...
+ // Microsoft: check that we will not do unnesasary operation here if dataViewSetting.Sort == this.Sort ...
applyDefaultSort = dataViewSetting.ApplyDefaultSort;
DataExpression newFilter = new DataExpression(table, dataViewSetting.RowFilter);
SetIndex(dataViewSetting.Sort, dataViewSetting.RowStateFilter, newFilter);
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataViewListener.cs b/mcs/class/referencesource/System.Data/System/Data/DataViewListener.cs
index 32fb4fbf6a0..0821be330dc 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataViewListener.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataViewListener.cs
@@ -2,8 +2,8 @@
// <copyright file="Select.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataViewManager.cs b/mcs/class/referencesource/System.Data/System/Data/DataViewManager.cs
index f597b87e80e..29d03280392 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataViewManager.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataViewManager.cs
@@ -2,9 +2,9 @@
// <copyright file="DataViewManager.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
@@ -300,7 +300,7 @@ namespace System.Data {
}
*/
- // [....]: GetListName and GetItemProperties almost the same in DataView and DataViewManager
+ // Microsoft: GetListName and GetItemProperties almost the same in DataView and DataViewManager
string System.ComponentModel.ITypedList.GetListName(PropertyDescriptor[] listAccessors) {
DataSet dataSet = DataSet;
if (dataSet == null)
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataViewManagerListItemTypeDescriptor.cs b/mcs/class/referencesource/System.Data/System/Data/DataViewManagerListItemTypeDescriptor.cs
index 60d96cc86b3..b9ed419b403 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataViewManagerListItemTypeDescriptor.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataViewManagerListItemTypeDescriptor.cs
@@ -2,9 +2,9 @@
// <copyright file="DataViewManagerListItemTypeDescriptor.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataViewSetting.cs b/mcs/class/referencesource/System.Data/System/Data/DataViewSetting.cs
index d2d4b86f44c..1072ce26384 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataViewSetting.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataViewSetting.cs
@@ -2,9 +2,9 @@
// <copyright file="DataViewSetting.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/DataViewSettingCollection.cs b/mcs/class/referencesource/System.Data/System/Data/DataViewSettingCollection.cs
index fc91e196bec..cbdfa92f2a7 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DataViewSettingCollection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DataViewSettingCollection.cs
@@ -2,9 +2,9 @@
// <copyright file="DataViewSettingCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/DefaultValueTypeConverter.cs b/mcs/class/referencesource/System.Data/System/Data/DefaultValueTypeConverter.cs
index 092a27b246d..977867402d5 100644
--- a/mcs/class/referencesource/System.Data/System/Data/DefaultValueTypeConverter.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/DefaultValueTypeConverter.cs
@@ -2,9 +2,9 @@
// <copyright file="DefaultValueTypeConverter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
/*
diff --git a/mcs/class/referencesource/System.Data/System/Data/FillErrorEventArgs.cs b/mcs/class/referencesource/System.Data/System/Data/FillErrorEventArgs.cs
index ea0f9b7d945..83c581a835e 100644
--- a/mcs/class/referencesource/System.Data/System/Data/FillErrorEventArgs.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/FillErrorEventArgs.cs
@@ -2,8 +2,8 @@
// <copyright file="FillErrorEventArgs.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data { // MDAC 59437
diff --git a/mcs/class/referencesource/System.Data/System/Data/Filter/AggregateNode.cs b/mcs/class/referencesource/System.Data/System/Data/Filter/AggregateNode.cs
index 0515908cc22..2fe5c813668 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Filter/AggregateNode.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Filter/AggregateNode.cs
@@ -2,8 +2,8 @@
// <copyright file="AggregateNode.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Filter/BinaryNode.cs b/mcs/class/referencesource/System.Data/System/Data/Filter/BinaryNode.cs
index 1e2691c822f..808ad90076d 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Filter/BinaryNode.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Filter/BinaryNode.cs
@@ -2,9 +2,9 @@
// <copyright file="BinaryNode.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Filter/ConstNode.cs b/mcs/class/referencesource/System.Data/System/Data/Filter/ConstNode.cs
index 3d3215329f4..ae40e2269cf 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Filter/ConstNode.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Filter/ConstNode.cs
@@ -2,9 +2,9 @@
// <copyright file="ConstNode.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Filter/DataExpression.cs b/mcs/class/referencesource/System.Data/System/Data/Filter/DataExpression.cs
index 2a13366e59e..a61417462df 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Filter/DataExpression.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Filter/DataExpression.cs
@@ -2,9 +2,9 @@
// <copyright file="DataExpression.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Filter/ExpressionNode.cs b/mcs/class/referencesource/System.Data/System/Data/Filter/ExpressionNode.cs
index bbd59d3c850..049e98aa8f2 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Filter/ExpressionNode.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Filter/ExpressionNode.cs
@@ -2,9 +2,9 @@
// <copyright file="ExpressionNode.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Filter/ExpressionParser.cs b/mcs/class/referencesource/System.Data/System/Data/Filter/ExpressionParser.cs
index 0cbd98ec98a..c040e8e4f0c 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Filter/ExpressionParser.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Filter/ExpressionParser.cs
@@ -2,9 +2,9 @@
// <copyright file="ExpressionParser.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Filter/FilterException.cs b/mcs/class/referencesource/System.Data/System/Data/Filter/FilterException.cs
index 643744062b5..11165c62e2f 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Filter/FilterException.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Filter/FilterException.cs
@@ -2,9 +2,9 @@
// <copyright file="FilterException.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Filter/FunctionNode.cs b/mcs/class/referencesource/System.Data/System/Data/Filter/FunctionNode.cs
index 97580e2d945..7d53c49343b 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Filter/FunctionNode.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Filter/FunctionNode.cs
@@ -2,9 +2,9 @@
// <copyright file="FunctionNode.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Filter/LookupNode.cs b/mcs/class/referencesource/System.Data/System/Data/Filter/LookupNode.cs
index 3b75a801cef..896122d7082 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Filter/LookupNode.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Filter/LookupNode.cs
@@ -2,9 +2,9 @@
// <copyright file="LookupNode.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
@@ -92,7 +92,7 @@ namespace System.Data {
if (parent == null)
return DBNull.Value;
- return parent[column, parent.HasVersion(version) ? version : DataRowVersion.Current]; // [....] : Bug 76154
+ return parent[column, parent.HasVersion(version) ? version : DataRowVersion.Current]; // Microsoft : Bug 76154
}
internal override object Eval(int[] recordNos) {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Filter/NameNode.cs b/mcs/class/referencesource/System.Data/System/Data/Filter/NameNode.cs
index 4ec71c0e7d9..efc3b139eb8 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Filter/NameNode.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Filter/NameNode.cs
@@ -2,9 +2,9 @@
// <copyright file="NameNode.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Filter/Operators.cs b/mcs/class/referencesource/System.Data/System/Data/Filter/Operators.cs
index ef806e204ef..863a0c0f00d 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Filter/Operators.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Filter/Operators.cs
@@ -2,9 +2,9 @@
// <copyright file="Operators.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Filter/UnaryNode.cs b/mcs/class/referencesource/System.Data/System/Data/Filter/UnaryNode.cs
index 21f4fec0c79..2bc95711750 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Filter/UnaryNode.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Filter/UnaryNode.cs
@@ -2,9 +2,9 @@
// <copyright file="UnaryNode.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Filter/ZeroOpNode.cs b/mcs/class/referencesource/System.Data/System/Data/Filter/ZeroOpNode.cs
index e9c0ad4fad5..21e318aa494 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Filter/ZeroOpNode.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Filter/ZeroOpNode.cs
@@ -2,9 +2,9 @@
// <copyright file="ZeroOpNode.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/ForeignKeyConstraint.cs b/mcs/class/referencesource/System.Data/System/Data/ForeignKeyConstraint.cs
index 5afa2ecbd13..26350a8bff7 100644
--- a/mcs/class/referencesource/System.Data/System/Data/ForeignKeyConstraint.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/ForeignKeyConstraint.cs
@@ -2,9 +2,9 @@
// <copyright file="ForeignKeyConstraint.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/MergeFailedEvent.cs b/mcs/class/referencesource/System.Data/System/Data/MergeFailedEvent.cs
index 880119a6716..3de377905f8 100644
--- a/mcs/class/referencesource/System.Data/System/Data/MergeFailedEvent.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/MergeFailedEvent.cs
@@ -2,9 +2,9 @@
// <copyright file="MergeFailedEvent.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Merger.cs b/mcs/class/referencesource/System.Data/System/Data/Merger.cs
index 091a03a2a0b..0d01c4987f5 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Merger.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Merger.cs
@@ -2,8 +2,8 @@
// <copyright file="Merger.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/DbDataRecord.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/DbDataRecord.cs
index ac00f0d0e55..ea81451b667 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/DbDataRecord.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/DbDataRecord.cs
@@ -2,8 +2,8 @@
// <copyright file="DbDataRecord.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/Odbc32.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/Odbc32.cs
index 63a7a6e2965..4fddaba8713 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/Odbc32.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/Odbc32.cs
@@ -2,8 +2,8 @@
// <copyright file="Odbc32.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcCommand.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcCommand.cs
index a5b4cbdf0ef..2c1f531f26b 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcCommand.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcCommand.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcCommand.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcCommandBuilder.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcCommandBuilder.cs
index 955c786fddf..e94f58756bb 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcCommandBuilder.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcCommandBuilder.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcCommandBuilder.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnection.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnection.cs
index bf56cc81f02..7a35ef87c83 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnection.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcConnection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionFactory.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionFactory.cs
index 956635682f0..e72fc109f19 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionFactory.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionFactory.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcConnectionFactory.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Odbc
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionHandle.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionHandle.cs
index fc645f7e74e..fd0b3598c41 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionHandle.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionHandle.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcConnectionHandle.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionOpen.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionOpen.cs
index cbfb7691d3b..42c134450bc 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionOpen.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionOpen.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcConnectionOpen.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionPoolProviderInfo.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionPoolProviderInfo.cs
index b631eabdb24..a48d5d7415f 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionPoolProviderInfo.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionPoolProviderInfo.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcConnectionPoolProviderInfo.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Odbc
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionString.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionString.cs
index 8214495463e..f9d7a4654f2 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionString.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionString.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcConnectionString.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Odbc {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionStringbuilder.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionStringbuilder.cs
index 224cf99840f..13193c544a9 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionStringbuilder.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcConnectionStringbuilder.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcConnectionStringBuilder.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcDataAdapter.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcDataAdapter.cs
index c05c0b67f0e..b3bbbe12901 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcDataAdapter.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcDataAdapter.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcDataAdapter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcDataReader.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcDataReader.cs
index 2428b5e4901..b361a55d0c2 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcDataReader.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcDataReader.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcDataReader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcEnvironment.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcEnvironment.cs
index 86685f8d238..e2f228c2140 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcEnvironment.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcEnvironment.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcEnvironment.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcEnvironmentHandle.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcEnvironmentHandle.cs
index a01fa82c98a..78d9cb709f4 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcEnvironmentHandle.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcEnvironmentHandle.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcEnvironmentHandle.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcError.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcError.cs
index 08fbed4a12e..2a1c944113d 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcError.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcError.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcError.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcErrorCollection.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcErrorCollection.cs
index 1358b94a3c8..00f464349ef 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcErrorCollection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcErrorCollection.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcErrorCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Odbc {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcException.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcException.cs
index ef8ebabb000..a852637eb52 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcException.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcException.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcException.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcFactory.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcFactory.cs
index 4637f0924e1..da89d9bac76 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcFactory.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcFactory.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcFactory.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcHandle.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcHandle.cs
index cf436200533..f4deea79fac 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcHandle.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcHandle.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcHandle.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcInfoMessageEvent.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcInfoMessageEvent.cs
index 18ea6b2f895..fed1a56fcbd 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcInfoMessageEvent.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcInfoMessageEvent.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcInfoMessageEvent.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcParameter.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcParameter.cs
index 013a65cb2e8..d9a23bb2a6e 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcParameter.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcParameter.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcParameter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
@@ -326,11 +326,11 @@ namespace System.Data.Odbc {
// the following code causes failure against SQL 6.5
// ERROR [HY104] [Microsoft][ODBC SQL Server Driver]Invalid precision value
//
- // the code causes failure if it is NOT there (remark added by [....])
+ // the code causes failure if it is NOT there (remark added by Microsoft)
// it causes failure with jet if it is there
//
// MDAC 76227: Code is required for japanese client/server tests.
- // If this causes regressions with Jet please doc here including bug#. ([....])
+ // If this causes regressions with Jet please doc here including bug#. (Microsoft)
//
if ((ODBC32.SQL_TYPE.CHAR == _bindtype._sql_type)
|| (ODBC32.SQL_TYPE.VARCHAR == _bindtype._sql_type)
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcParameterCollection.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcParameterCollection.cs
index 8231d988df4..feb30a5f5dc 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcParameterCollection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcParameterCollection.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcParameterCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Odbc {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcPermission.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcPermission.cs
index b173351f678..d1560e285a7 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcPermission.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcPermission.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcPermission.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Odbc {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcReferenceCollection.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcReferenceCollection.cs
index a6e6c14220d..16636e5d272 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcReferenceCollection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcReferenceCollection.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcReferenceCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcRowUpdatingEvent.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcRowUpdatingEvent.cs
index 1f33d71aed7..7e36ad5e1b6 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcRowUpdatingEvent.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcRowUpdatingEvent.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcRowUpdatingEvent.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcStatementHandle.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcStatementHandle.cs
index 04d1157b724..9000d8ea8aa 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcStatementHandle.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcStatementHandle.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcStatementHandle.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcTransaction.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcTransaction.cs
index 610dfdb7c96..25dbd717984 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcTransaction.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcTransaction.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcTransaction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcUtils.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcUtils.cs
index 5c6f11ad154..b5d23b8aae4 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcUtils.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/OdbcUtils.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcUtils.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/odbcmetadatacollectionnames.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/odbcmetadatacollectionnames.cs
index ab10d4aa0cf..a7cafce8aba 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/odbcmetadatacollectionnames.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/odbcmetadatacollectionnames.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcMetaDataCollectionNames.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Odbc {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/odbcmetadatacolumnnames.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/odbcmetadatacolumnnames.cs
index 513cf0f35b3..bbd591fb162 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/odbcmetadatacolumnnames.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/odbcmetadatacolumnnames.cs
@@ -2,8 +2,8 @@
// <copyright file="OdbcMetaDataColumnNames.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Odbc {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Odbc/odbcmetadatafactory.cs b/mcs/class/referencesource/System.Data/System/Data/Odbc/odbcmetadatafactory.cs
index 87281ad3bf7..01ffbf81c00 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Odbc/odbcmetadatafactory.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Odbc/odbcmetadatafactory.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/ColumnBinding.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/ColumnBinding.cs
index 05a211e2cb3..89b83e35c76 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/ColumnBinding.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/ColumnBinding.cs
@@ -2,8 +2,8 @@
// <copyright file="ColumnBinding.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/DBBindings.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/DBBindings.cs
index 60350f4689f..4b802a209a0 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/DBBindings.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/DBBindings.cs
@@ -2,8 +2,8 @@
// <copyright file="DBBindings.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/DBPropSet.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/DBPropSet.cs
index 7157e6c7e35..f6128fcf3c6 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/DBPropSet.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/DBPropSet.cs
@@ -2,8 +2,8 @@
// <copyright file="DBPropSet.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OLEDB_Enum.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OLEDB_Enum.cs
index 40d7250e084..9eaa3c0e0bb 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OLEDB_Enum.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OLEDB_Enum.cs
@@ -2,8 +2,8 @@
// <copyright file="OLEDB_Enum.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OLEDB_Util.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OLEDB_Util.cs
index 66c7ead9d27..9a5c4818b94 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OLEDB_Util.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OLEDB_Util.cs
@@ -2,8 +2,8 @@
// <copyright file="OLEDB_Util.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbCommand.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbCommand.cs
index a835d94e7cc..34c26ef0f0f 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbCommand.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbCommand.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbCommand.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbCommandBuilder.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbCommandBuilder.cs
index f7e15dd4f22..7e6b55777df 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbCommandBuilder.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbCommandBuilder.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbCommandBuilder.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbConnection.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbConnection.cs
index b721af209c8..251146a92fe 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbConnection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbConnection.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbConnection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbConnectionFactory.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbConnectionFactory.cs
index 81a53960832..28815c8557c 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbConnectionFactory.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbConnectionFactory.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbConnectionFactory.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbConnectionInternal.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbConnectionInternal.cs
index 83b463ed43a..67e120b1400 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbConnectionInternal.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbConnectionInternal.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbConnectionInternal.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbConnectionPoolGroupProviderInfo.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbConnectionPoolGroupProviderInfo.cs
index 88200afbaac..6c48b25650d 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbConnectionPoolGroupProviderInfo.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbConnectionPoolGroupProviderInfo.cs
@@ -2,7 +2,7 @@
// <copyright file="OleDbConnection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbDataAdapter.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbDataAdapter.cs
index c1301ded63c..f9e2e640cb4 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbDataAdapter.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbDataAdapter.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbDataAdapter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbDataReader.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbDataReader.cs
index 16a4393ed57..55fdaa58bd9 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbDataReader.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbDataReader.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbDataReader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
@@ -1168,7 +1168,7 @@ namespace System.Data.OleDb {
static private void NextResultsInfinite() { // MDAC 72738
Bid.Trace("<oledb.OleDbDataReader.NextResultsInfinite|INFO> System.Data.OleDb.OleDbDataReader: 2000 IMultipleResult.GetResult(NULL, DBRESULTFLAG_DEFAULT, IID_NULL, NULL, NULL) iterations with 0 records affected. Stopping suspect infinite loop. To work-around try using ExecuteReader() and iterating through results with NextResult().\n");
- // [....]'s suggestion is that we debug assert so that users will learn of MSOLAP's misbehavior and not call ExecuteNonQuery
+ // Microsoft's suggestion is that we debug assert so that users will learn of MSOLAP's misbehavior and not call ExecuteNonQuery
Debug.Assert(false, "<oledb.OleDbDataReader.NextResultsInfinite|INFO> System.Data.OleDb.OleDbDataReader: 2000 IMultipleResult.GetResult(NULL, DBRESULTFLAG_DEFAULT, IID_NULL, NULL, NULL) iterations with 0 records affected. Stopping suspect infinite loop. To work-around try using ExecuteReader() and iterating through results with NextResult().\n");
}
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbEnumerator.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbEnumerator.cs
index 25b0e27658a..fdd83b9c030 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbEnumerator.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbEnumerator.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbEnumerator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbError.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbError.cs
index 7bd40b39101..c46ab4271d9 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbError.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbError.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbError.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbErrorCollection.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbErrorCollection.cs
index c2e0e14f924..a7410a8e317 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbErrorCollection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbErrorCollection.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbErrorCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbException.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbException.cs
index b34faca19aa..1b310bb8b7b 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbException.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbException.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbException.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbFactory.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbFactory.cs
index a8977023409..190c0019d3d 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbFactory.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbFactory.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbFactory.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbInfoMessageEvent.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbInfoMessageEvent.cs
index 1af769a72fe..87936250c71 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbInfoMessageEvent.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbInfoMessageEvent.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbInfoMessageEvent.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbMetaDataFactory.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbMetaDataFactory.cs
index 99651fe5e91..7189c9f86b4 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbMetaDataFactory.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbMetaDataFactory.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <owner current="true" primary="false">Mugunm</owner>
//
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbParameter.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbParameter.cs
index 7454366930b..ad824e1a7dd 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbParameter.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbParameter.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbParameter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbParameterCollection.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbParameterCollection.cs
index 2ab175f7cc2..40a2107151b 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbParameterCollection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbParameterCollection.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbParameterCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbPermission.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbPermission.cs
index d7ca1aa88c0..a1a313100c7 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbPermission.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbPermission.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbPermission.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbPropertySetGuid.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbPropertySetGuid.cs
index 75e6fae1311..4be4655a888 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbPropertySetGuid.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbPropertySetGuid.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbPropertySetGuid.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbReferenceCollection.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbReferenceCollection.cs
index 45f347b78fb..ad3750c9529 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbReferenceCollection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbReferenceCollection.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbReferenceCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbRowUpdatedEvent.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbRowUpdatedEvent.cs
index d4c3ccf53cb..043e585d092 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbRowUpdatedEvent.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbRowUpdatedEvent.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbRowUpdatedEvent.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbRowUpdatingEvent.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbRowUpdatingEvent.cs
index ea1d58df0f7..4b20a71e36c 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbRowUpdatingEvent.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbRowUpdatingEvent.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbRowUpdatingEvent.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbSchemaGuid.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbSchemaGuid.cs
index eb0b45c119a..69bac32ad93 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbSchemaGuid.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbSchemaGuid.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbSchemaGuid.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbStruct.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbStruct.cs
index 49f83271bbb..8683055b54d 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbStruct.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbStruct.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbStruct.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbTransaction.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbTransaction.cs
index a5653b5a7d2..14881edbcff 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbTransaction.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbTransaction.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbTransaction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbWrapper.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbWrapper.cs
index c4a71c07154..433d6d4996d 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbWrapper.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OleDbWrapper.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbWrapper.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/OledbConnectionStringbuilder.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/OledbConnectionStringbuilder.cs
index bb021752ed4..9b9eb17174b 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/OledbConnectionStringbuilder.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/OledbConnectionStringbuilder.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbConnectionStringBuilder.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/PropertyIDSet.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/PropertyIDSet.cs
index 92d8e4bfbfd..048b30508b2 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/PropertyIDSet.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/PropertyIDSet.cs
@@ -2,8 +2,8 @@
// <copyright file="PropertyIDSet.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/PropertyInfoSet.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/PropertyInfoSet.cs
index fb15d85b3d5..8f0bbf8871b 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/PropertyInfoSet.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/PropertyInfoSet.cs
@@ -2,8 +2,8 @@
// <copyright file="PropertyInfoSet.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/RowBinding.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/RowBinding.cs
index eb93e1ae389..71b80127ace 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/RowBinding.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/RowBinding.cs
@@ -2,8 +2,8 @@
// <copyright file="RowBinding.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/SafeHandles.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/SafeHandles.cs
index 39e1958f5a4..1351f3b11f6 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/SafeHandles.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/SafeHandles.cs
@@ -2,8 +2,8 @@
// <copyright file="SafeHandles.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/oledbconnectionstring.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/oledbconnectionstring.cs
index bb12e5de732..e1406cfc2a1 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/oledbconnectionstring.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/oledbconnectionstring.cs
@@ -2,8 +2,8 @@
// <copyright file="oledbconnectionstring.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/oledbmetadatacollectionnames.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/oledbmetadatacollectionnames.cs
index 629e25ab995..9c0600b28e9 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/oledbmetadatacollectionnames.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/oledbmetadatacollectionnames.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbMetaDataCollectionNames.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OleDb/oledbmetadatacolumnnames.cs b/mcs/class/referencesource/System.Data/System/Data/OleDb/oledbmetadatacolumnnames.cs
index 3e260632562..741e79769a4 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OleDb/oledbmetadatacolumnnames.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OleDb/oledbmetadatacolumnnames.cs
@@ -2,8 +2,8 @@
// <copyright file="OleDbMetaDataColumnNames.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.OleDb {
diff --git a/mcs/class/referencesource/System.Data/System/Data/OperationAbortedException.cs b/mcs/class/referencesource/System.Data/System/Data/OperationAbortedException.cs
index 539b0e3c114..3eda086c703 100644
--- a/mcs/class/referencesource/System.Data/System/Data/OperationAbortedException.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/OperationAbortedException.cs
@@ -2,8 +2,8 @@
// <copyright file="OperationAbortedException.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/PrimaryKeyTypeConverter.cs b/mcs/class/referencesource/System.Data/System/Data/PrimaryKeyTypeConverter.cs
index 431f2ba83d8..b57494291b1 100644
--- a/mcs/class/referencesource/System.Data/System/Data/PrimaryKeyTypeConverter.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/PrimaryKeyTypeConverter.cs
@@ -2,9 +2,9 @@
// <copyright file="PrimaryKeyTypeConverter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/PropertyCollection.cs b/mcs/class/referencesource/System.Data/System/Data/PropertyCollection.cs
index 0b014fd3adb..e0532236dfa 100644
--- a/mcs/class/referencesource/System.Data/System/Data/PropertyCollection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/PropertyCollection.cs
@@ -2,9 +2,9 @@
// <copyright file="PropertyCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DataReaderContainer.cs b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DataReaderContainer.cs
index b6864fb8d66..181017f55e9 100644
--- a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DataReaderContainer.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DataReaderContainer.cs
@@ -2,7 +2,7 @@
// <copyright file="DataReaderContainer.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.ProviderBase {
diff --git a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbBuffer.cs b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbBuffer.cs
index 82c4df38272..390d8cd51d4 100644
--- a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbBuffer.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbBuffer.cs
@@ -2,7 +2,7 @@
// <copyright file="DbBuffer.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.ProviderBase
diff --git a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionClosed.cs b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionClosed.cs
index fee86a2e3fa..a47c0532b34 100644
--- a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionClosed.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionClosed.cs
@@ -2,8 +2,8 @@
// <copyright file="DbConnectionClosed.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.ProviderBase {
diff --git a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionFactory.cs b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionFactory.cs
index 6832381eb7c..835b18d97a6 100644
--- a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionFactory.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionFactory.cs
@@ -2,8 +2,8 @@
// <copyright file="DbConnectionFactory.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.ProviderBase {
diff --git a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionHelper.cs b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionHelper.cs
index 8c09bbc4c08..8f3f01b8386 100644
--- a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionHelper.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionHelper.cs
@@ -2,7 +2,7 @@
// <copyright file="DbConnectionHelper.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace NAMESPACE {
diff --git a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionInternal.cs b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionInternal.cs
index b55df0aecd2..a90dbe742a8 100644
--- a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionInternal.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionInternal.cs
@@ -2,8 +2,8 @@
// <copyright file="DbConnectionInternal.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.ProviderBase {
@@ -58,7 +58,7 @@ namespace System.Data.ProviderBase {
private SysTx.Transaction _enlistedTransactionOriginal;
#if DEBUG
- private int _activateCount; // debug only counter to verify activate/deactivates are in [....].
+ private int _activateCount; // debug only counter to verify activate/deactivates are in sync.
#endif //DEBUG
protected DbConnectionInternal() : this(ConnectionState.Open, true, false) { // V1.1.3300
@@ -323,7 +323,7 @@ namespace System.Data.ProviderBase {
get;
}
- // this should be abstract but untill it is added to all the providers virtual will have to do [....]
+ // this should be abstract but untill it is added to all the providers virtual will have to do Microsoft
virtual public string ServerVersionNormalized {
get{
throw ADP.NotSupported();
diff --git a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPool.cs b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPool.cs
index dd0b6ad4bb3..7a7029b4597 100644
--- a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPool.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPool.cs
@@ -2,8 +2,8 @@
// <copyright file="DbConnectionPool.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.ProviderBase {
@@ -758,40 +758,6 @@ namespace System.Data.ProviderBase {
return (new Timer(new TimerCallback(this.CleanupCallback), null, _cleanupWait, _cleanupWait));
}
- private static readonly string[] AzureSqlServerEndpoints = {Res.GetString(Res.AZURESQL_GenericEndpoint),
- Res.GetString(Res.AZURESQL_GermanEndpoint),
- Res.GetString(Res.AZURESQL_UsGovEndpoint),
- Res.GetString(Res.AZURESQL_ChinaEndpoint) };
- private static bool IsAzureSqlServerEndpoint(string dataSource)
- {
- // remove server port
- var i = dataSource.LastIndexOf(',');
- if (i >= 0)
- {
- dataSource = dataSource.Substring(0, i);
- }
-
- // check for the instance name
- i = dataSource.LastIndexOf('\\');
- if (i >= 0)
- {
- dataSource = dataSource.Substring(0, i);
- }
-
- // trim redundant whitespaces
- dataSource = dataSource.Trim();
-
- // check if servername end with any azure endpoints
- for (i = 0; i < AzureSqlServerEndpoints.Length; i++)
- {
- if (dataSource.EndsWith(AzureSqlServerEndpoints[i], StringComparison.OrdinalIgnoreCase))
- {
- return true;
- }
- }
- return false;
- }
-
private bool IsBlockingPeriodEnabled()
{
var poolGroupConnectionOptions = _connectionPoolGroup.ConnectionOptions as SqlConnectionString;
@@ -806,7 +772,7 @@ namespace System.Data.ProviderBase {
{
case PoolBlockingPeriod.Auto:
{
- if (IsAzureSqlServerEndpoint(poolGroupConnectionOptions.DataSource))
+ if (ADP.IsAzureSqlServerEndpoint(poolGroupConnectionOptions.DataSource))
{
return false; // in Azure it will be Disabled
}
@@ -1243,7 +1209,7 @@ namespace System.Data.ProviderBase {
return true;
}
else if (retry == null) {
- // timed out on a [....] call
+ // timed out on a sync call
return true;
}
diff --git a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolCounters.cs b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolCounters.cs
index 03ab70dbe1c..e0484c2f89b 100644
--- a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolCounters.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolCounters.cs
@@ -2,7 +2,7 @@
// <copyright file="DbConnectionPoolCounters.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.ProviderBase {
diff --git a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolGroup.cs b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolGroup.cs
index 91fb7aacb90..126ced9adea 100644
--- a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolGroup.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolGroup.cs
@@ -2,7 +2,7 @@
// <copyright file="DbConnectionPoolGroup.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.ProviderBase {
diff --git a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolGroupProviderInfo.cs b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolGroupProviderInfo.cs
index 32a8ebfb298..dfd1796b93e 100644
--- a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolGroupProviderInfo.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolGroupProviderInfo.cs
@@ -2,8 +2,8 @@
// <copyright file="DbConnectionPoolGroupProviderInfo.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.ProviderBase {
diff --git a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolIdentity.cs b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolIdentity.cs
index 846ff67f2c2..b7876128be1 100644
--- a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolIdentity.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolIdentity.cs
@@ -2,7 +2,7 @@
// <copyright file="DbConnectionPoolIdentity.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.ProviderBase {
diff --git a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolOptions.cs b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolOptions.cs
index fa3f82e553a..33610b61804 100644
--- a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolOptions.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolOptions.cs
@@ -2,7 +2,7 @@
// <copyright file="DbConnectionPoolGroupOptions.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.ProviderBase {
diff --git a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataCollectionNames.cs b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataCollectionNames.cs
index 2408d5f4a36..118800f7cf7 100644
--- a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataCollectionNames.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataCollectionNames.cs
@@ -2,8 +2,8 @@
// <copyright file="DbMetaDataCollectionNames.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataColumnNames.cs b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataColumnNames.cs
index c8237455efd..6d12c91692d 100644
--- a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataColumnNames.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataColumnNames.cs
@@ -2,8 +2,8 @@
// <copyright file="DbMetaDataColumnNames.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Common {
diff --git a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataFactory.cs b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataFactory.cs
index 5267928dd0d..67025f4b56f 100644
--- a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataFactory.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataFactory.cs
@@ -2,8 +2,8 @@
// <copyright file="dbmetadatafactory.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.ProviderBase {
diff --git a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbParameterCollectionHelper.cs b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbParameterCollectionHelper.cs
index 33266444b1b..d28d3414eff 100644
--- a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbParameterCollectionHelper.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbParameterCollectionHelper.cs
@@ -2,7 +2,7 @@
// <copyright file="DbParameterCollectionBase.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace NAMESPACE
diff --git a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbParameterHelper.cs b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbParameterHelper.cs
index 7efd67b6a33..b968d12dc69 100644
--- a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbParameterHelper.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbParameterHelper.cs
@@ -2,7 +2,7 @@
// <copyright file="DbParameterHelper.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace NAMESPACE {
diff --git a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbReferenceCollection.cs b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbReferenceCollection.cs
index 8a1baeec7cf..1f55090b42a 100644
--- a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbReferenceCollection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/DbReferenceCollection.cs
@@ -2,8 +2,8 @@
// <copyright file="DbReferenceCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.ProviderBase {
diff --git a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/SchemaMapping.cs b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/SchemaMapping.cs
index 9c0e435130b..0118a9a644e 100644
--- a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/SchemaMapping.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/SchemaMapping.cs
@@ -2,7 +2,7 @@
// <copyright file="SchemaMapping.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.ProviderBase {
diff --git a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/TimeoutTimer.cs b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/TimeoutTimer.cs
index 8c89bab8e4b..24172d3bdae 100644
--- a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/TimeoutTimer.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/TimeoutTimer.cs
@@ -5,8 +5,8 @@
//
// Class used to manage timeouts in complex system operations.
//
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.ProviderBase
diff --git a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/WrappedIUnknown.cs b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/WrappedIUnknown.cs
index c1501a0d289..2fdb4797888 100644
--- a/mcs/class/referencesource/System.Data/System/Data/ProviderBase/WrappedIUnknown.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/ProviderBase/WrappedIUnknown.cs
@@ -2,8 +2,8 @@
// <copyright file="WrappedIUnknown.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.ProviderBase {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Range.cs b/mcs/class/referencesource/System.Data/System/Data/Range.cs
index 790bf3055f3..6c3ea0a9c21 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Range.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Range.cs
@@ -2,9 +2,9 @@
// <copyright file="Range.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/RbTree.cs b/mcs/class/referencesource/System.Data/System/Data/RbTree.cs
index 4048974b984..57ab5bfa1ee 100644
--- a/mcs/class/referencesource/System.Data/System/Data/RbTree.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/RbTree.cs
@@ -2,8 +2,8 @@
// <copyright file="Selection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
#if DEBUG
diff --git a/mcs/class/referencesource/System.Data/System/Data/RecordManager.cs b/mcs/class/referencesource/System.Data/System/Data/RecordManager.cs
index 106bfafe054..608f79c6f9d 100644
--- a/mcs/class/referencesource/System.Data/System/Data/RecordManager.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/RecordManager.cs
@@ -2,8 +2,8 @@
// <copyright file="RecordManager.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/RecordsAffectedEventArgs.cs b/mcs/class/referencesource/System.Data/System/Data/RecordsAffectedEventArgs.cs
index 9f2c8aef1ab..82322d9618a 100644
--- a/mcs/class/referencesource/System.Data/System/Data/RecordsAffectedEventArgs.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/RecordsAffectedEventArgs.cs
@@ -2,8 +2,8 @@
// <copyright file="StatementCompletedEventArgs.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/RelatedView.cs b/mcs/class/referencesource/System.Data/System/Data/RelatedView.cs
index 7493a8b56ae..e1aed175ae1 100644
--- a/mcs/class/referencesource/System.Data/System/Data/RelatedView.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/RelatedView.cs
@@ -2,8 +2,8 @@
// <copyright file="RelatedView.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/RelationshipConverter.cs b/mcs/class/referencesource/System.Data/System/Data/RelationshipConverter.cs
index dbddce219e3..2fec1c69e26 100644
--- a/mcs/class/referencesource/System.Data/System/Data/RelationshipConverter.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/RelationshipConverter.cs
@@ -2,9 +2,9 @@
// <copyright file="RelationshipConverter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLBinary.cs b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLBinary.cs
index 114fd109a6e..e9df08a601d 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLBinary.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLBinary.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <owner current="true" primary="true">junfang</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
//**************************************************************************
diff --git a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLBoolean.cs b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLBoolean.cs
index 300eb2914f0..21f2b3df4da 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLBoolean.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLBoolean.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <owner current="true" primary="true">junfang</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
//**************************************************************************
diff --git a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLByte.cs b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLByte.cs
index f72b2e84388..3ae27040ea1 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLByte.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLByte.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <owner current="true" primary="true">junfang</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
//**************************************************************************
@@ -49,7 +49,7 @@ namespace System.Data.SqlTypes {
private bool m_fNotNull; // false if null
private byte m_value;
- private static readonly int x_iBitNotByteMax = ~0xff;
+ private const int x_iBitNotByteMax = ~0xff;
// constructor
// construct a Null
diff --git a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLBytes.cs b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLBytes.cs
index 1c7dd76f46f..5c77bc04557 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLBytes.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLBytes.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <owner current="true" primary="true">junfang</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
//**************************************************************************
diff --git a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLChars.cs b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLChars.cs
index 0bd0bd5d0f8..ea61e840461 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLChars.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLChars.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <owner current="true" primary="true">junfang</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
//**************************************************************************
diff --git a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLDateTime.cs b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLDateTime.cs
index 6217081b98f..666b2afc370 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLDateTime.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLDateTime.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <owner current="true" primary="true">junfang</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
//**************************************************************************
@@ -56,26 +56,26 @@ namespace System.Data.SqlTypes {
// Constants
// Number of (100ns) ticks per time unit
- private static readonly double SQLTicksPerMillisecond = 0.3;
- public static readonly int SQLTicksPerSecond = 300;
- public static readonly int SQLTicksPerMinute = SQLTicksPerSecond * 60;
- public static readonly int SQLTicksPerHour = SQLTicksPerMinute * 60;
- private static readonly int SQLTicksPerDay = SQLTicksPerHour * 24;
+ private const double SQLTicksPerMillisecond = 0.3;
+ public static readonly int SQLTicksPerSecond = 300;
+ public static readonly int SQLTicksPerMinute = SQLTicksPerSecond * 60;
+ public static readonly int SQLTicksPerHour = SQLTicksPerMinute * 60;
+ private static readonly int SQLTicksPerDay = SQLTicksPerHour * 24;
- private static readonly long TicksPerSecond = TimeSpan.TicksPerMillisecond * 1000;
+ private const long TicksPerSecond = TimeSpan.TicksPerMillisecond * 1000;
private static readonly DateTime SQLBaseDate = new DateTime(1900, 1, 1);
private static readonly long SQLBaseDateTicks = SQLBaseDate.Ticks;
- private static readonly int MinYear = 1753; // Jan 1 1753
- private static readonly int MaxYear = 9999; // Dec 31 9999
+ private const int MinYear = 1753; // Jan 1 1753
+ private const int MaxYear = 9999; // Dec 31 9999
- private static readonly int MinDay = -53690; // Jan 1 1753
- private static readonly int MaxDay = 2958463; // Dec 31 9999 is this many days from Jan 1 1900
- private static readonly int MinTime = 0; // 00:00:0:000PM
+ private const int MinDay = -53690; // Jan 1 1753
+ private const int MaxDay = 2958463; // Dec 31 9999 is this many days from Jan 1 1900
+ private const int MinTime = 0; // 00:00:0:000PM
private static readonly int MaxTime = SQLTicksPerDay - 1; // = 25919999, 11:59:59:997PM
- private static readonly int DayBase = 693595; // Jan 1 1900 is this many days from Jan 1 0001
+ private const int DayBase = 693595; // Jan 1 1900 is this many days from Jan 1 0001
private static readonly int[] DaysToMonth365 = new int[] {
@@ -87,7 +87,7 @@ namespace System.Data.SqlTypes {
private static readonly DateTime MaxDateTime = DateTime.MaxValue;
private static readonly TimeSpan MinTimeSpan = MinDateTime.Subtract(SQLBaseDate);
private static readonly TimeSpan MaxTimeSpan = MaxDateTime.Subtract(SQLBaseDate);
- private static readonly String x_ISO8601_DateTimeFormat = "yyyy-MM-ddTHH:mm:ss.fff";
+ private const String x_ISO8601_DateTimeFormat = "yyyy-MM-ddTHH:mm:ss.fff";
// These formats are valid styles in SQL Server (style 9, 12, 13, 14)
// but couldn't be recognized by the default parse. Needs to call
diff --git a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLDecimal.cs b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLDecimal.cs
index a992e479ef8..db66e9680eb 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLDecimal.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLDecimal.cs
@@ -3,9 +3,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <owner current="true" primary="true">junfang</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
//**************************************************************************
@@ -69,44 +69,44 @@ namespace System.Data.SqlTypes {
internal UInt32 m_data3;
internal UInt32 m_data4;
- private static readonly byte NUMERIC_MAX_PRECISION = 38; // Maximum precision of numeric
+ private const byte NUMERIC_MAX_PRECISION = 38; // Maximum precision of numeric
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
- public static readonly byte MaxPrecision = NUMERIC_MAX_PRECISION; // max SS precision
+ public static readonly byte MaxPrecision = NUMERIC_MAX_PRECISION; // max SS precision
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
- public static readonly byte MaxScale = NUMERIC_MAX_PRECISION; // max SS scale
+ public static readonly byte MaxScale = NUMERIC_MAX_PRECISION; // max SS scale
- private static readonly byte x_bNullMask = 1; // bit mask for null bit in m_bStatus
- private static readonly byte x_bIsNull = 0; // is null
- private static readonly byte x_bNotNull = 1; // is not null
- private static readonly byte x_bReverseNullMask = unchecked((byte)~x_bNullMask);
+ private const byte x_bNullMask = 1; // bit mask for null bit in m_bStatus
+ private const byte x_bIsNull = 0; // is null
+ private const byte x_bNotNull = 1; // is not null
+ private const byte x_bReverseNullMask = unchecked((byte)~x_bNullMask);
- private static readonly byte x_bSignMask = 2; // bit mask for sign bit in m_bStatus
- private static readonly byte x_bPositive = 0; // is positive
- private static readonly byte x_bNegative = 2; // is negative
- private static readonly byte x_bReverseSignMask = unchecked((byte)~x_bSignMask);
+ private const byte x_bSignMask = 2; // bit mask for sign bit in m_bStatus
+ private const byte x_bPositive = 0; // is positive
+ private const byte x_bNegative = 2; // is negative
+ private const byte x_bReverseSignMask = unchecked((byte)~x_bSignMask);
- private static readonly uint x_uiZero = (uint) 0;
+ private const uint x_uiZero = (uint) 0;
- private static readonly int x_cNumeMax = 4;
- private static readonly long x_lInt32Base = ((long)1) << 32; // 2**32
- private static readonly ulong x_ulInt32Base = ((ulong)1) << 32; // 2**32
- private static readonly ulong x_ulInt32BaseForMod = x_ulInt32Base - 1; // 2**32 - 1 (0xFFF...FF)
+ private const int x_cNumeMax = 4;
+ private const long x_lInt32Base = ((long)1) << 32; // 2**32
+ private const ulong x_ulInt32Base = ((ulong)1) << 32; // 2**32
+ private const ulong x_ulInt32BaseForMod = x_ulInt32Base - 1; // 2**32 - 1 (0xFFF...FF)
- internal static readonly ulong x_llMax = Int64.MaxValue; // Max of Int64
+ internal const ulong x_llMax = Int64.MaxValue; // Max of Int64
- private static readonly uint x_ulBase10 = 10;
+ private const uint x_ulBase10 = 10;
- private static readonly double DUINT_BASE = (double)x_lInt32Base; // 2**32
- private static readonly double DUINT_BASE2 = DUINT_BASE * DUINT_BASE; // 2**64
- private static readonly double DUINT_BASE3 = DUINT_BASE2 * DUINT_BASE; // 2**96
- private static readonly double DMAX_NUME = 1.0e+38; // Max value of numeric
- private static readonly uint DBL_DIG = 17; // Max decimal digits of double
+ private const double DUINT_BASE = (double)x_lInt32Base; // 2**32
+ private const double DUINT_BASE2 = DUINT_BASE * DUINT_BASE; // 2**64
+ private const double DUINT_BASE3 = DUINT_BASE2 * DUINT_BASE; // 2**96
+ private const double DMAX_NUME = 1.0e+38; // Max value of numeric
+ private const uint DBL_DIG = 17; // Max decimal digits of double
- private static readonly byte x_cNumeDivScaleMin = 6; // Minimum result scale of numeric division
+ private const byte x_cNumeDivScaleMin = 6; // Minimum result scale of numeric division
// Array of multipliers for lAdjust and Ceiling/Floor.
private static readonly uint[] x_rgulShiftBase = new uint[9] {
@@ -1907,25 +1907,25 @@ namespace System.Data.SqlTypes {
// Powers of ten (used by BGetPrecI4,BGetPrecI8)
- private static readonly uint x_ulT1 = 10;
- private static readonly uint x_ulT2 = 100;
- private static readonly uint x_ulT3 = 1000;
- private static readonly uint x_ulT4 = 10000;
- private static readonly uint x_ulT5 = 100000;
- private static readonly uint x_ulT6 = 1000000;
- private static readonly uint x_ulT7 = 10000000;
- private static readonly uint x_ulT8 = 100000000;
- private static readonly uint x_ulT9 = 1000000000;
- private static readonly ulong x_dwlT10 = 10000000000;
- private static readonly ulong x_dwlT11 = 100000000000;
- private static readonly ulong x_dwlT12 = 1000000000000;
- private static readonly ulong x_dwlT13 = 10000000000000;
- private static readonly ulong x_dwlT14 = 100000000000000;
- private static readonly ulong x_dwlT15 = 1000000000000000;
- private static readonly ulong x_dwlT16 = 10000000000000000;
- private static readonly ulong x_dwlT17 = 100000000000000000;
- private static readonly ulong x_dwlT18 = 1000000000000000000;
- private static readonly ulong x_dwlT19 = 10000000000000000000;
+ private const uint x_ulT1 = 10;
+ private const uint x_ulT2 = 100;
+ private const uint x_ulT3 = 1000;
+ private const uint x_ulT4 = 10000;
+ private const uint x_ulT5 = 100000;
+ private const uint x_ulT6 = 1000000;
+ private const uint x_ulT7 = 10000000;
+ private const uint x_ulT8 = 100000000;
+ private const uint x_ulT9 = 1000000000;
+ private const ulong x_dwlT10 = 10000000000;
+ private const ulong x_dwlT11 = 100000000000;
+ private const ulong x_dwlT12 = 1000000000000;
+ private const ulong x_dwlT13 = 10000000000000;
+ private const ulong x_dwlT14 = 100000000000000;
+ private const ulong x_dwlT15 = 1000000000000000;
+ private const ulong x_dwlT16 = 10000000000000000;
+ private const ulong x_dwlT17 = 100000000000000000;
+ private const ulong x_dwlT18 = 1000000000000000000;
+ private const ulong x_dwlT19 = 10000000000000000000;
//------------------------------------------------------------------
//BGetPrecI4
diff --git a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLDouble.cs b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLDouble.cs
index 3aace9925ae..5e25a2fc0ce 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLDouble.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLDouble.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <owner current="true" primary="true">junfang</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
//**************************************************************************
diff --git a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLFileStream.cs b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLFileStream.cs
index 05bb96edc14..0fd017e4204 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLFileStream.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLFileStream.cs
@@ -2,9 +2,9 @@
// <copyright file="SqlFileStream.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
@@ -428,7 +428,7 @@ namespace System.Data.SqlTypes
// 2. GetFullPathName API of kernel32 does not accept paths with length (in chars) greater than 32766
// (32766 is actually Int16.MaxValue - 1, while (-1) is for NULL termination)
// We must check for the lowest value between the the two
- static private readonly int MaxWin32PathLength = Int16.MaxValue - 1;
+ private const int MaxWin32PathLength = Int16.MaxValue - 1;
[ConditionalAttribute("DEBUG")]
static private void AssertPathFormat(string path)
diff --git a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLGuid.cs b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLGuid.cs
index 46e62e8440b..e62e9ab1f47 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLGuid.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLGuid.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <owner current="true" primary="true">junfang</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
//**************************************************************************
@@ -41,7 +41,7 @@ namespace System.Data.SqlTypes {
[Serializable]
[XmlSchemaProvider("GetXsdType")]
public struct SqlGuid : INullable, IComparable, IXmlSerializable {
- private static readonly int SizeOfGuid = 16;
+ private const int SizeOfGuid = 16;
// Comparison orders.
private static readonly int[] x_rgiGuidOrder = new int[16]
diff --git a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLInt16.cs b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLInt16.cs
index 276862274cf..1691de4bf0c 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLInt16.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLInt16.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <owner current="true" primary="true">junfang</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
//**************************************************************************
@@ -48,7 +48,7 @@ namespace System.Data.SqlTypes {
private bool m_fNotNull; // false if null
private short m_value;
- private static readonly int O_MASKI2 = ~0x00007fff;
+ private const int O_MASKI2 = ~0x00007fff;
// constructor
// construct a Null
diff --git a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLInt32.cs b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLInt32.cs
index 70667a2d6f7..b97fe87c5ef 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLInt32.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLInt32.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <owner current="true" primary="true">junfang</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
//**************************************************************************
@@ -47,8 +47,8 @@ namespace System.Data.SqlTypes {
private bool m_fNotNull; // false if null, the default ctor (plain 0) will make it Null
private int m_value;
- private static readonly long x_iIntMin = Int32.MinValue; // minimum (signed) int value
- private static readonly long x_lBitNotIntMax = ~(long)(Int32.MaxValue);
+ private const long x_iIntMin = Int32.MinValue; // minimum (signed) int value
+ private const long x_lBitNotIntMax = ~(long)(Int32.MaxValue);
// constructor
// construct a Null
diff --git a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLInt64.cs b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLInt64.cs
index 523433c9b8b..60337ce30f0 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLInt64.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLInt64.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <owner current="true" primary="true">junfang</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
//**************************************************************************
@@ -47,8 +47,8 @@ namespace System.Data.SqlTypes {
private bool m_fNotNull; // false if null
private long m_value;
- private static readonly long x_lLowIntMask = 0xffffffff;
- private static readonly long x_lHighIntMask = unchecked((long)0xffffffff00000000);
+ private const long x_lLowIntMask = 0xffffffff;
+ private const long x_lHighIntMask = unchecked((long)0xffffffff00000000);
// constructor
diff --git a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLMoney.cs b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLMoney.cs
index e64f46118b1..d40b0edff8f 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLMoney.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLMoney.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <owner current="true" primary="true">junfang</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
//**************************************************************************
@@ -52,12 +52,12 @@ namespace System.Data.SqlTypes {
private long m_value;
// SQL Server stores money8 as ticks of 1/10000.
- internal static readonly int x_iMoneyScale = 4;
- private static readonly long x_lTickBase = 10000;
- private static readonly double x_dTickBase = (double)x_lTickBase;
+ internal const int x_iMoneyScale = 4;
+ private const long x_lTickBase = 10000;
+ private const double x_dTickBase = (double)x_lTickBase;
- private static readonly long MinLong = unchecked((long)0x8000000000000000L) / x_lTickBase;
- private static readonly long MaxLong = 0x7FFFFFFFFFFFFFFFL / x_lTickBase;
+ private const long MinLong = unchecked((long)0x8000000000000000L) / x_lTickBase;
+ private const long MaxLong = 0x7FFFFFFFFFFFFFFFL / x_lTickBase;
// constructor
// construct a Null
diff --git a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLResource.cs b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLResource.cs
index 679bc8ff87a..3ce29437d2f 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLResource.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLResource.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <owner current="true" primary="true">junfang</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
//**************************************************************************
diff --git a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLSingle.cs b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLSingle.cs
index 5e7aa686959..124a7fe13e6 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLSingle.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLSingle.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <owner current="true" primary="true">junfang</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
//**************************************************************************
diff --git a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLString.cs b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLString.cs
index 4bc110c4c53..944dd623003 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLString.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLString.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <owner current="true" primary="true">junfang</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
//**************************************************************************
@@ -105,8 +105,8 @@ namespace System.Data.SqlTypes {
SqlCompareOptions.IgnoreNonSpace | SqlCompareOptions.IgnoreKanaType |
SqlCompareOptions.BinarySort | SqlCompareOptions.BinarySort2;
- internal static readonly int x_lcidUSEnglish = 0x00000409;
- private static readonly int x_lcidBinary = 0x00008200;
+ internal const int x_lcidUSEnglish = 0x00000409;
+ private const int x_lcidBinary = 0x00008200;
// constructor
diff --git a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLUtility.cs b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLUtility.cs
index 5a8e648115d..253b85477f1 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLUtility.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SQLUtility.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <owner current="true" primary="true">junfang</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
//**************************************************************************
diff --git a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SqlCharStream.cs b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SqlCharStream.cs
index 3d77065fc84..e270bc00b86 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SqlCharStream.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SqlCharStream.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <owner current="true" primary="true">junfang</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
//**************************************************************************
diff --git a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SqlTypesSchemaImporter.cs b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SqlTypesSchemaImporter.cs
index 0d65de3b205..6b390b537ed 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SqlTypesSchemaImporter.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SqlTypesSchemaImporter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <owner current="true" primary="true">dondu</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SqlXml.cs b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SqlXml.cs
index d05ed2c80a2..cab4fed085a 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SqlXml.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/SqlXml.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlXmlReader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
//**************************************************************************
diff --git a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/UnsafeNativeMethods.cs b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/UnsafeNativeMethods.cs
index c1639481477..7c847edace3 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SQLTypes/UnsafeNativeMethods.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SQLTypes/UnsafeNativeMethods.cs
@@ -2,9 +2,9 @@
// <copyright file="SafeNativeMethods.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Select.cs b/mcs/class/referencesource/System.Data/System/Data/Select.cs
index afac088726e..118a08534ab 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Select.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Select.cs
@@ -2,9 +2,9 @@
// <copyright file="Select.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
@@ -52,7 +52,7 @@ namespace System.Data {
return ((op >= Operators.EqualTo && op <= Operators.LessOrEqual) || op == Operators.Is || op == Operators.IsNot);
}
- // [....] : Gathers all linear expressions in to this.linearExpression and all binary expressions in to their respective candidate columns expressions
+ // Microsoft : Gathers all linear expressions in to this.linearExpression and all binary expressions in to their respective candidate columns expressions
private void AnalyzeExpression(BinaryNode expr) {
if (this.linearExpression == this.expression)
return;
@@ -355,7 +355,7 @@ namespace System.Data {
matchedCandidates = 0;
if (this.linearExpression != this.expression) {
IndexField[] fields = index.IndexFields;
- while (matchedCandidates < j) { // [....] : j = index.IndexDesc.Length
+ while (matchedCandidates < j) { // Microsoft : j = index.IndexDesc.Length
ColumnInfo canColumn = candidateColumns[fields[matchedCandidates].Column.Ordinal];
if (canColumn == null || canColumn.expr == null)
break;
@@ -459,7 +459,7 @@ namespace System.Data {
return table.NewRowArray(0);
Range range;
- if (matchedCandidates == 0) { // [....] : Either dont have rowFilter or only linear search expression
+ if (matchedCandidates == 0) { // Microsoft : Either dont have rowFilter or only linear search expression
range = new Range(0, index.RecordCount-1);
Debug.Assert(!needSorting, "What are we doing here if no real reuse of this index ?");
this.linearExpression = this.expression;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Selection.cs b/mcs/class/referencesource/System.Data/System/Data/Selection.cs
index 6ef2dd1eaba..cdb4f24e6f0 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Selection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Selection.cs
@@ -2,8 +2,8 @@
// <copyright file="Selection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SimpleType.cs b/mcs/class/referencesource/System.Data/System/Data/SimpleType.cs
index 13ecfc5b7fe..a1d995b6009 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SimpleType.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SimpleType.cs
@@ -2,9 +2,9 @@
// <copyright file="SimpleType.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
@@ -38,7 +38,7 @@ namespace System.Data {
string maxInclusive = "";
string minExclusive = "";
string minInclusive = "";
- //REMOVED: encoding due to [....] 2001 XDS changes
+ //REMOVED: encoding due to Microsoft 2001 XDS changes
//
internal string enumeration = "";
@@ -267,7 +267,7 @@ namespace System.Data {
type.SetAttribute(Keywords.BASE, baseSimpleType.Name);
}
}
- else { // [....]
+ else { // Microsoft
type.SetAttribute(Keywords.BASE, baseSimpleType.Name);
}
}
diff --git a/mcs/class/referencesource/System.Data/System/Data/Sql/SqlDataSourceEnumerator.cs b/mcs/class/referencesource/System.Data/System/Data/Sql/SqlDataSourceEnumerator.cs
index a86c03ff01e..657bed3dc7a 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Sql/SqlDataSourceEnumerator.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Sql/SqlDataSourceEnumerator.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlDataSourceEnumerator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Sql {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Sql/SqlFacetAttribute.cs b/mcs/class/referencesource/System.Data/System/Data/Sql/SqlFacetAttribute.cs
index 7b56e9852c1..0d3fc92f46b 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Sql/SqlFacetAttribute.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Sql/SqlFacetAttribute.cs
@@ -3,12 +3,12 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved.
// Information Contained Herein is Proprietary and Confidential.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <owner current="true" primary="true">daltudov</owner>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <owner current="true" primary="false">beysims</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
// <owner current="true" primary="false">vadimt</owner>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data/System/Data/Sql/SqlFunctionAttribute.cs b/mcs/class/referencesource/System.Data/System/Data/Sql/SqlFunctionAttribute.cs
index b1af7c80738..c11a8f4caf0 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Sql/SqlFunctionAttribute.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Sql/SqlFunctionAttribute.cs
@@ -3,12 +3,12 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved.
// Information Contained Herein is Proprietary and Confidential.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <owner current="true" primary="true">daltudov</owner>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <owner current="true" primary="false">beysims</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
// <owner current="true" primary="false">vadimt</owner>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data/System/Data/Sql/SqlGenericUtil.cs b/mcs/class/referencesource/System.Data/System/Data/Sql/SqlGenericUtil.cs
index db01b7ad5dd..e5a3b390726 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Sql/SqlGenericUtil.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Sql/SqlGenericUtil.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlGenericUtil.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Sql {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Sql/SqlMetaData.cs b/mcs/class/referencesource/System.Data/System/Data/Sql/SqlMetaData.cs
index d17f8b723ab..ea709ecc098 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Sql/SqlMetaData.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Sql/SqlMetaData.cs
@@ -2,9 +2,9 @@
// <copyright file="SqlMetaData.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace Microsoft.SqlServer.Server {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Sql/SqlMethodAttribute.cs b/mcs/class/referencesource/System.Data/System/Data/Sql/SqlMethodAttribute.cs
index 66eee2f72e2..3203b1748c5 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Sql/SqlMethodAttribute.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Sql/SqlMethodAttribute.cs
@@ -3,13 +3,13 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved.
// Information Contained Herein is Proprietary and Confidential.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <owner current="true" primary="true">daltudov</owner>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <owner current="true" primary="false">beysims</owner>
// <owner current="true" primary="false">junfang</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
// <owner current="true" primary="false">vadimt</owner>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data/System/Data/Sql/SqlNotificationRequest.cs b/mcs/class/referencesource/System.Data/System/Data/Sql/SqlNotificationRequest.cs
index 9b5149d529a..986d8f5d6d3 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Sql/SqlNotificationRequest.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Sql/SqlNotificationRequest.cs
@@ -2,9 +2,9 @@
// <copyright file="SqlNotificationRequest.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.Sql {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Sql/SqlProcedureAttribute.cs b/mcs/class/referencesource/System.Data/System/Data/Sql/SqlProcedureAttribute.cs
index 8f28089cbec..c88caeaeaa7 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Sql/SqlProcedureAttribute.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Sql/SqlProcedureAttribute.cs
@@ -3,12 +3,12 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved.
// Information Contained Herein is Proprietary and Confidential.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <owner current="true" primary="true">daltudov</owner>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <owner current="true" primary="false">beysims</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
// <owner current="true" primary="false">vadimt</owner>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data/System/Data/Sql/SqlTriggerAttribute.cs b/mcs/class/referencesource/System.Data/System/Data/Sql/SqlTriggerAttribute.cs
index dbb72b83d23..303687749f4 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Sql/SqlTriggerAttribute.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Sql/SqlTriggerAttribute.cs
@@ -3,12 +3,12 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved.
// Information Contained Herein is Proprietary and Confidential.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <owner current="true" primary="true">daltudov</owner>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <owner current="true" primary="false">beysims</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
// <owner current="true" primary="false">vadimt</owner>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data/System/Data/Sql/SqlUserDefinedAggregateAttribute.cs b/mcs/class/referencesource/System.Data/System/Data/Sql/SqlUserDefinedAggregateAttribute.cs
index 56ba4a976c2..f7c1307fd50 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Sql/SqlUserDefinedAggregateAttribute.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Sql/SqlUserDefinedAggregateAttribute.cs
@@ -3,15 +3,15 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved.
// Information Contained Herein is Proprietary and Confidential.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <owner current="true" primary="true">daltudov</owner>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <owner current="true" primary="false">beysims</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
// <owner current="true" primary="false">vadimt</owner>
// <owner current="false" primary="false">venkar</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace Microsoft.SqlServer.Server {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Sql/SqlUserDefinedTypeAttribute.cs b/mcs/class/referencesource/System.Data/System/Data/Sql/SqlUserDefinedTypeAttribute.cs
index 2684b82feff..8dddb2200cb 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Sql/SqlUserDefinedTypeAttribute.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Sql/SqlUserDefinedTypeAttribute.cs
@@ -3,15 +3,15 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved.
// Information Contained Herein is Proprietary and Confidential.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <owner current="true" primary="true">daltudov</owner>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <owner current="true" primary="false">beysims</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
// <owner current="true" primary="false">vadimt</owner>
// <owner current="false" primary="false">venkar</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace Microsoft.SqlServer.Server {
diff --git a/mcs/class/referencesource/System.Data/System/Data/Sql/invalidudtexception.cs b/mcs/class/referencesource/System.Data/System/Data/Sql/invalidudtexception.cs
index 56efbc86f0f..527832fdb4f 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Sql/invalidudtexception.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Sql/invalidudtexception.cs
@@ -2,8 +2,8 @@
// <copyright file="InvalidUdtException.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/Sql/sqlnorm.cs b/mcs/class/referencesource/System.Data/System/Data/Sql/sqlnorm.cs
index 2be7f1237ab..e27d86b3f36 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Sql/sqlnorm.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Sql/sqlnorm.cs
@@ -3,14 +3,14 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved.
// Information Contained Herein is Proprietary and Confidential.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <owner current="true" primary="true">daltudov</owner>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <owner current="true" primary="false">beysims</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
// <owner current="true" primary="false">vadimt</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="false" primary="false">Microsoft</owner>
// <owner current="false" primary="false">venkar</owner>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data/System/Data/Sql/sqlser.cs b/mcs/class/referencesource/System.Data/System/Data/Sql/sqlser.cs
index 579818e6ea3..e4a1cada184 100644
--- a/mcs/class/referencesource/System.Data/System/Data/Sql/sqlser.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/Sql/sqlser.cs
@@ -3,15 +3,15 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved.
// Information Contained Herein is Proprietary and Confidential.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <owner current="true" primary="true">daltudov</owner>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <owner current="true" primary="false">beysims</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
// <owner current="true" primary="false">vadimt</owner>
// <owner current="false" primary="false">venkar</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/RowsCopiedEventArgs.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/RowsCopiedEventArgs.cs
index 0a93882a2d9..cc294b15712 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/RowsCopiedEventArgs.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/RowsCopiedEventArgs.cs
@@ -2,8 +2,8 @@
// <copyright file="RowsCopiedEvent.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlBuffer.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlBuffer.cs
index f4dce919cf9..9c4084086bb 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlBuffer.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlBuffer.cs
@@ -2,9 +2,9 @@
// <copyright file="SqlDataReader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlBulkCopy.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlBulkCopy.cs
index 2a4b96c02a3..f538fdfe009 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlBulkCopy.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlBulkCopy.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlBulkCopy.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
// todo list:
@@ -531,7 +531,7 @@ namespace System.Data.SqlClient {
}
// Creates and then executes initial query to get information about the targettable
- // When __isAsyncBulkCopy == false (i.e. it is [....] copy): out result contains the resulset. Returns null.
+ // When __isAsyncBulkCopy == false (i.e. it is Sync copy): out result contains the resulset. Returns null.
// When __isAsyncBulkCopy == true (i.e. it is Async copy): This still uses the _parser.Run method synchronously and return Task<BulkCopySimpleResultSet>.
// We need to have a _parser.RunAsync to make it real async.
private Task<BulkCopySimpleResultSet> CreateAndExecuteInitialQueryAsync(out BulkCopySimpleResultSet result) {
@@ -1067,7 +1067,7 @@ namespace System.Data.SqlClient {
// unified method to read a row from the current rowsource
// When _isAsyncBulkCopy == true (i.e. async copy): returns Task<bool> when IDataReader is a DbDataReader, Null for others.
- // When _isAsyncBulkCopy == false (i.e. [....] copy): returns null. Uses ReadFromRowSource to get the boolean value.
+ // When _isAsyncBulkCopy == false (i.e. sync copy): returns null. Uses ReadFromRowSource to get the boolean value.
// "more" -- should be used by the caller only when the return value is null.
private Task ReadFromRowSourceAsync(CancellationToken cts) {
#if !PROJECTK
@@ -2081,7 +2081,7 @@ namespace System.Data.SqlClient {
// Reads a cell and then writes it.
// Read may block at this moment since there is no getValueAsync or DownStream async at this moment.
// When _isAsyncBulkCopy == true: Write will return Task (when async method runs asynchronously) or Null (when async call actually ran synchronously) for performance.
- // When _isAsyncBulkCopy == false: Writes are purely [....]. This method reutrn null at the end.
+ // When _isAsyncBulkCopy == false: Writes are purely sync. This method reutrn null at the end.
//
private Task ReadWriteColumnValueAsync(int col) {
bool isSqlType;
@@ -2392,7 +2392,7 @@ namespace System.Data.SqlClient {
AsyncHelper.ContinueTask(commandTask, source, () => {
Task continuedTask = CopyBatchesAsyncContinued(internalResults, updateBulkCommandText, cts, source);
if (continuedTask == null) {
- // Continuation finished [....], recall into CopyBatchesAsync to continue
+ // Continuation finished sync, recall into CopyBatchesAsync to continue
CopyBatchesAsync(internalResults, updateBulkCommandText, cts, source);
}
}, _connection.GetOpenTdsConnection());
@@ -2443,7 +2443,7 @@ namespace System.Data.SqlClient {
AsyncHelper.ContinueTask(task, source, () => {
Task continuedTask = CopyBatchesAsyncContinuedOnSuccess(internalResults, updateBulkCommandText, cts, source);
if (continuedTask == null) {
- // Continuation finished [....], recall into CopyBatchesAsync to continue
+ // Continuation finished sync, recall into CopyBatchesAsync to continue
CopyBatchesAsync(internalResults, updateBulkCommandText, cts, source);
}
}, _connection.GetOpenTdsConnection(), _ => CopyBatchesAsyncContinuedOnError(cleanupParser: false), () => CopyBatchesAsyncContinuedOnError(cleanupParser: true));
@@ -2586,7 +2586,7 @@ namespace System.Data.SqlClient {
// The continuation part of WriteToServerInternalRest. Executes when the initial query task is completed. (see, WriteToServerInternalRest).
// It carries on the source which is passed from the WriteToServerInternalRest and performs SetResult when the entire copy is done.
- // The carried on source may be null in case of [....] copy. So no need to SetResult at that time.
+ // The carried on source may be null in case of Sync copy. So no need to SetResult at that time.
// It launches the copy operation.
//
private void WriteToServerInternalRestContinuedAsync(BulkCopySimpleResultSet internalResults, CancellationToken cts, TaskCompletionSource<object> source) {
@@ -2683,7 +2683,7 @@ namespace System.Data.SqlClient {
// Rest of the WriteToServerInternalAsync method.
// It carries on the source from its caller WriteToServerInternal.
- // source is null in case of [....] bcp. But valid in case of Async bcp.
+ // source is null in case of Sync bcp. But valid in case of Async bcp.
// It calls the WriteToServerInternalRestContinuedAsync as a continuation of the initial query task.
//
private void WriteToServerInternalRestAsync(CancellationToken cts, TaskCompletionSource<object> source) {
@@ -2793,7 +2793,7 @@ namespace System.Data.SqlClient {
}
}
- // This returns Task for Async, Null for [....]
+ // This returns Task for Async, Null for Sync
//
private Task WriteToServerInternalAsync(CancellationToken ctoken) {
TaskCompletionSource<object> source = null;
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlBulkCopyColumnMapping.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlBulkCopyColumnMapping.cs
index d4166c2d911..16b85f3a23d 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlBulkCopyColumnMapping.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlBulkCopyColumnMapping.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlBulkCopyColumnMapping.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
// Todo: rename the file
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlBulkCopyColumnMappingCollection.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlBulkCopyColumnMappingCollection.cs
index ac37a1d924c..d11c23c8c61 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlBulkCopyColumnMappingCollection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlBulkCopyColumnMappingCollection.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlBulkCopyMappingCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
// todo: rename the file
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlCachedBuffer.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlCachedBuffer.cs
index 5e5e2c22da5..ded56bee758 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlCachedBuffer.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlCachedBuffer.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlCachedBuffer.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientFactory.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientFactory.cs
index b42193a8046..4763dd80d45 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientFactory.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientFactory.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlClientFactory.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientMetaDataCollectionNames.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientMetaDataCollectionNames.cs
index 46d0f0da589..01530e81bd4 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientMetaDataCollectionNames.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientMetaDataCollectionNames.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlClientMetaDataCollectionNames.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient{
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientPermission.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientPermission.cs
index d668f116979..695b9adad72 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientPermission.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientPermission.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlClientPermission.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientSymmetricKey.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientSymmetricKey.cs
index 501ed7c9150..0481e480a30 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientSymmetricKey.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientSymmetricKey.cs
@@ -35,15 +35,9 @@ namespace System.Data.SqlClient
}
/// <summary>
- /// Destructor that cleans up the key material.
- /// This is a best effort approach since there are no guarantees around GC.
+ /// Empty destructor for binary back compat.
/// </summary>
~SqlClientSymmetricKey() {
- if (_rootKey != null) {
- for (int i = 0; i < _rootKey.Length; i++) {
- _rootKey[i] = 0;
- }
- }
}
/// <summary>
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientWrapperSmiStream.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientWrapperSmiStream.cs
index e4e984da90b..32ef810a406 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientWrapperSmiStream.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientWrapperSmiStream.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlClientWrapperSmiStream.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace Microsoft.SqlServer.Server {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientWrapperSmiStreamChars.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientWrapperSmiStreamChars.cs
index f5ae0f3df6c..1818a2e0c1d 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientWrapperSmiStreamChars.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlClientWrapperSmiStreamChars.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlClientWrapperSmiStream.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace Microsoft.SqlServer.Server {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlColumnEncryptionCngProvider.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlColumnEncryptionCngProvider.cs
index aa4561ab3cb..6f6c3010fe3 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlColumnEncryptionCngProvider.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlColumnEncryptionCngProvider.cs
@@ -37,7 +37,7 @@ namespace System.Data.SqlClient
/// <summary>
/// RSA_OAEP is the only algorithm supported for encrypting/decrypting column encryption keys using this provider.
- /// For now, we are keeping all the providers in [....].
+ /// For now, we are keeping all the providers in sync.
/// </summary>
private const string RSAEncryptionAlgorithmWithOAEP = @"RSA_OAEP";
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlColumnEncryptionCspProvider.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlColumnEncryptionCspProvider.cs
index 19ac621b388..14e57082c34 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlColumnEncryptionCspProvider.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlColumnEncryptionCspProvider.cs
@@ -38,7 +38,7 @@ namespace System.Data.SqlClient
/// <summary>
/// RSA_OAEP is the only algorithm supported for encrypting/decrypting column encryption keys using this provider.
- /// For now, we are keeping all the providers in [....].
+ /// For now, we are keeping all the providers in sync.
/// </summary>
private const string RSAEncryptionAlgorithmWithOAEP = @"RSA_OAEP";
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlCommand.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlCommand.cs
index 46a53537089..5a3c6835c31 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlCommand.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlCommand.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlCommand.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
@@ -500,7 +500,7 @@ namespace System.Data.SqlClient {
}
}
- _activeConnection = value; // UNDONE: Designers need this setter. Should we block other scenarios?
+ _activeConnection = value; //
Bid.Trace("<sc.SqlCommand.set_Connection|API> %d#, %d#\n", ObjectID, ((null != value) ? value.ObjectID : -1));
}
@@ -1991,7 +1991,7 @@ namespace System.Data.SqlClient {
}
internal SqlDataReader ExecuteReader(CommandBehavior behavior, string method) {
- SqlConnection.ExecutePermission.Demand(); // TODO: Need to move this to public methods...
+ SqlConnection.ExecutePermission.Demand(); //
// Reset _pendingCancel upon entry into any Execute - used to synchronize state
// between entry into Execute* API and the thread obtaining the stateObject.
@@ -4032,7 +4032,7 @@ namespace System.Data.SqlClient {
catch (SqlException ex) {
// We only want to retry once, so don't retry if we are already in retry.
// If we didn't use the cache, we don't want to retry.
- // The async retried are handled separately, handle only [....] calls here.
+ // The async retried are handled separately, handle only sync calls here.
if (inRetry || async || !usedCache) {
throw;
}
@@ -4441,7 +4441,7 @@ namespace System.Data.SqlClient {
}
if (null != eventStream) {
- eventStream.Close( EventSink ); // UNDONE: should cancel instead!
+ eventStream.Close( EventSink ); //
}
if (requestExecutor != null) {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlCommandBuilder.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlCommandBuilder.cs
index 476000e80a5..7563b0c082c 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlCommandBuilder.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlCommandBuilder.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlCommandBuilder.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlCommandSet.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlCommandSet.cs
index b15a5353bb2..913a30f1c2a 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlCommandSet.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlCommandSet.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlBatchCommand.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnection.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnection.cs
index 306a4207980..577b5961f99 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnection.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlConnection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("System.Data.DataSetExtensions, PublicKey="+AssemblyRef.EcmaPublicKeyFull)] // DevDiv Bugs 92166
@@ -1702,7 +1702,7 @@ namespace System.Data.SqlClient
// time the connection state should change to what is passed in to this function is if
// the parser is broken, then we should be closed. Changed to passing in
// TdsParserState, not ConnectionState.
- // fixed by [....]
+ // fixed by Microsoft
if (breakConnection && (ConnectionState.Open == State)) {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionFactory.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionFactory.cs
index d1b96a31b51..82fa0407df7 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionFactory.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionFactory.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlConnectionFactory.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionPoolGroupProviderInfo.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionPoolGroupProviderInfo.cs
index 044682c672c..157865b45ab 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionPoolGroupProviderInfo.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionPoolGroupProviderInfo.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlConnectionPoolGroupProviderInfo.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionPoolKey.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionPoolKey.cs
index e3fb5a7dd71..ccb98a2b8ea 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionPoolKey.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionPoolKey.cs
@@ -2,8 +2,8 @@
// <copyright file="ConnectionPoolKey.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionPoolProviderInfo.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionPoolProviderInfo.cs
index d5ff005e671..3f9e5ccee0d 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionPoolProviderInfo.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionPoolProviderInfo.cs
@@ -2,7 +2,7 @@
// <copyright file="SqlConnectionPoolProviderInfo.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionString.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionString.cs
index 1dd74aec96b..05e672bffe2 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionString.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionString.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlConnectionString.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionStringBuilder.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionStringBuilder.cs
index ae3c2b1e67e..21ff4e0fa52 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionStringBuilder.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionStringBuilder.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlConnectionStringBuilder.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionTimeoutErrorInternal.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionTimeoutErrorInternal.cs
index 0e799476baf..f7e0ca2d2ff 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionTimeoutErrorInternal.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlConnectionTimeoutErrorInternal.cs
@@ -2,7 +2,7 @@
// <copyright file="SqlConnectionTimeoutErrorInternal.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlCredential.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlCredential.cs
index 874ac5cc355..091753c6f38 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlCredential.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlCredential.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlCredential.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDataAdapter.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDataAdapter.cs
index 11be2219aea..b1f304cd795 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDataAdapter.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDataAdapter.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlDataAdapter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDataReader.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDataReader.cs
index 8e04c422542..fcec91e6f91 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDataReader.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDataReader.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlDataReader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
@@ -44,7 +44,7 @@ namespace System.Data.SqlClient {
internal SharedState _sharedState = new SharedState();
- private TdsParser _parser; // TODO: Probably don't need this, since it's on the stateObj
+ private TdsParser _parser; //
private TdsParserStateObject _stateObj;
private SqlCommand _command;
private SqlConnection _connection;
@@ -1105,7 +1105,7 @@ namespace System.Data.SqlClient {
// CleanWire will do cleanup - so we don't really care about the snapshot
CleanupAfterAsyncInvocationInternal(stateObj, resetNetworkPacketTaskSource: false);
}
- // Switch to [....] to prepare for cleanwire
+ // Switch to sync to prepare for cleanwire
stateObj._syncOverAsync = true;
// Remove owner (this will allow the stateObj to be disposed after the connection is closed)
stateObj.RemoveOwner();
@@ -4355,7 +4355,7 @@ namespace System.Data.SqlClient {
return ADP.CreatedTaskWithCancellation<bool>();
}
- // Shortcut - if we have enough data, then run [....]
+ // Shortcut - if we have enough data, then run sync
try {
if (WillHaveEnoughData(i, headerOnly: true)) {
#if DEBUG
@@ -4457,7 +4457,7 @@ namespace System.Data.SqlClient {
return ADP.CreatedTaskWithCancellation<T>();
}
- // Shortcut - if we have enough data, then run [....]
+ // Shortcut - if we have enough data, then run sync
try {
if (WillHaveEnoughData(i)) {
#if DEBUG
@@ -4628,9 +4628,7 @@ namespace System.Data.SqlClient {
}
if (task.IsCompleted) {
- // If we've completed [....], then don't bother handling the TaskCompletionSource - we'll just return the completed task
CompleteRetryable(task, source, objectToDispose);
- return task;
}
else {
task.ContinueWith((t) => CompleteRetryable(t, source, objectToDispose), TaskScheduler.Default);
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDataReaderSmi.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDataReaderSmi.cs
index 4a46f64b62e..ded4479ff4a 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDataReaderSmi.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDataReaderSmi.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlDataReader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDelegatedTransaction.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDelegatedTransaction.cs
index 60edc0e400d..63bae158d8a 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDelegatedTransaction.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDelegatedTransaction.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlDelegatedTransaction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDependency.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDependency.cs
index fe13f0878c0..c27b94cd082 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDependency.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDependency.cs
@@ -2,9 +2,9 @@
// <copyright file="SqlDependency.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDependencyListener.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDependencyListener.cs
index 9a11b63cb68..656d0dd6db1 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDependencyListener.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDependencyListener.cs
@@ -2,9 +2,9 @@
// <copyright file="SqlDependency.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
@@ -151,7 +151,7 @@ internal class SqlDependencyProcessDispatcher : MarshalByRefObject { // MBR sinc
_conversationGuidParam = new SqlParameter("@p1", SqlDbType.UniqueIdentifier);
_timeoutParam = new SqlParameter("@p2", SqlDbType.Int);
- _timeoutParam.Value = 0; // Timeout set to 0 for initial [....] query.
+ _timeoutParam.Value = 0; // Timeout set to 0 for initial sync query.
_com.Parameters.Add(_timeoutParam);
setupCompleted = true;
@@ -160,7 +160,7 @@ internal class SqlDependencyProcessDispatcher : MarshalByRefObject { // MBR sinc
// Create standard query.
_receiveQuery = "WAITFOR(RECEIVE TOP (1) message_type_name, conversation_handle, cast(message_body AS XML) as message_body from " + _escapedQueueName + "), TIMEOUT @p2;";
- // Create queue, service, [....] query, and async query on user thread to ensure proper
+ // Create queue, service, sync query, and async query on user thread to ensure proper
// init prior to return.
if (useDefaults) { // Only create if user did not specify service & database.
@@ -179,7 +179,7 @@ internal class SqlDependencyProcessDispatcher : MarshalByRefObject { // MBR sinc
// Query synchronously once to ensure everything is working correctly.
// We want the exception to occur on start to immediately inform caller.
SynchronouslyQueryServiceBrokerQueue();
- _timeoutParam.Value = _defaultWaitforTimeout; // [....] successful, extend timeout to 60 seconds.
+ _timeoutParam.Value = _defaultWaitforTimeout; // Sync successful, extend timeout to 60 seconds.
AsynchronouslyQueryServiceBrokerQueue();
}
catch (Exception e) {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDependencyUtils.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDependencyUtils.cs
index ae91e9644a2..ccd6d84f7e4 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDependencyUtils.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlDependencyUtils.cs
@@ -2,9 +2,9 @@
// <copyright file="SqlDependencyUtils.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
@@ -179,7 +179,7 @@ namespace System.Data.SqlClient {
{
// this should not happen since _commandHashToNotificationId and _notificationIdToDependenciesHash are always
// updated together
- Debug.Assert(false, "_commandHashToNotificationId has entries that were removed from _notificationIdToDependenciesHash. Remember to keep them in [....]");
+ Debug.Assert(false, "_commandHashToNotificationId has entries that were removed from _notificationIdToDependenciesHash. Remember to keep them in sync");
throw ADP.InternalError(ADP.InternalErrorCode.SqlDependencyCommandHashIsNotAssociatedWithNotification);
}
@@ -217,7 +217,7 @@ namespace System.Data.SqlClient {
}
- Debug.Assert(_notificationIdToDependenciesHash.Count == _commandHashToNotificationId.Count, "always keep these maps in [....]!");
+ Debug.Assert(_notificationIdToDependenciesHash.Count == _commandHashToNotificationId.Count, "always keep these maps in sync!");
}
}
}
@@ -402,7 +402,7 @@ namespace System.Data.SqlClient {
Bid.NotificationsTrace("<sc.SqlDependencyPerAppDomainDispatcher.LookupDependencyEntriesWithRemove|DEP> Entries NOT found in hashtable.\n");
}
- Debug.Assert(_notificationIdToDependenciesHash.Count == _commandHashToNotificationId.Count, "always keep these maps in [....]!");
+ Debug.Assert(_notificationIdToDependenciesHash.Count == _commandHashToNotificationId.Count, "always keep these maps in sync!");
}
return entry; // DependencyList inherits from List<SqlDependency>
@@ -436,7 +436,7 @@ namespace System.Data.SqlClient {
// same SqlDependency can be associated with more than one command, so we have to continue till the end...
}
- Debug.Assert(commandHashesToRemove.Count == notificationIdsToRemove.Count, "maps should be kept in [....]");
+ Debug.Assert(commandHashesToRemove.Count == notificationIdsToRemove.Count, "maps should be kept in sync");
for (int i = 0; i < notificationIdsToRemove.Count; i++ ) {
// cleanup the entry outside of foreach
// do it inside finally block to avoid ThreadAbort exception interrupt this operation
@@ -448,7 +448,7 @@ namespace System.Data.SqlClient {
}
}
- Debug.Assert(_notificationIdToDependenciesHash.Count == _commandHashToNotificationId.Count, "always keep these maps in [....]!");
+ Debug.Assert(_notificationIdToDependenciesHash.Count == _commandHashToNotificationId.Count, "always keep these maps in sync!");
}
}
finally {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlEnums.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlEnums.cs
index da0013b801c..ea4a9a88bde 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlEnums.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlEnums.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlEnums.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlError.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlError.cs
index 9b4d5ee36a5..e929e0eaf9a 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlError.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlError.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlError.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
@@ -16,7 +16,7 @@ namespace System.Data.SqlClient {
public sealed class SqlError {
// bug fix - MDAC 48965 - missing source of exception
- // fixed by [....]
+ // fixed by Microsoft
private string source = TdsEnums.SQL_PROVIDER_NAME;
private int number;
private byte state;
@@ -61,7 +61,7 @@ namespace System.Data.SqlClient {
}
// bug fix - MDAC #48965 - missing source of exception
- // fixed by [....]
+ // fixed by Microsoft
public string Source {
get { return this.source;}
}
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlErrorCollection.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlErrorCollection.cs
index 143be5fa399..18ea5d8081e 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlErrorCollection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlErrorCollection.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlErrorCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlException.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlException.cs
index 2da09347a56..72dab1c0a59 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlException.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlException.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlException.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlInfoMessageEvent.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlInfoMessageEvent.cs
index 51e69e9dd4d..1e3eadb40fd 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlInfoMessageEvent.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlInfoMessageEvent.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlInfoMessageEvent.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlInternalConnection.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlInternalConnection.cs
index 6221416a111..3179c4849b5 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlInternalConnection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlInternalConnection.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlInternalConnection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlInternalConnectionSmi.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlInternalConnectionSmi.cs
index 16772773427..becb5962e50 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlInternalConnectionSmi.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlInternalConnectionSmi.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlInternalConnectionSmi.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlInternalConnectionTds.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlInternalConnectionTds.cs
index 376909b9abd..a617acd95cd 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlInternalConnectionTds.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlInternalConnectionTds.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlInternalConnectionTds.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient
@@ -1428,16 +1428,21 @@ namespace System.Data.SqlClient
ResolveExtendedServerName(serverInfo, !redirectedUserInstance, connectionOptions);
+ Boolean disableTnir = ShouldDisableTnir(connectionOptions);
+
long timeoutUnitInterval = 0;
- Boolean isParallel = connectionOptions.MultiSubnetFailover || connectionOptions.TransparentNetworkIPResolution;
+ Boolean isParallel = connectionOptions.MultiSubnetFailover || (connectionOptions.TransparentNetworkIPResolution && !disableTnir);
+
+
if(isParallel) {
+ float failoverTimeoutStep = connectionOptions.MultiSubnetFailover ? ADP.FailoverTimeoutStep : ADP.FailoverTimeoutStepForTnir;
// Determine unit interval
if (timeout.IsInfinite) {
- timeoutUnitInterval = checked((long)(ADP.FailoverTimeoutStep * (1000L * ADP.DefaultConnectionTimeout)));
+ timeoutUnitInterval = checked((long)(failoverTimeoutStep * (1000L * ADP.DefaultConnectionTimeout)));
}
else {
- timeoutUnitInterval = checked((long)(ADP.FailoverTimeoutStep * timeout.MillisecondsRemaining));
+ timeoutUnitInterval = checked((long)(failoverTimeoutStep * timeout.MillisecondsRemaining));
}
}
// Only three ways out of this loop:
@@ -1451,15 +1456,31 @@ namespace System.Data.SqlClient
// back into the parser for the error cases.
int attemptNumber = 0;
TimeoutTimer intervalTimer = null;
- TimeoutTimer firstTransparentAttemptTimeout = TimeoutTimer.StartMillisecondsTimeout(ADP.FirstTransparentAttemptTimeout);
+
TimeoutTimer attemptOneLoginTimeout = timeout;
while(true) {
+ Boolean isFirstTransparentAttempt = connectionOptions.TransparentNetworkIPResolution && !disableTnir && attemptNumber == 1;
+
if(isParallel) {
- attemptNumber++;
+ int multiplier = ++attemptNumber;
+
+ if (connectionOptions.TransparentNetworkIPResolution)
+ {
+ // While connecting using TNIR the timeout multiplier should be increased to allow steps of 1,2,4 instead of 1,2,3.
+ // This will allow half the time out for the last connection attempt in case of Tnir.
+ multiplier = 1 << (attemptNumber - 1);
+ }
// Set timeout for this attempt, but don't exceed original timer
- long nextTimeoutInterval = checked(timeoutUnitInterval * attemptNumber);
+ long nextTimeoutInterval = checked(timeoutUnitInterval * multiplier);
long milliseconds = timeout.MillisecondsRemaining;
+
+ // If it is the first attempt at TNIR connection, then allow at least 500 ms for timeout. With the current failover step of 0.125
+ // and Connection Time of < 4000 ms, the first attempt can be lower than 500 ms.
+ if (isFirstTransparentAttempt)
+ {
+ nextTimeoutInterval = Math.Max(ADP.MinimumTimeoutForTnirMs, nextTimeoutInterval);
+ }
if (nextTimeoutInterval > milliseconds) {
nextTimeoutInterval = milliseconds;
}
@@ -1478,15 +1499,9 @@ namespace System.Data.SqlClient
//
- Boolean isFirstTransparentAttempt = connectionOptions.TransparentNetworkIPResolution && attemptNumber == 1;
-
- if(isFirstTransparentAttempt) {
- attemptOneLoginTimeout = firstTransparentAttemptTimeout;
- }
- else {
- if(isParallel) {
- attemptOneLoginTimeout = intervalTimer;
- }
+
+ if(isParallel) {
+ attemptOneLoginTimeout = intervalTimer;
}
AttemptOneLogin( serverInfo,
@@ -1494,7 +1509,8 @@ namespace System.Data.SqlClient
newSecurePassword,
!isParallel, // ignore timeout for SniOpen call unless MSF , and TNIR
attemptOneLoginTimeout,
- isFirstTransparentAttempt:isFirstTransparentAttempt);
+ isFirstTransparentAttempt:isFirstTransparentAttempt,
+ disableTnir: disableTnir);
if (connectionOptions.MultiSubnetFailover && null != ServerProvidedFailOverPartner) {
// connection succeeded: trigger exception if server sends failover partner and MultiSubnetFailover is used.
@@ -1594,6 +1610,21 @@ namespace System.Data.SqlClient
CurrentDataSource = originalServerInfo.UserServerName;
}
+ private bool ShouldDisableTnir(SqlConnectionString connectionOptions)
+ {
+ Boolean isAzureEndPoint = ADP.IsAzureSqlServerEndpoint(connectionOptions.DataSource);
+
+ Boolean isFedAuthEnabled = this._accessTokenInBytes != null ||
+ connectionOptions.Authentication == SqlAuthenticationMethod.ActiveDirectoryPassword ||
+ connectionOptions.Authentication == SqlAuthenticationMethod.ActiveDirectoryIntegrated;
+
+ // Check if the user had explicitly specified the TNIR option in the connection string or the connection string builder.
+ // If the user has specified the option in the connection string explicitly, then we shouldn't disable TNIR.
+ bool isTnirExplicitlySpecifiedInConnectionOptions = connectionOptions.Parsetable[SqlConnectionString.KEY.TransparentNetworkIPResolution] != null;
+
+ return isTnirExplicitlySpecifiedInConnectionOptions ? false : (isAzureEndPoint || isFedAuthEnabled);
+ }
+
// Attempt to login to a host that has a failover partner
//
// Connection & timeout sequence is
@@ -1815,7 +1846,8 @@ namespace System.Data.SqlClient
}
// Common code path for making one attempt to establish a connection and log in to server.
- private void AttemptOneLogin(ServerInfo serverInfo, string newPassword, SecureString newSecurePassword, bool ignoreSniOpenTimeout, TimeoutTimer timeout, bool withFailover = false, bool isFirstTransparentAttempt = true) {
+ private void AttemptOneLogin(ServerInfo serverInfo, string newPassword, SecureString newSecurePassword, bool ignoreSniOpenTimeout, TimeoutTimer timeout, bool withFailover = false, bool isFirstTransparentAttempt = true, bool disableTnir = false)
+ {
if (Bid.AdvancedOn) {
Bid.Trace("<sc.SqlInternalConnectionTds.AttemptOneLogin|ADV> %d#, timout=%I64d{msec}, server=", ObjectID, timeout.MillisecondsRemaining);
Bid.PutStr(serverInfo.ExtendedServerName);
@@ -1835,7 +1867,8 @@ namespace System.Data.SqlClient
ConnectionOptions.IntegratedSecurity,
withFailover,
isFirstTransparentAttempt,
- ConnectionOptions.Authentication);
+ ConnectionOptions.Authentication,
+ disableTnir);
timeoutErrorInternal.EndPhase(SqlConnectionTimeoutErrorPhase.ConsumePreLoginHandshake);
timeoutErrorInternal.SetAndBeginPhase(SqlConnectionTimeoutErrorPhase.LoginBegin);
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlNotificationEventArgs.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlNotificationEventArgs.cs
index 89498fc18ec..590e7bfe329 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlNotificationEventArgs.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlNotificationEventArgs.cs
@@ -2,9 +2,9 @@
// <copyright file="SqlNotificationEventArgs.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlParameter.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlParameter.cs
index 81274a6b846..37efcfd5257 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlParameter.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlParameter.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlParameter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlParameterCollection.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlParameterCollection.cs
index 4367bc7a67c..a8951459130 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlParameterCollection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlParameterCollection.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlParameterCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlReferenceCollection.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlReferenceCollection.cs
index e26069f2dac..c50e7ea4f77 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlReferenceCollection.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlReferenceCollection.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlReferenceCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlRowUpdatedEvent.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlRowUpdatedEvent.cs
index 75d37032331..a0ff53b1fad 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlRowUpdatedEvent.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlRowUpdatedEvent.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlRowUpdatedEvent.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlRowUpdatingEvent.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlRowUpdatingEvent.cs
index 6d3bcd921b4..2233e9dff94 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlRowUpdatingEvent.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlRowUpdatingEvent.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlRowUpdatingEvent.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlSequentialTextReader.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlSequentialTextReader.cs
index d5e60712a24..8236a519bb1 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlSequentialTextReader.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlSequentialTextReader.cs
@@ -180,7 +180,7 @@ namespace System.Data.SqlClient
byteBufferUsed += bytesRead;
}
else {
- // We need more data - setup the callback, and mark this as not completed [....]
+ // We need more data - setup the callback, and mark this as not completed sync
completedSynchronously = false;
getBytesTask.ContinueWith((t) =>
{
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlStatistics.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlStatistics.cs
index be518346a2e..688fe4f3de0 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlStatistics.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlStatistics.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlStatistics.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlStream.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlStream.cs
index 6fa1900911e..d8a7753b308 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlStream.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlStream.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlStream.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlTransaction.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlTransaction.cs
index ff02ce923a3..e7927edf1a4 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlTransaction.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlTransaction.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlTransaction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlUdtInfo.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlUdtInfo.cs
index cfde73a6f2b..a97f766bfc5 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlUdtInfo.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlUdtInfo.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved.
// Information Contained Herein is Proprietary and Confidential.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlUtil.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlUtil.cs
index a15b1893767..96b7b4e327e 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlUtil.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/SqlUtil.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlUtil.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsEnums.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsEnums.cs
index 11e3cdd98ef..d0607ec2f52 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsEnums.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsEnums.cs
@@ -2,8 +2,8 @@
// <copyright file="TdsEnums.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParameterSetter.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParameterSetter.cs
index 56a661fe1ae..18da7f15354 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParameterSetter.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParameterSetter.cs
@@ -2,9 +2,9 @@
// <copyright file="TdsParameterSetter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParser.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParser.cs
index 8c2c8cc5d87..3d3d95f3f6d 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParser.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParser.cs
@@ -2,8 +2,8 @@
// <copyright file="TdsParser.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
@@ -386,7 +386,8 @@ namespace System.Data.SqlClient {
bool integratedSecurity,
bool withFailover,
bool isFirstTransparentAttempt,
- SqlAuthenticationMethod authType) {
+ SqlAuthenticationMethod authType,
+ bool disableTnir) {
if (_state != TdsParserState.Closed) {
Debug.Assert(false, "TdsParser.Connect called on non-closed connection!");
return;
@@ -435,7 +436,7 @@ namespace System.Data.SqlClient {
bool fParallel = _connHandler.ConnectionOptions.MultiSubnetFailover;
TransparentNetworkResolutionState transparentNetworkResolutionState;
- if(_connHandler.ConnectionOptions.TransparentNetworkIPResolution)
+ if (_connHandler.ConnectionOptions.TransparentNetworkIPResolution && !disableTnir)
{
if(isFirstTransparentAttempt)
transparentNetworkResolutionState = TransparentNetworkResolutionState.SequentialMode;
@@ -7948,7 +7949,7 @@ namespace System.Data.SqlClient {
}, TaskScheduler.Default);
}
- // Finished [....]
+ // Finished sync
return null;
}
catch (Exception e) {
@@ -8773,7 +8774,7 @@ namespace System.Data.SqlClient {
case SqlDbType.Char:
stateObj.WriteByte(TdsEnums.SQLBIGCHAR);
WriteUnsignedShort(checked((ushort)(metaData.MaxLength)), stateObj);
- WriteUnsignedInt(_defaultCollation.info, stateObj); // TODO: Use metadata's collation??
+ WriteUnsignedInt(_defaultCollation.info, stateObj); //
stateObj.WriteByte(_defaultCollation.sortId);
break;
case SqlDbType.DateTime:
@@ -8805,13 +8806,13 @@ namespace System.Data.SqlClient {
case SqlDbType.NChar:
stateObj.WriteByte(TdsEnums.SQLNCHAR);
WriteUnsignedShort(checked((ushort)(metaData.MaxLength*2)), stateObj);
- WriteUnsignedInt(_defaultCollation.info, stateObj); // TODO: Use metadata's collation??
+ WriteUnsignedInt(_defaultCollation.info, stateObj); //
stateObj.WriteByte(_defaultCollation.sortId);
break;
case SqlDbType.NText:
stateObj.WriteByte(TdsEnums.SQLNVARCHAR);
WriteUnsignedShort(unchecked((ushort)MSS.SmiMetaData.UnlimitedMaxLengthIndicator), stateObj);
- WriteUnsignedInt(_defaultCollation.info, stateObj); // TODO: Use metadata's collation??
+ WriteUnsignedInt(_defaultCollation.info, stateObj); //
stateObj.WriteByte(_defaultCollation.sortId);
break;
case SqlDbType.NVarChar:
@@ -8822,7 +8823,7 @@ namespace System.Data.SqlClient {
else {
WriteUnsignedShort(checked((ushort)(metaData.MaxLength*2)), stateObj);
}
- WriteUnsignedInt(_defaultCollation.info, stateObj); // TODO: Use metadata's collation??
+ WriteUnsignedInt(_defaultCollation.info, stateObj); //
stateObj.WriteByte(_defaultCollation.sortId);
break;
case SqlDbType.Real:
@@ -8848,7 +8849,7 @@ namespace System.Data.SqlClient {
case SqlDbType.Text:
stateObj.WriteByte(TdsEnums.SQLBIGVARCHAR);
WriteUnsignedShort(unchecked((ushort)MSS.SmiMetaData.UnlimitedMaxLengthIndicator), stateObj);
- WriteUnsignedInt(_defaultCollation.info, stateObj); // TODO: Use metadata's collation??
+ WriteUnsignedInt(_defaultCollation.info, stateObj); //
stateObj.WriteByte(_defaultCollation.sortId);
break;
case SqlDbType.Timestamp:
@@ -8866,7 +8867,7 @@ namespace System.Data.SqlClient {
case SqlDbType.VarChar:
stateObj.WriteByte(TdsEnums.SQLBIGVARCHAR);
WriteUnsignedShort(unchecked((ushort)metaData.MaxLength), stateObj);
- WriteUnsignedInt(_defaultCollation.info, stateObj); // TODO: Use metadata's collation??
+ WriteUnsignedInt(_defaultCollation.info, stateObj); //
stateObj.WriteByte(_defaultCollation.sortId);
break;
case SqlDbType.Variant:
@@ -9127,7 +9128,7 @@ namespace System.Data.SqlClient {
/// <returns></returns>
internal void WriteTceUserTypeAndTypeInfo(SqlMetaDataPriv mdPriv, TdsParserStateObject stateObj) {
// Write the UserType (4 byte value)
- WriteInt(0x0, stateObj); // TODO: fix this- timestamp columns have 0x50 value here
+ WriteInt(0x0, stateObj); //
Debug.Assert(SqlDbType.Xml != mdPriv.type);
Debug.Assert(SqlDbType.Udt != mdPriv.type);
@@ -9233,7 +9234,7 @@ namespace System.Data.SqlClient {
// todo:
// for xml WriteTokenLength results in a no-op
// discuss this with blaine ...
- // ([....]) xml datatype does not have token length in its metadata. So it should be a noop.
+ // (Microsoft) xml datatype does not have token length in its metadata. So it should be a noop.
switch (md.type) {
case SqlDbType.Decimal:
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserHelperClasses.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserHelperClasses.cs
index 01322f3193b..7d2408a9042 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserHelperClasses.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserHelperClasses.cs
@@ -2,8 +2,8 @@
// <copyright file="TdsParserHelperClasses.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserSafeHandles.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserSafeHandles.cs
index 73286f199c2..c1a4d9406fe 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserSafeHandles.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserSafeHandles.cs
@@ -2,8 +2,8 @@
// <copyright file="TdsParserSafeHandles.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
@@ -150,7 +150,8 @@ namespace System.Data.SqlClient {
int transparentNetworkResolutionStateNo = (int)transparentNetworkResolutionState;
_status = SNINativeMethodWrapper.SNIOpenSyncEx(myInfo, serverName, ref base.handle,
- spnBuffer, instanceName, flushCache, fSync, timeout, fParallel, transparentNetworkResolutionStateNo, totalTimeout);
+ spnBuffer, instanceName, flushCache, fSync, timeout, fParallel, transparentNetworkResolutionStateNo, totalTimeout,
+ ADP.IsAzureSqlServerEndpoint(serverName));
}
}
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserSessionPool.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserSessionPool.cs
index d60e9ecdc77..cb4d9b10da7 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserSessionPool.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserSessionPool.cs
@@ -2,8 +2,8 @@
// <copyright file="TdsParserSessionPool.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserStateObject.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserStateObject.cs
index 75e2a4b30c8..7a878152f2c 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserStateObject.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserStateObject.cs
@@ -2,8 +2,8 @@
// <copyright file="TdsParserStateObject.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
@@ -646,7 +646,7 @@ namespace System.Data.SqlClient {
// Should only be called for MARS - that is the only time we need to take
// the ResetConnection lock!
- // SQL BU DT 333026 - it was raised in a security review by [....] questioning whether
+ // SQL BU DT 333026 - it was raised in a security review by Microsoft questioning whether
// we need to actually process the resulting packet (sp_reset ack or error) to know if the
// reset actually succeeded. There was a concern that if the reset failed and we proceeded
// there might be a security issue present. We have been assured by the server that if
@@ -2046,7 +2046,7 @@ namespace System.Data.SqlClient {
TaskCompletionSource<object> source = _networkPacketTaskSource;
if (_parser.Connection.IsInPool) {
- // Dev11 Bug 390048 : Timing issue between OnTimeout and ReadAsyncCallback results in SqlClient's packet parsing going out of [....]
+ // Dev11 Bug 390048 : Timing issue between OnTimeout and ReadAsyncCallback results in SqlClient's packet parsing going out of sync
// We should never timeout if the connection is currently in the pool: the safest thing to do here is to doom the connection to avoid corruption
Debug.Assert(_parser.Connection.IsConnectionDoomed, "Timeout occurred while the connection is in the pool");
_parser.State = TdsParserState.Broken;
@@ -2150,7 +2150,7 @@ namespace System.Data.SqlClient {
}
// -1 == Infinite
- // 0 == Already timed out (NOTE: To simulate the same behavior as [....] we will only timeout on 0 if we receive an IO Pending from SNI)
+ // 0 == Already timed out (NOTE: To simulate the same behavior as sync we will only timeout on 0 if we receive an IO Pending from SNI)
// >0 == Actual timeout remaining
int msecsRemaining = GetTimeoutRemaining();
if (msecsRemaining > 0) {
@@ -2206,7 +2206,7 @@ namespace System.Data.SqlClient {
ChangeNetworkPacketTimeout(0, Timeout.Infinite);
}
// DO NOT HANDLE PENDING READ HERE - which is TdsEnums.SNI_SUCCESS_IO_PENDING state.
- // That is handled by user who initiated async read, or by ReadNetworkPacket which is [....] over async.
+ // That is handled by user who initiated async read, or by ReadNetworkPacket which is sync over async.
}
finally {
if (readPacket != IntPtr.Zero) {
@@ -3278,7 +3278,7 @@ namespace System.Data.SqlClient {
internal void AddError(SqlError error) {
Debug.Assert(error != null, "Trying to add a null error");
- // Switch to [....] once we see an error
+ // Switch to sync once we see an error
_syncOverAsync = true;
lock (_errorAndWarningsLock) {
@@ -3312,7 +3312,7 @@ namespace System.Data.SqlClient {
internal void AddWarning(SqlError error) {
Debug.Assert(error != null, "Trying to add a null error");
- // Switch to [....] once we see a warning
+ // Switch to sync once we see a warning
_syncOverAsync = true;
lock (_errorAndWarningsLock){
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserStaticMethods.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserStaticMethods.cs
index 187a187d0b6..3935e1b523e 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserStaticMethods.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserStaticMethods.cs
@@ -2,8 +2,8 @@
// <copyright file="TdsParserStaticFunctionality.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsRecordBufferSetter.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsRecordBufferSetter.cs
index 406e2b7b614..7b856bb8500 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsRecordBufferSetter.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsRecordBufferSetter.cs
@@ -2,8 +2,8 @@
// <copyright file="TdsRecordBufferSetter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsValueSetter.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsValueSetter.cs
index aef315de517..63e1dd4ed68 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsValueSetter.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsValueSetter.cs
@@ -2,8 +2,8 @@
// <copyright file="TdsValueSetter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/assemblycache.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/assemblycache.cs
index b843d552997..5fd69f0547e 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/assemblycache.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/assemblycache.cs
@@ -2,8 +2,8 @@
// <copyright file="assemblycache.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/sqlinternaltransaction.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/sqlinternaltransaction.cs
index c717a8efc77..e09e10f5aa8 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/sqlinternaltransaction.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/sqlinternaltransaction.cs
@@ -2,8 +2,8 @@
// <copyright file="SqlInternalTransaction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data.SqlClient {
diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/sqlmetadatafactory.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/sqlmetadatafactory.cs
index 24cfe1c3ee8..f17f069a00f 100644
--- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/sqlmetadatafactory.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/sqlmetadatafactory.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <owner current="true" primary="false">Mugunm</owner>
//
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data/System/Data/StateChangeEvent.cs b/mcs/class/referencesource/System.Data/System/Data/StateChangeEvent.cs
index 54d94f05102..8bc08c54840 100644
--- a/mcs/class/referencesource/System.Data/System/Data/StateChangeEvent.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/StateChangeEvent.cs
@@ -2,8 +2,8 @@
// <copyright file="StateChangeEvent.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/UniqueConstraint.cs b/mcs/class/referencesource/System.Data/System/Data/UniqueConstraint.cs
index c097f9319c2..29c3d5a2486 100644
--- a/mcs/class/referencesource/System.Data/System/Data/UniqueConstraint.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/UniqueConstraint.cs
@@ -2,9 +2,9 @@
// <copyright file="UniqueConstraint.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/XDRSchema.cs b/mcs/class/referencesource/System.Data/System/Data/XDRSchema.cs
index 4c8a962083a..fee6ab5be6b 100644
--- a/mcs/class/referencesource/System.Data/System/Data/XDRSchema.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/XDRSchema.cs
@@ -2,9 +2,9 @@
// <copyright file="XDRSchema.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/XMLDiffLoader.cs b/mcs/class/referencesource/System.Data/System/Data/XMLDiffLoader.cs
index fc3ecb9f9ff..c240bd1ed33 100644
--- a/mcs/class/referencesource/System.Data/System/Data/XMLDiffLoader.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/XMLDiffLoader.cs
@@ -2,9 +2,9 @@
// <copyright file="XMLDiffLoader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/XMLSchema.cs b/mcs/class/referencesource/System.Data/System/Data/XMLSchema.cs
index ae76cafbcec..d668514dd39 100644
--- a/mcs/class/referencesource/System.Data/System/Data/XMLSchema.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/XMLSchema.cs
@@ -2,8 +2,8 @@
// <copyright file="XMLSchema.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
@@ -1346,7 +1346,7 @@ namespace System.Data {
table = _ds.Tables.GetTable(XmlConvert.DecodeName(typeName), _TableUri);
// TOD: Do not do this fix
// if (table == null && node.RefName.IsEmpty && !IsTopLevelElement(node) && _TableUri != null && _TableUri.Length > 0) {
-// _TableUri = null; // it means form="qualified", so child element inherits namespace. [....]
+// _TableUri = null; // it means form="qualified", so child element inherits namespace. Microsoft
// }
if (!FromInference || (FromInference && table == null))
@@ -1574,7 +1574,7 @@ namespace System.Data {
new NameType("byte" , typeof(SByte) ), /* XSD Apr */
new NameType("date" , typeof(DateTime)), /* XSD Apr */
new NameType("dateTime" , typeof(DateTime)), /* XSD Apr */
- new NameType("decimal" , typeof(decimal) ), /* XSD 2001 [....] */
+ new NameType("decimal" , typeof(decimal) ), /* XSD 2001 Microsoft */
new NameType("double" , typeof(double) ), /* XSD Apr */
new NameType("duration" , typeof(TimeSpan)), /* XSD Apr */
new NameType("float" , typeof(Single) ), /* XSD Apr */
@@ -2026,7 +2026,7 @@ namespace System.Data {
}
- // XDR [....] change
+ // XDR Microsoft change
string strDefault = (attrib.Use == XmlSchemaUse.Required) ? GetMsdataAttribute(attr, Keywords.MSD_DEFAULTVALUE) : attr.DefaultValue;
if ((attr.Use == XmlSchemaUse.Optional) && (strDefault == null ))
strDefault = attr.FixedValue;
diff --git a/mcs/class/referencesource/System.Data/System/Data/XmlDataLoader.cs b/mcs/class/referencesource/System.Data/System/Data/XmlDataLoader.cs
index 566e2581f16..24733de45bc 100644
--- a/mcs/class/referencesource/System.Data/System/Data/XmlDataLoader.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/XmlDataLoader.cs
@@ -2,8 +2,8 @@
// <copyright file="XmlDataLoader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
@@ -313,7 +313,7 @@ namespace System.Data {
XmlElement e = xdoc.DocumentElement;
DataTable topTable = (DataTable) nodeToSchemaMap.GetSchemaForNode(e, FIgnoreNamespace(e));
if (topTable != null) {
- topRow = topTable.CreateEmptyRow(); //enzol perf
+ topRow = topTable.CreateEmptyRow(); //Microsoft perf
nodeToRowMap[ e ] = topRow;
// get all field values.
diff --git a/mcs/class/referencesource/System.Data/System/Data/XmlKeywords.cs b/mcs/class/referencesource/System.Data/System/Data/XmlKeywords.cs
index 674f812d5ad..4b288fb5f25 100644
--- a/mcs/class/referencesource/System.Data/System/Data/XmlKeywords.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/XmlKeywords.cs
@@ -2,9 +2,9 @@
// <copyright file="XmlKeywords.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
diff --git a/mcs/class/referencesource/System.Data/System/Data/XmlToDatasetMap.cs b/mcs/class/referencesource/System.Data/System/Data/XmlToDatasetMap.cs
index a1aab9cd564..7f46e7e6d54 100644
--- a/mcs/class/referencesource/System.Data/System/Data/XmlToDatasetMap.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/XmlToDatasetMap.cs
@@ -2,9 +2,9 @@
// <copyright file="XmlToDatasetMap.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
@@ -128,10 +128,10 @@ namespace System.Data {
// Used to infere schema
private TableSchemaInfo AddTableSchema(DataTable table, XmlNameTable nameTable) {
- // [....]: Because in our case reader already read the document all names that we can meet in the
+ // Microsoft: Because in our case reader already read the document all names that we can meet in the
// document already has an entry in NameTable.
// If in future we will build identity map before reading XML we can replace Get() to Add()
- // [....]: GetIdentity is called from two places: BuildIdentityMap() and LoadRows()
+ // Microsoft: GetIdentity is called from two places: BuildIdentityMap() and LoadRows()
// First case deals with decoded names; Second one with encoded names.
// We decided encoded names in first case (instead of decoding them in second)
// because it save us time in LoadRows(). We have, as usual, more data them schemas
@@ -148,10 +148,10 @@ namespace System.Data {
}
private TableSchemaInfo AddTableSchema(XmlNameTable nameTable, DataTable table) {
- // [....]:This is the opposite of the previous function:
+ // Microsoft:This is the opposite of the previous function:
// we populate the nametable so that the hash comparison can happen as
// object comparison instead of strings.
- // [....]: GetIdentity is called from two places: BuildIdentityMap() and LoadRows()
+ // Microsoft: GetIdentity is called from two places: BuildIdentityMap() and LoadRows()
// First case deals with decoded names; Second one with encoded names.
// We decided encoded names in first case (instead of decoding them in second)
// because it save us time in LoadRows(). We have, as usual, more data them schemas
diff --git a/mcs/class/referencesource/System.Data/System/Data/xmlsaver.cs b/mcs/class/referencesource/System.Data/System/Data/xmlsaver.cs
index 2129d476241..a25f9b1de47 100644
--- a/mcs/class/referencesource/System.Data/System/Data/xmlsaver.cs
+++ b/mcs/class/referencesource/System.Data/System/Data/xmlsaver.cs
@@ -2,8 +2,8 @@
// <copyright file="xmlsaver.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Data {
@@ -153,7 +153,7 @@ namespace System.Data {
if (propInst is PropertyCollection) {
return;
}
- // [....]: perf: Why not have this as a table?
+ // Microsoft: perf: Why not have this as a table?
// there are several xdo properties that equal to some xml attributes, we should not explicitly ouput them.
if (
0 == String.Compare(pd.Name, "Namespace" , StringComparison.Ordinal) ||
@@ -1093,7 +1093,7 @@ namespace System.Data {
schNode.AppendChild(type);
}else {
#if DEBUG
- // [....]: TO DO: replace the constructor with IsEqual(XmlElement)
+ // Microsoft: TO DO: replace the constructor with IsEqual(XmlElement)
// Debug.Assert(col.SimpleType.IsEqual(new SimpleType(elmSimpeType)), "simpleTypes with the same name have to be the same: "+name);
#endif
}
@@ -1288,7 +1288,7 @@ namespace System.Data {
minOccurs = (col.AllowDBNull) ? 0 : 1;
- // [....] 2001 change
+ // Microsoft 2001 change
if (col.ColumnMapping == MappingType.Attribute && minOccurs != 0)
root.SetAttribute(Keywords.USE, Keywords.REQUIRED);
diff --git a/mcs/class/referencesource/System.Data/System/NewXml/BaseTreeIterator.cs b/mcs/class/referencesource/System.Data/System/NewXml/BaseTreeIterator.cs
index c06feef60f4..fa67c094ac3 100644
--- a/mcs/class/referencesource/System.Data/System/NewXml/BaseTreeIterator.cs
+++ b/mcs/class/referencesource/System.Data/System/NewXml/BaseTreeIterator.cs
@@ -2,8 +2,8 @@
// <copyright file="BaseTreeIterator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Data/System/NewXml/DataDocumentXPathNavigator.cs b/mcs/class/referencesource/System.Data/System/NewXml/DataDocumentXPathNavigator.cs
index 45420d2d287..d2e5280a554 100644
--- a/mcs/class/referencesource/System.Data/System/NewXml/DataDocumentXPathNavigator.cs
+++ b/mcs/class/referencesource/System.Data/System/NewXml/DataDocumentXPathNavigator.cs
@@ -2,8 +2,8 @@
// <copyright file="DataDocumentXPathNavigator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
#pragma warning disable 618 // ignore obsolete warning about XmlDataDocument
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Data/System/NewXml/DataPointer.cs b/mcs/class/referencesource/System.Data/System/NewXml/DataPointer.cs
index e8f4f51e6e6..2b85cf142ea 100644
--- a/mcs/class/referencesource/System.Data/System/NewXml/DataPointer.cs
+++ b/mcs/class/referencesource/System.Data/System/NewXml/DataPointer.cs
@@ -2,8 +2,8 @@
// <copyright file="DataPointer.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
#pragma warning disable 618 // ignore obsolete warning about XmlDataDocument
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Data/System/NewXml/DataSetMappper.cs b/mcs/class/referencesource/System.Data/System/NewXml/DataSetMappper.cs
index 390bf5780d9..de28bbd118d 100644
--- a/mcs/class/referencesource/System.Data/System/NewXml/DataSetMappper.cs
+++ b/mcs/class/referencesource/System.Data/System/NewXml/DataSetMappper.cs
@@ -2,8 +2,8 @@
// <copyright file="DataSetMapper.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
#pragma warning disable 618 // ignore obsolete warning about XmlDataDocument
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Data/System/NewXml/RegionIterator.cs b/mcs/class/referencesource/System.Data/System/NewXml/RegionIterator.cs
index de0c6882c97..8e4b622acef 100644
--- a/mcs/class/referencesource/System.Data/System/NewXml/RegionIterator.cs
+++ b/mcs/class/referencesource/System.Data/System/NewXml/RegionIterator.cs
@@ -2,8 +2,8 @@
// <copyright file="RegionIterator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
#pragma warning disable 618 // ignore obsolete warning about XmlDataDocument
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Data/System/NewXml/TreeIterator.cs b/mcs/class/referencesource/System.Data/System/NewXml/TreeIterator.cs
index 5e90984a748..34099a111b7 100644
--- a/mcs/class/referencesource/System.Data/System/NewXml/TreeIterator.cs
+++ b/mcs/class/referencesource/System.Data/System/NewXml/TreeIterator.cs
@@ -2,8 +2,8 @@
// <copyright file="TreeIterator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
#pragma warning disable 618 // ignore obsolete warning about XmlDataDocument
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Data/System/NewXml/XPathNodePointer.cs b/mcs/class/referencesource/System.Data/System/NewXml/XPathNodePointer.cs
index 1af6e149ac5..4d772315afb 100644
--- a/mcs/class/referencesource/System.Data/System/NewXml/XPathNodePointer.cs
+++ b/mcs/class/referencesource/System.Data/System/NewXml/XPathNodePointer.cs
@@ -2,8 +2,8 @@
// <copyright file="XPathNodePointer.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
#pragma warning disable 618 // ignore obsolete warning about XmlDataDocument
namespace System.Xml {
@@ -169,7 +169,7 @@ namespace System.Xml {
}
}
- //[....]: From CodeReview: Perf: We should have another array similar w/
+ //Microsoft: From CodeReview: Perf: We should have another array similar w/
// xmlNodeType_To_XpathNodeType_Map that will return String.Empty for everything but the element and
// attribute case.
internal string LocalName {
diff --git a/mcs/class/referencesource/System.Data/System/NewXml/XmlBoundElement.cs b/mcs/class/referencesource/System.Data/System/NewXml/XmlBoundElement.cs
index 476facfa93a..33f8307d359 100644
--- a/mcs/class/referencesource/System.Data/System/NewXml/XmlBoundElement.cs
+++ b/mcs/class/referencesource/System.Data/System/NewXml/XmlBoundElement.cs
@@ -2,8 +2,8 @@
// <copyright file="XmlBoundElement.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
#pragma warning disable 618 // ignore obsolete warning about XmlDataDocument
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Data/System/NewXml/XmlDataDocument.cs b/mcs/class/referencesource/System.Data/System/NewXml/XmlDataDocument.cs
index c2b65001e20..b2dc5d618b8 100644
--- a/mcs/class/referencesource/System.Data/System/NewXml/XmlDataDocument.cs
+++ b/mcs/class/referencesource/System.Data/System/NewXml/XmlDataDocument.cs
@@ -2,8 +2,8 @@
// <copyright file="XmlDataDocument.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
using System;
@@ -606,9 +606,9 @@ namespace System.Xml {
DataRow row = node.Row;
// create new attrs & elements for row
- // For detached rows: we are in [....] w/ temp values
- // For non-detached rows: we are in [....] w/ the current values
- // For deleted rows: we never [....]
+ // For detached rows: we are in sync w/ temp values
+ // For non-detached rows: we are in sync w/ the current values
+ // For deleted rows: we never sync
DataRowVersion rowVersion = ( row.RowState == DataRowState.Detached ) ? DataRowVersion.Proposed : DataRowVersion.Current;
foreach( DataColumn col in row.Table.Columns ) {
if ( !IsNotMapped(col) ) {
@@ -1273,7 +1273,7 @@ namespace System.Xml {
if ( col.ColumnMapping == MappingType.SimpleContent && Convert.IsDBNull( value ) && !rowElement.IsFoliated )
ForceFoliation( rowElement, ElementState.WeakFoliation);
else {
- // no need to [....] if not foliated
+ // no need to sync if not foliated
if ( !IsFoliated( rowElement ) ) {
#if DEBUG
// If the new value is null, we should be already foliated if there is a DataPointer that points to the column
@@ -1433,7 +1433,7 @@ lblDoNestedRelationSync:
XmlBoundElement be = row.Element;
Debug.Assert( be != null );
if ( be.IsFoliated ) {
- // Need to [....] changes from ROM to DOM
+ // Need to sync changes from ROM to DOM
OnColumnValueChanged( row, col, be );
}
}
@@ -1535,7 +1535,7 @@ lblDoNestedRelationSync:
// Change the childElement position in the tree to conform to the parent nested relationship in ROM
private void OnNestedParentChange(DataRow child, XmlBoundElement childElement, DataColumn childCol) {
Debug.Assert( child.Element == childElement && childElement.Row == child );
- // This function is (and s/b) called as a result of ROM changes, therefore XML changes done here should not be [....]-ed to ROM
+ // This function is (and s/b) called as a result of ROM changes, therefore XML changes done here should not be sync-ed to ROM
Debug.Assert( ignoreXmlEvents == true );
#if DEBUG
// In order to check that this move does not change the connected/disconnected state of the node
@@ -1697,7 +1697,7 @@ lblDoNestedRelationSync:
OnNodeRemovedFromTree( node, oldParent );
}
else {
- // Removing from disconnected tree to disconnected tree: just [....] the old region
+ // Removing from disconnected tree to disconnected tree: just sync the old region
OnNodeRemovedFromFragment( node, oldParent );
}
}
@@ -1742,7 +1742,7 @@ lblDoNestedRelationSync:
XmlBoundElement oldRowElem;
if ( mapper.GetRegion( oldParent, out oldRowElem ) ) {
- // [....] the old region if it is not deleted
+ // Sync the old region if it is not deleted
DataRow row = oldRowElem.Row;
// Since the old old region was disconnected, then the row can be only Deleted or Detached
Debug.Assert( ! IsRowLive( row ) );
@@ -2171,7 +2171,7 @@ lblDoNestedRelationSync:
private void SynchronizeRowFromRowElement( XmlBoundElement rowElement ) {
SynchronizeRowFromRowElement( rowElement, null );
}
- // [....] row fields w/ values from rowElem region.
+ // Sync row fields w/ values from rowElem region.
// If rowElemList is != null, all subregions of rowElem are appended to it.
private void SynchronizeRowFromRowElement( XmlBoundElement rowElement, ArrayList rowElemList ) {
DataRow row = rowElement.Row;
@@ -2402,7 +2402,7 @@ lblDoNestedRelationSync:
}
}
else {
- // We only need to [....] the embedded sub-regions
+ // We only need to sync the embedded sub-regions
TreeIterator iter = new TreeIterator( node );
for (bool fMore = iter.NextRowElement(); fMore; fMore = iter.NextRightRowElement() )
rowElemList.Add( iter.CurrentNode );
@@ -2588,7 +2588,7 @@ lblDoNestedRelationSync:
if ( row.RowState == DataRowState.Detached )
SynchronizeRowFromRowElementEx( rowElement, rowElemList );
- // Nothing to do if the row is deleted (there is no [....]-ing from XML to ROM for deleted rows)
+ // Nothing to do if the row is deleted (there is no sync-ing from XML to ROM for deleted rows)
}
private void SetNestedParentRegion( XmlBoundElement childRowElem ) {
diff --git a/mcs/class/referencesource/System.Data/System/NewXml/XmlDataImplementation.cs b/mcs/class/referencesource/System.Data/System/NewXml/XmlDataImplementation.cs
index ed253a35a14..c3e98395886 100644
--- a/mcs/class/referencesource/System.Data/System/NewXml/XmlDataImplementation.cs
+++ b/mcs/class/referencesource/System.Data/System/NewXml/XmlDataImplementation.cs
@@ -2,8 +2,8 @@
// <copyright file="XmlDataImplementation.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
#pragma warning disable 618 // ignore obsolete warning about XmlDataDocument
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Data/bid/inc/cs/bidPrivateBase.cs b/mcs/class/referencesource/System.Data/bid/inc/cs/bidPrivateBase.cs
index a2bf64dd498..0783a6e8088 100644
--- a/mcs/class/referencesource/System.Data/bid/inc/cs/bidPrivateBase.cs
+++ b/mcs/class/referencesource/System.Data/bid/inc/cs/bidPrivateBase.cs
@@ -2,8 +2,8 @@
// <copyright file="BidPrivateBase.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="true" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="true" primary="false">Microsoft</owner>
// Last Modified: 6-November-2008
//-----------------------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Data/system.data.txt b/mcs/class/referencesource/System.Data/system.data.txt
index ef72da35619..c4d1f60995a 100644
--- a/mcs/class/referencesource/System.Data/system.data.txt
+++ b/mcs/class/referencesource/System.Data/system.data.txt
@@ -6,10 +6,13 @@
; NOTE: do not use \", use ' instead
; NOTE: Use # or ; for comments
+; <owner current="true" primary="true">markash</owner>
+; <owner current="true" primary="false">laled</owner>
; These are the managed resources for System.Data.dll. See
; ResourceManager documentation and the ResGen tool.
+;; TODO: Remove Common Code stuff if we ever get Friend Assemblies to work
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; COMMON CODE STUFF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -52,6 +55,12 @@ ADP_NonPooledOpenTimeout=Timeout attempting to open the connection. The time pe
ADP_InvalidMixedUsageOfSecureAndClearCredential=Cannot use Credential with UserID, UID, Password, or PWD connection string keywords.
ADP_InvalidMixedUsageOfSecureCredentialAndIntegratedSecurity=Cannot use Credential with Integrated Security connection string keyword.
ADP_InvalidMixedUsageOfSecureCredentialAndContextConnection=Cannot use Credential with Context Connection keyword.
+ADP_InvalidMixedUsageOfAccessTokenAndUserIDPassword=Cannot set the AccessToken property if 'UserID', 'UID', 'Password', or 'PWD' has been specified in connection string.
+ADP_InvalidMixedUsageOfAccessTokenAndIntegratedSecurity=Cannot set the AccessToken property if the 'Integrated Security' connection string keyword has been set to 'true' or 'SSPI'.
+ADP_InvalidMixedUsageOfAccessTokenAndContextConnection=Cannot set the AccessToken property with the 'Context Connection' keyword.
+ADP_InvalidMixedUsageOfAccessTokenAndCredential=Cannot set the AccessToken property if the Credential property is already set.
+ADP_InvalidMixedUsageOfCredentialAndAccessToken=Cannot set the Credential property if the AccessToken property is already set.
+ADP_InvalidMixedUsageOfAccessTokenAndAuthentication=Cannot set the AccessToken property if 'Authentication' has been specified in the connection string.
ADP_MustBeReadOnly={0} must be marked as read only.
DataCategory_Data=Data
DataCategory_StateChange=StateChange
@@ -1082,6 +1091,11 @@ SQL_InvalidPacketSizeValue=Invalid 'Packet Size'. The value must be an integer
SQL_NullEmptyTransactionName=Invalid transaction or invalid name for a point at which to save within the transaction.
SQL_SnapshotNotSupported=The {0} enumeration value, {1}, is not supported by SQL Server 7.0 or SQL Server 2000.
SQL_UserInstanceFailoverNotCompatible=User Instance and Failover are not compatible options. Please choose only one of the two in the connection string.
+SQL_AuthenticationAndIntegratedSecurity=Cannot use 'Authentication' with 'Integrated Security'.
+SQL_IntegratedWithUserIDAndPassword=Cannot use 'Authentication=Active Directory Integrated' with 'User ID', 'UID', 'Password' or 'PWD' connection string keywords.
+SQL_SettingIntegratedWithCredential=Cannot use 'Authentication=Active Directory Integrated', if the Credential property has been set.
+SQL_SettingCredentialWithIntegrated=Cannot set the Credential property if 'Authentication=Active Directory Integrated' has been specified in the connection string.
+
; DataProviderException
SQL_EncryptionNotSupportedByClient=The instance of SQL Server you attempted to connect to requires encryption but this machine does not support it.
SQL_EncryptionNotSupportedByServer=The instance of SQL Server you attempted to connect to does not support encryption.
@@ -1091,6 +1105,7 @@ SQL_CannotModifyPropertyAsyncOperationInProgress={0} cannot be changed while asy
SQL_AsyncConnectionRequired=This command requires an asynchronous connection. Set \"Asynchronous Processing=true\" in the connection string.
SQL_FatalTimeout=Timeout expired. The connection has been broken as a result.
SQL_InstanceFailure=Instance failure.
+SQL_CredentialsNotProvided=Either Credential or both 'User ID' and 'Password' (or 'UID' and 'PWD') connection string keywords must be specified, if 'Authentication={0}'.
SQL_ChangePasswordArgumentMissing=The '{0}' argument must not be null or empty.
SQL_ChangePasswordConflictsWithSSPI=ChangePassword can only be used with SQL authentication, not with integrated security.
@@ -1098,6 +1113,8 @@ SQL_ChangePasswordUseOfUnallowedKey=The keyword '{0}' must not be specified in t
SQL_UnknownSysTxIsolationLevel=Unrecognized System.Transactions.IsolationLevel enumeration value: {0}.
SQL_InvalidPartnerConfiguration=Server {0}, database {1} is not configured for database mirroring.
SQL_MarsUnsupportedOnConnection=The connection does not support MultipleActiveResultSets.
+SQL_ADALFailure=Failed to authenticate the user {0} in Active Directory (Authentication={1}).
+SQL_ADALInnerException=Error code 0x{0}; state {1}
;NotSupportedException
SQL_ChangePasswordRequiresYukon=ChangePassword requires SQL Server 9.0 or later.
@@ -1127,10 +1144,19 @@ SQL_ParameterTypeNameRequired=The {0} type parameter '{1}' must have a valid typ
;;; SQLServer.TDSParser
; InvalidOperationException
+SQL_ADALInitializeError=Unable to load adalsql.dll (Authentication={0}). Error code: 0x{1}. For more information, see http://go.microsoft.com/fwlink/?LinkID=513072
SQL_InvalidInternalPacketSize=Invalid internal packet size:
SQL_InvalidTDSVersion=The SQL Server instance returned an invalid or unsupported protocol version during login negotiation.
SQL_InvalidTDSPacketSize=Invalid Packet Size.
SQL_ParsingError=Internal connection fatal error.
+SQL_ParsingErrorWithState=Internal connection fatal error. Error state: {0}
+SQL_ParsingErrorValue=Internal connection fatal error. Error state: {0}, Value: {1}
+SQL_ParsingErrorOffset=Internal connection fatal error. Error state: {0}, Offset: {1}
+SQL_ParsingErrorFeatureId=Internal connection fatal error. Error state: {0}, Feature Id: {1}
+SQL_ParsingErrorToken=Internal connection fatal error. Error state: {0}, Token : {1}
+SQL_ParsingErrorLength=Internal connection fatal error. Error state: {0}, Length: {1}
+SQL_ParsingErrorStatus=Internal connection fatal error. Error state: {0}, Status: {1}
+SQL_ParsingErrorAuthLibraryType=Internal connection fatal error. Error state: {0}, Authentication Library Type: {1}
SQL_ConnectionLockedForBcpEvent=The connection cannot be used because there is an ongoing operation that must be finished.
SQL_SNIPacketAllocationFailure=Memory allocation for internal connection failed.
; OverflowException
@@ -1214,6 +1240,10 @@ SQL_ConnectionDoomed=The requested operation cannot be completed because the con
SQL_OpenResultCountExceeded=Open result count exceeded.
;;;
+;;; Global Transactions
+GT_Disabled=Global Transactions are not enabled for this Azure SQL Database. Please contact Azure SQL DB support for assistance.
+GT_UnsupportedSysTxVersion=The System.Transactions.dll loaded does not support Global Transactions. Please upgrade to .NET 4.6.1 or later.
+
;;; Merged Provider
SQL_BatchedUpdatesNotAvailableOnContextConnection=Batching updates is not supported on the context connection.
SQL_ContextAllowsLimitedKeywords=The only additional connection string keyword that may be used when requesting the context connection is the Type System Version keyword.
@@ -1228,7 +1258,7 @@ SQL_UnexpectedSmiEvent=Unexpected server event: {0}.
SQL_UserInstanceNotAvailableInProc=User instances are not allowed when running in the Sql Server process.
SQL_ArgumentLengthMismatch=The length of '{0}' must match the length of '{1}'.
SQL_InvalidSqlDbTypeWithOneAllowedType=The SqlDbType '{0}' is invalid for {1}. Only {2} is supported.
-SQL_PipeErrorRequiresSendEnd=An error occurred with a prior row sent to the SqlPipe. SendResultsEnd must be called before anything else con be sent.
+SQL_PipeErrorRequiresSendEnd=An error occurred with a prior row sent to the SqlPipe. SendResultsEnd must be called before anything else can be sent.
SQL_TooManyValues=Too many values.
SQL_StreamWriteNotSupported=The Stream does not support writing.
SQL_StreamReadNotSupported=The Stream does not support reading.
@@ -1373,6 +1403,7 @@ DbConnectionString_MaxPoolSize=The maximum number of connections allowed in the
DbConnectionString_MinPoolSize=The minimum number of connections allowed in the pool.
DbConnectionString_MultipleActiveResultSets=When true, multiple result sets can be returned and read from one connection.
DbConnectionString_MultiSubnetFailover=If your application is connecting to a high-availability, disaster recovery (AlwaysOn) availability group (AG) on different subnets, MultiSubnetFailover=Yes configures SqlConnection to provide faster detection of and connection to the (currently) active server.
+DbConnectionString_TransparentNetworkIPResolution=If your application connects to different networks, TransparentNetworkIPResolution=Yes configures SqlConnection to provide transparent connection resolution to the currently active server, independently of the network IP topology.
DbConnectionString_NetworkLibrary=The network library used to establish a connection to an instance of SQL Server.
DbConnectionString_PacketSize=Size in bytes of the network packets used to communicate with an instance of SQL Server.
DbConnectionString_Password=Indicates the password to be used when connecting to the data source.
@@ -1389,6 +1420,7 @@ DbConnectionString_ApplicationIntent=Declares the application workload type when
;DbConnectionString_Unicode=If true, the client supports Unicode functionality available in Oracle, or if false, is non-Unicode aware.
DbConnectionString_ConnectRetryCount=Number of attempts to restore connection.
DbConnectionString_ConnectRetryInterval=Delay between attempts to restore connection.
+DbConnectionString_Authentication=Specifies the method of authenticating with SQL Server.
;;;
;;; DbConnection Property Descriptions
; COMMON CODE DbConnection_State=The ConnectionState indicating whether the connection is open or closed.
@@ -1407,6 +1439,7 @@ OleDbConnection_DataSource=Current data source, 'Data Source=X' in the connectio
OleDbConnection_Provider=Current OLE DB provider ProgID, 'Provider=X' in the connection string.
OleDbConnection_ServerVersion=Version of the product accessed by the OLE DB Provider.
+SqlConnection_AccessToken=Access token to use for authentication.
SqlConnection_Asynchronous=State of connection, synchronous or asynchronous. 'Asynchronous Processing=x' in the connection string.
SqlConnection_Replication=Information used to connect for replication.
SqlConnection_ConnectionString=Information used to connect to a DataSource, such as 'Data Source=x;Initial Catalog=x;Integrated Security=SSPI'.
@@ -1417,6 +1450,7 @@ SqlConnection_PacketSize=Network packet size, 'Packet Size=x' in the connection
SqlConnection_ServerVersion=Version of the SQL Server accessed by the SqlConnection.
SqlConnection_WorkstationId=Workstation Id, 'Workstation ID=x' in the connection string.
SqlConnection_StatisticsEnabled=Collect statistics for this connection.
+SqlConnection_CustomColumnEncryptionKeyStoreProviders=Custom column encryption key store providers.
SqlConnection_ClientConnectionId=A guid to represent the physical connection.
SqlConnection_Credential=User Id and secure password to use for authentication.
;;;
@@ -1702,6 +1736,123 @@ LocalDB_MethodNotFound=Invalid SQLUserInstance.dll found at the location specifi
LocalDB_UnobtainableMessage=Cannot obtain Local Database Runtime error message
LocalDB_InvalidVersion=Local Database Runtime: Invalid instance version specification found in the configuration file.
+;;; TCE
+; CertificateStoreProvider error messages
+TCE_InvalidKeyEncryptionAlgorithm=Invalid key encryption algorithm specified: '{0}'. Expected value: '{1}'.
+TCE_InvalidKeyEncryptionAlgorithmSysErr=Internal error. Invalid key encryption algorithm specified: '{0}'. Expected value: '{1}'.
+TCE_NullKeyEncryptionAlgorithm=Key encryption algorithm cannot be null.
+TCE_NullKeyEncryptionAlgorithmSysErr=Internal error. Key encryption algorithm cannot be null.
+TCE_EmptyColumnEncryptionKey=Empty column encryption key specified.
+TCE_NullColumnEncryptionKey=Column encryption key cannot be null.
+TCE_EmptyEncryptedColumnEncryptionKey=Internal error. Empty encrypted column encryption key specified.
+TCE_NullEncryptedColumnEncryptionKey=Internal error. Encrypted column encryption key cannot be null.
+TCE_LargeCertificatePathLength=Specified certificate path has {0} bytes, which exceeds maximum length of {1} bytes.
+TCE_LargeCertificatePathLengthSysErr=Internal error. Specified certificate path has {0} bytes, which exceeds maximum length of {1} bytes.
+TCE_NullCertificatePath=Certificate path cannot be null. Use the following format: <certificate location>{2}<certificate store>{2}<certificate thumbprint>, where <certificate location> is either '{0}' or '{1}'.
+TCE_NullCertificatePathSysErr=Internal error. Certificate path cannot be null. Use the following format: <certificate location>{2}<certificate store>{2}<certificate thumbprint>, where <certificate location> is either '{0}' or '{1}'.
+TCE_NullCspPath=Column master key path cannot be null. Use the following format for a key stored in a Microsoft cryptographic service provider (CSP): <CSP Provider Name>{0}<Key Identifier>.
+TCE_NullCspPathSysErr=Internal error. Column master key path cannot be null. Use the following format for a key stored in a Microsoft cryptographic service provider (CSP): <CSP Provider Name>{0}<Key Identifier>.
+TCE_NullCngPath=Column master key path cannot be null. Use the following format for a key stored in a Microsoft Cryptography API: Next Generation (CNG) provider: <CNG Provider Name>{0}<Key Identifier>.
+TCE_NullCngPathSysErr=Internal error. Column master key path cannot be null. Use the following format for a key stored in a Microsoft Cryptography API: Next Generation (CNG) provider: <CNG Provider Name>{0}<Key Identifier>.
+TCE_InvalidCertificatePath=Invalid certificate path: '{0}'. Use the following format: <certificate location>{3}<certificate store>{3}<certificate thumbprint>, where <certificate location> is either '{1}' or '{2}'.
+TCE_InvalidCertificatePathSysErr=Internal error. Invalid certificate path: '{0}'. Use the following format: <certificate location>{3}<certificate store>{3}<certificate thumbprint>, where <certificate location> is either '{1}' or '{2}'.
+TCE_InvalidCspPath=Invalid column master key path: '{0}'. Use the following format for a key stored in a Microsoft cryptographic service provider (CSP): <CSP Provider Name>{1}<Key Identifier>.
+TCE_InvalidCspPathSysErr=Internal error. Invalid column master key path: '{0}'. Use the following format for a key stored in a Microsoft cryptographic service provider (CSP): <CSP Provider Name>{1}<Key Identifier>.
+TCE_InvalidCngPath=Invalid column master key path: '{0}'. Use the following format for a key stored in a Microsoft Cryptography API: Next Generation (CNG) provider: <CNG Provider Name>{1}<Key Identifier>.
+TCE_InvalidCngPathSysErr=Internal error. Invalid column master key path: '{0}'. Use the following format for a key stored in a Microsoft Cryptography API: Next Generation (CNG) provider: <CNG Provider Name>{1}<Key Identifier>.
+TCE_InvalidCertificateLocation=Invalid certificate location '{0}' in certificate path '{1}'. Use the following format: <certificate location>{4}<certificate store>{4}<certificate thumbprint>, where <certificate location> is either '{2}' or '{3}'.
+TCE_InvalidCertificateLocationSysErr=Internal error. Invalid certificate location '{0}' in certificate path '{1}'. Use the following format: <certificate location>{4}<certificate store>{4}<certificate thumbprint>, where <certificate location> is either '{2}' or '{3}'.
+TCE_InvalidCertificateStore=Invalid certificate store '{0}' specified in certificate path '{1}'. Expected value: '{2}'.
+TCE_InvalidCertificateStoreSysErr=Internal error. Invalid certificate store '{0}' specified in certificate path '{1}'. Expected value: '{2}'.
+TCE_EmptyCertificateThumbprint=Empty certificate thumbprint specified in certificate path '{0}'.
+TCE_EmptyCertificateThumbprintSysErr=Internal error. Empty certificate thumbprint specified in certificate path '{0}'.
+TCE_EmptyCspName=Empty Microsoft cryptographic service provider (CSP) name specified in column master key path: '{0}'. Use the following format for a key stored in a Microsoft cryptographic service provider (CSP): <CSP Provider Name>{1}<Key Identifier>.
+TCE_EmptyCspNameSysErr=Internal error. Empty Microsoft cryptographic service provider (CSP) name specified in column master key path: '{0}'. Use the following format for a key stored in a Microsoft cryptographic service provider (CSP): <CSP Provider Name>{1}<Key Identifier>.
+TCE_EmptyCngName=Empty Microsoft Cryptography API: Next Generation (CNG) provider name specified in column master key path: '{0}'. Use the following format for a key stored in a Microsoft Cryptography API: Next Generation (CNG) provider: <CNG Provider Name>{1}<Key Identifier>.
+TCE_EmptyCngNameSysErr=Internal error. Empty Microsoft Cryptography API: Next Generation (CNG) provider name specified in column master key path: '{0}'. Use the following format for a key stored in a Microsoft Cryptography API: Next Generation (CNG) provider: <CNG Provider Name>{1}<Key Identifier>.
+TCE_EmptyCspKeyId=Empty key identifier specified in column master key path: '{0}'. Use the following format for a key stored in a Microsoft cryptographic service provider (CSP): <CSP Provider Name>{1}<Key Identifier>.
+TCE_EmptyCspKeyIdSysErr=Internal error. Empty key identifier specified in column master key path: '{0}'. Use the following format for a key stored in a Microsoft cryptographic service provider (CSP): <CSP Provider Name>{1}<Key Identifier>.
+TCE_EmptyCngKeyId=Empty key identifier specified in column master key path: '{0}'. Use the following format for a key stored in a Microsoft Cryptography API: Next Generation (CNG) provider: <CNG Provider Name>{1}<Key Identifier>.
+TCE_EmptyCngKeyIdSysErr=Internal error. Empty key identifier specified in column master key path: '{0}'. Use the following format for a key stored in a Microsoft Cryptography API: Next Generation (CNG) provider: <CNG Provider Name>{1}<Key Identifier>.
+TCE_InvalidCspName=Invalid Microsoft cryptographic service provider (CSP) name: '{0}'. Verify that the CSP provider name in column master key path: '{1}' is valid and installed on the machine.
+TCE_InvalidCspNameSysErr=Internal error. Invalid Microsoft cryptographic service provider (CSP) name: '{0}'. Verify that the CSP provider name in column master key path: '{1}' is valid and installed on the machine.
+TCE_InvalidCspKeyId=Invalid key identifier: '{0}'. Verify that the key identifier in column master key path: '{1}' is valid and exists in the CSP.
+TCE_InvalidCspKeyIdSysErr=Internal error. Invalid key identifier: '{0}'. Verify that the key identifier in column master key path: '{1}' is valid and exists in the CSP.
+TCE_InvalidCngKey=An error occurred while opening the Microsoft Cryptography API: Next Generation (CNG) key: '{0}'. Verify that the CNG provider name '{1}' is valid, installed on the machine, and the key '{2}' exists.
+TCE_InvalidCngKeySysErr=Internal error. An error occurred while opening the Microsoft Cryptography API: Next Generation (CNG) key: '{0}'. Verify that the CNG provider name '{1}' is valid, installed on the machine, and the key '{2}' exists.
+TCE_CertificateNotFound=Certificate with thumbprint '{0}' not found in certificate store '{1}' in certificate location '{2}'.
+TCE_CertificateNotFoundSysErr=Certificate with thumbprint '{0}' not found in certificate store '{1}' in certificate location '{2}'. Verify the certificate path in the column master key definition in the database is correct, and the certificate has been imported correctly into the certificate location/store.
+TCE_InvalidAlgorithmVersionInEncryptedCEK=Specified encrypted column encryption key contains an invalid encryption algorithm version '{0}'. Expected version is '{1}'.
+TCE_InvalidCiphertextLengthInEncryptedCEK=The specified encrypted column encryption key's ciphertext length: {0} does not match the ciphertext length: {1} when using column master key (certificate) in '{2}'. The encrypted column encryption key may be corrupt, or the specified certificate path may be incorrect.
+TCE_InvalidCiphertextLengthInEncryptedCEKCsp=The specified encrypted column encryption key's ciphertext length: {0} does not match the ciphertext length: {1} when using column master key (asymmetric key) in '{2}'. The encrypted column encryption key may be corrupt, or the specified Microsoft Cryptographic Service provider (CSP) path may be incorrect.
+TCE_InvalidCiphertextLengthInEncryptedCEKCng=The specified encrypted column encryption key's ciphertext length: {0} does not match the ciphertext length: {1} when using column master key (asymmetric key) in '{2}'. The encrypted column encryption key may be corrupt, or the specified Microsoft Cryptography API: Next Generation (CNG) provider path may be incorrect.
+TCE_InvalidSignatureInEncryptedCEK=The specified encrypted column encryption key's signature length: {0} does not match the signature length: {1} when using column master key (certificate) in '{2}'. The encrypted column encryption key may be corrupt, or the specified certificate path may be incorrect.
+TCE_InvalidSignatureInEncryptedCEKCsp=The specified encrypted column encryption key's signature length: {0} does not match the signature length: {1} when using column master key (asymmetric key) in '{2}'. The encrypted column encryption key may be corrupt, or the specified Microsoft cryptographic service provider (CSP) path may be incorrect.
+TCE_InvalidSignatureInEncryptedCEKCng=The specified encrypted column encryption key's signature length: {0} does not match the signature length: {1} when using column master key (asymmetric key) in '{2}'. The encrypted column encryption key may be corrupt, or the specified Microsoft Cryptography API: Next Generation (CNG) provider path may be incorrect.
+TCE_InvalidCertificateSignature=The specified encrypted column encryption key signature does not match the signature computed with the column master key (certificate) in '{0}'. The encrypted column encryption key may be corrupt, or the specified path may be incorrect.
+TCE_InvalidSignature=The specified encrypted column encryption key signature does not match the signature computed with the column master key (asymmetric key) in '{0}'. The encrypted column encryption key may be corrupt, or the specified path may be incorrect.
+TCE_CertificateWithNoPrivateKey=Certificate specified in key path '{0}' does not have a private key to encrypt a column encryption key. Verify the certificate is imported correctly.
+TCE_CertificateWithNoPrivateKeySysErr=Certificate specified in key path '{0}' does not have a private key to decrypt a column encryption key. Verify the certificate is imported correctly.
+
+; Cryptographic algorithms error messages
+TCE_NullColumnEncryptionKeySysErr=Internal error. Column encryption key cannot be null.
+TCE_InvalidKeySize=The column encryption key has been successfully decrypted but it's length: {1} does not match the length: {2} for algorithm '{0}'. Verify the encrypted value of the column encryption key in the database.
+TCE_InvalidEncryptionType=Encryption type '{1}' specified for the column in the database is either invalid or corrupted. Valid encryption types for algorithm '{0}' are: {2}.
+TCE_NullPlainText=Internal error. Plaintext value cannot be null.
+TCE_VeryLargeCiphertext=Cannot encrypt. Encrypting resulted in {0} bytes of ciphertext which exceeds the maximum allowed limit of {1} bytes. The specified plaintext value is likely too large (plaintext size is: {2} bytes).
+TCE_NullCipherText=Internal error. Ciphertext value cannot be null.
+TCE_InvalidCipherTextSize=Specified ciphertext has an invalid size of {0} bytes, which is below the minimum {1} bytes required for decryption.
+TCE_InvalidAlgorithmVersion=The specified ciphertext's encryption algorithm version '{0}' does not match the expected encryption algorithm version '{1}'.
+TCE_InvalidAuthenticationTag=Specified ciphertext has an invalid authentication tag.
+TCE_NullColumnEncryptionAlgorithm=Internal error. Encryption algorithm cannot be null. Valid algorithms are: {0}.
+
+; Errors from sp_describe_parameter_encryption
+TCE_UnexpectedDescribeParamFormat=Internal error. The format of the resultset returned by {0} is invalid. One of the resultsets is missing.
+TCE_InvalidEncryptionKeyOrdinal=Internal error. The referenced column encryption key ordinal '{1}' is missing in the encryption metadata returned by {0}. Max ordinal is '{2}'.
+TCE_ParamEncryptionMetaDataMissing=Internal error. Metadata for parameter '{1}' in statement or procedure '{2}' is missing in resultset returned by {0}.
+TCE_ProcEncryptionMetaDataMissing=Internal error. Metadata for parameters for command '{1}' in a batch is missing in the resultset returned by {0}.
+
+; Generic toplevel cryptofailures
+TCE_ParamEncryptionFailed=Failed to encrypt parameter '{0}'.
+TCE_ColumnDecryptionFailed=Failed to decrypt column '{0}'.
+TCE_ParamDecryptionFailed=Failed to decrypt parameter '{0}'.
+
+; Query processing error messages
+TCE_UnknownColumnEncryptionAlgorithm=Encryption algorithm '{0}' for the column in the database is either invalid or corrupted. Valid algorithms are: {1}.
+TCE_UnknownColumnEncryptionAlgorithmId=Encryption algorithm id '{0}' for the column in the database is either invalid or corrupted. Valid encryption algorithm ids are: {1}.
+TCE_UnsupportedNormalizationVersion=Normalization version '{0}' received from {2} is not supported. Valid normalization versions are: {1}.
+TCE_UnrecognizedKeyStoreProviderName=Failed to decrypt a column encryption key. Invalid key store provider name: '{0}'. A key store provider name must denote either a system key store provider or a registered custom key store provider. Valid system key store provider names are: {1}. Valid (currently registered) custom key store provider names are: {2}. Please verify key store provider information in column master key definitions in the database, and verify all custom key store providers used in your application are registered properly.
+TCE_KeyDecryptionFailedCertStore=Failed to decrypt a column encryption key using key store provider: '{0}'. The last 10 bytes of the encrypted column encryption key are: '{1}'.
+TCE_UntrustedKeyPath=Column master key path '{0}' received from server '{1}' is not a trusted key path.
+TCE_KeyDecryptionFailed=Failed to decrypt a column encryption key using key store provider: '{0}'. Verify the properties of the column encryption key and its column master key in your database. The last 10 bytes of the encrypted column encryption key are: '{1}'.
+TCE_UnsupportedDatatype=Encryption and decryption of data type '{0}' is not supported.
+TCE_DecryptionFailed=Decryption failed. The last 10 bytes of the encrypted column encryption key are: '{0}'. The first 10 bytes of ciphertext are: '{1}'.
+
+; TCE Generic errors
+TCE_ParamInvalidForceColumnEncryptionSetting=Cannot set {0} for {3} '{1}' because encryption is not enabled for the statement or procedure '{2}'.
+TCE_ParamUnExpectedEncryptionMetadata=Cannot execute statement or procedure '{1}' because {2} was set for {3} '{0}' and the database expects this parameter to be sent as plaintext. This may be due to a configuration error.
+
+; TCE specific SQL connection related error messages
+TCE_NotSupportedByServer={0} instance in use does not support column encryption.
+
+; TCE specific SQL command/adapter related error messages
+TCE_BatchedUpdateColumnEncryptionSettingMismatch={0} should be identical on all commands ({1}, {2}, {3}, {4}) when doing batch updates.
+TCE_StreamNotSupportOnEncryptedColumn=Retrieving encrypted column '{0}' as a {1} is not supported.
+TCE_SequentialAccessNotSupportedOnEncryptedColumn=Retrieving encrypted column '{0}' with {1} is not supported.
+
+; Provider Extensibility error messages
+TCE_CanOnlyCallOnce=Key store providers cannot be set more than once.
+TCE_NullCustomKeyStoreProviderDictionary=Column encryption key store provider dictionary cannot be null. Expecting a non-null value.
+TCE_InvalidCustomKeyStoreProviderName=Invalid key store provider name '{0}'. '{1}' prefix is reserved for system key store providers.
+TCE_NullProviderValue=Null reference specified for key store provider '{0}'. Expecting a non-null value.
+TCE_EmptyProviderName=Invalid key store provider name specified. Key store provider names cannot be null or empty.
+
+; TCE Generic Property descriptions
+TCE_SqlCommand_ColumnEncryptionSetting=Column encryption setting for the command. Overrides the connection level default.
+TCE_DbConnectionString_ColumnEncryptionSetting=Default column encryption setting for all the commands on the connection.
+TCE_SqlParameter_ForceColumnEncryption=Forces parameter to be encrypted before sending sensitive data to server.
+TCE_SqlConnection_TrustedColumnMasterKeyPaths=Dictionary object containing SQL Server names and their trusted column master key paths.
+
; Read-only routing error message
SQLROR_RecursiveRoutingNotSupported=Two or more redirections have occurred. Only one redirection per login is allowed.
SQLROR_FailoverNotSupported=Connecting to a mirrored SQL Server instance using the ApplicationIntent ReadOnly connection option is not supported.
@@ -1719,3 +1870,18 @@ SQLCR_AllAttemptsFailed=The connection is broken and recovery is not possible.
SQLCR_UnrecoverableServer=The connection is broken and recovery is not possible. The connection is marked by the server as unrecoverable. No attempt was made to restore the connection.
SQLCR_UnrecoverableClient=The connection is broken and recovery is not possible. The connection is marked by the client driver as unrecoverable. No attempt was made to restore the connection.
SQLCR_NoCRAckAtReconnection=The server did not acknowledge a recovery attempt, connection recovery is not possible.
+
+DbConnectionString_PoolBlockingPeriod=Defines the blocking period behavior for a connection pool.
+
+; Azure endpoints
+AZURESQL_GenericEndpoint=.database.windows.net
+AZURESQL_GermanEndpoint=.database.cloudapi.de
+AZURESQL_UsGovEndpoint=.database.usgovcloudapi.net
+AZURESQL_ChinaEndpoint=.database.chinacloudapi.cn
+
+; TCE Generic Property descriptions .Net 4.6.2
+TCE_SqlConnection_ColumnEncryptionQueryMetadataCacheEnabled=Defines whether query metadata caching is enabled.
+TCE_SqlConnection_ColumnEncryptionKeyCacheTtl=Defines the time-to-live of entries in the column encryption key cache.
+
+;;; SQLServer.TDSParser .Net 4.6.2
+SQL_Timeout_Execution=Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. \ No newline at end of file
diff --git a/mcs/class/referencesource/System.IdentityModel.Selectors/infocard/common/managed/InfoCardCryptoHelper.cs b/mcs/class/referencesource/System.IdentityModel.Selectors/infocard/common/managed/InfoCardCryptoHelper.cs
index 1e7281d0cd7..1a53c754fa6 100644
--- a/mcs/class/referencesource/System.IdentityModel.Selectors/infocard/common/managed/InfoCardCryptoHelper.cs
+++ b/mcs/class/referencesource/System.IdentityModel.Selectors/infocard/common/managed/InfoCardCryptoHelper.cs
@@ -8,7 +8,7 @@ namespace Microsoft.InfoCards
using System.Security.Cryptography;
using System.Security.Cryptography.Xml;
- // copied from IdentityModel\CryptoHelper.cs and they need to be kept in [....]. After V1, we need to rethink how we can have
+ // copied from IdentityModel\CryptoHelper.cs and they need to be kept in sync. After V1, we need to rethink how we can have
// a single place to ask this question. Perhaps even add it as an extensibility
internal static class InfoCardCryptoHelper
diff --git a/mcs/class/referencesource/System.IdentityModel/System/AppContextDefaultValues.cs b/mcs/class/referencesource/System.IdentityModel/System/AppContextDefaultValues.cs
index e879cb1e24b..6f66cdbc746 100644
--- a/mcs/class/referencesource/System.IdentityModel/System/AppContextDefaultValues.cs
+++ b/mcs/class/referencesource/System.IdentityModel/System/AppContextDefaultValues.cs
@@ -31,6 +31,11 @@ namespace System
LocalAppContextSwitches.SetDefaultsLessOrEqual_46();
}
+ if (version <= 40602)
+ {
+ LocalAppContextSwitches.SetDefaultsLessOrEqual_462();
+ }
+
break;
}
}
diff --git a/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/Claims/Claim.cs b/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/Claims/Claim.cs
index bc90eb0f2fe..f8a2a4bdfb3 100644
--- a/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/Claims/Claim.cs
+++ b/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/Claims/Claim.cs
@@ -17,7 +17,7 @@ namespace System.IdentityModel.Claims
// --------------- ---------------- ------------------
// "File" "boot.ini" "Read"
// "HairColor" "Brown" "PossessProperty"
- // "UserName" "[....]" "PossessProperty"
+ // "UserName" "Microsoft" "PossessProperty"
// "Service" "MailService" "Access"
// "Operation" "ReadMail" "Invoke"
// ClaimType:
diff --git a/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/Claims/X509CertificateClaimSet.cs b/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/Claims/X509CertificateClaimSet.cs
index 7561fffb97f..cf6bf7762e7 100644
--- a/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/Claims/X509CertificateClaimSet.cs
+++ b/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/Claims/X509CertificateClaimSet.cs
@@ -192,7 +192,15 @@ namespace System.IdentityModel.Claims
if (!string.IsNullOrEmpty(value))
claims.Add(Claim.CreateUriClaim(new Uri(value)));
- RSA rsa = this.certificate.PublicKey.Key as RSA;
+ RSA rsa;
+ if (LocalAppContextSwitches.DisableCngCertificates)
+ {
+ rsa = this.certificate.PublicKey.Key as RSA;
+ }
+ else
+ {
+ rsa = CngLightup.GetRSAPublicKey(this.certificate);
+ }
if (rsa != null)
claims.Add(Claim.CreateRsaClaim(rsa));
diff --git a/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/CryptoHelper.cs b/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/CryptoHelper.cs
index bfcc748bf4b..bfe9e626697 100644
--- a/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/CryptoHelper.cs
+++ b/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/CryptoHelper.cs
@@ -865,7 +865,7 @@ namespace System.IdentityModel
catch (InvalidOperationException)
{
algorithmObject = null;
- // We ---- the exception and continue.
+ // We swallow the exception and continue.
}
if (algorithmObject != null)
@@ -901,7 +901,7 @@ namespace System.IdentityModel
catch (InvalidOperationException)
{
algorithmObject = null;
- // We ---- the exception and continue.
+ // We swallow the exception and continue.
}
if (algorithmObject != null)
{
@@ -952,7 +952,7 @@ namespace System.IdentityModel
}
catch (InvalidOperationException)
{
- // We ---- the exception and continue.
+ // We swallow the exception and continue.
}
if (algorithmObject != null)
{
diff --git a/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/LocalAppContextSwitches.cs b/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/LocalAppContextSwitches.cs
index b6bc822248a..ccea9bbbc91 100644
--- a/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/LocalAppContextSwitches.cs
+++ b/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/LocalAppContextSwitches.cs
@@ -2,6 +2,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------
+#pragma warning disable 0436 //Disable the type conflict warning for the types used by LocalAppContext framework (Quirking)
namespace System.IdentityModel
{
using System;
@@ -16,10 +17,12 @@ namespace System.IdentityModel
private const string EnableCachedEmptyDefaultAuthorizationContextString = "Switch.System.IdentityModel.EnableCachedEmptyDefaultAuthorizationContext";
private const string DisableMultipleDNSEntriesInSANCertificateString = "Switch.System.IdentityModel.DisableMultipleDNSEntriesInSANCertificate";
private const string DisableUpdatingRsaProviderTypeString = "Switch.System.IdentityModel.DisableUpdatingRsaProviderType";
+ private const string DisableCngCertificatesString = "Switch.System.IdentityModel.DisableCngCertificates";
private static int enableCachedEmptyDefaultAuthorizationContext;
private static int disableMultipleDNSEntriesInSANCertificate;
private static int disableUpdatingRsaProviderType;
+ private static int disableCngCertificatesString;
public static bool EnableCachedEmptyDefaultAuthorizationContext
{
@@ -48,6 +51,15 @@ namespace System.IdentityModel
}
}
+ public static bool DisableCngCertificates
+ {
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ get
+ {
+ return LocalAppContext.GetCachedSwitchValue(DisableCngCertificatesString, ref disableCngCertificatesString);
+ }
+ }
+
public static void SetDefaultsLessOrEqual_452()
{
#pragma warning disable BCL0012
@@ -63,5 +75,13 @@ namespace System.IdentityModel
LocalAppContext.DefineSwitchDefault(DisableMultipleDNSEntriesInSANCertificateString, true);
#pragma warning restore BCL0012
}
+
+ public static void SetDefaultsLessOrEqual_462()
+ {
+#pragma warning disable BCL0012
+ // Define the switches that should be true for 4.6.2 or less, false for above 4.6.2.
+ LocalAppContext.DefineSwitchDefault(DisableCngCertificatesString, true);
+#pragma warning restore BCL0012
+ }
}
}
diff --git a/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/RsaEncryptionCookieTransform.cs b/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/RsaEncryptionCookieTransform.cs
index 33cac6ffb63..9ada52d4ddd 100644
--- a/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/RsaEncryptionCookieTransform.cs
+++ b/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/RsaEncryptionCookieTransform.cs
@@ -46,14 +46,14 @@ namespace System.IdentityModel
/// </summary>
/// <param name="key">The provided key will be used as the encryption and decryption key by default.</param>
/// <exception cref="ArgumentNullException">When the key is null.</exception>
- public RsaEncryptionCookieTransform( RSA key )
+ public RsaEncryptionCookieTransform(RSA key)
{
- if ( null == key )
+ if (null == key)
{
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull( "key" );
+ throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("key");
}
_encryptionKey = key;
- _decryptionKeys.Add( _encryptionKey );
+ _decryptionKeys.Add(_encryptionKey);
}
/// <summary>
@@ -63,14 +63,14 @@ namespace System.IdentityModel
/// <exception cref="ArgumentNullException">When certificate is null.</exception>
/// <exception cref="ArgumentException">When the certificate has no private key.</exception>
/// <exception cref="ArgumentException">When the certificate's key is not RSA.</exception>
- public RsaEncryptionCookieTransform( X509Certificate2 certificate )
+ public RsaEncryptionCookieTransform(X509Certificate2 certificate)
{
- if ( null == certificate )
+ if (null == certificate)
{
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull( "certificate" );
+ throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("certificate");
}
- _encryptionKey = X509Util.EnsureAndGetPrivateRSAKey( certificate );
- _decryptionKeys.Add( _encryptionKey );
+ _encryptionKey = X509Util.EnsureAndGetPrivateRSAKey(certificate);
+ _decryptionKeys.Add(_encryptionKey);
}
/// <summary>
@@ -90,7 +90,7 @@ namespace System.IdentityModel
set
{
_encryptionKey = value;
- _decryptionKeys = new List<RSA>( new RSA[] { _encryptionKey });
+ _decryptionKeys = new List<RSA>(new RSA[] { _encryptionKey });
}
}
@@ -118,11 +118,11 @@ namespace System.IdentityModel
get { return _hashName; }
set
{
- using ( HashAlgorithm algorithm = CryptoHelper.CreateHashAlgorithm( value ) )
+ using (HashAlgorithm algorithm = CryptoHelper.CreateHashAlgorithm(value))
{
- if ( algorithm == null )
+ if (algorithm == null)
{
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument( "value", SR.GetString( SR.ID6034, value ) );
+ throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("value", SR.GetString(SR.ID6034, value));
}
_hashName = value;
}
@@ -138,23 +138,23 @@ namespace System.IdentityModel
/// <exception cref="ArgumentException">The argument 'encoded' contains zero bytes.</exception>
/// <exception cref="NotSupportedException">The platform does not support the requested algorithm.</exception>
/// <exception cref="InvalidOperationException">There are no decryption keys or none of the keys match.</exception>
- public override byte[] Decode( byte[] encoded )
+ public override byte[] Decode(byte[] encoded)
{
- if ( null == encoded )
+ if (null == encoded)
{
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull( "encoded" );
+ throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("encoded");
}
- if ( 0 == encoded.Length )
+ if (0 == encoded.Length)
{
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument( "encoded", SR.GetString( SR.ID6045 ) );
+ throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("encoded", SR.GetString(SR.ID6045));
}
ReadOnlyCollection<RSA> decryptionKeys = DecryptionKeys;
- if ( 0 == decryptionKeys.Count )
+ if (0 == decryptionKeys.Count)
{
- throw DiagnosticUtility.ThrowHelperInvalidOperation( SR.GetString( SR.ID6039 ) );
+ throw DiagnosticUtility.ThrowHelperInvalidOperation(SR.GetString(SR.ID6039));
}
byte[] encryptedKeyAndIV;
@@ -162,50 +162,50 @@ namespace System.IdentityModel
byte[] rsaHash;
RSA rsaDecryptionKey = null;
- using ( HashAlgorithm hash = CryptoHelper.CreateHashAlgorithm( _hashName ) )
+ using (HashAlgorithm hash = CryptoHelper.CreateHashAlgorithm(_hashName))
{
int hashSizeInBytes = hash.HashSize / 8;
- using ( BinaryReader br = new BinaryReader( new MemoryStream( encoded ) ) )
+ using (BinaryReader br = new BinaryReader(new MemoryStream(encoded)))
{
- rsaHash = br.ReadBytes( hashSizeInBytes );
+ rsaHash = br.ReadBytes(hashSizeInBytes);
int encryptedKeyAndIVSize = br.ReadInt32();
- if ( encryptedKeyAndIVSize < 0 )
+ if (encryptedKeyAndIVSize < 0)
{
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperError( new FormatException( SR.GetString( SR.ID1006, encryptedKeyAndIVSize ) ) );
+ throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new FormatException(SR.GetString(SR.ID1006, encryptedKeyAndIVSize)));
}
//
// Enforce upper limit on key size to prevent large buffer allocation in br.ReadBytes()
//
- if ( encryptedKeyAndIVSize > encoded.Length )
+ if (encryptedKeyAndIVSize > encoded.Length)
{
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperError( new FormatException( SR.GetString( SR.ID1007 ) ) );
+ throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new FormatException(SR.GetString(SR.ID1007)));
}
- encryptedKeyAndIV = br.ReadBytes( encryptedKeyAndIVSize );
+ encryptedKeyAndIV = br.ReadBytes(encryptedKeyAndIVSize);
int encryptedDataSize = br.ReadInt32();
- if ( encryptedDataSize < 0 )
+ if (encryptedDataSize < 0)
{
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperError( new FormatException( SR.GetString( SR.ID1008, encryptedDataSize ) ) );
+ throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new FormatException(SR.GetString(SR.ID1008, encryptedDataSize)));
}
//
// Enforce upper limit on data size to prevent large buffer allocation in br.ReadBytes()
//
- if ( encryptedDataSize > encoded.Length )
+ if (encryptedDataSize > encoded.Length)
{
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperError( new FormatException( SR.GetString( SR.ID1009 ) ) );
+ throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new FormatException(SR.GetString(SR.ID1009)));
}
- encryptedData = br.ReadBytes( encryptedDataSize );
+ encryptedData = br.ReadBytes(encryptedDataSize);
}
//
// Find the decryption key matching the one in XML
//
- foreach ( RSA key in decryptionKeys )
+ foreach (RSA key in decryptionKeys)
{
- byte[] hashedKey = hash.ComputeHash( Encoding.UTF8.GetBytes( key.ToXmlString( false ) ) );
- if ( CryptoHelper.IsEqual( hashedKey, rsaHash ) )
+ byte[] hashedKey = hash.ComputeHash(Encoding.UTF8.GetBytes(key.ToXmlString(false)));
+ if (CryptoHelper.IsEqual(hashedKey, rsaHash))
{
rsaDecryptionKey = key;
break;
@@ -213,19 +213,12 @@ namespace System.IdentityModel
}
}
- if ( rsaDecryptionKey == null )
+ if (rsaDecryptionKey == null)
{
- throw DiagnosticUtility.ThrowHelperInvalidOperation( SR.GetString( SR.ID6040 ) );
+ throw DiagnosticUtility.ThrowHelperInvalidOperation(SR.GetString(SR.ID6040));
}
- RSACryptoServiceProvider rsaProvider = rsaDecryptionKey as RSACryptoServiceProvider;
-
- if ( rsaProvider == null )
- {
- throw DiagnosticUtility.ThrowHelperInvalidOperation( SR.GetString( SR.ID6041 ) );
- }
-
- byte[] decryptedKeyAndIV = rsaProvider.Decrypt( encryptedKeyAndIV, true );
+ byte[] decryptedKeyAndIV = CngLightup.OaepSha1Decrypt(rsaDecryptionKey, encryptedKeyAndIV);
using (SymmetricAlgorithm symmetricAlgorithm = CryptoHelper.NewDefaultEncryption())
{
@@ -265,35 +258,35 @@ namespace System.IdentityModel
/// <exception cref="ArgumentException">The argument 'value' contains zero bytes.</exception>
/// <exception cref="InvalidOperationException">The EncryptionKey is null.</exception>
/// <returns>Encoded data</returns>
- public override byte[] Encode( byte[] value )
+ public override byte[] Encode(byte[] value)
{
- if ( null == value )
+ if (null == value)
{
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull( "value" );
+ throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("value");
}
- if ( 0 == value.Length )
+ if (0 == value.Length)
{
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument( "value", SR.GetString( SR.ID6044 ) );
+ throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("value", SR.GetString(SR.ID6044));
}
RSA encryptionKey = EncryptionKey;
- if ( null == encryptionKey )
+ if (null == encryptionKey)
{
- throw DiagnosticUtility.ThrowHelperInvalidOperation( SR.GetString( SR.ID6043 ) );
+ throw DiagnosticUtility.ThrowHelperInvalidOperation(SR.GetString(SR.ID6043));
}
byte[] rsaHash;
byte[] encryptedKeyAndIV;
byte[] encryptedData;
- using ( HashAlgorithm hash = CryptoHelper.CreateHashAlgorithm( _hashName ) )
+ using (HashAlgorithm hash = CryptoHelper.CreateHashAlgorithm(_hashName))
{
- rsaHash = hash.ComputeHash( Encoding.UTF8.GetBytes( encryptionKey.ToXmlString( false ) ) );
+ rsaHash = hash.ComputeHash(Encoding.UTF8.GetBytes(encryptionKey.ToXmlString(false)));
}
- using ( SymmetricAlgorithm encryptionAlgorithm = CryptoHelper.NewDefaultEncryption() )
+ using (SymmetricAlgorithm encryptionAlgorithm = CryptoHelper.NewDefaultEncryption())
{
encryptionAlgorithm.GenerateIV();
encryptionAlgorithm.GenerateKey();
@@ -314,21 +307,21 @@ namespace System.IdentityModel
// Concatenate the Key and IV in an attempt to avoid two minimum block lengths in the cookie
//
byte[] keyAndIV = new byte[encryptionAlgorithm.Key.Length + encryptionAlgorithm.IV.Length];
- Array.Copy( encryptionAlgorithm.Key, keyAndIV, encryptionAlgorithm.Key.Length );
- Array.Copy( encryptionAlgorithm.IV, 0, keyAndIV, encryptionAlgorithm.Key.Length, encryptionAlgorithm.IV.Length );
+ Array.Copy(encryptionAlgorithm.Key, keyAndIV, encryptionAlgorithm.Key.Length);
+ Array.Copy(encryptionAlgorithm.IV, 0, keyAndIV, encryptionAlgorithm.Key.Length, encryptionAlgorithm.IV.Length);
- encryptedKeyAndIV = provider.Encrypt( keyAndIV, true );
+ encryptedKeyAndIV = CngLightup.OaepSha1Encrypt(encryptionKey, keyAndIV);
}
- using ( MemoryStream ms = new MemoryStream() )
+ using (MemoryStream ms = new MemoryStream())
{
- using ( BinaryWriter bw = new BinaryWriter( ms ) )
+ using (BinaryWriter bw = new BinaryWriter(ms))
{
- bw.Write( rsaHash );
- bw.Write( encryptedKeyAndIV.Length );
- bw.Write( encryptedKeyAndIV );
- bw.Write( encryptedData.Length );
- bw.Write( encryptedData );
+ bw.Write(rsaHash);
+ bw.Write(encryptedKeyAndIV.Length);
+ bw.Write(encryptedKeyAndIV);
+ bw.Write(encryptedData.Length);
+ bw.Write(encryptedData);
bw.Flush();
}
diff --git a/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/RsaSignatureCookieTransform.cs b/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/RsaSignatureCookieTransform.cs
index 566f8bd6238..d5b7c5c3d98 100644
--- a/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/RsaSignatureCookieTransform.cs
+++ b/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/RsaSignatureCookieTransform.cs
@@ -242,15 +242,18 @@ namespace System.IdentityModel
}
RSA signingKey = SigningKey;
+ if (null == signingKey)
+ {
+ throw DiagnosticUtility.ThrowHelperInvalidOperation(SR.GetString(SR.ID6042));
+ }
RSACryptoServiceProvider rsaCryptoServiceProvider = signingKey as RSACryptoServiceProvider;
-
- if (null == signingKey || null == rsaCryptoServiceProvider)
+ if (rsaCryptoServiceProvider == null && LocalAppContextSwitches.DisableCngCertificates)
{
throw DiagnosticUtility.ThrowHelperInvalidOperation(SR.GetString(SR.ID6042));
}
- if (rsaCryptoServiceProvider.PublicOnly)
+ if (rsaCryptoServiceProvider != null && rsaCryptoServiceProvider.PublicOnly)
{
throw DiagnosticUtility.ThrowHelperInvalidOperation(SR.GetString(SR.ID6046));
}
diff --git a/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/SecurityUtils.cs b/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/SecurityUtils.cs
index 7b2b9f18987..297c9df09bf 100644
--- a/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/SecurityUtils.cs
+++ b/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/SecurityUtils.cs
@@ -28,7 +28,7 @@ namespace System.IdentityModel
public const int WindowsVistaMajorNumber = 6;
static IIdentity anonymousIdentity;
- // these should be kept in [....] with IIS70
+ // these should be kept in sync with IIS70
public const string AuthTypeNTLM = "NTLM";
public const string AuthTypeNegotiate = "Negotiate";
public const string AuthTypeKerberos = "Kerberos";
@@ -727,7 +727,7 @@ namespace System.IdentityModel
}
/// <summary>
- /// Internal helper class to help keep Kerberos and Spnego in [....].
+ /// Internal helper class to help keep Kerberos and Spnego in sync.
/// This code is shared by:
/// System\IdentityModel\Tokens\KerberosReceiverSecurityToken.cs
/// System\ServiceModel\Security\WindowsSspiNegotiation.cs
@@ -736,7 +736,7 @@ namespace System.IdentityModel
internal class ExtendedProtectionPolicyHelper
{
//
- // keep the defaults: _protectionScenario and _policyEnforcement, in [....] with: static class System.ServiceModel.Channel.ChannelBindingUtility
+ // keep the defaults: _protectionScenario and _policyEnforcement, in sync with: static class System.ServiceModel.Channel.ChannelBindingUtility
// We can't access those defaults as IdentityModel cannot take a dependency on ServiceModel
//
static ExtendedProtectionPolicy disabledPolicy = new ExtendedProtectionPolicy(PolicyEnforcement.Never);
@@ -893,11 +893,11 @@ namespace System.IdentityModel
}
/// <summary>
- /// Keep this in [....] with \System\ServiceModel\Channels\ChannelBindingUtility.cs
+ /// Keep this in sync with \System\ServiceModel\Channels\ChannelBindingUtility.cs
/// </summary>
public static ExtendedProtectionPolicy DefaultPolicy
{ //
- //keep the default in [....] with : static class System.ServiceModel.Channels.ChannelBindingUtility
+ //keep the default in sync with : static class System.ServiceModel.Channels.ChannelBindingUtility
//we can't use these defaults as IdentityModel cannot take a dependency on ServiceModel
//
diff --git a/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/SspiWrapper.cs b/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/SspiWrapper.cs
index 9a885e93bc6..cf5e3d5898f 100644
--- a/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/SspiWrapper.cs
+++ b/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/SspiWrapper.cs
@@ -18,6 +18,9 @@ namespace System.IdentityModel
internal enum SchProtocols
{
Zero = 0,
+ PctClient = 0x00000002,
+ PctServer = 0x00000001,
+ Pct = (PctClient | PctServer),
Ssl2Client = 0x00000008,
Ssl2Server = 0x00000004,
Ssl2 = (Ssl2Client | Ssl2Server),
@@ -28,6 +31,17 @@ namespace System.IdentityModel
TlsServer = 0x00000040,
Tls = (TlsClient | TlsServer),
Ssl3Tls = (Ssl3 | Tls),
+ Tls11Client = 0x00000200,
+ Tls11Server = 0x00000100,
+ Tls11 = (Tls11Client | Tls11Server),
+ Tls12Client = 0x00000800,
+ Tls12Server = 0x00000400,
+ Tls12 = (Tls12Client | Tls12Server),
+ UniClient = unchecked((int)0x80000000),
+ UniServer = 0x40000000,
+ Unified = (UniClient | UniServer),
+ ClientMask = (PctClient | Ssl2Client | Ssl3Client | TlsClient | Tls11Client | Tls12Client | UniClient),
+ ServerMask = (PctServer | Ssl2Server | Ssl3Server | TlsServer | Tls11Server | Tls12Server | UniServer)
};
//From WinCrypt.h
diff --git a/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/Tokens/Saml2SecurityTokenHandler.cs b/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/Tokens/Saml2SecurityTokenHandler.cs
index 3911fb6480c..227968329ea 100644
--- a/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/Tokens/Saml2SecurityTokenHandler.cs
+++ b/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/Tokens/Saml2SecurityTokenHandler.cs
@@ -370,7 +370,7 @@ namespace System.IdentityModel.Tokens
if (this.samlSecurityTokenRequirement.MapToWindows)
{
- // TFS: 153865, [....] WindowsIdentity does not set Authtype. I don't think that authtype should be set here anyway.
+ // TFS: 153865, Microsoft WindowsIdentity does not set Authtype. I don't think that authtype should be set here anyway.
// The authtype will be S4U (kerberos) it doesn't really matter that the upn arrived in a SAML token.
claimsIdentity = this.CreateWindowsIdentity(this.FindUpn(claimsIdentity));
diff --git a/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/Tokens/SamlSecurityTokenHandler.cs b/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/Tokens/SamlSecurityTokenHandler.cs
index 3ee5369d33f..0fbf94a87c6 100644
--- a/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/Tokens/SamlSecurityTokenHandler.cs
+++ b/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/Tokens/SamlSecurityTokenHandler.cs
@@ -1020,7 +1020,7 @@ namespace System.IdentityModel.Tokens
if (_samlSecurityTokenRequirement.MapToWindows)
{
- // TFS: 153865, [....] WindowsIdentity does not set Authtype. I don't think that authtype should be set here anyway.
+ // TFS: 153865, Microsoft WindowsIdentity does not set Authtype. I don't think that authtype should be set here anyway.
// The authtype will be S4U (kerberos) it doesn't really matter that the upn arrived in a SAML token.
WindowsIdentity windowsIdentity = CreateWindowsIdentity(FindUpn(claimsIdentity));
diff --git a/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/Tokens/X509AsymmetricSecurityKey.cs b/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/Tokens/X509AsymmetricSecurityKey.cs
index fb1918c6ca6..ab69fff4836 100644
--- a/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/Tokens/X509AsymmetricSecurityKey.cs
+++ b/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/Tokens/X509AsymmetricSecurityKey.cs
@@ -14,7 +14,8 @@ namespace System.IdentityModel.Tokens
X509Certificate2 certificate;
AsymmetricAlgorithm privateKey;
bool privateKeyAvailabilityDetermined;
- PublicKey publicKey;
+ AsymmetricAlgorithm publicKey;
+ bool publicKeyAvailabilityDetermined;
object thisLock = new Object();
@@ -28,7 +29,7 @@ namespace System.IdentityModel.Tokens
public override int KeySize
{
- get { return this.PublicKey.Key.KeySize; }
+ get { return this.PublicKey.KeySize; }
}
AsymmetricAlgorithm PrivateKey
@@ -39,28 +40,67 @@ namespace System.IdentityModel.Tokens
{
lock (ThisLock)
{
- if (!this.privateKeyAvailabilityDetermined)
+ if (LocalAppContextSwitches.DisableCngCertificates)
{
this.privateKey = this.certificate.PrivateKey;
- this.privateKeyAvailabilityDetermined = true;
}
+ else
+ {
+ this.privateKey = CngLightup.GetRSAPrivateKey(this.certificate);
+ if (this.privateKey != null)
+ {
+ RSACryptoServiceProvider rsaCsp = this.privateKey as RSACryptoServiceProvider;
+ // ProviderType == 1 is PROV_RSA_FULL provider type that only supports SHA1. Change it to PROV_RSA_AES=24 that supports SHA2 also.
+ if (rsaCsp != null && rsaCsp.CspKeyContainerInfo.ProviderType == 1)
+ {
+ CspParameters csp = new CspParameters();
+ csp.ProviderType = 24;
+ csp.KeyContainerName = rsaCsp.CspKeyContainerInfo.KeyContainerName;
+ csp.KeyNumber = (int)rsaCsp.CspKeyContainerInfo.KeyNumber;
+ if (rsaCsp.CspKeyContainerInfo.MachineKeyStore)
+ csp.Flags = CspProviderFlags.UseMachineKeyStore;
+
+ csp.Flags |= CspProviderFlags.UseExistingKey;
+ this.privateKey = new RSACryptoServiceProvider(csp);
+ }
+ }
+ else
+ {
+ this.privateKey = CngLightup.GetDSAPrivateKey(this.certificate);
+ }
+ if (certificate.HasPrivateKey && this.privateKey == null)
+ DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.PrivateKeyNotSupported)));
+ }
+ this.privateKeyAvailabilityDetermined = true;
}
}
return this.privateKey;
}
}
- PublicKey PublicKey
+ AsymmetricAlgorithm PublicKey
{
get
{
- if (this.publicKey == null)
+ if (!this.publicKeyAvailabilityDetermined)
{
lock (ThisLock)
{
- if (this.publicKey == null)
+ if (!this.publicKeyAvailabilityDetermined)
{
- this.publicKey = this.certificate.PublicKey;
+ if (LocalAppContextSwitches.DisableCngCertificates)
+ {
+ this.publicKey = this.certificate.PublicKey.Key;
+ }
+ else
+ {
+ this.publicKey = CngLightup.GetRSAPublicKey(this.certificate);
+ if (this.publicKey == null)
+ this.publicKey = CngLightup.GetDSAPublicKey(this.certificate);
+ if (this.publicKey == null)
+ DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.PublicKeyNotSupported)));
+ }
+ this.publicKeyAvailabilityDetermined = true;
}
}
}
@@ -115,7 +155,7 @@ namespace System.IdentityModel.Tokens
public override byte[] EncryptKey(string algorithm, byte[] keyData)
{
// Ensure that we have an RSA algorithm object
- RSA rsa = this.PublicKey.Key as RSA;
+ RSA rsa = this.PublicKey as RSA;
if (rsa == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.PublicKeyNotRSA)));
@@ -181,18 +221,18 @@ namespace System.IdentityModel.Tokens
switch (algorithm)
{
case SignedXml.XmlDsigDSAUrl:
- if ((this.PublicKey.Key as DSA) != null)
+ if ((this.PublicKey as DSA) != null)
{
- return (this.PublicKey.Key as DSA);
+ return (this.PublicKey as DSA);
}
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.AlgorithmAndPublicKeyMisMatch)));
case SignedXml.XmlDsigRSASHA1Url:
case SecurityAlgorithms.RsaSha256Signature:
case EncryptedXml.XmlEncRSA15Url:
case EncryptedXml.XmlEncRSAOAEPUrl:
- if ((this.PublicKey.Key as RSA) != null)
+ if ((this.PublicKey as RSA) != null)
{
- return (this.PublicKey.Key as RSA);
+ return (this.PublicKey as RSA);
}
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.AlgorithmAndPublicKeyMisMatch)));
default:
@@ -254,14 +294,14 @@ namespace System.IdentityModel.Tokens
{
SignatureDescription description = algorithmObject as SignatureDescription;
if (description != null)
- return description.CreateDeformatter(this.PublicKey.Key);
+ return description.CreateDeformatter(this.PublicKey);
try
{
AsymmetricSignatureDeformatter asymmetricSignatureDeformatter = algorithmObject as AsymmetricSignatureDeformatter;
if (asymmetricSignatureDeformatter != null)
{
- asymmetricSignatureDeformatter.SetKey(this.PublicKey.Key);
+ asymmetricSignatureDeformatter.SetKey(this.PublicKey);
return asymmetricSignatureDeformatter;
}
}
@@ -279,7 +319,7 @@ namespace System.IdentityModel.Tokens
case SignedXml.XmlDsigDSAUrl:
// Ensure that we have a DSA algorithm object.
- DSA dsa = (this.PublicKey.Key as DSA);
+ DSA dsa = (this.PublicKey as DSA);
if (dsa == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.PublicKeyNotDSA)));
return new DSASignatureDeformatter(dsa);
@@ -287,7 +327,7 @@ namespace System.IdentityModel.Tokens
case SignedXml.XmlDsigRSASHA1Url:
case SecurityAlgorithms.RsaSha256Signature:
// Ensure that we have an RSA algorithm object.
- RSA rsa = (this.PublicKey.Key as RSA);
+ RSA rsa = (this.PublicKey as RSA);
if (rsa == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.PublicKeyNotRSA)));
return new RSAPKCS1SignatureDeformatter(rsa);
@@ -456,13 +496,13 @@ namespace System.IdentityModel.Tokens
switch (algorithm)
{
case SignedXml.XmlDsigDSAUrl:
- return (this.PublicKey.Key is DSA);
+ return (this.PublicKey is DSA);
case SignedXml.XmlDsigRSASHA1Url:
case SecurityAlgorithms.RsaSha256Signature:
case EncryptedXml.XmlEncRSA15Url:
case EncryptedXml.XmlEncRSAOAEPUrl:
- return (this.PublicKey.Key is RSA);
+ return (this.PublicKey is RSA);
default:
return false;
}
diff --git a/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/X509Util.cs b/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/X509Util.cs
index 965002cd32e..7ede60624eb 100644
--- a/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/X509Util.cs
+++ b/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/X509Util.cs
@@ -32,18 +32,23 @@ namespace System.IdentityModel
}
// Check for accessibility of private key
- AsymmetricAlgorithm privateKey;
+ RSA rsa;
try
{
- privateKey = certificate.PrivateKey;
+ if (LocalAppContextSwitches.DisableCngCertificates)
+ {
+ rsa = certificate.PrivateKey as RSA;
+ }
+ else
+ {
+ rsa = CngLightup.GetRSAPrivateKey(certificate);
+ }
}
catch (CryptographicException e)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentException(SR.GetString(SR.ID1039, certificate.Thumbprint), e));
}
- // Reject weird private key
- RSA rsa = privateKey as RSA;
if (rsa == null)
{
#pragma warning suppress 56526 // no validation necessary for value.Thumbprint
@@ -223,13 +228,29 @@ namespace System.IdentityModel
claimsCollection.Add(new Claim(ClaimTypes.Uri, value, ClaimValueTypes.String, issuer));
}
- RSA rsa = certificate.PublicKey.Key as RSA;
+ RSA rsa;
+ if (LocalAppContextSwitches.DisableCngCertificates)
+ {
+ rsa = certificate.PublicKey.Key as RSA;
+ }
+ else
+ {
+ rsa = CngLightup.GetRSAPublicKey(certificate);
+ }
if (rsa != null)
{
claimsCollection.Add(new Claim(ClaimTypes.Rsa, rsa.ToXmlString(false), ClaimValueTypes.RsaKeyValue, issuer));
}
- DSA dsa = certificate.PublicKey.Key as DSA;
+ DSA dsa;
+ if (LocalAppContextSwitches.DisableCngCertificates)
+ {
+ dsa = certificate.PublicKey.Key as DSA;
+ }
+ else
+ {
+ dsa = CngLightup.GetDSAPublicKey(certificate);
+ }
if (dsa != null)
{
claimsCollection.Add(new Claim(ClaimTypes.Dsa, dsa.ToXmlString(false), ClaimValueTypes.DsaKeyValue, issuer));
diff --git a/mcs/class/referencesource/System.Net/net/PeerToPeer/Collaboration/ContactManager.cs b/mcs/class/referencesource/System.Net/net/PeerToPeer/Collaboration/ContactManager.cs
index de8d5aab8f2..0a863133e1b 100644
--- a/mcs/class/referencesource/System.Net/net/PeerToPeer/Collaboration/ContactManager.cs
+++ b/mcs/class/referencesource/System.Net/net/PeerToPeer/Collaboration/ContactManager.cs
@@ -1561,7 +1561,7 @@ namespace System.Net.PeerToPeer.Collaboration
object userToken = createAsyncState.UserToken;
//
- // Call the [....] version of createcontact
+ // Call the sync version of createcontact
//
try{
peerContact = CreateContact(peerNearMe);
diff --git a/mcs/class/referencesource/System.Net/net/PeerToPeer/Collaboration/PeerNearMe.cs b/mcs/class/referencesource/System.Net/net/PeerToPeer/Collaboration/PeerNearMe.cs
index 66fae79abbd..b72b6f990f3 100644
--- a/mcs/class/referencesource/System.Net/net/PeerToPeer/Collaboration/PeerNearMe.cs
+++ b/mcs/class/referencesource/System.Net/net/PeerToPeer/Collaboration/PeerNearMe.cs
@@ -315,7 +315,7 @@ namespace System.Net.PeerToPeer.Collaboration
if (exception != null){
//
- // Throw exception for [....] but call callback for async with exception
+ // Throw exception for sync but call callback for async with exception
//
if (!isAsync)
throw exception;
@@ -328,7 +328,7 @@ namespace System.Net.PeerToPeer.Collaboration
Logging.P2PTraceSource.TraceEvent(TraceEventType.Information, 0, "Found endpoint match in Request status changed.");
//
- // For async call the callback and for [....] just return
+ // For async call the callback and for sync just return
//
if (isAsync){
RefreshDataCompletedEventArgs args = new
@@ -352,7 +352,7 @@ namespace System.Net.PeerToPeer.Collaboration
//
// Async case with exception fire callback here
- // [....] would have already thrown this by now
+ // Sync would have already thrown this by now
//
if (exception != null){
RefreshDataCompletedEventArgs args = new
diff --git a/mcs/class/referencesource/System.Net/net/PeerToPeer/PeerName.cs b/mcs/class/referencesource/System.Net/net/PeerToPeer/PeerName.cs
index e4c8f05b975..b9502c116d7 100644
--- a/mcs/class/referencesource/System.Net/net/PeerToPeer/PeerName.cs
+++ b/mcs/class/referencesource/System.Net/net/PeerToPeer/PeerName.cs
@@ -433,7 +433,7 @@ namespace System.Net.PeerToPeer
/// I have considered using regular expressions. However, the regular expressions offer
/// poor performance and or startup cost. Really there is no substiture for custom
/// parsing logic. I decided to write this piece of code to parse the peername for now
- /// - [....] 6/6/2005
+ /// - Microsoft 6/6/2005
/// </summary>
/// <param name="peerName"></param>
/// <param name="authority"></param>
diff --git a/mcs/class/referencesource/System.Net/net/PeerToPeer/PeerNameResolver.cs b/mcs/class/referencesource/System.Net/net/PeerToPeer/PeerNameResolver.cs
index 887280f9238..62397d824d7 100644
--- a/mcs/class/referencesource/System.Net/net/PeerToPeer/PeerNameResolver.cs
+++ b/mcs/class/referencesource/System.Net/net/PeerToPeer/PeerNameResolver.cs
@@ -490,7 +490,7 @@ namespace System.Net.PeerToPeer
/// <summary>
- /// PeerNameResolver does [....] and async resolves.
+ /// PeerNameResolver does sync and async resolves.
/// PeerNameResolver supports multiple outstanding async calls
/// </summary>
public class PeerNameResolver
@@ -581,7 +581,7 @@ namespace System.Net.PeerToPeer
}
/// <summary>
- /// Implements [....] resolve of the PeerName in the cloud given
+ /// Implements sync resolve of the PeerName in the cloud given
/// </summary>
/// <param name="peerName"></param>
/// <param name="cloud"></param>
@@ -641,7 +641,7 @@ namespace System.Net.PeerToPeer
//---------------------------------------------------------------
//Trace log
//---------------------------------------------------------------
- Logging.P2PTraceSource.TraceEvent(TraceEventType.Information, 0, "[....] Resolve called with PeerName: {0}, Cloud: {1}, MaxRecords {2}", peerName, cloud, maxRecords);
+ Logging.P2PTraceSource.TraceEvent(TraceEventType.Information, 0, "Sync Resolve called with PeerName: {0}, Cloud: {1}, MaxRecords {2}", peerName, cloud, maxRecords);
SafePeerData shEndPointInfoArray;
string NativeCloudName = cloud.InternalName;
@@ -721,7 +721,7 @@ namespace System.Net.PeerToPeer
shEndPointInfoArray.Dispose();
}
}
- Logging.P2PTraceSource.TraceEvent(TraceEventType.Information, 0, "[....] Resolve returnig with PeerNameRecord count :{0}", PeerNameRecords.Count);
+ Logging.P2PTraceSource.TraceEvent(TraceEventType.Information, 0, "Sync Resolve returnig with PeerNameRecord count :{0}", PeerNameRecords.Count);
return PeerNameRecords;
}
diff --git a/mcs/class/referencesource/System.Numerics/System.Numerics.txt b/mcs/class/referencesource/System.Numerics/System.Numerics.txt
index f3827ec29f9..e834a8449ea 100644
--- a/mcs/class/referencesource/System.Numerics/System.Numerics.txt
+++ b/mcs/class/referencesource/System.Numerics/System.Numerics.txt
@@ -6,6 +6,7 @@
; NOTE: do not use \", use ' instead
; NOTE: Use # or ; for comments
+
Argument_InvalidNumberStyles=An undefined NumberStyles value is being used.
Argument_InvalidHexStyle=With the AllowHexSpecifier bit set in the enum bit field, the only other valid bits that can be combined into the enum value must be a subset of those in HexNumber.
Argument_MustBeBigInt=The parameter must be a BigInteger.
@@ -20,3 +21,8 @@ Overflow_Int64=Value was either too large or too small for an Int64.
Overflow_UInt32=Value was either too large or too small for a UInt32.
Overflow_UInt64=Value was either too large or too small for a UInt64.
Overflow_Decimal=Value was either too large or too small for a Decimal.
+Arg_ArgumentOutOfRangeException=Index was out of bounds:
+Arg_ElementsInSourceIsGreaterThanDestination=Number of elements in source vector is greater than the destination array
+Arg_MultiDimArrayNotSupported=Only one-dimensional arrays are supported
+Arg_RegisterLengthOfRangeException=length must be less than
+Arg_NullArgumentNullRef=The method was called with a null array argument.
diff --git a/mcs/class/referencesource/System.Numerics/System/Numerics/Complex.cs b/mcs/class/referencesource/System.Numerics/System/Numerics/Complex.cs
index 42c854dcbf6..ce88cda7498 100644
--- a/mcs/class/referencesource/System.Numerics/System/Numerics/Complex.cs
+++ b/mcs/class/referencesource/System.Numerics/System/Numerics/Complex.cs
@@ -290,7 +290,7 @@ namespace System.Numerics {
return new Complex(Math.Sin(a) * Math.Cosh(b), Math.Cos(a) * Math.Sinh(b));
}
- [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Sinh", Justification = "[....]: Existing Name")]
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Sinh", Justification = "Microsoft: Existing Name")]
public static Complex Sinh(Complex value) /* Hyperbolic sin */
{
double a = value.m_real;
@@ -313,7 +313,7 @@ namespace System.Numerics {
return new Complex(Math.Cos(a) * Math.Cosh(b), - (Math.Sin(a) * Math.Sinh(b)));
}
- [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Cosh", Justification = "[....]: Existing Name")]
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Cosh", Justification = "Microsoft: Existing Name")]
public static Complex Cosh(Complex value) /* Hyperbolic cos */
{
double a = value.m_real;
@@ -333,7 +333,7 @@ namespace System.Numerics {
return (Sin(value) / Cos(value));
}
- [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Tanh", Justification = "[....]: Existing Name")]
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Tanh", Justification = "Microsoft: Existing Name")]
public static Complex Tanh(Complex value) /* Hyperbolic tan */
{
return (Sinh(value) / Cosh(value));
@@ -370,7 +370,7 @@ namespace System.Numerics {
return (new Complex(result_re, result_im));
}
- [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Sqrt", Justification = "[....]: Existing Name")]
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Sqrt", Justification = "Microsoft: Existing Name")]
public static Complex Sqrt(Complex value) /* Square root ot the complex number */
{
return Complex.FromPolarCoordinates(Math.Sqrt(value.Magnitude), value.Phase / 2.0);
diff --git a/mcs/class/referencesource/System.Runtime.Caching/R.resx b/mcs/class/referencesource/System.Runtime.Caching/R.resx
new file mode 100644
index 00000000000..85da51f1f87
--- /dev/null
+++ b/mcs/class/referencesource/System.Runtime.Caching/R.resx
@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <data name="Config_unable_to_get_section" xml:space="preserve">
+ <value>Unable to retrieve configuration section '{0}'.</value>
+ </data>
+ <data name="TimeSpan_invalid_format" xml:space="preserve">
+ <value>Invalid configuration: {0}="{1}". The {0} value must be a time interval that can be parsed by System.TimeSpan.Parse.</value>
+ </data>
+ <data name="Value_must_be_non_negative_integer" xml:space="preserve">
+ <value>Invalid configuration: {0}="{1}". The {0} value must be a non-negative 32-bit integer.</value>
+ </data>
+ <data name="Value_must_be_positive_integer" xml:space="preserve">
+ <value>Invalid configuration: {0}="{1}". The {0} value must be a positive 32-bit integer.</value>
+ </data>
+ <data name="Value_too_big" xml:space="preserve">
+ <value>Invalid configuration: {0}="{1}". The {0} value cannot be greater than '{2}'.</value>
+ </data>
+ <data name="Empty_collection" xml:space="preserve">
+ <value>The collection '{0}' is empty.</value>
+ </data>
+ <data name="Collection_contains_null_element" xml:space="preserve">
+ <value>The collection '{0}' contains a null element.</value>
+ </data>
+ <data name="Collection_contains_null_or_empty_string" xml:space="preserve">
+ <value>The collection '{0}' contains a null or empty string.</value>
+ </data>
+ <data name="Method_already_invoked" xml:space="preserve">
+ <value>The method has already been invoked, and can only be invoked once.</value>
+ </data>
+ <data name="Property_already_set" xml:space="preserve">
+ <value>The property has already been set, and can only be set once.</value>
+ </data>
+ <data name="Invalid_state" xml:space="preserve">
+ <value>Invalid state.</value>
+ </data>
+ <data name="Init_not_complete" xml:space="preserve">
+ <value>Initialization has not completed yet. The InitializationComplete method must be invoked before Dispose is invoked.</value>
+ </data>
+ <data name="Default_is_reserved" xml:space="preserve">
+ <value>Default is a reserved MemoryCache name.</value>
+ </data>
+ <data name="Invalid_expiration_combination" xml:space="preserve">
+ <value>AbsoluteExpiration must be DateTimeOffset.MaxValue or SlidingExpiration must be TimeSpan.Zero.</value>
+ </data>
+ <data name="Invalid_callback_combination" xml:space="preserve">
+ <value>Only one callback can be specified. Either RemovedCallback or UpdateCallback must be null.</value>
+ </data>
+ <data name="Invalid_argument_combination" xml:space="preserve">
+ <value>One of the following parameters must be specified: dependencies, absoluteExpiration, slidingExpiration.</value>
+ </data>
+ <data name="Update_callback_must_be_null" xml:space="preserve">
+ <value>CacheItemUpdateCallback must be null.</value>
+ </data>
+ <data name="Argument_out_of_range" xml:space="preserve">
+ <value>'{0}' must be greater than or equal to '{1}' and less than or equal to '{2}'.</value>
+ </data>
+ <data name="Empty_string_invalid" xml:space="preserve">
+ <value>An empty string is invalid.</value>
+ </data>
+ <data name="RegionName_not_supported" xml:space="preserve">
+ <value>The parameter regionName must be null.</value>
+ </data>
+ <data name="Value_must_be_boolean" xml:space="preserve">
+ <value>Invalid configuration: {0}="{1}". The {0} value must be a boolean.</value>
+ </data>
+</root> \ No newline at end of file
diff --git a/mcs/class/referencesource/System.Runtime.Caching/Resources/R.Designer.cs b/mcs/class/referencesource/System.Runtime.Caching/Resources/R.Designer.cs
index fc9a8303c01..a6a4cc0f7a7 100644
--- a/mcs/class/referencesource/System.Runtime.Caching/Resources/R.Designer.cs
+++ b/mcs/class/referencesource/System.Runtime.Caching/Resources/R.Designer.cs
@@ -223,6 +223,15 @@ namespace System.Runtime.Caching.Resources {
}
/// <summary>
+ /// Looks up a localized string similar to Invalid configuration: {0}=&quot;{1}&quot;. The {0} value must be a boolean..
+ /// </summary>
+ internal static string Value_must_be_boolean {
+ get {
+ return ResourceManager.GetString("Value_must_be_boolean", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to An empty string is invalid..
/// </summary>
internal static string Empty_string_invalid {
diff --git a/mcs/class/referencesource/System.Runtime.Caching/System/Caching/CacheMemoryMonitor.cs b/mcs/class/referencesource/System.Runtime.Caching/System/Caching/CacheMemoryMonitor.cs
index 05af1435998..0de026fa252 100644
--- a/mcs/class/referencesource/System.Runtime.Caching/System/Caching/CacheMemoryMonitor.cs
+++ b/mcs/class/referencesource/System.Runtime.Caching/System/Caching/CacheMemoryMonitor.cs
@@ -44,7 +44,8 @@ namespace System.Runtime.Caching {
_gen2Count = GC.CollectionCount(2);
_cacheSizeSamples = new long[SAMPLE_COUNT];
_cacheSizeSampleTimes = new DateTime[SAMPLE_COUNT];
- InitMemoryCacheManager();
+ if (memoryCache.UseMemoryCacheManager)
+ InitMemoryCacheManager(); // This magic thing connects us to ObjectCacheHost magically. :/
InitDisposableMembers(cacheMemoryLimitMegabytes);
}
diff --git a/mcs/class/referencesource/System.Runtime.Caching/System/Caching/Configuration/ConfigUtil.cs b/mcs/class/referencesource/System.Runtime.Caching/System/Caching/Configuration/ConfigUtil.cs
index 48aff5f2d23..587d4f3b618 100644
--- a/mcs/class/referencesource/System.Runtime.Caching/System/Caching/Configuration/ConfigUtil.cs
+++ b/mcs/class/referencesource/System.Runtime.Caching/System/Caching/Configuration/ConfigUtil.cs
@@ -12,6 +12,7 @@ namespace System.Runtime.Caching.Configuration {
internal const string CacheMemoryLimitMegabytes = "cacheMemoryLimitMegabytes";
internal const string PhysicalMemoryLimitPercentage = "physicalMemoryLimitPercentage";
internal const string PollingInterval = "pollingInterval";
+ internal const string UseMemoryCacheManager = "useMemoryCacheManager";
internal const int DefaultPollingTimeMilliseconds = 120000;
internal static int GetIntValue(NameValueCollection config, string valueName, int defaultValue, bool zeroAllowed, int maxValueAllowed) {
@@ -63,5 +64,19 @@ namespace System.Runtime.Caching.Configuration {
return iValue;
}
+ internal static bool GetBooleanValue(NameValueCollection config, string valueName, bool defaultValue) {
+ string sValue = config[valueName];
+
+ if (sValue == null) {
+ return defaultValue;
+ }
+
+ bool bValue;
+ if (!Boolean.TryParse(sValue, out bValue)) {
+ throw new ArgumentException(RH.Format(R.Value_must_be_boolean, valueName, sValue), "config");
+ }
+
+ return bValue;
+ }
}
}
diff --git a/mcs/class/referencesource/System.Runtime.Caching/System/Caching/MemoryCache.cs b/mcs/class/referencesource/System.Runtime.Caching/System/Caching/MemoryCache.cs
index f74996a20e1..52c3fd7f734 100644
--- a/mcs/class/referencesource/System.Runtime.Caching/System/Caching/MemoryCache.cs
+++ b/mcs/class/referencesource/System.Runtime.Caching/System/Caching/MemoryCache.cs
@@ -34,6 +34,7 @@ namespace System.Runtime.Caching {
private string _name;
private PerfCounters _perfCounters;
private bool _configLess;
+ private bool _useMemoryCacheManager = true;
EventHandler _onAppDomainUnload;
UnhandledExceptionEventHandler _onUnhandledException;
@@ -258,6 +259,10 @@ namespace System.Runtime.Caching {
get { return _name; }
}
+ internal bool UseMemoryCacheManager {
+ get { return _useMemoryCacheManager; }
+ }
+
// Percentage of physical memory that can be used before
// the cache begins to forcibly remove items.
public long PhysicalMemoryLimit {
@@ -280,7 +285,7 @@ namespace System.Runtime.Caching {
Init(null);
}
- [SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Justification="This is assembly is a special case approved by the NetFx API review board")]
+ [SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Justification = "This is assembly is a special case approved by the NetFx API review board")]
public MemoryCache(string name, NameValueCollection config = null) {
if (name == null) {
throw new ArgumentNullException("name");
@@ -294,12 +299,12 @@ namespace System.Runtime.Caching {
_name = name;
Init(config);
}
-
- // Configless is used when redirecting ASP.NET cache into the MemoryCache. This avoids infinite recursion
+
+ // ignoreConfigSection is used when redirecting ASP.NET cache into the MemoryCache. This avoids infinite recursion
// due to the fact that the (ASP.NET) config system uses the cache, and the cache uses the
// config system. This method could be made public, perhaps with CAS to prevent partial trust callers.
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Grandfathered suppression from original caching code checkin")]
- internal MemoryCache(string name, NameValueCollection config, bool configLess) {
+ [SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Justification = "This is assembly is a special case approved by the NetFx API review board")]
+ public MemoryCache(string name, NameValueCollection config, bool ignoreConfigSection) {
if (name == null) {
throw new ArgumentNullException("name");
}
@@ -310,14 +315,15 @@ namespace System.Runtime.Caching {
throw new ArgumentException(R.Default_is_reserved, "name");
}
_name = name;
- _configLess = configLess;
+ _configLess = ignoreConfigSection;
Init(config);
}
+
private void Init(NameValueCollection config) {
_storeCount = Environment.ProcessorCount;
-#if MONO
if (config != null) {
+#if MONO
if (config ["__MonoEmulateOneCPU"] == "true")
_storeCount = 1;
if (config ["__MonoTimerPeriod"] != null) {
@@ -328,9 +334,11 @@ namespace System.Runtime.Caching {
//
}
}
+#endif
+ _useMemoryCacheManager = ConfigUtil.GetBooleanValue(config, ConfigUtil.UseMemoryCacheManager, true);
}
-#endif
_storeRefs = new GCHandleRef<MemoryCacheStore>[_storeCount];
+
InitDisposableMembers(config);
}
@@ -668,6 +676,11 @@ namespace System.Runtime.Caching {
[SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Justification="This is assembly is a special case approved by the NetFx API review board")]
public override object Remove(string key, string regionName = null) {
+ return Remove(key, CacheEntryRemovedReason.Removed, regionName);
+ }
+
+ [SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Justification = "This is assembly is a special case approved by the NetFx API review board")]
+ public object Remove(string key, CacheEntryRemovedReason reason, string regionName = null) {
if (regionName != null) {
throw new NotSupportedException(R.RegionName_not_supported);
}
@@ -677,7 +690,7 @@ namespace System.Runtime.Caching {
if (IsDisposed) {
return null;
}
- MemoryCacheEntry entry = RemoveEntry(key, null, CacheEntryRemovedReason.Removed);
+ MemoryCacheEntry entry = RemoveEntry(key, null, reason);
return (entry != null) ? entry.Value : null;
}
@@ -695,6 +708,14 @@ namespace System.Runtime.Caching {
return count;
}
+ public long GetLastSize(string regionName = null) {
+ if (regionName != null) {
+ throw new NotSupportedException(R.RegionName_not_supported);
+ }
+
+ return _stats.GetLastSize();
+ }
+
[SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Justification="This is assembly is a special case approved by the NetFx API review board")]
public override IDictionary<string, object> GetValues(IEnumerable<String> keys, string regionName = null) {
if (regionName != null) {
diff --git a/mcs/class/referencesource/System.Runtime.Caching/System/Caching/MemoryCacheStatistics.cs b/mcs/class/referencesource/System.Runtime.Caching/System/Caching/MemoryCacheStatistics.cs
index 99196c05f5d..69f3e7b79b8 100644
--- a/mcs/class/referencesource/System.Runtime.Caching/System/Caching/MemoryCacheStatistics.cs
+++ b/mcs/class/referencesource/System.Runtime.Caching/System/Caching/MemoryCacheStatistics.cs
@@ -85,6 +85,10 @@ namespace System.Runtime.Caching {
CacheManagerThread(0);
}
+ internal long GetLastSize() {
+ return this._cacheMemoryMonitor.PressureLast;
+ }
+
private int GetPercentToTrim() {
int gen2Count = GC.CollectionCount(2);
// has there been a Gen 2 Collection since the last trim?
diff --git a/mcs/class/referencesource/System.Runtime.DurableInstancing/System/Runtime/DurableInstancing/InstanceHandle.cs b/mcs/class/referencesource/System.Runtime.DurableInstancing/System/Runtime/DurableInstancing/InstanceHandle.cs
index 95764cc2bfc..fc6f606c097 100644
--- a/mcs/class/referencesource/System.Runtime.DurableInstancing/System/Runtime/DurableInstancing/InstanceHandle.cs
+++ b/mcs/class/referencesource/System.Runtime.DurableInstancing/System/Runtime/DurableInstancing/InstanceHandle.cs
@@ -89,7 +89,7 @@ namespace System.Runtime.DurableInstancing
{
Fx.Assert(value != Guid.Empty, "Cannot set an empty Id.");
Fx.Assert(this.id == Guid.Empty, "Cannot set Id more than once.");
- Fx.Assert(!this.idIsSet, "idIsSet out of [....] with id.");
+ Fx.Assert(!this.idIsSet, "idIsSet out of sync with id.");
this.id = value;
diff --git a/mcs/class/referencesource/System.Runtime.DurableInstancing/System/Runtime/DurableInstancing/InstancePersistenceContext.cs b/mcs/class/referencesource/System.Runtime.DurableInstancing/System/Runtime/DurableInstancing/InstancePersistenceContext.cs
index f5e657cf682..10f94668259 100644
--- a/mcs/class/referencesource/System.Runtime.DurableInstancing/System/Runtime/DurableInstancing/InstancePersistenceContext.cs
+++ b/mcs/class/referencesource/System.Runtime.DurableInstancing/System/Runtime/DurableInstancing/InstancePersistenceContext.cs
@@ -1596,7 +1596,7 @@ namespace System.Runtime.DurableInstancing
}
finally
{
- Fx.AssertAndThrowFatal(this.context.Active, "Out-of-[....] between InstanceExecutionContext and ExecutionAsyncResult.");
+ Fx.AssertAndThrowFatal(this.context.Active, "Out-of-sync between InstanceExecutionContext and ExecutionAsyncResult.");
this.context.LastAsyncResult = null;
this.context.RootAsyncResult = null;
diff --git a/mcs/class/referencesource/System.Runtime.Serialization/System.Runtime.Serialization.txt b/mcs/class/referencesource/System.Runtime.Serialization/System.Runtime.Serialization.txt
index 2f8b8280a55..974e2988222 100644
--- a/mcs/class/referencesource/System.Runtime.Serialization/System.Runtime.Serialization.txt
+++ b/mcs/class/referencesource/System.Runtime.Serialization/System.Runtime.Serialization.txt
@@ -164,6 +164,7 @@ XmlInvalidConversion=The value '{0}' cannot be parsed as the type '{1}'.
XmlInvalidConversionWithoutValue=The value cannot be parsed as the type '{0}'.
XmlStartElementExpected=Start element expected. Found {0}.
XmlWriterMustBeInElement=WriteState '{0}' not valid. Caller must write start element before serializing in contentOnly mode.
+NonOptionalFieldMemberOnIsReferenceSerializableType={0}.{1}' is not marked with OptionalFieldAttribute, thus indicating that it must be serialized. However, '{0}' derives from a class marked with DataContractAttribute and an IsReference setting of '{2}'. It is not possible to have required data members on IsReference classes. Either decorate '{0}.{1}' with OptionalFieldAttribute, or disable the IsReference setting on the appropriate parent class.
# System.Text
@@ -188,25 +189,25 @@ InvalidLocalNameEmpty=The empty string is not a valid local name.
;QuotaMustBePositive=Quota must be a positive value.
XmlArrayTooSmall=Array too small.
XmlArrayTooSmallInput=Array too small. Length of available data must be at least {0}.
-;XmlBadBOM=Unrecognized Byte Order Mark.
+XmlBadBOM=Unrecognized Byte Order Mark.
XmlBase64DataExpected=Base64 encoded data expected. Found {0}.
-;XmlCDATAInvalidAtTopLevel=CData elements not valid at top level of an XML document.
-;XmlCloseCData=']]>' not valid in text node content.
+XmlCDATAInvalidAtTopLevel=CData elements not valid at top level of an XML document.
+XmlCloseCData=']]>' not valid in text node content.
XmlConversionOverflow=The value '{0}' cannot be represented with the type '{1}'.
-;XmlDeclarationRequired=An XML declaration with an encoding is required for all non-UTF8 documents.
+XmlDeclarationRequired=An XML declaration with an encoding is required for all non-UTF8 documents.
XmlDeclMissingVersion=Version not found in XML declaration.
-;XmlDeclMissing=An XML declaration is required for all non-UTF8 documents.
-;XmlDeclNotFirst=No characters can appear before the XML declaration.
+XmlDeclMissing=An XML declaration is required for all non-UTF8 documents.
+XmlDeclNotFirst=No characters can appear before the XML declaration.
XmlDictionaryStringIDRange=XmlDictionaryString IDs must be in the range from {0} to {1}.
XmlDictionaryStringIDUndefinedSession=XmlDictionaryString ID {0} not defined in the XmlBinaryReaderSession.
XmlDictionaryStringIDUndefinedStatic=XmlDictionaryString ID {0} not defined in the static dictionary.
XmlDuplicateAttribute=Duplicate attribute found. Both '{0}' and '{1}' are from the namespace '{2}'.
XmlEmptyNamespaceRequiresNullPrefix=The empty namespace requires a null or empty prefix.
-;XmlEncodingMismatch=The encoding in the declaration '{0}' does not match the encoding of the document '{1}'.
-;XmlEncodingNotSupported=XML encoding not supported.
+XmlEncodingMismatch=The encoding in the declaration '{0}' does not match the encoding of the document '{1}'.
+XmlEncodingNotSupported=XML encoding not supported.
XmlEndElementExpected=End element '{0}' from namespace '{1}' expected. Found {2}.
XmlEndElementNoOpenNodes=No corresponding start element is open.
-;XmlExpectedEncoding=The expected encoding '{0}' does not match the actual encoding '{1}'.
+XmlExpectedEncoding=The expected encoding '{0}' does not match the actual encoding '{1}'.
XmlFoundCData=cdata '{0}'
XmlFoundComment=comment '{0}'
XmlFoundElement=element '{0}' from namespace '{1}'
@@ -220,31 +221,31 @@ XmlFullStartElementNameExpected=Non-empty start element '{0}' expected. Found {1
XmlIDDefined=ID already defined.
XmlKeyAlreadyExists=The specified key already exists in the dictionary.
XmlIllegalOutsideRoot=Text cannot be written outside the root element.
-;XmlInvalidBytes=Invalid byte encoding.
+XmlInvalidBytes=Invalid byte encoding.
XmlInvalidCharRef=Character reference not valid.
XmlInvalidCommentChars=XML comments cannot contain '--' or end with '-'.
XmlInvalidDeclaration=XML declaration can only be written at the beginning of the document.
XmlInvalidDepth=Cannot call '{0}' while Depth is '{1}'.
XmlInvalidEncoding=XML encoding must be 'UTF-8'.
-;XmlInvalidFFFE=Characters with hexadecimal values 0xFFFE and 0xFFFF are not valid.
+XmlInvalidFFFE=Characters with hexadecimal values 0xFFFE and 0xFFFF are not valid.
XmlInvalidFormat=The input source is not correctly formatted.
XmlInvalidID=ID must be >= 0.
XmlInvalidOperation=The reader cannot be advanced.
XmlInvalidPrefixState=A prefix cannot be defined while WriteState is '{0}'.
XmlInvalidQualifiedName=Expected XML qualified name. Found '{0}'.
-;XmlInvalidRootData=The data at the root level is invalid.
+XmlInvalidRootData=The data at the root level is invalid.
XmlInvalidStandalone='standalone' value in declaration must be 'yes' or 'no'.
;XmlInvalidStream=Stream returned by IStreamProvider cannot be null.
XmlInvalidUniqueId=UniqueId cannot be zero length.
XmlInvalidUTF8Bytes='{0}' contains invalid UTF8 bytes.
XmlInvalidVersion=XML version must be '1.0'.
XmlInvalidWriteState='{0}' cannot be called while WriteState is '{1}'.
-;XmlInvalidXmlByte=The byte 0x{0} is not valid at this location.
+XmlInvalidXmlByte=The byte 0x{0} is not valid at this location.
XmlInvalidXmlSpace='{0}' is not a valid xml:space value. Valid values are 'default' and 'preserve'.
XmlLineInfo=Line {0}, position {1}.
XmlMalformedDecl=Malformed XML declaration.
XmlMaxArrayLengthExceeded=The maximum array length quota ({0}) has been exceeded while reading XML data. This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader.
-#XmlMaxBytesPerReadExceeded=The 'maximum bytes per Read operation' quota ({0}) has been exceeded while reading XML data. Long element start tags (consisting of the element name, attribute names and attribute values) may trigger this quota. This quota may be increased by changing the MaxBytesPerRead property on the XmlDictionaryReaderQuotas object used when creating the XML reader.
+XmlMaxBytesPerReadExceeded=The 'maximum bytes per Read operation' quota ({0}) has been exceeded while reading XML data. Long element start tags (consisting of the element name, attribute names and attribute values) may trigger this quota. This quota may be increased by changing the MaxBytesPerRead property on the XmlDictionaryReaderQuotas object used when creating the XML reader.
#XmlMaxDepthExceeded=The maximum read depth ({0}) has been exceeded because XML data being read has more levels of nesting than is allowed by the quota. This quota may be increased by changing the MaxDepth property on the XmlDictionaryReaderQuotas object used when creating the XML reader.
XmlMaxNameTableCharCountExceeded=The maximum nametable character count quota ({0}) has been exceeded while reading XML data. The nametable is a data structure used to store strings encountered during XML processing - long XML documents with non-repeating element names, attribute names and attribute values may trigger this quota. This quota may be increased by changing the MaxNameTableCharCount property on the XmlDictionaryReaderQuotas object used when creating the XML reader.
#XmlMaxStringContentLengthExceeded=The maximum string content length quota ({0}) has been exceeded while reading XML data. This quota may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader.
@@ -260,13 +261,13 @@ XmlOnlySingleValue=Only a single typed value may be written inside an attribute
XmlPrefixBoundToNamespace=The prefix '{0}' is bound to the namespace '{1}' and cannot be changed to '{2}'.
XmlProcessingInstructionNotSupported=Processing instructions (other than the XML declaration) and DTDs are not supported.
XmlReservedPrefix=Prefixes beginning with "xml" (regardless of casing) are reserved for use by XML.
-;XmlSpaceBetweenAttributes=Whitespace must appear between attributes.
+XmlSpaceBetweenAttributes=Whitespace must appear between attributes.
XmlSpecificBindingNamespace=The namespace '{1}' can only be bound to the prefix '{0}'.
XmlSpecificBindingPrefix=The prefix '{0}' can only be bound to the namespace '{1}'.
XmlStartElementLocalNameNsExpected=Start element '{0}' from namespace '{1}' expected. Found {2}.
XmlStartElementNameExpected=Start element '{0}' expected. Found {1}.
-;XmlTagMismatch=Start element '{0}' does not match end element '{1}'.
-;XmlTokenExpected=The token '{0}' was expected but found '{1}'.
+XmlTagMismatch=Start element '{0}' does not match end element '{1}'.
+XmlTokenExpected=The token '{0}' was expected but found '{1}'.
XmlUndefinedPrefix=The prefix '{0}' is not defined.
XmlUnexpectedEndElement=No matching start tag for end element.
XmlUnexpectedEndOfFile=Unexpected end of file. Following elements are not closed: {0}.
diff --git a/mcs/class/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Configuration/SerializationSectionGroup.cs b/mcs/class/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Configuration/SerializationSectionGroup.cs
index 044ffea1746..7b73dabbe5a 100644
--- a/mcs/class/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Configuration/SerializationSectionGroup.cs
+++ b/mcs/class/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Configuration/SerializationSectionGroup.cs
@@ -13,7 +13,7 @@ namespace System.Runtime.Serialization.Configuration
{
throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("config");
}
-#pragma warning suppress 56506 // [....], config is checked above
+#pragma warning suppress 56506 // Microsoft, config is checked above
return (SerializationSectionGroup)config.SectionGroups[ConfigurationStrings.SectionGroupName];
}
diff --git a/mcs/class/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Json/JsonEncodingStreamWrapper.cs b/mcs/class/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Json/JsonEncodingStreamWrapper.cs
index d3f2b39d19c..42ee0308ef6 100644
--- a/mcs/class/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Json/JsonEncodingStreamWrapper.cs
+++ b/mcs/class/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Json/JsonEncodingStreamWrapper.cs
@@ -16,7 +16,7 @@ namespace System.Runtime.Serialization.Json
// This wrapper does not support seek.
// Supports: UTF-8, Unicode, BigEndianUnicode
- // ASSUMPTION ([....]): This class will only be used for EITHER reading OR writing. It can be done, it would just mean more buffers.
+ // ASSUMPTION (Microsoft): This class will only be used for EITHER reading OR writing. It can be done, it would just mean more buffers.
class JsonEncodingStreamWrapper : Stream
{
[Fx.Tag.SecurityNote(Miscellaneous = "RequiresReview - Static fields are marked SecurityCritical or readonly to prevent"
diff --git a/mcs/class/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Json/XmlJsonWriter.cs b/mcs/class/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Json/XmlJsonWriter.cs
index c87639bee1f..83782347f49 100644
--- a/mcs/class/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Json/XmlJsonWriter.cs
+++ b/mcs/class/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Json/XmlJsonWriter.cs
@@ -27,6 +27,9 @@ namespace System.Runtime.Serialization.Json
const char WHITESPACE = ' ';
const char CARRIAGE_RETURN = '\r';
const char NEWLINE = '\n';
+ const char BACKSPACE = '\b';
+ const char FORM_FEED = '\f';
+ const char HORIZONTAL_TABULATION = '\t';
const string xmlNamespace = "http://www.w3.org/XML/1998/namespace";
const string xmlnsNamespace = "http://www.w3.org/2000/xmlns/";
@@ -34,6 +37,9 @@ namespace System.Runtime.Serialization.Json
+ " data from being modified or leaked to other components in appdomain.")]
[SecurityCritical]
static BinHexEncoding binHexEncoding;
+
+ // This array was part of a perf improvement for escaping characters < WHITESPACE.
+ static char[] CharacterAbbrevs;
string attributeText;
JsonDataType dataType;
@@ -71,6 +77,57 @@ namespace System.Runtime.Serialization.Json
this.indentChars = indentChars;
}
InitializeWriter();
+
+ if (CharacterAbbrevs == null)
+ {
+ CharacterAbbrevs = GetCharacterAbbrevs();
+ }
+ }
+
+ private static char[] GetCharacterAbbrevs()
+ {
+ var abbrevs = new char[WHITESPACE];
+ for(int i = 0; i < WHITESPACE; i++)
+ {
+ char abbrev;
+ if (!LocalAppContextSwitches.DoNotUseEcmaScriptV6EscapeControlCharacter && TryEscapeControlCharacter((char)i, out abbrev))
+ {
+ abbrevs[i] = abbrev;
+ }
+ else
+ {
+ abbrevs[i] = (char) 0;
+ }
+ }
+
+ return abbrevs;
+ }
+
+ private static bool TryEscapeControlCharacter(char ch, out char abbrev)
+ {
+ switch (ch)
+ {
+ case BACKSPACE:
+ abbrev = 'b';
+ break;
+ case HORIZONTAL_TABULATION:
+ abbrev = 't';
+ break;
+ case NEWLINE:
+ abbrev = 'n';
+ break;
+ case FORM_FEED:
+ abbrev = 'f';
+ break;
+ case CARRIAGE_RETURN:
+ abbrev = 'r';
+ break;
+ default:
+ abbrev = ' ';
+ return false;
+ }
+
+ return true;
}
enum JsonDataType
@@ -794,7 +851,7 @@ namespace System.Runtime.Serialization.Json
WriteString(new string(buffer, index, count));
}
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase")] // [....], ToLowerInvariant is just used in Json error message
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase")] // Microsoft, ToLowerInvariant is just used in Json error message
public override void WriteStartAttribute(string prefix, string localName, string ns)
{
if (IsClosed)
@@ -1376,7 +1433,7 @@ namespace System.Runtime.Serialization.Json
}
}
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase")] // [....], ToLowerInvariant is just used in Json error message
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase")] // Microsoft, ToLowerInvariant is just used in Json error message
void ThrowInvalidAttributeContent()
{
if (HasOpenAttribute)
@@ -1450,7 +1507,7 @@ namespace System.Runtime.Serialization.Json
{
char ch = chars[j];
if (ch <= FORWARD_SLASH)
- {
+ {
if (ch == FORWARD_SLASH || ch == JsonGlobals.QuoteChar)
{
nodeWriter.WriteChars(chars + i, j - i);
@@ -1462,9 +1519,17 @@ namespace System.Runtime.Serialization.Json
{
nodeWriter.WriteChars(chars + i, j - i);
nodeWriter.WriteText(BACK_SLASH);
- nodeWriter.WriteText('u');
- nodeWriter.WriteText(string.Format(CultureInfo.InvariantCulture, "{0:x4}", (int)ch));
- i = j + 1;
+ if (CharacterAbbrevs[ch] == 0)
+ {
+ nodeWriter.WriteText('u');
+ nodeWriter.WriteText(string.Format(CultureInfo.InvariantCulture, "{0:x4}", (int)ch));
+ i = j + 1;
+ }
+ else
+ {
+ nodeWriter.WriteText(CharacterAbbrevs[ch]);
+ i = j + 1;
+ }
}
}
else if (ch == BACK_SLASH)
diff --git a/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/EncodingStreamWrapper.cs b/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/EncodingStreamWrapper.cs
index bea64bce4d9..b0a6487fc6d 100644
--- a/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/EncodingStreamWrapper.cs
+++ b/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/EncodingStreamWrapper.cs
@@ -11,9 +11,9 @@ namespace System.Xml
// This wrapper does not support seek.
// Constructors consume/emit byte order mark.
// Supports: UTF-8, Unicode, BigEndianUnicode
- // ASSUMPTION ([....]): This class will only be used for EITHER reading OR writing. It can be done, it would just mean more buffers.
- // ASSUMPTION ([....]): The byte buffer is large enough to hold the declaration
- // ASSUMPTION ([....]): The buffer manipulation methods (FillBuffer/Compare/etc.) will only be used to parse the declaration
+ // ASSUMPTION (Microsoft): This class will only be used for EITHER reading OR writing. It can be done, it would just mean more buffers.
+ // ASSUMPTION (Microsoft): The byte buffer is large enough to hold the declaration
+ // ASSUMPTION (Microsoft): The buffer manipulation methods (FillBuffer/Compare/etc.) will only be used to parse the declaration
// during construction.
class EncodingStreamWrapper : Stream
{
@@ -749,7 +749,7 @@ namespace System.Xml
// Add format exceptions
// Do we need to modify the stream position/Seek to account for the buffer?
- // ASSUMPTION ([....]): This class will only be used for EITHER reading OR writing.
+ // ASSUMPTION (Microsoft): This class will only be used for EITHER reading OR writing.
#if NO
class UTF16Stream : Stream
{
diff --git a/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/UniqueID.cs b/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/UniqueID.cs
index 2db9f63d632..53fe8347cac 100644
--- a/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/UniqueID.cs
+++ b/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/UniqueID.cs
@@ -352,7 +352,7 @@ namespace System.Xml
if (object.ReferenceEquals(id1, null) || object.ReferenceEquals(id2, null))
return false;
-#pragma warning suppress 56506 // [....], checks for whether id1 and id2 are null done above.
+#pragma warning suppress 56506 // Microsoft, checks for whether id1 and id2 are null done above.
if (id1.IsGuid && id2.IsGuid)
{
return id1.idLow == id2.idLow && id1.idHigh == id2.idHigh;
diff --git a/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/ValueHandle.cs b/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/ValueHandle.cs
index 74313dec99b..5d18e55fe92 100644
--- a/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/ValueHandle.cs
+++ b/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/ValueHandle.cs
@@ -539,7 +539,7 @@ namespace System.Xml
}
}
- // ASSUMPTION ([....]): all chars in str will be ASCII
+ // ASSUMPTION (Microsoft): all chars in str will be ASCII
public bool Equals2(string str, bool checkLower)
{
if (this.type != ValueHandleType.UTF8)
diff --git a/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/XmlBaseReader.cs b/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/XmlBaseReader.cs
index 008ed195fb5..f92e4af7485 100644
--- a/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/XmlBaseReader.cs
+++ b/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/XmlBaseReader.cs
@@ -1,8 +1,8 @@
//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------
-// PERF, [....], [....]: Make LookupNamespace do something smarter when lots of names
-// PERF, [....], [....]: Make Attribute lookup smarter when lots of attributes
+// PERF, Microsoft, Microsoft: Make LookupNamespace do something smarter when lots of names
+// PERF, Microsoft, Microsoft: Make Attribute lookup smarter when lots of attributes
namespace System.Xml
{
using System;
diff --git a/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/XmlConverter.cs b/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/XmlConverter.cs
index 3497ba645ca..3f683a49570 100644
--- a/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/XmlConverter.cs
+++ b/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/XmlConverter.cs
@@ -1,9 +1,9 @@
//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------
-// PERF, [....], [....]: Make LookupNamespace do something smarter when lots of names
-// PERF, [....], [....]: Make Attribute lookup smarter when lots of attributes
-// PERF: [....], [....]: Compare safe/unsafe versions
+// PERF, Microsoft, Microsoft: Make LookupNamespace do something smarter when lots of names
+// PERF, Microsoft, Microsoft: Make Attribute lookup smarter when lots of attributes
+// PERF: Microsoft, Microsoft: Compare safe/unsafe versions
namespace System.Xml
{
diff --git a/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/XmlDictionaryWriter.cs b/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/XmlDictionaryWriter.cs
index bfb1b2a9827..3868664cd23 100644
--- a/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/XmlDictionaryWriter.cs
+++ b/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/XmlDictionaryWriter.cs
@@ -145,7 +145,7 @@ namespace System.Xml
{
if (LookupPrefix(namespaceUri) != null)
return;
-#pragma warning suppress 56506 // [....], namespaceUri is already checked
+#pragma warning suppress 56506 // Microsoft, namespaceUri is already checked
prefix = namespaceUri.Length == 0 ? string.Empty : string.Concat("d", namespaceUri.Length.ToString(System.Globalization.NumberFormatInfo.InvariantInfo));
}
WriteAttributeString("xmlns", prefix, null, namespaceUri);
@@ -196,7 +196,7 @@ namespace System.Xml
throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("localName"));
if (namespaceUri == null)
namespaceUri = XmlDictionaryString.Empty;
-#pragma warning suppress 56506 // [....], XmlDictionaryString.Empty is never null
+#pragma warning suppress 56506 // Microsoft, XmlDictionaryString.Empty is never null
WriteQualifiedName(localName.Value, namespaceUri.Value);
}
@@ -301,7 +301,7 @@ namespace System.Xml
{
if (completionException == null)
{
- // only release stream when no exception (mirrors [....] behaviour)
+ // only release stream when no exception (mirrors sync behaviour)
this.streamProvider.ReleaseStream(this.stream);
this.stream = null;
}
@@ -311,7 +311,7 @@ namespace System.Xml
void ContinueWork(bool completedSynchronously, Exception completionException = null)
{
- // Individual Reads or writes may complete [....] or async. A callback however
+ // Individual Reads or writes may complete sync or async. A callback however
// will always all ContinueWork() with CompletedSynchronously=false this flag
// is used to complete this AsyncResult.
try
@@ -565,7 +565,7 @@ namespace System.Xml
{
if (completionException == null)
{
- // only release stream when no exception (mirrors [....] behaviour)
+ // only release stream when no exception (mirrors sync behaviour)
this.streamProvider.ReleaseStream(this.stream);
this.stream = null;
}
@@ -582,7 +582,7 @@ namespace System.Xml
{
if (HandleReadBlock(result))
{
- // Read completed ([....] or async, doesn't matter)
+ // Read completed (sync or async, doesn't matter)
if (this.bytesRead > 0)
{
// allow loop to continue at Write
@@ -604,7 +604,7 @@ namespace System.Xml
{
if (this.writeBlockHandler(result, this))
{
- // Write completed ([....] or async, doesn't matter)
+ // Write completed (sync or async, doesn't matter)
AdjustBlockSize();
operation = Operation.Read;
}
diff --git a/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/XmlMtomReader.cs b/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/XmlMtomReader.cs
index 69831c0d846..1c5fd2c4cfd 100644
--- a/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/XmlMtomReader.cs
+++ b/mcs/class/referencesource/System.Runtime.Serialization/System/Xml/XmlMtomReader.cs
@@ -2102,7 +2102,7 @@ namespace System.Xml
public override long Length
{
-#pragma warning suppress 56503 // [....], required by the XmlReader
+#pragma warning suppress 56503 // Microsoft, required by the XmlReader
get { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.SeekNotSupportedOnStream, this.GetType().FullName))); }
}
@@ -2110,7 +2110,7 @@ namespace System.Xml
{
get
{
-#pragma warning suppress 56503 // [....], required by the XmlReader
+#pragma warning suppress 56503 // Microsoft, required by the XmlReader
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.SeekNotSupportedOnStream, this.GetType().FullName)));
}
set { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.SeekNotSupportedOnStream, this.GetType().FullName))); }
@@ -2831,7 +2831,7 @@ namespace System.Xml
{
get
{
-#pragma warning suppress 56503 // [....], required by the Stream contract
+#pragma warning suppress 56503 // Microsoft, required by the Stream contract
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.SeekNotSupportedOnStream, stream.GetType().FullName)));
}
}
@@ -2840,7 +2840,7 @@ namespace System.Xml
{
get
{
-#pragma warning suppress 56503 // [....], required by the Stream contract
+#pragma warning suppress 56503 // Microsoft, required by the Stream contract
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.SeekNotSupportedOnStream, stream.GetType().FullName)));
}
set
diff --git a/mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/BufferedReceiveManager.cs b/mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/BufferedReceiveManager.cs
index e8670e2a0a6..b240804d46d 100644
--- a/mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/BufferedReceiveManager.cs
+++ b/mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/BufferedReceiveManager.cs
@@ -83,7 +83,7 @@ namespace System.ServiceModel.Activities.Dispatcher
// Actual Buffering
lock (this.thisLock)
{
- // Optimistic state check in case we just ----d with the receiveContext
+ // Optimistic state check in case we just raced with the receiveContext
// faulting. If the receiveContext still faults after the state check, the above
// cleanup routine will handle things correctly. In both cases, a double-release
// of the throttle is protected.
diff --git a/mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/DurableInstanceManager.cs b/mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/DurableInstanceManager.cs
index 2ff32b65c21..198c511575b 100644
--- a/mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/DurableInstanceManager.cs
+++ b/mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/DurableInstanceManager.cs
@@ -1323,7 +1323,7 @@ namespace System.ServiceModel.Activities.Dispatcher
// This async result waits for store events and handle them (currently only support HasRunnableWorkflowEvent).
// It is intended to always complete async to simplify caller usage.
- // 1) no code to handle [....] completion.
+ // 1) no code to handle sync completion.
// 2) recursive call will be safe from StackOverflow.
// For simplicity, we handle (load/run) each event one-by-one.
// We ---- certain set of exception (see HandleException). Other will crash the process.
diff --git a/mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/PersistenceContext.cs b/mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/PersistenceContext.cs
index eb135add289..96a92a8fed8 100644
--- a/mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/PersistenceContext.cs
+++ b/mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/PersistenceContext.cs
@@ -102,7 +102,7 @@ namespace System.ServiceModel.Activities.Dispatcher
ReadSuspendedInfo(view);
}
- // If we were loaded or we locked the instance, the keys will have been [....]'d.
+ // If we were loaded or we locked the instance, the keys will have been sync'd.
if (IsInitialized || IsLocked)
{
RationalizeSavedKeys(false);
diff --git a/mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/PersistenceProviderDirectory.cs b/mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/PersistenceProviderDirectory.cs
index ed99706cbfa..126936ab2c9 100644
--- a/mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/PersistenceProviderDirectory.cs
+++ b/mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/PersistenceProviderDirectory.cs
@@ -1178,7 +1178,7 @@ namespace System.ServiceModel.Activities.Dispatcher
this.pipeline.Publish();
}
- // PersistenceContext.Open doesn't do anything, so it's ok to call [....].
+ // PersistenceContext.Open doesn't do anything, so it's ok to call sync.
this.context.Open(TimeSpan.Zero);
IAsyncResult result;
diff --git a/mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/WorkflowServiceInstance.cs b/mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/WorkflowServiceInstance.cs
index e5ea1459fff..539cdf5804b 100644
--- a/mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/WorkflowServiceInstance.cs
+++ b/mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/WorkflowServiceInstance.cs
@@ -42,7 +42,7 @@ namespace System.ServiceModel.Activities.Dispatcher
// NOTE: There is a small period of time where no one things they own the lock. Exit has "handed
// off the lock by calling Set on the waiter, but the waiter has not yet executed the code
// which sets ownsLock to true.
- // [....] Handoff - During [....] handoff the ref bool ownsLock will be set accordingly by the
+ // Sync Handoff - During sync handoff the ref bool ownsLock will be set accordingly by the
// Acquire* method. These methods should always be called in a try block with a finally
// which calls ReleaseLock.
// Async Handoff - During async handoff the callback can assume it has the lock if either
@@ -655,12 +655,12 @@ namespace System.ServiceModel.Activities.Dispatcher
{
if (!this.idleWaiters.Remove(idleEvent))
{
- // If it wasn't in the list that means we ----d between throwing from Wait
+ // If it wasn't in the list that means we raced between throwing from Wait
// and setting the event. This thread now is responsible for the lock.
if (waitException is TimeoutException)
{
// In the case of Timeout we let setting the event win and signal to
- // ---- the exception
+ // swallow the exception
ownsLock = true;
return false;
@@ -814,7 +814,7 @@ namespace System.ServiceModel.Activities.Dispatcher
if (!this.executorLock.Exit(isRunnable, ref ownsLock))
{
// No one was waiting, but we had activeOperations (otherwise we would not have gotten
- // to this branch of the if). This means that we ----d with a timeout and should resume
+ // to this branch of the if). This means that we raced with a timeout and should resume
// the workflow's execution. If we don't resume execution we'll just hang ... no one
// has the lock, the workflow is ready to execute, but it is not.
Fx.Assert(this.activeOperations > 0, "We should always have active operations otherwise we should have taken a different code path.");
@@ -3268,7 +3268,7 @@ namespace System.ServiceModel.Activities.Dispatcher
{
// If the waitHandle is not in either of these lists then it must have
// been removed by the Set() path - that means we've got the lock, so let's
- // just run with it (IE - ---- the exception).
+ // just run with it (IE - swallow the exception).
if (thisPtr.instance.nextIdleWaiters.Remove(thisPtr.waitHandle) || thisPtr.instance.idleWaiters.Remove(thisPtr.waitHandle))
{
thisPtr.Complete(false, asyncException);
@@ -5311,7 +5311,7 @@ namespace System.ServiceModel.Activities.Dispatcher
{
if (!asyncWaiter.Owner.waiters.Remove(asyncWaiter.Token))
{
- // We ----d between timing out and getting signaled.
+ // We raced between timing out and getting signaled.
// We'll take the signal which means we now own the lock
completionException = null;
@@ -5604,7 +5604,7 @@ namespace System.ServiceModel.Activities.Dispatcher
{
// 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)
{
diff --git a/mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/InternalSendMessage.cs b/mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/InternalSendMessage.cs
index 83519049410..ffbe82df40d 100644
--- a/mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/InternalSendMessage.cs
+++ b/mcs/class/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/InternalSendMessage.cs
@@ -1830,7 +1830,7 @@ namespace System.ServiceModel.Activities
{
if (asyncSend)
{
- //If there is a transaction that we could be flowing out then we create this blocking clone to [....] with the commit processing.
+ //If there is a transaction that we could be flowing out then we create this blocking clone to sync with the commit processing.
if (this.currentTransactionContext != null)
{
this.dependentClone = this.currentTransactionContext.DependentClone(DependentCloneOption.BlockCommitUntilComplete);
@@ -2664,9 +2664,9 @@ namespace System.ServiceModel.Activities
property.Instance.CorrelationSynchronizer.NotifyRequestSetByChannel(new Action<Message>(OnWorkflowCorrelationProcessingComplete));
// We have to do this dance with the lock because
- // we aren't sure if we've been running [....] or not.
+ // we aren't sure if we've been running sync or not.
// NOTE: It is possible for us to go async and
- // still decide we're completing [....]. This is fine
+ // still decide we're completing sync. This is fine
// as it does not violate the async pattern since
// the work is done by the time Begin completes.
completeSelf = false;
@@ -2697,9 +2697,9 @@ namespace System.ServiceModel.Activities
this.message = updatedMessage;
// We have to do this dance with the lock because
- // we aren't sure if we've been running [....] or not.
+ // we aren't sure if we've been running sync or not.
// NOTE: It is possible for us to go async and
- // still decide we're completing [....]. This is fine
+ // still decide we're completing sync. This is fine
// as it does not violate the async pattern since
// the work is done by the time Begin completes.
bool completeSelf = false;
diff --git a/mcs/class/referencesource/System.ServiceModel.Channels/System/ServiceModel/Channels/UdpChannelBase.cs b/mcs/class/referencesource/System.ServiceModel.Channels/System/ServiceModel/Channels/UdpChannelBase.cs
index bd420a64d62..6e0f45677ef 100644
--- a/mcs/class/referencesource/System.ServiceModel.Channels/System/ServiceModel/Channels/UdpChannelBase.cs
+++ b/mcs/class/referencesource/System.ServiceModel.Channels/System/ServiceModel/Channels/UdpChannelBase.cs
@@ -481,7 +481,7 @@ namespace System.ServiceModel.Channels
// AsyncResult.AsyncCompletionWrapperCallback takes care of catching the exceptions for us.
IAsyncResult result = this.channel.UdpOutputChannel.BeginClose(this.timeoutHelper.RemainingTime(), this.PrepareAsyncCompletion(completeCloseOutputChannelCallback), this);
- // SyncContinue calls CompleteCloseOutputChannel for us in [....] case.
+ // SyncContinue calls CompleteCloseOutputChannel for us in sync case.
return this.SyncContinue(result);
}
@@ -490,7 +490,7 @@ namespace System.ServiceModel.Channels
// AsyncResult.AsyncCompletionWrapperCallback takes care of catching the exceptions for us.
IAsyncResult result = this.baseBeginClose(this.timeoutHelper.RemainingTime(), this.PrepareAsyncCompletion(completeBaseCloseCallback), this);
- // SyncContinue calls CompleteBaseClose for us in [....] case.
+ // SyncContinue calls CompleteBaseClose for us in sync case.
return this.SyncContinue(result);
}
}
diff --git a/mcs/class/referencesource/System.ServiceModel.Channels/System/ServiceModel/Channels/UdpOutputChannel.cs b/mcs/class/referencesource/System.ServiceModel.Channels/System/ServiceModel/Channels/UdpOutputChannel.cs
index 2a932ecbe35..ebc66d5ea6b 100644
--- a/mcs/class/referencesource/System.ServiceModel.Channels/System/ServiceModel/Channels/UdpOutputChannel.cs
+++ b/mcs/class/referencesource/System.ServiceModel.Channels/System/ServiceModel/Channels/UdpOutputChannel.cs
@@ -664,7 +664,7 @@ namespace System.ServiceModel.Channels
if (completedSynchronously && this.retransmissionEnabled)
{
- // initial send completed [....], now we need to start the retransmission process...
+ // initial send completed sync, now we need to start the retransmission process...
completedSynchronously = this.BeginRetransmission();
}
diff --git a/mcs/class/referencesource/System.ServiceModel.Discovery/System/ServiceModel/Discovery/AnnouncementService.cs b/mcs/class/referencesource/System.ServiceModel.Discovery/System/ServiceModel/Discovery/AnnouncementService.cs
index 89dd02a9aff..f464d031ec0 100644
--- a/mcs/class/referencesource/System.ServiceModel.Discovery/System/ServiceModel/Discovery/AnnouncementService.cs
+++ b/mcs/class/referencesource/System.ServiceModel.Discovery/System/ServiceModel/Discovery/AnnouncementService.cs
@@ -46,7 +46,7 @@ namespace System.ServiceModel.Discovery
void IAnnouncementContractApril2005.HelloOperation(HelloMessageApril2005 message)
{
- Fx.Assert("The [....] method IAnnouncementContractApril2005.HelloOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IAnnouncementContractApril2005.HelloOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
}
IAsyncResult IAnnouncementContractApril2005.BeginHelloOperation(HelloMessageApril2005 message, AsyncCallback callback, object state)
@@ -61,7 +61,7 @@ namespace System.ServiceModel.Discovery
void IAnnouncementContractApril2005.ByeOperation(ByeMessageApril2005 message)
{
- Fx.Assert("The [....] method IAnnouncementContractApril2005.ByeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IAnnouncementContractApril2005.ByeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
}
IAsyncResult IAnnouncementContractApril2005.BeginByeOperation(ByeMessageApril2005 message, AsyncCallback callback, object state)
@@ -76,7 +76,7 @@ namespace System.ServiceModel.Discovery
void IAnnouncementContract11.HelloOperation(HelloMessage11 message)
{
- Fx.Assert("The [....] method IAnnouncementContract11.HelloOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IAnnouncementContract11.HelloOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
}
IAsyncResult IAnnouncementContract11.BeginHelloOperation(HelloMessage11 message, AsyncCallback callback, object state)
@@ -91,7 +91,7 @@ namespace System.ServiceModel.Discovery
void IAnnouncementContract11.ByeOperation(ByeMessage11 message)
{
- Fx.Assert("The [....] method IAnnouncementContract11.ByeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IAnnouncementContract11.ByeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
}
IAsyncResult IAnnouncementContract11.BeginByeOperation(ByeMessage11 message, AsyncCallback callback, object state)
@@ -106,7 +106,7 @@ namespace System.ServiceModel.Discovery
void IAnnouncementContractCD1.HelloOperation(HelloMessageCD1 message)
{
- Fx.Assert("The [....] method IAnnouncementContractCD1.HelloOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IAnnouncementContractCD1.HelloOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
}
IAsyncResult IAnnouncementContractCD1.BeginHelloOperation(HelloMessageCD1 message, AsyncCallback callback, object state)
@@ -121,7 +121,7 @@ namespace System.ServiceModel.Discovery
void IAnnouncementContractCD1.ByeOperation(ByeMessageCD1 message)
{
- Fx.Assert("The [....] method IAnnouncementContractCD1.ByeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IAnnouncementContractCD1.ByeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
}
IAsyncResult IAnnouncementContractCD1.BeginByeOperation(ByeMessageCD1 message, AsyncCallback callback, object state)
diff --git a/mcs/class/referencesource/System.ServiceModel.Discovery/System/ServiceModel/Discovery/DiscoveryProxy.cs b/mcs/class/referencesource/System.ServiceModel.Discovery/System/ServiceModel/Discovery/DiscoveryProxy.cs
index 8b32eb3d74b..7f2946925e5 100644
--- a/mcs/class/referencesource/System.ServiceModel.Discovery/System/ServiceModel/Discovery/DiscoveryProxy.cs
+++ b/mcs/class/referencesource/System.ServiceModel.Discovery/System/ServiceModel/Discovery/DiscoveryProxy.cs
@@ -65,7 +65,7 @@ namespace System.ServiceModel.Discovery
void IAnnouncementContractApril2005.HelloOperation(HelloMessageApril2005 message)
{
- Fx.Assert("The [....] method IAnnouncementContractApril2005.HelloOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IAnnouncementContractApril2005.HelloOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
}
IAsyncResult IAnnouncementContractApril2005.BeginHelloOperation(HelloMessageApril2005 message, AsyncCallback callback, object state)
@@ -80,7 +80,7 @@ namespace System.ServiceModel.Discovery
void IAnnouncementContractApril2005.ByeOperation(ByeMessageApril2005 message)
{
- Fx.Assert("The [....] method IAnnouncementContractApril2005.ByeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IAnnouncementContractApril2005.ByeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
}
IAsyncResult IAnnouncementContractApril2005.BeginByeOperation(ByeMessageApril2005 message, AsyncCallback callback, object state)
@@ -95,7 +95,7 @@ namespace System.ServiceModel.Discovery
void IAnnouncementContract11.HelloOperation(HelloMessage11 message)
{
- Fx.Assert("The [....] method IAnnouncementContract11.HelloOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IAnnouncementContract11.HelloOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
}
IAsyncResult IAnnouncementContract11.BeginHelloOperation(HelloMessage11 message, AsyncCallback callback, object state)
@@ -110,7 +110,7 @@ namespace System.ServiceModel.Discovery
void IAnnouncementContract11.ByeOperation(ByeMessage11 message)
{
- Fx.Assert("The [....] method IAnnouncementContract11.ByeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IAnnouncementContract11.ByeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
}
IAsyncResult IAnnouncementContract11.BeginByeOperation(ByeMessage11 message, AsyncCallback callback, object state)
@@ -125,7 +125,7 @@ namespace System.ServiceModel.Discovery
void IAnnouncementContractCD1.HelloOperation(HelloMessageCD1 message)
{
- Fx.Assert("The [....] method IAnnouncementContractCD1.HelloOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IAnnouncementContractCD1.HelloOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
}
IAsyncResult IAnnouncementContractCD1.BeginHelloOperation(HelloMessageCD1 message, AsyncCallback callback, object state)
@@ -140,7 +140,7 @@ namespace System.ServiceModel.Discovery
void IAnnouncementContractCD1.ByeOperation(ByeMessageCD1 message)
{
- Fx.Assert("The [....] method IAnnouncementContractCD1.ByeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IAnnouncementContractCD1.ByeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
}
IAsyncResult IAnnouncementContractCD1.BeginByeOperation(ByeMessageCD1 message, AsyncCallback callback, object state)
@@ -155,7 +155,7 @@ namespace System.ServiceModel.Discovery
void IDiscoveryContractApril2005.ProbeOperation(ProbeMessageApril2005 request)
{
- Fx.Assert("The [....] method IDiscoveryContractApril2005.ProbeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IDiscoveryContractApril2005.ProbeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
}
IAsyncResult IDiscoveryContractApril2005.BeginProbeOperation(ProbeMessageApril2005 request, AsyncCallback callback, object state)
@@ -170,7 +170,7 @@ namespace System.ServiceModel.Discovery
void IDiscoveryContractApril2005.ResolveOperation(ResolveMessageApril2005 request)
{
- Fx.Assert("The [....] method IDiscoveryContractApril2005.ResolveOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IDiscoveryContractApril2005.ResolveOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
}
IAsyncResult IDiscoveryContractApril2005.BeginResolveOperation(ResolveMessageApril2005 request, AsyncCallback callback, object state)
@@ -185,7 +185,7 @@ namespace System.ServiceModel.Discovery
void IDiscoveryContractAdhoc11.ProbeOperation(ProbeMessage11 request)
{
- Fx.Assert("The [....] method IDiscoveryContractAdhoc11.ProbeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IDiscoveryContractAdhoc11.ProbeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
}
IAsyncResult IDiscoveryContractAdhoc11.BeginProbeOperation(ProbeMessage11 request, AsyncCallback callback, object state)
@@ -200,7 +200,7 @@ namespace System.ServiceModel.Discovery
void IDiscoveryContractAdhoc11.ResolveOperation(ResolveMessage11 request)
{
- Fx.Assert("The [....] method IDiscoveryContractAdhoc11.ResolveOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IDiscoveryContractAdhoc11.ResolveOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
}
IAsyncResult IDiscoveryContractAdhoc11.BeginResolveOperation(ResolveMessage11 request, AsyncCallback callback, object state)
@@ -215,7 +215,7 @@ namespace System.ServiceModel.Discovery
ProbeMatchesMessage11 IDiscoveryContractManaged11.ProbeOperation(ProbeMessage11 request)
{
- Fx.Assert("The [....] method IDiscoveryContractManaged11.ProbeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IDiscoveryContractManaged11.ProbeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
return null;
}
@@ -231,7 +231,7 @@ namespace System.ServiceModel.Discovery
ResolveMatchesMessage11 IDiscoveryContractManaged11.ResolveOperation(ResolveMessage11 request)
{
- Fx.Assert("The [....] method IDiscoveryContractManaged11.ResolveOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IDiscoveryContractManaged11.ResolveOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
return null;
}
@@ -247,7 +247,7 @@ namespace System.ServiceModel.Discovery
void IDiscoveryContractAdhocCD1.ProbeOperation(ProbeMessageCD1 request)
{
- Fx.Assert("The [....] method IDiscoveryContractAdhocCD1.ProbeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IDiscoveryContractAdhocCD1.ProbeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
}
IAsyncResult IDiscoveryContractAdhocCD1.BeginProbeOperation(ProbeMessageCD1 request, AsyncCallback callback, object state)
@@ -262,7 +262,7 @@ namespace System.ServiceModel.Discovery
void IDiscoveryContractAdhocCD1.ResolveOperation(ResolveMessageCD1 request)
{
- Fx.Assert("The [....] method IDiscoveryContractAdhocCD1.ResolveOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IDiscoveryContractAdhocCD1.ResolveOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
}
IAsyncResult IDiscoveryContractAdhocCD1.BeginResolveOperation(ResolveMessageCD1 request, AsyncCallback callback, object state)
@@ -277,7 +277,7 @@ namespace System.ServiceModel.Discovery
ProbeMatchesMessageCD1 IDiscoveryContractManagedCD1.ProbeOperation(ProbeMessageCD1 request)
{
- Fx.Assert("The [....] method IDiscoveryContractManagedCD1.ProbeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IDiscoveryContractManagedCD1.ProbeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
return null;
}
@@ -293,7 +293,7 @@ namespace System.ServiceModel.Discovery
ResolveMatchesMessageCD1 IDiscoveryContractManagedCD1.ResolveOperation(ResolveMessageCD1 request)
{
- Fx.Assert("The [....] method IDiscoveryContractManagedCD1.ResolveOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IDiscoveryContractManagedCD1.ResolveOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
return null;
}
diff --git a/mcs/class/referencesource/System.ServiceModel.Discovery/System/ServiceModel/Discovery/DiscoveryService.cs b/mcs/class/referencesource/System.ServiceModel.Discovery/System/ServiceModel/Discovery/DiscoveryService.cs
index b7119cb08f0..98adc930deb 100644
--- a/mcs/class/referencesource/System.ServiceModel.Discovery/System/ServiceModel/Discovery/DiscoveryService.cs
+++ b/mcs/class/referencesource/System.ServiceModel.Discovery/System/ServiceModel/Discovery/DiscoveryService.cs
@@ -69,7 +69,7 @@ namespace System.ServiceModel.Discovery
void IDiscoveryContractApril2005.ProbeOperation(ProbeMessageApril2005 request)
{
- Fx.Assert("The [....] method IDiscoveryContractApril2005.ProbeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IDiscoveryContractApril2005.ProbeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
}
IAsyncResult IDiscoveryContractApril2005.BeginProbeOperation(ProbeMessageApril2005 request, AsyncCallback callback, object state)
@@ -84,7 +84,7 @@ namespace System.ServiceModel.Discovery
void IDiscoveryContractApril2005.ResolveOperation(ResolveMessageApril2005 request)
{
- Fx.Assert("The [....] method IDiscoveryContractApril2005.ResolveOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IDiscoveryContractApril2005.ResolveOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
}
IAsyncResult IDiscoveryContractApril2005.BeginResolveOperation(ResolveMessageApril2005 request, AsyncCallback callback, object state)
@@ -99,7 +99,7 @@ namespace System.ServiceModel.Discovery
void IDiscoveryContractAdhoc11.ProbeOperation(ProbeMessage11 request)
{
- Fx.Assert("The [....] method IDiscoveryContractAdhoc11.ProbeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IDiscoveryContractAdhoc11.ProbeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
}
IAsyncResult IDiscoveryContractAdhoc11.BeginProbeOperation(ProbeMessage11 request, AsyncCallback callback, object state)
@@ -114,7 +114,7 @@ namespace System.ServiceModel.Discovery
void IDiscoveryContractAdhoc11.ResolveOperation(ResolveMessage11 request)
{
- Fx.Assert("The [....] method IDiscoveryContractAdhoc11.ResolveOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IDiscoveryContractAdhoc11.ResolveOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
}
IAsyncResult IDiscoveryContractAdhoc11.BeginResolveOperation(ResolveMessage11 request, AsyncCallback callback, object state)
@@ -129,7 +129,7 @@ namespace System.ServiceModel.Discovery
ProbeMatchesMessage11 IDiscoveryContractManaged11.ProbeOperation(ProbeMessage11 request)
{
- Fx.Assert("The [....] method IDiscoveryContractManaged11.ProbeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IDiscoveryContractManaged11.ProbeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
return null;
}
@@ -145,7 +145,7 @@ namespace System.ServiceModel.Discovery
ResolveMatchesMessage11 IDiscoveryContractManaged11.ResolveOperation(ResolveMessage11 request)
{
- Fx.Assert("The [....] method IDiscoveryContractManaged11.ResolveOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IDiscoveryContractManaged11.ResolveOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
return null;
}
@@ -162,7 +162,7 @@ namespace System.ServiceModel.Discovery
void IDiscoveryContractAdhocCD1.ProbeOperation(ProbeMessageCD1 request)
{
- Fx.Assert("The [....] method IDiscoveryContractAdhocCD1.ProbeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IDiscoveryContractAdhocCD1.ProbeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
}
IAsyncResult IDiscoveryContractAdhocCD1.BeginProbeOperation(ProbeMessageCD1 request, AsyncCallback callback, object state)
@@ -177,7 +177,7 @@ namespace System.ServiceModel.Discovery
void IDiscoveryContractAdhocCD1.ResolveOperation(ResolveMessageCD1 request)
{
- Fx.Assert("The [....] method IDiscoveryContractAdhocCD1.ResolveOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IDiscoveryContractAdhocCD1.ResolveOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
}
IAsyncResult IDiscoveryContractAdhocCD1.BeginResolveOperation(ResolveMessageCD1 request, AsyncCallback callback, object state)
@@ -192,7 +192,7 @@ namespace System.ServiceModel.Discovery
ProbeMatchesMessageCD1 IDiscoveryContractManagedCD1.ProbeOperation(ProbeMessageCD1 request)
{
- Fx.Assert("The [....] method IDiscoveryContractManagedCD1.ProbeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IDiscoveryContractManagedCD1.ProbeOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
return null;
}
@@ -208,7 +208,7 @@ namespace System.ServiceModel.Discovery
ResolveMatchesMessageCD1 IDiscoveryContractManagedCD1.ResolveOperation(ResolveMessageCD1 request)
{
- Fx.Assert("The [....] method IDiscoveryContractManagedCD1.ResolveOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
+ Fx.Assert("The sync method IDiscoveryContractManagedCD1.ResolveOperation must not get invoked. It is marked with PreferAsyncInvocation flag.");
return null;
}
diff --git a/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/AsyncResult.cs b/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/AsyncResult.cs
index 652bb872179..996b8becef2 100644
--- a/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/AsyncResult.cs
+++ b/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/AsyncResult.cs
@@ -402,7 +402,7 @@ namespace System.Runtime
return asyncResult;
}
- // can be utilized by subclasses to write core completion code for both the [....] and async paths
+ // can be utilized by subclasses to write core completion code for both the sync and async paths
// in one location, signalling chainable synchronous completion with the boolean result,
// and leveraging PrepareAsyncCompletion for conversion to an AsyncCallback.
// NOTE: requires that "this" is passed in as the state object to the asynchronous sub-call being used with a completion routine.
diff --git a/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/DiagnosticTraceBase.cs b/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/DiagnosticTraceBase.cs
index f3ab701ee2f..f7d8d55717b 100644
--- a/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/DiagnosticTraceBase.cs
+++ b/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/DiagnosticTraceBase.cs
@@ -484,7 +484,7 @@ namespace System.Runtime.Diagnostics
{
OnShutdownTracing();
}
-#pragma warning suppress 56500 //[....]; Taken care of by FxCop
+#pragma warning suppress 56500 //Microsoft; Taken care of by FxCop
catch (Exception exception)
{
if (Fx.IsFatal(exception))
diff --git a/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EtwDiagnosticTrace.cs b/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EtwDiagnosticTrace.cs
index c84160682a5..bc881d88f70 100644
--- a/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EtwDiagnosticTrace.cs
+++ b/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EtwDiagnosticTrace.cs
@@ -15,6 +15,7 @@ namespace System.Runtime.Diagnostics
using System.Xml.XPath;
using System.Diagnostics.CodeAnalysis;
using System.Security.Permissions;
+ using System.ServiceModel.Internals;
using System.Collections.Generic;
using System.Collections.Concurrent;
@@ -29,6 +30,7 @@ namespace System.Runtime.Diagnostics
const string DiagnosticTraceSource = "System.ServiceModel.Diagnostics";
const int XmlBracketsLength = 5; // "<></>".Length;
+ const int XmlBracketsLengthForNullValue = 4; // "< />".Length; (Empty XML Element)
static readonly public Guid ImmutableDefaultEtwProviderId = new Guid("{c651f5f6-1c0d-492e-8ae1-b4efd7c9d503}");
[Fx.Tag.SecurityNote(Critical = "provider Id to create EtwProvider, which is SecurityCritical")]
@@ -891,7 +893,19 @@ namespace System.Runtime.Diagnostics
static bool WriteXmlElementString(XmlTextWriter xml, string localName, string value, ref int remainingLength)
{
- int xmlElementLength = (localName.Length * 2) + EtwDiagnosticTrace.XmlBracketsLength + value.Length;
+ int xmlElementLength;
+
+ // Quirk to fix DevDiv 155469: All previous versions of that platform (up-to 4.6.2) will get the old behavior (throw null ref when Exception Message property is null)
+ if (string.IsNullOrEmpty(value) && !LocalAppContextSwitches.IncludeNullExceptionMessageInETWTrace)
+ {
+ xmlElementLength = localName.Length + EtwDiagnosticTrace.XmlBracketsLengthForNullValue;
+ }
+
+ else
+ {
+ xmlElementLength = (localName.Length * 2) + EtwDiagnosticTrace.XmlBracketsLength + value.Length;
+ }
+
if (xmlElementLength <= remainingLength)
{
xml.WriteElementString(localName, value);
diff --git a/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/MruCache.cs b/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/MruCache.cs
index 91555c98f88..dada2897fb8 100644
--- a/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/MruCache.cs
+++ b/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/MruCache.cs
@@ -60,7 +60,7 @@ namespace System.Runtime
Fx.Assert(null != key, "");
// if anything goes wrong (duplicate entry, etc) we should
- // clear our caches so that we don't get out of [....]
+ // clear our caches so that we don't get out of sync
bool success = false;
try
{
diff --git a/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/ThreadNeutralSemaphore.cs b/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/ThreadNeutralSemaphore.cs
index 814d7819b53..054e0504faf 100644
--- a/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/ThreadNeutralSemaphore.cs
+++ b/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/ThreadNeutralSemaphore.cs
@@ -105,7 +105,7 @@ namespace System.Runtime
{
if (!thisPtr.RemoveWaiter(data.Waiter))
{
- // The timeout ----d with Exit and exit won.
+ // The timeout raced with Exit and exit won.
// We've successfully entered.
exceptionToPropagate = null;
}
@@ -160,7 +160,7 @@ namespace System.Runtime
if (timedOut && !RemoveWaiter(waiter))
{
- // The timeout ----d with Exit and exit won.
+ // The timeout raced with Exit and exit won.
// We've successfully entered.
timedOut = false;
diff --git a/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/TraceLevelHelper.cs b/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/TraceLevelHelper.cs
index 2098afd1b62..9eaf540e6e1 100644
--- a/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/TraceLevelHelper.cs
+++ b/mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/TraceLevelHelper.cs
@@ -10,7 +10,7 @@ namespace System.Runtime
using System.Diagnostics;
/// <remarks>
- /// [....] (11/15/10, CSDMain 194940) - Previously, this code first checked that the opcode was set to informational. If not, it would check
+ /// Microsoft (11/15/10, CSDMain 194940) - Previously, this code first checked that the opcode was set to informational. If not, it would check
/// the opcode name for start, stop, suspend, or resume and use that or return Information otherwise. This does not work well with the latest
/// ETW changes where almost every event has a task and opcode. With the old logic, if an opcode is set on the event with a level such as
/// warning or error, the level would be incorrectly reported in diagnostic tracing as informational. Also, start/stop/suspend/resume events
diff --git a/mcs/class/referencesource/System.ServiceModel.Routing/System/ServiceModel/Routing/RoutingService.cs b/mcs/class/referencesource/System.ServiceModel.Routing/System/ServiceModel/Routing/RoutingService.cs
index 32e9d3dcf99..d136269d2ad 100644
--- a/mcs/class/referencesource/System.ServiceModel.Routing/System/ServiceModel/Routing/RoutingService.cs
+++ b/mcs/class/referencesource/System.ServiceModel.Routing/System/ServiceModel/Routing/RoutingService.cs
@@ -200,7 +200,7 @@ namespace System.ServiceModel.Routing
{
if (this.perMessageChannels != null)
{
- //This is for impersonation, thus it's supposed to complete [....]
+ //This is for impersonation, thus it's supposed to complete sync
IAsyncResult result = this.perMessageChannels.BeginClose(this.ChannelExtension.OperationTimeout, null, null);
this.perMessageChannels.EndClose(result);
this.perMessageChannels = null;
diff --git a/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Description/WebHttpBehavior.cs b/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Description/WebHttpBehavior.cs
index 7e9b5bf657e..83b5943fbc2 100644
--- a/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Description/WebHttpBehavior.cs
+++ b/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Description/WebHttpBehavior.cs
@@ -116,12 +116,12 @@ namespace System.ServiceModel.Description
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR2.CrossDomainJavascriptNotsupported));
}
-#pragma warning disable 56506 // [....], endpoint.Contract is never null
+#pragma warning disable 56506 // Microsoft, endpoint.Contract is never null
this.reflector = new XmlSerializerOperationBehavior.Reflector(endpoint.Contract.Namespace, null);
foreach (OperationDescription od in endpoint.Contract.Operations)
#pragma warning restore 56506
{
-#pragma warning disable 56506 // [....], clientRuntime.Operations is never null
+#pragma warning disable 56506 // Microsoft, clientRuntime.Operations is never null
if (clientRuntime.Operations.Contains(od.Name))
#pragma warning restore 56506
{
@@ -169,7 +169,7 @@ namespace System.ServiceModel.Description
{
this.HelpUri = new UriTemplate(HelpPage.OperationListHelpPageUriTemplate).BindByPosition(endpoint.ListenUri);
}
-#pragma warning disable 56506 // [....], endpoint.Contract is never null
+#pragma warning disable 56506 // Microsoft, endpoint.Contract is never null
this.reflector = new XmlSerializerOperationBehavior.Reflector(endpoint.Contract.Namespace, null);
#pragma warning restore 56506
@@ -177,12 +177,12 @@ namespace System.ServiceModel.Description
endpointDispatcher.AddressFilter = new PrefixEndpointAddressMessageFilter(endpoint.Address);
endpointDispatcher.ContractFilter = new MatchAllMessageFilter();
// operation selector
-#pragma warning disable 56506 // [....], endpointDispatcher.DispatchRuntime is never null
+#pragma warning disable 56506 // Microsoft, endpointDispatcher.DispatchRuntime is never null
endpointDispatcher.DispatchRuntime.OperationSelector = this.GetOperationSelector(endpoint);
#pragma warning restore 56506
// unhandled operation
string actionStarOperationName = null;
-#pragma warning disable 56506 // [....], endpoint.Contract is never null
+#pragma warning disable 56506 // Microsoft, endpoint.Contract is never null
foreach (OperationDescription od in endpoint.Contract.Operations)
#pragma warning restore 56506
{
@@ -197,7 +197,7 @@ namespace System.ServiceModel.Description
{
// WCF v1 installs any Action="*" op into UnhandledDispatchOperation, but WebHttpBehavior
// doesn't want this, so we 'move' that operation back into normal set of operations
-#pragma warning disable 56506 // [....], endpointDispatcher.DispatchRuntime.{Operations,UnhandledDispatchOperation} is never null
+#pragma warning disable 56506 // Microsoft, endpointDispatcher.DispatchRuntime.{Operations,UnhandledDispatchOperation} is never null
endpointDispatcher.DispatchRuntime.Operations.Add(
endpointDispatcher.DispatchRuntime.UnhandledDispatchOperation);
#pragma warning restore 56506
@@ -228,7 +228,7 @@ namespace System.ServiceModel.Description
jsonContentType = JsonMessageEncoderFactory.GetContentType(null);
}
-#pragma warning disable 56506 // [....], endpointDispatcher.DispatchRuntime.UnhandledDispatchOperation is never null
+#pragma warning disable 56506 // Microsoft, endpointDispatcher.DispatchRuntime.UnhandledDispatchOperation is never null
// always install UnhandledDispatchOperation (WebHttpDispatchOperationSelector may choose not to use it)
endpointDispatcher.DispatchRuntime.UnhandledDispatchOperation = new DispatchOperation(endpointDispatcher.DispatchRuntime, "*", WildcardAction, WildcardAction);
endpointDispatcher.DispatchRuntime.UnhandledDispatchOperation.DeserializeRequest = false;
@@ -239,13 +239,13 @@ namespace System.ServiceModel.Description
foreach (OperationDescription od in endpoint.Contract.Operations)
{
DispatchOperation dop = null;
-#pragma warning disable 56506 // [....], endpointDispatcher.DispatchRuntime, DispatchRuntime.Operations are never null
+#pragma warning disable 56506 // Microsoft, endpointDispatcher.DispatchRuntime, DispatchRuntime.Operations are never null
if (endpointDispatcher.DispatchRuntime.Operations.Contains(od.Name))
#pragma warning restore 56506
{
dop = endpointDispatcher.DispatchRuntime.Operations[od.Name];
}
-#pragma warning disable 56506 // [....], endpointDispatcher.DispatchRuntime.UnhandledDispatchOperation is never null
+#pragma warning disable 56506 // Microsoft, endpointDispatcher.DispatchRuntime.UnhandledDispatchOperation is never null
else if (endpointDispatcher.DispatchRuntime.UnhandledDispatchOperation.Name == od.Name)
{
dop = endpointDispatcher.DispatchRuntime.UnhandledDispatchOperation;
@@ -600,7 +600,7 @@ namespace System.ServiceModel.Description
WebMessageFormat responseFormat = GetResponseFormat(operationDescription);
// Determine if we should add a json formatter; If the ResponseFormat is json, we always add the json formatter even if the
- // operation is XmlSerializerFormat because the formatter constructor throws the exception: "json not valid with XmlSerializerFormat" [[....]]
+ // operation is XmlSerializerFormat because the formatter constructor throws the exception: "json not valid with XmlSerializerFormat" [Microsoft]
bool useJson = (responseFormat == WebMessageFormat.Json || SupportsJsonFormat(operationDescription));
IDispatchMessageFormatter innerFormatter;
diff --git a/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Description/WebScriptEnablingBehavior.cs b/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Description/WebScriptEnablingBehavior.cs
index bfa99823767..8913c7090b5 100644
--- a/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Description/WebScriptEnablingBehavior.cs
+++ b/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Description/WebScriptEnablingBehavior.cs
@@ -126,7 +126,7 @@ namespace System.ServiceModel.Description
public override void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
{
base.ApplyClientBehavior(endpoint, clientRuntime);
-#pragma warning disable 56506 // [....], clientRuntime.MessageInspectors is never null
+#pragma warning disable 56506 // Microsoft, clientRuntime.MessageInspectors is never null
clientRuntime.MessageInspectors.Add(new JsonClientMessageInspector());
#pragma warning restore 56506
}
@@ -142,7 +142,7 @@ namespace System.ServiceModel.Description
}
catch (XmlException exception)
{
- // [....], need to reference this resource string although fix for 13332 was removed
+ // Microsoft, need to reference this resource string although fix for 13332 was removed
throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR2.GetString(SR2.InvalidXmlCharactersInNameUsedWithPOSTMethod, string.Empty, string.Empty, string.Empty), exception));
}
}
@@ -151,7 +151,7 @@ namespace System.ServiceModel.Description
{
base.Validate(endpoint);
-#pragma warning disable 56506 // [....], endpoint.Contract is never null
+#pragma warning disable 56506 // Microsoft, endpoint.Contract is never null
foreach (OperationDescription operation in endpoint.Contract.Operations)
#pragma warning restore 56506
{
@@ -232,7 +232,7 @@ namespace System.ServiceModel.Description
throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(
"endpointDispatcher", SR2.GetString(SR2.ChannelDispatcherMustBePresent));
}
-#pragma warning disable 56506 // [....], endpointDispatcher.ChannelDispatcher.ErrorHandlers never null
+#pragma warning disable 56506 // Microsoft, endpointDispatcher.ChannelDispatcher.ErrorHandlers never null
endpointDispatcher.ChannelDispatcher.ErrorHandlers.Add(new JsonErrorHandler(endpoint, endpointDispatcher.ChannelDispatcher.IncludeExceptionDetailInFaults));
#pragma warning restore 56506
}
diff --git a/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Dispatcher/HttpUnhandledOperationInvoker.cs b/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Dispatcher/HttpUnhandledOperationInvoker.cs
index 22389d6d90b..523e330f016 100644
--- a/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Dispatcher/HttpUnhandledOperationInvoker.cs
+++ b/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Dispatcher/HttpUnhandledOperationInvoker.cs
@@ -36,7 +36,7 @@ namespace System.ServiceModel.Dispatcher
{
Message message = inputs[0] as Message;
outputs = null;
-#pragma warning disable 56506 // [....], message.Properties is never null
+#pragma warning disable 56506 // Microsoft, message.Properties is never null
if (message == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(
diff --git a/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Dispatcher/WebHttpDispatchOperationSelector.cs b/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Dispatcher/WebHttpDispatchOperationSelector.cs
index ee73a7fd9a4..dba20ddce99 100644
--- a/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Dispatcher/WebHttpDispatchOperationSelector.cs
+++ b/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Dispatcher/WebHttpDispatchOperationSelector.cs
@@ -47,7 +47,7 @@ namespace System.ServiceModel.Dispatcher
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(
SR2.GetString(SR2.EndpointAddressCannotBeNull)));
}
-#pragma warning disable 56506 // [....], endpoint.Address.Uri is never null
+#pragma warning disable 56506 // Microsoft, endpoint.Address.Uri is never null
Uri baseUri = endpoint.Address.Uri;
this.methodSpecificTables = new Dictionary<string, UriTemplateTable>();
this.templates = new Dictionary<string, UriTemplate>();
@@ -61,7 +61,7 @@ namespace System.ServiceModel.Dispatcher
Dictionary<WCFKey, string> alreadyHaves = new Dictionary<WCFKey, string>();
-#pragma warning disable 56506 // [....], endpoint.Contract is never null
+#pragma warning disable 56506 // Microsoft, endpoint.Contract is never null
foreach (OperationDescription od in endpoint.Contract.Operations)
#pragma warning restore 56506
{
@@ -156,7 +156,7 @@ namespace System.ServiceModel.Dispatcher
}
bool uriMatched;
string result = this.SelectOperation(ref message, out uriMatched);
-#pragma warning disable 56506 // [....], Message.Properties is never null
+#pragma warning disable 56506 // Microsoft, Message.Properties is never null
message.Properties.Add(HttpOperationSelectorUriMatchedPropertyName, uriMatched);
#pragma warning restore 56506
if (result != null)
@@ -164,7 +164,7 @@ namespace System.ServiceModel.Dispatcher
message.Properties.Add(HttpOperationNamePropertyName, result);
if (DiagnosticUtility.ShouldTraceInformation)
{
-#pragma warning disable 56506 // [....], Message.Headers is never null
+#pragma warning disable 56506 // Microsoft, Message.Headers is never null
TraceUtility.TraceEvent(TraceEventType.Information, TraceCode.WebRequestMatchesOperation, SR2.GetString(SR2.TraceCodeWebRequestMatchesOperation, message.Headers.To, result));
#pragma warning restore 56506
}
@@ -186,7 +186,7 @@ namespace System.ServiceModel.Dispatcher
return this.catchAllOperationName;
}
-#pragma warning disable 56506 // [....], message.Properties is never null
+#pragma warning disable 56506 // Microsoft, message.Properties is never null
if (!message.Properties.ContainsKey(HttpRequestMessageProperty.Name))
{
return this.catchAllOperationName;
diff --git a/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Web/HttpDateParse.cs b/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Web/HttpDateParse.cs
index 4a3d17d51e7..cadf9da9eea 100644
--- a/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Web/HttpDateParse.cs
+++ b/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Web/HttpDateParse.cs
@@ -1,4 +1,4 @@
-//------------------------------------------------------------
+//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------
namespace System.ServiceModel.Web
@@ -11,7 +11,7 @@ namespace System.ServiceModel.Web
// All of the code from this class was taken from build 20717.00
// of System.Net.HttpDateParse. If there is a bug with this code
// it should be fixed in the original System.Net.HttpDateParse
- // and then ported here. [[....]]
+ // and then ported here. [Microsoft]
internal static class HttpDateParse
{
@@ -48,7 +48,7 @@ namespace System.ServiceModel.Web
private const int DATE_TOKEN_JANUARY = 1;
private const int DATE_TOKEN_FEBRUARY = 2;
- private const int DATE_TOKEN_MARCH = 3;
+ private const int DATE_TOKEN_Microsoft = 3;
private const int DATE_TOKEN_APRIL = 4;
private const int DATE_TOKEN_MAY = 5;
private const int DATE_TOKEN_JUNE = 6;
@@ -145,7 +145,7 @@ namespace System.ServiceModel.Web
switch (MakeUpper(lpszDay[index + 2]))
{
case 'R':
- return DATE_TOKEN_MARCH;
+ return DATE_TOKEN_Microsoft;
case 'Y':
return DATE_TOKEN_MAY;
}
diff --git a/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Web/WebOperationContext.cs b/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Web/WebOperationContext.cs
index e6d3a74f47d..aaff3cea26a 100644
--- a/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Web/WebOperationContext.cs
+++ b/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/Web/WebOperationContext.cs
@@ -37,7 +37,7 @@ namespace System.ServiceModel.Web
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("operationContext");
}
this.operationContext = operationContext;
-#pragma warning disable 56506 // [....], operationContext.Extensions is never null
+#pragma warning disable 56506 // Microsoft, operationContext.Extensions is never null
if (operationContext.Extensions.Find<WebOperationContext>() == null)
{
operationContext.Extensions.Add(this);
diff --git a/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/WebHttpBinding.cs b/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/WebHttpBinding.cs
index 7fd8d6fd514..2b72d55770b 100644
--- a/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/WebHttpBinding.cs
+++ b/mcs/class/referencesource/System.ServiceModel.Web/System/ServiceModel/WebHttpBinding.cs
@@ -195,7 +195,7 @@ namespace System.ServiceModel
}
}
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] // [....], This is the pattern we use on the standard bindings in Indigo V1
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] // Microsoft, This is the pattern we use on the standard bindings in Indigo V1
bool IBindingRuntimePreferences.ReceiveSynchronously
{
get { return false; }
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/Configuration/ServiceModelActivationSectionGroup.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/Configuration/ServiceModelActivationSectionGroup.cs
index 5688f5591ea..19c842d4e17 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/Configuration/ServiceModelActivationSectionGroup.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/Configuration/ServiceModelActivationSectionGroup.cs
@@ -19,7 +19,7 @@ namespace System.ServiceModel.Activation.Configuration
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("config");
}
-#pragma warning suppress 56506 // [....], Configuration.SectionGroups cannot be null
+#pragma warning suppress 56506 // Microsoft, Configuration.SectionGroups cannot be null
return (ServiceModelActivationSectionGroup)config.SectionGroups[ConfigurationStrings.SectionGroupName];
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/ListenerUnsafeNativeMethods.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/ListenerUnsafeNativeMethods.cs
index 6e8d0191482..b8fb610e44f 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/ListenerUnsafeNativeMethods.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/ListenerUnsafeNativeMethods.cs
@@ -279,7 +279,7 @@ namespace System.ServiceModel.Activation
override protected bool ReleaseHandle()
{
-#pragma warning suppress 56523 // [....], should only fail if there is a bug (invalid handle); MDA will be raised
+#pragma warning suppress 56523 // Microsoft, should only fail if there is a bug (invalid handle); MDA will be raised
return ListenerUnsafeNativeMethods.CloseServiceHandle(handle);
}
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/Utility.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/Utility.cs
index 32b1ecdc92b..9a011db9633 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/Utility.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/Utility.cs
@@ -33,7 +33,7 @@ namespace System.ServiceModel.Activation
static SafeCloseHandle OpenCurrentProcessForWrite()
{
int processId = Process.GetCurrentProcess().Id;
-#pragma warning suppress 56523 // [....], Win32Exception ctor calls Marshal.GetLastWin32Error()
+#pragma warning suppress 56523 // Microsoft, Win32Exception ctor calls Marshal.GetLastWin32Error()
SafeCloseHandle process = ListenerUnsafeNativeMethods.OpenProcess(ListenerUnsafeNativeMethods.PROCESS_QUERY_INFORMATION | ListenerUnsafeNativeMethods.WRITE_DAC | ListenerUnsafeNativeMethods.READ_CONTROL, false, processId);
if (process.IsInvalid)
{
@@ -46,7 +46,7 @@ namespace System.ServiceModel.Activation
static SafeCloseHandle OpenProcessForQuery(int pid)
{
-#pragma warning suppress 56523 // [....], Win32Exception ctor calls Marshal.GetLastWin32Error()
+#pragma warning suppress 56523 // Microsoft, Win32Exception ctor calls Marshal.GetLastWin32Error()
SafeCloseHandle process = ListenerUnsafeNativeMethods.OpenProcess(ListenerUnsafeNativeMethods.PROCESS_QUERY_INFORMATION, false, pid);
if (process.IsInvalid)
{
@@ -99,7 +99,7 @@ namespace System.ServiceModel.Activation
static SafeServiceHandle OpenSCManager()
{
-#pragma warning suppress 56523 // [....], Win32Exception ctor calls Marshal.GetLastWin32Error()
+#pragma warning suppress 56523 // Microsoft, Win32Exception ctor calls Marshal.GetLastWin32Error()
SafeServiceHandle scManager = ListenerUnsafeNativeMethods.OpenSCManager(null, null, ListenerUnsafeNativeMethods.SC_MANAGER_CONNECT);
if (scManager.IsInvalid)
{
@@ -112,7 +112,7 @@ namespace System.ServiceModel.Activation
static SafeServiceHandle OpenService(SafeServiceHandle scManager, string serviceName, int purpose)
{
-#pragma warning suppress 56523 // [....], Win32Exception ctor calls Marshal.GetLastWin32Error()
+#pragma warning suppress 56523 // Microsoft, Win32Exception ctor calls Marshal.GetLastWin32Error()
SafeServiceHandle service = ListenerUnsafeNativeMethods.OpenService(scManager, serviceName, purpose);
if (service.IsInvalid)
{
@@ -249,7 +249,7 @@ namespace System.ServiceModel.Activation
}
}
byte[] pSecurityDescriptor = new byte[lpnLengthNeeded];
-#pragma warning suppress 56523 // [....], Win32Exception ctor calls Marshal.GetLastWin32Error()
+#pragma warning suppress 56523 // Microsoft, Win32Exception ctor calls Marshal.GetLastWin32Error()
success = ListenerUnsafeNativeMethods.GetKernelObjectSecurity(kernelObject, ListenerUnsafeNativeMethods.DACL_SECURITY_INFORMATION, pSecurityDescriptor, pSecurityDescriptor.Length, out lpnLengthNeeded);
if (!success)
{
@@ -273,7 +273,7 @@ namespace System.ServiceModel.Activation
pSecurityDescriptor = new byte[lpnLengthNeeded];
securityDescriptor.GetBinaryForm(pSecurityDescriptor, 0);
// set the SECURITY_DESCRIPTOR on the kernelObject
-#pragma warning suppress 56523 // [....], Win32Exception ctor calls Marshal.GetLastWin32Error()
+#pragma warning suppress 56523 // Microsoft, Win32Exception ctor calls Marshal.GetLastWin32Error()
success = ListenerUnsafeNativeMethods.SetKernelObjectSecurity(kernelObject, ListenerUnsafeNativeMethods.DACL_SECURITY_INFORMATION, pSecurityDescriptor);
if (!success)
{
@@ -419,7 +419,7 @@ namespace System.ServiceModel.Activation
}
}
byte[] serviceStatusProcess = new byte[lpnLengthNeeded];
-#pragma warning suppress 56523 // [....], Win32Exception ctor calls Marshal.GetLastWin32Error()
+#pragma warning suppress 56523 // Microsoft, Win32Exception ctor calls Marshal.GetLastWin32Error()
success = ListenerUnsafeNativeMethods.QueryServiceStatusEx(service, ListenerUnsafeNativeMethods.SC_STATUS_PROCESS_INFO, serviceStatusProcess, serviceStatusProcess.Length, out lpnLengthNeeded);
if (!success)
{
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Administration/ProviderBase.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Administration/ProviderBase.cs
index 2c22592f0a2..f5c43f0cad3 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Administration/ProviderBase.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Administration/ProviderBase.cs
@@ -14,7 +14,7 @@ namespace System.ServiceModel.Administration
Fx.Assert(null != info, "");
Fx.Assert(null != instance, "");
//warning 56507 : Prefer 'string.IsNullOrEmpty(action)' over checks for null and/or emptiness.
-#pragma warning suppress 56507 //[....]; Asserting non-null object for marshalling reasons. Empty string may be valid input.
+#pragma warning suppress 56507 //Microsoft; Asserting non-null object for marshalling reasons. Empty string may be valid input.
Fx.Assert(null != propertyName, "");
string[] data = new string[info.Count];
@@ -31,7 +31,7 @@ namespace System.ServiceModel.Administration
Fx.Assert(null != info, "");
Fx.Assert(null != instance, "");
//warning 56507 : Prefer 'string.IsNullOrEmpty(action)' over checks for null and/or emptiness.
-#pragma warning suppress 56507 //[....]; Asserting non-null object for marshalling reasons. Empty string may be valid input.
+#pragma warning suppress 56507 //Microsoft; Asserting non-null object for marshalling reasons. Empty string may be valid input.
Fx.Assert(null != propertyName, "");
int i = 0;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/AppContextDefaultValues.Default.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/AppContextDefaultValues.Default.cs
index e086fad2760..a41685a719f 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/AppContextDefaultValues.Default.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/AppContextDefaultValues.Default.cs
@@ -32,6 +32,12 @@ namespace System
LocalAppContextSwitches.SetDefaultsLessOrEqual_461();
}
+ if (version <= 40602)
+ {
+ // Define the switches that should be true for 4.6.2 or less, false for 4.6.3+.
+ LocalAppContext.DefineSwitchDefault(LocalAppContextSwitches.DisableUsingServicePointManagerSecurityProtocolsString, true);
+ }
+
break;
}
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/AddressHeader.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/AddressHeader.cs
index b866cfd27ca..e9aca788ae8 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/AddressHeader.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/AddressHeader.cs
@@ -293,7 +293,7 @@ namespace System.ServiceModel.Channels
}
}
- // [....], This will be kept internal for now. If the optimization needs to be public, we'll re-evaluate it.
+ // Microsoft, This will be kept internal for now. If the optimization needs to be public, we'll re-evaluate it.
class DictionaryAddressHeader : XmlObjectSerializerAddressHeader
{
XmlDictionaryString name;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/AddressHeaderCollection.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/AddressHeaderCollection.cs
index 0225acd4ea6..a249d56a9a9 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/AddressHeaderCollection.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/AddressHeaderCollection.cs
@@ -70,7 +70,7 @@ namespace System.ServiceModel.Channels
for (int i = 0; i < InternalCount; i++)
{
-#pragma warning suppress 56506 // [....], Message.Headers can never be null
+#pragma warning suppress 56506 // Microsoft, Message.Headers can never be null
message.Headers.Add(this[i].ToMessageHeader());
}
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/BinaryMessageEncoder.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/BinaryMessageEncoder.cs
index 0aea9ac3133..f223ce0f0c0 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/BinaryMessageEncoder.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/BinaryMessageEncoder.cs
@@ -1667,7 +1667,7 @@ namespace System.ServiceModel.Channels
get
{
if (IsDisposed)
-#pragma warning suppress 56503 // [....], Invalid State after dispose
+#pragma warning suppress 56503 // Microsoft, Invalid State after dispose
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(CreateMessageDisposedException());
@@ -1681,7 +1681,7 @@ namespace System.ServiceModel.Channels
get
{
if (IsDisposed)
-#pragma warning suppress 56503 // [....], Invalid State after dispose
+#pragma warning suppress 56503 // Microsoft, Invalid State after dispose
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(CreateMessageDisposedException());
@@ -1690,13 +1690,23 @@ namespace System.ServiceModel.Channels
}
}
+ internal override void SetProperty(string name, object value)
+ {
+ MessageProperties prop = this.properties;
+
+ if (prop != null)
+ {
+ prop[name] = value;
+ }
+ }
+
public override MessageVersion Version
{
get
{
if (IsDisposed)
{
-#pragma warning suppress 56503 // [....], Invalid State after dispose
+#pragma warning suppress 56503 // Microsoft, Invalid State after dispose
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(CreateMessageDisposedException());
}
return headers.MessageVersion;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/BufferedOutputAsyncStream.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/BufferedOutputAsyncStream.cs
index cc976b636e1..94ae253ec1b 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/BufferedOutputAsyncStream.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/BufferedOutputAsyncStream.cs
@@ -27,8 +27,8 @@ namespace System.ServiceModel.Channels
///
/// Currently BufferedOutputAsyncStream only used to wrap the System.Net.HttpResponseStream, which satisfy both requirements.
///
- /// BufferedOutputAsyncStream can also be used when doing asynchronous operations. [....] operations are not allowed when an async
- /// operation is in-flight. If a [....] operation is in progress (i.e., data exists in our CurrentBuffer) and we issue an async operation,
+ /// BufferedOutputAsyncStream can also be used when doing asynchronous operations. Sync operations are not allowed when an async
+ /// operation is in-flight. If a sync operation is in progress (i.e., data exists in our CurrentBuffer) and we issue an async operation,
/// we flush everything in the buffers (and block while doing so) before the async operation is allowed to proceed.
///
/// </summary>
@@ -78,7 +78,7 @@ namespace System.ServiceModel.Channels
{
get
{
-#pragma warning suppress 56503 // [....], required by the Stream.Length contract
+#pragma warning suppress 56503 // Microsoft, required by the Stream.Length contract
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.ReadNotSupported)));
}
}
@@ -87,7 +87,7 @@ namespace System.ServiceModel.Channels
{
get
{
-#pragma warning suppress 56503 // [....], required by the Stream.Position contract
+#pragma warning suppress 56503 // Microsoft, required by the Stream.Position contract
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.SeekNotSupported)));
}
set
@@ -335,7 +335,7 @@ namespace System.ServiceModel.Channels
void DequeueAndFlush(ByteBuffer currentBuffer, AsyncEventArgsCallback callback)
{
// Dequeue does a checkout of the buffer from its slot.
- // the callback for the [....] path only enqueues the buffer.
+ // the callback for the sync path only enqueues the buffer.
// The WriteAsync callback needs to enqueue and also complete.
this.currentByteBuffer = null;
ByteBuffer dequeued = this.buffers.Dequeue();
@@ -756,7 +756,7 @@ namespace System.ServiceModel.Channels
buffer.stream.EndWrite(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/CompositeDuplexBindingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/CompositeDuplexBindingElement.cs
index f038eb55394..1dcac849612 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/CompositeDuplexBindingElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/CompositeDuplexBindingElement.cs
@@ -86,7 +86,7 @@ namespace System.ServiceModel.Channels
else
{
//
-#pragma warning suppress 56506 // [....], context.Binding will never be null.
+#pragma warning suppress 56506 // Microsoft, context.Binding will never be null.
context.ListenUriRelativeAddress = String.Empty;
context.ListenUriMode = ListenUriMode.Unique;
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/Connection.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/Connection.cs
index 9934d41ffdb..c795e66a15e 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/Connection.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/Connection.cs
@@ -338,7 +338,7 @@ namespace System.ServiceModel.Channels
{
get
{
-#pragma warning suppress 56503 // [....], required by the Stream.Length contract
+#pragma warning suppress 56503 // Microsoft, required by the Stream.Length contract
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.SeekNotSupported)));
}
}
@@ -347,7 +347,7 @@ namespace System.ServiceModel.Channels
{
get
{
-#pragma warning suppress 56503 // [....], required by the Stream.Position contract
+#pragma warning suppress 56503 // Microsoft, required by the Stream.Position contract
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.SeekNotSupported)));
}
set
@@ -470,7 +470,7 @@ namespace System.ServiceModel.Channels
{
thisPtr.HandleIO(thisPtr.connection);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionDemuxer.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionDemuxer.cs
index 0a74ee019dd..9f50f397fe8 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionDemuxer.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionDemuxer.cs
@@ -554,7 +554,7 @@ namespace System.ServiceModel.Channels
IConnection upgradedConnection = this.serverSingletonPreambleReader.EndCompletePreamble(result);
ServerSingletonConnectionReader singletonReader = new ServerSingletonConnectionReader(serverSingletonPreambleReader, upgradedConnection, this.demuxer);
- //singletonReader doesn't have async version of ReceiveRequest, so just call the [....] method for now.
+ //singletonReader doesn't have async version of ReceiveRequest, so just call the sync method for now.
RequestContext requestContext = singletonReader.ReceiveRequest(this.timeoutHelper.RemainingTime());
singletonChannelListener.ReceiveRequest(requestContext, serverSingletonPreambleReader.ConnectionDequeuedCallback, true);
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionModeReader.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionModeReader.cs
index de091c4ea88..57a54e084e5 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionModeReader.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionModeReader.cs
@@ -134,7 +134,7 @@ namespace System.ServiceModel.Channels
completeSelf = reader.ContinueReading();
}
}
-#pragma warning suppress 56500 // [....], transferring exception to caller
+#pragma warning suppress 56500 // Microsoft, transferring exception to caller
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -201,7 +201,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = ContinueReading();
}
-#pragma warning suppress 56500 // [....], transferring exception to caller
+#pragma warning suppress 56500 // Microsoft, transferring exception to caller
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionPool.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionPool.cs
index a76041897de..fcab3692d0b 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionPool.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionPool.cs
@@ -1213,7 +1213,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = thisPtr.HandleConnect(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -1292,7 +1292,7 @@ namespace System.ServiceModel.Channels
thisPtr.SnapshotConnection();
}
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ContentOnlyMessage.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ContentOnlyMessage.cs
index a2413853a8d..0173e2b62ea 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ContentOnlyMessage.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ContentOnlyMessage.cs
@@ -28,7 +28,7 @@ namespace System.ServiceModel.Channels
{
if (IsDisposed)
{
-#pragma warning suppress 56503 // [....], required by base class contract
+#pragma warning suppress 56503 // Microsoft, required by base class contract
throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this);
}
@@ -42,7 +42,7 @@ namespace System.ServiceModel.Channels
{
if (IsDisposed)
{
-#pragma warning suppress 56503 // [....], required by base class contract
+#pragma warning suppress 56503 // Microsoft, required by base class contract
throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this);
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/FramingChannels.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/FramingChannels.cs
index f232b0f7d44..41c0e1f3786 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/FramingChannels.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/FramingChannels.cs
@@ -641,7 +641,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = thisPtr.HandleWritePreamble();
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -669,7 +669,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = thisPtr.HandlePreambleAck();
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -702,7 +702,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = thisPtr.HandleInitiatorOpen(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -735,7 +735,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = thisPtr.HandleUpgrade(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -768,7 +768,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = thisPtr.HandleInitiatorClose(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -796,7 +796,7 @@ namespace System.ServiceModel.Channels
thisPtr.connection.EndWrite();
completeSelf = thisPtr.ReadAck();
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -826,7 +826,7 @@ namespace System.ServiceModel.Channels
{
ConnectionUpgradeHelper.EndDecodeFramingFault(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -913,7 +913,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = thisPtr.HandleEstablishConnection(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -1172,7 +1172,7 @@ namespace System.ServiceModel.Channels
{
thisPtr.CompleteReadFaultData();
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -1335,7 +1335,7 @@ namespace System.ServiceModel.Channels
completeSelf = thisPtr.Begin();
}
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -1366,7 +1366,7 @@ namespace System.ServiceModel.Channels
{
ConnectionUpgradeHelper.EndDecodeFramingFault(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -1392,7 +1392,7 @@ namespace System.ServiceModel.Channels
completeSelf = thisPtr.Begin();
}
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -1423,7 +1423,7 @@ namespace System.ServiceModel.Channels
thisPtr.CompleteUpgrade(result);
completeSelf = thisPtr.Begin();
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/FramingDecoders.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/FramingDecoders.cs
index 8c5b4e61483..dbd6ca609d0 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/FramingDecoders.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/FramingDecoders.cs
@@ -32,7 +32,7 @@ namespace System.ServiceModel.Channels
get
{
if (!isValueDecoded)
-#pragma warning suppress 56503 // [....], not a publicly accessible API
+#pragma warning suppress 56503 // Microsoft, not a publicly accessible API
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable)));
return value;
}
@@ -108,7 +108,7 @@ namespace System.ServiceModel.Channels
get
{
if (currentState != State.Done)
-#pragma warning suppress 56503 // [....], not a publicly accessible API
+#pragma warning suppress 56503 // Microsoft, not a publicly accessible API
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable)));
return value;
}
@@ -236,7 +236,7 @@ namespace System.ServiceModel.Channels
get
{
if (!IsValueDecoded)
-#pragma warning suppress 56503 // [....], not a publicly accessible API
+#pragma warning suppress 56503 // Microsoft, not a publicly accessible API
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable)));
return via;
}
@@ -544,7 +544,7 @@ namespace System.ServiceModel.Channels
get
{
if (currentState != State.Done)
-#pragma warning suppress 56503 // [....], not a publicly accessible API
+#pragma warning suppress 56503 // Microsoft, not a publicly accessible API
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable)));
return mode;
}
@@ -555,7 +555,7 @@ namespace System.ServiceModel.Channels
get
{
if (currentState != State.Done)
-#pragma warning suppress 56503 // [....], not a publicly accessible API
+#pragma warning suppress 56503 // Microsoft, not a publicly accessible API
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable)));
return majorVersion;
}
@@ -566,7 +566,7 @@ namespace System.ServiceModel.Channels
get
{
if (currentState != State.Done)
-#pragma warning suppress 56503 // [....], not a publicly accessible API
+#pragma warning suppress 56503 // Microsoft, not a publicly accessible API
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable)));
return minorVersion;
}
@@ -624,7 +624,7 @@ namespace System.ServiceModel.Channels
get
{
if (currentState < State.PreUpgradeStart)
-#pragma warning suppress 56503 // [....], not a publicly accessible API
+#pragma warning suppress 56503 // Microsoft, not a publicly accessible API
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable)));
return contentType;
}
@@ -635,7 +635,7 @@ namespace System.ServiceModel.Channels
get
{
if (currentState < State.ReadingContentTypeRecord)
-#pragma warning suppress 56503 // [....], not a publicly accessible API
+#pragma warning suppress 56503 // Microsoft, not a publicly accessible API
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable)));
return viaDecoder.ValueAsUri;
}
@@ -652,7 +652,7 @@ namespace System.ServiceModel.Channels
get
{
if (currentState != State.UpgradeRequest)
-#pragma warning suppress 56503 // [....], not a publicly accessible API
+#pragma warning suppress 56503 // Microsoft, not a publicly accessible API
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable)));
return upgrade;
}
@@ -663,7 +663,7 @@ namespace System.ServiceModel.Channels
get
{
if (currentState < State.EnvelopeStart)
-#pragma warning suppress 56503 // [....], not a publicly accessible API
+#pragma warning suppress 56503 // Microsoft, not a publicly accessible API
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable)));
return envelopeSize;
}
@@ -880,7 +880,7 @@ namespace System.ServiceModel.Channels
{
if (currentState < State.ChunkStart)
{
-#pragma warning suppress 56503 // [....], not a publicly accessible API
+#pragma warning suppress 56503 // Microsoft, not a publicly accessible API
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable)));
}
@@ -1009,7 +1009,7 @@ namespace System.ServiceModel.Channels
get
{
if (currentState < State.ReadingContentTypeRecord)
-#pragma warning suppress 56503 // [....], not a publicly accessible API
+#pragma warning suppress 56503 // Microsoft, not a publicly accessible API
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable)));
return viaDecoder.ValueAsUri;
}
@@ -1020,7 +1020,7 @@ namespace System.ServiceModel.Channels
get
{
if (currentState < State.PreUpgradeStart)
-#pragma warning suppress 56503 // [....], not a publicly accessible API
+#pragma warning suppress 56503 // Microsoft, not a publicly accessible API
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable)));
return contentType;
}
@@ -1031,7 +1031,7 @@ namespace System.ServiceModel.Channels
get
{
if (currentState != State.UpgradeRequest)
-#pragma warning suppress 56503 // [....], not a publicly accessible API
+#pragma warning suppress 56503 // Microsoft, not a publicly accessible API
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable)));
return upgrade;
}
@@ -1280,7 +1280,7 @@ namespace System.ServiceModel.Channels
get
{
if (currentState < State.ReadingContentTypeRecord)
-#pragma warning suppress 56503 // [....], not a publicly accessible API
+#pragma warning suppress 56503 // Microsoft, not a publicly accessible API
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable)));
return viaDecoder.ValueAsUri;
}
@@ -1291,7 +1291,7 @@ namespace System.ServiceModel.Channels
get
{
if (currentState < State.Start)
-#pragma warning suppress 56503 // [....], not a publicly accessible API
+#pragma warning suppress 56503 // Microsoft, not a publicly accessible API
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable)));
return contentType;
}
@@ -1386,7 +1386,7 @@ namespace System.ServiceModel.Channels
get
{
if (CurrentState < ClientFramingDecoderState.EnvelopeStart)
-#pragma warning suppress 56503 // [....], not a publicly accessible API
+#pragma warning suppress 56503 // Microsoft, not a publicly accessible API
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable)));
return envelopeSize;
}
@@ -1397,7 +1397,7 @@ namespace System.ServiceModel.Channels
get
{
if (CurrentState < ClientFramingDecoderState.Fault)
-#pragma warning suppress 56503 // [....], not a publicly accessible API
+#pragma warning suppress 56503 // Microsoft, not a publicly accessible API
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable)));
return faultDecoder.Value;
}
@@ -1543,7 +1543,7 @@ namespace System.ServiceModel.Channels
get
{
if (CurrentState < ClientFramingDecoderState.Fault)
-#pragma warning suppress 56503 // [....], not a publicly accessible API
+#pragma warning suppress 56503 // Microsoft, not a publicly accessible API
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable)));
return faultDecoder.Value;
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpChannelFactory.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpChannelFactory.cs
index 482d0bfde8f..323b2541503 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpChannelFactory.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpChannelFactory.cs
@@ -1496,7 +1496,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = thisPtr.OnGetWebRequestCompleted(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -1810,7 +1810,7 @@ namespace System.ServiceModel.Channels
{
thisPtr.CompleteParseIncomingMessage(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -1837,7 +1837,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = thisPtr.CompleteSend(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -1882,7 +1882,7 @@ namespace System.ServiceModel.Channels
completeSelf = true;
completionException = new CommunicationException(webException.Message, webException);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -2068,7 +2068,7 @@ namespace System.ServiceModel.Channels
thisPtr.CompleteGetSspiCredential(result);
thisPtr.CloseTokenProvidersIfRequired();
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -2096,7 +2096,7 @@ namespace System.ServiceModel.Channels
thisPtr.CompleteGetUserNameCredential(result);
thisPtr.CloseTokenProvidersIfRequired();
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpChannelHelpers.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpChannelHelpers.cs
index 5df21319d3d..f75afcecfbb 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpChannelHelpers.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpChannelHelpers.cs
@@ -780,7 +780,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = thisPtr.ContinueReading(thisPtr.inputStream.EndRead(result));
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -2193,7 +2193,7 @@ namespace System.ServiceModel.Channels
bool WriteStreamedMessage()
{
- // return a bool to determine if we are [....].
+ // return a bool to determine if we are sync.
if (onWriteStreamedMessage == null)
{
@@ -2289,7 +2289,7 @@ namespace System.ServiceModel.Channels
completeSelf = true;
}
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -2315,7 +2315,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = thisPtr.WriteStreamedMessage();
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -2349,7 +2349,7 @@ namespace System.ServiceModel.Channels
thisPtr.CompleteWriteBody(result);
thisPtr.httpOutput.TraceSend();
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -2781,7 +2781,7 @@ namespace System.ServiceModel.Channels
{
thisPtr.CompleteGetRequestStream(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpPipeline.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpPipeline.cs
index ee321225b02..2b656359678 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpPipeline.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpPipeline.cs
@@ -444,7 +444,7 @@ namespace System.ServiceModel.Channels
bool lockTaken = false;
try
{
- // We need this lock only in [....] reply case. In this case, we hopped the thread in the request side, so it's possible to send the response here
+ // We need this lock only in sync reply case. In this case, we hopped the thread in the request side, so it's possible to send the response here
// before the TransportIntegrationHandler is ready on another thread (thus a race condition). So we use the lock here. In the incoming path, we won't
// release the lock until the TransportIntegrationHandler is ready. Once we get the lock on the outgoing path, we can then call Wait() on this handler safely.
Monitor.TryEnter(this.ThisLock, TimeoutHelper.ToMilliseconds(helper.RemainingTime()), ref lockTaken);
@@ -615,7 +615,7 @@ namespace System.ServiceModel.Channels
this.cancellationTokenSource.Dispose();
this.wasProcessInboundRequestSuccessful = true;
//// shortcut scenario
- //// Currently we are always doing [....] send even async send is enabled.
+ //// Currently we are always doing sync send even async send is enabled.
this.SendAndClose(t.Result);
}
else if (this.isAsyncReply)
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpTransportBindingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpTransportBindingElement.cs
index 479ca48628a..c173b43170b 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpTransportBindingElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpTransportBindingElement.cs
@@ -528,7 +528,7 @@ namespace System.ServiceModel.Channels
}
else
{
-#pragma warning suppress 56506 // [....], BindingContext.BindingParameters cannot be null
+#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters cannot be null
if (context.BindingParameters.Find<MessageEncodingBindingElement>() == null)
{
context.BindingParameters.Add(new TextMessageEncodingBindingElement());
@@ -578,7 +578,7 @@ namespace System.ServiceModel.Channels
if (!this.CanBuildChannelFactory<TChannel>(context))
{
-#pragma warning suppress 56506 // [....], context.Binding will never be null.
+#pragma warning suppress 56506 // Microsoft, context.Binding will never be null.
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("TChannel", SR.GetString(SR.CouldnTCreateChannelForChannelType2, context.Binding.Name, typeof(TChannel)));
}
@@ -649,7 +649,7 @@ namespace System.ServiceModel.Channels
if (!this.CanBuildChannelListener<TChannel>(context))
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(
-#pragma warning suppress 56506 // [....], context.Binding will never be null.
+#pragma warning suppress 56506 // Microsoft, context.Binding will never be null.
"TChannel", SR.GetString(SR.CouldnTCreateChannelForChannelType2, context.Binding.Name, typeof(TChannel)));
}
@@ -672,7 +672,7 @@ namespace System.ServiceModel.Channels
if (effectiveAutheSchemes == AuthenticationSchemes.None)
{
-#pragma warning suppress 56506 // [....], context.Binding will never be null.
+#pragma warning suppress 56506 // Microsoft, context.Binding will never be null.
string bindingName = context.Binding.Name;
if (this.AuthenticationScheme == AuthenticationSchemes.None)
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpsChannelFactory.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpsChannelFactory.cs
index 6b2511b4c0f..6f0924176e2 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpsChannelFactory.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpsChannelFactory.cs
@@ -488,7 +488,7 @@ namespace System.ServiceModel.Channels
thisPtr.request = thisPtr.httpsChannel.EndBaseGetWebRequest(result);
thisPtr.factory.AddServerCertMappingOrSetRemoteCertificateValidationCallback(thisPtr.request, thisPtr.to);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -514,7 +514,7 @@ namespace System.ServiceModel.Channels
thisPtr.OnGetToken(result);
completeSelf = thisPtr.GetWebRequest();
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IdlingCommunicationPool.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IdlingCommunicationPool.cs
index b2563cc48b4..e576d74b13c 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IdlingCommunicationPool.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IdlingCommunicationPool.cs
@@ -37,7 +37,7 @@ namespace System.ServiceModel.Channels
protected override void CloseItemAsync(TItem item, TimeSpan timeout)
{
- // Default behavior is [....]. Derived classes can override.
+ // Default behavior is sync. Derived classes can override.
this.CloseItem(item, timeout);
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InitialServerConnectionReader.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InitialServerConnectionReader.cs
index 4bc768331a2..d9d1af921b2 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InitialServerConnectionReader.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InitialServerConnectionReader.cs
@@ -404,7 +404,7 @@ namespace System.ServiceModel.Channels
{
thisPtr.CompleteAcceptUpgrade(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InputChannel.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InputChannel.cs
index 26f1e3aa35f..b4e5202fa55 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InputChannel.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InputChannel.cs
@@ -223,7 +223,7 @@ namespace System.ServiceModel.Channels
{
thisPtr.HandleReceiveComplete(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InternalDuplexBindingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InternalDuplexBindingElement.cs
index dc126777c7b..5abee3c70ab 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InternalDuplexBindingElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InternalDuplexBindingElement.cs
@@ -69,7 +69,7 @@ namespace System.ServiceModel.Channels
}
else
{
-#pragma warning suppress 56506 // [....], context.RemainingBindingElements will never be null
+#pragma warning suppress 56506 // Microsoft, context.RemainingBindingElements will never be null
context.RemainingBindingElements.Clear();
}
LocalAddressProvider localAddressProvider = context.BindingParameters.Remove<LocalAddressProvider>();
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InternalDuplexChannelListener.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InternalDuplexChannelListener.cs
index 2795232210d..9f3022762c8 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InternalDuplexChannelListener.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InternalDuplexChannelListener.cs
@@ -345,7 +345,7 @@ namespace System.ServiceModel.Channels
{
thisPtr.CompleteSend(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/Message.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/Message.cs
index 5ea731f0809..6575d29ffe3 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/Message.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/Message.cs
@@ -34,7 +34,7 @@ namespace System.ServiceModel.Channels
get
{
if (IsDisposed)
-#pragma warning suppress 56503 // [....], Invalid State after dispose
+#pragma warning suppress 56503 // Microsoft, Invalid State after dispose
throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this);
return false;
@@ -46,7 +46,7 @@ namespace System.ServiceModel.Channels
get
{
if (IsDisposed)
-#pragma warning suppress 56503 // [....], Invalid State after dispose
+#pragma warning suppress 56503 // Microsoft, Invalid State after dispose
throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this);
return false;
@@ -57,6 +57,29 @@ namespace System.ServiceModel.Channels
public abstract MessageVersion Version { get; } // must never return null
+ internal virtual void SetProperty(string name, object value)
+ {
+ MessageProperties prop = Properties;
+
+ if (prop != null)
+ {
+ prop[name] = value;
+ }
+ }
+
+ internal virtual bool GetProperty(string name, out object result)
+ {
+ MessageProperties prop = Properties;
+
+ if (prop != null)
+ {
+ return prop.TryGetValue(name, out result);
+ }
+
+ result = null;
+ return false;
+ }
+
internal virtual RecycledMessageState RecycledMessageState
{
get { return null; }
@@ -978,7 +1001,7 @@ namespace System.ServiceModel.Channels
get
{
if (IsDisposed)
-#pragma warning suppress 56503 // [....], Invalid State after dispose
+#pragma warning suppress 56503 // Microsoft, Invalid State after dispose
throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this);
return bodyWriter.IsFault;
}
@@ -989,7 +1012,7 @@ namespace System.ServiceModel.Channels
get
{
if (IsDisposed)
-#pragma warning suppress 56503 // [....], Invalid State after dispose
+#pragma warning suppress 56503 // Microsoft, Invalid State after dispose
throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this);
return bodyWriter.IsEmpty;
}
@@ -1000,7 +1023,7 @@ namespace System.ServiceModel.Channels
get
{
if (IsDisposed)
-#pragma warning suppress 56503 // [....], Invalid State after dispose
+#pragma warning suppress 56503 // Microsoft, Invalid State after dispose
throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this);
return headers;
}
@@ -1011,7 +1034,7 @@ namespace System.ServiceModel.Channels
get
{
if (IsDisposed)
-#pragma warning suppress 56503 // [....], Invalid State after dispose
+#pragma warning suppress 56503 // Microsoft, Invalid State after dispose
throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this);
if (properties == null)
properties = new MessageProperties();
@@ -1019,12 +1042,36 @@ namespace System.ServiceModel.Channels
}
}
+ internal override void SetProperty(string name, object value)
+ {
+ MessageProperties prop = this.properties;
+
+ if (prop != null)
+ {
+ prop[name] = value;
+ }
+ }
+
+ internal override bool GetProperty(string name, out object result)
+ {
+ MessageProperties prop = this.properties;
+
+ if (prop != null)
+ {
+ return prop.TryGetValue(name, out result);
+ }
+
+ result = null;
+ return false;
+ }
+
+
public override MessageVersion Version
{
get
{
if (IsDisposed)
-#pragma warning suppress 56503 // [....], Invalid State after dispose
+#pragma warning suppress 56503 // Microsoft, Invalid State after dispose
throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this);
return headers.MessageVersion;
}
@@ -1306,7 +1353,7 @@ namespace System.ServiceModel.Channels
get
{
if (IsDisposed)
-#pragma warning suppress 56503 // [....], Invalid State after dispose
+#pragma warning suppress 56503 // Microsoft, Invalid State after dispose
throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this);
return headers;
}
@@ -1522,7 +1569,7 @@ namespace System.ServiceModel.Channels
get
{
if (IsDisposed)
-#pragma warning suppress 56503 // [....], Invalid State after dispose
+#pragma warning suppress 56503 // Microsoft, Invalid State after dispose
throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this);
return headers;
}
@@ -1541,7 +1588,7 @@ namespace System.ServiceModel.Channels
get
{
if (IsDisposed)
-#pragma warning suppress 56503 // [....], Invalid State after dispose
+#pragma warning suppress 56503 // Microsoft, Invalid State after dispose
throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this);
return properties;
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageBuffer.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageBuffer.cs
index 4a15880764e..383bf17b7af 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageBuffer.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageBuffer.cs
@@ -197,7 +197,7 @@ namespace System.ServiceModel.Channels
lock (ThisLock)
{
if (closed)
-#pragma warning suppress 56503 // [....], Invalid State after dispose
+#pragma warning suppress 56503 // Microsoft, Invalid State after dispose
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(CreateBufferDisposedException());
return messageData.Buffer.Count;
}
@@ -224,7 +224,7 @@ namespace System.ServiceModel.Channels
lock (ThisLock)
{
if (closed)
-#pragma warning suppress 56503 // [....], Invalid State after dispose
+#pragma warning suppress 56503 // Microsoft, Invalid State after dispose
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(CreateBufferDisposedException());
return messageData.MessageEncoder.ContentType;
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageEncodingBindingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageEncodingBindingElement.cs
index 1dcae5bf034..72af695436d 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageEncodingBindingElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageEncodingBindingElement.cs
@@ -38,7 +38,7 @@ namespace System.ServiceModel.Channels
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context"));
}
-#pragma warning suppress 56506 // [....], BindingContext.BindingParameters never be null
+#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters never be null
context.BindingParameters.Add(this);
return context.BuildInnerChannelFactory<TChannel>();
}
@@ -50,7 +50,7 @@ namespace System.ServiceModel.Channels
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context"));
}
-#pragma warning suppress 56506 // [....], BindingContext.BindingParameters never be null
+#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters never be null
context.BindingParameters.Add(this);
return context.CanBuildInnerChannelFactory<TChannel>();
}
@@ -63,7 +63,7 @@ namespace System.ServiceModel.Channels
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context"));
}
-#pragma warning suppress 56506 // [....], BindingContext.BindingParameters never be null
+#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters never be null
context.BindingParameters.Add(this);
return context.BuildInnerChannelListener<TChannel>();
}
@@ -76,7 +76,7 @@ namespace System.ServiceModel.Channels
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context"));
}
-#pragma warning suppress 56506 // [....], BindingContext.BindingParameters never be null
+#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters never be null
context.BindingParameters.Add(this);
return context.CanBuildInnerChannelListener<TChannel>();
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageEncodingBindingElementImporter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageEncodingBindingElementImporter.cs
index 6b4de1fab49..3662da87dc2 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageEncodingBindingElementImporter.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageEncodingBindingElementImporter.cs
@@ -25,7 +25,7 @@ namespace System.ServiceModel.Channels
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context");
}
-#pragma warning suppress 56506 // [....], these properties cannot be null in this context
+#pragma warning suppress 56506 // Microsoft, these properties cannot be null in this context
if (context.Endpoint.Binding == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context.Endpoint.Binding");
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageFault.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageFault.cs
index 5803f1710c9..09e60dfffb8 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageFault.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageFault.cs
@@ -69,7 +69,7 @@ namespace System.ServiceModel.Channels
{
try
{
-#pragma warning suppress 56506 // [....], Message.Version can never be null
+#pragma warning suppress 56506 // Microsoft, Message.Version can never be null
EnvelopeVersion envelopeVersion = message.Version.Envelope;
MessageFault fault;
if (envelopeVersion == EnvelopeVersion.Soap12)
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageHeaders.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageHeaders.cs
index de966e44995..5accd13b6ac 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageHeaders.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageHeaders.cs
@@ -490,7 +490,7 @@ namespace System.ServiceModel.Channels
if (collection.version != version)
{
-#pragma warning suppress 56506 // [....], collection.version is never null
+#pragma warning suppress 56506 // Microsoft, collection.version is never null
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentException(SR.GetString(SR.MessageHeaderVersionMismatch, collection.version.ToString(), version.ToString()), "collection"));
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OneWayChannelFactory.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OneWayChannelFactory.cs
index f45463a3320..c37698a5e7b 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OneWayChannelFactory.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OneWayChannelFactory.cs
@@ -763,7 +763,7 @@ namespace System.ServiceModel.Channels
thisPtr.CompleteOpen(result);
completeSelf = thisPtr.SendMessage();
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -796,7 +796,7 @@ namespace System.ServiceModel.Channels
{
thisPtr.innerChannel.EndSend(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OneWayChannelListener.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OneWayChannelListener.cs
index ef8abafcf1f..afba9b018ca 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OneWayChannelListener.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OneWayChannelListener.cs
@@ -429,7 +429,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = thisPtr.HandleReceiveRequestComplete(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -461,7 +461,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = thisPtr.HandleReplyComplete(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -770,7 +770,7 @@ namespace System.ServiceModel.Channels
return;
}
}
-#pragma warning suppress 56500 // [....], transferring exception to input queue to be pulled off by user
+#pragma warning suppress 56500 // Microsoft, transferring exception to input queue to be pulled off by user
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -809,7 +809,7 @@ namespace System.ServiceModel.Channels
{
DiagnosticUtility.TraceHandledException(e, TraceEventType.Information);
}
-#pragma warning suppress 56500 // [....], transferring exception to input queue to be pulled off by user
+#pragma warning suppress 56500 // Microsoft, transferring exception to input queue to be pulled off by user
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -940,7 +940,7 @@ namespace System.ServiceModel.Channels
}
DiagnosticUtility.TraceHandledException(e, TraceEventType.Information);
}
-#pragma warning suppress 56500 // [....], transferring exception to input queue to be pulled off by user
+#pragma warning suppress 56500 // Microsoft, transferring exception to input queue to be pulled off by user
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -1007,7 +1007,7 @@ namespace System.ServiceModel.Channels
}
DiagnosticUtility.TraceHandledException(e, TraceEventType.Information);
}
-#pragma warning suppress 56500 // [....], transferring exception to input queue to be pulled off by user
+#pragma warning suppress 56500 // Microsoft, transferring exception to input queue to be pulled off by user
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -1274,7 +1274,7 @@ namespace System.ServiceModel.Channels
{
DiagnosticUtility.TraceHandledException(e, TraceEventType.Information);
}
-#pragma warning suppress 56500 // [....], transferring exception to input queue to be pulled off by user
+#pragma warning suppress 56500 // Microsoft, transferring exception to input queue to be pulled off by user
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -1379,7 +1379,7 @@ namespace System.ServiceModel.Channels
DiagnosticUtility.TraceHandledException(e, TraceEventType.Information);
startLoop = (this.channel.State == CommunicationState.Opened);
}
-#pragma warning suppress 56500 // [....], transferring exception to input queue to be pulled off by user
+#pragma warning suppress 56500 // Microsoft, transferring exception to input queue to be pulled off by user
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -1415,7 +1415,7 @@ namespace System.ServiceModel.Channels
{
DiagnosticUtility.TraceHandledException(e, TraceEventType.Information);
}
-#pragma warning suppress 56500 // [....], transferring exception to input queue to be pulled off by user
+#pragma warning suppress 56500 // Microsoft, transferring exception to input queue to be pulled off by user
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OverlappedContext.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OverlappedContext.cs
index 7af8609728f..f03b4079905 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OverlappedContext.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OverlappedContext.cs
@@ -109,7 +109,7 @@ namespace System.ServiceModel.Channels
}
if (this.syncOperationPending)
{
- throw Fx.AssertAndThrow("OverlappedContext.Free called while [....] operation is pending.");
+ throw Fx.AssertAndThrow("OverlappedContext.Free called while sync operation is pending.");
}
if (this.nativeOverlapped == null)
{
@@ -172,7 +172,7 @@ namespace System.ServiceModel.Channels
}
if (this.syncOperationPending)
{
- throw Fx.AssertAndThrow("StartAsyncOperation called while a [....] operation was already pending.");
+ throw Fx.AssertAndThrow("StartAsyncOperation called while a sync operation was already pending.");
}
if (this.nativeOverlapped == null)
{
@@ -249,7 +249,7 @@ namespace System.ServiceModel.Channels
this.overlapped.EventHandleIntPtr = EventHandle;
- // [....] operations do NOT root this object. If it gets finalized, we need to know not to free the buffer.
+ // Sync operations do NOT root this object. If it gets finalized, we need to know not to free the buffer.
// We do root the event.
this.rootedHolder.EventHolder = this.completionEvent;
this.syncOperationPending = true;
@@ -292,7 +292,7 @@ namespace System.ServiceModel.Channels
}
Fx.Assert(this.bufferPtr == null || this.bufferPtr == (byte*)Marshal.UnsafeAddrOfPinnedArrayElement((byte[])holder, 0),
- "The buffer moved during a [....] call!");
+ "The buffer moved during a sync call!");
CancelSyncOperation(ref holder);
return true;
@@ -333,7 +333,7 @@ namespace System.ServiceModel.Channels
byte* ptr = this.bufferPtr;
if (ptr == null)
{
-#pragma warning suppress 56503 // [....], not a publicly accessible API
+#pragma warning suppress 56503 // Microsoft, not a publicly accessible API
throw Fx.AssertAndThrow("Pointer requested while no operation pending or no buffer provided.");
}
return ptr;
@@ -348,7 +348,7 @@ namespace System.ServiceModel.Channels
NativeOverlapped* ptr = this.nativeOverlapped;
if (ptr == null)
{
-#pragma warning suppress 56503 // [....], not a publicly accessible API
+#pragma warning suppress 56503 // Microsoft, not a publicly accessible API
throw Fx.AssertAndThrow("NativeOverlapped pointer requested after it was freed.");
}
return ptr;
@@ -446,14 +446,14 @@ namespace System.ServiceModel.Channels
Fx.Assert(pThis.bufferPtr == null || pThis.bufferPtr == (byte*)Marshal.UnsafeAddrOfPinnedArrayElement((byte[])pThis.bufferHolder[0], 0),
"Buffer moved during synchronous deferred cleanup!");
- Fx.Assert(pThis.syncOperationPending, "OverlappedContext.CleanupCallback called with no [....] operation pending.");
+ Fx.Assert(pThis.syncOperationPending, "OverlappedContext.CleanupCallback called with no sync operation pending.");
pThis.pinnedTarget = null;
pThis.rootedHolder.EventHolder.Close();
Overlapped.Free(pThis.nativeOverlapped);
}
// This class is always held onto (rooted) by the packed Overlapped. The OverlappedContext instance moves itself in and out of
- // this object to root itself. It's also used to root the ManualResetEvent during [....] operations.
+ // this object to root itself. It's also used to root the ManualResetEvent during sync operations.
// It needs to be an IAsyncResult since that's what Overlapped takes.
class RootedHolder : IAsyncResult
{
@@ -493,7 +493,7 @@ namespace System.ServiceModel.Channels
{
get
{
-#pragma warning suppress 56503 // [....], not a publicly accessible API
+#pragma warning suppress 56503 // Microsoft, not a publicly accessible API
throw Fx.AssertAndThrow("RootedHolder.AsyncState called.");
}
}
@@ -502,7 +502,7 @@ namespace System.ServiceModel.Channels
{
get
{
-#pragma warning suppress 56503 // [....], not a publicly accessible API
+#pragma warning suppress 56503 // Microsoft, not a publicly accessible API
throw Fx.AssertAndThrow("RootedHolder.AsyncWaitHandle called.");
}
}
@@ -511,7 +511,7 @@ namespace System.ServiceModel.Channels
{
get
{
-#pragma warning suppress 56503 // [....], not a publicly accessible API
+#pragma warning suppress 56503 // Microsoft, not a publicly accessible API
throw Fx.AssertAndThrow("RootedHolder.CompletedSynchronously called.");
}
}
@@ -520,7 +520,7 @@ namespace System.ServiceModel.Channels
{
get
{
-#pragma warning suppress 56503 // [....], not a publicly accessible API
+#pragma warning suppress 56503 // Microsoft, not a publicly accessible API
throw Fx.AssertAndThrow("RootedHolder.IsCompleted called.");
}
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerCustomResolverBindingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerCustomResolverBindingElement.cs
index a9e8a8ea0ef..00ba45b8759 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerCustomResolverBindingElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerCustomResolverBindingElement.cs
@@ -52,7 +52,7 @@ namespace System.ServiceModel.Channels
if (context == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context"));
-#pragma warning suppress 56506 // [....], context.BindingParameters is never null
+#pragma warning suppress 56506 // Microsoft, context.BindingParameters is never null
credentials = context.BindingParameters.Find<ClientCredentials>();
}
public override T GetProperty<T>(System.ServiceModel.Channels.BindingContext context)
@@ -110,7 +110,7 @@ namespace System.ServiceModel.Channels
if (context == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context"));
-#pragma warning suppress 56506 // [....], context.BindingParameters is never null
+#pragma warning suppress 56506 // Microsoft, context.BindingParameters is never null
context.BindingParameters.Add(this);
credentials = context.BindingParameters.Find<ClientCredentials>();
return context.BuildInnerChannelFactory<TChannel>();
@@ -120,7 +120,7 @@ namespace System.ServiceModel.Channels
{
if (context == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context"));
-#pragma warning suppress 56506 // [....], context.BindingParameters is never null
+#pragma warning suppress 56506 // Microsoft, context.BindingParameters is never null
this.credentials = context.BindingParameters.Find<ClientCredentials>();
context.BindingParameters.Add(this);
return context.CanBuildInnerChannelFactory<TChannel>();
@@ -131,7 +131,7 @@ namespace System.ServiceModel.Channels
if (context == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context"));
-#pragma warning suppress 56506 // [....], context.BindingParameters is never null
+#pragma warning suppress 56506 // Microsoft, context.BindingParameters is never null
context.BindingParameters.Add(this);
this.credentials = context.BindingParameters.Find<ClientCredentials>();
return context.BuildInnerChannelListener<TChannel>();
@@ -141,7 +141,7 @@ namespace System.ServiceModel.Channels
{
if (context == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context"));
-#pragma warning suppress 56506 // [....], context.BindingParameters is never null
+#pragma warning suppress 56506 // Microsoft, context.BindingParameters is never null
this.credentials = context.BindingParameters.Find<ClientCredentials>();
context.BindingParameters.Add(this);
return context.CanBuildInnerChannelListener<TChannel>();
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerFlooder.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerFlooder.cs
index b3866971e7a..9559bfb66a9 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerFlooder.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerFlooder.cs
@@ -938,7 +938,7 @@ namespace System.ServiceModel.Channels
//this is the callback routine for async completion on channel BeginSend() operations.
- //if we are done, simply return. This can happen if user called [....] EndX.
+ //if we are done, simply return. This can happen if user called sync EndX.
//if the flooder is still processing BeginSend(), then we probably cant complete. In this case, add the result to pending and return
//main thread will flush the pending completions in MarkEnd().
//otherwise, call EndX on the result and remove it from results.
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerNeighborManager.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerNeighborManager.cs
index 0ae8268e7fc..1698d27888b 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerNeighborManager.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerNeighborManager.cs
@@ -1635,7 +1635,7 @@ namespace System.ServiceModel.Channels
throw;
}
- // Indicate [....] completion to the caller
+ // Indicate sync completion to the caller
if (result.CompletedSynchronously)
base.Complete(true);
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PipeConnection.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PipeConnection.cs
index ee3fbc127a7..9b1f4f0e003 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PipeConnection.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PipeConnection.cs
@@ -799,7 +799,7 @@ namespace System.ServiceModel.Channels
ulong GetServerPid()
{
ulong id;
-#pragma warning suppress 56523 // [....], Win32Exception ctor calls Marshal.GetLastWin32Error()
+#pragma warning suppress 56523 // Microsoft, Win32Exception ctor calls Marshal.GetLastWin32Error()
if (!UnsafeNativeMethods.GetNamedPipeServerProcessId(pipe, out id))
{
Win32Exception e = new Win32Exception();
@@ -811,7 +811,7 @@ namespace System.ServiceModel.Channels
ulong GetClientPid()
{
ulong id;
-#pragma warning suppress 56523 // [....], Win32Exception ctor calls Marshal.GetLastWin32Error()
+#pragma warning suppress 56523 // Microsoft, Win32Exception ctor calls Marshal.GetLastWin32Error()
if (!UnsafeNativeMethods.GetNamedPipeServerProcessId(pipe, out id))
{
Win32Exception e = new Win32Exception();
@@ -886,7 +886,7 @@ namespace System.ServiceModel.Channels
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(ConvertPipeException(e, TransferOperation.Read));
}
}
-#pragma warning suppress 56500 // [....], transferring exception to caller
+#pragma warning suppress 56500 // Microsoft, transferring exception to caller
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -956,7 +956,7 @@ namespace System.ServiceModel.Channels
throw DiagnosticUtility.ExceptionUtility.ThrowHelper(ConvertPipeException(e, TransferOperation.Write), ExceptionEventType);
}
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -2315,7 +2315,7 @@ namespace System.ServiceModel.Channels
}
}
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ReliableChannelBinder.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ReliableChannelBinder.cs
index 74d844b0198..4bb39e2fc33 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ReliableChannelBinder.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ReliableChannelBinder.cs
@@ -1743,6 +1743,12 @@ namespace System.ServiceModel.Channels
bool RemoveWaiter(IWaiter waiter)
{
Queue<IWaiter> waiters = waiter.CanGetChannel ? this.getChannelQueue : this.waitQueue;
+
+ if (waiters == null)
+ {
+ return false;
+ }
+
bool removed = false;
lock (this.ThisLock)
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ReplyChannel.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ReplyChannel.cs
index 3f258f1641f..58c50c38a0f 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ReplyChannel.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ReplyChannel.cs
@@ -129,7 +129,7 @@ namespace System.ServiceModel.Channels
{
thisPtr.HandleReceiveRequestComplete(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/RequestChannel.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/RequestChannel.cs
index 687c24254c5..f6e2de5fec7 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/RequestChannel.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/RequestChannel.cs
@@ -415,7 +415,7 @@ namespace System.ServiceModel.Channels
}
thisPtr.CleanupEvents();
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/RequestContextBase.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/RequestContextBase.cs
index f062f22e9a0..269367ec443 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/RequestContextBase.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/RequestContextBase.cs
@@ -45,7 +45,7 @@ namespace System.ServiceModel.Channels
{
if (this.requestMessageException != null)
{
-#pragma warning suppress 56503 // [....], see outcome of DCR 50092
+#pragma warning suppress 56503 // Microsoft, see outcome of DCR 50092
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(this.requestMessageException);
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SecurityBindingElementImporter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SecurityBindingElementImporter.cs
index 4a140246430..e71c0e84951 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SecurityBindingElementImporter.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SecurityBindingElementImporter.cs
@@ -349,7 +349,7 @@ namespace System.ServiceModel.Channels
// normalize protection level settings at the operation scope if possible to help avoid typed message generation
if (hasProtectionLevel && isProtectionLevelUniform)
{
- // ([....]) remove the foreach message here
+ // (Microsoft) remove the foreach message here
// foreach (MessageDescription message in operation.Messages)
this.ResetProtectionLevelForMessages(operation);
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ServiceChannelProxy.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ServiceChannelProxy.cs
index d2551e9e314..8469527bec0 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ServiceChannelProxy.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ServiceChannelProxy.cs
@@ -765,7 +765,7 @@ namespace System.ServiceModel.Channels
{
get
{
-#pragma warning suppress 56503 // [....], IEnumerator guidelines, Current throws exception before calling MoveNext
+#pragma warning suppress 56503 // Microsoft, IEnumerator guidelines, Current throws exception before calling MoveNext
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.SFxDictionaryIsEmpty)));
}
}
@@ -778,7 +778,7 @@ namespace System.ServiceModel.Channels
{
get
{
-#pragma warning suppress 56503 // [....], IEnumerator guidelines, Current throws exception before calling MoveNext
+#pragma warning suppress 56503 // Microsoft, IEnumerator guidelines, Current throws exception before calling MoveNext
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.SFxDictionaryIsEmpty)));
}
}
@@ -787,7 +787,7 @@ namespace System.ServiceModel.Channels
{
get
{
-#pragma warning suppress 56503 // [....], IEnumerator guidelines, Current throws exception before calling MoveNext
+#pragma warning suppress 56503 // Microsoft, IEnumerator guidelines, Current throws exception before calling MoveNext
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.SFxDictionaryIsEmpty)));
}
}
@@ -796,7 +796,7 @@ namespace System.ServiceModel.Channels
{
get
{
-#pragma warning suppress 56503 // [....], IEnumerator guidelines, Current throws exception before calling MoveNext
+#pragma warning suppress 56503 // Microsoft, IEnumerator guidelines, Current throws exception before calling MoveNext
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.SFxDictionaryIsEmpty)));
}
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SessionConnectionReader.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SessionConnectionReader.cs
index 71a06c030bf..62fff724ff7 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SessionConnectionReader.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SessionConnectionReader.cs
@@ -1465,7 +1465,7 @@ namespace System.ServiceModel.Channels
}
}
}
-#pragma warning suppress 56500 // [....], transferring exception to caller
+#pragma warning suppress 56500 // Microsoft, transferring exception to caller
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SharedConnectionListener.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SharedConnectionListener.cs
index 6a655ad2665..81daac42994 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SharedConnectionListener.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SharedConnectionListener.cs
@@ -778,22 +778,20 @@ namespace System.ServiceModel.Channels
CompletedAsyncResult<bool>.End(completedResult);
}
- using (LockHelper.TakeReaderLock(this.readerWriterLock))
+ bool isClosed = !closed;
+ try
{
- try
+ return ValidateUriRouteAsyncResult.End(result);
+ }
+ catch (Exception exception)
+ {
+ if (Fx.IsFatal(exception) || !isClosed)
{
- return ValidateUriRouteAsyncResult.End(result);
+ throw;
}
- catch (Exception exception)
- {
- if (Fx.IsFatal(exception) || !closed)
- {
- throw;
- }
- DiagnosticUtility.TraceHandledException(exception, TraceEventType.Error);
- return false;
- }
+ DiagnosticUtility.TraceHandledException(exception, TraceEventType.Error);
+ return false;
}
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SingletonConnectionReader.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SingletonConnectionReader.cs
index 5660eb1b93b..4cb52f57980 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SingletonConnectionReader.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SingletonConnectionReader.cs
@@ -595,7 +595,7 @@ namespace System.ServiceModel.Channels
if (!upgradeAsyncResult.CompletedSynchronously)
{
- upgradeAsyncResult = null; //caller shouldn't use this out param unless completed [....].
+ upgradeAsyncResult = null; //caller shouldn't use this out param unless completed sync.
return false;
}
@@ -1295,7 +1295,7 @@ namespace System.ServiceModel.Channels
{
thisPtr.message = thisPtr.parent.Receive(thisPtr.timeout);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception exception)
{
if (Fx.IsFatal(exception))
@@ -1892,7 +1892,7 @@ namespace System.ServiceModel.Channels
completeSelf = thisPtr.HandleWriteStartBytes();
throwing = false;
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -1928,7 +1928,7 @@ namespace System.ServiceModel.Channels
completeSelf = thisPtr.HandleWriteBufferedMessage();
throwing = false;
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -1963,7 +1963,7 @@ namespace System.ServiceModel.Channels
completeSelf = thisPtr.HandleWriteEndBytes();
success = true;
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SocketConnection.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SocketConnection.cs
index 2a57b0bdbf5..989fda614a0 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SocketConnection.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SocketConnection.cs
@@ -27,9 +27,16 @@ namespace System.ServiceModel.Channels
// common state
Socket socket;
- TimeSpan sendTimeout;
+ TimeSpan asyncSendTimeout;
TimeSpan readFinTimeout;
- TimeSpan receiveTimeout;
+ TimeSpan asyncReceiveTimeout;
+
+ // Socket.SendTimeout/Socket.ReceiveTimeout only work with the synchronous API calls and therefore they
+ // do not get updated when asynchronous Send/Read operations are performed. In order to make sure we
+ // Set the proper timeouts on the Socket itself we need to keep these two additional fields.
+ TimeSpan socketSyncSendTimeout;
+ TimeSpan socketSyncReceiveTimeout;
+
CloseState closeState;
bool isShutdown;
bool noDelay = false;
@@ -83,7 +90,8 @@ namespace System.ServiceModel.Channels
this.readBuffer = this.connectionBufferPool.Take();
this.asyncReadBufferSize = this.readBuffer.Length;
this.socket.SendBufferSize = this.socket.ReceiveBufferSize = this.asyncReadBufferSize;
- this.sendTimeout = this.receiveTimeout = TimeSpan.MaxValue;
+ this.asyncSendTimeout = this.asyncReceiveTimeout = TimeSpan.MaxValue;
+ this.socketSyncSendTimeout = this.socketSyncReceiveTimeout = TimeSpan.MaxValue;
this.remoteEndpoint = null;
@@ -147,7 +155,7 @@ namespace System.ServiceModel.Channels
// will never be a timeout error, so TimeSpan.Zero is ok
#pragma warning suppress 56503 // Called from Receive path, SocketConnection cannot allow a SocketException to escape.
throw DiagnosticUtility.ExceptionUtility.ThrowHelper(
- ConvertReceiveException(socketException, TimeSpan.Zero), ExceptionEventType);
+ ConvertReceiveException(socketException, TimeSpan.Zero, TimeSpan.Zero), ExceptionEventType);
}
catch (ObjectDisposedException objectDisposedException)
{
@@ -241,14 +249,14 @@ namespace System.ServiceModel.Channels
static void OnReceiveTimeout(object state)
{
SocketConnection thisPtr = (SocketConnection)state;
- thisPtr.Abort(SR.GetString(SR.SocketAbortedReceiveTimedOut, thisPtr.receiveTimeout), TransferOperation.Read);
+ thisPtr.Abort(SR.GetString(SR.SocketAbortedReceiveTimedOut, thisPtr.asyncReceiveTimeout), TransferOperation.Read);
}
static void OnSendTimeout(object state)
{
SocketConnection thisPtr = (SocketConnection)state;
thisPtr.Abort(TraceEventType.Warning,
- SR.GetString(SR.SocketAbortedSendTimedOut, thisPtr.sendTimeout), TransferOperation.Write);
+ SR.GetString(SR.SocketAbortedSendTimedOut, thisPtr.asyncSendTimeout), TransferOperation.Write);
}
static void OnReceiveCompleted(IAsyncResult result)
@@ -559,7 +567,7 @@ namespace System.ServiceModel.Channels
catch (SocketException socketException)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelper(
- ConvertSendException(socketException, TimeSpan.MaxValue), ExceptionEventType);
+ ConvertSendException(socketException, TimeSpan.MaxValue, this.socketSyncSendTimeout), ExceptionEventType);
}
catch (ObjectDisposedException objectDisposedException)
{
@@ -670,15 +678,15 @@ namespace System.ServiceModel.Channels
return CompletedAsyncResult<bool>.End(result);
}
- Exception ConvertSendException(SocketException socketException, TimeSpan remainingTime)
+ Exception ConvertSendException(SocketException socketException, TimeSpan remainingTime, TimeSpan timeout)
{
- return ConvertTransferException(socketException, this.sendTimeout, socketException,
+ return ConvertTransferException(socketException, timeout, socketException,
TransferOperation.Write, this.aborted, this.timeoutErrorString, this.timeoutErrorTransferOperation, this, remainingTime);
}
- Exception ConvertReceiveException(SocketException socketException, TimeSpan remainingTime)
+ Exception ConvertReceiveException(SocketException socketException, TimeSpan remainingTime, TimeSpan timeout)
{
- return ConvertTransferException(socketException, this.receiveTimeout, socketException,
+ return ConvertTransferException(socketException, timeout, socketException,
TransferOperation.Read, this.aborted, this.timeoutErrorString, this.timeoutErrorTransferOperation, this, remainingTime);
}
@@ -879,7 +887,7 @@ namespace System.ServiceModel.Channels
catch (SocketException socketException)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelper(
- ConvertSendException(socketException, TimeSpan.MaxValue), ExceptionEventType);
+ ConvertSendException(socketException, TimeSpan.MaxValue, this.asyncSendTimeout), ExceptionEventType);
}
catch (ObjectDisposedException objectDisposedException)
{
@@ -939,9 +947,9 @@ namespace System.ServiceModel.Channels
}
catch (SocketException socketException)
{
- this.asyncWriteException = ConvertSendException(socketException, TimeSpan.MaxValue);
+ this.asyncWriteException = ConvertSendException(socketException, TimeSpan.MaxValue, this.asyncSendTimeout);
}
-#pragma warning suppress 56500 // [....], transferring exception to caller
+#pragma warning suppress 56500 // Microsoft, transferring exception to caller
catch (Exception exception)
{
if (Fx.IsFatal(exception))
@@ -1038,7 +1046,7 @@ namespace System.ServiceModel.Channels
catch (SocketException socketException)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelper(
- ConvertSendException(socketException, timeoutHelper.RemainingTime()), ExceptionEventType);
+ ConvertSendException(socketException, timeoutHelper.RemainingTime(), this.socketSyncSendTimeout), ExceptionEventType);
}
catch (ObjectDisposedException objectDisposedException)
{
@@ -1102,7 +1110,7 @@ namespace System.ServiceModel.Channels
catch (SocketException socketException)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelper(
- ConvertReceiveException(socketException, timeoutHelper.RemainingTime()), ExceptionEventType);
+ ConvertReceiveException(socketException, timeoutHelper.RemainingTime(), this.socketSyncReceiveTimeout), ExceptionEventType);
}
catch (ObjectDisposedException objectDisposedException)
{
@@ -1199,7 +1207,7 @@ namespace System.ServiceModel.Channels
}
catch (SocketException socketException)
{
- throw DiagnosticUtility.ExceptionUtility.ThrowHelper(ConvertReceiveException(socketException, TimeSpan.MaxValue), ExceptionEventType);
+ throw DiagnosticUtility.ExceptionUtility.ThrowHelper(ConvertReceiveException(socketException, TimeSpan.MaxValue, this.asyncReceiveTimeout), ExceptionEventType);
}
catch (ObjectDisposedException objectDisposedException)
{
@@ -1268,13 +1276,13 @@ namespace System.ServiceModel.Channels
}
catch (SocketException socketException)
{
- this.asyncReadException = ConvertReceiveException(socketException, TimeSpan.MaxValue);
+ this.asyncReadException = ConvertReceiveException(socketException, TimeSpan.MaxValue, this.asyncReceiveTimeout);
}
catch (ObjectDisposedException objectDisposedException)
{
this.asyncReadException = ConvertObjectDisposedException(objectDisposedException, TransferOperation.Read);
}
-#pragma warning suppress 56500 // [....], transferring exception to caller
+#pragma warning suppress 56500 // Microsoft, transferring exception to caller
catch (Exception exception)
{
if (Fx.IsFatal(exception))
@@ -1304,9 +1312,9 @@ namespace System.ServiceModel.Channels
}
catch (SocketException socketException)
{
- asyncReadException = ConvertReceiveException(socketException, TimeSpan.MaxValue);
+ asyncReadException = ConvertReceiveException(socketException, TimeSpan.MaxValue, this.asyncReceiveTimeout);
}
-#pragma warning suppress 56500 // [....], transferring exception to caller
+#pragma warning suppress 56500 // Microsoft, transferring exception to caller
catch (Exception exception)
{
if (Fx.IsFatal(exception))
@@ -1429,7 +1437,7 @@ namespace System.ServiceModel.Channels
new TimeoutException(SR.GetString(SR.TcpConnectionTimedOut, timeout)), ExceptionEventType);
}
- if (UpdateTimeout(this.receiveTimeout, timeout))
+ if (ShouldUpdateTimeout(this.socketSyncReceiveTimeout, timeout))
{
lock (ThisLock)
{
@@ -1439,12 +1447,12 @@ namespace System.ServiceModel.Channels
}
this.socket.ReceiveTimeout = TimeoutHelper.ToMilliseconds(timeout);
}
- this.receiveTimeout = timeout;
+ this.socketSyncReceiveTimeout = timeout;
}
}
else
{
- this.receiveTimeout = timeout;
+ this.asyncReceiveTimeout = timeout;
if (timeout == TimeSpan.MaxValue)
{
CancelReceiveTimer();
@@ -1469,19 +1477,19 @@ namespace System.ServiceModel.Channels
new TimeoutException(SR.GetString(SR.TcpConnectionTimedOut, timeout)), ExceptionEventType);
}
- if (UpdateTimeout(this.sendTimeout, timeout))
+ if (ShouldUpdateTimeout(this.socketSyncSendTimeout, timeout))
{
lock (ThisLock)
{
ThrowIfNotOpen();
this.socket.SendTimeout = TimeoutHelper.ToMilliseconds(timeout);
}
- this.sendTimeout = timeout;
+ this.socketSyncSendTimeout = timeout;
}
}
else
{
- this.sendTimeout = timeout;
+ this.asyncSendTimeout = timeout;
if (timeout == TimeSpan.MaxValue)
{
CancelSendTimer();
@@ -1493,7 +1501,7 @@ namespace System.ServiceModel.Channels
}
}
- bool UpdateTimeout(TimeSpan oldTimeout, TimeSpan newTimeout)
+ bool ShouldUpdateTimeout(TimeSpan oldTimeout, TimeSpan newTimeout)
{
if (oldTimeout == newTimeout)
{
@@ -1927,7 +1935,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = thisPtr.StartConnect();
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -2234,7 +2242,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = thisPtr.StartAccept();
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SslStreamSecurityBindingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SslStreamSecurityBindingElement.cs
index baf6e2dfdbf..957aefd915a 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SslStreamSecurityBindingElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SslStreamSecurityBindingElement.cs
@@ -89,7 +89,7 @@ namespace System.ServiceModel.Channels
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context");
}
-#pragma warning suppress 56506 // [....], BindingContext.BindingParameters cannot be null
+#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters cannot be null
context.BindingParameters.Add(this);
return context.BuildInnerChannelFactory<TChannel>();
}
@@ -101,7 +101,7 @@ namespace System.ServiceModel.Channels
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context");
}
-#pragma warning suppress 56506 // [....], BindingContext.BindingParameters cannot be null
+#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters cannot be null
context.BindingParameters.Add(this);
return context.CanBuildInnerChannelFactory<TChannel>();
}
@@ -113,7 +113,7 @@ namespace System.ServiceModel.Channels
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context");
}
-#pragma warning suppress 56506 // [....], BindingContext.BindingParameters cannot be null
+#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters cannot be null
context.BindingParameters.Add(this);
return context.BuildInnerChannelListener<TChannel>();
}
@@ -125,7 +125,7 @@ namespace System.ServiceModel.Channels
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context");
}
-#pragma warning suppress 56506 // [....], BindingContext.BindingParameters cannot be null
+#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters cannot be null
context.BindingParameters.Add(this);
return context.CanBuildInnerChannelListener<TChannel>();
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SslStreamSecurityUpgradeProvider.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SslStreamSecurityUpgradeProvider.cs
index a675b39930a..a9761c4dcab 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SslStreamSecurityUpgradeProvider.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SslStreamSecurityUpgradeProvider.cs
@@ -439,7 +439,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = this.HandleOpenAuthenticatorComplete(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -470,7 +470,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = this.HandleOpenTokenProviderComplete(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -501,7 +501,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = this.HandleGetTokenComplete(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -532,7 +532,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = this.HandleCloseTokenProviderComplete(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -1142,7 +1142,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = this.HandleBaseOpenComplete(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -1173,7 +1173,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = this.HandleOpenTokenProviderComplete(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -1204,7 +1204,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = this.HandleGetTokenComplete(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -1294,7 +1294,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = this.HandleBaseCloseComplete(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -1324,7 +1324,7 @@ namespace System.ServiceModel.Channels
{
SecurityUtils.EndCloseTokenProviderIfRequired(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StandardBindingImporter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StandardBindingImporter.cs
index 55a2020f77e..364205eab36 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StandardBindingImporter.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StandardBindingImporter.cs
@@ -21,7 +21,7 @@ namespace System.ServiceModel.Channels
if (endpointContext == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("endpointContext");
-#pragma warning suppress 56506 // [....], endpointContext.Endpoint is never null
+#pragma warning suppress 56506 // Microsoft, endpointContext.Endpoint is never null
if (endpointContext.Endpoint.Binding == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("endpointContext.Binding");
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamSecurityUpgradeAcceptorAsyncResult.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamSecurityUpgradeAcceptorAsyncResult.cs
index fb32637e265..f045513e285 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamSecurityUpgradeAcceptorAsyncResult.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamSecurityUpgradeAcceptorAsyncResult.cs
@@ -90,7 +90,7 @@ namespace System.ServiceModel.Channels
{
acceptUpgradeAsyncResult.CompleteAuthenticateAsServer(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamSecurityUpgradeInitiatorAsyncResult.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamSecurityUpgradeInitiatorAsyncResult.cs
index 5d18a8df17e..37d443c87cf 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamSecurityUpgradeInitiatorAsyncResult.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamSecurityUpgradeInitiatorAsyncResult.cs
@@ -93,7 +93,7 @@ namespace System.ServiceModel.Channels
{
thisPtr.CompleteAuthenticateAsClient(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamedFramingRequestChannel.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamedFramingRequestChannel.cs
index fc5e285e288..ccfc53f4304 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamedFramingRequestChannel.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamedFramingRequestChannel.cs
@@ -348,7 +348,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = thisPtr.HandleWritePreamble();
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -377,7 +377,7 @@ namespace System.ServiceModel.Channels
thisPtr.connection.EndWrite();
completeSelf = thisPtr.ReadPreambleAck();
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -405,7 +405,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = thisPtr.HandlePreambleAck();
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -438,7 +438,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = thisPtr.HandleUpgrade(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -470,7 +470,7 @@ namespace System.ServiceModel.Channels
{
ConnectionUpgradeHelper.EndDecodeFramingFault(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -763,7 +763,7 @@ namespace System.ServiceModel.Channels
completeSelf = thisPtr.HandleEstablishConnection(result);
throwing = false;
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -805,7 +805,7 @@ namespace System.ServiceModel.Channels
completeSelf = thisPtr.HandleWriteMessage(result);
throwing = false;
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -842,7 +842,7 @@ namespace System.ServiceModel.Channels
completeSelf = thisPtr.CompleteReceiveReply(result);
throwing = false;
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SynchronizedMessageSource.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SynchronizedMessageSource.cs
index 99380758425..91df25a657b 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SynchronizedMessageSource.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SynchronizedMessageSource.cs
@@ -176,7 +176,7 @@ namespace System.ServiceModel.Channels
thisPtr.exitLock = true;
completeSelf = thisPtr.PerformOperation(thisPtr.timeoutHelper.RemainingTime());
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -225,7 +225,7 @@ namespace System.ServiceModel.Channels
{
thisPtr.SetReturnValue(thisPtr.Source.EndReceive());
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -270,7 +270,7 @@ namespace System.ServiceModel.Channels
{
thisPtr.SetReturnValue(thisPtr.Source.EndWaitForMessage());
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportBindingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportBindingElement.cs
index c1727702b66..799f5ba415c 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportBindingElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportBindingElement.cs
@@ -117,7 +117,7 @@ namespace System.ServiceModel.Channels
// to cover all our bases, let's iterate through the BindingParameters to make sure
// we haven't missed a query (since we're the Transport and we're at the bottom)
-#pragma warning suppress 56506 // [....], BindingContext.BindingParameters cannot be null
+#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters cannot be null
Collection<BindingElement> bindingElements = context.BindingParameters.FindAll<BindingElement>();
T result = default(T);
@@ -154,7 +154,7 @@ namespace System.ServiceModel.Channels
internal ChannelProtectionRequirements GetProtectionRequirements(BindingContext context)
{
AddressingVersion addressingVersion = AddressingVersion.WSAddressing10;
-#pragma warning suppress 56506 // [....], CustomBinding.Elements can never be null
+#pragma warning suppress 56506 // Microsoft, CustomBinding.Elements can never be null
MessageEncodingBindingElement messageEncoderBindingElement = context.Binding.Elements.Find<MessageEncodingBindingElement>();
if (messageEncoderBindingElement != null)
{
@@ -183,7 +183,7 @@ namespace System.ServiceModel.Channels
}
// Set SoapBinding Transport URI
-#pragma warning suppress 56506 // [....], these properties cannot be null in this context
+#pragma warning suppress 56506 // Microsoft, these properties cannot be null in this context
BindingElementCollection bindingElements = endpointContext.Endpoint.Binding.CreateBindingElements();
if (wsdlTransportUri != null)
{
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportBindingElementImporter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportBindingElementImporter.cs
index 3cd450b6d5c..9e6b90657f3 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportBindingElementImporter.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportBindingElementImporter.cs
@@ -36,20 +36,20 @@ namespace System.ServiceModel.Channels
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context");
}
-#pragma warning suppress 56506 // [....], these properties cannot be null in this context
+#pragma warning suppress 56506 // Microsoft, these properties cannot be null in this context
if (context.Endpoint.Binding == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context.Endpoint.Binding");
}
-#pragma warning suppress 56506 // [....], CustomBinding.Elements never be null
+#pragma warning suppress 56506 // Microsoft, CustomBinding.Elements never be null
TransportBindingElement transportBindingElement = GetBindingElements(context).Find<TransportBindingElement>();
bool transportHandledExternaly = (transportBindingElement != null) && !StateHelper.IsRegisteredTransportBindingElement(importer, context);
if (transportHandledExternaly)
return;
-#pragma warning suppress 56506 // [....], these properties cannot be null in this context
+#pragma warning suppress 56506 // Microsoft, these properties cannot be null in this context
WsdlNS.SoapBinding soapBinding = (WsdlNS.SoapBinding)context.WsdlBinding.Extensions.Find(typeof(WsdlNS.SoapBinding));
if (soapBinding != null && transportBindingElement == null)
{
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportDuplexSessionChannel.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportDuplexSessionChannel.cs
index ec077721918..d0a75974cbc 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportDuplexSessionChannel.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportDuplexSessionChannel.cs
@@ -739,7 +739,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = thisPtr.HandleCloseOutputSession(result, false);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -771,7 +771,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = thisPtr.HandleCloseInputSession(result, false);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -937,7 +937,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = thisPtr.WriteEndBytes();
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -965,7 +965,7 @@ namespace System.ServiceModel.Channels
{
thisPtr.HandleWriteEndBytesComplete();
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -1105,7 +1105,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = thisPtr.WriteCore();
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -1133,7 +1133,7 @@ namespace System.ServiceModel.Channels
{
thisPtr.channel.FinishWritingMessage();
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -1290,7 +1290,7 @@ namespace System.ServiceModel.Channels
DiagnosticUtility.TraceHandledException(e, TraceEventType.Information);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportManager.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportManager.cs
index aedfcbdd37c..5bf91cc0194 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportManager.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportManager.cs
@@ -345,7 +345,7 @@ namespace System.ServiceModel.Channels
{
this.OnScheduled(this.parent);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportSecurityHelpers.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportSecurityHelpers.cs
index 3abbf4e36ed..84154efa76a 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportSecurityHelpers.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportSecurityHelpers.cs
@@ -606,7 +606,7 @@ namespace System.ServiceModel.Channels
{
thisPtr.CompleteGetToken(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -700,7 +700,7 @@ namespace System.ServiceModel.Channels
{
thisPtr.CompleteGetToken(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/UnsafeNativeMethods.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/UnsafeNativeMethods.cs
index 275270b401c..1ace36ecf50 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/UnsafeNativeMethods.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/UnsafeNativeMethods.cs
@@ -1203,7 +1203,7 @@ namespace System.ServiceModel.Channels
internal int GetClientPid()
{
int pid;
-#pragma warning suppress 56523 // [....], Win32Exception ctor calls Marshal.GetLastWin32Error()
+#pragma warning suppress 56523 // Microsoft, Win32Exception ctor calls Marshal.GetLastWin32Error()
bool success = UnsafeNativeMethods.GetNamedPipeClientProcessId(this, out pid);
if (!success)
{
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/UriPrefixTable.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/UriPrefixTable.cs
index 71549cd703b..4795a09177b 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/UriPrefixTable.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/UriPrefixTable.cs
@@ -56,7 +56,7 @@ namespace System.ServiceModel.Channels
{
// The UriPrefixTable instance itself is used as a
// synchronization primitive in the TransportManagers and the
- // TransportManagerContainers so we return 'this' to keep them in [....].
+ // TransportManagerContainers so we return 'this' to keep them in sync.
return this;
}
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/WindowsStreamSecurityBindingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/WindowsStreamSecurityBindingElement.cs
index 8f027c01ce9..e1f36707c02 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/WindowsStreamSecurityBindingElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/WindowsStreamSecurityBindingElement.cs
@@ -57,7 +57,7 @@ namespace System.ServiceModel.Channels
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context");
}
-#pragma warning suppress 56506 // [....], BindingContext.BindingParameters cannot be null
+#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters cannot be null
context.BindingParameters.Add(this);
return context.BuildInnerChannelFactory<TChannel>();
}
@@ -69,7 +69,7 @@ namespace System.ServiceModel.Channels
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context");
}
-#pragma warning suppress 56506 // [....], BindingContext.BindingParameters cannot be null
+#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters cannot be null
context.BindingParameters.Add(this);
return context.CanBuildInnerChannelFactory<TChannel>();
}
@@ -81,7 +81,7 @@ namespace System.ServiceModel.Channels
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context");
}
-#pragma warning suppress 56506 // [....], BindingContext.BindingParameters cannot be null
+#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters cannot be null
context.BindingParameters.Add(this);
return context.BuildInnerChannelListener<TChannel>();
}
@@ -93,7 +93,7 @@ namespace System.ServiceModel.Channels
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context");
}
-#pragma warning suppress 56506 // [....], BindingContext.BindingParameters cannot be null
+#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters cannot be null
context.BindingParameters.Add(this);
return context.CanBuildInnerChannelListener<TChannel>();
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/WindowsStreamSecurityUpgradeProvider.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/WindowsStreamSecurityUpgradeProvider.cs
index feaf5f1b1cf..441c80b91f1 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/WindowsStreamSecurityUpgradeProvider.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/WindowsStreamSecurityUpgradeProvider.cs
@@ -614,7 +614,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = this.HandleBaseOpenComplete(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -645,7 +645,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = this.HandleOpenTokenProviderComplete(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -676,7 +676,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = this.HandleGetSspiCredentialComplete(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -758,7 +758,7 @@ namespace System.ServiceModel.Channels
{
completeSelf = this.HandleBaseCloseComplete(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -788,7 +788,7 @@ namespace System.ServiceModel.Channels
{
SecurityUtils.EndCloseTokenProviderIfRequired(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ClientBase.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ClientBase.cs
index c969544ef04..9da24fb18bb 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ClientBase.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ClientBase.cs
@@ -376,7 +376,7 @@ namespace System.ServiceModel
}
else
{
-#pragma warning suppress 56503 // [....], We throw only for unknown exceptions.
+#pragma warning suppress 56503 // Microsoft, We throw only for unknown exceptions.
throw;
}
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/BinaryMessageEncodingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/BinaryMessageEncodingElement.cs
index 05db2a82948..94912a949e8 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/BinaryMessageEncodingElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/BinaryMessageEncodingElement.cs
@@ -63,7 +63,7 @@ namespace System.ServiceModel.Configuration
binding.MaxSessionSize = this.MaxSessionSize;
binding.MaxReadPoolSize = this.MaxReadPoolSize;
binding.MaxWritePoolSize = this.MaxWritePoolSize;
-#pragma warning suppress 56506 //[....]; base.ApplyConfiguration() checks for 'binding' being null
+#pragma warning suppress 56506 //Microsoft; base.ApplyConfiguration() checks for 'binding' being null
this.ReaderQuotas.ApplyConfiguration(binding.ReaderQuotas);
binding.CompressionFormat = this.CompressionFormat;
}
@@ -73,7 +73,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
BinaryMessageEncodingElement source = (BinaryMessageEncodingElement)from;
-#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null
+#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null
this.MaxSessionSize = source.MaxSessionSize;
this.MaxReadPoolSize = source.MaxReadPoolSize;
this.MaxWritePoolSize = source.MaxWritePoolSize;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CallbackDebugElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CallbackDebugElement.cs
index e9ffa4980f0..68aaa719233 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CallbackDebugElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CallbackDebugElement.cs
@@ -25,7 +25,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
CallbackDebugElement source = (CallbackDebugElement)from;
-#pragma warning suppress 56506 //[....]; base.CopyFrom() check for 'from' being null
+#pragma warning suppress 56506 //Microsoft; base.CopyFrom() check for 'from' being null
this.IncludeExceptionDetailInFaults = source.IncludeExceptionDetailInFaults;
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CallbackTimeoutsElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CallbackTimeoutsElement.cs
index c12e897d24b..e998b23a0fa 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CallbackTimeoutsElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CallbackTimeoutsElement.cs
@@ -29,7 +29,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
CallbackTimeoutsElement source = (CallbackTimeoutsElement)from;
-#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null
+#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null
this.TransactionTimeout = source.TransactionTimeout;
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ClientCredentialsElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ClientCredentialsElement.cs
index ca6fdc46366..71c11065ab4 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ClientCredentialsElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ClientCredentialsElement.cs
@@ -96,7 +96,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
ClientCredentialsElement source = (ClientCredentialsElement)from;
-#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null
+#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null
this.ClientCertificate.Copy(source.ClientCertificate);
this.ServiceCertificate.Copy(source.ServiceCertificate);
this.Windows.Copy(source.Windows);
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ClientViaElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ClientViaElement.cs
index 7c79bab3f26..33e4d36bd11 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ClientViaElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ClientViaElement.cs
@@ -25,7 +25,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
ClientViaElement source = (ClientViaElement)from;
-#pragma warning suppress 56506 //[....]; base.CopyFrom() check for 'from' being null
+#pragma warning suppress 56506 //Microsoft; base.CopyFrom() check for 'from' being null
this.ViaUri = source.ViaUri;
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CommonEndpointBehaviorElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CommonEndpointBehaviorElement.cs
index 6913327c252..d5220b39c01 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CommonEndpointBehaviorElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CommonEndpointBehaviorElement.cs
@@ -23,7 +23,7 @@ namespace System.ServiceModel.Configuration
{
if (!typeof(System.ServiceModel.Description.IEndpointBehavior).IsAssignableFrom(element.BehaviorType))
{
-#pragma warning disable 56506 //[....]; element.ElementInformation is guaranteed to be non-null(System.Configuration)
+#pragma warning disable 56506 //Microsoft; element.ElementInformation is guaranteed to be non-null(System.Configuration)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(SR.GetString(SR.ConfigInvalidCommonEndpointBehaviorType,
element.ConfigurationElementName,
typeof(System.ServiceModel.Description.IEndpointBehavior).FullName),
@@ -44,7 +44,7 @@ namespace System.ServiceModel.Configuration
{
if (!typeof(System.ServiceModel.Description.IEndpointBehavior).IsAssignableFrom(element.BehaviorType))
{
-#pragma warning disable 56506 //[....]; element.ElementInformation is guaranteed to be non-null(System.Configuration)
+#pragma warning disable 56506 //Microsoft; element.ElementInformation is guaranteed to be non-null(System.Configuration)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(SR.GetString(SR.ConfigInvalidCommonEndpointBehaviorType,
element.ConfigurationElementName,
typeof(System.ServiceModel.Description.IEndpointBehavior).FullName),
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CommonServiceBehaviorElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CommonServiceBehaviorElement.cs
index 963969c6d22..ab4e50ac044 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CommonServiceBehaviorElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CommonServiceBehaviorElement.cs
@@ -23,7 +23,7 @@ namespace System.ServiceModel.Configuration
{
if (!typeof(System.ServiceModel.Description.IServiceBehavior).IsAssignableFrom(element.BehaviorType))
{
-#pragma warning disable 56506 //[....]; element.ElementInformation is guaranteed to be non-null(System.Configuration)
+#pragma warning disable 56506 //Microsoft; element.ElementInformation is guaranteed to be non-null(System.Configuration)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(SR.GetString(SR.ConfigInvalidCommonServiceBehaviorType,
element.ConfigurationElementName,
typeof(System.ServiceModel.Description.IServiceBehavior).FullName),
@@ -44,7 +44,7 @@ namespace System.ServiceModel.Configuration
{
if (!typeof(System.ServiceModel.Description.IServiceBehavior).IsAssignableFrom(element.BehaviorType))
{
-#pragma warning disable 56506 //[....]; element.ElementInformation is guaranteed to be non-null(System.Configuration)
+#pragma warning disable 56506 //Microsoft; element.ElementInformation is guaranteed to be non-null(System.Configuration)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(SR.GetString(SR.ConfigInvalidCommonServiceBehaviorType,
element.ConfigurationElementName,
typeof(System.ServiceModel.Description.IServiceBehavior).FullName),
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CompositeDuplexElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CompositeDuplexElement.cs
index 8367bce3605..960392bb704 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CompositeDuplexElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CompositeDuplexElement.cs
@@ -35,7 +35,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
CompositeDuplexElement source = (CompositeDuplexElement)from;
-#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument
+#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument
this.ClientBaseAddress = source.ClientBaseAddress;
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ConnectionOrientedTransportElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ConnectionOrientedTransportElement.cs
index 40411ccbc5e..d9f93eff49d 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ConnectionOrientedTransportElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ConnectionOrientedTransportElement.cs
@@ -111,7 +111,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
ConnectionOrientedTransportElement source = (ConnectionOrientedTransportElement)from;
-#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument
+#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument
this.ConnectionBufferSize = source.ConnectionBufferSize;
this.HostNameComparisonMode = source.HostNameComparisonMode;
this.ChannelInitializationTimeout = source.ChannelInitializationTimeout;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/DataContractSerializerElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/DataContractSerializerElement.cs
index ac7dea53490..2997f320965 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/DataContractSerializerElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/DataContractSerializerElement.cs
@@ -38,7 +38,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
DataContractSerializerElement source = (DataContractSerializerElement)from;
-#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null
+#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null
this.IgnoreExtensionDataObject = source.IgnoreExtensionDataObject;
this.MaxItemsInObjectGraph = source.MaxItemsInObjectGraph;
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/EndpointBehaviorElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/EndpointBehaviorElement.cs
index 02733601e3c..4c079f993d6 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/EndpointBehaviorElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/EndpointBehaviorElement.cs
@@ -37,7 +37,7 @@ namespace System.ServiceModel.Configuration
}
if (!typeof(System.ServiceModel.Description.IEndpointBehavior).IsAssignableFrom(element.BehaviorType))
{
-#pragma warning disable 56506 //[....]; element.ElementInformation is guaranteed to be non-null(System.Configuration)
+#pragma warning disable 56506 //Microsoft; element.ElementInformation is guaranteed to be non-null(System.Configuration)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(SR.GetString(SR.ConfigInvalidEndpointBehaviorType,
element.ConfigurationElementName,
this.Name),
@@ -62,7 +62,7 @@ namespace System.ServiceModel.Configuration
}
if (!typeof(System.ServiceModel.Description.IEndpointBehavior).IsAssignableFrom(element.BehaviorType))
{
-#pragma warning disable 56506 //[....]; element.ElementInformation is guaranteed to be non-null(System.Configuration)
+#pragma warning disable 56506 //Microsoft; element.ElementInformation is guaranteed to be non-null(System.Configuration)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(SR.GetString(SR.ConfigInvalidEndpointBehaviorType,
element.ConfigurationElementName,
this.Name),
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/HttpTransportElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/HttpTransportElement.cs
index e8e8d211ebd..b3df15d6f1a 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/HttpTransportElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/HttpTransportElement.cs
@@ -211,7 +211,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
HttpTransportElement source = (HttpTransportElement)from;
-#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument
+#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument
this.AllowCookies = source.AllowCookies;
this.RequestInitializationTimeout = source.RequestInitializationTimeout;
this.AuthenticationScheme = source.AuthenticationScheme;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/HttpsTransportElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/HttpsTransportElement.cs
index 38d9700d506..5e54dbf2fbd 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/HttpsTransportElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/HttpsTransportElement.cs
@@ -30,7 +30,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
HttpsTransportElement source = (HttpsTransportElement)from;
-#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument
+#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument
this.RequireClientCertificate = source.RequireClientCertificate;
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IdentityElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IdentityElement.cs
index 50ed2a79999..e7ec1f86419 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IdentityElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IdentityElement.cs
@@ -111,7 +111,7 @@ namespace System.ServiceModel.Configuration
else if (identity is X509CertificateEndpointIdentity)
{
X509Certificate2Collection certs = ((X509CertificateEndpointIdentity)identity).Certificates;
-#pragma warning suppress 56506 //[....]; this.Certificate can never be null (underlying configuration system guarantees)
+#pragma warning suppress 56506 //Microsoft; this.Certificate can never be null (underlying configuration system guarantees)
this.Certificate.EncodedValue = Convert.ToBase64String(certs.Export(certs.Count == 1 ? X509ContentType.SerializedCert : X509ContentType.SerializedStore));
}
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IssuedTokenClientElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IssuedTokenClientElement.cs
index c12c1022c0f..7c925c490ee 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IssuedTokenClientElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IssuedTokenClientElement.cs
@@ -94,17 +94,17 @@ namespace System.ServiceModel.Configuration
this.MaxIssuedTokenCachingTime = from.MaxIssuedTokenCachingTime;
this.IssuedTokenRenewalThresholdPercentage = from.IssuedTokenRenewalThresholdPercentage;
-#pragma warning suppress 56506 //[....]; from.ElementInformation.Properties[ConfigurationStrings.LocalIssuerIssuedTokenParameters] can never be null (underlying configuration system guarantees)
+#pragma warning suppress 56506 //Microsoft; from.ElementInformation.Properties[ConfigurationStrings.LocalIssuerIssuedTokenParameters] can never be null (underlying configuration system guarantees)
if (PropertyValueOrigin.Default != from.ElementInformation.Properties[ConfigurationStrings.LocalIssuer].ValueOrigin)
{
this.LocalIssuer.Copy(from.LocalIssuer);
}
-#pragma warning suppress 56506 //[....]; from.ElementInformation.Properties[ConfigurationStrings.LocalIssuerChannelBehaviors] can never be null (underlying configuration system guarantees)
+#pragma warning suppress 56506 //Microsoft; from.ElementInformation.Properties[ConfigurationStrings.LocalIssuerChannelBehaviors] can never be null (underlying configuration system guarantees)
if (PropertyValueOrigin.Default != from.ElementInformation.Properties[ConfigurationStrings.LocalIssuerChannelBehaviors].ValueOrigin)
{
this.LocalIssuerChannelBehaviors = from.LocalIssuerChannelBehaviors;
}
-#pragma warning suppress 56506 //[....]; from.ElementInformation.Properties[ConfigurationStrings.IssuerChannelBehaviors] can never be null (underlying configuration system guarantees)
+#pragma warning suppress 56506 //Microsoft; from.ElementInformation.Properties[ConfigurationStrings.IssuerChannelBehaviors] can never be null (underlying configuration system guarantees)
if (PropertyValueOrigin.Default != from.ElementInformation.Properties[ConfigurationStrings.IssuerChannelBehaviors].ValueOrigin)
{
foreach (IssuedTokenClientBehaviorsElement element in from.IssuerChannelBehaviors)
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IssuedTokenServiceElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IssuedTokenServiceElement.cs
index 426a9ae19b9..5d7544aeba6 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IssuedTokenServiceElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IssuedTokenServiceElement.cs
@@ -114,7 +114,7 @@ namespace System.ServiceModel.Configuration
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("from");
}
this.SamlSerializerType = from.SamlSerializerType;
-#pragma warning suppress 56506 // [....]; ElementInformation is never null.
+#pragma warning suppress 56506 // Microsoft; ElementInformation is never null.
PropertyInformationCollection propertyInfo = from.ElementInformation.Properties;
if (propertyInfo[ConfigurationStrings.KnownCertificates].ValueOrigin != PropertyValueOrigin.Default)
{
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/MtomMessageEncodingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/MtomMessageEncodingElement.cs
index 8f40a13563e..6ad15c1e44d 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/MtomMessageEncodingElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/MtomMessageEncodingElement.cs
@@ -24,7 +24,7 @@ namespace System.ServiceModel.Configuration
binding.WriteEncoding = this.WriteEncoding;
binding.MaxReadPoolSize = this.MaxReadPoolSize;
binding.MaxWritePoolSize = this.MaxWritePoolSize;
-#pragma warning suppress 56506 //[....]; base.ApplyConfiguration() checks for 'binding' being null
+#pragma warning suppress 56506 //Microsoft; base.ApplyConfiguration() checks for 'binding' being null
this.ReaderQuotas.ApplyConfiguration(binding.ReaderQuotas);
binding.MaxBufferSize = this.MaxBufferSize;
}
@@ -39,7 +39,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
MtomMessageEncodingElement source = (MtomMessageEncodingElement)from;
-#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null
+#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null
this.MessageVersion = source.MessageVersion;
this.WriteEncoding = source.WriteEncoding;
this.MaxReadPoolSize = source.MaxReadPoolSize;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/NamedPipeTransportElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/NamedPipeTransportElement.cs
index 941b4601c4f..d5cfd75588b 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/NamedPipeTransportElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/NamedPipeTransportElement.cs
@@ -22,7 +22,7 @@ namespace System.ServiceModel.Configuration
{
base.ApplyConfiguration(bindingElement);
NamedPipeTransportBindingElement binding = (NamedPipeTransportBindingElement)bindingElement;
-#pragma warning suppress 56506 //[....]; base.ApplyConfiguration above checks for bindingElement being null
+#pragma warning suppress 56506 //Microsoft; base.ApplyConfiguration above checks for bindingElement being null
this.ConnectionPoolSettings.ApplyConfiguration(binding.ConnectionPoolSettings);
this.PipeSettings.ApplyConfiguration(binding.PipeSettings);
}
@@ -30,7 +30,7 @@ namespace System.ServiceModel.Configuration
protected internal override void InitializeFrom(BindingElement bindingElement)
{
base.InitializeFrom(bindingElement);
-#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument
+#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument
NamedPipeTransportBindingElement binding = (NamedPipeTransportBindingElement)bindingElement;
this.ConnectionPoolSettings.InitializeFrom(binding.ConnectionPoolSettings);
this.PipeSettings.InitializeFrom(binding.PipeSettings);
@@ -40,7 +40,7 @@ namespace System.ServiceModel.Configuration
{
base.CopyFrom(from);
NamedPipeTransportElement source = (NamedPipeTransportElement)from;
-#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument
+#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument
this.ConnectionPoolSettings.CopyFrom(source.ConnectionPoolSettings);
this.PipeSettings.CopyFrom(source.PipeSettings);
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/OneWayElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/OneWayElement.cs
index 0c90b056aa4..c3d3c369274 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/OneWayElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/OneWayElement.cs
@@ -47,7 +47,7 @@ namespace System.ServiceModel.Configuration
PropertyInformationCollection propertyInfo = this.ElementInformation.Properties;
if (propertyInfo[ConfigurationStrings.ChannelPoolSettings].ValueOrigin != PropertyValueOrigin.Default)
{
-#pragma warning suppress 56506 // [....], base.ApplyConfiguration() validates the argument
+#pragma warning suppress 56506 // Microsoft, base.ApplyConfiguration() validates the argument
this.ChannelPoolSettings.ApplyConfiguration(oneWayBindingElement.ChannelPoolSettings);
}
oneWayBindingElement.MaxAcceptedChannels = this.MaxAcceptedChannels;
@@ -59,7 +59,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
OneWayElement source = (OneWayElement)from;
-#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument
+#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument
PropertyInformationCollection propertyInfo = source.ElementInformation.Properties;
if (propertyInfo[ConfigurationStrings.ChannelPoolSettings].ValueOrigin != PropertyValueOrigin.Default)
{
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/PeerTransportElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/PeerTransportElement.cs
index 5b8d687f39f..ddc638c7926 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/PeerTransportElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/PeerTransportElement.cs
@@ -68,7 +68,7 @@ namespace System.ServiceModel.Configuration
binding.Port = this.Port;
binding.MaxBufferPoolSize = this.MaxBufferPoolSize;
binding.MaxReceivedMessageSize = this.MaxReceivedMessageSize;
-#pragma warning suppress 56506 //[....]; base.ApplyConfiguration() checks for 'binding' being null
+#pragma warning suppress 56506 //Microsoft; base.ApplyConfiguration() checks for 'binding' being null
this.Security.ApplyConfiguration(binding.Security);
}
@@ -77,7 +77,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
PeerTransportElement source = (PeerTransportElement)from;
-#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument
+#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument
this.ListenIPAddress = source.ListenIPAddress;
this.Port = source.Port;
this.MaxBufferPoolSize = source.MaxBufferPoolSize;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/PrivacyNoticeElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/PrivacyNoticeElement.cs
index c8e310db5dc..bdfdf19f58e 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/PrivacyNoticeElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/PrivacyNoticeElement.cs
@@ -50,7 +50,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
PrivacyNoticeElement source = (PrivacyNoticeElement) from;
- #pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument
+ #pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument
this.Url = source.Url;
this.Version = source.Version;
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ReliableMessagingVersionConverter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ReliableMessagingVersionConverter.cs
index 5ea78eddac7..dff1f8fd22d 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ReliableMessagingVersionConverter.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ReliableMessagingVersionConverter.cs
@@ -32,7 +32,7 @@ namespace System.ServiceModel.Configuration
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
{
string version = value as string;
-#pragma warning suppress 56507 // [....], Really checking for null (meaning value was not a string) versus String.Empty
+#pragma warning suppress 56507 // Microsoft, Really checking for null (meaning value was not a string) versus String.Empty
if (version != null)
{
switch (version)
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ReliableSessionElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ReliableSessionElement.cs
index 5fa338c0cdf..78c194c1945 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ReliableSessionElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ReliableSessionElement.cs
@@ -104,7 +104,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
ReliableSessionElement source = (ReliableSessionElement)from;
-#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null
+#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null
this.AcknowledgementInterval = source.AcknowledgementInterval;
this.FlowControlEnabled = source.FlowControlEnabled;
this.InactivityTimeout = source.InactivityTimeout;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/RemoveBehaviorElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/RemoveBehaviorElement.cs
index f7d061da296..04f10476125 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/RemoveBehaviorElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/RemoveBehaviorElement.cs
@@ -23,7 +23,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
RemoveBehaviorElement source = (RemoveBehaviorElement) from;
-#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null
+#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null
this.Name = source.Name;
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SecurityElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SecurityElement.cs
index 70c98b01678..6866807d7b6 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SecurityElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SecurityElement.cs
@@ -37,7 +37,7 @@ namespace System.ServiceModel.Configuration
SecurityElement source = (SecurityElement)from;
-#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null
+#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null
if (PropertyValueOrigin.Default != source.ElementInformation.Properties[ConfigurationStrings.SecureConversationBootstrap].ValueOrigin)
this.SecureConversationBootstrap.CopyFrom(source.SecureConversationBootstrap);
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SecurityElementBase.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SecurityElementBase.cs
index 98c71d0c3bb..f27d8b8a471 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SecurityElementBase.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SecurityElementBase.cs
@@ -173,7 +173,7 @@ namespace System.ServiceModel.Configuration
SecurityBindingElement sbe = (SecurityBindingElement)bindingElement;
-#pragma warning disable 56506 //[....]; base.CopyFrom() checks for 'from' being null
+#pragma warning disable 56506 //Microsoft; base.CopyFrom() checks for 'from' being null
if (PropertyValueOrigin.Default != this.ElementInformation.Properties[ConfigurationStrings.DefaultAlgorithmSuite].ValueOrigin)
sbe.DefaultAlgorithmSuite = this.DefaultAlgorithmSuite;
if (PropertyValueOrigin.Default != this.ElementInformation.Properties[ConfigurationStrings.IncludeTimestamp].ValueOrigin)
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceAuthorizationElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceAuthorizationElement.cs
index 3871c52a5cb..bea61241b88 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceAuthorizationElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceAuthorizationElement.cs
@@ -84,7 +84,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
ServiceAuthorizationElement source = (ServiceAuthorizationElement)from;
-#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null
+#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null
this.PrincipalPermissionMode = source.PrincipalPermissionMode;
this.RoleProviderName = source.RoleProviderName;
this.ImpersonateCallerForAllOperations = source.ImpersonateCallerForAllOperations;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceBehaviorElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceBehaviorElement.cs
index 28a42f4bf36..feac091740f 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceBehaviorElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceBehaviorElement.cs
@@ -37,7 +37,7 @@ namespace System.ServiceModel.Configuration
}
if (!typeof(System.ServiceModel.Description.IServiceBehavior).IsAssignableFrom(element.BehaviorType))
{
-#pragma warning disable 56506 //[....]; element.ElementInformation is guaranteed to be non-null(System.Configuration)
+#pragma warning disable 56506 //Microsoft; element.ElementInformation is guaranteed to be non-null(System.Configuration)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(SR.GetString(SR.ConfigInvalidServiceBehaviorType,
element.ConfigurationElementName,
this.Name),
@@ -62,7 +62,7 @@ namespace System.ServiceModel.Configuration
}
if (!typeof(System.ServiceModel.Description.IServiceBehavior).IsAssignableFrom(element.BehaviorType))
{
-#pragma warning disable 56506 //[....]; element.ElementInformation is guaranteed to be non-null(System.Configuration)
+#pragma warning disable 56506 //Microsoft; element.ElementInformation is guaranteed to be non-null(System.Configuration)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(SR.GetString(SR.ConfigInvalidServiceBehaviorType,
element.ConfigurationElementName,
this.Name),
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceCredentialsElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceCredentialsElement.cs
index 050bca034d1..ae57ebb3ffd 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceCredentialsElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceCredentialsElement.cs
@@ -98,7 +98,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
ServiceCredentialsElement source = (ServiceCredentialsElement)from;
-#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null
+#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null
this.ClientCertificate.Copy(source.ClientCertificate);
this.ServiceCertificate.Copy(source.ServiceCertificate);
this.UserNameAuthentication.Copy(source.UserNameAuthentication);
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceDebugElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceDebugElement.cs
index 86a1000cbf8..c3e7c986f24 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceDebugElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceDebugElement.cs
@@ -86,7 +86,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
ServiceDebugElement source = (ServiceDebugElement)from;
-#pragma warning suppress 56506 //[....]; base.CopyFrom() check for 'from' being null
+#pragma warning suppress 56506 //Microsoft; base.CopyFrom() check for 'from' being null
this.HttpHelpPageEnabled = source.HttpHelpPageEnabled;
this.HttpHelpPageUrl = source.HttpHelpPageUrl;
this.HttpsHelpPageEnabled = source.HttpsHelpPageEnabled;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceMetadataPublishingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceMetadataPublishingElement.cs
index 236a9d88250..f23ce762124 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceMetadataPublishingElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceMetadataPublishingElement.cs
@@ -95,7 +95,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
ServiceMetadataPublishingElement source = (ServiceMetadataPublishingElement)from;
-#pragma warning suppress 56506 //[....]; base.CopyFrom() check for 'from' being null
+#pragma warning suppress 56506 //Microsoft; base.CopyFrom() check for 'from' being null
this.HttpGetEnabled = source.HttpGetEnabled;
this.HttpGetUrl = source.HttpGetUrl;
this.HttpsGetEnabled = source.HttpsGetEnabled;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelConfigurationElementCollection.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelConfigurationElementCollection.cs
index 277cdad0330..576cff6c0b1 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelConfigurationElementCollection.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelConfigurationElementCollection.cs
@@ -239,7 +239,7 @@ namespace System.ServiceModel.Configuration
}
else
{
-#pragma warning disable 56506 //[....]; Variable 'key' checked for null previously
+#pragma warning disable 56506 //Microsoft; Variable 'key' checked for null previously
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(SR.GetString(SR.ConfigKeysDoNotMatch,
this.GetElementKey(value).ToString(),
key.ToString()));
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelExtensionCollectionElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelExtensionCollectionElement.cs
index eba49b2e2ed..9a6073794e2 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelExtensionCollectionElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelExtensionCollectionElement.cs
@@ -48,7 +48,7 @@ namespace System.ServiceModel.Configuration
if (!this.CollectionElementBaseType.IsAssignableFrom(extensionType))
{
-#pragma warning disable 56506 //[....]; Variable 'extensionType' checked for null previously
+#pragma warning disable 56506 //Microsoft; Variable 'extensionType' checked for null previously
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("extensionType",
SR.GetString(SR.ConfigInvalidExtensionType,
extensionType.ToString(),
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelSectionGroup.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelSectionGroup.cs
index c05708f7b3e..112d210c209 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelSectionGroup.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelSectionGroup.cs
@@ -74,7 +74,7 @@ namespace System.ServiceModel.Configuration
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("config");
}
-#pragma warning suppress 56506 //[....]; config.SectionGroups can never be null (underlying configuration system guarantees)
+#pragma warning suppress 56506 //Microsoft; config.SectionGroups can never be null (underlying configuration system guarantees)
return (ServiceModelSectionGroup)config.SectionGroups[ConfigurationStrings.SectionGroupName];
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceSecurityAuditElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceSecurityAuditElement.cs
index a26244ce56d..5cbdf80e1fb 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceSecurityAuditElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceSecurityAuditElement.cs
@@ -52,7 +52,7 @@ namespace System.ServiceModel.Configuration
{
base.CopyFrom(from);
ServiceSecurityAuditElement source = (ServiceSecurityAuditElement)from;
-#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null
+#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null
this.AuditLogLocation = source.AuditLogLocation;
this.SuppressAuditFailure = source.SuppressAuditFailure;
this.ServiceAuthorizationAuditLevel = source.ServiceAuthorizationAuditLevel;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceThrottlingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceThrottlingElement.cs
index 11f81f42606..b6df0f71a16 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceThrottlingElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceThrottlingElement.cs
@@ -44,7 +44,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
ServiceThrottlingElement source = (ServiceThrottlingElement)from;
-#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null
+#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null
this.MaxConcurrentCalls = source.MaxConcurrentCalls;
this.MaxConcurrentSessions = source.MaxConcurrentSessions;
this.MaxConcurrentInstances = source.MaxConcurrentInstances;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceTimeoutsElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceTimeoutsElement.cs
index 9bd23149f74..573b1d9a966 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceTimeoutsElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceTimeoutsElement.cs
@@ -29,7 +29,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
ServiceTimeoutsElement source = (ServiceTimeoutsElement)from;
-#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null
+#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null
this.TransactionTimeout = source.TransactionTimeout;
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SslStreamSecurityElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SslStreamSecurityElement.cs
index 025ebc79432..247bd119d7a 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SslStreamSecurityElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SslStreamSecurityElement.cs
@@ -60,7 +60,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
SslStreamSecurityElement source = (SslStreamSecurityElement)from;
-#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument
+#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument
this.RequireClientCertificate = source.RequireClientCertificate;
this.SslProtocols = source.SslProtocols;
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/StandardBindingCollectionElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/StandardBindingCollectionElement.cs
index 64932814a80..ed2e5bb7e99 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/StandardBindingCollectionElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/StandardBindingCollectionElement.cs
@@ -44,7 +44,7 @@ namespace System.ServiceModel.Configuration
{
// This line needed because of the IBindingSection implementation
StandardBindingCollectionElement<TStandardBinding, TBindingConfiguration> me = (StandardBindingCollectionElement<TStandardBinding, TBindingConfiguration>)this;
-#pragma warning suppress 56506 //[....]; me.Bindings can never be null (underlying configuration system guarantees)
+#pragma warning suppress 56506 //Microsoft; me.Bindings can never be null (underlying configuration system guarantees)
return me.Bindings.ContainsKey(name);
}
protected internal override Binding GetDefault()
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/StandardEndpointCollectionElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/StandardEndpointCollectionElement.cs
index 51b14b08d3b..848b2d8991d 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/StandardEndpointCollectionElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/StandardEndpointCollectionElement.cs
@@ -44,7 +44,7 @@ namespace System.ServiceModel.Configuration
public override bool ContainsKey(string name)
{
StandardEndpointCollectionElement<TStandardEndpoint, TEndpointConfiguration> me = (StandardEndpointCollectionElement<TStandardEndpoint, TEndpointConfiguration>)this;
-#pragma warning suppress 56506 //[....]; me.Endpoints can never be null (underlying configuration system guarantees)
+#pragma warning suppress 56506 //Microsoft; me.Endpoints can never be null (underlying configuration system guarantees)
return me.Endpoints.ContainsKey(name);
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TcpTransportElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TcpTransportElement.cs
index e792c9cabc7..bed3878e51b 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TcpTransportElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TcpTransportElement.cs
@@ -19,7 +19,7 @@ namespace System.ServiceModel.Configuration
public override void ApplyConfiguration(BindingElement bindingElement)
{
base.ApplyConfiguration(bindingElement);
-#pragma warning suppress 56506 // [....], base.ApplyConfiguration() validates the argument
+#pragma warning suppress 56506 // Microsoft, base.ApplyConfiguration() validates the argument
TcpTransportBindingElement binding = (TcpTransportBindingElement)bindingElement;
PropertyInformationCollection propertyInfo = this.ElementInformation.Properties;
if (this.ListenBacklog != TcpTransportDefaults.ListenBacklogConst)
@@ -28,7 +28,7 @@ namespace System.ServiceModel.Configuration
}
binding.PortSharingEnabled = this.PortSharingEnabled;
binding.TeredoEnabled = this.TeredoEnabled;
-#pragma warning suppress 56506 // [....], base.ApplyConfiguration() validates the argument
+#pragma warning suppress 56506 // Microsoft, base.ApplyConfiguration() validates the argument
this.ConnectionPoolSettings.ApplyConfiguration(binding.ConnectionPoolSettings);
binding.ExtendedProtectionPolicy = ChannelBindingUtility.BuildPolicy(this.ExtendedProtectionPolicy);
}
@@ -43,7 +43,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
TcpTransportElement source = (TcpTransportElement)from;
-#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument
+#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument
this.ListenBacklog = source.ListenBacklog;
this.PortSharingEnabled = source.PortSharingEnabled;
this.TeredoEnabled = source.TeredoEnabled;
@@ -59,7 +59,7 @@ namespace System.ServiceModel.Configuration
protected internal override void InitializeFrom(BindingElement bindingElement)
{
base.InitializeFrom(bindingElement);
-#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument
+#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument
TcpTransportBindingElement binding = (TcpTransportBindingElement)bindingElement;
if (binding.IsListenBacklogSet)
{
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TextMessageEncodingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TextMessageEncodingElement.cs
index bf649723569..ec04b51b2cb 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TextMessageEncodingElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TextMessageEncodingElement.cs
@@ -24,7 +24,7 @@ namespace System.ServiceModel.Configuration
binding.WriteEncoding = this.WriteEncoding;
binding.MaxReadPoolSize = this.MaxReadPoolSize;
binding.MaxWritePoolSize = this.MaxWritePoolSize;
-#pragma warning suppress 56506 //[....]; base.ApplyConfiguration() checks for 'binding' being null
+#pragma warning suppress 56506 //Microsoft; base.ApplyConfiguration() checks for 'binding' being null
this.ReaderQuotas.ApplyConfiguration(binding.ReaderQuotas);
}
@@ -38,7 +38,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
TextMessageEncodingElement source = (TextMessageEncodingElement)from;
-#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null
+#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null
this.MessageVersion = source.MessageVersion;
this.WriteEncoding = source.WriteEncoding;
this.MaxReadPoolSize = source.MaxReadPoolSize;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactedBatchingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactedBatchingElement.cs
index b74805626e1..176571cd0e2 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactedBatchingElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactedBatchingElement.cs
@@ -22,7 +22,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
TransactedBatchingElement source = from as TransactedBatchingElement;
-#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null
+#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null
this.MaxBatchSize = source.MaxBatchSize;
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactionFlowElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactionFlowElement.cs
index 652f729b0cc..de6601252f0 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactionFlowElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactionFlowElement.cs
@@ -53,7 +53,7 @@ namespace System.ServiceModel.Configuration
{
base.CopyFrom(from);
TransactionFlowElement source = (TransactionFlowElement)from;
-#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument
+#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument
this.TransactionProtocol = source.TransactionProtocol;
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactionProtocolConverter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactionProtocolConverter.cs
index 9bba5ca4cce..12c1308b56b 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactionProtocolConverter.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactionProtocolConverter.cs
@@ -32,7 +32,7 @@ namespace System.ServiceModel.Configuration
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
{
string protocol = value as string;
-#pragma warning suppress 56507 // [....], Really checking for null (meaning value was not a string) versus String.Empty
+#pragma warning suppress 56507 // Microsoft, Really checking for null (meaning value was not a string) versus String.Empty
if (protocol != null)
{
switch (protocol)
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransportElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransportElement.cs
index c4599271949..18d9aea87e4 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransportElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransportElement.cs
@@ -27,7 +27,7 @@ using System.ServiceModel.Channels;
base.CopyFrom(from);
TransportElement source = (TransportElement)from;
-#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument
+#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument
this.ManualAddressing = source.ManualAddressing;
this.MaxBufferPoolSize = source.MaxBufferPoolSize;
this.MaxReceivedMessageSize = source.MaxReceivedMessageSize;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/WindowsStreamSecurityElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/WindowsStreamSecurityElement.cs
index f82b3f7c2d5..e31633cd846 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/WindowsStreamSecurityElement.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/WindowsStreamSecurityElement.cs
@@ -52,7 +52,7 @@ namespace System.ServiceModel.Configuration
base.CopyFrom(from);
WindowsStreamSecurityElement source = (WindowsStreamSecurityElement)from;
-#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument
+#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument
this.ProtectionLevel = source.ProtectionLevel;
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ClientClassGenerator.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ClientClassGenerator.cs
index c7362683b42..5712afbf7ba 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ClientClassGenerator.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ClientClassGenerator.cs
@@ -61,7 +61,7 @@ namespace System.ServiceModel.Description
static string getDefaultValueForInitializationMethodName = "GetDefaultValueForInitialization";
// IMPORTANT: this table tracks the set of .ctors in ClientBase and DuplexClientBase.
- // This table must be kept in [....]
+ // This table must be kept in sync
// for DuplexClientBase, the initial InstanceContext param is assumed; ctor overloads must match between ClientBase and DuplexClientBase
static Type[][] ClientCtorParamTypes = new Type[][]
{
@@ -107,7 +107,7 @@ namespace System.ServiceModel.Description
#if DEBUG
static BindingFlags ctorBindingFlags = BindingFlags.Instance | BindingFlags.NonPublic;
- static string DebugCheckTable_errorString = "Client code generation table out of [....] with ClientBase and DuplexClientBase ctors. Please investigate.";
+ static string DebugCheckTable_errorString = "Client code generation table out of sync with ClientBase and DuplexClientBase ctors. Please investigate.";
// check the table against what we would get from reflection
static void DebugCheckTable()
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ConfigWriter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ConfigWriter.cs
index 2020a04443f..c111c900c36 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ConfigWriter.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ConfigWriter.cs
@@ -40,7 +40,7 @@ namespace System.ServiceModel.Description
channelElement = new ChannelEndpointElement(endpoint.Address, typeName);
- // [....]: review: Use decoded form to preserve the user-given friendly name, however, beacuse our Encoding algorithm
+ // Microsoft: review: Use decoded form to preserve the user-given friendly name, however, beacuse our Encoding algorithm
// does not touch ASCII names, a name that looks like encoded name will not roundtrip(Example: "_x002C_" will turned into ",")
channelElement.Name = NamingHelper.GetUniqueName(NamingHelper.CodeName(endpoint.Name), this.CheckIfChannelNameInUse, null);
@@ -64,7 +64,7 @@ namespace System.ServiceModel.Description
BindingDictionaryValue bindingDV;
if (!bindingTable.TryGetValue(binding, out bindingDV))
{
- // [....]: review: Use decoded form to preserve the user-given friendly name, however, beacuse our Encoding algorithm
+ // Microsoft: review: Use decoded form to preserve the user-given friendly name, however, beacuse our Encoding algorithm
// does not touch ASCII names, a name that looks like encoded name will not roundtrip(Example: "_x002C_" will turned into ",")
string bindingName = NamingHelper.GetUniqueName(NamingHelper.CodeName(binding.Name), this.CheckIfBindingNameInUse, null);
string bindingSectionName;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ImportedPolicyConversionContext.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ImportedPolicyConversionContext.cs
index 5d9a366651e..711970a2a0c 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ImportedPolicyConversionContext.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ImportedPolicyConversionContext.cs
@@ -13,7 +13,7 @@ namespace System.ServiceModel.Description
public abstract partial class MetadataImporter
{
- //Consider, [....]: make this public
+ //Consider, Microsoft: make this public
internal static IEnumerable<PolicyConversionContext> GetPolicyConversionContextEnumerator(ServiceEndpoint endpoint, PolicyAlternatives policyAlternatives)
{
return ImportedPolicyConversionContext.GetPolicyConversionContextEnumerator(endpoint, policyAlternatives, MetadataImporterQuotas.Defaults);
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/MessageContractExporter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/MessageContractExporter.cs
index e4a23bcc00c..b92b7b207b8 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/MessageContractExporter.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/MessageContractExporter.cs
@@ -511,7 +511,7 @@ namespace System.ServiceModel.Description
string operationName = contractContext.GetOperation(operation).Name;
string callbackString = operation.IsServerInitiated() ? "Callback" : string.Empty;
- // [....]: composing names have potential problem of generating name that looks like an encoded name, consider avoiding '_'
+ // Microsoft: composing names have potential problem of generating name that looks like an encoded name, consider avoiding '_'
if (messageDescription.Direction == MessageDirection.Input)
messageNameBase = string.Format(System.Globalization.CultureInfo.InvariantCulture,
"{0}_{1}_Input{2}Message", portTypeName, operationName, callbackString);
@@ -539,7 +539,7 @@ namespace System.ServiceModel.Description
{
string portTypeName = contractContext.WsdlPortType.Name;
string operationName = contractContext.GetOperation(operation).Name;
- // [....]: composing names have potential problem of generating name that looks like an encoded name, consider avoiding '_'
+ // Microsoft: composing names have potential problem of generating name that looks like an encoded name, consider avoiding '_'
string faultNameBase = String.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}_{1}_{2}_FaultMessage", portTypeName, operationName, faultName);
WsdlNS.ServiceDescription wsdl = contractContext.WsdlPortType.ServiceDescription;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/MetadataSection.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/MetadataSection.cs
index 87e7f37dace..8c33e75db72 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/MetadataSection.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/MetadataSection.cs
@@ -92,7 +92,7 @@ namespace System.ServiceModel.Description
if (!IsPolicyElement(policy))
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("policy",
-#pragma warning suppress 56506 // [....], policy cannot be null at this point since it has been validated above.
+#pragma warning suppress 56506 // Microsoft, policy cannot be null at this point since it has been validated above.
SR.GetString(SR.SFxBadMetadataMustBePolicy, MetadataStrings.WSPolicy.NamespaceUri, MetadataStrings.WSPolicy.Elements.Policy, policy.NamespaceURI, policy.LocalName));
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/PolicyReader.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/PolicyReader.cs
index 469c6d6be67..9b60b764319 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/PolicyReader.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/PolicyReader.cs
@@ -21,7 +21,7 @@ namespace System.ServiceModel.Description
internal delegate void PolicyWarningHandler(XmlElement contextAssertion, string warningMessage);
- // Consider, [....], make this public?
+ // Consider, Microsoft, make this public?
internal event PolicyWarningHandler PolicyWarningOccured;
internal IEnumerable<IEnumerable<XmlElement>> NormalizePolicy(IEnumerable<XmlElement> policyAssertions)
@@ -92,7 +92,7 @@ namespace System.ServiceModel.Description
string warningMsg = SR.GetString(SR.UnrecognizedPolicyElementInNamespace, node.Name, node.NamespaceURI);
metadataImporter.PolicyWarningOccured.Invoke(contextAssertion, warningMsg);
break;
- //consider [....], add more error handling here. default?
+ //consider Microsoft, add more error handling here. default?
}
return nodes;
}
@@ -365,7 +365,7 @@ namespace System.ServiceModel.Description
{
get
{
-#pragma warning suppress 56503 // [....], IEnumerator guidelines, Current throws exception before calling MoveNext
+#pragma warning suppress 56503 // Microsoft, IEnumerator guidelines, Current throws exception before calling MoveNext
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.NoValue0)));
}
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ServiceEndpoint.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ServiceEndpoint.cs
index cd369d24220..d8c3dca4e8b 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ServiceEndpoint.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ServiceEndpoint.cs
@@ -105,7 +105,7 @@ namespace System.ServiceModel.Description
}
else if (binding != null)
{
- // [....]: composing names have potential problem of generating name that looks like an encoded name, consider avoiding '_'
+ // Microsoft: composing names have potential problem of generating name that looks like an encoded name, consider avoiding '_'
return String.Format(CultureInfo.InvariantCulture, "{0}_{1}", new XmlName(Binding.Name).EncodedName, Contract.Name);
}
else
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/SoapHelper.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/SoapHelper.cs
index 61868f6c869..d18c4927e4d 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/SoapHelper.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/SoapHelper.cs
@@ -186,7 +186,7 @@ namespace System.ServiceModel.Description
static class SoapConverter
{
- // [....], this could be simplified if we used generics.
+ // Microsoft, this could be simplified if we used generics.
internal static void ConvertExtensions(WsdlNS.ServiceDescriptionFormatExtensionCollection extensions, EnvelopeVersion version, ConvertExtension conversionMethod)
{
bool foundOne = false;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/TaskOperationDescriptionValidator.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/TaskOperationDescriptionValidator.cs
index 70f61006515..2d1827ef8a1 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/TaskOperationDescriptionValidator.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/TaskOperationDescriptionValidator.cs
@@ -15,7 +15,7 @@ namespace System.ServiceModel.Description
{
if (isForService)
{
- // no other method ([....], async) is allowed to co-exist with a task-based method on the server-side.
+ // no other method (sync, async) is allowed to co-exist with a task-based method on the server-side.
EnsureNoSyncMethod(operationDescription);
EnsureNoBeginEndMethod(operationDescription);
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/TypeLoader.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/TypeLoader.cs
index 105821f4e78..45d56cc0518 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/TypeLoader.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/TypeLoader.cs
@@ -771,13 +771,13 @@ namespace System.ServiceModel.Description
return defaultFormatAttribute;
}
- //[....] and Async should follow the rules:
+ //Sync and Async should follow the rules:
// 1. Parameter match
// 2. Async cannot have behaviors (verification happens later in ProcessOpMethod - behaviors haven't yet been loaded here)
// 3. Async cannot have known types
// 4. Async cannot have known faults
- // 5. [....] and Async have to match on OneWay status
- // 6. [....] and Async have to match Action and ReplyAction
+ // 5. Sync and Async have to match on OneWay status
+ // 6. Sync and Async have to match Action and ReplyAction
void VerifyConsistency(OperationConsistencyVerifier verifier)
{
verifier.VerifyParameterLength();
@@ -860,7 +860,7 @@ namespace System.ServiceModel.Description
existingOp.TaskTResult = newOp.TaskTResult;
if (existingOp.SyncMethod != null)
{
- // Task vs. [....]
+ // Task vs. Sync
VerifyConsistency(new SyncTaskOperationConsistencyVerifier(existingOp, newOp));
}
else
@@ -876,7 +876,7 @@ namespace System.ServiceModel.Description
existingOp.EndMethod = newOp.EndMethod;
if (existingOp.SyncMethod != null)
{
- // Async vs. [....]
+ // Async vs. Sync
VerifyConsistency(new SyncAsyncOperationConsistencyVerifier(existingOp, newOp));
}
else
@@ -894,12 +894,12 @@ namespace System.ServiceModel.Description
newOp.TaskTResult = existingOp.TaskTResult;
if (existingOp.TaskMethod != null)
{
- // [....] vs. Task
+ // Sync vs. Task
VerifyConsistency(new SyncTaskOperationConsistencyVerifier(newOp, existingOp));
}
else
{
- // [....] vs. Async
+ // Sync vs. Async
VerifyConsistency(new SyncAsyncOperationConsistencyVerifier(newOp, existingOp));
}
return newOp;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/WsdlExporter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/WsdlExporter.cs
index 656fc85a790..bb0dc9be896 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/WsdlExporter.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/WsdlExporter.cs
@@ -991,7 +991,7 @@ namespace System.ServiceModel.Description
int i = 0;
prefix = prefixBase + i.ToString(CultureInfo.InvariantCulture);
- //[....], consider do we need to check at higher scopes as well?
+ //Microsoft, consider do we need to check at higher scopes as well?
while (PrefixExists(scopes[0].Namespaces.ToArray(), prefix))
prefix = prefixBase + (++i).ToString(CultureInfo.InvariantCulture);
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/WsdlImporter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/WsdlImporter.cs
index cf5abf7fb7a..f980585bc71 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/WsdlImporter.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/WsdlImporter.cs
@@ -1189,7 +1189,7 @@ namespace System.ServiceModel.Description
internal static XmlQualifiedName GetBindingName(WsdlNS.Port wsdlPort)
{
- // [....]: composing names have potential problem of generating name that looks like an encoded name, consider avoiding '_'
+ // Microsoft: composing names have potential problem of generating name that looks like an encoded name, consider avoiding '_'
XmlName xmlName = new XmlName(string.Format(CultureInfo.InvariantCulture, "{0}_{1}", wsdlPort.Service.Name, wsdlPort.Name), true /*isEncoded*/);
return new XmlQualifiedName(xmlName.EncodedName, wsdlPort.Service.ServiceDescription.TargetNamespace);
}
@@ -1233,7 +1233,7 @@ namespace System.ServiceModel.Description
}
else
{
- // [....]: why this is an Assert, and not an exception?
+ // Microsoft: why this is an Assert, and not an exception?
Fx.Assert("Unsupported WSDL OM (More than 2 OperationMessages encountered in an Operation or WsdlOM is invalid)");
}
// names the come from service description documents have to be valid NCNames; XmlName.ctor will validate.
@@ -1920,7 +1920,7 @@ namespace System.ServiceModel.Description
static Exception CreateExtensionException(IWsdlImportExtension importer, Exception e)
{
string errorMessage = SR.GetString(SR.WsdlExtensionImportError, importer.GetType().FullName, e.Message);
- //consider [....], allow internal exceptions to throw WsdlImportException and handle it in some special way?
+ //consider Microsoft, allow internal exceptions to throw WsdlImportException and handle it in some special way?
return new InvalidOperationException(errorMessage, e);
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/TraceUtility.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/TraceUtility.cs
index 17d2b24eaf3..7941c64ce48 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/TraceUtility.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/TraceUtility.cs
@@ -545,8 +545,8 @@ namespace System.ServiceModel.Diagnostics
(message.State != MessageState.Closed))
{
object property;
-
- if (message.Properties.TryGetValue(TraceUtility.ActivityIdKey, out property))
+
+ if (message.GetProperty(TraceUtility.ActivityIdKey, out property))
{
retval = property as ServiceModelActivity;
}
@@ -603,7 +603,7 @@ namespace System.ServiceModel.Diagnostics
{
// If the property is just removed, the item is disposed and we don't want the thing
// to be disposed of.
- message.Properties[TraceUtility.ActivityIdKey] = false;
+ message.SetProperty(TraceUtility.ActivityIdKey, false);
}
return retval;
}
@@ -659,7 +659,7 @@ namespace System.ServiceModel.Diagnostics
{
if (DiagnosticUtility.ShouldUseActivity && message != null && message.State != MessageState.Closed)
{
- message.Properties[TraceUtility.ActivityIdKey] = activity;
+ message.SetProperty(TraceUtility.ActivityIdKey, activity);
}
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ActionMessageFilterTable.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ActionMessageFilterTable.cs
index 08915244300..9f4d8c9c0bc 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ActionMessageFilterTable.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ActionMessageFilterTable.cs
@@ -111,7 +111,7 @@ namespace System.ServiceModel.Dispatcher
this.filters.Add(filter, data);
List<MessageFilter> filters;
-#pragma warning suppress 56506 // [....], Actions will never be null
+#pragma warning suppress 56506 // Microsoft, Actions will never be null
if (filter.Actions.Count == 0)
{
this.always.Add(filter);
@@ -426,7 +426,7 @@ namespace System.ServiceModel.Dispatcher
if (this.filters.Remove(filter))
{
-#pragma warning suppress 56506 // [....], ActionMessageFilter.Actions can never be null
+#pragma warning suppress 56506 // Microsoft, ActionMessageFilter.Actions can never be null
if (filter.Actions.Count == 0)
{
this.always.Remove(filter);
@@ -436,9 +436,9 @@ namespace System.ServiceModel.Dispatcher
List<MessageFilter> filters;
for (int i = 0; i < filter.Actions.Count; ++i)
{
-#pragma warning suppress 56506 // [....], PreSharp generates a false error here
+#pragma warning suppress 56506 // Microsoft, PreSharp generates a false error here
filters = this.actions[filter.Actions[i]];
-#pragma warning suppress 56506 // [....], filters can never be null
+#pragma warning suppress 56506 // Microsoft, filters can never be null
if (filters.Count == 1)
{
this.actions.Remove(filter.Actions[i]);
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/DuplexChannelBinder.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/DuplexChannelBinder.cs
index 8a9955bd599..e6b36c43fb0 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/DuplexChannelBinder.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/DuplexChannelBinder.cs
@@ -30,7 +30,7 @@ namespace System.ServiceModel.Dispatcher
List<IDuplexRequest> requests;
List<ICorrelatorKey> timedOutRequests;
ChannelHandler channelHandler;
- volatile bool requestAborted;
+ bool requestAborted;
internal DuplexChannelBinder(IDuplexChannel channel, IRequestReplyCorrelator correlator)
{
@@ -207,25 +207,32 @@ namespace System.ServiceModel.Dispatcher
void AbortRequests()
{
IDuplexRequest[] array = null;
+
lock (this.ThisLock)
{
if (this.requests != null)
{
array = this.requests.ToArray();
-
- foreach (IDuplexRequest request in array)
- {
- request.Abort();
- }
+ this.requests = null;
}
- this.requests = null;
+
this.requestAborted = true;
}
+ bool hadRequests = array != null && array.Length > 0;
+
+ if (hadRequests)
+ {
+ foreach (IDuplexRequest request in array)
+ {
+ request.Abort();
+ }
+ }
+
// Remove requests from the correlator since the channel might be either faulting or aborting,
// We are not going to get a reply for these requests. If they are not removed from the correlator, this will cause a leak.
// This operation does not have to be under the lock
- if (array != null && array.Length > 0)
+ if (hadRequests)
{
RequestReplyCorrelator requestReplyCorrelator = this.correlator as RequestReplyCorrelator;
if (requestReplyCorrelator != null)
@@ -537,7 +544,7 @@ namespace System.ServiceModel.Dispatcher
}
}
- // ASSUMPTION: ([....]) caller holds lock (this.mutex)
+ // ASSUMPTION: (Microsoft) caller holds lock (this.mutex)
void RequestStarting(Message message, IDuplexRequest request)
{
if (request != null)
@@ -552,7 +559,7 @@ namespace System.ServiceModel.Dispatcher
}
- // ASSUMPTION: ([....]) caller holds lock (this.mutex)
+ // ASSUMPTION: (Microsoft) caller holds lock (this.mutex)
void RequestCompleting(IDuplexRequest request)
{
this.pending--;
@@ -1473,7 +1480,7 @@ namespace System.ServiceModel.Dispatcher
public void EndClose(IAsyncResult result)
{
- // don't need to lock here since BeginClose is the [....]-point
+ // don't need to lock here since BeginClose is the sync-point
if (this.closeState.TryUserClose())
{
this.innerChannel.EndClose(result);
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/EndpointAddressMessageFilter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/EndpointAddressMessageFilter.cs
index c61e56fb947..049a1b78495 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/EndpointAddressMessageFilter.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/EndpointAddressMessageFilter.cs
@@ -92,7 +92,7 @@ namespace System.ServiceModel.Dispatcher
}
// To
-#pragma warning suppress 56506 // [....], Message.Headers can never be null
+#pragma warning suppress 56506 // Microsoft, Message.Headers can never be null
Uri to = message.Headers.To;
Uri actingAs = this.address.Uri;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/EndpointAddressMessageFilterTable.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/EndpointAddressMessageFilterTable.cs
index b3d707904c1..7f5e509b82b 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/EndpointAddressMessageFilterTable.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/EndpointAddressMessageFilterTable.cs
@@ -153,7 +153,7 @@ namespace System.ServiceModel.Dispatcher
this.candidates.Add(filter, can);
CandidateSet cset;
-#pragma warning suppress 56506 // [....], EndpointAddressMessageFilter.Address can never be null
+#pragma warning suppress 56506 // Microsoft, EndpointAddressMessageFilter.Address can never be null
Uri soapToAddress = filter.Address.Uri;
if (filter.IncludeHostNameInComparison)
{
@@ -181,7 +181,7 @@ namespace System.ServiceModel.Dispatcher
// Update the QName ref count
QName qname;
int cnt;
-#pragma warning suppress 56506 // [....], EndpointAddressMessageFilter.Address can never be null
+#pragma warning suppress 56506 // Microsoft, EndpointAddressMessageFilter.Address can never be null
for (int i = 0; i < address.Headers.Count; ++i)
{
AddressHeader parameter = address.Headers[i];
@@ -719,7 +719,7 @@ namespace System.ServiceModel.Dispatcher
}
Candidate can = this.candidates[filter];
-#pragma warning suppress 56506 // [....], EndpointAddressMessageFilter.Address can never be null
+#pragma warning suppress 56506 // Microsoft, EndpointAddressMessageFilter.Address can never be null
Uri soapToAddress = filter.Address.Uri;
CandidateSet cset = null;
@@ -761,7 +761,7 @@ namespace System.ServiceModel.Dispatcher
{
// Adjust QName counts
QName qname;
-#pragma warning suppress 56506 // [....], EndpointAddress.Headers can never be null
+#pragma warning suppress 56506 // Microsoft, EndpointAddress.Headers can never be null
for (int i = 0; i < address.Headers.Count; ++i)
{
AddressHeader parameter = address.Headers[i];
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ImmutableDispatchRuntime.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ImmutableDispatchRuntime.cs
index caf32a6274a..60d24111d6a 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ImmutableDispatchRuntime.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ImmutableDispatchRuntime.cs
@@ -1144,7 +1144,7 @@ namespace System.ServiceModel.Dispatcher
{
if (!rpc.Operation.IsSynchronous)
{
- // If async call completes in [....], it tells us through the gate below
+ // If async call completes in sync, it tells us through the gate below
rpc.PrepareInvokeContinueGate();
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/InputChannelBinder.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/InputChannelBinder.cs
index 9a7e2012f19..b27cc867c80 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/InputChannelBinder.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/InputChannelBinder.cs
@@ -50,7 +50,7 @@ namespace System.ServiceModel.Dispatcher
{
get
{
-#pragma warning suppress 56503 // [....], the property is really not implemented, cannot lie, API not public
+#pragma warning suppress 56503 // Microsoft, the property is really not implemented, cannot lie, API not public
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
}
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/MessageFilterTable.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/MessageFilterTable.cs
index 3f1dd3be148..ebe6801b630 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/MessageFilterTable.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/MessageFilterTable.cs
@@ -153,7 +153,7 @@ namespace System.ServiceModel.Dispatcher
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("filter", SR.GetString(SR.FilterExists));
}
-#pragma warning suppress 56506 // [....], PreSharp generates a false warning here
+#pragma warning suppress 56506 // Microsoft, PreSharp generates a false warning here
Type filterType = filter.GetType();
Type tableType = null;
IMessageFilterTable<TFilterData> table = null;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/OperationInvokerBehavior.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/OperationInvokerBehavior.cs
index 2bfeafdac3c..2bcb3ceaede 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/OperationInvokerBehavior.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/OperationInvokerBehavior.cs
@@ -41,7 +41,7 @@ namespace System.ServiceModel.Dispatcher
{
if (description.BeginMethod != null)
{
- // both [....] and async methods are present on the contract, check the preference
+ // both sync and async methods are present on the contract, check the preference
OperationBehaviorAttribute operationBehaviorAttribue = description.Behaviors.Find<OperationBehaviorAttribute>();
if ((operationBehaviorAttribue != null) && operationBehaviorAttribue.PreferAsyncInvocation)
{
@@ -54,7 +54,7 @@ namespace System.ServiceModel.Dispatcher
}
else
{
- // only [....] method is present on the contract
+ // only sync method is present on the contract
dispatch.Invoker = new SyncMethodInvoker(description.SyncMethod);
}
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/OutputChannelBinder.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/OutputChannelBinder.cs
index 4c94fe775fe..e4a25a96a6a 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/OutputChannelBinder.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/OutputChannelBinder.cs
@@ -43,7 +43,7 @@ namespace System.ServiceModel.Dispatcher
{
get
{
-#pragma warning suppress 56503 // [....], the property is really not implemented, cannot lie, API not public
+#pragma warning suppress 56503 // Microsoft, the property is really not implemented, cannot lie, API not public
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
}
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrefixEndpointAddressMessageFilter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrefixEndpointAddressMessageFilter.cs
index 53855e35933..91f21729a23 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrefixEndpointAddressMessageFilter.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrefixEndpointAddressMessageFilter.cs
@@ -85,7 +85,7 @@ namespace System.ServiceModel.Dispatcher
}
// To
-#pragma warning suppress 56506 // [....], Message.Headers can never be null
+#pragma warning suppress 56506 // Microsoft, Message.Headers can never be null
Uri to = message.Headers.To;
object o;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrefixEndpointAddressMessageFilterTable.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrefixEndpointAddressMessageFilterTable.cs
index d360c4ba441..5b8d787e79f 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrefixEndpointAddressMessageFilterTable.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrefixEndpointAddressMessageFilterTable.cs
@@ -59,7 +59,7 @@ namespace System.ServiceModel.Dispatcher
Candidate can = new Candidate(filter, data, mask, filter.HeaderLookup);
this.candidates.Add(filter, can);
-#pragma warning suppress 56506 // [....], PrefixEndpointAddressMessageFilter.Address can never be null
+#pragma warning suppress 56506 // Microsoft, PrefixEndpointAddressMessageFilter.Address can never be null
Uri soapToAddress = filter.Address.Uri;
CandidateSet cset;
@@ -134,7 +134,7 @@ namespace System.ServiceModel.Dispatcher
}
Candidate can = this.candidates[filter];
-#pragma warning suppress 56506 // [....], PrefixEndpointAddressMessageFilter.Address can never be null
+#pragma warning suppress 56506 // Microsoft, PrefixEndpointAddressMessageFilter.Address can never be null
Uri soapToAddress = filter.Address.Uri;
CandidateSet cset = null;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrimitiveOperationFormatter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrimitiveOperationFormatter.cs
index 7387258171a..beddbbcfcfb 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrimitiveOperationFormatter.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrimitiveOperationFormatter.cs
@@ -46,7 +46,7 @@ namespace System.ServiceModel.Dispatcher
OperationFormatter.Validate(description, isRpc, false/*isEncoded*/);
this.operation = description;
-#pragma warning suppress 56506 // [....], OperationDescription.Messages never be null
+#pragma warning suppress 56506 // Microsoft, OperationDescription.Messages never be null
this.requestMessage = description.Messages[0];
if (description.Messages.Count == 2)
this.responseMessage = description.Messages[1];
@@ -290,7 +290,7 @@ namespace System.ServiceModel.Dispatcher
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("description");
OperationDescription operation = description;
-#pragma warning suppress 56506 // [....], OperationDescription.Messages never be null
+#pragma warning suppress 56506 // Microsoft, OperationDescription.Messages never be null
MessageDescription requestMessage = description.Messages[0];
MessageDescription responseMessage = null;
if (description.Messages.Count == 2)
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryFunctions.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryFunctions.cs
index e3335d23660..046eea89a08 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryFunctions.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryFunctions.cs
@@ -55,7 +55,7 @@ namespace System.ServiceModel.Dispatcher
List<NodeSequenceIterator> iterList;
- // REFACTOR, [....], make this a function on QueryValueModel
+ // REFACTOR, Microsoft, make this a function on QueryValueModel
internal XsltFunctionCallOpcode(XsltContext context, IXsltContextFunction function, int argCount)
: base(OpcodeID.XsltFunction)
{
@@ -138,7 +138,7 @@ namespace System.ServiceModel.Dispatcher
}
else
{
- // PERF, [....], see if we can cache these arrays to avoid allocations
+ // PERF, Microsoft, see if we can cache these arrays to avoid allocations
object[] xsltArgs = new object[this.argCount];
int iterationCount = context.TopArg.Count;
for (int iteration = 0; iteration < iterationCount; ++iteration)
@@ -1210,7 +1210,7 @@ namespace System.ServiceModel.Dispatcher
StackFrame argKeys = context.SecondArg;
StackFrame argValues = context[2];
- // PERF, [....], this is really slow.
+ // PERF, Microsoft, this is really slow.
StringBuilder builder = new StringBuilder();
while (argSource.basePtr <= argSource.endPtr)
{
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryNode.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryNode.cs
index 0ee7900aaca..f56c2737a5e 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryNode.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryNode.cs
@@ -140,7 +140,7 @@ namespace System.ServiceModel.Dispatcher
NodesetLast = 0x01,
}
- // PERF, [....], Remove when generic sort works
+ // PERF, Microsoft, Remove when generic sort works
// Used to sort in document order
#if NO
internal class NodeSequenceItemObjectComparer : IComparer
@@ -908,7 +908,7 @@ namespace System.ServiceModel.Dispatcher
{
this.Merge(false);
- // PERF, [....], make this work
+ // PERF, Microsoft, make this work
//Array.Sort<NodeSequenceItem>(this.items, 0, this.count, NodeSequence.Comparer);
Array.Sort(this.items, 0, this.count, NodeSequence.ObjectComparer);
@@ -974,7 +974,7 @@ namespace System.ServiceModel.Dispatcher
return seq;
/*
- // PERF, [....], I think we can do the merge ourselves and avoid the sort.
+ // PERF, Microsoft, I think we can do the merge ourselves and avoid the sort.
// Need to verify that the sequences are always in document order.
for(int i = 0; i < this.count; ++i)
{
@@ -1055,13 +1055,13 @@ namespace System.ServiceModel.Dispatcher
{
if (this.index == 0)
{
-#pragma warning suppress 56503 // [....], postponing the public change
+#pragma warning suppress 56503 // Microsoft, postponing the public change
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new QueryProcessingException(QueryProcessingError.Unexpected, SR.GetString(SR.QueryContextNotSupportedInSequences)));
}
if (this.index > this.data.seq.Count)
{
-#pragma warning suppress 56503 // [....], postponing the public change
+#pragma warning suppress 56503 // Microsoft, postponing the public change
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.QueryAfterNodes)));
}
//
@@ -1156,13 +1156,13 @@ namespace System.ServiceModel.Dispatcher
{
if (this.iter.CurrentPosition == 0)
{
-#pragma warning suppress 56503 // [....], postponing the public change
+#pragma warning suppress 56503 // Microsoft, postponing the public change
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.QueryBeforeNodes)));
}
if (this.iter.CurrentPosition > this.iter.Count)
{
-#pragma warning suppress 56503 // [....], postponing the public change
+#pragma warning suppress 56503 // Microsoft, postponing the public change
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.QueryAfterNodes)));
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryProcessor.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryProcessor.cs
index 54818a997be..6df5f8ce144 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryProcessor.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryProcessor.cs
@@ -457,7 +457,7 @@ namespace System.ServiceModel.Dispatcher
this.matcher = matcher;
this.flags = QueryProcessingFlags.Match;
- // PERF, [....], see if we can just let these to their default init
+ // PERF, Microsoft, see if we can just let these to their default init
this.messageAction = null;
//this.messageAddress = null;
//this.messageVia = null;
@@ -510,7 +510,7 @@ namespace System.ServiceModel.Dispatcher
}
else
{
-#pragma warning suppress 56503 // [....], property is more readable for this
+#pragma warning suppress 56503 // Microsoft, property is more readable for this
throw DiagnosticUtility.ExceptionUtility.ThrowHelperCritical(new QueryProcessingException(QueryProcessingError.Unexpected));
}
this.counter = this.contextNode as INodeCounter;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QuerySelectOp.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QuerySelectOp.cs
index e835c3651fd..133eb048b5e 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QuerySelectOp.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QuerySelectOp.cs
@@ -44,7 +44,7 @@ namespace System.ServiceModel.Dispatcher
{
get
{
- // PERF, [....], weaken guard?
+ // PERF, Microsoft, weaken guard?
return QueryAxisType.Self == this.axis.Type || QueryAxisType.Child == this.axis.Type;
//return ((QueryAxisType.Self == this.axis.Type) || ((this.axis.Type != QueryAxisType.DescendantOrSelf || this.axis.Type != QueryAxisType.Descendant)&& 0 != ((QueryNodeType.Element | QueryNodeType.Root) & this.type)));
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QuerySubExprEliminator.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QuerySubExprEliminator.cs
index 790a61eb0e0..40a6970b464 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QuerySubExprEliminator.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QuerySubExprEliminator.cs
@@ -278,8 +278,8 @@ namespace System.ServiceModel.Dispatcher
internal class SubExprHeader : SubExpr
{
- // WS, [....], Can probably combine these
- // WS, [....], Make this data structure less ugly (if possible)
+ // WS, Microsoft, Can probably combine these
+ // WS, Microsoft, Make this data structure less ugly (if possible)
Dictionary<string, Dictionary<string, List<SubExpr>>> nameLookup;
Dictionary<SubExpr, MyInt> indexLookup;
@@ -329,7 +329,7 @@ namespace System.ServiceModel.Dispatcher
context.SaveVariable(this.var, context.Processor.ElapsedCount(marker));
}
- // WS, [....], see if we can put this array in the processor to save
+ // WS, Microsoft, see if we can put this array in the processor to save
// an allocation. Perhaps we can use the variables slot we're going to fill
NodeSequence[] childSequences = new NodeSequence[this.children.Count];
NodeSequence seq = context.Sequences[context.TopSequenceArg.basePtr].Sequence;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryUtil.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryUtil.cs
index 6efce98ed0c..6327b5d0d53 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryUtil.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryUtil.cs
@@ -657,7 +657,7 @@ namespace System.ServiceModel.Dispatcher
}
else
{
- // PERF, [....], can this be made more efficient? Does it need to be?
+ // PERF, Microsoft, can this be made more efficient? Does it need to be?
Remove(old);
Insert(replace);
}
@@ -704,7 +704,7 @@ namespace System.ServiceModel.Dispatcher
}
else if (this.buffer.Length == this.size)
{
- // PERF, [....], how should we choose a new size?
+ // PERF, Microsoft, how should we choose a new size?
T[] tmp = new T[this.size + 1];
if (index == 0)
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ReplyChannelBinder.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ReplyChannelBinder.cs
index fc2e8ea3f9f..3c15855a7dd 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ReplyChannelBinder.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ReplyChannelBinder.cs
@@ -50,7 +50,7 @@ namespace System.ServiceModel.Dispatcher
{
get
{
-#pragma warning suppress 56503 // [....], the property is really not implemented, cannot lie, API not public
+#pragma warning suppress 56503 // Microsoft, the property is really not implemented, cannot lie, API not public
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
}
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/SecurityValidationBehavior.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/SecurityValidationBehavior.cs
index 0d0cb0f2c97..82a56eaf5fe 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/SecurityValidationBehavior.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/SecurityValidationBehavior.cs
@@ -235,7 +235,7 @@ namespace System.ServiceModel.Dispatcher
if (sbe is SymmetricSecurityBindingElement || sbe is AsymmetricSecurityBindingElement)
{
// check to see if we are streaming
- // ([....] 53690): need to have a general way get the transfer Mode from the binding
+ // (Microsoft 53690): need to have a general way get the transfer Mode from the binding
// TransferMode transferMode = binding.GetProperty<TransferMode>(new BindingParameterCollection());
if (GetTransferMode(binding) != TransferMode.Buffered)
{
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/SeekableMessageNavigator.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/SeekableMessageNavigator.cs
index 9066da02bd9..7e37baf4ea9 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/SeekableMessageNavigator.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/SeekableMessageNavigator.cs
@@ -138,7 +138,7 @@ namespace System.ServiceModel.Dispatcher
// The base uri of the element
// This is usually associated with the URI of the original data's location
- // WS, [....], look into what readers from messages surface. If it's always null, we can save
+ // WS, Microsoft, look into what readers from messages surface. If it's always null, we can save
// some memory
public override string BaseURI
{
@@ -183,7 +183,7 @@ namespace System.ServiceModel.Dispatcher
while (n != p.elem)
{
- // PERF, [....], we might be able to get rid of this check by tweaking the position
+ // PERF, Microsoft, we might be able to get rid of this check by tweaking the position
// validator
if (n == NullIndex)
{
@@ -779,7 +779,7 @@ namespace System.ServiceModel.Dispatcher
// Move the navigator to the first child of the current node.
public override bool MoveToFirstChild()
{
- // PERF, [....], do we need this check? The null check may be enough
+ // PERF, Microsoft, do we need this check? The null check may be enough
// Only valid for the root or an element node
if (this.location == RootIndex || this.dom.nodes[this.location].type == XPathNodeType.Element)
{
@@ -894,7 +894,7 @@ namespace System.ServiceModel.Dispatcher
n = this.dom.nodes[n].nextSibling;
}
- // PERF, [....], can we just clear?
+ // PERF, Microsoft, can we just clear?
// We didn't find it, so restore the namespace stack
for (int i = 0; i < nsCount; ++i)
{
@@ -1483,7 +1483,7 @@ namespace System.ServiceModel.Dispatcher
// Get the index of the next namespace that matches the scope
// This function populates the namespace stack too
- // PERF, [....], see if we can have this function set the current location too
+ // PERF, Microsoft, see if we can have this function set the current location too
int FindNamespace(int parent, int ns, XPathNamespaceScope scope)
{
bool done = false;
@@ -1932,7 +1932,7 @@ namespace System.ServiceModel.Dispatcher
int n = NullIndex;
do
{
- // PERF, [....], reorder cases so more common ones are earlier
+ // PERF, Microsoft, reorder cases so more common ones are earlier
switch (reader.NodeType)
{
case XmlNodeType.Element:
@@ -2118,7 +2118,7 @@ namespace System.ServiceModel.Dispatcher
}
}
- // PERF, [....], find a better way to implement and have internal
+ // PERF, Microsoft, find a better way to implement and have internal
void INodeCounter.Increase()
{
Increase();
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/StreamFormatter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/StreamFormatter.cs
index a11a8f82efa..37c3276d24f 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/StreamFormatter.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/StreamFormatter.cs
@@ -332,7 +332,7 @@ namespace System.ServiceModel.Dispatcher
{
get
{
-#pragma warning suppress 56503 // [....], not a seekable stream, it is ok to throw NotSupported in this case
+#pragma warning suppress 56503 // Microsoft, not a seekable stream, it is ok to throw NotSupported in this case
throw TraceUtility.ThrowHelperError(new NotSupportedException(), this.message);
}
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/XPathMessageContext.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/XPathMessageContext.cs
index 1222eb30b45..18a71af65d5 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/XPathMessageContext.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/XPathMessageContext.cs
@@ -162,7 +162,7 @@ namespace System.ServiceModel.Dispatcher
if (argTypes == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("argTypes");
- // PERF, [....], factor ns if all same
+ // PERF, Microsoft, factor ns if all same
string ns = LookupNamespace(prefix);
for (int i = 0; i < functions.Length; ++i)
{
@@ -1254,7 +1254,7 @@ namespace System.ServiceModel.Dispatcher
{
do
{
- // PERF, [....], this will be faster if I cache the envelope namespace to do the
+ // PERF, Microsoft, this will be faster if I cache the envelope namespace to do the
// actor lookup by hand
long pos = nav.CurrentPosition;
string navActor = XPathMessageFunctionActor.ExtractFromNavigator(nav);
@@ -1283,7 +1283,7 @@ namespace System.ServiceModel.Dispatcher
return docContext.Evaluate(expr);
#if NO
- // PERF, [....], I drafted this implementation before we found out that a bug in the Fx implementation would
+ // PERF, Microsoft, I drafted this implementation before we found out that a bug in the Fx implementation would
// prevent us from constructing an XPathNodeIterator that they would accept. I'm keeping it
// around in the hope that I will be able to use it by M5.4. If not, it will be deleted.
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/EndpointAddress.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/EndpointAddress.cs
index 26583d1528c..dd22acb146b 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/EndpointAddress.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/EndpointAddress.cs
@@ -342,7 +342,7 @@ namespace System.ServiceModel
// NOTE: UserInfo, Query, and Fragment are ignored when comparing Uris as addresses
// this is the WCF logic for comparing Uris that represent addresses
- // this method must be kept in [....] with UriGetHashCode
+ // this method must be kept in sync with UriGetHashCode
internal static bool UriEquals(Uri u1, Uri u2, bool ignoreCase, bool includeHostInComparison)
{
return UriEquals(u1, u2, ignoreCase, includeHostInComparison, true);
@@ -393,7 +393,7 @@ namespace System.ServiceModel
return string.Compare(u1Path, 0, u2Path, 0, u1Len, ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal) == 0;
}
- // this method must be kept in [....] with UriEquals
+ // this method must be kept in sync with UriEquals
internal static int UriGetHashCode(Uri uri, bool includeHostInComparison)
{
return UriGetHashCode(uri, includeHostInComparison, true);
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/FaultReason.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/FaultReason.cs
index cbac59f62a0..409b9c82445 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/FaultReason.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/FaultReason.cs
@@ -72,7 +72,7 @@ namespace System.ServiceModel
return GetMatchingTranslation(CultureInfo.CurrentCulture);
}
- // [....], This function should always return a translation so that a fault can be surfaced.
+ // Microsoft, This function should always return a translation so that a fault can be surfaced.
public FaultReasonText GetMatchingTranslation(CultureInfo cultureInfo)
{
if (cultureInfo == null)
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/LocalAppContextSwitches.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/LocalAppContextSwitches.cs
index 323304ff6ba..ced8931ddb5 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/LocalAppContextSwitches.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/LocalAppContextSwitches.cs
@@ -15,10 +15,12 @@ namespace System.ServiceModel
private const string DisableExplicitConnectionCloseHeaderString = "Switch.System.ServiceModel.DisableExplicitConnectionCloseHeader";
private const string AllowUnsignedToHeaderString = "Switch.System.ServiceModel.AllowUnsignedToHeader";
private const string DisableCngCertificatesString = "Switch.System.ServiceModel.DisableCngCertificates";
+ internal const string DisableUsingServicePointManagerSecurityProtocolsString = "Switch.System.ServiceModel.DisableUsingServicePointManagerSecurityProtocols";
private static int disableExplicitConnectionCloseHeader;
private static int allowUnsignedToHeader;
private static int disableCngCertificates;
+ private static int disableUsingServicePointManagerSecurityProtocols;
public static bool DisableExplicitConnectionCloseHeader
{
@@ -47,6 +49,15 @@ namespace System.ServiceModel
}
}
+ public static bool DisableUsingServicePointManagerSecurityProtocols
+ {
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ get
+ {
+ return LocalAppContext.GetCachedSwitchValue(DisableUsingServicePointManagerSecurityProtocolsString, ref disableUsingServicePointManagerSecurityProtocols);
+ }
+ }
+
public static void SetDefaultsLessOrEqual_452()
{
#pragma warning disable BCL0012
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/OperationContext.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/OperationContext.cs
index c08a1200cb8..58c994dd7e5 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/OperationContext.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/OperationContext.cs
@@ -100,7 +100,7 @@ namespace System.ServiceModel
set
{
- if (ShouldUseAsyncLocalContext)
+ if (ShouldUseAsyncLocalContext && value != null && value.isAsyncFlowEnabled)
{
OperationContext.currentAsyncLocalContext.Value = value;
}
@@ -125,11 +125,11 @@ namespace System.ServiceModel
}
}
- private static bool ShouldUseAsyncLocalContext
+ internal static bool ShouldUseAsyncLocalContext
{
get
{
- return CurrentHolder.Context == null && OperationContext.currentAsyncLocalContext.Value != null && OperationContext.currentAsyncLocalContext.Value.isAsyncFlowEnabled;
+ return !ServiceModelAppSettings.DisableOperationContextAsyncFlow && CurrentHolder.Context == null && OperationContext.currentAsyncLocalContext.Value != null && OperationContext.currentAsyncLocalContext.Value.isAsyncFlowEnabled;
}
}
@@ -359,8 +359,16 @@ namespace System.ServiceModel
internal static void EnableAsyncFlow()
{
- CurrentHolder.Context.isAsyncFlowEnabled = true;
- currentAsyncLocalContext.Value = CurrentHolder.Context;
+ EnableAsyncFlow(CurrentHolder.Context);
+ }
+
+ internal static void EnableAsyncFlow(OperationContext oc)
+ {
+ if (oc != null)
+ {
+ oc.isAsyncFlowEnabled = true;
+ currentAsyncLocalContext.Value = oc;
+ }
}
internal static void DisableAsyncFlow()
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/OperationContextScope.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/OperationContextScope.cs
index 3d12f54c864..e386e5868f2 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/OperationContextScope.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/OperationContextScope.cs
@@ -10,12 +10,16 @@ namespace System.ServiceModel
public sealed class OperationContextScope : IDisposable
{
+ [ThreadStatic]
+ static OperationContextScope legacyCurrentScope;
+
static AsyncLocal<OperationContextScope> currentScope = new AsyncLocal<OperationContextScope>();
OperationContext currentContext;
bool disposed;
readonly OperationContext originalContext = OperationContext.Current;
- readonly OperationContextScope originalScope = OperationContextScope.currentScope.Value;
+ readonly OperationContextScope originalScope = OperationContextScope.CurrentScope;
+ readonly Thread thread = Thread.CurrentThread;
public OperationContextScope(IContextChannel channel)
{
@@ -27,6 +31,26 @@ namespace System.ServiceModel
this.PushContext(context);
}
+ private static OperationContextScope CurrentScope
+ {
+ get
+ {
+ return ServiceModelAppSettings.DisableOperationContextAsyncFlow ? legacyCurrentScope : currentScope.Value;
+ }
+
+ set
+ {
+ if (ServiceModelAppSettings.DisableOperationContextAsyncFlow)
+ {
+ legacyCurrentScope = value;
+ }
+ else
+ {
+ currentScope.Value = value;
+ }
+ }
+ }
+
public void Dispose()
{
if (!this.disposed)
@@ -38,20 +62,31 @@ namespace System.ServiceModel
void PushContext(OperationContext context)
{
+ bool isAsyncFlowEnabled = OperationContext.ShouldUseAsyncLocalContext;
+
this.currentContext = context;
- OperationContextScope.currentScope.Value = this;
+
+ if (isAsyncFlowEnabled)
+ {
+ OperationContext.EnableAsyncFlow(this.currentContext);
+ }
+
+ CurrentScope = this;
OperationContext.Current = this.currentContext;
}
void PopContext()
{
- if (OperationContextScope.currentScope.Value != this)
+ if (ServiceModelAppSettings.DisableOperationContextAsyncFlow && this.thread != Thread.CurrentThread)
+ throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.SFxInvalidContextScopeThread0)));
+
+ if (CurrentScope != this)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.SFxInterleavedContextScopes0)));
if (OperationContext.Current != this.currentContext)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.SFxContextModifiedInsideScope0)));
- OperationContextScope.currentScope.Value = this.originalScope;
+ CurrentScope = this.originalScope;
OperationContext.Current = this.originalContext;
if (this.currentContext != null)
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/CryptoHelper.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/CryptoHelper.cs
index 7c0b7a8cb2e..8bc85e1e2b8 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/CryptoHelper.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/CryptoHelper.cs
@@ -181,7 +181,7 @@ namespace System.ServiceModel.Security
catch (InvalidOperationException)
{
algorithmObject = null;
- // We ---- the exception and continue.
+ // We swallow the exception and continue.
}
if (algorithmObject != null)
{
@@ -284,7 +284,7 @@ namespace System.ServiceModel.Security
catch (InvalidOperationException)
{
algorithmObject = null;
- // We ---- the exception and continue.
+ // We swallow the exception and continue.
}
if (algorithmObject != null)
{
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecuritySessionSecurityTokenProvider.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecuritySessionSecurityTokenProvider.cs
index 175f07c58c9..4f2357a444a 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecuritySessionSecurityTokenProvider.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecuritySessionSecurityTokenProvider.cs
@@ -865,9 +865,9 @@ namespace System.ServiceModel.Security
/*
* Session issuance/renewal consists of the following steps (some may be async):
- * 1. Create a channel ([....])
+ * 1. Create a channel (sync)
* 2. Open the channel (async)
- * 3. Create the request to send to server ([....])
+ * 3. Create the request to send to server (sync)
* 4. Send the message and get reply (async)
* 5. Process the reply to get the token
* 6. Close the channel (async) and complete the async result
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecurityUtils.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecurityUtils.cs
index b62aceefcff..98a912c3cc5 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecurityUtils.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecurityUtils.cs
@@ -284,7 +284,7 @@ namespace System.ServiceModel.Security
volatile static bool isSslValidationRequirementDetermined = false;
static readonly int MinimumSslCipherStrength = 128;
- // these are kept in [....] with IIS70
+ // these are kept in sync with IIS70
public const string AuthTypeNTLM = "NTLM";
public const string AuthTypeNegotiate = "Negotiate";
public const string AuthTypeKerberos = "Kerberos";
@@ -1472,7 +1472,7 @@ namespace System.ServiceModel.Security
}
}
- // WORKAROUND, [....], VSWhidbey 561276: The first NetworkCredential must be created in a lock.
+ // WORKAROUND, Microsoft, VSWhidbey 561276: The first NetworkCredential must be created in a lock.
internal static void PrepareNetworkCredential()
{
if (dummyNetworkCredential == null)
@@ -1692,7 +1692,7 @@ namespace System.ServiceModel.Security
{
thisPtr.communicationObject.EndOpen(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
@@ -1767,7 +1767,7 @@ namespace System.ServiceModel.Security
{
thisPtr.communicationObject.EndClose(result);
}
-#pragma warning suppress 56500 // [....], transferring exception to another thread
+#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
catch (Exception e)
{
if (Fx.IsFatal(e))
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/TlsnegoTokenAuthenticator.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/TlsnegoTokenAuthenticator.cs
index 6fe4644020f..688b509f644 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/TlsnegoTokenAuthenticator.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/TlsnegoTokenAuthenticator.cs
@@ -170,8 +170,17 @@ namespace System.ServiceModel.Security
protected override SspiNegotiationTokenAuthenticatorState CreateSspiState(byte[] incomingBlob, string incomingValueTypeUri)
{
- TlsSspiNegotiation tlsNegotiation = new TlsSspiNegotiation(SchProtocols.TlsServer | SchProtocols.Ssl3Server,
+ TlsSspiNegotiation tlsNegotiation = null;
+ if (LocalAppContextSwitches.DisableUsingServicePointManagerSecurityProtocols)
+ {
+ tlsNegotiation = new TlsSspiNegotiation(SchProtocols.TlsServer | SchProtocols.Ssl3Server,
this.serverToken.Certificate, this.ClientTokenAuthenticator != null);
+ }
+ else
+ {
+ var protocol = (SchProtocols)System.Net.ServicePointManager.SecurityProtocol & SchProtocols.ServerMask;
+ tlsNegotiation = new TlsSspiNegotiation(protocol, this.serverToken.Certificate, this.ClientTokenAuthenticator != null);
+ }
// Echo only for TrustFeb2005 and ValueType mismatch
if (this.StandardsManager.MessageSecurityVersion.TrustVersion == TrustVersion.WSTrustFeb2005 &&
this.NegotiationValueType.Value != incomingValueTypeUri)
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/TlsnegoTokenProvider.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/TlsnegoTokenProvider.cs
index 628bada91c0..cfd4485a92e 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/TlsnegoTokenProvider.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/TlsnegoTokenProvider.cs
@@ -74,7 +74,16 @@ namespace System.ServiceModel.Security
{
clientCertificate = token.Certificate;
}
- TlsSspiNegotiation tlsNegotiation = new TlsSspiNegotiation(String.Empty, SchProtocols.Ssl3Client | SchProtocols.TlsClient, clientCertificate);
+ TlsSspiNegotiation tlsNegotiation = null;
+ if(LocalAppContextSwitches.DisableUsingServicePointManagerSecurityProtocols)
+ {
+ tlsNegotiation = new TlsSspiNegotiation(String.Empty, SchProtocols.Ssl3Client | SchProtocols.TlsClient, clientCertificate);
+ }
+ else
+ {
+ var protocol = (SchProtocols)System.Net.ServicePointManager.SecurityProtocol & SchProtocols.ClientMask;
+ tlsNegotiation = new TlsSspiNegotiation(String.Empty, protocol, clientCertificate);
+ }
return new SspiNegotiationTokenProviderState(tlsNegotiation);
}
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSSecurityPolicy.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSSecurityPolicy.cs
index 417886dd3eb..5c559bb53a3 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSSecurityPolicy.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSSecurityPolicy.cs
@@ -2923,7 +2923,7 @@ namespace System.ServiceModel.Security
return;
}
WsdlImporter wsdlImporter;
- // NOTE: [....], Policy import/export is seperate from WSDL however, this policy importer
+ // NOTE: Microsoft, Policy import/export is seperate from WSDL however, this policy importer
// invokes the WsdlImporter. In the event that the current MetadataImporter is a WsdlImporter,
// we should use it's collection of extensions for the import process. Other wise
WsdlImporter currentWsdlImporter = importer as WsdlImporter;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSTrustServiceContract.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSTrustServiceContract.cs
index 1bd584b2806..f601b50e1b1 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSTrustServiceContract.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSTrustServiceContract.cs
@@ -1351,7 +1351,7 @@ namespace System.ServiceModel.Security
internal class ProcessCoreAsyncResult : AsyncResult
{
//
- // Encapsulate the local variables in the [....] version of ProcessCore as fields.
+ // Encapsulate the local variables in the sync version of ProcessCore as fields.
//
WSTrustServiceContract _trustServiceContract;
DispatchContext _dispatchContext;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelAppSettings.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelAppSettings.cs
index 19fba5c99a8..950c5fecdd4 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelAppSettings.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelAppSettings.cs
@@ -16,14 +16,17 @@ namespace System.ServiceModel
internal const string EnsureUniquePerformanceCounterInstanceNamesString = "wcf:ensureUniquePerformanceCounterInstanceNames";
internal const string UseConfiguredTransportSecurityHeaderLayoutString = "wcf:useConfiguredTransportSecurityHeaderLayout";
internal const string UseBestMatchNamedPipeUriString = "wcf:useBestMatchNamedPipeUri";
+ internal const string DisableOperationContextAsyncFlowString = "wcf:disableOperationContextAsyncFlow";
const bool DefaultHttpTransportPerFactoryConnectionPool = false;
const bool DefaultEnsureUniquePerformanceCounterInstanceNames = false;
const bool DefaultUseConfiguredTransportSecurityHeaderLayout = false;
const bool DefaultUseBestMatchNamedPipeUri = false;
+ const bool DefaultDisableOperationContextAsyncFlow = true;
static bool httpTransportPerFactoryConnectionPool;
static bool ensureUniquePerformanceCounterInstanceNames;
static bool useConfiguredTransportSecurityHeaderLayout;
static bool useBestMatchNamedPipeUri;
+ static bool disableOperationContextAsyncFlow;
static volatile bool settingsInitalized = false;
static object appSettingsLock = new object();
@@ -47,6 +50,15 @@ namespace System.ServiceModel
}
}
+ internal static bool DisableOperationContextAsyncFlow
+ {
+ get
+ {
+ EnsureSettingsLoaded();
+ return disableOperationContextAsyncFlow;
+ }
+ }
+
internal static bool UseConfiguredTransportSecurityHeaderLayout
{
get
@@ -97,6 +109,11 @@ namespace System.ServiceModel
ensureUniquePerformanceCounterInstanceNames = DefaultEnsureUniquePerformanceCounterInstanceNames;
}
+ if ((appSettingsSection == null) || !bool.TryParse(appSettingsSection[DisableOperationContextAsyncFlowString], out disableOperationContextAsyncFlow))
+ {
+ disableOperationContextAsyncFlow = DefaultDisableOperationContextAsyncFlow;
+ }
+
if ((appSettingsSection == null) || !bool.TryParse(appSettingsSection[UseConfiguredTransportSecurityHeaderLayoutString], out useConfiguredTransportSecurityHeaderLayout))
{
useConfiguredTransportSecurityHeaderLayout = DefaultUseConfiguredTransportSecurityHeaderLayout;
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Syndication/Rss20FeedFormatter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Syndication/Rss20FeedFormatter.cs
index a417e2b9dc6..a7bfdc2a440 100644
--- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Syndication/Rss20FeedFormatter.cs
+++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Syndication/Rss20FeedFormatter.cs
@@ -1124,7 +1124,7 @@ namespace System.ServiceModel.Syndication
// if there's a single author with an email address, then serialize as the managingEditor
// else serialize the authors as Atom extensions
-#pragma warning disable 56506 // [....]: this.Feed.Authors is never null
+#pragma warning disable 56506 // Microsoft: this.Feed.Authors is never null
if ((this.Feed.Authors.Count == 1) && (this.Feed.Authors[0].Email != null))
#pragma warning restore 56506
{
@@ -1149,7 +1149,7 @@ namespace System.ServiceModel.Syndication
writer.WriteEndElement();
}
-#pragma warning disable 56506 // [....]: this.Feed.Categories is never null
+#pragma warning disable 56506 // Microsoft: this.Feed.Categories is never null
for (int i = 0; i < this.Feed.Categories.Count; ++i)
#pragma warning restore 56506
{
@@ -1161,7 +1161,7 @@ namespace System.ServiceModel.Syndication
writer.WriteElementString(Rss20Constants.GeneratorTag, this.Feed.Generator);
}
-#pragma warning disable 56506 // [....]: this.Feed.Contributors is never null
+#pragma warning disable 56506 // Microsoft: this.Feed.Contributors is never null
if (this.Feed.Contributors.Count > 0)
#pragma warning restore 56506
{
@@ -1263,7 +1263,7 @@ namespace System.ServiceModel.Syndication
WriteAlternateLink(writer, firstAlternateLink, (item.BaseUri != null ? item.BaseUri : feedBaseUri));
}
-#pragma warning disable 56506 // [....], item.Authors is never null
+#pragma warning disable 56506 // Microsoft, item.Authors is never null
if (item.Authors.Count == 1 && !string.IsNullOrEmpty(item.Authors[0].Email))
#pragma warning restore 56506
{
@@ -1281,7 +1281,7 @@ namespace System.ServiceModel.Syndication
}
}
-#pragma warning disable 56506 // [....], item.Categories is never null
+#pragma warning disable 56506 // Microsoft, item.Categories is never null
for (int i = 0; i < item.Categories.Count; ++i)
#pragma warning restore 56506
{
@@ -1409,7 +1409,7 @@ namespace System.ServiceModel.Syndication
}
}
-#pragma warning disable 56506 // [....], item.COntributors is never null
+#pragma warning disable 56506 // Microsoft, item.COntributors is never null
if (item.Contributors.Count > 0)
#pragma warning restore 56506
{
diff --git a/mcs/class/referencesource/System.Web.ApplicationServices/ApplicationServicesStrings.resx b/mcs/class/referencesource/System.Web.ApplicationServices/ApplicationServicesStrings.resx
new file mode 100644
index 00000000000..3455657fab0
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.ApplicationServices/ApplicationServicesStrings.resx
@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <data name="Can_not_use_encrypted_passwords_with_autogen_keys" xml:space="preserve">
+ <value>You must specify a non-autogenerated machine key to store passwords in the encrypted format. Either specify a different passwordFormat, or change the machineKey configuration to use a non-autogenerated decryption key.</value>
+ </data>
+ <data name="Membership_DuplicateEmail" xml:space="preserve">
+ <value>The E-mail address is already in use.</value>
+ </data>
+ <data name="Membership_DuplicateProviderUserKey" xml:space="preserve">
+ <value>The provider user key is already in use.</value>
+ </data>
+ <data name="Membership_DuplicateUserName" xml:space="preserve">
+ <value>The username is already in use.</value>
+ </data>
+ <data name="Membership_InvalidAnswer" xml:space="preserve">
+ <value>The password-answer supplied is invalid.</value>
+ </data>
+ <data name="Membership_InvalidEmail" xml:space="preserve">
+ <value>The E-mail supplied is invalid.</value>
+ </data>
+ <data name="Membership_InvalidPassword" xml:space="preserve">
+ <value>The password supplied is invalid. Passwords must conform to the password strength requirements configured for the default provider.</value>
+ </data>
+ <data name="Membership_InvalidProviderUserKey" xml:space="preserve">
+ <value>The provider user key supplied is invalid. It must be of type System.Guid.</value>
+ </data>
+ <data name="Membership_InvalidQuestion" xml:space="preserve">
+ <value>The password-question supplied is invalid. Note that the current provider configuration requires a valid password question and answer. As a result, a CreateUser overload that accepts question and answer parameters must also be used.</value>
+ </data>
+ <data name="Membership_InvalidUserName" xml:space="preserve">
+ <value>The username supplied is invalid.</value>
+ </data>
+ <data name="Membership_no_error" xml:space="preserve">
+ <value>No Error.</value>
+ </data>
+ <data name="Membership_provider_name_invalid" xml:space="preserve">
+ <value>The membership provider name specified is invalid.</value>
+ </data>
+ <data name="Membership_UserRejected" xml:space="preserve">
+ <value>The user was rejected.</value>
+ </data>
+ <data name="Parameter_can_not_be_empty" xml:space="preserve">
+ <value>The parameter '{0}' must not be empty.</value>
+ </data>
+ <data name="Platform_not_supported" xml:space="preserve">
+ <value>This member is not supported on the .NET Framework Client Profile.</value>
+ </data>
+ <data name="Provider_Error" xml:space="preserve">
+ <value>The Provider encountered an unknown error.</value>
+ </data>
+ <data name="Provider_must_implement_type" xml:space="preserve">
+ <value>Provider must implement the class '{0}'.</value>
+ </data>
+ <data name="CustomLoader_NoAttributeFound" xml:space="preserve">
+ <value>The assembly '{0}' did not contain an assembly-level CustomLoaderAttribute.</value>
+ </data>
+ <data name="CustomLoader_NotInFullTrust" xml:space="preserve">
+ <value>Custom loaders can only be used by fully-trusted applications (&lt;trust level="Full" /&gt;).</value>
+ </data>
+ <data name="CustomLoader_ForbiddenByHost" xml:space="preserve">
+ <value>The host forbids the use of custom loaders.</value>
+ </data>
+ <data name="CustomLoader_MustImplementICustomLoader" xml:space="preserve">
+ <value>The provided type '{0}' must implement the ICustomLoader interface.</value>
+ </data>
+</root> \ No newline at end of file
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/AnnotationBase.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/AnnotationBase.cs
new file mode 100644
index 00000000000..57f8649f26e
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/AnnotationBase.cs
@@ -0,0 +1,4437 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: Annotation.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: Annotation, AnnotationPositionChangingEventArgs
+//
+// Purpose: Base class for all anotation objects. Provides
+// basic set of properties and methods.
+//
+// Reviewed:
+//
+//===================================================================
+
+#region Used namespace
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Globalization;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Text;
+using System.Drawing.Drawing2D;
+using System.Diagnostics;
+using System.Diagnostics.CodeAnalysis;
+
+#if Microsoft_CONTROL
+using System.ComponentModel.Design.Serialization;
+using System.Reflection;
+using System.Windows.Forms;
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+#else
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.DataVisualization.Charting;
+using System.Web.UI.DataVisualization.Charting.Data;
+using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ #region Enumerations
+
+ /// <summary>
+ /// Annotation object selection points style.
+ /// </summary>
+ /// <remarks>
+ /// Enumeration is for internal use only and should not be part of the documentation.
+ /// </remarks>
+ internal enum SelectionPointsStyle
+ {
+ /// <summary>
+ /// Selection points are displayed top left and bottom right corners
+ /// </summary>
+ TwoPoints,
+
+ /// <summary>
+ /// Selection points are displayed on all sides and corners of the rectangle.
+ /// </summary>
+ Rectangle,
+ }
+
+ /// <summary>
+ /// Annotation object resizing\moving mode.
+ /// </summary>
+ /// <remarks>
+ /// Enumeration is for internal use only and should not be part of the documentation.
+ /// </remarks>
+ internal enum ResizingMode
+ {
+ /// <summary>
+ /// Top Left selection handle is used.
+ /// </summary>
+ TopLeftHandle = 0,
+ /// <summary>
+ /// Top selection handle is used.
+ /// </summary>
+ TopHandle = 1,
+ /// <summary>
+ /// Top Right selection handle is used.
+ /// </summary>
+ TopRightHandle = 2,
+ /// <summary>
+ /// Right selection handle is used.
+ /// </summary>
+ RightHandle = 3,
+ /// <summary>
+ /// Bottom Right selection handle is used.
+ /// </summary>
+ BottomRightHandle = 4,
+ /// <summary>
+ /// Bottom selection handle is used.
+ /// </summary>
+ BottomHandle = 5,
+ /// <summary>
+ /// Bottom Left selection handle is used.
+ /// </summary>
+ BottomLeftHandle = 6,
+ /// <summary>
+ /// Left selection handle is used.
+ /// </summary>
+ LeftHandle = 7,
+ /// <summary>
+ /// Anchor selection handle is used.
+ /// </summary>
+ AnchorHandle = 8,
+ /// <summary>
+ /// No selection handles used - moving mode.
+ /// </summary>
+ Moving = 16,
+ /// <summary>
+ /// Moving points of the annotation path.
+ /// </summary>
+ MovingPathPoints = 32,
+ /// <summary>
+ /// No moving or resizing.
+ /// </summary>
+ None = 64,
+ }
+
+#endregion
+
+ /// <summary>
+ /// <b>Annotation</b> is an abstract class that defines properties and methods
+ /// common to all annotations.
+ /// </summary>
+ /// <remarks>
+ /// All annotations are derived from the <b>Annotation</b> class, which can be
+ /// used to set properties common to all annotation objects (e.g. color, position,
+ /// anchoring and others).
+ /// </remarks>
+ [
+ SRDescription("DescriptionAttributeAnnotation_Annotation"),
+ DefaultProperty("Name"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+#if !Microsoft_CONTROL
+ public abstract class Annotation : ChartNamedElement, IChartMapArea
+#else
+ public abstract class Annotation : ChartNamedElement
+#endif
+ {
+ #region Fields
+
+
+ // Name of the chart area the annotation is clipped to
+ private string _clipToChartArea = Constants.NotSetValue;
+
+ // Indicates that annotation is selected
+ private bool _isSelected = false;
+
+ // Indicates that annotation size is defined in relative chart coordinates
+ private bool _isSizeAlwaysRelative = true;
+
+ // Position attribute fields
+ private double _x = double.NaN;
+ private double _y = double.NaN;
+ private double _width = double.NaN;
+ private double _height = double.NaN;
+
+ // Annotation axes attaching fields
+ private string _axisXName = String.Empty;
+ private string _axisYName = String.Empty;
+ private Axis _axisX = null;
+ private Axis _axisY = null;
+
+ // Visual attribute fields
+ private bool _visible = true;
+ private ContentAlignment _alignment = ContentAlignment.MiddleCenter;
+ private Color _foreColor = Color.Black;
+ private FontCache _fontCache = new FontCache();
+ private Font _textFont;
+ private TextStyle _textStyle = TextStyle.Default;
+ internal Color lineColor = Color.Black;
+ private int _lineWidth = 1;
+ private ChartDashStyle _lineDashStyle = ChartDashStyle.Solid;
+ private Color _backColor = Color.Empty;
+ private ChartHatchStyle _backHatchStyle = ChartHatchStyle.None;
+ private GradientStyle _backGradientStyle = GradientStyle.None;
+ private Color _backSecondaryColor = Color.Empty;
+ private Color _shadowColor = Color.FromArgb(128, 0, 0, 0);
+ private int _shadowOffset = 0;
+
+ // Anchor position attribute fields
+ private string _anchorDataPointName = String.Empty;
+ private DataPoint _anchorDataPoint = null;
+ private DataPoint _anchorDataPoint2 = null;
+ private double _anchorX = double.NaN;
+ private double _anchorY = double.NaN;
+ internal double anchorOffsetX = 0.0;
+ internal double anchorOffsetY = 0.0;
+ internal ContentAlignment anchorAlignment = ContentAlignment.BottomCenter;
+
+ // Selection handles position (starting top-left and moving clockwise)
+ internal RectangleF[] selectionRects = null;
+
+ // Annotation tooltip
+ private string _tooltip = String.Empty;
+
+ // Selection handles size
+ internal const int selectionMarkerSize = 6;
+
+ // Pre calculated relative position of annotation and anchor point
+ internal RectangleF currentPositionRel = new RectangleF(float.NaN, float.NaN, float.NaN, float.NaN);
+ internal PointF currentAnchorLocationRel = new PointF(float.NaN, float.NaN);
+
+ // Smart labels style
+ private AnnotationSmartLabelStyle _smartLabelStyle = null;
+
+ // Index of last selected point in the annotation path
+ internal int currentPathPointIndex = -1;
+
+ // Group this annotation belongs too
+ internal AnnotationGroup annotationGroup = null;
+
+#if Microsoft_CONTROL
+
+ // Selection and editing permissions
+ private bool _allowSelecting = false;
+ private bool _allowMoving = false;
+ private bool _allowAnchorMoving = false;
+ private bool _allowResizing = false;
+ private bool _allowTextEditing = false;
+ private bool _allowPathEditing = false;
+
+#endif //Microsoft_CONTROL
+
+#if Microsoft_CONTROL
+
+ // Indicates that annotation position was changed. Flag used to fire events.
+ internal bool positionChanged = false;
+
+ // Relative location of last placement position
+ internal PointF lastPlacementPosition = PointF.Empty;
+
+ // Relative location of annotation anchor, when it's started to move
+ internal PointF startMoveAnchorLocationRel = PointF.Empty;
+
+#endif // Microsoft_CONTROL
+
+ // Relative position of annotation, when it's started to move/resize
+ internal RectangleF startMovePositionRel = RectangleF.Empty;
+
+ // Relative position of annotation, when it's started to move/resize
+ internal GraphicsPath startMovePathRel = null;
+
+#if !Microsoft_CONTROL
+
+ // Annotation map area attributes
+ private string _url = String.Empty;
+ private string _mapAreaAttributes = String.Empty;
+ private string _postbackValue = String.Empty;
+
+#endif // !Microsoft_CONTROL
+
+ /// <summary>
+ /// Limit of annotation width and height.
+ /// </summary>
+ internal static double WidthHightLimit = 290000000;
+
+ #endregion
+
+ #region Constructors
+ /// <summary>
+ /// Initializes a new instance of the <see cref="Annotation"/> class.
+ /// </summary>
+ protected Annotation()
+ {
+ _textFont = _fontCache.DefaultFont;
+ }
+
+ #endregion
+
+ #region Properties
+
+ #region Miscellaneous
+
+ /// <summary>
+ /// Gets or sets an annotation's unique name.
+ /// </summary>
+ /// <value>
+ /// A <b>string</b> that represents an annotation's unique name.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeName4"),
+ ParenthesizePropertyNameAttribute(true),
+ ]
+ public override string Name
+ {
+ get
+ {
+ return base.Name;
+ }
+ set
+ {
+ base.Name = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an annotation's type name.
+ /// </summary>
+ /// <remarks>
+ /// This property is used to get the name of each annotation Style
+ /// (e.g. Line, Rectangle, Ellipse).
+ /// <para>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeAnnotation_AnnotationType"),
+ ]
+ public abstract string AnnotationType
+ {
+ get;
+ }
+
+
+ /// <summary>
+ /// Gets or sets the name of the chart area which an annotation is clipped to.
+ /// </summary>
+ /// <value>
+ /// A string which represents the name of an existing chart area.
+ /// </value>
+ /// <remarks>
+ /// If the chart area name is specified, an annotation will only be drawn inside the
+ /// plotting area of the chart area specified. All parts of the annotation
+ /// outside of the plotting area will be clipped.
+ /// <para>
+ /// To disable chart area clipping, set the property to "NotSet" or an empty string.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(Constants.NotSetValue),
+ SRDescription("DescriptionAttributeAnnotationClipToChartArea"),
+ TypeConverter(typeof(LegendAreaNameConverter))
+ ]
+ virtual public string ClipToChartArea
+ {
+ get
+ {
+ return _clipToChartArea;
+ }
+ set
+ {
+ if (value != _clipToChartArea)
+ {
+ if (String.IsNullOrEmpty(value))
+ {
+ _clipToChartArea = Constants.NotSetValue;
+ }
+ else
+ {
+ if (Chart != null && Chart.ChartAreas != null)
+ {
+ Chart.ChartAreas.VerifyNameReference(value);
+ }
+ _clipToChartArea = value;
+ }
+ this.Invalidate();
+ }
+ }
+ }
+
+
+ /// <summary>
+ /// Gets or sets the smart labels style of an annotation.
+ /// </summary>
+ /// <value>
+ /// An <see cref="AnnotationSmartLabelStyle"/> object that represents an annotation's
+ /// smart labels style properties.
+ /// </value>
+ /// <remarks>
+ /// Smart labels are used to prevent an annotation from overlapping data point labels
+ /// and other annotations.
+ /// <para>
+ /// Note that data point labels must also have smart labels enabled.
+ /// </para>
+ /// </remarks>
+ [
+ Browsable(true),
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeSmartLabels"),
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ ]
+ public AnnotationSmartLabelStyle SmartLabelStyle
+ {
+ get
+ {
+ if (this._smartLabelStyle == null)
+ {
+ this._smartLabelStyle = new AnnotationSmartLabelStyle(this);
+ }
+ return _smartLabelStyle;
+ }
+ set
+ {
+ value.chartElement = this;
+ _smartLabelStyle = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets the group, if any, the annotation belongs to.
+ /// </summary>
+ [
+ Browsable(false),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ ]
+ public AnnotationGroup AnnotationGroup
+ {
+ get { return this.annotationGroup; }
+ }
+
+ #endregion
+
+ #region Position
+
+ /// <summary>
+ /// Gets or sets a flag that specifies whether the size of an annotation is always
+ /// defined in relative chart coordinates.
+ /// <seealso cref="Width"/>
+ /// <seealso cref="Height"/>
+ /// </summary>
+ /// <value>
+ /// <b>True</b> if an annotation's <see cref="Width"/> and <see cref="Height"/> are always
+ /// in chart relative coordinates, <b>false</b> otherwise.
+ /// </value>
+ /// <remarks>
+ /// An annotation's width and height may be set in relative chart or axes coordinates.
+ /// By default, relative chart coordinates are used.
+ /// <para>
+ /// To use axes coordinates for size set the <b>IsSizeAlwaysRelative</b> property to
+ /// <b>false</b> and either anchor the annotation to a data point or set the
+ /// <see cref="AxisX"/> or <see cref="AxisY"/> properties.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributePosition"),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeSizeAlwaysRelative"),
+ ]
+ virtual public bool IsSizeAlwaysRelative
+ {
+ get
+ {
+ return _isSizeAlwaysRelative;
+ }
+ set
+ {
+ _isSizeAlwaysRelative = value;
+ this.ResetCurrentRelativePosition();
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the X coordinate of an annotation.
+ /// <seealso cref="AnchorDataPoint"/>
+ /// <seealso cref="AnchorX"/>
+ /// </summary>
+ /// <value>
+ /// A Double value that represents the X coordinate of an annotation.
+ /// </value>
+ /// <remarks>
+ /// The X coordinate of an annotation is in relative chart coordinates or axes coordinates. Chart
+ /// relative coordinates are used by default.
+ /// <para>
+ /// To use axes coordinates, anchor
+ /// an annotation to a data point using the <see cref="AnchorDataPoint"/> property, or
+ /// set the annotation axes using the <see cref="AxisX"/> or <see cref="AxisY"/> properties.
+ /// </para>
+ /// <para>
+ /// Set the X position to Double.NaN ("NotSet") to achieve automatic position calculation
+ /// when the annotation is anchored using the <see cref="AnchorDataPoint"/> property or
+ /// the <see cref="AnchorX"/> and <see cref="AnchorY"/> properties.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributePosition"),
+ DefaultValue(double.NaN),
+ SRDescription("DescriptionAttributeAnnotationBaseX"),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ TypeConverter(typeof(DoubleNanValueConverter)),
+ ]
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "X")]
+ virtual public double X
+ {
+ get
+ {
+ return _x;
+ }
+ set
+ {
+ _x = value;
+ this.ResetCurrentRelativePosition();
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the Y coordinate of an annotation.
+ /// <seealso cref="AnchorDataPoint"/>
+ /// <seealso cref="AnchorY"/>
+ /// </summary>
+ /// <value>
+ /// A Double value that represents the Y coordinate of an annotation.
+ /// </value>
+ /// <remarks>
+ /// The Y coordinate of an annotation is in relative chart coordinates or axes coordinates. Chart
+ /// relative coordinates are used by default.
+ /// <para>
+ /// To use axes coordinates, anchor
+ /// an annotation to a data point using the <see cref="AnchorDataPoint"/> property, or
+ /// set the annotation axes using the <see cref="AxisX"/> or <see cref="AxisY"/> properties.
+ /// </para>
+ /// <para>
+ /// Set the Y position to Double.NaN ("NotSet") to achieve automatic position calculation
+ /// when the annotation is anchored using the <see cref="AnchorDataPoint"/> property or
+ /// the <see cref="AnchorX"/> and <see cref="AnchorY"/> properties.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributePosition"),
+ DefaultValue(double.NaN),
+ SRDescription("DescriptionAttributeAnnotationBaseY"),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ TypeConverter(typeof(DoubleNanValueConverter)),
+ ]
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Y")]
+ virtual public double Y
+ {
+ get
+ {
+ return _y;
+ }
+ set
+ {
+ _y = value;
+ this.ResetCurrentRelativePosition();
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an annotation's width.
+ /// <seealso cref="IsSizeAlwaysRelative"/>
+ /// <seealso cref="AxisX"/>
+ /// </summary>
+ /// <value>
+ /// A Double value that represents an annotation's width.
+ /// </value>
+ /// <remarks>
+ /// An annotation's width can be a negative value, in which case the annotation orientation
+ /// is switched.
+ /// <para>
+ /// Annotation width can be in relative chart or axes coordinates. Chart
+ /// relative coordinates are used by default.
+ /// </para>
+ /// <para>
+ /// To use axes coordinates, anchor
+ /// an annotation to a data point using the <see cref="AnchorDataPoint"/> property, or
+ /// set the annotation axes using the <see cref="AxisX"/> or <see cref="AxisY"/> properties
+ /// and set the <see cref="IsSizeAlwaysRelative"/> property to <b>false</b>.
+ /// </para>
+ /// <para>
+ /// Set the width to Double.NaN ("NotSet") to achieve automatic size calculation for
+ /// annotations with text. The size will automatically be calculated based on
+ /// the annotation text and font size.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributePosition"),
+ DefaultValue(double.NaN),
+ SRDescription("DescriptionAttributeAnnotationWidth"),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ TypeConverter(typeof(DoubleNanValueConverter)),
+ ]
+ virtual public double Width
+ {
+ get
+ {
+ return _width;
+ }
+ set
+ {
+ if (value < -WidthHightLimit || value > WidthHightLimit)
+ {
+ throw new ArgumentException(SR.ExceptionValueMustBeInRange("Width", (-WidthHightLimit).ToString(CultureInfo.CurrentCulture), WidthHightLimit.ToString(CultureInfo.CurrentCulture)));
+ }
+ _width = value;
+ this.ResetCurrentRelativePosition();
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an annotation's height.
+ /// <seealso cref="IsSizeAlwaysRelative"/>
+ /// <seealso cref="AxisY"/>
+ /// </summary>
+ /// <value>
+ /// A Double value that represents an annotation's height.
+ /// </value>
+ /// <remarks>
+ /// An annotation's height can be a negative value, in which case the annotation orientation
+ /// is switched.
+ /// <para>
+ /// Annotation height can be in relative chart or axes coordinates. Chart
+ /// relative coordinates are used by default.
+ /// </para>
+ /// <para>
+ /// To use axes coordinates, anchor
+ /// an annotation to a data point using the <see cref="AnchorDataPoint"/> property, or
+ /// set the annotation axes using the <see cref="AxisX"/> or <see cref="AxisY"/> properties
+ /// and set the <see cref="IsSizeAlwaysRelative"/> property to <b>false</b>.
+ /// </para>
+ /// <para>
+ /// Set the height to Double.NaN ("NotSet") to achieve automatic size calculation for
+ /// annotations with text. The size will automatically be calculated based on
+ /// the annotation text and font size.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributePosition"),
+ DefaultValue(double.NaN),
+ SRDescription("DescriptionAttributeAnnotationHeight"),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ TypeConverter(typeof(DoubleNanValueConverter)),
+ ]
+ virtual public double Height
+ {
+ get
+ {
+ return _height;
+ }
+ set
+ {
+ if (value < -WidthHightLimit || value > WidthHightLimit)
+ {
+ throw new ArgumentException(SR.ExceptionValueMustBeInRange("Height", (-WidthHightLimit).ToString(CultureInfo.CurrentCulture), WidthHightLimit.ToString(CultureInfo.CurrentCulture)));
+ }
+ _height = value;
+ this.ResetCurrentRelativePosition();
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an annotation position's right boundary.
+ /// <seealso cref="IsSizeAlwaysRelative"/>
+ /// <seealso cref="AxisX"/>
+ /// </summary>
+ /// <value>
+ /// A Double value that represents the position of an annotation's right boundary.
+ /// </value>
+ /// <remarks>
+ /// To use axes coordinates, anchor
+ /// an annotation to a data point using the <see cref="AnchorDataPoint"/> property, or
+ /// set the annotation axes using the <see cref="AxisX"/> or <see cref="AxisY"/> properties
+ /// and set the <see cref="IsSizeAlwaysRelative"/> property to <b>false</b>.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributePosition"),
+ DefaultValue(double.NaN),
+ SRDescription("DescriptionAttributeRight3"),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ Browsable(false),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ TypeConverter(typeof(DoubleNanValueConverter)),
+ ]
+ virtual public double Right
+ {
+ get
+ {
+ return _x + _width;
+ }
+ set
+ {
+ _width = value - _x;
+ this.ResetCurrentRelativePosition();
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an annotation position's bottom boundary.
+ /// <seealso cref="IsSizeAlwaysRelative"/>
+ /// <seealso cref="AxisX"/>
+ /// </summary>
+ /// <value>
+ /// A Double value that represents the position of an annotation's bottom boundary.
+ /// </value>
+ /// <remarks>
+ /// To use axes coordinates, anchor
+ /// an annotation to a data point using the <see cref="AnchorDataPoint"/> property, or
+ /// set the annotation axes using the <see cref="AxisX"/> or <see cref="AxisY"/> properties
+ /// and set the <see cref="IsSizeAlwaysRelative"/> property to <b>false</b>.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributePosition"),
+ DefaultValue(double.NaN),
+ SRDescription("DescriptionAttributeBottom"),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ Browsable(false),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ TypeConverter(typeof(DoubleNanValueConverter)),
+ ]
+ virtual public double Bottom
+ {
+ get
+ {
+ return _y + _height;
+ }
+ set
+ {
+ _height = value - _y;
+ this.ResetCurrentRelativePosition();
+ Invalidate();
+ }
+ }
+
+ #endregion
+
+ #region Visual Attributes
+
+#if Microsoft_CONTROL
+ /// <summary>
+ /// Gets or sets a flag that determines if an annotation is selected.
+ /// <seealso cref="AllowSelecting"/>
+ /// </summary>
+ /// <value>
+ /// <b>True</b> if the annotation is selected, <b>false</b> otherwise.
+ /// </value>
+#else
+ /// <summary>
+ /// Gets or sets a flag that determines if an annotation is selected.
+ /// </summary>
+ /// <value>
+ /// <b>True</b> if the annotation is selected, <b>false</b> otherwise.
+ /// </value>
+#endif // Microsoft_CONTROL
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(false),
+ Browsable(false),
+ SRDescription("DescriptionAttributeSelected"),
+ ]
+ virtual public bool IsSelected
+ {
+ get
+ {
+ return _isSelected;
+ }
+ set
+ {
+ _isSelected = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an annotation selection points style.
+ /// </summary>
+ /// <value>
+ /// A <see cref="SelectionPointsStyle"/> value that represents annotation
+ /// selection style.
+ /// </value>
+ /// <remarks>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(SelectionPointsStyle.Rectangle),
+ ParenthesizePropertyNameAttribute(true),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeSelectionPointsStyle"),
+ ]
+ virtual internal SelectionPointsStyle SelectionPointsStyle
+ {
+ get
+ {
+ return SelectionPointsStyle.Rectangle;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag that specifies whether an annotation is visible.
+ /// </summary>
+ /// <value>
+ /// <b>True</b> if the annotation is visible, <b>false</b> otherwise.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeVisible"),
+ ParenthesizePropertyNameAttribute(true),
+ ]
+ virtual public bool Visible
+ {
+ get
+ {
+ return _visible;
+ }
+ set
+ {
+ _visible = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an annotation's content alignment.
+ /// </summary>
+ /// <value>
+ /// A <see cref="ContentAlignment"/> value that represents the content alignment.
+ /// </value>
+ /// <remarks>
+ /// This property is used to align text for <see cref="TextAnnotation"/>, <see cref="RectangleAnnotation"/>,
+ /// <see cref="EllipseAnnotation"/> and <see cref="CalloutAnnotation"/> objects, and to align
+ /// a non-scaled image inside an <see cref="ImageAnnotation"/> object.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(typeof(ContentAlignment), "MiddleCenter"),
+ SRDescription("DescriptionAttributeAlignment"),
+ ]
+ virtual public ContentAlignment Alignment
+ {
+ get
+ {
+ return _alignment;
+ }
+ set
+ {
+ _alignment = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the text color of an annotation.
+ /// <seealso cref="Font"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value used for the text color of an annotation.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeForeColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ virtual public Color ForeColor
+ {
+ get
+ {
+ return _foreColor;
+ }
+ set
+ {
+ _foreColor = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the font of an annotation's text.
+ /// <seealso cref="ForeColor"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Font"/> object used for an annotation's text.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(typeof(Font), "Microsoft Sans Serif, 8pt"),
+ SRDescription("DescriptionAttributeTextFont"),
+ ]
+ virtual public Font Font
+ {
+ get
+ {
+ return _textFont;
+ }
+ set
+ {
+ _textFont = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an annotation's text style.
+ /// <seealso cref="Font"/>
+ /// <seealso cref="ForeColor"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="TextStyle"/> value used to draw an annotation's text.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(typeof(TextStyle), "Default"),
+ SRDescription("DescriptionAttributeTextStyle"),
+ ]
+ virtual public TextStyle TextStyle
+ {
+ get
+ {
+ return _textStyle;
+ }
+ set
+ {
+ _textStyle = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the color of an annotation line.
+ /// <seealso cref="LineWidth"/>
+ /// <seealso cref="LineDashStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value used to draw an annotation line.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeLineColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ virtual public Color LineColor
+ {
+ get
+ {
+ return lineColor;
+ }
+ set
+ {
+ lineColor = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the width of an annotation line.
+ /// <seealso cref="LineColor"/>
+ /// <seealso cref="LineDashStyle"/>
+ /// </summary>
+ /// <value>
+ /// An integer value defining the width of an annotation line in pixels.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(1),
+ SRDescription("DescriptionAttributeLineWidth"),
+ ]
+ virtual public int LineWidth
+ {
+ get
+ {
+ return _lineWidth;
+ }
+ set
+ {
+ if(value < 0)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionAnnotationLineWidthIsNegative));
+ }
+ _lineWidth = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the style of an annotation line.
+ /// <seealso cref="LineWidth"/>
+ /// <seealso cref="LineColor"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="ChartDashStyle"/> value used to draw an annotation line.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(ChartDashStyle.Solid),
+ SRDescription("DescriptionAttributeLineDashStyle"),
+ ]
+ virtual public ChartDashStyle LineDashStyle
+ {
+ get
+ {
+ return _lineDashStyle;
+ }
+ set
+ {
+ _lineDashStyle = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background color of an annotation.
+ /// <seealso cref="BackSecondaryColor"/>
+ /// <seealso cref="BackHatchStyle"/>
+ /// <seealso cref="BackGradientStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value used for the background of an annotation.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeBackColor"),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ virtual public Color BackColor
+ {
+ get
+ {
+ return _backColor;
+ }
+ set
+ {
+ _backColor = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background hatch style of an annotation.
+ /// <seealso cref="BackSecondaryColor"/>
+ /// <seealso cref="BackColor"/>
+ /// <seealso cref="BackGradientStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="ChartHatchStyle"/> value used for the background of an annotation.
+ /// </value>
+ /// <remarks>
+ /// Two colors are used to draw the hatching, <see cref="BackColor"/> and <see cref="BackSecondaryColor"/>.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(ChartHatchStyle.None),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackHatchStyle"),
+ Editor(Editors.HatchStyleEditor.Editor, Editors.HatchStyleEditor.Base)
+ ]
+ virtual public ChartHatchStyle BackHatchStyle
+ {
+ get
+ {
+ return _backHatchStyle;
+ }
+ set
+ {
+ _backHatchStyle = value;
+ Invalidate();
+ }
+ }
+ /// <summary>
+ /// Gets or sets the background gradient style of an annotation.
+ /// <seealso cref="BackSecondaryColor"/>
+ /// <seealso cref="BackColor"/>
+ /// <seealso cref="BackHatchStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="GradientStyle"/> value used for the background of an annotation.
+ /// </value>
+ /// <remarks>
+ /// Two colors are used to draw the gradient, <see cref="BackColor"/> and <see cref="BackSecondaryColor"/>.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(GradientStyle.None),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackGradientStyle"),
+ Editor(Editors.GradientEditor.Editor, Editors.GradientEditor.Base)
+ ]
+ virtual public GradientStyle BackGradientStyle
+ {
+ get
+ {
+ return _backGradientStyle;
+ }
+ set
+ {
+ _backGradientStyle = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the secondary background color of an annotation.
+ /// <seealso cref="BackColor"/>
+ /// <seealso cref="BackHatchStyle"/>
+ /// <seealso cref="BackGradientStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value used for the secondary color of an annotation background with
+ /// hatching or gradient fill.
+ /// </value>
+ /// <remarks>
+ /// This color is used with <see cref="BackColor"/> when <see cref="BackHatchStyle"/> or
+ /// <see cref="BackGradientStyle"/> are used.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(typeof(Color), ""),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackSecondaryColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ virtual public Color BackSecondaryColor
+ {
+ get
+ {
+ return _backSecondaryColor;
+ }
+ set
+ {
+ _backSecondaryColor = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the color of an annotation's shadow.
+ /// <seealso cref="ShadowOffset"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value used to draw an annotation's shadow.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(typeof(Color), "128,0,0,0"),
+ SRDescription("DescriptionAttributeShadowColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ virtual public Color ShadowColor
+ {
+ get
+ {
+ return _shadowColor;
+ }
+ set
+ {
+ _shadowColor = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the offset between an annotation and its shadow.
+ /// <seealso cref="ShadowColor"/>
+ /// </summary>
+ /// <value>
+ /// An integer value that represents the offset between an annotation and its shadow.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(0),
+ SRDescription("DescriptionAttributeShadowOffset"),
+ ]
+ virtual public int ShadowOffset
+ {
+ get
+ {
+ return _shadowOffset;
+ }
+ set
+ {
+ _shadowOffset = value;
+ Invalidate();
+ }
+ }
+
+ #endregion
+
+ #region Axes Attaching
+
+ /// <summary>
+ /// Gets or sets the name of the X axis which an annotation is attached to.
+ /// </summary>
+ /// <value>
+ /// A string value that represents the name of the X axis which an annotation
+ /// is attached to.
+ /// </value>
+ /// <remarks>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAnchorAxes"),
+ DefaultValue(""),
+ Browsable(false),
+ Bindable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ SRDescription("DescriptionAttributeAxisXName"),
+ ]
+ virtual public string AxisXName
+ {
+ get
+ {
+ if(_axisXName.Length == 0 && _axisX != null)
+ {
+ _axisXName = GetAxisName(_axisX);
+ }
+ return _axisXName;
+ }
+ set
+ {
+ _axisXName = value;
+ _axisX = null;
+ this.ResetCurrentRelativePosition();
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the name of the Y axis which an annotation is attached to.
+ /// </summary>
+ /// <value>
+ /// A string value that represents the name of the Y axis which an annotation
+ /// is attached to.
+ /// </value>
+ /// <remarks>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAnchorAxes"),
+ Browsable(false),
+ Bindable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeAxisYName"),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ ]
+ virtual public string AxisYName
+ {
+ get
+ {
+ // Always return empty string to prevent property serialization
+ // "YAxisName" property will be used instead.
+ return string.Empty;
+ }
+ set
+ {
+ this.YAxisName = value;
+ }
+ }
+
+
+ /// <summary>
+ /// Gets or sets the name of the Y axis which an annotation is attached to.
+ /// NOTE: "AxisYName" property was used before but the name was changed to solve the
+ /// duplicated hash value during the serialization with the "TitleSeparator" property.
+ /// </summary>
+ /// <value>
+ /// A string value that represents the name of the Y axis which an annotation
+ /// is attached to.
+ /// </value>
+ /// <remarks>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAnchorAxes"),
+ Browsable(false),
+ Bindable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeAxisYName"),
+ ]
+ virtual public string YAxisName
+ {
+ get
+ {
+ if(_axisYName.Length == 0 && _axisY != null)
+ {
+ _axisYName = GetAxisName(_axisY);
+ }
+ return _axisYName;
+ }
+ set
+ {
+ _axisYName = value;
+ _axisY = null;
+ this.ResetCurrentRelativePosition();
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the X axis which an annotation is attached to.
+ /// <seealso cref="AxisY"/>
+ /// <seealso cref="IsSizeAlwaysRelative"/>
+ /// </summary>
+ /// <value>
+ /// <see cref="Axis"/> object which an annotation is attached to.
+ /// </value>
+ /// <remarks>
+ /// When an annotation is attached to an axis, its X position is always in
+ /// axis coordinates. To define an annotation's size in axis coordinates as well,
+ /// make sure the <see cref="IsSizeAlwaysRelative"/> property is set to <b>false</b>.
+ /// <para>
+ /// Set this value to <b>null</b> or <b>nothing</b> to disable attachment to the axis.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAnchorAxes"),
+ DefaultValue(null),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeAxisX"),
+ Editor(Editors.AnnotationAxisUITypeEditor.Editor, Editors.AnnotationAxisUITypeEditor.Base),
+ TypeConverter(typeof(AnnotationAxisValueConverter)),
+ ]
+ virtual public Axis AxisX
+ {
+ get
+ {
+ if(_axisX == null && _axisXName.Length > 0)
+ {
+ _axisX = GetAxisByName(_axisXName);
+ }
+ return _axisX;
+ }
+ set
+ {
+ _axisX = value;
+ _axisXName = String.Empty;
+ this.ResetCurrentRelativePosition();
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the Y axis which an annotation is attached to.
+ /// <seealso cref="AxisX"/>
+ /// <seealso cref="IsSizeAlwaysRelative"/>
+ /// </summary>
+ /// <value>
+ /// <see cref="Axis"/> object which an annotation is attached to.
+ /// </value>
+ /// <remarks>
+ /// When an annotation is attached to an axis, its Y position is always in
+ /// axis coordinates. To define an annotation's size in axis coordinates as well,
+ /// make sure <see cref="IsSizeAlwaysRelative"/> property is set to <b>false</b>.
+ /// <para>
+ /// Set this value to <b>null</b> or <b>nothing</b> to disable annotation attachment to an axis.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAnchorAxes"),
+ DefaultValue(null),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeAxisY"),
+ Editor(Editors.AnnotationAxisUITypeEditor.Editor, Editors.AnnotationAxisUITypeEditor.Base),
+ TypeConverter(typeof(AnnotationAxisValueConverter)),
+ ]
+ virtual public Axis AxisY
+ {
+ get
+ {
+ if(_axisY == null && _axisYName.Length > 0)
+ {
+ _axisY = GetAxisByName(_axisYName);
+ }
+ return _axisY;
+ }
+ set
+ {
+ _axisY = value;
+ _axisYName = String.Empty;
+ this.ResetCurrentRelativePosition();
+ Invalidate();
+ }
+ }
+
+ #endregion
+
+ #region Anchor
+
+ /// <summary>
+ /// Gets or sets the name of a data point which an annotation is anchored to.
+ /// </summary>
+ /// <value>
+ /// A string value that represents the name of the data point which an
+ /// annotation is anchored to.
+ /// </value>
+ /// <remarks>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAnchor"),
+ Browsable(false),
+ Bindable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeAnchorDataPointName"),
+ ]
+ virtual public string AnchorDataPointName
+ {
+ get
+ {
+ if(_anchorDataPointName.Length == 0 && _anchorDataPoint != null)
+ {
+ _anchorDataPointName = GetDataPointName(_anchorDataPoint);
+ }
+ return _anchorDataPointName;
+ }
+ set
+ {
+ _anchorDataPointName = value;
+ _anchorDataPoint = null;
+ this.ResetCurrentRelativePosition();
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the data point an annotation is anchored to.
+ /// <seealso cref="AnchorAlignment"/>
+ /// <seealso cref="AnchorOffsetX"/>
+ /// <seealso cref="AnchorOffsetY"/>
+ /// <seealso cref="AnchorX"/>
+ /// <seealso cref="AnchorY"/>
+ /// <seealso cref="SetAnchor(Charting.DataPoint)"/>
+ /// <seealso cref="SetAnchor(Charting.DataPoint, Charting.DataPoint)"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="DataPoint"/> object an annotation is anchored to.
+ /// </value>
+ /// <remarks>
+ /// The annotation is anchored to the X and Y values of the specified data point,
+ /// and automatically uses the same axes coordinates as the data point.
+ /// <para>
+ /// To automatically position an annotation relative to an anchor point, make sure
+ /// its <see cref="X"/> and <see cref="Y"/> properties are set to <b>Double.NaN</b>.
+ /// The <see cref="AnchorAlignment"/> property may be used to change an annotation's
+ /// automatic position alignment to an anchor point. The <see cref="AnchorOffsetX"/> and
+ /// <see cref="AnchorOffsetY"/> properties may be used to add extra spacing.
+ /// </para>
+ /// <para>
+ /// When using this property, make sure the <see cref="AnchorX"/> and <see cref="AnchorY"/>
+ /// properties are set to <b>Double.NaN</b> (they have precedence).
+ /// </para>
+ /// <para>
+ /// Set this value to <b>null</b> or <b>nothing</b> to disable annotation anchoring to a data point.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAnchor"),
+ DefaultValue(null),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeAnchorDataPoint"),
+ Editor(Editors.AnchorPointUITypeEditor.Editor, Editors.AnchorPointUITypeEditor.Base),
+ TypeConverter(typeof(AnchorPointValueConverter)),
+ ]
+ virtual public DataPoint AnchorDataPoint
+ {
+ get
+ {
+ if(_anchorDataPoint == null && _anchorDataPointName.Length > 0)
+ {
+ _anchorDataPoint = GetDataPointByName(_anchorDataPointName);
+ }
+ return _anchorDataPoint;
+ }
+ set
+ {
+ _anchorDataPoint = value;
+ _anchorDataPointName = String.Empty;
+ this.ResetCurrentRelativePosition();
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the X coordinate the annotation is anchored to.
+ /// <seealso cref="AnchorY"/>
+ /// <seealso cref="AnchorOffsetX"/>
+ /// <seealso cref="AnchorOffsetY"/>
+ /// <seealso cref="AnchorAlignment"/>
+ /// <seealso cref="AnchorDataPoint"/>
+ /// </summary>
+ /// <value>
+ /// A double value that represents the X coordinate which an annotation is anchored to.
+ /// </value>
+ /// <remarks>
+ /// The annotation is anchored to the X coordinate specified in relative or axis coordinates,
+ /// depending on the <see cref="AxisX"/> property value.
+ /// <para>
+ /// To automatically position an annotation relative to an anchor point, make sure
+ /// its <see cref="X"/> property is set to <b>Double.NaN</b>.
+ /// The <see cref="AnchorAlignment"/> property may be used to change the annotation's
+ /// automatic position alignment to the anchor point. The <see cref="AnchorOffsetX"/> and
+ /// <see cref="AnchorOffsetY"/> properties may be used to add extra spacing.
+ /// </para>
+ /// <para>
+ /// This property has a higher priority than the <see cref="AnchorDataPoint"/> property.
+ /// </para>
+ /// <para>
+ /// Set this value to <b>Double.NaN</b> to disable annotation anchoring to the value.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAnchor"),
+ DefaultValue(double.NaN),
+ SRDescription("DescriptionAttributeAnchorX"),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ TypeConverter(typeof(DoubleNanValueConverter)),
+ ]
+ virtual public double AnchorX
+ {
+ get
+ {
+ return _anchorX;
+ }
+ set
+ {
+ _anchorX = value;
+ this.ResetCurrentRelativePosition();
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the Y coordinate which an annotation is anchored to.
+ /// <seealso cref="AnchorY"/>
+ /// <seealso cref="AnchorOffsetX"/>
+ /// <seealso cref="AnchorOffsetY"/>
+ /// <seealso cref="AnchorAlignment"/>
+ /// <seealso cref="AnchorDataPoint"/>
+ /// </summary>
+ /// <value>
+ /// A double value that represents the Y coordinate which an annotation is anchored to.
+ /// </value>
+ /// <remarks>
+ /// The annotation is anchored to the Y coordinate specified in relative or axis coordinates,
+ /// depending on the <see cref="AxisX"/> property value.
+ /// <para>
+ /// To automatically position an annotation relative to an anchor point, make sure
+ /// its <see cref="Y"/> property is set to <b>Double.NaN</b>.
+ /// The <see cref="AnchorAlignment"/> property may be used to change the annotation's
+ /// automatic position alignment to the anchor point. The <see cref="AnchorOffsetX"/> and
+ /// <see cref="AnchorOffsetY"/> properties may be used to add extra spacing.
+ /// </para>
+ /// <para>
+ /// This property has a higher priority than the <see cref="AnchorDataPoint"/> property.
+ /// </para>
+ /// <para>
+ /// Set this value to <b>Double.NaN</b> to disable annotation anchoring to the value.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAnchor"),
+ DefaultValue(double.NaN),
+ SRDescription("DescriptionAttributeAnchorY"),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ TypeConverter(typeof(DoubleNanValueConverter)),
+ ]
+ virtual public double AnchorY
+ {
+ get
+ {
+ return _anchorY;
+ }
+ set
+ {
+ _anchorY = value;
+ this.ResetCurrentRelativePosition();
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the x-coordinate offset between the positions of an annotation and its anchor point.
+ /// <seealso cref="AnchorOffsetY"/>
+ /// <seealso cref="AnchorDataPoint"/>
+ /// <seealso cref="AnchorX"/>
+ /// <seealso cref="AnchorAlignment"/>
+ /// </summary>
+ /// <value>
+ /// A double value that represents the x-coordinate offset between the positions of an annotation and its anchor point.
+ /// </value>
+ /// <remarks>
+ /// The annotation must be anchored using the <see cref="AnchorDataPoint"/> or
+ /// <see cref="AnchorX"/> properties, and its <see cref="X"/> property must be set
+ /// to <b>Double.NaN</b>.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAnchor"),
+ DefaultValue(0.0),
+ SRDescription("DescriptionAttributeAnchorOffsetX3"),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ ]
+ virtual public double AnchorOffsetX
+ {
+ get
+ {
+ return anchorOffsetX;
+ }
+ set
+ {
+ if(value > 100.0 || value < -100.0)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionAnnotationAnchorOffsetInvalid));
+ }
+ anchorOffsetX = value;
+ this.ResetCurrentRelativePosition();
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the y-coordinate offset between the positions of an annotation and its anchor point.
+ /// <seealso cref="Annotation.AnchorOffsetX"/>
+ /// <seealso cref="Annotation.AnchorDataPoint"/>
+ /// <seealso cref="Annotation.AnchorY"/>
+ /// <seealso cref="Annotation.AnchorAlignment"/>
+ /// </summary>
+ /// <value>
+ /// A double value that represents the y-coordinate offset between the positions of an annotation and its anchor point.
+ /// </value>
+ /// <remarks>
+ /// Annotation must be anchored using <see cref="Annotation.AnchorDataPoint"/> or
+ /// <see cref="Annotation.AnchorY"/> properties and it's <see cref="Annotation.Y"/> property must be set
+ /// to <b>Double.NaN</b>.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAnchor"),
+ DefaultValue(0.0),
+ SRDescription("DescriptionAttributeAnchorOffsetY3"),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ ]
+ virtual public double AnchorOffsetY
+ {
+ get
+ {
+ return anchorOffsetY;
+ }
+ set
+ {
+ if(value > 100.0 || value < -100.0)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionAnnotationAnchorOffsetInvalid));
+ }
+ anchorOffsetY = value;
+ this.ResetCurrentRelativePosition();
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an annotation position's alignment to the anchor point.
+ /// <seealso cref="AnchorX"/>
+ /// <seealso cref="AnchorY"/>
+ /// <seealso cref="AnchorDataPoint"/>
+ /// <seealso cref="AnchorOffsetX"/>
+ /// <seealso cref="AnchorOffsetY"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="ContentAlignment"/> value that represents the annotation's alignment to
+ /// the anchor point.
+ /// </value>
+ /// <remarks>
+ /// The annotation must be anchored using either <see cref="AnchorDataPoint"/>, or the <see cref="AnchorX"/>
+ /// and <see cref="AnchorY"/> properties. Its <see cref="X"/> and <see cref="Y"/>
+ /// properties must be set to <b>Double.NaN</b>.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAnchor"),
+ DefaultValue(typeof(ContentAlignment), "BottomCenter"),
+ SRDescription("DescriptionAttributeAnchorAlignment"),
+ ]
+ virtual public ContentAlignment AnchorAlignment
+ {
+ get
+ {
+ return anchorAlignment;
+ }
+ set
+ {
+ anchorAlignment = value;
+ this.ResetCurrentRelativePosition();
+ Invalidate();
+ }
+ }
+
+ #endregion // Anchoring
+
+ #region Editing Permissions
+
+#if Microsoft_CONTROL
+
+ /// <summary>
+ /// Gets or sets a flag that specifies whether an annotation may be selected
+ /// with a mouse by the end user.
+ /// </summary>
+ /// <value>
+ /// <b>True</b> if the annotation may be selected, <b>false</b> otherwise.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeEditing"),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeAllowSelecting"),
+ ]
+ virtual public bool AllowSelecting
+ {
+ get
+ {
+ return _allowSelecting;
+ }
+ set
+ {
+ _allowSelecting = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag that specifies whether an annotation may be moved
+ /// with a mouse by the end user.
+ /// </summary>
+ /// <value>
+ /// <b>True</b> if the annotation may be moved, <b>false</b> otherwise.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeEditing"),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeAllowMoving"),
+ ]
+ virtual public bool AllowMoving
+ {
+ get
+ {
+ return _allowMoving;
+ }
+ set
+ {
+ _allowMoving = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag that specifies whether an annotation anchor may be moved
+ /// with a mouse by the end user.
+ /// </summary>
+ /// <value>
+ /// <b>True</b> if the annotation anchor may be moved, <b>false</b> otherwise.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeEditing"),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeAllowAnchorMoving3"),
+ ]
+ virtual public bool AllowAnchorMoving
+ {
+ get
+ {
+ return _allowAnchorMoving;
+ }
+ set
+ {
+ _allowAnchorMoving = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag that specifies whether an annotation may be resized
+ /// with a mouse by the end user.
+ /// </summary>
+ /// <value>
+ /// <b>True</b> if the annotation may be resized, <b>false</b> otherwise.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeEditing"),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeAllowResizing"),
+ ]
+ virtual public bool AllowResizing
+ {
+ get
+ {
+ return _allowResizing;
+ }
+ set
+ {
+ _allowResizing = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag that specifies whether an annotation's text may be edited
+ /// when the end user double clicks on the text.
+ /// </summary>
+ /// <value>
+ /// <b>True</b> if the annotation text may be edited, <b>false</b> otherwise.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeEditing"),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeAllowTextEditing"),
+ ]
+ virtual public bool AllowTextEditing
+ {
+ get
+ {
+ return _allowTextEditing;
+ }
+ set
+ {
+ _allowTextEditing = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag that specifies whether a polygon annotation's points
+ /// may be moved with a mouse by the end user.
+ /// </summary>
+ /// <value>
+ /// <b>True</b> if the polygon annotation's points may be moved, <b>false</b> otherwise.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeEditing"),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeAllowPathEditing3"),
+ ]
+ virtual public bool AllowPathEditing
+ {
+ get
+ {
+ return _allowPathEditing;
+ }
+ set
+ {
+ _allowPathEditing = value;
+ }
+ }
+
+#endif // Microsoft_CONTROL
+
+ #endregion
+
+ #region Interactivity
+
+ /// <summary>
+ /// Gets or sets an annotation's tooltip text.
+ /// </summary>
+ /// <value>
+ /// A string value.
+ /// </value>
+ /// <remarks>
+ /// Special keywords can be used in the text when an annotation is anchored to
+ /// a data point using the <see cref="AnchorDataPoint"/> property. For a listing of
+ /// these keywords, refer to the "Annotations" help topic.
+ /// </remarks>
+ [
+
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeToolTip"),
+ ]
+ virtual public string ToolTip
+ {
+ get
+ {
+ return _tooltip;
+ }
+ set
+ {
+ _tooltip = value;
+
+ }
+ }
+
+#if !Microsoft_CONTROL
+
+ /// <summary>
+ /// Gets or sets an annotation's Url.
+ /// </summary>
+ /// <value>
+ /// A string value.
+ /// </value>
+ /// <remarks>
+ /// Special keywords can be used when an annotation is anchored to
+ /// a data point using the <see cref="AnchorDataPoint"/> property. For a listing of
+ /// these keywords, refer to the "Annotations" help topic.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeUrl"),
+ ]
+ virtual public string Url
+ {
+ get
+ {
+ return _url;
+ }
+ set
+ {
+ _url = value;
+
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an annotation's map area attributes.
+ /// </summary>
+ /// <value>
+ /// A string value.
+ /// </value>
+ /// <remarks>
+ /// This string will be added to the attributes of the image map generated
+ /// for the annotation.
+ /// <para>
+ /// Special keywords can be used when an annotation is anchored to
+ /// a data point using the <see cref="AnchorDataPoint"/> property. For a listing of
+ /// these keywords, refer to the "Annotations" help topic.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeMapAreaAttributes"),
+ ]
+ virtual public string MapAreaAttributes
+ {
+ get
+ {
+ return _mapAreaAttributes;
+ }
+ set
+ {
+ _mapAreaAttributes = value;
+
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the postback value which can be processed on click event.
+ /// </summary>
+ /// <value>The value which is passed to click event as argument.</value>
+ [DefaultValue("")]
+ [SRCategory(SR.Keys.CategoryAttributeMapArea)]
+ [SRDescription(SR.Keys.DescriptionAttributePostBackValue)]
+ public string PostBackValue
+ {
+ get
+ {
+ return this._postbackValue;
+ }
+ set
+ {
+ this._postbackValue = value;
+ }
+ }
+
+
+#endif // !Microsoft_CONTROL
+
+ #endregion // Interactivity
+
+ #endregion
+
+ #region Methods
+
+ #region Painting
+
+ /// <summary>
+ /// Paints the annotation object using the specified graphics.
+ /// </summary>
+ /// <param name="graphics">
+ /// A <see cref="ChartGraphics"/> object used to paint the annotation object.
+ /// </param>
+ /// <param name="chart">
+ /// Reference to the annotation's <see cref="Chart"/> control owner.
+ /// </param>
+ abstract internal void Paint(Chart chart, ChartGraphics graphics);
+
+ /// <summary>
+ /// Paints annotation selection markers.
+ /// </summary>
+ /// <param name="chartGraphics">Chart graphics used for painting.</param>
+ /// <param name="rect">Selection rectangle.</param>
+ /// <param name="path">Selection path.</param>
+ virtual internal void PaintSelectionHandles(ChartGraphics chartGraphics, RectangleF rect, GraphicsPath path)
+ {
+ // Define markers appearance style
+ Color markerBorderColor = Color.Black;
+ Color markerColor = Color.FromArgb(200, 255, 255, 255);
+ MarkerStyle markerStyle = MarkerStyle.Square;
+ int markerSize = selectionMarkerSize;
+ Boolean selected = this.IsSelected;
+
+ SizeF markerSizeRel = chartGraphics.GetRelativeSize(new SizeF(markerSize, markerSize));
+ if (this.Common.ProcessModePaint &&
+ !this.Common.ChartPicture.isPrinting)
+ {
+ // Clear selection rectangles
+ this.selectionRects = null;
+
+ // Check if annotation is selected
+ if (selected)
+ {
+ // Create selection rectangles
+ this.selectionRects = new RectangleF[9];
+
+ // Draw selection handles for single dimension annotations like line.
+ if(this.SelectionPointsStyle == SelectionPointsStyle.TwoPoints)
+ {
+ // Save selection handles position in array elements 0 and 4
+ this.selectionRects[(int)ResizingMode.TopLeftHandle] = new RectangleF(
+ rect.X - markerSizeRel.Width/2f,
+ rect.Y - markerSizeRel.Height/2f,
+ markerSizeRel.Width,
+ markerSizeRel.Height);
+ this.selectionRects[(int)ResizingMode.BottomRightHandle] = new RectangleF(
+ rect.Right - markerSizeRel.Width/2f,
+ rect.Bottom - markerSizeRel.Height/2f,
+ markerSizeRel.Width,
+ markerSizeRel.Height);
+
+
+ // Draw selection handle
+ chartGraphics.DrawMarkerRel(
+ rect.Location,
+ markerStyle,
+ markerSize,
+ markerColor,
+ markerBorderColor,
+ 1,
+ "",
+ Color.Empty,
+ 0,
+ Color.FromArgb(128, 0, 0, 0),
+ RectangleF.Empty);
+
+ chartGraphics.DrawMarkerRel(
+ new PointF(rect.Right, rect.Bottom),
+ markerStyle,
+ markerSize,
+ markerColor,
+ markerBorderColor,
+ 1,
+ "",
+ Color.Empty,
+ 0,
+ Color.FromArgb(128, 0, 0, 0),
+ RectangleF.Empty);
+ }
+ else if(this.SelectionPointsStyle == SelectionPointsStyle.Rectangle)
+ {
+ for(int index = 0; index < 8; index++)
+ {
+ // Get handle position
+ PointF handlePosition = PointF.Empty;
+ switch((ResizingMode)index)
+ {
+ case ResizingMode.TopLeftHandle:
+ handlePosition = rect.Location;
+ break;
+ case ResizingMode.TopHandle:
+ handlePosition = new PointF(rect.X + rect.Width / 2f, rect.Y);
+ break;
+ case ResizingMode.TopRightHandle:
+ handlePosition = new PointF(rect.Right, rect.Y);
+ break;
+ case ResizingMode.RightHandle:
+ handlePosition = new PointF(rect.Right, rect.Y + rect.Height / 2f);
+ break;
+ case ResizingMode.BottomRightHandle:
+ handlePosition = new PointF(rect.Right, rect.Bottom);
+ break;
+ case ResizingMode.BottomHandle:
+ handlePosition = new PointF(rect.X + rect.Width / 2f, rect.Bottom);
+ break;
+ case ResizingMode.BottomLeftHandle:
+ handlePosition = new PointF(rect.X, rect.Bottom);
+ break;
+ case ResizingMode.LeftHandle:
+ handlePosition = new PointF(rect.X, rect.Y + rect.Height / 2f);
+ break;
+ }
+
+ // Save selection handles position in array elements 0 and 4
+ this.selectionRects[index] = new RectangleF(
+ handlePosition.X - markerSizeRel.Width/2f,
+ handlePosition.Y - markerSizeRel.Height/2f,
+ markerSizeRel.Width,
+ markerSizeRel.Height);
+
+ // Draw selection handle
+ chartGraphics.DrawMarkerRel(
+ handlePosition,
+ markerStyle,
+ markerSize,
+ markerColor,
+ markerBorderColor,
+ 1,
+ "",
+ Color.Empty,
+ 0,
+ Color.FromArgb(128, 0, 0, 0),
+ RectangleF.Empty);
+ }
+ }
+
+
+ //********************************************************************
+ //** Draw anchor selection handle
+ //********************************************************************
+
+ // Get vertical and horizontal axis
+ Axis vertAxis = null;
+ Axis horizAxis = null;
+ GetAxes(ref vertAxis, ref horizAxis);
+
+ // Get anchor position
+ double anchorX = double.NaN;
+ double anchorY = double.NaN;
+ bool relativeX = false;
+ bool relativeY = false;
+ this.GetAnchorLocation(ref anchorX, ref anchorY, ref relativeX, ref relativeY);
+
+ // Convert anchor location to relative coordinates
+ if(!double.IsNaN(anchorX) && !double.IsNaN(anchorY))
+ {
+ if( !relativeX && horizAxis != null )
+ {
+ anchorX = horizAxis.ValueToPosition(anchorX);
+ }
+ if( !relativeY && vertAxis != null )
+ {
+ anchorY = vertAxis.ValueToPosition(anchorY);
+ }
+
+ // Apply 3D transforamtion if required
+ ChartArea chartArea = null;
+ if(horizAxis != null && horizAxis.ChartArea != null)
+ {
+ chartArea = horizAxis.ChartArea;
+ }
+ if(vertAxis != null && vertAxis.ChartArea != null)
+ {
+ chartArea = vertAxis.ChartArea;
+ }
+ if(chartArea != null &&
+ chartArea.Area3DStyle.Enable3D == true &&
+ !chartArea.chartAreaIsCurcular &&
+ chartArea.requireAxes &&
+ chartArea.matrix3D.IsInitialized())
+ {
+ // Get anotation Z coordinate (use scene depth or anchored point Z position)
+ float positionZ = chartArea.areaSceneDepth;
+ if (this.AnchorDataPoint != null && this.AnchorDataPoint.series != null)
+ {
+ float depth = 0f;
+ chartArea.GetSeriesZPositionAndDepth(
+ this.AnchorDataPoint.series,
+ out depth,
+ out positionZ);
+ positionZ += depth / 2f;
+ }
+
+ // Define 3D points of annotation object
+ Point3D[] annot3DPoints = new Point3D[1];
+ annot3DPoints[0] = new Point3D((float)anchorX, (float)anchorY, positionZ);
+
+ // Tranform cube coordinates
+ chartArea.matrix3D.TransformPoints(annot3DPoints);
+
+ // Get transformed coordinates
+ anchorX = annot3DPoints[0].X;
+ anchorY = annot3DPoints[0].Y;
+ }
+
+ // Save selection handles position in array elements 0 and 4
+ this.selectionRects[(int)ResizingMode.AnchorHandle] = new RectangleF(
+ (float)anchorX - markerSizeRel.Width/2f,
+ (float)anchorY - markerSizeRel.Height/2f,
+ markerSizeRel.Width,
+ markerSizeRel.Height);
+
+ // Draw circular selection handle
+ chartGraphics.DrawMarkerRel(
+ new PointF((float)anchorX, (float)anchorY),
+ MarkerStyle.Cross,
+ selectionMarkerSize + 3,
+ markerColor,
+ markerBorderColor,
+ 1,
+ "",
+ Color.Empty,
+ 0,
+ Color.FromArgb(128, 0, 0, 0),
+ RectangleF.Empty);
+ }
+
+#if Microsoft_CONTROL
+
+ //********************************************************************
+ //** Draw path selection handles
+ //********************************************************************
+ if(path != null && AllowPathEditing)
+ {
+ // Create selection rectangles for each point
+ PointF[] pathPoints = path.PathPoints;
+ RectangleF[] newSelectionRects = new RectangleF[pathPoints.Length + 9];
+
+ // Copy previous rectangles (first nine elements)
+ for(int index = 0; index < this.selectionRects.Length; index++)
+ {
+ newSelectionRects[index] = this.selectionRects[index];
+ }
+ this.selectionRects = newSelectionRects;
+
+ // Loop through all points
+ for(int index = 0; index < pathPoints.Length; index++)
+ {
+ // Get handle position
+ PointF handlePosition = chartGraphics.GetRelativePoint(pathPoints[index]);
+
+ // Save selection handles position in array elements 0 and 4
+ this.selectionRects[9 + index] = new RectangleF(
+ handlePosition.X - markerSizeRel.Width/2f,
+ handlePosition.Y - markerSizeRel.Height/2f,
+ markerSizeRel.Width,
+ markerSizeRel.Height);
+
+ // Draw selection handle
+ chartGraphics.DrawMarkerRel(
+ handlePosition,
+ MarkerStyle.Circle,
+ selectionMarkerSize + 1,
+ markerColor,
+ markerBorderColor,
+ 1,
+ "",
+ Color.Empty,
+ 0,
+ Color.FromArgb(128, 0, 0, 0),
+ RectangleF.Empty);
+ }
+ }
+
+#endif // Microsoft_CONTROL
+
+ }
+ }
+ }
+
+ #endregion
+
+ #region Position and Size
+
+ /// <summary>
+ /// Resizes an annotation according to its content size.
+ /// </summary>
+ /// <remarks>
+ /// Sets the annotation width and height to fit the specified text. This method applies to
+ /// <see cref="TextAnnotation"/>, <see cref="RectangleAnnotation"/>, <see cref="EllipseAnnotation"/>
+ /// and <see cref="CalloutAnnotation"/> objects only.
+ /// </remarks>
+ virtual public void ResizeToContent()
+ {
+ RectangleF position = GetContentPosition();
+ if(!double.IsNaN(position.Width))
+ {
+ this.Width = position.Width;
+ }
+ if(!double.IsNaN(position.Height))
+ {
+ this.Height = position.Height;
+ }
+ }
+
+ /// <summary>
+ /// Gets an annotation's content position.
+ /// </summary>
+ /// <returns>Annotation's content size.</returns>
+ virtual internal RectangleF GetContentPosition()
+ {
+ return new RectangleF(float.NaN, float.NaN, float.NaN, float.NaN);
+ }
+
+ /// <summary>
+ /// Gets an annotation's anchor point location.
+ /// </summary>
+ /// <param name="anchorX">Returns the anchor X coordinate.</param>
+ /// <param name="anchorY">Returns the anchor Y coordinate.</param>
+ /// <param name="inRelativeAnchorX">Indicates if X coordinate is in relative chart coordinates.</param>
+ /// <param name="inRelativeAnchorY">Indicates if Y coordinate is in relative chart coordinates.</param>
+ private void GetAnchorLocation(ref double anchorX, ref double anchorY, ref bool inRelativeAnchorX, ref bool inRelativeAnchorY)
+ {
+ anchorX = this.AnchorX;
+ anchorY = this.AnchorY;
+
+ if(this.AnchorDataPoint != null &&
+ this.AnchorDataPoint.series != null &&
+ this.Chart != null &&
+ this.Chart.chartPicture != null)
+ {
+ // Anchor data point is not allowed for gropped annotations
+ if(this.AnnotationGroup != null)
+ {
+ throw (new InvalidOperationException(SR.ExceptionAnnotationGroupedAnchorDataPointMustBeEmpty));
+ }
+
+ // Get data point relative coordinate
+ if( double.IsNaN(anchorX) || double.IsNaN(anchorY))
+ {
+ // Get X value from data point
+ if( double.IsNaN(anchorX) )
+ {
+ anchorX = this.AnchorDataPoint.positionRel.X;
+ inRelativeAnchorX = true;
+ }
+
+ // Get Y value from data point
+ if( double.IsNaN(anchorY) )
+ {
+ anchorY = this.AnchorDataPoint.positionRel.Y;
+ inRelativeAnchorY = true;
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets annotation object position in relative coordinates.
+ /// </summary>
+ /// <param name="location">Returns annotation location.</param>
+ /// <param name="size">Returns annotation size.</param>
+ /// <param name="anchorLocation">Returns annotation anchor point location.</param>
+ virtual internal void GetRelativePosition(out PointF location, out SizeF size, out PointF anchorLocation)
+ {
+ bool saveCurrentPosition = true;
+
+ //***********************************************************************
+ //** Check if position was precalculated
+ //***********************************************************************
+ if(!double.IsNaN(currentPositionRel.X) && !double.IsNaN(currentPositionRel.X))
+ {
+ location = currentPositionRel.Location;
+ size = currentPositionRel.Size;
+ anchorLocation = currentAnchorLocationRel;
+ return;
+ }
+
+ //***********************************************************************
+ //** Get vertical and horizontal axis
+ //***********************************************************************
+ Axis vertAxis = null;
+ Axis horizAxis = null;
+ GetAxes(ref vertAxis, ref horizAxis);
+
+ //***********************************************************************
+ //** Check if annotation was anchored to 2 points.
+ //***********************************************************************
+ if(this._anchorDataPoint != null &&
+ this._anchorDataPoint2 != null)
+ {
+ // Annotation size is in axis coordinates
+ this.IsSizeAlwaysRelative = false;
+
+ // Set annotation size
+ this.Height =
+ vertAxis.PositionToValue(this._anchorDataPoint2.positionRel.Y, false) -
+ vertAxis.PositionToValue(this._anchorDataPoint.positionRel.Y, false);
+ this.Width =
+ horizAxis.PositionToValue(this._anchorDataPoint2.positionRel.X, false) -
+ horizAxis.PositionToValue(this._anchorDataPoint.positionRel.X, false);
+
+ // Reset second anchor point after setting width and height
+ this._anchorDataPoint2 = null;
+ }
+
+ //***********************************************************************
+ //** Flags which indicate that coordinate was already transformed
+ //** into chart relative coordinate system.
+ //***********************************************************************
+ bool inRelativeX = false;
+ bool inRelativeY = false;
+ bool inRelativeWidth = (_isSizeAlwaysRelative) ? true : false;
+ bool inRelativeHeight = (_isSizeAlwaysRelative) ? true : false;
+ bool inRelativeAnchorX = false;
+ bool inRelativeAnchorY = false;
+
+ //***********************************************************************
+ //** Get anchoring coordinates from anchored Data Point.
+ //***********************************************************************
+ double anchorX = this.AnchorX;
+ double anchorY = this.AnchorY;
+ GetAnchorLocation(ref anchorX, ref anchorY, ref inRelativeAnchorX, ref inRelativeAnchorY);
+
+ //***********************************************************************
+ //** Calculate scaling and translation for the annotations in the group.
+ //***********************************************************************
+ AnnotationGroup group = this.AnnotationGroup;
+ PointF groupLocation = PointF.Empty;
+ double groupScaleX = 1.0;
+ double groupScaleY = 1.0;
+ if(group != null)
+ {
+ // Do not save relative position of annotations inside the group
+ saveCurrentPosition = false;
+
+ // Take relative position of the group
+ SizeF groupSize = SizeF.Empty;
+ PointF groupAnchorLocation = PointF.Empty;
+ group.GetRelativePosition(out groupLocation, out groupSize, out groupAnchorLocation);
+
+ // Calculate Scale
+ groupScaleX = groupSize.Width / 100.0;
+ groupScaleY = groupSize.Height / 100.0;
+ }
+
+
+ //***********************************************************************
+ //** Get annotation automatic size.
+ //***********************************************************************
+ double relativeWidth = this._width;
+ double relativeHeight = this._height;
+
+ // Get annotation content position
+ RectangleF contentPosition = GetContentPosition();
+
+ // Set annotation size if not set to custom value
+ if( double.IsNaN(relativeWidth) )
+ {
+ relativeWidth = contentPosition.Width;
+ inRelativeWidth = true;
+ }
+ else
+ {
+ relativeWidth *= groupScaleX;
+ }
+ if( double.IsNaN(relativeHeight) )
+ {
+ relativeHeight = contentPosition.Height;
+ inRelativeHeight = true;
+ }
+ else
+ {
+ relativeHeight *= groupScaleY;
+ }
+
+ //***********************************************************************
+ //** Provide "dummy" size at design time
+ //***********************************************************************
+ if(this.Chart != null && this.Chart.IsDesignMode())
+ {
+ if(this.IsSizeAlwaysRelative ||
+ (vertAxis == null && horizAxis == null) )
+ {
+ if(double.IsNaN(relativeWidth))
+ {
+ relativeWidth = 20.0;
+ saveCurrentPosition = false;
+ }
+ if(double.IsNaN(relativeHeight))
+ {
+ relativeHeight = 20.0;
+ saveCurrentPosition = false;
+ }
+ }
+ }
+
+ //***********************************************************************
+ //** Get annotation location.
+ //***********************************************************************
+ double relativeX = this.X;
+ double relativeY = this.Y;
+
+ // Check if annotation location Y coordinate is defined
+ if( double.IsNaN(relativeY) && !double.IsNaN(anchorY) )
+ {
+ inRelativeY = true;
+ double relativeAnchorY = anchorY;
+ if(!inRelativeAnchorY && vertAxis != null)
+ {
+ relativeAnchorY = vertAxis.ValueToPosition(anchorY);
+ }
+ if(this.AnchorAlignment == ContentAlignment.TopCenter ||
+ this.AnchorAlignment == ContentAlignment.TopLeft ||
+ this.AnchorAlignment == ContentAlignment.TopRight)
+ {
+ relativeY = relativeAnchorY + this.AnchorOffsetY;
+ relativeY *= groupScaleY;
+ }
+ else if(this.AnchorAlignment == ContentAlignment.BottomCenter ||
+ this.AnchorAlignment == ContentAlignment.BottomLeft ||
+ this.AnchorAlignment == ContentAlignment.BottomRight)
+ {
+ relativeY = relativeAnchorY - this.AnchorOffsetY;
+ relativeY *= groupScaleY;
+ if(relativeHeight != 0f && !double.IsNaN(relativeHeight))
+ {
+ if(inRelativeHeight)
+ {
+ relativeY -= relativeHeight;
+ }
+ else if(vertAxis != null)
+ {
+ float yValue = (float)vertAxis.PositionToValue(relativeY);
+ float bottomRel = (float)vertAxis.ValueToPosition(yValue + relativeHeight);
+ relativeY -= bottomRel - relativeY;
+ }
+ }
+ }
+ else
+ {
+ relativeY = relativeAnchorY + this.AnchorOffsetY;
+ relativeY *= groupScaleY;
+ if(relativeHeight != 0f && !double.IsNaN(relativeHeight))
+ {
+ if(inRelativeHeight)
+ {
+ relativeY -= relativeHeight/2f;
+ }
+ else if(vertAxis != null)
+ {
+ float yValue = (float)vertAxis.PositionToValue(relativeY);
+ float bottomRel = (float)vertAxis.ValueToPosition(yValue + relativeHeight);
+ relativeY -= (bottomRel - relativeY) / 2f;
+ }
+ }
+ }
+ }
+ else
+ {
+ relativeY *= groupScaleY;
+ }
+
+ // Check if annotation location X coordinate is defined
+ if( double.IsNaN(relativeX) && !double.IsNaN(anchorX) )
+ {
+ inRelativeX = true;
+ double relativeAnchorX = anchorX;
+ if(!inRelativeAnchorX && horizAxis != null)
+ {
+ relativeAnchorX = horizAxis.ValueToPosition(anchorX);
+ }
+ if(this.AnchorAlignment == ContentAlignment.BottomLeft ||
+ this.AnchorAlignment == ContentAlignment.MiddleLeft ||
+ this.AnchorAlignment == ContentAlignment.TopLeft)
+ {
+ relativeX = relativeAnchorX + this.AnchorOffsetX;
+ relativeX *= groupScaleX;
+ }
+ else if(this.AnchorAlignment == ContentAlignment.BottomRight ||
+ this.AnchorAlignment == ContentAlignment.MiddleRight ||
+ this.AnchorAlignment == ContentAlignment.TopRight)
+ {
+ relativeX = relativeAnchorX - this.AnchorOffsetX;
+ relativeX *= groupScaleX;
+ if(relativeWidth != 0f && !double.IsNaN(relativeWidth))
+ {
+ if(inRelativeWidth)
+ {
+ relativeX -= relativeWidth;
+ }
+ else if(horizAxis != null)
+ {
+ float xValue = (float)horizAxis.PositionToValue(relativeX);
+ relativeX -= horizAxis.ValueToPosition(xValue + relativeWidth) - relativeX;
+ }
+ }
+ }
+ else
+ {
+ relativeX = relativeAnchorX + this.AnchorOffsetX;
+ relativeX *= groupScaleX;
+ if(relativeWidth != 0f && !double.IsNaN(relativeWidth))
+ {
+ if(inRelativeWidth)
+ {
+ relativeX -= relativeWidth/2f;
+ }
+ else if(horizAxis != null)
+ {
+ float xValue = (float)horizAxis.PositionToValue(relativeX);
+ relativeX -= (horizAxis.ValueToPosition(xValue + relativeWidth) - relativeX) / 2f;
+ }
+ }
+ }
+ }
+ else
+ {
+ relativeX *= groupScaleX;
+ }
+
+ // Translate
+ relativeX += groupLocation.X;
+ relativeY += groupLocation.Y;
+
+ //***********************************************************************
+ //** Get annotation automatic location.
+ //***********************************************************************
+
+ // Set annotation size if not set to custom value
+ if( double.IsNaN(relativeX) )
+ {
+ relativeX = contentPosition.X * groupScaleX;
+ inRelativeX = true;
+ }
+ if( double.IsNaN(relativeY) )
+ {
+ relativeY = contentPosition.Y * groupScaleY;
+ inRelativeY = true;
+ }
+
+ //***********************************************************************
+ //** Convert coordinates from axes values to relative coordinates.
+ //***********************************************************************
+
+ // Check if values are set in axis values
+ if(horizAxis != null)
+ {
+ if(!inRelativeX)
+ {
+ relativeX = horizAxis.ValueToPosition(relativeX);
+ }
+ if(!inRelativeAnchorX)
+ {
+ anchorX = horizAxis.ValueToPosition(anchorX);
+ }
+ if(!inRelativeWidth)
+ {
+ relativeWidth = horizAxis.ValueToPosition(
+ horizAxis.PositionToValue(relativeX, false) + relativeWidth) - relativeX;
+ }
+ }
+ if(vertAxis != null)
+ {
+ if(!inRelativeY)
+ {
+ relativeY = vertAxis.ValueToPosition(relativeY);
+ }
+ if(!inRelativeAnchorY)
+ {
+ anchorY = vertAxis.ValueToPosition(anchorY);
+ }
+ if(!inRelativeHeight)
+ {
+ relativeHeight = vertAxis.ValueToPosition(
+ vertAxis.PositionToValue(relativeY, false) + relativeHeight) - relativeY;
+ }
+ }
+ bool isTextAnnotation = this is TextAnnotation;
+ //***********************************************************************
+ //** Apply 3D transforamtion if required
+ //***********************************************************************
+ ChartArea chartArea = null;
+ if(horizAxis != null && horizAxis.ChartArea != null)
+ {
+ chartArea = horizAxis.ChartArea;
+ }
+ if(vertAxis != null && vertAxis.ChartArea != null)
+ {
+ chartArea = vertAxis.ChartArea;
+ }
+ if(chartArea != null &&
+ chartArea.Area3DStyle.Enable3D == true &&
+ !chartArea.chartAreaIsCurcular &&
+ chartArea.requireAxes &&
+ chartArea.matrix3D.IsInitialized())
+ {
+ // Get anotation Z coordinate (use scene depth or anchored point Z position)
+ float positionZ = chartArea.areaSceneDepth;
+ if(this.AnchorDataPoint != null && this.AnchorDataPoint.series != null)
+ {
+ float depth = 0f;
+ chartArea.GetSeriesZPositionAndDepth(
+ this.AnchorDataPoint.series,
+ out depth,
+ out positionZ);
+ positionZ += depth / 2f;
+ }
+
+ // Define 3D points of annotation object
+ Point3D[] annot3DPoints = new Point3D[3];
+ annot3DPoints[0] = new Point3D((float)relativeX, (float)relativeY, positionZ);
+ annot3DPoints[1] = new Point3D((float)(relativeX + relativeWidth), (float)(relativeY + relativeHeight), positionZ);
+ annot3DPoints[2] = new Point3D((float)anchorX, (float)anchorY, positionZ);
+
+ // Tranform cube coordinates
+ chartArea.matrix3D.TransformPoints( annot3DPoints );
+
+ // Get transformed coordinates
+ relativeX = annot3DPoints[0].X;
+ relativeY = annot3DPoints[0].Y;
+ anchorX = annot3DPoints[2].X;
+ anchorY = annot3DPoints[2].Y;
+
+ // Don't adjust size for text annotation
+ if (!(isTextAnnotation && this.IsSizeAlwaysRelative))
+ {
+ relativeWidth = annot3DPoints[1].X - relativeX;
+ relativeHeight = annot3DPoints[1].Y - relativeY;
+ }
+ }
+
+ //***********************************************************************
+ //** Provide "dummy" position at design time
+ //***********************************************************************
+ if(this.Chart != null && this.Chart.IsDesignMode())
+ {
+ if(double.IsNaN(relativeX))
+ {
+ relativeX = groupLocation.X;
+ saveCurrentPosition = false;
+ }
+ if(double.IsNaN(relativeY))
+ {
+ relativeY = groupLocation.Y;
+ saveCurrentPosition = false;
+ }
+ if(double.IsNaN(relativeWidth))
+ {
+ relativeWidth = 20.0 * groupScaleX;
+ saveCurrentPosition = false;
+ }
+ if(double.IsNaN(relativeHeight))
+ {
+ relativeHeight = 20.0 * groupScaleY;
+ saveCurrentPosition = false;
+ }
+ }
+
+ //***********************************************************************
+ //** Initialize returned values
+ //***********************************************************************
+ location = new PointF( (float)relativeX, (float)relativeY );
+ size = new SizeF( (float)relativeWidth, (float)relativeHeight );
+ anchorLocation = new PointF( (float)anchorX, (float)anchorY );
+
+ //***********************************************************************
+ //** Adjust text based annotaion position using SmartLabelStyle.
+ //***********************************************************************
+ // Check if smart labels are enabled
+ if (this.SmartLabelStyle.Enabled && isTextAnnotation &&
+ group == null)
+ {
+ // Anchor point must be set
+ if(!double.IsNaN(anchorX) && !double.IsNaN(anchorY) &&
+ double.IsNaN(this.X) && double.IsNaN(this.Y))
+ {
+ if(this.Chart != null &&
+ this.Chart.chartPicture != null)
+ {
+ // Remember old movement distance restriction
+ double oldMinMovingDistance = this.SmartLabelStyle.MinMovingDistance;
+ double oldMaxMovingDistance = this.SmartLabelStyle.MaxMovingDistance;
+
+ // Increase annotation moving restrictions according to the anchor offset
+ PointF anchorOffsetAbs = this.GetGraphics().GetAbsolutePoint(
+ new PointF((float)this.AnchorOffsetX, (float)this.AnchorOffsetY));
+ float maxAnchorOffsetAbs = Math.Max(anchorOffsetAbs.X, anchorOffsetAbs.Y);
+ if(maxAnchorOffsetAbs > 0.0)
+ {
+ this.SmartLabelStyle.MinMovingDistance += maxAnchorOffsetAbs;
+ this.SmartLabelStyle.MaxMovingDistance += maxAnchorOffsetAbs;
+ }
+
+ // Adjust label position using SmartLabelStyle algorithm
+ LabelAlignmentStyles labelAlignment = LabelAlignmentStyles.Bottom;
+ using (StringFormat format = new StringFormat())
+ {
+ SizeF markerSizeRel = new SizeF((float)this.AnchorOffsetX, (float)this.AnchorOffsetY);
+ PointF newlocation = this.Chart.chartPicture.annotationSmartLabel.AdjustSmartLabelPosition(
+ this.Common,
+ this.Chart.chartPicture.ChartGraph,
+ chartArea,
+ this.SmartLabelStyle,
+ location,
+ size,
+ format,
+ anchorLocation,
+ markerSizeRel,
+ labelAlignment,
+ (this is CalloutAnnotation));
+
+ // Restore old movement distance restriction
+ this.SmartLabelStyle.MinMovingDistance = oldMinMovingDistance;
+ this.SmartLabelStyle.MaxMovingDistance = oldMaxMovingDistance;
+
+ // Check if annotation should be hidden
+ if (newlocation.IsEmpty)
+ {
+ location = new PointF(float.NaN, float.NaN);
+ }
+ else
+ {
+ // Get new position using alignment in format
+ RectangleF newPosition = this.Chart.chartPicture.annotationSmartLabel.GetLabelPosition(
+ this.Chart.chartPicture.ChartGraph,
+ newlocation,
+ size,
+ format,
+ false);
+
+ // Set new location
+ location = newPosition.Location;
+ }
+ }
+ }
+ }
+ else
+ {
+ // Add annotation position into the list (to prevent overlapping)
+ using (StringFormat format = new StringFormat())
+ {
+ this.Chart.chartPicture.annotationSmartLabel.AddSmartLabelPosition(
+ this.Chart.chartPicture.ChartGraph,
+ location,
+ size,
+ format);
+ }
+ }
+ }
+
+ //***********************************************************************
+ //** Save calculated position
+ //***********************************************************************
+ if(saveCurrentPosition)
+ {
+ currentPositionRel = new RectangleF(location, size);
+ currentAnchorLocationRel = new PointF(anchorLocation.X, anchorLocation.Y);
+ }
+ }
+
+#if Microsoft_CONTROL
+ /// <summary>
+ /// Set annotation object position using rectangle in relative coordinates.
+ /// Automatically converts relative coordinates to axes values if required.
+ /// </summary>
+ /// <param name="position">Position in relative coordinates.</param>
+ /// <param name="anchorPoint">Anchor location in relative coordinates.</param>
+ internal void SetPositionRelative(RectangleF position, PointF anchorPoint)
+ {
+ SetPositionRelative(position, anchorPoint, false);
+ }
+#endif // Microsoft_CONTROL
+
+ /// <summary>
+ /// Set annotation object position using rectangle in relative coordinates.
+ /// Automatically converts relative coordinates to axes values if required.
+ /// </summary>
+ /// <param name="position">Position in relative coordinates.</param>
+ /// <param name="anchorPoint">Anchor location in relative coordinates.</param>
+ /// <param name="userInput">Indicates if position changing was a result of the user input.</param>
+ internal void SetPositionRelative(RectangleF position, PointF anchorPoint, bool userInput)
+ {
+ double newX = position.X;
+ double newY = position.Y;
+ double newRight = position.Right;
+ double newBottom = position.Bottom;
+ double newWidth = position.Width;
+ double newHeight = position.Height;
+ double newAnchorX = anchorPoint.X;
+ double newAnchorY = anchorPoint.Y;
+
+ //***********************************************************************
+ //** Set pre calculated position and anchor location
+ //***********************************************************************
+ this.currentPositionRel = new RectangleF(position.Location, position.Size);
+ this.currentAnchorLocationRel = new PointF(anchorPoint.X, anchorPoint.Y);
+
+ //***********************************************************************
+ //** Get vertical and horizontal axis
+ //***********************************************************************
+ Axis vertAxis = null;
+ Axis horizAxis = null;
+ GetAxes(ref vertAxis, ref horizAxis);
+
+ //***********************************************************************
+ //** Disable anchoring to point and axes in 3D
+ //** This is done due to the issues of moving elements in 3D space.
+ //***********************************************************************
+ ChartArea chartArea = null;
+ if(horizAxis != null && horizAxis.ChartArea != null)
+ {
+ chartArea = horizAxis.ChartArea;
+ }
+ if(vertAxis != null && vertAxis.ChartArea != null)
+ {
+ chartArea = vertAxis.ChartArea;
+ }
+ if(chartArea != null && chartArea.Area3DStyle.Enable3D == true)
+ {
+ // If anchor point was set - get its relative position and use it as an anchor point
+ if(this.AnchorDataPoint != null)
+ {
+ bool inRelativeCoordX = true;
+ bool inRelativeCoordY = true;
+ this.GetAnchorLocation(ref newAnchorX, ref newAnchorY, ref inRelativeCoordX, ref inRelativeCoordY);
+ this.currentAnchorLocationRel = new PointF((float)newAnchorX, (float)newAnchorY);
+ }
+
+ // In 3D always use relative annotation coordinates
+ // Disconnect annotation from axes and anchor point
+ this.AnchorDataPoint = null;
+ this.AxisX = null;
+ this.AxisY = null;
+ horizAxis = null;
+ vertAxis = null;
+ }
+
+
+ //***********************************************************************
+ //** Convert relative coordinates to axis values
+ //***********************************************************************
+ if(horizAxis != null)
+ {
+ newX = horizAxis.PositionToValue(newX, false);
+ if(!double.IsNaN(newAnchorX))
+ {
+ newAnchorX = horizAxis.PositionToValue(newAnchorX, false);
+ }
+
+ // Adjust for the IsLogarithmic axis
+ if( horizAxis.IsLogarithmic )
+ {
+ newX = Math.Pow( horizAxis.logarithmBase, newX );
+ if(!double.IsNaN(newAnchorX))
+ {
+ newAnchorX = Math.Pow( horizAxis.logarithmBase, newAnchorX );
+ }
+ }
+
+ if(!this.IsSizeAlwaysRelative)
+ {
+ if(float.IsNaN(position.Right) &&
+ !float.IsNaN(position.Width) &&
+ !float.IsNaN(anchorPoint.X) )
+ {
+ newRight = horizAxis.PositionToValue(anchorPoint.X + position.Width, false);
+ if( horizAxis.IsLogarithmic )
+ {
+ newRight = Math.Pow( horizAxis.logarithmBase, newRight );
+ }
+ newWidth = newRight - newAnchorX;
+ }
+ else
+ {
+ newRight = horizAxis.PositionToValue(position.Right, false);
+ if( horizAxis.IsLogarithmic )
+ {
+ newRight = Math.Pow( horizAxis.logarithmBase, newRight );
+ }
+ newWidth = newRight - newX;
+ }
+ }
+ }
+ if(vertAxis != null)
+ {
+ newY = vertAxis.PositionToValue(newY, false);
+ if(!double.IsNaN(newAnchorY))
+ {
+ newAnchorY = vertAxis.PositionToValue(newAnchorY, false);
+ }
+
+ // NOTE: Fixes issue #4113
+ // Adjust for the IsLogarithmic axis
+ if( vertAxis.IsLogarithmic )
+ {
+ newY = Math.Pow( vertAxis.logarithmBase, newY );
+ if(!double.IsNaN(newAnchorY))
+ {
+ newAnchorY = Math.Pow( vertAxis.logarithmBase, newAnchorY );
+ }
+ }
+
+ if(!this.IsSizeAlwaysRelative)
+ {
+ if(float.IsNaN(position.Bottom) &&
+ !float.IsNaN(position.Height) &&
+ !float.IsNaN(anchorPoint.Y) )
+ {
+ newBottom = vertAxis.PositionToValue(anchorPoint.Y + position.Height, false);
+ if( vertAxis.IsLogarithmic )
+ {
+ newBottom = Math.Pow( vertAxis.logarithmBase, newBottom );
+ }
+ newHeight = newBottom - newAnchorY;
+ }
+ else
+ {
+ newBottom = vertAxis.PositionToValue(position.Bottom, false);
+ if( vertAxis.IsLogarithmic )
+ {
+ newBottom = Math.Pow( vertAxis.logarithmBase, newBottom );
+ }
+ newHeight = newBottom - newY;
+ }
+ }
+ }
+
+ // Fire position changing event when position changed by user.
+ if(userInput)
+ {
+#if Microsoft_CONTROL
+ // Set flag that annotation position was changed
+ this.positionChanged = true;
+
+ // Fire position changing event
+ if(this.Chart != null)
+ {
+ AnnotationPositionChangingEventArgs args = new AnnotationPositionChangingEventArgs();
+ args.NewLocationX = newX;
+ args.NewLocationY = newY;
+ args.NewSizeWidth = newWidth;
+ args.NewSizeHeight = newHeight;
+ args.NewAnchorLocationX = newAnchorX;
+ args.NewAnchorLocationY = newAnchorY;
+ args.Annotation = this;
+
+ if(this.Chart.OnAnnotationPositionChanging(ref args))
+ {
+ // Get user changed position/anchor
+ newX = args.NewLocationX;
+ newY = args.NewLocationY;
+ newWidth = args.NewSizeWidth;
+ newHeight = args.NewSizeHeight;
+ newAnchorX = args.NewAnchorLocationX;
+ newAnchorY = args.NewAnchorLocationY;
+ }
+ }
+#endif // Microsoft_CONTROL
+ }
+
+ // Adjust location & size
+ this.X = newX;
+ this.Y = newY;
+ this.Width = newWidth;
+ this.Height = newHeight;
+ this.AnchorX = newAnchorX;
+ this.AnchorY = newAnchorY;
+
+ // Invalidate annotation
+ this.Invalidate();
+
+ return;
+ }
+ /// <summary>
+ /// Adjust annotation location and\or size as a result of user action.
+ /// </summary>
+ /// <param name="movingDistance">Distance to resize/move the annotation.</param>
+ /// <param name="resizeMode">Resizing mode.</param>
+ virtual internal void AdjustLocationSize(SizeF movingDistance, ResizingMode resizeMode)
+ {
+ AdjustLocationSize(movingDistance, resizeMode, true);
+ }
+
+ /// <summary>
+ /// Adjust annotation location and\or size as a result of user action.
+ /// </summary>
+ /// <param name="movingDistance">Distance to resize/move the annotation.</param>
+ /// <param name="resizeMode">Resizing mode.</param>
+ /// <param name="pixelCoord">Distance is in pixels, otherwise relative.</param>
+ virtual internal void AdjustLocationSize(SizeF movingDistance, ResizingMode resizeMode, bool pixelCoord)
+ {
+ AdjustLocationSize(movingDistance, resizeMode, pixelCoord, false);
+ }
+
+ /// <summary>
+ /// Adjust annotation location and\or size as a result of user action.
+ /// </summary>
+ /// <param name="movingDistance">Distance to resize/move the annotation.</param>
+ /// <param name="resizeMode">Resizing mode.</param>
+ /// <param name="pixelCoord">Distance is in pixels, otherwise relative.</param>
+ /// <param name="userInput">Indicates if position changing was a result of the user input.</param>
+ virtual internal void AdjustLocationSize(SizeF movingDistance, ResizingMode resizeMode, bool pixelCoord, bool userInput)
+ {
+ if(!movingDistance.IsEmpty)
+ {
+ // Convert pixel coordinates into relative
+ if(pixelCoord)
+ {
+ movingDistance = Chart.chartPicture.ChartGraph.GetRelativeSize(movingDistance);
+ }
+
+ // Get annotation position in relative coordinates
+ PointF firstPoint = PointF.Empty;
+ PointF anchorPoint = PointF.Empty;
+ SizeF size = SizeF.Empty;
+ if(userInput)
+ {
+#if Microsoft_CONTROL
+ if(this.startMovePositionRel.X == 0f &&
+ this.startMovePositionRel.Y == 0f &&
+ this.startMovePositionRel.Width == 0f &&
+ this.startMovePositionRel.Height == 0f)
+ {
+ GetRelativePosition(out firstPoint, out size, out anchorPoint);
+ this.startMovePositionRel = new RectangleF(firstPoint, size);
+ this.startMoveAnchorLocationRel = new PointF(anchorPoint.X, anchorPoint.Y);
+ }
+ firstPoint = this.startMovePositionRel.Location;
+ size = this.startMovePositionRel.Size;
+ anchorPoint = this.startMoveAnchorLocationRel;
+#else // Microsoft_CONTROL
+ GetRelativePosition(out firstPoint, out size, out anchorPoint);
+#endif // Microsoft_CONTROL
+
+ }
+ else
+ {
+ GetRelativePosition(out firstPoint, out size, out anchorPoint);
+ }
+
+ if(resizeMode == ResizingMode.TopLeftHandle)
+ {
+ firstPoint.X -= movingDistance.Width;
+ firstPoint.Y -= movingDistance.Height;
+ size.Width += movingDistance.Width;
+ size.Height += movingDistance.Height;
+ }
+ else if(resizeMode == ResizingMode.TopHandle)
+ {
+ firstPoint.Y -= movingDistance.Height;
+ size.Height += movingDistance.Height;
+ }
+ else if(resizeMode == ResizingMode.TopRightHandle)
+ {
+ firstPoint.Y -= movingDistance.Height;
+ size.Width -= movingDistance.Width;
+ size.Height += movingDistance.Height;
+ }
+ else if(resizeMode == ResizingMode.RightHandle)
+ {
+ size.Width -= movingDistance.Width;
+ }
+ else if(resizeMode == ResizingMode.BottomRightHandle)
+ {
+ size.Width -= movingDistance.Width;
+ size.Height -= movingDistance.Height;
+ }
+ else if(resizeMode == ResizingMode.BottomHandle)
+ {
+ size.Height -= movingDistance.Height;
+ }
+ else if(resizeMode == ResizingMode.BottomLeftHandle)
+ {
+ firstPoint.X -= movingDistance.Width;
+ size.Width += movingDistance.Width;
+ size.Height -= movingDistance.Height;
+ }
+ else if(resizeMode == ResizingMode.LeftHandle)
+ {
+ firstPoint.X -= movingDistance.Width;
+ size.Width += movingDistance.Width;
+ }
+ else if(resizeMode == ResizingMode.AnchorHandle)
+ {
+ anchorPoint.X -= movingDistance.Width;
+ anchorPoint.Y -= movingDistance.Height;
+ }
+ else if(resizeMode == ResizingMode.Moving)
+ {
+ firstPoint.X -= movingDistance.Width;
+ firstPoint.Y -= movingDistance.Height;
+ }
+
+ // Make sure we do not override automatic Width and Heigth
+ if(resizeMode == ResizingMode.Moving)
+ {
+ if( double.IsNaN(this.Width) )
+ {
+ size.Width = float.NaN;
+ }
+ if( double.IsNaN(this.Height) )
+ {
+ size.Height = float.NaN;
+ }
+ }
+
+ // Make sure we do not override automatic X and Y
+ if(resizeMode == ResizingMode.AnchorHandle)
+ {
+ if( double.IsNaN(this.X) )
+ {
+ firstPoint.X = float.NaN;
+ }
+ if( double.IsNaN(this.Y) )
+ {
+ firstPoint.Y = float.NaN;
+ }
+ }
+ else if(double.IsNaN(this.AnchorX) || double.IsNaN(this.AnchorY) )
+ {
+ anchorPoint = new PointF(float.NaN, float.NaN);
+ }
+
+ // Set annotation position from rectangle in relative coordinates
+ SetPositionRelative(new RectangleF(firstPoint, size), anchorPoint, userInput);
+ }
+ return;
+ }
+
+ #endregion
+
+ #region Anchor Point and Axes Converters
+
+ /// <summary>
+ /// Checks if annotation draw anything in the anchor position (except selection handle)
+ /// </summary>
+ /// <returns>True if annotation "connects" itself and anchor point visually.</returns>
+ virtual internal bool IsAnchorDrawn()
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// Gets data point by name.
+ /// </summary>
+ /// <param name="dataPointName">Data point name to find.</param>
+ /// <returns>Data point.</returns>
+ internal DataPoint GetDataPointByName(string dataPointName)
+ {
+ DataPoint dataPoint = null;
+
+ if (Chart != null && dataPointName.Length > 0)
+ {
+ // Split series name and point index
+ int separatorIndex = dataPointName.IndexOf("\\r", StringComparison.Ordinal);
+ if (separatorIndex > 0)
+ {
+ string seriesName = dataPointName.Substring(0, separatorIndex);
+ string pointIndex = dataPointName.Substring(separatorIndex + 2);
+
+ int index;
+ if (int.TryParse(pointIndex, NumberStyles.Any, CultureInfo.InvariantCulture, out index))
+ {
+ dataPoint = Chart.Series[seriesName].Points[index];
+ }
+ }
+ }
+
+ return dataPoint;
+ }
+
+ /// <summary>
+ /// Gets axis by name.
+ /// </summary>
+ /// <param name="axisName">Axis name to find.</param>
+ /// <returns>Data point.</returns>
+ private Axis GetAxisByName(string axisName)
+ {
+ Debug.Assert(axisName != null, "GetAxisByName: handed a null axis name");
+
+ Axis axis = null;
+
+ try
+ {
+ if (Chart != null && axisName.Length > 0)
+ {
+ // Split series name and point index
+ int separatorIndex = axisName.IndexOf("\\r", StringComparison.Ordinal);
+ if (separatorIndex > 0)
+ {
+ string areaName = axisName.Substring(0, separatorIndex);
+ string axisType = axisName.Substring(separatorIndex + 2);
+ switch ((AxisName)Enum.Parse(typeof(AxisName), axisType))
+ {
+ case (AxisName.X):
+ axis = Chart.ChartAreas[areaName].AxisX;
+ break;
+ case (AxisName.Y):
+ axis = Chart.ChartAreas[areaName].AxisY;
+ break;
+ case (AxisName.X2):
+ axis = Chart.ChartAreas[areaName].AxisX2;
+ break;
+ case (AxisName.Y2):
+ axis = Chart.ChartAreas[areaName].AxisY2;
+ break;
+ }
+ }
+ }
+ }
+ catch (ArgumentNullException)
+ {
+ axis = null;
+ }
+ catch (ArgumentException)
+ {
+ axis = null;
+ }
+
+ return axis;
+ }
+
+ /// <summary>
+ /// Gets data point unique name.
+ /// </summary>
+ /// <param name="dataPoint">Data point to get the name for.</param>
+ /// <returns>Data point name.</returns>
+ internal string GetDataPointName(DataPoint dataPoint)
+ {
+ string name = String.Empty;
+ if(dataPoint.series != null)
+ {
+ int pointIndex = dataPoint.series.Points.IndexOf(dataPoint);
+ if(pointIndex >= 0)
+ {
+ name = dataPoint.series.Name +
+ "\\r" +
+ pointIndex.ToString(CultureInfo.InvariantCulture);
+ }
+ }
+ return name;
+ }
+
+ /// <summary>
+ /// Gets axis unique name.
+ /// </summary>
+ /// <param name="axis">Axis to get the name for.</param>
+ /// <returns>Axis name.</returns>
+ private string GetAxisName(Axis axis)
+ {
+ string name = String.Empty;
+ if(axis.ChartArea != null)
+ {
+ name = axis.ChartArea.Name +
+ "\\r" +
+ axis.AxisName.ToString();
+ }
+ return name;
+ }
+
+ #endregion
+
+ #region Z Order Methods
+
+ /// <summary>
+ /// Sends an annotation to the back of all annotations.
+ /// <seealso cref="BringToFront"/>
+ /// </summary>
+ virtual public void SendToBack()
+ {
+ // Find collection of annotation objects this annotation belongs too
+ AnnotationCollection collection = null;
+ if(Chart != null)
+ {
+ collection = Chart.Annotations;
+ }
+
+ // Check if annotation belongs to the group
+ AnnotationGroup group = AnnotationGroup;
+ if(group != null)
+ {
+ collection = group.Annotations;
+ }
+
+ // Check if annotation is found
+ if(collection != null)
+ {
+ Annotation annot = collection.FindByName(this.Name);
+ if(annot != null)
+ {
+ // Reinsert annotation at the beginning of the collection
+ collection.Remove(annot);
+ collection.Insert(0, annot);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Brings an annotation to the front of all annotations.
+ /// <seealso cref="SendToBack"/>
+ /// </summary>
+ virtual public void BringToFront()
+ {
+ // Find collection of annotation objects this annotation belongs too
+ AnnotationCollection collection = null;
+ if(Chart != null)
+ {
+ collection = Chart.Annotations;
+ }
+
+ // Check if annotation belongs to the group
+ AnnotationGroup group = AnnotationGroup;
+ if(group != null)
+ {
+ collection = group.Annotations;
+ }
+
+ // Check if annotation is found
+ if(collection != null)
+ {
+ Annotation annot = collection.FindByName(this.Name);
+ if(annot != null)
+ {
+ // Reinsert annotation at the end of the collection
+ collection.Remove(annot);
+ collection.Add(this);
+ }
+ }
+ }
+
+ #endregion // Z Order Methods
+
+ #region Group Related Methods
+
+ #endregion // Group Related Methods
+
+ #region SmartLabelStyle methods
+
+ /// <summary>
+ /// Adds anchor position to the list. Used to check SmartLabelStyle overlapping.
+ /// </summary>
+ /// <param name="list">List to add to.</param>
+ internal void AddSmartLabelMarkerPositions(ArrayList list)
+ {
+ // Anchor position is added to the list of non-overlapped markers
+ if(this.Visible && this.IsAnchorDrawn())
+ {
+ // Get vertical and horizontal axis
+ Axis vertAxis = null;
+ Axis horizAxis = null;
+ GetAxes(ref vertAxis, ref horizAxis);
+
+ // Get anchor position
+ double anchorX = double.NaN;
+ double anchorY = double.NaN;
+ bool relativeX = false;
+ bool relativeY = false;
+ this.GetAnchorLocation(ref anchorX, ref anchorY, ref relativeX, ref relativeY);
+
+ // Convert anchor location to relative coordinates
+ if(!double.IsNaN(anchorX) && !double.IsNaN(anchorY))
+ {
+ if( !relativeX && horizAxis != null )
+ {
+ anchorX = horizAxis.ValueToPosition(anchorX);
+ }
+ if( !relativeY && vertAxis != null )
+ {
+ anchorY = vertAxis.ValueToPosition(anchorY);
+ }
+
+ // Apply 3D transforamtion if required
+ ChartArea chartArea = null;
+ if(horizAxis != null && horizAxis.ChartArea != null)
+ {
+ chartArea = horizAxis.ChartArea;
+ }
+ if(vertAxis != null && vertAxis.ChartArea != null)
+ {
+ chartArea = vertAxis.ChartArea;
+ }
+ if(chartArea != null &&
+ chartArea.Area3DStyle.Enable3D == true &&
+ !chartArea.chartAreaIsCurcular &&
+ chartArea.requireAxes &&
+ chartArea.matrix3D.IsInitialized())
+ {
+ // Get anotation Z coordinate (use scene depth or anchored point Z position)
+ float positionZ = chartArea.areaSceneDepth;
+ if(this.AnchorDataPoint != null && this.AnchorDataPoint.series != null)
+ {
+ float depth = 0f;
+ chartArea.GetSeriesZPositionAndDepth(
+ this.AnchorDataPoint.series,
+ out depth,
+ out positionZ);
+ positionZ += depth / 2f;
+ }
+
+ // Define 3D points of annotation object
+ Point3D[] annot3DPoints = new Point3D[1];
+ annot3DPoints[0] = new Point3D((float)anchorX, (float)anchorY, positionZ);
+
+ // Tranform cube coordinates
+ chartArea.matrix3D.TransformPoints( annot3DPoints );
+
+ // Get transformed coordinates
+ anchorX = annot3DPoints[0].X;
+ anchorY = annot3DPoints[0].Y;
+ }
+
+ // Save selection handles position in array elements 0 and 4
+ if(this.GetGraphics() != null)
+ {
+ SizeF markerSizeRel = this.GetGraphics().GetRelativeSize(
+ new SizeF(1f, 1f));
+ RectangleF anchorRect = new RectangleF(
+ (float)anchorX - markerSizeRel.Width/2f,
+ (float)anchorY - markerSizeRel.Height/2f,
+ markerSizeRel.Width,
+ markerSizeRel.Height);
+
+ list.Add(anchorRect);
+ }
+ }
+ }
+ }
+
+ #endregion
+
+ #region Public Anchoring Methods
+
+ /// <summary>
+ /// Anchors an annotation to a data point.
+ /// <seealso cref="AnchorDataPoint"/>
+ /// <seealso cref="AnchorX"/>
+ /// <seealso cref="AnchorY"/>
+ /// </summary>
+ /// <param name="dataPoint">
+ /// <see cref="DataPoint"/> to be anchored to.
+ /// </param>
+ /// <remarks>
+ /// Anchors an annotation to the specified data point.
+ /// </remarks>
+ public void SetAnchor(DataPoint dataPoint)
+ {
+ SetAnchor(dataPoint, null);
+ }
+
+ /// <summary>
+ /// Anchors an annotation to two data points.
+ /// <seealso cref="AnchorDataPoint"/>
+ /// <seealso cref="AnchorX"/>
+ /// <seealso cref="AnchorY"/>
+ /// </summary>
+ /// <param name="dataPoint1">
+ /// First anchor <see cref="DataPoint"/>.
+ /// </param>
+ /// <param name="dataPoint2">
+ /// Second anchor <see cref="DataPoint"/>.
+ /// </param>
+ /// <remarks>
+ /// Anchors an annotation's top/left and bottom/right corners to the
+ /// specified data points.
+ /// </remarks>
+ public void SetAnchor(DataPoint dataPoint1, DataPoint dataPoint2)
+ {
+ // Set annotation position to automatic
+ this.X = double.NaN;
+ this.Y = double.NaN;
+
+ // Reset anchor point if any
+ this.AnchorX = double.NaN;
+ this.AnchorY = double.NaN;
+
+ // Set anchor point
+ this.AnchorDataPoint = dataPoint1;
+
+ // Get vertical and horizontal axis
+ Axis vertAxis = null;
+ Axis horizAxis = null;
+ GetAxes(ref vertAxis, ref horizAxis);
+
+ // Set Width and Height in axis coordinates
+ if(dataPoint2 != null && dataPoint1 != null)
+ {
+ this._anchorDataPoint2 = dataPoint2;
+ }
+
+ // Invalidate annotation
+ this.Invalidate();
+ }
+
+ #endregion // Public Anchoring Methods
+
+ #region Placement Methods
+
+#if Microsoft_CONTROL
+
+ /// <summary>
+ /// Begins end user placement of an annotation using the mouse.
+ /// </summary>
+ /// <remarks>
+ /// When this method is called, the end user is allowed to place an annotation using the
+ /// mouse.
+ /// <para>
+ /// Placement will finish when the end user specifies all required points, or
+ /// the <see cref="EndPlacement"/> method is called.</para>
+ /// </remarks>
+ virtual public void BeginPlacement()
+ {
+ // Can't place annotations inside the group
+ if(this.AnnotationGroup != null)
+ {
+ throw (new InvalidOperationException(SR.ExceptionAnnotationGroupedUnableToStartPlacement));
+ }
+
+ if(this.Chart != null)
+ {
+ // Set the annotation object which is currently placed
+ this.Chart.Annotations.placingAnnotation = this;
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionAnnotationNotInCollection));
+ }
+
+ }
+
+ /// <summary>
+ /// Ends user placement of an annotation.
+ /// </summary>
+ /// <remarks>
+ /// Ends an annotation placement operation previously started by a
+ /// <see cref="BeginPlacement"/> method call.
+ /// <para>
+ /// Calling this method is not required, since placement will automatically
+ /// end when an end user enters all required points. However, it is useful when an annotation
+ /// placement operation needs to be aborted for some reason.
+ /// </para>
+ /// </remarks>
+ virtual public void EndPlacement()
+ {
+ if(this.Chart != null)
+ {
+ // Reset currently placed annotation object
+ this.Chart.Annotations.placingAnnotation = null;
+
+ // Restore default cursor
+ this.Chart.Cursor = this.Chart.defaultCursor;
+
+ // Clear last placement mouse position
+ this.lastPlacementPosition = PointF.Empty;
+
+ // Fire annotation placed event
+ this.Chart.OnAnnotationPlaced(this);
+ }
+ }
+
+ /// <summary>
+ /// Handles mouse down event during annotation placement.
+ /// </summary>
+ /// <param name="point">Mouse cursor position in pixels.</param>
+ /// <param name="buttons">Mouse button down.</param>
+ internal virtual void PlacementMouseDown(PointF point, MouseButtons buttons)
+ {
+ if(buttons == MouseButtons.Right)
+ {
+ // Stop any pacement
+ this.EndPlacement();
+ }
+ if(buttons == MouseButtons.Left &&
+ IsValidPlacementPosition(point.X, point.Y))
+ {
+ if(this.lastPlacementPosition.IsEmpty)
+ {
+ // Remeber position where mouse was clicked
+ this.lastPlacementPosition = this.GetGraphics().GetRelativePoint(point);
+
+ // Get annotation position in relative coordinates
+ PointF firstPoint = PointF.Empty;
+ PointF anchorPoint = PointF.Empty;
+ SizeF size = SizeF.Empty;
+ this.GetRelativePosition(out firstPoint, out size, out anchorPoint);
+
+ // Set annotation X, Y coordinate
+ if(this.AllowMoving)
+ {
+ firstPoint = this.GetGraphics().GetRelativePoint(point);
+
+ // Do not change default position
+ if(double.IsNaN(this.AnchorX))
+ {
+ anchorPoint.X = float.NaN;
+ }
+ if(double.IsNaN(this.AnchorY))
+ {
+ anchorPoint.Y = float.NaN;
+ }
+
+ }
+ else if(this.AllowAnchorMoving)
+ {
+ anchorPoint = this.GetGraphics().GetRelativePoint(point);
+
+ // Do not change default position
+ if(double.IsNaN(this.X))
+ {
+ firstPoint.X = float.NaN;
+ }
+ if(double.IsNaN(this.Y))
+ {
+ firstPoint.Y = float.NaN;
+ }
+ }
+
+ // Do not change default size
+ if(double.IsNaN(this.Width))
+ {
+ size.Width = float.NaN;
+ }
+ if(double.IsNaN(this.Height))
+ {
+ size.Height = float.NaN;
+ }
+
+ // Set annotation position
+ this.positionChanged = true;
+ this.SetPositionRelative(
+ new RectangleF(firstPoint, size),
+ anchorPoint,
+ true);
+
+ // Invalidate and update the chart
+ if(Chart != null)
+ {
+ Invalidate();
+ Chart.UpdateAnnotations();
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Handles mouse up event during annotation placement.
+ /// </summary>
+ /// <param name="point">Mouse cursor position in pixels.</param>
+ /// <param name="buttons">Mouse button Up.</param>
+ /// <returns>Return true when placing finished.</returns>
+ internal virtual bool PlacementMouseUp(PointF point, MouseButtons buttons)
+ {
+ bool result = false;
+ if(buttons == MouseButtons.Left)
+ {
+ // Get annotation position in relative coordinates
+ PointF firstPoint = PointF.Empty;
+ PointF anchorPoint = PointF.Empty;
+ SizeF size = SizeF.Empty;
+ this.GetRelativePosition(out firstPoint, out size, out anchorPoint);
+
+ if(this.AllowResizing)
+ {
+ PointF pointRel = this.GetGraphics().GetRelativePoint(point);
+ size = new SizeF(
+ pointRel.X - this.lastPlacementPosition.X,
+ pointRel.Y - this.lastPlacementPosition.Y);
+ }
+ else
+ {
+ // Do not change default size
+ if(double.IsNaN(this.Width))
+ {
+ size.Width = float.NaN;
+ }
+ if(double.IsNaN(this.Height))
+ {
+ size.Height = float.NaN;
+ }
+ }
+
+ // Do not change default position
+ if(double.IsNaN(this.X))
+ {
+ firstPoint.X = float.NaN;
+ }
+ if(double.IsNaN(this.Y))
+ {
+ firstPoint.Y = float.NaN;
+ }
+ if(double.IsNaN(this.AnchorX))
+ {
+ anchorPoint.X = float.NaN;
+ }
+ if(double.IsNaN(this.AnchorY))
+ {
+ anchorPoint.Y = float.NaN;
+ }
+
+ // Set annotation position
+ this.positionChanged = true;
+ this.SetPositionRelative(
+ new RectangleF(firstPoint, size),
+ anchorPoint,
+ true);
+
+ // End placement
+ if(!size.IsEmpty || !this.AllowResizing)
+ {
+ result = true;
+ this.EndPlacement();
+ }
+
+ // Invalidate and update the chart
+ if(Chart != null)
+ {
+ Invalidate();
+ Chart.UpdateAnnotations();
+ }
+ }
+
+ return result;
+ }
+
+ /// <summary>
+ /// Handles mouse move event during annotation placement.
+ /// </summary>
+ /// <param name="point">Mouse cursor position in pixels.</param>
+ internal virtual void PlacementMouseMove(PointF point)
+ {
+ // Check if annotation was moved
+ if( this.GetGraphics() != null &&
+ !this.lastPlacementPosition.IsEmpty)
+ {
+ // Get annotation position in relative coordinates
+ PointF firstPoint = PointF.Empty;
+ PointF anchorPoint = PointF.Empty;
+ SizeF size = SizeF.Empty;
+ this.GetRelativePosition(out firstPoint, out size, out anchorPoint);
+
+ if(this.AllowResizing)
+ {
+ PointF pointRel = this.GetGraphics().GetRelativePoint(point);
+ size = new SizeF(
+ pointRel.X - this.lastPlacementPosition.X,
+ pointRel.Y - this.lastPlacementPosition.Y);
+ }
+
+ // Do not change default position
+ if(double.IsNaN(this.X))
+ {
+ firstPoint.X = float.NaN;
+ }
+ if(double.IsNaN(this.Y))
+ {
+ firstPoint.Y = float.NaN;
+ }
+ if(double.IsNaN(this.AnchorX))
+ {
+ anchorPoint.X = float.NaN;
+ }
+ if(double.IsNaN(this.AnchorY))
+ {
+ anchorPoint.Y = float.NaN;
+ }
+
+ // Set annotation position
+ this.positionChanged = true;
+ this.SetPositionRelative(
+ new RectangleF(firstPoint, size),
+ anchorPoint,
+ true);
+
+ // Invalidate and update the chart
+ if(this.Chart != null)
+ {
+ Invalidate();
+ this.Chart.UpdateAnnotations();
+ }
+ }
+ }
+
+ /// <summary>
+ /// Checks if specified position is valid for placement.
+ /// </summary>
+ /// <param name="x">X coordinate.</param>
+ /// <param name="y">Y coordinate.</param>
+ /// <returns>True if annotation can be placed at specified coordinates.</returns>
+ virtual internal bool IsValidPlacementPosition(float x, float y)
+ {
+ if(this.Chart != null &&
+ this.GetGraphics() != null)
+ {
+ // Check if cursor is over the area where placement allowed
+ // If so - change cursor to cross
+ RectangleF placementRect = new RectangleF(0f, 0f, 100f, 100f);
+ if(this.ClipToChartArea.Length > 0 &&
+ this.ClipToChartArea != Constants.NotSetValue)
+ {
+ ChartArea area = Chart.ChartAreas[this.ClipToChartArea];
+ placementRect = area.PlotAreaPosition.ToRectangleF();
+ }
+ placementRect = this.GetGraphics().GetAbsoluteRectangle(placementRect);
+ if(placementRect.Contains(x, y))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+#endif // Microsoft_CONTROL
+
+ #endregion // Placement Methods
+
+ #region Helper Methods
+
+ /// <summary>
+ /// Helper method that checks if annotation is visible.
+ /// </summary>
+ /// <returns>True if annotation is visible.</returns>
+ internal bool IsVisible()
+ {
+ if(this.Visible)
+ {
+ if(this.Chart != null)
+ {
+ // Check if annotation is anchored to the data point
+ ChartArea area = null;
+ if(this.AnchorDataPoint != null &&
+ this.AnchorDataPoint.series != null)
+ {
+ if(this.Chart.ChartAreas.IndexOf(this.AnchorDataPoint.series.ChartArea) >= 0)
+ {
+ area = this.Chart.ChartAreas[this.AnchorDataPoint.series.ChartArea];
+ }
+ }
+ if(area == null &&
+ this._anchorDataPoint2 != null &&
+ this._anchorDataPoint2.series != null)
+ {
+ if(this.Chart.ChartAreas.IndexOf(this._anchorDataPoint2.series.ChartArea) >= 0)
+ {
+ area = this.Chart.ChartAreas[this._anchorDataPoint2.series.ChartArea];
+ }
+ }
+
+ // Check if annotation uses chart area axis values
+ if(area == null && this.AxisX != null)
+ {
+ area = this.AxisX.ChartArea;
+ }
+ if(area == null && this.AxisY != null)
+ {
+ area = this.AxisY.ChartArea;
+ }
+
+ // Check if associated area is visible
+ if(area != null &&
+ !area.Visible)
+ {
+ return false;
+ }
+ }
+
+
+ return true;
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// Resets pre-calculated annotation position.
+ /// </summary>
+ internal void ResetCurrentRelativePosition()
+ {
+ this.currentPositionRel = new RectangleF(float.NaN, float.NaN, float.NaN, float.NaN);
+ this.currentAnchorLocationRel = new PointF(float.NaN, float.NaN);
+ }
+
+ /// <summary>
+ /// Replaces predefined keyword inside the string with their values if
+ /// annotation is anchored to the data point.
+ /// </summary>
+ /// <param name="strOriginal">Original string with keywords.</param>
+ /// <returns>Modified string.</returns>
+ internal string ReplaceKeywords(string strOriginal)
+ {
+ if(this.AnchorDataPoint != null)
+ {
+ return this.AnchorDataPoint.ReplaceKeywords(strOriginal);
+ }
+ return strOriginal;
+ }
+
+ /// <summary>
+ /// Checks if anchor point of the annotation is visible.
+ /// </summary>
+ /// <returns>True if anchor point is visible.</returns>
+ internal bool IsAnchorVisible()
+ {
+ // Get axes objects
+ Axis vertAxis = null;
+ Axis horizAxis = null;
+ GetAxes(ref vertAxis, ref horizAxis);
+
+ // Get anchor position
+ bool inRelativeAnchorX = false;
+ bool inRelativeAnchorY = false;
+ double anchorX = this.AnchorX;
+ double anchorY = this.AnchorY;
+ GetAnchorLocation(ref anchorX, ref anchorY, ref inRelativeAnchorX, ref inRelativeAnchorY);
+
+ // Check if anchor is set
+ if( !double.IsNaN(anchorX) && !double.IsNaN(anchorY) )
+ {
+ // Check if anchor is in axes coordinates
+ if(this.AnchorDataPoint != null ||
+ this.AxisX != null ||
+ this.AxisY != null)
+ {
+ // Convert anchor point to relative coordinates
+ if(!inRelativeAnchorX && horizAxis != null)
+ {
+ anchorX = horizAxis.ValueToPosition(anchorX);
+ }
+ if(!inRelativeAnchorY && vertAxis != null)
+ {
+ anchorY = vertAxis.ValueToPosition(anchorY);
+ }
+
+ // Get chart area
+ ChartArea chartArea = null;
+ if(horizAxis != null)
+ {
+ chartArea = horizAxis.ChartArea;
+ }
+ if(chartArea == null && vertAxis != null)
+ {
+ chartArea = vertAxis.ChartArea;
+ }
+
+ // Apply 3D transforamtion if required
+ if(chartArea != null && chartArea.Area3DStyle.Enable3D == true)
+ {
+ if(!chartArea.chartAreaIsCurcular &&
+ chartArea.requireAxes &&
+ chartArea.matrix3D.IsInitialized())
+ {
+ // Get anotation Z coordinate (use scene depth or anchored point Z position)
+ float positionZ = chartArea.areaSceneDepth;
+ if (this.AnchorDataPoint != null && this.AnchorDataPoint.series != null)
+ {
+ float depth = 0f;
+ chartArea.GetSeriesZPositionAndDepth(
+ this.AnchorDataPoint.series,
+ out depth,
+ out positionZ);
+ positionZ += depth / 2f;
+ }
+
+ // Define 3D points of annotation object
+ Point3D[] annot3DPoints = new Point3D[1];
+ annot3DPoints[0] = new Point3D((float)anchorX, (float)anchorY, positionZ);
+
+ // Tranform cube coordinates
+ chartArea.matrix3D.TransformPoints(annot3DPoints);
+
+ // Get transformed coordinates
+ anchorX = annot3DPoints[0].X;
+ anchorY = annot3DPoints[0].Y;
+ }
+ }
+
+ // Get plot rectangle position and inflate it slightly
+ // to solve any float rounding issues.
+ RectangleF rect = chartArea.PlotAreaPosition.ToRectangleF();
+ rect.Inflate(0.00001f, 0.00001f);
+
+ // Check if anchor point is in the plotting area
+ if(!rect.Contains((float)anchorX, (float)anchorY))
+ {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+
+ /// <summary>
+ /// Returns chart graphics objects.
+ /// </summary>
+ /// <returns>Chart graphics object.</returns>
+ internal ChartGraphics GetGraphics()
+ {
+ if (this.Common != null)
+ {
+ return this.Common.graph;
+ }
+ return null;
+ }
+#if Microsoft_CONTROL
+ /// <summary>
+ /// Checks if provided pixel coordinate is contained in one of the
+ /// selection handles rectangle.
+ /// </summary>
+ /// <param name="point">Coordinate in pixels.</param>
+ /// <returns>Resizing mode.</returns>
+ internal ResizingMode GetSelectionHandle(PointF point)
+ {
+ ResizingMode resizingMode = ResizingMode.None;
+
+ if( this.Common != null &&
+ this.Common.graph != null)
+ {
+ // Convert point to relative coordinates
+ point = this.Common.graph.GetRelativePoint(point);
+
+ // Check if point is in one of the selection handles
+ if(this.selectionRects != null)
+ {
+ for(int index = 0; index < this.selectionRects.Length; index++)
+ {
+ if(!this.selectionRects[index].IsEmpty &&
+ this.selectionRects[index].Contains(point))
+ {
+ if(index > (int)ResizingMode.AnchorHandle)
+ {
+ resizingMode = ResizingMode.MovingPathPoints;
+ this.currentPathPointIndex = index - 9;
+ }
+ else
+ {
+ resizingMode = (ResizingMode)index;
+ }
+ }
+ }
+ }
+ }
+
+ return resizingMode;
+ }
+#endif //Microsoft_CONTROL
+ /// <summary>
+ /// Gets data point X or Y axis.
+ /// </summary>
+ /// <param name="dataPoint">Data point to get the axis for.</param>
+ /// <param name="axisName">X or Y axis to get.</param>
+ /// <returns>Data point axis.</returns>
+ private Axis GetDataPointAxis(DataPoint dataPoint, AxisName axisName)
+ {
+ if (dataPoint != null && dataPoint.series != null && Chart != null)
+ {
+ // Get data point chart area
+ ChartArea chartArea = Chart.ChartAreas[dataPoint.series.ChartArea];
+
+ // Get point X axis
+ if ((axisName == AxisName.X || axisName == AxisName.X2) &&
+ !chartArea.switchValueAxes)
+ {
+ return chartArea.GetAxis(axisName, dataPoint.series.XAxisType, dataPoint.series.XSubAxisName);
+ }
+ else
+ {
+ return chartArea.GetAxis(axisName, dataPoint.series.YAxisType, dataPoint.series.YSubAxisName);
+ }
+ }
+ return null;
+ }
+
+ /// <summary>
+ /// Gets annotation vertical and horizontal axes.
+ /// </summary>
+ /// <param name="vertAxis">Returns annotation vertical axis or null.</param>
+ /// <param name="horizAxis">Returns annotation horizontal axis or null.</param>
+ internal void GetAxes(ref Axis vertAxis, ref Axis horizAxis)
+ {
+ vertAxis = null;
+ horizAxis = null;
+
+ if(this.AxisX != null && this.AxisX.ChartArea != null)
+ {
+ if(this.AxisX.ChartArea.switchValueAxes)
+ {
+ vertAxis = this.AxisX;
+ }
+ else
+ {
+ horizAxis = this.AxisX;
+ }
+ }
+ if(this.AxisY != null && this.AxisY.ChartArea != null)
+ {
+ if(this.AxisY.ChartArea.switchValueAxes)
+ {
+ horizAxis = this.AxisY;
+ }
+ else
+ {
+ vertAxis = this.AxisY;
+ }
+ }
+
+ // Get axes from attached data point
+ if(this.AnchorDataPoint != null)
+ {
+ if(horizAxis == null)
+ {
+ horizAxis = GetDataPointAxis(this.AnchorDataPoint, AxisName.X);
+
+ // For chart types like Bar, RangeBar and others, position of X and Y axes are flipped
+ if (horizAxis != null && horizAxis.ChartArea != null && horizAxis.ChartArea.switchValueAxes)
+ {
+ horizAxis = GetDataPointAxis(this.AnchorDataPoint, AxisName.Y);
+ }
+ }
+ if(vertAxis == null)
+ {
+ vertAxis = GetDataPointAxis(this.AnchorDataPoint, AxisName.Y);
+
+ // For chart types like Bar, RangeBar and others, position of X and Y axes are flipped
+ if (vertAxis != null && vertAxis.ChartArea != null && vertAxis.ChartArea.switchValueAxes)
+ {
+ vertAxis = GetDataPointAxis(this.AnchorDataPoint, AxisName.X);
+ }
+ }
+ }
+
+ // No axes coordinate system for grouped annotations
+ if(vertAxis != null || horizAxis != null)
+ {
+ if(this.AnnotationGroup != null)
+ {
+ throw (new InvalidOperationException(SR.ExceptionAnnotationGroupedAxisMustBeEmpty));
+ }
+ }
+ }
+
+ #endregion
+
+ #endregion
+
+ #region IDisposable Members
+
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ //Free managed resources
+ if (_fontCache != null)
+ {
+ _fontCache.Dispose();
+ _fontCache = null;
+ }
+ }
+ base.Dispose(disposing);
+ }
+
+
+ #endregion
+ }
+
+#if Microsoft_CONTROL
+
+ /// <summary>
+ /// This class is used to stores position changing event data for an annotation.
+ /// </summary>
+ /// <remarks>
+ /// Provides additional data like the new annotation and anchor position when an end user
+ /// is moving the annotation with the mouse.
+ /// <para>
+ /// Can be used to restrict annotation movement, or snap the annotation position to
+ /// specific points.
+ /// </para>
+ /// </remarks>
+ [
+ SRDescription("DescriptionAttributeAnnotationPositionChangingEventArgs_AnnotationPositionChangingEventArgs"),
+ ]
+ public class AnnotationPositionChangingEventArgs : EventArgs
+ {
+ #region Fields
+
+ private Annotation _Annotation = null;
+ /// <summary>
+ /// Gets or sets the annotation the event is fired for.
+ /// </summary>
+ public Annotation Annotation
+ {
+ get { return _Annotation; }
+ set { _Annotation = value; }
+ }
+
+ private double _NewLocationX = 0.0;
+ /// <summary>
+ /// Gets or sets the new X location of the annotation.
+ /// </summary>
+ public double NewLocationX
+ {
+ get { return _NewLocationX; }
+ set { _NewLocationX = value; }
+ }
+
+ private double _NewLocationY = 0.0;
+ /// <summary>
+ /// Gets or sets the new Y location of the annotation.
+ /// </summary>
+ public double NewLocationY
+ {
+ get { return _NewLocationY; }
+ set { _NewLocationY = value; }
+ }
+
+ private double _NewSizeWidth = 0.0;
+ /// <summary>
+ /// Gets or sets the new width of the annotation.
+ /// </summary>
+ public double NewSizeWidth
+ {
+ get { return _NewSizeWidth; }
+ set { _NewSizeWidth = value; }
+ }
+
+ private double _NewSizeHeight = 0.0;
+ /// <summary>
+ /// Gets or sets the new height of the annotation.
+ /// </summary>
+ public double NewSizeHeight
+ {
+ get { return _NewSizeHeight; }
+ set { _NewSizeHeight = value; }
+ }
+
+ private double _NewAnchorLocationX = 0.0;
+ /// <summary>
+ /// Gets or sets the new annotation anchor point X location.
+ /// </summary>
+ public double NewAnchorLocationX
+ {
+ get { return _NewAnchorLocationX; }
+ set { _NewAnchorLocationX = value; }
+ }
+
+ private double _NewAnchorLocationY = 0.0;
+ /// <summary>
+ /// Gets or sets the new annotation anchor point Y location.
+ /// </summary>
+ public double NewAnchorLocationY
+ {
+ get { return _NewAnchorLocationY; }
+ set { _NewAnchorLocationY = value; }
+ }
+
+ #endregion // Fields
+
+ #region Properties
+
+
+ /// <summary>
+ /// Gets or sets the new location and size of the annotation.
+ /// </summary>
+ [
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ ]
+ public RectangleF NewPosition
+ {
+ get
+ {
+ return new RectangleF(
+ (float)this.NewLocationX,
+ (float)this.NewLocationY,
+ (float)this.NewSizeWidth,
+ (float)this.NewSizeHeight);
+ }
+ set
+ {
+ this.NewLocationX = value.X;
+ this.NewLocationY = value.Y;
+ this.NewSizeWidth = value.Width;
+ this.NewSizeHeight = value.Height;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the new anchor location of the annotation.
+ /// </summary>
+ [
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ ]
+ public PointF NewAnchorLocation
+ {
+ get
+ {
+ return new PointF(
+ (float)this.NewAnchorLocationX,
+ (float)this.NewAnchorLocationY);
+ }
+ set
+ {
+ this.NewAnchorLocationX = value.X;
+ this.NewAnchorLocationY = value.Y;
+ }
+ }
+
+ #endregion // Properties
+ }
+
+#endif //Microsoft_CONTROL
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/AnnotationCollection.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/AnnotationCollection.cs
new file mode 100644
index 00000000000..398aedd6148
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/AnnotationCollection.cs
@@ -0,0 +1,844 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: AnnotationCollection.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: AnnotationCollection, AnnotationCollectionEditor
+//
+// Purpose: Collection of annotation objects.
+//
+// Reviewed:
+//
+//===================================================================
+
+#region Used namespace
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Text;
+using System.Drawing.Drawing2D;
+using System.Globalization;
+using System.Diagnostics.CodeAnalysis;
+
+#if Microsoft_CONTROL
+using System.Windows.Forms;
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+
+#else
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.DataVisualization.Charting;
+using System.Web.UI.DataVisualization.Charting.Data;
+using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+ namespace System.Web.UI.DataVisualization.Charting
+#endif
+{
+ /// <summary>
+ /// <b>AnnotationCollection</b> is a collection that stores chart annotation objects.
+ /// <seealso cref="Charting.Chart.Annotations"/>
+ /// </summary>
+ /// <remarks>
+ /// All chart annotations are stored in this collection. It is exposed as
+ /// a <see cref="Charting.Chart.Annotations"/> property of the chart. It is also used to
+ /// store annotations inside the <see cref="AnnotationGroup"/> class.
+ /// <para>
+ /// This class includes methods for adding, inserting, iterating and removing annotations.
+ /// </para>
+ /// </remarks>
+ [
+ SRDescription("DescriptionAttributeAnnotations3"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class AnnotationCollection : ChartNamedElementCollection<Annotation>
+ {
+ #region Fields
+
+ /// <summary>
+ /// Group this collection belongs too
+ /// </summary>
+ internal AnnotationGroup AnnotationGroup { get; set; }
+
+#if Microsoft_CONTROL
+
+ // Annotation object that was last clicked on
+ internal Annotation lastClickedAnnotation = null;
+
+ // Start point of annotation moving or resizing
+ private PointF _movingResizingStartPoint = PointF.Empty;
+
+ // Current resizing mode
+ private ResizingMode _resizingMode = ResizingMode.None;
+
+ // Annotation object which is currently placed on the chart
+ internal Annotation placingAnnotation = null;
+
+#endif
+
+ #endregion
+
+ #region Construction and Initialization
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="AnnotationCollection"/> class.
+ /// </summary>
+ /// <param name="parent">The parent chart element.</param>
+ internal AnnotationCollection(IChartElement parent) : base(parent)
+ {
+ }
+
+ #endregion
+
+ #region Items Inserting and Removing Notification methods
+
+ /// <summary>
+ /// Initializes the specified item.
+ /// </summary>
+ /// <param name="item">The item.</param>
+ internal override void Initialize(Annotation item)
+ {
+ if (item != null)
+ {
+ TextAnnotation textAnnotation = item as TextAnnotation;
+ if (textAnnotation != null && string.IsNullOrEmpty(textAnnotation.Text) && Chart != null && Chart.IsDesignMode())
+ {
+ textAnnotation.Text = item.Name;
+ }
+
+ //If the collection belongs to annotation group we need to pass a ref to this group to all the child annotations
+ if (this.AnnotationGroup != null)
+ {
+ item.annotationGroup = this.AnnotationGroup;
+ }
+
+ item.ResetCurrentRelativePosition();
+ }
+ base.Initialize(item);
+ }
+
+ /// <summary>
+ /// Deinitializes the specified item.
+ /// </summary>
+ /// <param name="item">The item.</param>
+ internal override void Deinitialize(Annotation item)
+ {
+ if (item != null)
+ {
+ item.annotationGroup = null;
+ item.ResetCurrentRelativePosition();
+ }
+ base.Deinitialize(item);
+ }
+
+
+ /// <summary>
+ /// Finds an annotation in the collection by name.
+ /// </summary>
+ /// <param name="name">
+ /// Name of the annotation to find.
+ /// </param>
+ /// <returns>
+ /// <see cref="Annotation"/> object, or null (or nothing) if it does not exist.
+ /// </returns>
+ public override Annotation FindByName(string name)
+ {
+ foreach(Annotation annotation in this)
+ {
+ // Compare annotation name
+ if(annotation.Name == name)
+ {
+ return annotation;
+ }
+
+ // Check if annotation is a group
+ AnnotationGroup annotationGroup = annotation as AnnotationGroup;
+ if(annotationGroup != null)
+ {
+ Annotation result = annotationGroup.Annotations.FindByName(name);
+ if(result != null)
+ {
+ return result;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ #endregion
+
+ #region Painting
+
+ /// <summary>
+ /// Paints all annotation objects in the collection.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics used for painting.</param>
+ /// <param name="drawAnnotationOnly">Indicates that only annotation objects are redrawn.</param>
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Justification="This parameter is used when compiling for the Microsoft version of Chart")]
+ internal void Paint(ChartGraphics chartGraph, bool drawAnnotationOnly)
+ {
+#if Microsoft_CONTROL
+ ChartPicture chartPicture = this.Chart.chartPicture;
+
+ // Restore previous background using double buffered bitmap
+ if(!chartPicture.isSelectionMode &&
+ this.Count > 0 /*&&
+ !this.Chart.chartPicture.isPrinting*/)
+ {
+ chartPicture.backgroundRestored = true;
+ Rectangle chartPosition = new Rectangle(0, 0, chartPicture.Width, chartPicture.Height);
+ if(chartPicture.nonTopLevelChartBuffer == null || !drawAnnotationOnly)
+ {
+ // Dispose previous bitmap
+ if(chartPicture.nonTopLevelChartBuffer != null)
+ {
+ chartPicture.nonTopLevelChartBuffer.Dispose();
+ chartPicture.nonTopLevelChartBuffer = null;
+ }
+
+ // Copy chart area plotting rectangle from the chart's dubble buffer image into area dubble buffer image
+ if (this.Chart.paintBufferBitmap != null &&
+ this.Chart.paintBufferBitmap.Size.Width >= chartPosition.Size.Width &&
+ this.Chart.paintBufferBitmap.Size.Height >= chartPosition.Size.Height)
+ {
+ chartPicture.nonTopLevelChartBuffer = this.Chart.paintBufferBitmap.Clone(
+ chartPosition, this.Chart.paintBufferBitmap.PixelFormat);
+ }
+ }
+ else if(drawAnnotationOnly && chartPicture.nonTopLevelChartBuffer != null)
+ {
+ // Restore previous background
+ this.Chart.paintBufferBitmapGraphics.DrawImageUnscaled(
+ chartPicture.nonTopLevelChartBuffer,
+ chartPosition);
+ }
+ }
+#endif // Microsoft_CONTROL
+
+ // Draw all annotation objects
+ foreach(Annotation annotation in this)
+ {
+ // Reset calculated relative position
+ annotation.ResetCurrentRelativePosition();
+
+ if(annotation.IsVisible())
+ {
+ bool resetClip = false;
+
+ // Check if anchor point ----osiated with plot area is inside the scaleView
+ if(annotation.IsAnchorVisible())
+ {
+ // Set annotation object clipping
+ if(annotation.ClipToChartArea.Length > 0 &&
+ annotation.ClipToChartArea != Constants.NotSetValue &&
+ Chart != null)
+ {
+ int areaIndex = Chart.ChartAreas.IndexOf(annotation.ClipToChartArea);
+ if( areaIndex >= 0 )
+ {
+ // Get chart area object
+ ChartArea chartArea = Chart.ChartAreas[areaIndex];
+ chartGraph.SetClip(chartArea.PlotAreaPosition.ToRectangleF());
+ resetClip = true;
+ }
+ }
+
+ // Start Svg Selection mode
+ string url = String.Empty;
+#if !Microsoft_CONTROL
+ url = annotation.Url;
+#endif // !Microsoft_CONTROL
+ chartGraph.StartHotRegion(
+ annotation.ReplaceKeywords(url),
+ annotation.ReplaceKeywords(annotation.ToolTip) );
+
+ // Draw annotation object
+ annotation.Paint(Chart, chartGraph);
+
+
+ // End Svg Selection mode
+ chartGraph.EndHotRegion( );
+
+ // Reset clipping region
+ if(resetClip)
+ {
+ chartGraph.ResetClip();
+ }
+ }
+ }
+ }
+ }
+
+ #endregion
+
+ #region Mouse Events Handlers
+
+#if Microsoft_CONTROL
+
+ /// <summary>
+ /// Mouse was double clicked.
+ /// </summary>
+ internal void OnDoubleClick()
+ {
+ if(lastClickedAnnotation != null &&
+ lastClickedAnnotation.AllowTextEditing)
+ {
+ TextAnnotation textAnnotation = lastClickedAnnotation as TextAnnotation;
+
+ if(textAnnotation == null)
+ {
+ AnnotationGroup group = lastClickedAnnotation as AnnotationGroup;
+
+ if (group != null)
+ {
+ // Try to edit text annotation in the group
+ foreach (Annotation annot in group.Annotations)
+ {
+ TextAnnotation groupAnnot = annot as TextAnnotation;
+ if (groupAnnot != null &&
+ groupAnnot.AllowTextEditing)
+ {
+ // Get annotation position in relative coordinates
+ PointF firstPoint = PointF.Empty;
+ PointF anchorPoint = PointF.Empty;
+ SizeF size = SizeF.Empty;
+ groupAnnot.GetRelativePosition(out firstPoint, out size, out anchorPoint);
+ RectangleF textPosition = new RectangleF(firstPoint, size);
+
+ // Check if last clicked coordinate is inside this text annotation
+ if (groupAnnot.GetGraphics() != null &&
+ textPosition.Contains(groupAnnot.GetGraphics().GetRelativePoint(this._movingResizingStartPoint)))
+ {
+ textAnnotation = groupAnnot;
+ lastClickedAnnotation = textAnnotation;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ if(textAnnotation != null)
+ {
+ // Start annotation text editing
+ textAnnotation.BeginTextEditing();
+ }
+ }
+ }
+
+ /// <summary>
+ /// Checks if specified point is contained by any of the selection handles.
+ /// </summary>
+ /// <param name="point">Point which is tested in pixel coordinates.</param>
+ /// <param name="resizingMode">Handle containing the point or None.</param>
+ /// <returns>Annotation that contains the point or Null.</returns>
+ internal Annotation HitTestSelectionHandles(PointF point, ref ResizingMode resizingMode)
+ {
+ Annotation annotation = null;
+
+ if( Common != null &&
+ Common.graph != null)
+ {
+ PointF pointRel = Common.graph.GetRelativePoint(point);
+ foreach(Annotation annot in this)
+ {
+ // Reset selcted path point
+ annot.currentPathPointIndex = -1;
+
+ // Check if annotation is selected
+ if(annot.IsSelected)
+ {
+ if(annot.selectionRects != null)
+ {
+ for(int index = 0; index < annot.selectionRects.Length; index++)
+ {
+ if(!annot.selectionRects[index].IsEmpty &&
+ annot.selectionRects[index].Contains(pointRel))
+ {
+ annotation = annot;
+ if(index > (int)ResizingMode.AnchorHandle)
+ {
+ resizingMode = ResizingMode.MovingPathPoints;
+ annot.currentPathPointIndex = index - 9;
+ }
+ else
+ {
+ resizingMode = (ResizingMode)index;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return annotation;
+ }
+
+ /// <summary>
+ /// Mouse button pressed in the control.
+ /// </summary>
+ /// <param name="e">Event arguments.</param>
+ /// <param name="isHandled">Returns true if event is handled and no further processing required.</param>
+ internal void OnMouseDown(MouseEventArgs e, ref bool isHandled)
+ {
+ // Reset last clicked annotation object and stop text editing
+ if(lastClickedAnnotation != null)
+ {
+ TextAnnotation textAnnotation = lastClickedAnnotation as TextAnnotation;
+ if(textAnnotation != null)
+ {
+ // Stop annotation text editing
+ textAnnotation.StopTextEditing();
+ }
+ lastClickedAnnotation = null;
+ }
+
+ // Check if in annotation placement mode
+ if( this.placingAnnotation != null)
+ {
+ // Process mouse down
+ this.placingAnnotation.PlacementMouseDown(new PointF(e.X, e.Y), e.Button);
+
+ // Set handled flag
+ isHandled = true;
+ return;
+ }
+
+ // Process only left mouse buttons
+ if(e.Button == MouseButtons.Left)
+ {
+ bool updateRequired = false;
+ this._resizingMode = ResizingMode.None;
+
+ // Check if mouse buton was pressed in any selection handles areas
+ Annotation annotation =
+ HitTestSelectionHandles(new PointF(e.X, e.Y), ref this._resizingMode);
+
+ // Check if mouse button was pressed over one of the annotation objects
+ if(annotation == null && this.Count > 0)
+ {
+ HitTestResult result = this.Chart.HitTest(e.X, e.Y, ChartElementType.Annotation);
+ if(result != null && result.ChartElementType == ChartElementType.Annotation)
+ {
+ annotation = (Annotation)result.Object;
+ }
+ }
+
+ // Unselect all annotations if mouse clicked outside any annotations
+ if(annotation == null || !annotation.IsSelected)
+ {
+ if((Control.ModifierKeys & Keys.Control) != Keys.Control &&
+ (Control.ModifierKeys & Keys.Shift) != Keys.Shift)
+ {
+ foreach (Annotation annot in this.Chart.Annotations)
+ {
+ if(annot != annotation && annot.IsSelected)
+ {
+ annot.IsSelected = false;
+ updateRequired = true;
+
+ // Call selection changed notification
+ if (this.Chart != null)
+ {
+ this.Chart.OnAnnotationSelectionChanged(annot);
+ }
+ }
+ }
+ }
+ }
+
+ // Process mouse action in the annotation object
+ if(annotation != null)
+ {
+ // Mouse down event handled
+ isHandled = true;
+
+ // Select/Unselect annotation
+ Annotation selectableAnnotation = annotation;
+ if(annotation.AnnotationGroup != null)
+ {
+ // Select annotation group when click on any child annotations
+ selectableAnnotation = annotation.AnnotationGroup;
+ }
+ if(!selectableAnnotation.IsSelected && selectableAnnotation.AllowSelecting)
+ {
+ selectableAnnotation.IsSelected = true;
+ updateRequired = true;
+
+ // Call selection changed notification
+ if (this.Chart != null)
+ {
+ this.Chart.OnAnnotationSelectionChanged(selectableAnnotation);
+ }
+ }
+ else if((Control.ModifierKeys & Keys.Control) == Keys.Control ||
+ (Control.ModifierKeys & Keys.Shift) == Keys.Shift)
+ {
+ selectableAnnotation.IsSelected = false;
+ updateRequired = true;
+
+ // Call selection changed notification
+ if (this.Chart != null)
+ {
+ this.Chart.OnAnnotationSelectionChanged(selectableAnnotation);
+ }
+ }
+
+ // Remember last clicked and selected annotation
+ lastClickedAnnotation = annotation;
+
+ // Rember mouse position
+ this._movingResizingStartPoint = new PointF(e.X, e.Y);
+
+ // Start moving, repositioning or resizing of annotation
+ if(annotation.IsSelected)
+ {
+ // Check if one of selection handles was clicked on
+ this._resizingMode = annotation.GetSelectionHandle(this._movingResizingStartPoint);
+ if(!annotation.AllowResizing &&
+ this._resizingMode >= ResizingMode.TopLeftHandle &&
+ this._resizingMode <= ResizingMode.LeftHandle)
+ {
+ this._resizingMode = ResizingMode.None;
+ }
+ if(!annotation.AllowAnchorMoving &&
+ this._resizingMode == ResizingMode.AnchorHandle)
+ {
+ this._resizingMode = ResizingMode.None;
+ }
+ if(this._resizingMode == ResizingMode.None && annotation.AllowMoving)
+ {
+ // Annotation moving mode
+ this._resizingMode = ResizingMode.Moving;
+ }
+ }
+ else
+ {
+ if(this._resizingMode == ResizingMode.None && annotation.AllowMoving)
+ {
+ // Do not allow moving child annotations inside the group.
+ // Only the whole group can be selected, resized or repositioned.
+ if (annotation.AnnotationGroup != null)
+ {
+ // Move the group instead
+ lastClickedAnnotation = annotation.AnnotationGroup;
+ }
+
+ // Annotation moving mode
+ this._resizingMode = ResizingMode.Moving;
+ }
+ }
+ }
+
+ // Update chart
+ if(updateRequired)
+ {
+ // Invalidate and update the chart
+ this.Chart.Invalidate(true);
+ this.Chart.UpdateAnnotations();
+ }
+ }
+ }
+
+ /// <summary>
+ /// Mouse button released in the control.
+ /// </summary>
+ /// <param name="e">Event arguments.</param>
+ internal void OnMouseUp(MouseEventArgs e)
+ {
+ // Check if in annotation placement mode
+ if( this.placingAnnotation != null)
+ {
+ if(!this.placingAnnotation.PlacementMouseUp(new PointF(e.X, e.Y), e.Button))
+ {
+ return;
+ }
+ }
+
+ if(e.Button == MouseButtons.Left)
+ {
+ // Reset moving sizing start point
+ this._movingResizingStartPoint = PointF.Empty;
+ this._resizingMode = ResizingMode.None;
+ }
+
+ // Loop through all annotation objects
+ for(int index = 0; index < this.Count; index++)
+ {
+ Annotation annotation = this[index];
+
+ // NOTE: Automatic deleting feature was disabled. -AG.
+ /*
+ // Delete all annotation objects moved outside clipping region
+ if( annotation.outsideClipRegion )
+ {
+ this.List.RemoveAt(index);
+ --index;
+ }
+ */
+
+ // Reset start position/location fields
+ annotation.startMovePositionRel = RectangleF.Empty;
+ annotation.startMoveAnchorLocationRel = PointF.Empty;
+ if(annotation.startMovePathRel != null)
+ {
+ annotation.startMovePathRel.Dispose();
+ annotation.startMovePathRel = null;
+ }
+
+ // Fire position changed event
+ if( annotation.positionChanged )
+ {
+ annotation.positionChanged = false;
+ if (this.Chart != null)
+ {
+ this.Chart.OnAnnotationPositionChanged(annotation);
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Mouse moved in the control.
+ /// </summary>
+ /// <param name="e">Event arguments.</param>
+ internal void OnMouseMove(MouseEventArgs e)
+ {
+ // Check if in annotation placement mode
+ if(this.placingAnnotation != null)
+ {
+ System.Windows.Forms.Cursor newCursor = this.Chart.Cursor;
+ if(this.placingAnnotation.IsValidPlacementPosition(e.X, e.Y))
+ {
+ newCursor = Cursors.Cross;
+ }
+ else
+ {
+ newCursor = this.Chart.defaultCursor;
+ }
+
+ // Set current chart cursor
+ if (newCursor != this.Chart.Cursor)
+ {
+ System.Windows.Forms.Cursor tmpCursor = this.Chart.defaultCursor;
+ this.Chart.Cursor = newCursor;
+ this.Chart.defaultCursor = tmpCursor;
+ }
+
+ this.placingAnnotation.PlacementMouseMove(new PointF(e.X, e.Y));
+
+ return;
+ }
+
+ // Check if currently resizing/moving annotation
+ if(!this._movingResizingStartPoint.IsEmpty &&
+ this._resizingMode != ResizingMode.None)
+ {
+ // Calculate how far the mouse was moved
+ SizeF moveDistance = new SizeF(
+ this._movingResizingStartPoint.X - e.X,
+ this._movingResizingStartPoint.Y - e.Y );
+
+ // Update location of all selected annotation objects
+ foreach(Annotation annot in this)
+ {
+ if(annot.IsSelected &&
+ ( (this._resizingMode == ResizingMode.MovingPathPoints && annot.AllowPathEditing) ||
+ (this._resizingMode == ResizingMode.Moving && annot.AllowMoving) ||
+ (this._resizingMode == ResizingMode.AnchorHandle && annot.AllowAnchorMoving) ||
+ (this._resizingMode >= ResizingMode.TopLeftHandle && this._resizingMode <= ResizingMode.LeftHandle && annot.AllowResizing) ) )
+ {
+ annot.AdjustLocationSize(moveDistance, this._resizingMode, true, true);
+ }
+ }
+
+ // Move last clicked non-selected annotation
+ if(lastClickedAnnotation != null &&
+ !lastClickedAnnotation.IsSelected)
+ {
+ if(this._resizingMode == ResizingMode.Moving &&
+ lastClickedAnnotation.AllowMoving)
+ {
+ lastClickedAnnotation.AdjustLocationSize(moveDistance, this._resizingMode, true, true);
+ }
+ }
+
+ // Invalidate and update the chart
+ this.Chart.Invalidate(true);
+ this.Chart.UpdateAnnotations();
+ }
+ else if(this.Count > 0)
+ {
+ // Check if currently placing annotation from the UserInterface
+ bool process = true;
+
+ if(process)
+ {
+ // Check if mouse pointer is over the annotation selection handle
+ ResizingMode currentResizingMode = ResizingMode.None;
+ Annotation annotation =
+ HitTestSelectionHandles(new PointF(e.X, e.Y), ref currentResizingMode);
+
+ // Check if mouse pointer over the annotation object movable area
+ if(annotation == null)
+ {
+ HitTestResult result = this.Chart.HitTest(e.X, e.Y, ChartElementType.Annotation);
+ if(result != null && result.ChartElementType == ChartElementType.Annotation)
+ {
+ annotation = (Annotation)result.Object;
+ if(annotation != null)
+ {
+ // Check if annotation is in the collection
+ if(this.Contains(annotation))
+ {
+ currentResizingMode = ResizingMode.Moving;
+ if(annotation.AllowMoving == false)
+ {
+ // Movement is not allowed
+ annotation = null;
+ currentResizingMode = ResizingMode.None;
+ }
+ }
+ }
+ }
+ }
+ // Set mouse cursor
+ SetResizingCursor(annotation, currentResizingMode);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Sets mouse cursor shape.
+ /// </summary>
+ /// <param name="annotation">Annotation object.</param>
+ /// <param name="currentResizingMode">Resizing mode.</param>
+ private void SetResizingCursor(Annotation annotation, ResizingMode currentResizingMode)
+ {
+ // Change current cursor
+ if(this.Chart != null)
+ {
+ System.Windows.Forms.Cursor newCursor = this.Chart.Cursor;
+ if(annotation != null)
+ {
+ if(currentResizingMode == ResizingMode.MovingPathPoints &&
+ annotation.AllowPathEditing)
+ {
+ newCursor = Cursors.Cross;
+ }
+
+ if(currentResizingMode == ResizingMode.Moving &&
+ annotation.AllowMoving)
+ {
+ newCursor = Cursors.SizeAll;
+ }
+
+ if(currentResizingMode == ResizingMode.AnchorHandle &&
+ annotation.AllowAnchorMoving)
+ {
+ newCursor = Cursors.Cross;
+ }
+
+ if(currentResizingMode != ResizingMode.Moving &&
+ annotation.AllowResizing)
+ {
+ if(annotation.SelectionPointsStyle == SelectionPointsStyle.TwoPoints)
+ {
+ if(currentResizingMode == ResizingMode.TopLeftHandle ||
+ currentResizingMode == ResizingMode.BottomRightHandle)
+ {
+ newCursor = Cursors.Cross;
+ }
+ }
+ else
+ {
+ if(currentResizingMode == ResizingMode.TopLeftHandle ||
+ currentResizingMode == ResizingMode.BottomRightHandle)
+ {
+ newCursor = Cursors.SizeNWSE;
+ }
+ else if(currentResizingMode == ResizingMode.TopRightHandle ||
+ currentResizingMode == ResizingMode.BottomLeftHandle)
+ {
+ newCursor = Cursors.SizeNESW;
+ }
+ else if(currentResizingMode == ResizingMode.TopHandle ||
+ currentResizingMode == ResizingMode.BottomHandle)
+ {
+ newCursor = Cursors.SizeNS;
+ }
+ else if(currentResizingMode == ResizingMode.LeftHandle ||
+ currentResizingMode == ResizingMode.RightHandle)
+ {
+ newCursor = Cursors.SizeWE;
+ }
+ }
+ }
+ }
+ else
+ {
+ newCursor = this.Chart.defaultCursor;
+ }
+
+ // Set current chart cursor
+ if (newCursor != this.Chart.Cursor)
+ {
+ System.Windows.Forms.Cursor tmpCursor = this.Chart.defaultCursor;
+ this.Chart.Cursor = newCursor;
+ this.Chart.defaultCursor = tmpCursor;
+ }
+ }
+ }
+
+#endif // Microsoft_CONTROL
+
+ #endregion
+
+ #region Event handlers
+ internal void ChartAreaNameReferenceChanged(object sender, NameReferenceChangedEventArgs e)
+ {
+ // If all the chart areas are removed and then a new one is inserted - Annotations don't get bound to it by default
+ if (e.OldElement == null)
+ return;
+
+ foreach (Annotation annotation in this)
+ {
+ if (annotation.ClipToChartArea == e.OldName)
+ annotation.ClipToChartArea = e.NewName;
+
+ AnnotationGroup group = annotation as AnnotationGroup;
+ if (group != null)
+ {
+ group.Annotations.ChartAreaNameReferenceChanged(sender, e);
+ }
+ }
+ }
+ #endregion
+
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/ArrowAnnotation.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/ArrowAnnotation.cs
new file mode 100644
index 00000000000..96b6a2e68fc
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/ArrowAnnotation.cs
@@ -0,0 +1,471 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: ArrowAnnotation.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: ArrowAnnotation
+//
+// Purpose: Arrow annotation classes.
+//
+// Reviewed:
+//
+//===================================================================
+
+#region Used namespace
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Text;
+using System.Drawing.Drawing2D;
+#if Microsoft_CONTROL
+using System.Windows.Forms.DataVisualization.Charting;
+using System.Windows.Forms.DataVisualization.Charting.Data;
+using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+using System.Windows.Forms.DataVisualization.Charting.Utilities;
+using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+
+#else
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.DataVisualization.Charting;
+using System.Web.UI.DataVisualization.Charting.Data;
+using System.Web.UI.DataVisualization.Charting.Utilities;
+using System.Web.UI.DataVisualization.Charting.Borders3D;
+#endif
+
+
+#endregion
+
+#if Microsoft_CONTROL
+namespace System.Windows.Forms.DataVisualization.Charting
+
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ #region Enumeration
+
+ /// <summary>
+ /// Arrow annotation styles.
+ /// <seealso cref="ArrowAnnotation.ArrowStyle"/>
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeArrowStyle_ArrowStyle")
+ ]
+ public enum ArrowStyle
+ {
+ /// <summary>
+ /// Simple arrow.
+ /// </summary>
+ Simple,
+
+ /// <summary>
+ /// Arrow pointing in two directions.
+ /// </summary>
+ DoubleArrow,
+
+ /// <summary>
+ /// Arrow with a tail.
+ /// </summary>
+ Tailed,
+ }
+
+ #endregion // Enumeration
+
+ /// <summary>
+ /// <b>ArrowAnnotation</b> is a class class that represents an arrow annotation.
+ /// </summary>
+ /// <remarks>
+ /// Arrow annotations can be used to connect to points on the chart or highlight a
+ /// single chart area. Different arrow styles and sizes may be applied.
+ /// </remarks>
+ [
+ SRDescription("DescriptionAttributeArrowAnnotation_ArrowAnnotation"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class ArrowAnnotation : Annotation
+ {
+ #region Fields
+
+ // Annotation arrow style
+ private ArrowStyle _arrowStyle = ArrowStyle.Simple;
+
+ // Annotation arrow size
+ private int _arrowSize = 5;
+
+ #endregion
+
+ #region Construction and Initialization
+
+ /// <summary>
+ /// Default public constructor.
+ /// </summary>
+ public ArrowAnnotation()
+ : base()
+ {
+ base.AnchorAlignment = ContentAlignment.TopLeft;
+ }
+
+ #endregion
+
+ #region Properties
+
+ #region Arrow properties
+
+ /// <summary>
+ /// Gets or sets the arrow style of an arrow annotation.
+ /// <seealso cref="ArrowSize"/>
+ /// </summary>
+ /// <value>
+ /// <see cref="ArrowStyle"/> of an annotation.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ArrowStyle.Simple),
+ SRDescription("DescriptionAttributeArrowAnnotation_ArrowStyle"),
+ ParenthesizePropertyNameAttribute(true),
+ ]
+ virtual public ArrowStyle ArrowStyle
+ {
+ get
+ {
+ return _arrowStyle;
+ }
+ set
+ {
+ _arrowStyle = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the arrow size in pixels of an arrow annotation.
+ /// <seealso cref="ArrowStyle"/>
+ /// </summary>
+ /// <value>
+ /// Integer value that represents arrow size (thickness) in pixels.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(5),
+ SRDescription("DescriptionAttributeArrowAnnotation_ArrowSize"),
+ ParenthesizePropertyNameAttribute(true),
+ ]
+ virtual public int ArrowSize
+ {
+ get
+ {
+ return _arrowSize;
+ }
+ set
+ {
+ if(value <= 0)
+ {
+ throw(new ArgumentOutOfRangeException("value", SR.ExceptionAnnotationArrowSizeIsZero));
+ }
+ if(value > 100)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionAnnotationArrowSizeMustBeLessThen100));
+ }
+ _arrowSize = value;
+ Invalidate();
+ }
+ }
+
+
+ #endregion // Arrow properties
+
+ #region Anchor
+
+ /// <summary>
+ /// Gets or sets an annotation position's alignment to the anchor point.
+ /// <seealso cref="Annotation.AnchorX"/>
+ /// <seealso cref="Annotation.AnchorY"/>
+ /// <seealso cref="Annotation.AnchorDataPoint"/>
+ /// <seealso cref="Annotation.AnchorOffsetX"/>
+ /// <seealso cref="Annotation.AnchorOffsetY"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="ContentAlignment"/> value that represents the annotation's alignment to
+ /// the anchor point.
+ /// </value>
+ /// <remarks>
+ /// The annotation must be anchored using either <see cref="Annotation.AnchorDataPoint"/>, or the <see cref="Annotation.AnchorX"/>
+ /// and <see cref="Annotation.AnchorY"/> properties. Its <see cref="Annotation.X"/> and <see cref="Annotation.Y"/>
+ /// properties must be set to <b>Double.NaN</b>.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAnchor"),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DefaultValue(typeof(ContentAlignment), "TopLeft"),
+ SRDescription("DescriptionAttributeAnchorAlignment"),
+ ]
+ override public ContentAlignment AnchorAlignment
+ {
+ get
+ {
+ return base.AnchorAlignment;
+ }
+ set
+ {
+ base.AnchorAlignment = value;
+ }
+ }
+
+ #endregion // Anchoring
+
+ #region Other
+
+ /// <summary>
+ /// Gets or sets an annotation's type name.
+ /// </summary>
+ /// <remarks>
+ /// This property is used to get the name of each annotation type
+ /// (e.g. Line, Rectangle, Ellipse).
+ /// <para>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeAnnotationType"),
+ ]
+ public override string AnnotationType
+ {
+ get
+ {
+ return "Arrow";
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets annotation selection points style.
+ /// </summary>
+ /// <value>
+ /// A <see cref="SelectionPointsStyle"/> value that represents annotation
+ /// selection style.
+ /// </value>
+ /// <remarks>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(SelectionPointsStyle.Rectangle),
+ ParenthesizePropertyNameAttribute(true),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeSelectionPointsStyle"),
+ ]
+ override internal SelectionPointsStyle SelectionPointsStyle
+ {
+ get
+ {
+ return SelectionPointsStyle.TwoPoints;
+ }
+ }
+
+ #endregion
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Paints annotation object on specified graphics.
+ /// </summary>
+ /// <param name="graphics">
+ /// A <see cref="ChartGraphics"/> used to paint annotation object.
+ /// </param>
+ /// <param name="chart">
+ /// Reference to the <see cref="Chart"/> control.
+ /// </param>
+ override internal void Paint(Chart chart, ChartGraphics graphics)
+ {
+ // Get annotation position in relative coordinates
+ PointF firstPoint = PointF.Empty;
+ PointF anchorPoint = PointF.Empty;
+ SizeF size = SizeF.Empty;
+ GetRelativePosition(out firstPoint, out size, out anchorPoint);
+ PointF secondPoint = new PointF(firstPoint.X + size.Width, firstPoint.Y + size.Height);
+
+ // Create selection rectangle
+ RectangleF selectionRect = new RectangleF(firstPoint, new SizeF(secondPoint.X - firstPoint.X, secondPoint.Y - firstPoint.Y));
+
+ // Check if text position is valid
+ if( float.IsNaN(firstPoint.X) ||
+ float.IsNaN(firstPoint.Y) ||
+ float.IsNaN(secondPoint.X) ||
+ float.IsNaN(secondPoint.Y) )
+ {
+ return;
+ }
+
+ // Get arrow shape path
+ using (GraphicsPath arrowPathAbs = GetArrowPath(graphics, selectionRect))
+ {
+
+ // Draw arrow shape
+ if (this.Common.ProcessModePaint)
+ {
+ graphics.DrawPathAbs(
+ arrowPathAbs,
+ (this.BackColor.IsEmpty) ? Color.White : this.BackColor,
+ this.BackHatchStyle,
+ String.Empty,
+ ChartImageWrapMode.Scaled,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ this.BackGradientStyle,
+ this.BackSecondaryColor,
+ this.LineColor,
+ this.LineWidth,
+ this.LineDashStyle,
+ PenAlignment.Center,
+ this.ShadowOffset,
+ this.ShadowColor);
+ }
+
+ // Process hot region
+ if (this.Common.ProcessModeRegions)
+ {
+ // Use callout defined hot region
+ this.Common.HotRegionsList.AddHotRegion(
+ graphics,
+ arrowPathAbs,
+ false,
+ ReplaceKeywords(this.ToolTip),
+#if Microsoft_CONTROL
+ String.Empty,
+ String.Empty,
+ String.Empty,
+#else // Microsoft_CONTROL
+ ReplaceKeywords(this.Url),
+ ReplaceKeywords(this.MapAreaAttributes),
+ ReplaceKeywords(this.PostBackValue),
+#endif // Microsoft_CONTROL
+ this,
+ ChartElementType.Annotation);
+ }
+
+ // Paint selection handles
+ PaintSelectionHandles(graphics, selectionRect, null);
+ }
+ }
+
+ /// <summary>
+ /// Get arrow path for the specified annotation position
+ /// </summary>
+ /// <param name="graphics"></param>
+ /// <param name="position"></param>
+ /// <returns></returns>
+ private GraphicsPath GetArrowPath(
+ ChartGraphics graphics,
+ RectangleF position)
+ {
+ // Get absolute position
+ RectangleF positionAbs = graphics.GetAbsoluteRectangle(position);
+ PointF firstPoint = positionAbs.Location;
+ PointF secondPoint = new PointF(positionAbs.Right, positionAbs.Bottom);
+
+ // Calculate arrow length
+ float deltaX = secondPoint.X - firstPoint.X;
+ float deltaY = secondPoint.Y - firstPoint.Y;
+ float arrowLength = (float)Math.Sqrt(deltaX * deltaX + deltaY * deltaY);
+
+ // Create unrotated graphics path for the arrow started at the annotation location
+ // and going to the right for the length of the rotated arrow.
+ GraphicsPath path = new GraphicsPath();
+
+ PointF[] points = null;
+ float pointerRatio = 2.1f;
+ if(this.ArrowStyle == ArrowStyle.Simple)
+ {
+ points = new PointF[] {
+ firstPoint,
+ new PointF(firstPoint.X + this.ArrowSize*pointerRatio, firstPoint.Y - this.ArrowSize*pointerRatio),
+ new PointF(firstPoint.X + this.ArrowSize*pointerRatio, firstPoint.Y - this.ArrowSize),
+ new PointF(firstPoint.X + arrowLength, firstPoint.Y - this.ArrowSize),
+ new PointF(firstPoint.X + arrowLength, firstPoint.Y + this.ArrowSize),
+ new PointF(firstPoint.X + this.ArrowSize*pointerRatio, firstPoint.Y + this.ArrowSize),
+ new PointF(firstPoint.X + this.ArrowSize*pointerRatio, firstPoint.Y + this.ArrowSize*pointerRatio) };
+ }
+ else if(this.ArrowStyle == ArrowStyle.DoubleArrow)
+ {
+ points = new PointF[] {
+ firstPoint,
+ new PointF(firstPoint.X + this.ArrowSize*pointerRatio, firstPoint.Y - this.ArrowSize*pointerRatio),
+ new PointF(firstPoint.X + this.ArrowSize*pointerRatio, firstPoint.Y - this.ArrowSize),
+ new PointF(firstPoint.X + arrowLength - this.ArrowSize*pointerRatio, firstPoint.Y - this.ArrowSize),
+ new PointF(firstPoint.X + arrowLength - this.ArrowSize*pointerRatio, firstPoint.Y - this.ArrowSize*pointerRatio),
+ new PointF(firstPoint.X + arrowLength, firstPoint.Y),
+ new PointF(firstPoint.X + arrowLength - this.ArrowSize*pointerRatio, firstPoint.Y + this.ArrowSize*pointerRatio),
+ new PointF(firstPoint.X + arrowLength - this.ArrowSize*pointerRatio, firstPoint.Y + this.ArrowSize),
+ new PointF(firstPoint.X + this.ArrowSize*pointerRatio, firstPoint.Y + this.ArrowSize),
+ new PointF(firstPoint.X + this.ArrowSize*pointerRatio, firstPoint.Y + this.ArrowSize*pointerRatio) };
+ }
+ else if(this.ArrowStyle == ArrowStyle.Tailed)
+ {
+ float tailRatio = 2.1f;
+ points = new PointF[] {
+ firstPoint,
+ new PointF(firstPoint.X + this.ArrowSize*pointerRatio, firstPoint.Y - this.ArrowSize*pointerRatio),
+ new PointF(firstPoint.X + this.ArrowSize*pointerRatio, firstPoint.Y - this.ArrowSize),
+ new PointF(firstPoint.X + arrowLength, firstPoint.Y - this.ArrowSize*tailRatio),
+ new PointF(firstPoint.X + arrowLength - this.ArrowSize*tailRatio, firstPoint.Y),
+ new PointF(firstPoint.X + arrowLength, firstPoint.Y + this.ArrowSize*tailRatio),
+ new PointF(firstPoint.X + this.ArrowSize*pointerRatio, firstPoint.Y + this.ArrowSize),
+ new PointF(firstPoint.X + this.ArrowSize*pointerRatio, firstPoint.Y + this.ArrowSize*pointerRatio) };
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionAnnotationArrowStyleUnknown));
+ }
+
+ path.AddLines(points);
+ path.CloseAllFigures();
+
+ // Calculate arrow angle
+ float angle = (float)(Math.Atan(deltaY / deltaX) * 180f / Math.PI);
+ if(deltaX < 0)
+ {
+ angle += 180f;
+ }
+
+ // Rotate arrow path around the first point
+ using( Matrix matrix = new Matrix() )
+ {
+ matrix.RotateAt(angle, firstPoint);
+ path.Transform(matrix);
+ }
+
+ return path;
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/CalloutAnnotation.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/CalloutAnnotation.cs
new file mode 100644
index 00000000000..3f5dcc688fa
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/CalloutAnnotation.cs
@@ -0,0 +1,1901 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: CalloutAnnotation.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: CalloutAnnotation
+//
+// Purpose: Callout annotation classes.
+//
+// Reviewed:
+//
+//===================================================================
+
+#region Used namespace
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Text;
+using System.Drawing.Drawing2D;
+#if Microsoft_CONTROL
+using System.Windows.Forms.DataVisualization.Charting;
+using System.Windows.Forms.DataVisualization.Charting.Data;
+using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+using System.Windows.Forms.DataVisualization.Charting.Utilities;
+using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+
+#else
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.DataVisualization.Charting;
+using System.Web.UI.DataVisualization.Charting.Data;
+using System.Web.UI.DataVisualization.Charting.Utilities;
+using System.Web.UI.DataVisualization.Charting.Borders3D;
+#endif
+
+
+#endregion
+
+#if Microsoft_CONTROL
+namespace System.Windows.Forms.DataVisualization.Charting
+
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ #region Enumerations
+
+ /// <summary>
+ /// Annotation callout style.
+ /// <seealso cref="CalloutAnnotation.CalloutStyle"/>
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeCalloutStyle_CalloutStyle"),
+ ]
+ public enum CalloutStyle
+ {
+ /// <summary>
+ /// Callout text is underlined and a line is pointing to the anchor point.
+ /// </summary>
+ SimpleLine,
+
+ /// <summary>
+ /// Border is drawn around text and a line is pointing to the anchor point.
+ /// </summary>
+ Borderline,
+
+ /// <summary>
+ /// Callout text is inside the cloud and smaller clouds are pointing to the anchor point.
+ /// </summary>
+ Cloud,
+
+ /// <summary>
+ /// Rectangle is drawn around the callout text, which is connected with the anchor point.
+ /// </summary>
+ Rectangle,
+
+ /// <summary>
+ /// Rounded rectangle is drawn around the callout text, which is connected with the anchor point.
+ /// </summary>
+ RoundedRectangle,
+
+ /// <summary>
+ /// Ellipse is drawn around the callout text, which is connected with the anchor point.
+ /// </summary>
+ Ellipse,
+
+ /// <summary>
+ /// Perspective rectangle is drawn around the callout text, which is connected with the anchor point.
+ /// </summary>
+ Perspective,
+ }
+
+ #endregion
+
+ /// <summary>
+ /// <b>CalloutAnnotation</b> is a class class that represents a callout annotation.
+ /// </summary>
+ /// <remarks>
+ /// Callout annotation is the only annotation that draws a connection between the
+ /// annotation position and anchor point. It can display text and automatically
+ /// calculate the required size. Different <see cref="CalloutStyle"/> are supported.
+ /// </remarks>
+ [
+ SRDescription("DescriptionAttributeCalloutAnnotation_CalloutAnnotation"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class CalloutAnnotation : TextAnnotation
+ {
+ #region Fields
+
+ // Callout anchor type
+ private LineAnchorCapStyle _calloutAnchorCap = LineAnchorCapStyle.Arrow;
+
+ // Callout drawing style
+ private CalloutStyle _calloutStyle = CalloutStyle.Rectangle;
+
+ // Cloud shape path
+ private static GraphicsPath _cloudPath = null;
+
+ // Cloud shape outline path
+ private static GraphicsPath _cloudOutlinePath = null;
+
+ // Cloud shape boundary rectangle
+ private static RectangleF _cloudBounds = RectangleF.Empty;
+
+ #endregion
+
+ #region Construction and Initialization
+
+ /// <summary>
+ /// Default public constructor.
+ /// </summary>
+ public CalloutAnnotation()
+ : base()
+ {
+ // Changing default values of properties
+ this.anchorOffsetX = 3.0;
+ this.anchorOffsetY = 3.0;
+ this.anchorAlignment = ContentAlignment.BottomLeft;
+ }
+
+ #endregion
+
+ #region Properties
+
+ #region Callout properties
+
+ /// <summary>
+ /// Gets or sets the annotation callout style.
+ /// </summary>
+ /// <value>
+ /// <see cref="CalloutStyle"/> of the annotation.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(CalloutStyle.Rectangle),
+ SRDescription("DescriptionAttributeCalloutAnnotation_CalloutStyle"),
+ ParenthesizePropertyNameAttribute(true),
+ ]
+ virtual public CalloutStyle CalloutStyle
+ {
+ get
+ {
+ return _calloutStyle;
+ }
+ set
+ {
+ _calloutStyle = value;
+ this.ResetCurrentRelativePosition();
+
+ // Reset content size to empty
+ contentSize = SizeF.Empty;
+
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the anchor cap style of a callout line.
+ /// </summary>
+ /// <value>
+ /// A <see cref="LineAnchorCapStyle"/> value used as the anchor cap of a callout line.
+ /// </value>
+ /// <remarks>
+ /// This property sets the anchor cap of the line connecting an annotation to
+ /// its anchor point. It only applies when SimpleLine or BorderLine
+ /// are used.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(LineAnchorCapStyle.Arrow),
+ SRDescription("DescriptionAttributeCalloutAnnotation_CalloutAnchorCap"),
+ ]
+ virtual public LineAnchorCapStyle CalloutAnchorCap
+ {
+ get
+ {
+ return _calloutAnchorCap;
+ }
+ set
+ {
+ _calloutAnchorCap = value;
+ Invalidate();
+ }
+ }
+ #endregion // Callout properties
+
+ #region Applicable Annotation Appearance Attributes (set as Browsable)
+
+ /// <summary>
+ /// Gets or sets the color of an annotation line.
+ /// <seealso cref="LineWidth"/>
+ /// <seealso cref="LineDashStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value used to draw an annotation line.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(true),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeLineColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ override public Color LineColor
+ {
+ get
+ {
+ return base.LineColor;
+ }
+ set
+ {
+ base.LineColor = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the width of an annotation line.
+ /// <seealso cref="LineColor"/>
+ /// <seealso cref="LineDashStyle"/>
+ /// </summary>
+ /// <value>
+ /// An integer value defining the width of an annotation line in pixels.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(true),
+ DefaultValue(1),
+ SRDescription("DescriptionAttributeLineWidth"),
+ ]
+ override public int LineWidth
+ {
+ get
+ {
+ return base.LineWidth;
+ }
+ set
+ {
+ base.LineWidth = value;
+
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the style of an annotation line.
+ /// <seealso cref="LineWidth"/>
+ /// <seealso cref="LineColor"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="ChartDashStyle"/> value used to draw an annotation line.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(true),
+ DefaultValue(ChartDashStyle.Solid),
+ SRDescription("DescriptionAttributeLineDashStyle"),
+ ]
+ override public ChartDashStyle LineDashStyle
+ {
+ get
+ {
+ return base.LineDashStyle;
+ }
+ set
+ {
+ base.LineDashStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background color of an annotation.
+ /// <seealso cref="BackSecondaryColor"/>
+ /// <seealso cref="BackHatchStyle"/>
+ /// <seealso cref="BackGradientStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value used for the background of an annotation.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(true),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeBackColor"),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ override public Color BackColor
+ {
+ get
+ {
+ return base.BackColor;
+ }
+ set
+ {
+ base.BackColor = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background hatch style of an annotation.
+ /// <seealso cref="BackSecondaryColor"/>
+ /// <seealso cref="BackColor"/>
+ /// <seealso cref="BackGradientStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="ChartHatchStyle"/> value used for the background of an annotation.
+ /// </value>
+ /// <remarks>
+ /// Two colors are used to draw the hatching, <see cref="BackColor"/> and <see cref="BackSecondaryColor"/>.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(true),
+ DefaultValue(ChartHatchStyle.None),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackHatchStyle"),
+ Editor(Editors.HatchStyleEditor.Editor, Editors.HatchStyleEditor.Base)
+ ]
+ override public ChartHatchStyle BackHatchStyle
+ {
+ get
+ {
+ return base.BackHatchStyle;
+ }
+ set
+ {
+ base.BackHatchStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background gradient style of an annotation.
+ /// <seealso cref="BackSecondaryColor"/>
+ /// <seealso cref="BackColor"/>
+ /// <seealso cref="BackHatchStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="GradientStyle"/> value used for the background of an annotation.
+ /// </value>
+ /// <remarks>
+ /// Two colors are used to draw the gradient, <see cref="BackColor"/> and <see cref="BackSecondaryColor"/>.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(true),
+ DefaultValue(GradientStyle.None),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackGradientStyle"),
+ Editor(Editors.GradientEditor.Editor, Editors.GradientEditor.Base)
+ ]
+ override public GradientStyle BackGradientStyle
+ {
+ get
+ {
+ return base.BackGradientStyle;
+ }
+ set
+ {
+ base.BackGradientStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the secondary background color of an annotation.
+ /// <seealso cref="BackColor"/>
+ /// <seealso cref="BackHatchStyle"/>
+ /// <seealso cref="BackGradientStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value used for the secondary color of an annotation background with
+ /// hatching or gradient fill.
+ /// </value>
+ /// <remarks>
+ /// This color is used with <see cref="BackColor"/> when <see cref="BackHatchStyle"/> or
+ /// <see cref="BackGradientStyle"/> are used.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(true),
+ DefaultValue(typeof(Color), ""),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackSecondaryColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ override public Color BackSecondaryColor
+ {
+ get
+ {
+ return base.BackSecondaryColor;
+ }
+ set
+ {
+ base.BackSecondaryColor = value;
+ }
+ }
+
+ #endregion
+
+ #region Anchor
+
+ /// <summary>
+ /// Gets or sets the x-coordinate offset between the positions of an annotation and its anchor point.
+ /// <seealso cref="AnchorOffsetY"/>
+ /// <seealso cref="Annotation.AnchorDataPoint"/>
+ /// <seealso cref="Annotation.AnchorX"/>
+ /// <seealso cref="AnchorAlignment"/>
+ /// </summary>
+ /// <value>
+ /// A double value that represents the x-coordinate offset between the positions of an annotation and its anchor point.
+ /// </value>
+ /// <remarks>
+ /// The annotation must be anchored using the <see cref="Annotation.AnchorDataPoint"/> or
+ /// <see cref="Annotation.AnchorX"/> properties, and its <see cref="Annotation.X"/> property must be set
+ /// to <b>Double.NaN</b>.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAnchor"),
+ DefaultValue(3.0),
+ SRDescription("DescriptionAttributeCalloutAnnotation_AnchorOffsetX"),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ ]
+ override public double AnchorOffsetX
+ {
+ get
+ {
+ return base.AnchorOffsetX;
+ }
+ set
+ {
+ base.AnchorOffsetX = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the y-coordinate offset between the positions of an annotation and its anchor point.
+ /// <seealso cref="Annotation.AnchorOffsetX"/>
+ /// <seealso cref="Annotation.AnchorDataPoint"/>
+ /// <seealso cref="Annotation.AnchorY"/>
+ /// <seealso cref="Annotation.AnchorAlignment"/>
+ /// </summary>
+ /// <value>
+ /// A double value that represents the y-coordinate offset between the positions of an annotation and its anchor point.
+ /// </value>
+ /// <remarks>
+ /// Annotation must be anchored using <see cref="Annotation.AnchorDataPoint"/> or
+ /// <see cref="Annotation.AnchorY"/> properties and its <see cref="Annotation.Y"/> property must be set
+ /// to <b>Double.NaN</b>.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAnchor"),
+ DefaultValue(3.0),
+ SRDescription("DescriptionAttributeCalloutAnnotation_AnchorOffsetY"),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ ]
+ override public double AnchorOffsetY
+ {
+ get
+ {
+ return base.AnchorOffsetY;
+ }
+ set
+ {
+ base.AnchorOffsetY = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an annotation position's alignment to the anchor point.
+ /// <seealso cref="Annotation.AnchorX"/>
+ /// <seealso cref="Annotation.AnchorY"/>
+ /// <seealso cref="Annotation.AnchorDataPoint"/>
+ /// <seealso cref="AnchorOffsetX"/>
+ /// <seealso cref="AnchorOffsetY"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="ContentAlignment"/> value that represents the annotation's alignment to
+ /// the anchor point.
+ /// </value>
+ /// <remarks>
+ /// The annotation must be anchored using either <see cref="Annotation.AnchorDataPoint"/>, or the <see cref="Annotation.AnchorX"/>
+ /// and <see cref="Annotation.AnchorY"/> properties. Its <see cref="Annotation.X"/> and <see cref="Annotation.Y"/>
+ /// properties must be set to <b>Double.NaN</b>.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAnchor"),
+ DefaultValue(typeof(ContentAlignment), "BottomLeft"),
+ SRDescription("DescriptionAttributeAnchorAlignment"),
+ ]
+ override public ContentAlignment AnchorAlignment
+ {
+ get
+ {
+ return base.AnchorAlignment;
+ }
+ set
+ {
+ base.AnchorAlignment = value;
+ }
+ }
+
+ #endregion // Anchoring
+
+ #region Other
+
+ /// <summary>
+ /// Gets or sets an annotation's type name.
+ /// </summary>
+ /// <remarks>
+ /// This property is used to get the name of each annotation type
+ /// (e.g. Line, Rectangle, Ellipse).
+ /// <para>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeAnnotationType"),
+ ]
+ public override string AnnotationType
+ {
+ get
+ {
+ return "Callout";
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets annotation selection points style.
+ /// </summary>
+ /// <value>
+ /// A <see cref="SelectionPointsStyle"/> value that represents annotation
+ /// selection style.
+ /// </value>
+ /// <remarks>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(SelectionPointsStyle.Rectangle),
+ ParenthesizePropertyNameAttribute(true),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeSelectionPointsStyle"),
+ ]
+ override internal SelectionPointsStyle SelectionPointsStyle
+ {
+ get
+ {
+ return SelectionPointsStyle.Rectangle;
+ }
+ }
+
+ #endregion
+
+ #endregion
+
+ #region Methods
+
+ #region Text Spacing
+
+ /// <summary>
+ /// Gets text spacing on four different sides in relative coordinates.
+ /// </summary>
+ /// <param name="annotationRelative">Indicates that spacing is in annotation relative coordinates.</param>
+ /// <returns>Rectangle with text spacing values.</returns>
+ internal override RectangleF GetTextSpacing(out bool annotationRelative)
+ {
+ RectangleF spacing = base.GetTextSpacing(out annotationRelative);
+ if(this._calloutStyle == CalloutStyle.Cloud ||
+ this._calloutStyle == CalloutStyle.Ellipse)
+ {
+ spacing = new RectangleF(4f, 4f, 4f, 4f);
+ annotationRelative = true;
+ }
+ else if(this._calloutStyle == CalloutStyle.RoundedRectangle)
+ {
+ spacing = new RectangleF(1f, 1f, 1f, 1f);
+ annotationRelative = true;
+ }
+
+ return spacing;
+ }
+
+ #endregion // Text Spacing
+
+ #region Painting
+
+ /// <summary>
+ /// Paints annotation object on specified graphics.
+ /// </summary>
+ /// <param name="graphics">
+ /// A <see cref="ChartGraphics"/> used to paint annotation object.
+ /// </param>
+ /// <param name="chart">
+ /// Reference to the <see cref="Chart"/> control.
+ /// </param>
+ override internal void Paint(Chart chart, ChartGraphics graphics)
+ {
+ // Get annotation position in relative coordinates
+ PointF firstPoint = PointF.Empty;
+ PointF anchorPoint = PointF.Empty;
+ SizeF size = SizeF.Empty;
+ GetRelativePosition(out firstPoint, out size, out anchorPoint);
+ PointF secondPoint = new PointF(firstPoint.X + size.Width, firstPoint.Y + size.Height);
+
+ // Create selection rectangle
+ RectangleF selectionRect = new RectangleF(firstPoint, new SizeF(secondPoint.X - firstPoint.X, secondPoint.Y - firstPoint.Y));
+
+ // Adjust negative rectangle width and height
+ RectangleF rectanglePosition = new RectangleF(selectionRect.Location, selectionRect.Size);
+ if(rectanglePosition.Width < 0)
+ {
+ rectanglePosition.X = rectanglePosition.Right;
+ rectanglePosition.Width = -rectanglePosition.Width;
+ }
+ if(rectanglePosition.Height < 0)
+ {
+ rectanglePosition.Y = rectanglePosition.Bottom;
+ rectanglePosition.Height = -rectanglePosition.Height;
+ }
+
+ // Check if position is valid
+ if( float.IsNaN(rectanglePosition.X) ||
+ float.IsNaN(rectanglePosition.Y) ||
+ float.IsNaN(rectanglePosition.Right) ||
+ float.IsNaN(rectanglePosition.Bottom) )
+ {
+ return;
+ }
+
+ // Paint different style of callouts
+ GraphicsPath hotRegionPathAbs = null;
+ if(this.Common.ProcessModePaint)
+ {
+ switch(this._calloutStyle)
+ {
+ case(CalloutStyle.SimpleLine):
+ hotRegionPathAbs = DrawRectangleLineCallout(
+ graphics,
+ rectanglePosition,
+ anchorPoint,
+ false);
+ break;
+ case(CalloutStyle.Borderline):
+ hotRegionPathAbs = DrawRectangleLineCallout(
+ graphics,
+ rectanglePosition,
+ anchorPoint,
+ true);
+ break;
+ case(CalloutStyle.Perspective):
+ hotRegionPathAbs = DrawPerspectiveCallout(
+ graphics,
+ rectanglePosition,
+ anchorPoint);
+ break;
+ case(CalloutStyle.Cloud):
+ hotRegionPathAbs = DrawCloudCallout(
+ graphics,
+ rectanglePosition,
+ anchorPoint);
+ break;
+ case(CalloutStyle.Rectangle):
+ hotRegionPathAbs = DrawRectangleCallout(
+ graphics,
+ rectanglePosition,
+ anchorPoint);
+ break;
+ case(CalloutStyle.Ellipse):
+ hotRegionPathAbs = DrawRoundedRectCallout(
+ graphics,
+ rectanglePosition,
+ anchorPoint,
+ true);
+ break;
+ case(CalloutStyle.RoundedRectangle):
+ hotRegionPathAbs = DrawRoundedRectCallout(
+ graphics,
+ rectanglePosition,
+ anchorPoint,
+ false);
+ break;
+ }
+ }
+
+ if(this.Common.ProcessModeRegions)
+ {
+ if(hotRegionPathAbs != null)
+ {
+ // If there is more then one graphical path split them and create
+ // image maps for every graphical path separately.
+ GraphicsPathIterator iterator = new GraphicsPathIterator(hotRegionPathAbs);
+
+ // There is more then one path.
+ using (GraphicsPath subPath = new GraphicsPath())
+ {
+ while (iterator.NextMarker(subPath) > 0)
+ {
+ // Use callout defined hot region
+ this.Common.HotRegionsList.AddHotRegion(
+ graphics,
+ subPath,
+ false,
+ ReplaceKeywords(this.ToolTip),
+#if Microsoft_CONTROL
+ String.Empty,
+ String.Empty,
+ String.Empty,
+#else // Microsoft_CONTROL
+ ReplaceKeywords(this.Url),
+ ReplaceKeywords(this.MapAreaAttributes),
+ ReplaceKeywords(this.PostBackValue),
+#endif // Microsoft_CONTROL
+ this,
+ ChartElementType.Annotation);
+
+ // Reset current path
+ subPath.Reset();
+ }
+ }
+ }
+ else
+ {
+ // Use rectangular hot region
+ this.Common.HotRegionsList.AddHotRegion(
+ rectanglePosition,
+ ReplaceKeywords(this.ToolTip),
+#if Microsoft_CONTROL
+ String.Empty,
+ String.Empty,
+ String.Empty,
+#else // Microsoft_CONTROL
+ ReplaceKeywords(this.Url),
+ ReplaceKeywords(this.MapAreaAttributes),
+ ReplaceKeywords(this.PostBackValue),
+#endif // Microsoft_CONTROL
+ this,
+ ChartElementType.Annotation,
+ String.Empty);
+ }
+ }
+
+ //Clean up
+ if (hotRegionPathAbs != null)
+ hotRegionPathAbs.Dispose();
+
+ // Paint selection handles
+ PaintSelectionHandles(graphics, selectionRect, null);
+ }
+
+ /// <summary>
+ /// Draws Rounded rectangle or Ellipse style callout.
+ /// </summary>
+ /// <param name="graphics">Chart graphics.</param>
+ /// <param name="rectanglePosition">Position of annotation objet.</param>
+ /// <param name="anchorPoint">Anchor location.</param>
+ /// <param name="isEllipse">True if ellipse shape should be used.</param>
+ /// <returns>Hot region of the callout.</returns>
+ private GraphicsPath DrawRoundedRectCallout(
+ ChartGraphics graphics,
+ RectangleF rectanglePosition,
+ PointF anchorPoint,
+ bool isEllipse)
+ {
+ // Get absolute position
+ RectangleF rectanglePositionAbs = graphics.GetAbsoluteRectangle(rectanglePosition);
+
+ // NOTE: Fix for issue #6692.
+ // Do not draw the callout if size is not set. This may happen if callou text is set to empty string.
+ if (rectanglePositionAbs.Width <= 0 || rectanglePositionAbs.Height <= 0)
+ {
+ return null;
+ }
+
+ // Create ellipse path
+ GraphicsPath ellipsePath = new GraphicsPath();
+ if(isEllipse)
+ {
+ // Add ellipse shape
+ ellipsePath.AddEllipse(rectanglePositionAbs);
+ }
+ else
+ {
+ // Add rounded rectangle shape
+ float radius = Math.Min(rectanglePositionAbs.Width, rectanglePositionAbs.Height);
+ radius /= 5f;
+ ellipsePath = this.CreateRoundedRectPath(rectanglePositionAbs, radius);
+ }
+
+ // Draw perspective polygons from anchoring point
+ if(!float.IsNaN(anchorPoint.X) && !float.IsNaN(anchorPoint.Y))
+ {
+ // Check if point is inside annotation position
+ if(!rectanglePosition.Contains(anchorPoint.X, anchorPoint.Y))
+ {
+ // Get absolute anchor point
+ PointF anchorPointAbs = graphics.GetAbsolutePoint(new PointF(anchorPoint.X, anchorPoint.Y));
+
+ // Flatten ellipse path
+ ellipsePath.Flatten();
+
+ // Find point in the path closest to the anchor point
+ PointF[] points = ellipsePath.PathPoints;
+ int closestPointIndex = 0;
+ int index = 0;
+ float currentDistance = float.MaxValue;
+ foreach(PointF point in points)
+ {
+ float deltaX = point.X - anchorPointAbs.X;
+ float deltaY = point.Y - anchorPointAbs.Y;
+ float distance = deltaX * deltaX + deltaY * deltaY;
+ if(distance < currentDistance)
+ {
+ currentDistance = distance;
+ closestPointIndex = index;
+ }
+ ++ index;
+ }
+
+ // Change point to the anchor location
+ points[closestPointIndex] = anchorPointAbs;
+
+ // Recreate ellipse path
+ ellipsePath.Reset();
+ ellipsePath.AddLines(points);
+ ellipsePath.CloseAllFigures();
+ }
+ }
+
+ // Draw ellipse
+ graphics.DrawPathAbs(
+ ellipsePath,
+ this.BackColor,
+ this.BackHatchStyle,
+ String.Empty,
+ ChartImageWrapMode.Scaled,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ this.BackGradientStyle,
+ this.BackSecondaryColor,
+ this.LineColor,
+ this.LineWidth,
+ this.LineDashStyle,
+ PenAlignment.Center,
+ this.ShadowOffset,
+ this.ShadowColor);
+
+ // Draw text
+ DrawText(graphics, rectanglePosition, true, false);
+
+ return ellipsePath;
+ }
+
+ /// <summary>
+ /// Draws Rectangle style callout.
+ /// </summary>
+ /// <param name="graphics">Chart graphics.</param>
+ /// <param name="rectanglePosition">Position of annotation objet.</param>
+ /// <param name="anchorPoint">Anchor location.</param>
+ /// <returns>Hot region of the callout.</returns>
+ private GraphicsPath DrawRectangleCallout(
+ ChartGraphics graphics,
+ RectangleF rectanglePosition,
+ PointF anchorPoint)
+ {
+ // Create path for the rectangle connected with anchor point.
+ GraphicsPath hotRegion = null;
+ bool anchorVisible = false;
+ if(!float.IsNaN(anchorPoint.X) && !float.IsNaN(anchorPoint.Y))
+ {
+ // Get relative size of a pixel
+ SizeF pixelSize = graphics.GetRelativeSize(new SizeF(1f, 1f));
+
+ // Increase annotation position rectangle by 1 pixel
+ RectangleF inflatedPosition = new RectangleF(rectanglePosition.Location, rectanglePosition.Size);
+ inflatedPosition.Inflate(pixelSize);
+
+ // Check if point is inside annotation position
+ if(!inflatedPosition.Contains(anchorPoint.X, anchorPoint.Y))
+ {
+ anchorVisible = true;
+
+ // Get absolute position
+ RectangleF rectanglePositionAbs = graphics.GetAbsoluteRectangle(rectanglePosition);
+
+ // Get absolute anchor point
+ PointF anchorPointAbs = graphics.GetAbsolutePoint(new PointF(anchorPoint.X, anchorPoint.Y));
+
+ // Calculate anchor pointer thicness
+ float size = Math.Min(rectanglePositionAbs.Width, rectanglePositionAbs.Height);
+ size /= 4f;
+
+ // Create shape points
+ PointF[] points = new PointF[7];
+ if(anchorPoint.X < rectanglePosition.X &&
+ anchorPoint.Y > rectanglePosition.Bottom)
+ {
+ points[0] = rectanglePositionAbs.Location;
+ points[1] = new PointF(rectanglePositionAbs.Right, rectanglePositionAbs.Y);
+ points[2] = new PointF(rectanglePositionAbs.Right, rectanglePositionAbs.Bottom);
+ points[3] = new PointF(rectanglePositionAbs.X + size, rectanglePositionAbs.Bottom);
+ points[4] = anchorPointAbs;
+ points[5] = new PointF(rectanglePositionAbs.X, rectanglePositionAbs.Bottom - size);
+ points[6] = new PointF(rectanglePositionAbs.X, rectanglePositionAbs.Bottom - size);
+ }
+ else if(anchorPoint.X >= rectanglePosition.X &&
+ anchorPoint.X <= rectanglePosition.Right &&
+ anchorPoint.Y > rectanglePosition.Bottom)
+ {
+ points[0] = rectanglePositionAbs.Location;
+ points[1] = new PointF(rectanglePositionAbs.Right, rectanglePositionAbs.Y);
+ points[2] = new PointF(rectanglePositionAbs.Right, rectanglePositionAbs.Bottom);
+ points[3] = new PointF(rectanglePositionAbs.X + rectanglePositionAbs.Width / 2f + size, rectanglePositionAbs.Bottom);
+ points[4] = anchorPointAbs;
+ points[5] = new PointF(rectanglePositionAbs.X + rectanglePositionAbs.Width / 2f - size, rectanglePositionAbs.Bottom);
+ points[6] = new PointF(rectanglePositionAbs.X, rectanglePositionAbs.Bottom);
+ }
+ else if(anchorPoint.X > rectanglePosition.Right &&
+ anchorPoint.Y > rectanglePosition.Bottom)
+ {
+ points[0] = rectanglePositionAbs.Location;
+ points[1] = new PointF(rectanglePositionAbs.Right, rectanglePositionAbs.Y);
+ points[2] = new PointF(rectanglePositionAbs.Right, rectanglePositionAbs.Bottom - size);
+ points[3] = anchorPointAbs;
+ points[4] = new PointF(rectanglePositionAbs.Right - size, rectanglePositionAbs.Bottom);
+ points[5] = new PointF(rectanglePositionAbs.X, rectanglePositionAbs.Bottom);
+ points[6] = new PointF(rectanglePositionAbs.X, rectanglePositionAbs.Bottom);
+ }
+ else if(anchorPoint.X > rectanglePosition.Right &&
+ anchorPoint.Y <= rectanglePosition.Bottom &&
+ anchorPoint.Y >= rectanglePosition.Y)
+ {
+ points[0] = rectanglePositionAbs.Location;
+ points[1] = new PointF(rectanglePositionAbs.Right, rectanglePositionAbs.Y);
+ points[2] = new PointF(rectanglePositionAbs.Right, rectanglePositionAbs.Y + rectanglePositionAbs.Height / 2f - size);
+ points[3] = anchorPointAbs;
+ points[4] = new PointF(rectanglePositionAbs.Right, rectanglePositionAbs.Y + rectanglePositionAbs.Height / 2f + size);
+ points[5] = new PointF(rectanglePositionAbs.Right, rectanglePositionAbs.Bottom);
+ points[6] = new PointF(rectanglePositionAbs.X, rectanglePositionAbs.Bottom);
+ }
+ else if(anchorPoint.X > rectanglePosition.Right &&
+ anchorPoint.Y < rectanglePosition.Y)
+ {
+ points[0] = rectanglePositionAbs.Location;
+ points[1] = new PointF(rectanglePositionAbs.Right - size, rectanglePositionAbs.Y);
+ points[2] = anchorPointAbs;
+ points[3] = new PointF(rectanglePositionAbs.Right, rectanglePositionAbs.Y + size);
+ points[4] = new PointF(rectanglePositionAbs.Right, rectanglePositionAbs.Bottom);
+ points[5] = new PointF(rectanglePositionAbs.X, rectanglePositionAbs.Bottom);
+ points[6] = new PointF(rectanglePositionAbs.X, rectanglePositionAbs.Bottom);
+ }
+ else if(anchorPoint.X >= rectanglePosition.X &&
+ anchorPoint.X <= rectanglePosition.Right &&
+ anchorPoint.Y < rectanglePosition.Y)
+ {
+ points[0] = rectanglePositionAbs.Location;
+ points[1] = new PointF(rectanglePositionAbs.X + rectanglePositionAbs.Width/2f - size, rectanglePositionAbs.Y);
+ points[2] = anchorPointAbs;
+ points[3] = new PointF(rectanglePositionAbs.X + rectanglePositionAbs.Width/2f + size, rectanglePositionAbs.Y);
+ points[4] = new PointF(rectanglePositionAbs.Right, rectanglePositionAbs.Y);
+ points[5] = new PointF(rectanglePositionAbs.Right, rectanglePositionAbs.Bottom);
+ points[6] = new PointF(rectanglePositionAbs.X, rectanglePositionAbs.Bottom);
+ }
+ else if(anchorPoint.X < rectanglePosition.X &&
+ anchorPoint.Y < rectanglePosition.Y)
+ {
+ points[0] = anchorPointAbs;
+ points[1] = new PointF(rectanglePositionAbs.X + size, rectanglePositionAbs.Y);
+ points[2] = new PointF(rectanglePositionAbs.Right, rectanglePositionAbs.Y);
+ points[3] = new PointF(rectanglePositionAbs.Right, rectanglePositionAbs.Bottom);
+ points[4] = new PointF(rectanglePositionAbs.X, rectanglePositionAbs.Bottom);
+ points[5] = new PointF(rectanglePositionAbs.X, rectanglePositionAbs.Y + size);
+ points[6] = new PointF(rectanglePositionAbs.X, rectanglePositionAbs.Y + size);
+ }
+ else if(anchorPoint.X < rectanglePosition.X &&
+ anchorPoint.Y >= rectanglePosition.Y &&
+ anchorPoint.Y <= rectanglePosition.Bottom)
+ {
+ points[0] = rectanglePositionAbs.Location;
+ points[1] = new PointF(rectanglePositionAbs.Right, rectanglePositionAbs.Y);
+ points[2] = new PointF(rectanglePositionAbs.Right, rectanglePositionAbs.Bottom);
+ points[3] = new PointF(rectanglePositionAbs.X, rectanglePositionAbs.Bottom);
+ points[4] = new PointF(rectanglePositionAbs.X, rectanglePositionAbs.Y + rectanglePositionAbs.Height/2f + size );
+ points[5] = anchorPointAbs;
+ points[6] = new PointF(rectanglePositionAbs.X, rectanglePositionAbs.Y + rectanglePositionAbs.Height/2f - size );
+ }
+
+ // Create graphics path of the callout
+ hotRegion = new GraphicsPath();
+
+ hotRegion.AddLines(points);
+ hotRegion.CloseAllFigures();
+
+ // Draw callout
+ graphics.DrawPathAbs(
+ hotRegion,
+ this.BackColor,
+ this.BackHatchStyle,
+ String.Empty,
+ ChartImageWrapMode.Scaled,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ this.BackGradientStyle,
+ this.BackSecondaryColor,
+ this.LineColor,
+ this.LineWidth,
+ this.LineDashStyle,
+ PenAlignment.Center,
+ this.ShadowOffset,
+ this.ShadowColor);
+
+ }
+ }
+
+ // Draw rectangle if anchor is not visible
+ if(!anchorVisible)
+ {
+ graphics.FillRectangleRel(
+ rectanglePosition,
+ this.BackColor,
+ this.BackHatchStyle,
+ String.Empty,
+ ChartImageWrapMode.Scaled,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ this.BackGradientStyle,
+ this.BackSecondaryColor,
+ this.LineColor,
+ this.LineWidth,
+ this.LineDashStyle,
+ this.ShadowColor,
+ this.ShadowOffset,
+ PenAlignment.Center);
+
+ // Get hot region
+ hotRegion = new GraphicsPath();
+ hotRegion.AddRectangle( graphics.GetAbsoluteRectangle(rectanglePosition) );
+ }
+
+ // Draw text
+ DrawText(graphics, rectanglePosition, false, false);
+
+ return hotRegion;
+ }
+
+ /// <summary>
+ /// Draws Perspective style callout.
+ /// </summary>
+ /// <param name="graphics">Chart graphics.</param>
+ /// <param name="rectanglePosition">Position of annotation objet.</param>
+ /// <param name="anchorPoint">Anchor location.</param>
+ /// <returns>Hot region of the cloud.</returns>
+ private GraphicsPath DrawCloudCallout(
+ ChartGraphics graphics,
+ RectangleF rectanglePosition,
+ PointF anchorPoint)
+ {
+ // Get absolute position
+ RectangleF rectanglePositionAbs = graphics.GetAbsoluteRectangle(rectanglePosition);
+
+ // Draw perspective polygons from anchoring point
+ if(!float.IsNaN(anchorPoint.X) && !float.IsNaN(anchorPoint.Y))
+ {
+ // Check if point is inside annotation position
+ if(!rectanglePosition.Contains(anchorPoint.X, anchorPoint.Y))
+ {
+ // Get center point of the cloud
+ PointF cloudCenterAbs = graphics.GetAbsolutePoint(
+ new PointF(
+ rectanglePosition.X + rectanglePosition.Width / 2f,
+ rectanglePosition.Y + rectanglePosition.Height / 2f) );
+
+ // Calculate absolute ellipse size and position
+ SizeF ellipseSize = graphics.GetAbsoluteSize(
+ new SizeF(rectanglePosition.Width, rectanglePosition.Height));
+ ellipseSize.Width /= 10f;
+ ellipseSize.Height /= 10f;
+ PointF anchorPointAbs = graphics.GetAbsolutePoint(
+ new PointF(anchorPoint.X, anchorPoint.Y));
+ PointF ellipseLocation = anchorPointAbs;
+
+ // Get distance between anchor point and center of the cloud
+ float dxAbs = anchorPointAbs.X - cloudCenterAbs.X;
+ float dyAbs = anchorPointAbs.Y - cloudCenterAbs.Y;
+
+ PointF point = PointF.Empty;
+ if(anchorPoint.Y < rectanglePosition.Y)
+ {
+ point = GetIntersectionY(cloudCenterAbs, anchorPointAbs, rectanglePositionAbs.Y);
+ if(point.X < rectanglePositionAbs.X)
+ {
+ point = GetIntersectionX(cloudCenterAbs, anchorPointAbs, rectanglePositionAbs.X);
+ }
+ else if(point.X > rectanglePositionAbs.Right)
+ {
+ point = GetIntersectionX(cloudCenterAbs, anchorPointAbs, rectanglePositionAbs.Right);
+ }
+ }
+ else if(anchorPoint.Y > rectanglePosition.Bottom)
+ {
+ point = GetIntersectionY(cloudCenterAbs, anchorPointAbs, rectanglePositionAbs.Bottom);
+ if(point.X < rectanglePositionAbs.X)
+ {
+ point = GetIntersectionX(cloudCenterAbs, anchorPointAbs, rectanglePositionAbs.X);
+ }
+ else if(point.X > rectanglePositionAbs.Right)
+ {
+ point = GetIntersectionX(cloudCenterAbs, anchorPointAbs, rectanglePositionAbs.Right);
+ }
+ }
+ else
+ {
+ if(anchorPoint.X < rectanglePosition.X)
+ {
+ point = GetIntersectionX(cloudCenterAbs, anchorPointAbs, rectanglePositionAbs.X);
+ }
+ else
+ {
+ point = GetIntersectionX(cloudCenterAbs, anchorPointAbs, rectanglePositionAbs.Right);
+ }
+ }
+
+ SizeF size = new SizeF(Math.Abs(cloudCenterAbs.X - point.X), Math.Abs(cloudCenterAbs.Y - point.Y));
+ if(dxAbs > 0)
+ dxAbs -= size.Width;
+ else
+ dxAbs += size.Width;
+
+ if(dyAbs > 0)
+ dyAbs -= size.Height;
+ else
+ dyAbs += size.Height;
+
+
+ // Draw 3 smaller ellipses from anchor point to the cloud
+ for(int index = 0; index < 3; index++)
+ {
+ using( GraphicsPath path = new GraphicsPath() )
+ {
+ // Create ellipse path
+ path.AddEllipse(
+ ellipseLocation.X - ellipseSize.Width / 2f,
+ ellipseLocation.Y - ellipseSize.Height / 2f,
+ ellipseSize.Width,
+ ellipseSize.Height);
+
+ // Draw ellipse
+ graphics.DrawPathAbs(
+ path,
+ this.BackColor,
+ this.BackHatchStyle,
+ String.Empty,
+ ChartImageWrapMode.Scaled,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ this.BackGradientStyle,
+ this.BackSecondaryColor,
+ this.LineColor,
+ 1, // this.LineWidth, NOTE: Cloud supports only 1 pixel border
+ this.LineDashStyle,
+ PenAlignment.Center,
+ this.ShadowOffset,
+ this.ShadowColor);
+
+ // Adjust ellipse size
+ ellipseSize.Width *= 1.5f;
+ ellipseSize.Height *= 1.5f;
+
+ // Adjust next ellipse position
+ ellipseLocation.X -= dxAbs / 3f + (index * (dxAbs / 10f) );
+ ellipseLocation.Y -= dyAbs / 3f + (index * (dyAbs / 10f) );
+ }
+ }
+ }
+ }
+
+ // Draw cloud
+ GraphicsPath pathCloud = GetCloudPath(rectanglePositionAbs);
+ graphics.DrawPathAbs(
+ pathCloud,
+ this.BackColor,
+ this.BackHatchStyle,
+ String.Empty,
+ ChartImageWrapMode.Scaled,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ this.BackGradientStyle,
+ this.BackSecondaryColor,
+ this.LineColor,
+ 1, // this.LineWidth, NOTE: Cloud supports only 1 pixel border
+ this.LineDashStyle,
+ PenAlignment.Center,
+ this.ShadowOffset,
+ this.ShadowColor);
+
+ // Draw cloud outline (Do not draw in SVG or Flash Animation)
+ {
+ using(GraphicsPath pathCloudOutline = GetCloudOutlinePath(rectanglePositionAbs))
+ {
+ graphics.DrawPathAbs(
+ pathCloudOutline,
+ this.BackColor,
+ this.BackHatchStyle,
+ String.Empty,
+ ChartImageWrapMode.Scaled,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ this.BackGradientStyle,
+ this.BackSecondaryColor,
+ this.LineColor,
+ 1, // this.LineWidth, NOTE: Cloud supports only 1 pixel border
+ this.LineDashStyle,
+ PenAlignment.Center);
+ }
+ }
+
+ // Draw text
+ DrawText(graphics, rectanglePosition, true, false);
+
+ return pathCloud;
+ }
+
+ /// <summary>
+ /// Draws Perspective style callout.
+ /// </summary>
+ /// <param name="graphics">Chart graphics.</param>
+ /// <param name="rectanglePosition">Position of annotation objet.</param>
+ /// <param name="anchorPoint">Anchor location.</param>
+ /// <returns>Hot region of the cloud.</returns>
+ private GraphicsPath DrawPerspectiveCallout(
+ ChartGraphics graphics,
+ RectangleF rectanglePosition,
+ PointF anchorPoint)
+ {
+ // Draw rectangle
+ graphics.FillRectangleRel(
+ rectanglePosition,
+ this.BackColor,
+ this.BackHatchStyle,
+ String.Empty,
+ ChartImageWrapMode.Scaled,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ this.BackGradientStyle,
+ this.BackSecondaryColor,
+ this.LineColor,
+ this.LineWidth,
+ this.LineDashStyle,
+ this.ShadowColor,
+ 0, // Shadow is never drawn
+ PenAlignment.Center);
+
+ // Create hot region path
+ GraphicsPath hotRegion = new GraphicsPath();
+ hotRegion.AddRectangle( graphics.GetAbsoluteRectangle(rectanglePosition) );
+
+ // Draw text
+ DrawText(graphics, rectanglePosition, false, false);
+
+ // Draw perspective polygons from anchoring point
+ if(!float.IsNaN(anchorPoint.X) && !float.IsNaN(anchorPoint.Y))
+ {
+ // Check if point is inside annotation position
+ if(!rectanglePosition.Contains(anchorPoint.X, anchorPoint.Y))
+ {
+ Color[] perspectivePathColors = new Color[2];
+ Color color = (this.BackColor.IsEmpty) ? Color.White : this.BackColor;
+ perspectivePathColors[0] = graphics.GetBrightGradientColor(color, 0.6);
+ perspectivePathColors[1] = graphics.GetBrightGradientColor(color, 0.8);
+ GraphicsPath[] perspectivePaths = new GraphicsPath[2];
+ using(perspectivePaths[0] = new GraphicsPath())
+ {
+ using(perspectivePaths[1] = new GraphicsPath())
+ {
+ // Convert coordinates to absolute
+ RectangleF rectanglePositionAbs = graphics.GetAbsoluteRectangle(rectanglePosition);
+ PointF anchorPointAbs = graphics.GetAbsolutePoint(anchorPoint);
+
+ // Create paths of perspective
+ if(anchorPoint.Y < rectanglePosition.Y)
+ {
+ PointF[] points1 = new PointF[3];
+ points1[0] = new PointF(rectanglePositionAbs.X, rectanglePositionAbs.Y);
+ points1[1] = new PointF(rectanglePositionAbs.Right, rectanglePositionAbs.Y);
+ points1[2] = new PointF(anchorPointAbs.X, anchorPointAbs.Y);
+ perspectivePaths[0].AddLines(points1);
+ if(anchorPoint.X < rectanglePosition.X)
+ {
+ PointF[] points2 = new PointF[3];
+ points2[0] = new PointF(rectanglePositionAbs.X, rectanglePositionAbs.Bottom);
+ points2[1] = new PointF(rectanglePositionAbs.X, rectanglePositionAbs.Y);
+ points2[2] = new PointF(anchorPointAbs.X, anchorPointAbs.Y);
+ perspectivePaths[1].AddLines(points2);
+ }
+ else if(anchorPoint.X > rectanglePosition.Right)
+ {
+ PointF[] points2 = new PointF[3];
+ points2[0] = new PointF(rectanglePositionAbs.Right, rectanglePositionAbs.Bottom);
+ points2[1] = new PointF(rectanglePositionAbs.Right, rectanglePositionAbs.Y);
+ points2[2] = new PointF(anchorPointAbs.X, anchorPointAbs.Y);
+ perspectivePaths[1].AddLines(points2);
+ }
+ }
+ else if(anchorPoint.Y > rectanglePosition.Bottom)
+ {
+ PointF[] points1 = new PointF[3];
+ points1[0] = new PointF(rectanglePositionAbs.X, rectanglePositionAbs.Bottom);
+ points1[1] = new PointF(rectanglePositionAbs.Right, rectanglePositionAbs.Bottom);
+ points1[2] = new PointF(anchorPointAbs.X, anchorPointAbs.Y);
+ perspectivePaths[0].AddLines(points1);
+ if(anchorPoint.X < rectanglePosition.X)
+ {
+ PointF[] points2 = new PointF[3];
+ points2[0] = new PointF(rectanglePositionAbs.X, rectanglePositionAbs.Bottom);
+ points2[1] = new PointF(rectanglePositionAbs.X, rectanglePositionAbs.Y);
+ points2[2] = new PointF(anchorPointAbs.X, anchorPointAbs.Y);
+ perspectivePaths[1].AddLines(points2);
+ }
+ else if(anchorPoint.X > rectanglePosition.Right)
+ {
+ PointF[] points2 = new PointF[3];
+ points2[0] = new PointF(rectanglePositionAbs.Right, rectanglePositionAbs.Bottom);
+ points2[1] = new PointF(rectanglePositionAbs.Right, rectanglePositionAbs.Y);
+ points2[2] = new PointF(anchorPointAbs.X, anchorPointAbs.Y);
+ perspectivePaths[1].AddLines(points2);
+ }
+ }
+ else
+ {
+ if(anchorPoint.X < rectanglePosition.X)
+ {
+ PointF[] points2 = new PointF[3];
+ points2[0] = new PointF(rectanglePositionAbs.X, rectanglePositionAbs.Bottom);
+ points2[1] = new PointF(rectanglePositionAbs.X, rectanglePositionAbs.Y);
+ points2[2] = new PointF(anchorPointAbs.X, anchorPointAbs.Y);
+ perspectivePaths[1].AddLines(points2);
+ }
+ else if(anchorPoint.X > rectanglePosition.Right)
+ {
+ PointF[] points2 = new PointF[3];
+ points2[0] = new PointF(rectanglePositionAbs.Right, rectanglePositionAbs.Bottom);
+ points2[1] = new PointF(rectanglePositionAbs.Right, rectanglePositionAbs.Y);
+ points2[2] = new PointF(anchorPointAbs.X, anchorPointAbs.Y);
+ perspectivePaths[1].AddLines(points2);
+ }
+ }
+
+ // Draw paths if non-empty
+ int index = 0;
+ foreach(GraphicsPath path in perspectivePaths)
+ {
+ if(path.PointCount > 0)
+ {
+ path.CloseAllFigures();
+ graphics.DrawPathAbs(
+ path,
+ perspectivePathColors[index],
+ this.BackHatchStyle,
+ String.Empty,
+ ChartImageWrapMode.Scaled,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ this.BackGradientStyle,
+ this.BackSecondaryColor,
+ this.LineColor,
+ this.LineWidth,
+ this.LineDashStyle,
+ PenAlignment.Center);
+
+ // Add area to hot region path
+ hotRegion.SetMarkers();
+ hotRegion.AddPath( path, false );
+ }
+ ++index;
+ }
+ }
+ }
+ }
+ }
+
+ return hotRegion;
+ }
+
+ /// <summary>
+ /// Draws SimpleLine or BorderLine style callout.
+ /// </summary>
+ /// <param name="graphics">Chart graphics.</param>
+ /// <param name="rectanglePosition">Position of annotation objet.</param>
+ /// <param name="anchorPoint">Anchor location.</param>
+ /// <param name="drawRectangle">If true draws BorderLine style, otherwise SimpleLine.</param>
+ /// <returns>Hot region of the cloud.</returns>
+ private GraphicsPath DrawRectangleLineCallout(
+ ChartGraphics graphics,
+ RectangleF rectanglePosition,
+ PointF anchorPoint,
+ bool drawRectangle)
+ {
+ // Rectangle mode
+ if(drawRectangle)
+ {
+ // Draw rectangle
+ graphics.FillRectangleRel(
+ rectanglePosition,
+ this.BackColor,
+ this.BackHatchStyle,
+ String.Empty,
+ ChartImageWrapMode.Scaled,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ this.BackGradientStyle,
+ this.BackSecondaryColor,
+ this.LineColor,
+ this.LineWidth,
+ this.LineDashStyle,
+ this.ShadowColor,
+ this.ShadowOffset,
+ PenAlignment.Center);
+
+ // Draw text
+ DrawText(graphics, rectanglePosition, false, false);
+ }
+ else
+ {
+ // Draw text
+ rectanglePosition = DrawText(graphics, rectanglePosition, false, true);
+ SizeF pixelSize = graphics.GetRelativeSize(new SizeF(2f, 2f));
+ rectanglePosition.Inflate(pixelSize);
+ }
+
+ // Create hot region path
+ GraphicsPath hotRegion = new GraphicsPath();
+ hotRegion.AddRectangle( graphics.GetAbsoluteRectangle(rectanglePosition) );
+
+ // Define position of text underlying line
+ PointF textLinePoint1 = new PointF(rectanglePosition.X, rectanglePosition.Bottom);
+ PointF textLinePoint2 = new PointF(rectanglePosition.Right, rectanglePosition.Bottom);
+
+ // Draw line to the anchor point
+ if(!float.IsNaN(anchorPoint.X) && !float.IsNaN(anchorPoint.Y))
+ {
+ // Check if point is inside annotation position
+ if(!rectanglePosition.Contains(anchorPoint.X, anchorPoint.Y))
+ {
+ PointF lineSecondPoint = PointF.Empty;
+ if(anchorPoint.X < rectanglePosition.X)
+ {
+ lineSecondPoint.X = rectanglePosition.X;
+ }
+ else if(anchorPoint.X > rectanglePosition.Right)
+ {
+ lineSecondPoint.X = rectanglePosition.Right;
+ }
+ else
+ {
+ lineSecondPoint.X = rectanglePosition.X + rectanglePosition.Width / 2f;
+ }
+
+ if(anchorPoint.Y < rectanglePosition.Y)
+ {
+ lineSecondPoint.Y = rectanglePosition.Y;
+ }
+ else if(anchorPoint.Y > rectanglePosition.Bottom)
+ {
+ lineSecondPoint.Y = rectanglePosition.Bottom;
+ }
+ else
+ {
+ lineSecondPoint.Y = rectanglePosition.Y + rectanglePosition.Height / 2f;
+ }
+
+ // Set line caps
+ bool capChanged = false;
+ LineCap oldStartCap = LineCap.Flat;
+ if(this.CalloutAnchorCap != LineAnchorCapStyle.None)
+ {
+ // Save old pen
+ capChanged = true;
+ oldStartCap = graphics.Pen.StartCap;
+
+ // Apply anchor cap settings
+ if(this.CalloutAnchorCap == LineAnchorCapStyle.Arrow)
+ {
+ // Adjust arrow size for small line width
+ if(this.LineWidth < 4)
+ {
+ int adjustment = 3 - this.LineWidth;
+ graphics.Pen.StartCap = LineCap.Custom;
+ graphics.Pen.CustomStartCap = new AdjustableArrowCap(
+ this.LineWidth + adjustment,
+ this.LineWidth + adjustment,
+ true);
+ }
+ else
+ {
+ graphics.Pen.StartCap = LineCap.ArrowAnchor;
+ }
+ }
+ else if(this.CalloutAnchorCap == LineAnchorCapStyle.Diamond)
+ {
+ graphics.Pen.StartCap = LineCap.DiamondAnchor;
+ }
+ else if(this.CalloutAnchorCap == LineAnchorCapStyle.Round)
+ {
+ graphics.Pen.StartCap = LineCap.RoundAnchor;
+ }
+ else if(this.CalloutAnchorCap == LineAnchorCapStyle.Square)
+ {
+ graphics.Pen.StartCap = LineCap.SquareAnchor;
+ }
+ }
+
+ // Draw callout line
+ graphics.DrawLineAbs(
+ this.LineColor,
+ this.LineWidth,
+ this.LineDashStyle,
+ graphics.GetAbsolutePoint(anchorPoint),
+ graphics.GetAbsolutePoint(lineSecondPoint),
+ this.ShadowColor,
+ this.ShadowOffset);
+
+ // Create hot region path
+ using( GraphicsPath linePath = new GraphicsPath() )
+ {
+ linePath.AddLine(
+ graphics.GetAbsolutePoint(anchorPoint),
+ graphics.GetAbsolutePoint(lineSecondPoint) );
+
+ linePath.Widen(new Pen(Color.Black, this.LineWidth + 2));
+ hotRegion.SetMarkers();
+ hotRegion.AddPath( linePath, false );
+ }
+
+ // Restore line caps
+ if(capChanged)
+ {
+ graphics.Pen.StartCap = oldStartCap;
+ }
+
+ // Adjust text underlying line position
+ if(anchorPoint.Y < rectanglePosition.Y)
+ {
+ textLinePoint1.Y = rectanglePosition.Y;
+ textLinePoint2.Y = rectanglePosition.Y;
+ }
+ else if(anchorPoint.Y > rectanglePosition.Y &&
+ anchorPoint.Y < rectanglePosition.Bottom)
+ {
+ textLinePoint1.Y = rectanglePosition.Y;
+ textLinePoint2.Y = rectanglePosition.Bottom;
+ if(anchorPoint.X < rectanglePosition.X)
+ {
+ textLinePoint1.X = rectanglePosition.X;
+ textLinePoint2.X = rectanglePosition.X;
+ }
+ else
+ {
+ textLinePoint1.X = rectanglePosition.Right;
+ textLinePoint2.X = rectanglePosition.Right;
+ }
+ }
+ }
+
+ // Draw text underlying line
+ if(!drawRectangle)
+ {
+ graphics.DrawLineAbs(
+ this.LineColor,
+ this.LineWidth,
+ this.LineDashStyle,
+ graphics.GetAbsolutePoint(textLinePoint1),
+ graphics.GetAbsolutePoint(textLinePoint2),
+ this.ShadowColor,
+ this.ShadowOffset);
+
+ // Create hot region path
+ using( GraphicsPath linePath = new GraphicsPath() )
+ {
+ linePath.AddLine(
+ graphics.GetAbsolutePoint(textLinePoint1),
+ graphics.GetAbsolutePoint(textLinePoint2) );
+
+ linePath.Widen(new Pen(Color.Black, this.LineWidth + 2));
+ hotRegion.SetMarkers();
+ hotRegion.AddPath( linePath, false );
+ }
+
+ }
+ }
+
+ return hotRegion;
+ }
+
+ #endregion // Painting
+
+ #region Anchor Methods
+
+ /// <summary>
+ /// Checks if annotation draw anything in the anchor position (except selection handle)
+ /// </summary>
+ /// <returns>True if annotation "connects" itself and anchor point visually.</returns>
+ override internal bool IsAnchorDrawn()
+ {
+ return true;
+ }
+
+ #endregion // Anchor Methods
+
+ #region Helper methods
+
+ /// <summary>
+ /// Gets cloud callout outline graphics path.
+ /// </summary>
+ /// <param name="position">Absolute position of the callout cloud.</param>
+ /// <returns>Cloud outline path.</returns>
+ private static GraphicsPath GetCloudOutlinePath(RectangleF position)
+ {
+ if(_cloudOutlinePath == null)
+ {
+ GetCloudPath(position);
+ }
+
+ // Translate and sacle original path to fit specified position
+ GraphicsPath resultPath = (GraphicsPath)_cloudOutlinePath.Clone();
+ Matrix matrix = new Matrix();
+ matrix.Translate(-_cloudBounds.X, -_cloudBounds.Y);
+ resultPath.Transform(matrix);
+ matrix = new Matrix();
+ matrix.Translate(position.X, position.Y);
+ matrix.Scale(position.Width / _cloudBounds.Width, position.Height / _cloudBounds.Height);
+ resultPath.Transform(matrix);
+
+ return resultPath;
+ }
+
+ /// <summary>
+ /// Gets cloud callout graphics path.
+ /// </summary>
+ /// <param name="position">Absolute position of the callout cloud.</param>
+ /// <returns>Cloud path.</returns>
+ private static GraphicsPath GetCloudPath(RectangleF position)
+ {
+ // Check if cloud path was already created
+ if(_cloudPath == null)
+ {
+ // Create cloud path
+ _cloudPath = new GraphicsPath();
+
+ _cloudPath.AddBezier(1689.5f, 1998.6f, 1581.8f, 2009.4f, 1500f, 2098.1f, 1500f, 2204f);
+
+ _cloudPath.AddBezier(1500f, 2204f, 1499.9f, 2277.2f, 1539.8f, 2345.1f, 1604.4f, 2382.1f);
+
+ _cloudPath.AddBezier(1603.3f, 2379.7f, 1566.6f, 2417.8f, 1546.2f, 2468.1f, 1546.2f, 2520.1f);
+ _cloudPath.AddBezier(1546.2f, 2520.1f, 1546.2f, 2633.7f, 1641.1f, 2725.7f, 1758.1f, 2725.7f);
+ _cloudPath.AddBezier(1758.1f, 2725.7f, 1766.3f, 2725.6f, 1774.6f, 2725.2f, 1782.8f, 2724.2f);
+
+ _cloudPath.AddBezier(1781.7f, 2725.6f, 1848.5f, 2839.4f, 1972.8f, 2909.7f, 2107.3f, 2909.7f);
+ _cloudPath.AddBezier(2107.3f, 2909.7f, 2175.4f, 2909.7f, 2242.3f, 2891.6f, 2300.6f, 2857.4f);
+
+ _cloudPath.AddBezier(2300f, 2857.6f, 2360.9f, 2946.5f, 2463.3f, 2999.7f, 2572.9f, 2999.7f);
+ _cloudPath.AddBezier(2572.9f, 2999.7f, 2717.5f, 2999.7f, 2845.2f, 2907.4f, 2887.1f, 2772.5f);
+
+ _cloudPath.AddBezier(2887.4f, 2774.3f, 2932.1f, 2801.4f, 2983.6f, 2815.7f, 3036.3f, 2815.7f);
+ _cloudPath.AddBezier(3036.3f, 2815.7f, 3190.7f, 2815.7f, 3316.3f, 2694.8f, 3317.5f, 2544.8f);
+
+ _cloudPath.AddBezier(3317f, 2544.1f, 3479.2f, 2521.5f, 3599.7f, 2386.5f, 3599.7f, 2227.2f);
+ _cloudPath.AddBezier(3599.7f, 2227.2f, 3599.7f, 2156.7f, 3575.7f, 2088.1f, 3531.6f, 2032.2f);
+
+ _cloudPath.AddBezier(3530.9f, 2032f, 3544.7f, 2000.6f, 3551.9f, 1966.7f, 3551.9f, 1932.5f);
+ _cloudPath.AddBezier(3551.9f, 1932.5f, 3551.9f, 1818.6f, 3473.5f, 1718.8f, 3360.7f, 1688.8f);
+
+ _cloudPath.AddBezier(3361.6f, 1688.3f, 3341.4f, 1579.3f, 3243.5f, 1500f, 3129.3f, 1500f);
+ _cloudPath.AddBezier(3129.3f, 1500f, 3059.8f, 1499.9f, 2994f, 1529.6f, 2949.1f, 1580.9f);
+
+ _cloudPath.AddBezier(2949.5f, 1581.3f, 2909.4f, 1530f, 2847f, 1500f, 2780.8f, 1500f);
+ _cloudPath.AddBezier(2780.8f, 1500f, 2700.4f, 1499.9f, 2626.8f, 1544.2f, 2590.9f, 1614.2f);
+
+ _cloudPath.AddBezier(2591.7f, 1617.6f, 2543.2f, 1571.1f, 2477.9f, 1545.1f, 2409.8f, 1545.1f);
+ _cloudPath.AddBezier(2409.8f, 1545.1f, 2313.9f, 1545.1f, 2225.9f, 1596.6f, 2180.8f, 1679f);
+
+ _cloudPath.AddBezier(2180.1f, 1680.7f, 2129.7f, 1652f, 2072.4f, 1636.9f, 2014.1f, 1636.9f);
+ _cloudPath.AddBezier(2014.1f, 1636.9f, 1832.8f, 1636.9f, 1685.9f, 1779.8f, 1685.9f, 1956f);
+ _cloudPath.AddBezier(1685.9f, 1956f, 1685.8f, 1970.4f, 1686.9f, 1984.8f, 1688.8f, 1999f);
+
+ _cloudPath.CloseAllFigures();
+
+
+ // Create cloud outline path
+ _cloudOutlinePath = new GraphicsPath();
+
+ _cloudOutlinePath.AddBezier(1604.4f, 2382.1f, 1636.8f, 2400.6f, 1673.6f, 2410.3f, 1711.2f, 2410.3f);
+ _cloudOutlinePath.AddBezier(1711.2f, 2410.3f, 1716.6f, 2410.3f, 1722.2f, 2410.2f, 1727.6f, 2409.8f);
+
+ _cloudOutlinePath.StartFigure();
+ _cloudOutlinePath.AddBezier(1782.8f, 2724.2f, 1801.3f, 2722.2f, 1819.4f, 2717.7f, 1836.7f, 2711f);
+
+ _cloudOutlinePath.StartFigure();
+ _cloudOutlinePath.AddBezier(2267.6f, 2797.2f, 2276.1f, 2818.4f, 2287f, 2838.7f, 2300f, 2857.6f);
+
+ _cloudOutlinePath.StartFigure();
+ _cloudOutlinePath.AddBezier(2887.1f, 2772.5f, 2893.8f, 2750.9f, 2898.1f, 2728.7f, 2900f, 2706.3f);
+
+ // NOTE: This cloud segment overlaps text too much. Removed for now!
+ //cloudOutlinePath.StartFigure();
+ //cloudOutlinePath.AddBezier(3317.5f, 2544.8f, 3317.5f, 2544f, 3317.6f, 2543.3f, 3317.6f, 2542.6f);
+ //cloudOutlinePath.AddBezier(3317.6f, 2542.6f, 3317.6f, 2438.1f, 3256.1f, 2342.8f, 3159.5f, 2297f);
+
+ _cloudOutlinePath.StartFigure();
+ _cloudOutlinePath.AddBezier(3460.5f, 2124.9f, 3491f, 2099.7f, 3515f, 2067.8f, 3530.9f, 2032f);
+
+ _cloudOutlinePath.StartFigure();
+ _cloudOutlinePath.AddBezier(3365.3f, 1732.2f, 3365.3f, 1731.1f, 3365.4f, 1730.1f, 3365.4f, 1729f);
+ _cloudOutlinePath.AddBezier(3365.4f, 1729f, 3365.4f, 1715.3f, 3364.1f, 1701.7f, 3361.6f, 1688.3f);
+
+ _cloudOutlinePath.StartFigure();
+ _cloudOutlinePath.AddBezier(2949.1f, 1580.9f, 2934.4f, 1597.8f, 2922.3f, 1616.6f, 2913.1f, 1636.9f);
+ _cloudOutlinePath.CloseFigure();
+
+ _cloudOutlinePath.StartFigure();
+ _cloudOutlinePath.AddBezier(2590.9f, 1614.2f, 2583.1f, 1629.6f, 2577.2f, 1645.8f, 2573.4f, 1662.5f);
+
+ _cloudOutlinePath.StartFigure();
+ _cloudOutlinePath.AddBezier(2243.3f, 1727.5f, 2224.2f, 1709.4f, 2203f, 1693.8f, 2180.1f, 1680.7f);
+
+ _cloudOutlinePath.StartFigure();
+ _cloudOutlinePath.AddBezier(1688.8f, 1999f, 1691.1f, 2015.7f, 1694.8f, 2032.2f, 1699.9f, 2048.3f);
+
+ _cloudOutlinePath.CloseAllFigures();
+
+ // Get cloud path bounds
+ _cloudBounds = _cloudPath.GetBounds();
+ }
+
+ // Translate and sacle original path to fit specified position
+ GraphicsPath resultPath = (GraphicsPath)_cloudPath.Clone();
+ Matrix matrix = new Matrix();
+ matrix.Translate(-_cloudBounds.X, -_cloudBounds.Y);
+ resultPath.Transform(matrix);
+ matrix = new Matrix();
+ matrix.Translate(position.X, position.Y);
+ matrix.Scale(position.Width / _cloudBounds.Width, position.Height / _cloudBounds.Height);
+ resultPath.Transform(matrix);
+
+ return resultPath;
+ }
+
+ /// <summary>
+ /// Gets intersection point coordinates between point line and and horizontal
+ /// line specified by Y coordinate.
+ /// </summary>
+ /// <param name="firstPoint">First data point.</param>
+ /// <param name="secondPoint">Second data point.</param>
+ /// <param name="pointY">Y coordinate.</param>
+ /// <returns>Intersection point coordinates.</returns>
+ internal static PointF GetIntersectionY(PointF firstPoint, PointF secondPoint, float pointY)
+ {
+ PointF intersectionPoint = new PointF();
+ intersectionPoint.Y = pointY;
+ intersectionPoint.X = (pointY - firstPoint.Y) *
+ (secondPoint.X - firstPoint.X) /
+ (secondPoint.Y - firstPoint.Y) +
+ firstPoint.X;
+ return intersectionPoint;
+ }
+
+ /// <summary>
+ /// Gets intersection point coordinates between point line and and vertical
+ /// line specified by X coordinate.
+ /// </summary>
+ /// <param name="firstPoint">First data point.</param>
+ /// <param name="secondPoint">Second data point.</param>
+ /// <param name="pointX">X coordinate.</param>
+ /// <returns>Intersection point coordinates.</returns>
+ internal static PointF GetIntersectionX(PointF firstPoint, PointF secondPoint, float pointX)
+ {
+ PointF intersectionPoint = new PointF();
+ intersectionPoint.X = pointX;
+ intersectionPoint.Y = (pointX - firstPoint.X) *
+ (secondPoint.Y - firstPoint.Y) /
+ (secondPoint.X - firstPoint.X) +
+ firstPoint.Y;
+ return intersectionPoint;
+ }
+
+ /// <summary>
+ /// Adds a horizontal or vertical line into the path as multiple segments.
+ /// </summary>
+ /// <param name="path">Graphics path.</param>
+ /// <param name="x1">First point X coordinate.</param>
+ /// <param name="y1">First point Y coordinate.</param>
+ /// <param name="x2">Second point X coordinate.</param>
+ /// <param name="y2">Second point Y coordinate.</param>
+ /// <param name="segments">Number of segments to add.</param>
+ private void PathAddLineAsSegments(GraphicsPath path, float x1, float y1, float x2, float y2, int segments)
+ {
+ if(x1 == x2)
+ {
+ float distance = (y2 - y1) / segments;
+ for(int index = 0; index < segments; index++)
+ {
+ path.AddLine(x1, y1, x1, y1 + distance);
+ y1 += distance;
+ }
+ }
+ else if(y1 == y2)
+ {
+ float distance = (x2 - x1) / segments;
+ for(int index = 0; index < segments; index++)
+ {
+ path.AddLine(x1, y1, x1 + distance, y1);
+ x1 += distance;
+ }
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionAnnotationPathAddLineAsSegmentsInvalid));
+ }
+ }
+ /// <summary>
+ /// Helper function which creates a rounded rectangle path.
+ /// Extra points are added on the sides to allow anchor connection.
+ /// </summary>
+ /// <param name="rect">Rectangle coordinates.</param>
+ /// <param name="cornerRadius">Corner radius.</param>
+ /// <returns>Graphics path object.</returns>
+ private GraphicsPath CreateRoundedRectPath(RectangleF rect, float cornerRadius)
+ {
+ // Create rounded rectangle path
+ GraphicsPath path = new GraphicsPath();
+ int segments = 10;
+ PathAddLineAsSegments(path, rect.X+cornerRadius, rect.Y, rect.Right-cornerRadius, rect.Y, segments);
+
+ path.AddArc(rect.Right-2f*cornerRadius, rect.Y, 2f*cornerRadius, 2f*cornerRadius, 270, 90);
+
+ PathAddLineAsSegments(path, rect.Right, rect.Y + cornerRadius, rect.Right, rect.Bottom - cornerRadius, segments);
+
+ path.AddArc(rect.Right-2f*cornerRadius, rect.Bottom-2f*cornerRadius, 2f*cornerRadius, 2f*cornerRadius, 0, 90);
+
+ PathAddLineAsSegments(path, rect.Right-cornerRadius, rect.Bottom, rect.X + cornerRadius, rect.Bottom, segments);
+
+ path.AddArc(rect.X, rect.Bottom-2f*cornerRadius, 2f*cornerRadius, 2f*cornerRadius, 90, 90);
+
+ PathAddLineAsSegments(path, rect.X, rect.Bottom-cornerRadius, rect.X, rect.Y+cornerRadius, segments);
+
+ path.AddArc(rect.X, rect.Y, 2f*cornerRadius, 2f*cornerRadius, 180, 90);
+
+ return path;
+ }
+
+ #endregion // Helper methods
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/GroupAnnotation.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/GroupAnnotation.cs
new file mode 100644
index 00000000000..cf4965e154a
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/GroupAnnotation.cs
@@ -0,0 +1,995 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: GroupAnnotation.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: AnnotationGroup
+//
+// Purpose: Annotation group class.
+//
+// Reviewed:
+//
+//===================================================================
+
+#region Used namespace
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Text;
+using System.Drawing.Drawing2D;
+#if Microsoft_CONTROL
+using System.Windows.Forms;
+using System.Windows.Forms.DataVisualization.Charting;
+using System.Windows.Forms.DataVisualization.Charting.Data;
+using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+using System.Windows.Forms.DataVisualization.Charting.Utilities;
+using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+
+#else
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.DataVisualization.Charting;
+using System.Web.UI.DataVisualization.Charting.Data;
+using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+
+#endregion
+
+#if Microsoft_CONTROL
+namespace System.Windows.Forms.DataVisualization.Charting
+
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ /// <summary>
+ /// <b>AnnotationGroup</b> is a class that represents an annotation group.
+ /// </summary>
+ /// <remarks>
+ /// This class is a collection of annotations, and can be used
+ /// to manipulate annotations relative to each other.
+ /// </remarks>
+ [
+ SRDescription("DescriptionAttributeAnnotationGroup_AnnotationGroup"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class AnnotationGroup : Annotation
+ {
+ #region Fields
+
+ // Collection of annotations in the group
+ internal AnnotationCollection annotations = null;
+
+ #endregion
+
+ #region Construction and Initialization
+
+ /// <summary>
+ /// Default public constructor.
+ /// </summary>
+ public AnnotationGroup()
+ : base()
+ {
+ annotations = new AnnotationCollection(this);
+ annotations.AnnotationGroup = this;
+ }
+
+ #endregion
+
+ #region Miscellaneous Properties
+
+ /// <summary>
+ /// Gets or sets the name of the chart area which an annotation is clipped to.
+ /// </summary>
+ /// <value>
+ /// A string which represents the name of an existing chart area.
+ /// </value>
+ /// <remarks>
+ /// If the chart area name is specified, an annotation will only be drawn inside the
+ /// plotting area of the chart area specified. All parts of the annotation
+ /// outside of the plotting area will be clipped.
+ /// <para>
+ /// To disable chart area clipping, set the property to "NotSet" or an empty string.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(Constants.NotSetValue),
+ SRDescription("DescriptionAttributeAnnotationGroup_ClipToChartArea"),
+ TypeConverter(typeof(LegendAreaNameConverter)),
+ Browsable(false),
+ ]
+ override public string ClipToChartArea
+ {
+ get
+ {
+ return base.ClipToChartArea;
+ }
+ set
+ {
+ base.ClipToChartArea = value;
+ foreach(Annotation annotation in this.annotations)
+ {
+ annotation.ClipToChartArea = value;
+ }
+ }
+ }
+
+ #endregion
+
+ #region Position Properties
+
+ /// <summary>
+ /// Gets or sets a flag that specifies whether the size of an annotation is always
+ /// defined in relative chart coordinates.
+ /// <seealso cref="Annotation.Width"/>
+ /// <seealso cref="Annotation.Height"/>
+ /// </summary>
+ /// <value>
+ /// <b>True</b> if an annotation's <see cref="Annotation.Width"/> and <see cref="Annotation.Height"/> are always
+ /// in chart relative coordinates, <b>false</b> otherwise.
+ /// </value>
+ /// <remarks>
+ /// An annotation's width and height may be set in relative chart or axes coordinates.
+ /// By default, relative chart coordinates are used.
+ /// <para>
+ /// To use axes coordinates for size set the <b>IsSizeAlwaysRelative</b> property to
+ /// <b>false</b> and either anchor the annotation to a data point or set the
+ /// <see cref="Annotation.AxisX"/> or <see cref="Annotation.AxisY"/> properties.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributePosition"),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeAnnotationGroup_SizeAlwaysRelative"),
+ ]
+ override public bool IsSizeAlwaysRelative
+ {
+ get
+ {
+ return base.IsSizeAlwaysRelative;
+ }
+ set
+ {
+ base.IsSizeAlwaysRelative = value;
+ }
+ }
+
+ #endregion
+
+ #region Visual Properties
+
+#if Microsoft_CONTROL
+ /// <summary>
+ /// Gets or sets a flag that determines if an annotation is selected.
+ /// <seealso cref="Annotation.AllowSelecting"/>
+ /// </summary>
+ /// <value>
+ /// <b>True</b> if the annotation is selected, <b>false</b> otherwise.
+ /// </value>
+#else
+ /// <summary>
+ /// Gets or sets a flag that determines if an annotation is selected.
+ /// </summary>
+ /// <value>
+ /// <b>True</b> if the annotation is selected, <b>false</b> otherwise.
+ /// </value>
+#endif // Microsoft_CONTROL
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(false),
+ Browsable(false),
+ SRDescription("DescriptionAttributeAnnotationGroup_Selected"),
+ ]
+ override public bool IsSelected
+ {
+ get
+ {
+ return base.IsSelected;
+ }
+ set
+ {
+ base.IsSelected = value;
+
+ // Clear selection for all annotations in the group
+ foreach(Annotation annotation in this.annotations)
+ {
+ annotation.IsSelected = false;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag that specifies whether an annotation is visible.
+ /// </summary>
+ /// <value>
+ /// <b>True</b> if the annotation is visible, <b>false</b> otherwise.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeAnnotationGroup_Visible"),
+ ParenthesizePropertyNameAttribute(true),
+ ]
+ override public bool Visible
+ {
+ get
+ {
+ return base.Visible;
+ }
+ set
+ {
+ base.Visible = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an annotation's content alignment.
+ /// </summary>
+ /// <value>
+ /// A <see cref="ContentAlignment"/> value that represents the content alignment.
+ /// </value>
+ /// <remarks>
+ /// This property is used to align text for <see cref="TextAnnotation"/>, <see cref="RectangleAnnotation"/>,
+ /// <see cref="EllipseAnnotation"/> and <see cref="CalloutAnnotation"/> objects, and to align
+ /// a non-scaled image inside an <see cref="ImageAnnotation"/> object.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(typeof(ContentAlignment), "MiddleCenter"),
+ SRDescription("DescriptionAttributeAlignment"),
+ Browsable(false),
+ ]
+ override public ContentAlignment Alignment
+ {
+ get
+ {
+ return base.Alignment;
+ }
+ set
+ {
+ base.Alignment = value;
+ foreach(Annotation annotation in this.annotations)
+ {
+ annotation.Alignment = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an annotation's text style.
+ /// <seealso cref="Font"/>
+ /// <seealso cref="ForeColor"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="TextStyle"/> value used to draw an annotation's text.
+ /// </value>
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override TextStyle TextStyle
+ {
+ get
+ {
+ return base.TextStyle;
+ }
+ set
+ {
+ base.TextStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the text color of an annotation.
+ /// <seealso cref="Font"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value used for the text color of an annotation.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeForeColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ Browsable(false),
+ ]
+ override public Color ForeColor
+ {
+ get
+ {
+ return base.ForeColor;
+ }
+ set
+ {
+ base.ForeColor = value;
+ foreach(Annotation annotation in this.annotations)
+ {
+ annotation.ForeColor = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the font of an annotation's text.
+ /// <seealso cref="ForeColor"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Font"/> object used for an annotation's text.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(typeof(Font), "Microsoft Sans Serif, 8pt"),
+ SRDescription("DescriptionAttributeTextFont"),
+ Browsable(false),
+ ]
+ override public Font Font
+ {
+ get
+ {
+ return base.Font;
+ }
+ set
+ {
+ base.Font = value;
+ foreach(Annotation annotation in this.annotations)
+ {
+ annotation.Font = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the color of an annotation line.
+ /// <seealso cref="LineWidth"/>
+ /// <seealso cref="LineDashStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value used to draw an annotation line.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeLineColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ Browsable(false),
+ ]
+ override public Color LineColor
+ {
+ get
+ {
+ return base.LineColor;
+ }
+ set
+ {
+ base.LineColor = value;
+ foreach(Annotation annotation in this.annotations)
+ {
+ annotation.LineColor = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the width of an annotation line.
+ /// <seealso cref="LineColor"/>
+ /// <seealso cref="LineDashStyle"/>
+ /// </summary>
+ /// <value>
+ /// An integer value defining the width of an annotation line in pixels.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(1),
+ SRDescription("DescriptionAttributeLineWidth"),
+ Browsable(false),
+ ]
+ override public int LineWidth
+ {
+ get
+ {
+ return base.LineWidth;
+ }
+ set
+ {
+ base.LineWidth = value;
+ foreach(Annotation annotation in this.annotations)
+ {
+ annotation.LineWidth = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the style of an annotation line.
+ /// <seealso cref="LineWidth"/>
+ /// <seealso cref="LineColor"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="ChartDashStyle"/> value used to draw an annotation line.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(ChartDashStyle.Solid),
+ SRDescription("DescriptionAttributeLineDashStyle"),
+ Browsable(false),
+ ]
+ override public ChartDashStyle LineDashStyle
+ {
+ get
+ {
+ return base.LineDashStyle;
+ }
+ set
+ {
+ base.LineDashStyle = value;
+ foreach(Annotation annotation in this.annotations)
+ {
+ annotation.LineDashStyle = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background color of an annotation.
+ /// <seealso cref="BackSecondaryColor"/>
+ /// <seealso cref="BackHatchStyle"/>
+ /// <seealso cref="BackGradientStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value used for the background of an annotation.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeBackColor"),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ Browsable(false),
+ ]
+ override public Color BackColor
+ {
+ get
+ {
+ return base.BackColor;
+ }
+ set
+ {
+ base.BackColor = value;
+ foreach(Annotation annotation in this.annotations)
+ {
+ annotation.BackColor = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background hatch style of an annotation.
+ /// <seealso cref="BackSecondaryColor"/>
+ /// <seealso cref="BackColor"/>
+ /// <seealso cref="BackGradientStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="ChartHatchStyle"/> value used for the background of an annotation.
+ /// </value>
+ /// <remarks>
+ /// Two colors are used to draw the hatching, <see cref="BackColor"/> and <see cref="BackSecondaryColor"/>.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(ChartHatchStyle.None),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackHatchStyle"),
+ Editor(Editors.HatchStyleEditor.Editor, Editors.HatchStyleEditor.Base),
+ Browsable(false),
+ ]
+ override public ChartHatchStyle BackHatchStyle
+ {
+ get
+ {
+ return base.BackHatchStyle;
+ }
+ set
+ {
+ base.BackHatchStyle = value;
+ foreach(Annotation annotation in this.annotations)
+ {
+ annotation.BackHatchStyle = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background gradient style of an annotation.
+ /// <seealso cref="BackSecondaryColor"/>
+ /// <seealso cref="BackColor"/>
+ /// <seealso cref="BackHatchStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="GradientStyle"/> value used for the background of an annotation.
+ /// </value>
+ /// <remarks>
+ /// Two colors are used to draw the gradient, <see cref="BackColor"/> and <see cref="BackSecondaryColor"/>.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(GradientStyle.None),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackGradientStyle"),
+ Editor(Editors.GradientEditor.Editor, Editors.GradientEditor.Base),
+ Browsable(false),
+ ]
+ override public GradientStyle BackGradientStyle
+ {
+ get
+ {
+ return base.BackGradientStyle;
+ }
+ set
+ {
+ base.BackGradientStyle = value;
+ foreach(Annotation annotation in this.annotations)
+ {
+ annotation.BackGradientStyle = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the secondary background color of an annotation.
+ /// <seealso cref="BackColor"/>
+ /// <seealso cref="BackHatchStyle"/>
+ /// <seealso cref="BackGradientStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value used for the secondary color of an annotation background with
+ /// hatching or gradient fill.
+ /// </value>
+ /// <remarks>
+ /// This color is used with <see cref="BackColor"/> when <see cref="BackHatchStyle"/> or
+ /// <see cref="BackGradientStyle"/> are used.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(typeof(Color), ""),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackSecondaryColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ Browsable(false),
+ ]
+ override public Color BackSecondaryColor
+ {
+ get
+ {
+ return base.BackSecondaryColor;
+ }
+ set
+ {
+ base.BackSecondaryColor = value;
+ foreach(Annotation annotation in this.annotations)
+ {
+ annotation.BackSecondaryColor = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the color of an annotation's shadow.
+ /// <seealso cref="ShadowOffset"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value used to draw an annotation's shadow.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(typeof(Color), "128,0,0,0"),
+ SRDescription("DescriptionAttributeShadowColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ Browsable(false),
+ ]
+ override public Color ShadowColor
+ {
+ get
+ {
+ return base.ShadowColor;
+ }
+ set
+ {
+ base.ShadowColor = value;
+ foreach(Annotation annotation in this.annotations)
+ {
+ annotation.ShadowColor = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the offset between an annotation and its shadow.
+ /// <seealso cref="ShadowColor"/>
+ /// </summary>
+ /// <value>
+ /// An integer value that represents the offset between an annotation and its shadow.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(0),
+ SRDescription("DescriptionAttributeShadowOffset"),
+ Browsable(false),
+ ]
+ override public int ShadowOffset
+ {
+ get
+ {
+ return base.ShadowOffset;
+ }
+ set
+ {
+ base.ShadowOffset = value;
+ foreach(Annotation annotation in this.annotations)
+ {
+ annotation.ShadowOffset = value;
+ }
+ }
+ }
+
+ #endregion
+
+ #region Editing Permissions Properties
+
+#if Microsoft_CONTROL
+
+ /// <summary>
+ /// Gets or sets a flag that specifies whether an annotation may be selected
+ /// with a mouse by the end user.
+ /// </summary>
+ /// <value>
+ /// <b>True</b> if the annotation may be selected, <b>false</b> otherwise.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeEditing"),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeAllowSelecting"),
+ ]
+ override public bool AllowSelecting
+ {
+ get
+ {
+ return base.AllowSelecting;
+ }
+ set
+ {
+ base.AllowSelecting = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag that specifies whether an annotation may be moved
+ /// with a mouse by the end user.
+ /// </summary>
+ /// <value>
+ /// <b>True</b> if the annotation may be moved, <b>false</b> otherwise.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeEditing"),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeAllowMoving"),
+ ]
+ override public bool AllowMoving
+ {
+ get
+ {
+ return base.AllowMoving;
+ }
+ set
+ {
+ base.AllowMoving = value;
+ }
+ }
+ /// <summary>
+ /// Gets or sets a flag that specifies whether an annotation anchor may be moved
+ /// with a mouse by the end user.
+ /// </summary>
+ /// <value>
+ /// <b>True</b> if the annotation anchor may be moved, <b>false</b> otherwise.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeEditing"),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeAnnotationGroup_AllowAnchorMoving"),
+ ]
+ override public bool AllowAnchorMoving
+ {
+ get
+ {
+ return base.AllowAnchorMoving;
+ }
+ set
+ {
+ base.AllowAnchorMoving = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag that specifies whether an annotation may be resized
+ /// with a mouse by the end user.
+ /// </summary>
+ /// <value>
+ /// <b>True</b> if the annotation may be resized, <b>false</b> otherwise.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeEditing"),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeAllowResizing"),
+ ]
+ override public bool AllowResizing
+ {
+ get
+ {
+ return base.AllowResizing;
+ }
+ set
+ {
+ base.AllowResizing = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag that specifies whether an annotation's text may be edited
+ /// when the end user double clicks on the text.
+ /// </summary>
+ /// <value>
+ /// <b>True</b> if the annotation text may be edited, <b>false</b> otherwise.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeEditing"),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeAllowTextEditing"),
+ ]
+ override public bool AllowTextEditing
+ {
+ get
+ {
+ return base.AllowTextEditing;
+ }
+ set
+ {
+ base.AllowTextEditing = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag that specifies whether a polygon annotation's points
+ /// may be moved with a mouse by the end user.
+ /// </summary>
+ /// <value>
+ /// <b>True</b> if the polygon annotation's points may be moved, <b>false</b> otherwise.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeEditing"),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeAnnotationGroup_AllowPathEditing"),
+ ]
+ override public bool AllowPathEditing
+ {
+ get
+ {
+ return base.AllowPathEditing;
+ }
+ set
+ {
+ base.AllowPathEditing = value;
+ }
+ }
+
+#endif // Microsoft_CONTROL
+
+ #endregion
+
+ #region Other Properties
+
+ /// <summary>
+ /// Gets the collection of annotations in the group.
+ /// </summary>
+ /// <value>
+ /// An <see cref="AnnotationCollection"/> object.
+ /// </value>
+ /// <remarks>
+ /// Note that the coordinates of all annotations in the group are relative to the
+ /// group annotation.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAnnotations"),
+ SRDescription("DescriptionAttributeAnnotationGroup_Annotations"),
+ Editor(Editors.AnnotationCollectionEditor.Editor, Editors.AnnotationCollectionEditor.Base),
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else // Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif // Microsoft_CONTROL
+ ]
+ public AnnotationCollection Annotations
+ {
+ get
+ {
+ return annotations;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an annotation's type name.
+ /// </summary>
+ /// <remarks>
+ /// This property is used to get the name of each annotation type
+ /// (e.g. Line, Rectangle, Ellipse).
+ /// <para>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeAnnotationType"),
+ ]
+ public override string AnnotationType
+ {
+ get
+ {
+ return "Group";
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets annotation selection points style.
+ /// </summary>
+ /// <value>
+ /// A <see cref="SelectionPointsStyle"/> value that represents annotation
+ /// selection style.
+ /// </value>
+ /// <remarks>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(SelectionPointsStyle.Rectangle),
+ ParenthesizePropertyNameAttribute(true),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeSelectionPointsStyle"),
+ ]
+ override internal SelectionPointsStyle SelectionPointsStyle
+ {
+ get
+ {
+ return SelectionPointsStyle.Rectangle;
+ }
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Paints an annotation object using the specified graphics.
+ /// </summary>
+ /// <param name="graphics">
+ /// A <see cref="ChartGraphics"/> object, used to paint the annotation object.
+ /// </param>
+ /// <param name="chart">
+ /// Reference to the <see cref="Chart"/> control.
+ /// </param>
+ override internal void Paint(Chart chart, ChartGraphics graphics)
+ {
+ // Paint all annotations in the group
+ foreach(Annotation annotation in this.annotations)
+ {
+ annotation.Paint(chart, graphics);
+ }
+
+ if( (this.Common.ProcessModePaint && this.IsSelected) ||
+ this.Common.ProcessModeRegions )
+ {
+ // Get annotation position in relative coordinates
+ PointF firstPoint = PointF.Empty;
+ PointF anchorPoint = PointF.Empty;
+ SizeF size = SizeF.Empty;
+ GetRelativePosition(out firstPoint, out size, out anchorPoint);
+ PointF secondPoint = new PointF(firstPoint.X + size.Width, firstPoint.Y + size.Height);
+
+ // Create selection rectangle
+ RectangleF selectionRect = new RectangleF(firstPoint, new SizeF(secondPoint.X - firstPoint.X, secondPoint.Y - firstPoint.Y));
+
+ // Check rectangle orientation
+ if(selectionRect.Width < 0)
+ {
+ selectionRect.X = selectionRect.Right;
+ selectionRect.Width = -selectionRect.Width;
+ }
+ if(selectionRect.Height < 0)
+ {
+ selectionRect.Y = selectionRect.Bottom;
+ selectionRect.Height = -selectionRect.Height;
+ }
+
+ // Check if text position is valid
+ if( selectionRect.IsEmpty ||
+ float.IsNaN(selectionRect.X) ||
+ float.IsNaN(selectionRect.Y) ||
+ float.IsNaN(selectionRect.Right) ||
+ float.IsNaN(selectionRect.Bottom) )
+ {
+ return;
+ }
+
+ if(this.Common.ProcessModeRegions)
+ {
+ // Add hot region
+ this.Common.HotRegionsList.AddHotRegion(
+ selectionRect,
+ ReplaceKeywords(this.ToolTip),
+#if Microsoft_CONTROL
+ String.Empty,
+ String.Empty,
+ String.Empty,
+#else // Microsoft_CONTROL
+ ReplaceKeywords(this.Url),
+ ReplaceKeywords(this.MapAreaAttributes),
+ ReplaceKeywords(this.PostBackValue),
+#endif // Microsoft_CONTROL
+ this,
+ ChartElementType.Annotation,
+ String.Empty);
+ }
+
+ // Paint selection handles
+ PaintSelectionHandles(graphics, selectionRect, null);
+ }
+ }
+
+ #endregion // Methods
+
+ #region IDisposable override
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ //Clean up managed resources
+ if (this.annotations != null)
+ {
+ this.annotations.Dispose();
+ this.annotations = null;
+ }
+ }
+ base.Dispose(disposing);
+ }
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/ImageAnnotation.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/ImageAnnotation.cs
new file mode 100644
index 00000000000..b19820f90b1
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/ImageAnnotation.cs
@@ -0,0 +1,730 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: ImageAnnotation.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: ImageAnnotation
+//
+// Purpose: Image annotation classes.
+//
+// Reviewed:
+//
+//===================================================================
+
+#region Used namespace
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Text;
+using System.Drawing.Drawing2D;
+#if Microsoft_CONTROL
+using System.Windows.Forms.DataVisualization.Charting;
+using System.Windows.Forms.DataVisualization.Charting.Data;
+using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+using System.Windows.Forms.DataVisualization.Charting.Utilities;
+using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+
+#else
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.DataVisualization.Charting;
+using System.Web.UI.DataVisualization.Charting.Data;
+using System.Web.UI.DataVisualization.Charting.Utilities;
+using System.Web.UI.DataVisualization.Charting.Borders3D;
+#endif
+
+
+#endregion
+
+#if Microsoft_CONTROL
+namespace System.Windows.Forms.DataVisualization.Charting
+
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ /// <summary>
+ /// <b>ImageAnnotation</b> is a class that represents an image annotation.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeImageAnnotation_ImageAnnotation"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class ImageAnnotation : Annotation
+ {
+ #region Fields
+
+ // Annotation image name
+ private string _imageName = String.Empty;
+
+ // Image wrapping mode
+ private ChartImageWrapMode _imageWrapMode = ChartImageWrapMode.Scaled;
+
+ // Image transparent color
+ private Color _imageTransparentColor = Color.Empty;
+
+ #endregion
+
+ #region Construction and Initialization
+
+ /// <summary>
+ /// Default public constructor.
+ /// </summary>
+ public ImageAnnotation()
+ : base()
+ {
+ }
+
+ #endregion
+
+ #region Properties
+
+ #region Image properties
+
+ /// <summary>
+ /// Gets or sets the name of an annotation's image.
+ /// <seealso cref="ImageTransparentColor"/>
+ /// </summary>
+ /// <value>
+ /// A string value representing the name of an annotation's image.
+ /// </value>
+ /// <remarks>
+ /// The name can be a file name, URL for the web control or a name from
+ /// the <see cref="NamedImagesCollection"/> class.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeImage"),
+ Bindable(true),
+ DefaultValue(""),
+ Editor(Editors.ImageValueEditor.Editor, Editors.ImageValueEditor.Base),
+ SRDescription("DescriptionAttributeImageAnnotation_Image"),
+ ]
+ public virtual string Image
+ {
+ get
+ {
+ return _imageName;
+ }
+ set
+ {
+ _imageName = value;
+ this.Invalidate();
+ }
+ }
+
+
+ /// <summary>
+ /// Gets or sets the drawing mode of the image.
+ /// </summary>
+ /// <value>
+ /// A <see cref="ChartImageWrapMode"/> value that defines the drawing mode of the image.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeImage"),
+ Bindable(true),
+ DefaultValue(ChartImageWrapMode.Scaled),
+ SRDescription("DescriptionAttributeImageWrapMode"),
+ ]
+ public ChartImageWrapMode ImageWrapMode
+ {
+ get
+ {
+ return _imageWrapMode;
+ }
+ set
+ {
+ _imageWrapMode = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a color which will be replaced with a transparent color while drawing the image.
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value which will be replaced with a transparent color while drawing the image.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeImage"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeImageTransparentColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ public Color ImageTransparentColor
+ {
+ get
+ {
+ return _imageTransparentColor;
+ }
+ set
+ {
+ _imageTransparentColor = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an annotation's content alignment.
+ /// </summary>
+ /// <value>
+ /// A <see cref="ContentAlignment"/> value that represents the content alignment.
+ /// </value>
+ /// <remarks>
+ /// This property is used to align text for <see cref="TextAnnotation"/>, <see cref="RectangleAnnotation"/>,
+ /// <see cref="EllipseAnnotation"/> and <see cref="CalloutAnnotation"/> objects, and to align
+ /// a non-scaled image inside an <see cref="ImageAnnotation"/> object.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeImage"),
+ DefaultValue(typeof(ContentAlignment), "MiddleCenter"),
+ SRDescription("DescriptionAttributeImageAnnotation_Alignment"),
+ ]
+ override public ContentAlignment Alignment
+ {
+ get
+ {
+ return base.Alignment;
+ }
+ set
+ {
+ base.Alignment = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an annotation's text style.
+ /// <seealso cref="Font"/>
+ /// <seealso cref="ForeColor"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="TextStyle"/> value used to draw an annotation's text.
+ /// </value>
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override TextStyle TextStyle
+ {
+ get
+ {
+ return base.TextStyle;
+ }
+ set
+ {
+ base.TextStyle = value;
+ }
+ }
+
+ #endregion // Image properties
+
+ #region Other
+
+ /// <summary>
+ /// Gets or sets an annotation's type name.
+ /// </summary>
+ /// <remarks>
+ /// This property is used to get the name of each annotation type
+ /// (e.g. Line, Rectangle, Ellipse).
+ /// <para>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeAnnotationType"),
+ ]
+ public override string AnnotationType
+ {
+ get
+ {
+ return "Image";
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets annotation selection points style.
+ /// </summary>
+ /// <value>
+ /// A <see cref="SelectionPointsStyle"/> value that represents annotation
+ /// selection style.
+ /// </value>
+ /// <remarks>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(SelectionPointsStyle.Rectangle),
+ ParenthesizePropertyNameAttribute(true),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeSelectionPointsStyle"),
+ ]
+ override internal SelectionPointsStyle SelectionPointsStyle
+ {
+ get
+ {
+ return SelectionPointsStyle.Rectangle;
+ }
+ }
+
+ #endregion
+
+ #region Non Applicable Annotation Appearance Attributes (set as Non-Browsable)
+
+ /// <summary>
+ /// Not applicable to this type of annotation.
+ /// <seealso cref="Font"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(typeof(Color), "Black"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ override public Color ForeColor
+ {
+ get
+ {
+ return base.ForeColor;
+ }
+ set
+ {
+ base.ForeColor = value;
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this type of annotation.
+ /// </summary>
+ /// <value>
+ /// A <see cref="Font"/> object.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(typeof(Font), "Microsoft Sans Serif, 8pt"),
+ ]
+ override public Font Font
+ {
+ get
+ {
+ return base.Font;
+ }
+ set
+ {
+ base.Font = value;
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(typeof(Color), ""),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ override public Color BackColor
+ {
+ get
+ {
+ return base.BackColor;
+ }
+ set
+ {
+ base.BackColor = value;
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(ChartHatchStyle.None),
+ NotifyParentPropertyAttribute(true),
+ Editor(Editors.HatchStyleEditor.Editor, Editors.HatchStyleEditor.Base)
+ ]
+ override public ChartHatchStyle BackHatchStyle
+ {
+ get
+ {
+ return base.BackHatchStyle;
+ }
+ set
+ {
+ base.BackHatchStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(GradientStyle.None),
+ NotifyParentPropertyAttribute(true),
+ Editor(Editors.GradientEditor.Editor, Editors.GradientEditor.Base)
+ ]
+ override public GradientStyle BackGradientStyle
+ {
+ get
+ {
+ return base.BackGradientStyle;
+ }
+ set
+ {
+ base.BackGradientStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(typeof(Color), ""),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ override public Color BackSecondaryColor
+ {
+ get
+ {
+ return base.BackSecondaryColor;
+ }
+ set
+ {
+ base.BackSecondaryColor = value;
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(typeof(Color), "Black"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ override public Color LineColor
+ {
+ get
+ {
+ return base.LineColor;
+ }
+ set
+ {
+ base.LineColor = value;
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(1),
+ Browsable(false),
+ SRDescription("DescriptionAttributeLineWidth"),
+ ]
+ override public int LineWidth
+ {
+ get
+ {
+ return base.LineWidth;
+ }
+ set
+ {
+ base.LineWidth = value;
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(ChartDashStyle.Solid),
+ SRDescription("DescriptionAttributeLineDashStyle"),
+ ]
+ override public ChartDashStyle LineDashStyle
+ {
+ get
+ {
+ return base.LineDashStyle;
+ }
+ set
+ {
+ base.LineDashStyle = value;
+ }
+ }
+
+
+ #endregion
+
+ #endregion
+
+ #region Methods
+
+ #region Painting
+
+ /// <summary>
+ /// Paints the annotation object on the specified graphics.
+ /// </summary>
+ /// <param name="graphics">
+ /// A <see cref="ChartGraphics"/> object, used to paint the annotation object.
+ /// </param>
+ /// <param name="chart">
+ /// Reference to the <see cref="Chart"/> owner control.
+ /// </param>
+ override internal void Paint(Chart chart, ChartGraphics graphics)
+ {
+ // Get annotation position in relative coordinates
+ PointF firstPoint = PointF.Empty;
+ PointF anchorPoint = PointF.Empty;
+ SizeF size = SizeF.Empty;
+ GetRelativePosition(out firstPoint, out size, out anchorPoint);
+ PointF secondPoint = new PointF(firstPoint.X + size.Width, firstPoint.Y + size.Height);
+
+ // Create selection rectangle
+ RectangleF selectionRect = new RectangleF(firstPoint, new SizeF(secondPoint.X - firstPoint.X, secondPoint.Y - firstPoint.Y));
+
+ // Get position
+ RectangleF rectanglePosition = new RectangleF(selectionRect.Location, selectionRect.Size);
+ if(rectanglePosition.Width < 0)
+ {
+ rectanglePosition.X = rectanglePosition.Right;
+ rectanglePosition.Width = -rectanglePosition.Width;
+ }
+ if(rectanglePosition.Height < 0)
+ {
+ rectanglePosition.Y = rectanglePosition.Bottom;
+ rectanglePosition.Height = -rectanglePosition.Height;
+ }
+
+ // Check if position is valid
+ if( float.IsNaN(rectanglePosition.X) ||
+ float.IsNaN(rectanglePosition.Y) ||
+ float.IsNaN(rectanglePosition.Right) ||
+ float.IsNaN(rectanglePosition.Bottom) )
+ {
+ return;
+ }
+
+ if(this.Common.ProcessModePaint)
+ {
+ // Draw "empty" image at design time
+ if(this._imageName.Length == 0 && this.Chart.IsDesignMode() )
+ {
+ graphics.FillRectangleRel(
+ rectanglePosition,
+ this.BackColor,
+ this.BackHatchStyle,
+ this._imageName,
+ this._imageWrapMode,
+ this._imageTransparentColor,
+ GetImageAlignment(this.Alignment),
+ this.BackGradientStyle,
+ this.BackSecondaryColor,
+ this.LineColor,
+ this.LineWidth,
+ this.LineDashStyle,
+ this.ShadowColor,
+ this.ShadowOffset,
+ PenAlignment.Center);
+
+ // Draw text
+ using( Brush textBrush = new SolidBrush(this.ForeColor) )
+ {
+ using (StringFormat format = new StringFormat(StringFormat.GenericTypographic))
+ {
+ format.Alignment = StringAlignment.Center;
+ format.LineAlignment = StringAlignment.Center;
+ format.FormatFlags = StringFormatFlags.LineLimit;
+ format.Trimming = StringTrimming.EllipsisCharacter;
+ graphics.DrawStringRel(
+ "(no image)",
+ this.Font,
+ textBrush,
+ rectanglePosition,
+ format);
+ }
+ }
+ }
+ else
+ {
+ // Draw image
+ graphics.FillRectangleRel(
+ rectanglePosition,
+ Color.Transparent,
+ this.BackHatchStyle,
+ this._imageName,
+ this._imageWrapMode,
+ this._imageTransparentColor,
+ GetImageAlignment(this.Alignment),
+ this.BackGradientStyle,
+ Color.Transparent,
+ Color.Transparent,
+ 0,
+ this.LineDashStyle,
+ this.ShadowColor,
+ this.ShadowOffset,
+ PenAlignment.Center);
+ }
+ }
+
+ if(this.Common.ProcessModeRegions)
+ {
+ // Add hot region
+ this.Common.HotRegionsList.AddHotRegion(
+ rectanglePosition,
+ ReplaceKeywords(this.ToolTip),
+#if Microsoft_CONTROL
+ String.Empty,
+ String.Empty,
+ String.Empty,
+#else // Microsoft_CONTROL
+ ReplaceKeywords(this.Url),
+ ReplaceKeywords(this.MapAreaAttributes),
+ ReplaceKeywords(this.PostBackValue),
+#endif // Microsoft_CONTROL
+ this,
+ ChartElementType.Annotation,
+ String.Empty);
+ }
+
+ // Paint selection handles
+ PaintSelectionHandles(graphics, selectionRect, null);
+ }
+
+ /// <summary>
+ /// Coverts ContentAlignment enumeration to ChartImageAlignmentStyle enumeration.
+ /// </summary>
+ /// <param name="alignment">Content alignment.</param>
+ /// <returns>Image content alignment.</returns>
+ private ChartImageAlignmentStyle GetImageAlignment(ContentAlignment alignment)
+ {
+ if(alignment == ContentAlignment.TopLeft)
+ {
+ return ChartImageAlignmentStyle.TopLeft;
+ }
+ else if(alignment == ContentAlignment.TopCenter)
+ {
+ return ChartImageAlignmentStyle.Top;
+ }
+ else if(alignment == ContentAlignment.TopRight)
+ {
+ return ChartImageAlignmentStyle.TopRight;
+ }
+ else if(alignment == ContentAlignment.MiddleRight)
+ {
+ return ChartImageAlignmentStyle.Right;
+ }
+ else if(alignment == ContentAlignment.BottomRight)
+ {
+ return ChartImageAlignmentStyle.BottomRight;
+ }
+ else if(alignment == ContentAlignment.BottomCenter)
+ {
+ return ChartImageAlignmentStyle.Bottom;
+ }
+ else if(alignment == ContentAlignment.BottomLeft)
+ {
+ return ChartImageAlignmentStyle.BottomLeft;
+ }
+ else if(alignment == ContentAlignment.MiddleLeft)
+ {
+ return ChartImageAlignmentStyle.Left;
+ }
+ return ChartImageAlignmentStyle.Center;
+ }
+
+ #endregion // Painting
+
+ #region Content Size
+
+ /// <summary>
+ /// Gets text annotation content size based on the text and font.
+ /// </summary>
+ /// <returns>Annotation content position.</returns>
+ override internal RectangleF GetContentPosition()
+ {
+ // Check image size
+ if(this.Image.Length > 0)
+ {
+ // Try loading image and getting its size
+ try
+ {
+ if(this.Chart != null)
+ {
+ ImageLoader imageLoader = this.Common.ImageLoader;
+
+ if(imageLoader != null)
+ {
+ ChartGraphics chartGraphics = this.GetGraphics();
+
+ if (chartGraphics != null)
+ {
+ SizeF absSize = new SizeF();
+
+ if (imageLoader.GetAdjustedImageSize(this.Image, chartGraphics.Graphics, ref absSize))
+ {
+ SizeF imageSize = chartGraphics.GetRelativeSize(absSize);
+ return new RectangleF(float.NaN, float.NaN, imageSize.Width, imageSize.Height);
+ }
+ }
+ }
+ }
+ }
+ catch(ArgumentException)
+ {
+ // ArgumentException is thrown by LoadImage in certain situations when it can't load the image
+ }
+ }
+
+ return new RectangleF(float.NaN, float.NaN, float.NaN, float.NaN);
+ }
+
+ #endregion
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/LineAnnotation.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/LineAnnotation.cs
new file mode 100644
index 00000000000..3584928888c
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/LineAnnotation.cs
@@ -0,0 +1,910 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: LineAnnotation.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: LineAnnotation, VerticalLineAnnotation,
+// HorizontalLineAnnotation
+//
+// Purpose: Line annotation class.
+//
+// Reviewed:
+//
+//===================================================================
+
+#region Used namespace
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Text;
+using System.Drawing.Drawing2D;
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+
+#else
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.DataVisualization.Charting;
+using System.Web.UI.DataVisualization.Charting.Data;
+using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ /// <summary>
+ /// <b>LineAnnotation</b> is a class that represents a line annotation.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeLineAnnotation_LineAnnotation"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class LineAnnotation : Annotation
+ {
+ #region Fields
+
+ // Indicates that an infinitive line should be drawn through 2 specified points.
+ private bool _isInfinitive = false;
+
+ // Line start/end caps
+ private LineAnchorCapStyle _startCap = LineAnchorCapStyle.None;
+ private LineAnchorCapStyle _endCap = LineAnchorCapStyle.None;
+
+ #endregion
+
+ #region Construction and Initialization
+
+ /// <summary>
+ /// Default public constructor.
+ /// </summary>
+ public LineAnnotation()
+ : base()
+ {
+ this.anchorAlignment = ContentAlignment.TopLeft;
+ }
+
+ #endregion
+
+ #region Properties
+
+ #region Line Visual Attributes
+
+ /// <summary>
+ /// Gets or sets a flag that indicates if an infinitive line should be drawn.
+ /// </summary>
+ /// <value>
+ /// <b>True</b> if a line should be drawn infinitively through 2 points provided, <b>false</b> otherwise.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeDrawInfinitive"),
+ ]
+ virtual public bool IsInfinitive
+ {
+ get
+ {
+ return _isInfinitive;
+ }
+ set
+ {
+ _isInfinitive = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a cap style used at the start of an annotation line.
+ /// <seealso cref="EndCap"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="LineAnchorCapStyle"/> value, used for a cap style used at the start of an annotation line.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(LineAnchorCapStyle.None),
+ SRDescription("DescriptionAttributeStartCap3"),
+ ]
+ virtual public LineAnchorCapStyle StartCap
+ {
+ get
+ {
+ return _startCap;
+ }
+ set
+ {
+ _startCap = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a cap style used at the end of an annotation line.
+ /// <seealso cref="StartCap"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="LineAnchorCapStyle"/> value, used for a cap style used at the end of an annotation line.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(LineAnchorCapStyle.None),
+ SRDescription("DescriptionAttributeStartCap3"),
+ ]
+ virtual public LineAnchorCapStyle EndCap
+ {
+ get
+ {
+ return _endCap;
+ }
+ set
+ {
+ _endCap = value;
+ Invalidate();
+ }
+ }
+
+ #endregion
+
+ #region Non Applicable Annotation Appearance Attributes (set as Non-Browsable)
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// </summary>
+ /// <value>
+ /// A <see cref="ContentAlignment"/> value.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(typeof(ContentAlignment), "MiddleCenter"),
+ ]
+ override public ContentAlignment Alignment
+ {
+ get
+ {
+ return base.Alignment;
+ }
+ set
+ {
+ base.Alignment = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an annotation's text style.
+ /// <seealso cref="Font"/>
+ /// <seealso cref="ForeColor"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="TextStyle"/> value used to draw an annotation's text.
+ /// </value>
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override TextStyle TextStyle
+ {
+ get
+ {
+ return base.TextStyle;
+ }
+ set
+ {
+ base.TextStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// <seealso cref="Font"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeForeColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ override public Color ForeColor
+ {
+ get
+ {
+ return base.ForeColor;
+ }
+ set
+ {
+ base.ForeColor = value;
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// <seealso cref="ForeColor"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Font"/> object.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(typeof(Font), "Microsoft Sans Serif, 8pt"),
+ ]
+ override public Font Font
+ {
+ get
+ {
+ return base.Font;
+ }
+ set
+ {
+ base.Font = value;
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(typeof(Color), ""),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ override public Color BackColor
+ {
+ get
+ {
+ return base.BackColor;
+ }
+ set
+ {
+ base.BackColor = value;
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// </summary>
+ /// <value>
+ /// A <see cref="ChartHatchStyle"/> value.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(ChartHatchStyle.None),
+ NotifyParentPropertyAttribute(true),
+ Editor(Editors.HatchStyleEditor.Editor, Editors.HatchStyleEditor.Base)
+ ]
+ override public ChartHatchStyle BackHatchStyle
+ {
+ get
+ {
+ return base.BackHatchStyle;
+ }
+ set
+ {
+ base.BackHatchStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(GradientStyle.None),
+ NotifyParentPropertyAttribute(true),
+ Editor(Editors.GradientEditor.Editor, Editors.GradientEditor.Base)
+ ]
+ override public GradientStyle BackGradientStyle
+ {
+ get
+ {
+ return base.BackGradientStyle;
+ }
+ set
+ {
+ base.BackGradientStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(typeof(Color), ""),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ override public Color BackSecondaryColor
+ {
+ get
+ {
+ return base.BackSecondaryColor;
+ }
+ set
+ {
+ base.BackSecondaryColor = value;
+ }
+ }
+
+ #endregion
+
+ #region Position
+
+ /// <summary>
+ /// Gets or sets a flag that specifies whether the size of an annotation is always
+ /// defined in relative chart coordinates.
+ /// <seealso cref="Annotation.Width"/>
+ /// <seealso cref="Annotation.Height"/>
+ /// </summary>
+ /// <value>
+ /// <b>True</b> if an annotation's <see cref="Annotation.Width"/> and <see cref="Annotation.Height"/> are always
+ /// in chart relative coordinates, <b>false</b> otherwise.
+ /// </value>
+ /// <remarks>
+ /// An annotation's width and height may be set in relative chart or axes coordinates.
+ /// By default, relative chart coordinates are used.
+ /// <para>
+ /// To use axes coordinates for size set the <b>IsSizeAlwaysRelative</b> property to
+ /// <b>false</b> and either anchor the annotation to a data point or set the
+ /// <see cref="Annotation.AxisX"/> or <see cref="Annotation.AxisY"/> properties.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributePosition"),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeSizeAlwaysRelative3"),
+ ]
+ override public bool IsSizeAlwaysRelative
+ {
+ get
+ {
+ return base.IsSizeAlwaysRelative;
+ }
+ set
+ {
+ base.IsSizeAlwaysRelative = value;
+ }
+ }
+
+ #endregion // Position
+
+ #region Anchor
+
+ /// <summary>
+ /// Gets or sets an annotation position's alignment to the anchor point.
+ /// <seealso cref="Annotation.AnchorX"/>
+ /// <seealso cref="Annotation.AnchorY"/>
+ /// <seealso cref="Annotation.AnchorDataPoint"/>
+ /// <seealso cref="Annotation.AnchorOffsetX"/>
+ /// <seealso cref="Annotation.AnchorOffsetY"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="ContentAlignment"/> value that represents the annotation's alignment to
+ /// the anchor point.
+ /// </value>
+ /// <remarks>
+ /// The annotation must be anchored using either <see cref="Annotation.AnchorDataPoint"/>, or the <see cref="Annotation.AnchorX"/>
+ /// and <see cref="Annotation.AnchorY"/> properties. Its <see cref="Annotation.X"/> and <see cref="Annotation.Y"/>
+ /// properties must be set to <b>Double.NaN</b>.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAnchor"),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DefaultValue(typeof(ContentAlignment), "TopLeft"),
+ SRDescription("DescriptionAttributeAnchorAlignment"),
+ ]
+ override public ContentAlignment AnchorAlignment
+ {
+ get
+ {
+ return base.AnchorAlignment;
+ }
+ set
+ {
+ base.AnchorAlignment = value;
+ }
+ }
+
+ #endregion // Anchoring
+
+ #region Other
+
+ /// <summary>
+ /// Gets or sets an annotation's type name.
+ /// </summary>
+ /// <remarks>
+ /// This property is used to get the name of each annotation type
+ /// (e.g. Line, Rectangle, Ellipse).
+ /// <para>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeAnnotationType"),
+ ]
+ public override string AnnotationType
+ {
+ get
+ {
+ return "Line";
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an annotation's selection points style.
+ /// </summary>
+ /// <value>
+ /// A <see cref="SelectionPointsStyle"/> value that represents the annotation
+ /// selection style.
+ /// </value>
+ /// <remarks>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(SelectionPointsStyle.Rectangle),
+ ParenthesizePropertyNameAttribute(true),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeSelectionPointsStyle"),
+ ]
+ override internal SelectionPointsStyle SelectionPointsStyle
+ {
+ get
+ {
+ return SelectionPointsStyle.TwoPoints;
+ }
+ }
+
+ #endregion
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Adjusts the two coordinates of the line.
+ /// </summary>
+ /// <param name="point1">First line coordinate.</param>
+ /// <param name="point2">Second line coordinate.</param>
+ /// <param name="selectionRect">Selection rectangle.</param>
+ virtual internal void AdjustLineCoordinates(ref PointF point1, ref PointF point2, ref RectangleF selectionRect)
+ {
+ // Adjust line points to draw infinitive line
+ if(IsInfinitive)
+ {
+ if(Math.Round(point1.X , 3) == Math.Round(point2.X, 3))
+ {
+ point1.Y = (point1.Y < point2.Y) ? 0f : 100f;
+ point2.Y = (point1.Y < point2.Y) ? 100f : 0f;
+ }
+ else if(Math.Round(point1.Y , 3) == Math.Round(point2.Y, 3))
+ {
+ point1.X = (point1.X < point2.X) ? 0f : 100f;
+ point2.X = (point1.X < point2.X) ? 100f : 0f;
+ }
+ else
+ {
+ // Calculate intersection point of the line with two bounaries Y = 0 and Y = 100
+ PointF intersectionPoint1 = PointF.Empty;
+ intersectionPoint1.Y = 0f;
+ intersectionPoint1.X = (0f - point1.Y) *
+ (point2.X - point1.X) /
+ (point2.Y - point1.Y) +
+ point1.X;
+ PointF intersectionPoint2 = PointF.Empty;
+ intersectionPoint2.Y = 100f;
+ intersectionPoint2.X = (100f - point1.Y) *
+ (point2.X - point1.X) /
+ (point2.Y - point1.Y) +
+ point1.X;
+
+ // Select point closect to the intersection
+ point1 = (point1.Y < point2.Y) ? intersectionPoint1 : intersectionPoint2;
+ point2 = (point1.Y < point2.Y) ? intersectionPoint2 : intersectionPoint1;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Paints an annotation object on the specified graphics.
+ /// </summary>
+ /// <param name="graphics">
+ /// A <see cref="ChartGraphics"/> object, used to paint an annotation object.
+ /// </param>
+ /// <param name="chart">
+ /// Reference to the <see cref="Chart"/> owner control.
+ /// </param>
+ override internal void Paint(Chart chart, ChartGraphics graphics)
+ {
+ // Get annotation position in relative coordinates
+ PointF firstPoint = PointF.Empty;
+ PointF anchorPoint = PointF.Empty;
+ SizeF size = SizeF.Empty;
+ GetRelativePosition(out firstPoint, out size, out anchorPoint);
+ PointF secondPoint = new PointF(firstPoint.X + size.Width, firstPoint.Y + size.Height);
+
+ // Create selection rectangle
+ RectangleF selectionRect = new RectangleF(firstPoint, new SizeF(secondPoint.X - firstPoint.X, secondPoint.Y - firstPoint.Y));
+
+ // Adjust coordinates
+ AdjustLineCoordinates(ref firstPoint, ref secondPoint, ref selectionRect);
+
+ // Check if text position is valid
+ if( float.IsNaN(firstPoint.X) ||
+ float.IsNaN(firstPoint.Y) ||
+ float.IsNaN(secondPoint.X) ||
+ float.IsNaN(secondPoint.Y) )
+ {
+ return;
+ }
+
+ // Set line caps
+ bool capChanged = false;
+ LineCap oldStartCap = LineCap.Flat;
+ LineCap oldEndCap = LineCap.Flat;
+ if(this._startCap != LineAnchorCapStyle.None ||
+ this._endCap != LineAnchorCapStyle.None)
+ {
+ capChanged = true;
+ oldStartCap = graphics.Pen.StartCap;
+ oldEndCap = graphics.Pen.EndCap;
+
+ // Apply anchor cap settings
+ if(this._startCap == LineAnchorCapStyle.Arrow)
+ {
+ // Adjust arrow size for small line width
+ if(this.LineWidth < 4)
+ {
+ int adjustment = 3 - this.LineWidth;
+ graphics.Pen.StartCap = LineCap.Custom;
+ graphics.Pen.CustomStartCap = new AdjustableArrowCap(
+ this.LineWidth + adjustment,
+ this.LineWidth + adjustment,
+ true);
+ }
+ else
+ {
+ graphics.Pen.StartCap = LineCap.ArrowAnchor;
+ }
+ }
+ else if(this._startCap == LineAnchorCapStyle.Diamond)
+ {
+ graphics.Pen.StartCap = LineCap.DiamondAnchor;
+ }
+ else if(this._startCap == LineAnchorCapStyle.Round)
+ {
+ graphics.Pen.StartCap = LineCap.RoundAnchor;
+ }
+ else if(this._startCap == LineAnchorCapStyle.Square)
+ {
+ graphics.Pen.StartCap = LineCap.SquareAnchor;
+ }
+ if(this._endCap == LineAnchorCapStyle.Arrow)
+ {
+ // Adjust arrow size for small line width
+ if(this.LineWidth < 4)
+ {
+ int adjustment = 3 - this.LineWidth;
+ graphics.Pen.EndCap = LineCap.Custom;
+ graphics.Pen.CustomEndCap = new AdjustableArrowCap(
+ this.LineWidth + adjustment,
+ this.LineWidth + adjustment,
+ true);
+ }
+ else
+ {
+ graphics.Pen.EndCap = LineCap.ArrowAnchor;
+ }
+ }
+ else if(this._endCap == LineAnchorCapStyle.Diamond)
+ {
+ graphics.Pen.EndCap = LineCap.DiamondAnchor;
+ }
+ else if(this._endCap == LineAnchorCapStyle.Round)
+ {
+ graphics.Pen.EndCap = LineCap.RoundAnchor;
+ }
+ else if(this._endCap == LineAnchorCapStyle.Square)
+ {
+ graphics.Pen.EndCap = LineCap.SquareAnchor;
+ }
+ }
+
+ if(this.Common.ProcessModePaint)
+ {
+ // Draw line
+ graphics.DrawLineRel(
+ this.LineColor,
+ this.LineWidth,
+ this.LineDashStyle,
+ firstPoint,
+ secondPoint,
+ this.ShadowColor,
+ this.ShadowOffset);
+ }
+
+ if(this.Common.ProcessModeRegions)
+ {
+ // Create line graphics path
+ using (GraphicsPath path = new GraphicsPath())
+ {
+ path.AddLine(
+ graphics.GetAbsolutePoint(firstPoint),
+ graphics.GetAbsolutePoint(secondPoint));
+ using (Pen pen = (Pen)graphics.Pen.Clone())
+ {
+ // Increase pen size by 2 pixels
+ pen.DashStyle = DashStyle.Solid;
+ pen.Width += 2;
+ try
+ {
+ path.Widen(pen);
+ }
+ catch (OutOfMemoryException)
+ {
+ // GraphicsPath.Widen incorrectly throws OutOfMemoryException
+ // catching here and reacting by not widening
+ }
+ catch (ArgumentException)
+ {
+ }
+ }
+
+ // Add hot region
+ this.Common.HotRegionsList.AddHotRegion(
+ graphics,
+ path,
+ false,
+ ReplaceKeywords(this.ToolTip),
+#if Microsoft_CONTROL
+ String.Empty,
+ String.Empty,
+ String.Empty,
+#else // Microsoft_CONTROL
+ ReplaceKeywords(this.Url),
+ ReplaceKeywords(this.MapAreaAttributes),
+ ReplaceKeywords(this.PostBackValue),
+#endif // Microsoft_CONTROL
+ this,
+ ChartElementType.Annotation);
+ }
+ }
+
+
+ // Restore line caps
+ if(capChanged)
+ {
+ graphics.Pen.StartCap = oldStartCap;
+ graphics.Pen.EndCap = oldEndCap;
+ }
+
+ // Paint selection handles
+ PaintSelectionHandles(graphics, selectionRect, null);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// <b>VerticalLineAnnotation</b> is a class that represents a vertical line annotation.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeVerticalLineAnnotation_VerticalLineAnnotation"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class VerticalLineAnnotation : LineAnnotation
+ {
+ #region Construction and Initialization
+
+ /// <summary>
+ /// Default public constructor.
+ /// </summary>
+ public VerticalLineAnnotation()
+ : base()
+ {
+ }
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets an annotation's type name.
+ /// </summary>
+ /// <remarks>
+ /// This property is used to get the name of each annotation type
+ /// (e.g. Line, Rectangle, Ellipse).
+ /// <para>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeAnnotationType"),
+ ]
+ public override string AnnotationType
+ {
+ get
+ {
+ return "VerticalLine";
+ }
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Adjusts the two coordinates of the line.
+ /// </summary>
+ /// <param name="point1">First line coordinate.</param>
+ /// <param name="point2">Second line coordinate.</param>
+ /// <param name="selectionRect">Selection rectangle.</param>
+ override internal void AdjustLineCoordinates(ref PointF point1, ref PointF point2, ref RectangleF selectionRect)
+ {
+ // Make line vertical
+ point2.X = point1.X;
+ selectionRect.Width = 0f;
+
+ // Call base class
+ base.AdjustLineCoordinates(ref point1, ref point2, ref selectionRect);
+ }
+
+ #region Content Size
+
+ /// <summary>
+ /// Gets text annotation content size based on the text and font.
+ /// </summary>
+ /// <returns>Annotation content position.</returns>
+ override internal RectangleF GetContentPosition()
+ {
+ return new RectangleF(float.NaN, float.NaN, 0f, float.NaN);
+ }
+
+ #endregion // Content Size
+
+ #endregion
+ }
+
+ /// <summary>
+ /// <b>HorizontalLineAnnotation</b> is a class that represents a horizontal line annotation.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeHorizontalLineAnnotation_HorizontalLineAnnotation"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class HorizontalLineAnnotation : LineAnnotation
+ {
+ #region Construction and Initialization
+
+ /// <summary>
+ /// Default public constructor.
+ /// </summary>
+ public HorizontalLineAnnotation()
+ : base()
+ {
+ }
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets an annotation's type name.
+ /// </summary>
+ /// <remarks>
+ /// This property is used to get the name of each annotation type
+ /// (e.g. Line, Rectangle, Ellipse).
+ /// <para>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeAnnotationType"),
+ ]
+ public override string AnnotationType
+ {
+ get
+ {
+ return "HorizontalLine";
+ }
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Adjusts the two coordinates of the line.
+ /// </summary>
+ /// <param name="point1">First line coordinate.</param>
+ /// <param name="point2">Second line coordinate.</param>
+ /// <param name="selectionRect">Selection rectangle.</param>
+ override internal void AdjustLineCoordinates(ref PointF point1, ref PointF point2, ref RectangleF selectionRect)
+ {
+ // Make line horizontal
+ point2.Y = point1.Y;
+ selectionRect.Height = 0f;
+
+ // Call base class
+ base.AdjustLineCoordinates(ref point1, ref point2, ref selectionRect);
+ }
+
+ #region Content Size
+
+ /// <summary>
+ /// Gets text annotation content size based on the text and font.
+ /// </summary>
+ /// <returns>Annotation content position.</returns>
+ override internal RectangleF GetContentPosition()
+ {
+ return new RectangleF(float.NaN, float.NaN, float.NaN, 0f);
+ }
+
+ #endregion // Content Size
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/PolygonAnnotation.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/PolygonAnnotation.cs
new file mode 100644
index 00000000000..27ef81c1293
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/PolygonAnnotation.cs
@@ -0,0 +1,1739 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: RectangleAnnotation.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: PolylineAnnotation, PolygonAnnotation
+//
+// Purpose: Polyline and polygon annotation classes.
+//
+// Reviewed:
+//
+//===================================================================
+
+#region Used namespace
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Text;
+using System.Drawing.Drawing2D;
+using System.Diagnostics.CodeAnalysis;
+#if Microsoft_CONTROL
+using System.Windows.Forms;
+using System.Globalization;
+using System.Reflection;
+using System.ComponentModel.Design.Serialization;
+using System.Windows.Forms.DataVisualization.Charting;
+using System.Windows.Forms.DataVisualization.Charting.Data;
+using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+using System.Windows.Forms.DataVisualization.Charting.Utilities;
+using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+using System.Collections.ObjectModel;
+
+#else
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.DataVisualization.Charting;
+using System.Web.UI.DataVisualization.Charting.Data;
+using System.Web.UI.DataVisualization.Charting.Utilities;
+using System.Web.UI.DataVisualization.Charting.Borders3D;
+using System.Collections.ObjectModel;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+namespace System.Windows.Forms.DataVisualization.Charting
+
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ /// <summary>
+ /// <b>PolylineAnnotation</b> is a class that represents a polyline annotation.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributePolylineAnnotation_PolylineAnnotation"),
+ ]
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Polyline")]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class PolylineAnnotation : Annotation
+ {
+ #region Fields
+
+ // Path with polygon points.
+ private GraphicsPath _defaultGraphicsPath = new GraphicsPath();
+ private GraphicsPath _graphicsPath;
+
+ // Indicates that path was changed
+ internal bool pathChanged = false;
+
+ // Collection of path points exposed at design-time
+ private AnnotationPathPointCollection _pathPoints;
+
+ // Indicate that filled polygon must be drawn
+ internal bool isPolygon = false;
+
+ // Indicates that annotation will be placed using free-draw style
+ internal bool isFreeDrawPlacement = false;
+
+ // Line start/end caps
+ private LineAnchorCapStyle _startCap = LineAnchorCapStyle.None;
+ private LineAnchorCapStyle _endCap = LineAnchorCapStyle.None;
+
+ #endregion
+
+ #region Construction and Initialization
+
+ /// <summary>
+ /// Default public constructor.
+ /// </summary>
+ public PolylineAnnotation()
+ : base()
+ {
+ _pathPoints = new AnnotationPathPointCollection(this);
+
+ _graphicsPath = _defaultGraphicsPath;
+ }
+
+ #endregion
+
+ #region Properties
+
+ #region Polyline Visual Attributes
+
+ /// <summary>
+ /// Gets or sets a cap style used at the start of an annotation line.
+ /// <seealso cref="EndCap"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="LineAnchorCapStyle"/> value used for a cap style used at the start of an annotation line.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(LineAnchorCapStyle.None),
+ SRDescription("DescriptionAttributeStartCap3"),
+ ]
+ virtual public LineAnchorCapStyle StartCap
+ {
+ get
+ {
+ return _startCap;
+ }
+ set
+ {
+ _startCap = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a cap style used at the end of an annotation line.
+ /// <seealso cref="StartCap"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="LineAnchorCapStyle"/> value used for a cap style used at the end of an annotation line.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(LineAnchorCapStyle.None),
+ SRDescription("DescriptionAttributeStartCap3"),
+ ]
+ virtual public LineAnchorCapStyle EndCap
+ {
+ get
+ {
+ return _endCap;
+ }
+ set
+ {
+ _endCap = value;
+ Invalidate();
+ }
+ }
+
+ #endregion
+
+ #region Non Applicable Annotation Appearance Attributes (set as Non-Browsable)
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// </summary>
+ /// <value>
+ /// A <see cref="ContentAlignment"/> value.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(typeof(ContentAlignment), "MiddleCenter"),
+ ]
+ override public ContentAlignment Alignment
+ {
+ get
+ {
+ return base.Alignment;
+ }
+ set
+ {
+ base.Alignment = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an annotation's text style.
+ /// <seealso cref="Font"/>
+ /// <seealso cref="ForeColor"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="TextStyle"/> value used to draw an annotation's text.
+ /// </value>
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override TextStyle TextStyle
+ {
+ get
+ {
+ return base.TextStyle;
+ }
+ set
+ {
+ base.TextStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// <seealso cref="Font"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeForeColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ override public Color ForeColor
+ {
+ get
+ {
+ return base.ForeColor;
+ }
+ set
+ {
+ base.ForeColor = value;
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// <seealso cref="ForeColor"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Font"/> object.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(typeof(Font), "Microsoft Sans Serif, 8pt"),
+ ]
+ override public Font Font
+ {
+ get
+ {
+ return base.Font;
+ }
+ set
+ {
+ base.Font = value;
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(typeof(Color), ""),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ override public Color BackColor
+ {
+ get
+ {
+ return base.BackColor;
+ }
+ set
+ {
+ base.BackColor = value;
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(ChartHatchStyle.None),
+ NotifyParentPropertyAttribute(true),
+ Editor(Editors.HatchStyleEditor.Editor, Editors.HatchStyleEditor.Base)
+ ]
+ override public ChartHatchStyle BackHatchStyle
+ {
+ get
+ {
+ return base.BackHatchStyle;
+ }
+ set
+ {
+ base.BackHatchStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(GradientStyle.None),
+ NotifyParentPropertyAttribute(true),
+ Editor(Editors.GradientEditor.Editor, Editors.GradientEditor.Base)
+ ]
+ override public GradientStyle BackGradientStyle
+ {
+ get
+ {
+ return base.BackGradientStyle;
+ }
+ set
+ {
+ base.BackGradientStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(typeof(Color), ""),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ override public Color BackSecondaryColor
+ {
+ get
+ {
+ return base.BackSecondaryColor;
+ }
+ set
+ {
+ base.BackSecondaryColor = value;
+ }
+ }
+
+ #endregion
+
+ #region Other
+
+ /// <summary>
+ /// Gets or sets an annotation's type name.
+ /// </summary>
+ /// <remarks>
+ /// This property is used to get the name of each annotation type
+ /// (e.g. Line, Rectangle, Ellipse).
+ /// <para>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeAnnotationType"),
+ ]
+ public override string AnnotationType
+ {
+ get
+ {
+ return "Polyline";
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an annotation selection points style.
+ /// </summary>
+ /// <value>
+ /// A <see cref="SelectionPointsStyle"/> value that represents the annotation
+ /// selection style.
+ /// </value>
+ /// <remarks>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(SelectionPointsStyle.Rectangle),
+ ParenthesizePropertyNameAttribute(true),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeSelectionPointsStyle"),
+ ]
+ override internal SelectionPointsStyle SelectionPointsStyle
+ {
+ get
+ {
+ return SelectionPointsStyle.Rectangle;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag that determines whether an annotation should be placed using the free-draw mode.
+ /// </summary>
+ /// <value>
+ /// <b>True</b> if an annotation should be placed using free-draw mode,
+ /// <b>false</b> otherwise. Defaults to <b>false</b>.
+ /// </value>
+ /// <remarks>
+ /// Two different placement modes are supported when the Annotation.BeginPlacement
+ /// method is called. Set this property to <b>true</b> to switch from the default
+ /// mode to free-draw mode, which allows the caller to free-draw while moving the mouse cursor.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeFreeDrawPlacement"),
+#if !Microsoft_CONTROL
+ Browsable(false),
+ EditorBrowsable(EditorBrowsableState.Never),
+#endif // !Microsoft_CONTROL
+ ]
+ virtual public bool IsFreeDrawPlacement
+ {
+ get
+ {
+ return isFreeDrawPlacement;
+ }
+ set
+ {
+ isFreeDrawPlacement = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the path points of a polyline at run-time.
+ /// </summary>
+ /// <value>
+ /// A <see cref="GraphicsPath"/> object with the polyline shape.
+ /// </value>
+ /// <remarks>
+ /// A polyline must use coordinates relative to an annotation object, where (0,0) is
+ /// the top-left coordinates and (100,100) is the bottom-right coordinates of the annotation.
+ /// <para>
+ /// This property is not accessible at design time (at design-time, use the
+ /// <see cref="GraphicsPathPoints"/> property instead).
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributePosition"),
+ DefaultValue(null),
+ SRDescription("DescriptionAttributePath"),
+ Browsable(false),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ ]
+ virtual public GraphicsPath GraphicsPath
+ {
+ get
+ {
+ return _graphicsPath;
+ }
+ set
+ {
+ _graphicsPath = value;
+ this.pathChanged = true;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the path points of the polyline at design-time.
+ /// </summary>
+ /// <value>
+ /// An <see cref="AnnotationPathPointCollection"/> object with the polyline shape.
+ /// </value>
+ /// <remarks>
+ /// A polyline must use coordinates relative to an annotation object, where (0,0) is
+ /// the top-left coordinates and (100,100) is the bottom-right coordinates of the annotation.
+ /// <para>
+ /// This property is not accessible at runtime (at runtime, use the <see cref="GraphicsPath"/>
+ /// property instead).
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributePosition"),
+ SRDescription("DescriptionAttributePathPoints"),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ Editor(Editors.ChartCollectionEditor.Editor, Editors.ChartCollectionEditor.Base),
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.InnerProperty)
+#endif
+ ]
+ public AnnotationPathPointCollection GraphicsPathPoints
+ {
+ get
+ {
+ if(this.pathChanged ||
+ _graphicsPath.PointCount != _pathPoints.Count)
+ {
+ // Recreate collection from graphics path
+ _pathPoints.annotation = null;
+ _pathPoints.Clear();
+ if (_graphicsPath.PointCount > 0 )
+ {
+ PointF[] points = _graphicsPath.PathPoints;
+ byte[] types = _graphicsPath.PathTypes;
+ for (int index = 0; index < points.Length; index++)
+ {
+ _pathPoints.Add(new AnnotationPathPoint(points[index].X, points[index].Y, types[index]));
+ }
+ }
+ _pathPoints.annotation = this;
+ }
+ return _pathPoints;
+ }
+ }
+
+ #endregion
+
+ #endregion
+
+ #region Methods
+
+ #region Painting
+
+ /// <summary>
+ /// Paints an annotation object on the specified graphics.
+ /// </summary>
+ /// <param name="graphics">
+ /// A <see cref="ChartGraphics"/> object, used to paint an annotation object.
+ /// </param>
+ /// <param name="chart">
+ /// Reference to the <see cref="Chart"/> owner control.
+ /// </param>
+ override internal void Paint(Chart chart, ChartGraphics graphics)
+ {
+ // Check for empty path
+ if(_graphicsPath.PointCount == 0)
+ {
+ return;
+ }
+
+ // Get annotation position in relative coordinates
+ PointF firstPoint = PointF.Empty;
+ PointF anchorPoint = PointF.Empty;
+ SizeF size = SizeF.Empty;
+ GetRelativePosition(out firstPoint, out size, out anchorPoint);
+ PointF secondPoint = new PointF(firstPoint.X + size.Width, firstPoint.Y + size.Height);
+
+ // Create selection rectangle
+ RectangleF selectionRect = new RectangleF(firstPoint, new SizeF(secondPoint.X - firstPoint.X, secondPoint.Y - firstPoint.Y));
+
+ // Get position
+ RectangleF rectanglePosition = new RectangleF(selectionRect.Location, selectionRect.Size);
+ if(rectanglePosition.Width < 0)
+ {
+ rectanglePosition.X = rectanglePosition.Right;
+ rectanglePosition.Width = -rectanglePosition.Width;
+ }
+ if(rectanglePosition.Height < 0)
+ {
+ rectanglePosition.Y = rectanglePosition.Bottom;
+ rectanglePosition.Height = -rectanglePosition.Height;
+ }
+
+ // Check if position is valid
+ if( float.IsNaN(rectanglePosition.X) ||
+ float.IsNaN(rectanglePosition.Y) ||
+ float.IsNaN(rectanglePosition.Right) ||
+ float.IsNaN(rectanglePosition.Bottom) )
+ {
+ return;
+ }
+
+ // Get annotation absolute position
+ RectangleF rectanglePositionAbs = graphics.GetAbsoluteRectangle(rectanglePosition);
+
+ // Calculate scaling
+ float groupScaleX = rectanglePositionAbs.Width / 100.0f;
+ float groupScaleY = rectanglePositionAbs.Height / 100.0f;
+
+ // Convert path to pixel coordinates
+ PointF[] pathPoints = _graphicsPath.PathPoints;
+ byte[] pathTypes = _graphicsPath.PathTypes;
+ for(int pointIndex = 0; pointIndex < pathPoints.Length; pointIndex++)
+ {
+ pathPoints[pointIndex].X = rectanglePositionAbs.X + pathPoints[pointIndex].X * groupScaleX;
+ pathPoints[pointIndex].Y = rectanglePositionAbs.Y + pathPoints[pointIndex].Y * groupScaleY;
+ }
+
+ using (GraphicsPath pathAbs = new GraphicsPath(pathPoints, pathTypes))
+ {
+
+ // Set line caps
+ bool capChanged = false;
+ LineCap oldStartCap = LineCap.Flat;
+ LineCap oldEndCap = LineCap.Flat;
+ if (!this.isPolygon)
+ {
+ if (this._startCap != LineAnchorCapStyle.None ||
+ this._endCap != LineAnchorCapStyle.None)
+ {
+ capChanged = true;
+ oldStartCap = graphics.Pen.StartCap;
+ oldEndCap = graphics.Pen.EndCap;
+
+ // Apply anchor cap settings
+ if (this._startCap == LineAnchorCapStyle.Arrow)
+ {
+ // Adjust arrow size for small line width
+ if (this.LineWidth < 4)
+ {
+ int adjustment = 3 - this.LineWidth;
+ graphics.Pen.StartCap = LineCap.Custom;
+ graphics.Pen.CustomStartCap = new AdjustableArrowCap(
+ this.LineWidth + adjustment,
+ this.LineWidth + adjustment,
+ true);
+ }
+ else
+ {
+ graphics.Pen.StartCap = LineCap.ArrowAnchor;
+ }
+ }
+ else if (this._startCap == LineAnchorCapStyle.Diamond)
+ {
+ graphics.Pen.StartCap = LineCap.DiamondAnchor;
+ }
+ else if (this._startCap == LineAnchorCapStyle.Round)
+ {
+ graphics.Pen.StartCap = LineCap.RoundAnchor;
+ }
+ else if (this._startCap == LineAnchorCapStyle.Square)
+ {
+ graphics.Pen.StartCap = LineCap.SquareAnchor;
+ }
+ if (this._endCap == LineAnchorCapStyle.Arrow)
+ {
+ // Adjust arrow size for small line width
+ if (this.LineWidth < 4)
+ {
+ int adjustment = 3 - this.LineWidth;
+ graphics.Pen.EndCap = LineCap.Custom;
+ graphics.Pen.CustomEndCap = new AdjustableArrowCap(
+ this.LineWidth + adjustment,
+ this.LineWidth + adjustment,
+ true);
+ }
+ else
+ {
+ graphics.Pen.EndCap = LineCap.ArrowAnchor;
+ }
+ }
+ else if (this._endCap == LineAnchorCapStyle.Diamond)
+ {
+ graphics.Pen.EndCap = LineCap.DiamondAnchor;
+ }
+ else if (this._endCap == LineAnchorCapStyle.Round)
+ {
+ graphics.Pen.EndCap = LineCap.RoundAnchor;
+ }
+ else if (this._endCap == LineAnchorCapStyle.Square)
+ {
+ graphics.Pen.EndCap = LineCap.SquareAnchor;
+ }
+ }
+ }
+
+ // Painting mode
+ if (this.Common.ProcessModePaint)
+ {
+ if (this.isPolygon)
+ {
+ // Draw polygon
+ pathAbs.CloseAllFigures();
+ graphics.DrawPathAbs(
+ pathAbs,
+ this.BackColor,
+ this.BackHatchStyle,
+ String.Empty,
+ ChartImageWrapMode.Scaled,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ this.BackGradientStyle,
+ this.BackSecondaryColor,
+ this.LineColor,
+ this.LineWidth,
+ this.LineDashStyle,
+ PenAlignment.Center,
+ this.ShadowOffset,
+ this.ShadowColor);
+ }
+ else
+ {
+ // Draw polyline
+ graphics.DrawPathAbs(
+ pathAbs,
+ Color.Transparent,
+ ChartHatchStyle.None,
+ String.Empty,
+ ChartImageWrapMode.Scaled,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ GradientStyle.None,
+ Color.Empty,
+ this.LineColor,
+ this.LineWidth,
+ this.LineDashStyle,
+ PenAlignment.Center,
+ this.ShadowOffset,
+ this.ShadowColor);
+ }
+ }
+
+ if (this.Common.ProcessModeRegions)
+ {
+ // Create line graphics path
+ GraphicsPath selectionPath = null;
+ GraphicsPath newPath = null;
+
+ if (this.isPolygon)
+ {
+ selectionPath = pathAbs;
+ }
+ else
+ {
+ newPath = new GraphicsPath();
+ selectionPath = newPath;
+ selectionPath.AddPath(pathAbs, false);
+ using (Pen pen = (Pen)graphics.Pen.Clone())
+ {
+ // Increase pen size by 2 pixels
+ pen.DashStyle = DashStyle.Solid;
+ pen.Width += 2;
+ try
+ {
+ selectionPath.Widen(pen);
+ }
+ catch (OutOfMemoryException)
+ {
+ // GraphicsPath.Widen incorrectly throws OutOfMemoryException
+ // catching here and reacting by not widening
+ }
+ catch (ArgumentException)
+ {
+ }
+ }
+ }
+
+ // Add hot region
+ this.Common.HotRegionsList.AddHotRegion(
+ graphics,
+ selectionPath,
+ false,
+ ReplaceKeywords(this.ToolTip),
+#if Microsoft_CONTROL
+ String.Empty,
+ String.Empty,
+ String.Empty,
+#else // Microsoft_CONTROL
+ ReplaceKeywords(this.Url),
+ ReplaceKeywords(this.MapAreaAttributes),
+ ReplaceKeywords(this.PostBackValue),
+#endif // Microsoft_CONTROL
+ this,
+ ChartElementType.Annotation);
+
+ //Clean up
+ if (newPath != null)
+ newPath.Dispose();
+ }
+
+ // Restore line caps
+ if (capChanged)
+ {
+ graphics.Pen.StartCap = oldStartCap;
+ graphics.Pen.EndCap = oldEndCap;
+ }
+
+ // Paint selection handles
+ PaintSelectionHandles(graphics, rectanglePosition, pathAbs);
+ }
+ }
+
+ #endregion // Painting
+
+ #region Position Changing
+#if Microsoft_CONTROL
+ /// <summary>
+ /// Changes annotation position, so it exactly matches the bounary of the
+ /// polyline path.
+ /// </summary>
+ private void ResizeToPathBoundary()
+ {
+ if(_graphicsPath.PointCount > 0)
+ {
+ // Get current annotation position in relative coordinates
+ PointF firstPoint = PointF.Empty;
+ PointF anchorPoint = PointF.Empty;
+ SizeF size = SizeF.Empty;
+ GetRelativePosition(out firstPoint, out size, out anchorPoint);
+
+ // Get path boundary and convert it to relative coordinates
+ RectangleF pathBoundary = _graphicsPath.GetBounds();
+ pathBoundary.X *= size.Width / 100f;
+ pathBoundary.Y *= size.Height / 100f;
+ pathBoundary.X += firstPoint.X;
+ pathBoundary.Y += firstPoint.Y;
+ pathBoundary.Width *= size.Width / 100f;
+ pathBoundary.Height *= size.Height / 100f;
+
+ // Scale all current points
+ using( Matrix matrix = new Matrix() )
+ {
+ matrix.Scale(size.Width/pathBoundary.Width, size.Height/pathBoundary.Height);
+ matrix.Translate(-pathBoundary.X, -pathBoundary.Y);
+ _graphicsPath.Transform(matrix);
+ }
+
+ // Set new position for annotation
+ this.SetPositionRelative(pathBoundary, anchorPoint);
+ }
+ }
+#endif //Microsoft_CONTROL
+ /// <summary>
+ /// Adjust annotation location and\or size as a result of user action.
+ /// </summary>
+ /// <param name="movingDistance">Distance to resize/move the annotation.</param>
+ /// <param name="resizeMode">Resizing mode.</param>
+ /// <param name="pixelCoord">Distance is in pixels, otherwise relative.</param>
+ /// <param name="userInput">Indicates if position changing was a result of the user input.</param>
+ override internal void AdjustLocationSize(SizeF movingDistance, ResizingMode resizeMode, bool pixelCoord, bool userInput)
+ {
+ // Call base class when not resizing the path points
+ if(resizeMode != ResizingMode.MovingPathPoints)
+ {
+ base.AdjustLocationSize(movingDistance, resizeMode, pixelCoord, userInput);
+ return;
+ }
+
+ // Get annotation position in relative coordinates
+ PointF firstPoint = PointF.Empty;
+ PointF anchorPoint = PointF.Empty;
+ SizeF size = SizeF.Empty;
+ GetRelativePosition(out firstPoint, out size, out anchorPoint);
+
+ // Remember path before moving operation
+ if(userInput == true && startMovePathRel == null)
+ {
+#if Microsoft_CONTROL
+ this.startMovePathRel = (GraphicsPath)_graphicsPath.Clone();
+ this.startMovePositionRel = new RectangleF(firstPoint, size);
+ this.startMoveAnchorLocationRel = new PointF(anchorPoint.X, anchorPoint.Y);
+
+#endif // Microsoft_CONTROL
+ }
+
+ // Convert moving distance to coordinates relative to the anotation
+ if(pixelCoord)
+ {
+ movingDistance = this.GetGraphics().GetRelativeSize(movingDistance);
+ }
+ movingDistance.Width /= startMovePositionRel.Width / 100.0f;
+ movingDistance.Height /= startMovePositionRel.Height / 100.0f;
+
+ // Get path points and adjust position of one of them
+ if(_graphicsPath.PointCount > 0)
+ {
+ GraphicsPath pathToMove = (userInput) ? startMovePathRel : _graphicsPath;
+ PointF[] pathPoints = pathToMove.PathPoints;
+ byte[] pathTypes = pathToMove.PathTypes;
+
+ for(int pointIndex = 0; pointIndex < pathPoints.Length; pointIndex++)
+ {
+ // Adjust position
+ if( currentPathPointIndex == pointIndex ||
+ currentPathPointIndex < 0 ||
+ currentPathPointIndex >= pathPoints.Length )
+ {
+ pathPoints[pointIndex].X -= movingDistance.Width;
+ pathPoints[pointIndex].Y -= movingDistance.Height;
+ }
+ }
+
+#if Microsoft_CONTROL
+
+ // Adjust annotation position to the boundary of the path
+ if(userInput && this.AllowResizing)
+ {
+ // Get path bounds in relative coordinates
+ _defaultGraphicsPath.Dispose();
+ _defaultGraphicsPath = new GraphicsPath(pathPoints, pathTypes);
+ _graphicsPath = _defaultGraphicsPath;
+
+ RectangleF pathBounds = _graphicsPath.GetBounds();
+ pathBounds.X *= startMovePositionRel.Width / 100f;
+ pathBounds.Y *= startMovePositionRel.Height / 100f;
+ pathBounds.X += startMovePositionRel.X;
+ pathBounds.Y += startMovePositionRel.Y;
+ pathBounds.Width *= startMovePositionRel.Width / 100f;
+ pathBounds.Height *= startMovePositionRel.Height / 100f;
+
+ // Set new annotation position
+ this.SetPositionRelative(pathBounds, anchorPoint);
+
+ // Adjust path point position
+ for(int pointIndex = 0; pointIndex < pathPoints.Length; pointIndex++)
+ {
+
+ pathPoints[pointIndex].X = startMovePositionRel.X + pathPoints[pointIndex].X * (startMovePositionRel.Width / 100f);
+ pathPoints[pointIndex].Y = startMovePositionRel.Y + pathPoints[pointIndex].Y * (startMovePositionRel.Height / 100f);
+
+ pathPoints[pointIndex].X = (pathPoints[pointIndex].X - pathBounds.X) / (pathBounds.Width / 100f);
+ pathPoints[pointIndex].Y = (pathPoints[pointIndex].Y - pathBounds.Y) / (pathBounds.Height / 100f);
+ }
+ }
+
+#endif // Microsoft_CONTROL
+
+#if Microsoft_CONTROL
+ // Position changed
+ this.positionChanged = true;
+#endif // Microsoft_CONTROL
+
+ // Recreate path with new points
+ _defaultGraphicsPath.Dispose();
+ _defaultGraphicsPath = new GraphicsPath(pathPoints, pathTypes);
+ _graphicsPath = _defaultGraphicsPath;
+ this.pathChanged = true;
+
+ // Invalidate annotation
+ this.Invalidate();
+ }
+ }
+
+ #endregion // Position Changing
+
+ #region Placement Methods
+
+#if Microsoft_CONTROL
+
+ /// <summary>
+ /// Ends user placement of an annotation.
+ /// </summary>
+ /// <remarks>
+ /// Ends an annotation placement operation previously started by a
+ /// <see cref="Annotation.BeginPlacement"/> method call.
+ /// <para>
+ /// Calling this method is not required, since placement will automatically
+ /// end when an end user enters all required points. However, it is useful when an annotation
+ /// placement operation needs to be aborted for some reason.
+ /// </para>
+ /// </remarks>
+ override public void EndPlacement()
+ {
+ // Call base method
+ base.EndPlacement();
+
+ // Position was changed
+ if(this.Chart != null)
+ {
+ this.Chart.OnAnnotationPositionChanged(this);
+ }
+
+ // Reset last placement position
+ this.lastPlacementPosition = PointF.Empty;
+
+ // Resize annotation to the boundary of the polygon
+ ResizeToPathBoundary();
+
+ // Position changed
+ this.positionChanged = true;
+ }
+
+ /// <summary>
+ /// Handles mouse down event during annotation placement.
+ /// </summary>
+ /// <param name="point">Mouse cursor position in pixels.</param>
+ /// <param name="buttons">Mouse button down.</param>
+ internal override void PlacementMouseDown(PointF point, MouseButtons buttons)
+ {
+ // Call base class method if path editing is not allowed
+ if(!this.AllowPathEditing)
+ {
+ base.PlacementMouseDown(point, buttons);
+ return;
+ }
+
+ if(buttons == MouseButtons.Right)
+ {
+ // Stop pacement
+ this.EndPlacement();
+ }
+ if(buttons == MouseButtons.Left &&
+ IsValidPlacementPosition(point.X, point.Y))
+ {
+ // Convert coordinate to relative
+ PointF newPoint = this.GetGraphics().GetRelativePoint(point);
+
+ if(this.lastPlacementPosition.IsEmpty)
+ {
+ // Set annotation coordinates to full chart
+ this.X = 0f;
+ this.Y = 0f;
+ this.Width = 100f;
+ this.Height = 100f;
+
+ // Remeber position where mouse was clicked
+ this.lastPlacementPosition = newPoint;
+ }
+ else
+ {
+ if(this.lastPlacementPosition.X == newPoint.X &&
+ this.lastPlacementPosition.Y == newPoint.Y)
+ {
+ // Stop pacement
+ this.EndPlacement();
+ }
+ }
+
+ // Add a line from prev. position to current into the path
+ using( GraphicsPath tmpPath = new GraphicsPath() )
+ {
+ PointF firstPoint = this.lastPlacementPosition;
+ if(_graphicsPath.PointCount > 1)
+ {
+ firstPoint = _graphicsPath.GetLastPoint();
+ }
+ tmpPath.AddLine(firstPoint, newPoint);
+ _graphicsPath.AddPath(tmpPath, true);
+ }
+
+ // Remember last position
+ this.lastPlacementPosition = newPoint;
+
+ // Invalidate and update the chart
+ if(Chart != null)
+ {
+ Invalidate();
+ Chart.UpdateAnnotations();
+ }
+ }
+ }
+
+ /// <summary>
+ /// Handles mouse up event during annotation placement.
+ /// </summary>
+ /// <param name="point">Mouse cursor position in pixels.</param>
+ /// <param name="buttons">Mouse button Up.</param>
+ /// <returns>Return true when placing finished.</returns>
+ internal override bool PlacementMouseUp(PointF point, MouseButtons buttons)
+ {
+ // Call base class method if path editing is not allowed
+ if(!this.AllowPathEditing)
+ {
+ return base.PlacementMouseUp(point, buttons);
+ }
+
+ if(buttons == MouseButtons.Left &&
+ isFreeDrawPlacement)
+ {
+ // Stop pacement
+ this.EndPlacement();
+
+ }
+
+ return false;
+ }
+
+ /// <summary>
+ /// Handles mouse move event during annotation placement.
+ /// </summary>
+ /// <param name="point">Mouse cursor position in pixels.</param>
+ internal override void PlacementMouseMove(PointF point)
+ {
+ // Call base class method if path editing is not allowed
+ if(!this.AllowPathEditing)
+ {
+ base.PlacementMouseMove(point);
+ return;
+ }
+
+ // Check if annotation was moved
+ if( this.GetGraphics() != null &&
+ _graphicsPath.PointCount > 0 &&
+ !this.lastPlacementPosition.IsEmpty)
+ {
+ // Convert coordinate to relative
+ PointF newPoint = this.GetGraphics().GetRelativePoint(point);
+ if(this.isFreeDrawPlacement)
+ {
+ // Add new point
+ using( GraphicsPath tmpPath = new GraphicsPath() )
+ {
+ PointF firstPoint = this.lastPlacementPosition;
+ if(_graphicsPath.PointCount > 1)
+ {
+ firstPoint = _graphicsPath.GetLastPoint();
+ }
+ tmpPath.AddLine(firstPoint, newPoint);
+ _graphicsPath.AddPath(tmpPath, true);
+ }
+ }
+ else
+ {
+ // Adjust last point position
+ PointF[] pathPoints = _graphicsPath.PathPoints;
+ byte[] pathTypes = _graphicsPath.PathTypes;
+ pathPoints[pathPoints.Length - 1] = newPoint;
+
+ _defaultGraphicsPath.Dispose();
+ _defaultGraphicsPath = new GraphicsPath(pathPoints, pathTypes);
+ _graphicsPath = _defaultGraphicsPath;
+
+ }
+
+ // Position changed
+ this.positionChanged = true;
+
+ // Invalidate and update the chart
+ if(this.Chart != null)
+ {
+ Invalidate();
+ this.Chart.UpdateAnnotations();
+ }
+ }
+ }
+
+#endif // Microsoft_CONTROL
+
+ #endregion // Placement Methods
+
+ #endregion
+
+ #region IDisposable override
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ if (_defaultGraphicsPath != null)
+ {
+ _defaultGraphicsPath.Dispose();
+ _defaultGraphicsPath = null;
+ }
+ if (_pathPoints != null)
+ {
+ _pathPoints.Dispose();
+ _pathPoints = null;
+ }
+
+ }
+ base.Dispose(disposing);
+ }
+ #endregion
+
+ }
+
+ /// <summary>
+ /// <b>PolygonAnnotation</b> is a class that represents a polygon annotation.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributePolygonAnnotation_PolygonAnnotation"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class PolygonAnnotation : PolylineAnnotation
+ {
+ #region Construction and Initialization
+
+ /// <summary>
+ /// Default public constructor.
+ /// </summary>
+ public PolygonAnnotation()
+ : base()
+ {
+ this.isPolygon = true;
+ }
+
+ #endregion
+
+ #region Properties
+
+ #region Non Applicable Annotation Appearance Attributes (set as Non-Browsable)
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// <seealso cref="EndCap"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="LineAnchorCapStyle"/> value.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(LineAnchorCapStyle.None),
+ ]
+ override public LineAnchorCapStyle StartCap
+ {
+ get
+ {
+ return base.StartCap;
+ }
+ set
+ {
+ base.StartCap = value;
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// <seealso cref="StartCap"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="LineAnchorCapStyle"/> value.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(LineAnchorCapStyle.None),
+ ]
+ override public LineAnchorCapStyle EndCap
+ {
+ get
+ {
+ return base.EndCap;
+ }
+ set
+ {
+ base.EndCap = value;
+ }
+ }
+
+ #endregion
+
+ #region Applicable Annotation Appearance Attributes (set as Browsable)
+
+ /// <summary>
+ /// Gets or sets the background color of an annotation.
+ /// <seealso cref="BackSecondaryColor"/>
+ /// <seealso cref="BackHatchStyle"/>
+ /// <seealso cref="BackGradientStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value used for the background of an annotation.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(true),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeBackColor"),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ override public Color BackColor
+ {
+ get
+ {
+ return base.BackColor;
+ }
+ set
+ {
+ base.BackColor = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background hatch style of an annotation.
+ /// <seealso cref="BackSecondaryColor"/>
+ /// <seealso cref="BackColor"/>
+ /// <seealso cref="BackGradientStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="ChartHatchStyle"/> value used for the background of an annotation.
+ /// </value>
+ /// <remarks>
+ /// Two colors are used to draw the hatching, <see cref="BackColor"/> and <see cref="BackSecondaryColor"/>.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(true),
+ DefaultValue(ChartHatchStyle.None),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackHatchStyle"),
+ Editor(Editors.HatchStyleEditor.Editor, Editors.HatchStyleEditor.Base)
+ ]
+ override public ChartHatchStyle BackHatchStyle
+ {
+ get
+ {
+ return base.BackHatchStyle;
+ }
+ set
+ {
+ base.BackHatchStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background gradient style of an annotation.
+ /// <seealso cref="BackSecondaryColor"/>
+ /// <seealso cref="BackColor"/>
+ /// <seealso cref="BackHatchStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="GradientStyle"/> value used for the background of an annotation.
+ /// </value>
+ /// <remarks>
+ /// Two colors are used to draw the gradient, <see cref="BackColor"/> and <see cref="BackSecondaryColor"/>.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(true),
+ DefaultValue(GradientStyle.None),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackGradientStyle"),
+ Editor(Editors.GradientEditor.Editor, Editors.GradientEditor.Base)
+ ]
+ override public GradientStyle BackGradientStyle
+ {
+ get
+ {
+ return base.BackGradientStyle;
+ }
+ set
+ {
+ base.BackGradientStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the secondary background color of an annotation.
+ /// <seealso cref="BackColor"/>
+ /// <seealso cref="BackHatchStyle"/>
+ /// <seealso cref="BackGradientStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value used for the secondary color of an annotation background with
+ /// hatching or gradient fill.
+ /// </value>
+ /// <remarks>
+ /// This color is used with <see cref="BackColor"/> when <see cref="BackHatchStyle"/> or
+ /// <see cref="BackGradientStyle"/> are used.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(true),
+ DefaultValue(typeof(Color), ""),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackSecondaryColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ override public Color BackSecondaryColor
+ {
+ get
+ {
+ return base.BackSecondaryColor;
+ }
+ set
+ {
+ base.BackSecondaryColor = value;
+ }
+ }
+
+ #endregion
+
+ #region Other
+
+ /// <summary>
+ /// Gets or sets an annotation's type name.
+ /// </summary>
+ /// <remarks>
+ /// This property is used to get the name of each annotation type
+ /// (e.g. Line, Rectangle, Ellipse).
+ /// <para>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeAnnotationType"),
+ ]
+ public override string AnnotationType
+ {
+ get
+ {
+ return "Polygon";
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an annotation's selection points style.
+ /// </summary>
+ /// <value>
+ /// A <see cref="SelectionPointsStyle"/> value that represents an annotation's
+ /// selection style.
+ /// </value>
+ /// <remarks>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(SelectionPointsStyle.Rectangle),
+ ParenthesizePropertyNameAttribute(true),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeSelectionPointsStyle"),
+ ]
+ override internal SelectionPointsStyle SelectionPointsStyle
+ {
+ get
+ {
+ return SelectionPointsStyle.Rectangle;
+ }
+ }
+
+ #endregion
+
+ #endregion
+ }
+
+ /// <summary><b>AnnotationPathPointCollection</b> is a collection of polyline
+ /// annotation path points, and is only available via the <b>GraphicsPathPoints</b>
+ /// property at design-time.
+ /// <seealso cref="PolylineAnnotation.GraphicsPathPoints"/></summary>
+ /// <remarks>
+ /// This collection is used at design-time only, and uses serialization to expose the
+ /// shape of the polyline and polygon via their GraphicsPathPoints collection property.
+ /// At run-time, use Path property to set the path of a polyline or polygon
+ /// </remarks>
+ [
+ SRDescription("DescriptionAttributeAnnotationPathPointCollection_AnnotationPathPointCollection"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class AnnotationPathPointCollection : ChartElementCollection<AnnotationPathPoint>
+ {
+ #region Fields
+
+ internal PolylineAnnotation annotation = null;
+ private GraphicsPath _graphicsPath = null;
+
+ #endregion // Fields
+
+ #region Constructors
+
+ /// <summary>
+ /// Default public constructor.
+ /// </summary>
+ public AnnotationPathPointCollection(PolylineAnnotation annotation)
+ : base(annotation)
+ {
+ this.annotation = annotation;
+ }
+
+ #endregion // Constructors
+
+ #region Methods
+
+ /// <summary>
+ /// Forces the invalidation of the chart element
+ /// </summary>
+ public override void Invalidate()
+ {
+ if (this.annotation != null)
+ {
+ //Dispose previously instantiated graphics path
+ if (this._graphicsPath != null)
+ {
+ this._graphicsPath.Dispose();
+ this._graphicsPath = null;
+ }
+
+ // Recreate polyline annotation path
+ if (this.Count > 0)
+ {
+ PointF[] points = new PointF[this.Count];
+ byte[] types = new byte[this.Count];
+ for (int index = 0; index < this.Count; index++)
+ {
+ points[index] = new PointF(this[index].X, this[index].Y);
+ types[index] = this[index].PointType;
+ }
+ this._graphicsPath = new GraphicsPath(points, types);
+ }
+ else
+ {
+ this._graphicsPath = new GraphicsPath();
+ }
+
+ // Invalidate annotation
+ this.annotation.GraphicsPath = this._graphicsPath;
+ this.annotation.Invalidate();
+ }
+ base.Invalidate();
+ }
+
+ #endregion // Methods
+
+ #region IDisposable Members
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ // Free up managed resources
+ if (this._graphicsPath != null)
+ {
+ this._graphicsPath.Dispose();
+ this._graphicsPath = null;
+ }
+ }
+ base.Dispose(disposing);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// The <b>AnnotationPathPoint</b> class represents a path point of a polyline or polygon,
+ /// and is stored in their <b>GraphicsPathPoints</b> property, which is only available at design-time.
+ /// </summary>
+ /// <remarks>
+ /// At run-time, use <b>Path</b> property to set the path of a polyline or polygon.
+ /// </remarks>
+ [
+ SRDescription("DescriptionAttributeAnnotationPathPoint_AnnotationPathPoint"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class AnnotationPathPoint: ChartElement
+ {
+ #region Fields
+
+ // Point X value
+ private float _x = 0f;
+
+ // Point Y value
+ private float _y = 0f;
+
+ // Point type
+ private byte _pointType = 1;
+
+ #endregion // Fields
+
+ #region Constructors
+
+ /// <summary>
+ /// Default public constructor.
+ /// </summary>
+ public AnnotationPathPoint()
+ {
+ }
+
+ /// <summary>
+ /// Constructor that takes X and Y parameters.
+ /// </summary>
+ /// <param name="x">Point's X value.</param>
+ /// <param name="y">Point's Y value.</param>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification="X and Y are cartesian coordinates and well understood")]
+ public AnnotationPathPoint(float x, float y)
+ {
+ this._x = x;
+ this._y = y;
+ }
+
+ /// <summary>
+ /// Constructor that takes X, Y and point type parameters.
+ /// </summary>
+ /// <param name="x">Point's X value.</param>
+ /// <param name="y">Point's Y value.</param>
+ /// <param name="type">Point type.</param>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X and Y are cartesian coordinates and well understood")]
+ public AnnotationPathPoint(float x, float y, byte type)
+ {
+ this._x = x;
+ this._y = y;
+ this._pointType = type;
+ }
+
+ #endregion // Constructors
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets an annotation path point's X coordinate.
+ /// </summary>
+ /// <value>
+ /// A float value for the point's X coordinate.
+ /// </value>
+ [
+ SRCategory("CategoryAttributePosition"),
+ DefaultValue(0f),
+ Browsable(true),
+ SRDescription("DescriptionAttributeAnnotationPathPoint_X"),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+#endif
+ ]
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "X")]
+ public float X
+ {
+ get
+ {
+ return _x;
+ }
+ set
+ {
+ _x = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an annotation path point's Y coordinate.
+ /// </summary>
+ /// <value>
+ /// A float value for the point's Y coordinate.
+ /// </value>
+ [
+ SRCategory("CategoryAttributePosition"),
+ DefaultValue(0f),
+ Browsable(true),
+ SRDescription("DescriptionAttributeAnnotationPathPoint_Y"),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+#endif
+ ]
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Y")]
+ public float Y
+ {
+ get
+ {
+ return _y;
+ }
+ set
+ {
+ _y = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an annotation path point's type.
+ /// </summary>
+ /// <value>
+ /// A byte value.
+ /// </value>
+ /// <remarks>
+ /// See the <see cref="PathPointType"/> enumeration for more details.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributePosition"),
+ DefaultValue(typeof(byte), "1"),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ SRDescription("DescriptionAttributeAnnotationPathPoint_Name"),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+#endif
+ ]
+ public byte PointType
+ {
+ get
+ {
+ return _pointType;
+ }
+ set
+ {
+ _pointType = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an annotation path point's name.
+ /// </summary>
+ /// <para>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </para>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue("PathPoint"),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ SRDescription("DescriptionAttributeAnnotationPathPoint_Name"),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ ]
+ public string Name
+ {
+ get
+ {
+ return "PathPoint";
+ }
+ }
+
+ #endregion // Properties
+
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/RectangleAnnotation.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/RectangleAnnotation.cs
new file mode 100644
index 00000000000..870235e7456
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/RectangleAnnotation.cs
@@ -0,0 +1,722 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: RectangleAnnotation.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: RectangleAnnotation, EllipseAnnotation,
+// Border3DAnnotation
+//
+// Purpose: Rectangle, Ellipse and 3DBorder annotation classes.
+//
+// Reviewed:
+//
+//===================================================================
+
+
+#region Used namespace
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Text;
+using System.Drawing.Drawing2D;
+#if Microsoft_CONTROL
+using System.Windows.Forms.DataVisualization.Charting;
+using System.Windows.Forms.DataVisualization.Charting.Data;
+using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+using System.Windows.Forms.DataVisualization.Charting.Utilities;
+using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+
+#else
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.DataVisualization.Charting;
+using System.Web.UI.DataVisualization.Charting.Data;
+using System.Web.UI.DataVisualization.Charting.Utilities;
+using System.Web.UI.DataVisualization.Charting.Borders3D;
+#endif
+
+
+#endregion
+
+#if Microsoft_CONTROL
+namespace System.Windows.Forms.DataVisualization.Charting
+
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ /// <summary>
+ /// <b>RectangleAnnotation</b> is a class that represents a rectangle annotation.
+ /// </summary>
+ /// <remarks>
+ /// A rectangle annotation can also display text inside the rectangle.
+ /// </remarks>
+ [
+ SRDescription("DescriptionAttributeRectangleAnnotation_RectangleAnnotation"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class RectangleAnnotation : TextAnnotation
+ {
+ #region Fields
+
+ // Indicates that annotion rectangle should be drawn
+ internal bool isRectVisible = true;
+
+ #endregion
+
+ #region Construction and Initialization
+
+ /// <summary>
+ /// Default public constructor.
+ /// </summary>
+ public RectangleAnnotation()
+ : base()
+ {
+ }
+
+ #endregion
+
+ #region Properties
+
+ #region Applicable Annotation Appearance Attributes (set as Browsable)
+
+ /// <summary>
+ /// Gets or sets the color of an annotation line.
+ /// <seealso cref="LineWidth"/>
+ /// <seealso cref="LineDashStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value used to draw an annotation line.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(true),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeLineColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ override public Color LineColor
+ {
+ get
+ {
+ return base.LineColor;
+ }
+ set
+ {
+ base.LineColor = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the width of an annotation line.
+ /// <seealso cref="LineColor"/>
+ /// <seealso cref="LineDashStyle"/>
+ /// </summary>
+ /// <value>
+ /// An integer value defining the width of an annotation line in pixels.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(true),
+ DefaultValue(1),
+ SRDescription("DescriptionAttributeLineWidth"),
+ ]
+ override public int LineWidth
+ {
+ get
+ {
+ return base.LineWidth;
+ }
+ set
+ {
+ base.LineWidth = value;
+
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the style of an annotation line.
+ /// <seealso cref="LineWidth"/>
+ /// <seealso cref="LineColor"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="ChartDashStyle"/> value used to draw an annotation line.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(true),
+ DefaultValue(ChartDashStyle.Solid),
+ SRDescription("DescriptionAttributeLineDashStyle"),
+ ]
+ override public ChartDashStyle LineDashStyle
+ {
+ get
+ {
+ return base.LineDashStyle;
+ }
+ set
+ {
+ base.LineDashStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background color of an annotation.
+ /// <seealso cref="BackSecondaryColor"/>
+ /// <seealso cref="BackHatchStyle"/>
+ /// <seealso cref="BackGradientStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value used for the background of an annotation.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(true),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeBackColor"),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ override public Color BackColor
+ {
+ get
+ {
+ return base.BackColor;
+ }
+ set
+ {
+ base.BackColor = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background hatch style of an annotation.
+ /// <seealso cref="BackSecondaryColor"/>
+ /// <seealso cref="BackColor"/>
+ /// <seealso cref="BackGradientStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="ChartHatchStyle"/> value used for the background of an annotation.
+ /// </value>
+ /// <remarks>
+ /// Two colors are used to draw the hatching, <see cref="BackColor"/> and <see cref="BackSecondaryColor"/>.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(true),
+ DefaultValue(ChartHatchStyle.None),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackHatchStyle"),
+ Editor(Editors.HatchStyleEditor.Editor, Editors.HatchStyleEditor.Base)
+ ]
+ override public ChartHatchStyle BackHatchStyle
+ {
+ get
+ {
+ return base.BackHatchStyle;
+ }
+ set
+ {
+ base.BackHatchStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background gradient style of an annotation.
+ /// <seealso cref="BackSecondaryColor"/>
+ /// <seealso cref="BackColor"/>
+ /// <seealso cref="BackHatchStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="GradientStyle"/> value used for the background of an annotation.
+ /// </value>
+ /// <remarks>
+ /// Two colors are used to draw the gradient, <see cref="BackColor"/> and <see cref="BackSecondaryColor"/>.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(true),
+ DefaultValue(GradientStyle.None),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackGradientStyle"),
+ Editor(Editors.GradientEditor.Editor, Editors.GradientEditor.Base)
+ ]
+ override public GradientStyle BackGradientStyle
+ {
+ get
+ {
+ return base.BackGradientStyle;
+ }
+ set
+ {
+ base.BackGradientStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the secondary background color of an annotation.
+ /// <seealso cref="BackColor"/>
+ /// <seealso cref="BackHatchStyle"/>
+ /// <seealso cref="BackGradientStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value used for the secondary color of an annotation background with
+ /// hatching or gradient fill.
+ /// </value>
+ /// <remarks>
+ /// This color is used with <see cref="BackColor"/> when <see cref="BackHatchStyle"/> or
+ /// <see cref="BackGradientStyle"/> are used.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(true),
+ DefaultValue(typeof(Color), ""),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackSecondaryColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ override public Color BackSecondaryColor
+ {
+ get
+ {
+ return base.BackSecondaryColor;
+ }
+ set
+ {
+ base.BackSecondaryColor = value;
+ }
+ }
+
+ #endregion
+
+ #region Other
+
+ /// <summary>
+ /// Gets or sets an annotation's type name.
+ /// </summary>
+ /// <remarks>
+ /// This property is used to get the name of each annotation type
+ /// (e.g. Line, Rectangle, Ellipse).
+ /// <para>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeAnnotationType"),
+ ]
+ public override string AnnotationType
+ {
+ get
+ {
+ return "Rectangle";
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an annotation's selection points style.
+ /// </summary>
+ /// <value>
+ /// A <see cref="SelectionPointsStyle"/> value that represents the annotation
+ /// selection style.
+ /// </value>
+ /// <remarks>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(SelectionPointsStyle.Rectangle),
+ ParenthesizePropertyNameAttribute(true),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeSelectionPointsStyle"),
+ ]
+ override internal SelectionPointsStyle SelectionPointsStyle
+ {
+ get
+ {
+ return SelectionPointsStyle.Rectangle;
+ }
+ }
+
+ #endregion
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Paints an annotation object on the specified graphics.
+ /// </summary>
+ /// <param name="graphics">
+ /// A <see cref="ChartGraphics"/> object, used to paint an annotation object.
+ /// </param>
+ /// <param name="chart">
+ /// Reference to the <see cref="Chart"/> control.
+ /// </param>
+ override internal void Paint(Chart chart, ChartGraphics graphics)
+ {
+ // Get annotation position in relative coordinates
+ PointF firstPoint = PointF.Empty;
+ PointF anchorPoint = PointF.Empty;
+ SizeF size = SizeF.Empty;
+ GetRelativePosition(out firstPoint, out size, out anchorPoint);
+ PointF secondPoint = new PointF(firstPoint.X + size.Width, firstPoint.Y + size.Height);
+
+ // Create selection rectangle
+ RectangleF selectionRect = new RectangleF(firstPoint, new SizeF(secondPoint.X - firstPoint.X, secondPoint.Y - firstPoint.Y));
+
+ // Get text position
+ RectangleF rectanglePosition = new RectangleF(selectionRect.Location, selectionRect.Size);
+ if(rectanglePosition.Width < 0)
+ {
+ rectanglePosition.X = rectanglePosition.Right;
+ rectanglePosition.Width = -rectanglePosition.Width;
+ }
+ if(rectanglePosition.Height < 0)
+ {
+ rectanglePosition.Y = rectanglePosition.Bottom;
+ rectanglePosition.Height = -rectanglePosition.Height;
+ }
+
+ // Check if position is valid
+ if( float.IsNaN(rectanglePosition.X) ||
+ float.IsNaN(rectanglePosition.Y) ||
+ float.IsNaN(rectanglePosition.Right) ||
+ float.IsNaN(rectanglePosition.Bottom) )
+ {
+ return;
+ }
+
+ if(this.isRectVisible &&
+ this.Common.ProcessModePaint)
+ {
+ // Draw rectangle
+ graphics.FillRectangleRel(
+ rectanglePosition,
+ this.BackColor,
+ this.BackHatchStyle,
+ String.Empty,
+ ChartImageWrapMode.Scaled,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ this.BackGradientStyle,
+ this.BackSecondaryColor,
+ this.LineColor,
+ this.LineWidth,
+ this.LineDashStyle,
+ this.ShadowColor,
+ this.ShadowOffset,
+ PenAlignment.Center,
+ this.isEllipse,
+ 1,
+ false);
+ }
+
+ // Call base class to paint text, selection handles and process hot regions
+ base.Paint(chart, graphics);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// <b>EllipseAnnotation</b> is a class that represents an ellipse annotation.
+ /// </summary>
+ /// <remarks>
+ /// An ellipse annotation can also display text inside the ellipse.
+ /// </remarks>
+ [
+ SRDescription("DescriptionAttributeEllipseAnnotation_EllipseAnnotation"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class EllipseAnnotation : RectangleAnnotation
+ {
+ #region Construction and Initialization
+
+ /// <summary>
+ /// Default public constructor.
+ /// </summary>
+ public EllipseAnnotation()
+ : base()
+ {
+ this.isEllipse = true;
+ }
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets an annotation's type name.
+ /// </summary>
+ /// <remarks>
+ /// This property is used to get the name of each annotation type
+ /// (e.g. Line, Rectangle, Ellipse).
+ /// <para>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeAnnotationType"),
+ ]
+ public override string AnnotationType
+ {
+ get
+ {
+ return "Ellipse";
+ }
+ }
+
+ #endregion
+ }
+
+
+ /// <summary>
+ /// <b>Border3DAnnotation</b> is a class that represents an annotation with a 3D border.
+ /// </summary>
+ /// <remarks>
+ /// A Border3D annotation can also display inner text.
+ /// </remarks>
+ [
+ SRDescription("DescriptionAttributeBorder3DAnnotation_Border3DAnnotation"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class Border3DAnnotation : RectangleAnnotation
+ {
+ #region Fields
+
+ // 3D border properties
+ private BorderSkin _borderSkin;
+
+ #endregion
+
+ #region Construction and Initialization
+
+ /// <summary>
+ /// Default public constructor.
+ /// </summary>
+ public Border3DAnnotation()
+ : base()
+ {
+ this.isRectVisible = false;
+ this._borderSkin = new BorderSkin(this);
+ this._borderSkin.PageColor = Color.Transparent;
+ this._borderSkin.SkinStyle = BorderSkinStyle.Raised;
+
+ // Change default appearance styles
+ this.lineColor = Color.Empty;
+ }
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets an annotation's type name.
+ /// </summary>
+ /// <remarks>
+ /// This property is used to get the name of each annotation type
+ /// (e.g. Line, Rectangle, Ellipse).
+ /// <para>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeAnnotationType"),
+ ]
+ public override string AnnotationType
+ {
+ get
+ {
+ return "Border3D";
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the skin style of the 3D border.
+ /// </summary>
+ /// <value>
+ /// A <see cref="BorderSkin"/>
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(null),
+ SRDescription("DescriptionAttributeBorderSkin"),
+ NotifyParentPropertyAttribute(true),
+ TypeConverterAttribute(typeof(LegendConverter)),
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content)
+ ]
+ public BorderSkin BorderSkin
+ {
+ get
+ {
+ return _borderSkin;
+ }
+ set
+ {
+ _borderSkin = value;
+ this.Invalidate();
+ }
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Paints the annotation object on the specified graphics.
+ /// </summary>
+ /// <param name="graphics">
+ /// A <see cref="ChartGraphics"/>
+ /// </param>
+ /// <param name="chart">
+ /// Reference to the <see cref="Chart"/> control that owns the annotation.
+ /// </param>
+ override internal void Paint(Chart chart, ChartGraphics graphics)
+ {
+ // Get annotation position in relative coordinates
+ PointF firstPoint = PointF.Empty;
+ PointF anchorPoint = PointF.Empty;
+ SizeF size = SizeF.Empty;
+ GetRelativePosition(out firstPoint, out size, out anchorPoint);
+ PointF secondPoint = new PointF(firstPoint.X + size.Width, firstPoint.Y + size.Height);
+
+ // Create selection rectangle
+ RectangleF selectionRect = new RectangleF(firstPoint, new SizeF(secondPoint.X - firstPoint.X, secondPoint.Y - firstPoint.Y));
+
+ // Get text position
+ RectangleF rectanglePosition = new RectangleF(selectionRect.Location, selectionRect.Size);
+ if(rectanglePosition.Width < 0)
+ {
+ rectanglePosition.X = rectanglePosition.Right;
+ rectanglePosition.Width = -rectanglePosition.Width;
+ }
+ if(rectanglePosition.Height < 0)
+ {
+ rectanglePosition.Y = rectanglePosition.Bottom;
+ rectanglePosition.Height = -rectanglePosition.Height;
+ }
+
+ // Check if position is valid
+ if( float.IsNaN(rectanglePosition.X) ||
+ float.IsNaN(rectanglePosition.Y) ||
+ float.IsNaN(rectanglePosition.Right) ||
+ float.IsNaN(rectanglePosition.Bottom) )
+ {
+ return;
+ }
+
+ if(this.Common.ProcessModePaint)
+ {
+ // Do not draw border if size is less that 10 pixels
+ RectangleF absRectanglePosition = graphics.GetAbsoluteRectangle(rectanglePosition);
+ if(absRectanglePosition.Width > 30f &&
+ absRectanglePosition.Height > 30f)
+ {
+ // Draw rectangle
+ graphics.Draw3DBorderRel(
+ _borderSkin,
+ rectanglePosition,
+ this.BackColor,
+ this.BackHatchStyle,
+ String.Empty,
+ ChartImageWrapMode.Scaled,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ this.BackGradientStyle,
+ this.BackSecondaryColor,
+ this.LineColor,
+ this.LineWidth,
+ this.LineDashStyle);
+ }
+ }
+
+ // Call base class to paint text, selection handles and process hot regions
+ base.Paint(chart, graphics);
+ }
+
+ /// <summary>
+ /// Gets text spacing on four different sides in relative coordinates.
+ /// </summary>
+ /// <param name="annotationRelative">Indicates that spacing is in annotation relative coordinates.</param>
+ /// <returns>Rectangle with text spacing values.</returns>
+ internal override RectangleF GetTextSpacing(out bool annotationRelative)
+ {
+ annotationRelative = false;
+ RectangleF rect = new RectangleF(3f, 3f, 3f, 3f);
+ if(GetGraphics() != null)
+ {
+ rect = GetGraphics().GetRelativeRectangle(rect);
+ }
+
+ if(_borderSkin.SkinStyle != BorderSkinStyle.None &&
+ this.GetGraphics() != null &&
+ this.Chart != null &&
+ this.Chart.chartPicture != null &&
+ this.Common != null)
+ {
+ IBorderType border3D = this.Common.BorderTypeRegistry.GetBorderType(_borderSkin.SkinStyle.ToString());
+ if(border3D != null)
+ {
+ // Adjust are position to the border size
+ RectangleF rectangle = new RectangleF(0f, 0f, 100f, 100f);
+ border3D.AdjustAreasPosition(this.GetGraphics(), ref rectangle);
+ rect = new RectangleF(
+ rectangle.X + 1,
+ rectangle.Y + 1,
+ 100f - rectangle.Right + 2,
+ 100f - rectangle.Bottom + 2);
+ }
+ }
+
+ return rect;
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/TextAnnotation.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/TextAnnotation.cs
new file mode 100644
index 00000000000..f53f82c7290
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Annotation/TextAnnotation.cs
@@ -0,0 +1,1263 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: TextAnnotation.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: TextAnnotation, AnnotationSmartLabelStyle
+//
+// Purpose: Text annotation class.
+//
+// Reviewed:
+//
+//===================================================================
+
+#region Used namespace
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Text;
+using System.Drawing.Drawing2D;
+using System.Security;
+
+#if Microsoft_CONTROL
+using System.Windows.Forms;
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+#else
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.DataVisualization.Charting;
+using System.Web.UI.DataVisualization.Charting.Data;
+using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ /// <summary>
+ /// <b>TextAnnotation</b> is a class that represents a text annotation.
+ /// </summary>
+ /// <remarks>
+ /// Note that other annotations do display inner text (e.g. rectangle,
+ /// ellipse annotations.).
+ /// </remarks>
+ [
+ SRDescription("DescriptionAttributeTextAnnotation_TextAnnotation"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class TextAnnotation : Annotation
+ {
+ #region Fields
+
+ // Annotation text
+ private string _text = "";
+
+ // Indicates multiline text
+ private bool _isMultiline = false;
+
+ // Current content size
+ internal SizeF contentSize = SizeF.Empty;
+
+ // Indicates that annotion is an ellipse
+ internal bool isEllipse = false;
+
+#if Microsoft_CONTROL
+
+ // Control used to edit text
+ private TextBox _editTextBox = null;
+
+#endif // Microsoft_CONTROL
+
+ #endregion
+
+ #region Construction and Initialization
+
+ /// <summary>
+ /// Default public constructor.
+ /// </summary>
+ public TextAnnotation()
+ : base()
+ {
+ }
+
+ #endregion
+
+ #region Properties
+
+ #region Text Visual Attributes
+
+ /// <summary>
+ /// Annotation's text.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeText"),
+ ]
+ virtual public string Text
+ {
+ get
+ {
+ return _text;
+ }
+ set
+ {
+ _text = value;
+ Invalidate();
+
+ // Reset content size to empty
+ contentSize = SizeF.Empty;
+ }
+ }
+
+ /// <summary>
+ /// Indicates whether the annotation text is multiline.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeMultiline"),
+ ]
+ virtual public bool IsMultiline
+ {
+ get
+ {
+ return _isMultiline;
+ }
+ set
+ {
+ _isMultiline = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the font of an annotation's text.
+ /// <seealso cref="Annotation.ForeColor"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Font"/> object used for an annotation's text.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(typeof(Font), "Microsoft Sans Serif, 8pt"),
+ SRDescription("DescriptionAttributeTextFont4"),
+ ]
+ override public Font Font
+ {
+ get
+ {
+ return base.Font;
+ }
+ set
+ {
+ base.Font = value;
+
+ // Reset content size to empty
+ contentSize = SizeF.Empty;
+ }
+ }
+
+ #endregion
+
+ #region Non Applicable Annotation Appearance Attributes (set as Non-Browsable)
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(typeof(Color), "Black"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ override public Color LineColor
+ {
+ get
+ {
+ return base.LineColor;
+ }
+ set
+ {
+ base.LineColor = value;
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(1),
+ SRDescription("DescriptionAttributeLineWidth"),
+ ]
+ override public int LineWidth
+ {
+ get
+ {
+ return base.LineWidth;
+ }
+ set
+ {
+ base.LineWidth = value;
+
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(ChartDashStyle.Solid),
+ ]
+ override public ChartDashStyle LineDashStyle
+ {
+ get
+ {
+ return base.LineDashStyle;
+ }
+ set
+ {
+ base.LineDashStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(typeof(Color), ""),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ override public Color BackColor
+ {
+ get
+ {
+ return base.BackColor;
+ }
+ set
+ {
+ base.BackColor = value;
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(ChartHatchStyle.None),
+ NotifyParentPropertyAttribute(true),
+ Editor(Editors.HatchStyleEditor.Editor, Editors.HatchStyleEditor.Base)
+ ]
+ override public ChartHatchStyle BackHatchStyle
+ {
+ get
+ {
+ return base.BackHatchStyle;
+ }
+ set
+ {
+ base.BackHatchStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(GradientStyle.None),
+ NotifyParentPropertyAttribute(true),
+ Editor(Editors.GradientEditor.Editor, Editors.GradientEditor.Base)
+ ]
+ override public GradientStyle BackGradientStyle
+ {
+ get
+ {
+ return base.BackGradientStyle;
+ }
+ set
+ {
+ base.BackGradientStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Not applicable to this annotation type.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ DefaultValue(typeof(Color), ""),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ override public Color BackSecondaryColor
+ {
+ get
+ {
+ return base.BackSecondaryColor;
+ }
+ set
+ {
+ base.BackSecondaryColor = value;
+ }
+ }
+
+ #endregion
+
+ #region Other
+
+ /// <summary>
+ /// Gets or sets an annotation's type name.
+ /// </summary>
+ /// <remarks>
+ /// This property is used to get the name of each annotation type
+ /// (e.g. Line, Rectangle, Ellipse).
+ /// <para>
+ /// This property is for internal use and is hidden at design and run time.
+ /// </para>
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeTextAnnotation_AnnotationType"),
+ ]
+ public override string AnnotationType
+ {
+ get
+ {
+ return "Text";
+ }
+ }
+
+ /// <summary>
+ /// Annotation selection points style.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(SelectionPointsStyle.Rectangle),
+ ParenthesizePropertyNameAttribute(true),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeSelectionPointsStyle"),
+ ]
+ override internal SelectionPointsStyle SelectionPointsStyle
+ {
+ get
+ {
+ return SelectionPointsStyle.Rectangle;
+ }
+ }
+
+ #endregion
+
+ #endregion
+
+ #region Methods
+
+ #region Painting
+
+ /// <summary>
+ /// Paints an annotation object on the specified graphics.
+ /// </summary>
+ /// <param name="graphics">
+ /// A <see cref="ChartGraphics"/> object, used to paint an annotation object.
+ /// </param>
+ /// <param name="chart">
+ /// Reference to the <see cref="Chart"/> owner control.
+ /// </param>
+ override internal void Paint(Chart chart, ChartGraphics graphics)
+ {
+ // Get annotation position in relative coordinates
+ PointF firstPoint = PointF.Empty;
+ PointF anchorPoint = PointF.Empty;
+ SizeF size = SizeF.Empty;
+ GetRelativePosition(out firstPoint, out size, out anchorPoint);
+ PointF secondPoint = new PointF(firstPoint.X + size.Width, firstPoint.Y + size.Height);
+
+ // Create selection rectangle
+ RectangleF selectionRect = new RectangleF(firstPoint, new SizeF(secondPoint.X - firstPoint.X, secondPoint.Y - firstPoint.Y));
+
+ // Get text position
+ RectangleF textPosition = new RectangleF(selectionRect.Location, selectionRect.Size);
+ if(textPosition.Width < 0)
+ {
+ textPosition.X = textPosition.Right;
+ textPosition.Width = -textPosition.Width;
+ }
+ if(textPosition.Height < 0)
+ {
+ textPosition.Y = textPosition.Bottom;
+ textPosition.Height = -textPosition.Height;
+ }
+
+ // Check if text position is valid
+ if( textPosition.IsEmpty ||
+ float.IsNaN(textPosition.X) ||
+ float.IsNaN(textPosition.Y) ||
+ float.IsNaN(textPosition.Right) ||
+ float.IsNaN(textPosition.Bottom) )
+ {
+ return;
+ }
+
+ if(this.Common.ProcessModePaint)
+ {
+ DrawText(graphics, textPosition, false, false);
+ }
+
+ if(this.Common.ProcessModeRegions)
+ {
+ // Add hot region
+ if(isEllipse)
+ {
+ using (GraphicsPath ellipsePath = new GraphicsPath())
+ {
+ ellipsePath.AddEllipse(textPosition);
+ this.Common.HotRegionsList.AddHotRegion(
+ graphics,
+ ellipsePath,
+ true,
+ ReplaceKeywords(this.ToolTip),
+#if Microsoft_CONTROL
+ String.Empty,
+ String.Empty,
+ String.Empty,
+#else // Microsoft_CONTROL
+ ReplaceKeywords(this.Url),
+ ReplaceKeywords(this.MapAreaAttributes),
+ ReplaceKeywords(this.PostBackValue),
+#endif // Microsoft_CONTROL
+ this,
+ ChartElementType.Annotation);
+ }
+ }
+ else
+ {
+ this.Common.HotRegionsList.AddHotRegion(
+ textPosition,
+ ReplaceKeywords(this.ToolTip),
+#if Microsoft_CONTROL
+ String.Empty,
+ String.Empty,
+ String.Empty,
+#else // Microsoft_CONTROL
+ ReplaceKeywords(this.Url),
+ ReplaceKeywords(this.MapAreaAttributes),
+ ReplaceKeywords(this.PostBackValue),
+#endif // Microsoft_CONTROL
+ this,
+ ChartElementType.Annotation,
+ String.Empty);
+ }
+ }
+
+ // Paint selection handles
+ PaintSelectionHandles(graphics, selectionRect, null);
+ }
+
+ /// <summary>
+ /// Draws text in specified rectangle.
+ /// </summary>
+ /// <param name="graphics">Chart graphics.</param>
+ /// <param name="textPosition">Text position.</param>
+ /// <param name="noSpacingForCenteredText">True if text allowed to be outside of position when centered.</param>
+ /// <param name="getTextPosition">True if position text must be returned by the method.</param>
+ /// <returns>Text actual position if required.</returns>
+ internal RectangleF DrawText(ChartGraphics graphics, RectangleF textPosition, bool noSpacingForCenteredText, bool getTextPosition)
+ {
+ RectangleF textActualPosition = RectangleF.Empty;
+
+ //***************************************************************
+ //** Adjust text position uing text spacing
+ //***************************************************************
+ bool annotationRelative = false;
+ RectangleF textSpacing = GetTextSpacing(out annotationRelative);
+ float spacingScaleX = 1f;
+ float spacingScaleY = 1f;
+ if(annotationRelative)
+ {
+ if(textPosition.Width > 25f)
+ {
+ spacingScaleX = textPosition.Width / 50f;
+ spacingScaleX = Math.Max(1f, spacingScaleX);
+ }
+ if(textPosition.Height > 25f)
+ {
+ spacingScaleY = textPosition.Height / 50f;
+ spacingScaleY = Math.Max(1f, spacingScaleY);
+ }
+ }
+
+ RectangleF textPositionWithSpacing = new RectangleF(textPosition.Location, textPosition.Size);
+ textPositionWithSpacing.Width -= (textSpacing.Width + textSpacing.X) * spacingScaleX;
+ textPositionWithSpacing.X += textSpacing.X * spacingScaleX;
+ textPositionWithSpacing.Height -= (textSpacing.Height + textSpacing.Y) * spacingScaleY;
+ textPositionWithSpacing.Y += textSpacing.Y * spacingScaleY;
+
+ //***************************************************************
+ //** Replace new line characters
+ //***************************************************************
+ string titleText = this.ReplaceKeywords(this.Text.Replace("\\n", "\n"));
+
+ //***************************************************************
+ //** Check if centered text require spacing.
+ //** Use only half of the spacing required.
+ //** Apply only for 1 line of text.
+ //***************************************************************
+ if(noSpacingForCenteredText &&
+ titleText.IndexOf('\n') == -1)
+ {
+ if(this.Alignment == ContentAlignment.MiddleCenter ||
+ this.Alignment == ContentAlignment.MiddleLeft ||
+ this.Alignment == ContentAlignment.MiddleRight)
+ {
+ textPositionWithSpacing.Y = textPosition.Y;
+ textPositionWithSpacing.Height = textPosition.Height;
+ textPositionWithSpacing.Height -= textSpacing.Height/2f + textSpacing.Y / 2f;
+ textPositionWithSpacing.Y += textSpacing.Y / 2f;
+ }
+ if(this.Alignment == ContentAlignment.BottomCenter ||
+ this.Alignment == ContentAlignment.MiddleCenter ||
+ this.Alignment == ContentAlignment.TopCenter)
+ {
+ textPositionWithSpacing.X = textPosition.X;
+ textPositionWithSpacing.Width = textPosition.Width;
+ textPositionWithSpacing.Width -= textSpacing.Width/2f + textSpacing.X / 2f;
+ textPositionWithSpacing.X += textSpacing.X / 2f;
+ }
+ }
+
+ // Draw text
+ using( Brush textBrush = new SolidBrush(this.ForeColor) )
+ {
+ using (StringFormat format = new StringFormat(StringFormat.GenericTypographic))
+ {
+ //***************************************************************
+ //** Set text format
+ //***************************************************************
+ format.FormatFlags = format.FormatFlags ^ StringFormatFlags.LineLimit;
+ format.Trimming = StringTrimming.EllipsisCharacter;
+ if (this.Alignment == ContentAlignment.BottomRight ||
+ this.Alignment == ContentAlignment.MiddleRight ||
+ this.Alignment == ContentAlignment.TopRight)
+ {
+ format.Alignment = StringAlignment.Far;
+ }
+ if (this.Alignment == ContentAlignment.BottomCenter ||
+ this.Alignment == ContentAlignment.MiddleCenter ||
+ this.Alignment == ContentAlignment.TopCenter)
+ {
+ format.Alignment = StringAlignment.Center;
+ }
+ if (this.Alignment == ContentAlignment.BottomCenter ||
+ this.Alignment == ContentAlignment.BottomLeft ||
+ this.Alignment == ContentAlignment.BottomRight)
+ {
+ format.LineAlignment = StringAlignment.Far;
+ }
+ if (this.Alignment == ContentAlignment.MiddleCenter ||
+ this.Alignment == ContentAlignment.MiddleLeft ||
+ this.Alignment == ContentAlignment.MiddleRight)
+ {
+ format.LineAlignment = StringAlignment.Center;
+ }
+
+ //***************************************************************
+ //** Set shadow color and offset
+ //***************************************************************
+ Color textShadowColor = ChartGraphics.GetGradientColor(this.ForeColor, Color.Black, 0.8);
+ int textShadowOffset = 1;
+ TextStyle textStyle = this.TextStyle;
+ if (textStyle == TextStyle.Shadow &&
+ ShadowOffset != 0)
+ {
+ // Draw shadowed text
+ textShadowColor = ShadowColor;
+ textShadowOffset = ShadowOffset;
+ }
+
+ if (textStyle == TextStyle.Shadow)
+ {
+ textShadowColor = (textShadowColor.A != 255) ? textShadowColor : Color.FromArgb(textShadowColor.A / 2, textShadowColor);
+ }
+
+ //***************************************************************
+ //** Get text actual position
+ //***************************************************************
+ if (getTextPosition)
+ {
+ // Measure text size
+ SizeF textSize = graphics.MeasureStringRel(
+ this.ReplaceKeywords(_text.Replace("\\n", "\n")),
+ this.Font,
+ textPositionWithSpacing.Size,
+ format);
+
+ // Get text position
+ textActualPosition = new RectangleF(textPositionWithSpacing.Location, textSize);
+ if (this.Alignment == ContentAlignment.BottomRight ||
+ this.Alignment == ContentAlignment.MiddleRight ||
+ this.Alignment == ContentAlignment.TopRight)
+ {
+ textActualPosition.X += textPositionWithSpacing.Width - textSize.Width;
+ }
+ if (this.Alignment == ContentAlignment.BottomCenter ||
+ this.Alignment == ContentAlignment.MiddleCenter ||
+ this.Alignment == ContentAlignment.TopCenter)
+ {
+ textActualPosition.X += (textPositionWithSpacing.Width - textSize.Width) / 2f;
+ }
+ if (this.Alignment == ContentAlignment.BottomCenter ||
+ this.Alignment == ContentAlignment.BottomLeft ||
+ this.Alignment == ContentAlignment.BottomRight)
+ {
+ textActualPosition.Y += textPositionWithSpacing.Height - textSize.Height;
+ }
+ if (this.Alignment == ContentAlignment.MiddleCenter ||
+ this.Alignment == ContentAlignment.MiddleLeft ||
+ this.Alignment == ContentAlignment.MiddleRight)
+ {
+ textActualPosition.Y += (textPositionWithSpacing.Height - textSize.Height) / 2f;
+ }
+
+ // Do not allow text to go outside annotation position
+ textActualPosition.Intersect(textPositionWithSpacing);
+ }
+
+ RectangleF absPosition = graphics.GetAbsoluteRectangle(textPositionWithSpacing);
+ Title.DrawStringWithStyle(
+ graphics,
+ titleText,
+ this.TextStyle,
+ this.Font,
+ absPosition,
+ this.ForeColor,
+ textShadowColor,
+ textShadowOffset,
+ format,
+ TextOrientation.Auto
+ );
+ }
+ }
+
+ return textActualPosition;
+ }
+
+ #endregion // Painting
+
+ #region Text Editing
+
+#if Microsoft_CONTROL
+
+ /// <summary>
+ /// Stops editing of the annotation text.
+ /// <seealso cref="BeginTextEditing"/>
+ /// </summary>
+ /// <remarks>
+ /// Call this method to cancel text editing, which was started via a call to
+ /// the <see cref="BeginTextEditing"/> method, or after the end-user double-clicks
+ /// on the annotation.
+ /// </remarks>
+ public void StopTextEditing()
+ {
+ // Check if text is currently edited
+ if(_editTextBox != null)
+ {
+ // Set annotation text
+ this.Text = _editTextBox.Text;
+
+ // Remove and dispose the text box
+ try
+ {
+ _editTextBox.KeyDown -= new KeyEventHandler(OnTextBoxKeyDown);
+ _editTextBox.LostFocus -= new EventHandler(OnTextBoxLostFocus);
+ }
+ catch(SecurityException)
+ {
+ // Ignore security issues
+ }
+
+ if(this.Chart.Controls.Contains(_editTextBox))
+ {
+ TextBox tempControl = null;
+ try
+ {
+ // NOTE: Workaround .Net bug. Issue with appplication closing if
+ // active control is removed.
+ Form parentForm = this.Chart.FindForm();
+ if(parentForm != null)
+ {
+ tempControl = new TextBox();
+ tempControl.Visible = false;
+
+ // Add temp. control as active
+ parentForm.Controls.Add(tempControl);
+ parentForm.ActiveControl = tempControl;
+ }
+ }
+ catch(SecurityException)
+ {
+ // Ignore security issues
+ }
+
+ // Remove text editor
+ this.Chart.Controls.Remove(_editTextBox);
+
+ // Dispose temp. text box
+ if(tempControl != null)
+ {
+ tempControl.Dispose();
+ }
+ }
+
+ // Dispose edit box
+ _editTextBox.Dispose();
+ _editTextBox = null;
+
+ // Raise notification event
+ if(this.Chart != null)
+ {
+ this.Chart.OnAnnotationTextChanged(this);
+ }
+
+ // Update chart
+ if(this.Chart != null)
+ {
+ this.Chart.Invalidate();
+ this.Chart.Update();
+ }
+
+ }
+ }
+
+ /// <summary>
+ /// Handles event when focus is lost by the text editing control.
+ /// </summary>
+ /// <param name="sender">Event sender.</param>
+ /// <param name="e">Event arguments.</param>
+ private void OnTextBoxLostFocus(object sender, EventArgs e)
+ {
+ StopTextEditing();
+ }
+
+ /// <summary>
+ /// Handles event when key is pressed in the text editing control.
+ /// </summary>
+ /// <param name="sender">Event sender.</param>
+ /// <param name="e">Event arguments.</param>
+ private void OnTextBoxKeyDown(object sender, KeyEventArgs e)
+ {
+ if(e.KeyCode == Keys.Escape)
+ {
+ // Reset text and stop editing
+ _editTextBox.Text = this.Text;
+ StopTextEditing();
+ }
+ else if(e.KeyCode == Keys.Enter &&
+ this.IsMultiline == false)
+ {
+ // Stop editing
+ StopTextEditing();
+ }
+ }
+
+ /// <summary>
+ /// Begins editing the annotation's text by an end user.
+ /// <seealso cref="StopTextEditing"/>
+ /// </summary>
+ /// <remarks>
+ /// After calling this method, the annotation displays an editing box which allows
+ /// for editing of the annotation's text.
+ /// <para>
+ /// Call the <see cref="StopTextEditing"/> method to cancel this mode programatically.
+ /// Note that editing ends when the end-user hits the <c>Enter</c> key if multi-line
+ /// is false, or when the end-user clicks outside of the editing box if multi-line is true.
+ /// </para>
+ /// </remarks>
+ public void BeginTextEditing()
+ {
+
+ if(this.Chart != null && this.AllowTextEditing)
+ {
+ // Dispose previous text box
+ if(_editTextBox != null)
+ {
+ if(this.Chart.Controls.Contains(_editTextBox))
+ {
+ this.Chart.Controls.Remove(_editTextBox);
+ }
+ _editTextBox.Dispose();
+ _editTextBox = null;
+ }
+
+ // Create a text box inside the chart
+ _editTextBox = new TextBox();
+ _editTextBox.Text = this.Text;
+ _editTextBox.Multiline = this.IsMultiline;
+ _editTextBox.Font = this.Font;
+ _editTextBox.BorderStyle = BorderStyle.FixedSingle;
+ _editTextBox.BackColor = Color.FromArgb(255, (this.BackColor.IsEmpty) ? Color.White : this.BackColor);
+ _editTextBox.ForeColor = Color.FromArgb(255, this.ForeColor);
+
+ // Calculate text position in relative coordinates
+ PointF firstPoint = PointF.Empty;
+ PointF anchorPoint = PointF.Empty;
+ SizeF size = SizeF.Empty;
+ GetRelativePosition(out firstPoint, out size, out anchorPoint);
+ PointF secondPoint = new PointF(firstPoint.X + size.Width, firstPoint.Y + size.Height);
+ RectangleF textPosition = new RectangleF(firstPoint, new SizeF(secondPoint.X - firstPoint.X, secondPoint.Y - firstPoint.Y));
+ if(textPosition.Width < 0)
+ {
+ textPosition.X = textPosition.Right;
+ textPosition.Width = -textPosition.Width;
+ }
+ if(textPosition.Height < 0)
+ {
+ textPosition.Y = textPosition.Bottom;
+ textPosition.Height = -textPosition.Height;
+ }
+
+ // Set text control position in pixels
+ if(GetGraphics() != null)
+ {
+ // Convert point to relative coordinates
+ textPosition = GetGraphics().GetAbsoluteRectangle(textPosition);
+ }
+
+ // Adjust Location and Size
+ if(this.IsMultiline)
+ {
+ textPosition.X -= 1;
+ textPosition.Y -= 1;
+ textPosition.Width += 2;
+ textPosition.Height += 2;
+ }
+ else
+ {
+ textPosition.Y += textPosition.Height / 2f - _editTextBox.Size.Height / 2f;
+ }
+ _editTextBox.Location = Point.Round(textPosition.Location);
+ _editTextBox.Size = Size.Round(textPosition.Size);
+
+ // Add control to the chart
+ this.Chart.Controls.Add(_editTextBox);
+ try
+ {
+ _editTextBox.SelectAll();
+ _editTextBox.Focus();
+ }
+ catch(SecurityException)
+ {
+ // Ignore security issues
+ }
+
+ try
+ {
+ // Set text box event hanlers
+ _editTextBox.KeyDown += new KeyEventHandler(OnTextBoxKeyDown);
+ _editTextBox.LostFocus += new EventHandler(OnTextBoxLostFocus);
+ }
+ catch(SecurityException)
+ {
+ // Ignore security issues
+ }
+ }
+ }
+
+#endif // Microsoft_CONTROL
+
+ #endregion // Text Editing
+
+ #region Content Size
+
+ /// <summary>
+ /// Gets text annotation content size based on the text and font.
+ /// </summary>
+ /// <returns>Annotation content position.</returns>
+ override internal RectangleF GetContentPosition()
+ {
+ // Return pre calculated value
+ if(!contentSize.IsEmpty)
+ {
+ return new RectangleF(float.NaN, float.NaN, contentSize.Width, contentSize.Height);
+ }
+
+ // Create temporary bitmap based chart graphics if chart was not
+ // rendered yet and the graphics was not created.
+ // NOTE: Fix for issue #3978.
+ Graphics graphics = null;
+System.Drawing.Image graphicsImage = null;
+ ChartGraphics tempChartGraph = null;
+ if(GetGraphics() == null && this.Common != null)
+ {
+ graphicsImage = new System.Drawing.Bitmap(Common.ChartPicture.Width, Common.ChartPicture.Height);
+ graphics = Graphics.FromImage( graphicsImage );
+ tempChartGraph = new ChartGraphics( Common );
+ tempChartGraph.Graphics = graphics;
+ tempChartGraph.SetPictureSize( Common.ChartPicture.Width, Common.ChartPicture.Height );
+ this.Common.graph = tempChartGraph;
+ }
+
+ // Calculate content size
+ RectangleF result = RectangleF.Empty;
+ if(GetGraphics() != null && this.Text.Trim().Length > 0)
+ {
+ // Measure text using current font and slightly increase it
+ contentSize = GetGraphics().MeasureString(
+ "W" + this.ReplaceKeywords(this.Text.Replace("\\n", "\n")),
+ this.Font,
+ new SizeF(2000, 2000),
+ StringFormat.GenericTypographic);
+
+ contentSize.Height *= 1.04f;
+
+ // Convert to relative coordinates
+ contentSize = GetGraphics().GetRelativeSize(contentSize);
+
+ // Add spacing
+ bool annotationRelative = false;
+ RectangleF textSpacing = GetTextSpacing(out annotationRelative);
+ float spacingScaleX = 1f;
+ float spacingScaleY = 1f;
+ if(annotationRelative)
+ {
+ if(contentSize.Width > 25f)
+ {
+ spacingScaleX = contentSize.Width / 25f;
+ spacingScaleX = Math.Max(1f, spacingScaleX);
+ }
+ if(contentSize.Height > 25f)
+ {
+ spacingScaleY = contentSize.Height / 25f;
+ spacingScaleY = Math.Max(1f, spacingScaleY);
+ }
+ }
+
+ contentSize.Width += (textSpacing.X + textSpacing.Width) * spacingScaleX;
+ contentSize.Height += (textSpacing.Y + textSpacing.Height) * spacingScaleY;
+
+ result = new RectangleF(float.NaN, float.NaN, contentSize.Width, contentSize.Height);
+ }
+
+ // Dispose temporary chart graphics
+ if(tempChartGraph != null)
+ {
+ tempChartGraph.Dispose();
+ graphics.Dispose();
+ graphicsImage.Dispose();
+ this.Common.graph = null;
+ }
+
+ return result;
+ }
+
+ /// <summary>
+ /// Gets text spacing on four different sides in relative coordinates.
+ /// </summary>
+ /// <param name="annotationRelative">Indicates that spacing is in annotation relative coordinates.</param>
+ /// <returns>Rectangle with text spacing values.</returns>
+ internal virtual RectangleF GetTextSpacing(out bool annotationRelative)
+ {
+ annotationRelative = false;
+ RectangleF rect = new RectangleF(3f, 3f, 3f, 3f);
+ if(GetGraphics() != null)
+ {
+ rect = GetGraphics().GetRelativeRectangle(rect);
+ }
+ return rect;
+ }
+
+ #endregion
+
+ #region Placement Methods
+
+#if Microsoft_CONTROL
+
+ /// <summary>
+ /// Ends user placement of an annotation.
+ /// </summary>
+ /// <remarks>
+ /// Ends an annotation placement operation previously started by a
+ /// <see cref="Annotation.BeginPlacement"/> method call.
+ /// <para>
+ /// Calling this method is not required, since placement will automatically
+ /// end when an end user enters all required points. However, it is useful when an annotation
+ /// placement operation needs to be aborted for some reason.
+ /// </para>
+ /// </remarks>
+ override public void EndPlacement()
+ {
+ // Check if text editing is allowed
+ // Maybe changed later in the EndPlacement method.
+ bool allowTextEditing = this.AllowTextEditing;
+
+ // Call base class
+ base.EndPlacement();
+
+ // Begin text editing
+ if(this.Chart != null)
+ {
+ this.Chart.Annotations.lastClickedAnnotation = this;
+ if(allowTextEditing)
+ {
+ BeginTextEditing();
+ }
+ }
+ }
+
+#endif // Microsoft_CONTROL
+
+ #endregion // Placement Methods
+
+ #endregion // Methods
+ }
+
+ /// <summary>
+ /// The <b>AnnotationSmartLabelStyle</b> class is used to store an annotation's smart
+ /// labels properties.
+ /// <seealso cref="Annotation.SmartLabelStyle"/>
+ /// </summary>
+ /// <remarks>
+ /// This class is derived from the <b>SmartLabelStyle</b> class
+ /// used for <b>Series</b> objects.
+ /// </remarks>
+ [
+ DefaultProperty("Enabled"),
+ SRDescription("DescriptionAttributeAnnotationSmartLabelsStyle_AnnotationSmartLabelsStyle"),
+ TypeConverter(typeof(NoNameExpandableObjectConverter)),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class AnnotationSmartLabelStyle : SmartLabelStyle
+ {
+ #region Constructors and initialization
+
+ /// <summary>
+ /// Default public constructor.
+ /// </summary>
+ public AnnotationSmartLabelStyle()
+ {
+ this.chartElement = null;
+ }
+
+ /// <summary>
+ /// Constructor.
+ /// </summary>
+ /// <param name="chartElement">
+ /// Chart element this style belongs to.
+ /// </param>
+ public AnnotationSmartLabelStyle(Object chartElement) : base(chartElement)
+ {
+ }
+
+ #endregion
+
+ #region Non Applicable Appearance Attributes (set as Non-Browsable)
+
+
+ /// <summary>
+ /// Callout style of the repositioned smart labels.
+ /// </summary>
+ /// <remarks>
+ /// This method is for internal use and is hidden at design time and runtime.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DefaultValue(LabelCalloutStyle.Underlined),
+ SRDescription("DescriptionAttributeCalloutStyle3"),
+ ]
+ override public LabelCalloutStyle CalloutStyle
+ {
+ get
+ {
+ return base.CalloutStyle;
+ }
+ set
+ {
+ base.CalloutStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Label callout line color.
+ /// </summary>
+ /// <remarks>
+ /// This method is for internal use and is hidden at design and run time.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeCalloutLineColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ override public Color CalloutLineColor
+ {
+ get
+ {
+ return base.CalloutLineColor;
+ }
+ set
+ {
+ base.CalloutLineColor = value;
+ }
+ }
+
+ /// <summary>
+ /// Label callout line style.
+ /// </summary>
+ /// <remarks>
+ /// This method is for internal use and is hidden at design and run time.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DefaultValue(ChartDashStyle.Solid),
+ SRDescription("DescriptionAttributeLineDashStyle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ override public ChartDashStyle CalloutLineDashStyle
+ {
+ get
+ {
+ return base.CalloutLineDashStyle;
+ }
+ set
+ {
+ base.CalloutLineDashStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Label callout back color. Applies to the Box style only.
+ /// </summary>
+ /// <remarks>
+ /// This method is for internal use and is hidden at design and run time.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DefaultValue(typeof(Color), "Transparent"),
+ SRDescription("DescriptionAttributeCalloutBackColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ override public Color CalloutBackColor
+ {
+ get
+ {
+ return base.CalloutBackColor;
+ }
+ set
+ {
+ base.CalloutBackColor = value;
+ }
+ }
+
+ /// <summary>
+ /// Label callout line width.
+ /// </summary>
+ /// <remarks>
+ /// This method is for internal use and is hidden at design and run time.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DefaultValue(1),
+ SRDescription("DescriptionAttributeLineWidth"),
+ ]
+ override public int CalloutLineWidth
+ {
+ get
+ {
+ return base.CalloutLineWidth;
+ }
+ set
+ {
+ base.CalloutLineWidth = value;
+ }
+ }
+
+ /// <summary>
+ /// Label callout line anchor cap.
+ /// </summary>
+ /// <remarks>
+ /// This method is for internal use and is hidden at design and run time.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DefaultValue(LineAnchorCapStyle.Arrow),
+ SRDescription("DescriptionAttributeCalloutLineAnchorCapStyle"),
+ ]
+ override public LineAnchorCapStyle CalloutLineAnchorCapStyle
+ {
+ get
+ {
+ return base.CalloutLineAnchorCapStyle;
+ }
+ set
+ {
+ base.CalloutLineAnchorCapStyle = value;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Borders3D/Borders3D.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Borders3D/Borders3D.cs
new file mode 100644
index 00000000000..64c6d557582
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Borders3D/Borders3D.cs
@@ -0,0 +1,784 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: Borders3D.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+// System.Web.UI.WebControls[Windows.Forms].Charting.Borders3D
+//
+// Classes: BorderTypeRegistry, IBorderType, BorderSkin
+//
+// Purpose: 3D borders related classes:
+// BorderTypeRegistry - known borders registry.
+// IBorderType - border class interface.
+// BorderSkin - border visual properties.
+//
+// Reviewed: AG - August 7, 2002
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Drawing.Design;
+using System.Collections;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Resources;
+using System.Reflection;
+using System.IO;
+using System.Drawing.Imaging;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+
+using System.Windows.Forms.Design;
+#else
+ using System.Web.UI;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+
+#endregion
+
+#if Microsoft_CONTROL
+namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ #region Border style enumeration
+
+ /// <summary>
+ /// Styles of the border skin.
+ /// </summary>
+ public enum BorderSkinStyle
+ {
+ /// <summary>
+ /// Border not used.
+ /// </summary>
+ None,
+ /// <summary>
+ /// Emboss border.
+ /// </summary>
+ Emboss,
+ /// <summary>
+ /// Raised border.
+ /// </summary>
+ Raised,
+ /// <summary>
+ /// Sunken border.
+ /// </summary>
+ Sunken,
+ /// <summary>
+ /// Thin border with rounded corners.
+ /// </summary>
+ FrameThin1,
+ /// <summary>
+ /// Thin border with rounded top corners.
+ /// </summary>
+ FrameThin2,
+ /// <summary>
+ /// Thin border with square corners.
+ /// </summary>
+ FrameThin3,
+ /// <summary>
+ /// Thin border with square outside corners and rounded inside corners.
+ /// </summary>
+ FrameThin4,
+ /// <summary>
+ /// Thin border with rounded corners and ----s.
+ /// </summary>
+ FrameThin5,
+ /// <summary>
+ /// Thin border with square inside corners and rounded outside corners.
+ /// </summary>
+ FrameThin6,
+ /// <summary>
+ /// Border with rounded corners. Supports title text.
+ /// </summary>
+ FrameTitle1,
+ /// <summary>
+ /// Border with rounded top corners. Supports title text.
+ /// </summary>
+ FrameTitle2,
+ /// <summary>
+ /// Border with square corners. Supports title text.
+ /// </summary>
+ FrameTitle3,
+ /// <summary>
+ /// Border with rounded inside corners and square outside corners. Supports title text.
+ /// </summary>
+ FrameTitle4,
+ /// <summary>
+ /// Border with rounded corners and ----s. Supports title text.
+ /// </summary>
+ FrameTitle5,
+ /// <summary>
+ /// Border with rounded outside corners and square inside corners. Supports title text.
+ /// </summary>
+ FrameTitle6,
+ /// <summary>
+ /// Border with rounded corners. No border on the right side. Supports title text.
+ /// </summary>
+ FrameTitle7,
+ /// <summary>
+ /// Border with rounded corners on top and bottom sides only. Supports title text.
+ /// </summary>
+ FrameTitle8
+ }
+
+ #endregion
+
+ /// <summary>
+ /// Drawing properties of the 3D border skin.
+ /// </summary>
+ [
+ DefaultProperty("SkinStyle"),
+ SRDescription("DescriptionAttributeBorderSkin_BorderSkin"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class BorderSkin : ChartElement
+ {
+ #region Fields
+
+ // Private data members, which store properties values
+ private Color _pageColor = Color.White;
+ private BorderSkinStyle _skinStyle = BorderSkinStyle.None;
+ private GradientStyle _backGradientStyle = GradientStyle.None;
+ private Color _backSecondaryColor = Color.Empty;
+ private Color _backColor = Color.Gray;
+ private string _backImage = "";
+ private ChartImageWrapMode _backImageWrapMode = ChartImageWrapMode.Tile;
+ private Color _backImageTransparentColor = Color.Empty;
+ private ChartImageAlignmentStyle _backImageAlignment = ChartImageAlignmentStyle.TopLeft;
+ private Color _borderColor = Color.Black;
+ private int _borderWidth = 1;
+ private ChartDashStyle _borderDashStyle = ChartDashStyle.NotSet;
+ private ChartHatchStyle _backHatchStyle = ChartHatchStyle.None;
+
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// Default public constructor.
+ /// </summary>
+ public BorderSkin() : base()
+ {
+ }
+
+ /// <summary>
+ /// Constructor.
+ /// </summary>
+ /// <param name="parent">The parent chart element.</param>
+ internal BorderSkin(IChartElement parent) : base (parent)
+ {
+ }
+
+ #endregion
+
+ #region Border skin properties
+
+ /// <summary>
+ /// Gets or sets the page color of a border skin.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ NotifyParentPropertyAttribute(true),
+ DefaultValue(typeof(Color), "White"),
+ SRDescription("DescriptionAttributeBorderSkin_PageColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color PageColor
+ {
+ get
+ {
+ return _pageColor;
+ }
+ set
+ {
+ _pageColor = value;
+ this.Invalidate();
+ }
+ }
+
+
+ /// <summary>
+ /// Gets or sets the style of a border skin.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ NotifyParentPropertyAttribute(true),
+ DefaultValue(BorderSkinStyle.None),
+ SRDescription("DescriptionAttributeBorderSkin_SkinStyle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ ParenthesizePropertyNameAttribute(true)
+ ]
+ public BorderSkinStyle SkinStyle
+ {
+ get
+ {
+ return _skinStyle;
+ }
+ set
+ {
+ _skinStyle = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background color of a skin frame.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ NotifyParentPropertyAttribute(true),
+ DefaultValue(typeof(Color), "Gray"),
+ SRDescription("DescriptionAttributeFrameBackColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BackColor
+ {
+ get
+ {
+ return _backColor;
+ }
+ set
+ {
+ _backColor = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the border color of a skin frame.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ NotifyParentPropertyAttribute(true),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeBorderColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BorderColor
+ {
+ get
+ {
+ return _borderColor;
+ }
+ set
+ {
+ _borderColor = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background hatch style of a skin frame.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ NotifyParentPropertyAttribute(true),
+ DefaultValue(ChartHatchStyle.None),
+ SRDescription("DescriptionAttributeFrameBackHatchStyle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ Editor(Editors.HatchStyleEditor.Editor, Editors.HatchStyleEditor.Base)
+ ]
+ public ChartHatchStyle BackHatchStyle
+ {
+ get
+ {
+ return _backHatchStyle;
+ }
+ set
+ {
+ _backHatchStyle = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background image of a skin frame.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ NotifyParentPropertyAttribute(true),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeBackImage"),
+ Editor(Editors.ImageValueEditor.Editor, Editors.ImageValueEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ ]
+ public string BackImage
+ {
+ get
+ {
+ return _backImage;
+ }
+ set
+ {
+ _backImage = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the drawing mode for the background image of a skin frame.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ NotifyParentPropertyAttribute(true),
+ DefaultValue(ChartImageWrapMode.Tile),
+ SRDescription("DescriptionAttributeImageWrapMode"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public ChartImageWrapMode BackImageWrapMode
+ {
+ get
+ {
+ return _backImageWrapMode;
+ }
+ set
+ {
+ _backImageWrapMode = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a color which will be replaced with a transparent color
+ /// while drawing the background image of a skin frame.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ NotifyParentPropertyAttribute(true),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeImageTransparentColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BackImageTransparentColor
+ {
+ get
+ {
+ return _backImageTransparentColor;
+ }
+ set
+ {
+ _backImageTransparentColor = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background image alignment of a skin frame.
+ /// </summary>
+ /// <remarks>
+ /// Used by ClampUnscale drawing mode.
+ /// </remarks>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ NotifyParentPropertyAttribute(true),
+ DefaultValue(ChartImageAlignmentStyle.TopLeft),
+ SRDescription("DescriptionAttributeBackImageAlign"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public ChartImageAlignmentStyle BackImageAlignment
+ {
+ get
+ {
+ return _backImageAlignment;
+ }
+ set
+ {
+ _backImageAlignment = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background gradient style of a skin frame.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ NotifyParentPropertyAttribute(true),
+ DefaultValue(GradientStyle.None),
+ SRDescription("DescriptionAttributeBackGradientStyle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ Editor(Editors.GradientEditor.Editor, Editors.GradientEditor.Base)
+ ]
+ public GradientStyle BackGradientStyle
+ {
+ get
+ {
+ return _backGradientStyle;
+ }
+ set
+ {
+ _backGradientStyle = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the secondary background color of a skin frame.
+ /// </summary>
+ /// <remarks>
+ /// This color is used with <see cref="BackColor"/> when <see cref="BackHatchStyle"/> or
+ /// <see cref="BackGradientStyle"/> are used.
+ /// </remarks>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ NotifyParentPropertyAttribute(true),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeBorderSkin_FrameBackSecondaryColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BackSecondaryColor
+ {
+ get
+ {
+ return _backSecondaryColor;
+ }
+ set
+ {
+ _backSecondaryColor = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the width of the border line of a skin frame.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ NotifyParentPropertyAttribute(true),
+ DefaultValue(1),
+ SRDescription("DescriptionAttributeBorderSkin_FrameBorderWidth"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public int BorderWidth
+ {
+ get
+ {
+ return _borderWidth;
+ }
+ set
+ {
+ if(value < 0)
+ {
+ throw(new ArgumentOutOfRangeException("value", SR.ExceptionBorderWidthIsNotPositive));
+ }
+ _borderWidth = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the style of the border line of a skin frame.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ NotifyParentPropertyAttribute(true),
+ DefaultValue(ChartDashStyle.NotSet),
+ SRDescription("DescriptionAttributeBorderSkin_FrameBorderDashStyle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public ChartDashStyle BorderDashStyle
+ {
+ get
+ {
+ return _borderDashStyle;
+ }
+ set
+ {
+ _borderDashStyle = value;
+ this.Invalidate();
+ }
+ }
+
+ #endregion
+ }
+}
+
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.Borders3D
+#else
+ namespace System.Web.UI.DataVisualization.Charting.Borders3D
+#endif
+{
+ /// <summary>
+ /// Keep track of all registered 3D borders.
+ /// </summary>
+ internal class BorderTypeRegistry : IServiceProvider
+ {
+ #region Fields
+
+ // Border types image resource manager
+ private ResourceManager _resourceManager = null;
+
+ // Storage for all registered border types
+ internal Hashtable registeredBorderTypes = new Hashtable(StringComparer.OrdinalIgnoreCase);
+ private Hashtable _createdBorderTypes = new Hashtable(StringComparer.OrdinalIgnoreCase);
+
+ #endregion
+
+ #region Constructors and services
+
+ /// <summary>
+ /// Border types registry public constructor
+ /// </summary>
+ public BorderTypeRegistry()
+ {
+ }
+
+ /// <summary>
+ /// Returns border type registry service object
+ /// </summary>
+ /// <param name="serviceType">Service type to get.</param>
+ /// <returns>Border registry service.</returns>
+ [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+ object IServiceProvider.GetService(Type serviceType)
+ {
+ if(serviceType == typeof(BorderTypeRegistry))
+ {
+ return this;
+ }
+ throw (new ArgumentException( SR.ExceptionBorderTypeRegistryUnsupportedType( serviceType.ToString()) ));
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Adds 3D border type into the registry.
+ /// </summary>
+ /// <param name="name">Border type name.</param>
+ /// <param name="borderType">Border class type.</param>
+ public void Register(string name, Type borderType)
+ {
+ // First check if border type with specified name already registered
+ if(registeredBorderTypes.Contains(name))
+ {
+ // If same type provided - ignore
+ if(registeredBorderTypes[name].GetType() == borderType)
+ {
+ return;
+ }
+
+ // Error - throw exception
+ throw (new ArgumentException(SR.ExceptionBorderTypeNameIsNotUnique( name ) ) );
+ }
+
+ // Make sure that specified class support IBorderType interface
+ bool found = false;
+ Type[] interfaces = borderType.GetInterfaces();
+ foreach(Type type in interfaces)
+ {
+ if(type == typeof(IBorderType))
+ {
+ found = true;
+ break;
+ }
+ }
+ if(!found)
+ {
+ throw (new ArgumentException(SR.ExceptionBorderTypeHasNoInterface ));
+ }
+
+ // Add border type to the hash table
+ registeredBorderTypes[name] = borderType;
+ }
+
+ /// <summary>
+ /// Returns border type object by name.
+ /// </summary>
+ /// <param name="name">Border type name.</param>
+ /// <returns>Border type object derived from IBorderType.</returns>
+ public IBorderType GetBorderType(string name)
+ {
+ // First check if border type with specified name registered
+ if(!registeredBorderTypes.Contains(name))
+ {
+ throw( new ArgumentException( SR.ExceptionBorderTypeUnknown( name ) ) );
+ }
+
+ // Check if the border type object is already created
+ if(!_createdBorderTypes.Contains(name))
+ {
+ // Create border type object
+ _createdBorderTypes[name] =
+ ((Type)registeredBorderTypes[name]).Assembly.
+ CreateInstance(((Type)registeredBorderTypes[name]).ToString());
+ }
+
+ return (IBorderType)_createdBorderTypes[name];
+ }
+
+ /// <summary>
+ /// Border images resource manager.
+ /// </summary>
+ public ResourceManager ResourceManager
+ {
+ get
+ {
+ // Create border images resource manager
+ if(_resourceManager == null)
+ {
+ _resourceManager = new ResourceManager("System.Web.UI.DataVisualization.Charting", Assembly.GetExecutingAssembly());
+ }
+ return _resourceManager;
+ }
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Interface which defines the set of standard methods and
+ /// properties for each border type.
+ /// </summary>
+ internal interface IBorderType
+ {
+ #region Properties and Method
+
+ /// <summary>
+ /// Border type name.
+ /// </summary>
+ string Name { get; }
+
+ /// <summary>
+ /// Sets/Gets the resolution to draw with;
+ /// </summary>
+ float Resolution
+ {
+ set;
+ }
+ /// <summary>
+ /// Draws 3D border.
+ /// </summary>
+ /// <param name="graph">Graphics to draw the border on.</param>
+ /// <param name="borderSkin">Border skin object.</param>
+ /// <param name="rect">Rectangle of the border.</param>
+ /// <param name="backColor">Color of rectangle.</param>
+ /// <param name="backHatchStyle">Hatch style.</param>
+ /// <param name="backImage">Back Image.</param>
+ /// <param name="backImageWrapMode">Image mode.</param>
+ /// <param name="backImageTransparentColor">Image transparent color.</param>
+ /// <param name="backImageAlign">Image alignment.</param>
+ /// <param name="backGradientStyle">Gradient type.</param>
+ /// <param name="backSecondaryColor">Gradient End Color.</param>
+ /// <param name="borderColor">Border Color.</param>
+ /// <param name="borderWidth">Border Width.</param>
+ /// <param name="borderDashStyle">Border Style.</param>
+ void DrawBorder(
+ ChartGraphics graph,
+ BorderSkin borderSkin,
+ RectangleF rect,
+ Color backColor,
+ ChartHatchStyle backHatchStyle,
+ string backImage,
+ ChartImageWrapMode backImageWrapMode,
+ Color backImageTransparentColor,
+ ChartImageAlignmentStyle backImageAlign,
+ GradientStyle backGradientStyle,
+ Color backSecondaryColor,
+ Color borderColor,
+ int borderWidth,
+ ChartDashStyle borderDashStyle);
+
+ /// <summary>
+ /// Adjust areas rectangle coordinate to fit the 3D border.
+ /// </summary>
+ /// <param name="graph">Graphics to draw the border on.</param>
+ /// <param name="areasRect">Position to adjust.</param>
+ void AdjustAreasPosition(ChartGraphics graph, ref RectangleF areasRect);
+
+ /// <summary>
+ /// Returns the position of the rectangular area in the border where
+ /// title should be displayed. Returns empty rect if title can't be shown in the border.
+ /// </summary>
+ /// <returns>Title position in border.</returns>
+ RectangleF GetTitlePositionInBorder();
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Borders3D/EmbedBorder.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Borders3D/EmbedBorder.cs
new file mode 100644
index 00000000000..6ce5917298b
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Borders3D/EmbedBorder.cs
@@ -0,0 +1,1102 @@
+//-------------------------------------------------------------
+// <copyright company=�Microsoft Corporation�>
+// Copyright � Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: EmbedBorder.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting.Borders3D
+//
+// Classes: EmbedBorder, FrameTitle1Border, FrameTitle2Border,
+// FrameTitle3Border, FrameTitle4Border, FrameTitle5Border,
+// FrameTitle6Border, FrameTitle7Border, FrameTitle8Border,
+// FrameThin2Border, FrameThin3Border, FrameThin4Border,
+// FrameThin5Border, FrameThin6Border, FrameThin1Border,
+// RaisedBorder, SunkenBorder
+//
+// Purpose: Classes that implement different 3D border styles.
+//
+// Reviewed: AG - August 7, 2002
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Resources;
+using System.Reflection;
+using System.Collections;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.ComponentModel.Design;
+
+#if WINFORMS_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+
+#else
+ using System.Web.UI.DataVisualization.Charting; using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if WINFORMS_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.Borders3D
+#else
+ namespace System.Web.UI.DataVisualization.Charting.Borders3D
+#endif
+{
+ /// <summary>
+ /// Implements frame border.
+ /// </summary>
+ internal class FrameTitle1Border : FrameThin1Border
+ {
+ #region Border properties and methods
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public FrameTitle1Border()
+ {
+ sizeLeftTop = new SizeF(sizeLeftTop.Width, defaultRadiusSize*2f);
+ }
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ public override string Name { get{ return "FrameTitle1";}}
+
+
+ public override float Resolution
+ {
+ set
+ {
+ base.Resolution = value;
+ sizeLeftTop = new SizeF(sizeLeftTop.Width, defaultRadiusSize * 2f);
+ }
+ }
+ /// <summary>
+ /// Returns the position of the rectangular area in the border where
+ /// title should be displayed. Returns empty rect if title can't be shown in the border.
+ /// </summary>
+ /// <returns>Title position in border.</returns>
+ public override RectangleF GetTitlePositionInBorder()
+ {
+ return new RectangleF(
+ defaultRadiusSize * 0.25f,
+ defaultRadiusSize * 0.25f,
+ defaultRadiusSize * 0.25f,
+ defaultRadiusSize * 1.6f);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Implements frame border.
+ /// </summary>
+ internal class FrameTitle2Border : FrameThin2Border
+ {
+ #region Border properties and methods
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public FrameTitle2Border()
+ {
+ sizeLeftTop = new SizeF(sizeLeftTop.Width, defaultRadiusSize*2f);
+ }
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ public override string Name { get{ return "FrameTitle2";}}
+
+
+ public override float Resolution
+ {
+ set
+ {
+ base.Resolution = value;
+ sizeLeftTop = new SizeF(sizeLeftTop.Width, defaultRadiusSize * 2f);
+ }
+ }
+
+ /// <summary>
+ /// Returns the position of the rectangular area in the border where
+ /// title should be displayed. Returns empty rect if title can't be shown in the border.
+ /// </summary>
+ /// <returns>Title position in border.</returns>
+ public override RectangleF GetTitlePositionInBorder()
+ {
+ return new RectangleF(
+ defaultRadiusSize * 0.25f,
+ defaultRadiusSize * 0.25f,
+ defaultRadiusSize * 0.25f,
+ defaultRadiusSize * 1.6f);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Implements frame border.
+ /// </summary>
+ internal class FrameTitle3Border : FrameThin3Border
+ {
+ #region Border properties and methods
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public FrameTitle3Border()
+ {
+ sizeLeftTop = new SizeF(sizeLeftTop.Width, defaultRadiusSize*2f);
+ }
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ public override string Name { get{ return "FrameTitle3";}}
+
+
+ public override float Resolution
+ {
+ set
+ {
+ base.Resolution = value;
+ sizeLeftTop = new SizeF(sizeLeftTop.Width, defaultRadiusSize * 2f);
+ }
+ }
+
+ /// <summary>
+ /// Returns the position of the rectangular area in the border where
+ /// title should be displayed. Returns empty rect if title can't be shown in the border.
+ /// </summary>
+ /// <returns>Title position in border.</returns>
+ public override RectangleF GetTitlePositionInBorder()
+ {
+ return new RectangleF(
+ defaultRadiusSize * 0.25f,
+ defaultRadiusSize * 0.25f,
+ defaultRadiusSize * 0.25f,
+ defaultRadiusSize * 1.6f);
+ }
+ #endregion
+ }
+
+ /// <summary>
+ /// Implements frame border.
+ /// </summary>
+ internal class FrameTitle4Border : FrameThin4Border
+ {
+ #region Border properties and methods
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public FrameTitle4Border()
+ {
+ sizeLeftTop = new SizeF(sizeLeftTop.Width, defaultRadiusSize*2f);
+ }
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ public override string Name { get{ return "FrameTitle4";}}
+
+
+ public override float Resolution
+ {
+ set
+ {
+ base.Resolution = value;
+ sizeLeftTop = new SizeF(sizeLeftTop.Width, defaultRadiusSize * 2f);
+ }
+ }
+
+ /// <summary>
+ /// Returns the position of the rectangular area in the border where
+ /// title should be displayed. Returns empty rect if title can't be shown in the border.
+ /// </summary>
+ /// <returns>Title position in border.</returns>
+ public override RectangleF GetTitlePositionInBorder()
+ {
+ return new RectangleF(
+ defaultRadiusSize * 0.25f,
+ defaultRadiusSize * 0.25f,
+ defaultRadiusSize * 0.25f,
+ defaultRadiusSize * 1.6f);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Implements frame border.
+ /// </summary>
+ internal class FrameTitle5Border : FrameThin5Border
+ {
+ #region Border properties and methods
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public FrameTitle5Border()
+ {
+ sizeLeftTop = new SizeF(sizeLeftTop.Width, defaultRadiusSize*2f);
+ this.drawScrews = true;
+ }
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ public override string Name { get{ return "FrameTitle5";}}
+
+
+ public override float Resolution
+ {
+ set
+ {
+ base.Resolution = value;
+ sizeLeftTop = new SizeF(sizeLeftTop.Width, defaultRadiusSize * 2f);
+ }
+ }
+
+ /// <summary>
+ /// Returns the position of the rectangular area in the border where
+ /// title should be displayed. Returns empty rect if title can't be shown in the border.
+ /// </summary>
+ /// <returns>Title position in border.</returns>
+ public override RectangleF GetTitlePositionInBorder()
+ {
+ return new RectangleF(
+ defaultRadiusSize * 0.25f,
+ defaultRadiusSize * 0.25f,
+ defaultRadiusSize * 0.25f,
+ defaultRadiusSize * 1.6f);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Implements frame border.
+ /// </summary>
+ internal class FrameTitle6Border : FrameThin6Border
+ {
+ #region Border properties and methods
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public FrameTitle6Border()
+ {
+ sizeLeftTop = new SizeF(sizeLeftTop.Width, defaultRadiusSize*2f);
+ }
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ public override string Name { get{ return "FrameTitle6";}}
+
+ public override float Resolution
+ {
+ set
+ {
+ base.Resolution = value;
+ sizeLeftTop = new SizeF(sizeLeftTop.Width, defaultRadiusSize * 2f);
+ }
+ }
+
+ /// <summary>
+ /// Returns the position of the rectangular area in the border where
+ /// title should be displayed. Returns empty rect if title can't be shown in the border.
+ /// </summary>
+ /// <returns>Title position in border.</returns>
+ public override RectangleF GetTitlePositionInBorder()
+ {
+ return new RectangleF(
+ defaultRadiusSize * 0.25f,
+ defaultRadiusSize * 0.25f,
+ defaultRadiusSize * 0.25f,
+ defaultRadiusSize * 1.6f);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Implements frame border.
+ /// </summary>
+ internal class FrameTitle7Border : FrameTitle1Border
+ {
+ #region Border properties and methods
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public FrameTitle7Border()
+ {
+ this.sizeRightBottom = new SizeF(0, sizeRightBottom.Height);
+ float[] corners = {15f, 1f, 1f, 1f, 1f, 15f, 15f, 15f};
+ innerCorners = corners;
+ }
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ public override string Name { get{ return "FrameTitle7";}}
+
+
+ public override float Resolution
+ {
+ set
+ {
+ base.Resolution = value;
+ this.sizeRightBottom = new SizeF(0, sizeRightBottom.Height);
+ float largeRadius = 15f * resolution / 96.0f;
+ float smallRadius = 1 * resolution / 96.0f;
+ float[] corners = { largeRadius, smallRadius, smallRadius, smallRadius, smallRadius, largeRadius, largeRadius, largeRadius };
+ innerCorners = corners;
+ }
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Implements frame border.
+ /// </summary>
+ internal class FrameTitle8Border : FrameTitle1Border
+ {
+ #region Border properties and methods
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public FrameTitle8Border()
+ {
+ this.sizeLeftTop = new SizeF(0, sizeLeftTop.Height);
+ this.sizeRightBottom = new SizeF(0, sizeRightBottom.Height);
+ float[] corners = {1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f};
+ innerCorners = corners;
+ }
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ public override string Name { get{ return "FrameTitle8";}}
+
+
+ public override float Resolution
+ {
+ set
+ {
+ base.Resolution = value;
+
+ this.sizeLeftTop = new SizeF(0, sizeLeftTop.Height);
+ this.sizeRightBottom = new SizeF(0, sizeRightBottom.Height);
+ float radius = 1 * resolution / 96.0f;
+ float[] corners = { radius, radius, radius, radius, radius, radius, radius, radius };
+ innerCorners = corners;
+ }
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Implements frame border.
+ /// </summary>
+ internal class FrameThin2Border : FrameThin1Border
+ {
+ #region Border properties and methods
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public FrameThin2Border()
+ {
+ float[] corners = {15f, 15f, 15f, 1f, 1f, 1f, 1f, 15f};
+ cornerRadius = corners;
+ innerCorners = corners;
+ }
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ public override string Name { get{ return "FrameThin2";}}
+
+
+ public override float Resolution
+ {
+ set
+ {
+ base.Resolution = value;
+
+ float largeRadius = 15f * resolution / 96.0f;
+ float smallRadius = 1 * resolution / 96.0f;
+ float[] corners = { largeRadius, largeRadius, largeRadius, smallRadius, smallRadius, smallRadius, smallRadius, largeRadius };
+ cornerRadius = corners;
+ innerCorners = corners;
+ }
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Implements frame border.
+ /// </summary>
+ internal class FrameThin3Border : FrameThin1Border
+ {
+ #region Border properties and methods
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public FrameThin3Border()
+ {
+ float[] corners = {1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f};
+ cornerRadius = corners;
+ innerCorners = corners;
+ }
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ public override string Name { get{ return "FrameThin3";}}
+
+
+ public override float Resolution
+ {
+ set
+ {
+ base.Resolution = value;
+ float radius = resolution / 96.0f;
+ float[] corners = { radius, radius, radius, radius, radius, radius, radius, radius };
+ cornerRadius = corners;
+ innerCorners = corners;
+ }
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Implements frame border.
+ /// </summary>
+ internal class FrameThin4Border : FrameThin1Border
+ {
+ #region Border properties and methods
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public FrameThin4Border()
+ {
+ float[] corners = {1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f};
+ cornerRadius = corners;
+ }
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ public override string Name { get{ return "FrameThin4";}}
+
+
+ public override float Resolution
+ {
+ set
+ {
+ base.Resolution = value;
+ float radius = 1f * resolution / 96.0f;
+ cornerRadius = new float[] { radius, radius, radius, radius, radius, radius, radius, radius };
+ }
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Implements frame border.
+ /// </summary>
+ internal class FrameThin5Border : FrameThin1Border
+ {
+ #region Border properties and methods
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public FrameThin5Border()
+ {
+ drawScrews = true;
+ }
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ public override string Name { get{ return "FrameThin5";}}
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Implements frame border.
+ /// </summary>
+ internal class FrameThin6Border : FrameThin1Border
+ {
+ #region Border properties and methods
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public FrameThin6Border()
+ {
+ float[] corners = {1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f};
+ innerCorners = corners;
+ }
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ public override string Name { get{ return "FrameThin6";}}
+
+
+ public override float Resolution
+ {
+ set
+ {
+ base.Resolution = value;
+ float radius = resolution / 96.0f;
+ float[] corners = { radius, radius, radius, radius, radius, radius, radius, radius };
+ innerCorners = corners;
+ }
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Implements frame border.
+ /// </summary>
+ internal class FrameThin1Border : RaisedBorder
+ {
+ #region Border properties and methods
+
+ /// <summary>
+ /// Inner corners radius array
+ /// </summary>
+ internal float[] innerCorners = { 15f, 15f, 15f, 15f, 15f, 15f, 15f, 15f };
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public FrameThin1Border()
+ {
+ sizeLeftTop = new SizeF(defaultRadiusSize * .8f, defaultRadiusSize * .8f);
+ sizeRightBottom = new SizeF(defaultRadiusSize * .8f, defaultRadiusSize * .8f);
+ }
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ public override string Name { get{ return "FrameThin1";}}
+
+
+ public override float Resolution
+ {
+ set
+ {
+ base.Resolution = value;
+ float radius = 15.0f * resolution / 96.0f;
+ innerCorners = new float[] { radius, radius, radius, radius, radius, radius, radius, radius };
+ sizeLeftTop = new SizeF(defaultRadiusSize * .8f, defaultRadiusSize * .8f);
+ sizeRightBottom = new SizeF(defaultRadiusSize * .8f, defaultRadiusSize * .8f);
+
+ }
+ }
+
+ /// <summary>
+ /// Draws 3D border.
+ /// </summary>
+ /// <param name="graph">Graphics to draw the border on.</param>
+ /// <param name="borderSkin">Border skin object.</param>
+ /// <param name="rect">Rectangle of the border.</param>
+ /// <param name="backColor">Color of rectangle</param>
+ /// <param name="backHatchStyle">Hatch style</param>
+ /// <param name="backImage">Back Image</param>
+ /// <param name="backImageWrapMode">Image mode</param>
+ /// <param name="backImageTransparentColor">Image transparent color.</param>
+ /// <param name="backImageAlign">Image alignment</param>
+ /// <param name="backGradientStyle">Gradient type</param>
+ /// <param name="backSecondaryColor">Gradient End Color</param>
+ /// <param name="borderColor">Border Color</param>
+ /// <param name="borderWidth">Border Width</param>
+ /// <param name="borderDashStyle">Border Style</param>
+ public override void DrawBorder(
+ ChartGraphics graph,
+ BorderSkin borderSkin,
+ RectangleF rect,
+ Color backColor,
+ ChartHatchStyle backHatchStyle,
+ string backImage,
+ ChartImageWrapMode backImageWrapMode,
+ Color backImageTransparentColor,
+ ChartImageAlignmentStyle backImageAlign,
+ GradientStyle backGradientStyle,
+ Color backSecondaryColor,
+ Color borderColor,
+ int borderWidth,
+ ChartDashStyle borderDashStyle)
+ {
+ drawBottomShadow = true;
+ sunken = false;
+ outsideShadowRate = .9f;
+ drawOutsideTopLeftShadow = false;
+ bool oldScrewsFlag = this.drawScrews;
+ this.drawScrews = false;
+ base.DrawBorder(
+ graph,
+ borderSkin,
+ rect,
+ borderSkin.BackColor,
+ borderSkin.BackHatchStyle,
+ borderSkin.BackImage,
+ borderSkin.BackImageWrapMode,
+ borderSkin.BackImageTransparentColor,
+ borderSkin.BackImageAlignment,
+ borderSkin.BackGradientStyle,
+ borderSkin.BackSecondaryColor,
+ borderSkin.BorderColor,
+ borderSkin.BorderWidth,
+ borderSkin.BorderDashStyle);
+
+ this.drawScrews = oldScrewsFlag;
+ rect.X += sizeLeftTop.Width;
+ rect.Y += sizeLeftTop.Height;
+ rect.Width -= sizeRightBottom.Width + sizeLeftTop.Width;
+ rect.Height -= sizeRightBottom.Height + sizeLeftTop.Height;
+ if(rect.Width > 0 && rect.Height > 0 )
+ {
+ float[] oldCorners = new float[8];
+ oldCorners = (float[])cornerRadius.Clone();
+ cornerRadius = innerCorners;
+ drawBottomShadow = false;
+ sunken = true;
+ drawOutsideTopLeftShadow = true;
+ outsideShadowRate = 1.4f;
+ Color oldPageColor = borderSkin.PageColor;
+ borderSkin.PageColor = Color.Transparent;
+ base.DrawBorder(
+ graph,
+ borderSkin,
+ rect,
+ backColor,
+ backHatchStyle,
+ backImage,
+ backImageWrapMode,
+ backImageTransparentColor,
+ backImageAlign,
+ backGradientStyle,
+ backSecondaryColor,
+ borderColor,
+ borderWidth,
+ borderDashStyle );
+ borderSkin.PageColor = oldPageColor;
+ cornerRadius = oldCorners;
+ }
+ }
+
+ #endregion
+ }
+
+
+ /// <summary>
+ /// Implements raised border.
+ /// </summary>
+ internal class RaisedBorder : SunkenBorder
+ {
+ #region Border properties and methods
+
+ /// <summary>
+ /// Public constructor
+ /// </summary>
+ public RaisedBorder()
+ {
+ sunken = false;
+ }
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ public override string Name { get{ return "Raised";}}
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Implements embed 3D border.
+ /// </summary>
+ internal class SunkenBorder : IBorderType
+ {
+ #region Border properties and methods
+
+ /// <summary>
+ /// Radius for rounded rectangle
+ /// </summary>
+ internal float defaultRadiusSize = 15f;
+
+ /// <summary>
+ /// Outside shadow rate
+ /// </summary>
+ internal float outsideShadowRate = .9f;
+
+ /// <summary>
+ /// Indicates that sunken shadows should be drawn
+ /// </summary>
+ internal bool sunken = true;
+
+ /// <summary>
+ /// Indicates that bottom shadow should be drawn
+ /// </summary>
+ internal bool drawBottomShadow = true;
+
+ /// <summary>
+ /// Indicates that top left outside dark shadow must be drawn
+ /// </summary>
+ internal bool drawOutsideTopLeftShadow = false;
+
+ /// <summary>
+ /// Array of corner radius
+ /// </summary>
+ internal float[] cornerRadius = { 15f, 15f, 15f, 15f, 15f, 15f, 15f, 15f };
+
+ /// <summary>
+ /// Border top/left size
+ /// </summary>
+ internal SizeF sizeLeftTop = SizeF.Empty;
+
+ /// <summary>
+ /// Border right/bottom size
+ /// </summary>
+ internal SizeF sizeRightBottom = SizeF.Empty;
+
+ /// <summary>
+ /// Indicates that ----s should be drawn in the corners of the frame
+ /// </summary>
+ internal bool drawScrews = false;
+
+
+ internal float resolution = 96f;
+
+
+ /// <summary>
+ /// Public constructor
+ /// </summary>
+ public SunkenBorder()
+ {
+ }
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ public virtual string Name { get{ return "Sunken";}}
+
+
+ public virtual float Resolution
+ {
+ set
+ {
+ resolution = value;
+ defaultRadiusSize = 15 * resolution / 96;
+ //X = defaultRadiusSize;
+ //Y = defaultRadiusSize;
+ cornerRadius = new float[] { defaultRadiusSize, defaultRadiusSize, defaultRadiusSize, defaultRadiusSize, defaultRadiusSize, defaultRadiusSize, defaultRadiusSize, defaultRadiusSize };
+ }
+ }
+
+ /// <summary>
+ /// Returns the position of the rectangular area in the border where
+ /// title should be displayed. Returns empty rect if title can't be shown in the border.
+ /// </summary>
+ /// <returns>Title position in border.</returns>
+ public virtual RectangleF GetTitlePositionInBorder()
+ {
+ return RectangleF.Empty;
+ }
+
+ /// <summary>
+ /// Adjust areas rectangle coordinate to fit the 3D border
+ /// </summary>
+ /// <param name="graph">Graphics to draw the border on.</param>
+ /// <param name="areasRect">Position to adjust.</param>
+ public virtual void AdjustAreasPosition(ChartGraphics graph, ref RectangleF areasRect)
+ {
+ SizeF relSizeLeftTop = new SizeF(sizeLeftTop);
+ SizeF relSizeRightBottom = new SizeF(sizeRightBottom);
+ relSizeLeftTop.Width += defaultRadiusSize * 0.7f;
+ relSizeLeftTop.Height += defaultRadiusSize * 0.85f;
+ relSizeRightBottom.Width += defaultRadiusSize * 0.7f;
+ relSizeRightBottom.Height += defaultRadiusSize * 0.7f;
+ relSizeLeftTop = graph.GetRelativeSize(relSizeLeftTop);
+ relSizeRightBottom = graph.GetRelativeSize(relSizeRightBottom);
+
+ if(relSizeLeftTop.Width > 30f)
+ relSizeLeftTop.Width = 0;
+ if(relSizeLeftTop.Height > 30f)
+ relSizeLeftTop.Height = 0;
+ if(relSizeRightBottom.Width > 30f)
+ relSizeRightBottom.Width = 0;
+ if(relSizeRightBottom.Height > 30f)
+ relSizeRightBottom.Height = 0;
+
+
+ areasRect.X += relSizeLeftTop.Width;
+ areasRect.Width -= (float)Math.Min(areasRect.Width, relSizeLeftTop.Width + relSizeRightBottom.Width);
+ areasRect.Y += relSizeLeftTop.Height;
+ areasRect.Height -= (float)Math.Min(areasRect.Height, relSizeLeftTop.Height + relSizeRightBottom.Height);
+
+ if(areasRect.Right > 100f)
+ {
+ if(areasRect.Width > 100f - areasRect.Right)
+ areasRect.Width -= 100f - areasRect.Right;
+ else
+ areasRect.X -= 100f - areasRect.Right;
+ }
+ if(areasRect.Bottom > 100f)
+ {
+ if(areasRect.Height > 100f - areasRect.Bottom)
+ areasRect.Height -= 100f - areasRect.Bottom;
+ else
+ areasRect.Y -= 100f - areasRect.Bottom;
+
+ }
+ }
+
+ /// <summary>
+ /// Draws 3D border
+ /// </summary>
+ /// <param name="graph">Graphics to draw the border on.</param>
+ /// <param name="borderSkin">Border skin object.</param>
+ /// <param name="rect">Rectangle of the border.</param>
+ /// <param name="backColor">Color of rectangle</param>
+ /// <param name="backHatchStyle">Hatch style</param>
+ /// <param name="backImage">Back Image</param>
+ /// <param name="backImageWrapMode">Image mode</param>
+ /// <param name="backImageTransparentColor">Image transparent color.</param>
+ /// <param name="backImageAlign">Image alignment</param>
+ /// <param name="backGradientStyle">Gradient type</param>
+ /// <param name="backSecondaryColor">Gradient End Color</param>
+ /// <param name="borderColor">Border Color</param>
+ /// <param name="borderWidth">Border Width</param>
+ /// <param name="borderDashStyle">Border Style</param>
+ public virtual void DrawBorder(
+ ChartGraphics graph,
+ BorderSkin borderSkin,
+ RectangleF rect,
+ Color backColor,
+ ChartHatchStyle backHatchStyle,
+ string backImage,
+ ChartImageWrapMode backImageWrapMode,
+ Color backImageTransparentColor,
+ ChartImageAlignmentStyle backImageAlign,
+ GradientStyle backGradientStyle,
+ Color backSecondaryColor,
+ Color borderColor,
+ int borderWidth,
+ ChartDashStyle borderDashStyle)
+ {
+ RectangleF absolute = graph.Round( rect );
+ RectangleF shadowRect = absolute;
+
+ // Calculate shadow colors (0.2 - 0.6)
+ float colorDarkeningIndex = 0.3f + (0.4f * (borderSkin.PageColor.R + borderSkin.PageColor.G + borderSkin.PageColor.B) / 765f);
+ Color shadowColor = Color.FromArgb(
+ (int)(backColor.R*colorDarkeningIndex),
+ (int)(backColor.G*colorDarkeningIndex),
+ (int)(backColor.B*colorDarkeningIndex));
+
+ colorDarkeningIndex += 0.2f;
+ Color shadowLightColor = Color.FromArgb(
+ (int)(borderSkin.PageColor.R*colorDarkeningIndex),
+ (int)(borderSkin.PageColor.G*colorDarkeningIndex),
+ (int)(borderSkin.PageColor.B*colorDarkeningIndex));
+ if(borderSkin.PageColor == Color.Transparent)
+ {
+ shadowLightColor = Color.FromArgb(60, 0, 0, 0);
+ }
+
+ // Calculate rounded rect radius
+ float radius = defaultRadiusSize;
+ radius = (float)Math.Max(radius, 2f * resolution / 96.0f);
+ radius = (float)Math.Min(radius, rect.Width/2f);
+ radius = (float)Math.Min(radius, rect.Height/2f);
+ radius = (float)Math.Ceiling(radius);
+
+ // Fill page background color
+ using (Brush brush = new SolidBrush(borderSkin.PageColor))
+ {
+ graph.FillRectangle(brush, rect);
+ }
+
+ if(drawOutsideTopLeftShadow)
+ {
+ // Top/Left outside shadow
+ shadowRect = absolute;
+ shadowRect.X -= radius * 0.3f;
+ shadowRect.Y -= radius * 0.3f;
+ shadowRect.Width -= radius * .3f;
+ shadowRect.Height -= radius * .3f;
+ graph.DrawRoundedRectShadowAbs(shadowRect, cornerRadius, radius, Color.FromArgb(128, Color.Black), borderSkin.PageColor, outsideShadowRate);
+ }
+
+ // Bottom/Right outside shadow
+ shadowRect = absolute;
+ shadowRect.X += radius * 0.3f;
+ shadowRect.Y += radius * 0.3f;
+ shadowRect.Width -= radius * .3f;
+ shadowRect.Height -= radius * .3f;
+ graph.DrawRoundedRectShadowAbs(shadowRect, cornerRadius, radius, shadowLightColor, borderSkin.PageColor, outsideShadowRate);
+
+ // Background
+ shadowRect = absolute;
+ shadowRect.Width -= radius * .3f;
+ shadowRect.Height -= radius * .3f;
+ GraphicsPath path = graph.CreateRoundedRectPath(shadowRect, cornerRadius);
+ graph.DrawPathAbs(
+ path,
+ backColor,
+ backHatchStyle,
+ backImage,
+ backImageWrapMode,
+ backImageTransparentColor,
+ backImageAlign,
+ backGradientStyle,
+ backSecondaryColor,
+ borderColor,
+ borderWidth,
+ borderDashStyle,
+ PenAlignment.Inset );
+
+ // Dispose Graphic path
+ if( path != null )
+ path.Dispose();
+
+ // Draw ----s imitation in the corners of the farame
+ if(drawScrews)
+ {
+ // Left/Top ----
+ RectangleF screwRect = RectangleF.Empty;
+ float offset = radius * 0.4f;
+ screwRect.X = shadowRect.X + offset;
+ screwRect.Y = shadowRect.Y + offset;
+ screwRect.Width = radius * 0.55f;
+ screwRect.Height = screwRect.Width;
+ DrawScrew(graph, screwRect);
+
+ // Right/Top ----
+ screwRect.X = shadowRect.Right - offset - screwRect.Width;
+ DrawScrew(graph, screwRect);
+
+ // Right/Bottom ----
+ screwRect.X = shadowRect.Right - offset - screwRect.Width;
+ screwRect.Y = shadowRect.Bottom - offset - screwRect.Height;
+ DrawScrew(graph, screwRect);
+
+ // Left/Bottom ----
+ screwRect.X = shadowRect.X + offset;
+ screwRect.Y = shadowRect.Bottom - offset - screwRect.Height;
+ DrawScrew(graph, screwRect);
+ }
+
+ // Bottom/Right inner shadow
+ Region innerShadowRegion = null;
+ if(drawBottomShadow)
+ {
+ shadowRect = absolute;
+ shadowRect.Width -= radius * .3f;
+ shadowRect.Height -= radius * .3f;
+ innerShadowRegion = new Region(
+ graph.CreateRoundedRectPath(
+ new RectangleF(
+ shadowRect.X - radius,
+ shadowRect.Y - radius,
+ shadowRect.Width + 0.5f*radius,
+ shadowRect.Height + 0.5f*radius),
+ cornerRadius));
+ innerShadowRegion.Complement(graph.CreateRoundedRectPath(shadowRect, cornerRadius));
+ graph.Clip = innerShadowRegion;
+
+ shadowRect.X -= 0.5f*radius;
+ shadowRect.Width += 0.5f*radius;
+ shadowRect.Y -= 0.5f*radius;
+ shadowRect.Height += 0.5f*radius;
+
+ graph.DrawRoundedRectShadowAbs(
+ shadowRect,
+ cornerRadius,
+ radius,
+ Color.Transparent,
+ Color.FromArgb(175, (sunken) ? Color.White : shadowColor),
+ 1.0f);
+ graph.Clip = new Region();
+ }
+
+ // Top/Left inner shadow
+ shadowRect = absolute;
+ shadowRect.Width -= radius * .3f;
+ shadowRect.Height -= radius * .3f;
+ innerShadowRegion = new Region(
+ graph.CreateRoundedRectPath(
+ new RectangleF(
+ shadowRect.X + radius*.5f,
+ shadowRect.Y + radius*.5f,
+ shadowRect.Width - .2f*radius,
+ shadowRect.Height - .2f*radius),
+ cornerRadius));
+
+ RectangleF shadowWithOffset = shadowRect;
+ shadowWithOffset.Width += radius;
+ shadowWithOffset.Height += radius;
+ innerShadowRegion.Complement(graph.CreateRoundedRectPath(shadowWithOffset, cornerRadius));
+
+ innerShadowRegion.Intersect(graph.CreateRoundedRectPath(shadowRect, cornerRadius));
+ graph.Clip = innerShadowRegion;
+ graph.DrawRoundedRectShadowAbs(
+ shadowWithOffset,
+ cornerRadius,
+ radius,
+ Color.Transparent,
+ Color.FromArgb(175, (sunken) ? shadowColor : Color.White),
+ 1.0f);
+ graph.Clip = new Region();
+
+ }
+
+ /// <summary>
+ /// Helper function, which draws a ---- on the frame
+ /// </summary>
+ /// <param name="graph">Chart graphics to use.</param>
+ /// <param name="rect">---- position.</param>
+ private void DrawScrew(ChartGraphics graph, RectangleF rect)
+ {
+ // Draw ----
+ Pen screwPen = new Pen(Color.FromArgb(128,255,255,255), 1);
+ graph.DrawEllipse(screwPen, rect.X, rect.Y, rect.Width, rect.Height);
+ graph.DrawLine(screwPen, rect.X + 2 * resolution / 96.0f, rect.Y + rect.Height - 2 * resolution / 96.0f, rect.Right - 2 * resolution / 96.0f, rect.Y + 2 * resolution / 96.0f);
+ screwPen = new Pen(Color.FromArgb(128, Color.Black), 1);
+ graph.DrawEllipse(screwPen, rect.X + 1 * resolution / 96.0f, rect.Y + 1 * resolution / 96.0f, rect.Width, rect.Height);
+ graph.DrawLine(screwPen, rect.X + 3 * resolution / 96.0f, rect.Y + rect.Height - 1 * resolution / 96.0f, rect.Right - 1 * resolution / 96.0f, rect.Y + 3 * resolution / 96.0f);
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Borders3D/EmbossBorder.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Borders3D/EmbossBorder.cs
new file mode 100644
index 00000000000..24f289589c1
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Borders3D/EmbossBorder.cs
@@ -0,0 +1,268 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: EmbossBorder.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting.Borders3D
+//
+// Classes: EmbossBorder
+//
+// Purpose: Class that implements Emboss 3D border style.
+//
+// Reviewed: AG - August 7, 2002
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Resources;
+using System.Reflection;
+using System.Collections;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.ComponentModel.Design;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+
+#else
+ using System.Web.UI.DataVisualization.Charting; using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.Borders3D
+#else
+ namespace System.Web.UI.DataVisualization.Charting.Borders3D
+#endif
+ {
+
+ /// <summary>
+ /// Implements emboss 3D border.
+ /// </summary>
+ internal class EmbossBorder : IBorderType
+ {
+ #region Border properties and methods
+
+ /// <summary>
+ /// Default border radius size (relative)
+ /// </summary>
+ public float defaultRadiusSize = 15f;
+
+ public float resolution = 96f;
+
+ /// <summary>
+ /// Array of corner radius
+ /// </summary>
+ internal float[] cornerRadius = { 15f, 15f, 15f, 15f, 15f, 15f, 15f, 15f };
+
+
+ /// <summary>
+ /// Public constructor
+ /// </summary>
+ public EmbossBorder()
+ {
+ }
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ public virtual string Name { get{ return "Emboss";}}
+
+
+ public virtual float Resolution
+ {
+ set
+ {
+ resolution = value;
+ float radius = 15f * value / 96.0f;
+ defaultRadiusSize = radius;
+ cornerRadius = new float[] { radius, radius, radius, radius, radius, radius, radius, radius };
+ }
+
+ }
+
+ /// <summary>
+ /// Returns the position of the rectangular area in the border where
+ /// title should be displayed. Returns empty rect if title can't be shown in the border.
+ /// </summary>
+ /// <returns>Title position in border.</returns>
+ public virtual RectangleF GetTitlePositionInBorder()
+ {
+ return RectangleF.Empty;
+ }
+
+ /// <summary>
+ /// Adjust areas rectangle coordinate to fit the 3D border.
+ /// </summary>
+ /// <param name="graph">Graphics to draw the border on.</param>
+ /// <param name="areasRect">Position to adjust.</param>
+ public virtual void AdjustAreasPosition(ChartGraphics graph, ref RectangleF areasRect)
+ {
+ SizeF borderSize = new SizeF(defaultRadiusSize/2f, defaultRadiusSize/2f);
+ borderSize = graph.GetRelativeSize(borderSize);
+
+ // Do not do anything if rectangle is too small
+ if(borderSize.Width < 30f)
+ {
+ areasRect.X += borderSize.Width;
+ areasRect.Width -= (float)Math.Min(areasRect.Width, borderSize.Width * 2.5f);
+ }
+
+ if(borderSize.Height < 30f)
+ {
+ areasRect.Y += borderSize.Height;
+ areasRect.Height -= (float)Math.Min(areasRect.Height, borderSize.Height * 2.5f);
+ }
+
+ if(areasRect.X + areasRect.Width > 100f)
+ {
+ areasRect.X -= 100f - areasRect.Width;
+ }
+ if(areasRect.Y + areasRect.Height > 100f)
+ {
+ areasRect.Y -= 100f - areasRect.Height;
+ }
+ }
+
+ /// <summary>
+ /// Draws 3D border.
+ /// </summary>
+ /// <param name="graph">Graphics to draw the border on.</param>
+ /// <param name="borderSkin">Border skin object.</param>
+ /// <param name="rect">Rectangle of the border.</param>
+ /// <param name="backColor">Color of rectangle</param>
+ /// <param name="backHatchStyle">Hatch style</param>
+ /// <param name="backImage">Back Image</param>
+ /// <param name="backImageWrapMode">Image mode</param>
+ /// <param name="backImageTransparentColor">Image transparent color.</param>
+ /// <param name="backImageAlign">Image alignment</param>
+ /// <param name="backGradientStyle">Gradient type</param>
+ /// <param name="backSecondaryColor">Gradient End Color</param>
+ /// <param name="borderColor">Border Color</param>
+ /// <param name="borderWidth">Border Width</param>
+ /// <param name="borderDashStyle">Border Style</param>
+ public virtual void DrawBorder(
+ ChartGraphics graph,
+ BorderSkin borderSkin,
+ RectangleF rect,
+ Color backColor,
+ ChartHatchStyle backHatchStyle,
+ string backImage,
+ ChartImageWrapMode backImageWrapMode,
+ Color backImageTransparentColor,
+ ChartImageAlignmentStyle backImageAlign,
+ GradientStyle backGradientStyle,
+ Color backSecondaryColor,
+ Color borderColor,
+ int borderWidth,
+ ChartDashStyle borderDashStyle)
+ {
+ RectangleF absolute = graph.Round( rect );
+ RectangleF shadowRect = absolute;
+
+ // Calculate shadow colors (0.2 - 0.6)
+ float colorDarkeningIndex = 0.2f + (0.4f * (borderSkin.PageColor.R + borderSkin.PageColor.G + borderSkin.PageColor.B) / 765f);
+ Color shadowColor = Color.FromArgb(
+ (int)(borderSkin.PageColor.R*colorDarkeningIndex),
+ (int)(borderSkin.PageColor.G*colorDarkeningIndex),
+ (int)(borderSkin.PageColor.B*colorDarkeningIndex));
+ if(borderSkin.PageColor == Color.Transparent)
+ {
+ shadowColor = Color.FromArgb(60, 0, 0, 0);
+ }
+
+ colorDarkeningIndex += 0.2f;
+ Color shadowLightColor = Color.FromArgb(
+ (int)(borderSkin.PageColor.R*colorDarkeningIndex),
+ (int)(borderSkin.PageColor.G*colorDarkeningIndex),
+ (int)(borderSkin.PageColor.B*colorDarkeningIndex));
+
+ // Calculate rounded rect radius
+ float radius = defaultRadiusSize;
+ radius = (float)Math.Max(radius, 2f * resolution / 96.0f);
+ radius = (float)Math.Min(radius, rect.Width/2f);
+ radius = (float)Math.Min(radius, rect.Height/2f);
+ radius = (float)Math.Ceiling(radius);
+
+ // Fill page background color
+ using (Brush brush = new SolidBrush(borderSkin.PageColor))
+ {
+ graph.FillRectangle(brush, rect);
+ }
+
+ // Top/Left shadow
+ shadowRect = absolute;
+ shadowRect.Width -= radius * .3f;
+ shadowRect.Height -= radius * .3f;
+ graph.DrawRoundedRectShadowAbs(shadowRect, cornerRadius, radius + 1 * resolution / 96.0f, shadowLightColor, borderSkin.PageColor, 1.4f);
+
+ // Bottom/Right shadow
+ shadowRect = absolute;
+ shadowRect.X = absolute.X + radius / 3f;
+ shadowRect.Y = absolute.Y + radius / 3f;
+ shadowRect.Width -= radius / 3.5f;
+ shadowRect.Height -= radius / 3.5f;
+ graph.DrawRoundedRectShadowAbs(shadowRect, cornerRadius, radius, shadowColor, borderSkin.PageColor, 1.3f);
+
+ // Draw Background
+ shadowRect = absolute;
+ shadowRect.X = absolute.X + 3f * resolution / 96.0f;
+ shadowRect.Y = absolute.Y + 3f * resolution / 96.0f;
+ shadowRect.Width -= radius * .75f;
+ shadowRect.Height -= radius * .75f;
+ GraphicsPath path = graph.CreateRoundedRectPath(shadowRect, cornerRadius);
+ graph.DrawPathAbs(
+ path,
+ backColor,
+ backHatchStyle,
+ backImage,
+ backImageWrapMode,
+ backImageTransparentColor,
+ backImageAlign,
+ backGradientStyle,
+ backSecondaryColor,
+ borderColor,
+ borderWidth,
+ borderDashStyle,
+ PenAlignment.Inset );
+
+ // Dispose Graphic path
+ if( path != null )
+ path.Dispose();
+
+ // Bottom/Right inner shadow
+ Region innerShadowRegion = new Region(
+ graph.CreateRoundedRectPath(
+ new RectangleF(
+ shadowRect.X - radius,
+ shadowRect.Y - radius,
+ shadowRect.Width + radius - radius*0.25f,
+ shadowRect.Height + radius - radius*0.25f),
+ cornerRadius));
+ innerShadowRegion.Complement(graph.CreateRoundedRectPath(shadowRect, cornerRadius));
+ graph.Clip = innerShadowRegion;
+ graph.DrawRoundedRectShadowAbs(
+ shadowRect,
+ cornerRadius,
+ radius,
+ Color.Transparent,
+ Color.FromArgb(128, Color.Gray),
+ .5f);
+ graph.Clip = new Region();
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/AreaChart.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/AreaChart.cs
new file mode 100644
index 00000000000..e4a351ace31
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/AreaChart.cs
@@ -0,0 +1,1647 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: AreaChart.cs
+//
+// Namespace: DataVisualization.Charting.ChartTypes
+//
+// Classes: AreaChart, SplineAreaChart
+//
+// Purpose: Provide 2D/3D drawing and hit testing functionality
+// for the Area and SplineArea charts. Spline chart
+// type is used as a base for the Area and SplineArea
+// charts.
+//
+// Reviewed: AG - August 6, 2002;
+// GS - August 8, 2002
+// AG - Microsoft 6, 2007
+//
+//===================================================================
+
+
+#region Used namespaces
+using System;
+using System.Resources;
+using System.Reflection;
+using System.Collections;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+ using System.Windows.Forms.DataVisualization.Charting;
+#else
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.ChartTypes
+#else
+ namespace System.Web.UI.DataVisualization.Charting.ChartTypes
+#endif
+{
+ /// <summary>
+ /// SplineAreaChart class extends the AreaChart class by
+ /// providing a different initial tension for the line.
+ /// </summary>
+ internal class SplineAreaChart : AreaChart
+ {
+ #region Constructor
+
+ /// <summary>
+ /// Default constructor.
+ /// </summary>
+ public SplineAreaChart()
+ {
+ // Set default line tension
+ base.lineTension = 0.5f;
+ }
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ public override string Name { get{ return ChartTypeNames.SplineArea;}}
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ override public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+ #endregion
+
+ #region Default tension method
+
+ /// <summary>
+ /// Gets default line tension. For spline charts it's always 0.5.
+ /// </summary>
+ /// <returns>Line tension.</returns>
+ override protected float GetDefaultTension()
+ {
+ return 0.5f;
+ }
+
+ /// <summary>
+ /// Checks if line tension is supported by the chart type.
+ /// </summary>
+ /// <returns>True if line tension is supported.</returns>
+ protected override bool IsLineTensionSupported()
+ {
+ return true;
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// AreaChart class provides 2D/3D drawing and hit testing
+ /// functionality for the Area and SplineArea charts. The
+ /// only difference of the SplineArea chart is the default
+ /// tension of the line.
+ ///
+ /// SplineChart base class provides most of the functionality
+ /// like drawing lines, labels and markers.
+ /// </summary>
+ internal class AreaChart : SplineChart
+ {
+ #region Fields
+
+ /// <summary>
+ /// Fields used to fill area with gradient
+ /// </summary>
+
+ protected bool gradientFill = false;
+
+ /// <summary>
+ /// Coordinates of the area path
+ /// </summary>
+ protected GraphicsPath areaPath = null;
+
+ /// <summary>
+ /// Reference to the current series object
+ /// </summary>
+ protected Series Series { get; set; }
+
+ /// <summary>
+ /// Horizontal axis position
+ /// </summary>
+ protected PointF axisPos = PointF.Empty;
+
+ #endregion
+
+ #region Constructor
+
+ /// <summary>
+ /// Area chart constructor
+ /// </summary>
+ public AreaChart()
+ {
+ this.drawOutsideLines = true;
+
+ // Set default line tension
+ base.lineTension = 0f;
+
+ // Reset axis position
+ axisPos = PointF.Empty;
+ }
+
+ #endregion
+
+ #region Default tension method
+
+ /// <summary>
+ /// Gets default line tension.
+ /// </summary>
+ /// <returns>Line tension.</returns>
+ override protected float GetDefaultTension()
+ {
+ return 0f;
+ }
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ public override string Name { get { return ChartTypeNames.Area; } }
+
+ /// <summary>
+ /// If the crossing value is auto Crossing value should be
+ /// automatically set to zero for some chart
+ /// types (Bar, column, area etc.)
+ /// </summary>
+ public override bool ZeroCrossing { get{ return true;} }
+
+ /// <summary>
+ /// How to draw series/points in legend:
+ /// Filled rectangle, Line or Marker
+ /// </summary>
+ /// <param name="series">Legend item series.</param>
+ /// <returns>Legend item style.</returns>
+ override public LegendImageStyle GetLegendImageStyle(Series series)
+ {
+ return LegendImageStyle.Rectangle;
+ }
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ override public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+
+ #endregion
+
+ #region Painting and Selection methods
+
+ /// <summary>
+ /// This method recalculates position of the end points of lines. This method
+ /// is used from Paint or Select method.
+ /// </summary>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ protected override void ProcessChartType(
+ bool selection,
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ Series seriesToDraw )
+ {
+ // Reset background gradient fill flag
+ gradientFill = false;
+
+ // Reset axis position
+ axisPos = PointF.Empty;
+
+ // Call base SplineChart class
+ base.ProcessChartType(selection, graph, common, area, seriesToDraw);
+
+ // Fill background gradient for the 2D chart. Feature is not supported in 3D.
+ if(!area.Area3DStyle.Enable3D)
+ {
+ FillLastSeriesGradient(graph);
+ }
+
+ }
+
+ /// <summary>
+ /// This method is overriden to fill the area and draw border line.
+ /// </summary>
+ /// <param name="graph">Graphics object.</param>
+ /// <param name="common">The Common elements object</param>
+ /// <param name="point">Point to draw the line for.</param>
+ /// <param name="series">Point series.</param>
+ /// <param name="points">Array of oints coordinates.</param>
+ /// <param name="pointIndex">Index of point to draw.</param>
+ /// <param name="tension">Line tension</param>
+ override protected void DrawLine(
+ ChartGraphics graph,
+ CommonElements common,
+ DataPoint point,
+ Series series,
+ PointF[] points,
+ int pointIndex,
+ float tension)
+ {
+ // Start drawing from the second point
+ if (pointIndex <= 0)
+ {
+ return;
+ }
+
+ // Check if its a beginning of a new series
+ if (this.Series != null)
+ {
+ if (this.Series.Name != series.Name)
+ {
+ // Fill gradient from the previous series
+ FillLastSeriesGradient(graph);
+ this.Series = series;
+ }
+ }
+ else
+ {
+ this.Series = series;
+ }
+
+ // Calculate points position
+ PointF point1 = points[pointIndex - 1];
+ PointF point2 = points[pointIndex];
+ point1.X = (float)Math.Round(point1.X);
+ point1.Y = (float)Math.Round(point1.Y);
+ point2.X = (float)Math.Round(point2.X);
+ point2.Y = (float)Math.Round(point2.Y);
+ if (axisPos == PointF.Empty)
+ {
+ axisPos.X = (float)VAxis.GetPosition(this.VAxis.Crossing);
+ axisPos.Y = (float)VAxis.GetPosition(this.VAxis.Crossing);
+ axisPos = graph.GetAbsolutePoint(axisPos);
+ axisPos.X = (float)Math.Round(axisPos.X);
+ axisPos.Y = (float)Math.Round(axisPos.Y);
+ }
+
+ // Point properties
+ Color pointColor = point.Color;
+ Color pointBorderColor = point.BorderColor;
+ int pointBorderWidth = point.BorderWidth;
+ ChartDashStyle pointBorderDashStyle = point.BorderDashStyle;
+
+ // Create area brush
+ Brush areaBrush = null;
+ if (point.BackHatchStyle != ChartHatchStyle.None)
+ {
+ areaBrush = graph.GetHatchBrush(point.BackHatchStyle, pointColor, point.BackSecondaryColor);
+ }
+ else if (point.BackGradientStyle != GradientStyle.None)
+ {
+ this.gradientFill = true;
+ this.Series = point.series;
+ }
+ else if (point.BackImage.Length > 0 && point.BackImageWrapMode != ChartImageWrapMode.Unscaled && point.BackImageWrapMode != ChartImageWrapMode.Scaled)
+ {
+ areaBrush = graph.GetTextureBrush(point.BackImage, point.BackImageTransparentColor, point.BackImageWrapMode, point.Color);
+ }
+ else
+ {
+ areaBrush = new SolidBrush(pointColor);
+ }
+
+ // Calculate data point area segment path
+ GraphicsPath path = new GraphicsPath();
+
+ path.AddLine(point1.X, axisPos.Y, point1.X, point1.Y);
+ if (this.lineTension == 0)
+ {
+ path.AddLine(points[pointIndex - 1], points[pointIndex]);
+ }
+ else
+ {
+ path.AddCurve(points, pointIndex - 1, 1, this.lineTension);
+ }
+ path.AddLine(point2.X, point2.Y, point2.X, axisPos.Y);
+
+ // Draw shadow
+ if (series.ShadowColor != Color.Empty && series.ShadowOffset != 0)
+ {
+ if (pointColor != Color.Empty && pointColor != Color.Transparent)
+ {
+ Region shadowRegion = new Region(path);
+ using (Brush shadowBrush = new SolidBrush((series.ShadowColor.A != 255) ? series.ShadowColor : Color.FromArgb(pointColor.A / 2, series.ShadowColor)))
+ {
+ // Set offset transformation
+ GraphicsState graphicsState = graph.Save();
+ Region clipRegion = null;
+ Region clipRegionOld = null;
+ if (!graph.IsClipEmpty && !graph.Clip.IsInfinite(graph.Graphics))
+ {
+ clipRegionOld = graph.Clip.Clone();
+ clipRegion = graph.Clip;
+ clipRegion.Translate(series.ShadowOffset, series.ShadowOffset);
+ graph.Clip = clipRegion;
+ }
+ graph.TranslateTransform(series.ShadowOffset, series.ShadowOffset);
+
+ // Draw top and bottom lines
+ if (graph.SmoothingMode != SmoothingMode.None)
+ {
+ using (Pen areaLinePen = new Pen(shadowBrush, 1))
+ {
+ if (this.lineTension == 0)
+ {
+ graph.DrawLine(areaLinePen, points[pointIndex - 1], points[pointIndex]);
+ }
+ else
+ {
+ graph.DrawCurve(areaLinePen, points, pointIndex - 1, 1, this.lineTension);
+ }
+ }
+ }
+
+ // Fill shadow region
+ graph.FillRegion(shadowBrush, shadowRegion);
+
+ // Restore transformation matrix
+ graph.Restore(graphicsState);
+ if (clipRegion != null && clipRegionOld != null)
+ {
+ graph.Clip = clipRegionOld;
+ }
+ }
+ }
+ }
+
+ // Draw area
+ if (!gradientFill)
+ {
+ // Turn off anti aliasing and fill area
+ SmoothingMode oldMode = graph.SmoothingMode;
+ graph.SmoothingMode = SmoothingMode.None;
+
+ // Fill area
+ graph.FillPath(areaBrush, path);
+
+ // Draw right side of the area (not filled by FillPath)
+
+ // Restore smoothing mode
+ graph.SmoothingMode = oldMode;
+
+ // Draw top and bottom lines
+ if (graph.SmoothingMode != SmoothingMode.None)
+ {
+ // Start Svg Selection mode
+ graph.StartHotRegion(point);
+
+ using (Pen areaLinePen = new Pen(areaBrush, 1))
+ {
+ if (this.lineTension == 0)
+ {
+ // Draw horizontal and vertical lines without anti-aliasing
+ if (!(points[pointIndex - 1].X == points[pointIndex].X ||
+ points[pointIndex - 1].Y == points[pointIndex].Y))
+ {
+ graph.DrawLine(areaLinePen, points[pointIndex - 1], points[pointIndex]);
+ }
+ }
+ else
+ {
+ graph.DrawCurve(areaLinePen, points, pointIndex - 1, 1, this.lineTension);
+ }
+ }
+
+ // End Svg Selection mode
+ graph.EndHotRegion();
+ }
+
+ }
+
+ if (areaBrush != null)
+ areaBrush.Dispose();
+
+ // Add first line
+ if (areaPath == null)
+ {
+ areaPath = new GraphicsPath();
+ areaPath.AddLine(point1.X, axisPos.Y, point1.X, point1.Y);
+ }
+
+ // Add line to the gradient path
+ if (this.lineTension == 0)
+ {
+ areaPath.AddLine(points[pointIndex - 1], points[pointIndex]);
+ }
+ else
+ {
+ areaPath.AddCurve(points, pointIndex - 1, 1, this.lineTension);
+ }
+
+ // Draw area border line
+ if (pointBorderWidth > 0 && pointBorderColor != Color.Empty)
+ {
+ Pen pen = new Pen((pointBorderColor != Color.Empty) ? pointBorderColor : pointColor, pointBorderWidth);
+ pen.DashStyle = graph.GetPenStyle(pointBorderDashStyle);
+
+ // Set Rounded Cap
+ pen.StartCap = LineCap.Round;
+ pen.EndCap = LineCap.Round;
+
+ if (this.lineTension == 0)
+ {
+ graph.DrawLine(pen, points[pointIndex - 1], points[pointIndex]);
+ }
+ else
+ {
+ graph.DrawCurve(pen, points, pointIndex - 1, 1, this.lineTension);
+ }
+ }
+
+ //************************************************************
+ // Hot Regions mode used for image maps, tool tips and
+ // hit test function
+ //************************************************************
+ if (common.ProcessModeRegions)
+ {
+ //**************************************************************
+ //** Add area for the inside of the area
+ //**************************************************************
+
+ // Create grapics path object dor the curve
+ GraphicsPath mapAreaPath = new GraphicsPath();
+ mapAreaPath.AddLine(point1.X, axisPos.Y, point1.X, point1.Y);
+ if (this.lineTension == 0)
+ {
+ mapAreaPath.AddLine(points[pointIndex - 1], points[pointIndex]);
+ }
+ else
+ {
+ mapAreaPath.AddCurve(points, pointIndex - 1, 1, this.lineTension);
+ mapAreaPath.Flatten();
+ }
+ mapAreaPath.AddLine(point2.X, point2.Y, point2.X, axisPos.Y);
+ mapAreaPath.AddLine(point2.X, axisPos.Y, point1.X, axisPos.Y);
+
+ // Allocate array of floats
+ PointF pointNew = PointF.Empty;
+ float[] coord = new float[mapAreaPath.PointCount * 2];
+ PointF[] areaPoints = mapAreaPath.PathPoints;
+ for (int i = 0; i < mapAreaPath.PointCount; i++)
+ {
+ pointNew = graph.GetRelativePoint(areaPoints[i]);
+ coord[2 * i] = pointNew.X;
+ coord[2 * i + 1] = pointNew.Y;
+ }
+
+ //************************************************************
+ // Hot Regions mode used for image maps, tool tips and
+ // hit test function
+ //************************************************************
+ common.HotRegionsList.AddHotRegion(
+ mapAreaPath,
+ false,
+ coord,
+ point,
+ series.Name,
+ pointIndex);
+
+ //**************************************************************
+ //** Add area for the top line (with thickness)
+ //**************************************************************
+ if (pointBorderWidth > 1 && pointBorderDashStyle != ChartDashStyle.NotSet && pointBorderColor != Color.Empty)
+ {
+ try
+ {
+
+ mapAreaPath.Dispose();
+ // Reset path
+ mapAreaPath = new GraphicsPath();
+ if (this.lineTension == 0)
+ {
+ mapAreaPath.AddLine(points[pointIndex - 1], points[pointIndex]);
+ }
+ else
+ {
+ mapAreaPath.AddCurve(points, pointIndex - 1, 1, this.lineTension);
+ mapAreaPath.Flatten();
+ }
+
+ // Widen the lines to the size of pen plus 2
+ mapAreaPath.Widen(new Pen(pointColor, pointBorderWidth + 2));
+ }
+ catch (OutOfMemoryException)
+ {
+ // GraphicsPath.Widen incorrectly throws OutOfMemoryException
+ // catching here and reacting by not widening
+ }
+ catch (ArgumentException)
+ {
+ }
+
+ // Allocate array of floats
+ pointNew = PointF.Empty;
+ coord = new float[mapAreaPath.PointCount * 2];
+ PointF[] mapAreaPathPoints = mapAreaPath.PathPoints;
+ for (int i = 0; i < mapAreaPathPoints.Length; i++)
+ {
+ pointNew = graph.GetRelativePoint(mapAreaPathPoints[i]);
+ coord[2 * i] = pointNew.X;
+ coord[2 * i + 1] = pointNew.Y;
+ }
+
+ //************************************************************
+ // Hot Regions mode used for image maps, tool tips and
+ // hit test function
+ //************************************************************
+ common.HotRegionsList.AddHotRegion(
+ mapAreaPath,
+ false,
+ coord,
+ point,
+ series.Name,
+ pointIndex);
+
+ }
+ mapAreaPath.Dispose();
+ }
+ }
+
+ /// <summary>
+ /// Fills last series area with gradient.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object</param>
+ private void FillLastSeriesGradient(ChartGraphics graph)
+ {
+ // Add last line in the path
+ if(areaPath != null)
+ {
+ areaPath.AddLine(areaPath.GetLastPoint().X, areaPath.GetLastPoint().Y, areaPath.GetLastPoint().X, axisPos.Y);
+ }
+
+ // Fill whole area with gradient
+ if(gradientFill && areaPath != null)
+ {
+ // Set clip region
+ graph.SetClip( Area.PlotAreaPosition.ToRectangleF() );
+
+ // Create brush
+ using (Brush areaGradientBrush = graph.GetGradientBrush(areaPath.GetBounds(), this.Series.Color, this.Series.BackSecondaryColor, this.Series.BackGradientStyle))
+ {
+ // Fill area with gradient
+ graph.FillPath(areaGradientBrush, areaPath);
+ gradientFill = false;
+ }
+
+ // Reset clip region
+ graph.ResetClip();
+ }
+ if(areaPath != null)
+ {
+ areaPath.Dispose();
+ areaPath = null;
+ }
+ }
+
+ /// <summary>
+ /// Checks if line tension is supported by the chart type.
+ /// </summary>
+ /// <returns>True if line tension is supported.</returns>
+ protected override bool IsLineTensionSupported()
+ {
+ return false;
+ }
+
+ #endregion
+
+ #region 3D painting and selection methods
+
+ /// <summary>
+ /// Draws a 3D surface connecting the two specified points in 2D space.
+ /// Used to draw Line based charts.
+ /// </summary>
+ /// <param name="area">Chart area reference.</param>
+ /// <param name="graph">Chart graphics.</param>
+ /// <param name="matrix">Coordinates transformation matrix.</param>
+ /// <param name="lightStyle">LightStyle style (None, Simplistic, Realistic).</param>
+ /// <param name="prevDataPointEx">Previous data point object.</param>
+ /// <param name="positionZ">Z position of the back side of the 3D surface.</param>
+ /// <param name="depth">Depth of the 3D surface.</param>
+ /// <param name="points">Array of points.</param>
+ /// <param name="pointIndex">Index of point to draw.</param>
+ /// <param name="pointLoopIndex">Index of points loop.</param>
+ /// <param name="tension">Line tension.</param>
+ /// <param name="operationType">AxisName of operation Drawing, Calculating Path or Both</param>
+ /// <param name="topDarkening">Darkenning scale for top surface. 0 - None.</param>
+ /// <param name="bottomDarkening">Darkenning scale for bottom surface. 0 - None.</param>
+ /// <param name="thirdPointPosition">Position where the third point is actually located or float.NaN if same as in "firstPoint".</param>
+ /// <param name="fourthPointPosition">Position where the fourth point is actually located or float.NaN if same as in "secondPoint".</param>
+ /// <param name="clippedSegment">Indicates that drawn segment is 3D clipped. Only top/bottom should be drawn.</param>
+ /// <returns>Returns elemnt shape path if operationType parameter is set to CalcElementPath, otherwise Null.</returns>
+ protected override GraphicsPath Draw3DSurface(
+ ChartArea area,
+ ChartGraphics graph,
+ Matrix3D matrix,
+ LightStyle lightStyle,
+ DataPoint3D prevDataPointEx,
+ float positionZ,
+ float depth,
+ ArrayList points,
+ int pointIndex,
+ int pointLoopIndex,
+ float tension,
+ DrawingOperationTypes operationType,
+ float topDarkening,
+ float bottomDarkening,
+ PointF thirdPointPosition,
+ PointF fourthPointPosition,
+ bool clippedSegment)
+ {
+ // Create graphics path for selection
+ GraphicsPath resultPath = ((operationType & DrawingOperationTypes.CalcElementPath) == DrawingOperationTypes.CalcElementPath)
+ ? new GraphicsPath() : null;
+
+ //****************************************************************
+ //** Find line first and second points.
+ //****************************************************************
+
+ // Check if points are drawn from sides to center (do only once)
+ if(centerPointIndex == int.MaxValue)
+ {
+ centerPointIndex = GetCenterPointIndex(points);
+ }
+
+ //************************************************************
+ //** Find line first & second points
+ //************************************************************
+ DataPoint3D secondPoint = (DataPoint3D)points[pointIndex];
+ int pointArrayIndex = pointIndex;
+ DataPoint3D firstPoint = ChartGraphics.FindPointByIndex(
+ points,
+ secondPoint.index - 1,
+ (this.multiSeries) ? secondPoint : null,
+ ref pointArrayIndex);
+
+
+ //****************************************************************
+ //** Switch first and second points.
+ //****************************************************************
+ bool reversed = false;
+ if(firstPoint.index > secondPoint.index)
+ {
+ DataPoint3D tempPoint = firstPoint;
+ firstPoint = secondPoint;
+ secondPoint = tempPoint;
+ reversed = true;
+ }
+
+
+ // Points can be drawn from sides to the center.
+ // In this case can't use index in the list to find first point.
+ // Use point series and real point index to find the first point.
+ // Get required point index
+ if(matrix.Perspective != 0 && centerPointIndex != int.MaxValue)
+ {
+ pointArrayIndex = pointIndex;
+ if( pointIndex != (centerPointIndex + 1))
+ {
+ firstPoint = ChartGraphics.FindPointByIndex(points, secondPoint.index - 1, (this.multiSeries) ? secondPoint : null, ref pointArrayIndex);
+ }
+ else
+ {
+ if (!area.ReverseSeriesOrder)
+ {
+ secondPoint = ChartGraphics.FindPointByIndex(points, firstPoint.index + 1, (this.multiSeries) ? secondPoint : null, ref pointArrayIndex);
+ }
+ else
+ {
+ firstPoint = secondPoint;
+ secondPoint = ChartGraphics.FindPointByIndex(points, secondPoint.index - 1, (this.multiSeries) ? secondPoint : null, ref pointArrayIndex);
+ }
+ }
+ }
+
+ // Check if points are not null
+ if(firstPoint == null || secondPoint == null)
+ {
+ return resultPath;
+ }
+
+
+ //****************************************************************
+ //** Check if reversed drawing order required
+ //****************************************************************
+ reversed = false;
+ int indexOffset = 1;
+ while((pointIndex + indexOffset) < points.Count)
+ {
+ DataPoint3D p = (DataPoint3D)points[pointIndex + indexOffset];
+ if(p.dataPoint.series.Name == firstPoint.dataPoint.series.Name)
+ {
+ if(p.index == firstPoint.index)
+ {
+ reversed = true;
+ }
+ break;
+ }
+
+ ++indexOffset;
+ }
+
+ //****************************************************************
+ //** Check line tension and draw spline area if non zero.
+ //****************************************************************
+ // Check tension
+ if(tension != 0f)
+ {
+ // Get spline flatten path
+ GraphicsPath splineSurfacePath = graph.GetSplineFlattenPath(
+ area, positionZ,
+ firstPoint, secondPoint, points, tension, true, false, 0);
+
+ // Reversed array of points if needed
+ PointF[] splinePoints = null;
+ reversed = (pointIndex < pointArrayIndex);
+ if(reversed)
+ {
+ splineSurfacePath.Reverse();
+ }
+ splinePoints = splineSurfacePath.PathPoints;
+
+ // Loop through all segment lines the spline consist off
+ DataPoint3D dp1 = new DataPoint3D();
+ DataPoint3D dp2 = new DataPoint3D();
+ //LineSegmentType surfaceSegmentType = (!reversed) ? LineSegmentType.First : LineSegmentType.Last;
+ LineSegmentType surfaceSegmentType = LineSegmentType.Middle;
+ for(int pIndex = 1; pIndex < splinePoints.Length; pIndex++)
+ {
+ // Calculate surface coordinates
+ if(!reversed)
+ {
+ dp1.dataPoint = firstPoint.dataPoint;
+ dp1.index = firstPoint.index;
+ dp1.xPosition = splinePoints[pIndex - 1].X;
+ dp1.yPosition = splinePoints[pIndex - 1].Y;
+
+ dp2.dataPoint = secondPoint.dataPoint;
+ dp2.index = secondPoint.index;
+ dp2.xPosition = splinePoints[pIndex].X;
+ dp2.yPosition = splinePoints[pIndex].Y;
+ }
+ else
+ {
+ dp2.dataPoint = firstPoint.dataPoint;
+ dp2.index = firstPoint.index;
+ dp2.xPosition = splinePoints[pIndex - 1].X;
+ dp2.yPosition = splinePoints[pIndex - 1].Y;
+
+ dp1.dataPoint = secondPoint.dataPoint;
+ dp1.index = secondPoint.index;
+ dp1.xPosition = splinePoints[pIndex].X;
+ dp1.yPosition = splinePoints[pIndex].Y;
+ }
+
+ // Get sefment type
+ surfaceSegmentType = LineSegmentType.Middle;
+ if(pIndex == 1)
+ {
+ if(!reversed)
+ surfaceSegmentType = LineSegmentType.First;
+ else
+ surfaceSegmentType = LineSegmentType.Last;
+ }
+ else if(pIndex == splinePoints.Length - 1)
+ {
+ if(!reversed)
+ surfaceSegmentType = LineSegmentType.Last;
+ else
+ surfaceSegmentType = LineSegmentType.First;
+ }
+
+ // Draw each segment of the spline area
+ area.IterationCounter = 0;
+ GraphicsPath segmentResultPath = Draw3DSurface( dp1, dp2, reversed,
+ area, graph, matrix, lightStyle, prevDataPointEx,
+ positionZ, depth, points, pointIndex, pointLoopIndex,
+ 0f, operationType, surfaceSegmentType,
+ topDarkening, bottomDarkening,
+ new PointF(float.NaN, float.NaN),
+ new PointF(float.NaN, float.NaN),
+ clippedSegment,
+ true, true);
+
+ // Add selection path
+ if(resultPath != null && segmentResultPath != null && segmentResultPath.PointCount > 0)
+ {
+ resultPath.AddPath(segmentResultPath, true);
+ }
+ }
+
+ return resultPath;
+ }
+
+ // Area point is drawn as one segment
+ return Draw3DSurface( firstPoint, secondPoint, reversed,
+ area, graph, matrix, lightStyle, prevDataPointEx,
+ positionZ, depth, points, pointIndex, pointLoopIndex,
+ tension, operationType, LineSegmentType.Single,
+ topDarkening, bottomDarkening,
+ thirdPointPosition, fourthPointPosition,
+ clippedSegment,
+ true, true);
+ }
+
+ /// <summary>
+ /// Draws a 3D surface connecting the two specified points in 2D space.
+ /// Used to draw Line based charts.
+ /// </summary>
+ /// <param name="firstPoint">First data point.</param>
+ /// <param name="secondPoint">Second data point.</param>
+ /// <param name="reversed">Points are in reversed order.</param>
+ /// <param name="area">Chart area reference.</param>
+ /// <param name="graph">Chart graphics.</param>
+ /// <param name="matrix">Coordinates transformation matrix.</param>
+ /// <param name="lightStyle">LightStyle style (None, Simplistic, Realistic).</param>
+ /// <param name="prevDataPointEx">Previous data point object.</param>
+ /// <param name="positionZ">Z position of the back side of the 3D surface.</param>
+ /// <param name="depth">Depth of the 3D surface.</param>
+ /// <param name="points">Array of points.</param>
+ /// <param name="pointIndex">Index of point to draw.</param>
+ /// <param name="pointLoopIndex">Index of points loop.</param>
+ /// <param name="tension">Line tension.</param>
+ /// <param name="operationType">AxisName of operation Drawing, Calculating Path or Both</param>
+ /// <param name="surfaceSegmentType">Define surface segment type if it consists of several segments.</param>
+ /// <param name="topDarkening">Darkenning scale for top surface. 0 - None.</param>
+ /// <param name="bottomDarkening">Darkenning scale for bottom surface. 0 - None.</param>
+ /// <param name="thirdPointPosition">Position where the third point is actually located or float.NaN if same as in "firstPoint".</param>
+ /// <param name="fourthPointPosition">Position where the fourth point is actually located or float.NaN if same as in "secondPoint".</param>
+ /// <param name="clippedSegment">Indicates that drawn segment is 3D clipped. Only top/bottom should be drawn.</param>
+ /// <param name="clipOnTop">Indicates that top segment line should be clipped to the pkot area.</param>
+ /// <param name="clipOnBottom">Indicates that bottom segment line should be clipped to the pkot area.</param>
+ /// <returns>Returns elemnt shape path if operationType parameter is set to CalcElementPath, otherwise Null.</returns>
+ protected override GraphicsPath Draw3DSurface(
+ DataPoint3D firstPoint,
+ DataPoint3D secondPoint,
+ bool reversed,
+ ChartArea area,
+ ChartGraphics graph,
+ Matrix3D matrix,
+ LightStyle lightStyle,
+ DataPoint3D prevDataPointEx,
+ float positionZ,
+ float depth,
+ ArrayList points,
+ int pointIndex,
+ int pointLoopIndex,
+ float tension,
+ DrawingOperationTypes operationType,
+ LineSegmentType surfaceSegmentType,
+ float topDarkening,
+ float bottomDarkening,
+ PointF thirdPointPosition,
+ PointF fourthPointPosition,
+ bool clippedSegment,
+ bool clipOnTop,
+ bool clipOnBottom)
+ {
+ // Create graphics path for selection
+ GraphicsPath resultPath = ((operationType & DrawingOperationTypes.CalcElementPath) == DrawingOperationTypes.CalcElementPath)
+ ? new GraphicsPath() : null;
+
+ //**********************************************************************
+ //** Check surface coordinates
+ //**********************************************************************
+ if(Math.Round(firstPoint.xPosition, 3) == Math.Round(secondPoint.xPosition, 3) &&
+ Math.Round(firstPoint.yPosition, 3) == Math.Round(secondPoint.yPosition, 3))
+ {
+ return resultPath;
+ }
+
+ //****************************************************************
+ //** Fint point with line properties
+ //****************************************************************
+ DataPoint3D pointAttr = secondPoint;
+ if(prevDataPointEx.dataPoint.IsEmpty)
+ {
+ pointAttr = prevDataPointEx;
+ }
+ else if(firstPoint.index > secondPoint.index)
+ {
+ pointAttr = firstPoint;
+ }
+
+ //****************************************************************
+ //** Adjust point visual properties.
+ //****************************************************************
+ Color color = (useBorderColor) ? pointAttr.dataPoint.BorderColor : pointAttr.dataPoint.Color;
+ ChartDashStyle dashStyle = pointAttr.dataPoint.BorderDashStyle;
+ if( pointAttr.dataPoint.IsEmpty && pointAttr.dataPoint.Color == Color.Empty)
+ {
+ color = Color.Gray;
+ }
+ if( pointAttr.dataPoint.IsEmpty && pointAttr.dataPoint.BorderDashStyle == ChartDashStyle.NotSet )
+ {
+ dashStyle = ChartDashStyle.Solid;
+ }
+
+ //****************************************************************
+ //** Get axis position
+ //****************************************************************
+ float axisPosition = (float)Math.Round(VAxis.GetPosition(this.VAxis.Crossing), 3);
+
+
+ //****************************************************************
+ //** Detect visibility of the bounding rectangle.
+ //****************************************************************
+ float minX = (float)Math.Min(firstPoint.xPosition, secondPoint.xPosition);
+ float minY = (float)Math.Min(firstPoint.yPosition, secondPoint.yPosition);
+ minY = (float)Math.Min(minY, axisPosition);
+ float maxX = (float)Math.Max(firstPoint.xPosition, secondPoint.xPosition);
+ float maxY = (float)Math.Max(firstPoint.yPosition, secondPoint.yPosition);
+ maxY = (float)Math.Max(maxY, axisPosition);
+ RectangleF position = new RectangleF(minX, minY, maxX - minX, maxY - minY);
+ SurfaceNames visibleSurfaces = graph.GetVisibleSurfaces(position,positionZ,depth,matrix);
+
+ // Check if area point is drawn upside down.
+ bool upSideDown = false;
+ if( ((decimal)firstPoint.yPosition) >= ((decimal)axisPosition) &&
+ ((decimal)secondPoint.yPosition) >= ((decimal)axisPosition) )
+ {
+ upSideDown = true;
+
+ // Switch visibility between Top & Bottom surfaces
+ bool topVisible = ( (visibleSurfaces & SurfaceNames.Top) == SurfaceNames.Top );
+ bool bottomVisible = ( (visibleSurfaces & SurfaceNames.Bottom) == SurfaceNames.Bottom );
+ visibleSurfaces ^= SurfaceNames.Bottom;
+ visibleSurfaces ^= SurfaceNames.Top;
+ if(topVisible)
+ {
+ visibleSurfaces |= SurfaceNames.Bottom;
+ }
+ if(bottomVisible)
+ {
+ visibleSurfaces |= SurfaceNames.Top;
+ }
+ }
+
+ // Get visibility of the top surface (different from bounding rectangle)
+ GetTopSurfaceVisibility(
+ area,
+ firstPoint,
+ secondPoint,
+ upSideDown,
+ positionZ,
+ depth,
+ matrix,
+ ref visibleSurfaces);
+
+ //****************************************************************
+ //** Calculate position of top/bootom points.
+ //****************************************************************
+ PointF thirdPoint, fourthPoint;
+ GetBottomPointsPosition(
+ Common,
+ area,
+ axisPosition,
+ ref firstPoint,
+ ref secondPoint,
+ thirdPointPosition,
+ fourthPointPosition,
+ out thirdPoint,
+ out fourthPoint);
+
+ // Check if point's position provided as parameter
+ if(!float.IsNaN(thirdPointPosition.Y))
+ {
+ thirdPoint.Y = thirdPointPosition.Y;
+ }
+ if(!float.IsNaN(fourthPointPosition.Y))
+ {
+ fourthPoint.Y = fourthPointPosition.Y;
+ }
+
+ if(float.IsNaN(thirdPoint.X) ||
+ float.IsNaN(thirdPoint.Y) ||
+ float.IsNaN(fourthPoint.X) ||
+ float.IsNaN(fourthPoint.Y) )
+ {
+ return resultPath;
+ }
+
+ //****************************************************************
+ //** Clip area first and second data points inside
+ //** the plotting area.
+ //****************************************************************
+ if(clipOnTop && ClipTopPoints(
+ resultPath,
+ ref firstPoint,
+ ref secondPoint,
+ reversed,
+ area,
+ graph,
+ matrix,
+ lightStyle,
+ prevDataPointEx,
+ positionZ,
+ depth,
+ points,
+ pointIndex,
+ pointLoopIndex,
+ tension,
+ operationType,
+ surfaceSegmentType,
+ topDarkening,
+ bottomDarkening
+ ) == true)
+ {
+ return resultPath;
+ }
+
+ //****************************************************************
+ //** Clip area third and fourth data points inside
+ //** the plotting area.
+ //****************************************************************
+ if(clipOnBottom && ClipBottomPoints(
+ resultPath,
+ ref firstPoint,
+ ref secondPoint,
+ ref thirdPoint,
+ ref fourthPoint,
+ reversed,
+ area,
+ graph,
+ matrix,
+ lightStyle,
+ prevDataPointEx,
+ positionZ,
+ depth,
+ points,
+ pointIndex,
+ pointLoopIndex,
+ tension,
+ operationType,
+ surfaceSegmentType,
+ topDarkening,
+ bottomDarkening
+ ) == true)
+ {
+ return resultPath;
+ }
+
+
+ //****************************************************************
+ //** Check if area points are on the different sides of the axis.
+ //** In this case split area point into two points where the line
+ //** intersects the axis line
+ //****************************************************************
+ if( (Math.Round((decimal)firstPoint.yPosition, 3) > (decimal)axisPosition + 0.001M && Math.Round((decimal)secondPoint.yPosition, 3) < (decimal)axisPosition - 0.001M) ||
+ (Math.Round((decimal)firstPoint.yPosition, 3) < (decimal)axisPosition - 0.001M && Math.Round((decimal)secondPoint.yPosition, 3) > (decimal)axisPosition + 0.001M) )
+ {
+ // Find intersection point
+ DataPoint3D intersectionPoint = GetAxisIntersection(firstPoint, secondPoint, axisPosition);
+
+ for(int segmentIndex = 0; segmentIndex <= 1; segmentIndex++)
+ {
+ GraphicsPath segmentPath = null;
+ if(segmentIndex == 0 && !reversed ||
+ segmentIndex == 1 && reversed)
+ {
+ // Draw first segment
+ intersectionPoint.dataPoint = secondPoint.dataPoint;
+ intersectionPoint.index = secondPoint.index;
+ segmentPath = Draw3DSurface( firstPoint, intersectionPoint, reversed,
+ area, graph, matrix, lightStyle, prevDataPointEx,
+ positionZ, depth, points, pointIndex, pointLoopIndex,
+ tension, operationType, surfaceSegmentType,
+ topDarkening, bottomDarkening,
+ new PointF(float.NaN, float.NaN),
+ new PointF(float.NaN, float.NaN),
+ clippedSegment,
+ clipOnTop, clipOnBottom);
+ }
+
+ if(segmentIndex == 1 && !reversed ||
+ segmentIndex == 0 && reversed)
+ {
+ // Draw second segment
+ intersectionPoint.dataPoint = firstPoint.dataPoint;
+ intersectionPoint.index = firstPoint.index;
+ segmentPath = Draw3DSurface( intersectionPoint, secondPoint, reversed,
+ area, graph, matrix, lightStyle, prevDataPointEx,
+ positionZ, depth, points, pointIndex, pointLoopIndex,
+ tension, operationType, surfaceSegmentType,
+ topDarkening, bottomDarkening,
+ new PointF(float.NaN, float.NaN),
+ new PointF(float.NaN, float.NaN),
+ clippedSegment,
+ clipOnTop, clipOnBottom);
+ }
+
+ // Add segment path
+ if(resultPath != null && segmentPath != null && segmentPath.PointCount > 0)
+ {
+ resultPath.AddPath(segmentPath, true);
+ }
+ }
+
+ return resultPath;
+ }
+
+ //**********************************************************************
+ //** Check surface coordinates
+ //**********************************************************************
+ if(Math.Round(firstPoint.xPosition, 3) == Math.Round(secondPoint.xPosition, 3) &&
+ Math.Round(firstPoint.yPosition, 3) == Math.Round(secondPoint.yPosition, 3))
+ {
+ return resultPath;
+ }
+
+ //****************************************************************
+ //** Draw elements of area chart in 2 layers (back & front)
+ //****************************************************************
+ for(int elemLayer = 1; elemLayer <= 2; elemLayer++)
+ {
+ // Loop through all surfaces
+ SurfaceNames[] surfacesOrder = new SurfaceNames[] {SurfaceNames.Back, SurfaceNames.Bottom, SurfaceNames.Top, SurfaceNames.Left, SurfaceNames.Right, SurfaceNames.Front};
+ LineSegmentType lineSegmentType = LineSegmentType.Middle;
+ foreach(SurfaceNames currentSurface in surfacesOrder)
+ {
+ // Check if surface should be drawn
+ if (ChartGraphics.ShouldDrawLineChartSurface(area, area.ReverseSeriesOrder, currentSurface, visibleSurfaces, color,
+ points, firstPoint, secondPoint, this.multiSeries, ref lineSegmentType) != elemLayer)
+ {
+ continue;
+ }
+
+ // To solvce segments overlapping issues with semi-transparent colors ->
+ // Draw invisible surfaces in the first loop, visible in second
+ if(this.allPointsLoopsNumber == 2 && (operationType & DrawingOperationTypes.DrawElement) == DrawingOperationTypes.DrawElement)
+ {
+ if(pointLoopIndex == 0)
+ {
+ if(currentSurface == SurfaceNames.Front ||
+ elemLayer == 2 && (currentSurface == SurfaceNames.Left || currentSurface == SurfaceNames.Right))
+ {
+ continue;
+ }
+ }
+ if(pointLoopIndex == 1)
+ {
+ if(currentSurface == SurfaceNames.Back ||
+ currentSurface != SurfaceNames.Front)
+ {
+ if(elemLayer == 1)
+ {
+ continue;
+ }
+ else if(currentSurface != SurfaceNames.Left && currentSurface != SurfaceNames.Right)
+ {
+ continue;
+ }
+ }
+ }
+ }
+
+ // Draw only borders of the invisible elements on the back layer
+ Color surfaceColor = color;
+ Color surfaceBorderColor = pointAttr.dataPoint.BorderColor;
+ if(elemLayer == 1)
+ {
+ // Draw only if point color is semi-transparent
+ if(surfaceColor.A == 255)
+ {
+ continue;
+ }
+
+ // Define drawing colors
+ surfaceColor = Color.Transparent;
+ if(surfaceBorderColor == Color.Empty)
+ {
+ // If border color is emty use color slightly darker than main back color
+ surfaceBorderColor = ChartGraphics.GetGradientColor( color, Color.Black, 0.2 );
+ }
+ }
+
+ // Check if marker lines should be drawn
+ bool forceThinLines = this.showPointLines;
+ if(surfaceSegmentType == LineSegmentType.Middle)
+ {
+ forceThinLines = false;
+ }
+
+ // 3D clipped segment is drawn - draw only top & bottom
+ if(clippedSegment &&
+ currentSurface != SurfaceNames.Top &&
+ currentSurface != SurfaceNames.Bottom)
+ {
+ continue;
+ }
+
+ // Draw surfaces
+ GraphicsPath surfacePath = null;
+ switch(currentSurface)
+ {
+ case(SurfaceNames.Top):
+ {
+ // Darken colors
+ Color topColor = (topDarkening == 0f) ? surfaceColor : ChartGraphics.GetGradientColor(surfaceColor, Color.Black, topDarkening);
+ Color topBorderColor = (topDarkening == 0f) ? surfaceBorderColor : ChartGraphics.GetGradientColor(surfaceBorderColor, Color.Black, topDarkening);
+
+ surfacePath = graph.Draw3DSurface( area, matrix, lightStyle, currentSurface, positionZ, depth,
+ topColor, topBorderColor, pointAttr.dataPoint.BorderWidth, dashStyle,
+ firstPoint, secondPoint, points, pointIndex,
+ 0f, operationType, surfaceSegmentType,
+ forceThinLines, false, area.ReverseSeriesOrder, this.multiSeries, 0, true);
+
+ break;
+ }
+ case(SurfaceNames.Bottom):
+ {
+ // Calculate coordinates
+ DataPoint3D dp1 = new DataPoint3D();
+ dp1.index = firstPoint.index;
+ dp1.dataPoint = firstPoint.dataPoint;
+ dp1.xPosition = firstPoint.xPosition;
+ dp1.yPosition = thirdPoint.Y;
+ DataPoint3D dp2 = new DataPoint3D();
+ dp2.index = secondPoint.index;
+ dp2.dataPoint = secondPoint.dataPoint;
+ dp2.xPosition = secondPoint.xPosition;
+ dp2.yPosition = fourthPoint.Y;
+
+ // Darken colors
+ Color bottomColor = (bottomDarkening == 0f) ? surfaceColor : ChartGraphics.GetGradientColor(surfaceColor, Color.Black, topDarkening);
+ Color bottomBorderColor = (bottomDarkening == 0f) ? surfaceBorderColor : ChartGraphics.GetGradientColor(surfaceBorderColor, Color.Black, topDarkening);
+
+ // Draw surface
+ surfacePath = graph.Draw3DSurface( area, matrix, lightStyle, currentSurface, positionZ, depth,
+ bottomColor, bottomBorderColor, pointAttr.dataPoint.BorderWidth, dashStyle,
+ dp1, dp2, points, pointIndex,
+ 0f, operationType, surfaceSegmentType,
+ forceThinLines, false, area.ReverseSeriesOrder, this.multiSeries, 0, true);
+
+ break;
+ }
+
+ case(SurfaceNames.Left):
+ {
+ if(surfaceSegmentType == LineSegmentType.Single ||
+ (!area.ReverseSeriesOrder && surfaceSegmentType == LineSegmentType.First) ||
+ (area.ReverseSeriesOrder && surfaceSegmentType == LineSegmentType.Last))
+ {
+
+ // Calculate coordinates
+ DataPoint3D leftMostPoint = (firstPoint.xPosition <= secondPoint.xPosition) ? firstPoint : secondPoint;
+ DataPoint3D dp1 = new DataPoint3D();
+ dp1.index = leftMostPoint.index;
+ dp1.dataPoint = leftMostPoint.dataPoint;
+ dp1.xPosition = leftMostPoint.xPosition;
+ dp1.yPosition = (firstPoint.xPosition <= secondPoint.xPosition) ? thirdPoint.Y : fourthPoint.Y;
+ DataPoint3D dp2 = new DataPoint3D();
+ dp2.index = leftMostPoint.index;
+ dp2.dataPoint = leftMostPoint.dataPoint;
+ dp2.xPosition = leftMostPoint.xPosition;;
+ dp2.yPosition = leftMostPoint.yPosition;
+
+ // Draw surface
+ surfacePath = graph.Draw3DSurface( area, matrix, lightStyle, currentSurface, positionZ, depth,
+ surfaceColor, surfaceBorderColor, pointAttr.dataPoint.BorderWidth, dashStyle,
+ dp1, dp2, points, pointIndex,
+ 0f, operationType, LineSegmentType.Single, true, true, area.ReverseSeriesOrder, this.multiSeries, 0, true);
+
+ }
+ break;
+ }
+ case(SurfaceNames.Right):
+ {
+ if(surfaceSegmentType == LineSegmentType.Single ||
+ (!area.ReverseSeriesOrder && surfaceSegmentType == LineSegmentType.Last) ||
+ (area.ReverseSeriesOrder && surfaceSegmentType == LineSegmentType.First))
+
+ {
+ // Calculate coordinates
+ DataPoint3D rightMostPoint = (secondPoint.xPosition >= firstPoint.xPosition) ? secondPoint : firstPoint;
+ DataPoint3D dp1 = new DataPoint3D();
+ dp1.index = rightMostPoint.index;
+ dp1.dataPoint = rightMostPoint.dataPoint;
+ dp1.xPosition = rightMostPoint.xPosition;
+ dp1.yPosition = (secondPoint.xPosition >= firstPoint.xPosition) ? fourthPoint.Y : thirdPoint.Y;
+ DataPoint3D dp2 = new DataPoint3D();
+ dp2.index = rightMostPoint.index;
+ dp2.dataPoint = rightMostPoint.dataPoint;
+ dp2.xPosition = rightMostPoint.xPosition;
+ dp2.yPosition = rightMostPoint.yPosition;
+
+ // Draw surface
+ surfacePath = graph.Draw3DSurface( area, matrix, lightStyle, currentSurface, positionZ, depth,
+ surfaceColor, surfaceBorderColor, pointAttr.dataPoint.BorderWidth, dashStyle,
+ dp1, dp2, points, pointIndex,
+ 0f, operationType, LineSegmentType.Single, true, true, area.ReverseSeriesOrder, this.multiSeries, 0, true);
+
+ }
+
+ break;
+ }
+ case(SurfaceNames.Back):
+ {
+ // Calculate coordinates
+ DataPoint3D dp1 = new DataPoint3D();
+ dp1.index = firstPoint.index;
+ dp1.dataPoint = firstPoint.dataPoint;
+ dp1.xPosition = firstPoint.xPosition;
+ dp1.yPosition = thirdPoint.Y;
+ DataPoint3D dp2 = new DataPoint3D();
+ dp2.index = secondPoint.index;
+ dp2.dataPoint = secondPoint.dataPoint;
+ dp2.xPosition = secondPoint.xPosition;
+ dp2.yPosition = fourthPoint.Y;
+
+ // Border line is required on the data point boundary
+ SurfaceNames thinBorderSides = 0;
+ if(forceThinLines)
+ {
+ if(surfaceSegmentType == LineSegmentType.Single)
+ thinBorderSides = SurfaceNames.Left | SurfaceNames.Right;
+ else if(surfaceSegmentType == LineSegmentType.First)
+ thinBorderSides = SurfaceNames.Left;
+ else if(surfaceSegmentType == LineSegmentType.Last)
+ thinBorderSides = SurfaceNames.Right;
+ }
+
+
+ // Draw surface
+ surfacePath = graph.Draw3DPolygon( area, matrix, currentSurface, positionZ,
+ surfaceColor, surfaceBorderColor, pointAttr.dataPoint.BorderWidth,
+ firstPoint, secondPoint, dp2, dp1, operationType, lineSegmentType,
+ thinBorderSides);
+ break;
+ }
+ case(SurfaceNames.Front):
+ {
+ // Calculate coordinates
+ DataPoint3D dp1 = new DataPoint3D();
+ dp1.index = firstPoint.index;
+ dp1.dataPoint = firstPoint.dataPoint;
+ dp1.xPosition = firstPoint.xPosition;
+ dp1.yPosition = thirdPoint.Y;
+
+ DataPoint3D dp2 = new DataPoint3D();
+ dp2.index = secondPoint.index;
+ dp2.dataPoint = secondPoint.dataPoint;
+ dp2.xPosition = secondPoint.xPosition;
+ dp2.yPosition = fourthPoint.Y;
+
+ // Change segment type for the reversed series order
+ if (area.ReverseSeriesOrder)
+ {
+ if(lineSegmentType == LineSegmentType.First)
+ {
+ lineSegmentType = LineSegmentType.Last;
+ }
+ else if(lineSegmentType == LineSegmentType.Last)
+ {
+ lineSegmentType = LineSegmentType.First;
+ }
+ }
+
+ if(surfaceSegmentType != LineSegmentType.Single)
+ {
+ if( surfaceSegmentType == LineSegmentType.Middle ||
+ ( surfaceSegmentType == LineSegmentType.First && lineSegmentType != LineSegmentType.First) ||
+ ( surfaceSegmentType == LineSegmentType.Last && lineSegmentType != LineSegmentType.Last) )
+ {
+ lineSegmentType = LineSegmentType.Middle;
+ }
+ }
+
+ // Border line is required on the data point boundary
+ SurfaceNames thinBorderSides = 0;
+ if(forceThinLines)
+ {
+ if(surfaceSegmentType == LineSegmentType.Single)
+ thinBorderSides = SurfaceNames.Left | SurfaceNames.Right;
+ else if(surfaceSegmentType == LineSegmentType.First)
+ thinBorderSides = SurfaceNames.Left;
+ else if(surfaceSegmentType == LineSegmentType.Last)
+ thinBorderSides = SurfaceNames.Right;
+ }
+
+ // Draw surface
+ surfacePath = graph.Draw3DPolygon( area, matrix, currentSurface, positionZ + depth,
+ surfaceColor, surfaceBorderColor, pointAttr.dataPoint.BorderWidth,
+ firstPoint, secondPoint, dp2, dp1, operationType, lineSegmentType,
+ thinBorderSides);
+
+ break;
+ }
+ }
+
+ // Add path of the fully visible surfaces to the result surface
+ if(elemLayer == 2 && resultPath != null && surfacePath != null && surfacePath.PointCount > 0)
+ {
+ resultPath.CloseFigure();
+ resultPath.SetMarkers();
+ resultPath.AddPath(surfacePath, true);
+ }
+
+ }
+ }
+
+ return resultPath;
+ }
+
+
+ /// <summary>
+ /// Gets visibility of the top surface.
+ /// </summary>
+ /// <param name="area">Chart area object.</param>
+ /// <param name="firstPoint">First data point of the line.</param>
+ /// <param name="secondPoint">Second data point of the line.</param>
+ /// <param name="upSideDown">Indicates that Y values of the data points are below axis line.</param>
+ /// <param name="positionZ">Z coordinate of the back side of the cube.</param>
+ /// <param name="depth">Cube depth.</param>
+ /// <param name="matrix">Coordinate transformation matrix.</param>
+ /// <param name="visibleSurfaces">Surface visibility reference. Initialized with bounary cube visibility.</param>
+ protected virtual void GetTopSurfaceVisibility(
+ ChartArea area,
+ DataPoint3D firstPoint,
+ DataPoint3D secondPoint,
+ bool upSideDown,
+ float positionZ,
+ float depth,
+ Matrix3D matrix,
+ ref SurfaceNames visibleSurfaces)
+ {
+ // If Top surface visibility in bounding rectangle - do not gurantee angled linde visibility
+ if( (visibleSurfaces & SurfaceNames.Top) == SurfaceNames.Top)
+ {
+ visibleSurfaces ^= SurfaceNames.Top;
+ }
+
+ // Create top surface coordinates in 3D space
+ Point3D[] cubePoints = new Point3D[3];
+ if (!area.ReverseSeriesOrder)
+ {
+ if(!upSideDown && firstPoint.xPosition <= secondPoint.xPosition ||
+ upSideDown && firstPoint.xPosition >= secondPoint.xPosition)
+ {
+ cubePoints[0] = new Point3D( (float)firstPoint.xPosition, (float)firstPoint.yPosition, positionZ + depth );
+ cubePoints[1] = new Point3D( (float)firstPoint.xPosition, (float)firstPoint.yPosition, positionZ );
+ cubePoints[2] = new Point3D( (float)secondPoint.xPosition, (float)secondPoint.yPosition, positionZ );
+ }
+ else
+ {
+ cubePoints[0] = new Point3D( (float)secondPoint.xPosition, (float)secondPoint.yPosition, positionZ + depth );
+ cubePoints[1] = new Point3D( (float)secondPoint.xPosition, (float)secondPoint.yPosition, positionZ );
+ cubePoints[2] = new Point3D( (float)firstPoint.xPosition, (float)firstPoint.yPosition, positionZ );
+ }
+ }
+ else
+ {
+ if(!upSideDown && secondPoint.xPosition <= firstPoint.xPosition ||
+ upSideDown && secondPoint.xPosition >= firstPoint.xPosition)
+ {
+ cubePoints[0] = new Point3D( (float)secondPoint.xPosition, (float)secondPoint.yPosition, positionZ + depth );
+ cubePoints[1] = new Point3D( (float)secondPoint.xPosition, (float)secondPoint.yPosition, positionZ );
+ cubePoints[2] = new Point3D( (float)firstPoint.xPosition, (float)firstPoint.yPosition, positionZ );
+ }
+ else
+ {
+ cubePoints[0] = new Point3D( (float)firstPoint.xPosition, (float)firstPoint.yPosition, positionZ + depth );
+ cubePoints[1] = new Point3D( (float)firstPoint.xPosition, (float)firstPoint.yPosition, positionZ );
+ cubePoints[2] = new Point3D( (float)secondPoint.xPosition, (float)secondPoint.yPosition, positionZ );
+ }
+ }
+
+ // Tranform coordinates
+ matrix.TransformPoints( cubePoints );
+
+ // Check the top side visibility
+ if(ChartGraphics.IsSurfaceVisible(cubePoints[0],cubePoints[1],cubePoints[2]))
+ {
+ visibleSurfaces |= SurfaceNames.Top;
+ }
+ }
+
+ /// <summary>
+ /// Gets intersection point coordinates between point line and axis line.
+ /// </summary>
+ /// <param name="firstPoint">First data point.</param>
+ /// <param name="secondPoint">Second data point.</param>
+ /// <param name="axisPosition">Axis line position.</param>
+ /// <returns>Intersection point coordinates.</returns>
+ internal DataPoint3D GetAxisIntersection(DataPoint3D firstPoint, DataPoint3D secondPoint, float axisPosition)
+ {
+ DataPoint3D intersectionPoint = new DataPoint3D();
+ intersectionPoint.yPosition = axisPosition;
+ intersectionPoint.xPosition = (axisPosition - firstPoint.yPosition) *
+ (secondPoint.xPosition - firstPoint.xPosition) /
+ (secondPoint.yPosition - firstPoint.yPosition) +
+ firstPoint.xPosition ;
+ return intersectionPoint;
+ }
+
+ /// <summary>
+ /// Gets position ob the bottom points in area chart.
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="area">Chart area the series belongs to.</param>
+ /// <param name="axisPosition">Axis position.</param>
+ /// <param name="firstPoint">First top point coordinates.</param>
+ /// <param name="secondPoint">Second top point coordinates.</param>
+ /// <param name="thirdPointPosition">Position where the third point is actually located or float.NaN if same as in "firstPoint".</param>
+ /// <param name="fourthPointPosition">Position where the fourth point is actually located or float.NaN if same as in "secondPoint".</param>
+ /// <param name="thirdPoint">Returns third bottom point coordinates.</param>
+ /// <param name="fourthPoint">Returns fourth bottom point coordinates.</param>
+ protected virtual void GetBottomPointsPosition(
+ CommonElements common,
+ ChartArea area,
+ float axisPosition,
+ ref DataPoint3D firstPoint,
+ ref DataPoint3D secondPoint,
+ PointF thirdPointPosition,
+ PointF fourthPointPosition,
+ out PointF thirdPoint,
+ out PointF fourthPoint)
+ {
+ thirdPoint = new PointF((float)firstPoint.xPosition, axisPosition);
+ fourthPoint = new PointF((float)secondPoint.xPosition, axisPosition);
+ }
+
+ /// <summary>
+ /// Returns how many loops through all data points is required (1 or 2)
+ /// </summary>
+ /// <param name="selection">Selection indicator.</param>
+ /// <param name="pointsArray">Points array list.</param>
+ /// <returns>Number of loops (1 or 2).</returns>
+ override protected int GetPointLoopNumber(bool selection, ArrayList pointsArray)
+ {
+ // Always one loop for selection
+ if(selection)
+ {
+ return 1;
+ }
+
+ // Second loop will be required for semi-transparent colors
+ int loopNumber = 1;
+ foreach(object obj in pointsArray)
+ {
+ // Get point & series
+ DataPoint3D pointEx = (DataPoint3D) obj;
+
+ // Check properties
+ if(pointEx.dataPoint.Color.A != 255)
+ {
+ loopNumber = 2;
+ }
+ }
+
+ return loopNumber;
+ }
+
+ #endregion
+
+ #region IDisposable overrides
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ { // Managed resources
+ if (this.areaPath != null)
+ {
+ this.areaPath.Dispose();
+ this.areaPath = null;
+ }
+ }
+ base.Dispose(disposing);
+ }
+ #endregion
+
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/BarChart.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/BarChart.cs
new file mode 100644
index 00000000000..f4be0d76685
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/BarChart.cs
@@ -0,0 +1,2351 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: BarChart.cs
+//
+// Namespace: DataVisualization.Charting.ChartTypes
+//
+// Classes: BarChart, RangeBarChart
+//
+// Purpose: Provides 2D/3D drawing and hit testing functionality
+// for the Bar and RangeBar charts.
+//
+// Reviewed: AG - August 1, 2002
+// AG - Microsoft 6, 2007
+//
+//===================================================================
+
+#region Used namespaces
+using System;
+using System.Resources;
+using System.Reflection;
+using System.Collections;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Globalization;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+ using System.Windows.Forms.DataVisualization.Charting;
+#else
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.ChartTypes
+#else
+ namespace System.Web.UI.DataVisualization.Charting.ChartTypes
+#endif
+{
+ #region Bar label style enumeration
+
+ /// <summary>
+ /// Bar chart value label drawing style.
+ /// </summary>
+ internal enum BarValueLabelDrawingStyle
+ {
+ /// <summary>
+ /// Outside of the bar.
+ /// </summary>
+ Outside,
+
+ /// <summary>
+ /// Inside the bar aligned to the left.
+ /// </summary>
+ Left,
+
+ /// <summary>
+ /// Inside the bar aligned to the center.
+ /// </summary>
+ Center,
+
+ /// <summary>
+ /// Inside the bar aligned to the right.
+ /// </summary>
+ Right,
+ };
+
+ #endregion
+
+ /// <summary>
+ /// BarChart class contains all the code necessary to draw
+ /// both Bar and RangeBar charts. The RangeBarChart class is used
+ /// to override few default settings, so that 2 Y values
+ /// will be used to define left and right position of each bar.
+ /// </summary>
+ internal class RangeBarChart : BarChart
+ {
+ #region Constructor
+
+ /// <summary>
+ /// Public constructor
+ /// </summary>
+ public RangeBarChart()
+ {
+ // Set the flag to use two Y values, while drawing the bars
+ this.useTwoValues = true;
+
+ // Change default style of the labels
+ this.defLabelDrawingStyle = BarValueLabelDrawingStyle.Center;
+ }
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ override public string Name { get{ return ChartTypeNames.RangeBar;}}
+
+ /// <summary>
+ /// If the crossing value is auto Crossing value should be
+ /// automatically set to zero for some chart
+ /// types (Bar, column, area etc.)
+ /// </summary>
+ override public bool ZeroCrossing { get{ return true;} }
+
+ /// <summary>
+ /// Number of supported Y value(s) per point
+ /// </summary>
+ override public int YValuesPerPoint{ get { return 2; } }
+
+ /// <summary>
+ /// Indicates that extra Y values are connected to the scale of the Y axis
+ /// </summary>
+ override public bool ExtraYValuesConnectedToYAxis{ get { return true; } }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// BarChart class provides 2D/3D drawing and hit testing
+ /// functionality for the Bar and RangeBar charts. The only
+ /// difference between the RangeBar and Bar chart is that
+ /// 2 Y values are used to position left and right side
+ /// of each RangeBar bar.
+ /// </summary>
+ internal class BarChart : IChartType
+ {
+ #region Fields
+
+ /// <summary>
+ /// Indicates that two Y values are used to calculate bar position
+ /// </summary>
+ protected bool useTwoValues = false;
+
+ /// <summary>
+ /// Indicates that bars from different series are drawn side by side
+ /// </summary>
+ protected bool drawSeriesSideBySide = true;
+
+ /// <summary>
+ /// Defines the default drawing style of the labels.
+ /// </summary>
+ protected BarValueLabelDrawingStyle defLabelDrawingStyle = BarValueLabelDrawingStyle.Outside;
+
+ /// <summary>
+ /// Indicates that second point loop is required to draw points labels or markers.
+ /// </summary>
+ protected bool pointLabelsMarkersPresent = false;
+
+ #endregion
+
+ #region Constructor
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public BarChart()
+ {
+ }
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ virtual public string Name { get{ return ChartTypeNames.Bar;}}
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ virtual public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+
+ /// <summary>
+ /// True if chart type is stacked
+ /// </summary>
+ public bool Stacked { get{ return false;}}
+
+
+ /// <summary>
+ /// True if stacked chart type supports groups
+ /// </summary>
+ virtual public bool SupportStackedGroups { get { return false; } }
+
+
+ /// <summary>
+ /// True if stacked chart type should draw separately positive and
+ /// negative data points ( Bar and column Stacked types ).
+ /// </summary>
+ public bool StackSign { get{ return false;}}
+
+ /// <summary>
+ /// True if chart type supports axeses
+ /// </summary>
+ public bool RequireAxes { get{ return true;} }
+
+ /// <summary>
+ /// Chart type with two y values used for scale ( bubble chart type )
+ /// </summary>
+ public bool SecondYScale{ get{ return false;} }
+
+ /// <summary>
+ /// True if chart type requires circular chart area.
+ /// </summary>
+ public bool CircularChartArea { get{ return false;} }
+
+ /// <summary>
+ /// True if chart type supports Logarithmic axes
+ /// </summary>
+ public bool SupportLogarithmicAxes { get{ return true;} }
+
+ /// <summary>
+ /// True if chart type requires to switch the value (Y) axes position
+ /// </summary>
+ public bool SwitchValueAxes { get{ return true;} }
+
+ /// <summary>
+ /// True if chart series can be placed side-by-side.
+ /// </summary>
+ virtual public bool SideBySideSeries { get{ return true;} }
+
+ /// <summary>
+ /// If the crossing value is auto Crossing value should be
+ /// automatically set to zero for some chart
+ /// types (Bar, column, area etc.)
+ /// </summary>
+ virtual public bool ZeroCrossing { get{ return true;} }
+
+ /// <summary>
+ /// True if each data point of a chart must be represented in the legend
+ /// </summary>
+ public bool DataPointsInLegend { get{ return false;} }
+
+ /// <summary>
+ /// Indicates that extra Y values are connected to the scale of the Y axis
+ /// </summary>
+ virtual public bool ExtraYValuesConnectedToYAxis{ get { return false; } }
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ virtual public bool HundredPercent{ get{return false;} }
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ virtual public bool HundredPercentSupportNegative{ get{return false;} }
+
+ /// <summary>
+ /// True if palette colors should be applied for each data paoint.
+ /// Otherwise the color is applied to the series.
+ /// </summary>
+ public bool ApplyPaletteColorsToPoints { get { return false; } }
+
+
+ /// <summary>
+ /// How to draw series/points in legend:
+ /// Filled rectangle, Line or Marker
+ /// </summary>
+ /// <param name="series">Legend item series.</param>
+ /// <returns>Legend item style.</returns>
+ public LegendImageStyle GetLegendImageStyle(Series series)
+ {
+ return LegendImageStyle.Rectangle;
+ }
+
+ /// <summary>
+ /// Number of supported Y value(s) per point
+ /// </summary>
+ virtual public int YValuesPerPoint{ get { return 1; } }
+
+ #endregion
+
+ #region Painting and selection methods
+
+ /// <summary>
+ /// Paint Bar Chart.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ public void Paint( ChartGraphics graph, CommonElements common, ChartArea area, Series seriesToDraw )
+ {
+ // Draw data points
+ this.pointLabelsMarkersPresent = false;
+ ProcessChartType( false, false, graph, common, area, seriesToDraw );
+
+ // Draw markers and lables
+ if(this.pointLabelsMarkersPresent)
+ {
+ ProcessChartType( true, false, graph, common, area, seriesToDraw );
+ }
+ }
+
+ /// <summary>
+ /// Calculates position of each bar in all series and either draws it or checks the selection.
+ /// </summary>
+ /// <param name="labels">Mode which draws only labels and markers.</param>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ private void ProcessChartType(
+ bool labels,
+ bool selection,
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ Series seriesToDraw )
+ {
+ //************************************************************
+ //** Local variables declaration
+ //************************************************************
+ int seriesIndx = 0; // Data Series index
+ bool sameInterval = false; // Series points are equally spaced
+
+ // Get pixel size
+ SizeF pixelRelSize = graph.GetRelativeSize(new SizeF(1.1f, 1.1f));
+
+
+ //************************************************************
+ //** Prosess 3D chart type
+ //************************************************************
+ if(area.Area3DStyle.Enable3D)
+ {
+ ProcessChartType3D( selection, graph, common, area, seriesToDraw );
+ return;
+ }
+
+
+ //************************************************************
+ //** Collect initial series data
+ //************************************************************
+
+ // All data series from chart area which have Bar chart type
+ List<string> typeSeries = area.GetSeriesFromChartType(Name);
+
+ // Check if series should be drawn side by side
+ bool currentDrawSeriesSideBySide = this.drawSeriesSideBySide;
+ foreach(string seriesName in typeSeries)
+ {
+ if(common.DataManager.Series[seriesName].IsCustomPropertySet(CustomPropertyName.DrawSideBySide))
+ {
+ string attribValue = common.DataManager.Series[seriesName][CustomPropertyName.DrawSideBySide];
+ if(String.Compare(attribValue, "False", StringComparison.OrdinalIgnoreCase ) == 0)
+ {
+ currentDrawSeriesSideBySide = false;
+ }
+ else if (String.Compare(attribValue, "True", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ currentDrawSeriesSideBySide = true;
+ }
+ else if (String.Compare(attribValue, "Auto", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ // Do nothing
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionAttributeDrawSideBySideInvalid));
+ }
+ }
+ }
+
+ // Find the number of "Bar chart" data series
+ int numOfSeries = typeSeries.Count;
+ if(!currentDrawSeriesSideBySide)
+ {
+ numOfSeries = 1;
+ }
+
+ // Check if bar chart series are indexed
+ bool indexedSeries = ChartHelper.IndexedSeries(area.Common, typeSeries.ToArray());
+
+
+ //************************************************************
+ //** Loop through all series
+ //************************************************************
+ foreach( Series ser in common.DataManager.Series )
+ {
+ // Process non empty series of the area with Bar chart type
+ if( String.Compare( ser.ChartTypeName, Name, true, System.Globalization.CultureInfo.CurrentCulture ) != 0
+ || ser.ChartArea != area.Name || ser.Points.Count == 0 || !ser.IsVisible())
+ {
+ continue;
+ }
+
+ // Set active horizontal axis
+ Axis vAxis = area.GetAxis(AxisName.X, ser.XAxisType, ser.XSubAxisName);
+ double vertViewMax = vAxis.ViewMaximum;
+ double vertViewMin = vAxis.ViewMinimum;
+
+ // Set active vertical axis
+ Axis hAxis = area.GetAxis(AxisName.Y, ser.YAxisType, ser.YSubAxisName);
+ double horizViewMax = hAxis.ViewMaximum;
+ double horizViewMin = hAxis.ViewMinimum;
+
+ // Get points interval:
+ // - set interval to 1 for indexed series
+ // - if points are not equaly spaced, the minimum interval between points is selected.
+ // - if points have same interval bars do not overlap each other.
+ double interval = 1;
+ if(!indexedSeries)
+ {
+ if(ser.Points.Count == 1 &&
+ (ser.XValueType == ChartValueType.Date ||
+ ser.XValueType == ChartValueType.DateTime ||
+ ser.XValueType == ChartValueType.Time ||
+ ser.XValueType == ChartValueType.DateTimeOffset))
+ {
+ // Check if interval is the same
+ area.GetPointsInterval( typeSeries, vAxis.IsLogarithmic, vAxis.logarithmBase, true, out sameInterval );
+
+ // Special case when there is only one data point and date scale is used.
+ if(!double.IsNaN(vAxis.majorGrid.GetInterval()) && vAxis.majorGrid.GetIntervalType() != DateTimeIntervalType.NotSet)
+ {
+ interval = ChartHelper.GetIntervalSize(vAxis.minimum, vAxis.majorGrid.GetInterval(), vAxis.majorGrid.GetIntervalType());
+ }
+ else
+ {
+ interval = ChartHelper.GetIntervalSize(vAxis.minimum, vAxis.Interval, vAxis.IntervalType);
+ }
+ }
+ else
+ {
+ interval = area.GetPointsInterval( typeSeries, vAxis.IsLogarithmic, vAxis.logarithmBase, true, out sameInterval );
+ }
+ }
+
+ // Calculates the width of bars.
+ double width = ser.GetPointWidth(graph, vAxis, interval, 0.8) / numOfSeries;
+
+ // Call Back Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPrePaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+
+ //************************************************************
+ //** Loop through all points in series
+ //************************************************************
+ int pointIndex = 0;
+ int markerIndex = 0;
+ foreach( DataPoint point in ser.Points )
+ {
+ // Check required Y values number
+ if(point.YValues.Length < this.YValuesPerPoint)
+ {
+ throw(new InvalidOperationException(SR.ExceptionChartTypeRequiresYValues(this.Name, this.YValuesPerPoint.ToString(CultureInfo.InvariantCulture) )));
+ }
+
+ // Reset pre-calculated point position
+ point.positionRel = new PointF(float.NaN, float.NaN);
+
+ // Get Y value and make sure it fits the chart area.
+ // If chart type uses 2 Y values (RangeBar) use second Y value for size.
+ double yValue = hAxis.GetLogValue( GetYValue(common, area, ser, point, pointIndex, (useTwoValues) ? 1 : 0) );
+
+ bool yValueOutside = false;
+ bool yValueStartOutside = true;
+ if( (decimal)yValue > (decimal)horizViewMax )
+ {
+ yValue = horizViewMax;
+ yValueOutside = true;
+ }
+ else if( (decimal)yValue < (decimal)horizViewMin )
+ {
+ yValue = horizViewMin;
+ yValueOutside = true;
+ }
+
+ // Calculate the bar size
+ double barSize = hAxis.GetLinearPosition( yValue );
+
+ // Set start position for a bar
+ double barStartPosition = 0;
+ if(useTwoValues)
+ {
+ // Point Y value (first) is used to determine the bar starting position
+ double yValueStart = hAxis.GetLogValue( GetYValue(common, area, ser, point, pointIndex, 0 ) );
+ yValueStartOutside = false;
+ if( (decimal)yValueStart > (decimal)horizViewMax )
+ {
+ yValueStart = horizViewMax;
+ yValueStartOutside = true;
+ }
+ else if( (decimal)yValueStart < (decimal)horizViewMin )
+ {
+ yValueStart = horizViewMin;
+ yValueStartOutside = true;
+ }
+
+ barStartPosition = hAxis.GetLinearPosition(yValueStart);
+ }
+ else
+ {
+ // Bar starts on the vertical axis
+ barStartPosition = hAxis.GetPosition(hAxis.Crossing);
+ }
+
+ // Calculate X position of the Bar
+ double xPosition = 0;
+ if( indexedSeries )
+ {
+ // The formula for position is based on a distance
+ // from the grid line or nPoints position.
+ xPosition = vAxis.GetPosition( (double)pointIndex + 1 ) - width * ((double) numOfSeries) / 2.0 + width/2 + seriesIndx * width;
+ }
+ else if( sameInterval )
+ {
+ xPosition = vAxis.GetPosition( point.XValue ) - width * ((double) numOfSeries) / 2.0 + width/2 + seriesIndx * width;
+ }
+ else
+ {
+ xPosition = vAxis.GetPosition( point.XValue );
+ }
+
+ // Make sure that points with small values are still visible
+ if( barSize < barStartPosition &&
+ (barStartPosition - barSize) < pixelRelSize.Width)
+ {
+ barSize = barStartPosition - pixelRelSize.Width;
+ }
+ if( barSize > barStartPosition &&
+ (barSize - barStartPosition) < pixelRelSize.Width)
+ {
+ barSize = barStartPosition + pixelRelSize.Width;
+ }
+
+ // Set rectangle coordinates of the bar
+ RectangleF rectSize = RectangleF.Empty;
+ try
+ {
+ // Set the bar rectangle
+ rectSize.Y = (float)(xPosition - width/2);
+ rectSize.Height = (float)(width);
+
+ // The left side of rectangle has always
+ // smaller value than a right value
+ if( barStartPosition < barSize )
+ {
+ rectSize.X = (float)barStartPosition;
+ rectSize.Width = (float)barSize - rectSize.X;
+ }
+ else
+ {
+ rectSize.X = (float)barSize;
+ rectSize.Width = (float)barStartPosition - rectSize.X;
+ }
+ }
+ catch(OverflowException)
+ {
+ pointIndex++;
+ continue;
+ }
+
+ // Remeber pre-calculated point position
+ point.positionRel = new PointF(( barStartPosition < barSize ) ? rectSize.Right : rectSize.X, (float)xPosition);
+
+ //************************************************************
+ //** Painting mode
+ //************************************************************
+ if( common.ProcessModePaint )
+ {
+ // if data point is not empty and not labels drawing mode
+ if( !point.IsEmpty && !labels)
+ {
+ // Check if column is completly out of the data scaleView
+ double xValue = (indexedSeries) ? pointIndex + 1 : point.XValue;
+ xValue = vAxis.GetLogValue(xValue);
+ if(xValue < vertViewMin || xValue > vertViewMax )
+ {
+ pointIndex++;
+ continue;
+ }
+
+ // Check if column is partialy in the data scaleView
+ bool clipRegionSet = false;
+ if(rectSize.Y < area.PlotAreaPosition.Y || rectSize.Bottom > area.PlotAreaPosition.Bottom)
+ {
+ // Set clipping region for line drawing
+ graph.SetClip( area.PlotAreaPosition.ToRectangleF() );
+ clipRegionSet = true;
+ }
+
+ // Start Svg Selection mode
+ graph.StartHotRegion( point );
+
+ // Draw the bar rectangle
+ graph.FillRectangleRel( rectSize,
+ point.Color,
+ point.BackHatchStyle,
+ point.BackImage,
+ point.BackImageWrapMode,
+ point.BackImageTransparentColor,
+ point.BackImageAlignment,
+ point.BackGradientStyle,
+ point.BackSecondaryColor,
+ point.BorderColor,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ ser.ShadowColor,
+ ser.ShadowOffset,
+ PenAlignment.Inset,
+ ChartGraphics.GetBarDrawingStyle(point),
+ false);
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+
+ // Reset Clip Region
+ if(clipRegionSet)
+ {
+ graph.ResetClip();
+ }
+
+ if (common.ProcessModeRegions)
+ {
+ common.HotRegionsList.AddHotRegion(rectSize, point, ser.Name, pointIndex);
+ }
+ }
+
+ // Draw labels and markers (only if part of the bar is visible)
+ if( !(yValueOutside && yValueStartOutside && rectSize.Width == 0f) )
+ {
+ if ((rectSize.Y + rectSize.Height / 2f) >= area.PlotAreaPosition.Y &&
+ (rectSize.Y + rectSize.Height / 2f) <= area.PlotAreaPosition.Bottom)
+ {
+ if(labels)
+ {
+ DrawLabelsAndMarkers( area, graph, common, rectSize, point, ser, barStartPosition, barSize, width, pointIndex, ref markerIndex);
+ }
+ else
+ {
+ // Check if separate drawing loop required for labels and markers
+ if(point.MarkerStyle != MarkerStyle.None || point.MarkerImage.Length > 0)
+ {
+ this.pointLabelsMarkersPresent = true;
+ }
+ else if(ser.IsValueShownAsLabel || point.IsValueShownAsLabel || point.Label.Length > 0)
+ {
+ this.pointLabelsMarkersPresent = true;
+ }
+ }
+ }
+ }
+ }
+
+ //************************************************************
+ // Hot Regions mode used for image maps, tool tips and
+ // hit test function
+ //************************************************************
+ if (common.ProcessModeRegions && !common.ProcessModePaint)
+ {
+ common.HotRegionsList.AddHotRegion( rectSize, point, ser.Name, pointIndex );
+
+ // Process labels and markers regions only if it was not done while painting
+ if(labels )
+ {
+ DrawLabelsAndMarkers( area, graph, common, rectSize, point, ser, barStartPosition, barSize, width, pointIndex, ref markerIndex);
+ }
+ }
+
+ // Increase the data index counter
+ pointIndex++;
+ }
+
+ // Call Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPostPaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+
+ // Increase data series index
+ if(currentDrawSeriesSideBySide)
+ {
+ seriesIndx++;
+ }
+
+ }
+ }
+
+ /// <summary>
+ /// Adjusts size in pixels to the DPIs different than 96.
+ /// </summary>
+ /// <param name="pixelSize">Size in pixels.</param>
+ /// <param name="graph">Chart graphics.</param>
+ /// <returns>Adjusted pixel size.</returns>
+ private static int GetAdjustedPixelSize(int pixelSize, ChartGraphics graph)
+ {
+ if (graph != null && graph.Graphics != null)
+ {
+ // Marker size is in pixels and we do the mapping for higher DPIs
+ SizeF size = new SizeF();
+ size.Width = pixelSize * graph.Graphics.DpiX / 96;
+ size.Height = pixelSize * graph.Graphics.DpiY / 96;
+ pixelSize = (int)Math.Max(size.Width, size.Height);
+ }
+
+ return pixelSize;
+ }
+
+ /// <summary>
+ /// Draws labels and markers.
+ /// </summary>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="rectSize">Bar rectangle.</param>
+ /// <param name="point">Data point.</param>
+ /// <param name="ser">Data series.</param>
+ /// <param name="barStartPosition">The zero position or the bottom of bars.</param>
+ /// <param name="barSize">The Height of bars.</param>
+ /// <param name="width">The width of bars.</param>
+ /// <param name="pointIndex">Point index.</param>
+ /// <param name="markerIndex">Marker index reference.</param>
+ private void DrawLabelsAndMarkers(
+ ChartArea area,
+ ChartGraphics graph,
+ CommonElements common,
+ RectangleF rectSize,
+ DataPoint point,
+ Series ser,
+ double barStartPosition,
+ double barSize,
+ double width,
+ int pointIndex,
+ ref int markerIndex)
+ {
+
+ //************************************************************
+ // Draw data point value marker
+ //************************************************************
+ SizeF markerSize = SizeF.Empty;
+ if(point.MarkerStyle != MarkerStyle.None || point.MarkerImage.Length > 0)
+ {
+ // Check if this marker should be drawn
+ if(markerIndex == 0)
+ {
+ // Find relative marker size
+ if(point.MarkerImage.Length == 0)
+ {
+ markerSize.Width = point.MarkerSize;
+ markerSize.Height = point.MarkerSize;
+ }
+ else
+ common.ImageLoader.GetAdjustedImageSize(point.MarkerImage, graph.Graphics, ref markerSize);
+
+ markerSize = graph.GetRelativeSize( markerSize );
+
+ // Calculate marker position
+ PointF markerPosition = PointF.Empty;
+ if( barStartPosition < barSize )
+ {
+ markerPosition.X = rectSize.Right;
+ }
+ else
+ {
+ markerPosition.X = rectSize.X;
+ }
+ markerPosition.Y = rectSize.Y + rectSize.Height/2F;
+
+ if( common.ProcessModePaint )
+ {
+ // Draw marker
+ graph.DrawMarkerRel(
+ markerPosition,
+ point.MarkerStyle,
+ BarChart.GetAdjustedPixelSize(point.MarkerSize, graph),
+ (point.MarkerColor == Color.Empty) ? point.Color : point.MarkerColor,
+ point.MarkerBorderColor,
+ point.MarkerBorderWidth,
+ point.MarkerImage,
+ point.MarkerImageTransparentColor,
+ (point.series != null) ? point.series.ShadowOffset : 0,
+ (point.series != null) ? point.series.ShadowColor : Color.Empty,
+ RectangleF.Empty);
+ }
+ if( common.ProcessModeRegions )
+ {
+ SetHotRegions(
+ common,
+ graph,
+ point,
+ markerSize,
+ point.series.Name,
+ pointIndex,
+ point.MarkerStyle,
+ markerPosition );
+ }
+ }
+
+ // Increase the markers counter
+ ++markerIndex;
+ if(ser.MarkerStep == markerIndex)
+ {
+ markerIndex = 0;
+ }
+
+ }
+
+ //************************************************************
+ // Draw data point value label
+ //************************************************************
+ if (point.Label.Length > 0 ||
+ (!point.IsEmpty && (ser.IsValueShownAsLabel || point.IsValueShownAsLabel)))
+ {
+ // Label rectangle
+ RectangleF rectLabel = RectangleF.Empty;
+
+ // Label text format
+ using (StringFormat format = new StringFormat())
+ {
+
+ //************************************************************
+ // Get label text
+ //************************************************************
+ string text;
+ if( point.Label.Length == 0 )
+ {
+ text = ValueConverter.FormatValue(
+ ser.Chart,
+ point,
+ point.Tag,
+ GetYValue(common, area, ser, point, pointIndex, 0 ),
+ point.LabelFormat,
+ ser.YValueType,
+ ChartElementType.DataPoint);
+ }
+ else
+ {
+ text = point.ReplaceKeywords(point.Label);
+ }
+
+ //************************************************************
+ // Check labels style custom properties
+ //************************************************************
+ BarValueLabelDrawingStyle drawingStyle = defLabelDrawingStyle;
+ string valueLabelAttrib = "";
+ if (point.IsCustomPropertySet(CustomPropertyName.BarLabelStyle))
+ {
+ valueLabelAttrib = point[CustomPropertyName.BarLabelStyle];
+ }
+ else if (ser.IsCustomPropertySet(CustomPropertyName.BarLabelStyle))
+ {
+ valueLabelAttrib = ser[CustomPropertyName.BarLabelStyle];
+ }
+
+ if (valueLabelAttrib.Length > 0)
+ {
+ if (String.Compare(valueLabelAttrib, "Left", StringComparison.OrdinalIgnoreCase) == 0)
+ drawingStyle = BarValueLabelDrawingStyle.Left;
+ if (String.Compare(valueLabelAttrib, "Right", StringComparison.OrdinalIgnoreCase) == 0)
+ drawingStyle = BarValueLabelDrawingStyle.Right;
+ if (String.Compare(valueLabelAttrib, "Center", StringComparison.OrdinalIgnoreCase) == 0)
+ drawingStyle = BarValueLabelDrawingStyle.Center;
+ else if (String.Compare(valueLabelAttrib, "Outside", StringComparison.OrdinalIgnoreCase) == 0)
+ drawingStyle = BarValueLabelDrawingStyle.Outside;
+ }
+
+ //************************************************************
+ // Make sure label fits. Otherwise change it style
+ //************************************************************
+ bool labelFit = false;
+ bool labelSwitched = false;
+ bool labelSwitchedBack = false;
+ float prevWidth = 0f;
+ while (!labelFit)
+ {
+ // LabelStyle text format
+ format.Alignment = StringAlignment.Near;
+ format.LineAlignment = StringAlignment.Center;
+
+ // Label rectangle
+ if (barStartPosition <= barSize)
+ {
+ rectLabel.X = rectSize.Right;
+ rectLabel.Width = area.PlotAreaPosition.Right - rectSize.Right;
+ if (rectLabel.Width < 0.001f &&
+ barStartPosition == barSize)
+ {
+ rectLabel.Width = rectSize.X - area.PlotAreaPosition.X;
+ rectLabel.X = area.PlotAreaPosition.X;
+ format.Alignment = StringAlignment.Far;
+ }
+ }
+ else
+ {
+ rectLabel.X = area.PlotAreaPosition.X;
+ rectLabel.Width = rectSize.X - area.PlotAreaPosition.X;
+ }
+
+ // Adjust label rectangle
+ rectLabel.Y = rectSize.Y - (float)width / 2F;
+ rectLabel.Height = rectSize.Height + (float)width;
+
+ // Adjust label position depending on the drawing style
+ if (drawingStyle == BarValueLabelDrawingStyle.Outside)
+ {
+ // Adjust position if point marker is drawn
+ if (!markerSize.IsEmpty)
+ {
+ rectLabel.Width -= (float)Math.Min(rectLabel.Width, markerSize.Width / 2F);
+ if (barStartPosition < barSize)
+ {
+ rectLabel.X += (float)Math.Min(rectLabel.Width, markerSize.Width / 2F);
+ }
+ }
+ }
+ else if (drawingStyle == BarValueLabelDrawingStyle.Left)
+ {
+ rectLabel = rectSize;
+ format.Alignment = StringAlignment.Near;
+ }
+ else if (drawingStyle == BarValueLabelDrawingStyle.Center)
+ {
+ rectLabel = rectSize;
+ format.Alignment = StringAlignment.Center;
+ }
+ else if (drawingStyle == BarValueLabelDrawingStyle.Right)
+ {
+ rectLabel = rectSize;
+ format.Alignment = StringAlignment.Far;
+
+ // Adjust position if point marker is drawn
+ if (!markerSize.IsEmpty)
+ {
+ rectLabel.Width -= (float)Math.Min(rectLabel.Width, markerSize.Width / 2F);
+ if (barStartPosition >= barSize)
+ {
+ rectLabel.X += (float)Math.Min(rectLabel.Width, markerSize.Width / 2F);
+ }
+ }
+ }
+
+ // Reversed string alignment
+ if (barStartPosition > barSize)
+ {
+ if (format.Alignment == StringAlignment.Far)
+ format.Alignment = StringAlignment.Near;
+ else if (format.Alignment == StringAlignment.Near)
+ format.Alignment = StringAlignment.Far;
+ }
+
+ // Make sure value label fits rectangle.
+ SizeF valueTextSize = graph.MeasureStringRel(text, point.Font);
+ if (!labelSwitched &&
+ !labelSwitchedBack &&
+ valueTextSize.Width > rectLabel.Width - 1)
+ {
+ // Switch label style only once
+ labelSwitched = true;
+ prevWidth = rectLabel.Width;
+
+ // If text do not fit - try to switch between Outside/Inside drawing styles
+ if (drawingStyle == BarValueLabelDrawingStyle.Outside)
+ {
+ drawingStyle = BarValueLabelDrawingStyle.Right;
+ }
+ else
+ {
+ drawingStyle = BarValueLabelDrawingStyle.Outside;
+ }
+ }
+ else
+ {
+ // If label do not fit either Outside or to the Right,
+ // select the style that has more space available.
+ if (labelSwitched &&
+ !labelSwitchedBack &&
+ valueTextSize.Width > rectLabel.Width - 1 &&
+ prevWidth > rectLabel.Width)
+ {
+ labelSwitchedBack = true;
+
+ // Change back to the previous labels style
+ if (drawingStyle == BarValueLabelDrawingStyle.Outside)
+ {
+ drawingStyle = BarValueLabelDrawingStyle.Right;
+ }
+ else
+ {
+ drawingStyle = BarValueLabelDrawingStyle.Outside;
+ }
+ }
+ else
+ {
+ // Do not try to fit labels any more
+ labelFit = true;
+ }
+ }
+ }
+
+ //************************************************************
+ // Draw label
+ //************************************************************
+
+ // Calculate label background position
+ RectangleF labelBackPosition = RectangleF.Empty;
+ if (common.ProcessModeRegions ||
+ !point.LabelBackColor.IsEmpty ||
+ !point.LabelBorderColor.IsEmpty)
+ {
+ if (rectLabel.Width > 0 && rectLabel.Height > 0)
+ {
+ // Get label background position
+ SizeF valueTextSize = graph.MeasureStringRel(text, point.Font);
+ valueTextSize.Height += valueTextSize.Height / 8;
+ float spacing = valueTextSize.Width / text.Length / 2;
+ valueTextSize.Width += spacing;
+ labelBackPosition = new RectangleF(
+ rectLabel.X,
+ rectLabel.Y + (rectLabel.Height - valueTextSize.Height) / 2,
+ valueTextSize.Width,
+ valueTextSize.Height);
+
+ // Adjust position based on alignment
+ if (format.Alignment == StringAlignment.Near)
+ {
+ labelBackPosition.X += spacing / 2f;
+ rectLabel.X += spacing;
+ }
+ else if (format.Alignment == StringAlignment.Center)
+ {
+ labelBackPosition.X = rectLabel.X + (rectLabel.Width - valueTextSize.Width) / 2f;
+ }
+ else if (format.Alignment == StringAlignment.Far)
+ {
+ labelBackPosition.X = rectLabel.Right - valueTextSize.Width - spacing / 2f;
+ rectLabel.X -= spacing;
+ }
+ }
+ }
+
+ // Make sure there is enough vertical space for the label
+ // NOTE: Fixes issue #4502
+ SizeF textSize = graph.MeasureStringRel(text, point.Font);
+ if (textSize.Height > rectLabel.Height)
+ {
+ rectLabel.Y -= (textSize.Height - rectLabel.Height) / 2f;
+ rectLabel.Height = textSize.Height;
+ }
+
+ // Draw label text
+ using (Brush brush = new SolidBrush(point.LabelForeColor))
+ {
+ graph.DrawPointLabelStringRel(
+ common,
+ text,
+ point.Font,
+ brush,
+ rectLabel,
+ format,
+ point.LabelAngle,
+ labelBackPosition,
+
+ point.LabelBackColor,
+ point.LabelBorderColor,
+ point.LabelBorderWidth,
+ point.LabelBorderDashStyle,
+ ser,
+ point,
+ pointIndex);
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Inserts Hot Regions used for image maps, tool tips and
+ /// hit test function
+ /// </summary>
+ /// <param name="common">Common elements object</param>
+ /// <param name="graph">Chart Graphics object</param>
+ /// <param name="point">Data point used for hot region</param>
+ /// <param name="markerSize">Size of the marker</param>
+ /// <param name="seriesName">Name of the series</param>
+ /// <param name="pointIndex">Data point index</param>
+ /// <param name="pointMarkerStyle">Marker Style</param>
+ /// <param name="markerPosition">Marker Position</param>
+ private void SetHotRegions( CommonElements common, ChartGraphics graph, DataPoint point, SizeF markerSize, string seriesName, int pointIndex, MarkerStyle pointMarkerStyle, PointF markerPosition )
+ {
+
+ // Get relative marker size
+ SizeF relativeMarkerSize = markerSize;
+
+ int insertIndex = common.HotRegionsList.FindInsertIndex();
+
+ // Insert circle area
+ if( pointMarkerStyle == MarkerStyle.Circle )
+ {
+ common.HotRegionsList.AddHotRegion( insertIndex, graph, markerPosition.X, markerPosition.Y, relativeMarkerSize.Width/2f, point, seriesName, pointIndex );
+ }
+ // All other markers represented as rectangles
+ else
+ {
+ // Insert area
+ common.HotRegionsList.AddHotRegion(
+ new RectangleF(markerPosition.X - relativeMarkerSize.Width/2f, markerPosition.Y - relativeMarkerSize.Height/2f, relativeMarkerSize.Width, relativeMarkerSize.Height),
+ point,
+ seriesName,
+ pointIndex );
+ }
+
+ }
+
+ #endregion
+
+ #region Getting Y value methods
+
+ /// <summary>
+ /// Helper function, which returns the Y value of the point.
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="area">Chart area the series belongs to.</param>
+ /// <param name="series">Sereis of the point.</param>
+ /// <param name="point">Point object.</param>
+ /// <param name="pointIndex">Index of the point.</param>
+ /// <param name="yValueIndex">Index of the Y value to get.</param>
+ /// <returns>Y value of the point.</returns>
+ virtual public double GetYValue(
+ CommonElements common,
+ ChartArea area,
+ Series series,
+ DataPoint point,
+ int pointIndex,
+ int yValueIndex)
+ {
+ // Point chart do not have height
+ if(yValueIndex == -1)
+ {
+ return 0.0;
+ }
+
+ // Check required Y values number
+ if (point.YValues.Length <= yValueIndex)
+ {
+ throw (new InvalidOperationException(SR.ExceptionChartTypeRequiresYValues(this.Name, this.YValuesPerPoint.ToString(CultureInfo.InvariantCulture))));
+ }
+
+ if (point.IsEmpty || double.IsNaN(point.YValues[yValueIndex]))
+ {
+ // Get empty point value
+ double result = GetEmptyPointValue(point, pointIndex, yValueIndex);
+
+ // NOTE: Fixes issue #6921
+ // If empty point Y value is zero then check if the scale of
+ // the Y axis and if it is not containing zero adjust the Y value
+ // of the empty point, so it will be visible
+ if (result == 0.0)
+ {
+ Axis yAxis = area.GetAxis(AxisName.Y, series.YAxisType, series.YSubAxisName);
+ double yViewMax = yAxis.maximum;
+ double yViewMin = yAxis.minimum;
+ if (result < yViewMin)
+ {
+ result = yViewMin;
+ }
+ else if (result > yViewMax)
+ {
+ result = yViewMax;
+ }
+ }
+
+ return result;
+ }
+
+ // Return Y value from the point
+ return point.YValues[yValueIndex];
+ }
+
+ /// <summary>
+ /// This method will find previous and next data point, which is not
+ /// empty and recalculate a new value for current empty data point.
+ /// New value depends on custom attribute “EmptyPointValue” and
+ /// it could be zero or average.
+ /// </summary>
+ /// <param name="point">IsEmpty data point.</param>
+ /// <param name="pointIndex">IsEmpty data point index.</param>
+ /// <param name="yValueIndex">Index of the Y value to get.</param>
+ /// <returns>A Value for empty data point.</returns>
+ internal double GetEmptyPointValue( DataPoint point, int pointIndex, int yValueIndex)
+ {
+ Series series = point.series; // Data series
+ double previousPoint = 0; // Previous data point value (not empty)
+ double nextPoint = 0; // Next data point value (not empty)
+ int prevIndx = 0; // Previous data point index
+ int nextIndx = series.Points.Count - 1; // Next data point index
+
+ //************************************************************
+ //** Check custom attribute "EmptyPointValue"
+ //************************************************************
+ string emptyPointValue = "";
+ if( series.EmptyPointStyle.IsCustomPropertySet(CustomPropertyName.EmptyPointValue) )
+ {
+ emptyPointValue = series.EmptyPointStyle[CustomPropertyName.EmptyPointValue];
+ }
+ else if( series.IsCustomPropertySet(CustomPropertyName.EmptyPointValue) )
+ {
+ emptyPointValue = series[CustomPropertyName.EmptyPointValue];
+ }
+
+ // Take attribute value
+ if (String.Compare(emptyPointValue, "Zero", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ // IsEmpty points represented with zero values
+ return 0;
+ }
+
+ //************************************************************
+ //** IsEmpty point value is an average of neighbour points
+ //************************************************************
+
+ // Find previous non-empty point value
+ for( int indx = pointIndex; indx >= 0; indx-- )
+ {
+ if( !series.Points[indx].IsEmpty )
+ {
+ previousPoint = series.Points[indx].YValues[yValueIndex];
+ prevIndx = indx;
+ break;
+ }
+ previousPoint = Double.NaN;
+ }
+
+ // Find next non-empty point value
+ for( int indx = pointIndex; indx < series.Points.Count; indx++ )
+ {
+ if( !series.Points[indx].IsEmpty )
+ {
+ nextPoint = series.Points[indx].YValues[yValueIndex];
+ nextIndx = indx;
+ break;
+ }
+ nextPoint = Double.NaN;
+ }
+
+ // All Previous points are empty
+ if( Double.IsNaN( previousPoint ) )
+ {
+ // All points are empty
+ if( Double.IsNaN( nextPoint ) )
+ {
+ previousPoint = 0;
+ }
+ else // Next point is equal to previous point
+ {
+ previousPoint = nextPoint;
+ }
+ }
+
+ // All next points are empty
+ if( Double.IsNaN( nextPoint ) )
+ {
+ // Previous point is equal to next point
+ nextPoint = previousPoint;
+ }
+
+ // If points value are the same use average
+ if( series.Points[nextIndx].XValue == series.Points[prevIndx].XValue )
+ {
+ return ( previousPoint + nextPoint ) / 2;
+ }
+
+ // Calculate and return average value
+ double aCoeff = (previousPoint - nextPoint) / (series.Points[nextIndx].XValue - series.Points[prevIndx].XValue);
+ return -aCoeff * (point.XValue - series.Points[prevIndx].XValue) + previousPoint;
+ }
+
+ #endregion
+
+ #region 3D Drawing and Selection
+
+ /// <summary>
+ /// Calculates position of each bar in all series and either draws it or checks the selection in 3D space.
+ /// </summary>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ private void ProcessChartType3D(
+ bool selection,
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ Series seriesToDraw )
+ {
+ //************************************************************
+ //** Local variables declaration
+ //************************************************************
+
+ // Get pixel size
+ SizeF pixelRelSize = graph.GetRelativeSize(new SizeF(1.1f, 1.1f));
+
+
+ //************************************************************
+ //** Get list of series to draw
+ //************************************************************
+ double xValue = 0;
+ List<string> typeSeries = null;
+ bool currentDrawSeriesSideBySide = this.drawSeriesSideBySide;
+ if( (area.Area3DStyle.IsClustered && this.SideBySideSeries) ||
+ this.Stacked)
+ {
+ // Draw all series of the same chart type
+ typeSeries = area.GetSeriesFromChartType(Name);
+
+ // Check if series should be drawn side by side
+ foreach(string seriesName in typeSeries)
+ {
+ if(common.DataManager.Series[seriesName].IsCustomPropertySet(CustomPropertyName.DrawSideBySide))
+ {
+ string attribValue = common.DataManager.Series[seriesName][CustomPropertyName.DrawSideBySide];
+ if(String.Compare(attribValue, "False", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ currentDrawSeriesSideBySide = false;
+ }
+ else if(String.Compare(attribValue, "True", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ currentDrawSeriesSideBySide = true;
+ }
+ else if(String.Compare(attribValue, "Auto", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ // Do nothing
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionAttributeDrawSideBySideInvalid));
+ }
+ }
+ }
+ }
+ else
+ {
+ // Draw just one chart series
+ typeSeries = new List<string>();
+ typeSeries.Add(seriesToDraw.Name);
+ }
+
+ //************************************************************
+ //** Get order of data points drawing
+ //************************************************************
+ ArrayList dataPointDrawingOrder = area.GetDataPointDrawingOrder(
+ typeSeries,
+ this,
+ selection,
+ COPCoordinates.X | COPCoordinates.Y,
+ new BarPointsDrawingOrderComparer(area, selection, COPCoordinates.X | COPCoordinates.Y),
+ 0,
+ currentDrawSeriesSideBySide);
+
+ //************************************************************
+ //** Loop through all data poins
+ //************************************************************
+ bool drawLabels = false;
+ foreach(object obj in dataPointDrawingOrder)
+ {
+ // Get point & series
+ DataPoint3D pointEx = (DataPoint3D) obj;
+ DataPoint point = pointEx.dataPoint;
+ Series ser = point.series;
+
+ // Check required Y values number
+ if(point.YValues.Length < this.YValuesPerPoint)
+ {
+ throw(new InvalidOperationException(SR.ExceptionChartTypeRequiresYValues(this.Name, this.YValuesPerPoint.ToString(CultureInfo.InvariantCulture))));
+ }
+
+ // Reset pre-calculated point position
+ point.positionRel = new PointF(float.NaN, float.NaN);
+
+ // Set active vertical/horizontal axis
+ Axis vAxis = area.GetAxis(AxisName.X, ser.XAxisType, ser.XSubAxisName);
+ Axis hAxis = area.GetAxis(AxisName.Y, ser.YAxisType, ser.YSubAxisName);
+
+ // Get point bar drawing style
+ BarDrawingStyle barDrawingStyle = ChartGraphics.GetBarDrawingStyle(point);
+
+ // Get Y value and make sure it fits the chart area.
+ // If chart type uses 2 Y values (RangeBar) use second Y value for size.
+ float rightDarkening = 0f;
+ float leftDarkening = 0f;
+ double yValue = hAxis.GetLogValue( GetYValue(common, area, ser, pointEx.dataPoint, pointEx.index - 1, (useTwoValues) ? 1 : 0) );
+ if( yValue > hAxis.ViewMaximum )
+ {
+ rightDarkening = 0.5f;
+ yValue = hAxis.ViewMaximum;
+ }
+ else if( yValue < hAxis.ViewMinimum )
+ {
+ rightDarkening = 0.5f;
+ yValue = hAxis.ViewMinimum;
+ }
+
+ // Calculate the bar size
+ double barSize = hAxis.GetLinearPosition( yValue );
+
+ // Set start position for a bar
+ double barStartPosition = 0;
+ if(useTwoValues)
+ {
+ // Point Y value (first) is used to determine the bar starting position
+ double yValueStart = hAxis.GetLogValue( GetYValue(common, area, ser, pointEx.dataPoint, pointEx.index - 1, 0 ) );
+ if( yValueStart > hAxis.ViewMaximum )
+ {
+ leftDarkening = 0.5f;
+ yValueStart = hAxis.ViewMaximum;
+ }
+ else if( yValueStart < hAxis.ViewMinimum )
+ {
+ leftDarkening = 0.5f;
+ yValueStart = hAxis.ViewMinimum;
+ }
+
+ barStartPosition = hAxis.GetLinearPosition(yValueStart);
+ }
+ else
+ {
+ // Bar starts on the vertical axis
+ barStartPosition = hAxis.GetPosition(hAxis.Crossing);
+ }
+
+ // Calculate X position of the Bar
+ double xPosition = pointEx.xPosition;
+
+ // Make sure that points with small values are still visible
+ if( barSize < barStartPosition &&
+ (barStartPosition - barSize) < pixelRelSize.Width)
+ {
+ barSize = barStartPosition - pixelRelSize.Width;
+ }
+ if( barSize > barStartPosition &&
+ (barSize - barStartPosition) < pixelRelSize.Width)
+ {
+ barSize = barStartPosition + pixelRelSize.Width;
+ }
+
+ // Set rectangle coordinates of the bar
+ RectangleF rectSize = RectangleF.Empty;
+ try
+ {
+ // Set the bar rectangle
+ rectSize.Y = (float)(xPosition - pointEx.width/2);
+ rectSize.Height = (float)(pointEx.width);
+
+ // The left side of rectangle has always
+ // smaller value than a right value
+ if( barStartPosition < barSize )
+ {
+ rectSize.X = (float)barStartPosition;
+ rectSize.Width = (float)barSize - rectSize.X;
+ }
+ else
+ {
+ float temp = rightDarkening;
+ rightDarkening = leftDarkening;
+ leftDarkening = temp;
+
+ rectSize.X = (float)barSize;
+ rectSize.Width = (float)barStartPosition - rectSize.X;
+ }
+ }
+ catch(OverflowException)
+ {
+ continue;
+ }
+
+ // Remeber pre-calculated point position
+ point.positionRel = new PointF(rectSize.Right, (float)xPosition);
+
+
+ //************************************************************
+ //** Painting mode
+ //************************************************************
+ GraphicsPath rectPath = null;
+
+ // if data point is not empty
+ if( !point.IsEmpty )
+ {
+ // Check if column is completly out of the data scaleView
+ xValue = (pointEx.indexedSeries) ? pointEx.index : point.XValue;
+ xValue = vAxis.GetLogValue(xValue);
+ if(xValue < vAxis.ViewMinimum || xValue > vAxis.ViewMaximum )
+ {
+ continue;
+ }
+
+ // Check if column is partialy in the data scaleView
+ bool clipRegionSet = false;
+ if(rectSize.Bottom <= area.PlotAreaPosition.Y || rectSize.Y >= area.PlotAreaPosition.Bottom)
+ {
+ continue;
+ }
+ if(rectSize.Y < area.PlotAreaPosition.Y)
+ {
+ rectSize.Height -= area.PlotAreaPosition.Y - rectSize.Y;
+ rectSize.Y = area.PlotAreaPosition.Y;
+ }
+ if(rectSize.Bottom > area.PlotAreaPosition.Bottom)
+ {
+ rectSize.Height -= rectSize.Bottom - area.PlotAreaPosition.Bottom;
+ }
+ if(rectSize.Height < 0)
+ {
+ rectSize.Height = 0;
+ }
+ if(rectSize.Height == 0f || rectSize.Width == 0f)
+ {
+ continue;
+ }
+
+ // Detect if we need to get graphical path of drawn object
+ DrawingOperationTypes drawingOperationType = DrawingOperationTypes.DrawElement;
+
+ if( common.ProcessModeRegions )
+ {
+ drawingOperationType |= DrawingOperationTypes.CalcElementPath;
+ }
+
+ // Start Svg Selection mode
+ graph.StartHotRegion( point );
+
+ // Draw the bar rectangle
+ rectPath = graph.Fill3DRectangle(
+ rectSize,
+ pointEx.zPosition,
+ pointEx.depth,
+ area.matrix3D,
+ area.Area3DStyle.LightStyle,
+ point.Color,
+ rightDarkening,
+ leftDarkening,
+ point.BorderColor,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ barDrawingStyle,
+ false,
+ drawingOperationType );
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+
+ // Reset Clip Region
+ if(clipRegionSet)
+ {
+ graph.ResetClip();
+ }
+ }
+
+ // Draw 3D markers
+ DrawMarkers3D( area, graph, common, rectSize, pointEx, ser, barStartPosition, barSize );
+
+ // Check if labels should be drawn (in additional points loop)
+ if( point.IsValueShownAsLabel || point.Label.Length > 0 )
+ {
+ drawLabels = true;
+ }
+
+ //************************************************************
+ // Hot Regions mode used for image maps, tool tips and
+ // hit test function
+ //************************************************************
+ if( common.ProcessModeRegions )
+ {
+ common.HotRegionsList.AddHotRegion(
+ rectPath,
+ false,
+ graph,
+ point,
+ ser.Name,
+ pointEx.index - 1 );
+ }
+ if (rectPath != null)
+ {
+ rectPath.Dispose();
+ }
+ }
+
+
+ //************************************************************
+ //** Loop through all data poins and draw labels
+ //************************************************************
+ if(drawLabels)
+ {
+ foreach(object obj in dataPointDrawingOrder)
+ {
+ // Get point & series
+ DataPoint3D pointEx = (DataPoint3D) obj;
+ DataPoint point = pointEx.dataPoint;
+ Series ser = point.series;
+
+ // Set active vertical/horizontal axis
+ Axis vAxis = area.GetAxis(AxisName.X, ser.XAxisType, ser.XSubAxisName);
+ Axis hAxis = area.GetAxis(AxisName.Y, ser.YAxisType, ser.YSubAxisName);
+
+ // Get Y value and make sure it fits the chart area.
+ // If chart type uses 2 Y values (RangeBar) use second Y value for size.
+ double yValue = hAxis.GetLogValue( GetYValue(common, area, ser, pointEx.dataPoint, pointEx.index - 1, (useTwoValues) ? 1 : 0) );
+ if( yValue > hAxis.ViewMaximum )
+ {
+ yValue = hAxis.ViewMaximum;
+ }
+ else if( yValue < hAxis.ViewMinimum )
+ {
+ yValue = hAxis.ViewMinimum;
+ }
+
+ // Calculate the bar size
+ double barSize = hAxis.GetLinearPosition( yValue );
+
+ // Set start position for a bar
+ double barStartPosition = 0;
+ if(useTwoValues)
+ {
+ // Point Y value (first) is used to determine the bar starting position
+ double yValueStart = hAxis.GetLogValue( GetYValue(common, area, ser, pointEx.dataPoint, pointEx.index - 1, 0 ) );
+ if( yValueStart > hAxis.ViewMaximum )
+ {
+ yValueStart = hAxis.ViewMaximum;
+ }
+ else if( yValueStart < hAxis.ViewMinimum )
+ {
+ yValueStart = hAxis.ViewMinimum;
+ }
+
+ barStartPosition = hAxis.GetLinearPosition(yValueStart);
+ }
+ else
+ {
+ // Bar starts on the vertical axis
+ barStartPosition = hAxis.GetPosition(hAxis.Crossing);
+ }
+
+ // Calculate X position of the Bar
+ double xPosition = pointEx.xPosition;
+
+ // Set rectangle coordinates of the bar
+ RectangleF rectSize = RectangleF.Empty;
+ try
+ {
+ // Set the bar rectangle
+ rectSize.Y = (float)(xPosition - pointEx.width/2);
+ rectSize.Height = (float)(pointEx.width);
+
+ // The left side of rectangle has always
+ // smaller value than a right value
+ if( barStartPosition < barSize )
+ {
+ rectSize.X = (float)barStartPosition;
+ rectSize.Width = (float)barSize - rectSize.X;
+ }
+ else
+ {
+ rectSize.X = (float)barSize;
+ rectSize.Width = (float)barStartPosition - rectSize.X;
+ }
+ }
+ catch(OverflowException)
+ {
+ continue;
+ }
+
+
+ //************************************************************
+ //** Painting mode
+ //************************************************************
+ // if data point is not empty
+ if( !point.IsEmpty )
+ {
+ // Check if column is completly out of the data scaleView
+ xValue = (pointEx.indexedSeries) ? pointEx.index : point.XValue;
+ xValue = vAxis.GetLogValue(xValue);
+ if(xValue < vAxis.ViewMinimum || xValue > vAxis.ViewMaximum )
+ {
+ continue;
+ }
+
+ // Check if column is partialy in the data scaleView
+ if ((decimal)rectSize.Y >= (decimal)area.PlotAreaPosition.Y && (decimal)rectSize.Bottom <= (decimal)area.PlotAreaPosition.Bottom)
+ {
+ // Draw 3D labels
+ DrawLabels3D(area, graph, common, rectSize, pointEx, ser, barStartPosition, barSize, pointEx.width, pointEx.index - 1);
+ }
+ }
+ }
+ }
+
+ }
+
+ /// <summary>
+ /// Draws markers in 3D.
+ /// </summary>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="rectSize">Bar rectangle.</param>
+ /// <param name="pointEx">Data point.</param>
+ /// <param name="ser">Data series.</param>
+ /// <param name="barStartPosition">The zero position or the bottom of bars.</param>
+ /// <param name="barSize">The Height of bars.</param>
+ private void DrawMarkers3D(
+ ChartArea area,
+ ChartGraphics graph,
+ CommonElements common,
+ RectangleF rectSize,
+ DataPoint3D pointEx,
+ Series ser,
+ double barStartPosition,
+ double barSize)
+ {
+ DataPoint point = pointEx.dataPoint;
+
+ //************************************************************
+ // Draw data point value marker
+ //************************************************************
+ SizeF markerSize = SizeF.Empty;
+ if(point.MarkerStyle != MarkerStyle.None || point.MarkerImage.Length > 0)
+ {
+ // Check if this marker should be drawn
+ if((pointEx.index % ser.MarkerStep) == 0)
+ {
+ // Find relative marker size
+ if(point.MarkerImage.Length == 0)
+ {
+ markerSize.Width = point.MarkerSize;
+ markerSize.Height = point.MarkerSize;
+ }
+ else
+ common.ImageLoader.GetAdjustedImageSize(point.MarkerImage, graph.Graphics, ref markerSize);
+
+ markerSize = graph.GetRelativeSize( markerSize );
+
+ // Calculate marker position
+ PointF markerPosition = PointF.Empty;
+ if( barStartPosition < barSize )
+ {
+ markerPosition.X = rectSize.Right;
+ }
+ else
+ {
+ markerPosition.X = rectSize.X;
+ }
+ markerPosition.Y = rectSize.Y + rectSize.Height/2F;
+
+ //************************************************************
+ //** Transform marker position in 3D space
+ //************************************************************
+ // Get projection coordinates
+ Point3D[] marker3DPosition = new Point3D[1];
+ marker3DPosition[0] = new Point3D(markerPosition.X, markerPosition.Y, (float)(pointEx.zPosition + pointEx.depth/2f));
+
+ // Transform coordinates of text size
+ area.matrix3D.TransformPoints(marker3DPosition);
+
+
+ //************************************************************
+ //** Draw 3D marker
+ //************************************************************
+ graph.DrawMarker3D(
+ area.matrix3D,
+ area.Area3DStyle.LightStyle,
+ pointEx.zPosition + pointEx.depth/2f,
+ markerPosition,
+ point.MarkerStyle,
+ BarChart.GetAdjustedPixelSize(point.MarkerSize, graph),
+ (point.MarkerColor.IsEmpty) ? point.series.Color : point.MarkerColor,
+ point.MarkerBorderColor,
+ point.MarkerBorderWidth,
+ point.MarkerImage,
+ point.MarkerImageTransparentColor,
+ (point.series != null) ? point.series.ShadowOffset : 0,
+ (point.series != null) ? point.series.ShadowColor : Color.Empty,
+ RectangleF.Empty,
+ DrawingOperationTypes.DrawElement);
+ }
+ }
+ }
+
+
+ /// <summary>
+ /// Draws labels in 3D.
+ /// </summary>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="rectSize">Bar rectangle.</param>
+ /// <param name="pointEx">Data point.</param>
+ /// <param name="ser">Data series.</param>
+ /// <param name="barStartPosition">The zero position or the bottom of bars.</param>
+ /// <param name="barSize">The Height of bars.</param>
+ /// <param name="width">The width of bars.</param>
+ /// <param name="pointIndex">Point index.</param>
+ private void DrawLabels3D(
+ ChartArea area,
+ ChartGraphics graph,
+ CommonElements common,
+ RectangleF rectSize,
+ DataPoint3D pointEx,
+ Series ser,
+ double barStartPosition,
+ double barSize,
+ double width,
+ int pointIndex)
+ {
+ DataPoint point = pointEx.dataPoint;
+
+ //************************************************************
+ // Draw data point value label
+ //************************************************************
+ if (ser.IsValueShownAsLabel || point.IsValueShownAsLabel || point.Label.Length > 0)
+ {
+ // Label rectangle
+ RectangleF rectLabel = RectangleF.Empty;
+ // Label text format
+ using (StringFormat format = new StringFormat())
+ {
+
+ //************************************************************
+ // Get label text
+ //************************************************************
+ string text;
+ if( point.Label.Length == 0 )
+ {
+ text = ValueConverter.FormatValue(
+ ser.Chart,
+ point,
+ point.Tag,
+ GetYValue(common, area, ser, point, pointIndex, 0 ),
+ point.LabelFormat,
+ ser.YValueType,
+ ChartElementType.DataPoint);
+ }
+ else
+ {
+ text = point.ReplaceKeywords(point.Label);
+ }
+
+ //************************************************************
+ // Calculate marker size
+ //************************************************************
+ SizeF markerSize = SizeF.Empty;
+ if(point.MarkerStyle != MarkerStyle.None || point.MarkerImage.Length > 0)
+ {
+ // Check if this marker should be drawn
+ if((pointEx.index % ser.MarkerStep) == 0)
+ {
+ // Find relative marker size
+ if (point.MarkerImage.Length == 0)
+ {
+ markerSize.Width = point.MarkerSize;
+ markerSize.Height = point.MarkerSize;
+ }
+ else
+ common.ImageLoader.GetAdjustedImageSize(point.MarkerImage, graph.Graphics, ref markerSize);
+
+ markerSize = graph.GetRelativeSize( markerSize );
+ }
+ }
+
+ //************************************************************
+ // Check labels style custom properties
+ //************************************************************
+ BarValueLabelDrawingStyle drawingStyle = defLabelDrawingStyle;
+ string valueLabelAttrib = "";
+ if (point.IsCustomPropertySet(CustomPropertyName.BarLabelStyle))
+ {
+ valueLabelAttrib = point[CustomPropertyName.BarLabelStyle];
+ }
+ else if (ser.IsCustomPropertySet(CustomPropertyName.BarLabelStyle))
+ {
+ valueLabelAttrib = ser[CustomPropertyName.BarLabelStyle];
+ }
+
+ if (valueLabelAttrib != null && valueLabelAttrib.Length > 0)
+ {
+ if (String.Compare(valueLabelAttrib, "Left", StringComparison.OrdinalIgnoreCase) == 0)
+ drawingStyle = BarValueLabelDrawingStyle.Left;
+ else if (String.Compare(valueLabelAttrib, "Right", StringComparison.OrdinalIgnoreCase) == 0)
+ drawingStyle = BarValueLabelDrawingStyle.Right;
+ else if (String.Compare(valueLabelAttrib, "Center", StringComparison.OrdinalIgnoreCase) == 0)
+ drawingStyle = BarValueLabelDrawingStyle.Center;
+ else if (String.Compare(valueLabelAttrib, "Outside", StringComparison.OrdinalIgnoreCase) == 0)
+ drawingStyle = BarValueLabelDrawingStyle.Outside;
+ }
+
+ //************************************************************
+ // Make sure label fits. Otherwise change it style
+ //************************************************************
+ bool labelFit = false;
+ bool labelSwitched = false;
+ bool labelSwitchedBack = false;
+ float prevWidth = 0f;
+ while (!labelFit)
+ {
+ // Label text format
+ format.Alignment = StringAlignment.Near;
+ format.LineAlignment = StringAlignment.Center;
+
+ // LabelStyle rectangle
+ if (barStartPosition < barSize)
+ {
+ rectLabel.X = rectSize.Right;
+ rectLabel.Width = area.PlotAreaPosition.Right - rectSize.Right;
+ }
+ else
+ {
+ rectLabel.X = area.PlotAreaPosition.X;
+ rectLabel.Width = rectSize.X - area.PlotAreaPosition.X;
+ }
+
+ // Adjust label rectangle
+ rectLabel.Y = rectSize.Y - (float)width / 2F;
+ rectLabel.Height = rectSize.Height + (float)width;
+
+ // Adjust label position depending on the drawing style
+ if (drawingStyle == BarValueLabelDrawingStyle.Outside)
+ {
+ // Adjust position if point marker is drawn
+ if (!markerSize.IsEmpty)
+ {
+ rectLabel.Width -= (float)Math.Min(rectLabel.Width, markerSize.Width / 2F);
+ if (barStartPosition < barSize)
+ {
+ rectLabel.X += (float)Math.Min(rectLabel.Width, markerSize.Width / 2F);
+ }
+ }
+ }
+ else if (drawingStyle == BarValueLabelDrawingStyle.Left)
+ {
+ rectLabel = rectSize;
+ format.Alignment = StringAlignment.Near;
+ }
+ else if (drawingStyle == BarValueLabelDrawingStyle.Center)
+ {
+ rectLabel = rectSize;
+ format.Alignment = StringAlignment.Center;
+ }
+ else if (drawingStyle == BarValueLabelDrawingStyle.Right)
+ {
+ rectLabel = rectSize;
+ format.Alignment = StringAlignment.Far;
+
+ // Adjust position if point marker is drawn
+ if (!markerSize.IsEmpty)
+ {
+ rectLabel.Width -= (float)Math.Min(rectLabel.Width, markerSize.Width / 2F);
+ if (barStartPosition >= barSize)
+ {
+ rectLabel.X += (float)Math.Min(rectLabel.Width, markerSize.Width / 2F);
+ }
+ }
+ }
+
+ // Reversed string alignment
+ if (barStartPosition >= barSize)
+ {
+ if (format.Alignment == StringAlignment.Far)
+ format.Alignment = StringAlignment.Near;
+ else if (format.Alignment == StringAlignment.Near)
+ format.Alignment = StringAlignment.Far;
+ }
+
+ // Make sure value label fits rectangle.
+ SizeF valueTextSize = graph.MeasureStringRel(text, point.Font);
+ if (!labelSwitched &&
+ !labelSwitchedBack &&
+ valueTextSize.Width > rectLabel.Width)
+ {
+ // Switch label style only once
+ labelSwitched = true;
+ prevWidth = rectLabel.Width;
+
+ // If text do not fit - try to switch between Outside/Inside drawing styles
+ if (drawingStyle == BarValueLabelDrawingStyle.Outside)
+ {
+ drawingStyle = BarValueLabelDrawingStyle.Right;
+ }
+ else
+ {
+ drawingStyle = BarValueLabelDrawingStyle.Outside;
+ }
+ }
+ else
+ {
+ // If label do not fit either Outside or to the Right,
+ // select the style that has more space available.
+ if (labelSwitched &&
+ !labelSwitchedBack &&
+ valueTextSize.Width > rectLabel.Width - 1 &&
+ prevWidth > rectLabel.Width)
+ {
+ labelSwitchedBack = true;
+
+ // Change back to the previous labels style
+ if (drawingStyle == BarValueLabelDrawingStyle.Outside)
+ {
+ drawingStyle = BarValueLabelDrawingStyle.Right;
+ }
+ else
+ {
+ drawingStyle = BarValueLabelDrawingStyle.Outside;
+ }
+ }
+ else
+ {
+ // Do not try to fit labels any more
+ labelFit = true;
+ }
+ }
+ }
+
+ //************************************************************
+ // Find text rotation center point
+ //************************************************************
+
+ // Measure string size
+ SizeF size = graph.MeasureStringRel(text, point.Font, new SizeF(rectLabel.Width, rectLabel.Height), format);
+
+ PointF rotationCenter = PointF.Empty;
+ if (format.Alignment == StringAlignment.Near)
+ { // Near
+ rotationCenter.X = rectLabel.X + size.Width / 2;
+ }
+ else if (format.Alignment == StringAlignment.Far)
+ { // Far
+ rotationCenter.X = rectLabel.Right - size.Width / 2;
+ }
+ else
+ { // Center
+ rotationCenter.X = (rectLabel.Left + rectLabel.Right) / 2;
+ }
+
+ if (format.LineAlignment == StringAlignment.Near)
+ { // Near
+ rotationCenter.Y = rectLabel.Top + size.Height / 2;
+ }
+ else if (format.LineAlignment == StringAlignment.Far)
+ { // Far
+ rotationCenter.Y = rectLabel.Bottom - size.Height / 2;
+ }
+ else
+ { // Center
+ rotationCenter.Y = (rectLabel.Bottom + rectLabel.Top) / 2;
+ }
+
+ // Reset string alignment to center point
+ format.Alignment = StringAlignment.Center;
+ format.LineAlignment = StringAlignment.Center;
+
+
+ //************************************************************
+ // Adjust label rotation angle
+ //************************************************************
+ int angle = point.LabelAngle;
+
+ // Get projection coordinates
+ Point3D[] rotationCenterProjection = new Point3D[] {
+ new Point3D(rotationCenter.X, rotationCenter.Y, pointEx.zPosition + pointEx.depth),
+ new Point3D(rotationCenter.X - 20f, rotationCenter.Y, pointEx.zPosition + pointEx.depth) };
+
+ // Transform coordinates of text rotation point
+ area.matrix3D.TransformPoints(rotationCenterProjection);
+
+ // Adjust rotation point
+ rotationCenter = rotationCenterProjection[0].PointF;
+
+ // Adjust angle of the horisontal text
+ if (angle == 0 || angle == 180)
+ {
+ // Convert coordinates to absolute
+ rotationCenterProjection[0].PointF = graph.GetAbsolutePoint(rotationCenterProjection[0].PointF);
+ rotationCenterProjection[1].PointF = graph.GetAbsolutePoint(rotationCenterProjection[1].PointF);
+
+ // Calcuate axis angle
+ float angleXAxis = (float)Math.Atan(
+ (rotationCenterProjection[1].Y - rotationCenterProjection[0].Y) /
+ (rotationCenterProjection[1].X - rotationCenterProjection[0].X));
+ angleXAxis = (float)Math.Round(angleXAxis * 180f / (float)Math.PI);
+ angle += (int)angleXAxis;
+ }
+
+
+ // Calculate label background position
+ RectangleF labelBackPosition = RectangleF.Empty;
+ if (common.ProcessModeRegions ||
+ !point.LabelBackColor.IsEmpty ||
+ !point.LabelBorderColor.IsEmpty)
+ {
+ SizeF sizeLabel = new SizeF(size.Width, size.Height);
+ sizeLabel.Height += sizeLabel.Height / 8;
+ sizeLabel.Width += sizeLabel.Width / text.Length;
+ labelBackPosition = new RectangleF(
+ rotationCenter.X - sizeLabel.Width / 2,
+ rotationCenter.Y - sizeLabel.Height / 2,
+ sizeLabel.Width,
+ sizeLabel.Height);
+ }
+
+ //************************************************************
+ // Draw label
+ //************************************************************
+ using (Brush brush = new SolidBrush(point.LabelForeColor))
+ {
+ graph.DrawPointLabelStringRel(
+ common,
+ text,
+ point.Font,
+ brush,
+ rotationCenter,
+ format,
+ angle,
+ labelBackPosition,
+ point.LabelBackColor,
+ point.LabelBorderColor,
+ point.LabelBorderWidth,
+ point.LabelBorderDashStyle,
+ ser,
+ point,
+ pointIndex);
+ }
+ }
+
+ }
+ }
+
+ #endregion
+
+ #region SmartLabelStyle methods
+
+ /// <summary>
+ /// Adds markers position to the list. Used to check SmartLabelStyle overlapping.
+ /// </summary>
+ /// <param name="common">Common chart elements.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="series">Series values to be used.</param>
+ /// <param name="list">List to add to.</param>
+ public void AddSmartLabelMarkerPositions(CommonElements common, ChartArea area, Series series, ArrayList list)
+ {
+ // NOTE: Bar chart do not support SmartLabelStyle feature.
+ }
+
+ #endregion
+
+ #region IDisposable interface implementation
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected virtual void Dispose(bool disposing)
+ {
+ //Nothing to dispose at the base class.
+ }
+
+ /// <summary>
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// </summary>
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+ #endregion
+ }
+
+ #region Points drawing order comparer class
+
+ /// <summary>
+ /// Chart 3D engine relies on the data point drawing order
+ /// to achieve correct visual appearance. All data points
+ /// have to be drawn in the correct order depending on the
+ /// 3D angles, perspective and the depth of the series.
+ ///
+ /// BarPointsDrawingOrderComparer class is used sort data
+ /// points of the Bar chart type.
+ /// </summary>
+ internal class BarPointsDrawingOrderComparer : IComparer
+ {
+ #region Fields
+
+ /// <summary>
+ /// Chart area object reference.
+ /// </summary>
+ private ChartArea _area = null;
+
+ /// <summary>
+ /// Area X position where visible sides are switched.
+ /// </summary>
+ private Point3D _areaProjectionCenter = new Point3D(float.NaN, float.NaN, float.NaN);
+
+ /// <summary>
+ /// Selection mode. Points order should be reversed.
+ /// </summary>
+ private bool _selection = false;
+
+ #endregion // Fields
+
+ #region Methods
+
+ /// <summary>
+ /// Public constructor.
+ /// </summary>
+ /// <param name="area">Chart area.</param>
+ /// <param name="selection">Selection indicator.</param>
+ /// <param name="coord">Which coordinate of COP (X, Y or Z) to test for surface everlapping.</param>
+ public BarPointsDrawingOrderComparer(ChartArea area, bool selection, COPCoordinates coord)
+ {
+ this._area = area;
+ this._selection = selection;
+
+ // Get center of projection
+ if(area.DrawPointsToCenter(ref coord))
+ {
+ // Get COP
+ _areaProjectionCenter = area.GetCenterOfProjection(coord);
+
+ // Switch X & Y coordinates
+ float val = _areaProjectionCenter.X;
+ _areaProjectionCenter.X = _areaProjectionCenter.Y;
+ _areaProjectionCenter.Y = val;
+ }
+ }
+
+ /// <summary>
+ /// Comarer method.
+ /// </summary>
+ /// <param name="o1">First object.</param>
+ /// <param name="o2">Second object.</param>
+ /// <returns>Comparison result.</returns>
+ public int Compare(object o1, object o2)
+ {
+ DataPoint3D point1 = (DataPoint3D) o1;
+ DataPoint3D point2 = (DataPoint3D) o2;
+
+ int result = 0;
+ if(point1.xPosition < point2.xPosition)
+ {
+ result = -1;
+ }
+ else if(point1.xPosition > point2.xPosition)
+ {
+ result = 1;
+ }
+ else
+ {
+ // If X coordinate is the same - filter by Y coordinate
+ if(point1.yPosition < point2.yPosition)
+ {
+ result = 1;
+ }
+ else if(point1.yPosition > point2.yPosition)
+ {
+ result = -1;
+ }
+
+ // Order points from sides to center
+ if(!float.IsNaN(_areaProjectionCenter.Y))
+ {
+ double yMin1 = Math.Min(point1.yPosition, point1.height);
+ double yMax1 = Math.Max(point1.yPosition, point1.height);
+ double yMin2 = Math.Min(point2.yPosition, point2.height);
+ double yMax2 = Math.Max(point2.yPosition, point2.height);
+
+ if(_area.IsBottomSceneWallVisible())
+ {
+ if( yMin1 <= _areaProjectionCenter.Y && yMin2 <= _areaProjectionCenter.Y )
+ {
+ result *= -1;
+ }
+ else if( yMin1 <= _areaProjectionCenter.Y)
+ {
+ result = 1;
+ }
+
+ }
+ else
+ {
+
+ if( yMax1 >= _areaProjectionCenter.Y && yMax2 >= _areaProjectionCenter.Y )
+ {
+ result *= 1;
+ }
+ else if( yMax1 >= _areaProjectionCenter.Y)
+ {
+ result = 1;
+ }
+ else
+ {
+ result *= -1;
+ }
+ }
+ }
+
+ // Reversed order if looking from left or right
+ else if(!_area.DrawPointsInReverseOrder())
+ {
+ result *= -1;
+ }
+ }
+
+ if(point1.xPosition != point2.xPosition)
+ {
+ // Order points from sides to center
+ if(!float.IsNaN(_areaProjectionCenter.X))
+ {
+ if((point1.xPosition + point1.width / 2f) >= _areaProjectionCenter.X &&
+ (point2.xPosition + point2.width / 2f) >= _areaProjectionCenter.X)
+ {
+ result *= -1;
+ }
+ }
+
+ // Reversed order of points by X value
+ else if(_area.IsBottomSceneWallVisible())
+ {
+ result *= -1;
+ }
+ }
+
+ return (_selection) ? - result : result;
+ }
+
+ #endregion // Methods
+ }
+
+#endregion
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/BoxPlotChart.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/BoxPlotChart.cs
new file mode 100644
index 00000000000..e1b650d3c6e
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/BoxPlotChart.cs
@@ -0,0 +1,1856 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: BoxPlotChart.cs
+//
+// Namespace: DataVisualization.Charting.ChartTypes
+//
+// Classes: BoxPlotChart
+//
+// Purpose: Provides 2D and 3D drawing and hit testing of the
+// Box Plot chart.
+//
+// Box Plot Overview:
+// ------------------
+//
+// The Box Plot chart type consists of one or more box symbols that
+// summarize the distribution of the data within one or more data
+// sets. A Box Chart displays a rectangle with whisker lines
+// extending from both ends. What makes a Box Plot unique, in
+// comparison to standard chart types, is that the values for a box
+// plot most often are calculated values from data that is present
+// in another series. One box symbol, or data point, is associated
+// with one data series. The data for a Box Plot series may still
+// be populated using Data Binding or the Points Collection.
+//
+// Reviewed: GS - Jul 15, 2003
+// AG - Microsoft 6, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.ComponentModel.Design;
+using System.Globalization;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+#else
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+namespace System.Windows.Forms.DataVisualization.Charting.ChartTypes
+#else
+namespace System.Web.UI.DataVisualization.Charting.ChartTypes
+#endif
+{
+ /// <summary>
+ /// BoxPlotChart class provides 2D and 3D drawing and hit testing of
+ /// the Box Plot chart.
+ /// </summary>
+ internal class BoxPlotChart : IChartType
+ {
+ #region Fields
+
+ /// <summary>
+ /// Vertical axis
+ /// </summary>
+ protected Axis vAxis = null;
+
+ /// <summary>
+ /// Horizontal axis
+ /// </summary>
+ protected Axis hAxis = null;
+
+ /// <summary>
+ /// Side by side drawing flag.
+ /// </summary>
+ protected bool showSideBySide = true;
+
+ #endregion
+
+ #region Constructor
+
+ /// <summary>
+ /// Box Plot chart constructor.
+ /// </summary>
+ public BoxPlotChart()
+ {
+ }
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ virtual public string Name { get{ return ChartTypeNames.BoxPlot;}}
+
+ /// <summary>
+ /// True if chart type is stacked
+ /// </summary>
+ virtual public bool Stacked { get{ return false;}}
+
+
+ /// <summary>
+ /// True if stacked chart type supports groups
+ /// </summary>
+ virtual public bool SupportStackedGroups { get { return false; } }
+
+
+ /// <summary>
+ /// True if stacked chart type should draw separately positive and
+ /// negative data points ( Bar and column Stacked types ).
+ /// </summary>
+ public bool StackSign { get{ return false;}}
+
+ /// <summary>
+ /// True if chart type supports axes
+ /// </summary>
+ virtual public bool RequireAxes { get{ return true;} }
+
+ /// <summary>
+ /// Chart type with two y values used for scale ( bubble chart type )
+ /// </summary>
+ public bool SecondYScale{ get{ return false;} }
+
+ /// <summary>
+ /// True if chart type requires circular chart area.
+ /// </summary>
+ public bool CircularChartArea { get{ return false;} }
+
+ /// <summary>
+ /// True if chart type supports logarithmic axes
+ /// </summary>
+ virtual public bool SupportLogarithmicAxes { get{ return true;} }
+
+ /// <summary>
+ /// True if chart type requires to switch the value (Y) axes position
+ /// </summary>
+ virtual public bool SwitchValueAxes { get{ return false;} }
+
+ /// <summary>
+ /// True if chart series can be placed side-by-side.
+ /// </summary>
+ public bool SideBySideSeries { get{ return false;} }
+
+ /// <summary>
+ /// True if each data point of a chart must be represented in the legend
+ /// </summary>
+ virtual public bool DataPointsInLegend { get{ return false;} }
+
+ /// <summary>
+ /// If the crossing value is auto Crossing value ZeroCrossing should be
+ /// automatically set to zero for some chart
+ /// types (Bar, column, area etc.)
+ /// </summary>
+ virtual public bool ZeroCrossing { get{ return false;} }
+
+ /// <summary>
+ /// True if palette colors should be applied for each data paoint.
+ /// Otherwise the color is applied to the series.
+ /// </summary>
+ virtual public bool ApplyPaletteColorsToPoints { get { return false; } }
+
+ /// <summary>
+ /// Indicates that extra Y values are connected to the scale of the Y axis
+ /// </summary>
+ virtual public bool ExtraYValuesConnectedToYAxis{ get { return true; } }
+
+ /// <summary>
+ /// Indicates that this is a one hundred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ virtual public bool HundredPercent{ get{return false;} }
+
+ /// <summary>
+ /// Indicates that negative 100% stacked values are shown on
+ /// the other side of the X axis
+ /// </summary>
+ virtual public bool HundredPercentSupportNegative{ get{return false;} }
+
+ /// <summary>
+ /// How to draw series/points in legend:
+ /// Filled rectangle, Line or Marker
+ /// </summary>
+ /// <param name="series">Legend item series.</param>
+ /// <returns>Legend item style.</returns>
+ virtual public LegendImageStyle GetLegendImageStyle(Series series)
+ {
+ return LegendImageStyle.Rectangle;
+ }
+
+ /// <summary>
+ /// Number of supported Y value(s) per point
+ /// </summary>
+ virtual public int YValuesPerPoint { get { return 6; } }
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ virtual public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+
+ #endregion
+
+ #region Painting and Selection methods
+
+ /// <summary>
+ /// Paint box plot chart.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ virtual public void Paint( ChartGraphics graph, CommonElements common, ChartArea area, Series seriesToDraw )
+ {
+ ProcessChartType( false, graph, common, area, seriesToDraw );
+ }
+
+ /// <summary>
+ /// This method recalculates size of the bars. This method is used
+ /// from Paint or Select method.
+ /// </summary>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ virtual protected void ProcessChartType(
+ bool selection,
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ Series seriesToDraw )
+ {
+
+ // Prosess 3D chart type
+ if(area.Area3DStyle.Enable3D)
+ {
+ ProcessChartType3D( selection, graph, common, area, seriesToDraw );
+ return;
+ }
+
+ // All data series from chart area which have Box Plot chart type
+ List<string> typeSeries = area.GetSeriesFromChartType(this.Name);
+
+ // Zero X values mode.
+ bool indexedSeries = ChartHelper.IndexedSeries(area.Common, typeSeries.ToArray() );
+
+ //************************************************************
+ //** Loop through all series
+ //************************************************************
+ int seriesIndx = 0;
+ foreach( Series ser in common.DataManager.Series )
+ {
+ // Process non empty series of the area with box plot chart type
+ if( String.Compare( ser.ChartTypeName, this.Name, StringComparison.OrdinalIgnoreCase ) != 0
+ || ser.ChartArea != area.Name || !ser.IsVisible())
+ {
+ continue;
+ }
+
+ // Set active horizontal/vertical axis
+ hAxis = area.GetAxis(AxisName.X, ser.XAxisType, ser.XSubAxisName);
+ vAxis = area.GetAxis(AxisName.Y, ser.YAxisType, ser.YSubAxisName);
+
+ // Get interval between points
+ double interval = (indexedSeries) ? 1 : area.GetPointsInterval( hAxis.IsLogarithmic, hAxis.logarithmBase );
+
+ // Check if side-by-side attribute is set
+ bool currentShowSideBySide = showSideBySide;
+ if(ser.IsCustomPropertySet(CustomPropertyName.DrawSideBySide))
+ {
+ string attribValue = ser[CustomPropertyName.DrawSideBySide];
+ if(String.Compare(attribValue, "False", StringComparison.OrdinalIgnoreCase) == 0 )
+ {
+ currentShowSideBySide = false;
+ }
+ else if (String.Compare(attribValue, "True", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ currentShowSideBySide = true;
+ }
+ else if (String.Compare(attribValue, "Auto", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionAttributeDrawSideBySideInvalid));
+ }
+ }
+
+ // Find the number of "Column chart" data series
+ double numOfSeries = typeSeries.Count;
+ if(!currentShowSideBySide)
+ {
+ numOfSeries = 1;
+ }
+
+ // Calculates the width of the points.
+ float width = (float)(ser.GetPointWidth(graph, hAxis, interval, 0.8) / numOfSeries);
+
+ // Call Back Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPrePaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+
+
+ //************************************************************
+ //** Series data points loop
+ //************************************************************
+ int index = 1;
+ foreach( DataPoint point in ser.Points )
+ {
+ // Check required Y values number
+ if(point.YValues.Length < this.YValuesPerPoint)
+ {
+ throw(new InvalidOperationException(SR.ExceptionChartTypeRequiresYValues(this.Name, this.YValuesPerPoint.ToString(CultureInfo.InvariantCulture))));
+ }
+
+ // Reset pre-calculated point position
+ point.positionRel = new PointF(float.NaN, float.NaN);
+
+ // Get point X position
+ float xPosition = 0f;
+ double xValue = point.XValue;
+ if( indexedSeries )
+ {
+ xValue = (double)index;
+ xPosition = (float)(hAxis.GetPosition( (double)index ) - width * ((double) numOfSeries) / 2.0 + width/2 + seriesIndx * width);
+ }
+ else if( currentShowSideBySide )
+ {
+ xPosition = (float)(hAxis.GetPosition( xValue ) - width * ((double) numOfSeries) / 2.0 + width/2 + seriesIndx * width);
+ }
+ else
+ {
+ xPosition = (float)hAxis.GetPosition( xValue );
+ }
+
+
+ double yValue0 = vAxis.GetLogValue( point.YValues[0] );
+ double yValue1 = vAxis.GetLogValue( point.YValues[1] );
+ xValue = hAxis.GetLogValue(xValue);
+
+ // Check if chart is completly out of the data scaleView
+ if(xValue < hAxis.ViewMinimum ||
+ xValue > hAxis.ViewMaximum ||
+ (yValue0 < vAxis.ViewMinimum && yValue1 < vAxis.ViewMinimum) ||
+ (yValue0 > vAxis.ViewMaximum && yValue1 > vAxis.ViewMaximum) )
+ {
+ ++index;
+ continue;
+ }
+
+ // Make sure High/Low values are in data scaleView range
+ double low = vAxis.GetLogValue( point.YValues[0] );
+ double high = vAxis.GetLogValue( point.YValues[1] );
+
+ // Check if values are in range
+ if( high > vAxis.ViewMaximum )
+ {
+ high = vAxis.ViewMaximum;
+ }
+ if( high < vAxis.ViewMinimum )
+ {
+ high = vAxis.ViewMinimum;
+ }
+ high = (float)vAxis.GetLinearPosition(high);
+
+ if( low > vAxis.ViewMaximum )
+ {
+ low = vAxis.ViewMaximum;
+ }
+ if( low < vAxis.ViewMinimum )
+ {
+ low = vAxis.ViewMinimum;
+ }
+ low = vAxis.GetLinearPosition(low);
+
+ // Remeber pre-calculated point position
+ point.positionRel = new PointF((float)xPosition, (float)Math.Min(high, low));
+
+ if( common.ProcessModePaint )
+ {
+
+ // Check if chart is partialy in the data scaleView
+ bool clipRegionSet = false;
+ if(xValue == hAxis.ViewMinimum || xValue == hAxis.ViewMaximum )
+ {
+ // Set clipping region for line drawing
+ graph.SetClip( area.PlotAreaPosition.ToRectangleF() );
+ clipRegionSet = true;
+ }
+
+ // Define line color
+ Color lineColor = point.BorderColor;
+ if(lineColor == Color.Empty)
+ {
+ lineColor = point.Color;
+ }
+
+ // Start Svg Selection mode
+ graph.StartHotRegion( point );
+
+ // Draw lower whisker line
+ graph.DrawLineRel(
+ lineColor,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ new PointF(xPosition, (float)low),
+ new PointF(xPosition, (float)vAxis.GetPosition( point.YValues[2] )),
+ ser.ShadowColor,
+ ser.ShadowOffset );
+
+ // Draw upper whisker line
+ graph.DrawLineRel(
+ lineColor,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ new PointF(xPosition, (float)high),
+ new PointF(xPosition, (float)vAxis.GetPosition( point.YValues[3] )),
+ ser.ShadowColor,
+ ser.ShadowOffset );
+
+ // Draw Box
+ RectangleF rectSize = RectangleF.Empty;
+ rectSize.X = (float)(xPosition - width/2);
+ rectSize.Width = (float)(width);
+ rectSize.Y = (float)vAxis.GetPosition( point.YValues[3] );
+ rectSize.Height = (float)Math.Abs(rectSize.Y - vAxis.GetPosition( point.YValues[2] ));
+ graph.FillRectangleRel( rectSize,
+ point.Color,
+ point.BackHatchStyle,
+ point.BackImage,
+ point.BackImageWrapMode,
+ point.BackImageTransparentColor,
+ point.BackImageAlignment,
+ point.BackGradientStyle,
+ point.BackSecondaryColor,
+ point.BorderColor,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ ser.ShadowColor,
+ ser.ShadowOffset,
+ PenAlignment.Inset );
+
+
+ // Check if average line should be drawn
+ bool showAverage = true;
+ if(point.IsCustomPropertySet(CustomPropertyName.BoxPlotShowAverage) || ser.IsCustomPropertySet(CustomPropertyName.BoxPlotShowAverage))
+ {
+ string showAverageValue = ser[CustomPropertyName.BoxPlotShowAverage];
+ if(point.IsCustomPropertySet(CustomPropertyName.BoxPlotShowAverage))
+ {
+ showAverageValue = point[CustomPropertyName.BoxPlotShowAverage];
+ }
+ if(String.Compare( showAverageValue, "True", StringComparison.OrdinalIgnoreCase ) == 0 )
+ {
+ // default - do nothing
+ }
+ else if(String.Compare( showAverageValue, "False", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ showAverage = false;
+ }
+ else
+ {
+ throw(new InvalidOperationException( SR.ExceptionCustomAttributeValueInvalid( point[CustomPropertyName.BoxPlotShowAverage], "BoxPlotShowAverage")));
+ }
+ }
+
+
+ // Draw average line
+ SizeF relBorderWidth = graph.GetRelativeSize(new SizeF(point.BorderWidth, point.BorderWidth));
+ if(point.BorderColor == Color.Empty)
+ {
+ relBorderWidth.Height = 0;
+ relBorderWidth.Width = 0;
+ }
+ Color markerLinesColor = lineColor;
+ if(markerLinesColor == point.Color)
+ {
+ double brightness = Math.Sqrt(point.Color.R * point.Color.R + point.Color.G * point.Color.G + point.Color.B * point.Color.B);
+ if(brightness > 220)
+ {
+ markerLinesColor = ChartGraphics.GetGradientColor(point.Color, Color.Black, 0.4);
+ }
+ else
+ {
+ markerLinesColor = ChartGraphics.GetGradientColor(point.Color, Color.White, 0.4);
+ }
+ }
+ if(!double.IsNaN(point.YValues[4]) && showAverage)
+ {
+ graph.DrawLineRel(
+ markerLinesColor,
+ 1,
+ ChartDashStyle.Solid,
+ new PointF(rectSize.Left + relBorderWidth.Width, (float)vAxis.GetPosition( point.YValues[4])),
+ new PointF(rectSize.Right - relBorderWidth.Width, (float)vAxis.GetPosition( point.YValues[4])),
+ Color.Empty,
+ 0 );
+ }
+
+ // Check if median line should be drawn
+ bool showMedian = true;
+ if(point.IsCustomPropertySet(CustomPropertyName.BoxPlotShowMedian) || ser.IsCustomPropertySet(CustomPropertyName.BoxPlotShowMedian))
+ {
+ string showMedianValue = ser[CustomPropertyName.BoxPlotShowMedian];
+ if(point.IsCustomPropertySet(CustomPropertyName.BoxPlotShowMedian))
+ {
+ showMedianValue = point[CustomPropertyName.BoxPlotShowMedian];
+ }
+ if(String.Compare(showMedianValue, "True", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ // default - do nothing
+ }
+ else if(String.Compare(showMedianValue, "False", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ showMedian = false;
+ }
+ else
+ {
+ throw(new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid( point[CustomPropertyName.BoxPlotShowMedian],"BoxPlotShowMedian")));
+ }
+ }
+
+ // Draw median line
+ if(!double.IsNaN(point.YValues[5]) && showMedian)
+ {
+ float medianValue = (float)vAxis.GetPosition( point.YValues[5]);
+ float dashWidth = (rectSize.Width - relBorderWidth.Width * 2) / 9f;
+
+ // Dash width should not be less than 2 pixels
+ SizeF minSize = graph.GetRelativeSize(new SizeF(2, 2));
+ dashWidth = Math.Max(dashWidth, minSize.Width);
+
+ for(float curPosition = rectSize.Left + relBorderWidth.Width; curPosition < (rectSize.Right - relBorderWidth.Width); curPosition += dashWidth * 2f)
+ {
+ graph.DrawLineRel(
+ markerLinesColor,
+ 1,
+ ChartDashStyle.Solid,
+ new PointF(curPosition, medianValue),
+ new PointF((float) Math.Min(rectSize.Right, curPosition + dashWidth), medianValue),
+ Color.Empty,
+ 0 );
+ }
+ }
+
+ // Draw Box Plot marks
+ DrawBoxPlotMarks(graph, area, ser, point, xPosition, width);
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+
+ // Reset Clip Region
+ if(clipRegionSet)
+ {
+ graph.ResetClip();
+ }
+ }
+
+ if( common.ProcessModeRegions )
+ {
+ // Calculate rect around the box plot marks
+ RectangleF areaRect = RectangleF.Empty;
+ areaRect.X = xPosition - width / 2f;
+ areaRect.Y = (float)Math.Min(high, low);
+ areaRect.Width = width;
+ areaRect.Height = (float)Math.Max(high, low) - areaRect.Y;
+
+ // Add area
+ common.HotRegionsList.AddHotRegion( areaRect, point, ser.Name, index - 1 );
+ }
+ ++index;
+ }
+
+ //************************************************************
+ //** Second series data points loop, when labels are drawn.
+ //************************************************************
+ if( !selection )
+ {
+ index = 1;
+ foreach( DataPoint point in ser.Points )
+ {
+ // Get point X position
+ float xPosition = 0f;
+ double xValue = point.XValue;
+ if( indexedSeries )
+ {
+ xValue = (double)index;
+ xPosition = (float)(hAxis.GetPosition( (double)index ) - width * ((double) numOfSeries) / 2.0 + width/2 + seriesIndx * width);
+ }
+ else if( currentShowSideBySide )
+ {
+ xPosition = (float)(hAxis.GetPosition( xValue ) - width * ((double) numOfSeries) / 2.0 + width/2 + seriesIndx * width);
+ }
+ else
+ {
+ xPosition = (float)hAxis.GetPosition( xValue );
+ }
+
+ double yValue0 = vAxis.GetLogValue( point.YValues[0] );
+ double yValue1 = vAxis.GetLogValue( point.YValues[1] );
+ xValue = hAxis.GetLogValue(xValue);
+
+ // Check if chart is completly out of the data scaleView
+ if(xValue < hAxis.ViewMinimum ||
+ xValue > hAxis.ViewMaximum ||
+ (yValue0 < vAxis.ViewMinimum && yValue1 < vAxis.ViewMinimum) ||
+ (yValue0 > vAxis.ViewMaximum && yValue1 > vAxis.ViewMaximum) )
+ {
+ ++index;
+ continue;
+ }
+
+ // Make sure High/Low values are in data scaleView range
+ double high = double.MaxValue;
+ for(int valueIndex = 0; valueIndex < point.YValues.Length; valueIndex++)
+ {
+ if(!double.IsNaN(point.YValues[valueIndex]))
+ {
+ double currentValue = vAxis.GetLogValue( point.YValues[valueIndex] );
+ if( currentValue > vAxis.ViewMaximum )
+ {
+ currentValue = vAxis.ViewMaximum;
+ }
+ if( currentValue < vAxis.ViewMinimum )
+ {
+ currentValue = vAxis.ViewMinimum;
+ }
+ currentValue = (float)vAxis.GetLinearPosition(currentValue);
+
+ high = Math.Min(high, currentValue);
+ }
+ }
+
+ // Adjust label position by marker size
+ SizeF relMarkerSize = graph.GetRelativeSize(new SizeF(point.MarkerSize, point.MarkerSize));
+ high -= relMarkerSize.Height / 2f;
+
+ // Start Svg Selection mode
+ graph.StartHotRegion( point, true );
+
+ // Draw label
+ DrawLabel(common, area, graph, ser, point, new PointF(xPosition, (float)high), index);
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+
+
+ ++index;
+ }
+ }
+
+ // Call Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPostPaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+
+ // Data series index
+ if(currentShowSideBySide)
+ {
+ seriesIndx++;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Draws box plot markers.
+ /// </summary>
+ /// <param name="graph">Chart graphics object.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="ser">Data point series.</param>
+ /// <param name="point">Data point to draw.</param>
+ /// <param name="xPosition">X position.</param>
+ /// <param name="width">Point width.</param>
+ virtual protected void DrawBoxPlotMarks(
+ ChartGraphics graph,
+ ChartArea area,
+ Series ser,
+ DataPoint point,
+ float xPosition,
+ float width)
+ {
+ // Get markers style
+ string markerStyle = "LINE";
+ if(point.MarkerStyle != MarkerStyle.None)
+ {
+ markerStyle = point.MarkerStyle.ToString();
+ }
+
+ // Draw lower marker
+ double yPosition = vAxis.GetLogValue( point.YValues[0] );
+ DrawBoxPlotSingleMarker(graph, area, point, markerStyle, xPosition, (float)yPosition, 0f, width, false);
+
+ // Draw upper marker
+ yPosition = vAxis.GetLogValue( point.YValues[1] );
+ DrawBoxPlotSingleMarker(graph, area, point, markerStyle, xPosition, (float)yPosition, 0f, width, false);
+
+ // Draw unusual points if any
+ markerStyle = "CIRCLE";
+ if(point.MarkerStyle != MarkerStyle.None)
+ {
+ markerStyle = point.MarkerStyle.ToString();
+ }
+ for(int valueIndex = 6; valueIndex < point.YValues.Length; valueIndex++)
+ {
+ if(!double.IsNaN(point.YValues[valueIndex]))
+ {
+ yPosition = vAxis.GetLogValue( point.YValues[valueIndex] );
+ DrawBoxPlotSingleMarker(graph, area, point, markerStyle, xPosition, (float)yPosition, 0f, width, false);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Draws single marker on the box plot.
+ /// </summary>
+ /// <param name="graph">Chart graphics.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="point">Series point.</param>
+ /// <param name="markerStyle">Marker style name.</param>
+ /// <param name="xPosition">X position.</param>
+ /// <param name="yPosition">Y position.</param>
+ /// <param name="zPosition">Z position.</param>
+ /// <param name="width">Point width.</param>
+ /// <param name="draw3D">Used for 3d drawing.</param>
+ private void DrawBoxPlotSingleMarker(
+ ChartGraphics graph,
+ ChartArea area,
+ DataPoint point,
+ string markerStyle,
+ float xPosition,
+ float yPosition,
+ float zPosition,
+ float width,
+ bool draw3D)
+ {
+ markerStyle = markerStyle.ToUpper(CultureInfo.InvariantCulture);
+ if(markerStyle.Length > 0 && String.Compare(markerStyle, "None", StringComparison.OrdinalIgnoreCase ) != 0)
+ {
+ // Make sure Y value is in range
+ if( yPosition > vAxis.ViewMaximum || yPosition < vAxis.ViewMinimum)
+ {
+ return;
+ }
+ yPosition = (float)vAxis.GetLinearPosition(yPosition);
+
+ // 3D Transform coordinates
+ if(draw3D)
+ {
+ Point3D[] points = new Point3D[1];
+ points[0] = new Point3D(xPosition, yPosition, zPosition);
+ area.matrix3D.TransformPoints(points);
+ xPosition = points[0].X;
+ yPosition = points[0].Y;
+ }
+
+ // Define line color
+ Color lineColor = point.BorderColor;
+ if(lineColor == Color.Empty)
+ {
+ lineColor = point.Color;
+ }
+
+ // Draw horizontal line marker
+ if (String.Compare(markerStyle, "Line", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ graph.DrawLineRel(
+ lineColor,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ new PointF(xPosition - width/4f, yPosition),
+ new PointF(xPosition + width/4f, yPosition),
+ (point.series != null) ? point.series.ShadowColor : Color.Empty,
+ (point.series != null) ? point.series.ShadowOffset : 0 );
+ }
+
+ // Draw standard marker
+ else
+ {
+ MarkerStyle marker = (MarkerStyle)Enum.Parse(typeof(MarkerStyle), markerStyle, true);
+
+ // Get marker size
+ SizeF markerSize = GetMarkerSize(
+ graph,
+ area.Common,
+ area,
+ point,
+ point.MarkerSize,
+ point.MarkerImage);
+
+ // Get marker color
+ Color markerColor = (point.MarkerColor == Color.Empty) ? point.BorderColor : point.MarkerColor;
+ if(markerColor == Color.Empty)
+ {
+ markerColor = point.Color;
+ }
+
+ // Draw the marker
+ graph.DrawMarkerRel(
+ new PointF(xPosition, yPosition),
+ marker,
+ point.MarkerSize,
+ markerColor,
+ point.MarkerBorderColor,
+ point.MarkerBorderWidth,
+ point.MarkerImage,
+ point.MarkerImageTransparentColor,
+ (point.series != null) ? point.series.ShadowOffset : 0,
+ (point.series != null) ? point.series.ShadowColor : Color.Empty,
+ new RectangleF(xPosition, yPosition, markerSize.Width, markerSize.Height));
+ }
+ }
+ }
+
+ /// <summary>
+ /// Returns marker size.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="point">Data point.</param>
+ /// <param name="markerSize">Marker size.</param>
+ /// <param name="markerImage">Marker image.</param>
+ /// <returns>Marker width and height.</returns>
+ virtual protected SizeF GetMarkerSize(
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ DataPoint point,
+ int markerSize,
+ string markerImage)
+ {
+ SizeF size = new SizeF(markerSize, markerSize);
+ if (graph != null && graph.Graphics != null)
+ {
+ // Marker size is in pixels and we do the mapping for higher DPIs
+ size.Width = markerSize * graph.Graphics.DpiX / 96;
+ size.Height = markerSize * graph.Graphics.DpiY / 96;
+ }
+
+ if(markerImage.Length > 0)
+ common.ImageLoader.GetAdjustedImageSize(markerImage, graph.Graphics, ref size);
+
+ return size;
+ }
+
+
+ /// <summary>
+ /// Draws box plot chart data point label.
+ /// </summary>
+ /// <param name="common">The Common elements object</param>
+ /// <param name="area">Chart area for this chart</param>
+ /// <param name="graph">Chart graphics object.</param>
+ /// <param name="ser">Data point series.</param>
+ /// <param name="point">Data point to draw.</param>
+ /// <param name="position">Label position.</param>
+ /// <param name="pointIndex">Data point index.</param>
+ virtual protected void DrawLabel(
+ CommonElements common,
+ ChartArea area,
+ ChartGraphics graph,
+ Series ser,
+ DataPoint point,
+ PointF position,
+ int pointIndex)
+ {
+ if (ser.IsValueShownAsLabel || point.IsValueShownAsLabel || point.Label.Length > 0)
+ {
+ // Label text format
+ using (StringFormat format = new StringFormat())
+ {
+ format.Alignment = StringAlignment.Near;
+ format.LineAlignment = StringAlignment.Center;
+ if (point.LabelAngle == 0)
+ {
+ format.Alignment = StringAlignment.Center;
+ format.LineAlignment = StringAlignment.Far;
+ }
+
+ // Get label text
+ string text;
+ if( point.Label.Length == 0 )
+ {
+ text = ValueConverter.FormatValue(
+ ser.Chart,
+ point,
+ point.Tag,
+ point.YValues[0],
+ point.LabelFormat,
+ ser.YValueType,
+ ChartElementType.DataPoint);
+ }
+ else
+ {
+ text = point.ReplaceKeywords(point.Label);
+ }
+
+ // Adjust label positio to the marker size
+ SizeF markerSizes = new SizeF(0f, 0f);
+ if (point.MarkerStyle != MarkerStyle.None)
+ {
+ markerSizes = graph.GetRelativeSize(new SizeF(point.MarkerSize, point.MarkerSize));
+ position.Y -= markerSizes.Height / 2f;
+ }
+
+ // Get text angle
+ int textAngle = point.LabelAngle;
+
+ // Check if text contains white space only
+ if (text.Trim().Length != 0)
+ {
+ SizeF sizeFont = SizeF.Empty;
+
+
+ // Check if Smart Labels are enabled
+ if (ser.SmartLabelStyle.Enabled)
+ {
+ // Get text size
+ sizeFont = graph.GetRelativeSize(
+ graph.MeasureString(text, point.Font, new SizeF(1000f, 1000f), StringFormat.GenericTypographic));
+
+ // Adjust label position using SmartLabelStyle algorithm
+ position = area.smartLabels.AdjustSmartLabelPosition(
+ common,
+ graph,
+ area,
+ ser.SmartLabelStyle,
+ position,
+ sizeFont,
+ format,
+ position,
+ markerSizes,
+ LabelAlignmentStyles.Top);
+
+ // Smart labels always use 0 degrees text angle
+ textAngle = 0;
+ }
+
+
+
+ // Draw label
+ if (!position.IsEmpty)
+ {
+ // Get text size
+ if (sizeFont.IsEmpty)
+ {
+ sizeFont = graph.GetRelativeSize(
+ graph.MeasureString(text, point.Font, new SizeF(1000f, 1000f), StringFormat.GenericTypographic));
+ }
+
+ // Get label background position
+ RectangleF labelBackPosition = RectangleF.Empty;
+ SizeF sizeLabel = new SizeF(sizeFont.Width, sizeFont.Height);
+ sizeLabel.Height += sizeFont.Height / 8;
+ sizeLabel.Width += sizeLabel.Width / text.Length;
+ labelBackPosition = PointChart.GetLabelPosition(
+ graph,
+ position,
+ sizeLabel,
+ format,
+ true);
+
+ // Draw label text
+ using (Brush brush = new SolidBrush(point.LabelForeColor))
+ {
+ graph.DrawPointLabelStringRel(
+ common,
+ text,
+ point.Font,
+ brush,
+ position,
+ format,
+ textAngle,
+ labelBackPosition,
+ point.LabelBackColor,
+ point.LabelBorderColor,
+ point.LabelBorderWidth,
+ point.LabelBorderDashStyle,
+ ser,
+ point,
+ pointIndex - 1);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ #endregion
+
+ #region 3D Drawing and Selection methods
+
+ /// <summary>
+ /// This method recalculates size of the bars. This method is used
+ /// from Paint or Select method.
+ /// </summary>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ virtual protected void ProcessChartType3D(
+ bool selection,
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ Series seriesToDraw )
+ {
+ // All data series from chart area which have Error Bar chart type
+ List<string> typeSeries = area.GetSeriesFromChartType(this.Name);
+
+ // Zero X values mode.
+ bool indexedSeries = ChartHelper.IndexedSeries(common, typeSeries.ToArray() );
+
+ //************************************************************
+ //** Loop through all series
+ //************************************************************
+ int seriesIndx = 0;
+ foreach( Series ser in common.DataManager.Series )
+ {
+ // Process non empty series of the area with stock chart type
+ if( String.Compare( ser.ChartTypeName, this.Name, StringComparison.OrdinalIgnoreCase ) != 0
+ || ser.ChartArea != area.Name || !ser.IsVisible())
+ {
+ continue;
+ }
+
+ // Check that we have at least 6 Y values
+ if(ser.YValuesPerPoint < 6)
+ {
+ throw(new ArgumentException(SR.ExceptionChartTypeRequiresYValues( ChartTypeNames.BoxPlot, "6")));
+ }
+
+ // Check if side-by-side attribute is set
+ bool currentShowSideBySide = showSideBySide;
+ if(ser.IsCustomPropertySet(CustomPropertyName.DrawSideBySide))
+ {
+ string attribValue = ser[CustomPropertyName.DrawSideBySide];
+ if(String.Compare( attribValue, "False", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ currentShowSideBySide = false;
+ }
+ else if (String.Compare(attribValue, "True", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ currentShowSideBySide = true;
+ }
+ else if (String.Compare(attribValue, "Auto", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionAttributeDrawSideBySideInvalid));
+ }
+ }
+
+ // Find the number of "Column chart" data series
+ double numOfSeries = typeSeries.Count;
+ if(!currentShowSideBySide)
+ {
+ numOfSeries = 1;
+ }
+
+ // Set active horizontal/vertical axis
+ hAxis = area.GetAxis(AxisName.X, ser.XAxisType, ser.XSubAxisName);
+ vAxis = area.GetAxis(AxisName.Y, ser.YAxisType, ser.YSubAxisName);
+
+ // Get interval between points
+ double interval = (indexedSeries) ? 1 : area.GetPointsInterval( hAxis.IsLogarithmic, hAxis.logarithmBase );
+
+ // Calculates the width of the candles.
+ float width = (float)(ser.GetPointWidth(graph, hAxis, interval, 0.8) / numOfSeries);
+
+ // Call Back Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPrePaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+
+ //************************************************************
+ //** Get series depth and Z position
+ //************************************************************
+ float seriesDepth, seriesZPosition;
+ area.GetSeriesZPositionAndDepth(ser, out seriesDepth, out seriesZPosition);
+
+ //************************************************************
+ //** Series data points loop
+ //************************************************************
+ int index = 1;
+ foreach( DataPoint point in ser.Points )
+ {
+ // Check required Y values number
+ if(point.YValues.Length < this.YValuesPerPoint)
+ {
+ throw(new InvalidOperationException(SR.ExceptionChartTypeRequiresYValues(this.Name, this.YValuesPerPoint.ToString(CultureInfo.InvariantCulture))));
+ }
+
+ // Reset pre-calculated point position
+ point.positionRel = new PointF(float.NaN, float.NaN);
+
+ // Get point X position
+ float xPosition = 0f;
+ double xValue = point.XValue;
+ if( indexedSeries )
+ {
+ xValue = (double)index;
+ xPosition = (float)(hAxis.GetPosition( (double)index ) - width * ((double) numOfSeries) / 2.0 + width/2 + seriesIndx * width);
+ }
+ else if( currentShowSideBySide )
+ {
+ xPosition = (float)(hAxis.GetPosition( xValue ) - width * ((double) numOfSeries) / 2.0 + width/2 + seriesIndx * width);
+ }
+ else
+ {
+ xPosition = (float)hAxis.GetPosition( xValue );
+ }
+
+ double yValue0 = vAxis.GetLogValue( point.YValues[0] );
+ double yValue1 = vAxis.GetLogValue( point.YValues[1] );
+ xValue = hAxis.GetLogValue(xValue);
+
+ // Check if chart is completly out of the data scaleView
+ if(xValue < hAxis.ViewMinimum ||
+ xValue > hAxis.ViewMaximum ||
+ (yValue0 < vAxis.ViewMinimum && yValue1 < vAxis.ViewMinimum) ||
+ (yValue0 > vAxis.ViewMaximum && yValue1 > vAxis.ViewMaximum) )
+ {
+ ++index;
+ continue;
+ }
+
+ // Make sure High/Low values are in data scaleView range
+ double high = vAxis.GetLogValue( point.YValues[1] );
+ double low = vAxis.GetLogValue( point.YValues[0] );
+
+ if( high > vAxis.ViewMaximum )
+ {
+ high = vAxis.ViewMaximum;
+ }
+ if( high < vAxis.ViewMinimum )
+ {
+ high = vAxis.ViewMinimum;
+ }
+ high = (float)vAxis.GetLinearPosition(high);
+
+ if( low > vAxis.ViewMaximum )
+ {
+ low = vAxis.ViewMaximum;
+ }
+ if( low < vAxis.ViewMinimum )
+ {
+ low = vAxis.ViewMinimum;
+ }
+ low = vAxis.GetLinearPosition(low);
+
+ // Remeber pre-calculated point position
+ point.positionRel = new PointF((float)xPosition, (float)Math.Min(high, low));
+
+ // 3D Transform coordinates
+ Point3D[] points = new Point3D[6];
+ points[0] = new Point3D(xPosition, (float)low, seriesZPosition+seriesDepth/2f);
+ points[1] = new Point3D(xPosition, (float)high, seriesZPosition+seriesDepth/2f);
+ points[2] = new Point3D(xPosition, (float)vAxis.GetPosition(point.YValues[2]), seriesZPosition+seriesDepth/2f);
+ points[3] = new Point3D(xPosition, (float)vAxis.GetPosition(point.YValues[3]), seriesZPosition+seriesDepth/2f);
+ points[4] = new Point3D(xPosition, (float)vAxis.GetPosition(point.YValues[4]), seriesZPosition+seriesDepth/2f);
+ points[5] = new Point3D(xPosition, (float)vAxis.GetPosition(point.YValues[5]), seriesZPosition+seriesDepth/2f);
+ area.matrix3D.TransformPoints(points);
+
+ if( common.ProcessModePaint )
+ {
+ // Check if chart is partialy in the data scaleView
+ bool clipRegionSet = false;
+ if(xValue == hAxis.ViewMinimum || xValue == hAxis.ViewMaximum )
+ {
+ // Set clipping region for line drawing
+ graph.SetClip( area.PlotAreaPosition.ToRectangleF() );
+ clipRegionSet = true;
+ }
+
+ // Define line color
+ Color lineColor = point.BorderColor;
+ if(lineColor == Color.Empty)
+ {
+ lineColor = point.Color;
+ }
+
+ // Start Svg Selection mode
+ graph.StartHotRegion( point );
+
+ // Draw lower whisker line
+ graph.DrawLineRel(
+ lineColor,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ points[0].PointF,
+ points[2].PointF,
+ ser.ShadowColor,
+ ser.ShadowOffset );
+
+ // Draw upper whisker line
+ graph.DrawLineRel(
+ lineColor,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ points[1].PointF,
+ points[3].PointF,
+ ser.ShadowColor,
+ ser.ShadowOffset );
+
+ // Draw Box
+ RectangleF rectSize = RectangleF.Empty;
+ rectSize.X = (float)(points[0].X - width/2);
+ rectSize.Width = (float)(width);
+ rectSize.Y = (float)points[3].Y;
+ rectSize.Height = (float)Math.Abs(rectSize.Y - points[2].Y);
+ graph.FillRectangleRel( rectSize,
+ point.Color,
+ point.BackHatchStyle,
+ point.BackImage,
+ point.BackImageWrapMode,
+ point.BackImageTransparentColor,
+ point.BackImageAlignment,
+ point.BackGradientStyle,
+ point.BackSecondaryColor,
+ point.BorderColor,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ ser.ShadowColor,
+ ser.ShadowOffset,
+ PenAlignment.Inset );
+
+ // Check if average line should be drawn
+ bool showAverage = true;
+ if(point.IsCustomPropertySet(CustomPropertyName.BoxPlotShowAverage) || ser.IsCustomPropertySet(CustomPropertyName.BoxPlotShowAverage))
+ {
+ string showAverageValue = ser[CustomPropertyName.BoxPlotShowAverage];
+ if(point.IsCustomPropertySet(CustomPropertyName.BoxPlotShowAverage))
+ {
+ showAverageValue = point[CustomPropertyName.BoxPlotShowAverage];
+ }
+ if(String.Compare(showAverageValue, "True", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ // default - do nothing
+ }
+ else if(String.Compare(showAverageValue, "False", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ showAverage = false;
+ }
+ else
+ {
+ throw(new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid(point[CustomPropertyName.BoxPlotShowAverage], "BoxPlotShowAverage")));
+ }
+ }
+
+ // Draw average line
+ Color markerLinesColor = lineColor;
+ if(markerLinesColor == point.Color)
+ {
+ double brightness = Math.Sqrt(point.Color.R * point.Color.R + point.Color.G * point.Color.G + point.Color.B * point.Color.B);
+ if(brightness > 220)
+ {
+ markerLinesColor = ChartGraphics.GetGradientColor(point.Color, Color.Black, 0.4);
+ }
+ else
+ {
+ markerLinesColor = ChartGraphics.GetGradientColor(point.Color, Color.White, 0.4);
+ }
+ }
+ if(!double.IsNaN(point.YValues[4]) && showAverage)
+ {
+ graph.DrawLineRel(
+ markerLinesColor,
+ 1,
+ ChartDashStyle.Solid,
+ new PointF(rectSize.Left, (float)points[4].Y),
+ new PointF(rectSize.Right, (float)points[4].Y),
+ Color.Empty,
+ 0 );
+ }
+
+ // Check if median line should be drawn
+ bool showMedian = true;
+ if(point.IsCustomPropertySet(CustomPropertyName.BoxPlotShowMedian) || ser.IsCustomPropertySet(CustomPropertyName.BoxPlotShowMedian))
+ {
+ string showMedianValue = ser[CustomPropertyName.BoxPlotShowMedian];
+ if(point.IsCustomPropertySet(CustomPropertyName.BoxPlotShowMedian))
+ {
+ showMedianValue = point[CustomPropertyName.BoxPlotShowMedian];
+ }
+ if(String.Compare( showMedianValue, "True", StringComparison.OrdinalIgnoreCase ) == 0)
+ {
+ // default - do nothing
+ }
+ else if(String.Compare(showMedianValue, "False", StringComparison.OrdinalIgnoreCase ) == 0)
+ {
+ showMedian = false;
+ }
+ else
+ {
+ throw(new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid(point[CustomPropertyName.BoxPlotShowMedian], "BoxPlotShowMedian")));
+ }
+ }
+
+ // Draw median line
+ if(!double.IsNaN(point.YValues[5]) && showMedian)
+ {
+ float medianValue = (float)points[5].Y;
+ float dashWidth = rectSize.Width / 9f;
+
+ // Dash width should not be less than 2 pixels
+ SizeF minSize = graph.GetRelativeSize(new SizeF(2, 2));
+ dashWidth = Math.Max(dashWidth, minSize.Width);
+
+ for(float curPosition = rectSize.Left; curPosition < rectSize.Right; curPosition += dashWidth * 2f)
+ {
+ graph.DrawLineRel(
+ markerLinesColor,
+ 1,
+ ChartDashStyle.Solid,
+ new PointF(curPosition, medianValue),
+ new PointF((float) Math.Min(rectSize.Right, curPosition + dashWidth), medianValue),
+ Color.Empty,
+ 0 );
+ }
+ }
+
+ // Draw Box Plot marks
+ DrawBoxPlotMarks3D(graph, area, ser, point, xPosition, width, seriesZPosition, seriesDepth);
+ xPosition = points[0].X;
+ high = points[0].Y;
+ low = points[1].Y;
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+
+ // Reset Clip Region
+ if(clipRegionSet)
+ {
+ graph.ResetClip();
+ }
+ }
+
+ if( common.ProcessModeRegions )
+ {
+ xPosition = points[0].X;
+ high = points[0].Y;
+ low = points[1].Y;
+
+ // Calculate rect around the error bar marks
+ RectangleF areaRect = RectangleF.Empty;
+ areaRect.X = xPosition - width / 2f;
+ areaRect.Y = (float)Math.Min(high, low);
+ areaRect.Width = width;
+ areaRect.Height = (float)Math.Max(high, low) - areaRect.Y;
+
+ // Add area
+ common.HotRegionsList.AddHotRegion( areaRect, point, ser.Name, index - 1 );
+ }
+
+ ++index;
+ }
+
+ //************************************************************
+ //** Second series data points loop, when labels are drawn.
+ //************************************************************
+ if( !selection )
+ {
+ index = 1;
+ foreach( DataPoint point in ser.Points )
+ {
+ // Get point X position
+ float xPosition = 0f;
+ double xValue = point.XValue;
+ if( indexedSeries )
+ {
+ xValue = (double)index;
+ xPosition = (float)(hAxis.GetPosition( (double)index ) - width * ((double) numOfSeries) / 2.0 + width/2 + seriesIndx * width);
+ }
+ else if( currentShowSideBySide )
+ {
+ xPosition = (float)(hAxis.GetPosition( xValue ) - width * ((double) numOfSeries) / 2.0 + width/2 + seriesIndx * width);
+ }
+ else
+ {
+ xPosition = (float)hAxis.GetPosition( xValue );
+ }
+
+
+ double yValue0 = vAxis.GetLogValue( point.YValues[0] );
+ double yValue1 = vAxis.GetLogValue( point.YValues[1] );
+ xValue = hAxis.GetLogValue(xValue);
+
+ // Check if chart is completly out of the data scaleView
+ if(xValue < hAxis.ViewMinimum ||
+ xValue > hAxis.ViewMaximum ||
+ (yValue0 < vAxis.ViewMinimum && yValue1 < vAxis.ViewMinimum) ||
+ (yValue0 > vAxis.ViewMaximum && yValue1 > vAxis.ViewMaximum) )
+ {
+ ++index;
+ continue;
+ }
+
+ // Make sure High/Low values are in data scaleView range
+ double high = vAxis.GetLogValue( point.YValues[1] );
+ double low = vAxis.GetLogValue( point.YValues[0] );
+ if( high > vAxis.ViewMaximum )
+ {
+ high = vAxis.ViewMaximum;
+ }
+ if( high < vAxis.ViewMinimum )
+ {
+ high = vAxis.ViewMinimum;
+ }
+ high = (float)vAxis.GetLinearPosition(high);
+
+ if( low > vAxis.ViewMaximum )
+ {
+ low = vAxis.ViewMaximum;
+ }
+ if( low < vAxis.ViewMinimum )
+ {
+ low = vAxis.ViewMinimum;
+ }
+ low = vAxis.GetLinearPosition(low);
+
+
+ // 3D Transform coordinates
+ Point3D[] points = new Point3D[2];
+ points[0] = new Point3D(xPosition, (float)high, seriesZPosition+seriesDepth/2f);
+ points[1] = new Point3D(xPosition, (float)low, seriesZPosition+seriesDepth/2f);
+ area.matrix3D.TransformPoints(points);
+ xPosition = points[0].X;
+ high = points[0].Y;
+ low = points[1].Y;
+
+ // Draw label
+ DrawLabel(common, area, graph, ser, point, new PointF(xPosition, (float)Math.Min(high, low)), index);
+
+ ++index;
+ }
+ }
+
+ // Call Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPrePaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+ }
+ }
+
+ /// <summary>
+ /// Draws 3D box plot markers.
+ /// </summary>
+ /// <param name="graph">Chart graphics object.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="ser">Data point series.</param>
+ /// <param name="point">Data point to draw.</param>
+ /// <param name="xPosition">X position.</param>
+ /// <param name="width">Point width.</param>
+ /// <param name="zPosition">Series Z position.</param>
+ /// <param name="depth">Series depth.</param>
+ virtual protected void DrawBoxPlotMarks3D(
+ ChartGraphics graph,
+ ChartArea area,
+ Series ser,
+ DataPoint point,
+ float xPosition,
+ float width,
+ float zPosition,
+ float depth)
+ {
+ // Get markers style
+ string markerStyle = "LINE";
+ if(point.MarkerStyle != MarkerStyle.None)
+ {
+ markerStyle = point.MarkerStyle.ToString();
+ }
+
+ // Draw lower marker
+ double yPosition = vAxis.GetLogValue( point.YValues[0] );
+ DrawBoxPlotSingleMarker(graph, area, point, markerStyle, xPosition, (float)yPosition, zPosition+depth/2f, width, true);
+
+ // Draw upper marker
+ yPosition = vAxis.GetLogValue( point.YValues[1] );
+ DrawBoxPlotSingleMarker(graph, area, point, markerStyle, xPosition, (float)yPosition, zPosition+depth/2f, width, true);
+
+ // Draw unusual points if any
+ markerStyle = "CIRCLE";
+ if(point.MarkerStyle != MarkerStyle.None)
+ {
+ markerStyle = point.MarkerStyle.ToString();
+ }
+ for(int valueIndex = 6; valueIndex < point.YValues.Length; valueIndex++)
+ {
+ if(!double.IsNaN(point.YValues[valueIndex]))
+ {
+ yPosition = vAxis.GetLogValue( point.YValues[valueIndex] );
+ DrawBoxPlotSingleMarker(graph, area, point, markerStyle, xPosition, (float)yPosition, zPosition+depth/2f, width, true);
+ }
+ }
+ }
+
+ #endregion
+
+ #region Y values related methods
+
+ /// <summary>
+ /// Helper function that returns the Y value of the point.
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="area">Chart area the series belongs to.</param>
+ /// <param name="series">Sereis of the point.</param>
+ /// <param name="point">Point object.</param>
+ /// <param name="pointIndex">Index of the point.</param>
+ /// <param name="yValueIndex">Index of the Y value to get.</param>
+ /// <returns>Y value of the point.</returns>
+ virtual public double GetYValue(
+ CommonElements common,
+ ChartArea area,
+ Series series,
+ DataPoint point,
+ int pointIndex,
+ int yValueIndex)
+ {
+ return point.YValues[yValueIndex];
+ }
+
+ #endregion
+
+ #region Automatic Values Calculation methods
+
+ /// <summary>
+ /// Populates box plot chart type using series data specified in "BoxPlotSeries" custom attribute.
+ /// </summary>
+ /// <param name="boxPlotSeries">Box Plot chart type series.</param>
+ internal static void CalculateBoxPlotFromLinkedSeries(Series boxPlotSeries)
+ {
+ // Check input parameters
+ if(String.Compare( boxPlotSeries.ChartTypeName, ChartTypeNames.BoxPlot, StringComparison.OrdinalIgnoreCase) != 0)
+ {
+ return;
+ }
+
+ // Check if "BoxPlotSeries" custom attribute is set for the series
+ if(boxPlotSeries.IsCustomPropertySet(CustomPropertyName.BoxPlotSeries))
+ {
+ // Create as many data points as series in attribute
+ string[] attrValues = boxPlotSeries[CustomPropertyName.BoxPlotSeries].Split(';');
+
+ // Clear and and new points
+ boxPlotSeries.Points.Clear();
+ int pointIndex = 0;
+ foreach(string val in attrValues)
+ {
+ boxPlotSeries.Points.AddY(0.0);
+ boxPlotSeries.Points[pointIndex++][CustomPropertyName.BoxPlotSeries] = val.Trim();
+ }
+ }
+
+ // Calculate box plot for every data point
+ for(int pointIndex = 0; pointIndex < boxPlotSeries.Points.Count; pointIndex++)
+ {
+ DataPoint point = boxPlotSeries.Points[pointIndex];
+ if(point.IsCustomPropertySet(CustomPropertyName.BoxPlotSeries))
+ {
+ // Get series and value name
+ string linkedSeriesName = point[CustomPropertyName.BoxPlotSeries];
+ String valueName = "Y";
+ int valueTypeIndex = linkedSeriesName.IndexOf(":", StringComparison.OrdinalIgnoreCase);
+ if(valueTypeIndex >= 0)
+ {
+ valueName = linkedSeriesName.Substring(valueTypeIndex + 1);
+ linkedSeriesName = linkedSeriesName.Substring(0, valueTypeIndex);
+ }
+
+ // Get reference to the chart control
+ Chart control = boxPlotSeries.Chart;
+ if(control != null)
+ {
+ // Get linked series and check existance
+ if(control.Series.IndexOf(linkedSeriesName) == -1)
+ {
+ throw(new InvalidOperationException(SR.ExceptionCustomAttributeSeriesNameNotFound("BoxPlotSeries", linkedSeriesName) ));
+ }
+ Series linkedSeries = control.Series[linkedSeriesName];
+
+ // Calculate box point values
+ CalculateBoxPlotValues(ref point, linkedSeries, valueName);
+ }
+
+ }
+ }
+
+ }
+
+ /// <summary>
+ /// Calculates values for single Box Plot point using specified data series.
+ /// </summary>
+ /// <param name="boxPoint">Data Point.</param>
+ /// <param name="linkedSeries">Linked data series.</param>
+ /// <param name="valueName">Name of the point value to link to.</param>
+ private static void CalculateBoxPlotValues(ref DataPoint boxPoint, Series linkedSeries, string valueName)
+ {
+ // Linked series must be non-empty
+ if (linkedSeries.Points.Count == 0)
+ {
+ return;
+ }
+
+ // Calculate an average value for all the data points
+ double averageValue = 0.0;
+ int valueCount = 0;
+ foreach(DataPoint point in linkedSeries.Points)
+ {
+ if(!point.IsEmpty)
+ {
+ averageValue += point.GetValueByName(valueName);
+ ++valueCount;
+ }
+ }
+ averageValue /= valueCount;
+
+ // Fill array of Y values
+ List<double> yValues = new List<double>(valueCount);
+ foreach(DataPoint point in linkedSeries.Points)
+ {
+ if(!point.IsEmpty)
+ {
+ yValues.Add((point.IsEmpty) ? double.NaN : point.GetValueByName(valueName));
+ }
+ }
+
+ // Get required percentiles
+ double[] requiredPercentile = new Double[] { 10.0, 90.0, 25.0, 75.0, 50.0 };
+ string boxPercentile = (boxPoint.IsCustomPropertySet(CustomPropertyName.BoxPlotPercentile)) ? boxPoint[CustomPropertyName.BoxPlotPercentile] : String.Empty;
+ if(boxPercentile.Length == 0 && boxPoint.series != null && boxPoint.series.IsCustomPropertySet(CustomPropertyName.BoxPlotPercentile))
+ {
+ boxPercentile = boxPoint.series[CustomPropertyName.BoxPlotPercentile];
+ }
+ string boxWhiskerPercentile = (boxPoint.IsCustomPropertySet(CustomPropertyName.BoxPlotWhiskerPercentile)) ? boxPoint[CustomPropertyName.BoxPlotWhiskerPercentile] : String.Empty;
+ if(boxWhiskerPercentile.Length == 0 && boxPoint.series != null && boxPoint.series.IsCustomPropertySet(CustomPropertyName.BoxPlotWhiskerPercentile))
+ {
+ boxWhiskerPercentile = boxPoint.series[CustomPropertyName.BoxPlotWhiskerPercentile];
+ }
+
+ // Check specified
+ if (boxPercentile.Length > 0)
+ {
+ double percentile;
+ bool parseSucceed = double.TryParse(boxPercentile, NumberStyles.Any, CultureInfo.InvariantCulture, out percentile);
+ if (parseSucceed)
+ {
+ requiredPercentile[2] = percentile;
+ }
+
+ if (!parseSucceed || requiredPercentile[2] < 0 || requiredPercentile[2] > 50)
+ {
+ throw (new InvalidOperationException(SR.ExceptionCustomAttributeIsNotInRange0to50("BoxPlotPercentile")));
+ }
+
+ requiredPercentile[3] = 100.0 - requiredPercentile[2];
+ }
+
+ if (boxWhiskerPercentile.Length > 0)
+ {
+
+ double percentile;
+ bool parseSucceed = double.TryParse(boxWhiskerPercentile, NumberStyles.Any, CultureInfo.InvariantCulture, out percentile);
+ if (parseSucceed)
+ {
+ requiredPercentile[0] = percentile;
+ }
+
+
+ if (!parseSucceed || requiredPercentile[0] < 0 || requiredPercentile[0] > 50)
+ {
+ throw (new InvalidOperationException(SR.ExceptionCustomAttributeIsNotInRange0to50("BoxPlotPercentile")));
+ }
+
+ requiredPercentile[1] = 100.0 - requiredPercentile[0];
+ }
+
+ // Calculate 5 recured percentile values
+ double[] percentileValues = CalculatePercentileValues(yValues, requiredPercentile);
+
+ // Set data points values
+ boxPoint.YValues[0] = percentileValues[0];
+ boxPoint.YValues[1] = percentileValues[1];
+ boxPoint.YValues[2] = percentileValues[2];
+ boxPoint.YValues[3] = percentileValues[3];
+ boxPoint.YValues[4] = averageValue;
+ boxPoint.YValues[5] = percentileValues[4];
+
+ // Check if unusual values should be added
+ bool addUnusualValues = false;
+ string showUnusualValues = (boxPoint.IsCustomPropertySet(CustomPropertyName.BoxPlotShowUnusualValues)) ? boxPoint[CustomPropertyName.BoxPlotShowUnusualValues] : String.Empty;
+ if(showUnusualValues.Length == 0 && boxPoint.series != null && boxPoint.series.IsCustomPropertySet(CustomPropertyName.BoxPlotShowUnusualValues))
+ {
+ showUnusualValues = boxPoint.series[CustomPropertyName.BoxPlotShowUnusualValues];
+ }
+ if(showUnusualValues.Length > 0)
+ {
+ if(String.Compare(showUnusualValues, "True", StringComparison.OrdinalIgnoreCase ) == 0)
+ {
+ addUnusualValues = true;
+ }
+ else if(String.Compare(showUnusualValues, "False", StringComparison.OrdinalIgnoreCase ) == 0)
+ {
+ addUnusualValues = false;
+ }
+ else
+ {
+ throw(new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid2("BoxPlotShowUnusualValues")));
+ }
+ }
+
+ // Add unusual point
+ if(addUnusualValues)
+ {
+ BoxPlotAddUnusual(ref boxPoint, yValues);
+ }
+ }
+
+ /// <summary>
+ /// Add unusual data point
+ /// </summary>
+ /// <param name="boxPoint">Data Point.</param>
+ /// <param name="yValues">Y values array.</param>
+ static private void BoxPlotAddUnusual(ref DataPoint boxPoint, List<double> yValues)
+ {
+ // Get unusual values
+ ArrayList unusualValuesList = new ArrayList();
+ foreach(double yValue in yValues)
+ {
+ if(yValue < boxPoint.YValues[0] || yValue > boxPoint.YValues[1])
+ {
+ unusualValuesList.Add(yValue);
+ }
+ }
+
+ // Update point's values
+ if(unusualValuesList.Count > 0)
+ {
+ // Create new arry of values for the data pont
+ double[] newYValues = new double[6 + unusualValuesList.Count];
+
+ // Copy original data
+ for(int index = 0; index < 6; index++)
+ {
+ newYValues[index] = boxPoint.YValues[index];
+ }
+
+ // Add unusual values
+ for(int index = 0; index < unusualValuesList.Count; index++)
+ {
+ newYValues[6 + index] = (double)unusualValuesList[index];
+ }
+
+ // Set new values array
+ boxPoint.YValues = newYValues;
+ }
+ }
+
+ /// <summary>
+ /// Calculates required percentile values from the data
+ /// </summary>
+ /// <returns>Array of 5 values</returns>
+ /// <param name="yValues">Y values array.</param>
+ /// <param name="requiredPercentile">Required percentile</param>
+ /// <returns>Array of 5 values</returns>
+ static private double[] CalculatePercentileValues(List<double> yValues, double[] requiredPercentile)
+ {
+ // Create results array
+ double[] result = new double[5];
+
+ // Sort Y values array
+ yValues.Sort();
+
+ // Calculate required percentile
+ int index = 0;
+ foreach(double percentile in requiredPercentile)
+ {
+ // Get percentile point index
+ double percentPointIndex = (yValues.Count - 1.0)/ 100.0 * percentile;
+ double percentPointIndexInteger = Math.Floor(percentPointIndex);
+ double percentPointIndexReminder = percentPointIndex - percentPointIndexInteger;
+
+ result[index] = 0.0;
+ if ((int)percentPointIndexInteger < yValues.Count)
+ {
+ result[index] += (1.0 - percentPointIndexReminder) * yValues[(int)percentPointIndexInteger];
+ }
+ if ((int)(percentPointIndexInteger + 1) < yValues.Count)
+ {
+ result[index] += percentPointIndexReminder * yValues[(int)percentPointIndexInteger + 1];
+ }
+
+ ++index;
+ }
+
+
+ return result;
+ }
+
+ #endregion
+
+ #region SmartLabelStyle methods
+
+ /// <summary>
+ /// Adds markers position to the list. Used to check SmartLabelStyle overlapping.
+ /// </summary>
+ /// <param name="common">Common chart elements.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="series">Series values to be used.</param>
+ /// <param name="list">List to add to.</param>
+ public void AddSmartLabelMarkerPositions(CommonElements common, ChartArea area, Series series, ArrayList list)
+ {
+ // No data point markers supported for SmartLabelStyle
+ }
+
+ #endregion
+
+ #region IDisposable interface implementation
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected virtual void Dispose(bool disposing)
+ {
+ //Nothing to dispose at the base class.
+ }
+
+ /// <summary>
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// </summary>
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+ #endregion
+ }
+}
+
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/BubbleChart.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/BubbleChart.cs
new file mode 100644
index 00000000000..bab203a8148
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/BubbleChart.cs
@@ -0,0 +1,497 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: BubbleChart.cs
+//
+// Namespace: DataVisualization.Charting.ChartTypes
+//
+// Classes: BubbleChart
+//
+// Purpose: Bubble chart type is similar to the Point chart
+// where each data point is presented with a marker
+// positioned using X and Y values. The difference
+// of the Bubble chart is that an additional Y value
+// is used to control the size of the marker.
+//
+// Reviewed: AG - August 6, 2002
+// AG - Microsoft 6, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Collections;
+using System.Resources;
+using System.Reflection;
+using System.Drawing;
+using System.Globalization;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+
+#else
+using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.ChartTypes
+#else
+ namespace System.Web.UI.DataVisualization.Charting.ChartTypes
+#endif
+{
+ /// <summary>
+ /// BubbleChart class extends PointChart class to add support for
+ /// additional Y value which controls the size of the markers used.
+ /// </summary>
+ internal class BubbleChart : PointChart
+ {
+ #region Fields and Constructor
+
+ // Indicates that bubble size scale is calculated
+ private bool _scaleDetected = false;
+
+ // Minimum/Maximum bubble size
+ private double _maxPossibleBubbleSize = 15F;
+ private double _minPossibleBubbleSize = 3F;
+ private float _maxBubleSize = 0f;
+ private float _minBubleSize = 0f;
+
+ // Current min/max size of the bubble size
+ private double _minAll = double.MaxValue;
+ private double _maxAll = double.MinValue;
+
+
+ // Bubble size difference value
+ private double _valueDiff = 0;
+ private double _valueScale = 1;
+
+ /// <summary>
+ /// Class public constructor
+ /// </summary>
+ public BubbleChart() : base(true)
+ {
+ }
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ override public string Name { get{ return ChartTypeNames.Bubble;}}
+
+ /// <summary>
+ /// Number of supported Y value(s) per point
+ /// </summary>
+ override public int YValuesPerPoint { get { return 2; } }
+
+ /// <summary>
+ /// Chart type with two y values used for scale ( bubble chart type )
+ /// </summary>
+ override public bool SecondYScale{ get{ return true;} }
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ override public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+
+ #endregion
+
+ #region Bubble chart methods
+
+ /// <summary>
+ /// This method recalculates size of the bars. This method is used
+ /// from Paint or Select method.
+ /// </summary>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active</param>
+ /// <param name="graph">The Chart Graphics object</param>
+ /// <param name="common">The Common elements object</param>
+ /// <param name="area">Chart area for this chart</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ override protected void ProcessChartType(
+ bool selection,
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ Series seriesToDraw )
+ {
+ _scaleDetected = false;
+ base.ProcessChartType(selection, graph, common, area, seriesToDraw );
+ }
+
+ /// <summary>
+ /// Gets marker border size.
+ /// </summary>
+ /// <param name="point">Data point.</param>
+ /// <returns>Marker border size.</returns>
+ override protected int GetMarkerBorderSize(DataPointCustomProperties point)
+ {
+ if(point.series != null)
+ {
+ return point.series.BorderWidth;
+ }
+
+ return 1;
+ }
+
+ /// <summary>
+ /// Returns marker size.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="point">Data point.</param>
+ /// <param name="markerSize">Marker size.</param>
+ /// <param name="markerImage">Marker image.</param>
+ /// <returns>Marker width and height.</returns>
+ override protected SizeF GetMarkerSize(
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ DataPoint point,
+ int markerSize,
+ string markerImage)
+ {
+ // Check required Y values number
+ if(point.YValues.Length < this.YValuesPerPoint)
+ {
+ throw(new InvalidOperationException(SR.ExceptionChartTypeRequiresYValues(this.Name, this.YValuesPerPoint.ToString(CultureInfo.InvariantCulture))));
+ }
+
+ // Marker size
+ SizeF size = new SizeF(markerSize, markerSize);
+ if (graph != null && graph.Graphics != null)
+ {
+ // Marker size is in pixels and we do the mapping for higher DPIs
+ size.Width = markerSize * graph.Graphics.DpiX / 96;
+ size.Height = markerSize * graph.Graphics.DpiY / 96;
+ }
+
+ // Check number of Y values for non empty points
+ if(point.series.YValuesPerPoint > 1 && !point.IsEmpty)
+ {
+ // Scale Y values
+ size.Width = ScaleBubbleSize(graph, common, area, point.YValues[1]);
+ size.Height = ScaleBubbleSize(graph, common, area, point.YValues[1]);
+ }
+
+ return size;
+ }
+
+ /// <summary>
+ /// Scales the value used to determine the size of the Bubble.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object</param>
+ /// <param name="common">The Common elements object</param>
+ /// <param name="area">Chart area for this chart</param>
+ /// <param name="value">Value to scale.</param>
+ /// <returns>Scaled values.</returns>
+ private float ScaleBubbleSize(ChartGraphics graph, CommonElements common, ChartArea area, double value)
+ {
+ // Check if scaling numbers are detected
+ if(!_scaleDetected)
+ {
+ // Try to find bubble size scale in the custom series properties
+ _minAll = double.MaxValue;
+ _maxAll = double.MinValue;
+ foreach( Series ser in common.DataManager.Series )
+ {
+ if( String.Compare( ser.ChartTypeName, this.Name, true, System.Globalization.CultureInfo.CurrentCulture) == 0 &&
+ ser.ChartArea == area.Name &&
+ ser.IsVisible())
+ {
+ // Check if custom properties are set to specify scale
+ if(ser.IsCustomPropertySet(CustomPropertyName.BubbleScaleMin))
+ {
+ _minAll = Math.Min(_minAll, CommonElements.ParseDouble(ser[CustomPropertyName.BubbleScaleMin]));
+ }
+ if(ser.IsCustomPropertySet(CustomPropertyName.BubbleScaleMax))
+ {
+ _maxAll = Math.Max(_maxAll, CommonElements.ParseDouble(ser[CustomPropertyName.BubbleScaleMax]));
+ }
+
+ // Check if attribute for max. size is set
+ if(ser.IsCustomPropertySet(CustomPropertyName.BubbleMaxSize))
+ {
+ _maxPossibleBubbleSize = CommonElements.ParseDouble(ser[CustomPropertyName.BubbleMaxSize]);
+ if(_maxPossibleBubbleSize < 0 || _maxPossibleBubbleSize > 100)
+ {
+ throw(new ArgumentException(SR.ExceptionCustomAttributeIsNotInRange0to100("BubbleMaxSize")));
+ }
+ }
+
+ // Check if attribute for min. size is set
+ if(ser.IsCustomPropertySet(CustomPropertyName.BubbleMinSize))
+ {
+ _minPossibleBubbleSize = CommonElements.ParseDouble(ser[CustomPropertyName.BubbleMinSize]);
+ if(_minPossibleBubbleSize < 0 || _minPossibleBubbleSize > 100)
+ {
+ throw(new ArgumentException(SR.ExceptionCustomAttributeIsNotInRange0to100("BubbleMinSize")));
+ }
+ }
+
+
+ // Check if custom properties set to use second Y value (bubble size) as label text
+ labelYValueIndex = 0;
+ if(ser.IsCustomPropertySet(CustomPropertyName.BubbleUseSizeForLabel))
+ {
+ if(String.Compare(ser[CustomPropertyName.BubbleUseSizeForLabel], "true", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ labelYValueIndex = 1;
+ break;
+ }
+ }
+ }
+ }
+
+ // Scale values are not specified - auto detect
+ if(_minAll == double.MaxValue || _maxAll == double.MinValue)
+ {
+ double minSer = double.MaxValue;
+ double maxSer = double.MinValue;
+ foreach( Series ser in common.DataManager.Series )
+ {
+ if( ser.ChartTypeName == this.Name && ser.ChartArea == area.Name && ser.IsVisible() )
+ {
+ foreach(DataPoint point in ser.Points)
+ {
+ if (!point.IsEmpty)
+ {
+ // Check required Y values number
+ if (point.YValues.Length < this.YValuesPerPoint)
+ {
+ throw (new InvalidOperationException(SR.ExceptionChartTypeRequiresYValues(this.Name, this.YValuesPerPoint.ToString(CultureInfo.InvariantCulture))));
+ }
+
+ minSer = Math.Min(minSer, point.YValues[1]);
+ maxSer = Math.Max(maxSer, point.YValues[1]);
+ }
+ }
+ }
+ }
+ if(_minAll == double.MaxValue)
+ {
+ _minAll = minSer;
+ }
+ if(_maxAll == double.MinValue)
+ {
+ _maxAll = maxSer;
+ }
+ }
+
+ // Calculate maximum bubble size
+ SizeF areaSize = graph.GetAbsoluteSize(area.PlotAreaPosition.Size);
+ _maxBubleSize = (float)(Math.Min(areaSize.Width, areaSize.Height) / (100.0/_maxPossibleBubbleSize));
+ _minBubleSize = (float)(Math.Min(areaSize.Width, areaSize.Height) / (100.0/_minPossibleBubbleSize));
+
+ // Calculate scaling variables depending on the Min/Max values
+ if(_maxAll == _minAll)
+ {
+ this._valueScale = 1;
+ this._valueDiff = _minAll - (_maxBubleSize - _minBubleSize)/2f;
+ }
+ else
+ {
+ this._valueScale = (_maxBubleSize - _minBubleSize) / (_maxAll - _minAll);
+ this._valueDiff = _minAll;
+ }
+
+ _scaleDetected = true;
+ }
+
+ // Check if value do not exceed Min&Max
+ if(value > _maxAll)
+ {
+ return 0F;
+ }
+ if(value < _minAll)
+ {
+ return 0F;
+ }
+
+ // Return scaled value
+ return (float)((value - this._valueDiff) * this._valueScale) + _minBubleSize;
+ }
+
+ /// <summary>
+ /// Scales the value used to determine the size of the Bubble.
+ /// </summary>
+ /// <param name="common">The Common elements object</param>
+ /// <param name="area">Chart area for this chart</param>
+ /// <param name="value">Value to scale.</param>
+ /// <param name="yValue">True if Y value is calculated, false if X.</param>
+ /// <returns>Scaled values.</returns>
+ static internal double AxisScaleBubbleSize(CommonElements common, ChartArea area, double value, bool yValue )
+ {
+
+ // Try to find bubble size scale in the custom series properties
+ double minAll = double.MaxValue;
+ double maxAll = double.MinValue;
+ double maxPossibleBubbleSize = 15F;
+ double minPossibleBubbleSize = 3F;
+ float maxBubleSize;
+ float minBubleSize;
+ double valueScale;
+ double valueDiff;
+ foreach( Series ser in common.DataManager.Series )
+ {
+ if( String.Compare( ser.ChartTypeName, ChartTypeNames.Bubble, StringComparison.OrdinalIgnoreCase) == 0 &&
+ ser.ChartArea == area.Name &&
+ ser.IsVisible())
+ {
+ // Check if custom properties are set to specify scale
+ if(ser.IsCustomPropertySet(CustomPropertyName.BubbleScaleMin))
+ {
+ minAll = Math.Min(minAll, CommonElements.ParseDouble(ser[CustomPropertyName.BubbleScaleMin]));
+ }
+ if(ser.IsCustomPropertySet(CustomPropertyName.BubbleScaleMax))
+ {
+ maxAll = Math.Max(maxAll, CommonElements.ParseDouble(ser[CustomPropertyName.BubbleScaleMax]));
+ }
+
+ // Check if attribute for max. size is set
+ if(ser.IsCustomPropertySet(CustomPropertyName.BubbleMaxSize))
+ {
+ maxPossibleBubbleSize = CommonElements.ParseDouble(ser[CustomPropertyName.BubbleMaxSize]);
+ if(maxPossibleBubbleSize < 0 || maxPossibleBubbleSize > 100)
+ {
+ throw(new ArgumentException(SR.ExceptionCustomAttributeIsNotInRange0to100("BubbleMaxSize")));
+ }
+ }
+
+ // Check if custom properties set to use second Y value (bubble size) as label text
+ if(ser.IsCustomPropertySet(CustomPropertyName.BubbleUseSizeForLabel))
+ {
+ if(String.Compare(ser[CustomPropertyName.BubbleUseSizeForLabel], "true", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ break;
+ }
+ }
+ }
+ }
+
+ // Scale values are not specified - auto detect
+ double minimum = double.MaxValue;
+ double maximum = double.MinValue;
+ double minSer = double.MaxValue;
+ double maxSer = double.MinValue;
+ foreach( Series ser in common.DataManager.Series )
+ {
+ if( String.Compare(ser.ChartTypeName, ChartTypeNames.Bubble, StringComparison.OrdinalIgnoreCase) == 0
+ && ser.ChartArea == area.Name
+ && ser.IsVisible() )
+ {
+ foreach(DataPoint point in ser.Points)
+ {
+ if (!point.IsEmpty)
+ {
+ minSer = Math.Min(minSer, point.YValues[1]);
+ maxSer = Math.Max(maxSer, point.YValues[1]);
+
+ if (yValue)
+ {
+ minimum = Math.Min(minimum, point.YValues[0]);
+ maximum = Math.Max(maximum, point.YValues[0]);
+ }
+ else
+ {
+ minimum = Math.Min(minimum, point.XValue);
+ maximum = Math.Max(maximum, point.XValue);
+ }
+ }
+ }
+ }
+ }
+ if(minAll == double.MaxValue)
+ {
+ minAll = minSer;
+ }
+ if(maxAll == double.MinValue)
+ {
+ maxAll = maxSer;
+ }
+
+ // Calculate maximum bubble size
+ maxBubleSize = (float)( (maximum - minimum) / (100.0/maxPossibleBubbleSize));
+ minBubleSize = (float)( (maximum - minimum) / (100.0/minPossibleBubbleSize));
+
+ // Calculate scaling variables depending on the Min/Max values
+ if(maxAll == minAll)
+ {
+ valueScale = 1;
+ valueDiff = minAll - (maxBubleSize - minBubleSize)/2f;
+ }
+ else
+ {
+ valueScale = (maxBubleSize - minBubleSize) / (maxAll - minAll);
+ valueDiff = minAll;
+ }
+
+
+ // Check if value do not exceed Min&Max
+ if(value > maxAll)
+ {
+ return 0F;
+ }
+ if(value < minAll)
+ {
+ return 0F;
+ }
+
+ // Return scaled value
+ return (float)((value - valueDiff) * valueScale) + minBubleSize;
+ }
+
+ /// <summary>
+ /// Get value from custom attribute BubbleMaxSize
+ /// </summary>
+ /// <param name="area">Chart Area</param>
+ /// <returns>Bubble Max size</returns>
+ static internal double GetBubbleMaxSize( ChartArea area )
+ {
+ double maxPossibleBubbleSize = 15;
+ // Try to find bubble size scale in the custom series properties
+ foreach( Series ser in area.Common.DataManager.Series )
+ {
+ if( String.Compare( ser.ChartTypeName, ChartTypeNames.Bubble, StringComparison.OrdinalIgnoreCase) == 0 &&
+ ser.ChartArea == area.Name &&
+ ser.IsVisible())
+ {
+ // Check if attribute for max. size is set
+ if(ser.IsCustomPropertySet(CustomPropertyName.BubbleMaxSize))
+ {
+ maxPossibleBubbleSize = CommonElements.ParseDouble(ser[CustomPropertyName.BubbleMaxSize]);
+ if(maxPossibleBubbleSize < 0 || maxPossibleBubbleSize > 100)
+ {
+ throw(new ArgumentException(SR.ExceptionCustomAttributeIsNotInRange0to100("BubbleMaxSize")));
+ }
+ }
+ }
+ }
+
+ return maxPossibleBubbleSize / 100;
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/ChartTypeRegistry.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/ChartTypeRegistry.cs
new file mode 100644
index 00000000000..bf6e8b3d3a8
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/ChartTypeRegistry.cs
@@ -0,0 +1,453 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: ChartTypeRegistry.cs
+//
+// Namespace: DataVisualization.Charting.ChartTypes
+//
+// Classes: ChartTypeRegistry, IChartType
+//
+// Purpose: ChartTypeRegistry is a repository for all standard
+// and custom chart types. Each chart type has unique
+// name and IChartType derived class which provides
+// behaviour information about the chart type and
+// also contains drwaing functionality.
+//
+// ChartTypeRegistry can be used by user for custom
+// chart type registering and can be retrieved using
+// Chart.GetService(typeof(ChartTypeRegistry)) method.
+//
+// Reviewed: AG - Aug 6, 2002
+// AG - Microsoft 6, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Resources;
+using System.Collections;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Reflection;
+using System.Drawing;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+
+#else
+using System.Web.UI.DataVisualization.Charting;
+
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.ChartTypes
+#else
+ namespace System.Web.UI.DataVisualization.Charting.ChartTypes
+#endif
+{
+ /// <summary>
+ /// ChartTypeName class contains constant strings defining
+ /// names of all ChartTypes used in the Chart.
+ /// </summary>
+ internal static class ChartTypeNames
+ {
+ #region Chart type names
+
+ internal const string Area = "Area";
+ internal const string RangeBar = "RangeBar";
+ internal const string Bar = "Bar";
+ internal const string SplineArea = "SplineArea";
+ internal const string BoxPlot = "BoxPlot";
+ internal const string Bubble = "Bubble";
+ internal const string Column = "Column";
+ internal const string RangeColumn = "RangeColumn";
+ internal const string Doughnut = "Doughnut";
+ internal const string ErrorBar = "ErrorBar";
+ internal const string FastLine = "FastLine";
+ internal const string FastPoint = "FastPoint";
+ internal const string Funnel = "Funnel";
+ internal const string Pyramid = "Pyramid";
+ internal const string Kagi = "Kagi";
+ internal const string Spline = "Spline";
+ internal const string Line = "Line";
+ internal const string PointAndFigure = "PointAndFigure";
+ internal const string Pie = "Pie";
+ internal const string Point = "Point";
+ internal const string Polar = "Polar";
+ internal const string Radar = "Radar";
+ internal const string SplineRange = "SplineRange";
+ internal const string Range = "Range";
+ internal const string Renko = "Renko";
+ internal const string OneHundredPercentStackedArea = "100%StackedArea";
+ internal const string StackedArea = "StackedArea";
+ internal const string OneHundredPercentStackedBar = "100%StackedBar";
+ internal const string StackedBar = "StackedBar";
+ internal const string OneHundredPercentStackedColumn = "100%StackedColumn";
+ internal const string StackedColumn = "StackedColumn";
+ internal const string StepLine = "StepLine";
+ internal const string Candlestick = "Candlestick";
+ internal const string Stock = "Stock";
+ internal const string ThreeLineBreak = "ThreeLineBreak";
+
+ #endregion // Keyword Names
+ }
+
+ /// <summary>
+ /// ChartTypeRegistry class is a repository for all standard and custom
+ /// chart types. In order for the chart control to display the chart
+ /// type, it first must be registered using unique name and IChartType
+ /// derived class which provides the description of the chart type and
+ /// also responsible for all drawing and hit testing.
+ ///
+ /// ChartTypeRegistry can be used by user for custom chart type registering
+ /// and can be retrieved using Chart.GetService(typeof(ChartTypeRegistry))
+ /// method.
+ /// </summary>
+ internal class ChartTypeRegistry : IServiceProvider, IDisposable
+ {
+ #region Fields
+
+ // Chart types image resource manager
+ private ResourceManager _resourceManager = null;
+
+ // Storage for registered/created chart types
+ internal Hashtable registeredChartTypes = new Hashtable(StringComparer.OrdinalIgnoreCase);
+ private Hashtable _createdChartTypes = new Hashtable(StringComparer.OrdinalIgnoreCase);
+
+ #endregion
+
+ #region Constructor and Services
+
+ /// <summary>
+ /// Chart types registry public constructor.
+ /// </summary>
+ public ChartTypeRegistry()
+ {
+ }
+
+ /// <summary>
+ /// Returns chart type registry service object.
+ /// </summary>
+ /// <param name="serviceType">Service type to get.</param>
+ /// <returns>Chart type registry service.</returns>
+ [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+ object IServiceProvider.GetService(Type serviceType)
+ {
+ if(serviceType == typeof(ChartTypeRegistry))
+ {
+ return this;
+ }
+ throw (new ArgumentException(SR.ExceptionChartTypeRegistryUnsupportedType( serviceType.ToString() ) ) );
+ }
+
+ #endregion
+
+ #region Registry methods
+
+ /// <summary>
+ /// Adds chart type into the registry.
+ /// </summary>
+ /// <param name="name">Chart type name.</param>
+ /// <param name="chartType">Chart class type.</param>
+ public void Register(string name, Type chartType)
+ {
+ // First check if chart type with specified name already registered
+ if(registeredChartTypes.Contains(name))
+ {
+ // If same type provided - ignore
+ if(registeredChartTypes[name].GetType() == chartType)
+ {
+ return;
+ }
+
+ // Error - throw exception
+ throw( new ArgumentException( SR.ExceptionChartTypeNameIsNotUnique( name ) ) );
+ }
+
+ // Make sure that specified class support IChartType interface
+ bool found = false;
+ Type[] interfaces = chartType.GetInterfaces();
+ foreach(Type type in interfaces)
+ {
+ if(type == typeof(IChartType))
+ {
+ found = true;
+ break;
+ }
+ }
+ if(!found)
+ {
+ throw (new ArgumentException(SR.ExceptionChartTypeHasNoInterface ));
+ }
+
+ // Add chart type to the hash table
+ registeredChartTypes[name] = chartType;
+ }
+
+ /// <summary>
+ /// Returns chart type object by name.
+ /// </summary>
+ /// <param name="chartType">Chart type.</param>
+ /// <returns>Chart type object derived from IChartType.</returns>
+ public IChartType GetChartType(SeriesChartType chartType)
+ {
+ return this.GetChartType(Series.GetChartTypeName(chartType));
+ }
+
+ /// <summary>
+ /// Returns chart type object by name.
+ /// </summary>
+ /// <param name="name">Chart type name.</param>
+ /// <returns>Chart type object derived from IChartType.</returns>
+ public IChartType GetChartType(string name)
+ {
+ // First check if chart type with specified name registered
+ if(!registeredChartTypes.Contains(name))
+ {
+ throw( new ArgumentException( SR.ExceptionChartTypeUnknown( name ) ) );
+ }
+
+ // Check if the chart type object is already created
+ if(!_createdChartTypes.Contains(name))
+ {
+ // Create chart type object
+ _createdChartTypes[name] =
+ ((Type)registeredChartTypes[name]).Assembly.
+ CreateInstance(((Type)registeredChartTypes[name]).ToString());
+ }
+
+ return (IChartType)_createdChartTypes[name];
+ }
+
+ /// <summary>
+ /// Chart images resource manager.
+ /// </summary>
+ public ResourceManager ResourceManager
+ {
+ get
+ {
+ // Create chart images resource manager
+ if(_resourceManager == null)
+ {
+ _resourceManager = new ResourceManager(typeof(Chart).Namespace + ".Design", Assembly.GetExecutingAssembly());
+ }
+ return _resourceManager;
+ }
+ }
+
+ #endregion
+
+ #region IDisposable Members
+
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected virtual void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ // Dispose managed resource
+ foreach (string name in this._createdChartTypes.Keys)
+ {
+ IChartType chartType = (IChartType)_createdChartTypes[name];
+ chartType.Dispose();
+ }
+ this._createdChartTypes.Clear();
+ }
+ }
+
+ /// <summary>
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// </summary>
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// IChartType interface must be implemented for any standard or custom
+ /// chart type displayed in the chart control. This interface defines
+ /// properties which provide information on chart type behaviour including
+ /// how many Y values supported, is it a stacked chart type, how it
+ /// interacts with axes and much more.
+ ///
+ /// IChartType interface methods define how to draw series data point,
+ /// calculate Y values and process SmartLabelStyle.
+ /// </summary>
+ internal interface IChartType : IDisposable
+ {
+ #region Properties
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ string Name { get; }
+
+ /// <summary>
+ /// Gets chart type image
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ System.Drawing.Image GetImage(ChartTypeRegistry registry);
+
+ /// <summary>
+ /// True if chart type is stacked
+ /// </summary>
+ bool Stacked { get; }
+
+
+ /// <summary>
+ /// True if stacked chart type supports groups
+ /// </summary>
+ bool SupportStackedGroups { get; }
+
+
+ /// <summary>
+ /// True if stacked chart type should draw separately positive and
+ /// negative data points ( Bar and column Stacked types ).
+ /// </summary>
+ bool StackSign { get; }
+
+ /// <summary>
+ /// True if chart type supports axeses
+ /// </summary>
+ bool RequireAxes { get; }
+
+ /// <summary>
+ /// True if chart type requires circular chart area.
+ /// </summary>
+ bool CircularChartArea { get; }
+
+ /// <summary>
+ /// True if chart type supports logarithmic axes
+ /// </summary>
+ bool SupportLogarithmicAxes { get; }
+
+ /// <summary>
+ /// True if chart type requires to switch the value (Y) axes position
+ /// </summary>
+ bool SwitchValueAxes { get; }
+
+ /// <summary>
+ /// True if chart series can be placed side-by-side.
+ /// </summary>
+ bool SideBySideSeries { get; }
+
+ /// <summary>
+ /// True if each data point of a chart must be represented in the legend
+ /// </summary>
+ bool DataPointsInLegend { get; }
+
+ /// <summary>
+ /// True if palette colors should be applied for each data paoint.
+ /// Otherwise the color is applied to the series.
+ /// </summary>
+ bool ApplyPaletteColorsToPoints { get; }
+
+ /// <summary>
+ /// Indicates that extra Y values are connected to the scale of the Y axis
+ /// </summary>
+ bool ExtraYValuesConnectedToYAxis{ get; }
+
+ /// <summary>
+ /// If the crossing value is auto Crossing value should be
+ /// automatically set to zero for some chart
+ /// types (Bar, column, area etc.)
+ /// </summary>
+ bool ZeroCrossing { get; }
+
+ /// <summary>
+ /// Number of supported Y value(s) per point
+ /// </summary>
+ int YValuesPerPoint{ get; }
+
+ /// <summary>
+ /// Chart type with two y values used for scale ( bubble chart type )
+ /// </summary>
+ bool SecondYScale{ get; }
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ bool HundredPercent{ get; }
+
+ /// <summary>
+ /// Indicates that negative 100% stacked values are shown on
+ /// the other side of the X axis
+ /// </summary>
+ bool HundredPercentSupportNegative{ get; }
+
+ /// <summary>
+ /// How to draw series/points in legend:
+ /// Filled rectangle, Line or Marker
+ /// </summary>
+ /// <param name="series">Legend item series.</param>
+ /// <returns>Legend item style.</returns>
+ LegendImageStyle GetLegendImageStyle(Series series);
+
+ #endregion
+
+ #region Painting and Selection methods
+
+ /// <summary>
+ /// Draw chart on specified chart graphics.
+ /// </summary>
+ /// <param name="graph">Chart grahhics object.</param>
+ /// <param name="common">Common elements.</param>
+ /// <param name="area">Chart area to draw on.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ void Paint(ChartGraphics graph, CommonElements common, ChartArea area, Series seriesToDraw);
+
+ #endregion
+
+ #region Y values methods
+
+ /// <summary>
+ /// Helper function, which returns the Y value of the data point.
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="area">Chart area the series belongs to.</param>
+ /// <param name="series">Sereis of the point.</param>
+ /// <param name="point">Point object.</param>
+ /// <param name="pointIndex">Index of the point.</param>
+ /// <param name="yValueIndex">Index of the Y value to get.</param>
+ /// <returns>Y value of the point.</returns>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "5#y")]
+ double GetYValue(CommonElements common, ChartArea area, Series series, DataPoint point, int pointIndex, int yValueIndex);
+
+ #endregion
+
+ #region SmartLabelStyle methods
+
+ /// <summary>
+ /// Adds markers position to the list. Used to check SmartLabelStyle overlapping.
+ /// </summary>
+ /// <param name="common">Common chart elements.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="series">Series values to be used.</param>
+ /// <param name="list">List to add to.</param>
+ void AddSmartLabelMarkerPositions(CommonElements common, ChartArea area, Series series, ArrayList list);
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/ColumnChart.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/ColumnChart.cs
new file mode 100644
index 00000000000..12a04e29d32
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/ColumnChart.cs
@@ -0,0 +1,1414 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: ColumnChart.cs
+//
+// Namespace: System.Web.UI.DataVisualization.Charting.ChartTypes
+//
+// Classes: ColumnChart, RangeColumnChart
+//
+// Purpose: Provides 2D/3D drawing and hit testing functionality
+// for the Column and RangeColumn charts.
+//
+// Reviewed: AG - Aug 8, 2002
+// AG - Microsoft 6, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Globalization;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+#else
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.ChartTypes
+#else
+ namespace System.Web.UI.DataVisualization.Charting.ChartTypes
+#endif
+{
+ /// <summary>
+ /// ColumnChart class provides 2D/3D drawing and hit testing
+ /// functionality for the Column and RangeColumn charts. The
+ /// only difference between the RangeColumn and Column chart
+ /// is that 2 Y values are used to position top and bottom
+ /// side of each RangeColumn column.
+ /// </summary>
+ internal class ColumnChart : PointChart
+ {
+ #region Fields
+
+ /// <summary>
+ /// Labels and markers have to be shifted if there
+ /// is more than one series for column chart.
+ /// </summary>
+ private double _shiftedX = 0;
+
+ /// <summary>
+ /// Labels and markers have to be shifted if there
+ /// is more than one series for column chart. This property
+ /// will give a name of the series, which is used, for
+ /// labels and markers. Point chart
+ /// </summary>
+ private string _shiftedSerName = "";
+
+ /// <summary>
+ /// Indicates that two Y values are used to calculate column position
+ /// </summary>
+ protected bool useTwoValues = false;
+
+ /// <summary>
+ /// Indicates that columns from different series are drawn side by side
+ /// </summary>
+ protected bool drawSeriesSideBySide = true;
+
+ /// <summary>
+ /// Coordinates of COP used when sorting 3D points order
+ /// </summary>
+ protected COPCoordinates coordinates = COPCoordinates.X;
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ override public string Name { get{ return ChartTypeNames.Column;}}
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ override public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+
+ /// <summary>
+ /// True if chart type is stacked
+ /// </summary>
+ override public bool Stacked { get{ return false;}}
+
+ /// <summary>
+ /// True if chart type supports axeses
+ /// </summary>
+ override public bool RequireAxes { get{ return true;} }
+
+ /// <summary>
+ /// True if chart type supports logarithmic axes
+ /// </summary>
+ override public bool SupportLogarithmicAxes { get{ return true;} }
+
+ /// <summary>
+ /// True if chart type requires to switch the value (Y) axes position
+ /// </summary>
+ override public bool SwitchValueAxes { get{ return false;} }
+
+ /// <summary>
+ /// True if chart series can be placed side-by-side.
+ /// </summary>
+ override public bool SideBySideSeries { get{ return true;} }
+
+ /// <summary>
+ /// True if each data point of a chart must be represented in the legend
+ /// </summary>
+ override public bool DataPointsInLegend { get{ return false;} }
+
+ /// <summary>
+ /// Indicates that extra Y values are connected to the scale of the Y axis
+ /// </summary>
+ override public bool ExtraYValuesConnectedToYAxis{ get { return false; } }
+
+ /// <summary>
+ /// True if palette colors should be applied for each data paoint.
+ /// Otherwise the color is applied to the series.
+ /// </summary>
+ override public bool ApplyPaletteColorsToPoints { get { return false; } }
+
+ /// <summary>
+ /// How to draw series/points in legend:
+ /// Filled rectangle, Line or Marker
+ /// </summary>
+ /// <param name="series">Legend item series.</param>
+ /// <returns>Legend item style.</returns>
+ override public LegendImageStyle GetLegendImageStyle(Series series)
+ {
+ return LegendImageStyle.Rectangle;
+ }
+
+ /// <summary>
+ /// Number of supported Y value(s) per point
+ /// </summary>
+ override public int YValuesPerPoint{ get { return 1; } }
+
+ /// <summary>
+ /// If the crossing value is auto Crossing value should be
+ /// automatically set to zero for some chart
+ /// types (Bar, column, area etc.)
+ /// </summary>
+ override public bool ZeroCrossing { get{ return true;} }
+
+ #endregion
+
+ #region Constructor
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public ColumnChart() : base(false)
+ {
+ }
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Labels and markers have to be shifted if there
+ /// is more than one series for column chart.
+ /// </summary>
+ override public double ShiftedX
+ {
+ get
+ {
+ return _shiftedX;
+ }
+ set
+ {
+ _shiftedX = value;
+ }
+ }
+
+ /// <summary>
+ /// Labels and markers have to be shifted if there
+ /// is more than one series for column chart. This property
+ /// will give a name of the series, which is used, for
+ /// labels and markers.
+ /// </summary>
+ override public string ShiftedSerName
+ {
+ get
+ {
+ return _shiftedSerName;
+ }
+ set
+ {
+ _shiftedSerName = value;
+ }
+ }
+
+ #endregion
+
+ #region Painting and selection methods
+
+ /// <summary>
+ /// Paint Column Chart.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ override public void Paint(
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ Series seriesToDraw
+ )
+ {
+ this.Common = common;
+ // Draw columns
+ ProcessChartType( false, false, graph, common, area, seriesToDraw );
+
+ // Draw labels and markers
+ ProcessChartType( true, false, graph, common, area, seriesToDraw );
+ }
+
+ /// <summary>
+ /// This method recalculates size of the columns and paint them or do the hit test.
+ /// This method is used from Paint or Select method.
+ /// </summary>
+ /// <param name="labels">Mode which draws only labels and markers.</param>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ private void ProcessChartType(
+ bool labels,
+ bool selection,
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ Series seriesToDraw )
+ {
+ // Prosess 3D chart type
+ if(area.Area3DStyle.Enable3D)
+ {
+ ProcessChartType3D( labels, selection, graph, common, area, seriesToDraw );
+ return;
+ }
+
+ // Get pixel size
+ SizeF pixelRelSize = graph.GetRelativeSize(new SizeF(1.1f, 1.1f));
+
+ // All data series from chart area which have Column chart type
+ List<string> typeSeries = area.GetSeriesFromChartType(Name);
+
+ // Check if series should be drawn side by side
+ bool currentDrawSeriesSideBySide = this.drawSeriesSideBySide;
+ foreach(string seriesName in typeSeries)
+ {
+ if(common.DataManager.Series[seriesName].IsCustomPropertySet(CustomPropertyName.DrawSideBySide))
+ {
+ string attribValue = common.DataManager.Series[seriesName][CustomPropertyName.DrawSideBySide];
+ if(String.Compare( attribValue, "False", StringComparison.OrdinalIgnoreCase) == 0 )
+ {
+ currentDrawSeriesSideBySide = false;
+ }
+ else if(String.Compare( attribValue, "True", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ currentDrawSeriesSideBySide = true;
+ }
+ else if(String.Compare( attribValue, "Auto", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ // Do nothing
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionAttributeDrawSideBySideInvalid));
+ }
+ }
+ }
+
+ // Find the number of "Column chart" data series
+ double numOfSeries = typeSeries.Count;
+ if(!currentDrawSeriesSideBySide)
+ {
+ numOfSeries = 1;
+ }
+
+ // Check if column chart series are indexed
+ bool indexedSeries = ChartHelper.IndexedSeries(this.Common, area.GetSeriesFromChartType(Name).ToArray());
+
+ //************************************************************
+ //** Loop through all series
+ //************************************************************
+ int seriesIndx = 0;
+ foreach( Series ser in common.DataManager.Series )
+ {
+ // Process non empty series of the area with Column chart type
+ if( String.Compare( ser.ChartTypeName, Name, true, System.Globalization.CultureInfo.CurrentCulture) != 0
+ || ser.ChartArea != area.Name || ser.Points.Count == 0 || !ser.IsVisible())
+ {
+ continue;
+ }
+
+ // Set shifted series name property
+ ShiftedSerName = ser.Name;
+
+ // Set active vertical/horizontal axis
+ Axis vAxis = area.GetAxis(AxisName.Y, ser.YAxisType, ser.YSubAxisName);
+ Axis hAxis = area.GetAxis(AxisName.X, ser.XAxisType, ser.XSubAxisName);
+ double horizontalViewMax = hAxis.ViewMaximum;
+ double horizontalViewMin = hAxis.ViewMinimum;
+ double verticalViewMax = vAxis.ViewMaximum;
+ double verticalViewMin = vAxis.ViewMinimum;
+ double verticalAxisCrossing = vAxis.GetPosition(vAxis.Crossing);
+
+ // Get points interval:
+ // - set interval to 1 for indexed series
+ // - if points are not equaly spaced, the minimum interval between points is selected.
+ // - if points have same interval bars do not overlap each other.
+ bool sameInterval = false;
+ double interval = 1;
+ if(!indexedSeries)
+ {
+ if (ser.Points.Count == 1 &&
+ (ser.XValueType == ChartValueType.Date ||
+ ser.XValueType == ChartValueType.DateTime ||
+ ser.XValueType == ChartValueType.Time ||
+ ser.XValueType == ChartValueType.DateTimeOffset))
+ {
+ // Check if interval is the same
+ area.GetPointsInterval(typeSeries, hAxis.IsLogarithmic, hAxis.logarithmBase, true, out sameInterval);
+
+ // Special case when there is only one data point and date scale is used.
+ if (!double.IsNaN(hAxis.majorGrid.GetInterval()) && hAxis.majorGrid.GetIntervalType() != DateTimeIntervalType.NotSet)
+ {
+ interval = ChartHelper.GetIntervalSize(hAxis.minimum, hAxis.majorGrid.GetInterval(), hAxis.majorGrid.GetIntervalType());
+ }
+ else
+ {
+ interval = ChartHelper.GetIntervalSize(hAxis.minimum, hAxis.Interval, hAxis.IntervalType);
+ }
+ }
+ else
+ {
+ interval = area.GetPointsInterval( typeSeries, hAxis.IsLogarithmic, hAxis.logarithmBase, true, out sameInterval );
+ }
+ }
+
+ // Get column width
+ double width = ser.GetPointWidth(graph, hAxis, interval, 0.8) / numOfSeries;
+
+ // Call Back Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPrePaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+
+ //************************************************************
+ //** Loop through all points in series
+ //************************************************************
+ int index = 0;
+ foreach( DataPoint point in ser.Points )
+ {
+ // Change Y value if Column is out of plot area
+ double yValue = vAxis.GetLogValue( GetYValue(common, area, ser, point, index, (useTwoValues) ? 1 : 0) );
+
+ if( yValue > verticalViewMax )
+ {
+ yValue = verticalViewMax;
+ }
+ if( yValue < verticalViewMin )
+ {
+ yValue = verticalViewMin;
+ }
+
+ // Recalculates Height position and zero position of Columns
+ double height = vAxis.GetLinearPosition( yValue );
+
+ // Set start position for a column
+ double columnStartPosition = 0;
+ if(useTwoValues)
+ {
+ // Point Y value (first) is used to determine the column starting position
+ double yValueStart = vAxis.GetLogValue( GetYValue(common, area, ser, point, index, 0 ) );
+ if( yValueStart > verticalViewMax )
+ {
+ yValueStart = verticalViewMax;
+ }
+ else if( yValueStart < verticalViewMin )
+ {
+ yValueStart = verticalViewMin;
+ }
+
+ columnStartPosition = vAxis.GetLinearPosition(yValueStart);
+ }
+ else
+ {
+ // Column starts on the horizontal axis crossing
+ columnStartPosition = verticalAxisCrossing;
+ }
+
+ // Increase point index
+ index++;
+
+ // Set x position
+ double xCenterVal;
+ double xPosition;
+ if( indexedSeries )
+ {
+ // The formula for position is based on a distance
+ //from the grid line or nPoints position.
+ xPosition = hAxis.GetPosition( (double)index ) - width * ((double) numOfSeries) / 2.0 + width/2 + seriesIndx * width;
+ xCenterVal = hAxis.GetPosition( (double)index );
+ }
+ else if( sameInterval )
+ {
+ xPosition = hAxis.GetPosition( point.XValue ) - width * ((double) numOfSeries) / 2.0 + width/2 + seriesIndx * width;
+ xCenterVal = hAxis.GetPosition( point.XValue );
+ }
+ else
+ {
+ xPosition = hAxis.GetPosition( point.XValue );
+ xCenterVal = hAxis.GetPosition( point.XValue );
+ }
+
+ // Labels and markers have to be shifted if there
+ // is more than one series for column chart.
+ ShiftedX = xPosition - xCenterVal;
+
+
+ // Make sure that points with small values are still visible
+ if( height < columnStartPosition &&
+ (columnStartPosition - height) < pixelRelSize.Height)
+ {
+ height = columnStartPosition - pixelRelSize.Height;
+ }
+ if( height > columnStartPosition &&
+ (height - columnStartPosition) < pixelRelSize.Height)
+ {
+ height = columnStartPosition + pixelRelSize.Height;
+ }
+
+ // Get column rectangle
+ RectangleF rectSize = RectangleF.Empty;
+ try
+ {
+ // Set the Column rectangle
+ rectSize.X = (float)(xPosition - width/2);
+ rectSize.Width = (float)(width);
+
+
+ // The top side of rectangle has always
+ // smaller value than a bottom value
+ if( columnStartPosition < height )
+ {
+ rectSize.Y = (float)columnStartPosition;
+ rectSize.Height = (float)height - rectSize.Y;
+ }
+ else
+ {
+ rectSize.Y = (float)height;
+ rectSize.Height = (float)columnStartPosition - rectSize.Y;
+ }
+
+ }
+ catch(OverflowException)
+ {
+ continue;
+ }
+
+ // if data point is not empty
+ if( point.IsEmpty )
+ {
+ continue;
+ }
+
+ //************************************************************
+ // Painting mode
+ //************************************************************
+ if( common.ProcessModePaint )
+ {
+ if( !labels )
+ {
+ // Check if column is completly out of the data scaleView
+ double xValue = (indexedSeries) ? index : point.XValue;
+ xValue = hAxis.GetLogValue(xValue);
+ if(xValue < horizontalViewMin || xValue > horizontalViewMax )
+ {
+ continue;
+ }
+
+ // Check if column is partialy in the data scaleView
+ bool clipRegionSet = false;
+ if(rectSize.X < area.PlotAreaPosition.X || rectSize.Right > area.PlotAreaPosition.Right)
+ {
+ // Set clipping region for line drawing
+ graph.SetClip( area.PlotAreaPosition.ToRectangleF() );
+ clipRegionSet = true;
+ }
+
+ // Start Svg Selection mode
+ graph.StartHotRegion( point );
+
+ // Draw the Column rectangle
+ DrawColumn2D(graph, vAxis, rectSize, point, ser);
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+
+ // Reset Clip Region
+ if(clipRegionSet)
+ {
+ graph.ResetClip();
+ }
+ }
+ else if(this.useTwoValues)
+ {
+ // Draw labels and markers
+ DrawLabel(
+ area,
+ graph,
+ common,
+ rectSize,
+ point,
+ ser,
+ index);
+ }
+ }
+
+ //************************************************************
+ // Hot Regions mode used for image maps, tool tips and
+ // hit test function
+ //************************************************************
+ if( common.ProcessModeRegions && !labels)
+ {
+ common.HotRegionsList.AddHotRegion( rectSize, point, ser.Name, index - 1 );
+ }
+ }
+
+ // Call Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPostPaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+
+ // Data series index
+ if(currentDrawSeriesSideBySide)
+ {
+ seriesIndx++;
+ }
+
+ // Draw labels and markers using the base class algorithm
+ if( labels && !this.useTwoValues)
+ {
+ base.ProcessChartType( false, graph, common, area, seriesToDraw );
+ }
+ }
+ }
+
+ /// <summary>
+ /// Draws 2D column.
+ /// </summary>
+ /// <param name="graph">Chart graphics.</param>
+ /// <param name="vAxis">Vertical axis.</param>
+ /// <param name="rectSize">Column position and size.</param>
+ /// <param name="point">Column data point.</param>
+ /// <param name="ser">Column series.</param>
+ protected virtual void DrawColumn2D(
+ ChartGraphics graph,
+ Axis vAxis,
+ RectangleF rectSize,
+ DataPoint point,
+ Series ser)
+ {
+ graph.FillRectangleRel(
+ rectSize,
+ point.Color,
+ point.BackHatchStyle,
+ point.BackImage,
+ point.BackImageWrapMode,
+ point.BackImageTransparentColor,
+ point.BackImageAlignment,
+ point.BackGradientStyle,
+ point.BackSecondaryColor,
+ point.BorderColor,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ ser.ShadowColor,
+ ser.ShadowOffset,
+ PenAlignment.Inset,
+ ChartGraphics.GetBarDrawingStyle(point),
+ true);
+ }
+
+ /// <summary>
+ /// Gets label position for the column depending on the Y value.
+ /// </summary>
+ /// <returns>Return automaticly detected label position.</returns>
+ /// <param name="series">Data series.</param>
+ /// <param name="pointIndex">Point index.</param>
+ /// <returns>Label aligning.</returns>
+ override protected LabelAlignmentStyles GetAutoLabelPosition(Series series, int pointIndex)
+ {
+ if( series.Points[pointIndex].YValues[0] >= 0 )
+ return LabelAlignmentStyles.Top;
+ else
+ return LabelAlignmentStyles.Bottom;
+ }
+
+ /// <summary>
+ /// Indicates that markers are drawnd on the X edge of the data scaleView.
+ /// </summary>
+ /// <returns>False. Column chart never draws markers on the edge.</returns>
+ override protected bool ShouldDrawMarkerOnViewEdgeX()
+ {
+ return false;
+ }
+
+ #endregion
+
+ #region 3D painting and selection methods
+
+ /// <summary>
+ /// This method recalculates size of the columns and paint them or do the hit test in 3d space.
+ /// This method is used from Paint or Select method.
+ /// </summary>
+ /// <param name="labels">Mode which draws only labels and markers.</param>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ private void ProcessChartType3D( bool labels, bool selection, ChartGraphics graph, CommonElements common, ChartArea area, Series seriesToDraw )
+ {
+ // Labels & markers are drawn with the data points in the first iteration
+ if(labels && !selection)
+ {
+ return;
+ }
+
+ // Get pixel size
+ SizeF pixelRelSize = graph.GetRelativeSize(new SizeF(1.1f, 1.1f));
+
+ // Get list of series to draw
+ List<string> typeSeries = null;
+ bool currentDrawSeriesSideBySide = this.drawSeriesSideBySide;
+ if( (area.Area3DStyle.IsClustered && this.SideBySideSeries) ||
+ this.Stacked)
+ {
+ // Draw all series of the same chart type
+ typeSeries = area.GetSeriesFromChartType(Name);
+
+ // Check if series should be drawn side by side
+ foreach(string seriesName in typeSeries)
+ {
+ if(common.DataManager.Series[seriesName].IsCustomPropertySet(CustomPropertyName.DrawSideBySide))
+ {
+ string attribValue = common.DataManager.Series[seriesName][CustomPropertyName.DrawSideBySide];
+ if(String.Compare( attribValue, "False", StringComparison.OrdinalIgnoreCase)==0)
+ {
+ currentDrawSeriesSideBySide = false;
+ }
+ else if(String.Compare( attribValue, "True", StringComparison.OrdinalIgnoreCase)==0)
+ {
+ currentDrawSeriesSideBySide = true;
+ }
+ else if(String.Compare( attribValue, "Auto", StringComparison.OrdinalIgnoreCase)==0)
+ {
+ // Do nothing
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionAttributeDrawSideBySideInvalid));
+ }
+ }
+ }
+ }
+ else
+ {
+ // Draw just one chart series
+ typeSeries = new List<string>();
+ typeSeries.Add(seriesToDraw.Name);
+ }
+
+ //************************************************************
+ //** Get order of data points drawing
+ //************************************************************
+ ArrayList dataPointDrawingOrder = area.GetDataPointDrawingOrder(typeSeries, this, selection, coordinates, null, this.YValueIndex, currentDrawSeriesSideBySide);
+
+ //************************************************************
+ //** Loop through all data poins
+ //************************************************************
+ foreach(object obj in dataPointDrawingOrder)
+ {
+ // Get point & series
+ DataPoint3D pointEx = (DataPoint3D) obj;
+ DataPoint point = pointEx.dataPoint;
+ Series ser = point.series;
+
+ // Get point bar drawing style
+ BarDrawingStyle barDrawingStyle = ChartGraphics.GetBarDrawingStyle(point);
+
+ // Set active vertical/horizontal axis
+ Axis vAxis = area.GetAxis(AxisName.Y, ser.YAxisType, ser.YSubAxisName);
+ Axis hAxis = area.GetAxis(AxisName.X, ser.XAxisType, ser.XSubAxisName);
+
+ // Change Y value if Column is out of plot area
+ float topDarkening = 0f;
+ float bottomDarkening = 0f;
+ double yValue = GetYValue(common, area, ser, pointEx.dataPoint, pointEx.index - 1, (useTwoValues) ? 1 : 0);
+ yValue = vAxis.GetLogValue(yValue);
+ if( yValue > vAxis.ViewMaximum )
+ {
+ topDarkening = 0.5f;
+ yValue = vAxis.ViewMaximum;
+ }
+ if( yValue < vAxis.ViewMinimum )
+ {
+ topDarkening = 0.5f;
+ yValue = vAxis.ViewMinimum;
+ }
+
+ // Recalculates Height position and zero position of Columns
+ double height = vAxis.GetLinearPosition( yValue );
+
+ // Set start position for a column
+ double columnStartPosition = 0;
+ if(useTwoValues)
+ {
+ // Point Y value (first) is used to determine the column starting position
+ double yValueStart = vAxis.GetLogValue( GetYValue(common, area, ser, point, pointEx.index - 1, 0 ) );
+ if( yValueStart > vAxis.ViewMaximum )
+ {
+ bottomDarkening = 0.5f;
+ yValueStart = vAxis.ViewMaximum;
+ }
+ else if( yValueStart < vAxis.ViewMinimum )
+ {
+ bottomDarkening = 0.5f;
+ yValueStart = vAxis.ViewMinimum;
+ }
+
+ columnStartPosition = vAxis.GetLinearPosition(yValueStart);
+ }
+ else
+ {
+ // Column starts on the horizontal axis crossing
+ columnStartPosition = vAxis.GetPosition(vAxis.Crossing);
+ }
+
+ // Labels and markers have to be shifted if there
+ // is more than one series for column chart.
+ if(!currentDrawSeriesSideBySide)
+ {
+ pointEx.xPosition = pointEx.xCenterVal;
+ }
+ ShiftedX = pointEx.xPosition - pointEx.xCenterVal;
+
+ // Make sure that points with small values are still visible
+ if( height < columnStartPosition &&
+ (columnStartPosition - height) < pixelRelSize.Height)
+ {
+ height = columnStartPosition - pixelRelSize.Height;
+ }
+ if( height > columnStartPosition &&
+ (height - columnStartPosition) < pixelRelSize.Height)
+ {
+ height = columnStartPosition + pixelRelSize.Height;
+ }
+
+ // Get column rectangle
+ RectangleF rectSize = RectangleF.Empty;
+ try
+ {
+ // Set the Column rectangle
+ rectSize.X = (float)(pointEx.xPosition - pointEx.width/2);
+ rectSize.Width = (float)(pointEx.width);
+
+ // The top side of rectangle has always
+ // smaller value than a bottom value
+ if( columnStartPosition < height )
+ {
+ float temp = bottomDarkening;
+ bottomDarkening = topDarkening;
+ topDarkening = temp;
+
+ rectSize.Y = (float)columnStartPosition;
+ rectSize.Height = (float)height - rectSize.Y;
+ }
+ else
+ {
+ rectSize.Y = (float)height;
+ rectSize.Height = (float)columnStartPosition - rectSize.Y;
+ }
+ }
+ catch(OverflowException)
+ {
+ continue;
+ }
+
+ //************************************************************
+ //** Painting mode
+ //************************************************************
+ // Path projection of 3D rect.
+ GraphicsPath rectPath = null;
+
+ // Check if column is completly out of the data scaleView
+ double xValue = (pointEx.indexedSeries) ? pointEx.index : point.XValue;
+ xValue = hAxis.GetLogValue(xValue);
+ if(xValue < hAxis.ViewMinimum || xValue > hAxis.ViewMaximum )
+ {
+ continue;
+ }
+
+ // Check if column is partialy in the data scaleView
+ bool clipRegionSet = false;
+ if(rectSize.Right <= area.PlotAreaPosition.X || rectSize.X >= area.PlotAreaPosition.Right)
+ {
+ continue;
+ }
+
+ if(rectSize.X < area.PlotAreaPosition.X)
+ {
+ rectSize.Width -= area.PlotAreaPosition.X - rectSize.X;
+ rectSize.X = area.PlotAreaPosition.X;
+ }
+ if(rectSize.Right > area.PlotAreaPosition.Right)
+ {
+ rectSize.Width -= rectSize.Right - area.PlotAreaPosition.Right;
+ }
+ if(rectSize.Width < 0)
+ {
+ rectSize.Width = 0;
+ }
+
+ // Detect if we need to get graphical path of drawn object
+ DrawingOperationTypes drawingOperationType = DrawingOperationTypes.DrawElement;
+
+ if( common.ProcessModeRegions )
+ {
+ drawingOperationType |= DrawingOperationTypes.CalcElementPath;
+ }
+
+ if(!point.IsEmpty &&
+ rectSize.Height > 0f &&
+ rectSize.Width > 0f)
+ {
+ // Start Svg Selection mode
+ graph.StartHotRegion( point );
+
+ rectPath = graph.Fill3DRectangle(
+ rectSize,
+ pointEx.zPosition,
+ pointEx.depth,
+ area.matrix3D,
+ area.Area3DStyle.LightStyle,
+ point.Color,
+ topDarkening,
+ bottomDarkening,
+ point.BorderColor,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ barDrawingStyle,
+ true,
+ drawingOperationType);
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+
+ //************************************************************
+ // Hot Regions mode used for image maps, tool tips and
+ // hit test function
+ //************************************************************
+ if( common.ProcessModeRegions && !labels)
+ {
+ common.HotRegionsList.AddHotRegion(
+ rectPath,
+ false,
+ graph,
+ point,
+ ser.Name,
+ pointEx.index - 1
+ );
+ }
+ if (rectPath != null)
+ {
+ rectPath.Dispose();
+ }
+ }
+
+ // Reset Clip Region
+ if(clipRegionSet)
+ {
+ graph.ResetClip();
+ }
+
+ // Draw Labels & markers for each data point
+ this.ProcessSinglePoint3D(
+ pointEx,
+ selection,
+ graph,
+ common,
+ area,
+ rectSize,
+ pointEx.index - 1
+ );
+ }
+
+ // Finish processing 3D labels
+ this.DrawAccumulated3DLabels(graph, common, area);
+ }
+
+ #endregion
+
+ #region 2D and 3D Labels Drawing
+
+ /// <summary>
+ /// This method draws label.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object</param>
+ /// <param name="common">The Common elements object</param>
+ /// <param name="area">Chart area for this chart</param>
+ /// <param name="columnPosition">Column position</param>
+ /// <param name="point">Data point</param>
+ /// <param name="ser">Data series</param>
+ /// <param name="pointIndex">Data point index.</param>
+ protected virtual void DrawLabel(
+ ChartArea area,
+ ChartGraphics graph,
+ CommonElements common,
+ RectangleF columnPosition,
+ DataPoint point,
+ Series ser,
+ int pointIndex)
+ {
+ // Labels drawing functionality is inhereted from the PointChart class.
+ }
+
+ /// <summary>
+ /// Draws\Hit tests single 3D point.
+ /// </summary>
+ /// <param name="pointEx">3D point information.</param>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="columnPosition">Column position</param>
+ /// <param name="pointIndex">Point index.</param>
+ protected virtual void ProcessSinglePoint3D(
+ DataPoint3D pointEx,
+ bool selection,
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ RectangleF columnPosition,
+ int pointIndex
+ )
+ {
+ // Draw Labels & markers for each data point
+ base.ProcessSinglePoint3D(
+ pointEx,
+ graph,
+ common,
+ area
+ );
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// ColumnChart class contains all the code necessary to draw
+ /// both Column and RangeColumn charts. The RangeColumnChart class
+ /// is used to override few default settings, so that 2 Y values
+ /// will be used to define top and bottom position of each column.
+ /// </summary>
+ internal class RangeColumnChart : ColumnChart
+ {
+ #region Constructor
+
+ /// <summary>
+ /// Public constructor
+ /// </summary>
+ public RangeColumnChart()
+ {
+ // Set the flag to use two Y values, while drawing the columns
+ this.useTwoValues = true;
+
+ // Coordinates of COP used when sorting 3D points order
+ this.coordinates = COPCoordinates.X | COPCoordinates.Y;
+
+ // Index of the main Y value
+ this.YValueIndex = 1;
+ }
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ override public string Name { get{ return ChartTypeNames.RangeColumn;}}
+
+ /// <summary>
+ /// If the crossing value is auto Crossing value should be
+ /// automatically set to zero for some chart
+ /// types (Bar, column, area etc.)
+ /// </summary>
+ override public bool ZeroCrossing { get{ return true;} }
+
+ /// <summary>
+ /// Number of supported Y value(s) per point
+ /// </summary>
+ override public int YValuesPerPoint{ get { return 2; } }
+
+ /// <summary>
+ /// Indicates that extra Y values are connected to the scale of the Y axis
+ /// </summary>
+ override public bool ExtraYValuesConnectedToYAxis{ get { return true; } }
+
+ #endregion
+
+ #region Y values related methods
+
+ /// <summary>
+ /// Helper function, which returns the Y value of the point.
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="area">Chart area the series belongs to.</param>
+ /// <param name="series">Sereis of the point.</param>
+ /// <param name="point">Point object.</param>
+ /// <param name="pointIndex">Index of the point.</param>
+ /// <param name="yValueIndex">Index of the Y value to get.</param>
+ /// <returns>Y value of the point.</returns>
+ override public double GetYValue(
+ CommonElements common,
+ ChartArea area,
+ Series series,
+ DataPoint point,
+ int pointIndex,
+ int yValueIndex)
+ {
+ // Calculate column height
+ if(yValueIndex == -1)
+ {
+ return -(base.GetYValue(common, area, series, point, pointIndex, 1) -
+ base.GetYValue(common, area, series, point, pointIndex, 0));
+ }
+
+ return base.GetYValue(common, area, series, point, pointIndex, yValueIndex);
+ }
+
+ #endregion
+
+ #region 2D and 3D Labels Drawing
+
+ /// <summary>
+ /// This method draws label.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object</param>
+ /// <param name="common">The Common elements object</param>
+ /// <param name="area">Chart area for this chart</param>
+ /// <param name="columnPosition">Column position</param>
+ /// <param name="point">Data point</param>
+ /// <param name="series">Data series</param>
+ /// <param name="pointIndex">Data point index.</param>
+ protected override void DrawLabel(
+ ChartArea area,
+ ChartGraphics graph,
+ CommonElements common,
+ RectangleF columnPosition,
+ DataPoint point,
+ Series series,
+ int pointIndex)
+ {
+ //************************************************************
+ //** Get marker position and size
+ //************************************************************
+
+ // Get intersection between column rectangle and plotting area rectangle
+ RectangleF intersection = RectangleF.Intersect(
+ columnPosition, area.PlotAreaPosition.ToRectangleF() );
+
+ // If intersection is empty no drawing required
+ if(intersection.Height <= 0f || intersection.Width <= 0f)
+ {
+ return;
+ }
+
+ // Get marker position
+ PointF markerPosition = PointF.Empty;
+ markerPosition.X = intersection.X + intersection.Width / 2f;
+ markerPosition.Y = intersection.Y;
+
+ // Remeber pre-calculated point position
+ point.positionRel = new PointF(markerPosition.X, markerPosition.Y);
+
+ // Get point some point properties and save them in variables
+ int pointMarkerSize = point.MarkerSize;
+ string pointMarkerImage = point.MarkerImage;
+ MarkerStyle pointMarkerStyle = point.MarkerStyle;
+
+ // Get marker size
+ SizeF markerSize = base.GetMarkerSize(
+ graph,
+ common,
+ area,
+ point,
+ pointMarkerSize,
+ pointMarkerImage);
+
+ //************************************************************
+ //** Draw point chart
+ //************************************************************
+ if(pointMarkerStyle != MarkerStyle.None ||
+ pointMarkerImage.Length > 0)
+ {
+ // Start Svg Selection mode
+ graph.StartHotRegion( point );
+
+ // Draw the marker
+ graph.DrawMarkerRel(markerPosition,
+ (pointMarkerStyle == MarkerStyle.None) ? MarkerStyle.Circle : pointMarkerStyle,
+ (int)markerSize.Height,
+ (point.MarkerColor == Color.Empty) ? point.Color : point.MarkerColor,
+ (point.MarkerBorderColor == Color.Empty) ? point.BorderColor : point.MarkerBorderColor,
+ GetMarkerBorderSize(point),
+ pointMarkerImage,
+ point.MarkerImageTransparentColor,
+ (point.series != null) ? point.series.ShadowOffset : 0,
+ (point.series != null) ? point.series.ShadowColor : Color.Empty,
+ new RectangleF(markerPosition.X, markerPosition.Y, markerSize.Width, markerSize.Height));
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+
+ //************************************************************
+ // Hot Regions mode used for image maps, tool tips and
+ // hit test function
+ //************************************************************
+ if( common.ProcessModeRegions )
+ {
+ // Get relative marker size
+ SizeF relativeMarkerSize = graph.GetRelativeSize(markerSize);
+
+ // Insert area just after the last custom area
+ int insertIndex = common.HotRegionsList.FindInsertIndex();
+
+ // Insert circle area
+ if(pointMarkerStyle == MarkerStyle.Circle)
+ {
+ float[] circCoord = new float[3];
+ circCoord[0] = markerPosition.X;
+ circCoord[1] = markerPosition.Y;
+ circCoord[2] = relativeMarkerSize.Width/2f;
+
+ common.HotRegionsList.AddHotRegion(
+ insertIndex,
+ graph,
+ circCoord[0],
+ circCoord[1],
+ circCoord[2],
+ point,
+ series.Name,
+ pointIndex - 1 );
+ }
+ // All other markers represented as rectangles
+ else
+ {
+ common.HotRegionsList.AddHotRegion(
+ new RectangleF(markerPosition.X - relativeMarkerSize.Width/2f, markerPosition.Y - relativeMarkerSize.Height/2f, relativeMarkerSize.Width, relativeMarkerSize.Height),
+ point,
+ series.Name,
+ pointIndex - 1 );
+ }
+ }
+ }
+
+
+ //************************************************************
+ //** Draw LabelStyle
+ //************************************************************
+
+ // Label text format
+ using (StringFormat format = new StringFormat())
+ {
+ format.Alignment = StringAlignment.Center;
+ format.LineAlignment = StringAlignment.Center;
+
+ // Disable the clip region
+ Region oldClipRegion = graph.Clip;
+ graph.Clip = new Region();
+
+ if (point.IsValueShownAsLabel || point.Label.Length > 0)
+ {
+ // Get label text
+ string text;
+ if (point.Label.Length == 0)
+ {
+ // Round Y values for 100% stacked area
+ double pointLabelValue = GetYValue(common, area, series, point, pointIndex, 0);
+
+ text = ValueConverter.FormatValue(
+ series.Chart,
+ point,
+ point.Tag,
+ pointLabelValue,
+ point.LabelFormat,
+ series.YValueType,
+ ChartElementType.DataPoint);
+ }
+ else
+ {
+ text = point.ReplaceKeywords(point.Label);
+ }
+
+ // Calculate label position
+ PointF labelPosition = PointF.Empty;
+ labelPosition.X = intersection.X + intersection.Width / 2f;
+ labelPosition.Y = intersection.Y + intersection.Height / 2f;
+
+ // Start Svg Selection mode
+ graph.StartHotRegion(point, true);
+
+ // Get string size
+ SizeF sizeFont = graph.GetRelativeSize(graph.MeasureString(text, point.Font, new SizeF(1000f, 1000f), StringFormat.GenericTypographic));
+
+ // Get label background position
+ RectangleF labelBackPosition = RectangleF.Empty;
+ SizeF sizeLabel = new SizeF(sizeFont.Width, sizeFont.Height);
+ sizeLabel.Width += sizeLabel.Width / text.Length;
+ sizeLabel.Height += sizeFont.Height / 8;
+ labelBackPosition = GetLabelPosition(
+ graph,
+ labelPosition,
+ sizeLabel,
+ format,
+ true);
+
+ // Draw label text
+ using (Brush brush = new SolidBrush(point.LabelForeColor))
+ {
+ graph.DrawPointLabelStringRel(
+ common,
+ text,
+ point.Font,
+ brush,
+ labelPosition,
+ format,
+ point.LabelAngle,
+ labelBackPosition,
+ point.LabelBackColor,
+ point.LabelBorderColor,
+ point.LabelBorderWidth,
+ point.LabelBorderDashStyle,
+ series,
+ point,
+ pointIndex - 1);
+ }
+
+ // End Svg Selection mode
+ graph.EndHotRegion();
+ }
+
+ // Restore old clip region
+ graph.Clip = oldClipRegion;
+ }
+ }
+
+ /// <summary>
+ /// Draws\Hit tests single 3D point.
+ /// </summary>
+ /// <param name="pointEx">3D point information.</param>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="columnPosition">Column position</param>
+ /// <param name="pointIndex">Point index.</param>
+ protected override void ProcessSinglePoint3D(
+ DataPoint3D pointEx,
+ bool selection,
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ RectangleF columnPosition,
+ int pointIndex
+ )
+ {
+ DataPoint point = pointEx.dataPoint;
+
+ // Check required Y values number
+ if(point.YValues.Length < this.YValuesPerPoint)
+ {
+ throw(new InvalidOperationException(SR.ExceptionChartTypeRequiresYValues(this.Name,this.YValuesPerPoint.ToString(CultureInfo.InvariantCulture))));
+ }
+
+ // Label text format
+ using (StringFormat format = new StringFormat())
+ {
+ format.Alignment = StringAlignment.Center;
+ format.LineAlignment = StringAlignment.Center;
+
+ // Disable the clip region
+ Region oldClipRegion = graph.Clip;
+ graph.Clip = new Region();
+
+ if (point.IsValueShownAsLabel || point.Label.Length > 0)
+ {
+ // Get label text
+ string text;
+ if (point.Label.Length == 0)
+ {
+ // Get Y value
+ double pointLabelValue = GetYValue(common, area, pointEx.dataPoint.series, point, pointEx.index - 1, 0);
+ text = ValueConverter.FormatValue(
+ pointEx.dataPoint.series.Chart,
+ point,
+ point.Tag,
+ pointLabelValue,
+ point.LabelFormat,
+ pointEx.dataPoint.series.YValueType,
+ ChartElementType.DataPoint);
+ }
+ else
+ {
+ text = point.ReplaceKeywords(point.Label);
+
+ }
+
+ // Calculate label position
+ PointF labelPosition = PointF.Empty;
+ labelPosition.X = columnPosition.X + columnPosition.Width / 2f;
+ labelPosition.Y = columnPosition.Y + columnPosition.Height / 2f;
+
+ // Transform coordinates
+ Point3D[] marker3DPosition = new Point3D[1];
+ marker3DPosition[0] = new Point3D(labelPosition.X, labelPosition.Y, (float)(pointEx.zPosition + pointEx.depth));
+ area.matrix3D.TransformPoints(marker3DPosition);
+
+ labelPosition.X = marker3DPosition[0].X;
+ labelPosition.Y = marker3DPosition[0].Y;
+
+ // Start Svg Selection mode
+ graph.StartHotRegion(point, true);
+
+ // Get string size
+ SizeF sizeFont = graph.GetRelativeSize(graph.MeasureString(text, point.Font, new SizeF(1000f, 1000f), StringFormat.GenericTypographic));
+
+ // Get label background position
+ RectangleF labelBackPosition = RectangleF.Empty;
+ SizeF sizeLabel = new SizeF(sizeFont.Width, sizeFont.Height);
+ sizeLabel.Width += sizeLabel.Width / text.Length;
+ sizeLabel.Height += sizeFont.Height / 8;
+ labelBackPosition = GetLabelPosition(
+ graph,
+ labelPosition,
+ sizeLabel,
+ format,
+ true);
+
+ // Draw label text
+ using (Brush brush = new SolidBrush(point.LabelForeColor))
+ {
+ graph.DrawPointLabelStringRel(
+ common,
+ text,
+ point.Font,
+ brush,
+ labelPosition,
+ format,
+ point.LabelAngle,
+ labelBackPosition,
+ point.LabelBackColor,
+ point.LabelBorderColor,
+ point.LabelBorderWidth,
+ point.LabelBorderDashStyle,
+ point.series,
+ point,
+ pointIndex);
+ }
+
+ // End Svg Selection mode
+ graph.EndHotRegion();
+ }
+
+ // Restore old clip region
+ graph.Clip = oldClipRegion;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/DoughnutChart.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/DoughnutChart.cs
new file mode 100644
index 00000000000..4e21ee536f2
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/DoughnutChart.cs
@@ -0,0 +1,143 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: DoughnutChart.cs
+//
+// Namespace: System.Web.UI.DataVisualization.Charting.ChartTypes
+//
+// Classes: DoughnutChart
+//
+// Purpose: DoughnutChart class provide only the behaviour
+// information for the Doughnut chart, all the drawing
+// routines are located in the PieChart base class.
+//
+// Reviewed: GS - Aug 8, 2002
+// AG - Aug 8, 2002
+// AG - Microsoft 6, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Drawing;
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.ChartTypes
+#else
+ namespace System.Web.UI.DataVisualization.Charting.ChartTypes
+#endif
+{
+ /// <summary>
+ /// DoughnutChart class provide only the behaviour information for the
+ /// Doughnut chart, all the drawing routines are located in the PieChart
+ /// base class.
+ /// </summary>
+ internal class DoughnutChart : PieChart
+ {
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ override public string Name { get{ return ChartTypeNames.Doughnut;}}
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ override public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+
+ /// <summary>
+ /// True if chart type is stacked
+ /// </summary>
+ override public bool Stacked { get{ return false;}}
+
+ /// <summary>
+ /// True if chart type supports axeses
+ /// </summary>
+ override public bool RequireAxes { get{ return false;} }
+
+ /// <summary>
+ /// True if chart type supports logarithmic axes
+ /// </summary>
+ override public bool SupportLogarithmicAxes { get{ return false;} }
+
+ /// <summary>
+ /// True if chart type requires to switch the value (Y) axes position
+ /// </summary>
+ override public bool SwitchValueAxes { get{ return false;} }
+
+ /// <summary>
+ /// True if chart series can be placed side-by-side.
+ /// </summary>
+ override public bool SideBySideSeries { get{ return false;} }
+
+ /// <summary>
+ /// If the crossing value is auto Crossing value should be
+ /// automatically set to zero for some chart
+ /// types (Bar, column, area etc.)
+ /// </summary>
+ override public bool ZeroCrossing { get{ return false;} }
+
+ /// <summary>
+ /// True if each data point of a chart must be represented in the legend
+ /// </summary>
+ override public bool DataPointsInLegend { get{ return true;} }
+
+ /// <summary>
+ /// Indicates that extra Y values are connected to the scale of the Y axis
+ /// </summary>
+ override public bool ExtraYValuesConnectedToYAxis{ get { return false; } }
+
+ /// <summary>
+ /// True if palette colors should be applied for each data paint.
+ /// Otherwise the color is applied to the series.
+ /// </summary>
+ override public bool ApplyPaletteColorsToPoints { get { return true; } }
+
+ /// <summary>
+ /// How to draw series/points in legend:
+ /// Filled rectangle, Line or Marker
+ /// </summary>
+ /// <param name="series">Legend item series.</param>
+ /// <returns>Legend item style.</returns>
+ override public LegendImageStyle GetLegendImageStyle(Series series)
+ {
+ return LegendImageStyle.Rectangle;
+ }
+
+ /// <summary>
+ /// Number of supported Y value(s) per point
+ /// </summary>
+ override public int YValuesPerPoint{ get { return 1; } }
+
+ /// <summary>
+ /// Chart is Doughnut or Pie type
+ /// </summary>
+ override public bool Doughnut{ get { return true; } }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public DoughnutChart()
+ {
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/ErrorBarChart.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/ErrorBarChart.cs
new file mode 100644
index 00000000000..77f6d6ebce5
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/ErrorBarChart.cs
@@ -0,0 +1,1887 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: ErrorBarChart.cs
+//
+// Namespace: DataVisualization.Charting.ChartTypes
+//
+// Classes: ErrorBarChart
+//
+// Purpose: Provides 2D and 3D drawing and hit testing of the
+// ErrorBar chart.
+//
+// Error Bar Chart Overview:
+// -------------------------
+// Error bar charts consist of lines with markers that are used to
+// display statistical information about the data displayed in a
+// graph. An Error Bar chart type is a series that has 3 Y values.
+// While it is true that these values can be assigned to each point
+// in an Error Bar chart, in most cases, the values will be
+// calculated from the data present in another series.
+//
+// The order of the Y values is important because each position in
+// the array of values represents a value on the Error Bar:
+// 0 - Center or Average point value
+// 1 - Lower Error value
+// 2 - Upper Error value
+//
+// Reviewed: GS - Jul 15, 2003
+// AG - Microsoft 6, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Collections;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.ComponentModel.Design;
+using System.Globalization;
+using System.Collections.Generic;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+#else
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.ChartTypes
+#else
+ namespace System.Web.UI.DataVisualization.Charting.ChartTypes
+#endif
+{
+ #region Enumerations
+
+ /// <summary>
+ /// Defines the way error amount is calculated.
+ /// </summary>
+ internal enum ErrorBarType
+ {
+ /// <summary>
+ /// Error is a fixed value.
+ /// </summary>
+ FixedValue,
+
+ /// <summary>
+ /// Error is percentage of the center value.
+ /// </summary>
+ Percentage,
+
+ /// <summary>
+ /// Error is standard deviation of all center values in series.
+ /// </summary>
+ StandardDeviation,
+
+ /// <summary>
+ /// Error is standard error of all center values in series.
+ /// </summary>
+ StandardError
+ }
+
+ /// <summary>
+ /// Error bars drawing styles.
+ /// </summary>
+ internal enum ErrorBarStyle
+ {
+ /// <summary>
+ /// Draws both lower and upper error bar.
+ /// </summary>
+ Both,
+
+ /// <summary>
+ /// Draws only upper error bar.
+ /// </summary>
+ UpperError,
+
+ /// <summary>
+ /// Draws only lower error bar.
+ /// </summary>
+ LowerError
+ }
+
+ #endregion
+
+ /// <summary>
+ /// ErrorBarChart class provides 2D and 3D drawing and hit testing of
+ /// the ErrorBar chart.
+ /// </summary>
+ internal class ErrorBarChart : IChartType
+ {
+ #region Fields
+
+ /// <summary>
+ /// Vertical axis
+ /// </summary>
+ protected Axis vAxis = null;
+
+ /// <summary>
+ /// Horizontal axis
+ /// </summary>
+ protected Axis hAxis = null;
+
+ #endregion
+
+ #region Constructor
+
+ /// <summary>
+ /// Error bar chart constructor.
+ /// </summary>
+ public ErrorBarChart()
+ {
+ }
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ virtual public string Name { get{ return ChartTypeNames.ErrorBar;}}
+
+ /// <summary>
+ /// True if chart type is stacked
+ /// </summary>
+ virtual public bool Stacked { get{ return false;}}
+
+
+ /// <summary>
+ /// True if stacked chart type supports groups
+ /// </summary>
+ virtual public bool SupportStackedGroups { get { return false; } }
+
+
+ /// <summary>
+ /// True if stacked chart type should draw separately positive and
+ /// negative data points ( Bar and column Stacked types ).
+ /// </summary>
+ public bool StackSign { get{ return false;}}
+
+ /// <summary>
+ /// True if chart type supports axes
+ /// </summary>
+ virtual public bool RequireAxes { get{ return true;} }
+
+ /// <summary>
+ /// Chart type with two y values used for scale ( bubble chart type )
+ /// </summary>
+ public bool SecondYScale{ get{ return false;} }
+
+ /// <summary>
+ /// True if chart type requires circular chart area.
+ /// </summary>
+ public bool CircularChartArea { get{ return false;} }
+
+ /// <summary>
+ /// True if chart type supports logarithmic axes
+ /// </summary>
+ virtual public bool SupportLogarithmicAxes { get{ return true;} }
+
+ /// <summary>
+ /// True if chart type requires to switch the value (Y) axes position
+ /// </summary>
+ virtual public bool SwitchValueAxes { get{ return false;} }
+
+ /// <summary>
+ /// True if chart series can be placed side-by-side.
+ /// </summary>
+ public bool SideBySideSeries { get{ return false;} }
+
+ /// <summary>
+ /// True if each data point of a chart must be represented in the legend
+ /// </summary>
+ virtual public bool DataPointsInLegend { get{ return false;} }
+
+ /// <summary>
+ /// If the crossing value is auto Crossing value ZeroCrossing should be
+ /// automatically set to zero for some chart
+ /// types (Bar, column, area etc.)
+ /// </summary>
+ virtual public bool ZeroCrossing { get{ return false;} }
+
+ /// <summary>
+ /// True if palette colors should be applied for each data paoint.
+ /// Otherwise the color is applied to the series.
+ /// </summary>
+ virtual public bool ApplyPaletteColorsToPoints { get { return false; } }
+
+ /// <summary>
+ /// Indicates that extra Y values are connected to the scale of the Y axis
+ /// </summary>
+ virtual public bool ExtraYValuesConnectedToYAxis{ get { return true; } }
+
+ /// <summary>
+ /// Indicates that this is a one hundred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ virtual public bool HundredPercent{ get{return false;} }
+
+ /// <summary>
+ /// Indicates that this is a one hundred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ virtual public bool HundredPercentSupportNegative{ get{return false;} }
+
+ /// <summary>
+ /// How to draw series/points in legend:
+ /// Filled rectangle, Line or Marker
+ /// </summary>
+ /// <param name="series">Legend item series.</param>
+ /// <returns>Legend item style.</returns>
+ virtual public LegendImageStyle GetLegendImageStyle(Series series)
+ {
+ return LegendImageStyle.Line;
+ }
+
+ /// <summary>
+ /// Number of supported Y value(s) per point
+ /// </summary>
+ virtual public int YValuesPerPoint { get { return 3; } }
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ virtual public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+
+ #endregion
+
+ #region Painting and Selection methods
+
+ /// <summary>
+ /// Paint error bar chart.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ virtual public void Paint( ChartGraphics graph, CommonElements common, ChartArea area, Series seriesToDraw )
+ {
+ ProcessChartType( false, graph, common, area, seriesToDraw );
+ }
+
+ /// <summary>
+ /// This method recalculates size of the bars. This method is used
+ /// from Paint or Select method.
+ /// </summary>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ virtual protected void ProcessChartType(
+ bool selection,
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ Series seriesToDraw )
+ {
+ // Prosess 3D chart type
+ if(area.Area3DStyle.Enable3D)
+ {
+ ProcessChartType3D( selection, graph, common, area, seriesToDraw );
+ return;
+ }
+
+ // All data series from chart area which have Error bar chart type
+ List<string> typeSeries = area.GetSeriesFromChartType(this.Name);
+
+ // Zero X values mode.
+ bool indexedSeries = ChartHelper.IndexedSeries(common, typeSeries.ToArray());
+
+ //************************************************************
+ //** Loop through all series
+ //************************************************************
+ int seriesIndex = 0;
+ foreach( Series ser in common.DataManager.Series )
+ {
+ // Process non empty series of the area with error bar chart type
+ if( String.Compare( ser.ChartTypeName, this.Name, StringComparison.OrdinalIgnoreCase ) != 0
+ || ser.ChartArea != area.Name || !ser.IsVisible())
+ {
+ continue;
+ }
+
+ // Set active horizontal/vertical axis
+ hAxis = area.GetAxis(AxisName.X, ser.XAxisType, ser.XSubAxisName);
+ vAxis = area.GetAxis(AxisName.Y, ser.YAxisType, ser.YSubAxisName);
+
+ // Get interval between points
+ double interval = (indexedSeries) ? 1 : area.GetPointsInterval( hAxis.IsLogarithmic, hAxis.logarithmBase );
+
+ // Calculates points width
+ float width = (float)(ser.GetPointWidth(graph, hAxis, interval, 0.4));
+
+
+ // Align error bar X position with linked series
+ float sideBySideWidth = width;
+ int numberOfLinkedSeries = 1;
+ int indexOfLinkedSeries = 0;
+ bool showSideBySide = false;
+ string linkedSeriesName = string.Empty;
+ bool currentDrawSeriesSideBySide = false;
+ if(ser.IsCustomPropertySet(CustomPropertyName.ErrorBarSeries))
+ {
+ // Get series name
+ linkedSeriesName = ser[CustomPropertyName.ErrorBarSeries];
+ int valueTypeIndex = linkedSeriesName.IndexOf(":", StringComparison.Ordinal);
+ if(valueTypeIndex >= 0)
+ {
+ linkedSeriesName = linkedSeriesName.Substring(0, valueTypeIndex);
+ }
+
+ // All linked data series from chart area which have Error bar chart type
+ string linkedSeriesChartType = common.DataManager.Series[linkedSeriesName].ChartTypeName;
+ ChartArea linkedSeriesArea = common.ChartPicture.ChartAreas[common.DataManager.Series[linkedSeriesName].ChartArea];
+ List<string> typeLinkedSeries = linkedSeriesArea.GetSeriesFromChartType(linkedSeriesChartType);
+
+ // Get index of linked serries
+ foreach(string name in typeLinkedSeries)
+ {
+ if(name == linkedSeriesName)
+ {
+ break;
+ }
+ ++indexOfLinkedSeries;
+ }
+
+
+ currentDrawSeriesSideBySide = false;
+ if(String.Compare(linkedSeriesChartType, ChartTypeNames.Column, StringComparison.OrdinalIgnoreCase) ==0
+ || String.Compare(linkedSeriesChartType, ChartTypeNames.RangeColumn, StringComparison.OrdinalIgnoreCase) == 0
+ )
+ {
+ currentDrawSeriesSideBySide = true;
+ }
+ foreach(string seriesName in typeLinkedSeries)
+ {
+ if(common.DataManager.Series[seriesName].IsCustomPropertySet(CustomPropertyName.DrawSideBySide))
+ {
+ string attribValue = common.DataManager.Series[seriesName][CustomPropertyName.DrawSideBySide];
+ if(String.Compare(attribValue, "False", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ currentDrawSeriesSideBySide = false;
+ }
+ else if(String.Compare(attribValue, "True", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ currentDrawSeriesSideBySide = true;
+ }
+ else if(String.Compare(attribValue, "Auto", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ // Do nothing
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionAttributeDrawSideBySideInvalid));
+ }
+ }
+ }
+
+ if(currentDrawSeriesSideBySide)
+ {
+ // Find the number of linked data series
+ numberOfLinkedSeries = typeLinkedSeries.Count;
+ width /= numberOfLinkedSeries;
+ showSideBySide = true;
+
+ // Check if side by side
+ if(!indexedSeries)
+ {
+ area.GetPointsInterval( typeLinkedSeries, hAxis.IsLogarithmic, hAxis.logarithmBase, true, out showSideBySide );
+ }
+
+ sideBySideWidth = (float)(common.DataManager.Series[linkedSeriesName].GetPointWidth(graph, hAxis, interval, 0.8)) / numberOfLinkedSeries;
+ }
+ }
+
+ // Check if side-by-side attribute is set
+ if(!currentDrawSeriesSideBySide && ser.IsCustomPropertySet(CustomPropertyName.DrawSideBySide))
+ {
+ string attribValue = ser[CustomPropertyName.DrawSideBySide];
+ if(String.Compare(attribValue, "False", StringComparison.OrdinalIgnoreCase) ==0)
+ {
+ showSideBySide = false;
+ }
+ else if(String.Compare(attribValue, "True", StringComparison.OrdinalIgnoreCase) ==0)
+ {
+ showSideBySide = true;
+ numberOfLinkedSeries = typeSeries.Count;
+ indexOfLinkedSeries = seriesIndex;
+ width /= numberOfLinkedSeries;
+
+ // NOTE: Lines of code below were added to fix issue #4048
+ sideBySideWidth = (float)(ser.GetPointWidth(graph, hAxis, interval, 0.8)) / numberOfLinkedSeries;
+ }
+ else if(String.Compare(attribValue, "Auto", StringComparison.OrdinalIgnoreCase) ==0)
+ {
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionAttributeDrawSideBySideInvalid));
+ }
+ }
+
+
+ // Call Back Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPrePaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+
+
+ //************************************************************
+ //** Series data points loop
+ //************************************************************
+ int index = 1;
+ foreach( DataPoint point in ser.Points )
+ {
+ // Check required Y values number
+ if(point.YValues.Length < this.YValuesPerPoint)
+ {
+ throw(new InvalidOperationException(SR.ExceptionChartTypeRequiresYValues(this.Name, this.YValuesPerPoint.ToString(CultureInfo.InvariantCulture))));
+ }
+
+ // Reset pre-calculated point position
+ point.positionRel = new PointF(float.NaN, float.NaN);
+
+ // Get point X position
+ float xPosition = 0f;
+ double xValue = point.XValue;
+ if( indexedSeries )
+ {
+ xValue = (double)index;
+ // xPosition = (float)(hAxis.GetPosition( (double)index ) - sideBySideWidth * ((double) numberOfLinkedSeries) / 2.0 + sideBySideWidth/2 + indexOfLinkedSeries * sideBySideWidth);
+ }
+
+ if( showSideBySide )
+ {
+ xPosition = (float)(hAxis.GetPosition( xValue ) - sideBySideWidth * ((double) numberOfLinkedSeries) / 2.0 + sideBySideWidth/2 + indexOfLinkedSeries * sideBySideWidth);
+ }
+ else
+ {
+ xPosition = (float)hAxis.GetPosition( xValue );
+ }
+
+ double yValue0 = vAxis.GetLogValue( point.YValues[1] );
+ double yValue1 = vAxis.GetLogValue( point.YValues[2] );
+ xValue = hAxis.GetLogValue(xValue);
+
+ // Check if chart is completly out of the data scaleView
+ if(xValue < hAxis.ViewMinimum ||
+ xValue > hAxis.ViewMaximum ||
+ (yValue0 < vAxis.ViewMinimum && yValue1 < vAxis.ViewMinimum) ||
+ (yValue0 > vAxis.ViewMaximum && yValue1 > vAxis.ViewMaximum) )
+ {
+ ++index;
+ continue;
+ }
+
+ // Make sure High/Low values are in data scaleView range
+ double low = vAxis.GetLogValue( point.YValues[1] );
+ double high = vAxis.GetLogValue( point.YValues[2] );
+
+ // Check if lower and/or upper error bar are drawn
+ ErrorBarStyle barStyle = ErrorBarStyle.Both;
+ if(point.IsCustomPropertySet(CustomPropertyName.ErrorBarStyle) || ser.IsCustomPropertySet(CustomPropertyName.ErrorBarStyle))
+ {
+ string errorBarStyle = ser[CustomPropertyName.ErrorBarStyle];
+ if(point.IsCustomPropertySet(CustomPropertyName.ErrorBarStyle))
+ {
+ errorBarStyle = point[CustomPropertyName.ErrorBarStyle];
+ }
+
+ if(String.Compare( errorBarStyle, "Both", StringComparison.OrdinalIgnoreCase ) == 0)
+ {
+ // default - do nothing
+ }
+ else if(String.Compare(errorBarStyle, "UpperError", StringComparison.OrdinalIgnoreCase ) == 0)
+ {
+ barStyle = ErrorBarStyle.UpperError;
+ low = vAxis.GetLogValue( point.YValues[0] );
+ high = vAxis.GetLogValue( point.YValues[2] );
+ }
+ else if(String.Compare(errorBarStyle, "LowerError", StringComparison.OrdinalIgnoreCase ) == 0)
+ {
+ barStyle = ErrorBarStyle.LowerError;
+ low = vAxis.GetLogValue( point.YValues[1] );
+ high = vAxis.GetLogValue( point.YValues[0] );
+ }
+ else
+ {
+ throw(new InvalidOperationException( SR.ExceptionCustomAttributeValueInvalid( point[CustomPropertyName.ErrorBarStyle], "ErrorBarStyle")));
+ }
+ }
+
+ // Check if values are in range
+ if( high > vAxis.ViewMaximum )
+ {
+ high = vAxis.ViewMaximum;
+ }
+ if( high < vAxis.ViewMinimum )
+ {
+ high = vAxis.ViewMinimum;
+ }
+ high = (float)vAxis.GetLinearPosition(high);
+
+ if( low > vAxis.ViewMaximum )
+ {
+ low = vAxis.ViewMaximum;
+ }
+ if( low < vAxis.ViewMinimum )
+ {
+ low = vAxis.ViewMinimum;
+ }
+ low = vAxis.GetLinearPosition(low);
+
+ // Remeber pre-calculated point position
+ point.positionRel = new PointF((float)xPosition, (float)Math.Min(high, low));
+
+ if( common.ProcessModePaint )
+ {
+
+ // Check if chart is partialy in the data scaleView
+ bool clipRegionSet = false;
+ if(xValue == hAxis.ViewMinimum || xValue == hAxis.ViewMaximum )
+ {
+ // Set clipping region for line drawing
+ graph.SetClip( area.PlotAreaPosition.ToRectangleF() );
+ clipRegionSet = true;
+ }
+
+ // Start Svg Selection mode
+ graph.StartHotRegion( point );
+
+ // Draw error bar line
+ graph.DrawLineRel(
+ point.Color,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ new PointF(xPosition, (float)high),
+ new PointF(xPosition, (float)low),
+ ser.ShadowColor,
+ ser.ShadowOffset );
+
+ // Draw Error Bar marks
+ DrawErrorBarMarks(graph, barStyle, area, ser, point, xPosition, width);
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+
+ // Reset Clip Region
+ if(clipRegionSet)
+ {
+ graph.ResetClip();
+ }
+ }
+
+ if( common.ProcessModeRegions )
+ {
+ // Calculate rect around the error bar marks
+ RectangleF areaRect = RectangleF.Empty;
+ areaRect.X = xPosition - width / 2f;
+ areaRect.Y = (float)Math.Min(high, low);
+ areaRect.Width = width;
+ areaRect.Height = (float)Math.Max(high, low) - areaRect.Y;
+
+ // Add area
+ common.HotRegionsList.AddHotRegion( areaRect, point, ser.Name, index - 1 );
+ }
+ ++index;
+ }
+
+ //************************************************************
+ //** Second series data points loop, when labels are drawn.
+ //************************************************************
+ if( !selection )
+ {
+ index = 1;
+ foreach( DataPoint point in ser.Points )
+ {
+ // Get point X position
+ float xPosition = 0f;
+ double xValue = point.XValue;
+ if( indexedSeries )
+ {
+ xValue = (double)index;
+ xPosition = (float)(hAxis.GetPosition( (double)index ) - sideBySideWidth * ((double) numberOfLinkedSeries) / 2.0 + sideBySideWidth/2 + indexOfLinkedSeries * sideBySideWidth);
+ }
+ else if( showSideBySide )
+ {
+ xPosition = (float)(hAxis.GetPosition( xValue ) - sideBySideWidth * ((double) numberOfLinkedSeries) / 2.0 + sideBySideWidth/2 + indexOfLinkedSeries * sideBySideWidth);
+ }
+ else
+ {
+ xPosition = (float)hAxis.GetPosition( xValue );
+ }
+
+ double yValue0 = vAxis.GetLogValue( point.YValues[1] );
+ double yValue1 = vAxis.GetLogValue( point.YValues[2] );
+ xValue = hAxis.GetLogValue(xValue);
+
+ // Check if chart is completly out of the data scaleView
+ if(xValue < hAxis.ViewMinimum ||
+ xValue > hAxis.ViewMaximum ||
+ (yValue0 < vAxis.ViewMinimum && yValue1 < vAxis.ViewMinimum) ||
+ (yValue0 > vAxis.ViewMaximum && yValue1 > vAxis.ViewMaximum) )
+ {
+ ++index;
+ continue;
+ }
+
+ // Make sure High/Low values are in data scaleView range
+ double high = vAxis.GetLogValue( point.YValues[1] );
+ double low = vAxis.GetLogValue( point.YValues[2] );
+
+ // Check if lower and/or upper error bar are drawn
+ if(point.IsCustomPropertySet(CustomPropertyName.ErrorBarStyle) || ser.IsCustomPropertySet(CustomPropertyName.ErrorBarStyle))
+ {
+ string errorBarStyle = ser[CustomPropertyName.ErrorBarStyle];
+ if(point.IsCustomPropertySet(CustomPropertyName.ErrorBarStyle))
+ {
+ errorBarStyle = point[CustomPropertyName.ErrorBarStyle];
+ }
+ if(String.Compare(errorBarStyle, "Both", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ // default - do nothing
+ }
+ else if(String.Compare(errorBarStyle, "UpperError", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ low = vAxis.GetLogValue( point.YValues[0] );
+ high = vAxis.GetLogValue( point.YValues[2] );
+ }
+ else if(String.Compare(errorBarStyle, "LowerError", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ low = vAxis.GetLogValue( point.YValues[1] );
+ high = vAxis.GetLogValue( point.YValues[0] );
+ }
+ else
+ {
+ throw(new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid(point[CustomPropertyName.ErrorBarStyle], "ErrorBarStyle")));
+ }
+ }
+
+
+ if( high > vAxis.ViewMaximum )
+ {
+ high = vAxis.ViewMaximum;
+ }
+ if( high < vAxis.ViewMinimum )
+ {
+ high = vAxis.ViewMinimum;
+ }
+ high = (float)vAxis.GetLinearPosition(high);
+
+ if( low > vAxis.ViewMaximum )
+ {
+ low = vAxis.ViewMaximum;
+ }
+ if( low < vAxis.ViewMinimum )
+ {
+ low = vAxis.ViewMinimum;
+ }
+ low = vAxis.GetLinearPosition(low);
+
+ // Start Svg Selection mode
+ graph.StartHotRegion( point, true );
+
+ // Draw label
+ DrawLabel(common, area, graph, ser, point, new PointF(xPosition, (float)Math.Min(high, low)), index);
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+
+ ++index;
+ }
+ }
+
+ // Call Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPostPaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+
+ ++seriesIndex;
+ }
+ }
+
+ /// <summary>
+ /// Draws error bar markers.
+ /// </summary>
+ /// <param name="graph">Chart graphics object.</param>
+ /// <param name="barStyle">Style of the error bar.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="ser">Data point series.</param>
+ /// <param name="point">Data point to draw.</param>
+ /// <param name="xPosition">X position.</param>
+ /// <param name="width">Point width.</param>
+ virtual protected void DrawErrorBarMarks(
+ ChartGraphics graph,
+ ErrorBarStyle barStyle,
+ ChartArea area,
+ Series ser,
+ DataPoint point,
+ float xPosition,
+ float width)
+ {
+ double yPosition = 0.0;
+ string markerStyle = String.Empty;
+
+ // Draw lower error marker
+ if(barStyle == ErrorBarStyle.Both || barStyle == ErrorBarStyle.LowerError)
+ {
+ // Get Y position
+ yPosition = vAxis.GetLogValue( point.YValues[1] );
+
+ // Get marker style name
+ markerStyle = "LINE";
+ if(point.MarkerStyle != MarkerStyle.None)
+ {
+ markerStyle = point.MarkerStyle.ToString();
+ }
+
+ // Draw marker
+ DrawErrorBarSingleMarker(graph, area, point, markerStyle, xPosition, (float)yPosition, 0f, width, false);
+ }
+
+ // Draw upper error marker
+ if(barStyle == ErrorBarStyle.Both || barStyle == ErrorBarStyle.UpperError)
+ {
+ // Get Y position
+ yPosition = vAxis.GetLogValue( point.YValues[2] );
+
+ // Get marker style name
+ markerStyle = "LINE";
+ if(point.MarkerStyle != MarkerStyle.None)
+ {
+ markerStyle = point.MarkerStyle.ToString();
+ }
+
+ // Draw marker
+ DrawErrorBarSingleMarker(graph, area, point, markerStyle, xPosition, (float)yPosition, 0f, width, false);
+ }
+
+ // Draw center value marker
+ if(point.IsCustomPropertySet(CustomPropertyName.ErrorBarCenterMarkerStyle) || point.series.IsCustomPropertySet(CustomPropertyName.ErrorBarCenterMarkerStyle))
+ {
+ // Get Y position
+ yPosition = vAxis.GetLogValue( point.YValues[0] );
+
+ // Get marker style name
+ markerStyle = point.series[CustomPropertyName.ErrorBarCenterMarkerStyle];
+ if(point.IsCustomPropertySet(CustomPropertyName.ErrorBarCenterMarkerStyle))
+ {
+ markerStyle = point[CustomPropertyName.ErrorBarCenterMarkerStyle];
+ }
+ markerStyle = markerStyle.ToUpper(System.Globalization.CultureInfo.InvariantCulture);
+
+ // Draw marker
+ DrawErrorBarSingleMarker(graph, area, point, markerStyle, xPosition, (float)yPosition, 0f, width, false);
+ }
+ }
+
+ /// <summary>
+ /// Draws single marker on the error bar.
+ /// </summary>
+ /// <param name="graph">Chart graphics.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="point">Series point.</param>
+ /// <param name="markerStyle">Marker style name.</param>
+ /// <param name="xPosition">X position.</param>
+ /// <param name="yPosition">Y position.</param>
+ /// <param name="zPosition">Z position.</param>
+ /// <param name="width">Point width.</param>
+ /// <param name="draw3D">Used for 3d drawing.</param>
+ private void DrawErrorBarSingleMarker(
+ ChartGraphics graph,
+ ChartArea area,
+ DataPoint point,
+ string markerStyle,
+ float xPosition,
+ float yPosition,
+ float zPosition,
+ float width,
+ bool draw3D)
+ {
+ markerStyle = markerStyle.ToUpper(CultureInfo.InvariantCulture);
+ if(markerStyle.Length > 0 && String.Compare(markerStyle, "None", StringComparison.OrdinalIgnoreCase) != 0)
+ {
+ // Make sure Y value is in range
+ if( yPosition > vAxis.ViewMaximum || yPosition < vAxis.ViewMinimum)
+ {
+ return;
+ }
+ yPosition = (float)vAxis.GetLinearPosition(yPosition);
+
+ // 3D Transform coordinates
+ if(draw3D)
+ {
+ Point3D[] points = new Point3D[1];
+ points[0] = new Point3D(xPosition, yPosition, zPosition);
+ area.matrix3D.TransformPoints(points);
+ xPosition = points[0].X;
+ yPosition = points[0].Y;
+ }
+
+ // Draw horizontal line marker
+ if(String.Compare(markerStyle, "Line", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ graph.DrawLineRel(
+ point.Color,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ new PointF(xPosition - width/2f, yPosition),
+ new PointF(xPosition + width/2f, yPosition),
+ (point.series != null) ? point.series.ShadowColor : Color.Empty,
+ (point.series != null) ? point.series.ShadowOffset : 0 );
+ }
+
+ // Draw standard marker
+ else
+ {
+ MarkerStyle marker = (MarkerStyle)Enum.Parse(typeof(MarkerStyle), markerStyle, true);
+
+ // Get marker size
+ SizeF markerSize = GetMarkerSize(
+ graph,
+ area.Common,
+ area,
+ point,
+ point.MarkerSize,
+ point.MarkerImage);
+
+ // Get marker color
+ Color markerColor = (point.MarkerColor == Color.Empty) ? point.Color : point.MarkerColor;
+
+ // Draw the marker
+ graph.DrawMarkerRel(
+ new PointF(xPosition, yPosition),
+ marker,
+ point.MarkerSize,
+ markerColor,
+ point.MarkerBorderColor,
+ point.MarkerBorderWidth,
+ point.MarkerImage,
+ point.MarkerImageTransparentColor,
+ (point.series != null) ? point.series.ShadowOffset : 0,
+ (point.series != null) ? point.series.ShadowColor : Color.Empty,
+ new RectangleF(xPosition, yPosition, markerSize.Width, markerSize.Height));
+ }
+ }
+ }
+
+ /// <summary>
+ /// Returns marker size.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="point">Data point.</param>
+ /// <param name="markerSize">Marker size.</param>
+ /// <param name="markerImage">Marker image.</param>
+ /// <returns>Marker width and height.</returns>
+ virtual protected SizeF GetMarkerSize(
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ DataPoint point,
+ int markerSize,
+ string markerImage)
+ {
+ SizeF size = new SizeF(markerSize, markerSize);
+ if (graph != null && graph.Graphics != null)
+ {
+ // Marker size is in pixels and we do the mapping for higher DPIs
+ size.Width = markerSize * graph.Graphics.DpiX / 96;
+ size.Height = markerSize * graph.Graphics.DpiY / 96;
+ }
+
+ if(markerImage.Length > 0)
+ common.ImageLoader.GetAdjustedImageSize(markerImage, graph.Graphics, ref size);
+
+ return size;
+ }
+
+
+ /// <summary>
+ /// Draws error bar chart data point label.
+ /// </summary>
+ /// <param name="common">The Common elements object</param>
+ /// <param name="area">Chart area for this chart</param>
+ /// <param name="graph">Chart graphics object.</param>
+ /// <param name="ser">Data point series.</param>
+ /// <param name="point">Data point to draw.</param>
+ /// <param name="position">Label position.</param>
+ /// <param name="pointIndex">Data point index.</param>
+ virtual protected void DrawLabel(
+ CommonElements common,
+ ChartArea area,
+ ChartGraphics graph,
+ Series ser,
+ DataPoint point,
+ PointF position,
+ int pointIndex)
+ {
+ if(ser.IsValueShownAsLabel || point.IsValueShownAsLabel || point.Label.Length > 0)
+ {
+ // Label text format
+ using (StringFormat format = new StringFormat())
+ {
+ format.Alignment = StringAlignment.Near;
+ format.LineAlignment = StringAlignment.Center;
+ if (point.LabelAngle == 0)
+ {
+ format.Alignment = StringAlignment.Center;
+ format.LineAlignment = StringAlignment.Far;
+ }
+
+ // Get label text
+ string text;
+ if (point.Label.Length == 0)
+ {
+ text = ValueConverter.FormatValue(
+ ser.Chart,
+ point,
+ point.Tag,
+ point.YValues[0],
+ point.LabelFormat,
+ ser.YValueType,
+ ChartElementType.DataPoint);
+ }
+ else
+ {
+ text = point.ReplaceKeywords(point.Label);
+ }
+
+ // Adjust label positio to the marker size
+ SizeF markerSizes = new SizeF(0f, 0f);
+ if (point.MarkerStyle != MarkerStyle.None)
+ {
+ markerSizes = graph.GetRelativeSize(new SizeF(point.MarkerSize, point.MarkerSize));
+ position.Y -= markerSizes.Height / 2f;
+ }
+
+ // Get text angle
+ int textAngle = point.LabelAngle;
+
+ // Check if text contains white space only
+ if (text.Trim().Length != 0)
+ {
+ SizeF sizeFont = SizeF.Empty;
+
+
+ // Check if Smart Labels are enabled
+ if (ser.SmartLabelStyle.Enabled)
+ {
+ // Get text size
+ sizeFont = graph.GetRelativeSize(
+ graph.MeasureString(text, point.Font, new SizeF(1000f, 1000f), StringFormat.GenericTypographic));
+
+ // Adjust label position using SmartLabelStyle algorithm
+ position = area.smartLabels.AdjustSmartLabelPosition(
+ common,
+ graph,
+ area,
+ ser.SmartLabelStyle,
+ position,
+ sizeFont,
+ format,
+ position,
+ markerSizes,
+ LabelAlignmentStyles.Top);
+
+ // Smart labels always use 0 degrees text angle
+ textAngle = 0;
+ }
+
+
+
+ // Draw label
+ if (!position.IsEmpty)
+ {
+ // Get text size
+ if (sizeFont.IsEmpty)
+ {
+ sizeFont = graph.GetRelativeSize(
+ graph.MeasureString(text, point.Font, new SizeF(1000f, 1000f), StringFormat.GenericTypographic));
+ }
+
+ // Get label background position
+ RectangleF labelBackPosition = RectangleF.Empty;
+ SizeF sizeLabel = new SizeF(sizeFont.Width, sizeFont.Height);
+ sizeLabel.Height += sizeFont.Height / 8;
+ sizeLabel.Width += sizeLabel.Width / text.Length;
+ labelBackPosition = PointChart.GetLabelPosition(
+ graph,
+ position,
+ sizeLabel,
+ format,
+ true);
+
+ // Draw label text
+ using (Brush brush = new SolidBrush(point.LabelForeColor))
+ {
+ graph.DrawPointLabelStringRel(
+ common,
+ text,
+ point.Font,
+ brush,
+ position,
+ format,
+ textAngle,
+ labelBackPosition,
+ point.LabelBackColor,
+ point.LabelBorderColor,
+ point.LabelBorderWidth,
+ point.LabelBorderDashStyle,
+ ser,
+ point,
+ pointIndex - 1);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ #endregion
+
+ #region 3D Drawing and Selection methods
+
+ /// <summary>
+ /// This method recalculates size of the bars. This method is used
+ /// from Paint or Select method.
+ /// </summary>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ virtual protected void ProcessChartType3D(
+ bool selection,
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ Series seriesToDraw )
+ {
+ // All data series from chart area which have Error Bar chart type
+ List<string> typeSeries = area.GetSeriesFromChartType(this.Name);
+
+ // Zero X values mode.
+ bool indexedSeries = ChartHelper.IndexedSeries(common, typeSeries.ToArray());
+
+ //************************************************************
+ //** Loop through all series
+ //************************************************************
+ foreach( Series ser in common.DataManager.Series )
+ {
+ // Process non empty series of the area with stock chart type
+ if( String.Compare( ser.ChartTypeName, this.Name, StringComparison.OrdinalIgnoreCase ) != 0
+ || ser.ChartArea != area.Name || !ser.IsVisible())
+ {
+ continue;
+ }
+
+ // Check that we have at least 4 Y values
+ if(ser.YValuesPerPoint < 3)
+ {
+ throw(new ArgumentException(SR.ExceptionChartTypeRequiresYValues( ChartTypeNames.ErrorBar, ((int)(3)).ToString(CultureInfo.CurrentCulture))));
+ }
+
+ // Set active horizontal/vertical axis
+ hAxis = area.GetAxis(AxisName.X, ser.XAxisType, ser.XSubAxisName);
+ vAxis = area.GetAxis(AxisName.Y, ser.YAxisType, ser.YSubAxisName);
+
+ // Get interval between points
+ double interval = (indexedSeries) ? 1 : area.GetPointsInterval( hAxis.IsLogarithmic, hAxis.logarithmBase );
+
+ // Calculates the width of the candles.
+ float width = (float)(ser.GetPointWidth(graph, hAxis, interval, 0.4));
+
+ // Align error bar X position with linked series
+ float sideBySideWidth = width;
+ int numberOfLinkedSeries = 1;
+ int indexOfLinkedSeries = 0;
+ bool showSideBySide = false;
+ if(ser.IsCustomPropertySet(CustomPropertyName.ErrorBarSeries))
+ {
+ // Get series name
+ string attribValue = ser[CustomPropertyName.ErrorBarSeries];
+ int valueTypeIndex = attribValue.IndexOf(":", StringComparison.Ordinal);
+ if(valueTypeIndex >= 0)
+ {
+ attribValue = attribValue.Substring(0, valueTypeIndex);
+ }
+
+ // All linked data series from chart area which have Error bar chart type
+ string linkedSeriesChartType = common.DataManager.Series[attribValue].ChartTypeName;
+ List<string> typeLinkedSeries = area.GetSeriesFromChartType(linkedSeriesChartType);
+
+ // Get index of linked serries
+ foreach(string name in typeLinkedSeries)
+ {
+ if(name == attribValue)
+ {
+ break;
+ }
+ ++indexOfLinkedSeries;
+ }
+
+ bool currentDrawSeriesSideBySide = false;
+ if(String.Compare(linkedSeriesChartType, ChartTypeNames.Column, StringComparison.OrdinalIgnoreCase ) == 0
+ || String.Compare(linkedSeriesChartType, ChartTypeNames.RangeColumn, StringComparison.OrdinalIgnoreCase) == 0
+ )
+ {
+ currentDrawSeriesSideBySide = true;
+ }
+ foreach(string seriesName in typeLinkedSeries)
+ {
+ if(common.DataManager.Series[seriesName].IsCustomPropertySet(CustomPropertyName.DrawSideBySide))
+ {
+ attribValue = common.DataManager.Series[seriesName][CustomPropertyName.DrawSideBySide];
+ if(String.Compare(attribValue, "False", StringComparison.OrdinalIgnoreCase ) == 0)
+ {
+ currentDrawSeriesSideBySide = false;
+ }
+ else if(String.Compare(attribValue, "True", StringComparison.OrdinalIgnoreCase ) == 0)
+ {
+ currentDrawSeriesSideBySide = true;
+ }
+ else if(String.Compare(attribValue, "Auto", StringComparison.OrdinalIgnoreCase ) == 0)
+ {
+ // Do nothing
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionAttributeDrawSideBySideInvalid));
+ }
+ }
+ }
+
+ if(currentDrawSeriesSideBySide)
+ {
+ // Find the number of linked data series
+ numberOfLinkedSeries = typeLinkedSeries.Count;
+ width /= numberOfLinkedSeries;
+
+ // Check if side by side
+ if(!indexedSeries)
+ {
+ area.GetPointsInterval( typeLinkedSeries, hAxis.IsLogarithmic, hAxis.logarithmBase, true, out showSideBySide );
+ }
+ }
+ }
+
+ // Call Back Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPrePaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+
+ //************************************************************
+ //** Get series depth and Z position
+ //************************************************************
+ float seriesDepth, seriesZPosition;
+ area.GetSeriesZPositionAndDepth(ser, out seriesDepth, out seriesZPosition);
+
+ //************************************************************
+ //** Series data points loop
+ //************************************************************
+ int index = 1;
+ foreach( DataPoint point in ser.Points )
+ {
+ // Check required Y values number
+ if(point.YValues.Length < this.YValuesPerPoint)
+ {
+ throw(new InvalidOperationException(SR.ExceptionChartTypeRequiresYValues( this.Name, this.YValuesPerPoint.ToString(CultureInfo.InvariantCulture))));
+ }
+
+ // Reset pre-calculated point position
+ point.positionRel = new PointF(float.NaN, float.NaN);
+
+ // Get point X position
+ float xPosition = 0f;
+ double xValue = point.XValue;
+ if( indexedSeries )
+ {
+ xValue = (double)index;
+ xPosition = (float)(hAxis.GetPosition( (double)index ) - sideBySideWidth * ((double) numberOfLinkedSeries) / 2.0 + sideBySideWidth/2 + indexOfLinkedSeries * sideBySideWidth);
+ }
+ else if( showSideBySide )
+ {
+ xPosition = (float)(hAxis.GetPosition( xValue ) - sideBySideWidth * ((double) numberOfLinkedSeries) / 2.0 + sideBySideWidth/2 + indexOfLinkedSeries * sideBySideWidth);
+ }
+ else
+ {
+ xPosition = (float)hAxis.GetPosition( xValue );
+ }
+
+ double yValue0 = vAxis.GetLogValue( point.YValues[1] );
+ double yValue1 = vAxis.GetLogValue( point.YValues[2] );
+ xValue = hAxis.GetLogValue(xValue);
+
+ // Check if chart is completly out of the data scaleView
+ if(xValue < hAxis.ViewMinimum ||
+ xValue > hAxis.ViewMaximum ||
+ (yValue0 < vAxis.ViewMinimum && yValue1 < vAxis.ViewMinimum) ||
+ (yValue0 > vAxis.ViewMaximum && yValue1 > vAxis.ViewMaximum) )
+ {
+ ++index;
+ continue;
+ }
+
+ // Make sure High/Low values are in data scaleView range
+ double high = vAxis.GetLogValue( point.YValues[2] );
+ double low = vAxis.GetLogValue( point.YValues[1] );
+
+ // Check if lower and/or upper error bar are drawn
+ ErrorBarStyle barStyle = ErrorBarStyle.Both;
+ if(point.IsCustomPropertySet(CustomPropertyName.ErrorBarStyle) || ser.IsCustomPropertySet(CustomPropertyName.ErrorBarStyle))
+ {
+ string errorBarStyle = ser[CustomPropertyName.ErrorBarStyle];
+ if(point.IsCustomPropertySet(CustomPropertyName.ErrorBarStyle))
+ {
+ errorBarStyle = point[CustomPropertyName.ErrorBarStyle];
+ }
+ if(String.Compare(errorBarStyle, "Both", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ // default - do nothing
+ }
+ else if(String.Compare(errorBarStyle, "UpperError", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ barStyle = ErrorBarStyle.UpperError;
+ low = vAxis.GetLogValue( point.YValues[0] );
+ high = vAxis.GetLogValue( point.YValues[2] );
+ }
+ else if(String.Compare(errorBarStyle, "LowerError", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ barStyle = ErrorBarStyle.LowerError;
+ low = vAxis.GetLogValue( point.YValues[1] );
+ high = vAxis.GetLogValue( point.YValues[0] );
+ }
+ else
+ {
+ throw(new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid(point[CustomPropertyName.ErrorBarStyle], "ErrorBarStyle")));
+ }
+ }
+
+ if( high > vAxis.ViewMaximum )
+ {
+ high = vAxis.ViewMaximum;
+ }
+ if( high < vAxis.ViewMinimum )
+ {
+ high = vAxis.ViewMinimum;
+ }
+ high = (float)vAxis.GetLinearPosition(high);
+
+ if( low > vAxis.ViewMaximum )
+ {
+ low = vAxis.ViewMaximum;
+ }
+ if( low < vAxis.ViewMinimum )
+ {
+ low = vAxis.ViewMinimum;
+ }
+ low = vAxis.GetLinearPosition(low);
+
+ // Remeber pre-calculated point position
+ point.positionRel = new PointF((float)xPosition, (float)Math.Min(high, low));
+
+ // 3D Transform coordinates
+ Point3D[] points = new Point3D[2];
+ points[0] = new Point3D(xPosition, (float)high, seriesZPosition+seriesDepth/2f);
+ points[1] = new Point3D(xPosition, (float)low, seriesZPosition+seriesDepth/2f);
+ area.matrix3D.TransformPoints(points);
+
+ if( common.ProcessModePaint )
+ {
+
+ // Check if chart is partialy in the data scaleView
+ bool clipRegionSet = false;
+ if(xValue == hAxis.ViewMinimum || xValue == hAxis.ViewMaximum )
+ {
+ // Set clipping region for line drawing
+ graph.SetClip( area.PlotAreaPosition.ToRectangleF() );
+ clipRegionSet = true;
+ }
+
+ // Start Svg Selection mode
+ graph.StartHotRegion( point );
+
+ // Draw error bar line
+ graph.DrawLineRel(
+ point.Color,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ points[0].PointF,
+ points[1].PointF,
+ ser.ShadowColor,
+ ser.ShadowOffset );
+
+ // Draw Error Bar marks
+ DrawErrorBarMarks3D(graph, barStyle, area, ser, point, xPosition, width, seriesZPosition, seriesDepth);
+ xPosition = points[0].X;
+ high = points[0].Y;
+ low = points[1].Y;
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+
+ // Reset Clip Region
+ if(clipRegionSet)
+ {
+ graph.ResetClip();
+ }
+ }
+
+ if( common.ProcessModeRegions )
+ {
+ xPosition = points[0].X;
+ high = points[0].Y;
+ low = points[1].Y;
+
+ // Calculate rect around the error bar marks
+ RectangleF areaRect = RectangleF.Empty;
+ areaRect.X = xPosition - width / 2f;
+ areaRect.Y = (float)Math.Min(high, low);
+ areaRect.Width = width;
+ areaRect.Height = (float)Math.Max(high, low) - areaRect.Y;
+
+ // Add area
+ common.HotRegionsList.AddHotRegion(
+ areaRect,
+ point,
+ ser.Name,
+ index - 1 );
+ }
+
+ ++index;
+ }
+
+ //************************************************************
+ //** Second series data points loop, when labels are drawn.
+ //************************************************************
+ if( !selection )
+ {
+ index = 1;
+ foreach( DataPoint point in ser.Points )
+ {
+ // Get point X position
+ float xPosition = 0f;
+ double xValue = point.XValue;
+ if( indexedSeries )
+ {
+ xValue = (double)index;
+ xPosition = (float)(hAxis.GetPosition( (double)index ) - sideBySideWidth * ((double) numberOfLinkedSeries) / 2.0 + sideBySideWidth/2 + indexOfLinkedSeries * sideBySideWidth);
+ }
+ else if( showSideBySide )
+ {
+ xPosition = (float)(hAxis.GetPosition( xValue ) - sideBySideWidth * ((double) numberOfLinkedSeries) / 2.0 + sideBySideWidth/2 + indexOfLinkedSeries * sideBySideWidth);
+ }
+ else
+ {
+ xPosition = (float)hAxis.GetPosition( xValue );
+ }
+
+
+ double yValue0 = vAxis.GetLogValue( point.YValues[1] );
+ double yValue1 = vAxis.GetLogValue( point.YValues[2] );
+ xValue = hAxis.GetLogValue(xValue);
+
+ // Check if chart is completly out of the data scaleView
+ if(xValue < hAxis.ViewMinimum ||
+ xValue > hAxis.ViewMaximum ||
+ (yValue0 < vAxis.ViewMinimum && yValue1 < vAxis.ViewMinimum) ||
+ (yValue0 > vAxis.ViewMaximum && yValue1 > vAxis.ViewMaximum) )
+ {
+ ++index;
+ continue;
+ }
+
+ // Make sure High/Low values are in data scaleView range
+ double high = vAxis.GetLogValue( point.YValues[2] );
+ double low = vAxis.GetLogValue( point.YValues[1] );
+
+ // Check if lower and/or upper error bar are drawn
+ if(point.IsCustomPropertySet(CustomPropertyName.ErrorBarStyle) || ser.IsCustomPropertySet(CustomPropertyName.ErrorBarStyle))
+ {
+ string errorBarStyle = ser[CustomPropertyName.ErrorBarStyle];
+ if(point.IsCustomPropertySet(CustomPropertyName.ErrorBarStyle))
+ {
+ errorBarStyle = point[CustomPropertyName.ErrorBarStyle];
+ }
+ if(String.Compare(errorBarStyle, "Both", StringComparison.OrdinalIgnoreCase ) == 0)
+ {
+ // default - do nothing
+ }
+ else if(String.Compare(errorBarStyle, "UpperError", StringComparison.OrdinalIgnoreCase ) == 0)
+ {
+ low = vAxis.GetLogValue( point.YValues[0] );
+ high = vAxis.GetLogValue( point.YValues[2] );
+ }
+ else if(String.Compare(errorBarStyle, "LowerError", StringComparison.OrdinalIgnoreCase ) == 0)
+ {
+ low = vAxis.GetLogValue( point.YValues[1] );
+ high = vAxis.GetLogValue( point.YValues[0] );
+ }
+ else
+ {
+ throw(new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid( point[CustomPropertyName.ErrorBarStyle], "ErrorBarStyle")));
+ }
+ }
+
+ if( high > vAxis.ViewMaximum )
+ {
+ high = vAxis.ViewMaximum;
+ }
+ if( high < vAxis.ViewMinimum )
+ {
+ high = vAxis.ViewMinimum;
+ }
+ high = (float)vAxis.GetLinearPosition(high);
+
+ if( low > vAxis.ViewMaximum )
+ {
+ low = vAxis.ViewMaximum;
+ }
+ if( low < vAxis.ViewMinimum )
+ {
+ low = vAxis.ViewMinimum;
+ }
+ low = vAxis.GetLinearPosition(low);
+
+
+ // 3D Transform coordinates
+ Point3D[] points = new Point3D[2];
+ points[0] = new Point3D(xPosition, (float)high, seriesZPosition+seriesDepth/2f);
+ points[1] = new Point3D(xPosition, (float)low, seriesZPosition+seriesDepth/2f);
+ area.matrix3D.TransformPoints(points);
+ xPosition = points[0].X;
+ high = points[0].Y;
+ low = points[1].Y;
+
+ // Draw label
+ DrawLabel(common, area, graph, ser, point, new PointF(xPosition, (float)Math.Min(high, low)), index);
+
+ ++index;
+ }
+ }
+
+ // Call Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPostPaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+ }
+ }
+
+ /// <summary>
+ /// Draws stock chart open-close marks depending on selected style.
+ /// </summary>
+ /// <param name="graph">Chart graphics object.</param>
+ /// <param name="barStyle">Style of the error bar.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="ser">Data point series.</param>
+ /// <param name="point">Data point to draw.</param>
+ /// <param name="xPosition">X position.</param>
+ /// <param name="width">Point width.</param>
+ /// <param name="zPosition">Series Z position.</param>
+ /// <param name="depth">Series depth.</param>
+ virtual protected void DrawErrorBarMarks3D(
+ ChartGraphics graph,
+ ErrorBarStyle barStyle,
+ ChartArea area,
+ Series ser,
+ DataPoint point,
+ float xPosition,
+ float width,
+ float zPosition,
+ float depth)
+ {
+ float yPosition = 0f;
+ string markerStyle = String.Empty;
+
+ // Draw lower error marker
+ if(barStyle == ErrorBarStyle.Both || barStyle == ErrorBarStyle.LowerError)
+ {
+ // Get Y position
+ yPosition = (float)vAxis.GetLogValue( point.YValues[1] );
+
+ // Get marker style name
+ markerStyle = "LINE";
+ if(point.MarkerStyle != MarkerStyle.None)
+ {
+ markerStyle = point.MarkerStyle.ToString();
+ }
+
+ // Draw marker
+ DrawErrorBarSingleMarker(graph, area, point, markerStyle, xPosition, yPosition, zPosition+depth/2f, width, true);
+ }
+
+ // Draw upper error marker
+ if(barStyle == ErrorBarStyle.Both || barStyle == ErrorBarStyle.UpperError)
+ {
+ // Get Y position
+ yPosition = (float)vAxis.GetLogValue( point.YValues[2] );
+
+ // Get marker style name
+ markerStyle = "LINE";
+ if(point.MarkerStyle != MarkerStyle.None)
+ {
+ markerStyle = point.MarkerStyle.ToString();
+ }
+
+ // Draw marker
+ DrawErrorBarSingleMarker(graph, area, point, markerStyle, xPosition, yPosition, zPosition+depth/2f, width, true);
+ }
+
+ // Draw center value marker
+ if(point.IsCustomPropertySet(CustomPropertyName.ErrorBarCenterMarkerStyle) || point.series.IsCustomPropertySet(CustomPropertyName.ErrorBarCenterMarkerStyle))
+ {
+ // Get Y position
+ yPosition = (float)vAxis.GetLogValue( point.YValues[0] );
+
+ // Get marker style name
+ markerStyle = point.series[CustomPropertyName.ErrorBarCenterMarkerStyle];
+ if(point.IsCustomPropertySet(CustomPropertyName.ErrorBarCenterMarkerStyle))
+ {
+ markerStyle = point[CustomPropertyName.ErrorBarCenterMarkerStyle];
+ }
+ markerStyle = markerStyle.ToUpper(CultureInfo.InvariantCulture);
+
+ // Draw marker
+ DrawErrorBarSingleMarker(graph, area, point, markerStyle, xPosition, yPosition, zPosition+depth/2f, width, true);
+ }
+ }
+
+ #endregion
+
+ #region Y values related methods
+
+ /// <summary>
+ /// Helper function that returns the Y value of the point.
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="area">Chart area the series belongs to.</param>
+ /// <param name="series">Sereis of the point.</param>
+ /// <param name="point">Point object.</param>
+ /// <param name="pointIndex">Index of the point.</param>
+ /// <param name="yValueIndex">Index of the Y value to get.</param>
+ /// <returns>Y value of the point.</returns>
+ virtual public double GetYValue(
+ CommonElements common,
+ ChartArea area,
+ Series series,
+ DataPoint point,
+ int pointIndex,
+ int yValueIndex)
+ {
+ return point.YValues[yValueIndex];
+ }
+
+ #endregion
+
+ #region Automatic Values Calculation methods
+
+ /// <summary>
+ /// Calculates lower and upper error amount using specified formula.
+ /// </summary>
+ /// <param name="errorBarSeries">Error bar chart type series.</param>
+ internal static void CalculateErrorAmount(Series errorBarSeries)
+ {
+ // Check input parameters
+ if(String.Compare(errorBarSeries.ChartTypeName, ChartTypeNames.ErrorBar, StringComparison.OrdinalIgnoreCase) != 0 )
+ {
+ return;
+ }
+
+ // Check if "ErrorBarType" custom attribute is set
+ if(!errorBarSeries.IsCustomPropertySet(CustomPropertyName.ErrorBarType) &&
+ !errorBarSeries.IsCustomPropertySet(CustomPropertyName.ErrorBarSeries))
+ {
+ return;
+ }
+
+ // Parase the value of the ErrorBarType attribute.
+ double param = double.NaN;
+ ErrorBarType errorBarType = ErrorBarType.StandardError;
+ if(errorBarSeries.IsCustomPropertySet(CustomPropertyName.ErrorBarType))
+ {
+ string typeName = errorBarSeries[CustomPropertyName.ErrorBarType];
+ if(typeName.StartsWith("FixedValue", StringComparison.OrdinalIgnoreCase))
+ {
+ errorBarType = ErrorBarType.FixedValue;
+ }
+ else if(typeName.StartsWith("Percentage", StringComparison.OrdinalIgnoreCase))
+ {
+ errorBarType = ErrorBarType.Percentage;
+ }
+ else if(typeName.StartsWith("StandardDeviation", StringComparison.OrdinalIgnoreCase))
+ {
+ errorBarType = ErrorBarType.StandardDeviation;
+ }
+ else if(typeName.StartsWith("StandardError", StringComparison.OrdinalIgnoreCase))
+ {
+ errorBarType = ErrorBarType.StandardError;
+ }
+ else if(typeName.StartsWith("None", StringComparison.OrdinalIgnoreCase))
+ {
+ return;
+ }
+ else
+ {
+ throw(new InvalidOperationException(SR.ExceptionErrorBarTypeInvalid(errorBarSeries[CustomPropertyName.ErrorBarType])));
+ }
+
+ // Check if parameter is specified
+ typeName = typeName.Substring(errorBarType.ToString().Length);
+ if(typeName.Length > 0)
+ {
+ // Must be followed by '(' and ends with ')'
+ if (!typeName.StartsWith("(", StringComparison.Ordinal) || !typeName.EndsWith(")", StringComparison.Ordinal))
+ {
+ throw(new InvalidOperationException(SR.ExceptionErrorBarTypeFormatInvalid(errorBarSeries[CustomPropertyName.ErrorBarType])));
+ }
+ typeName = typeName.Substring(1, typeName.Length - 2);
+
+
+ if(typeName.Length > 0)
+ {
+ if (!double.TryParse(typeName, NumberStyles.Any, CultureInfo.InvariantCulture, out param))
+ {
+ throw (new InvalidOperationException(SR.ExceptionErrorBarTypeFormatInvalid(errorBarSeries[CustomPropertyName.ErrorBarType])));
+ }
+ }
+ }
+ }
+
+ // Points number
+ int pointNumber = errorBarSeries.Points.Count;
+
+ // Find number of empty data points
+ int numberOfEmptyPoints = 0;
+ foreach(DataPoint point in errorBarSeries.Points)
+ {
+ if( point.IsEmpty )
+ {
+ numberOfEmptyPoints++;
+ }
+ }
+
+ // Number of poist without empty points
+ pointNumber -= numberOfEmptyPoints;
+
+ if (double.IsNaN(param))
+ {
+ param = DefaultErrorBarTypeValue(errorBarType);
+ }
+
+ // Calculate error amount
+ double errorAmount = 0.0;
+ if(errorBarType == ErrorBarType.FixedValue)
+ {
+ errorAmount = param;
+ }
+ else if(errorBarType == ErrorBarType.Percentage)
+ {
+ // no processing or errorAmount
+ }
+ else if( errorBarType == ErrorBarType.StandardDeviation )
+ {
+ // Formula for standard deviation need
+ // more then one data point
+ if( pointNumber > 1 )
+ {
+
+ // Calculate series mean value
+ double mean = 0.0;
+ foreach(DataPoint point in errorBarSeries.Points)
+ {
+ mean += point.YValues[0];
+ }
+ mean /= pointNumber;
+
+ // Calculate series variance
+ errorAmount = 0.0;
+ foreach(DataPoint point in errorBarSeries.Points)
+ {
+ if( !point.IsEmpty )
+ {
+ errorAmount += Math.Pow(point.YValues[0] - mean, 2);
+ }
+ }
+
+ errorAmount = param * Math.Sqrt(errorAmount/ ( pointNumber - 1 ) );
+ }
+ else
+ {
+ errorAmount = 0;
+ }
+ }
+ else if( errorBarType == ErrorBarType.StandardError )
+ {
+ // Formula for standard deviation need
+ // more then one data point
+ if( pointNumber > 1 )
+ {
+ // Calculate standard error
+ errorAmount = 0.0;
+ foreach(DataPoint point in errorBarSeries.Points)
+ {
+ if( !point.IsEmpty )
+ {
+ errorAmount += Math.Pow(point.YValues[0], 2);
+ }
+ }
+
+ errorAmount = param * Math.Sqrt( errorAmount/( pointNumber * ( pointNumber - 1 ) ) ) / 2.0;
+ }
+ else
+ {
+ errorAmount = 0;
+ }
+ }
+
+
+ // Loop through all points to calculate error amount
+ foreach(DataPoint point in errorBarSeries.Points)
+ {
+ if(errorBarType == ErrorBarType.Percentage)
+ {
+ point.YValues[1] = point.YValues[0] - point.YValues[0] * param / 100.0;
+ point.YValues[2] = point.YValues[0] + point.YValues[0] * param / 100.0;
+ }
+ else
+ {
+ point.YValues[1] = point.YValues[0] - errorAmount;
+ point.YValues[2] = point.YValues[0] + errorAmount;
+ }
+ }
+
+ }
+
+ internal static double DefaultErrorBarTypeValue(ErrorBarType errorBarType)
+ {
+ switch (errorBarType)
+ {
+ case ErrorBarType.FixedValue:
+ case ErrorBarType.Percentage:
+ return 10.0;
+ case ErrorBarType.StandardDeviation:
+ case ErrorBarType.StandardError:
+ return 1.0;
+ default:
+ System.Diagnostics.Debug.Fail("Unknown ErrorBarType=" + errorBarType.ToString());
+ break;
+ }
+ return 10.0;
+ }
+
+ /// <summary>
+ /// Populates error bar center value using the linked series specified by
+ /// "ErrorBarSeries" custom attribute.
+ /// </summary>
+ /// <param name="errorBarSeries">Error bar chart type series.</param>
+ internal static void GetDataFromLinkedSeries(Series errorBarSeries)
+ {
+ // Check input parameters
+ if(String.Compare(errorBarSeries.ChartTypeName, ChartTypeNames.ErrorBar, StringComparison.OrdinalIgnoreCase) != 0 || errorBarSeries.Chart == null)
+ {
+ return;
+ }
+
+ // Check if "ErrorBarSeries" custom attribute is set
+ if(!errorBarSeries.IsCustomPropertySet(CustomPropertyName.ErrorBarSeries))
+ {
+ return;
+ }
+
+ // Get series and value name
+ string linkedSeriesName = errorBarSeries[CustomPropertyName.ErrorBarSeries];
+ String valueName = "Y";
+ int valueTypeIndex = linkedSeriesName.IndexOf(":", StringComparison.Ordinal);
+ if(valueTypeIndex >= 0)
+ {
+ valueName = linkedSeriesName.Substring(valueTypeIndex + 1);
+ linkedSeriesName = linkedSeriesName.Substring(0, valueTypeIndex);
+ }
+
+ // Get reference to the chart control
+ Chart control = errorBarSeries.Chart;
+ if(control != null)
+ {
+ // Get linked series and check existance
+ if(control.Series.IndexOf(linkedSeriesName) == -1)
+ {
+ throw (new InvalidOperationException(SR.ExceptionDataSeriesNameNotFound(linkedSeriesName)));
+ }
+ Series linkedSeries = control.Series[linkedSeriesName];
+
+ // Make sure we use the same X and Y axis as the linked series
+ errorBarSeries.XAxisType = linkedSeries.XAxisType;
+ errorBarSeries.YAxisType = linkedSeries.YAxisType;
+
+ // Get cennter values from the linked series
+ errorBarSeries.Points.Clear();
+ foreach(DataPoint point in linkedSeries.Points)
+ {
+ // Add new point into the collection
+ errorBarSeries.Points.AddXY(point.XValue, point.GetValueByName(valueName));
+ }
+ }
+
+ }
+
+ #endregion
+
+ #region SmartLabelStyle methods
+
+ /// <summary>
+ /// Adds markers position to the list. Used to check SmartLabelStyle overlapping.
+ /// </summary>
+ /// <param name="common">Common chart elements.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="series">Series values to be used.</param>
+ /// <param name="list">List to add to.</param>
+ public void AddSmartLabelMarkerPositions(CommonElements common, ChartArea area, Series series, ArrayList list)
+ {
+ // No data point markers supported for SmartLabelStyle
+ }
+
+ #endregion
+
+ #region IDisposable interface implementation
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected virtual void Dispose(bool disposing)
+ {
+ //Nothing to dispose at the base class.
+ }
+
+ /// <summary>
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// </summary>
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+ #endregion
+ }
+}
+
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/FastLineChart.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/FastLineChart.cs
new file mode 100644
index 00000000000..2beee4626b1
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/FastLineChart.cs
@@ -0,0 +1,738 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: FastLineChart.cs
+//
+// Namespace: DataVisualization.Charting.ChartTypes
+//
+// Classes: FastLineChart
+//
+// Purpose: When performance is critical, the FastLine chart
+// type is a good alternative to the Line chart. FastLine
+// charts significantly reduce the drawing time of a
+// series that contains a very large number of data points.
+//
+// To make the FastLine chart a high performance chart,
+// some charting features have been omitted. The features
+// omitted include the ability to control Point level
+// visual properties, the ability to draw markers, the
+// use of data point labels, shadows, and the use of
+// chart animation.
+//
+// FastLine chart performance was improved by limiting
+// visual appearance features and by introducing data
+// point compacting algorithm. When chart contains
+// thousands of data points, it is common to have tens
+// or hundreds points displayed in the area comparable
+// to a single pixel. FastLine algorithm accumulates
+// point information and only draw points if they extend
+// outside currently filled pixels.
+//
+// Reviewed: AG - Microsoft 6, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Collections;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Globalization;
+
+#if Microsoft_CONTROL
+using System.Windows.Forms.DataVisualization.Charting.Utilities;
+#else
+using System.Web.UI.DataVisualization.Charting;
+
+using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.ChartTypes
+#else
+namespace System.Web.UI.DataVisualization.Charting.ChartTypes
+#endif
+{
+ /// <summary>
+ /// FastLineChart class implements a simplified line chart drawing
+ /// algorithm which is optimized for the performance.
+ /// </summary>
+ internal class FastLineChart : IChartType
+ {
+ #region Fields and Constructor
+
+ /// <summary>
+ /// Indicates that chart is drawn in 3D area
+ /// </summary>
+ internal bool chartArea3DEnabled = false;
+
+ /// <summary>
+ /// Current chart graphics
+ /// </summary>
+ internal ChartGraphics Graph { get; set; }
+
+ /// <summary>
+ /// Z coordinate of the 3D series
+ /// </summary>
+ internal float seriesZCoordinate = 0f;
+
+ /// <summary>
+ /// 3D transformation matrix
+ /// </summary>
+ internal Matrix3D matrix3D = null;
+
+ /// <summary>
+ /// Reference to common chart elements
+ /// </summary>
+ internal CommonElements Common { get; set; }
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public FastLineChart()
+ {
+ }
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ virtual public string Name { get{ return ChartTypeNames.FastLine;}}
+
+ /// <summary>
+ /// True if chart type is stacked
+ /// </summary>
+ virtual public bool Stacked { get{ return false;}}
+
+
+ /// <summary>
+ /// True if stacked chart type supports groups
+ /// </summary>
+ virtual public bool SupportStackedGroups { get { return false; } }
+
+
+ /// <summary>
+ /// True if stacked chart type should draw separately positive and
+ /// negative data points ( Bar and column Stacked types ).
+ /// </summary>
+ public bool StackSign { get{ return false;}}
+
+ /// <summary>
+ /// True if chart type supports axeses
+ /// </summary>
+ virtual public bool RequireAxes { get{ return true;} }
+
+ /// <summary>
+ /// Chart type with two y values used for scale ( bubble chart type )
+ /// </summary>
+ virtual public bool SecondYScale{ get{ return false;} }
+
+ /// <summary>
+ /// True if chart type requires circular chart area.
+ /// </summary>
+ public bool CircularChartArea { get{ return false;} }
+
+ /// <summary>
+ /// True if chart type supports logarithmic axes
+ /// </summary>
+ virtual public bool SupportLogarithmicAxes { get{ return true;} }
+
+ /// <summary>
+ /// True if chart type requires to switch the value (Y) axes position
+ /// </summary>
+ virtual public bool SwitchValueAxes { get{ return false;} }
+
+ /// <summary>
+ /// True if chart series can be placed side-by-side.
+ /// </summary>
+ virtual public bool SideBySideSeries { get{ return false;} }
+
+ /// <summary>
+ /// True if each data point of a chart must be represented in the legend
+ /// </summary>
+ virtual public bool DataPointsInLegend { get{ return false;} }
+
+ /// <summary>
+ /// If the crossing value is auto Crossing value should be
+ /// automatically set to zero for some chart
+ /// types (Bar, column, area etc.)
+ /// </summary>
+ virtual public bool ZeroCrossing { get{ return false;} }
+
+ /// <summary>
+ /// True if palette colors should be applied for each data paoint.
+ /// Otherwise the color is applied to the series.
+ /// </summary>
+ virtual public bool ApplyPaletteColorsToPoints { get { return false; } }
+
+ /// <summary>
+ /// Indicates that extra Y values are connected to the scale of the Y axis
+ /// </summary>
+ virtual public bool ExtraYValuesConnectedToYAxis{ get { return false; } }
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ virtual public bool HundredPercent{ get{return false;} }
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ virtual public bool HundredPercentSupportNegative{ get{return false;} }
+
+ /// <summary>
+ /// How to draw series/points in legend:
+ /// Filled rectangle, Line or Marker
+ /// </summary>
+ /// <param name="series">Legend item series.</param>
+ /// <returns>Legend item style.</returns>
+ virtual public LegendImageStyle GetLegendImageStyle(Series series)
+ {
+ return LegendImageStyle.Line;
+ }
+
+ /// <summary>
+ /// Number of supported Y value(s) per point
+ /// </summary>
+ virtual public int YValuesPerPoint { get { return 1; } }
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ virtual public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+
+ #endregion
+
+ #region Painting
+
+ /// <summary>
+ /// Paint FastLine Chart.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ virtual public void Paint(
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ Series seriesToDraw )
+ {
+ this.Common = common;
+ this.Graph = graph;
+ bool clipRegionSet = false;
+ if(area.Area3DStyle.Enable3D)
+ {
+ // Initialize variables
+ this.chartArea3DEnabled = true;
+ matrix3D = area.matrix3D;
+ }
+ else
+ {
+ this.chartArea3DEnabled = false;
+ }
+
+ //************************************************************
+ //** Loop through all series
+ //************************************************************
+ foreach( Series series in common.DataManager.Series )
+ {
+ // Process non empty series of the area with FastLine chart type
+ if( String.Compare( series.ChartTypeName, this.Name, true, System.Globalization.CultureInfo.CurrentCulture ) != 0
+ || series.ChartArea != area.Name ||
+ !series.IsVisible())
+ {
+ continue;
+ }
+
+ // Get 3D series depth and Z position
+ if(this.chartArea3DEnabled)
+ {
+ float seriesDepth;
+ area.GetSeriesZPositionAndDepth(series, out seriesDepth, out seriesZCoordinate);
+ this.seriesZCoordinate += seriesDepth/2.0f;
+ }
+
+ // Set active horizontal/vertical axis
+ Axis hAxis = area.GetAxis(AxisName.X, series.XAxisType, (area.Area3DStyle.Enable3D) ? string.Empty : series.XSubAxisName);
+ Axis vAxis = area.GetAxis(AxisName.Y, series.YAxisType, (area.Area3DStyle.Enable3D) ? string.Empty : series.YSubAxisName);
+ double hAxisMin = hAxis.ViewMinimum;
+ double hAxisMax = hAxis.ViewMaximum;
+ double vAxisMin = vAxis.ViewMinimum;
+ double vAxisMax = vAxis.ViewMaximum;
+
+ // Get "PermittedPixelError" attribute
+ float permittedPixelError = 1.0f;
+ if (series.IsCustomPropertySet(CustomPropertyName.PermittedPixelError))
+ {
+ string attrValue = series[CustomPropertyName.PermittedPixelError];
+
+ float pixelError;
+ bool parseSucceed = float.TryParse(attrValue, NumberStyles.Any, CultureInfo.CurrentCulture, out pixelError);
+
+ if (parseSucceed)
+ {
+ permittedPixelError = pixelError;
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid2("PermittedPixelError")));
+ }
+
+ // "PermittedPixelError" attribute value should be in range from zero to 1
+ if (permittedPixelError < 0f || permittedPixelError > 1f)
+ {
+ throw (new InvalidOperationException(SR.ExceptionCustomAttributeIsNotInRange0to1("PermittedPixelError")));
+ }
+ }
+
+ // Get pixel size in axes coordinates
+ SizeF pixelSize = graph.GetRelativeSize(new SizeF(permittedPixelError, permittedPixelError));
+ SizeF axesMin = graph.GetRelativeSize(new SizeF((float)hAxisMin, (float)vAxisMin));
+ double axesValuesPixelSizeX = Math.Abs(hAxis.PositionToValue(axesMin.Width + pixelSize.Width, false) - hAxis.PositionToValue(axesMin.Width, false));
+
+ // Create line pen
+ Pen linePen = new Pen(series.Color, series.BorderWidth);
+ linePen.DashStyle = graph.GetPenStyle( series.BorderDashStyle );
+ linePen.StartCap = LineCap.Round;
+ linePen.EndCap = LineCap.Round;
+
+ // Create empty line pen
+ Pen emptyLinePen = new Pen(series.EmptyPointStyle.Color, series.EmptyPointStyle.BorderWidth);
+ emptyLinePen.DashStyle = graph.GetPenStyle( series.EmptyPointStyle.BorderDashStyle );
+ emptyLinePen.StartCap = LineCap.Round;
+ emptyLinePen.EndCap = LineCap.Round;
+
+ // Check if series is indexed
+ bool indexedSeries = ChartHelper.IndexedSeries(this.Common, series.Name );
+
+ // Loop through all ponts in the series
+ int index = 0;
+ double yValueRangeMin = double.NaN;
+ double yValueRangeMax = double.NaN;
+ DataPoint pointRangeMin = null;
+ DataPoint pointRangeMax = null;
+ double xValue = 0;
+ double yValue = 0;
+ double xValuePrev = 0;
+ double yValuePrev = 0;
+ DataPoint prevDataPoint = null;
+ PointF lastVerticalSegmentPoint = PointF.Empty;
+ PointF prevPoint = PointF.Empty;
+ PointF currentPoint = PointF.Empty;
+ bool prevPointInAxesCoordinates = false;
+ bool verticalLineDetected = false;
+ bool prevPointIsEmpty = false;
+ bool currentPointIsEmpty = false;
+ bool firstNonEmptyPoint = false;
+ double xPixelConverter = (graph.Common.ChartPicture.Width - 1.0) / 100.0;
+ double yPixelConverter = (graph.Common.ChartPicture.Height - 1.0) / 100.0;
+ foreach( DataPoint point in series.Points )
+ {
+ // Get point X and Y values
+ xValue = (indexedSeries) ? index + 1 : point.XValue;
+ xValue = hAxis.GetLogValue(xValue);
+ yValue = vAxis.GetLogValue(point.YValues[0]);
+ currentPointIsEmpty = point.IsEmpty;
+
+ // NOTE: Fixes issue #7094
+ // If current point is non-empty but the previous one was,
+ // use empty point style properties to draw it.
+ if (prevPointIsEmpty && !currentPointIsEmpty && !firstNonEmptyPoint)
+ {
+ firstNonEmptyPoint = true;
+ currentPointIsEmpty = true;
+ }
+ else
+ {
+ firstNonEmptyPoint = false;
+ }
+
+ // Check if line is completly out of the data scaleView
+ if( !verticalLineDetected &&
+ ((xValue < hAxisMin && xValuePrev < hAxisMin) ||
+ (xValue > hAxisMax && xValuePrev > hAxisMax) ||
+ (yValue < vAxisMin && yValuePrev < vAxisMin) ||
+ (yValue > vAxisMax && yValuePrev > vAxisMax) ))
+ {
+ xValuePrev = xValue;
+ yValuePrev = yValue;
+ prevPointInAxesCoordinates = true;
+ ++index;
+ continue;
+ }
+ else if(!clipRegionSet)
+ {
+ // Check if line is partialy in the data scaleView
+ if(xValuePrev < hAxisMin || xValuePrev > hAxisMax ||
+ xValue > hAxisMax || xValue < hAxisMin ||
+ yValuePrev < vAxisMin || yValuePrev > vAxisMax ||
+ yValue < vAxisMin || yValue > vAxisMax )
+ {
+ // Set clipping region for line drawing
+ graph.SetClip( area.PlotAreaPosition.ToRectangleF() );
+ clipRegionSet = true;
+ }
+ }
+
+ // Check if point may be skipped
+ if(index > 0 &&
+ currentPointIsEmpty == prevPointIsEmpty)
+ {
+ // Check if points X value in acceptable error boundary
+ if( Math.Abs(xValue - xValuePrev) < axesValuesPixelSizeX)
+ {
+ if(!verticalLineDetected)
+ {
+ verticalLineDetected = true;
+ if(yValue > yValuePrev)
+ {
+ yValueRangeMax = yValue;
+ yValueRangeMin = yValuePrev;
+ pointRangeMax = point;
+ pointRangeMin = prevDataPoint;
+ }
+ else
+ {
+ yValueRangeMax = yValuePrev;
+ yValueRangeMin = yValue;
+ pointRangeMax = prevDataPoint;
+ pointRangeMin = point;
+ }
+
+ // NOTE: Prev. version code - A.G.
+// yValueRangeMin = Math.Min(yValue, yValuePrev);
+// yValueRangeMax = Math.Max(yValue, yValuePrev);
+ }
+ else
+ {
+ if(yValue > yValueRangeMax)
+ {
+ yValueRangeMax = yValue;
+ pointRangeMax = point;
+ }
+
+ else if(yValue < yValueRangeMin)
+ {
+ yValueRangeMin = yValue;
+ pointRangeMin = point;
+ }
+
+ // NOTE: Prev. version code - A.G.
+// yValueRangeMin = Math.Min(yValue, yValueRangeMin);
+// yValueRangeMax = Math.Max(yValue, yValueRangeMax);
+ }
+
+ // Remember last point
+ prevDataPoint = point;
+
+ // Remember last vertical range point
+ // Note! Point is in axes coordinate.
+ lastVerticalSegmentPoint.Y = (float)yValue;
+
+ // Increase counter and proceed to next data point
+ ++index;
+ continue;
+ }
+ }
+
+ // Get point pixel position
+ currentPoint.X = (float)
+ (hAxis.GetLinearPosition( xValue ) * xPixelConverter);
+ currentPoint.Y = (float)
+ (vAxis.GetLinearPosition( yValue ) * yPixelConverter);
+
+ // Check if previous point must be converted from axes values to pixels
+ if(prevPointInAxesCoordinates)
+ {
+ prevPoint.X = (float)
+ (hAxis.GetLinearPosition( xValuePrev ) * xPixelConverter);
+ prevPoint.Y = (float)
+ (vAxis.GetLinearPosition( yValuePrev ) * yPixelConverter);
+ }
+
+ // Draw accumulated vertical line (with minimal X values differences)
+ if(verticalLineDetected)
+ {
+ // Convert Y coordinates to pixels
+ yValueRangeMin = (vAxis.GetLinearPosition( yValueRangeMin ) * yPixelConverter);
+ yValueRangeMax = (vAxis.GetLinearPosition( yValueRangeMax ) * yPixelConverter);
+
+ // Draw accumulated vertical line
+ DrawLine(
+ series,
+ prevDataPoint,
+ pointRangeMin,
+ pointRangeMax,
+ index,
+ (prevPointIsEmpty) ? emptyLinePen : linePen,
+ prevPoint.X,
+ (float)yValueRangeMin,
+ prevPoint.X,
+ (float)yValueRangeMax);
+
+ // Reset vertical line detected flag
+ verticalLineDetected = false;
+
+ // Convert last point of the vertical line segment to pixel coordinates
+ prevPoint.Y = (float)
+ (vAxis.GetLinearPosition( lastVerticalSegmentPoint.Y ) * yPixelConverter);
+ }
+
+ // Draw line from previous to current point
+ if(index > 0)
+ {
+ DrawLine(
+ series,
+ point,
+ pointRangeMin,
+ pointRangeMax,
+ index,
+ (currentPointIsEmpty) ? emptyLinePen : linePen,
+ prevPoint.X,
+ prevPoint.Y,
+ currentPoint.X,
+ currentPoint.Y);
+ }
+
+ // Remember last point coordinates
+ xValuePrev = xValue;
+ yValuePrev = yValue;
+ prevDataPoint = point;
+ prevPoint = currentPoint;
+ prevPointInAxesCoordinates = false;
+ prevPointIsEmpty = currentPointIsEmpty;
+ ++index;
+ }
+
+ // Draw last accumulated line segment
+ if(verticalLineDetected)
+ {
+ // Check if previous point must be converted from axes values to pixels
+ if(prevPointInAxesCoordinates)
+ {
+ prevPoint.X = (float)
+ (hAxis.GetLinearPosition( xValuePrev ) * xPixelConverter);
+ prevPoint.Y = (float)
+ (vAxis.GetLinearPosition( yValuePrev ) * yPixelConverter);
+ }
+
+ // Convert Y coordinates to pixels
+ yValueRangeMin = (vAxis.GetLinearPosition( yValueRangeMin ) * yPixelConverter);
+ yValueRangeMax = (vAxis.GetLinearPosition( yValueRangeMax ) * yPixelConverter);
+
+ // Draw accumulated vertical line
+ DrawLine(
+ series,
+ prevDataPoint,
+ pointRangeMin,
+ pointRangeMax,
+ index - 1,
+ (prevPointIsEmpty) ? emptyLinePen : linePen,
+ prevPoint.X,
+ (float)yValueRangeMin,
+ prevPoint.X,
+ (float)yValueRangeMax);
+
+ verticalLineDetected = false;
+ yValueRangeMin = double.NaN;
+ yValueRangeMax = double.NaN;
+ pointRangeMin = null;
+ pointRangeMax = null;
+ }
+
+ }
+
+ // Reset Clip Region
+ if(clipRegionSet)
+ {
+ graph.ResetClip();
+ }
+
+ }
+
+ /// <summary>
+ /// Draws a line connecting two PointF structures.
+ /// </summary>
+ /// <param name="series">Chart series.</param>
+ /// <param name="point">Series last data point in the group.</param>
+ /// <param name="pointMin">Series minimum Y value data point in the group.</param>
+ /// <param name="pointMax">Series maximum Y value data point in the group.</param>
+ /// <param name="pointIndex">Point index.</param>
+ /// <param name="pen">Pen object that determines the color, width, and style of the line.</param>
+ /// <param name="firstPointX">First point X coordinate.</param>
+ /// <param name="firstPointY">First point Y coordinate</param>
+ /// <param name="secondPointX">Second point X coordinate.</param>
+ /// <param name="secondPointY">Second point Y coordinate</param>
+ public virtual void DrawLine(
+ Series series,
+ DataPoint point,
+ DataPoint pointMin,
+ DataPoint pointMax,
+ int pointIndex,
+ Pen pen,
+ float firstPointX,
+ float firstPointY,
+ float secondPointX,
+ float secondPointY
+ )
+ {
+ // Transform 3D coordinates
+ if(chartArea3DEnabled)
+ {
+ Point3D [] points = new Point3D[2];
+
+ // All coordinates has to be transformed in relative coordinate system
+ // NOTE: Fixes issue #5496
+ PointF firstPoint = Graph.GetRelativePoint(new PointF(firstPointX, firstPointY));
+ PointF secondPoint = Graph.GetRelativePoint(new PointF(secondPointX, secondPointY));
+
+ points[0] = new Point3D(firstPoint.X, firstPoint.Y, seriesZCoordinate);
+ points[1] = new Point3D(secondPoint.X, secondPoint.Y, seriesZCoordinate);
+ matrix3D.TransformPoints( points );
+
+ // All coordinates has to be transformed back to pixels
+ // NOTE: Fixes issue #5496
+ points[0].PointF = Graph.GetAbsolutePoint(points[0].PointF);
+ points[1].PointF = Graph.GetAbsolutePoint(points[1].PointF);
+
+ firstPointX = points[0].X;
+ firstPointY = points[0].Y;
+ secondPointX = points[1].X;
+ secondPointY = points[1].Y;
+ }
+
+ // Draw line
+ Graph.DrawLine(pen, firstPointX, firstPointY, secondPointX,secondPointY);
+
+ // Process selection regions
+ if( this.Common.ProcessModeRegions )
+ {
+ // Create grapics path object for the line
+ using (GraphicsPath path = new GraphicsPath())
+ {
+ float width = pen.Width + 2;
+
+ if (Math.Abs(firstPointX - secondPointX) > Math.Abs(firstPointY - secondPointY))
+ {
+ path.AddLine(firstPointX, firstPointY - width, secondPointX, secondPointY - width);
+ path.AddLine(secondPointX, secondPointY + width, firstPointX, firstPointY + width);
+ path.CloseAllFigures();
+ }
+ else
+ {
+ path.AddLine(firstPointX - width, firstPointY, secondPointX - width, secondPointY);
+ path.AddLine(secondPointX + width, secondPointY, firstPointX + width, firstPointY);
+ path.CloseAllFigures();
+ }
+
+ // Calculate bounding rectangle
+ RectangleF pathBounds = path.GetBounds();
+
+ // If one side of the bounding rectangle is less than 2 pixels
+ // use rectangle region shape to optimize used coordinates space
+ if (pathBounds.Width <= 2.0 || pathBounds.Height <= 2.0)
+ {
+ // Add hot region path as rectangle
+ pathBounds.Inflate(pen.Width, pen.Width);
+ this.Common.HotRegionsList.AddHotRegion(
+ Graph.GetRelativeRectangle(pathBounds),
+ point,
+ point.series.Name,
+ pointIndex);
+ }
+ else
+ {
+ // Add hot region path as polygon
+ this.Common.HotRegionsList.AddHotRegion(
+ path,
+ false,
+ Graph,
+ point,
+ point.series.Name,
+ pointIndex);
+ }
+ }
+ }
+ }
+
+ #endregion
+
+ #region Y values related methods
+
+ /// <summary>
+ /// Helper function, which returns the Y value of the point.
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="area">Chart area the series belongs to.</param>
+ /// <param name="series">Sereis of the point.</param>
+ /// <param name="point">Point object.</param>
+ /// <param name="pointIndex">Index of the point.</param>
+ /// <param name="yValueIndex">Index of the Y value to get.</param>
+ /// <returns>Y value of the point.</returns>
+ virtual public double GetYValue(
+ CommonElements common,
+ ChartArea area,
+ Series series,
+ DataPoint point,
+ int pointIndex,
+ int yValueIndex)
+ {
+ return point.YValues[yValueIndex];
+ }
+
+ #endregion
+
+ #region SmartLabelStyle methods
+
+ /// <summary>
+ /// Adds markers position to the list. Used to check SmartLabelStyle overlapping.
+ /// </summary>
+ /// <param name="common">Common chart elements.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="series">Series values to be used.</param>
+ /// <param name="list">List to add to.</param>
+ public void AddSmartLabelMarkerPositions(CommonElements common, ChartArea area, Series series, ArrayList list)
+ {
+ // Fast Line chart type do not support labels
+ }
+
+ #endregion
+
+ #region IDisposable interface implementation
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected virtual void Dispose(bool disposing)
+ {
+ //Nothing to dispose at the base class.
+ }
+
+ /// <summary>
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// </summary>
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/FastPointChart.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/FastPointChart.cs
new file mode 100644
index 00000000000..16724763112
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/FastPointChart.cs
@@ -0,0 +1,700 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: FastPointChart.cs
+//
+// Namespace: DataVisualization.Charting.ChartTypes
+//
+// Classes: FastPointChart
+//
+// Purpose: When performance is critical, the FastPoint chart
+// type is a good alternative to the Point chart. FastPoint
+// charts significantly reduce the drawing time of a
+// series that contains a very large number of data points.
+//
+// To make the FastPoint chart a high performance chart,
+// some charting features have been omitted. The features
+// omitted include the ability to control Point level
+// visual properties the use of data point labels, shadows,
+// and the use of chart animation.
+//
+// FastPoint chart performance was improved by limiting
+// visual appearance features and by introducing data
+// point compacting algorithm. When chart contains
+// thousands of data points, it is common to have tens
+// or hundreds points displayed in the area comparable
+// to a single pixel. FastPoint algorithm accumulates
+// point information and only draw points if they extend
+// outside currently filled pixels.
+//
+// Reviewed: AG - Microsoft 6, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Collections;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Globalization;
+
+#if Microsoft_CONTROL
+using System.Windows.Forms.DataVisualization.Charting.Utilities;
+#else
+using System.Web.UI.DataVisualization.Charting;
+
+using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.ChartTypes
+#else
+namespace System.Web.UI.DataVisualization.Charting.ChartTypes
+#endif
+{
+
+ /// <summary>
+ /// FastPointChart class implements a simplified point chart drawing
+ /// algorithm which is optimized for the performance.
+ /// </summary>
+ internal class FastPointChart : IChartType
+ {
+ #region Fields and Constructor
+
+ /// <summary>
+ /// Indicates that chart is drawn in 3D area
+ /// </summary>
+ internal bool chartArea3DEnabled = false;
+
+ /// <summary>
+ /// Current chart graphics
+ /// </summary>
+ internal ChartGraphics Graph { get; set; }
+
+ /// <summary>
+ /// Z coordinate of the 3D series
+ /// </summary>
+ internal float seriesZCoordinate = 0f;
+
+ /// <summary>
+ /// 3D transformation matrix
+ /// </summary>
+ internal Matrix3D matrix3D = null;
+
+ /// <summary>
+ /// Reference to common chart elements
+ /// </summary>
+ internal CommonElements Common { get; set; }
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public FastPointChart()
+ {
+ }
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ virtual public string Name { get{ return ChartTypeNames.FastPoint;}}
+
+ /// <summary>
+ /// True if chart type is stacked
+ /// </summary>
+ virtual public bool Stacked { get{ return false;}}
+
+
+ /// <summary>
+ /// True if stacked chart type supports groups
+ /// </summary>
+ virtual public bool SupportStackedGroups { get { return false; } }
+
+
+ /// <summary>
+ /// True if stacked chart type should draw separately positive and
+ /// negative data points ( Bar and column Stacked types ).
+ /// </summary>
+ public bool StackSign { get{ return false;}}
+
+ /// <summary>
+ /// True if chart type supports axeses
+ /// </summary>
+ virtual public bool RequireAxes { get{ return true;} }
+
+ /// <summary>
+ /// Chart type with two y values used for scale ( bubble chart type )
+ /// </summary>
+ virtual public bool SecondYScale{ get{ return false;} }
+
+ /// <summary>
+ /// True if chart type requires circular chart area.
+ /// </summary>
+ public bool CircularChartArea { get{ return false;} }
+
+ /// <summary>
+ /// True if chart type supports logarithmic axes
+ /// </summary>
+ virtual public bool SupportLogarithmicAxes { get{ return true;} }
+
+ /// <summary>
+ /// True if chart type requires to switch the value (Y) axes position
+ /// </summary>
+ virtual public bool SwitchValueAxes { get{ return false;} }
+
+ /// <summary>
+ /// True if chart series can be placed side-by-side.
+ /// </summary>
+ virtual public bool SideBySideSeries { get{ return false;} }
+
+ /// <summary>
+ /// True if each data point of a chart must be represented in the legend
+ /// </summary>
+ virtual public bool DataPointsInLegend { get{ return false;} }
+
+ /// <summary>
+ /// If the crossing value is auto Crossing value should be
+ /// automatically set to zero for some chart
+ /// types (Bar, column, area etc.)
+ /// </summary>
+ virtual public bool ZeroCrossing { get{ return false;} }
+
+ /// <summary>
+ /// True if palette colors should be applied for each data paoint.
+ /// Otherwise the color is applied to the series.
+ /// </summary>
+ virtual public bool ApplyPaletteColorsToPoints { get { return false; } }
+
+ /// <summary>
+ /// Indicates that extra Y values are connected to the scale of the Y axis
+ /// </summary>
+ virtual public bool ExtraYValuesConnectedToYAxis{ get { return false; } }
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ virtual public bool HundredPercent{ get{return false;} }
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ virtual public bool HundredPercentSupportNegative{ get{return false;} }
+
+ /// <summary>
+ /// How to draw series/points in legend:
+ /// Filled rectangle, Line or Marker
+ /// </summary>
+ /// <param name="series">Legend item series.</param>
+ /// <returns>Legend item style.</returns>
+ virtual public LegendImageStyle GetLegendImageStyle(Series series)
+ {
+ return LegendImageStyle.Marker;
+ }
+
+ /// <summary>
+ /// Number of supported Y value(s) per point
+ /// </summary>
+ virtual public int YValuesPerPoint { get { return 1; } }
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ virtual public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+
+ #endregion
+
+ #region Painting
+
+ /// <summary>
+ /// Paint FastPoint Chart.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ virtual public void Paint(
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ Series seriesToDraw )
+ {
+ this.Common = common;
+ this.Graph = graph;
+ if(area.Area3DStyle.Enable3D)
+ {
+ // Initialize variables
+ this.chartArea3DEnabled = true;
+ matrix3D = area.matrix3D;
+ }
+ else
+ {
+ this.chartArea3DEnabled = false;
+ }
+
+ //************************************************************
+ //** Loop through all series
+ //************************************************************
+ foreach( Series series in common.DataManager.Series )
+ {
+ // Process non empty series of the area with FastPoint chart type
+ if( String.Compare( series.ChartTypeName, this.Name, true, System.Globalization.CultureInfo.CurrentCulture ) != 0
+ || series.ChartArea != area.Name ||
+ !series.IsVisible())
+ {
+ continue;
+ }
+
+ // Get 3D series depth and Z position
+ if(this.chartArea3DEnabled)
+ {
+ float seriesDepth;
+ area.GetSeriesZPositionAndDepth(series, out seriesDepth, out this.seriesZCoordinate);
+ this.seriesZCoordinate += seriesDepth/2.0f;
+ }
+
+ // Set active horizontal/vertical axis
+ Axis hAxis = area.GetAxis(AxisName.X, series.XAxisType, (area.Area3DStyle.Enable3D) ? string.Empty : series.XSubAxisName);
+ Axis vAxis = area.GetAxis(AxisName.Y, series.YAxisType, (area.Area3DStyle.Enable3D) ? string.Empty : series.YSubAxisName);
+ double hAxisMin = hAxis.ViewMinimum;
+ double hAxisMax = hAxis.ViewMaximum;
+ double vAxisMin = vAxis.ViewMinimum;
+ double vAxisMax = vAxis.ViewMaximum;
+
+ // Get "PermittedPixelError" attribute.
+ // By default use 1/3 of the marker size.
+ float permittedPixelError = series.MarkerSize / 3f;
+ if (series.IsCustomPropertySet(CustomPropertyName.PermittedPixelError))
+ {
+ string attrValue = series[CustomPropertyName.PermittedPixelError];
+
+ float pixelError;
+ bool parseSucceed = float.TryParse(attrValue, NumberStyles.Any, CultureInfo.CurrentCulture, out pixelError);
+
+ if (parseSucceed)
+ {
+ permittedPixelError = pixelError;
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid2("PermittedPixelError")));
+ }
+
+ // "PermittedPixelError" attribute value should be in range from zero to 1
+ if (permittedPixelError < 0f || permittedPixelError > 1f)
+ {
+ throw (new InvalidOperationException(SR.ExceptionCustomAttributeIsNotInRange0to1("PermittedPixelError")));
+ }
+ }
+
+ // Get pixel size in axes coordinates
+ SizeF pixelSize = graph.GetRelativeSize(new SizeF(permittedPixelError, permittedPixelError));
+ SizeF axesMin = graph.GetRelativeSize(new SizeF((float)hAxisMin, (float)vAxisMin));
+ double axesValuesPixelSizeX = Math.Abs(hAxis.PositionToValue(axesMin.Width + pixelSize.Width, false) - hAxis.PositionToValue(axesMin.Width, false));
+ double axesValuesPixelSizeY = Math.Abs(vAxis.PositionToValue(axesMin.Height + pixelSize.Height, false) - vAxis.PositionToValue(axesMin.Height, false));
+
+ // Create point marker brush
+ SolidBrush markerBrush = new SolidBrush( ((series.MarkerColor.IsEmpty) ? series.Color : series.MarkerColor) );
+ SolidBrush emptyMarkerBrush = new SolidBrush( ((series.EmptyPointStyle.MarkerColor.IsEmpty) ? series.EmptyPointStyle.Color : series.EmptyPointStyle.MarkerColor) );
+
+ // Create point marker border pen
+ Pen borderPen = null;
+ Pen emptyBorderPen = null;
+ if(!series.MarkerBorderColor.IsEmpty && series.MarkerBorderWidth > 0)
+ {
+ borderPen = new Pen(series.MarkerBorderColor, series.MarkerBorderWidth);
+ }
+ if(!series.EmptyPointStyle.MarkerBorderColor.IsEmpty && series.EmptyPointStyle.MarkerBorderWidth > 0)
+ {
+ emptyBorderPen = new Pen(series.EmptyPointStyle.MarkerBorderColor, series.EmptyPointStyle.MarkerBorderWidth);
+ }
+
+ // Check if series is indexed
+ bool indexedSeries = ChartHelper.IndexedSeries(this.Common, series.Name );
+
+ // Get marker size taking in consideration current DPIs
+ int markerSize = series.MarkerSize;
+ if (graph != null && graph.Graphics != null)
+ {
+ // Marker size is in pixels and we do the mapping for higher DPIs
+ markerSize = (int)Math.Max(markerSize * graph.Graphics.DpiX / 96, markerSize * graph.Graphics.DpiY / 96);
+ }
+
+ // Loop through all ponts in the series
+ int index = 0;
+ double xValue = 0.0;
+ double yValue = 0.0;
+ double xValuePrev = 0.0;
+ double yValuePrev = 0.0;
+ PointF currentPoint = PointF.Empty;
+ bool currentPointIsEmpty = false;
+ double xPixelConverter = (graph.Common.ChartPicture.Width - 1.0) / 100.0;
+ double yPixelConverter = (graph.Common.ChartPicture.Height - 1.0) / 100.0;
+ MarkerStyle markerStyle = series.MarkerStyle;
+ MarkerStyle emptyMarkerStyle = series.EmptyPointStyle.MarkerStyle;
+ foreach( DataPoint point in series.Points )
+ {
+ // Get point X and Y values
+ xValue = (indexedSeries) ? index + 1 : point.XValue;
+ xValue = hAxis.GetLogValue(xValue);
+ yValue = vAxis.GetLogValue(point.YValues[0]);
+ currentPointIsEmpty = point.IsEmpty;
+
+ // Check if point is completly out of the data scaleView
+ if( xValue < hAxisMin ||
+ xValue > hAxisMax ||
+ yValue < vAxisMin ||
+ yValue > vAxisMax )
+ {
+ xValuePrev = xValue;
+ yValuePrev = yValue;
+ ++index;
+ continue;
+ }
+
+ // Check if point may be skipped
+ if(index > 0)
+ {
+ // Check if current point location is in the specified distance from the
+ // preious data location.
+ if(Math.Abs(xValue - xValuePrev) < axesValuesPixelSizeX &&
+ Math.Abs(yValue - yValuePrev) < axesValuesPixelSizeY)
+ {
+ // Increase counter and proceed to the next data point
+ ++index;
+ continue;
+ }
+ }
+
+ // Get point pixel position
+ currentPoint.X = (float)
+ (hAxis.GetLinearPosition( xValue ) * xPixelConverter);
+ currentPoint.Y = (float)
+ (vAxis.GetLinearPosition( yValue ) * yPixelConverter);
+
+ // Draw point marker
+ MarkerStyle currentMarkerStyle = (currentPointIsEmpty) ? emptyMarkerStyle : markerStyle;
+ if(currentMarkerStyle != MarkerStyle.None)
+ {
+ this.DrawMarker(
+ graph,
+ point,
+ index,
+ currentPoint,
+ currentMarkerStyle,
+ markerSize,
+ (currentPointIsEmpty) ? emptyMarkerBrush : markerBrush,
+ (currentPointIsEmpty) ? emptyBorderPen : borderPen);
+ }
+
+ // Remember last point coordinates
+ xValuePrev = xValue;
+ yValuePrev = yValue;
+ ++index;
+ }
+
+ // Dispose used brushes and pens
+ markerBrush.Dispose();
+ emptyMarkerBrush.Dispose();
+ if(borderPen != null)
+ {
+ borderPen.Dispose();
+ }
+ if(emptyBorderPen != null)
+ {
+ emptyBorderPen.Dispose();
+ }
+ }
+ }
+
+ /// <summary>
+ /// Draws a marker that represents a data point in FastPoint series.
+ /// </summary>
+ /// <param name="graph">Chart graphics used to draw the marker.</param>
+ /// <param name="point">Series data point drawn.</param>
+ /// <param name="pointIndex">Data point index in the series.</param>
+ /// <param name="location">Marker location in pixels.</param>
+ /// <param name="markerStyle">Marker style.</param>
+ /// <param name="markerSize">Marker size in pixels.</param>
+ /// <param name="brush">Brush used to fill marker shape.</param>
+ /// <param name="borderPen">Marker border pen.</param>
+ virtual protected void DrawMarker(
+ ChartGraphics graph,
+ DataPoint point,
+ int pointIndex,
+ PointF location,
+ MarkerStyle markerStyle,
+ int markerSize,
+ Brush brush,
+ Pen borderPen)
+ {
+ // Transform 3D coordinates
+ if(chartArea3DEnabled)
+ {
+ Point3D [] points = new Point3D[1];
+ location = graph.GetRelativePoint(location);
+ points[0] = new Point3D(location.X, location.Y, this.seriesZCoordinate);
+ matrix3D.TransformPoints( points );
+ location.X = points[0].X;
+ location.Y = points[0].Y;
+ location = graph.GetAbsolutePoint(location);
+ }
+
+ // Create marker bounding rectangle in pixels
+ RectangleF markerBounds = new RectangleF(
+ location.X - markerSize / 2f, location.Y - markerSize / 2f, markerSize, markerSize);
+
+ // Draw Marker
+ switch(markerStyle)
+ {
+ case(MarkerStyle.Star4):
+ case(MarkerStyle.Star5):
+ case(MarkerStyle.Star6):
+ case(MarkerStyle.Star10):
+ {
+ // Set number of corners
+ int cornerNumber = 4;
+ if(markerStyle == MarkerStyle.Star5)
+ {
+ cornerNumber = 5;
+ }
+ else if(markerStyle == MarkerStyle.Star6)
+ {
+ cornerNumber = 6;
+ }
+ else if(markerStyle == MarkerStyle.Star10)
+ {
+ cornerNumber = 10;
+ }
+
+ // Get star polygon
+ PointF[] points = graph.CreateStarPolygon(markerBounds, cornerNumber);
+
+ // Fill shape
+ graph.FillPolygon(brush, points);
+
+ // Draw border
+ if(borderPen != null)
+ {
+ graph.DrawPolygon(borderPen, points);
+ }
+ break;
+ }
+ case(MarkerStyle.Circle):
+ {
+ graph.FillEllipse(brush, markerBounds);
+
+ // Draw border
+ if(borderPen != null)
+ {
+ graph.DrawEllipse(borderPen, markerBounds);
+ }
+
+ break;
+ }
+ case(MarkerStyle.Square):
+ {
+ graph.FillRectangle(brush, markerBounds);
+
+ // Draw border
+ if(borderPen != null)
+ {
+ graph.DrawRectangle(
+ borderPen,
+ (int)Math.Round(markerBounds.X, 0),
+ (int)Math.Round(markerBounds.Y, 0),
+ (int)Math.Round(markerBounds.Width, 0),
+ (int)Math.Round(markerBounds.Height, 0) );
+ }
+
+ break;
+ }
+ case(MarkerStyle.Cross):
+ {
+ // Calculate cross line width and size
+ float crossLineWidth = (float)Math.Ceiling(markerSize/4F);
+ float crossSize = markerSize; // * (float)Math.Sin(45f/180f*Math.PI);
+
+ // Calculate cross coordinates
+ PointF[] points = new PointF[12];
+ points[0].X = location.X - crossSize/2F;
+ points[0].Y = location.Y + crossLineWidth/2F;
+ points[1].X = location.X - crossSize/2F;
+ points[1].Y = location.Y - crossLineWidth/2F;
+
+ points[2].X = location.X - crossLineWidth/2F;
+ points[2].Y = location.Y - crossLineWidth/2F;
+ points[3].X = location.X - crossLineWidth/2F;
+ points[3].Y = location.Y - crossSize/2F;
+ points[4].X = location.X + crossLineWidth/2F;
+ points[4].Y = location.Y - crossSize/2F;
+
+ points[5].X = location.X + crossLineWidth/2F;
+ points[5].Y = location.Y - crossLineWidth/2F;
+ points[6].X = location.X + crossSize/2F;
+ points[6].Y = location.Y - crossLineWidth/2F;
+ points[7].X = location.X + crossSize/2F;
+ points[7].Y = location.Y + crossLineWidth/2F;
+
+ points[8].X = location.X + crossLineWidth/2F;
+ points[8].Y = location.Y + crossLineWidth/2F;
+ points[9].X = location.X + crossLineWidth/2F;
+ points[9].Y = location.Y + crossSize/2F;
+ points[10].X = location.X - crossLineWidth/2F;
+ points[10].Y = location.Y + crossSize/2F;
+ points[11].X = location.X - crossLineWidth/2F;
+ points[11].Y = location.Y + crossLineWidth/2F;
+
+ // Rotate cross coordinates 45 degrees
+ Matrix rotationMatrix = new Matrix();
+ rotationMatrix.RotateAt(45, location);
+ rotationMatrix.TransformPoints(points);
+ rotationMatrix.Dispose();
+
+ // Fill shape
+ graph.FillPolygon(brush, points);
+
+ // Draw border
+ if(borderPen != null)
+ {
+ graph.DrawPolygon(borderPen, points);
+ }
+ break;
+ }
+ case(MarkerStyle.Diamond):
+ {
+ PointF[] points = new PointF[4];
+ points[0].X = markerBounds.X;
+ points[0].Y = markerBounds.Y + markerBounds.Height/2F;
+ points[1].X = markerBounds.X + markerBounds.Width/2F;
+ points[1].Y = markerBounds.Top;
+ points[2].X = markerBounds.Right;
+ points[2].Y = markerBounds.Y + markerBounds.Height/2F;
+ points[3].X = markerBounds.X + markerBounds.Width/2F;
+ points[3].Y = markerBounds.Bottom;
+
+ graph.FillPolygon(brush, points);
+
+ // Draw border
+ if(borderPen != null)
+ {
+ graph.DrawPolygon(borderPen, points);
+ }
+ break;
+ }
+ case(MarkerStyle.Triangle):
+ {
+ PointF[] points = new PointF[3];
+ points[0].X = markerBounds.X;
+ points[0].Y = markerBounds.Bottom;
+ points[1].X = markerBounds.X + markerBounds.Width/2F;
+ points[1].Y = markerBounds.Top;
+ points[2].X = markerBounds.Right;
+ points[2].Y = markerBounds.Bottom;
+
+ graph.FillPolygon(brush, points);
+
+ // Draw border
+ if(borderPen != null)
+ {
+ graph.DrawPolygon(borderPen, points);
+ }
+ break;
+ }
+ default:
+ {
+ throw (new InvalidOperationException(SR.ExceptionFastPointMarkerStyleUnknown));
+ }
+ }
+
+ // Process selection regions
+ if( this.Common.ProcessModeRegions )
+ {
+ this.Common.HotRegionsList.AddHotRegion(
+ graph.GetRelativeRectangle(markerBounds),
+ point,
+ point.series.Name,
+ pointIndex );
+ }
+ }
+
+ #endregion
+
+ #region Y values related methods
+
+ /// <summary>
+ /// Helper function, which returns the Y value of the location.
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="area">Chart area the series belongs to.</param>
+ /// <param name="series">Sereis of the location.</param>
+ /// <param name="point">Point object.</param>
+ /// <param name="pointIndex">Index of the location.</param>
+ /// <param name="yValueIndex">Index of the Y value to get.</param>
+ /// <returns>Y value of the location.</returns>
+ virtual public double GetYValue(
+ CommonElements common,
+ ChartArea area,
+ Series series,
+ DataPoint point,
+ int pointIndex,
+ int yValueIndex)
+ {
+ return point.YValues[yValueIndex];
+ }
+
+ #endregion
+
+ #region SmartLabelStyle methods
+
+ /// <summary>
+ /// Adds markers position to the list. Used to check SmartLabelStyle overlapping.
+ /// </summary>
+ /// <param name="common">Common chart elements.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="series">Series values to be used.</param>
+ /// <param name="list">List to add to.</param>
+ public void AddSmartLabelMarkerPositions(CommonElements common, ChartArea area, Series series, ArrayList list)
+ {
+ // Fast Point chart type do not support labels
+ }
+
+ #endregion
+
+ #region IDisposable interface implementation
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected virtual void Dispose(bool disposing)
+ {
+ //Nothing to dispose at the base class.
+ }
+
+ /// <summary>
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// </summary>
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/FunnelChart.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/FunnelChart.cs
new file mode 100644
index 00000000000..3afc18bd7ea
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/FunnelChart.cs
@@ -0,0 +1,3044 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: FunnelChart.cs
+//
+// Namespace: DataVisualization.Charting.ChartTypes
+//
+// Classes: FunnelChart, PyramidChart, FunnelSegmentInfo,
+// FunnelPointLabelInfo
+//
+// Purpose: Provides 2D/3D drawing and hit testing functionality
+// for the Funnel and Pyramid charts.
+//
+// Funnel and Pyramid Chart types display data that
+// equals 100% when totalled. This type of chart is a
+// single series chart representing the data as portions
+// of 100%, and this chart does not use any axes.
+//
+// Reviewed: AG - Microsoft 6, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Collections;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Diagnostics.CodeAnalysis;
+using System.Globalization;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+#else
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion // Used namespaces
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.ChartTypes
+#else // Microsoft_CONTROL
+ namespace System.Web.UI.DataVisualization.Charting.ChartTypes
+#endif // Microsoft_CONTROL
+{
+ #region Enumerations
+
+ /// <summary>
+ /// Value type of the pyramid chart.
+ /// </summary>
+ internal enum PyramidValueType
+ {
+ /// <summary>
+ /// Each point value defines linear height of each segment.
+ /// </summary>
+ Linear,
+
+ /// <summary>
+ /// Each point value defines surface of each segment.
+ /// </summary>
+ Surface
+ }
+
+ /// <summary>
+ /// Funnel chart drawing style.
+ /// </summary>
+ internal enum FunnelStyle
+ {
+ /// <summary>
+ /// Shape of the funnel is fixed and point Y value controls the height of the segments.
+ /// </summary>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "YIs")]
+ YIsHeight,
+
+ /// <summary>
+ /// Height of each segment is the same and point Y value controls the diameter of the segment.
+ /// </summary>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "YIs")]
+ YIsWidth
+ }
+
+ /// <summary>
+ /// Outside labels placement.
+ /// </summary>
+ internal enum FunnelLabelPlacement
+ {
+ /// <summary>
+ /// Labels are placed on the right side of the funnel.
+ /// </summary>
+ Right,
+
+ /// <summary>
+ /// Labels are placed on the left side of the funnel.
+ /// </summary>
+ Left
+ }
+
+ /// <summary>
+ /// Vertical alignment of the data point labels
+ /// </summary>
+ internal enum FunnelLabelVerticalAlignment
+ {
+ /// <summary>
+ /// Label placed in the middle.
+ /// </summary>
+ Center,
+
+ /// <summary>
+ /// Label placed on top.
+ /// </summary>
+ Top,
+
+ /// <summary>
+ /// Label placed on the bottom.
+ /// </summary>
+ Bottom
+ }
+
+ /// <summary>
+ /// Funnel chart 3D drawing style.
+ /// </summary>
+ internal enum Funnel3DDrawingStyle
+ {
+ /// <summary>
+ /// Circle will be used as a shape of the base.
+ /// </summary>
+ CircularBase,
+
+ /// <summary>
+ /// Square will be used as a shape of the base.
+ /// </summary>
+ SquareBase
+ }
+
+
+ /// <summary>
+ /// Funnel chart labels style enumeration.
+ /// </summary>
+ internal enum FunnelLabelStyle
+ {
+ /// <summary>
+ /// Data point labels are located inside of the funnel.
+ /// </summary>
+ Inside,
+
+ /// <summary>
+ /// Data point labels are located outside of the funnel.
+ /// </summary>
+ Outside,
+
+ /// <summary>
+ /// Data point labels are located outside of the funnel in a column.
+ /// </summary>
+ OutsideInColumn,
+
+ /// <summary>
+ /// Data point labels are disabled.
+ /// </summary>
+ Disabled
+ }
+
+ #endregion // Enumerations
+
+ /// <summary>
+ /// FunnelChart class provides 2D/3D drawing and hit testing functionality
+ /// for the Funnel and Pyramid charts.
+ /// </summary>
+ internal class FunnelChart : IChartType
+ {
+ #region Fields and Constructor
+
+ // Array list of funnel segments
+ internal ArrayList segmentList = null;
+
+ // List of data point labels information
+ internal ArrayList labelInfoList = null;
+
+ // Chart graphics object.
+ internal ChartGraphics Graph { get; set; }
+
+ // Chart area the chart type belongs to.
+ internal ChartArea Area { get; set; }
+
+ // Common chart elements.
+ internal CommonElements Common { get; set; }
+
+ // Spacing between each side of the funnel and chart area.
+ internal RectangleF plotAreaSpacing = new RectangleF(3f, 3f, 3f, 3f);
+
+ // Current chart type series
+ private Series _chartTypeSeries = null;
+
+ // Sum of all Y values in the data series
+ internal double yValueTotal = 0.0;
+
+ // Maximum Y value in the data series
+ private double _yValueMax = 0.0;
+
+ // Sum of all X values in the data series
+ private double _xValueTotal = 0.0;
+
+ // Number of points in the series
+ internal int pointNumber;
+
+ // Calculted plotting area of the chart
+ private RectangleF _plotAreaPosition = RectangleF.Empty;
+
+ // Funnel chart drawing style
+ private FunnelStyle _funnelStyle = FunnelStyle.YIsHeight;
+
+ // Define the shape of the funnel neck
+ private SizeF _funnelNeckSize = new SizeF(50f, 30f);
+
+ // Gap between funnel segments
+ internal float funnelSegmentGap = 0f;
+
+ // 3D funnel rotation angle
+ private int _rotation3D = 5;
+
+ // Indicates that rounded shape is used to draw 3D chart type instead of square
+ internal bool round3DShape = true;
+
+ // Indicates that Pyramid chart is rendered.
+ internal bool isPyramid = false;
+
+ // Minimum data point height
+ private float _funnelMinPointHeight = 0f;
+
+ // Name of the attribute that controls the height of the gap between the points
+ internal string funnelPointGapAttributeName = CustomPropertyName.FunnelPointGap;
+
+ // Name of the attribute that controls the 3D funnel rotation angle
+ internal string funnelRotationAngleAttributeName = CustomPropertyName.Funnel3DRotationAngle;
+
+ // Name of the attribute that controls the minimum height of the point
+ protected string funnelPointMinHeight = CustomPropertyName.FunnelMinPointHeight;
+
+ // Name of the attribute that controls the minimum height of the point
+ internal string funnel3DDrawingStyleAttributeName = CustomPropertyName.Funnel3DDrawingStyle;
+
+ // Name of the attribute that controls inside labels vertical alignment
+ internal string funnelInsideLabelAlignmentAttributeName = CustomPropertyName.FunnelInsideLabelAlignment;
+
+ // Name of the attribute that controls outside labels placement (Left vs. Right)
+ protected string funnelOutsideLabelPlacementAttributeName = CustomPropertyName.FunnelOutsideLabelPlacement;
+
+ // Name of the attribute that controls labels style
+ internal string funnelLabelStyleAttributeName = CustomPropertyName.FunnelLabelStyle;
+
+ // Array of data point value adjusments in percentage
+ private double[] _valuePercentages = null;
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public FunnelChart()
+ {
+ }
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets the calculted plotting area of the chart
+ /// </summary>
+ internal RectangleF PlotAreaPosition
+ {
+ get { return _plotAreaPosition; }
+ set { _plotAreaPosition = value; }
+ }
+
+ #endregion // Properties
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ virtual public string Name { get{ return ChartTypeNames.Funnel;}}
+
+ /// <summary>
+ /// True if chart type is stacked
+ /// </summary>
+ virtual public bool Stacked { get{ return false;}}
+
+
+ /// <summary>
+ /// True if stacked chart type supports groups
+ /// </summary>
+ virtual public bool SupportStackedGroups { get { return false; } }
+
+
+ /// <summary>
+ /// True if stacked chart type should draw separately positive and
+ /// negative data points ( Bar and column Stacked types ).
+ /// </summary>
+ public bool StackSign { get{ return false;}}
+
+ /// <summary>
+ /// True if chart type supports axeses
+ /// </summary>
+ virtual public bool RequireAxes { get{ return false;} }
+
+ /// <summary>
+ /// Chart type with two y values used for scale ( bubble chart type )
+ /// </summary>
+ virtual public bool SecondYScale{ get{ return false;} }
+
+ /// <summary>
+ /// True if chart type requires circular chart area.
+ /// </summary>
+ public bool CircularChartArea { get{ return false;} }
+
+ /// <summary>
+ /// True if chart type supports logarithmic axes
+ /// </summary>
+ virtual public bool SupportLogarithmicAxes { get{ return true;} }
+
+ /// <summary>
+ /// True if chart type requires to switch the value (Y) axes position
+ /// </summary>
+ virtual public bool SwitchValueAxes { get{ return false;} }
+
+ /// <summary>
+ /// True if chart series can be placed side-by-side.
+ /// </summary>
+ virtual public bool SideBySideSeries { get{ return false;} }
+
+ /// <summary>
+ /// True if each data point of a chart must be represented in the legend
+ /// </summary>
+ virtual public bool DataPointsInLegend { get{ return true;} }
+
+ /// <summary>
+ /// If the crossing value is auto Crossing value should be
+ /// automatically set to zero for some chart
+ /// types (Bar, column, area etc.)
+ /// </summary>
+ virtual public bool ZeroCrossing { get{ return false;} }
+
+ /// <summary>
+ /// True if palette colors should be applied for each data paoint.
+ /// Otherwise the color is applied to the series.
+ /// </summary>
+ virtual public bool ApplyPaletteColorsToPoints { get { return true; } }
+
+ /// <summary>
+ /// Indicates that extra Y values are connected to the scale of the Y axis
+ /// </summary>
+ virtual public bool ExtraYValuesConnectedToYAxis{ get { return false; } }
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ virtual public bool HundredPercent{ get{return false;} }
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ virtual public bool HundredPercentSupportNegative{ get{return false;} }
+
+ /// <summary>
+ /// How to draw series/points in legend:
+ /// Filled rectangle, Line or Marker
+ /// </summary>
+ /// <param name="series">Legend item series.</param>
+ /// <returns>Legend item style.</returns>
+ virtual public LegendImageStyle GetLegendImageStyle(Series series)
+ {
+ return LegendImageStyle.Rectangle;
+ }
+
+ /// <summary>
+ /// Number of supported Y value(s) per point
+ /// </summary>
+ virtual public int YValuesPerPoint { get { return 1; } }
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ virtual public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+
+ #endregion
+
+ #region Painting
+
+ /// <summary>
+ /// Paint Funnel Chart.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ virtual public void Paint(
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ Series seriesToDraw )
+ {
+ // Reset fields
+ this._chartTypeSeries = null;
+ this._funnelMinPointHeight = 0f;
+
+ // Save reference to the input parameters
+ this.Graph = graph;
+ this.Common = common;
+ this.Area = area;
+
+ // Funnel chart like a Pie chart shows each data point as part of the whole (100%).
+ // Calculate the sum of all Y and X values, which will be used to calculate point percentage.
+ GetDataPointValuesStatistic();
+
+ // Check if there are non-zero points
+ if(this.yValueTotal == 0.0 || this.pointNumber == 0)
+ {
+ return;
+ }
+
+ // When Y value is funnel width at least 2 points required
+ this._funnelStyle = GetFunnelStyle( this.GetDataSeries() );
+ if(this._funnelStyle == FunnelStyle.YIsWidth &&
+ this.pointNumber == 1)
+ {
+ // At least 2 points required
+ return;
+ }
+
+ // Get minimum point height
+ GetFunnelMinPointHeight( this.GetDataSeries() );
+
+ // Fill list of data point labels information
+ this.labelInfoList = CreateLabelsInfoList();
+
+ // Calculate the spacing required for the labels.
+ GetPlotAreaSpacing();
+
+ // Draw funnel
+ ProcessChartType();
+
+ // Draw data point labels
+ DrawLabels();
+ }
+
+ /// <summary>
+ /// Process chart type drawing.
+ /// </summary>
+ private void ProcessChartType()
+ {
+ // Reversed drawing order in 3D with positive rotation angle
+ if(this.Area.Area3DStyle.Enable3D &&
+ ( (this._rotation3D > 0 && !this.isPyramid) || (this._rotation3D < 0 && this.isPyramid) ) )
+ {
+ this.segmentList.Reverse();
+ }
+
+ // Check if series shadow should be drawn separatly
+ bool drawShadowSeparatly = true;
+ bool drawSegmentShadow = (this.Area.Area3DStyle.Enable3D) ? false : true;
+
+ // Process all funnel segments shadows
+ Series series = this.GetDataSeries();
+ if(drawSegmentShadow &&
+ drawShadowSeparatly &&
+ series != null &&
+ series.ShadowOffset != 0)
+ {
+ foreach(FunnelSegmentInfo segmentInfo in this.segmentList)
+ {
+ // Draw funnel segment
+ this.DrawFunnelCircularSegment(
+ segmentInfo.Point,
+ segmentInfo.PointIndex,
+ segmentInfo.StartWidth,
+ segmentInfo.EndWidth,
+ segmentInfo.Location,
+ segmentInfo.Height,
+ segmentInfo.NothingOnTop,
+ segmentInfo.NothingOnBottom,
+ false,
+ true);
+ }
+
+ drawSegmentShadow = false;
+ }
+
+ // Process all funnel segments
+ foreach(FunnelSegmentInfo segmentInfo in this.segmentList)
+ {
+ // Draw funnel segment
+ this.DrawFunnelCircularSegment(
+ segmentInfo.Point,
+ segmentInfo.PointIndex,
+ segmentInfo.StartWidth,
+ segmentInfo.EndWidth,
+ segmentInfo.Location,
+ segmentInfo.Height,
+ segmentInfo.NothingOnTop,
+ segmentInfo.NothingOnBottom,
+ true,
+ drawSegmentShadow);
+ }
+ }
+
+ /// <summary>
+ /// Gets funnel data point segment height and width.
+ /// </summary>
+ /// <param name="series">Chart type series.</param>
+ /// <param name="pointIndex">Data point index in the series.</param>
+ /// <param name="location">Segment top location. Bottom location if reversed drawing order.</param>
+ /// <param name="height">Returns the height of the segment.</param>
+ /// <param name="startWidth">Returns top width of the segment.</param>
+ /// <param name="endWidth">Returns botom width of the segment.</param>
+ protected virtual void GetPointWidthAndHeight(
+ Series series,
+ int pointIndex,
+ float location,
+ out float height,
+ out float startWidth,
+ out float endWidth)
+ {
+ PointF pointPositionAbs = PointF.Empty;
+
+ // Get plotting area position in pixels
+ RectangleF plotAreaPositionAbs = this.Graph.GetAbsoluteRectangle(this.PlotAreaPosition);
+
+ // Calculate total height of plotting area minus reserved space for the gaps
+ float plotAreaHeightAbs = plotAreaPositionAbs.Height -
+ this.funnelSegmentGap * (this.pointNumber - ((ShouldDrawFirstPoint()) ? 1 : 2) );
+ if(plotAreaHeightAbs < 0f)
+ {
+ plotAreaHeightAbs = 0f;
+ }
+
+ if( this._funnelStyle == FunnelStyle.YIsWidth )
+ {
+ // Check if X values are provided
+ if(this._xValueTotal == 0.0)
+ {
+ // Calculate segment height in pixels by deviding
+ // plotting area height by number of points.
+ height = plotAreaHeightAbs / (this.pointNumber - 1);
+ }
+ else
+ {
+ // Calculate segment height as a part of total Y values in series
+ height = (float)(plotAreaHeightAbs * (GetXValue(series.Points[pointIndex]) / this._xValueTotal));
+ }
+
+ // Check for minimum segment height
+ height = CheckMinHeight(height);
+
+ // Calculate start and end width of the segment based on Y value
+ // of previous and current data point.
+ startWidth = (float)(plotAreaPositionAbs.Width * (GetYValue(series.Points[pointIndex-1], pointIndex-1) / this._yValueMax));
+ endWidth = (float)(plotAreaPositionAbs.Width * (GetYValue(series.Points[pointIndex], pointIndex) / this._yValueMax));
+
+ // Set point position for annotation anchoring
+ pointPositionAbs = new PointF(
+ plotAreaPositionAbs.X + plotAreaPositionAbs.Width / 2f,
+ location + height);
+ }
+ else if( this._funnelStyle == FunnelStyle.YIsHeight )
+ {
+ // Calculate segment height as a part of total Y values in series
+ height = (float)(plotAreaHeightAbs * (GetYValue(series.Points[pointIndex], pointIndex) / this.yValueTotal));
+
+ // Check for minimum segment height
+ height = CheckMinHeight(height);
+
+ // Get intersection point of the horizontal line at the start of the segment
+ // with the left pre-defined wall of the funnel.
+ PointF startIntersection = ChartGraphics.GetLinesIntersection(
+ plotAreaPositionAbs.X, location,
+ plotAreaPositionAbs.Right, location,
+ plotAreaPositionAbs.X, plotAreaPositionAbs.Y,
+ plotAreaPositionAbs.X + plotAreaPositionAbs.Width / 2f - this._funnelNeckSize.Width / 2f,
+ plotAreaPositionAbs.Bottom - this._funnelNeckSize.Height );
+
+ // Get intersection point of the horizontal line at the end of the segment
+ // with the left pre-defined wall of the funnel.
+ PointF endIntersection = ChartGraphics.GetLinesIntersection(
+ plotAreaPositionAbs.X, location + height,
+ plotAreaPositionAbs.Right, location + height,
+ plotAreaPositionAbs.X, plotAreaPositionAbs.Y,
+ plotAreaPositionAbs.X + plotAreaPositionAbs.Width / 2f - this._funnelNeckSize.Width / 2f,
+ plotAreaPositionAbs.Bottom - this._funnelNeckSize.Height );
+
+ // Get segment start and end width
+ startWidth = (float)( plotAreaPositionAbs.X + plotAreaPositionAbs.Width / 2f -
+ startIntersection.X) * 2f;
+ endWidth = (float)( plotAreaPositionAbs.X + plotAreaPositionAbs.Width / 2f -
+ endIntersection.X) * 2f;
+
+ // Set point position for annotation anchoring
+ pointPositionAbs = new PointF(
+ plotAreaPositionAbs.X + plotAreaPositionAbs.Width / 2f,
+ location + height / 2f);
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionFunnelStyleUnknown(this._funnelStyle.ToString())));
+ }
+
+ // Set pre-calculated point position
+ series.Points[pointIndex].positionRel = Graph.GetRelativePoint(pointPositionAbs);
+ }
+
+ /// <summary>
+ /// Checks if first point in the series should be drawn.
+ /// When point Y value is used to define the diameter of the funnel
+ /// segment 2 points are required to draw 1 segment. In this case first
+ /// data point is not drawn.
+ /// </summary>
+ /// <returns>True if first point in the series should be drawn.</returns>
+ protected virtual bool ShouldDrawFirstPoint()
+ {
+ return ( this._funnelStyle == FunnelStyle.YIsHeight || this.isPyramid);
+ }
+
+ /// <summary>
+ /// Draws funnel 3D square segment.
+ /// </summary>
+ /// <param name="point">Data point</param>
+ /// <param name="pointIndex">Data point index.</param>
+ /// <param name="startWidth">Segment top width.</param>
+ /// <param name="endWidth">Segment bottom width.</param>
+ /// <param name="location">Segment top location.</param>
+ /// <param name="height">Segment height.</param>
+ /// <param name="nothingOnTop">True if nothing is on the top of that segment.</param>
+ /// <param name="nothingOnBottom">True if nothing is on the bottom of that segment.</param>
+ /// <param name="drawSegment">True if segment shadow should be drawn.</param>
+ /// <param name="drawSegmentShadow">True if segment shadow should be drawn.</param>
+ private void DrawFunnel3DSquareSegment(
+ DataPoint point,
+ int pointIndex,
+ float startWidth,
+ float endWidth,
+ float location,
+ float height,
+ bool nothingOnTop,
+ bool nothingOnBottom,
+ bool drawSegment,
+ bool drawSegmentShadow)
+ {
+ // Increase the height of the segment to make sure there is no gaps between segments
+ if(!nothingOnBottom)
+ {
+ height += 0.3f;
+ }
+
+ // Get lighter and darker back colors
+ Color lightColor = ChartGraphics.GetGradientColor( point.Color, Color.White, 0.3 );
+ Color darkColor = ChartGraphics.GetGradientColor( point.Color, Color.Black, 0.3 );
+
+ // Segment width can't be smaller than funnel neck width
+ if( this._funnelStyle == FunnelStyle.YIsHeight && !this.isPyramid )
+ {
+ if(startWidth < this._funnelNeckSize.Width)
+ {
+ startWidth = this._funnelNeckSize.Width;
+ }
+ if(endWidth < this._funnelNeckSize.Width)
+ {
+ endWidth = this._funnelNeckSize.Width;
+ }
+ }
+
+ // Get 3D rotation angle
+ float topRotationHeight = (float)( (startWidth / 2f) * Math.Sin(this._rotation3D / 180F * Math.PI) );
+ float bottomRotationHeight = (float)( (endWidth / 2f) * Math.Sin(this._rotation3D / 180F * Math.PI) );
+
+ // Get plotting area position in pixels
+ RectangleF plotAreaPositionAbs = this.Graph.GetAbsoluteRectangle(this.PlotAreaPosition);
+
+ // Get the horizontal center point in pixels
+ float xCenterPointAbs = plotAreaPositionAbs.X + plotAreaPositionAbs.Width / 2f;
+
+ // Start Svg Selection mode
+ this.Graph.StartHotRegion( point );
+
+ // Create segment path
+ GraphicsPath segmentPath = new GraphicsPath();
+
+ // Draw left part of the pyramid segment
+ // Add top line
+ if(startWidth > 0f)
+ {
+ segmentPath.AddLine(
+ xCenterPointAbs - startWidth / 2f, location,
+ xCenterPointAbs, location + topRotationHeight);
+ }
+
+ // Add middle line
+ segmentPath.AddLine(
+ xCenterPointAbs, location + topRotationHeight,
+ xCenterPointAbs, location + height + bottomRotationHeight);
+
+ // Add bottom line
+ if(endWidth > 0f)
+ {
+ segmentPath.AddLine(
+ xCenterPointAbs, location + height + bottomRotationHeight,
+ xCenterPointAbs - endWidth / 2f, location + height);
+ }
+
+ // Add left line
+ segmentPath.AddLine(
+ xCenterPointAbs - endWidth / 2f, location + height,
+ xCenterPointAbs - startWidth / 2f, location);
+
+ if( this.Common.ProcessModePaint )
+ {
+ // Fill graphics path
+ this.Graph.DrawPathAbs(
+ segmentPath,
+ (drawSegment) ? lightColor : Color.Transparent,
+ point.BackHatchStyle,
+ point.BackImage,
+ point.BackImageWrapMode,
+ point.BackImageTransparentColor,
+ point.BackImageAlignment,
+ point.BackGradientStyle,
+ (drawSegment) ? point.BackSecondaryColor : Color.Transparent,
+ (drawSegment) ? point.BorderColor : Color.Transparent,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ PenAlignment.Center,
+ (drawSegmentShadow) ? point.series.ShadowOffset : 0,
+ point.series.ShadowColor);
+ }
+
+ if( this.Common.ProcessModeRegions )
+ {
+ // Add hot region
+ this.Common.HotRegionsList.AddHotRegion(
+ segmentPath,
+ false,
+ this.Graph,
+ point,
+ point.series.Name,
+ pointIndex);
+ }
+ segmentPath.Dispose();
+
+
+
+ // Draw right part of the pyramid segment
+ // Add top line
+ segmentPath = new GraphicsPath();
+ if(startWidth > 0f)
+ {
+ segmentPath.AddLine(
+ xCenterPointAbs + startWidth / 2f, location,
+ xCenterPointAbs, location + topRotationHeight);
+ }
+
+ // Add middle line
+ segmentPath.AddLine(
+ xCenterPointAbs, location + topRotationHeight,
+ xCenterPointAbs, location + height + bottomRotationHeight);
+
+ // Add bottom line
+ if(endWidth > 0f)
+ {
+ segmentPath.AddLine(
+ xCenterPointAbs, location + height + bottomRotationHeight,
+ xCenterPointAbs + endWidth / 2f, location + height);
+ }
+
+ // Add right line
+ segmentPath.AddLine(
+ xCenterPointAbs + endWidth / 2f, location + height,
+ xCenterPointAbs + startWidth / 2f, location);
+
+ if( this.Common.ProcessModePaint )
+ {
+ // Fill graphics path
+ this.Graph.DrawPathAbs(
+ segmentPath,
+ (drawSegment) ? darkColor : Color.Transparent,
+ point.BackHatchStyle,
+ point.BackImage,
+ point.BackImageWrapMode,
+ point.BackImageTransparentColor,
+ point.BackImageAlignment,
+ point.BackGradientStyle,
+ (drawSegment) ? point.BackSecondaryColor : Color.Transparent,
+ (drawSegment) ? point.BorderColor : Color.Transparent,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ PenAlignment.Center,
+ (drawSegmentShadow) ? point.series.ShadowOffset : 0,
+ point.series.ShadowColor);
+ }
+
+ if( this.Common.ProcessModeRegions )
+ {
+ // Add hot region
+ this.Common.HotRegionsList.AddHotRegion(
+ segmentPath,
+ false,
+ this.Graph,
+ point,
+ point.series.Name,
+ pointIndex);
+ }
+ segmentPath.Dispose();
+
+
+ // Add top 3D surface
+ if(this._rotation3D > 0f && startWidth > 0f && nothingOnTop)
+ {
+ if(this.Area.Area3DStyle.Enable3D)
+ {
+ PointF[] sidePoints = new PointF[4];
+ sidePoints[0] = new PointF(xCenterPointAbs + startWidth / 2f, location);
+ sidePoints[1] = new PointF(xCenterPointAbs, location + topRotationHeight);
+ sidePoints[2] = new PointF(xCenterPointAbs - startWidth / 2f, location);
+ sidePoints[3] = new PointF(xCenterPointAbs, location - topRotationHeight);
+ GraphicsPath topCurve = new GraphicsPath();
+ topCurve.AddLines(sidePoints);
+ topCurve.CloseAllFigures();
+
+ if( this.Common.ProcessModePaint )
+ {
+ // Fill graphics path
+ this.Graph.DrawPathAbs(
+ topCurve,
+ (drawSegment) ? ChartGraphics.GetGradientColor( point.Color, Color.Black, 0.4 ) : Color.Transparent,
+ point.BackHatchStyle,
+ point.BackImage,
+ point.BackImageWrapMode,
+ point.BackImageTransparentColor,
+ point.BackImageAlignment,
+ point.BackGradientStyle,
+ (drawSegment) ? point.BackSecondaryColor : Color.Transparent,
+ (drawSegment) ? point.BorderColor : Color.Transparent,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ PenAlignment.Center,
+ (drawSegmentShadow) ? point.series.ShadowOffset : 0,
+ point.series.ShadowColor);
+ }
+
+ if( this.Common.ProcessModeRegions )
+ {
+ // Add hot region
+ this.Common.HotRegionsList.AddHotRegion(
+ topCurve,
+ false,
+ this.Graph,
+ point,
+ point.series.Name,
+ pointIndex);
+ }
+ topCurve.Dispose();
+ }
+ }
+
+ // Add bottom 3D surface
+ if(this._rotation3D < 0f && startWidth > 0f && nothingOnBottom)
+ {
+ if(this.Area.Area3DStyle.Enable3D)
+ {
+ PointF[] sidePoints = new PointF[4];
+ sidePoints[0] = new PointF(xCenterPointAbs + endWidth / 2f, location + height);
+ sidePoints[1] = new PointF(xCenterPointAbs, location + height + bottomRotationHeight);
+ sidePoints[2] = new PointF(xCenterPointAbs - endWidth / 2f, location + height);
+ sidePoints[3] = new PointF(xCenterPointAbs, location + height - bottomRotationHeight);
+ GraphicsPath topCurve = new GraphicsPath();
+ topCurve.AddLines(sidePoints);
+ topCurve.CloseAllFigures();
+
+ if( this.Common.ProcessModePaint )
+ {
+ // Fill graphics path
+ this.Graph.DrawPathAbs(
+ topCurve,
+ (drawSegment) ? ChartGraphics.GetGradientColor( point.Color, Color.Black, 0.4 ) : Color.Transparent,
+ point.BackHatchStyle,
+ point.BackImage,
+ point.BackImageWrapMode,
+ point.BackImageTransparentColor,
+ point.BackImageAlignment,
+ point.BackGradientStyle,
+ (drawSegment) ? point.BackSecondaryColor : Color.Transparent,
+ (drawSegment) ? point.BorderColor : Color.Transparent,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ PenAlignment.Center,
+ (drawSegmentShadow) ? point.series.ShadowOffset : 0,
+ point.series.ShadowColor);
+ }
+
+ if( this.Common.ProcessModeRegions )
+ {
+ // Add hot region
+ this.Common.HotRegionsList.AddHotRegion(
+ topCurve,
+ false,
+ this.Graph,
+ point,
+ point.series.Name,
+ pointIndex);
+ }
+ topCurve.Dispose();
+
+ }
+ }
+
+ // End Svg Selection mode
+ this.Graph.EndHotRegion( );
+ }
+
+ /// <summary>
+ /// Draws funnel segment.
+ /// </summary>
+ /// <param name="point">Data point</param>
+ /// <param name="pointIndex">Data point index.</param>
+ /// <param name="startWidth">Segment top width.</param>
+ /// <param name="endWidth">Segment bottom width.</param>
+ /// <param name="location">Segment top location.</param>
+ /// <param name="height">Segment height.</param>
+ /// <param name="nothingOnTop">True if nothing is on the top of that segment.</param>
+ /// <param name="nothingOnBottom">True if nothing is on the bottom of that segment.</param>
+ /// <param name="drawSegment">True if segment shadow should be drawn.</param>
+ /// <param name="drawSegmentShadow">True if segment shadow should be drawn.</param>
+ private void DrawFunnelCircularSegment(
+ DataPoint point,
+ int pointIndex,
+ float startWidth,
+ float endWidth,
+ float location,
+ float height,
+ bool nothingOnTop,
+ bool nothingOnBottom,
+ bool drawSegment,
+ bool drawSegmentShadow)
+ {
+ PointF leftSideLinePoint = PointF.Empty;
+ PointF rightSideLinePoint = PointF.Empty;
+
+ // Check if square 3D segment should be drawn
+ if(this.Area.Area3DStyle.Enable3D && !round3DShape)
+ {
+ DrawFunnel3DSquareSegment(
+ point,
+ pointIndex,
+ startWidth,
+ endWidth,
+ location,
+ height,
+ nothingOnTop,
+ nothingOnBottom,
+ drawSegment,
+ drawSegmentShadow);
+ return;
+ }
+
+ // Increase the height of the segment to make sure there is no gaps between segments
+ if(!nothingOnBottom)
+ {
+ height += 0.3f;
+ }
+
+ // Segment width can't be smaller than funnel neck width
+ float originalStartWidth = startWidth;
+ float originalEndWidth = endWidth;
+ if( this._funnelStyle == FunnelStyle.YIsHeight && !this.isPyramid)
+ {
+ if(startWidth < this._funnelNeckSize.Width)
+ {
+ startWidth = this._funnelNeckSize.Width;
+ }
+ if(endWidth < this._funnelNeckSize.Width)
+ {
+ endWidth = this._funnelNeckSize.Width;
+ }
+ }
+
+ // Get 3D rotation angle
+ float tension = 0.8f;
+ float topRotationHeight = (float)( (startWidth / 2f) * Math.Sin(this._rotation3D / 180F * Math.PI) );
+ float bottomRotationHeight = (float)( (endWidth / 2f) * Math.Sin(this._rotation3D / 180F * Math.PI) );
+
+ // Get plotting area position in pixels
+ RectangleF plotAreaPositionAbs = this.Graph.GetAbsoluteRectangle(this.PlotAreaPosition);
+
+ // Get the horizontal center point in pixels
+ float xCenterPointAbs = plotAreaPositionAbs.X + plotAreaPositionAbs.Width / 2f;
+
+ // Start Svg Selection mode
+ this.Graph.StartHotRegion( point );
+
+ // Create segment path
+ GraphicsPath segmentPath = new GraphicsPath();
+
+ // Add top line
+ if(startWidth > 0f)
+ {
+ if(this.Area.Area3DStyle.Enable3D)
+ {
+ PointF[] sidePoints = new PointF[4];
+ sidePoints[0] = new PointF(xCenterPointAbs + startWidth / 2f, location);
+ sidePoints[1] = new PointF(xCenterPointAbs, location + topRotationHeight);
+ sidePoints[2] = new PointF(xCenterPointAbs - startWidth / 2f, location);
+ sidePoints[3] = new PointF(xCenterPointAbs, location - topRotationHeight);
+ GraphicsPath topCurve = new GraphicsPath();
+ topCurve.AddClosedCurve(sidePoints, tension);
+ topCurve.Flatten();
+ topCurve.Reverse();
+
+ Graph.AddEllipseSegment(
+ segmentPath,
+ topCurve,
+ null,
+ true,
+ 0f,
+ out leftSideLinePoint,
+ out rightSideLinePoint);
+ }
+ else
+ {
+ segmentPath.AddLine(
+ xCenterPointAbs - startWidth / 2f, location,
+ xCenterPointAbs + startWidth / 2f, location);
+ }
+ }
+
+ // Add right line
+ if( this._funnelStyle == FunnelStyle.YIsHeight &&
+ !this.isPyramid &&
+ startWidth > this._funnelNeckSize.Width &&
+ endWidth <= this._funnelNeckSize.Width)
+ {
+ // Get intersection point of the vertical line at the neck border
+ // with the left pre-defined wall of the funnel.
+ PointF intersection = ChartGraphics.GetLinesIntersection(
+ xCenterPointAbs + this._funnelNeckSize.Width / 2f, plotAreaPositionAbs.Top,
+ xCenterPointAbs + this._funnelNeckSize.Width / 2f, plotAreaPositionAbs.Bottom,
+ xCenterPointAbs + originalStartWidth / 2f, location,
+ xCenterPointAbs + originalEndWidth / 2f, location + height);
+
+ // Adjust intersection point with top of the neck
+ intersection.Y = plotAreaPositionAbs.Bottom - this._funnelNeckSize.Height;
+
+ // Add two segment line
+ segmentPath.AddLine(
+ xCenterPointAbs + startWidth / 2f, location,
+ intersection.X, intersection.Y);
+ segmentPath.AddLine(
+ intersection.X, intersection.Y,
+ intersection.X, location + height);
+ }
+ else
+ {
+ // Add straight line
+ segmentPath.AddLine(
+ xCenterPointAbs + startWidth / 2f, location,
+ xCenterPointAbs + endWidth / 2f, location + height);
+ }
+
+ // Add bottom line
+ if(endWidth > 0f)
+ {
+ if(this.Area.Area3DStyle.Enable3D)
+ {
+ PointF[] sidePoints = new PointF[4];
+ sidePoints[0] = new PointF(xCenterPointAbs + endWidth / 2f, location + height);
+ sidePoints[1] = new PointF(xCenterPointAbs, location + height + bottomRotationHeight);
+ sidePoints[2] = new PointF(xCenterPointAbs - endWidth / 2f, location + height);
+ sidePoints[3] = new PointF(xCenterPointAbs, location + height - bottomRotationHeight);
+ GraphicsPath topCurve = new GraphicsPath();
+ topCurve.AddClosedCurve(sidePoints, tension);
+ topCurve.Flatten();
+ topCurve.Reverse();
+
+ using (GraphicsPath tmp = new GraphicsPath())
+ {
+ Graph.AddEllipseSegment(
+ tmp,
+ topCurve,
+ null,
+ true,
+ 0f,
+ out leftSideLinePoint,
+ out rightSideLinePoint);
+
+ tmp.Reverse();
+ if (tmp.PointCount > 0)
+ {
+ segmentPath.AddPath(tmp, false);
+ }
+ }
+ }
+ else
+ {
+ segmentPath.AddLine(
+ xCenterPointAbs + endWidth / 2f, location + height,
+ xCenterPointAbs - endWidth / 2f, location + height);
+ }
+ }
+
+ // Add left line
+ if( this._funnelStyle == FunnelStyle.YIsHeight &&
+ !this.isPyramid &&
+ startWidth > this._funnelNeckSize.Width &&
+ endWidth <= this._funnelNeckSize.Width)
+ {
+ // Get intersection point of the horizontal line at the start of the segment
+ // with the left pre-defined wall of the funnel.
+ PointF intersection = ChartGraphics.GetLinesIntersection(
+ xCenterPointAbs - this._funnelNeckSize.Width / 2f, plotAreaPositionAbs.Top,
+ xCenterPointAbs - this._funnelNeckSize.Width / 2f, plotAreaPositionAbs.Bottom,
+ xCenterPointAbs - originalStartWidth / 2f, location,
+ xCenterPointAbs - originalEndWidth / 2f, location + height);
+
+ // Adjust intersection point with top of the neck
+ intersection.Y = plotAreaPositionAbs.Bottom - this._funnelNeckSize.Height;
+
+ // Add two segment line
+ segmentPath.AddLine(
+ intersection.X, location + height,
+ intersection.X, intersection.Y);
+ segmentPath.AddLine(
+ intersection.X, intersection.Y,
+ xCenterPointAbs - startWidth / 2f, location);
+ }
+ else
+ {
+ segmentPath.AddLine(
+ xCenterPointAbs - endWidth / 2f, location + height,
+ xCenterPointAbs - startWidth / 2f, location);
+ }
+
+ if( this.Common.ProcessModePaint )
+ {
+ // Draw lightStyle source blink effect in 3D
+ if(this.Area.Area3DStyle.Enable3D &&
+ Graph.ActiveRenderingType == RenderingType.Gdi )
+ {
+ // Get lighter and darker back colors
+ Color lightColor = ChartGraphics.GetGradientColor( point.Color, Color.White, 0.3 );
+ Color darkColor = ChartGraphics.GetGradientColor( point.Color, Color.Black, 0.3 );
+
+ // Create linear gradient brush
+ RectangleF boundsRect = segmentPath.GetBounds();
+ if(boundsRect.Width == 0f)
+ {
+ boundsRect.Width = 1f;
+ }
+ if(boundsRect.Height == 0f)
+ {
+ boundsRect.Height = 1f;
+ }
+ using( LinearGradientBrush brush = new LinearGradientBrush(
+ boundsRect,
+ lightColor,
+ darkColor,
+ 0f) )
+ {
+ // Set linear gradient brush interpolation colors
+ ColorBlend colorBlend = new ColorBlend(5);
+ colorBlend.Colors[0] = darkColor;
+ colorBlend.Colors[1] = darkColor;
+ colorBlend.Colors[2] = lightColor;
+ colorBlend.Colors[3] = darkColor;
+ colorBlend.Colors[4] = darkColor;
+
+ colorBlend.Positions[0] = 0.0f;
+ colorBlend.Positions[1] = 0.0f;
+ colorBlend.Positions[2] = 0.5f;
+ colorBlend.Positions[3] = 1.0f;
+ colorBlend.Positions[4] = 1.0f;
+
+ brush.InterpolationColors = colorBlend;
+
+ // Fill path
+ this.Graph.Graphics.FillPath(brush, segmentPath);
+
+ // Draw path border
+ Pen pen = new Pen(point.BorderColor, point.BorderWidth);
+ pen.DashStyle = this.Graph.GetPenStyle( point.BorderDashStyle );
+ if(point.BorderWidth == 0 ||
+ point.BorderDashStyle == ChartDashStyle.NotSet ||
+ point.BorderColor == Color.Empty)
+ {
+ // Draw line of the darker color inside the cylinder
+ pen = new Pen(ChartGraphics.GetGradientColor( point.Color, Color.Black, 0.3 ), 1);
+ pen.Alignment = PenAlignment.Inset;
+ }
+
+ pen.StartCap = LineCap.Round;
+ pen.EndCap = LineCap.Round;
+ pen.LineJoin = LineJoin.Bevel;
+ this.Graph.DrawPath(pen, segmentPath );
+ pen.Dispose();
+ }
+ }
+ else
+ {
+ // Fill graphics path
+ this.Graph.DrawPathAbs(
+ segmentPath,
+ (drawSegment) ? point.Color : Color.Transparent,
+ point.BackHatchStyle,
+ point.BackImage,
+ point.BackImageWrapMode,
+ point.BackImageTransparentColor,
+ point.BackImageAlignment,
+ point.BackGradientStyle,
+ (drawSegment) ? point.BackSecondaryColor : Color.Transparent,
+ (drawSegment) ? point.BorderColor : Color.Transparent,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ PenAlignment.Center,
+ (drawSegmentShadow) ? point.series.ShadowOffset : 0,
+ point.series.ShadowColor);
+ }
+ }
+
+ if( this.Common.ProcessModeRegions )
+ {
+ // Add hot region
+ this.Common.HotRegionsList.AddHotRegion(
+ segmentPath,
+ false,
+ this.Graph,
+ point,
+ point.series.Name,
+ pointIndex);
+ }
+ segmentPath.Dispose();
+
+
+ // Add top 3D surface
+ if(this._rotation3D > 0f && startWidth > 0f && nothingOnTop)
+ {
+ if(this.Area.Area3DStyle.Enable3D)
+ {
+ PointF[] sidePoints = new PointF[4];
+ sidePoints[0] = new PointF(xCenterPointAbs + startWidth / 2f, location);
+ sidePoints[1] = new PointF(xCenterPointAbs, location + topRotationHeight);
+ sidePoints[2] = new PointF(xCenterPointAbs - startWidth / 2f, location);
+ sidePoints[3] = new PointF(xCenterPointAbs, location - topRotationHeight);
+ GraphicsPath topCurve = new GraphicsPath();
+ topCurve.AddClosedCurve(sidePoints, tension);
+
+ if( this.Common.ProcessModePaint )
+ {
+ // Fill graphics path
+ this.Graph.DrawPathAbs(
+ topCurve,
+ (drawSegment) ? ChartGraphics.GetGradientColor( point.Color, Color.Black, 0.4 ) : Color.Transparent,
+ point.BackHatchStyle,
+ point.BackImage,
+ point.BackImageWrapMode,
+ point.BackImageTransparentColor,
+ point.BackImageAlignment,
+ point.BackGradientStyle,
+ (drawSegment) ? point.BackSecondaryColor : Color.Transparent,
+ (drawSegment) ? point.BorderColor : Color.Transparent,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ PenAlignment.Center,
+ (drawSegmentShadow) ? point.series.ShadowOffset : 0,
+ point.series.ShadowColor);
+ }
+
+ if( this.Common.ProcessModeRegions )
+ {
+ // Add hot region
+ this.Common.HotRegionsList.AddHotRegion(
+ topCurve,
+ false,
+ this.Graph,
+ point,
+ point.series.Name,
+ pointIndex);
+ }
+ topCurve.Dispose();
+ }
+ }
+
+ // Add bottom 3D surface
+ if(this._rotation3D < 0f && startWidth > 0f && nothingOnBottom)
+ {
+ if(this.Area.Area3DStyle.Enable3D)
+ {
+ PointF[] sidePoints = new PointF[4];
+ sidePoints[0] = new PointF(xCenterPointAbs + endWidth / 2f, location + height);
+ sidePoints[1] = new PointF(xCenterPointAbs, location + height + bottomRotationHeight);
+ sidePoints[2] = new PointF(xCenterPointAbs - endWidth / 2f, location + height);
+ sidePoints[3] = new PointF(xCenterPointAbs, location + height - bottomRotationHeight);
+ GraphicsPath topCurve = new GraphicsPath();
+ topCurve.AddClosedCurve(sidePoints, tension);
+
+ if( this.Common.ProcessModePaint )
+ {
+ // Fill graphics path
+ this.Graph.DrawPathAbs(
+ topCurve,
+ (drawSegment) ? ChartGraphics.GetGradientColor( point.Color, Color.Black, 0.4 ) : Color.Transparent,
+ point.BackHatchStyle,
+ point.BackImage,
+ point.BackImageWrapMode,
+ point.BackImageTransparentColor,
+ point.BackImageAlignment,
+ point.BackGradientStyle,
+ (drawSegment) ? point.BackSecondaryColor : Color.Transparent,
+ (drawSegment) ? point.BorderColor : Color.Transparent,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ PenAlignment.Center,
+ (drawSegmentShadow) ? point.series.ShadowOffset : 0,
+ point.series.ShadowColor);
+ }
+
+ if( this.Common.ProcessModeRegions )
+ {
+ // Add hot region
+ this.Common.HotRegionsList.AddHotRegion(
+ topCurve,
+ false,
+ this.Graph,
+ point,
+ point.series.Name,
+ pointIndex);
+ }
+ topCurve.Dispose();
+
+ }
+ }
+
+ // End Svg Selection mode
+ this.Graph.EndHotRegion( );
+ }
+
+
+ /// <summary>
+ /// Fill list with information about every segment of the funnel.
+ /// </summary>
+ /// <returns>Funnel segment information list.</returns>
+ private ArrayList GetFunnelSegmentPositions()
+ {
+ // Create new list
+ ArrayList list = new ArrayList();
+
+ // Funnel chart process only first series in the chart area
+ // and cannot be combined with any other chart types.
+ Series series = GetDataSeries();
+ if( series != null )
+ {
+ // Get funnel drawing style
+ this._funnelStyle = GetFunnelStyle(series);
+
+ // Check if round or square base is used in 3D chart
+ this.round3DShape = (GetFunnel3DDrawingStyle(series) == Funnel3DDrawingStyle.CircularBase);
+
+ // Get funnel points gap
+ this.funnelSegmentGap = GetFunnelPointGap(series);
+
+ // Get funnel neck size
+ this._funnelNeckSize = GetFunnelNeckSize(series);
+
+ // Loop through all ponts in the data series
+ float currentLocation = this.Graph.GetAbsolutePoint(this.PlotAreaPosition.Location).Y;
+ if(this.isPyramid)
+ {
+ // Pyramid is drawn in reversed order.
+ currentLocation = this.Graph.GetAbsoluteRectangle(this.PlotAreaPosition).Bottom;
+ }
+ for( int pointIndex = 0; pointIndex >= 0 && pointIndex < series.Points.Count; pointIndex += 1 )
+ {
+ DataPoint point = series.Points[pointIndex];
+
+ // Check if first data point should be drawn
+ if( pointIndex > 0 || ShouldDrawFirstPoint() )
+ {
+ // Get height and width of each data point segment
+ float startWidth = 0f;
+ float endWidth = 0f;
+ float height = 0f;
+ GetPointWidthAndHeight(
+ series,
+ pointIndex,
+ currentLocation,
+ out height,
+ out startWidth,
+ out endWidth);
+
+ // Check visibility of previous and next points
+ bool nothingOnTop = false;
+ bool nothingOnBottom = false;
+ if(this.funnelSegmentGap > 0)
+ {
+ nothingOnTop = true;
+ nothingOnBottom = true;
+ }
+ else
+ {
+ if(ShouldDrawFirstPoint())
+ {
+ if(pointIndex == 0 ||
+ series.Points[pointIndex-1].Color.A != 255)
+ {
+ if(this.isPyramid)
+ {
+ nothingOnBottom = true;
+ }
+ else
+ {
+ nothingOnTop = true;
+ }
+ }
+ }
+ else
+ {
+ if(pointIndex == 1 ||
+ series.Points[pointIndex-1].Color.A != 255)
+ {
+ if(this.isPyramid)
+ {
+ nothingOnBottom = true;
+ }
+ else
+ {
+ nothingOnTop = true;
+ }
+ }
+ }
+ if( pointIndex == series.Points.Count - 1)
+ {
+ if(this.isPyramid)
+ {
+ nothingOnTop = true;
+ }
+ else
+ {
+ nothingOnBottom = true;
+ }
+ }
+ else if(series.Points[pointIndex+1].Color.A != 255)
+ {
+ if(this.isPyramid)
+ {
+ nothingOnTop = true;
+ }
+ else
+ {
+ nothingOnBottom = true;
+ }
+ }
+ }
+
+ // Add segment information
+ FunnelSegmentInfo info = new FunnelSegmentInfo();
+ info.Point = point;
+ info.PointIndex = pointIndex;
+ info.StartWidth = startWidth;
+ info.EndWidth = endWidth;
+ info.Location = (this.isPyramid) ? currentLocation - height : currentLocation;
+ info.Height = height;
+ info.NothingOnTop = nothingOnTop;
+ info.NothingOnBottom = nothingOnBottom;
+ list.Add(info);
+
+ // Increase current Y location
+ if(this.isPyramid)
+ {
+ currentLocation -= height + this.funnelSegmentGap;
+ }
+ else
+ {
+ currentLocation += height + this.funnelSegmentGap;
+ }
+ }
+ }
+ }
+
+ return list;
+ }
+
+ #endregion
+
+ #region Labels Methods
+
+ /// <summary>
+ /// Draws funnel data point labels.
+ /// </summary>
+ private void DrawLabels()
+ {
+ // Loop through all labels
+ foreach(FunnelPointLabelInfo labelInfo in this.labelInfoList)
+ {
+ if(!labelInfo.Position.IsEmpty &&
+ !float.IsNaN(labelInfo.Position.X) &&
+ !float.IsNaN(labelInfo.Position.Y) &&
+ !float.IsNaN(labelInfo.Position.Width) &&
+ !float.IsNaN(labelInfo.Position.Height) )
+ {
+ // Start Svg Selection mode
+ this.Graph.StartHotRegion( labelInfo.Point );
+
+ // Get size of a single character used for spacing
+ SizeF spacing = this.Graph.MeasureString(
+ "W",
+ labelInfo.Point.Font,
+ new SizeF(1000f, 1000F),
+ StringFormat.GenericTypographic );
+
+ // Draw a callout line
+ if( !labelInfo.CalloutPoint1.IsEmpty &&
+ !labelInfo.CalloutPoint2.IsEmpty &&
+ !float.IsNaN(labelInfo.CalloutPoint1.X) &&
+ !float.IsNaN(labelInfo.CalloutPoint1.Y) &&
+ !float.IsNaN(labelInfo.CalloutPoint2.X) &&
+ !float.IsNaN(labelInfo.CalloutPoint2.Y) )
+ {
+ // Add spacing between text and callout line
+ if(labelInfo.OutsidePlacement == FunnelLabelPlacement.Right)
+ {
+ labelInfo.CalloutPoint2.X -= spacing.Width / 2f;
+
+ // Add a small spacing between a callout line and a segment
+ labelInfo.CalloutPoint1.X += 2;
+ }
+ else
+ {
+ labelInfo.CalloutPoint2.X += spacing.Width / 2f;
+
+ // Add a small spacing between a callout line and a segment
+ labelInfo.CalloutPoint1.X += 2;
+ }
+
+ // Get callout line color
+ Color lineColor = GetCalloutLineColor(labelInfo.Point);
+
+ // Draw callout line
+ this.Graph.DrawLineAbs(
+ lineColor,
+ 1,
+ ChartDashStyle.Solid,
+ labelInfo.CalloutPoint1,
+ labelInfo.CalloutPoint2 );
+
+ }
+
+ // Get label background position
+ RectangleF labelBackPosition = labelInfo.Position;
+ labelBackPosition.Inflate(spacing.Width / 2f, spacing.Height / 8f);
+ labelBackPosition = this.Graph.GetRelativeRectangle(labelBackPosition);
+
+ // Center label in the middle of the background rectangle
+ using (StringFormat format = new StringFormat())
+ {
+ format.Alignment = StringAlignment.Center;
+ format.LineAlignment = StringAlignment.Center;
+
+ // Draw label text
+ using (Brush brush = new SolidBrush(labelInfo.Point.LabelForeColor))
+ {
+
+ this.Graph.DrawPointLabelStringRel(
+ this.Common,
+ labelInfo.Text,
+ labelInfo.Point.Font,
+ brush,
+ labelBackPosition,
+ format,
+ labelInfo.Point.LabelAngle,
+ labelBackPosition,
+
+ labelInfo.Point.LabelBackColor,
+ labelInfo.Point.LabelBorderColor,
+ labelInfo.Point.LabelBorderWidth,
+ labelInfo.Point.LabelBorderDashStyle,
+ labelInfo.Point.series,
+ labelInfo.Point,
+ labelInfo.PointIndex);
+ }
+
+ // End Svg Selection mode
+ this.Graph.EndHotRegion();
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Creates a list of structures with the data point labels information.
+ /// </summary>
+ /// <returns>Array list of labels information.</returns>
+ private ArrayList CreateLabelsInfoList()
+ {
+ ArrayList list = new ArrayList();
+
+ // Get area position in pixels
+ RectangleF plotAreaPositionAbs = this.Graph.GetAbsoluteRectangle( this.Area.Position.ToRectangleF() );
+
+ // Get funnel chart type series
+ Series series = GetDataSeries();
+ if( series != null )
+ {
+ // Loop through all ponts in the data series
+ int pointIndex = 0;
+ foreach( DataPoint point in series.Points )
+ {
+ // Ignore empty points
+ if( !point.IsEmpty )
+ {
+ // Get some properties for performance
+ string pointLabel = point.Label;
+ bool pointShowLabelAsValue = point.IsValueShownAsLabel;
+
+ // Check if label text exists
+ if(pointShowLabelAsValue || pointLabel.Length > 0)
+ {
+ // Create new point label information class
+ FunnelPointLabelInfo labelInfo = new FunnelPointLabelInfo();
+ labelInfo.Point = point;
+ labelInfo.PointIndex = pointIndex;
+
+ // Get point label text
+ if( pointLabel.Length == 0 )
+ {
+ labelInfo.Text = ValueConverter.FormatValue(
+ point.series.Chart,
+ point,
+ point.Tag,
+ point.YValues[0],
+ point.LabelFormat,
+ point.series.YValueType,
+ ChartElementType.DataPoint);
+ }
+ else
+ {
+ labelInfo.Text = point.ReplaceKeywords(pointLabel);
+ }
+
+ // Get label style
+ labelInfo.Style = GetLabelStyle(point);
+
+ // Get inside label vertical alignment
+ if(labelInfo.Style == FunnelLabelStyle.Inside)
+ {
+ labelInfo.VerticalAlignment = GetInsideLabelAlignment(point);
+ }
+
+ // Get outside labels placement
+ if(labelInfo.Style != FunnelLabelStyle.Inside)
+ {
+ labelInfo.OutsidePlacement = GetOutsideLabelPlacement(point);
+ }
+
+ // Measure string size
+ labelInfo.Size = this.Graph.MeasureString(
+ labelInfo.Text,
+ point.Font,
+ plotAreaPositionAbs.Size,
+ StringFormat.GenericTypographic);
+
+ // Add label information into the list
+ if(labelInfo.Text.Length > 0 &&
+ labelInfo.Style != FunnelLabelStyle.Disabled)
+ {
+ list.Add(labelInfo);
+ }
+ }
+ }
+ ++pointIndex;
+ }
+ }
+ return list;
+ }
+
+ /// <summary>
+ /// Changes required plotting area spacing, so that all labels fit.
+ /// </summary>
+ /// <returns>Return True if no resizing required.</returns>
+ private bool FitPointLabels()
+ {
+ // Convert plotting area position to pixels.
+ // Make rectangle 4 pixels smaller on each side.
+ RectangleF plotAreaPositionAbs = this.Graph.GetAbsoluteRectangle(PlotAreaPosition);
+ plotAreaPositionAbs.Inflate(-4f, -4f);
+
+ // Get position of each label
+ GetLabelsPosition();
+
+ // Get spacing required to draw labels
+ RectangleF requiredSpacing = this.Graph.GetAbsoluteRectangle( new RectangleF(1f, 1f, 1f, 1f) );
+ foreach(FunnelPointLabelInfo labelInfo in this.labelInfoList)
+ {
+ // Add additional horizontal spacing for outside labels
+ RectangleF position = labelInfo.Position;
+ if(labelInfo.Style == FunnelLabelStyle.Outside ||
+ labelInfo.Style == FunnelLabelStyle.OutsideInColumn)
+ {
+ float spacing = 10f;
+ if(labelInfo.OutsidePlacement == FunnelLabelPlacement.Right)
+ {
+ position.Width += spacing;
+ }
+ else if(labelInfo.OutsidePlacement == FunnelLabelPlacement.Left)
+ {
+ position.X -= spacing;
+ position.Width += spacing;
+ }
+ }
+
+ // Horizontal coordinates are ignored for Inside label style
+ if(labelInfo.Style != FunnelLabelStyle.Inside)
+ {
+ if( (plotAreaPositionAbs.X - position.X) > requiredSpacing.X )
+ {
+ requiredSpacing.X = plotAreaPositionAbs.X - position.X;
+ }
+
+ if( (position.Right - plotAreaPositionAbs.Right) > requiredSpacing.Width )
+ {
+ requiredSpacing.Width = position.Right - plotAreaPositionAbs.Right;
+ }
+ }
+
+ // Vertical spacing
+ if( (plotAreaPositionAbs.Y - position.Y) > requiredSpacing.Y )
+ {
+ requiredSpacing.Y = plotAreaPositionAbs.Y - position.Y;
+ }
+
+ if( (position.Bottom - plotAreaPositionAbs.Bottom) > requiredSpacing.Height )
+ {
+ requiredSpacing.Height = position.Bottom - plotAreaPositionAbs.Bottom;
+ }
+ }
+
+ // Convert spacing rectangle to relative coordinates
+ requiredSpacing = this.Graph.GetRelativeRectangle(requiredSpacing);
+
+ // Check if non-default spacing was used
+ if(requiredSpacing.X > 1f ||
+ requiredSpacing.Y > 1f ||
+ requiredSpacing.Width > 1f ||
+ requiredSpacing.Height > 1f )
+ {
+ this.plotAreaSpacing = requiredSpacing;
+
+ // Get NEW plotting area position
+ this.PlotAreaPosition = GetPlotAreaPosition();
+
+ // Get NEW list of segments
+ this.segmentList = GetFunnelSegmentPositions();
+
+ // Get NEW position of each label
+ GetLabelsPosition();
+
+ return false;
+ }
+
+ return true;
+ }
+
+ /// <summary>
+ /// Loops through the point labels list and calculates labels position
+ /// based on their size, position and funnel chart shape.
+ /// </summary>
+ private void GetLabelsPosition()
+ {
+ // Convert plotting area position to pixels
+ RectangleF plotAreaPositionAbs = this.Graph.GetAbsoluteRectangle(PlotAreaPosition);
+ float plotAreaCenterXAbs = plotAreaPositionAbs.X + plotAreaPositionAbs.Width / 2f;
+
+ // Define label spacing
+ SizeF labelSpacing = new SizeF(3f, 3f);
+
+ //Loop through all labels
+ foreach(FunnelPointLabelInfo labelInfo in this.labelInfoList)
+ {
+ // Get ----osiated funnel segment information
+ bool lastLabel = false;
+ int pointIndex = labelInfo.PointIndex + ((ShouldDrawFirstPoint()) ? 0 : 1);
+ if(pointIndex > this.segmentList.Count && !ShouldDrawFirstPoint() )
+ {
+ // Use last point index if first point is not drawn
+ pointIndex = this.segmentList.Count;
+ lastLabel = true;
+ }
+ FunnelSegmentInfo segmentInfo = null;
+ foreach(FunnelSegmentInfo info in this.segmentList)
+ {
+ if(info.PointIndex == pointIndex)
+ {
+ segmentInfo = info;
+ break;
+ }
+ }
+
+ // Check if segment was found
+ if(segmentInfo != null)
+ {
+ // Set label width and height
+ labelInfo.Position.Width = labelInfo.Size.Width;
+ labelInfo.Position.Height = labelInfo.Size.Height;
+
+ //******************************************************
+ //** Labels are placed OUTSIDE of the funnel
+ //******************************************************
+ if(labelInfo.Style == FunnelLabelStyle.Outside ||
+ labelInfo.Style == FunnelLabelStyle.OutsideInColumn)
+ {
+ // Define position
+ if( this._funnelStyle == FunnelStyle.YIsHeight )
+ {
+ // Get segment top and bottom diameter
+ float topDiameter = segmentInfo.StartWidth;
+ float bottomDiameter = segmentInfo.EndWidth;
+ if(!this.isPyramid)
+ {
+ if(topDiameter < this._funnelNeckSize.Width)
+ {
+ topDiameter = this._funnelNeckSize.Width;
+ }
+ if(bottomDiameter < this._funnelNeckSize.Width)
+ {
+ bottomDiameter = this._funnelNeckSize.Width;
+ }
+
+ // Adjust label position because segment is bent to make a neck
+ if(segmentInfo.StartWidth >= this._funnelNeckSize.Width &&
+ segmentInfo.EndWidth < this._funnelNeckSize.Width)
+ {
+ bottomDiameter = segmentInfo.EndWidth;
+ }
+ }
+
+ // Get Y position
+ labelInfo.Position.Y = (segmentInfo.Location + segmentInfo.Height / 2f) -
+ labelInfo.Size.Height / 2f;
+
+ // Get X position
+ if(labelInfo.Style == FunnelLabelStyle.OutsideInColumn)
+ {
+ if(labelInfo.OutsidePlacement == FunnelLabelPlacement.Right)
+ {
+ labelInfo.Position.X = plotAreaPositionAbs.Right +
+ 4f * labelSpacing.Width;
+
+ // Set callout line coordinates
+ if(!this.isPyramid)
+ {
+ labelInfo.CalloutPoint1.X = plotAreaCenterXAbs +
+ Math.Max(this._funnelNeckSize.Width/2f, (topDiameter + bottomDiameter) / 4f);
+ }
+ else
+ {
+ labelInfo.CalloutPoint1.X = plotAreaCenterXAbs +
+ (topDiameter + bottomDiameter) / 4f;
+ }
+ labelInfo.CalloutPoint2.X = labelInfo.Position.X;
+ }
+ else
+ {
+ labelInfo.Position.X = plotAreaPositionAbs.X -
+ labelInfo.Size.Width -
+ 4f * labelSpacing.Width;
+
+ // Set callout line coordinates
+ if(!this.isPyramid)
+ {
+ labelInfo.CalloutPoint1.X = plotAreaCenterXAbs -
+ Math.Max(this._funnelNeckSize.Width/2f, (topDiameter + bottomDiameter) / 4f);
+ }
+ else
+ {
+ labelInfo.CalloutPoint1.X = plotAreaCenterXAbs -
+ (topDiameter + bottomDiameter) / 4f;
+ }
+ labelInfo.CalloutPoint2.X = labelInfo.Position.Right;
+ }
+
+ // Fill rest of coordinates required for the callout line
+ labelInfo.CalloutPoint1.Y = segmentInfo.Location + segmentInfo.Height / 2f;
+ labelInfo.CalloutPoint2.Y = labelInfo.CalloutPoint1.Y;
+ }
+ else
+ {
+ if(labelInfo.OutsidePlacement == FunnelLabelPlacement.Right)
+ {
+ labelInfo.Position.X = plotAreaCenterXAbs +
+ (topDiameter + bottomDiameter) / 4f +
+ 4f * labelSpacing.Width;
+ }
+ else
+ {
+ labelInfo.Position.X = plotAreaCenterXAbs -
+ labelInfo.Size.Width -
+ (topDiameter + bottomDiameter) / 4f -
+ 4f * labelSpacing.Width;
+ }
+ }
+ }
+ else
+ {
+ // Use bottom part of the segment for the last point
+ if(lastLabel)
+ {
+ if(labelInfo.OutsidePlacement == FunnelLabelPlacement.Right)
+ {
+ labelInfo.Position.X = plotAreaCenterXAbs +
+ segmentInfo.EndWidth / 2f +
+ 4f * labelSpacing.Width;
+ }
+ else
+ {
+ labelInfo.Position.X = plotAreaCenterXAbs -
+ labelInfo.Size.Width -
+ segmentInfo.EndWidth / 2f -
+ 4f * labelSpacing.Width;
+ }
+ labelInfo.Position.Y = segmentInfo.Location +
+ segmentInfo.Height -
+ labelInfo.Size.Height / 2f;
+ }
+ else
+ {
+ if(labelInfo.OutsidePlacement == FunnelLabelPlacement.Right)
+ {
+ labelInfo.Position.X = plotAreaCenterXAbs +
+ segmentInfo.StartWidth / 2f +
+ 4f * labelSpacing.Width;
+ }
+ else
+ {
+ labelInfo.Position.X = plotAreaCenterXAbs -
+ labelInfo.Size.Width -
+ segmentInfo.StartWidth / 2f -
+ 4f * labelSpacing.Width;
+ }
+ labelInfo.Position.Y = segmentInfo.Location -
+ labelInfo.Size.Height / 2f;
+ }
+
+ if(labelInfo.Style == FunnelLabelStyle.OutsideInColumn)
+ {
+ if(labelInfo.OutsidePlacement == FunnelLabelPlacement.Right)
+ {
+ labelInfo.Position.X = plotAreaPositionAbs.Right +
+ 4f * labelSpacing.Width;
+
+ // Set callout line coordinates
+ labelInfo.CalloutPoint1.X = plotAreaCenterXAbs +
+ ( (lastLabel) ? segmentInfo.EndWidth : segmentInfo.StartWidth) / 2f;
+ labelInfo.CalloutPoint2.X = labelInfo.Position.X;
+
+ }
+ else
+ {
+ labelInfo.Position.X = plotAreaPositionAbs.X -
+ labelInfo.Size.Width -
+ 4f * labelSpacing.Width;
+
+ // Set callout line coordinates
+ labelInfo.CalloutPoint1.X = plotAreaCenterXAbs -
+ ( (lastLabel) ? segmentInfo.EndWidth : segmentInfo.StartWidth) / 2f;
+ labelInfo.CalloutPoint2.X = labelInfo.Position.Right;
+ }
+
+ // Fill rest of coordinates required for the callout line
+ labelInfo.CalloutPoint1.Y = segmentInfo.Location;
+ if(lastLabel)
+ {
+ labelInfo.CalloutPoint1.Y += segmentInfo.Height;
+ }
+ labelInfo.CalloutPoint2.Y = labelInfo.CalloutPoint1.Y;
+
+ }
+ }
+ }
+
+ //******************************************************
+ //** Labels are placed INSIDE of the funnel
+ //******************************************************
+ else if(labelInfo.Style == FunnelLabelStyle.Inside)
+ {
+ // Define position
+ labelInfo.Position.X = plotAreaCenterXAbs - labelInfo.Size.Width / 2f;
+ if( this._funnelStyle == FunnelStyle.YIsHeight )
+ {
+ labelInfo.Position.Y = (segmentInfo.Location + segmentInfo.Height / 2f) -
+ labelInfo.Size.Height / 2f;
+ if(labelInfo.VerticalAlignment == FunnelLabelVerticalAlignment.Top)
+ {
+ labelInfo.Position.Y -= segmentInfo.Height / 2f - labelInfo.Size.Height / 2f - labelSpacing.Height;
+ }
+ else if(labelInfo.VerticalAlignment == FunnelLabelVerticalAlignment.Bottom)
+ {
+ labelInfo.Position.Y += segmentInfo.Height / 2f - labelInfo.Size.Height / 2f - labelSpacing.Height;
+ }
+ }
+ else
+ {
+ labelInfo.Position.Y = segmentInfo.Location - labelInfo.Size.Height / 2f;
+ if(labelInfo.VerticalAlignment == FunnelLabelVerticalAlignment.Top)
+ {
+ labelInfo.Position.Y -= labelInfo.Size.Height / 2f + labelSpacing.Height;
+ }
+ else if(labelInfo.VerticalAlignment == FunnelLabelVerticalAlignment.Bottom)
+ {
+ labelInfo.Position.Y += labelInfo.Size.Height / 2f + labelSpacing.Height;
+ }
+
+ // Use bottom part of the segment for the last point
+ if(lastLabel)
+ {
+ labelInfo.Position.Y += segmentInfo.Height;
+ }
+ }
+
+ // Adjust label Y position in 3D
+ if(this.Area.Area3DStyle.Enable3D)
+ {
+ labelInfo.Position.Y += (float)( ( (segmentInfo.EndWidth + segmentInfo.StartWidth) / 4f) * Math.Sin(this._rotation3D / 180F * Math.PI) );
+ }
+ }
+
+ //******************************************************
+ //** Check if label overlaps any previous label
+ //******************************************************
+ int interation = 0;
+ while( IsLabelsOverlap(labelInfo) && interation < 1000)
+ {
+ float shiftSize = (this.isPyramid) ? -3f : 3f;
+
+ // Move label down
+ labelInfo.Position.Y += shiftSize;
+
+ // Move callout second point down
+ if(!labelInfo.CalloutPoint2.IsEmpty)
+ {
+ labelInfo.CalloutPoint2.Y += shiftSize;
+ }
+
+ ++interation;
+ }
+
+ }
+ }
+ }
+
+ /// <summary>
+ /// Checks if specified label overlaps any previous labels.
+ /// </summary>
+ /// <param name="testLabelInfo">Label to test.</param>
+ /// <returns>True if labels overlapp.</returns>
+ private bool IsLabelsOverlap(FunnelPointLabelInfo testLabelInfo)
+ {
+ // Increase rectangle size by 1 pixel
+ RectangleF rect = testLabelInfo.Position;
+ rect.Inflate(1f, 1f);
+
+ // Increase label rectangle if border is drawn around the label
+ if(!testLabelInfo.Point.LabelBackColor.IsEmpty ||
+ (testLabelInfo.Point.LabelBorderWidth > 0 &&
+ !testLabelInfo.Point.LabelBorderColor.IsEmpty &&
+ testLabelInfo.Point.LabelBorderDashStyle != ChartDashStyle.NotSet) )
+ {
+ rect.Inflate(4f, 4f);
+ }
+
+ //Loop through all labels
+ foreach(FunnelPointLabelInfo labelInfo in this.labelInfoList)
+ {
+ // Stop searching
+ if(labelInfo.PointIndex == testLabelInfo.PointIndex)
+ {
+ break;
+ }
+
+ // Check if label position overlaps
+ if(!labelInfo.Position.IsEmpty &&
+ labelInfo.Position.IntersectsWith(rect) )
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /// <summary>
+ /// Gets label style of the data point.
+ /// </summary>
+ /// <returns>Label style of the data point.</returns>
+ private FunnelLabelStyle GetLabelStyle(DataPointCustomProperties properties)
+ {
+ // Set default label style
+ FunnelLabelStyle labelStyle = FunnelLabelStyle.OutsideInColumn;
+
+ // Get string value of the custom attribute
+ string attrValue = properties[this.funnelLabelStyleAttributeName];
+ if(attrValue != null && attrValue.Length > 0)
+ {
+ // Convert string to the labels style
+ try
+ {
+ labelStyle = (FunnelLabelStyle)Enum.Parse(typeof(FunnelLabelStyle), attrValue, true);
+ }
+ catch
+ {
+ throw(new InvalidOperationException( SR.ExceptionCustomAttributeValueInvalid(labelStyle.ToString(), this.funnelLabelStyleAttributeName) ) );
+ }
+ }
+ return labelStyle;
+ }
+
+ #endregion // Labels Methods
+
+ #region Position Methods
+
+ /// <summary>
+ /// Calculate the spacing required for the labels.
+ /// </summary>
+ private void GetPlotAreaSpacing()
+ {
+ // Provide small spacing on the sides of chart area
+ this.plotAreaSpacing = new RectangleF(1f, 1f, 1f, 1f);
+
+ // Get plotting area position
+ this.PlotAreaPosition = GetPlotAreaPosition();
+
+ // Get list of segments
+ this.segmentList = GetFunnelSegmentPositions();
+
+ // If plotting area position is automatic
+ if( Area.InnerPlotPosition.Auto )
+ {
+ // Set a position so that data labels fit
+ // This method is called several time to adjust label position while
+ // funnel side angle is changed
+ int iteration = 0;
+ while(!FitPointLabels() && iteration < 5)
+ {
+ iteration++;
+ }
+ }
+ else
+ {
+ // Just get labels position
+ GetLabelsPosition();
+ }
+
+ }
+
+ /// <summary>
+ /// Gets a rectangle in relative coordinates where the funnel will chart
+ /// will be drawn.
+ /// </summary>
+ /// <returns>Plotting are of the chart in relative coordinates.</returns>
+ private RectangleF GetPlotAreaPosition()
+ {
+ // Get plotting area rectangle position
+ RectangleF plotAreaPosition = ( Area.InnerPlotPosition.Auto ) ?
+ Area.Position.ToRectangleF() : Area.PlotAreaPosition.ToRectangleF();
+
+ // NOTE: Fixes issue #4085
+ // Do not allow decreasing of the plot area height more than 50%
+ if(plotAreaSpacing.Y > plotAreaPosition.Height / 2f)
+ {
+ plotAreaSpacing.Y = plotAreaPosition.Height / 2f;
+ }
+ if(plotAreaSpacing.Height > plotAreaPosition.Height / 2f)
+ {
+ plotAreaSpacing.Height = plotAreaPosition.Height / 2f;
+ }
+
+ // Decrease plotting are position using pre-calculated ratio
+ plotAreaPosition.X += plotAreaSpacing.X;
+ plotAreaPosition.Y += plotAreaSpacing.Y;
+ plotAreaPosition.Width -= plotAreaSpacing.X + plotAreaSpacing.Width;
+ plotAreaPosition.Height -= plotAreaSpacing.Y + plotAreaSpacing.Height;
+
+ // Apply vertical spacing on top and bottom to fit the 3D surfaces
+ if(this.Area.Area3DStyle.Enable3D)
+ {
+ // Convert position to pixels
+ RectangleF plotAreaPositionAbs = this.Graph.GetAbsoluteRectangle(plotAreaPosition);
+
+ // Funnel chart process only first series in the chart area
+ // and cannot be combined with any other chart types.
+ Series series = GetDataSeries();
+ if( series != null )
+ {
+ // Get 3D funnel rotation angle (from 10 to -10)
+ this._rotation3D = GetFunnelRotation(series);
+ }
+
+ // Get top and bottom spacing
+ float topSpacing = (float)Math.Abs( (plotAreaPositionAbs.Width/ 2f) * Math.Sin(this._rotation3D / 180F * Math.PI) );
+ float bottomSpacing = (float)Math.Abs( (plotAreaPositionAbs.Width/ 2f) * Math.Sin(this._rotation3D / 180F * Math.PI) );
+
+ // Adjust position
+ if(this.isPyramid)
+ {
+ // Only bottom spacing for the pyramid
+ plotAreaPositionAbs.Height -= bottomSpacing;
+ }
+ else
+ {
+ // Add top/bottom spacing
+ plotAreaPositionAbs.Y += topSpacing;
+ plotAreaPositionAbs.Height -= topSpacing + bottomSpacing;
+ }
+
+ // Convert position back to relative coordinates
+ plotAreaPosition = this.Graph.GetRelativeRectangle(plotAreaPositionAbs);
+ }
+
+ return plotAreaPosition;
+ }
+
+ #endregion // Position Methods
+
+ #region Helper Methods
+
+ /// <summary>
+ /// Checks for minimum segment height.
+ /// </summary>
+ /// <param name="height">Current segment height.</param>
+ /// <returns>Adjusted segment height.</returns>
+ protected float CheckMinHeight(float height)
+ {
+ // When point gap is used do not allow to have the segment heigth to be zero.
+ float minSize = Math.Min(2f, this.funnelSegmentGap / 2f);
+ if(this.funnelSegmentGap > 0 &&
+ height < minSize)
+ {
+ return minSize;
+ }
+
+ return height;
+ }
+
+ /// <summary>
+ /// Gets minimum point height in pixels.
+ /// </summary>
+ /// <returns>Minimum point height in pixels.</returns>
+ private void GetFunnelMinPointHeight(DataPointCustomProperties properties)
+ {
+ // Set default minimum point size
+ this._funnelMinPointHeight = 0f;
+
+ // Get string value of the custom attribute
+ string attrValue = properties[this.funnelPointMinHeight];
+ if (attrValue != null && attrValue.Length > 0)
+ {
+ // Convert string to the point gap size
+
+ float pointHeight;
+ bool parseSucceed = float.TryParse(attrValue, NumberStyles.Any, CultureInfo.InvariantCulture, out pointHeight);
+ if (parseSucceed)
+ {
+ this._funnelMinPointHeight = pointHeight;
+ }
+
+ if (!parseSucceed || this._funnelMinPointHeight < 0f || this._funnelMinPointHeight > 100f)
+ {
+ throw (new InvalidOperationException(SR.ExceptionFunnelMinimumPointHeightAttributeInvalid));
+ }
+
+ // Check if specified value is too big
+ this._funnelMinPointHeight = (float)(this.yValueTotal * this._funnelMinPointHeight / 100f);
+
+ // Get data statistic again using Min value
+ GetDataPointValuesStatistic();
+ }
+
+ return;
+ }
+
+ /// <summary>
+ /// Gets 3D funnel rotation angle.
+ /// </summary>
+ /// <returns>Rotation angle.</returns>
+ private int GetFunnelRotation(DataPointCustomProperties properties)
+ {
+ // Set default gap size
+ int angle = 5;
+
+ // Get string value of the custom attribute
+ string attrValue = properties[this.funnelRotationAngleAttributeName];
+ if (attrValue != null && attrValue.Length > 0)
+ {
+ // Convert string to the point gap size
+
+ int a;
+ bool parseSucceed = int.TryParse(attrValue, NumberStyles.Any, CultureInfo.InvariantCulture, out a);
+ if (parseSucceed)
+ {
+ angle = a;
+ }
+
+ // Validate attribute value
+ if (!parseSucceed || angle < -10 || angle > 10)
+ {
+ throw (new InvalidOperationException(SR.ExceptionFunnelAngleRangeInvalid));
+ }
+ }
+
+ return angle;
+ }
+
+ /// <summary>
+ /// Gets callout line color.
+ /// </summary>
+ /// <returns>Callout line color.</returns>
+ private Color GetCalloutLineColor(DataPointCustomProperties properties)
+ {
+ // Set default gap size
+ Color color = Color.Black;
+
+ // Get string value of the custom attribute
+ string attrValue = properties[CustomPropertyName.CalloutLineColor];
+ if(attrValue != null && attrValue.Length > 0)
+ {
+ // Convert string to Color
+ bool failed = false;
+ ColorConverter colorConverter = new ColorConverter();
+ try
+ {
+ color = (Color)colorConverter.ConvertFromInvariantString(attrValue);
+ }
+ catch (ArgumentException)
+ {
+ failed = true;
+ }
+ catch (NotSupportedException)
+ {
+ failed = true;
+ }
+
+ // In case of an error try to convert using local settings
+ if(failed)
+ {
+ try
+ {
+ color = (Color)colorConverter.ConvertFromString(attrValue);
+ }
+ catch(ArgumentException)
+ {
+ throw(new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid( attrValue, "CalloutLineColor") ) );
+ }
+ }
+
+ }
+
+ return color;
+ }
+
+ /// <summary>
+ /// Gets funnel neck size when shape of the funnel do not change.
+ /// </summary>
+ /// <returns>Funnel neck width and height.</returns>
+ private SizeF GetFunnelNeckSize(DataPointCustomProperties properties)
+ {
+ // Set default gap size
+ SizeF neckSize = new SizeF(5f, 5f);
+
+ // Get string value of the custom attribute
+ string attrValue = properties[CustomPropertyName.FunnelNeckWidth];
+ if (attrValue != null && attrValue.Length > 0)
+ {
+ // Convert string to the point gap size
+
+ float w;
+ bool parseSucceed = float.TryParse(attrValue, NumberStyles.Any, CultureInfo.InvariantCulture, out w);
+ if (parseSucceed)
+ {
+ neckSize.Width = w;
+ }
+
+ // Validate attribute value
+ if (!parseSucceed || neckSize.Width < 0 || neckSize.Width > 100)
+ {
+ throw (new InvalidOperationException(SR.ExceptionFunnelNeckWidthInvalid));
+ }
+ }
+
+ // Get string value of the custom attribute
+ attrValue = properties[CustomPropertyName.FunnelNeckHeight];
+ if (attrValue != null && attrValue.Length > 0)
+ {
+ // Convert string to the point gap size
+ float h;
+ bool parseSucceed = float.TryParse(attrValue, NumberStyles.Any, CultureInfo.InvariantCulture, out h);
+ if (parseSucceed)
+ {
+ neckSize.Height = h;
+ }
+
+
+ if (!parseSucceed || neckSize.Height < 0 || neckSize.Height > 100)
+ {
+ throw (new InvalidOperationException(SR.ExceptionFunnelNeckHeightInvalid));
+ }
+ }
+
+ // Make sure the neck size do not exceed the plotting area size
+ if(neckSize.Height > this.PlotAreaPosition.Height/2f)
+ {
+ neckSize.Height = this.PlotAreaPosition.Height/2f;
+ }
+ if(neckSize.Width > this.PlotAreaPosition.Width/2f)
+ {
+ neckSize.Width = this.PlotAreaPosition.Width/2f;
+ }
+
+ // Convert from relative coordinates to pixels
+ return this.Graph.GetAbsoluteSize(neckSize);
+ }
+
+ /// <summary>
+ /// Gets gap between points in pixels.
+ /// </summary>
+ /// <returns>Gap between funnel points.</returns>
+ private float GetFunnelPointGap(DataPointCustomProperties properties)
+ {
+ // Set default gap size
+ float gapSize = 0f;
+
+ // Get string value of the custom attribute
+ string attrValue = properties[this.funnelPointGapAttributeName];
+ if (attrValue != null && attrValue.Length > 0)
+ {
+ // Convert string to the point gap size
+
+ float gs;
+ bool parseSucceed = float.TryParse(attrValue, NumberStyles.Any, CultureInfo.InvariantCulture, out gs);
+ if (parseSucceed)
+ {
+ gapSize = gs;
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid(attrValue, this.funnelPointGapAttributeName)));
+ }
+
+ // Make sure the total gap size for all points do not exceed the total height of the plotting area
+ float maxGapSize = this.PlotAreaPosition.Height / (this.pointNumber - ((ShouldDrawFirstPoint()) ? 1 : 2));
+ if (gapSize > maxGapSize)
+ {
+ gapSize = maxGapSize;
+ }
+ if (gapSize < 0)
+ {
+ gapSize = 0;
+ }
+
+ // Convert from relative coordinates to pixels
+ gapSize = this.Graph.GetAbsoluteSize(new SizeF(gapSize, gapSize)).Height;
+ }
+
+ return gapSize;
+ }
+
+ /// <summary>
+ /// Gets funnel drawing style.
+ /// </summary>
+ /// <returns>funnel drawing style.</returns>
+ private FunnelStyle GetFunnelStyle(DataPointCustomProperties properties)
+ {
+ // Set default funnel drawing style
+ FunnelStyle drawingStyle = FunnelStyle.YIsHeight;
+
+ // Get string value of the custom attribute
+ if(!this.isPyramid)
+ {
+ string attrValue = properties[CustomPropertyName.FunnelStyle];
+ if(attrValue != null && attrValue.Length > 0)
+ {
+ // Convert string to the labels style
+ try
+ {
+ drawingStyle = (FunnelStyle)Enum.Parse(typeof(FunnelStyle), attrValue, true);
+ }
+ catch
+ {
+ throw(new InvalidOperationException( SR.ExceptionCustomAttributeValueInvalid( attrValue, "FunnelStyle") ) );
+ }
+ }
+ }
+ return drawingStyle;
+ }
+
+ /// <summary>
+ /// Gets outside labels placement.
+ /// </summary>
+ /// <returns>Outside labels placement.</returns>
+ private FunnelLabelPlacement GetOutsideLabelPlacement(DataPointCustomProperties properties)
+ {
+ // Set default vertical alignment for the inside labels
+ FunnelLabelPlacement placement = FunnelLabelPlacement.Right;
+
+ // Get string value of the custom attribute
+ string attrValue = properties[this.funnelOutsideLabelPlacementAttributeName];
+ if(attrValue != null && attrValue.Length > 0)
+ {
+ // Convert string to the labels placement
+ try
+ {
+ placement = (FunnelLabelPlacement)Enum.Parse(typeof(FunnelLabelPlacement), attrValue, true);
+ }
+ catch
+ {
+ throw (new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid(attrValue, this.funnelOutsideLabelPlacementAttributeName )));
+ }
+ }
+ return placement;
+ }
+
+ /// <summary>
+ /// Gets inside labels vertical alignment.
+ /// </summary>
+ /// <returns>Inside labels vertical alignment.</returns>
+ private FunnelLabelVerticalAlignment GetInsideLabelAlignment(DataPointCustomProperties properties)
+ {
+ // Set default vertical alignment for the inside labels
+ FunnelLabelVerticalAlignment alignment = FunnelLabelVerticalAlignment.Center;
+
+ // Get string value of the custom attribute
+ string attrValue = properties[this.funnelInsideLabelAlignmentAttributeName];
+ if(attrValue != null && attrValue.Length > 0)
+ {
+ // Convert string to the labels style
+ try
+ {
+ alignment = (FunnelLabelVerticalAlignment)Enum.Parse(typeof(FunnelLabelVerticalAlignment), attrValue, true);
+ }
+ catch
+ {
+ throw (new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid(attrValue, this.funnelInsideLabelAlignmentAttributeName)));
+ }
+ }
+ return alignment;
+ }
+
+ /// <summary>
+ /// Gets funnel 3D drawing style.
+ /// </summary>
+ /// <returns>funnel drawing style.</returns>
+ private Funnel3DDrawingStyle GetFunnel3DDrawingStyle(DataPointCustomProperties properties)
+ {
+ // Set default funnel drawing style
+ Funnel3DDrawingStyle drawingStyle = (this.isPyramid) ?
+ Funnel3DDrawingStyle.SquareBase : Funnel3DDrawingStyle.CircularBase;
+
+ // Get string value of the custom attribute
+ string attrValue = properties[funnel3DDrawingStyleAttributeName];
+ if(attrValue != null && attrValue.Length > 0)
+ {
+ // Convert string to the labels style
+ try
+ {
+ drawingStyle = (Funnel3DDrawingStyle)Enum.Parse(typeof(Funnel3DDrawingStyle), attrValue, true);
+ }
+ catch
+ {
+ throw (new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid(attrValue, funnel3DDrawingStyleAttributeName) ) );
+ }
+ }
+
+ return drawingStyle;
+ }
+
+ /// <summary>
+ /// Get data point Y and X values statistics:
+ /// - Total of all Y values
+ /// - Total of all X values
+ /// - Maximum Y value
+ /// Negative values are treated as positive.
+ /// </summary>
+ private void GetDataPointValuesStatistic()
+ {
+ // Get funnel chart type series
+ Series series = GetDataSeries();
+ if( series != null )
+ {
+ // Reset values
+ this.yValueTotal = 0.0;
+ this._xValueTotal = 0.0;
+ this._yValueMax = 0.0;
+ this.pointNumber = 0;
+
+ // Get value type
+ this._valuePercentages = null;
+ PyramidValueType valueType = this.GetPyramidValueType( series );
+ if(valueType == PyramidValueType.Surface)
+ {
+ // Calculate the total surface area
+ double triangleArea = 0.0;
+ int pointIndex = 0;
+ foreach( DataPoint point in series.Points )
+ {
+ // Ignore empty points
+ if( !point.IsEmpty )
+ {
+ // Get Y value
+ triangleArea += GetYValue(point, pointIndex);
+ }
+ ++pointIndex;
+ }
+
+ // Calculate the base
+ double triangleHeight = 100.0;
+ double triangleBase = (2* triangleArea) / triangleHeight;
+
+ // Calculate the base to height ratio
+ double baseRatio = triangleBase / triangleHeight;
+
+ // Calcuate the height percentage for each value
+ double[] percentages = new double[series.Points.Count];
+ double sumArea = 0.0;
+ for(int loop = 0; loop < percentages.Length; loop++)
+ {
+ double yValue = GetYValue(series.Points[loop], loop);
+ sumArea += yValue;
+ percentages[loop] = Math.Sqrt((2 * sumArea) / baseRatio);
+ }
+ this._valuePercentages = percentages;
+ }
+
+ // Loop through all ponts in the data series
+ foreach( DataPoint point in series.Points )
+ {
+ // Ignore empty points
+ if( !point.IsEmpty )
+ {
+ // Get Y value
+ double yValue = GetYValue(point, this.pointNumber);
+
+ // Get data point Y and X values statistics
+ this.yValueTotal += yValue;
+ this._yValueMax = Math.Max(this._yValueMax, yValue);
+ this._xValueTotal += GetXValue(point);
+ }
+
+ ++this.pointNumber;
+ }
+
+ }
+ }
+
+ /// <summary>
+ /// Gets funnel chart series that belongs to the current chart area.
+ /// Method also checks that only one visible Funnel series exists in the chart area.
+ /// </summary>
+ /// <returns>Funnel chart type series.</returns>
+ private Series GetDataSeries()
+ {
+ // Check if funnel series was already found
+ if(this._chartTypeSeries == null)
+ {
+ // Loop through all series
+ Series funnelSeries = null;
+ foreach( Series series in Common.DataManager.Series )
+ {
+ // Check if series is visible and belong to the current chart area
+ if( series.IsVisible() &&
+ series.ChartArea == this.Area.Name )
+ {
+ // Check series chart type is Funnel
+ if( String.Compare( series.ChartTypeName, this.Name, true, System.Globalization.CultureInfo.CurrentCulture ) == 0 )
+ {
+ if(funnelSeries == null)
+ {
+ funnelSeries = series;
+ }
+ }
+ else if(!this.Common.ChartPicture.SuppressExceptions)
+ {
+ // Funnel chart can not be combined with other chart type
+ throw (new InvalidOperationException(SR.ExceptionFunnelCanNotCombine));
+ }
+ }
+ }
+
+ // Remember the chart type series
+ this._chartTypeSeries = funnelSeries;
+ }
+
+ return this._chartTypeSeries;
+ }
+
+ /// <summary>
+ /// Gets pyramid value type. Each point value may represent a "Linear" height of
+ /// the segment or "Surface" of the segment.
+ /// </summary>
+ /// <returns>Pyramid value type.</returns>
+ private PyramidValueType GetPyramidValueType(DataPointCustomProperties properties)
+ {
+ // Set default funnel drawing style
+ PyramidValueType valueType = PyramidValueType.Linear;
+
+ // Get string value of the custom attribute
+ if(this.isPyramid)
+ {
+ string attrValue = properties[CustomPropertyName.PyramidValueType];
+ if(attrValue != null && attrValue.Length > 0)
+ {
+ // Convert string to the labels style
+ try
+ {
+ valueType = (PyramidValueType)Enum.Parse(typeof(PyramidValueType), attrValue, true);
+ }
+ catch
+ {
+ throw (new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid(attrValue,"PyramidValueType") ) );
+ }
+ }
+ }
+ return valueType;
+ }
+
+ #endregion // Helper Methods
+
+ #region Y & X values related methods
+
+ /// <summary>
+ /// Helper function, which returns the Y value of the point.
+ /// </summary>
+ /// <param name="point">Point object.</param>
+ /// <param name="pointIndex">Point index.</param>
+ /// <returns>Y value of the point.</returns>
+ virtual public double GetYValue(DataPoint point, int pointIndex)
+ {
+ double yValue = 0.0;
+ if( !point.IsEmpty )
+ {
+ // Get Y value
+ yValue = point.YValues[0];
+
+ // Adjust point value
+ if(this._valuePercentages != null &&
+ this._valuePercentages.Length > pointIndex )
+ {
+ yValue = yValue / 100.0 * this._valuePercentages[pointIndex];
+ }
+
+ if(this.Area.AxisY.IsLogarithmic)
+ {
+ yValue = Math.Abs(Math.Log( yValue, this.Area.AxisY.LogarithmBase ));
+ }
+ else
+ {
+ yValue = Math.Abs( yValue );
+ if(yValue < this._funnelMinPointHeight)
+ {
+ yValue = this._funnelMinPointHeight;
+ }
+ }
+ }
+ return yValue;
+ }
+
+ /// <summary>
+ /// Helper function, which returns the X value of the point.
+ /// </summary>
+ /// <param name="point">Point object.</param>
+ /// <returns>X value of the point.</returns>
+ virtual public double GetXValue(DataPoint point)
+ {
+ if(this.Area.AxisX.IsLogarithmic)
+ {
+ return Math.Abs(Math.Log( point.XValue, this.Area.AxisX.LogarithmBase ));
+ }
+ return Math.Abs(point.XValue);
+ }
+
+ /// <summary>
+ /// Helper function, which returns the Y value of the point.
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="area">Chart area the series belongs to.</param>
+ /// <param name="series">Sereis of the point.</param>
+ /// <param name="point">Point object.</param>
+ /// <param name="pointIndex">Index of the point.</param>
+ /// <param name="yValueIndex">Index of the Y value to get.</param>
+ /// <returns>Y value of the point.</returns>
+ virtual public double GetYValue(
+ CommonElements common,
+ ChartArea area,
+ Series series,
+ DataPoint point,
+ int pointIndex,
+ int yValueIndex)
+ {
+ return point.YValues[yValueIndex];
+ }
+
+ #endregion // Y & X values related methods
+
+ #region SmartLabelStyle methods
+
+ /// <summary>
+ /// Adds markers position to the list. Used to check SmartLabelStyle overlapping.
+ /// </summary>
+ /// <param name="common">Common chart elements.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="series">Series values to be used.</param>
+ /// <param name="list">List to add to.</param>
+ public void AddSmartLabelMarkerPositions(CommonElements common, ChartArea area, Series series, ArrayList list)
+ {
+ // Fast Line chart type do not support labels
+ }
+
+ #endregion
+
+ #region IDisposable interface implementation
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected virtual void Dispose(bool disposing)
+ {
+ //Nothing to dispose at the base class.
+ }
+
+ /// <summary>
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// </summary>
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+ #endregion
+ }
+
+ /// <summary>
+ /// PyramidChart class overrides some of the functionality of FunnelChart class.
+ /// Most of drawing and othere processing is done in the FunnelChart.
+ /// </summary>
+ internal class PyramidChart : FunnelChart
+ {
+ #region Fields and Constructor
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public PyramidChart()
+ {
+ // Renering of the pyramid chart type
+ base.isPyramid = true;
+
+ // Pyramid chart type uses square base by default
+ base.round3DShape = false;
+
+ // Pyramid properties names
+ base.funnelLabelStyleAttributeName = CustomPropertyName.PyramidLabelStyle;
+ base.funnelPointGapAttributeName = CustomPropertyName.PyramidPointGap;
+ base.funnelRotationAngleAttributeName = CustomPropertyName.Pyramid3DRotationAngle;
+ base.funnelPointMinHeight = CustomPropertyName.PyramidMinPointHeight;
+ base.funnel3DDrawingStyleAttributeName = CustomPropertyName.Pyramid3DDrawingStyle;
+ base.funnelInsideLabelAlignmentAttributeName = CustomPropertyName.PyramidInsideLabelAlignment;
+ base.funnelOutsideLabelPlacementAttributeName = CustomPropertyName.PyramidOutsideLabelPlacement;
+ }
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ override public string Name { get{ return ChartTypeNames.Pyramid;}}
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Gets pyramid data point segment height and width.
+ /// </summary>
+ /// <param name="series">Chart type series.</param>
+ /// <param name="pointIndex">Data point index in the series.</param>
+ /// <param name="location">Segment top location. Bottom location if reversed drawing order.</param>
+ /// <param name="height">Returns the height of the segment.</param>
+ /// <param name="startWidth">Returns top width of the segment.</param>
+ /// <param name="endWidth">Returns botom width of the segment.</param>
+ protected override void GetPointWidthAndHeight(
+ Series series,
+ int pointIndex,
+ float location,
+ out float height,
+ out float startWidth,
+ out float endWidth)
+ {
+ PointF pointPositionAbs = PointF.Empty;
+
+ // Get plotting area position in pixels
+ RectangleF plotAreaPositionAbs = this.Graph.GetAbsoluteRectangle(this.PlotAreaPosition);
+
+ // Calculate total height of plotting area minus reserved space for the gaps
+ float plotAreaHeightAbs = plotAreaPositionAbs.Height -
+ this.funnelSegmentGap * (this.pointNumber - ((ShouldDrawFirstPoint()) ? 1 : 2) );
+ if(plotAreaHeightAbs < 0f)
+ {
+ plotAreaHeightAbs = 0f;
+ }
+
+ // Calculate segment height as a part of total Y values in series
+ height = (float)(plotAreaHeightAbs * (GetYValue(series.Points[pointIndex], pointIndex) / this.yValueTotal));
+
+ // Check for minimum segment height
+ height = CheckMinHeight(height);
+
+ // Get intersection point of the horizontal line at the start of the segment
+ // with the left pre-defined wall of the funnel.
+ PointF startIntersection = ChartGraphics.GetLinesIntersection(
+ plotAreaPositionAbs.X, location - height,
+ plotAreaPositionAbs.Right, location - height,
+ plotAreaPositionAbs.X, plotAreaPositionAbs.Bottom,
+ plotAreaPositionAbs.X + plotAreaPositionAbs.Width / 2f, plotAreaPositionAbs.Y );
+ if(startIntersection.X > (plotAreaPositionAbs.X + plotAreaPositionAbs.Width / 2f) )
+ {
+ startIntersection.X = plotAreaPositionAbs.X + plotAreaPositionAbs.Width / 2f;
+ }
+
+ // Get intersection point of the horizontal line at the end of the segment
+ // with the left pre-defined wall of the funnel.
+ PointF endIntersection = ChartGraphics.GetLinesIntersection(
+ plotAreaPositionAbs.X, location,
+ plotAreaPositionAbs.Right, location,
+ plotAreaPositionAbs.X, plotAreaPositionAbs.Bottom,
+ plotAreaPositionAbs.X + plotAreaPositionAbs.Width / 2f, plotAreaPositionAbs.Y );
+ if(endIntersection.X > (plotAreaPositionAbs.X + plotAreaPositionAbs.Width / 2f))
+ {
+ endIntersection.X = plotAreaPositionAbs.X + plotAreaPositionAbs.Width / 2f;
+ }
+
+ // Get segment start and end width
+ startWidth = (float)Math.Abs( plotAreaPositionAbs.X + plotAreaPositionAbs.Width / 2f -
+ startIntersection.X) * 2f;
+ endWidth = (float)Math.Abs( plotAreaPositionAbs.X + plotAreaPositionAbs.Width / 2f -
+ endIntersection.X) * 2f;
+
+ // Set point position for annotation anchoring
+ pointPositionAbs = new PointF(
+ plotAreaPositionAbs.X + plotAreaPositionAbs.Width / 2f,
+ location - height / 2f);
+
+ // Set pre-calculated point position
+ series.Points[pointIndex].positionRel = Graph.GetRelativePoint(pointPositionAbs);
+ }
+
+ #endregion // Methods
+ }
+
+ /// <summary>
+ /// Helper data structure used to store information about single funnel segment.
+ /// </summary>
+ internal class FunnelSegmentInfo
+ {
+ #region Fields
+
+ // ----osiated data point
+ public DataPoint Point = null;
+
+ // Data point index
+ public int PointIndex = 0;
+
+ // Segment top position
+ public float Location = 0f;
+
+ // Segment height
+ public float Height = 0f;
+
+ // Segment top width
+ public float StartWidth = 0f;
+
+ // Segment bottom width
+ public float EndWidth = 0f;
+
+ // Segment has nothing on the top
+ public bool NothingOnTop = false;
+
+ // Segment has nothing on the bottom
+ public bool NothingOnBottom = false;
+
+ #endregion // Fields
+ }
+
+ /// <summary>
+ /// Helper data structure used to store information about funnel data point label.
+ /// </summary>
+ internal class FunnelPointLabelInfo
+ {
+ #region Fields
+
+ // ----osiated data point
+ public DataPoint Point = null;
+
+ // Data point index
+ public int PointIndex = 0;
+
+ // Label text
+ public string Text = string.Empty;
+
+ // Data point label size
+ public SizeF Size = SizeF.Empty;
+
+ // Position of the data point label
+ public RectangleF Position = RectangleF.Empty;
+
+ // Label style
+ public FunnelLabelStyle Style = FunnelLabelStyle.OutsideInColumn;
+
+ // Inside label vertical alignment
+ public FunnelLabelVerticalAlignment VerticalAlignment = FunnelLabelVerticalAlignment.Center;
+
+ // Outside labels placement
+ public FunnelLabelPlacement OutsidePlacement = FunnelLabelPlacement.Right;
+
+ // Label callout first point
+ public PointF CalloutPoint1 = PointF.Empty;
+
+ // Label callout second point
+ public PointF CalloutPoint2 = PointF.Empty;
+
+ #endregion // Fields
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/KagiChart.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/KagiChart.cs
new file mode 100644
index 00000000000..a722479e7a6
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/KagiChart.cs
@@ -0,0 +1,996 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: KagiChart.cs
+//
+// Namespace: DataVisualization.Charting.ChartTypes
+//
+// Classes: Provides 2D and 3D drawing and hit testing of the
+// Kagi chart.
+//
+// Purpose:
+//
+// Kagi Chart Overview:
+// --------------------
+//
+// Kagi charts are believed to have been created around the time
+// that the Japanese stock market began trading in the 1870's. Kagi
+// charts display a series of connecting vertical lines where the
+// thickness and direction of the lines are dependent on the action
+// of the price value. These charts ignore the passage of time, but
+// can be used to illustrate the forces of supply and demand on a
+// security.
+//
+// When working with this type of chart, the following should be
+// taken into account:
+//
+// - The X values of data points are automatically indexed.
+//
+// - There is a formula applied to the original data before plotting,
+// which changes the number of points and their X/Y values.
+//
+// - Due to the data being recalculated we do not recommend setting
+// the minimum and/or maximum values for the X axis, since it cannot
+// be determined how many data points will actually get plotted.
+// However, if the axis' maximum or minimum is set then the Maximum
+// or Minimum properties should use data point index values.
+//
+// - Data point anchoring, used for annotations, is not supported
+// with this type of chart.
+//
+// Reviewed: AG - Microsoft 6, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Resources;
+using System.Reflection;
+using System.Collections;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.ComponentModel.Design;
+using System.Globalization;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+
+#else
+using System.Web.UI.DataVisualization.Charting;
+
+using System.Web.UI.DataVisualization.Charting.ChartTypes;
+using System.Web.UI.DataVisualization.Charting.Data;
+using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.ChartTypes
+#else
+namespace System.Web.UI.DataVisualization.Charting.ChartTypes
+#endif
+{
+ /// <summary>
+ /// KagiChart class provides 2D and 3D drawing and hit testing of
+ /// the Kagi chart.
+ /// </summary>
+ internal class KagiChart : StepLineChart
+ {
+ #region Fields
+
+ // Color used to draw up direction lines
+ internal Color kagiUpColor = Color.Empty;
+
+ // Current properties used for kagi line (1 up; -1 down; 0 none)
+ internal int currentKagiDirection = 0;
+
+ #endregion // Fields
+
+ #region Methods
+
+ /// <summary>
+ /// Prepares Kagi chart type for rendering.
+ /// </summary>
+ /// <param name="series">Series to be prepared.</param>
+ internal static void PrepareData(Series series)
+ {
+ // Check series chart type
+ if (String.Compare(series.ChartTypeName, ChartTypeNames.Kagi, StringComparison.OrdinalIgnoreCase) != 0 || !series.IsVisible())
+ {
+ return;
+ }
+
+ // Get reference to the chart control
+ Chart chart = series.Chart;
+ if(chart == null)
+ {
+ throw(new InvalidOperationException(SR.ExceptionKagiNullReference));
+ }
+
+ // Kagi chart may not be combined with any other chart types
+ ChartArea area = chart.ChartAreas[series.ChartArea];
+ foreach (Series currentSeries in chart.Series)
+ {
+ if (currentSeries.IsVisible() && currentSeries != series && area == chart.ChartAreas[currentSeries.ChartArea])
+ {
+ throw (new InvalidOperationException(SR.ExceptionKagiCanNotCombine));
+ }
+ }
+
+ // Create a temp series which will hold original series data points
+ string tempSeriesName = "KAGI_ORIGINAL_DATA_" + series.Name;
+ if (chart.Series.IndexOf(tempSeriesName) != -1)
+ {
+ return; // the temp series has already been added
+ }
+ Series seriesOriginalData = new Series(tempSeriesName, series.YValuesPerPoint);
+ seriesOriginalData.Enabled = false;
+ seriesOriginalData.IsVisibleInLegend = false;
+ chart.Series.Add(seriesOriginalData);
+ foreach(DataPoint dp in series.Points)
+ {
+ seriesOriginalData.Points.Add(dp);
+ }
+ series.Points.Clear();
+ if(series.IsCustomPropertySet("TempDesignData"))
+ {
+ seriesOriginalData["TempDesignData"] = "true";
+ }
+
+
+ // Remember prev. series parameters
+ series["OldXValueIndexed"] = series.IsXValueIndexed.ToString(CultureInfo.InvariantCulture);
+ series["OldYValuesPerPoint"] = series.YValuesPerPoint.ToString(CultureInfo.InvariantCulture);
+ series.IsXValueIndexed = true;
+
+ // Calculate date-time interval for indexed series
+ if(series.ChartArea.Length > 0 &&
+ series.IsXValueDateTime())
+ {
+ // Get X axis connected to the series
+ Axis xAxis = area.GetAxis(AxisName.X, series.XAxisType, series.XSubAxisName);
+
+ // Change interval for auto-calculated interval only
+ if(xAxis.Interval == 0 && xAxis.IntervalType == DateTimeIntervalType.Auto)
+ {
+ // Check if original data has X values set to date-time values and
+ // calculate min/max X values.
+ bool nonZeroXValues = false;
+ double minX = double.MaxValue;
+ double maxX = double.MinValue;
+ foreach(DataPoint dp in seriesOriginalData.Points)
+ {
+ if(!dp.IsEmpty)
+ {
+ if(dp.XValue != 0.0)
+ {
+ nonZeroXValues = true;
+ }
+ if(dp.XValue > maxX)
+ {
+ maxX = dp.XValue;
+ }
+ if(dp.XValue < minX)
+ {
+ minX = dp.XValue;
+ }
+ }
+ }
+
+ if(nonZeroXValues)
+ {
+ // Save flag that axis interval is automatic
+ series["OldAutomaticXAxisInterval"] = "true";
+
+ // Calculate and set axis date-time interval
+ DateTimeIntervalType intervalType = DateTimeIntervalType.Auto;
+ xAxis.interval = xAxis.CalcInterval(minX, maxX, true, out intervalType, series.XValueType);
+ xAxis.intervalType = intervalType;
+ }
+ }
+ }
+
+ // Calculate Kagi bricks data points values
+ FillKagiData(series, seriesOriginalData);
+ }
+
+ /// <summary>
+ /// Remove any changes done while preparing Kagi chart type for rendering.
+ /// </summary>
+ /// <param name="series">Series to be un-prepared.</param>
+ /// <returns>True if series was removed from collection.</returns>
+ internal static bool UnPrepareData(Series series)
+ {
+ if(series.Name.StartsWith("KAGI_ORIGINAL_DATA_", StringComparison.Ordinal))
+ {
+ // Get reference to the chart control
+ Chart chart = series.Chart;
+ if(chart == null)
+ {
+ throw (new InvalidOperationException(SR.ExceptionKagiNullReference));
+ }
+
+ // Get original Kagi series
+ Series kagiSeries = chart.Series[series.Name.Substring(19)];
+ Series.MovePositionMarkers(kagiSeries, series);
+ // Copy data back to original Kagi series
+ kagiSeries.Points.Clear();
+ if(!series.IsCustomPropertySet("TempDesignData"))
+ {
+ foreach(DataPoint dp in series.Points)
+ {
+ kagiSeries.Points.Add(dp);
+ }
+ }
+
+ // Restore series properties
+ bool xValIndexed;
+ bool parseSucceed = bool.TryParse(kagiSeries["OldXValueIndexed"], out xValIndexed);
+ kagiSeries.IsXValueIndexed = parseSucceed && xValIndexed;
+
+ int yValPerPoint;
+ parseSucceed = int.TryParse(kagiSeries["OldYValuesPerPoint"], NumberStyles.Any, CultureInfo.InvariantCulture, out yValPerPoint);
+ if (parseSucceed)
+ {
+ kagiSeries.YValuesPerPoint = yValPerPoint;
+ }
+
+ kagiSeries.DeleteCustomProperty("OldXValueIndexed");
+ kagiSeries.DeleteCustomProperty("OldYValuesPerPoint");
+
+ series["OldAutomaticXAxisInterval"] = "true";
+ if(kagiSeries.IsCustomPropertySet("OldAutomaticXAxisInterval"))
+ {
+ kagiSeries.DeleteCustomProperty("OldAutomaticXAxisInterval");
+
+ // Reset automatic interval for X axis
+ if(kagiSeries.ChartArea.Length > 0)
+ {
+ // Get X axis connected to the series
+ ChartArea area = chart.ChartAreas[kagiSeries.ChartArea];
+ Axis xAxis = area.GetAxis(AxisName.X, kagiSeries.XAxisType, kagiSeries.XSubAxisName);
+
+ xAxis.interval = 0.0;
+ xAxis.intervalType = DateTimeIntervalType.Auto;
+ }
+ }
+
+ // Remove series from the collection
+ chart.Series.Remove(series);
+ return true;
+ }
+
+ return false;
+ }
+
+ /// <summary>
+ /// Gets reversal amount of the kagi chart.
+ /// </summary>
+ /// <param name="series">Step line chart series used to dispaly the kagi chart.</param>
+ /// <param name="percentOfPrice">Returns reversal amount in percentage.</param>
+ private static double GetReversalAmount(Series series, out double percentOfPrice)
+ {
+ // Check "ReversalAmount" custom attribute
+ double reversalAmount = 1.0;
+ percentOfPrice = 3.0;
+ if (series.IsCustomPropertySet(CustomPropertyName.ReversalAmount))
+ {
+ string attrValue = series[CustomPropertyName.ReversalAmount].Trim();
+ bool usePercentage = attrValue.EndsWith("%", StringComparison.Ordinal);
+ if (usePercentage)
+ {
+ attrValue = attrValue.Substring(0, attrValue.Length - 1);
+ }
+
+ if (usePercentage)
+ {
+ double percent;
+ bool parseSucceed = double.TryParse(attrValue, NumberStyles.Any, CultureInfo.InvariantCulture, out percent);
+ if (parseSucceed)
+ {
+ percentOfPrice = percent;
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionKagiAttributeFormatInvalid("ReversalAmount")));
+ }
+ }
+ else
+ {
+ double amount;
+ bool parseSucceed = double.TryParse(attrValue, NumberStyles.Any, CultureInfo.InvariantCulture, out amount);
+ if (parseSucceed)
+ {
+ reversalAmount = amount;
+ percentOfPrice = 0.0;
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionKagiAttributeFormatInvalid("ReversalAmount")));
+ }
+ }
+
+ }
+
+ return reversalAmount;
+ }
+
+
+ /// <summary>
+ /// Fills step line series with data to draw the Kagi chart.
+ /// </summary>
+ /// <param name="series">Step line chart series used to dispaly the Kagi chart.</param>
+ /// <param name="originalData">Series with original data.</param>
+ private static void FillKagiData(Series series, Series originalData)
+ {
+ // Get index of the Y values used
+ int yValueIndex = 0;
+ if (series.IsCustomPropertySet(CustomPropertyName.UsedYValue))
+ {
+ int yi;
+ bool parseSucceed = int.TryParse(series[CustomPropertyName.UsedYValue], NumberStyles.Any, CultureInfo.InvariantCulture, out yi);
+
+ if (parseSucceed)
+ {
+ yValueIndex = yi;
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionKagiAttributeFormatInvalid("UsedYValue")));
+ }
+
+ if (yValueIndex >= series.YValuesPerPoint)
+ {
+ throw (new InvalidOperationException(SR.ExceptionKagiAttributeOutOfRange("UsedYValue")));
+ }
+ }
+
+ // Calculate reversal amount
+ double reversalAmountPercentage = 0.0;
+ double reversalAmount = GetReversalAmount(series, out reversalAmountPercentage);
+
+ // Fill points
+ double prevClose = double.NaN;
+ int prevDirection = 0; // 1 up; -1 down; 0 none
+ int pointIndex = 0;
+ foreach(DataPoint dataPoint in originalData.Points)
+ {
+ // Check if previus values exists
+ if(double.IsNaN(prevClose))
+ {
+ prevClose = dataPoint.YValues[yValueIndex];
+
+ // Add first point
+ DataPoint newDataPoint = (DataPoint)dataPoint.Clone();
+ newDataPoint["OriginalPointIndex"] = pointIndex.ToString(CultureInfo.InvariantCulture);
+ newDataPoint.series = series;
+ newDataPoint.XValue = dataPoint.XValue;
+ newDataPoint.YValues[0] = dataPoint.YValues[yValueIndex];
+ newDataPoint.Tag = dataPoint;
+ series.Points.Add(newDataPoint);
+ ++pointIndex;
+ continue;
+ }
+
+ // Calculate reversal amount as percentage of previous price
+ if(reversalAmountPercentage != 0.0)
+ {
+ reversalAmount = (prevClose / 100.0) * reversalAmountPercentage;
+ }
+
+ // Check direction of the price change
+ int direction = 0;
+ if(dataPoint.YValues[yValueIndex] > prevClose)
+ {
+ direction = 1;
+ }
+ else if(dataPoint.YValues[yValueIndex] < prevClose)
+ {
+ direction = -1;
+ }
+ else
+ {
+ direction = 0;
+ }
+
+ // Check if value was changed - otherwise do nothing
+ if(direction != 0)
+ {
+ // Extend line in same direction
+ if(direction == prevDirection)
+ {
+ series.Points[series.Points.Count - 1].YValues[0] =
+ dataPoint.YValues[yValueIndex];
+ series.Points[series.Points.Count - 1]["OriginalPointIndex"] = pointIndex.ToString(CultureInfo.InvariantCulture);
+ series.Points[series.Points.Count - 1].Tag = dataPoint;
+ }
+ else if( Math.Abs(dataPoint.YValues[yValueIndex] - prevClose) < reversalAmount)
+ {
+ // Ignore opposite direction change if value is less than reversal amount
+ ++pointIndex;
+ continue;
+ }
+ else
+ {
+ // Opposite direction by more than reversal amount
+ DataPoint newDataPoint = (DataPoint)dataPoint.Clone();
+ newDataPoint["OriginalPointIndex"] = pointIndex.ToString(CultureInfo.InvariantCulture);
+ newDataPoint.series = series;
+ newDataPoint.XValue = dataPoint.XValue;
+ newDataPoint.YValues[0] = dataPoint.YValues[yValueIndex];
+ newDataPoint.Tag = dataPoint;
+ // Add Kagi to the range step line series
+ series.Points.Add(newDataPoint);
+ }
+
+ // Save previous close value and direction
+ prevClose = dataPoint.YValues[yValueIndex];
+ prevDirection = direction;
+ }
+ ++pointIndex;
+ }
+ }
+
+ #endregion // Methods
+
+ #region Line drawing and selecting methods
+
+ /// <summary>
+ /// Draw chart line using horisontal and vertical lines.
+ /// </summary>
+ /// <param name="graph">Graphics object.</param>
+ /// <param name="common">The Common elements object</param>
+ /// <param name="point">Point to draw the line for.</param>
+ /// <param name="series">Point series.</param>
+ /// <param name="points">Array of points coordinates.</param>
+ /// <param name="pointIndex">Index of point to draw.</param>
+ /// <param name="tension">Line tension</param>
+ override protected void DrawLine(
+ ChartGraphics graph,
+ CommonElements common,
+ DataPoint point,
+ Series series,
+ PointF[] points,
+ int pointIndex,
+ float tension)
+ {
+ // Start drawing from the second point
+ if(pointIndex <= 0)
+ {
+ return;
+ }
+
+ if(currentKagiDirection == 0)
+ {
+ // Get up price color
+ this.kagiUpColor = ChartGraphics.GetGradientColor(series.Color, Color.Black, 0.5);
+ string priceUpColorString = series[CustomPropertyName.PriceUpColor];
+ ColorConverter colorConverter = new ColorConverter();
+ if(priceUpColorString != null)
+ {
+ try
+ {
+ this.kagiUpColor = (Color)colorConverter.ConvertFromString(null, CultureInfo.InvariantCulture, priceUpColorString);
+ }
+ catch
+ {
+ throw(new InvalidOperationException(SR.ExceptionKagiAttributeFormatInvalid("Up Brick color")));
+ }
+ }
+
+ // Check direction of first line (up or down)
+ currentKagiDirection = (points[pointIndex - 1].Y > points[pointIndex].Y) ?
+ 1 : -1;
+ }
+
+ // Set up movement colors and width
+ Color lineColor = (currentKagiDirection == 1) ? this.kagiUpColor : point.Color;
+
+ // Prepare coordinate to draw 2 or 3 segments of the step line
+ PointF point1 = points[pointIndex - 1];
+ PointF point2 = new PointF(points[pointIndex].X, points[pointIndex - 1].Y);
+ PointF point3 = points[pointIndex];
+ PointF point4 = PointF.Empty;
+
+ // Check if vertical line should be draw as to segments of different color
+ if(pointIndex >= 2)
+ {
+ // Check current direction
+ int direction = (points[pointIndex - 1].Y > points[pointIndex].Y) ?
+ 1 : -1;
+
+ // Proceed only when direction is changed
+ if(direction != currentKagiDirection)
+ {
+ // Find prev line low & high
+ PointF prevPoint = points[pointIndex - 2];
+ bool twoVertSegments = false;
+ if(point1.Y > prevPoint.Y &&
+ point1.Y > point3.Y &&
+ prevPoint.Y > point3.Y)
+ {
+ twoVertSegments = true;
+ }
+ else if(point1.Y < prevPoint.Y &&
+ point1.Y < point3.Y &&
+ prevPoint.Y < point3.Y)
+ {
+ twoVertSegments = true;
+ }
+
+ if(twoVertSegments)
+ {
+ // Calculate point where vertical line is split
+ point4.Y = prevPoint.Y;
+ point4.X = point2.X;
+ }
+ }
+ }
+
+ // Round line point values
+ point1.X = (float)Math.Round(point1.X);
+ point1.Y = (float)Math.Round(point1.Y);
+ point2.X = (float)Math.Round(point2.X);
+ point2.Y = (float)Math.Round(point2.Y);
+ point3.X = (float)Math.Round(point3.X);
+ point3.Y = (float)Math.Round(point3.Y);
+ if(!point4.IsEmpty)
+ {
+ point4.X = (float)Math.Round(point4.X);
+ point4.Y = (float)Math.Round(point4.Y);
+ }
+
+
+ // Draw horizontal segment
+ graph.DrawLineRel( lineColor, point.BorderWidth, point.BorderDashStyle,
+ graph.GetRelativePoint(point1), graph.GetRelativePoint(point2),
+ series.ShadowColor, series.ShadowOffset );
+
+ // Check if vertical segment should be drawn as one ore two segments
+ if(point4.IsEmpty)
+ {
+ // Draw 1 vertical segment
+ graph.DrawLineRel( lineColor, point.BorderWidth, point.BorderDashStyle,
+ graph.GetRelativePoint(point2), graph.GetRelativePoint(point3),
+ series.ShadowColor, series.ShadowOffset );
+ }
+ else
+ {
+ // Draw firts part of vertical segment
+ graph.DrawLineRel( lineColor, point.BorderWidth, point.BorderDashStyle,
+ graph.GetRelativePoint(point2), graph.GetRelativePoint(point4),
+ series.ShadowColor, series.ShadowOffset );
+
+ // Change direction
+ currentKagiDirection = (currentKagiDirection == 1) ? -1 : 1;
+
+ // Set color
+ lineColor = (currentKagiDirection == 1) ? this.kagiUpColor : point.Color;
+
+ // Draw second part of vertical segment
+ graph.DrawLineRel( lineColor, point.BorderWidth, point.BorderDashStyle,
+ graph.GetRelativePoint(point4), graph.GetRelativePoint(point3),
+ series.ShadowColor, series.ShadowOffset );
+ }
+
+ if( common.ProcessModeRegions )
+ {
+ // Create grapics path object dor the curve
+ using (GraphicsPath path = new GraphicsPath())
+ {
+ try
+ {
+ path.AddLine(point1, point2);
+ path.AddLine(point2, point3);
+ path.Widen(new Pen(point.Color, point.BorderWidth + 2));
+ }
+ catch (OutOfMemoryException)
+ {
+ // GraphicsPath.Widen incorrectly throws OutOfMemoryException
+ // catching here and reacting by not widening
+ }
+ catch (ArgumentException)
+ {
+ }
+
+ // Allocate array of floats
+ PointF pointNew = PointF.Empty;
+ float[] coord = new float[path.PointCount * 2];
+ PointF[] pathPoints = path.PathPoints;
+ for (int i = 0; i < path.PointCount; i++)
+ {
+ pointNew = graph.GetRelativePoint(pathPoints[i]);
+ coord[2 * i] = pointNew.X;
+ coord[2 * i + 1] = pointNew.Y;
+ }
+
+ common.HotRegionsList.AddHotRegion(
+ path,
+ false,
+ coord,
+ point,
+ series.Name,
+ pointIndex);
+ }
+ }
+
+ }
+
+ /// <summary>
+ /// Fills a PointF array of data points absolute pixel positions.
+ /// </summary>
+ /// <param name="graph">Graphics object.</param>
+ /// <param name="series">Point series.</param>
+ /// <param name="indexedSeries">Indicate that point index should be used as X value.</param>
+ /// <returns>Array of data points position.</returns>
+ override protected PointF[] GetPointsPosition(ChartGraphics graph, Series series, bool indexedSeries)
+ {
+ PointF[] pointPos = new PointF[series.Points.Count];
+ int index = 0;
+ foreach( DataPoint point in series.Points )
+ {
+ // Change Y value if line is out of plot area
+ double yValue = GetYValue(Common, Area, series, point, index, this.YValueIndex);
+
+ // Recalculates y position
+ double yPosition = VAxis.GetPosition( yValue );
+
+ // Recalculates x position
+ double xPosition = HAxis.GetPosition( point.XValue );
+ if( indexedSeries )
+ {
+ xPosition = HAxis.GetPosition( index + 1 );
+ }
+
+ // Add point position into array
+ pointPos[index] = new PointF(
+ (float)(xPosition * (graph.Common.ChartPicture.Width - 1) / 100F),
+ (float)(yPosition * (graph.Common.ChartPicture.Height - 1) / 100F));
+
+ index++;
+ }
+
+ return pointPos;
+ }
+
+ #endregion
+
+ #region 3D Line drawing and selection
+
+ /// <summary>
+ /// Draws a 3D surface connecting the two specified points in 2D space.
+ /// Used to draw Line based charts.
+ /// </summary>
+ /// <param name="area">Chart area reference.</param>
+ /// <param name="graph">Chart graphics.</param>
+ /// <param name="matrix">Coordinates transformation matrix.</param>
+ /// <param name="lightStyle">LightStyle style (None, Simplistic, Realistic).</param>
+ /// <param name="prevDataPointEx">Previous data point object.</param>
+ /// <param name="positionZ">Z position of the back side of the 3D surface.</param>
+ /// <param name="depth">Depth of the 3D surface.</param>
+ /// <param name="points">Array of points.</param>
+ /// <param name="pointIndex">Index of point to draw.</param>
+ /// <param name="pointLoopIndex">Index of points loop.</param>
+ /// <param name="tension">Line tension.</param>
+ /// <param name="operationType">AxisName of operation Drawing, Calculating Path or Both</param>
+ /// <param name="topDarkening">Darkenning scale for top surface. 0 - None.</param>
+ /// <param name="bottomDarkening">Darkenning scale for bottom surface. 0 - None.</param>
+ /// <param name="thirdPointPosition">Position where the third point is actually located or float.NaN if same as in "firstPoint".</param>
+ /// <param name="fourthPointPosition">Position where the fourth point is actually located or float.NaN if same as in "secondPoint".</param>
+ /// <param name="clippedSegment">Indicates that drawn segment is 3D clipped. Only top/bottom should be drawn.</param>
+ /// <returns>Returns elemnt shape path if operationType parameter is set to CalcElementPath, otherwise Null.</returns>
+ protected override GraphicsPath Draw3DSurface(
+ ChartArea area,
+ ChartGraphics graph,
+ Matrix3D matrix,
+ LightStyle lightStyle,
+ DataPoint3D prevDataPointEx,
+ float positionZ,
+ float depth,
+ ArrayList points,
+ int pointIndex,
+ int pointLoopIndex,
+ float tension,
+ DrawingOperationTypes operationType,
+ float topDarkening,
+ float bottomDarkening,
+ PointF thirdPointPosition,
+ PointF fourthPointPosition,
+ bool clippedSegment)
+ {
+ // Create graphics path for selection
+ GraphicsPath resultPath = ((operationType & DrawingOperationTypes.CalcElementPath) == DrawingOperationTypes.CalcElementPath)
+ ? new GraphicsPath() : null;
+
+ // Check if points are drawn from sides to center (do only once)
+ if(centerPointIndex == int.MaxValue)
+ {
+ centerPointIndex = GetCenterPointIndex(points);
+ }
+
+ //************************************************************
+ //** Find line first & second points
+ //************************************************************
+ DataPoint3D secondPoint = (DataPoint3D)points[pointIndex];
+ int pointArrayIndex = pointIndex;
+ DataPoint3D firstPoint = ChartGraphics.FindPointByIndex(
+ points,
+ secondPoint.index - 1,
+ (this.multiSeries) ? secondPoint : null,
+ ref pointArrayIndex);
+
+ // Fint point with line properties
+ DataPoint3D pointAttr = secondPoint;
+ if(prevDataPointEx.dataPoint.IsEmpty)
+ {
+ pointAttr = prevDataPointEx;
+ }
+ else if(firstPoint.index > secondPoint.index)
+ {
+ pointAttr = firstPoint;
+ }
+
+ // Adjust point visual properties
+ Color color = (useBorderColor) ? pointAttr.dataPoint.BorderColor : pointAttr.dataPoint.Color;
+ ChartDashStyle dashStyle = pointAttr.dataPoint.BorderDashStyle;
+ if( pointAttr.dataPoint.IsEmpty && pointAttr.dataPoint.Color == Color.Empty)
+ {
+ color = Color.Gray;
+ }
+ if( pointAttr.dataPoint.IsEmpty && pointAttr.dataPoint.BorderDashStyle == ChartDashStyle.NotSet )
+ {
+ dashStyle = ChartDashStyle.Solid;
+ }
+
+ // Set up kagi chart
+ if(currentKagiDirection == 0)
+ {
+ // Get up price color
+ this.kagiUpColor = secondPoint.dataPoint.series.Color;
+ string priceUpColorString = secondPoint.dataPoint.series[CustomPropertyName.PriceUpColor];
+ ColorConverter colorConverter = new ColorConverter();
+ if(priceUpColorString != null)
+ {
+ try
+ {
+ this.kagiUpColor = (Color)colorConverter.ConvertFromString(null, CultureInfo.InvariantCulture, priceUpColorString);
+ }
+ catch
+ {
+ throw(new InvalidOperationException(SR.ExceptionKagiAttributeFormatInvalid("Up Brick color")));
+ }
+ }
+
+ // Check direction of first line (up or down)
+ currentKagiDirection = (firstPoint.yPosition > secondPoint.yPosition) ?
+ 1 : -1;
+ }
+
+ // Set up movement colors and width
+ Color lineColor = (currentKagiDirection == 1) ? this.kagiUpColor : color;
+
+ //************************************************************
+ //** Create "middle" point
+ //************************************************************
+ DataPoint3D middlePoint = new DataPoint3D();
+ middlePoint.xPosition = secondPoint.xPosition;
+ middlePoint.yPosition = firstPoint.yPosition;
+
+ // Check if reversed drawing order required
+ bool originalDrawOrder = true;
+ if((pointIndex + 1) < points.Count)
+ {
+ DataPoint3D p = (DataPoint3D)points[pointIndex + 1];
+ if(p.index == firstPoint.index)
+ {
+ originalDrawOrder = false;
+ }
+ }
+
+ // Check in which order vertical & horizontal lines segments should be drawn
+ if(centerPointIndex != int.MaxValue)
+ {
+ if(pointIndex >= centerPointIndex)
+ {
+ originalDrawOrder = false;
+ }
+ }
+
+
+ // Check if vertical line should be draw as to segments of different color
+ DataPoint3D vertSplitPoint = null;
+ if(secondPoint.index >= 3) //Point3D.index is 1 based
+ {
+ // Check current direction
+ int direction = (firstPoint.yPosition > secondPoint.yPosition) ?
+ 1 : -1;
+
+ // Proceed only when direction is changed
+ if(direction != currentKagiDirection)
+ {
+ // Find prev line low & high
+ DataPoint3D prevPoint = ChartGraphics.FindPointByIndex(
+ points,
+ secondPoint.index - 2,
+ (this.multiSeries) ? secondPoint : null,
+ ref pointArrayIndex);
+
+ bool twoVertSegments = false;
+ if(firstPoint.yPosition > prevPoint.yPosition &&
+ firstPoint.yPosition > secondPoint.yPosition &&
+ prevPoint.yPosition > secondPoint.yPosition)
+ {
+ twoVertSegments = true;
+ }
+ else if(firstPoint.yPosition < prevPoint.yPosition &&
+ firstPoint.yPosition < secondPoint.yPosition &&
+ prevPoint.yPosition < secondPoint.yPosition)
+ {
+ twoVertSegments = true;
+ }
+
+ if(twoVertSegments)
+ {
+ vertSplitPoint = new DataPoint3D();
+ vertSplitPoint.xPosition = secondPoint.xPosition;
+ vertSplitPoint.yPosition = prevPoint.yPosition;
+ vertSplitPoint.dataPoint = secondPoint.dataPoint;
+ }
+ }
+ }
+
+ // Draw two or three segments of the step line
+ GraphicsPath[] resultPathLine = new GraphicsPath[3];
+ for(int segmentIndex = 0; segmentIndex < 2; segmentIndex++)
+ {
+ DataPoint3D point1 = firstPoint, point2 = secondPoint;
+ LineSegmentType lineSegmentType = LineSegmentType.First;
+
+ if(segmentIndex == 0)
+ {
+ lineSegmentType = (originalDrawOrder) ? LineSegmentType.First : LineSegmentType.Last;
+ middlePoint.dataPoint = (originalDrawOrder) ? secondPoint.dataPoint : firstPoint.dataPoint;
+ point1 = (originalDrawOrder) ? firstPoint : middlePoint;
+ point2 = (originalDrawOrder) ? middlePoint : secondPoint;
+ }
+ else if(segmentIndex == 1)
+ {
+ lineSegmentType = (!originalDrawOrder) ? LineSegmentType.First : LineSegmentType.Last;
+ middlePoint.dataPoint = (!originalDrawOrder) ? secondPoint.dataPoint : secondPoint.dataPoint;
+ point1 = (!originalDrawOrder) ? firstPoint : middlePoint;
+ point2 = (!originalDrawOrder) ? middlePoint : secondPoint;
+ }
+
+ // Draw horizontal surface
+ if(lineSegmentType == LineSegmentType.First ||
+ vertSplitPoint == null)
+ {
+ resultPathLine[segmentIndex] = new GraphicsPath();
+ resultPathLine[segmentIndex] = graph.Draw3DSurface(
+ area, matrix, lightStyle, SurfaceNames.Top, positionZ, depth, lineColor,
+ pointAttr.dataPoint.BorderColor, pointAttr.dataPoint.BorderWidth, dashStyle,
+ point1, point2,
+ points, pointIndex, 0f, operationType, lineSegmentType,
+ (this.showPointLines) ? true : false, false,
+ area.ReverseSeriesOrder,
+ this.multiSeries, 0, true);
+ }
+ else
+ {
+ if(!originalDrawOrder)
+ {
+ lineColor = (currentKagiDirection == -1) ? this.kagiUpColor : color;
+ }
+
+ // Draw verticla line as two segments
+ resultPathLine[segmentIndex] = new GraphicsPath();
+ resultPathLine[segmentIndex] = graph.Draw3DSurface(
+ area, matrix, lightStyle, SurfaceNames.Top, positionZ, depth, lineColor,
+ pointAttr.dataPoint.BorderColor, pointAttr.dataPoint.BorderWidth, dashStyle,
+ point1, vertSplitPoint,
+ points, pointIndex, 0f, operationType, LineSegmentType.Middle,
+ (this.showPointLines) ? true : false, false,
+ area.ReverseSeriesOrder,
+ this.multiSeries, 0, true);
+
+ // No second draw of the prev. front line required
+ graph.frontLinePen = null;
+
+ // Change direction
+ currentKagiDirection = (currentKagiDirection == 1) ? -1 : 1;
+
+ // Set color
+ if(originalDrawOrder)
+ {
+ lineColor = (currentKagiDirection == 1) ? this.kagiUpColor : color;
+ }
+ else
+ {
+ lineColor = (currentKagiDirection == -1) ? this.kagiUpColor : color;
+ }
+
+ resultPathLine[2] = new GraphicsPath();
+ resultPathLine[2] = graph.Draw3DSurface(
+ area, matrix, lightStyle, SurfaceNames.Top, positionZ, depth, lineColor,
+ pointAttr.dataPoint.BorderColor, pointAttr.dataPoint.BorderWidth, dashStyle,
+ vertSplitPoint, point2,
+ points, pointIndex, 0f, operationType, lineSegmentType,
+ (this.showPointLines) ? true : false, false,
+ area.ReverseSeriesOrder,
+ this.multiSeries, 0, true);
+
+ if(!originalDrawOrder)
+ {
+ lineColor = (currentKagiDirection == 1) ? this.kagiUpColor : color;
+ }
+
+ }
+
+ // No second draw of the prev. front line required
+ graph.frontLinePen = null;
+ }
+
+ if(resultPath != null)
+ {
+ if(resultPathLine[0] != null)
+ resultPath.AddPath(resultPathLine[0], true);
+ if(resultPathLine[1] != null)
+ resultPath.AddPath(resultPathLine[1], true);
+ if(resultPathLine[2] != null)
+ resultPath.AddPath(resultPathLine[2], true);
+ }
+ return resultPath;
+ }
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ override public string Name { get{ return ChartTypeNames.Kagi;}}
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ override public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+ #endregion
+
+ #region Painting and selection methods
+
+ /// <summary>
+ /// Paint Line Chart.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this char.t</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ public override void Paint( ChartGraphics graph, CommonElements common, ChartArea area, Series seriesToDraw )
+ {
+ // Reset current direction
+ this.currentKagiDirection = 0;
+
+ // Call base class methods
+ base.Paint(graph, common, area, seriesToDraw);
+ }
+
+ #endregion // Painting and selection methods
+ }
+}
+
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/LineChart.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/LineChart.cs
new file mode 100644
index 00000000000..dd0a450404c
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/LineChart.cs
@@ -0,0 +1,2472 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: LineChart.cs
+//
+// Namespace: DataVisualization.Charting.ChartTypes
+//
+// Classes: LineChart, SplineChart
+//
+// Purpose: Provides 2D/3D drawing and hit testing
+// functionality for the Line and Spline charts.
+//
+// Reviewed: AG - August 6, 2002
+// AG - Microsoft 6, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+#else
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.ChartTypes
+#else
+ namespace System.Web.UI.DataVisualization.Charting.ChartTypes
+#endif
+{
+ /// <summary>
+ /// SplineChart class extends the LineChart class by
+ /// providing a different initial tension for the line.
+ /// </summary>
+ internal class SplineChart : LineChart
+ {
+ #region Constructor
+
+ /// <summary>
+ /// Default constructor.
+ /// </summary>
+ public SplineChart()
+ {
+ // Set default line tension
+ base.lineTension = 0.5f;
+ }
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ public override string Name { get{ return ChartTypeNames.Spline;}}
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ override public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+
+ #endregion
+
+ #region Helper methods
+
+ /// <summary>
+ /// Checks if line tension is supported by the chart type.
+ /// </summary>
+ /// <returns>True if line tension is supported.</returns>
+ protected override bool IsLineTensionSupported()
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Fills a PointF array of data points positions.
+ /// </summary>
+ /// <param name="graph">Graphics object.</param>
+ /// <param name="series">Point series.</param>
+ /// <param name="indexedSeries">Indicate that point index should be used as X value.</param>
+ /// <returns>Array of data points position.</returns>
+ override protected PointF[] GetPointsPosition(
+ ChartGraphics graph,
+ Series series,
+ bool indexedSeries)
+ {
+ // Check tension attribute in the series
+ base.lineTension = GetDefaultTension();
+ if(IsLineTensionSupported() && series.IsCustomPropertySet(CustomPropertyName.LineTension))
+ {
+ base.lineTension = CommonElements.ParseFloat(series[CustomPropertyName.LineTension]);
+ }
+
+ // Call base LineChart class
+ return base.GetPointsPosition(graph, series, indexedSeries);
+ }
+
+ /// <summary>
+ /// Gets default line tension.
+ /// </summary>
+ /// <returns>Default line tension.</returns>
+ override protected float GetDefaultTension()
+ {
+ return 0.5f;
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// LineChart class provides 2D/3D drawing and hit testing
+ /// functionality for the Line and Spline charts. The only
+ /// difference of the Spline chart is the default tension
+ /// of the line.
+ ///
+ /// PointChart base class provides functionality realted
+ /// to drawing labels and markers.
+ /// </summary>
+ internal class LineChart : PointChart
+ {
+ #region Fields and Constructor
+
+ /// <summary>
+ /// Line tension
+ /// </summary>
+ protected float lineTension = 0f;
+
+ /// <summary>
+ /// Index of the drawing center point. int.MaxValue if drawn from left->right or right->left.
+ /// </summary>
+ protected int centerPointIndex = int.MaxValue;
+
+ /// <summary>
+ /// Inicates that border color attribute must be used to draw the line
+ /// </summary>
+ protected bool useBorderColor = false;
+
+ /// <summary>
+ /// Inicates that line shadow should not be drawn
+ /// </summary>
+ protected bool disableShadow = false;
+
+ /// <summary>
+ /// Inicates that only line shadow must be drawn
+ /// </summary>
+ protected bool drawShadowOnly = false;
+
+ // Pen used to draw the line chart
+ private Pen _linePen = new Pen(Color.Black);
+
+ /// <summary>
+ /// Horizontal axis minimum value
+ /// </summary>
+ protected double hAxisMin = 0.0;
+
+ /// <summary>
+ /// Horizontal axis maximum value
+ /// </summary>
+ protected double hAxisMax = 0.0;
+
+ /// <summary>
+ /// Vertical axis minimum value
+ /// </summary>
+ protected double vAxisMin = 0.0;
+
+ /// <summary>
+ /// Vertical axis maximum value
+ /// </summary>
+ protected double vAxisMax = 0.0;
+
+ /// <summary>
+ /// Clip region indicator
+ /// </summary>
+ protected bool clipRegionSet = false;
+
+ /// <summary>
+ /// Indicates that several series are drawn at the same time. Stacked or Side-by-side.
+ /// </summary>
+ protected bool multiSeries = false;
+
+ /// <summary>
+ /// Indicates which coordinates should be tested against the COP.
+ /// </summary>
+ protected COPCoordinates COPCoordinatesToCheck = COPCoordinates.X;
+
+ /// <summary>
+ /// Number of data points loops required to draw chart.
+ /// </summary>
+ protected int allPointsLoopsNumber = 1;
+
+ /// <summary>
+ /// Indicates that line markers are shown at data point.
+ /// </summary>
+ protected bool showPointLines = false;
+
+ /// <summary>
+ /// Indicates that that lines outside the area should be still processed while drawing.
+ /// </summary>
+ protected bool drawOutsideLines = false;
+
+
+ /// <summary>
+ /// Indicates if base (point) chart type should be processed
+ /// </summary>
+ private bool _processBaseChart = false;
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public LineChart() : base(false)
+ {
+ // Draw markers on the front edge
+ middleMarker = false;
+ }
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ public override string Name { get{ return ChartTypeNames.Line;}}
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ override public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+
+ /// <summary>
+ /// True if chart type is stacked
+ /// </summary>
+ public override bool Stacked { get{ return false;}}
+
+ /// <summary>
+ /// True if chart type supports axeses
+ /// </summary>
+ public override bool RequireAxes { get{ return true;} }
+
+ /// <summary>
+ /// True if chart type supports logarithmic axes
+ /// </summary>
+ public override bool SupportLogarithmicAxes { get{ return true;} }
+
+ /// <summary>
+ /// True if chart type requires to switch the value (Y) axes position
+ /// </summary>
+ public override bool SwitchValueAxes { get{ return false;} }
+
+ /// <summary>
+ /// True if chart series can be placed side-by-side.
+ /// </summary>
+ override public bool SideBySideSeries { get{ return false;} }
+
+ /// <summary>
+ /// If the crossing value is auto Crossing value should be
+ /// automatically set to zero for some chart
+ /// types (Bar, column, area etc.)
+ /// </summary>
+ override public bool ZeroCrossing { get{ return true;} }
+
+ /// <summary>
+ /// True if each data point of a chart must be represented in the legend
+ /// </summary>
+ public override bool DataPointsInLegend { get{ return false;} }
+
+ /// <summary>
+ /// True if palette colors should be applied for each data paoint.
+ /// Otherwise the color is applied to the series.
+ /// </summary>
+ public override bool ApplyPaletteColorsToPoints { get { return false; } }
+
+ /// <summary>
+ /// How to draw series/points in legend:
+ /// Filled rectangle, Line or Marker
+ /// </summary>
+ /// <param name="series">Legend item series.</param>
+ /// <returns>Legend item style.</returns>
+ override public LegendImageStyle GetLegendImageStyle(Series series)
+ {
+ return LegendImageStyle.Line;
+ }
+
+ /// <summary>
+ /// Number of supported Y value(s) per point
+ /// </summary>
+ public override int YValuesPerPoint{ get { return 1; } }
+
+ #endregion
+
+ #region Painting and selection methods
+
+ /// <summary>
+ /// Paint Line Chart.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this char.t</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ public override void Paint( ChartGraphics graph, CommonElements common, ChartArea area, Series seriesToDraw )
+ {
+ // Save chart area reference
+ this.Area = area;
+ this.Common = common;
+ // Draw lines
+ _processBaseChart = false;
+ ProcessChartType( false, graph, common, area, seriesToDraw );
+
+ // Draw labels and markers using base class PointChart
+ if(_processBaseChart)
+ {
+ base.ProcessChartType( false, graph, common, area, seriesToDraw );
+ }
+ }
+
+ /// <summary>
+ /// Draws or perform the hit test for the line chart.
+ /// </summary>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ protected override void ProcessChartType(
+ bool selection,
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ Series seriesToDraw )
+ {
+ this.Common = common;
+ // Prosess 3D chart type
+ if(area.Area3DStyle.Enable3D)
+ {
+ _processBaseChart = true;
+ ProcessLineChartType3D( selection, graph, common, area, seriesToDraw );
+ return;
+ }
+
+
+ // All data series from chart area which have Bar chart type
+ List<string> typeSeries = area.GetSeriesFromChartType(this.Name);
+
+ // Check if series are indexed
+ bool indexedSeries = ChartHelper.IndexedSeries(this.Common, typeSeries.ToArray());
+
+ //************************************************************
+ //** Loop through all series
+ //************************************************************
+ foreach( Series ser in common.DataManager.Series )
+ {
+ // Process non empty series of the area with Line chart type
+ if( String.Compare( ser.ChartTypeName, this.Name, true, System.Globalization.CultureInfo.CurrentCulture ) != 0
+ || ser.ChartArea != area.Name || !ser.IsVisible())
+ {
+ continue;
+ }
+
+ // Check if only 1 specified series must be processed
+ if (seriesToDraw != null && seriesToDraw.Name != ser.Name)
+ {
+ continue;
+ }
+
+ // Set active horizontal/vertical axis
+ HAxis = area.GetAxis(AxisName.X, ser.XAxisType, ser.XSubAxisName);
+ VAxis = area.GetAxis(AxisName.Y, ser.YAxisType, ser.YSubAxisName);
+ hAxisMin = HAxis.ViewMinimum;
+ hAxisMax = HAxis.ViewMaximum;
+ vAxisMin = VAxis.ViewMinimum;
+ vAxisMax = VAxis.ViewMaximum;
+
+ float chartWidthPercentage = (graph.Common.ChartPicture.Width - 1) / 100F;
+ float chartHeightPercentage = (graph.Common.ChartPicture.Height - 1) / 100F;
+
+ // Call Back Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPrePaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+
+ // Check tension attribute in the series
+ this.lineTension = GetDefaultTension();
+ if (IsLineTensionSupported() && ser.IsCustomPropertySet(CustomPropertyName.LineTension))
+ {
+ this.lineTension = CommonElements.ParseFloat(ser[CustomPropertyName.LineTension]);
+ }
+
+ // Fill the array of data points coordinates (absolute)
+ bool dataPointPosFilled = false;
+ PointF[] dataPointPos = null;
+ if(this.lineTension == 0 && !common.ProcessModeRegions)
+ {
+ dataPointPos = new PointF[ser.Points.Count];
+ }
+ else
+ {
+ dataPointPosFilled = true;
+ dataPointPos = GetPointsPosition(graph, ser, indexedSeries);
+
+ //*************************************************************************
+ //** Solution for the "Out of Memory" exception in the DrawCurve method
+ //** All points in the array should be at least 0.1 pixel apart.
+ //*************************************************************************
+ if(this.lineTension != 0)
+ {
+ float minDifference = 0.1f;
+ for(int pointIndex = 1; pointIndex < dataPointPos.Length; pointIndex++)
+ {
+ if( Math.Abs(dataPointPos[pointIndex - 1].X - dataPointPos[pointIndex].X ) < minDifference )
+ {
+ if(dataPointPos[pointIndex].X > dataPointPos[pointIndex - 1].X)
+ {
+ dataPointPos[pointIndex].X = dataPointPos[pointIndex - 1].X + minDifference;
+ }
+ else
+ {
+ dataPointPos[pointIndex].X = dataPointPos[pointIndex - 1].X - minDifference;
+ }
+ }
+ if( Math.Abs(dataPointPos[pointIndex - 1].Y - dataPointPos[pointIndex].Y ) < minDifference )
+ {
+ if(dataPointPos[pointIndex].Y > dataPointPos[pointIndex - 1].Y)
+ {
+ dataPointPos[pointIndex].Y = dataPointPos[pointIndex - 1].Y + minDifference;
+ }
+ else
+ {
+ dataPointPos[pointIndex].Y = dataPointPos[pointIndex - 1].Y - minDifference;
+ }
+ }
+ }
+ }
+
+ }
+
+ // Draw line if we have more than one data point
+ if(dataPointPos.Length > 1)
+ {
+ // Draw each data point
+ int index = 0;
+ DataPoint prevDataPoint = null;
+ double yValuePrev = 0.0;
+ double xValuePrev = 0.0;
+ bool showLabelAsValue = ser.IsValueShownAsLabel;
+ bool prevPointInArray = false;
+ foreach( DataPoint point in ser.Points )
+ {
+ prevPointInArray = false;
+
+ // Reset pre-calculated point position
+ point.positionRel = new PointF(float.NaN, float.NaN);
+
+ //************************************************************
+ //** Check if point marker or label is visible
+ //************************************************************
+ if(!_processBaseChart)
+ {
+ string pointMarkerImage = point.MarkerImage;
+ MarkerStyle pointMarkerStyle = point.MarkerStyle;
+
+ if( alwaysDrawMarkers ||
+ pointMarkerStyle != MarkerStyle.None ||
+ pointMarkerImage.Length > 0 ||
+ showLabelAsValue ||
+ point.IsValueShownAsLabel ||
+ point.Label.Length > 0 )
+ {
+ _processBaseChart = true;
+ }
+ }
+
+ // Change Y value if line is out of plot area
+ double yValue = GetYValue(common, area, ser, point, index, this.YValueIndex);
+
+ // Recalculates x position
+ double xValue = (indexedSeries) ? index + 1 : point.XValue;
+
+ // If not first point
+ if(index != 0)
+ {
+ // Axes are logarithmic
+ yValue = VAxis.GetLogValue( yValue );
+ xValue = HAxis.GetLogValue( xValue );
+
+ // Check if line is completly out of the data scaleView
+ if( (xValue <= hAxisMin && xValuePrev < hAxisMin) ||
+ (xValue >= hAxisMax && xValuePrev > hAxisMax) ||
+ (yValue <= vAxisMin && yValuePrev < vAxisMin) ||
+ (yValue >= vAxisMax && yValuePrev > vAxisMax) )
+ {
+ if(!drawOutsideLines)
+ {
+ // Check if next point also outside of the scaleView and on the
+ // same side as current point. If not line has to be processed
+ // to correctly handle tooltips.
+ // NOTE: Fixes issue #4961
+ bool skipPoint = true;
+ if( common.ProcessModeRegions &&
+ (index + 1) < ser.Points.Count)
+ {
+ DataPoint nextPoint = ser.Points[index + 1];
+
+ // Recalculates x position
+ double xValueNext = (indexedSeries) ? index + 2 : nextPoint.XValue;
+
+ if( (xValue < hAxisMin && xValueNext > hAxisMin) ||
+ (xValue > hAxisMax && xValueNext < hAxisMax) )
+ {
+ skipPoint = false;
+ }
+
+
+ // Change Y value if line is out of plot area
+ if(skipPoint)
+ {
+ if( (yValue < vAxisMin && xValueNext > vAxisMin) ||
+ (yValue > vAxisMax && xValueNext < vAxisMax) )
+ {
+ skipPoint = false;
+ }
+ }
+ }
+
+ // Skip point
+ if(skipPoint)
+ {
+ ++index;
+ prevDataPoint = point;
+ yValuePrev = yValue;
+ xValuePrev = xValue;
+ continue;
+ }
+ }
+ }
+
+ // Check if line is partialy in the data scaleView
+ clipRegionSet = false;
+ if(this.lineTension != 0.0 ||
+ xValuePrev < hAxisMin || xValuePrev > hAxisMax ||
+ xValue > hAxisMax || xValue < hAxisMin ||
+ yValuePrev < vAxisMin || yValuePrev > vAxisMax ||
+ yValue < vAxisMin || yValue > vAxisMax )
+ {
+ // Set clipping region for line drawing
+ graph.SetClip( area.PlotAreaPosition.ToRectangleF() );
+ clipRegionSet = true;
+ }
+
+
+ if(this.lineTension == 0 && !dataPointPosFilled)
+ {
+ float yPosition = 0f;
+ float xPosition = 0f;
+
+ // Line reqires two points to draw
+ // Check if previous point is in the array
+ if(!prevPointInArray)
+ {
+ // Recalculates x/y position
+ yPosition = (float)VAxis.GetLinearPosition( yValuePrev );
+ xPosition = (float)HAxis.GetLinearPosition( xValuePrev );
+
+ // Add point position into array
+ // IMPORTANT: Rounding was removed from this part of code because of
+ // very bad drawing in Flash.
+ dataPointPos[index - 1] = new PointF(
+ xPosition * chartWidthPercentage,
+ yPosition * chartHeightPercentage);
+ }
+
+
+ // Recalculates x/y position
+ yPosition = (float)VAxis.GetLinearPosition( yValue );
+ xPosition = (float)HAxis.GetLinearPosition( xValue );
+
+ // Add point position into array
+ // IMPORTANT: Rounding was removed from this part of code because of
+ // very bad drawing in Flash.
+ dataPointPos[index] = new PointF(
+ xPosition * chartWidthPercentage,
+ yPosition * chartHeightPercentage);
+
+ prevPointInArray = true;
+ }
+
+ // Remeber pre-calculated point position
+ point.positionRel = graph.GetRelativePoint(dataPointPos[index]);
+
+ // Start Svg Selection mode
+ graph.StartHotRegion( point );
+
+ if( index != 0 && prevDataPoint.IsEmpty )
+ {
+ // IsEmpty data point - second line
+ DrawLine(
+ graph,
+ common,
+ prevDataPoint,
+ ser,
+ dataPointPos,
+ index,
+ this.lineTension);
+ }
+ else
+ {
+ // Regular data point and empty point - first line
+ DrawLine(
+ graph,
+ common,
+ point,
+ ser,
+ dataPointPos,
+ index,
+ this.lineTension);
+ }
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+
+ // Reset Clip Region
+ if(clipRegionSet)
+ {
+ graph.ResetClip();
+ }
+
+ // Remember previous point data
+ prevDataPoint = point;
+ yValuePrev = yValue;
+ xValuePrev = xValue;
+ }
+ else
+ {
+ // Get Y values of the current and previous data points
+ prevDataPoint = point;
+ yValuePrev = GetYValue(common, area, ser, point, index, 0);
+ xValuePrev = (indexedSeries) ? index + 1 : point.XValue;
+ yValuePrev = VAxis.GetLogValue( yValuePrev );
+ xValuePrev = HAxis.GetLogValue( xValuePrev );
+
+ // Remeber pre-calculated point position
+ point.positionRel = new PointF(
+ (float)HAxis.GetPosition( xValuePrev ),
+ (float)VAxis.GetPosition( yValuePrev ) );
+ }
+
+ // Process image map selection for the first point
+ if(index == 0)
+ {
+ DrawLine(
+ graph,
+ common,
+ point,
+ ser,
+ dataPointPos,
+ index,
+ this.lineTension);
+ }
+
+ // Increase data point index
+ ++index;
+ }
+ }
+ else if(dataPointPos.Length == 1 &&
+ ser.Points.Count == 1)
+ {
+ //************************************************************
+ //** Check if point marker or label is visible
+ //************************************************************
+ if(!_processBaseChart)
+ {
+ if( alwaysDrawMarkers ||
+ ser.Points[0].MarkerStyle != MarkerStyle.None ||
+ ser.Points[0].MarkerImage.Length > 0 ||
+ ser.IsValueShownAsLabel ||
+ ser.Points[0].IsValueShownAsLabel ||
+ ser.Points[0].Label.Length > 0 )
+ {
+ _processBaseChart = true;
+ }
+ }
+ }
+
+ // Reset points array
+ dataPointPos = null;
+
+ // Call Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPostPaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+ }
+ }
+
+ /// <summary>
+ /// Calculate position and draw one chart line and/or shadow.
+ /// </summary>
+ /// <param name="graph">Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="point">Point to draw the line for.</param>
+ /// <param name="series">Point series.</param>
+ /// <param name="points">Array of oints coordinates.</param>
+ /// <param name="pointIndex">Index of point to draw.</param>
+ /// <param name="tension">Line tension.</param>
+ virtual protected void DrawLine(
+ ChartGraphics graph,
+ CommonElements common,
+ DataPoint point,
+ Series series,
+ PointF[] points,
+ int pointIndex,
+ float tension)
+ {
+ int pointBorderWidth = point.BorderWidth;
+
+ // ****************************************************
+ // Paint Mode
+ // ****************************************************
+ if( common.ProcessModePaint )
+ {
+ // Start drawing from the second point
+ if(pointIndex > 0)
+ {
+ Color color = (useBorderColor) ? point.BorderColor : point.Color;
+ ChartDashStyle dashStyle = point.BorderDashStyle;
+
+ // Draw line shadow
+ if(!disableShadow && series.ShadowOffset != 0 && series.ShadowColor != Color.Empty)
+ {
+ if(color != Color.Empty && color != Color.Transparent && pointBorderWidth > 0 && dashStyle != ChartDashStyle.NotSet)
+ {
+ Pen shadowPen = new Pen((series.ShadowColor.A != 255) ? series.ShadowColor : Color.FromArgb((useBorderColor) ? point.BorderColor.A/2 : point.Color.A/2, series.ShadowColor), pointBorderWidth);
+ shadowPen.DashStyle = graph.GetPenStyle( point.BorderDashStyle );
+ shadowPen.StartCap = LineCap.Round;
+ shadowPen.EndCap = LineCap.Round;
+
+ // Translate curve
+ GraphicsState graphicsState = graph.Save();
+ Matrix transform = graph.Transform.Clone();
+ transform.Translate(series.ShadowOffset, series.ShadowOffset);
+ graph.Transform = transform;
+
+ // Draw shadow
+ if(this.lineTension == 0)
+ {
+ try
+ {
+ graph.DrawLine(shadowPen, points[pointIndex - 1], points[pointIndex]);
+ }
+ catch (OverflowException)
+ {
+ this.DrawTruncatedLine(graph, shadowPen, points[pointIndex - 1], points[pointIndex]);
+ }
+ }
+ else
+ {
+ graph.DrawCurve(shadowPen, points, pointIndex - 1, 1, tension);
+ }
+ graph.Restore(graphicsState);
+ }
+ }
+
+ // If only shadow must be drawn - return
+ if(drawShadowOnly)
+ {
+ return;
+ }
+
+ //// IsEmpty data ` color and style
+ // DT - removed code - line chart will have MS Office behavior for empty points -> broken line.
+ //if( point.IsEmpty )
+ //{
+ // if( point.Color == Color.IsEmpty)
+ // {
+ // color = Color.Black;
+ // }
+ // if( point.BorderDashStyle == ChartDashStyle.NotSet )
+ // {
+ // dashStyle = ChartDashStyle.Dash;
+ // }
+ //}
+
+ // Draw data point line
+ if(color != Color.Empty && pointBorderWidth > 0 && dashStyle != ChartDashStyle.NotSet)
+ {
+ if(_linePen.Color != color)
+ {
+ _linePen.Color = color;
+ }
+ if(_linePen.Width != pointBorderWidth)
+ {
+ _linePen.Width = pointBorderWidth;
+ }
+ if(_linePen.DashStyle != graph.GetPenStyle( dashStyle ))
+ {
+ _linePen.DashStyle = graph.GetPenStyle( dashStyle );
+ }
+
+ // Set Rounded Cap
+ if(_linePen.StartCap != LineCap.Round)
+ _linePen.StartCap = LineCap.Round;
+ if(_linePen.EndCap != LineCap.Round)
+ _linePen.EndCap = LineCap.Round;
+
+ if(tension == 0)
+ {
+ // VSTS: 9698 - issue: the line start from X = 0 when GDI overflows (before we expected exception)
+ if (IsLinePointsOverflow(points[pointIndex - 1]) || IsLinePointsOverflow(points[pointIndex]))
+ {
+ this.DrawTruncatedLine(graph, _linePen, points[pointIndex - 1], points[pointIndex]);
+ }
+ else
+ {
+ try
+ {
+ graph.DrawLine(_linePen, points[pointIndex - 1], points[pointIndex]);
+ }
+ catch (OverflowException)
+ {
+ this.DrawTruncatedLine(graph, _linePen, points[pointIndex - 1], points[pointIndex]);
+ }
+ }
+ }
+ else
+ {
+ graph.DrawCurve(_linePen, points, pointIndex - 1, 1, tension);
+ }
+ }
+ }
+ }
+
+ //************************************************************
+ // Hot Regions mode used for image maps, tool tips and
+ // hit test function
+ //************************************************************
+ if( common.ProcessModeRegions )
+ {
+ int width = pointBorderWidth + 2;
+
+ // Create grapics path object dor the curve
+ using (GraphicsPath path = new GraphicsPath())
+ {
+
+ // If line tension is zero - it's a straight line
+ if (this.lineTension == 0)
+ {
+ // Add half line segment prior to the data point
+ if (pointIndex > 0)
+ {
+ PointF first = points[pointIndex - 1];
+ PointF second = points[pointIndex];
+ first.X = (first.X + second.X) / 2f;
+ first.Y = (first.Y + second.Y) / 2f;
+
+ if (Math.Abs(first.X - second.X) > Math.Abs(first.Y - second.Y))
+ {
+ path.AddLine(first.X, first.Y - width, second.X, second.Y - width);
+ path.AddLine(second.X, second.Y + width, first.X, first.Y + width);
+ path.CloseAllFigures();
+ }
+ else
+ {
+ path.AddLine(first.X - width, first.Y, second.X - width, second.Y);
+ path.AddLine(second.X + width, second.Y, first.X + width, first.Y);
+ path.CloseAllFigures();
+
+ }
+ }
+
+ // Add half line segment after the data point
+ if (pointIndex + 1 < points.Length)
+ {
+ PointF first = points[pointIndex];
+ PointF second = points[pointIndex + 1];
+ second.X = (first.X + second.X) / 2f;
+ second.Y = (first.Y + second.Y) / 2f;
+
+ // Set a marker in the path to separate from the first line segment
+ if (pointIndex > 0)
+ {
+ path.SetMarkers();
+ }
+
+ if (Math.Abs(first.X - second.X) > Math.Abs(first.Y - second.Y))
+ {
+ path.AddLine(first.X, first.Y - width, second.X, second.Y - width);
+ path.AddLine(second.X, second.Y + width, first.X, first.Y + width);
+ path.CloseAllFigures();
+ }
+ else
+ {
+ path.AddLine(first.X - width, first.Y, second.X - width, second.Y);
+ path.AddLine(second.X + width, second.Y, first.X + width, first.Y);
+ path.CloseAllFigures();
+ }
+ }
+
+ }
+ else if (pointIndex > 0)
+ {
+ try
+ {
+ path.AddCurve(points, pointIndex - 1, 1, this.lineTension);
+ path.Widen(new Pen(point.Color, pointBorderWidth + 2));
+ path.Flatten();
+ }
+ catch (OutOfMemoryException)
+ {
+ // GraphicsPath.Widen incorrectly throws OutOfMemoryException
+ // catching here and reacting by not widening
+ }
+ catch (ArgumentException)
+ {
+ }
+ }
+
+ // Path is empty
+ if (path.PointCount == 0)
+ {
+ return;
+ }
+
+ // Allocate array of floats
+ PointF pointNew = PointF.Empty;
+ float[] coord = new float[path.PointCount * 2];
+ PointF[] pathPoints = path.PathPoints;
+ for (int i = 0; i < path.PointCount; i++)
+ {
+ pointNew = graph.GetRelativePoint(pathPoints[i]);
+ coord[2 * i] = pointNew.X;
+ coord[2 * i + 1] = pointNew.Y;
+ }
+
+ common.HotRegionsList.AddHotRegion(path, false, coord, point, series.Name, pointIndex);
+ }
+ }
+ }
+
+
+ private const long maxGDIRange = 0x800000;
+ // VSTS: 9698 - issue: the line start from X = 0 when GDI overflows (before we expected exception)
+ private bool IsLinePointsOverflow(PointF point)
+ {
+ return point.X <= -maxGDIRange || point.X >= maxGDIRange || point.Y <= -maxGDIRange || point.Y >= maxGDIRange;
+ }
+
+ /// <summary>
+ /// During zooming there are scenarios when the line coordinates are extremly large and
+ /// originate outside of the chart pixel boundaries. This cause GDI+ line drawing methods
+ /// to throw stack overflow exceptions.
+ /// This method tries to change the coordinates into the chart boundaries and draw the line.
+ /// </summary>
+ /// <param name="graph">Chart graphics.</param>
+ /// <param name="pen">Pen object that determines the color, width, and style of the line.</param>
+ /// <param name="pt1">PointF structure that represents the first point to connect.</param>
+ /// <param name="pt2">PointF structure that represents the second point to connect.</param>
+ private void DrawTruncatedLine(ChartGraphics graph, Pen pen, PointF pt1, PointF pt2)
+ {
+ PointF adjustedPoint1 = PointF.Empty;
+ PointF adjustedPoint2 = PointF.Empty;
+
+ // Check line angle. Intersection with vertical or horizontal lines will be done based on the results
+ bool topBottomLine = (Math.Abs(pt2.Y - pt1.Y) > Math.Abs(pt2.X - pt1.X));
+ RectangleF rect = new RectangleF(0, 0, graph.Common.ChartPicture.Width, graph.Common.ChartPicture.Height);
+ if (topBottomLine)
+ {
+ // Find the intersection point between the original line and Y = 0 and Y = Height lines
+ adjustedPoint1 = rect.Contains(pt1) ? pt1 : GetIntersectionY(pt1, pt2, 0);
+ adjustedPoint2 = rect.Contains(pt2) ? pt2 : GetIntersectionY(pt1, pt2, graph.Common.ChartPicture.Height);
+ }
+ else
+ {
+ // Find the intersection point between the original line and X = 0 and X = Width lines
+ adjustedPoint1 = rect.Contains(pt1) ? pt1 : GetIntersectionX(pt1, pt2, 0);
+ adjustedPoint2 = rect.Contains(pt2) ? pt2 : GetIntersectionX(pt1, pt2, graph.Common.ChartPicture.Width);
+ }
+
+ // Draw Line
+ graph.DrawLine(pen, adjustedPoint1, adjustedPoint2);
+ }
+
+ /// <summary>
+ /// Gets intersection point coordinates between point line and and horizontal
+ /// line specified by Y coordinate.
+ /// </summary>
+ /// <param name="firstPoint">First data point.</param>
+ /// <param name="secondPoint">Second data point.</param>
+ /// <param name="pointY">Y coordinate.</param>
+ /// <returns>Intersection point coordinates.</returns>
+ internal static PointF GetIntersectionY(PointF firstPoint, PointF secondPoint, float pointY)
+ {
+ PointF intersectionPoint = new PointF();
+ intersectionPoint.Y = pointY;
+ intersectionPoint.X = (pointY - firstPoint.Y) *
+ (secondPoint.X - firstPoint.X) /
+ (secondPoint.Y - firstPoint.Y) +
+ firstPoint.X;
+ return intersectionPoint;
+ }
+
+ /// <summary>
+ /// Gets intersection point coordinates between point line and and vertical
+ /// line specified by X coordinate.
+ /// </summary>
+ /// <param name="firstPoint">First data point.</param>
+ /// <param name="secondPoint">Second data point.</param>
+ /// <param name="pointX">X coordinate.</param>
+ /// <returns>Intersection point coordinates.</returns>
+ internal static PointF GetIntersectionX(PointF firstPoint, PointF secondPoint, float pointX)
+ {
+ PointF intersectionPoint = new PointF();
+ intersectionPoint.X = pointX;
+ intersectionPoint.Y = (pointX - firstPoint.X) *
+ (secondPoint.Y - firstPoint.Y) /
+ (secondPoint.X - firstPoint.X) +
+ firstPoint.Y;
+ return intersectionPoint;
+ }
+
+ /// <summary>
+ /// Draw chart line.
+ /// </summary>
+ /// <param name="graph">Graphics object.</param>
+ /// <param name="point">Point to draw the line for.</param>
+ /// <param name="series">Point series.</param>
+ /// <param name="firstPoint">First line point.</param>
+ /// <param name="secondPoint">Seconf line point.</param>
+ protected void DrawLine(
+ ChartGraphics graph,
+ DataPoint point,
+ Series series,
+ PointF firstPoint,
+ PointF secondPoint)
+ {
+ graph.DrawLineRel( point.Color, point.BorderWidth, point.BorderDashStyle, firstPoint, secondPoint, series.ShadowColor, series.ShadowOffset );
+ }
+
+ /// <summary>
+ /// Checks if line tension is supported by the chart type.
+ /// </summary>
+ /// <returns>True if line tension is supported.</returns>
+ protected virtual bool IsLineTensionSupported()
+ {
+ return false;
+ }
+
+ #endregion
+
+ #region Position helper methods
+
+ /// <summary>
+ /// Gets default line tension.
+ /// </summary>
+ /// <returns>Default line tension.</returns>
+ virtual protected float GetDefaultTension()
+ {
+ return 0f;
+ }
+
+ /// <summary>
+ /// Gets label position depending on the prev/next point values.
+ /// This method will reduce label overlapping with the chart itself (line).
+ /// </summary>
+ /// <param name="series">Data series.</param>
+ /// <param name="pointIndex">Point index.</param>
+ /// <returns>Return automaticly detected label position.</returns>
+ override protected LabelAlignmentStyles GetAutoLabelPosition(Series series, int pointIndex)
+ {
+ int pointsCount = series.Points.Count; // Number of data points
+ double previous; // Y Value from the previous data point
+ double next; // Y Value from the next data point
+
+ // There is only one data point
+ if( pointsCount == 1 )
+ {
+ return LabelAlignmentStyles.Top;
+ }
+
+ // Y Value from the current data point
+ double current = GetYValue(Common, Area, series, series.Points[pointIndex], pointIndex, 0);
+
+ // The data point is between two data points
+ if( pointIndex < pointsCount - 1 && pointIndex > 0 )
+ {
+ // Y Value from the previous data point
+ previous = GetYValue(Common, Area, series, series.Points[pointIndex-1], pointIndex-1, 0);
+
+ // Y Value from the next data point
+ next = GetYValue(Common, Area, series, series.Points[pointIndex+1], pointIndex+1, 0);
+
+ // Put the label below lines
+ if( previous > current && next > current )
+ {
+ return LabelAlignmentStyles.Bottom;
+ }
+ }
+
+ // This is the last data point
+ if( pointIndex == pointsCount - 1 )
+ {
+ // Y Value from the previous data point
+ previous = GetYValue(Common, Area, series, series.Points[pointIndex-1], pointIndex-1, 0);
+
+ // Put the label below line
+ if( previous > current )
+ {
+ return LabelAlignmentStyles.Bottom;
+ }
+ }
+
+ // This is the first data point
+ if( pointIndex == 0 )
+ {
+ // Y Value from the next data point
+ next = GetYValue(Common, Area, series, series.Points[pointIndex + 1], pointIndex + 1, 0);
+
+ // Put the label below line
+ if( next > current )
+ {
+ return LabelAlignmentStyles.Bottom;
+ }
+ }
+
+ return LabelAlignmentStyles.Top;
+ }
+
+ /// <summary>
+ /// Fills a PointF array of data points absolute pixel positions.
+ /// </summary>
+ /// <param name="graph">Graphics object.</param>
+ /// <param name="series">Point series.</param>
+ /// <param name="indexedSeries">Indicate that point index should be used as X value.</param>
+ /// <returns>Array of data points position.</returns>
+ virtual protected PointF[] GetPointsPosition(ChartGraphics graph, Series series, bool indexedSeries)
+ {
+ PointF[] pointPos = new PointF[series.Points.Count];
+ int index = 0;
+ foreach( DataPoint point in series.Points )
+ {
+ // Change Y value if line is out of plot area
+ double yValue = GetYValue(Common, Area, series, point, index, this.YValueIndex);
+
+ // Recalculates y position
+ double yPosition = VAxis.GetPosition( yValue );
+
+ // Recalculates x position
+ double xPosition = HAxis.GetPosition( point.XValue );
+ if( indexedSeries )
+ {
+ xPosition = HAxis.GetPosition( index + 1 );
+ }
+
+ // Add point position into array
+ // IMPORTANT: Rounding was removed from this part of code because of
+ // very bad drawing in Flash.
+ pointPos[index] = new PointF(
+ (float)xPosition * (graph.Common.ChartPicture.Width - 1) / 100F,
+ (float)yPosition * (graph.Common.ChartPicture.Height - 1) / 100F);
+
+ index++;
+ }
+
+ return pointPos;
+ }
+
+ #endregion
+
+ #region 3D Drawing and selection methods
+
+ /// <summary>
+ /// Draws or perform the hit test for the line chart in 3D.
+ /// </summary>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ protected void ProcessLineChartType3D(
+ bool selection,
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ Series seriesToDraw )
+ {
+
+ // Reset graphics fields
+ graph.frontLinePen = null;
+ graph.frontLinePoint1 = PointF.Empty;
+ graph.frontLinePoint2 = PointF.Empty;
+
+ // Get list of series to draw
+ List<string> typeSeries = null;
+ if( (area.Area3DStyle.IsClustered && this.SideBySideSeries) ||
+ this.Stacked)
+ {
+ // Draw all series of the same chart type
+ typeSeries = area.GetSeriesFromChartType(Name);
+ }
+ else
+ {
+ // Draw just one chart series
+ typeSeries = new List<string>();
+ typeSeries.Add(seriesToDraw.Name);
+ }
+
+ //***************************************************************
+ //** Check that data points XValues. Must be sorted or set to 0.
+ //***************************************************************
+ foreach(string seriesName in typeSeries)
+ {
+ // Get series object
+ Series currentSeries = common.DataManager.Series[seriesName];
+
+ // Do not check indexed series
+ if(currentSeries.IsXValueIndexed)
+ {
+ continue;
+ }
+
+ // Loop through all data points in the series
+ bool allZeros = true;
+ int order = int.MaxValue; // 0 - Ascending; 1 - Descending;
+ double prevValue = double.NaN;
+ foreach(DataPoint dp in currentSeries.Points)
+ {
+ // Check if X values were set (or all zeros)
+ if(allZeros && dp.XValue == 0.0)
+ {
+ continue;
+ }
+ allZeros = false;
+
+ // Check X values order
+ bool validOrder = true;
+ if(!double.IsNaN(prevValue) && dp.XValue != prevValue)
+ {
+ // Determine sorting order
+ if(order == int.MaxValue)
+ {
+ order = (dp.XValue > prevValue) ? 0 : 1; // 0 - Ascending; 1 - Descending;
+ }
+
+ // Compare current X value with previous
+ if(dp.XValue > prevValue && order == 1)
+ {
+ validOrder = false;
+ }
+ if(dp.XValue < prevValue && order == 0)
+ {
+ validOrder = false;
+ }
+ }
+
+ // Throw error exception
+ if(!validOrder)
+ {
+ throw (new InvalidOperationException(SR.Exception3DChartPointsXValuesUnsorted));
+ }
+
+ // Remember previous value
+ prevValue = dp.XValue;
+ }
+ }
+
+ //************************************************************
+ //** Get order of data points drawing
+ //************************************************************
+ ArrayList dataPointDrawingOrder = area.GetDataPointDrawingOrder(
+ typeSeries,
+ this,
+ selection,
+ this.COPCoordinatesToCheck,
+ null,
+ 0,
+ false);
+
+
+ //************************************************************
+ //** Get line tension attribute
+ //************************************************************
+ this.lineTension = GetDefaultTension();
+ if(dataPointDrawingOrder.Count > 0)
+ {
+ Series firstSeries = firstSeries = ((DataPoint3D)dataPointDrawingOrder[0]).dataPoint.series;
+ if(IsLineTensionSupported() && firstSeries.IsCustomPropertySet(CustomPropertyName.LineTension))
+ {
+ this.lineTension = CommonElements.ParseFloat(firstSeries[CustomPropertyName.LineTension]);
+ }
+ }
+
+ //************************************************************
+ //** Check if second ALL points loop is required
+ //************************************************************
+ allPointsLoopsNumber = GetPointLoopNumber(selection, dataPointDrawingOrder);
+
+ //************************************************************
+ //** Loop through all data poins (one or two times)
+ //************************************************************
+ for(int pointsLoop = 0; pointsLoop < allPointsLoopsNumber; pointsLoop++)
+ {
+ int index = 0;
+ this.centerPointIndex = int.MaxValue;
+ foreach(object obj in dataPointDrawingOrder)
+ {
+ // Get point & series
+ DataPoint3D pointEx = (DataPoint3D) obj;
+ DataPoint point = pointEx.dataPoint;
+ Series ser = point.series;
+
+ // Set active horizontal/vertical axis
+ HAxis = area.GetAxis(AxisName.X, ser.XAxisType, ser.XSubAxisName);
+ VAxis = area.GetAxis(AxisName.Y, ser.YAxisType, ser.YSubAxisName);
+ hAxisMin = HAxis.ViewMinimum;
+ hAxisMax = HAxis.ViewMaximum;
+ vAxisMin = VAxis.ViewMinimum;
+ vAxisMax = VAxis.ViewMaximum;
+
+ // First point is not drawn as a 3D line
+ if(pointEx.index > 1)
+ {
+ //************************************************************
+ //** Get previous data point using the point index in the series
+ //************************************************************
+ int pointArrayIndex = index;
+ DataPoint3D prevDataPointEx = ChartGraphics.FindPointByIndex(
+ dataPointDrawingOrder,
+ pointEx.index - 1,
+ (this.multiSeries) ? pointEx : null,
+ ref pointArrayIndex);
+
+ //************************************************************
+ //** Painting mode
+ //************************************************************
+ GraphicsPath rectPath = null;
+
+ // Get Y values of the current and previous data points
+ double yValue = GetYValue(common, area, ser, pointEx.dataPoint, pointEx.index - 1, 0);
+ double yValuePrev = GetYValue(common, area, ser, prevDataPointEx.dataPoint, prevDataPointEx.index - 1, 0);
+ double xValue = (pointEx.indexedSeries) ? pointEx.index : pointEx.dataPoint.XValue;
+ double xValuePrev = (prevDataPointEx.indexedSeries) ? prevDataPointEx.index : prevDataPointEx.dataPoint.XValue;
+
+ // Axes are logarithmic
+ yValue = VAxis.GetLogValue( yValue );
+ yValuePrev = VAxis.GetLogValue( yValuePrev );
+
+ xValue = HAxis.GetLogValue( xValue );
+ xValuePrev = HAxis.GetLogValue( xValuePrev );
+
+ //************************************************************
+ //** Draw line
+ //************************************************************
+ DataPoint3D pointAttr = (prevDataPointEx.dataPoint.IsEmpty) ? prevDataPointEx : pointEx;
+ if(pointAttr.dataPoint.Color != Color.Empty)
+ {
+ // Detect if we need to get graphical path of drawn object
+ DrawingOperationTypes drawingOperationType = DrawingOperationTypes.DrawElement;
+
+ if( common.ProcessModeRegions )
+ {
+ drawingOperationType |= DrawingOperationTypes.CalcElementPath;
+ }
+
+ // Check if point markers lines should be drawn
+ this.showPointLines = false;
+ if(pointAttr.dataPoint.IsCustomPropertySet(CustomPropertyName.ShowMarkerLines))
+ {
+ if(String.Compare(pointAttr.dataPoint[CustomPropertyName.ShowMarkerLines], "TRUE", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this.showPointLines = true;
+ }
+ }
+ else
+ {
+ if(pointAttr.dataPoint.series.IsCustomPropertySet(CustomPropertyName.ShowMarkerLines))
+ {
+ if (String.Compare(pointAttr.dataPoint.series[CustomPropertyName.ShowMarkerLines], "TRUE", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this.showPointLines = true;
+ }
+ }
+ }
+
+ // Start Svg Selection mode
+ graph.StartHotRegion( point );
+
+ // Draw line surface
+ area.IterationCounter = 0;
+ rectPath = Draw3DSurface(
+ area,
+ graph,
+ area.matrix3D,
+ area.Area3DStyle.LightStyle,
+ prevDataPointEx,
+ pointAttr.zPosition,
+ pointAttr.depth,
+ dataPointDrawingOrder,
+ index,
+ pointsLoop,
+ lineTension,
+ drawingOperationType,
+ 0f, 0f,
+ new PointF(float.NaN, float.NaN),
+ new PointF(float.NaN, float.NaN),
+ false);
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+ }
+
+ //************************************************************
+ // Hot Regions mode used for image maps, tool tips and
+ // hit test function
+ //************************************************************
+ if( common.ProcessModeRegions && rectPath != null)
+ {
+ common.HotRegionsList.AddHotRegion(
+ rectPath,
+ false,
+ graph,
+ point,
+ ser.Name,
+ pointEx.index - 1 );
+ }
+ if (rectPath != null)
+ {
+ rectPath.Dispose();
+ }
+ }
+
+ // Increase point index
+ ++index;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Draws a 3D surface connecting the two specified points in 2D space.
+ /// Used to draw Line based charts.
+ /// </summary>
+ /// <param name="area">Chart area reference.</param>
+ /// <param name="graph">Chart graphics.</param>
+ /// <param name="matrix">Coordinates transformation matrix.</param>
+ /// <param name="lightStyle">LightStyle style (None, Simplistic, Realistic).</param>
+ /// <param name="prevDataPointEx">Previous data point object.</param>
+ /// <param name="positionZ">Z position of the back side of the 3D surface.</param>
+ /// <param name="depth">Depth of the 3D surface.</param>
+ /// <param name="points">Array of points.</param>
+ /// <param name="pointIndex">Index of point to draw.</param>
+ /// <param name="pointLoopIndex">Index of points loop.</param>
+ /// <param name="tension">Line tension.</param>
+ /// <param name="operationType">AxisName of operation Drawing, Calculating Path or Both</param>
+ /// <param name="topDarkening">Darkenning scale for top surface. 0 - None.</param>
+ /// <param name="bottomDarkening">Darkenning scale for bottom surface. 0 - None.</param>
+ /// <param name="thirdPointPosition">Position where the third point is actually located or float.NaN if same as in "firstPoint".</param>
+ /// <param name="fourthPointPosition">Position where the fourth point is actually located or float.NaN if same as in "secondPoint".</param>
+ /// <param name="clippedSegment">Indicates that drawn segment is 3D clipped. Only top/bottom should be drawn.</param>
+ /// <returns>Returns elemnt shape path if operationType parameter is set to CalcElementPath, otherwise Null.</returns>
+ protected virtual GraphicsPath Draw3DSurface(
+ ChartArea area,
+ ChartGraphics graph,
+ Matrix3D matrix,
+ LightStyle lightStyle,
+ DataPoint3D prevDataPointEx,
+ float positionZ,
+ float depth,
+ ArrayList points,
+ int pointIndex,
+ int pointLoopIndex,
+ float tension,
+ DrawingOperationTypes operationType,
+ float topDarkening,
+ float bottomDarkening,
+ PointF thirdPointPosition,
+ PointF fourthPointPosition,
+ bool clippedSegment)
+ {
+ // Check if points are drawn from sides to center (do only once)
+ if(centerPointIndex == int.MaxValue)
+ {
+ centerPointIndex = GetCenterPointIndex(points);
+ }
+
+ //************************************************************
+ //** Find line first & second points
+ //************************************************************
+ DataPoint3D secondPoint = (DataPoint3D)points[pointIndex];
+ int pointArrayIndex = pointIndex;
+ DataPoint3D firstPoint = ChartGraphics.FindPointByIndex(
+ points,
+ secondPoint.index - 1,
+ (this.multiSeries) ? secondPoint : null,
+ ref pointArrayIndex);
+
+
+ // Fint point with line properties
+ DataPoint3D pointAttr = secondPoint;
+ if(prevDataPointEx.dataPoint.IsEmpty)
+ {
+ pointAttr = prevDataPointEx;
+ }
+ else if(firstPoint.index > secondPoint.index)
+ {
+ pointAttr = firstPoint;
+ }
+
+ // Adjust point visual properties
+ Color color = (useBorderColor) ? pointAttr.dataPoint.BorderColor : pointAttr.dataPoint.Color;
+ ChartDashStyle dashStyle = pointAttr.dataPoint.BorderDashStyle;
+ if( pointAttr.dataPoint.IsEmpty && pointAttr.dataPoint.Color == Color.Empty)
+ {
+ color = Color.Gray;
+ }
+ if( pointAttr.dataPoint.IsEmpty && pointAttr.dataPoint.BorderDashStyle == ChartDashStyle.NotSet )
+ {
+ dashStyle = ChartDashStyle.Solid;
+ }
+
+ // Draw point using 2 points
+ return graph.Draw3DSurface(
+ area,
+ matrix,
+ lightStyle,
+ SurfaceNames.Top,
+ positionZ,
+ depth,
+ color,
+ pointAttr.dataPoint.BorderColor,
+ pointAttr.dataPoint.BorderWidth,
+ dashStyle,
+ firstPoint,
+ secondPoint,
+ points,
+ pointIndex,
+ tension,
+ operationType,
+ LineSegmentType.Single,
+ (this.showPointLines) ? true : false,
+ false,
+ area.ReverseSeriesOrder,
+ this.multiSeries,
+ 0,
+ true);
+ }
+
+ /// <summary>
+ /// Gets index of center point.
+ /// </summary>
+ /// <param name="points">Points list.</param>
+ /// <returns>Index of center point or int.MaxValue.</returns>
+ protected int GetCenterPointIndex(ArrayList points)
+ {
+ for(int pointIndex = 1; pointIndex < points.Count; pointIndex++)
+ {
+ DataPoint3D firstPoint = (DataPoint3D)points[pointIndex - 1];
+ DataPoint3D secondPoint = (DataPoint3D)points[pointIndex];
+ if(Math.Abs(secondPoint.index - firstPoint.index) != 1)
+ {
+ return pointIndex - 1;
+ }
+ }
+ return int.MaxValue;
+ }
+
+ /// <summary>
+ /// Returns how many loops through all data points is required (1 or 2)
+ /// </summary>
+ /// <param name="selection">Selection indicator.</param>
+ /// <param name="pointsArray">Points array list.</param>
+ /// <returns>Number of loops (1 or 2).</returns>
+ virtual protected int GetPointLoopNumber(bool selection, ArrayList pointsArray)
+ {
+ return 1;
+ }
+
+ /// <summary>
+ /// Clips the top (left and right) points of the segment to plotting area.
+ /// Used in area and range charts.
+ /// </summary>
+ /// <param name="resultPath">Segment area path.</param>
+ /// <param name="firstPoint">First data point.</param>
+ /// <param name="secondPoint">Second data point.</param>
+ /// <param name="reversed">Points are in reversed order.</param>
+ /// <param name="area">Chart area reference.</param>
+ /// <param name="graph">Chart graphics.</param>
+ /// <param name="matrix">Coordinates transformation matrix.</param>
+ /// <param name="lightStyle">LightStyle style (None, Simplistic, Realistic).</param>
+ /// <param name="prevDataPointEx">Previous data point object.</param>
+ /// <param name="positionZ">Z position of the back side of the 3D surface.</param>
+ /// <param name="depth">Depth of the 3D surface.</param>
+ /// <param name="points">Array of points.</param>
+ /// <param name="pointIndex">Index of point to draw.</param>
+ /// <param name="pointLoopIndex">Index of points loop.</param>
+ /// <param name="tension">Line tension.</param>
+ /// <param name="operationType">AxisName of operation Drawing, Calculating Path or Both</param>
+ /// <param name="surfaceSegmentType">Define surface segment type if it consists of several segments.</param>
+ /// <param name="topDarkening">Darkenning scale for top surface. 0 - None.</param>
+ /// <param name="bottomDarkening">Darkenning scale for bottom surface. 0 - None.</param>
+ /// <returns>Returns element shape path if operationType parameter is set to CalcElementPath, otherwise Null.</returns>
+ protected bool ClipTopPoints(
+ GraphicsPath resultPath,
+ ref DataPoint3D firstPoint,
+ ref DataPoint3D secondPoint,
+ bool reversed,
+ ChartArea area,
+ ChartGraphics graph,
+ Matrix3D matrix,
+ LightStyle lightStyle,
+ DataPoint3D prevDataPointEx,
+ float positionZ,
+ float depth,
+ ArrayList points,
+ int pointIndex,
+ int pointLoopIndex,
+ float tension,
+ DrawingOperationTypes operationType,
+ LineSegmentType surfaceSegmentType,
+ float topDarkening,
+ float bottomDarkening)
+ {
+ // Do not allow recursion to go too deep
+ ++area.IterationCounter;
+ if(area.IterationCounter > 20)
+ {
+ area.IterationCounter = 0;
+ return true;
+ }
+
+ //****************************************************************
+ //** Check point values
+ //****************************************************************
+ if( double.IsNaN(firstPoint.xPosition) ||
+ double.IsNaN(firstPoint.yPosition) ||
+ double.IsNaN(secondPoint.xPosition) ||
+ double.IsNaN(secondPoint.yPosition) )
+ {
+ return true;
+ }
+
+ //****************************************************************
+ //** Round plot are position and point coordinates
+ //****************************************************************
+ int decimals = 3;
+ decimal plotAreaPositionX = Math.Round((decimal)area.PlotAreaPosition.X, decimals);
+ decimal plotAreaPositionY = Math.Round((decimal)area.PlotAreaPosition.Y, decimals);
+ decimal plotAreaPositionRight = Math.Round((decimal)area.PlotAreaPosition.Right, decimals);
+ decimal plotAreaPositionBottom = Math.Round((decimal)area.PlotAreaPosition.Bottom, decimals);
+
+ // Make area a little bit bigger
+ plotAreaPositionX -= 0.001M;
+ plotAreaPositionY -= 0.001M;
+ plotAreaPositionRight += 0.001M;
+ plotAreaPositionBottom += 0.001M;
+
+ // Round top points coordinates
+ firstPoint.xPosition = Math.Round(firstPoint.xPosition, decimals);
+ firstPoint.yPosition = Math.Round(firstPoint.yPosition, decimals);
+ secondPoint.xPosition = Math.Round(secondPoint.xPosition, decimals);
+ secondPoint.yPosition = Math.Round(secondPoint.yPosition, decimals);
+
+
+ //****************************************************************
+ //** Clip area data points inside the plotting area
+ //****************************************************************
+
+ // Chech data points X values
+ if((decimal)firstPoint.xPosition < plotAreaPositionX ||
+ (decimal)firstPoint.xPosition > plotAreaPositionRight ||
+ (decimal)secondPoint.xPosition < plotAreaPositionX ||
+ (decimal)secondPoint.xPosition > plotAreaPositionRight )
+ {
+ // Check if surface completly out of the plot area
+ if((decimal)firstPoint.xPosition < plotAreaPositionX &&
+ (decimal)secondPoint.xPosition < plotAreaPositionX)
+ {
+ return true;
+ }
+ // Check if surface completly out of the plot area
+ if((decimal)firstPoint.xPosition > plotAreaPositionRight &&
+ (decimal)secondPoint.xPosition > plotAreaPositionRight)
+ {
+ return true;
+ }
+
+ // Only part of the surface is outside - fix X value and adjust Y value
+ if((decimal)firstPoint.xPosition < plotAreaPositionX)
+ {
+ firstPoint.yPosition = ((double)plotAreaPositionX - secondPoint.xPosition) /
+ (firstPoint.xPosition - secondPoint.xPosition) *
+ (firstPoint.yPosition - secondPoint.yPosition) +
+ secondPoint.yPosition;
+ firstPoint.xPosition = (double)plotAreaPositionX;
+ }
+ else if((decimal)firstPoint.xPosition > plotAreaPositionRight)
+ {
+ firstPoint.yPosition = ((double)plotAreaPositionRight - secondPoint.xPosition) /
+ (firstPoint.xPosition - secondPoint.xPosition) *
+ (firstPoint.yPosition - secondPoint.yPosition) +
+ secondPoint.yPosition;
+ firstPoint.xPosition = (double)plotAreaPositionRight;
+ }
+ if((decimal)secondPoint.xPosition < plotAreaPositionX)
+ {
+ secondPoint.yPosition = ((double)plotAreaPositionX - secondPoint.xPosition) /
+ (firstPoint.xPosition - secondPoint.xPosition) *
+ (firstPoint.yPosition - secondPoint.yPosition) +
+ secondPoint.yPosition;
+ secondPoint.xPosition = (double)plotAreaPositionX;
+ }
+ else if((decimal)secondPoint.xPosition > plotAreaPositionRight)
+ {
+ secondPoint.yPosition = ((double)plotAreaPositionRight - secondPoint.xPosition) /
+ (firstPoint.xPosition - secondPoint.xPosition) *
+ (firstPoint.yPosition - secondPoint.yPosition) +
+ secondPoint.yPosition;
+ secondPoint.xPosition = (double)plotAreaPositionRight;
+ }
+ }
+
+ // Chech data points Y values
+ if((decimal)firstPoint.yPosition < plotAreaPositionY ||
+ (decimal)firstPoint.yPosition > plotAreaPositionBottom ||
+ (decimal)secondPoint.yPosition < plotAreaPositionY ||
+ (decimal)secondPoint.yPosition > plotAreaPositionBottom )
+ {
+ // Remember previous y positions
+ double prevFirstPointY = firstPoint.yPosition;
+ double prevSecondPointY = secondPoint.yPosition;
+
+ // Check if whole line is outside plotting region
+ bool surfaceCompletlyOutside = false;
+ bool outsideBottom = false;
+ if((decimal)firstPoint.yPosition < plotAreaPositionY &&
+ (decimal)secondPoint.yPosition < plotAreaPositionY)
+ {
+ surfaceCompletlyOutside = true;
+ firstPoint.yPosition = (double)plotAreaPositionY;
+ secondPoint.yPosition = (double)plotAreaPositionY;
+ }
+ if((decimal)firstPoint.yPosition > plotAreaPositionBottom &&
+ (decimal)secondPoint.yPosition > plotAreaPositionBottom)
+ {
+ surfaceCompletlyOutside = true;
+ outsideBottom = true;
+ firstPoint.yPosition = (double)plotAreaPositionBottom;
+ secondPoint.yPosition = (double)plotAreaPositionBottom;
+ }
+
+ // Draw just one surface
+ if(surfaceCompletlyOutside)
+ {
+ resultPath = Draw3DSurface( firstPoint, secondPoint, reversed,
+ area, graph, matrix, lightStyle, prevDataPointEx,
+ positionZ, depth, points, pointIndex, pointLoopIndex,
+ tension, operationType, surfaceSegmentType,
+ 0.5f, 0f,
+ new PointF(float.NaN, float.NaN),
+ new PointF(float.NaN, float.NaN),
+ outsideBottom,
+ false, true);
+
+ // Restore previous y positions
+ firstPoint.yPosition = prevFirstPointY;
+ secondPoint.yPosition = prevSecondPointY;
+
+ return true;
+ }
+
+ // Get intersection point
+ DataPoint3D intersectionPoint = new DataPoint3D();
+ intersectionPoint.yPosition = (double)plotAreaPositionY;
+ if((decimal)firstPoint.yPosition > plotAreaPositionBottom ||
+ (decimal)secondPoint.yPosition > plotAreaPositionBottom )
+ {
+ intersectionPoint.yPosition = (double)plotAreaPositionBottom;
+ }
+ intersectionPoint.xPosition = (intersectionPoint.yPosition - secondPoint.yPosition) *
+ (firstPoint.xPosition - secondPoint.xPosition) /
+ (firstPoint.yPosition - secondPoint.yPosition) +
+ secondPoint.xPosition;
+
+ if(double.IsNaN(intersectionPoint.xPosition) ||
+ double.IsInfinity(intersectionPoint.xPosition) ||
+ double.IsNaN(intersectionPoint.yPosition) ||
+ double.IsInfinity(intersectionPoint.yPosition) )
+ {
+ return true;
+ }
+
+ // Check if there are 2 intersection points (3 segments)
+ int segmentNumber = 2;
+ DataPoint3D intersectionPoint2 = null;
+ if( ((decimal)firstPoint.yPosition < plotAreaPositionY &&
+ (decimal)secondPoint.yPosition > plotAreaPositionBottom) ||
+ ((decimal)firstPoint.yPosition > plotAreaPositionBottom &&
+ (decimal)secondPoint.yPosition < plotAreaPositionY))
+ {
+ segmentNumber = 3;
+ intersectionPoint2 = new DataPoint3D();
+ if((decimal)intersectionPoint.yPosition == plotAreaPositionY)
+ {
+ intersectionPoint2.yPosition = (double)plotAreaPositionBottom;
+ }
+ else
+ {
+ intersectionPoint2.yPosition = (double)plotAreaPositionY;
+ }
+ intersectionPoint2.xPosition = (intersectionPoint2.yPosition - secondPoint.yPosition) *
+ (firstPoint.xPosition - secondPoint.xPosition) /
+ (firstPoint.yPosition - secondPoint.yPosition) +
+ secondPoint.xPosition;
+
+ if(double.IsNaN(intersectionPoint2.xPosition) ||
+ double.IsInfinity(intersectionPoint2.xPosition) ||
+ double.IsNaN(intersectionPoint2.yPosition) ||
+ double.IsInfinity(intersectionPoint2.yPosition) )
+ {
+ return true;
+ }
+
+ // Switch intersection points
+ if((decimal)firstPoint.yPosition > plotAreaPositionBottom)
+ {
+ DataPoint3D tempPoint = new DataPoint3D();
+ tempPoint.xPosition = intersectionPoint.xPosition;
+ tempPoint.yPosition = intersectionPoint.yPosition;
+ intersectionPoint.xPosition = intersectionPoint2.xPosition;
+ intersectionPoint.yPosition = intersectionPoint2.yPosition;
+ intersectionPoint2.xPosition = tempPoint.xPosition;
+ intersectionPoint2.yPosition = tempPoint.yPosition;
+ }
+ }
+
+
+ // Adjust points Y values
+ bool firstSegmentVisible = true;
+ bool firstSegmentOutsideBottom = false;
+ bool secondSegmentOutsideBottom = false;
+ if((decimal)firstPoint.yPosition < plotAreaPositionY)
+ {
+ firstSegmentVisible = false;
+ firstPoint.yPosition = (double)plotAreaPositionY;
+ }
+ else if((decimal)firstPoint.yPosition > plotAreaPositionBottom)
+ {
+ firstSegmentOutsideBottom = true;
+ firstSegmentVisible = false;
+ firstPoint.yPosition = (double)plotAreaPositionBottom;
+ }
+ if((decimal)secondPoint.yPosition < plotAreaPositionY)
+ {
+ secondPoint.yPosition = (double)plotAreaPositionY;
+ }
+ else if((decimal)secondPoint.yPosition > plotAreaPositionBottom)
+ {
+ secondSegmentOutsideBottom = true;
+ secondPoint.yPosition = (double)plotAreaPositionBottom;
+ }
+
+ // Draw surfaces in 2 or 3 segments
+ for(int segmentIndex = 0; segmentIndex < 3; segmentIndex++)
+ {
+ GraphicsPath segmentPath = null;
+ if(segmentIndex == 0 && !reversed ||
+ segmentIndex == 2 && reversed)
+ {
+ // Draw first segment
+ if(intersectionPoint2 == null)
+ {
+ intersectionPoint2 = intersectionPoint;
+ }
+ intersectionPoint2.dataPoint = secondPoint.dataPoint;
+ intersectionPoint2.index = secondPoint.index;
+ intersectionPoint2.xCenterVal = secondPoint.xCenterVal;
+
+ segmentPath = Draw3DSurface( firstPoint, intersectionPoint2, reversed,
+ area, graph, matrix, lightStyle, prevDataPointEx,
+ positionZ, depth, points, pointIndex, pointLoopIndex,
+ tension, operationType,
+ (surfaceSegmentType == LineSegmentType.Middle) ? LineSegmentType.Middle : LineSegmentType.First,
+ (firstSegmentVisible && segmentNumber != 3) ? 0f : 0.5f, 0f,
+ new PointF(float.NaN, float.NaN),
+ new PointF((float)intersectionPoint2.xPosition, float.NaN),
+ firstSegmentOutsideBottom,
+ false, true);
+
+ }
+
+ if(segmentIndex == 1 && intersectionPoint2 != null && segmentNumber == 3)
+ {
+ // Draw middle segment
+ intersectionPoint2.dataPoint = secondPoint.dataPoint;
+ intersectionPoint2.index = secondPoint.index;
+ intersectionPoint2.xCenterVal = secondPoint.xCenterVal;
+
+ intersectionPoint.xCenterVal = firstPoint.xCenterVal;
+ intersectionPoint.index = firstPoint.index;
+ intersectionPoint.dataPoint = firstPoint.dataPoint;
+
+ segmentPath = Draw3DSurface( intersectionPoint, intersectionPoint2, reversed,
+ area, graph, matrix, lightStyle, prevDataPointEx,
+ positionZ, depth, points, pointIndex, pointLoopIndex,
+ tension, operationType, LineSegmentType.Middle,
+ topDarkening, bottomDarkening,
+ new PointF((float)intersectionPoint.xPosition, float.NaN),
+ new PointF((float)intersectionPoint2.xPosition, float.NaN),
+ false,
+ false, true);
+
+ }
+
+ if(segmentIndex == 2 && !reversed ||
+ segmentIndex == 0 && reversed)
+ {
+ // Draw second segment
+ intersectionPoint.dataPoint = firstPoint.dataPoint;
+ intersectionPoint.index = firstPoint.index;
+ intersectionPoint.xCenterVal = firstPoint.xCenterVal;
+
+ segmentPath = Draw3DSurface( intersectionPoint, secondPoint, reversed,
+ area, graph, matrix, lightStyle, prevDataPointEx,
+ positionZ, depth, points, pointIndex, pointLoopIndex,
+ tension, operationType,
+ (surfaceSegmentType == LineSegmentType.Middle) ? LineSegmentType.Middle : LineSegmentType.Last,
+ (!firstSegmentVisible && segmentNumber != 3) ? 0f : 0.5f, 0f,
+ new PointF((float)intersectionPoint.xPosition, float.NaN),
+ new PointF(float.NaN, float.NaN),
+ secondSegmentOutsideBottom,
+ false, true);
+
+ }
+
+ // Add segment path
+ if(resultPath != null && segmentPath != null && segmentPath.PointCount > 0)
+ {
+ resultPath.AddPath(segmentPath, true);
+ }
+ }
+
+ // Restore previous y positions
+ firstPoint.yPosition = prevFirstPointY;
+ secondPoint.yPosition = prevSecondPointY;
+
+ return true;
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// Clips the bottom (left and right) points of the segment to plotting area.
+ /// Used in area and range charts.
+ /// </summary>
+ /// <param name="resultPath"></param>
+ /// <param name="firstPoint">First data point.</param>
+ /// <param name="secondPoint">Second data point.</param>
+ /// <param name="thirdPoint">Coordinates of the bottom left point.</param>
+ /// <param name="fourthPoint">Coordinates of the bottom right point.</param>
+ /// <param name="reversed">Points are in reversed order.</param>
+ /// <param name="area">Chart area reference.</param>
+ /// <param name="graph">Chart graphics.</param>
+ /// <param name="matrix">Coordinates transformation matrix.</param>
+ /// <param name="lightStyle">LightStyle style (None, Simplistic, Realistic).</param>
+ /// <param name="prevDataPointEx">Previous data point object.</param>
+ /// <param name="positionZ">Z position of the back side of the 3D surface.</param>
+ /// <param name="depth">Depth of the 3D surface.</param>
+ /// <param name="points">Array of points.</param>
+ /// <param name="pointIndex">Index of point to draw.</param>
+ /// <param name="pointLoopIndex">Index of points loop.</param>
+ /// <param name="tension">Line tension.</param>
+ /// <param name="operationType">AxisName of operation Drawing, Calculating Path or Both</param>
+ /// <param name="surfaceSegmentType">Define surface segment type if it consists of several segments.</param>
+ /// <param name="topDarkening">Darkenning scale for top surface. 0 - None.</param>
+ /// <param name="bottomDarkening">Darkenning scale for bottom surface. 0 - None.</param>
+ /// <returns>Returns element shape path if operationType parameter is set to CalcElementPath, otherwise Null.</returns>
+ protected bool ClipBottomPoints(
+ GraphicsPath resultPath,
+ ref DataPoint3D firstPoint,
+ ref DataPoint3D secondPoint,
+ ref PointF thirdPoint,
+ ref PointF fourthPoint,
+ bool reversed,
+ ChartArea area,
+ ChartGraphics graph,
+ Matrix3D matrix,
+ LightStyle lightStyle,
+ DataPoint3D prevDataPointEx,
+ float positionZ,
+ float depth,
+ ArrayList points,
+ int pointIndex,
+ int pointLoopIndex,
+ float tension,
+ DrawingOperationTypes operationType,
+ LineSegmentType surfaceSegmentType,
+ float topDarkening,
+ float bottomDarkening)
+ {
+ // Do not allow recursion to go too deep
+ ++area.IterationCounter;
+ if(area.IterationCounter > 20)
+ {
+ area.IterationCounter = 0;
+ return true;
+ }
+
+ //****************************************************************
+ //** Round plot are position and point coordinates
+ //****************************************************************
+ int decimals = 3;
+ decimal plotAreaPositionX = Math.Round((decimal)area.PlotAreaPosition.X, decimals);
+ decimal plotAreaPositionY = Math.Round((decimal)area.PlotAreaPosition.Y, decimals);
+ decimal plotAreaPositionRight = Math.Round((decimal)area.PlotAreaPosition.Right, decimals);
+ decimal plotAreaPositionBottom = Math.Round((decimal)area.PlotAreaPosition.Bottom, decimals);
+
+ // Make area a little bit bigger
+ plotAreaPositionX -= 0.001M;
+ plotAreaPositionY -= 0.001M;
+ plotAreaPositionRight += 0.001M;
+ plotAreaPositionBottom += 0.001M;
+
+
+
+ // Round top points coordinates
+ firstPoint.xPosition = Math.Round(firstPoint.xPosition, decimals);
+ firstPoint.yPosition = Math.Round(firstPoint.yPosition, decimals);
+ secondPoint.xPosition = Math.Round(secondPoint.xPosition, decimals);
+ secondPoint.yPosition = Math.Round(secondPoint.yPosition, decimals);
+
+ thirdPoint.X = (float)Math.Round(thirdPoint.X, decimals);
+ thirdPoint.Y = (float)Math.Round(thirdPoint.Y, decimals);
+
+ fourthPoint.X = (float)Math.Round(fourthPoint.X, decimals);
+ fourthPoint.Y = (float)Math.Round(fourthPoint.Y, decimals);
+
+ //****************************************************************
+ //** Clip area data points inside the plotting area
+ //****************************************************************
+
+ // Chech data points Y values
+ if((decimal)thirdPoint.Y < plotAreaPositionY ||
+ (decimal)thirdPoint.Y > plotAreaPositionBottom ||
+ (decimal)fourthPoint.Y < plotAreaPositionY ||
+ (decimal)fourthPoint.Y > plotAreaPositionBottom )
+ {
+ // Remember previous y positions
+ PointF prevThirdPoint = new PointF(thirdPoint.X, thirdPoint.Y);
+ PointF prevFourthPoint = new PointF(fourthPoint.X, fourthPoint.Y);
+
+ // Check if whole line is outside plotting region
+ bool surfaceCompletlyOutside = false;
+ bool outsideTop = false;
+ if((decimal)thirdPoint.Y < plotAreaPositionY &&
+ (decimal)fourthPoint.Y < plotAreaPositionY)
+ {
+ outsideTop = true;
+ surfaceCompletlyOutside = true;
+ thirdPoint.Y = area.PlotAreaPosition.Y;
+ fourthPoint.Y = area.PlotAreaPosition.Y;
+ }
+ if((decimal)thirdPoint.Y > plotAreaPositionBottom &&
+ (decimal)fourthPoint.Y > plotAreaPositionBottom)
+ {
+ surfaceCompletlyOutside = true;
+ thirdPoint.Y = area.PlotAreaPosition.Bottom;
+ fourthPoint.Y = area.PlotAreaPosition.Bottom;
+ }
+
+ // Draw just one surface
+ if(surfaceCompletlyOutside)
+ {
+ resultPath = Draw3DSurface( firstPoint, secondPoint, reversed,
+ area, graph, matrix, lightStyle, prevDataPointEx,
+ positionZ, depth, points, pointIndex, pointLoopIndex,
+ tension, operationType, surfaceSegmentType,
+ topDarkening, 0.5f,
+ new PointF(thirdPoint.X, thirdPoint.Y),
+ new PointF(fourthPoint.X, fourthPoint.Y),
+ outsideTop,
+ false, false);
+
+ // Restore previous x\y positions
+ thirdPoint = new PointF(prevThirdPoint.X, prevThirdPoint.Y);
+ fourthPoint = new PointF(prevFourthPoint.X, prevFourthPoint.Y);
+
+ return true;
+ }
+
+ // Get intersection point
+ DataPoint3D intersectionPoint = new DataPoint3D();
+ bool firstIntersectionOnBottom = false;
+ intersectionPoint.yPosition = (double)plotAreaPositionY;
+ if((decimal)thirdPoint.Y > plotAreaPositionBottom ||
+ (decimal)fourthPoint.Y > plotAreaPositionBottom )
+ {
+ intersectionPoint.yPosition = (double)area.PlotAreaPosition.Bottom;
+ firstIntersectionOnBottom = true;
+ }
+ intersectionPoint.xPosition = (intersectionPoint.yPosition - fourthPoint.Y) *
+ (thirdPoint.X - fourthPoint.X) /
+ (thirdPoint.Y - fourthPoint.Y) +
+ fourthPoint.X;
+
+ // Intersection point must be between first and second points
+ intersectionPoint.yPosition = (intersectionPoint.xPosition - secondPoint.xPosition) /
+ (firstPoint.xPosition - secondPoint.xPosition) *
+ (firstPoint.yPosition - secondPoint.yPosition) +
+ secondPoint.yPosition;
+
+ if(double.IsNaN(intersectionPoint.xPosition) ||
+ double.IsInfinity(intersectionPoint.xPosition) ||
+ double.IsNaN(intersectionPoint.yPosition) ||
+ double.IsInfinity(intersectionPoint.yPosition) )
+ {
+ return true;
+ }
+
+ // Check if there are 2 intersection points (3 segments)
+ int segmentNumber = 2;
+ DataPoint3D intersectionPoint2 = null;
+ bool switchPoints = false;
+ if( ((decimal)thirdPoint.Y < plotAreaPositionY &&
+ (decimal)fourthPoint.Y > plotAreaPositionBottom) ||
+ ((decimal)thirdPoint.Y > plotAreaPositionBottom &&
+ (decimal)fourthPoint.Y < plotAreaPositionY))
+ {
+ segmentNumber = 3;
+ intersectionPoint2 = new DataPoint3D();
+ if(!firstIntersectionOnBottom)
+ {
+ intersectionPoint2.yPosition = (double)area.PlotAreaPosition.Bottom;
+ }
+ else
+ {
+ intersectionPoint2.yPosition = (double)area.PlotAreaPosition.Y;
+ }
+ intersectionPoint2.xPosition = (intersectionPoint2.yPosition - fourthPoint.Y) *
+ (thirdPoint.X - fourthPoint.X) /
+ (thirdPoint.Y - fourthPoint.Y) +
+ fourthPoint.X;
+
+ intersectionPoint2.yPosition = (intersectionPoint2.xPosition - secondPoint.xPosition) /
+ (firstPoint.xPosition - secondPoint.xPosition) *
+ (firstPoint.yPosition - secondPoint.yPosition) +
+ secondPoint.yPosition;
+
+ if(double.IsNaN(intersectionPoint2.xPosition) ||
+ double.IsInfinity(intersectionPoint2.xPosition) ||
+ double.IsNaN(intersectionPoint2.yPosition) ||
+ double.IsInfinity(intersectionPoint2.yPosition) )
+ {
+ return true;
+ }
+
+
+ // Switch intersection points
+ //if(firstPoint.yPosition > plotAreaPositionBottom)
+ if((decimal)thirdPoint.Y > plotAreaPositionBottom)
+ {
+ switchPoints = true;
+ /*
+ DataPoint3D tempPoint = new DataPoint3D();
+ tempPoint.xPosition = intersectionPoint.xPosition;
+ tempPoint.yPosition = intersectionPoint.yPosition;
+ intersectionPoint.xPosition = intersectionPoint2.xPosition;
+ intersectionPoint.yPosition = intersectionPoint2.yPosition;
+ intersectionPoint2.xPosition = tempPoint.xPosition;
+ intersectionPoint2.yPosition = tempPoint.yPosition;
+ */
+ }
+ }
+
+
+ // Adjust points Y values
+ bool firstSegmentVisible = true;
+ float bottomDarken = bottomDarkening;
+ bool firstSegmentOutsideTop = false;
+ bool secondSegmentOutsideTop = false;
+ if((decimal)thirdPoint.Y < plotAreaPositionY)
+ {
+ firstSegmentOutsideTop = true;
+ firstSegmentVisible = false;
+ thirdPoint.Y = area.PlotAreaPosition.Y;
+ bottomDarken = 0.5f;
+ }
+ else if((decimal)thirdPoint.Y > plotAreaPositionBottom)
+ {
+ firstSegmentVisible = false;
+ thirdPoint.Y = area.PlotAreaPosition.Bottom;
+ if(firstPoint.yPosition >= thirdPoint.Y)
+ {
+ bottomDarken = 0.5f;
+ }
+ }
+ if((decimal)fourthPoint.Y < plotAreaPositionY)
+ {
+ secondSegmentOutsideTop = true;
+ fourthPoint.Y = area.PlotAreaPosition.Y;
+ bottomDarken = 0.5f;
+ }
+ else if((decimal)fourthPoint.Y > plotAreaPositionBottom)
+ {
+ fourthPoint.Y = area.PlotAreaPosition.Bottom;
+ if(fourthPoint.Y <= secondPoint.yPosition)
+ {
+ bottomDarken = 0.5f;
+ }
+ }
+
+ // Draw surfaces in 2 or 3 segments
+ for(int segmentIndex = 0; segmentIndex < 3; segmentIndex++)
+ {
+ GraphicsPath segmentPath = null;
+ if(segmentIndex == 0 && !reversed ||
+ segmentIndex == 2 && reversed)
+ {
+ // Draw first segment
+ if(intersectionPoint2 == null)
+ {
+ intersectionPoint2 = intersectionPoint;
+ }
+
+ if(switchPoints)
+ {
+ DataPoint3D tempPoint = new DataPoint3D();
+ tempPoint.xPosition = intersectionPoint.xPosition;
+ tempPoint.yPosition = intersectionPoint.yPosition;
+ intersectionPoint.xPosition = intersectionPoint2.xPosition;
+ intersectionPoint.yPosition = intersectionPoint2.yPosition;
+ intersectionPoint2.xPosition = tempPoint.xPosition;
+ intersectionPoint2.yPosition = tempPoint.yPosition;
+ }
+
+
+ intersectionPoint2.dataPoint = secondPoint.dataPoint;
+ intersectionPoint2.index = secondPoint.index;
+ intersectionPoint2.xCenterVal = secondPoint.xCenterVal;
+
+ segmentPath = Draw3DSurface( firstPoint, intersectionPoint2, reversed,
+ area, graph, matrix, lightStyle, prevDataPointEx,
+ positionZ, depth, points, pointIndex, pointLoopIndex,
+ tension, operationType,
+ (surfaceSegmentType == LineSegmentType.Middle) ? LineSegmentType.Middle : LineSegmentType.First,
+ topDarkening, bottomDarken,
+ new PointF(float.NaN, thirdPoint.Y),
+ new PointF((float)intersectionPoint2.xPosition, (!firstSegmentVisible || segmentNumber == 3) ? thirdPoint.Y : fourthPoint.Y),
+ firstSegmentOutsideTop,
+ false, false);
+
+ if(switchPoints)
+ {
+ DataPoint3D tempPoint = new DataPoint3D();
+ tempPoint.xPosition = intersectionPoint.xPosition;
+ tempPoint.yPosition = intersectionPoint.yPosition;
+ intersectionPoint.xPosition = intersectionPoint2.xPosition;
+ intersectionPoint.yPosition = intersectionPoint2.yPosition;
+ intersectionPoint2.xPosition = tempPoint.xPosition;
+ intersectionPoint2.yPosition = tempPoint.yPosition;
+ }
+
+ }
+
+ if(segmentIndex == 1 && intersectionPoint2 != null && segmentNumber == 3)
+ {
+ if(!switchPoints)
+ {
+ DataPoint3D tempPoint = new DataPoint3D();
+ tempPoint.xPosition = intersectionPoint.xPosition;
+ tempPoint.yPosition = intersectionPoint.yPosition;
+ intersectionPoint.xPosition = intersectionPoint2.xPosition;
+ intersectionPoint.yPosition = intersectionPoint2.yPosition;
+ intersectionPoint2.xPosition = tempPoint.xPosition;
+ intersectionPoint2.yPosition = tempPoint.yPosition;
+ }
+
+ // Draw middle segment
+ intersectionPoint2.dataPoint = secondPoint.dataPoint;
+ intersectionPoint2.index = secondPoint.index;
+ intersectionPoint2.xCenterVal = secondPoint.xCenterVal;
+
+ intersectionPoint.xCenterVal = firstPoint.xCenterVal;
+ intersectionPoint.index = firstPoint.index;
+ intersectionPoint.dataPoint = firstPoint.dataPoint;
+
+ segmentPath = Draw3DSurface( intersectionPoint, intersectionPoint2, reversed,
+ area, graph, matrix, lightStyle, prevDataPointEx,
+ positionZ, depth, points, pointIndex, pointLoopIndex,
+ tension, operationType, LineSegmentType.Middle,
+ topDarkening, bottomDarkening,
+ new PointF((float)intersectionPoint.xPosition, thirdPoint.Y),
+ new PointF((float)intersectionPoint2.xPosition, fourthPoint.Y),
+ false,
+ false, false);
+
+ if(!switchPoints)
+ {
+ DataPoint3D tempPoint = new DataPoint3D();
+ tempPoint.xPosition = intersectionPoint.xPosition;
+ tempPoint.yPosition = intersectionPoint.yPosition;
+ intersectionPoint.xPosition = intersectionPoint2.xPosition;
+ intersectionPoint.yPosition = intersectionPoint2.yPosition;
+ intersectionPoint2.xPosition = tempPoint.xPosition;
+ intersectionPoint2.yPosition = tempPoint.yPosition;
+ }
+
+ }
+
+ if(segmentIndex == 2 && !reversed ||
+ segmentIndex == 0 && reversed)
+ {
+ if(switchPoints)
+ {
+ DataPoint3D tempPoint = new DataPoint3D();
+ tempPoint.xPosition = intersectionPoint.xPosition;
+ tempPoint.yPosition = intersectionPoint.yPosition;
+ intersectionPoint.xPosition = intersectionPoint2.xPosition;
+ intersectionPoint.yPosition = intersectionPoint2.yPosition;
+ intersectionPoint2.xPosition = tempPoint.xPosition;
+ intersectionPoint2.yPosition = tempPoint.yPosition;
+ }
+
+ // Draw second segment
+ intersectionPoint.dataPoint = firstPoint.dataPoint;
+ intersectionPoint.index = firstPoint.index;
+ intersectionPoint.xCenterVal = firstPoint.xCenterVal;
+
+ float thirdPointNewY = (!firstSegmentVisible || segmentNumber == 3) ? thirdPoint.Y : fourthPoint.Y;
+ if(segmentNumber == 3)
+ {
+ thirdPointNewY = (secondSegmentOutsideTop) ? thirdPoint.Y : fourthPoint.Y;
+ }
+
+ segmentPath = Draw3DSurface( intersectionPoint, secondPoint, reversed,
+ area, graph, matrix, lightStyle, prevDataPointEx,
+ positionZ, depth, points, pointIndex, pointLoopIndex,
+ tension, operationType,
+ (surfaceSegmentType == LineSegmentType.Middle) ? LineSegmentType.Middle : LineSegmentType.Last,
+ topDarkening, bottomDarken,
+ new PointF((float)intersectionPoint.xPosition, thirdPointNewY),
+ new PointF(float.NaN, fourthPoint.Y),
+ secondSegmentOutsideTop,
+ false, false);
+
+ if(switchPoints)
+ {
+ DataPoint3D tempPoint = new DataPoint3D();
+ tempPoint.xPosition = intersectionPoint.xPosition;
+ tempPoint.yPosition = intersectionPoint.yPosition;
+ intersectionPoint.xPosition = intersectionPoint2.xPosition;
+ intersectionPoint.yPosition = intersectionPoint2.yPosition;
+ intersectionPoint2.xPosition = tempPoint.xPosition;
+ intersectionPoint2.yPosition = tempPoint.yPosition;
+ }
+
+ }
+
+ // Add segment path
+ if(resultPath != null && segmentPath != null && segmentPath.PointCount > 0)
+ {
+ resultPath.AddPath(segmentPath, true);
+ }
+ }
+
+ // Restore previous x\y positions
+ thirdPoint = new PointF(prevThirdPoint.X, prevThirdPoint.Y);
+ fourthPoint = new PointF(prevFourthPoint.X, prevFourthPoint.Y);
+ return true;
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// Draws a 3D surface connecting the two specified points in 2D space.
+ /// Used to draw Line based charts.
+ /// </summary>
+ /// <param name="firstPoint">First data point.</param>
+ /// <param name="secondPoint">Second data point.</param>
+ /// <param name="reversed">Points are in reversed order.</param>
+ /// <param name="area">Chart area reference.</param>
+ /// <param name="graph">Chart graphics.</param>
+ /// <param name="matrix">Coordinates transformation matrix.</param>
+ /// <param name="lightStyle">LightStyle style (None, Simplistic, Realistic).</param>
+ /// <param name="prevDataPointEx">Previous data point object.</param>
+ /// <param name="positionZ">Z position of the back side of the 3D surface.</param>
+ /// <param name="depth">Depth of the 3D surface.</param>
+ /// <param name="points">Array of points.</param>
+ /// <param name="pointIndex">Index of point to draw.</param>
+ /// <param name="pointLoopIndex">Index of points loop.</param>
+ /// <param name="tension">Line tension.</param>
+ /// <param name="operationType">AxisName of operation Drawing, Calculating Path or Both</param>
+ /// <param name="surfaceSegmentType">Define surface segment type if it consists of several segments.</param>
+ /// <param name="topDarkening">Darkenning scale for top surface. 0 - None.</param>
+ /// <param name="bottomDarkening">Darkenning scale for bottom surface. 0 - None.</param>
+ /// <param name="thirdPointPosition">Position where the third point is actually located or float.NaN if same as in "firstPoint".</param>
+ /// <param name="fourthPointPosition">Position where the fourth point is actually located or float.NaN if same as in "secondPoint".</param>
+ /// <param name="clippedSegment">Indicates that drawn segment is 3D clipped. Only top/bottom should be drawn.</param>
+ /// <param name="clipOnTop">Indicates that top segment line should be clipped to the pkot area.</param>
+ /// <param name="clipOnBottom">Indicates that bottom segment line should be clipped to the pkot area.</param>
+ /// <returns>Returns elemnt shape path if operationType parameter is set to CalcElementPath, otherwise Null.</returns>
+ protected virtual GraphicsPath Draw3DSurface(
+ DataPoint3D firstPoint,
+ DataPoint3D secondPoint,
+ bool reversed,
+ ChartArea area,
+ ChartGraphics graph,
+ Matrix3D matrix,
+ LightStyle lightStyle,
+ DataPoint3D prevDataPointEx,
+ float positionZ,
+ float depth,
+ ArrayList points,
+ int pointIndex,
+ int pointLoopIndex,
+ float tension,
+ DrawingOperationTypes operationType,
+ LineSegmentType surfaceSegmentType,
+ float topDarkening,
+ float bottomDarkening,
+ PointF thirdPointPosition,
+ PointF fourthPointPosition,
+ bool clippedSegment,
+ bool clipOnTop,
+ bool clipOnBottom)
+ {
+ // Implemented in area and range chart
+ return null;
+ }
+ #endregion
+
+ #region IDisposable overrides
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ // Dispose managed resources
+ if (this._linePen != null)
+ {
+ this._linePen.Dispose();
+ this._linePen = null;
+ }
+ }
+ base.Dispose(disposing);
+ }
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/PieChart.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/PieChart.cs
new file mode 100644
index 00000000000..ae0bb94870b
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/PieChart.cs
@@ -0,0 +1,5703 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: PieChart.cs
+//
+// Namespace: DataVisualization.Charting.ChartTypes
+//
+// Classes: PieChart
+//
+// Purpose: Provides 2D/3D drawing and hit testing functionality
+// for the Pie chart. A pie chart shows how proportions
+// of data, shown as pie-shaped pieces, contribute to
+// the data as a whole.
+//
+// PieChart class is used as a base class for the
+// DoughnutChart class.
+//
+// Reviewed: GS - Aug 8, 2002
+// AG - Aug 8, 2002
+// AG - Microsoft 6, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.ComponentModel.Design;
+using System.Globalization;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+#else
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.ChartTypes
+#else
+ namespace System.Web.UI.DataVisualization.Charting.ChartTypes
+#endif
+{
+ #region Enumerations
+
+ /// <summary>
+ /// Pie Labels style
+ /// </summary>
+ internal enum PieLabelStyle
+ {
+ /// <summary>
+ /// Labels are inside pie slice
+ /// </summary>
+ Inside,
+
+ /// <summary>
+ /// Labels are outside pie slice
+ /// </summary>
+ Outside,
+
+ /// <summary>
+ /// Labels are disabled
+ /// </summary>
+ Disabled,
+
+ };
+
+ #endregion
+
+ /// <summary>
+ /// PieChart class provides 2D/3D drawing and hit testing functionality
+ /// for the Pie chart.
+ /// </summary>
+ internal class PieChart : IChartType
+ {
+ #region Enumerations
+
+ /// <summary>
+ /// Labels Mode for preparing data
+ /// </summary>
+ enum LabelsMode
+ {
+ /// <summary>
+ /// There are no labels
+ /// </summary>
+ Off,
+
+ /// <summary>
+ /// Drawing labels mode
+ /// </summary>
+ Draw,
+
+ /// <summary>
+ /// Labels Estimation mode
+ /// </summary>
+ EstimateSize,
+
+ /// <summary>
+ /// Labels Overlap Mode
+ /// </summary>
+ LabelsOverlap
+ };
+
+ #endregion
+
+ #region Fields
+
+ // True if labels fit inside plot area.
+ private bool _labelsFit = true;
+
+ // Field that is used to resize pie
+ // because of labels.
+ private float _sizeCorrection = 0.95F;
+
+ // True if any pie slice is exploded
+ private bool _sliceExploded = false;
+
+ // True if labels overlap for 2D Pie and outside labels
+ private bool _labelsOverlap = false;
+
+ // Left Lable column used for 3D chart and outside labels
+ internal LabelColumn labelColumnLeft;
+
+ // Right Lable column used for 3D chart and outside labels
+ internal LabelColumn labelColumnRight;
+
+ // Array of label rectangles used to prevent labels overlapping
+ // for 2D pie chart outside labels.
+ private ArrayList _labelsRectangles = new ArrayList();
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ virtual public string Name { get{ return ChartTypeNames.Pie;}}
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ virtual public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+
+ /// <summary>
+ /// True if chart type is stacked
+ /// </summary>
+ virtual public bool Stacked { get{ return false;}}
+
+
+ /// <summary>
+ /// True if stacked chart type supports groups
+ /// </summary>
+ virtual public bool SupportStackedGroups { get { return false; } }
+
+
+ /// <summary>
+ /// True if stacked chart type should draw separately positive and
+ /// negative data points ( Bar and column Stacked types ).
+ /// </summary>
+ public bool StackSign { get{ return false;}}
+
+ /// <summary>
+ /// True if chart type supports axeses
+ /// </summary>
+ virtual public bool RequireAxes { get{ return false;} }
+
+ /// <summary>
+ /// Chart type with two y values used for scale ( bubble chart type )
+ /// </summary>
+ public bool SecondYScale{ get{ return false;} }
+
+ /// <summary>
+ /// True if chart type requires circular chart area.
+ /// </summary>
+ public bool CircularChartArea { get{ return false;} }
+
+ /// <summary>
+ /// True if chart type supports logarithmic axes
+ /// </summary>
+ virtual public bool SupportLogarithmicAxes { get{ return false;} }
+
+ /// <summary>
+ /// True if chart type requires to switch the value (Y) axes position
+ /// </summary>
+ virtual public bool SwitchValueAxes { get{ return false;} }
+
+ /// <summary>
+ /// True if chart series can be placed side-by-side.
+ /// </summary>
+ virtual public bool SideBySideSeries { get{ return false;} }
+
+ /// <summary>
+ /// If the crossing value is auto Crossing value should be
+ /// automatically set to zero for some chart
+ /// types (Bar, column, area etc.)
+ /// </summary>
+ virtual public bool ZeroCrossing { get{ return false;} }
+
+ /// <summary>
+ /// True if each data point of a chart must be represented in the legend
+ /// </summary>
+ virtual public bool DataPointsInLegend { get{ return true;} }
+
+ /// <summary>
+ /// Indicates that extra Y values are connected to the scale of the Y axis
+ /// </summary>
+ virtual public bool ExtraYValuesConnectedToYAxis{ get { return false; } }
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ virtual public bool HundredPercent{ get{return false;} }
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ virtual public bool HundredPercentSupportNegative{ get{return false;} }
+
+ /// <summary>
+ /// True if palette colors should be applied for each data paoint.
+ /// Otherwise the color is applied to the series.
+ /// </summary>
+ virtual public bool ApplyPaletteColorsToPoints { get { return true; } }
+
+ /// <summary>
+ /// How to draw series/points in legend:
+ /// Filled rectangle, Line or Marker
+ /// </summary>
+ /// <param name="series">Legend item series.</param>
+ /// <returns>Legend item style.</returns>
+ virtual public LegendImageStyle GetLegendImageStyle(Series series)
+ {
+ return LegendImageStyle.Rectangle;
+ }
+
+ /// <summary>
+ /// Number of supported Y value(s) per point
+ /// </summary>
+ virtual public int YValuesPerPoint{ get { return 1; } }
+
+ /// <summary>
+ /// Chart is Doughnut or Pie type
+ /// </summary>
+ virtual public bool Doughnut{ get { return false; } }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public PieChart()
+ {
+ }
+
+
+
+ /// <summary>
+ /// Calculates Collected pie slice if required.
+ /// </summary>
+ /// <param name="series">Series to be prepared.</param>
+ internal static void PrepareData(Series series)
+ {
+ // Check series chart type
+ if( String.Compare(series.ChartTypeName, ChartTypeNames.Pie, StringComparison.OrdinalIgnoreCase ) != 0 &&
+ String.Compare(series.ChartTypeName, ChartTypeNames.Doughnut, StringComparison.OrdinalIgnoreCase ) != 0
+ )
+ {
+ return;
+ }
+
+ // Check if collected threshold value is set
+ double threshold = 0.0;
+ if (series.IsCustomPropertySet(CustomPropertyName.CollectedThreshold))
+ {
+ double t;
+ bool parseSucceed = double.TryParse(series[CustomPropertyName.CollectedThreshold], NumberStyles.Any, CultureInfo.InvariantCulture, out t);
+ if (parseSucceed)
+ {
+ threshold = t;
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionDoughnutCollectedThresholdInvalidFormat));
+ }
+
+ if (threshold < 0.0)
+ {
+ throw (new InvalidOperationException(SR.ExceptionDoughnutThresholdInvalid));
+ }
+ }
+
+ // Check if threshold is set
+ if(threshold > 0.0)
+ {
+ // Get reference to the chart control
+ Chart chart = series.Chart;
+ if(chart == null)
+ {
+ throw (new InvalidOperationException(SR.ExceptionDoughnutNullReference));
+ }
+
+ // Create a temp series which will hold original series data points
+ Series seriesOriginalData = new Series("PIE_ORIGINAL_DATA_" + series.Name, series.YValuesPerPoint);
+ seriesOriginalData.Enabled = false;
+ seriesOriginalData.IsVisibleInLegend = false;
+ chart.Series.Add(seriesOriginalData);
+ foreach(DataPoint dp in series.Points)
+ {
+ seriesOriginalData.Points.Add(dp.Clone());
+ }
+
+ // Copy temporary design data attribute
+ if(series.IsCustomPropertySet("TempDesignData"))
+ {
+ seriesOriginalData["TempDesignData"] = "true";
+ }
+
+ // Calculate total value of all data points. IsEmpty points are
+ // ignored. Absolute value is used.
+ double total = 0.0;
+ foreach(DataPoint dp in series.Points)
+ {
+ if(!dp.IsEmpty)
+ {
+ total += Math.Abs(dp.YValues[0]);
+ }
+ }
+
+ // Check if threshold value is set in percents
+ bool percent = true;
+ if(series.IsCustomPropertySet(CustomPropertyName.CollectedThresholdUsePercent))
+ {
+ if(string.Compare(series[CustomPropertyName.CollectedThresholdUsePercent], "True", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ percent = true;
+ }
+ else if (string.Compare(series[CustomPropertyName.CollectedThresholdUsePercent], "False", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ percent = false;
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionDoughnutCollectedThresholdUsePercentInvalid));
+ }
+ }
+
+ // Convert from percent valur to data point value
+ if(percent)
+ {
+ if(threshold > 100.0)
+ {
+ throw (new InvalidOperationException(SR.ExceptionDoughnutCollectedThresholdInvalidRange));
+ }
+
+ threshold = total * threshold / 100.0;
+ }
+
+ // Count how many points will be collected and remove collected points
+ DataPoint collectedPoint = null;
+ double collectedTotal = 0.0;
+ int collectedCount = 0;
+ int firstCollectedPointIndex = 0;
+ int originalDataPointIndex = 0;
+ for(int dataPointIndex = 0; dataPointIndex < series.Points.Count; dataPointIndex++)
+ {
+ DataPoint dataPoint = series.Points[dataPointIndex];
+ if(!dataPoint.IsEmpty && Math.Abs(dataPoint.YValues[0]) <= threshold)
+ {
+ // Keep statistics
+ ++collectedCount;
+ collectedTotal += Math.Abs(dataPoint.YValues[0]);
+
+ // Make a template for the collected point using the first removed point
+ if(collectedPoint == null)
+ {
+ firstCollectedPointIndex = dataPointIndex;
+ collectedPoint = dataPoint.Clone();
+ }
+
+ // Remove first collected point only when second collected point found
+ if(collectedCount == 2)
+ {
+ series.Points.RemoveAt(firstCollectedPointIndex);
+ --dataPointIndex;
+ }
+
+ // Remove collected point
+ if(collectedCount > 1)
+ {
+ series.Points.RemoveAt(dataPointIndex);
+ --dataPointIndex;
+ }
+ }
+
+ // Set point index that will be used for tooltips
+ dataPoint["OriginalPointIndex"] = originalDataPointIndex.ToString(CultureInfo.InvariantCulture);
+ ++originalDataPointIndex;
+ }
+
+ // Add collected data point into the series
+ if(collectedCount > 1 && collectedPoint != null)
+ {
+ collectedPoint["_COLLECTED_DATA_POINT"] = "TRUE";
+ collectedPoint.YValues[0] = collectedTotal;
+ series.Points.Add(collectedPoint);
+
+ // Set collected point color
+ if(series.IsCustomPropertySet(CustomPropertyName.CollectedColor))
+ {
+ ColorConverter colorConverter = new ColorConverter();
+ try
+ {
+ collectedPoint.Color = (Color)colorConverter.ConvertFromString(null, CultureInfo.InvariantCulture, series[CustomPropertyName.CollectedColor]);
+ }
+ catch
+ {
+ throw (new InvalidOperationException(SR.ExceptionDoughnutCollectedColorInvalidFormat));
+ }
+ }
+
+ // Set collected point exploded attribute
+ if(series.IsCustomPropertySet(CustomPropertyName.CollectedSliceExploded))
+ {
+ collectedPoint[CustomPropertyName.Exploded] = series[CustomPropertyName.CollectedSliceExploded];
+ }
+
+ // Set collected point tooltip
+ if(series.IsCustomPropertySet(CustomPropertyName.CollectedToolTip))
+ {
+ collectedPoint.ToolTip = series[CustomPropertyName.CollectedToolTip];
+ }
+
+ // Set collected point legend text
+ if(series.IsCustomPropertySet(CustomPropertyName.CollectedLegendText))
+ {
+ collectedPoint.LegendText = series[CustomPropertyName.CollectedLegendText];
+ }
+ else
+ {
+ collectedPoint.LegendText = SR.DescriptionCustomAttributeCollectedLegendDefaultText;
+ }
+
+ // Set collected point label
+ if(series.IsCustomPropertySet(CustomPropertyName.CollectedLabel))
+ {
+ collectedPoint.Label = series[CustomPropertyName.CollectedLabel];
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Remove any changes done while preparing Pie/Doughnut charts
+ /// to draw the collected slice.
+ /// </summary>
+ /// <param name="series">Series to be un-prepared.</param>
+ /// <returns>True if series was removed from collection.</returns>
+ internal static bool UnPrepareData(Series series)
+ {
+ if(series.Name.StartsWith("PIE_ORIGINAL_DATA_", StringComparison.Ordinal))
+ {
+ // Get reference to the chart control
+ Chart chart = series.Chart;
+ if(chart == null)
+ {
+ throw (new InvalidOperationException(SR.ExceptionDoughnutNullReference));
+ }
+
+ // Get original Renko series
+ Series pieSeries = chart.Series[series.Name.Substring(18)];
+
+ // Copy data back to original Pie series
+ pieSeries.Points.Clear();
+ if(!series.IsCustomPropertySet("TempDesignData"))
+ {
+ foreach(DataPoint dp in series.Points)
+ {
+ pieSeries.Points.Add(dp);
+ }
+ }
+
+ // Remove series from the collection
+ chart.Series.Remove(series);
+ return true;
+ }
+ return false;
+ }
+
+
+
+ /// <summary>
+ /// Paint Pie Chart
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object</param>
+ /// <param name="common">The Common elements object</param>
+ /// <param name="area">Chart area for this chart</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ public void Paint( ChartGraphics graph, CommonElements common, ChartArea area, Series seriesToDraw )
+ {
+ // Pie chart cannot be combined with other chart types
+ foreach( Series series in common.DataManager.Series )
+ {
+ // Check if series is visible and belong to the current chart area
+ if( series.IsVisible() &&
+ series.ChartArea == area.Name )
+ {
+ // Check if series chart type matches
+ if( String.Compare( series.ChartTypeName, this.Name, true, System.Globalization.CultureInfo.CurrentCulture ) != 0 )
+ {
+ if(!common.ChartPicture.SuppressExceptions)
+ {
+ // Pie/Doughnut chart can not be combined with other chart type
+ throw (new InvalidOperationException(SR.ExceptionChartCanNotCombine( this.Name )));
+ }
+ }
+ }
+ }
+
+ // 3D Pie Chart
+ if( area.Area3DStyle.Enable3D )
+ {
+
+ float pieWidth = 10 * area.Area3DStyle.PointDepth / 100;
+
+ // Set Clip Region
+ graph.SetClip(area.Position.ToRectangleF());
+
+ // Make reversed X angle because of default angle.
+ area.Area3DStyle.Inclination *= -1;
+ int oldYAngle = area.Area3DStyle.Rotation;
+ area.Area3DStyle.Rotation = area.GetRealYAngle( );
+
+ // Draw Pie
+ ProcessChartType3D( false, graph, common, area, pieWidth );
+
+ // Make reversed X angle because of default angle.
+ area.Area3DStyle.Inclination *= -1;
+ area.Area3DStyle.Rotation = oldYAngle;
+
+ // Reset Clip Region
+ graph.ResetClip();
+
+ }
+ else
+ {
+ // Reset overlapped labels flag
+ this._labelsOverlap = false;
+
+ //Set Clip Region
+ ((ChartGraphics)graph).SetClip( area.Position.ToRectangleF() );
+
+ // Resize pie because of labels
+ SizeCorrection( graph, common, area );
+
+ // Draw Pie labels
+ ProcessChartType( false, graph, common, area, false, LabelsMode.LabelsOverlap );
+
+ // If overlapping labels are detected they will be drawn in "columns" on each
+ // side of the pie. Adjust plotting area to fit the labels
+ if(this._labelsOverlap)
+ {
+ // Resize pie because of labels
+ SizeCorrection( graph, common, area );
+
+ // Reset overlapped labels flag
+ this._labelsOverlap = false;
+
+ // Draw Pie labels
+ ProcessChartType( false, graph, common, area, false, LabelsMode.LabelsOverlap );
+ }
+
+ // Draw Shadow
+ ProcessChartType( false, graph, common, area, true, LabelsMode.Off );
+
+ // Draw Pie
+ ProcessChartType( false, graph, common, area, false, LabelsMode.Off );
+
+ // Draw Pie labels
+ ProcessChartType( false, graph, common, area, false, LabelsMode.Draw );
+
+ //Reset Clip Region
+ ((ChartGraphics)graph).ResetClip();
+ }
+ }
+
+ /// <summary>
+ /// Take Relative Minimum Pie Size attribute
+ /// </summary>
+ /// <param name="area">Chart Area</param>
+ /// <returns>Custom attribute value.</returns>
+ private double MinimumRelativePieSize( ChartArea area )
+ {
+ // Default value
+ double minimumSize = 0.3;
+
+ // All data series from chart area which have Pie chart type
+ List<string> typeSeries = area.GetSeriesFromChartType(Name);
+
+ // Data series collection
+ SeriesCollection dataSeries = area.Common.DataManager.Series;
+
+ // Take Relative Minimum Pie Size attribute
+ if(dataSeries[typeSeries[0]].IsCustomPropertySet(CustomPropertyName.MinimumRelativePieSize))
+ {
+ minimumSize = CommonElements.ParseFloat(dataSeries[typeSeries[0]][CustomPropertyName.MinimumRelativePieSize]) / 100.0;
+
+ // Validation
+ if( minimumSize < 0.1 || minimumSize > 0.7 )
+ throw (new ArgumentException(SR.ExceptionPieMinimumRelativePieSizeInvalid));
+
+ }
+
+ return minimumSize;
+ }
+
+ /// <summary>
+ /// Method that is used to resize pie
+ /// because of labels.
+ /// </summary>
+ private void SizeCorrection( ChartGraphics graph, CommonElements common, ChartArea area )
+ {
+ float correction = (this._labelsOverlap) ? this._sizeCorrection : 0.95F;
+ _sliceExploded = false;
+
+ // Estimate Labels
+ if( area.InnerPlotPosition.Auto )
+ {
+ for( ; correction >= (float)MinimumRelativePieSize( area ); correction -= 0.05F )
+ {
+ // Decrease Pie size
+ this._sizeCorrection = correction;
+
+ // Check if labels fit.
+ ProcessChartType( false, graph, common, area, false, LabelsMode.EstimateSize );
+ if( _labelsFit )
+ {
+ break;
+ }
+ }
+
+ // Size correction for exploded pie can not be larger then 0.8
+ if( _sliceExploded && _sizeCorrection > 0.8F )
+ {
+ _sizeCorrection = 0.8F;
+ }
+ }
+ else
+ {
+ _sizeCorrection = 0.95F;
+ }
+ }
+
+ /// <summary>
+ /// This method recalculates position of pie slices
+ /// or checks if pie slice is selected.
+ /// </summary>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active</param>
+ /// <param name="graph">The Chart Graphics object</param>
+ /// <param name="common">The Common elements object</param>
+ /// <param name="area">Chart area for this chart</param>
+ /// <param name="shadow">Draw pie shadow</param>
+ /// <param name="labels">Pie labels</param>
+ private void ProcessChartType( bool selection, ChartGraphics graph, CommonElements common, ChartArea area, bool shadow, LabelsMode labels )
+ {
+ float startAngle = 0; // Angle in degrees measured clockwise from the x-axis to the first side of the pie section.
+ string explodedAttrib = ""; // Exploded attribute
+ bool exploded; // Exploded pie slice
+ float midAngle; // Angle between Start Angle and End Angle
+
+ // Data series collection
+ SeriesCollection dataSeries = common.DataManager.Series;
+
+ // Clear Labels overlap collection
+ if( labels == LabelsMode.LabelsOverlap )
+ {
+ _labelsRectangles.Clear();
+ }
+
+ // All data series from chart area which have Pie chart type
+ List<string> typeSeries = area.GetSeriesFromChartType(Name);
+ if(typeSeries.Count == 0)
+ {
+ return;
+ }
+
+ // Get first pie starting angle
+ if(typeSeries.Count > 0)
+ {
+ if (dataSeries[typeSeries[0]].IsCustomPropertySet(CustomPropertyName.PieStartAngle))
+ {
+ float angle;
+ bool parseSucceed = float.TryParse(dataSeries[typeSeries[0]][CustomPropertyName.PieStartAngle], NumberStyles.Any, CultureInfo.InvariantCulture, out angle);
+ if (parseSucceed)
+ {
+ startAngle = angle;
+ }
+
+ if (!parseSucceed || startAngle > 360f || startAngle < 0f)
+ {
+ throw (new InvalidOperationException(SR.ExceptionCustomAttributeAngleOutOfRange("PieStartAngle")));
+ }
+ }
+ }
+
+ // Call Back Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPrePaint(new ChartPaintEventArgs(dataSeries[typeSeries[0]], graph, common, area.PlotAreaPosition));
+ }
+
+ // The data points loop. Find Sum of data points.
+ double sum = 0.0;
+ foreach( DataPoint point in dataSeries[typeSeries[0]].Points )
+ {
+ if( !point.IsEmpty )
+ {
+ sum += Math.Abs( point.YValues[0] );
+ }
+ }
+
+ // No points or all points have zero values
+ if(sum == 0.0)
+ {
+ return;
+ }
+
+ // Take radius attribute
+ float doughnutRadius = 60f;
+ if(dataSeries[typeSeries[0]].IsCustomPropertySet(CustomPropertyName.DoughnutRadius))
+ {
+ doughnutRadius = CommonElements.ParseFloat(dataSeries[typeSeries[0]][CustomPropertyName.DoughnutRadius]);
+
+ // Validation
+ if( doughnutRadius < 0f || doughnutRadius > 99f )
+ throw (new ArgumentException(SR.ExceptionPieRadiusInvalid));
+
+ }
+
+ // This method is introduced to check colors of palette. For
+ // pie chart the first pie slice and the second pie slice can
+ // not have same color because they are connected.
+ CheckPaleteColors( dataSeries[typeSeries[0]].Points );
+
+ //************************************************************
+ //** Data point loop
+ //************************************************************
+ int pointIndx = 0;
+ int nonEmptyPointIndex = 0;
+ foreach( DataPoint point in dataSeries[typeSeries[0]].Points )
+ {
+ // Do not process empty points
+ if( point.IsEmpty )
+ {
+ pointIndx++;
+ continue;
+ }
+
+ // Rectangle size
+ RectangleF rectangle;
+ if( area.InnerPlotPosition.Auto )
+ {
+ rectangle = new RectangleF( area.Position.ToRectangleF().X, area.Position.ToRectangleF().Y, area.Position.ToRectangleF().Width, area.Position.ToRectangleF().Height );
+ }
+ else
+ {
+ rectangle = new RectangleF( area.PlotAreaPosition.ToRectangleF().X, area.PlotAreaPosition.ToRectangleF().Y, area.PlotAreaPosition.ToRectangleF().Width, area.PlotAreaPosition.ToRectangleF().Height );
+ }
+ if(rectangle.Width < 0f || rectangle.Height < 0f)
+ {
+ return;
+ }
+
+ // Find smallest edge
+ SizeF absoluteSize = graph.GetAbsoluteSize( new SizeF( rectangle.Width, rectangle.Height ) );
+ float absRadius = ( absoluteSize.Width < absoluteSize.Height ) ? absoluteSize.Width : absoluteSize.Height;
+
+ // Size of the square, which will be used for drawing pie.
+ SizeF relativeSize = graph.GetRelativeSize( new SizeF( absRadius, absRadius ) );
+
+ // Center of the pie
+ PointF middlePoint = new PointF( rectangle.X + rectangle.Width / 2, rectangle.Y + rectangle.Height / 2 );
+
+ // Rectangle which will always create circle, never ellipse.
+ rectangle = new RectangleF( middlePoint.X - relativeSize.Width / 2, middlePoint.Y - relativeSize.Height / 2, relativeSize.Width, relativeSize.Height );
+
+ // Size correction because of exploded or labels
+ if( _sizeCorrection != 1 )
+ {
+ rectangle.X += rectangle.Width * ( 1 - _sizeCorrection ) / 2;
+ rectangle.Y += rectangle.Height * ( 1 - _sizeCorrection ) / 2;
+ rectangle.Width = rectangle.Width * _sizeCorrection;
+ rectangle.Height = rectangle.Height * _sizeCorrection;
+
+ // Adjust inner plot position
+ if(area.InnerPlotPosition.Auto)
+ {
+ RectangleF rect = rectangle;
+ rect.X = (rect.X - area.Position.X) / area.Position.Width * 100f;
+ rect.Y = (rect.Y - area.Position.Y) / area.Position.Height * 100f;
+ rect.Width = rect.Width / area.Position.Width * 100f;
+ rect.Height = rect.Height / area.Position.Height * 100f;
+ area.InnerPlotPosition.SetPositionNoAuto(rect.X, rect.Y, rect.Width, rect.Height);
+ }
+ }
+
+ float sweepAngle = (float)( Math.Abs(point.YValues[0]) / sum * 360);
+
+ // Check Exploded attribute for data point
+ exploded = false;
+ if(point.IsCustomPropertySet(CustomPropertyName.Exploded))
+ {
+ explodedAttrib = point[CustomPropertyName.Exploded];
+ if( String.Compare(explodedAttrib,"true", StringComparison.OrdinalIgnoreCase) == 0 )
+ exploded = true;
+ else
+ exploded = false;
+ }
+
+ Color pieLineColor = Color.Empty;
+ ColorConverter colorConverter = new ColorConverter();
+
+ // Check if special color properties are set
+ if(point.IsCustomPropertySet(CustomPropertyName.PieLineColor) || dataSeries[typeSeries[0]].IsCustomPropertySet(CustomPropertyName.PieLineColor))
+ {
+ bool failed = false;
+ try
+ {
+ pieLineColor = (Color)colorConverter.ConvertFromString(
+ (point.IsCustomPropertySet(CustomPropertyName.PieLineColor)) ? point[CustomPropertyName.PieLineColor] : dataSeries[typeSeries[0]][CustomPropertyName.PieLineColor]);
+ failed = false;
+ }
+ catch (ArgumentException)
+ {
+ failed = true;
+ }
+ catch (NotSupportedException)
+ {
+ failed = true;
+ }
+
+ if (failed)
+ {
+ pieLineColor = (Color)colorConverter.ConvertFromInvariantString(
+ (point.IsCustomPropertySet(CustomPropertyName.PieLineColor)) ? point[CustomPropertyName.PieLineColor] : dataSeries[typeSeries[0]][CustomPropertyName.PieLineColor]);
+ }
+ }
+
+ // Find Direction to move exploded pie slice
+ if( exploded )
+ {
+ _sliceExploded = true;
+ midAngle = ( 2 * startAngle + sweepAngle ) / 2;
+ double xComponent = Math.Cos( midAngle * Math.PI / 180 ) * rectangle.Width / 10;
+ double yComponent = Math.Sin( midAngle * Math.PI / 180 ) * rectangle.Height / 10;
+
+ rectangle.Offset( (float)xComponent, (float)yComponent );
+ }
+
+ // Hot regions of the data points. Labels hot regions are processed aftre drawing.
+ if( common.ProcessModeRegions && labels == LabelsMode.Draw )
+ {
+ Map( common, point, startAngle, sweepAngle, rectangle, Doughnut, doughnutRadius, graph, pointIndx );
+ }
+
+ // Painting mode
+ if( common.ProcessModePaint )
+ {
+ // Draw Shadow
+ if( shadow )
+ {
+ double offset = graph.GetRelativeSize( new SizeF( point.series.ShadowOffset, point.series.ShadowOffset ) ).Width;
+
+ // Offset is zero. Do not draw shadow pie slice.
+ if( offset == 0.0 )
+ {
+ break;
+ }
+
+ // Shadow Rectangle
+ RectangleF shadowRect = new RectangleF( rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height );
+ shadowRect.Offset( (float)offset, (float)offset );
+
+ // Change shadow color
+ Color shcolor = new Color();
+ Color shGradientColor = new Color();
+ Color shBorderColor = new Color();
+
+ // Solid color
+ if( point.Color.A != 255 )
+ shcolor = Color.FromArgb( point.Color.A/2, point.series.ShadowColor );
+ else
+ shcolor = point.series.ShadowColor;
+
+ // Gradient Color
+ if( !point.BackSecondaryColor.IsEmpty )
+ {
+ if( point.BackSecondaryColor.A != 255 )
+ shGradientColor = Color.FromArgb( point.BackSecondaryColor.A/2, point.series.ShadowColor );
+ else
+ shGradientColor = point.series.ShadowColor;
+ }
+ else
+ shGradientColor = Color.Empty;
+
+ // Border color
+ if( !point.BorderColor.IsEmpty )
+ {
+ if( point.BorderColor.A != 255 )
+ shBorderColor = Color.FromArgb( point.BorderColor.A/2, point.series.ShadowColor );
+ else
+ shBorderColor = point.series.ShadowColor;
+ }
+ else
+ shBorderColor = Color.Empty;
+
+ // Draw shadow of pie slice
+ graph.DrawPieRel(
+ shadowRect,
+ startAngle,
+ sweepAngle,
+ shcolor,
+ ChartHatchStyle.None,
+ "",
+ point.BackImageWrapMode,
+ point.BackImageTransparentColor,
+ point.BackGradientStyle,
+ shGradientColor,
+ shBorderColor,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ true,
+ Doughnut,
+ doughnutRadius,
+ PieDrawingStyle.Default);
+ }
+ else
+ {
+ if( labels == LabelsMode.Off )
+ {
+ // Start Svg Selection mode
+ graph.StartHotRegion( point );
+
+ // Draw pie slice
+ graph.DrawPieRel(
+ rectangle,
+ startAngle,
+ sweepAngle,
+ point.Color,
+ point.BackHatchStyle,
+ point.BackImage,
+ point.BackImageWrapMode,
+ point.BackImageTransparentColor,
+ point.BackGradientStyle,
+ point.BackSecondaryColor,
+ point.BorderColor,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ false,
+ Doughnut,
+ doughnutRadius,
+ ChartGraphics.GetPieDrawingStyle(point) );
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+ }
+ }
+
+ // Estimate labels
+ if( labels == LabelsMode.EstimateSize )
+ {
+ EstimateLabels( graph, middlePoint, rectangle.Size, startAngle, sweepAngle, point, exploded, area );
+ if( _labelsFit == false )
+ {
+ return;
+ }
+ }
+
+ // Labels overlap test
+ if( labels == LabelsMode.LabelsOverlap )
+ {
+ DrawLabels( graph, middlePoint, rectangle.Size, startAngle, sweepAngle, point, doughnutRadius, exploded, area, true, nonEmptyPointIndex, pieLineColor );
+ }
+
+ // Draw labels and markers
+ if( labels == LabelsMode.Draw )
+ {
+ DrawLabels( graph, middlePoint, rectangle.Size, startAngle, sweepAngle, point, doughnutRadius, exploded, area, false, nonEmptyPointIndex, pieLineColor );
+ }
+
+ }
+
+ if( common.ProcessModeRegions && labels == LabelsMode.Draw )
+ {
+ // Add labels hot regions if it was not done during the painting
+ if( !common.ProcessModePaint )
+ {
+ DrawLabels( graph, middlePoint, rectangle.Size, startAngle, sweepAngle, point, doughnutRadius, exploded, area, false, nonEmptyPointIndex, pieLineColor );
+ }
+ }
+
+
+ //**************************************************
+ //** Remember point relative position
+ //**************************************************
+ point.positionRel = new PointF(float.NaN, float.NaN);
+
+
+ // If exploded the shift is bigger
+ float expShift = 1;
+ if( exploded )
+ expShift = 1.2F;
+
+ midAngle = startAngle + sweepAngle / 2;
+
+ // Find first line position
+ point.positionRel.X = (float)Math.Cos( (midAngle) * Math.PI / 180 ) * rectangle.Width * expShift / 2 + middlePoint.X;
+ point.positionRel.Y = (float)Math.Sin( (midAngle) * Math.PI / 180 ) * rectangle.Height * expShift / 2 + middlePoint.Y;
+
+ // Increase point index and sweep angle
+ pointIndx++;
+ nonEmptyPointIndex++;
+ startAngle += sweepAngle;
+ if(startAngle >= 360)
+ {
+ startAngle -= 360;
+ }
+ }
+
+ if( labels == LabelsMode.LabelsOverlap && this._labelsOverlap )
+ {
+ this._labelsOverlap = PrepareLabels( area.Position.ToRectangleF() );
+ }
+
+ // Call Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPostPaint(new ChartPaintEventArgs(dataSeries[typeSeries[0]], graph, common, area.PlotAreaPosition));
+ }
+ }
+
+ /// <summary>
+ /// Draw Pie labels or test for overlaping.
+ /// </summary>
+ /// <param name="graph">Chart Graphics object</param>
+ /// <param name="middlePoint">Center of the pie chart</param>
+ /// <param name="relativeSize">Size of the square, which will be used for drawing pie.</param>
+ /// <param name="startAngle">Starting angle of a pie slice</param>
+ /// <param name="sweepAngle">Sweep angle of a pie slice</param>
+ /// <param name="point">Data point</param>
+ /// <param name="doughnutRadius">Radius for Doughnut Chart in %</param>
+ /// <param name="exploded">The pie slice is exploded</param>
+ /// <param name="area">Chart area</param>
+ /// <param name="overlapTest">True if test mode is on</param>
+ /// <param name="pointIndex">Data Point Index</param>
+ /// <param name="pieLineColor">Color of line labels</param>
+ public void DrawLabels( ChartGraphics graph, PointF middlePoint, SizeF relativeSize, float startAngle, float sweepAngle, DataPoint point, float doughnutRadius, bool exploded, ChartArea area, bool overlapTest, int pointIndex, Color pieLineColor )
+ {
+ bool added = false; // Indicates that label position was added
+ float x; // Label Position
+ float y; // Label Position
+ Series series; // Data Series
+ float labelsHorizontalLineSize = 1; // Horizontal line size for outside labels
+ float labelsRadialLineSize = 1; // Radial line size for outside labels
+ string text;
+
+ // Disable the clip region
+ Region oldClipRegion = graph.Clip;
+ graph.Clip = new Region();
+
+ // Get label text
+ text = this.GetLabelText( point );
+ if(text.Length == 0)
+ {
+ return;
+ }
+
+ float shift;
+
+ series = point.series;
+
+ PieLabelStyle style = PieLabelStyle.Inside;
+
+ // Get label style attribute from series
+ if(series.IsCustomPropertySet(CustomPropertyName.LabelStyle))
+ {
+ string labelStyleAttrib = series[CustomPropertyName.LabelStyle];
+
+ // Labels Disabled
+ if( String.Compare(labelStyleAttrib,"disabled",StringComparison.OrdinalIgnoreCase) == 0 )
+ style = PieLabelStyle.Disabled;
+ else if (String.Compare(labelStyleAttrib, "outside", StringComparison.OrdinalIgnoreCase) == 0)
+ style = PieLabelStyle.Outside;
+ else
+ style = PieLabelStyle.Inside;
+ }
+ else if(series.IsCustomPropertySet(CustomPropertyName.PieLabelStyle))
+ {
+ string labelStyleAttrib = series[CustomPropertyName.PieLabelStyle];
+
+ // Labels Disabled
+ if (String.Compare(labelStyleAttrib, "disabled", StringComparison.OrdinalIgnoreCase) == 0)
+ style = PieLabelStyle.Disabled;
+ else if (String.Compare(labelStyleAttrib, "outside", StringComparison.OrdinalIgnoreCase) == 0)
+ style = PieLabelStyle.Outside;
+ else
+ style = PieLabelStyle.Inside;
+ }
+
+ // Get label style attribute from point
+ if(point.IsCustomPropertySet(CustomPropertyName.LabelStyle))
+ {
+ string labelStyleAttrib = point[CustomPropertyName.LabelStyle];
+
+ // Labels Disabled
+ if (String.Compare(labelStyleAttrib, "disabled", StringComparison.OrdinalIgnoreCase) == 0)
+ style = PieLabelStyle.Disabled;
+ else if (String.Compare(labelStyleAttrib, "outside", StringComparison.OrdinalIgnoreCase) == 0)
+ style = PieLabelStyle.Outside;
+ else
+ style = PieLabelStyle.Inside;
+ }
+ // Get label style attribute from point
+ else if(point.IsCustomPropertySet(CustomPropertyName.PieLabelStyle))
+ {
+ string labelStyleAttrib = point[CustomPropertyName.PieLabelStyle];
+
+ // Labels Disabled
+ if (String.Compare(labelStyleAttrib, "disabled", StringComparison.OrdinalIgnoreCase) == 0)
+ style = PieLabelStyle.Disabled;
+ else if (String.Compare(labelStyleAttrib, "outside", StringComparison.OrdinalIgnoreCase) == 0)
+ style = PieLabelStyle.Outside;
+ else
+ style = PieLabelStyle.Inside;
+ }
+
+
+ // Take labels radial line size attribute from series
+ if(series.IsCustomPropertySet(CustomPropertyName.LabelsRadialLineSize))
+ {
+ string labelsRadialLineSizeAttrib = series[CustomPropertyName.LabelsRadialLineSize];
+ labelsRadialLineSize = CommonElements.ParseFloat( labelsRadialLineSizeAttrib);
+
+ // Validation
+ if( labelsRadialLineSize < 0 || labelsRadialLineSize > 100 )
+ throw new InvalidOperationException(SR.ExceptionPieRadialLineSizeInvalid);
+ }
+
+ // Take labels radial line size attribute from point
+ if(point.IsCustomPropertySet(CustomPropertyName.LabelsRadialLineSize))
+ {
+ string labelsRadialLineSizeAttrib = point[CustomPropertyName.LabelsRadialLineSize];
+ labelsRadialLineSize = CommonElements.ParseFloat( labelsRadialLineSizeAttrib);
+
+ // Validation
+ if( labelsRadialLineSize < 0 || labelsRadialLineSize > 100 )
+ throw new InvalidOperationException(SR.ExceptionPieRadialLineSizeInvalid);
+ }
+
+ // Take labels horizontal line size attribute from series
+ if(series.IsCustomPropertySet(CustomPropertyName.LabelsHorizontalLineSize))
+ {
+ string labelsHorizontalLineSizeAttrib = series[CustomPropertyName.LabelsHorizontalLineSize];
+ labelsHorizontalLineSize = CommonElements.ParseFloat( labelsHorizontalLineSizeAttrib);
+
+ // Validation
+ if( labelsHorizontalLineSize < 0 || labelsHorizontalLineSize > 100 )
+ throw new InvalidOperationException(SR.ExceptionPieHorizontalLineSizeInvalid);
+ }
+
+ // Take labels horizontal line size attribute from point
+ if(point.IsCustomPropertySet(CustomPropertyName.LabelsHorizontalLineSize))
+ {
+ string labelsHorizontalLineSizeAttrib = point[CustomPropertyName.LabelsHorizontalLineSize];
+ labelsHorizontalLineSize = CommonElements.ParseFloat( labelsHorizontalLineSizeAttrib);
+
+ // Validation
+ if( labelsHorizontalLineSize < 0 || labelsHorizontalLineSize > 100 )
+ throw new InvalidOperationException(SR.ExceptionPieHorizontalLineSizeInvalid);
+ }
+
+ float expShift = 1;
+
+ // ********************************************
+ // Labels are set inside pie
+ // ********************************************
+ if( style == PieLabelStyle.Inside && !overlapTest )
+ {
+ float width;
+ float height;
+
+ // If exploded the shift is bigger
+ if( exploded )
+ {
+ expShift = 1.4F;
+ }
+
+ // Get offset of the inside labels position
+ // NOTE: This custom attribute is NOT released!
+ float positionRatio = 4.0f;
+ if(point.IsCustomPropertySet("InsideLabelOffset"))
+ {
+ bool parseSucceed = float.TryParse(point["InsideLabelOffset"], NumberStyles.Any, CultureInfo.InvariantCulture, out positionRatio);
+ if(!parseSucceed || positionRatio < 0f || positionRatio > 100f)
+ {
+ throw(new InvalidOperationException(SR.ExceptionCustomAttributeIsNotInRange0to100("InsideLabelOffset")));
+ }
+ positionRatio = 4f / (1f + positionRatio / 100f);
+ }
+
+
+ // Shift the string for Doughnut type
+ if( Doughnut )
+ {
+ width = relativeSize.Width * expShift / positionRatio * ( 1 + ( 100 - doughnutRadius ) / 100F );
+ height = relativeSize.Height * expShift / positionRatio * ( 1 + ( 100 - doughnutRadius ) / 100F );
+ }
+ else
+ {
+ width = relativeSize.Width * expShift / positionRatio;
+ height = relativeSize.Height * expShift / positionRatio;
+ }
+
+ // Find string position
+ x = (float)Math.Cos( (startAngle + sweepAngle / 2) * Math.PI / 180 ) * width + middlePoint.X;
+ y = (float)Math.Sin( (startAngle + sweepAngle / 2) * Math.PI / 180 ) * height + middlePoint.Y;
+
+ // Center the string horizontally and vertically.
+ using (StringFormat format = new StringFormat())
+ {
+ format.Alignment = StringAlignment.Center;
+ format.LineAlignment = StringAlignment.Center;
+
+ SizeF sizeFont = graph.GetRelativeSize(
+ graph.MeasureString(
+ text.Replace("\\n", "\n"),
+ point.Font,
+ new SizeF(1000f, 1000f),
+ StringFormat.GenericTypographic));
+
+ // Get label background position
+ RectangleF labelBackPosition = RectangleF.Empty;
+ SizeF sizeLabel = new SizeF(sizeFont.Width, sizeFont.Height);
+ sizeLabel.Height += sizeLabel.Height / 8;
+ sizeLabel.Width += sizeLabel.Width / text.Length;
+ labelBackPosition = PointChart.GetLabelPosition(
+ graph,
+ new PointF(x, y),
+ sizeLabel,
+ format,
+ true);
+
+ // Draw the label inside the pie
+ using (Brush brush = new SolidBrush(point.LabelForeColor))
+ {
+ graph.DrawPointLabelStringRel(
+ area.Common,
+ text,
+ point.Font,
+ brush,
+ new PointF(x, y),
+ format,
+ point.LabelAngle,
+ labelBackPosition,
+ point.LabelBackColor,
+ point.LabelBorderColor,
+ point.LabelBorderWidth,
+ point.LabelBorderDashStyle,
+ series,
+ point,
+ pointIndex);
+ }
+ }
+ }
+
+ // ********************************************
+ // Labels are set outside pie
+ // ********************************************
+ else if( style == PieLabelStyle.Outside )
+ {
+
+ // Coefficient which represent shift from pie border
+ shift = 0.5F + labelsRadialLineSize * 0.1F;
+
+ // If exploded the shift is bigger
+ if( exploded )
+ expShift = 1.2F;
+
+ float midAngle = startAngle + sweepAngle / 2;
+
+ // Find first line position
+ float x1 = (float)Math.Cos( (midAngle) * Math.PI / 180 ) * relativeSize.Width * expShift / 2 + middlePoint.X;
+ float y1 = (float)Math.Sin( (midAngle) * Math.PI / 180 ) * relativeSize.Height * expShift / 2 + middlePoint.Y;
+
+ float x2 = (float)Math.Cos( (midAngle) * Math.PI / 180 ) * relativeSize.Width * shift * expShift + middlePoint.X;
+ float y2 = (float)Math.Sin( (midAngle) * Math.PI / 180 ) * relativeSize.Height * shift * expShift + middlePoint.Y;
+
+ if( pieLineColor == Color.Empty )
+ {
+ pieLineColor = point.BorderColor;
+ }
+
+ // Draw first line
+ if( !overlapTest )
+ {
+ graph.DrawLineRel( pieLineColor, point.BorderWidth, ChartDashStyle.Solid, new PointF( x1, y1 ), new PointF( x2, y2 ) );
+ }
+
+ // Set string alingment
+ using (StringFormat format = new StringFormat())
+ {
+ format.Alignment = StringAlignment.Center;
+ format.LineAlignment = StringAlignment.Center;
+
+ // Find second line position
+ float y3 = (float)Math.Sin((midAngle) * Math.PI / 180) * relativeSize.Height * shift * expShift + middlePoint.Y;
+ float x3;
+ float x3Overlap;
+
+ RectangleF labelRect = RectangleF.Empty;
+ RectangleF labelRectOver = RectangleF.Empty;
+
+ if (midAngle > 90 && midAngle < 270)
+ {
+ format.Alignment = StringAlignment.Far;
+ x3Overlap = -relativeSize.Width * shift * expShift + middlePoint.X - relativeSize.Width / 10 * labelsHorizontalLineSize;
+ x3 = (float)Math.Cos((midAngle) * Math.PI / 180) * relativeSize.Width * shift * expShift + middlePoint.X - relativeSize.Width / 10 * labelsHorizontalLineSize;
+
+ if (overlapTest)
+ {
+ x3Overlap = x3;
+ }
+
+ // This method returns calculated rectangle from point position
+ // for outside label. Rectangle mustn’t be out of chart area.
+ labelRect = GetLabelRect(new PointF(x3, y3), area, text, format, graph, point, true);
+ labelRectOver = GetLabelRect(new PointF(x3Overlap, y3), area, text, format, graph, point, true);
+ }
+ else
+ {
+ format.Alignment = StringAlignment.Near;
+
+ x3Overlap = relativeSize.Width * shift * expShift + middlePoint.X + relativeSize.Width / 10 * labelsHorizontalLineSize;
+ x3 = (float)Math.Cos((midAngle) * Math.PI / 180) * relativeSize.Width * shift * expShift + middlePoint.X + relativeSize.Width / 10 * labelsHorizontalLineSize;
+
+ if (overlapTest)
+ {
+ x3Overlap = x3;
+ }
+
+ // This method returns calculated rectangle from point position
+ // for outside label. Rectangle mustn’t be out of chart area.
+ labelRect = GetLabelRect(new PointF(x3, y3), area, text, format, graph, point, false);
+ labelRectOver = GetLabelRect(new PointF(x3Overlap, y3), area, text, format, graph, point, false);
+ }
+
+ // Draw second line
+ if (!overlapTest)
+ {
+ if (this._labelsOverlap)
+ {
+ float calculatedY3 = (((RectangleF)this._labelsRectangles[pointIndex]).Top + ((RectangleF)this._labelsRectangles[pointIndex]).Bottom) / 2f;
+ graph.DrawLineRel(pieLineColor, point.BorderWidth, ChartDashStyle.Solid, new PointF(x2, y2), new PointF(x3Overlap, calculatedY3));
+ }
+ else
+ {
+ graph.DrawLineRel(pieLineColor, point.BorderWidth, ChartDashStyle.Solid, new PointF(x2, y2), new PointF(x3, y3));
+ }
+ }
+
+ // Draw the string
+ if (!overlapTest)
+ {
+ RectangleF rect = new RectangleF(labelRect.Location, labelRect.Size);
+ if (this._labelsOverlap)
+ {
+ // Draw label from collection if original labels overlap.
+ rect = (RectangleF)this._labelsRectangles[pointIndex];
+ rect.X = labelRectOver.X;
+ rect.Width = labelRectOver.Width;
+ }
+
+ // Get label background position
+ SizeF valueTextSize = graph.MeasureStringRel(text.Replace("\\n", "\n"), point.Font);
+ valueTextSize.Height += valueTextSize.Height / 8;
+ float spacing = valueTextSize.Width / text.Length / 2;
+ valueTextSize.Width += spacing;
+ RectangleF labelBackPosition = new RectangleF(
+ rect.X,
+ rect.Y + rect.Height / 2f - valueTextSize.Height / 2f,
+ valueTextSize.Width,
+ valueTextSize.Height);
+
+ // Adjust position based on alignment
+ if (format.Alignment == StringAlignment.Near)
+ {
+ labelBackPosition.X -= spacing / 2f;
+ }
+ else if (format.Alignment == StringAlignment.Center)
+ {
+ labelBackPosition.X = rect.X + (rect.Width - valueTextSize.Width) / 2f;
+ }
+ else if (format.Alignment == StringAlignment.Far)
+ {
+ labelBackPosition.X = rect.Right - valueTextSize.Width - spacing / 2f;
+ }
+
+ // Draw label text outside
+ using (Brush brush = new SolidBrush(point.LabelForeColor))
+ {
+ graph.DrawPointLabelStringRel(
+ area.Common,
+ text,
+ point.Font,
+ brush,
+ rect,
+ format,
+ point.LabelAngle,
+ labelBackPosition,
+ point.LabelBackColor,
+ point.LabelBorderColor,
+ point.LabelBorderWidth,
+ point.LabelBorderDashStyle,
+ series,
+ point,
+ pointIndex);
+ }
+ }
+ else
+ {
+ // Insert labels in label collection. This
+ // code is executed only if labels overlap.
+ this.InsertOverlapLabel(labelRectOver);
+ added = true;
+ }
+ }
+ }
+ // Restore old clip region
+ graph.Clip = oldClipRegion;
+
+
+ // Add empty overlap empty position
+ if(!added)
+ {
+ InsertOverlapLabel( RectangleF.Empty );
+ }
+
+ return;
+
+ }
+
+
+ /// <summary>
+ /// This method returns calculated rectangle from point position
+ /// for outside label. Rectangle mustn’t be out of chart area.
+ /// </summary>
+ /// <param name="labelPosition">The first position for label</param>
+ /// <param name="area">Chart area used for chart area position</param>
+ /// <param name="text">Label text</param>
+ /// <param name="format">Text format</param>
+ /// <param name="graph">Chart Graphics object</param>
+ /// <param name="point">Data point</param>
+ /// <param name="leftOrientation">Orientation for label. It could be left or right.</param>
+ /// <returns>Calculated rectangle for label</returns>
+ private RectangleF GetLabelRect( PointF labelPosition, ChartArea area, string text, StringFormat format, ChartGraphics graph, DataPoint point, bool leftOrientation )
+ {
+ RectangleF labelRect = RectangleF.Empty;
+ if( leftOrientation )
+ {
+ labelRect.X = area.Position.X;
+ labelRect.Y = area.Position.Y;
+ labelRect.Width = labelPosition.X - area.Position.X;
+ labelRect.Height = area.Position.Height;
+ }
+ else
+ {
+ labelRect.X = labelPosition.X;
+ labelRect.Y = area.Position.Y;
+ labelRect.Width = area.Position.Right - labelPosition.X;
+ labelRect.Height = area.Position.Height;
+ }
+
+ // Find bounding rectangle of the text
+ SizeF size = graph.MeasureStringRel( text.Replace("\\n", "\n"), point.Font, labelRect.Size, format );
+ labelRect.Y = labelPosition.Y - size.Height / 2 * 1.8f;
+ labelRect.Height = size.Height * 1.8f;
+
+ return labelRect;
+ }
+
+
+
+ /// <summary>
+ /// This method returns Pie Label Style enumeration
+ /// from Data Point Custom attribute.
+ /// </summary>
+ /// <param name="point">Data Point</param>
+ /// <returns>Pie label style enumeration</returns>
+ private PieLabelStyle GetLabelStyle( DataPoint point )
+ {
+ Series series = point.series;
+
+ PieLabelStyle style = PieLabelStyle.Inside;
+
+ // Get label style attribute from series
+ if(series.IsCustomPropertySet(CustomPropertyName.LabelStyle))
+ {
+ string labelStyleAttrib = series[CustomPropertyName.LabelStyle];
+
+ // Labels Disabled
+ if (String.Compare(labelStyleAttrib, "disabled", StringComparison.OrdinalIgnoreCase) == 0)
+ style = PieLabelStyle.Disabled;
+ else if (String.Compare(labelStyleAttrib, "outside", StringComparison.OrdinalIgnoreCase) == 0)
+ style = PieLabelStyle.Outside;
+ else
+ style = PieLabelStyle.Inside;
+ }
+ else if(series.IsCustomPropertySet(CustomPropertyName.PieLabelStyle))
+ {
+ string labelStyleAttrib = series[CustomPropertyName.PieLabelStyle];
+
+ // Labels Disabled
+ if (String.Compare(labelStyleAttrib, "disabled", StringComparison.OrdinalIgnoreCase) == 0)
+ style = PieLabelStyle.Disabled;
+ else if (String.Compare(labelStyleAttrib, "outside", StringComparison.OrdinalIgnoreCase) == 0)
+ style = PieLabelStyle.Outside;
+ else
+ style = PieLabelStyle.Inside;
+ }
+
+ // Get label style attribute from point
+ if(point.IsCustomPropertySet(CustomPropertyName.LabelStyle))
+ {
+ string labelStyleAttrib = point[CustomPropertyName.LabelStyle];
+
+ // Labels Disabled
+ if (String.Compare(labelStyleAttrib, "disabled", StringComparison.OrdinalIgnoreCase) == 0)
+ style = PieLabelStyle.Disabled;
+ else if (String.Compare(labelStyleAttrib, "outside", StringComparison.OrdinalIgnoreCase) == 0)
+ style = PieLabelStyle.Outside;
+ else
+ style = PieLabelStyle.Inside;
+ }
+ else if(point.IsCustomPropertySet(CustomPropertyName.PieLabelStyle))
+ {
+ string labelStyleAttrib = point[CustomPropertyName.PieLabelStyle];
+
+ // Labels Disabled
+ if (String.Compare(labelStyleAttrib, "disabled", StringComparison.OrdinalIgnoreCase) == 0)
+ style = PieLabelStyle.Disabled;
+ else if (String.Compare(labelStyleAttrib, "outside", StringComparison.OrdinalIgnoreCase) == 0)
+ style = PieLabelStyle.Outside;
+ else
+ style = PieLabelStyle.Inside;
+ }
+
+ return style;
+ }
+
+ /// <summary>
+ /// Estimate Labels.
+ /// </summary>
+ /// <param name="graph">Chart Graphics object</param>
+ /// <param name="middlePoint">Center of the pie chart</param>
+ /// <param name="relativeSize">Size of the square, which will be used for drawing pie.</param>
+ /// <param name="startAngle">Starting angle of a pie slice</param>
+ /// <param name="sweepAngle">Sweep angle of a pie slice</param>
+ /// <param name="point">Data point</param>
+ /// <param name="exploded">The pie slice is exploded</param>
+ /// <param name="area">Chart area</param>
+ public bool EstimateLabels( ChartGraphics graph, PointF middlePoint, SizeF relativeSize, float startAngle, float sweepAngle, DataPoint point, bool exploded, ChartArea area )
+ {
+ float labelsHorizontalLineSize = 1; // Horizontal line size for outside labels
+ float labelsRadialLineSize = 1; // Radial line size for outside labels
+ float shift;
+
+ string pointLabel = this.GetPointLabel(point);
+
+ Series series = point.series;
+
+ PieLabelStyle style = PieLabelStyle.Inside;
+
+ // Get label style attribute from series
+ if(series.IsCustomPropertySet(CustomPropertyName.LabelStyle))
+ {
+ string labelStyleAttrib = series[CustomPropertyName.LabelStyle];
+
+ // Labels Disabled
+ if( String.Compare(labelStyleAttrib,"disabled", StringComparison.OrdinalIgnoreCase) == 0 )
+ style = PieLabelStyle.Disabled;
+ else if (String.Compare(labelStyleAttrib, "outside", StringComparison.OrdinalIgnoreCase) == 0)
+ style = PieLabelStyle.Outside;
+ else
+ style = PieLabelStyle.Inside;
+ }
+ else if(series.IsCustomPropertySet(CustomPropertyName.PieLabelStyle))
+ {
+ string labelStyleAttrib = series[CustomPropertyName.PieLabelStyle];
+
+ // Labels Disabled
+ if (String.Compare(labelStyleAttrib, "disabled", StringComparison.OrdinalIgnoreCase) == 0)
+ style = PieLabelStyle.Disabled;
+ else if (String.Compare(labelStyleAttrib, "outside", StringComparison.OrdinalIgnoreCase) == 0)
+ style = PieLabelStyle.Outside;
+ else
+ style = PieLabelStyle.Inside;
+ }
+
+ // Get label style attribute from point
+ if(point.IsCustomPropertySet(CustomPropertyName.LabelStyle))
+ {
+ string labelStyleAttrib = point[CustomPropertyName.LabelStyle];
+
+ // Labels Disabled
+ if (String.Compare(labelStyleAttrib, "disabled", StringComparison.OrdinalIgnoreCase) == 0)
+ style = PieLabelStyle.Disabled;
+ else if (String.Compare(labelStyleAttrib, "outside", StringComparison.OrdinalIgnoreCase) == 0)
+ style = PieLabelStyle.Outside;
+ else
+ style = PieLabelStyle.Inside;
+ }
+ else if(point.IsCustomPropertySet(CustomPropertyName.PieLabelStyle))
+ {
+ string labelStyleAttrib = point[CustomPropertyName.PieLabelStyle];
+
+ // Labels Disabled
+ if (String.Compare(labelStyleAttrib, "disabled", StringComparison.OrdinalIgnoreCase) == 0)
+ style = PieLabelStyle.Disabled;
+ else if (String.Compare(labelStyleAttrib, "outside", StringComparison.OrdinalIgnoreCase) == 0)
+ style = PieLabelStyle.Outside;
+ else
+ style = PieLabelStyle.Inside;
+ }
+
+ // Take labels radial line size attribute from series
+ if(series.IsCustomPropertySet(CustomPropertyName.LabelsRadialLineSize))
+ {
+ string labelsRadialLineSizeAttrib = series[CustomPropertyName.LabelsRadialLineSize];
+ labelsRadialLineSize = CommonElements.ParseFloat( labelsRadialLineSizeAttrib );
+
+ // Validation
+ if( labelsRadialLineSize < 0 || labelsRadialLineSize > 100 )
+ throw new InvalidOperationException(SR.ExceptionPieRadialLineSizeInvalid);
+ }
+
+ // Take labels radial line size attribute from point
+ if(point.IsCustomPropertySet(CustomPropertyName.LabelsRadialLineSize))
+ {
+ string labelsRadialLineSizeAttrib = point[CustomPropertyName.LabelsRadialLineSize];
+ labelsRadialLineSize = CommonElements.ParseFloat( labelsRadialLineSizeAttrib );
+
+ // Validation
+ if( labelsRadialLineSize < 0 || labelsRadialLineSize > 100 )
+ throw new InvalidOperationException(SR.ExceptionPieRadialLineSizeInvalid);
+ }
+
+ // Take labels horizontal line size attribute from series
+ if(series.IsCustomPropertySet(CustomPropertyName.LabelsHorizontalLineSize))
+ {
+ string labelsHorizontalLineSizeAttrib = series[CustomPropertyName.LabelsHorizontalLineSize];
+ labelsHorizontalLineSize = CommonElements.ParseFloat( labelsHorizontalLineSizeAttrib );
+
+ // Validation
+ if( labelsHorizontalLineSize < 0 || labelsHorizontalLineSize > 100 )
+ throw new InvalidOperationException(SR.ExceptionPieHorizontalLineSizeInvalid);
+ }
+
+ // Take labels horizontal line size attribute from point
+ if(point.IsCustomPropertySet(CustomPropertyName.LabelsHorizontalLineSize))
+ {
+ string labelsHorizontalLineSizeAttrib = point[CustomPropertyName.LabelsHorizontalLineSize];
+ labelsHorizontalLineSize = CommonElements.ParseFloat( labelsHorizontalLineSizeAttrib );
+
+ // Validation
+ if( labelsHorizontalLineSize < 0 || labelsHorizontalLineSize > 100 )
+ throw new InvalidOperationException(SR.ExceptionPieHorizontalLineSizeInvalid);
+ }
+
+ float expShift = 1;
+
+
+ // ********************************************
+ // Labels are set outside pie
+ // ********************************************
+ if( style == PieLabelStyle.Outside )
+ {
+ // Coefficient which represent shift from pie border
+ shift = 0.5F + labelsRadialLineSize * 0.1F;
+
+ // If exploded the shift is bigger
+ if( exploded )
+ expShift = 1.2F;
+
+ float midAngle = startAngle + sweepAngle / 2;
+
+
+ // Find second line position
+ float y3 = (float)Math.Sin( (midAngle) * Math.PI / 180 ) * relativeSize.Height * shift * expShift + middlePoint.Y;
+ float x3;
+
+ if( midAngle > 90 && midAngle < 270 )
+ {
+ x3 = (float)Math.Cos( (midAngle) * Math.PI / 180 ) * relativeSize.Width * shift * expShift + middlePoint.X - relativeSize.Width / 10 * labelsHorizontalLineSize;
+ }
+ else
+ {
+ x3 = (float)Math.Cos( (midAngle) * Math.PI / 180 ) * relativeSize.Width * shift * expShift + middlePoint.X + relativeSize.Width / 10 * labelsHorizontalLineSize;
+ }
+
+ // Get label text
+ string text;
+ if( pointLabel.Length == 0 && point.IsValueShownAsLabel )
+ {
+ text = ValueConverter.FormatValue(
+ series.Chart,
+ point,
+ point.Tag,
+ point.YValues[0],
+ point.LabelFormat,
+ point.series.YValueType,
+ ChartElementType.DataPoint);
+ }
+ else
+ {
+ text = pointLabel;
+ }
+
+ SizeF size = graph.MeasureStringRel( text.Replace("\\n", "\n"), point.Font);
+
+ _labelsFit = true;
+
+ if(this._labelsOverlap)
+ {
+ if( midAngle > 90 && midAngle < 270 )
+ {
+ float xOverlap = -relativeSize.Width * shift * expShift + middlePoint.X - relativeSize.Width / 10 * labelsHorizontalLineSize;
+ if( (xOverlap - size.Width) < area.Position.X )
+ {
+ _labelsFit = false;
+ }
+ }
+ else
+ {
+ float xOverlap = relativeSize.Width * shift * expShift + middlePoint.X + relativeSize.Width / 10 * labelsHorizontalLineSize;
+ if( (xOverlap + size.Width) > area.Position.Right )
+ {
+ _labelsFit = false;
+ }
+ }
+ }
+ else
+ {
+ if( midAngle > 90 && midAngle < 270 )
+ {
+ if( x3 - size.Width < area.PlotAreaPosition.ToRectangleF().Left )
+ _labelsFit = false;
+ }
+ else
+ {
+ if( x3 + size.Width > area.PlotAreaPosition.ToRectangleF().Right )
+ _labelsFit = false;
+ }
+
+ if( midAngle > 180 && midAngle < 360 )
+ {
+ if( y3 - size.Height/2 < area.PlotAreaPosition.ToRectangleF().Top )
+ _labelsFit = false;
+ }
+ else
+ {
+ if( y3 + size.Height/2 > area.PlotAreaPosition.ToRectangleF().Bottom )
+ _labelsFit = false;
+ }
+ }
+
+ }
+ return true;
+ }
+
+ /// <summary>
+ /// This method adds map area information.
+ /// </summary>
+ /// <param name="common">The Common elements object</param>
+ /// <param name="point">Data Point</param>
+ /// <param name="startAngle">Start Angle</param>
+ /// <param name="sweepAngle">Sweep Angle</param>
+ /// <param name="rectangle">Rectangle of the pie</param>
+ /// <param name="doughnut">True if doughnut</param>
+ /// <param name="doughnutRadius">Doughnut radius in %</param>
+ /// <param name="graph">Chart graphics object</param>
+ /// <param name="pointIndex">Data point index</param>
+ private void Map( CommonElements common, DataPoint point, float startAngle, float sweepAngle, RectangleF rectangle, bool doughnut, float doughnutRadius, ChartGraphics graph, int pointIndex )
+ {
+ // Create a graphics path
+ using (GraphicsPath path = new GraphicsPath())
+ {
+
+ // Create the interior doughnut rectangle
+ RectangleF doughnutRect = RectangleF.Empty;
+
+ doughnutRect.X = rectangle.X + rectangle.Width * (1 - (100 - doughnutRadius) / 100) / 2;
+ doughnutRect.Y = rectangle.Y + rectangle.Height * (1 - (100 - doughnutRadius) / 100) / 2;
+ doughnutRect.Width = rectangle.Width * (100 - doughnutRadius) / 100;
+ doughnutRect.Height = rectangle.Height * (100 - doughnutRadius) / 100;
+
+ // Get absolute coordinates of the pie rectangle
+ rectangle = graph.GetAbsoluteRectangle(rectangle);
+
+ // Add the pie to the graphics path
+ path.AddPie(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, startAngle, sweepAngle);
+ // VSTS #250394 (Dev10:591140) Fix - Control should not return “useless” map areas
+ if (sweepAngle <= 0)
+ {
+ return;
+ }
+ // If the chart type is doughnut
+ if (doughnut)
+ {
+
+ // Get absolute coordinates of the interior doughnut rectangle
+ doughnutRect = graph.GetAbsoluteRectangle(doughnutRect);
+
+ // Add the interior doughnut region to the graphics path
+ path.AddPie(doughnutRect.X, doughnutRect.Y, doughnutRect.Width, doughnutRect.Width, startAngle, sweepAngle);
+ }
+
+ // Make a polygon from curves
+ path.Flatten(new Matrix(), 1f);
+
+ // Create an area of points and convert them to
+ // relative coordinates.
+ PointF[] pointNew = new PointF[path.PointCount];
+ for (int i = 0; i < path.PointCount; i++)
+ {
+ pointNew[i] = graph.GetRelativePoint(path.PathPoints[i]);
+ }
+
+ // Allocate array of floats
+ float[] coord = new float[path.PointCount * 2];
+
+ // Transfer path points
+ for (int index = 0; index < path.PointCount; index++)
+ {
+ coord[2 * index] = pointNew[index].X;
+ coord[2 * index + 1] = pointNew[index].Y;
+ }
+
+
+
+ // Check if processing collected data point
+ if (point.IsCustomPropertySet("_COLLECTED_DATA_POINT"))
+ {
+ // Add point to the map area
+ common.HotRegionsList.AddHotRegion(
+ graph,
+ path,
+ false,
+ point.ReplaceKeywords(point.ToolTip),
+#if Microsoft_CONTROL
+ string.Empty,
+ string.Empty,
+ string.Empty,
+#else // Microsoft_CONTROL
+ point.ReplaceKeywords(point.Url),
+ point.ReplaceKeywords(point.MapAreaAttributes),
+ point.ReplaceKeywords(point.PostBackValue),
+#endif // Microsoft_CONTROL
+ point,
+ ChartElementType.DataPoint);
+
+ return;
+ }
+
+
+
+ // Add points to the map area
+ common.HotRegionsList.AddHotRegion(
+ path,
+ false,
+ coord,
+ point,
+ point.series.Name,
+ pointIndex
+ );
+ }
+ }
+
+ /// <summary>
+ /// This method is introduced to check colors of palette. For
+ /// pie chart the first pie slice and the second pie slice can
+ /// not have same color because they are connected.
+ /// </summary>
+ /// <param name="points">Data points used for pie chart</param>
+ private void CheckPaleteColors( DataPointCollection points )
+ {
+ DataPoint firstPoint, lastPoint;
+
+ firstPoint = points[0];
+ lastPoint = points[ points.Count - 1 ];
+
+ // Change color for last point if same as the first and if it is from pallete.
+ if( firstPoint.tempColorIsSet && lastPoint.tempColorIsSet && firstPoint.Color == lastPoint.Color )
+ {
+ lastPoint.Color = points[ points.Count / 2 ].Color;
+ lastPoint.tempColorIsSet = true;
+ }
+ }
+
+ #endregion
+
+ #region 2DLabels
+
+ /// <summary>
+ /// This method finds vertical position for left and
+ /// right labels on that way that labels do not
+ /// overlap each other.
+ /// </summary>
+ /// <param name="area">Chart area position</param>
+ /// <returns>True if it is possible to find position that labels do not overlap each other.</returns>
+ private bool PrepareLabels( RectangleF area )
+ {
+ // Initialization of local variables
+ float splitPoint = area.X + area.Width / 2f;
+ int numberOfLeft = 0;
+ int numberOfRight = 0;
+
+ // Find the number of left and right labels.
+ foreach( RectangleF rect in this._labelsRectangles )
+ {
+ if( rect.X < splitPoint )
+ {
+ numberOfLeft++;
+ }
+ else
+ {
+ numberOfRight++;
+ }
+ }
+
+ // **********************************************
+ // Find the best position for LEFT labels
+ // **********************************************
+ bool leftResult = true;
+ if(numberOfLeft > 0)
+ {
+ double [] startPoints = new double[numberOfLeft];
+ double [] endPoints = new double[numberOfLeft];
+ int [] positionIndex = new Int32[numberOfLeft];
+
+ // Fill double arrays with Top and Bottom coordinates
+ // from the label rectangle.
+ int splitIndex = 0;
+ for( int index = 0; index < _labelsRectangles.Count; index++ )
+ {
+ RectangleF rect = (RectangleF)_labelsRectangles[index];
+ if( rect.X < splitPoint )
+ {
+ startPoints[ splitIndex ] = rect.Top;
+ endPoints[ splitIndex ] = rect.Bottom;
+ positionIndex[ splitIndex ] = index;
+ splitIndex++;
+ }
+ }
+
+ // Sort label positions
+ this.SortIntervals( startPoints, endPoints, positionIndex );
+
+ // Find no overlapping positions if possible.
+ if( this.ArrangeOverlappingIntervals( startPoints, endPoints, area.Top, area.Bottom ) )
+ {
+ // Fill label rectangle top and bottom coordinates
+ // from double arrays.
+ splitIndex = 0;
+ for( int index = 0; index < _labelsRectangles.Count; index++ )
+ {
+ RectangleF rect = (RectangleF)_labelsRectangles[index];
+ if( rect.X < splitPoint )
+ {
+ rect.Y = (float)startPoints[ splitIndex ];
+ rect.Height = (float)(endPoints[ splitIndex ] - rect.Top);
+ _labelsRectangles[positionIndex[ splitIndex ]] = rect;
+ splitIndex++;
+
+ }
+ }
+ }
+ else
+ {
+ leftResult = false;
+ }
+ }
+
+ // **********************************************
+ // Find the best position for Right labels
+ // **********************************************
+ bool rigthResult = true;
+ if(numberOfRight > 0)
+ {
+ double [] startPoints = new double[numberOfRight];
+ double [] endPoints = new double[numberOfRight];
+ int [] positionIndex = new Int32[numberOfRight];
+
+ // Fill double arrays with Top and Bottom coordinates
+ // from the label rectangle.
+ int splitIndex = 0;
+ for( int index = 0; index < _labelsRectangles.Count; index++ )
+ {
+ RectangleF rect = (RectangleF)_labelsRectangles[index];
+ if( rect.X >= splitPoint )
+ {
+ startPoints[ splitIndex ] = rect.Top;
+ endPoints[ splitIndex ] = rect.Bottom;
+ positionIndex[ splitIndex ] = index;
+ splitIndex++;
+ }
+ }
+
+ // Sort label positions
+ this.SortIntervals( startPoints, endPoints, positionIndex );
+
+ // Find no overlapping positions if possible.
+ if( this.ArrangeOverlappingIntervals( startPoints, endPoints, area.Top, area.Bottom ) )
+ {
+ // Fill label rectangle top and bottom coordinates
+ // from double arrays.
+ splitIndex = 0;
+ for( int index = 0; index < _labelsRectangles.Count; index++ )
+ {
+ RectangleF rect = (RectangleF)_labelsRectangles[index];
+ if( rect.X >= splitPoint )
+ {
+ rect.Y = (float)startPoints[ splitIndex ];
+ rect.Height = (float)(endPoints[ splitIndex ] - rect.Top);
+ _labelsRectangles[positionIndex[ splitIndex ]] = rect;
+ splitIndex++;
+ }
+ }
+ }
+ else
+ {
+ rigthResult = false;
+ }
+ }
+
+ return ( (!leftResult || !rigthResult) ? true : false );
+ }
+
+ /// <summary>
+ /// This algorithm sorts labels vertical intervals.
+ /// </summary>
+ /// <param name="startOfIntervals">Double array of label interval start points</param>
+ /// <param name="endOfIntervals">Double array of label interval end points</param>
+ /// <param name="positinIndex">Integer array of label interval indexes</param>
+ private void SortIntervals( double [] startOfIntervals, double [] endOfIntervals, int [] positinIndex )
+ {
+ double firstCenter;
+ double secondCenter;
+ double midDouble;
+ int midInt;
+
+ // Sorting loops
+ for( int firstIndex = 0; firstIndex < startOfIntervals.Length; firstIndex++ )
+ {
+ for( int secondIndex = firstIndex; secondIndex < startOfIntervals.Length; secondIndex++ )
+ {
+ firstCenter = ( startOfIntervals[ firstIndex ] + endOfIntervals[ firstIndex ] ) / 2.0;
+ secondCenter = ( startOfIntervals[ secondIndex ] + endOfIntervals[ secondIndex ] ) / 2.0;
+
+ if( firstCenter > secondCenter )
+ {
+ // Sort start points
+ midDouble = startOfIntervals[ firstIndex ];
+ startOfIntervals[ firstIndex ] = startOfIntervals[ secondIndex ];
+ startOfIntervals[ secondIndex ] = midDouble;
+
+ // Sort end points
+ midDouble = endOfIntervals[ firstIndex ];
+ endOfIntervals[ firstIndex ] = endOfIntervals[ secondIndex ];
+ endOfIntervals[ secondIndex ] = midDouble;
+
+ // Sort indexes
+ midInt = positinIndex[ firstIndex ];
+ positinIndex[ firstIndex ] = positinIndex[ secondIndex ];
+ positinIndex[ secondIndex ] = midInt;
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// This method inserts label rectangles
+ /// into the collection.
+ /// </summary>
+ /// <param name="labelRect">Label Rectangle</param>
+ private void InsertOverlapLabel( RectangleF labelRect )
+ {
+ // Check if any pair of labels overlap
+ if(!labelRect.IsEmpty)
+ {
+ foreach( RectangleF rect in _labelsRectangles )
+ {
+ if( labelRect.IntersectsWith( rect ) )
+ {
+ this._labelsOverlap = true;
+ }
+ }
+ }
+
+ // Add rectangle to the collection
+ _labelsRectangles.Add( labelRect );
+ }
+
+ /// <summary>
+ /// This method will find the best position for labels.
+ /// It is based on finding non overlap intervals for
+ /// left or right side of the pie. This is
+ /// recursive algorithm.
+ /// </summary>
+ /// <param name="startOfIntervals">The start positions of intervals.</param>
+ /// <param name="endOfIntervals">The end positions of intervals.</param>
+ /// <param name="startArea">Start position of chart area vertical range.</param>
+ /// <param name="endArea">End position of chart area vertical range.</param>
+ /// <returns>False if non overlapping positions for intervals can not be found.</returns>
+ private bool ArrangeOverlappingIntervals( double [] startOfIntervals, double [] endOfIntervals, double startArea, double endArea )
+ {
+
+ // Invalidation
+ if( startOfIntervals.Length != endOfIntervals.Length )
+ {
+ throw new InvalidOperationException(SR.ExceptionPieIntervalsInvalid);
+ }
+
+ ShiftOverlappingIntervals( startOfIntervals, endOfIntervals );
+
+ // Find amount of empty space between intervals.
+ double emptySpace = 0;
+ for( int intervalIndex = 0; intervalIndex < startOfIntervals.Length - 1; intervalIndex++ )
+ {
+ // Check overlapping
+ if( startOfIntervals[ intervalIndex + 1 ] < endOfIntervals[ intervalIndex ] )
+ {
+ //throw new InvalidOperationException( SR.ExceptionPieIntervalsOverlapping );
+ }
+
+ emptySpace += startOfIntervals[ intervalIndex + 1 ] - endOfIntervals[ intervalIndex ];
+ }
+
+ //Find how much intervals are out of area. Out of area could be positive value only.
+ double outOfArea = ( endOfIntervals[ endOfIntervals.Length - 1 ] - endArea ) + ( startArea - startOfIntervals[ 0 ] );
+ if( outOfArea <= 0 )
+ {
+ // This algorithm shifts all intervals for the same
+ // amount. It is trying to put all intervals inside
+ // chart area range.
+ ShiftIntervals( startOfIntervals, endOfIntervals, startArea, endArea );
+ return true;
+ }
+
+ // There is no enough space for all intervals.
+ if( outOfArea > emptySpace )
+ {
+ return false;
+ }
+
+ // This method reduces empty space between intervals.
+ ReduceEmptySpace( startOfIntervals, endOfIntervals, ( emptySpace - outOfArea ) / emptySpace );
+
+ // This algorithm shifts all intervals for the same
+ // amount. It is trying to put all intervals inside
+ // chart area range.
+ ShiftIntervals( startOfIntervals, endOfIntervals, startArea, endArea );
+
+ return true;
+ }
+
+ /// <summary>
+ /// This method reduces empty space between intervals.
+ /// </summary>
+ /// <param name="startOfIntervals">The start positions of intervals.</param>
+ /// <param name="endOfIntervals">The end positions of intervals.</param>
+ /// <param name="reduction">Relative value which presents size reduction.</param>
+ private void ReduceEmptySpace( double [] startOfIntervals, double [] endOfIntervals, double reduction )
+ {
+ for( int intervalIndex = 0; intervalIndex < startOfIntervals.Length - 1; intervalIndex++ )
+ {
+ // Check overlapping
+ if( startOfIntervals[ intervalIndex + 1 ] < endOfIntervals[ intervalIndex ] )
+ {
+ //throw new InvalidOperationException( SR.ExceptionPieIntervalsOverlapping );
+ }
+
+ // Reduce space
+ double shift = ( startOfIntervals[ intervalIndex + 1 ] - endOfIntervals[ intervalIndex ] ) - ( startOfIntervals[ intervalIndex + 1 ] - endOfIntervals[ intervalIndex ] ) * reduction;
+ for( int reductionIndex = intervalIndex + 1; reductionIndex < startOfIntervals.Length; reductionIndex++ )
+ {
+ startOfIntervals[ reductionIndex ] -= shift;
+ endOfIntervals[ reductionIndex ] -= shift;
+ }
+ }
+ }
+
+ /// <summary>
+ /// This algorithm shifts all intervals for the same
+ /// amount. It is trying to put all intervals inside
+ /// chart area range.
+ /// </summary>
+ /// <param name="startOfIntervals">The start positions of intervals.</param>
+ /// <param name="endOfIntervals">The end positions of intervals.</param>
+ /// <param name="startArea">Start position of chart area vertical range.</param>
+ /// <param name="endArea">End position of chart area vertical range.</param>
+ private void ShiftIntervals( double [] startOfIntervals, double [] endOfIntervals, double startArea, double endArea )
+ {
+
+ double shift = 0;
+
+ if( startOfIntervals[ 0 ] < startArea )
+ {
+ shift = startArea - startOfIntervals[ 0 ];
+ }
+ else if( endOfIntervals[ endOfIntervals.Length - 1 ] > endArea )
+ {
+ shift = endArea - endOfIntervals[ endOfIntervals.Length - 1 ];
+ }
+
+ for( int index = 0; index < startOfIntervals.Length; index++ )
+ {
+ startOfIntervals[ index ] += shift;
+ endOfIntervals[ index ] += shift;
+ }
+ }
+
+ /// <summary>
+ /// This is used to find non overlapping position for intervals.
+ /// </summary>
+ /// <param name="startOfIntervals">The start positions of intervals.</param>
+ /// <param name="endOfIntervals">The end positions of intervals.</param>
+ /// <returns>Returns true if any label overlaps before method is used.</returns>
+ private void ShiftOverlappingIntervals( double [] startOfIntervals, double [] endOfIntervals )
+ {
+ // Invalidation
+ if( startOfIntervals.Length != endOfIntervals.Length )
+ {
+ throw new InvalidOperationException(SR.ExceptionPieIntervalsInvalid);
+ }
+
+ // Find first overlaping intervals
+ for( int index = 0; index < startOfIntervals.Length - 1; index++ )
+ {
+ // Intervals overlap
+ if( endOfIntervals[ index ] > startOfIntervals[ index + 1 ] )
+ {
+ double overlapRange = endOfIntervals[ index ] - startOfIntervals[ index + 1 ];
+ SpreadInterval( startOfIntervals, endOfIntervals, index, Math.Floor( overlapRange / 2.0 ) );
+ }
+ }
+ }
+
+ /// <summary>
+ /// This method spread all intervals down or up from
+ /// splitIndex. Intervals are spread only if there is no
+ /// empty space which will compensate shifting of intervals.
+ /// </summary>
+ /// <param name="startOfIntervals">The start positions of intervals.</param>
+ /// <param name="endOfIntervals">The end positions of intervals.</param>
+ /// <param name="splitIndex">Position of the interval which ovelap.</param>
+ /// <param name="overlapShift">The half of the overlapping range.</param>
+ private void SpreadInterval( double [] startOfIntervals, double [] endOfIntervals, int splitIndex, double overlapShift )
+ {
+ // Move first overlapping intervals.
+ endOfIntervals[ splitIndex ] -= overlapShift;
+ startOfIntervals[ splitIndex ] -= overlapShift;
+
+ endOfIntervals[ splitIndex + 1 ] += overlapShift;
+ startOfIntervals[ splitIndex + 1 ] += overlapShift;
+
+ // Move up other intervals if there is no enough empty space
+ // to compensate overlapping intervals.
+ if( splitIndex > 0 )
+ {
+ for( int index = splitIndex - 1; index >= 0; index-- )
+ {
+ if( endOfIntervals[ index ] > startOfIntervals[ index + 1 ] - overlapShift )
+ {
+ endOfIntervals[ index ] -= overlapShift;
+ startOfIntervals[ index ] -= overlapShift;
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+
+ // Move down other intervals if there is no enough empty space
+ // to compensate overlapping intervals.
+ if( splitIndex + 2 < startOfIntervals.Length - 1 )
+ {
+ for( int index = splitIndex + 2; index < startOfIntervals.Length; index++ )
+ {
+ if( startOfIntervals[ index ] > endOfIntervals[ index - 1 ] + overlapShift )
+ {
+ endOfIntervals[ index ] += overlapShift;
+ startOfIntervals[ index ] += overlapShift;
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+ }
+
+ #endregion
+
+ #region Y values related methods
+
+ /// <summary>
+ /// Helper function, which returns the Y value of the point.
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="area">Chart area the series belongs to.</param>
+ /// <param name="series">Sereis of the point.</param>
+ /// <param name="point">Point object.</param>
+ /// <param name="pointIndex">Index of the point.</param>
+ /// <param name="yValueIndex">Index of the Y value to get.</param>
+ /// <returns>Y value of the point.</returns>
+ virtual public double GetYValue(
+ CommonElements common,
+ ChartArea area,
+ Series series,
+ DataPoint point,
+ int pointIndex,
+ int yValueIndex)
+ {
+ return point.YValues[yValueIndex];
+ }
+
+ #endregion
+
+ #region 3D painting and selection methods
+
+ /// <summary>
+ /// This method recalculates position of pie slices
+ /// or checks if pie slice is selected.
+ /// </summary>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active</param>
+ /// <param name="graph">The Chart Graphics object</param>
+ /// <param name="common">The Common elements object</param>
+ /// <param name="area">Chart area for this chart</param>
+ /// <param name="pieWidth">Pie width.</param>
+ private void ProcessChartType3D(
+ bool selection,
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ float pieWidth )
+ {
+ string explodedAttrib = ""; // Exploded attribute
+ bool exploded; // Exploded pie slice
+ float midAngle; // Angle between Start Angle and End Angle
+
+
+ // Data series collection
+ SeriesCollection dataSeries = common.DataManager.Series;
+
+ // All data series from chart area which have Pie chart type
+ List<string> typeSeries = area.GetSeriesFromChartType(Name);
+
+ if( typeSeries.Count == 0 )
+ {
+ return;
+ }
+
+ // Get first pie starting angle
+ if (dataSeries[typeSeries[0]].IsCustomPropertySet(CustomPropertyName.PieStartAngle))
+ {
+ int angle;
+ bool parseSucceed = int.TryParse(dataSeries[typeSeries[0]][CustomPropertyName.PieStartAngle], NumberStyles.Any, CultureInfo.InvariantCulture, out angle);
+
+ if (parseSucceed)
+ {
+ if (angle > 180 && angle <= 360)
+ {
+ angle = -(360 - angle);
+ }
+ area.Area3DStyle.Rotation = angle;
+ }
+
+
+ if (!parseSucceed || area.Area3DStyle.Rotation > 180 || area.Area3DStyle.Rotation < -180)
+ {
+ throw (new InvalidOperationException(SR.ExceptionCustomAttributeAngleOutOfRange("PieStartAngle")));
+ }
+ }
+
+ // Call Back Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPrePaint(new ChartPaintEventArgs(dataSeries[typeSeries[0]], graph, common, area.PlotAreaPosition));
+ }
+
+ // The data points loop. Find Sum of data points.
+ double sum = 0;
+ foreach( DataPoint point in dataSeries[typeSeries[0]].Points )
+ {
+ if( !point.IsEmpty )
+ {
+ sum += Math.Abs(point.YValues[0]);
+ }
+ }
+
+ // Is exploded if only one is exploded
+ bool isExploded = false;
+ foreach( DataPoint point in dataSeries[typeSeries[0]].Points )
+ {
+ if(point.IsCustomPropertySet(CustomPropertyName.Exploded))
+ {
+ explodedAttrib = point[CustomPropertyName.Exploded];
+ if( String.Compare(explodedAttrib,"true",StringComparison.OrdinalIgnoreCase) == 0 )
+ {
+ isExploded = true;
+ }
+ }
+ }
+
+ // Take radius attribute
+ float doughnutRadius = 60f;
+ if(dataSeries[typeSeries[0]].IsCustomPropertySet(CustomPropertyName.DoughnutRadius))
+ {
+ doughnutRadius = CommonElements.ParseFloat(dataSeries[typeSeries[0]][CustomPropertyName.DoughnutRadius] );
+
+ // Validation
+ if( doughnutRadius < 0f || doughnutRadius > 99f )
+ throw (new ArgumentException(SR.ExceptionPieRadiusInvalid));
+
+ }
+
+ // Take 3D Label Line Size attribute
+ float labelLineSize = 100f;
+ if(dataSeries[typeSeries[0]].IsCustomPropertySet(CustomPropertyName._3DLabelLineSize))
+ {
+ labelLineSize = CommonElements.ParseFloat(dataSeries[typeSeries[0]][CustomPropertyName._3DLabelLineSize] );
+
+ // Validation
+ if( labelLineSize < 30f || labelLineSize > 200f )
+ throw (new ArgumentException(SR.ExceptionPie3DLabelLineSizeInvalid));
+
+ }
+ labelLineSize = labelLineSize * 0.1F / 100F;
+
+ //************************************************************
+ //** Data point loop
+ //************************************************************
+ float [] startAngleList;
+ float [] sweepAngleList;
+ int [] pointIndexList;
+
+ // This method is introduced to check colors of palette. For
+ // pie chart the first pie slice and the second pie slice can
+ // not have same color because they are connected.
+ CheckPaleteColors( dataSeries[typeSeries[0]].Points );
+
+ bool sameBackFront;
+ DataPoint [] points = PointOrder( dataSeries[typeSeries[0]], area, out startAngleList, out sweepAngleList, out pointIndexList, out sameBackFront );
+
+ // There are no points or all points are empty.
+ if( points == null )
+ {
+ return;
+ }
+
+ RectangleF plotingRectangle = new RectangleF( area.Position.ToRectangleF().X + 1, area.Position.ToRectangleF().Y + 1, area.Position.ToRectangleF().Width-2, area.Position.ToRectangleF().Height-2 );
+
+ // Check if any data point has outside label
+ bool outside = false;
+ foreach( DataPoint point in points )
+ {
+ if( GetLabelStyle( point ) == PieLabelStyle.Outside )
+ {
+ outside = true;
+ }
+ }
+
+ // If outside labels resize Pie size
+ if( outside )
+ {
+ InitPieSize( graph, area, ref plotingRectangle, ref pieWidth, points, startAngleList, sweepAngleList, dataSeries[typeSeries[0]], labelLineSize );
+ }
+
+ // Initialize Matrix 3D
+ area.matrix3D.Initialize(
+ plotingRectangle,
+ pieWidth,
+ area.Area3DStyle.Inclination,
+ 0F,
+ 0,
+ false);
+
+ //***********************************************************
+ //** Initialize Lighting
+ //***********************************************************
+ area.matrix3D.InitLight(
+ area.Area3DStyle.LightStyle
+ );
+
+ // Turns are introduce because of special case – Big pie slice, which
+ // is bigger, then 180 degree and it is back and
+ // front point in same time. If special case exists drawing has to be split
+ // into 4 parts: 1. Drawing back pie slices, 2. Drawing the first part of
+ // big slice and other points, 3. Drawing second part of big slice and
+ // 4. Drawing top of the pie slices.
+ for( int turn = 0; turn < 5; turn++ )
+ {
+ int pointIndx = 0;
+ foreach( DataPoint point in points )
+ {
+ // Reset point anchor location
+ point.positionRel = PointF.Empty;
+
+ // Do not process empty points
+ if( point.IsEmpty )
+ {
+ pointIndx++;
+ continue;
+ }
+
+ float sweepAngle = sweepAngleList[pointIndx];
+ float startAngle = startAngleList[pointIndx];
+
+ // Rectangle size
+ RectangleF rectangle;
+ if( area.InnerPlotPosition.Auto )
+ rectangle = new RectangleF( plotingRectangle.X, plotingRectangle.Y, plotingRectangle.Width, plotingRectangle.Height );
+ else
+ rectangle = new RectangleF( area.PlotAreaPosition.ToRectangleF().X, area.PlotAreaPosition.ToRectangleF().Y, area.PlotAreaPosition.ToRectangleF().Width, area.PlotAreaPosition.ToRectangleF().Height );
+
+ // Find smallest edge
+ SizeF absoluteSize = graph.GetAbsoluteSize( new SizeF( rectangle.Width, rectangle.Height ) );
+ float absRadius = ( absoluteSize.Width < absoluteSize.Height ) ? absoluteSize.Width : absoluteSize.Height;
+
+ // Size of the square, which will be used for drawing pie.
+ SizeF relativeSize = graph.GetRelativeSize( new SizeF( absRadius, absRadius ) );
+
+ // Center of the pie
+ PointF middlePoint = new PointF( rectangle.X + rectangle.Width / 2, rectangle.Y + rectangle.Height / 2 );
+
+ // Rectangle which will always create circle, never ellipse.
+ rectangle = new RectangleF( middlePoint.X - relativeSize.Width / 2, middlePoint.Y - relativeSize.Height / 2, relativeSize.Width, relativeSize.Height );
+
+ // Check Exploded attribute for data point
+ exploded = false;
+ if(point.IsCustomPropertySet(CustomPropertyName.Exploded))
+ {
+ explodedAttrib = point[CustomPropertyName.Exploded];
+ if( String.Compare(explodedAttrib,"true",StringComparison.OrdinalIgnoreCase) == 0 )
+ exploded = true;
+ else
+ exploded = false;
+ }
+
+ // Size correction because of exploded or labels
+ float sizeCorrection = 1.0F;
+ if( isExploded )
+ {
+ sizeCorrection = 0.82F;
+
+ rectangle.X += rectangle.Width * ( 1 - sizeCorrection ) / 2;
+ rectangle.Y += rectangle.Height * ( 1 - sizeCorrection ) / 2;
+ rectangle.Width = rectangle.Width * sizeCorrection;
+ rectangle.Height = rectangle.Height * sizeCorrection;
+ }
+
+
+ // Find Direction to move exploded pie slice
+ if( exploded )
+ {
+ _sliceExploded = true;
+ midAngle = ( 2 * startAngle + sweepAngle ) / 2;
+ double xComponent = Math.Cos( midAngle * Math.PI / 180 ) * rectangle.Width / 10;
+ double yComponent = Math.Sin( midAngle * Math.PI / 180 ) * rectangle.Height / 10;
+
+ rectangle.Offset( (float)xComponent, (float)yComponent );
+ }
+
+ // Adjust inner plot position
+ if(area.InnerPlotPosition.Auto)
+ {
+ RectangleF rect = rectangle;
+ rect.X = (rect.X - area.Position.X) / area.Position.Width * 100f;
+ rect.Y = (rect.Y - area.Position.Y) / area.Position.Height * 100f;
+ rect.Width = rect.Width / area.Position.Width * 100f;
+ rect.Height = rect.Height / area.Position.Height * 100f;
+ area.InnerPlotPosition.SetPositionNoAuto(rect.X, rect.Y, rect.Width, rect.Height);
+ }
+
+ // Start Svg Selection mode
+ graph.StartHotRegion( point );
+
+ // Drawing or selection of pie clice
+ Draw3DPie( turn, graph, point, area, rectangle, startAngle, sweepAngle, doughnutRadius, pieWidth, sameBackFront, exploded, pointIndexList[pointIndx] );
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+
+ if( turn == 1 )
+ {
+ // Outside labels
+ if( GetLabelStyle( point ) == PieLabelStyle.Outside )
+ {
+ FillPieLabelOutside( graph, area, rectangle, pieWidth, point, startAngle, sweepAngle, pointIndx, doughnutRadius, exploded );
+ }
+ }
+ if( turn == 2 )
+ {
+
+ // Outside labels
+ if( GetLabelStyle( point ) == PieLabelStyle.Outside && pointIndx == 0 )
+ {
+ labelColumnLeft.Sort();
+ labelColumnLeft.AdjustPositions();
+ labelColumnRight.Sort();
+ labelColumnRight.AdjustPositions();
+ }
+
+ }
+
+ // Increae point index
+ pointIndx++;
+ }
+ }
+
+ // Call Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPostPaint(new ChartPaintEventArgs(dataSeries[typeSeries[0]], graph, common, area.PlotAreaPosition));
+ }
+ }
+
+ /// <summary>
+ /// This method draws a part of a pie slice. Which part is drown
+ /// depend on turn. There is special case if there is a big pie
+ /// slice (>180) when one pie slice has to be split on parts
+ /// and between that other small pie slices has to be drawn.
+ /// </summary>
+ /// <param name="turn">Turn for drawing.</param>
+ /// <param name="graph">Chart Graphics</param>
+ /// <param name="point">Data Point to draw</param>
+ /// <param name="area">Chart area</param>
+ /// <param name="rectangle">Rectangle used for drawing pie clice.</param>
+ /// <param name="startAngle">Start angle for pie slice</param>
+ /// <param name="sweepAngle">End angle for pie slice</param>
+ /// <param name="doughnutRadius">Inner Radius if chart is doughnut</param>
+ /// <param name="pieWidth">Width of the pie</param>
+ /// <param name="sameBackFront">Pie slice is >180 and same pie slice is back and front slice</param>
+ /// <param name="exploded">Pie slice is exploded</param>
+ /// <param name="pointIndex">Point Index</param>
+ private void Draw3DPie(
+ int turn,
+ ChartGraphics graph,
+ DataPoint point,
+ ChartArea area,
+ RectangleF rectangle,
+ float startAngle,
+ float sweepAngle,
+ float doughnutRadius,
+ float pieWidth,
+ bool sameBackFront,
+ bool exploded,
+ int pointIndex
+ )
+ {
+ SolidBrush brush = new SolidBrush(point.Color);
+
+ // For lightStyle style Non, Border color always exist.
+ Color penColor = Color.Empty;
+ Color penCurveColor = Color.Empty;
+
+ if( point.BorderColor == Color.Empty && area.Area3DStyle.LightStyle == LightStyle.None )
+ {
+ penColor = ChartGraphics.GetGradientColor( point.Color, Color.Black, 0.5 );
+ }
+ else if( point.BorderColor == Color.Empty )
+ {
+ penColor = point.Color;
+ }
+ else
+ {
+ penColor = point.BorderColor;
+ }
+
+ if( point.BorderColor != Color.Empty || area.Area3DStyle.LightStyle == LightStyle.None )
+ {
+ penCurveColor = penColor;
+ }
+
+ Pen pen = new Pen(penColor, point.BorderWidth);
+ pen.DashStyle = graph.GetPenStyle( point.BorderDashStyle );
+
+ // Pen for back side slice.
+ Pen backSlicePen;
+ if( point.BorderColor == Color.Empty )
+ {
+ backSlicePen = new Pen(point.Color);
+ }
+ else
+ {
+ backSlicePen = pen;
+ }
+
+ Pen penCurve = new Pen(penCurveColor, point.BorderWidth);
+ penCurve.DashStyle = graph.GetPenStyle( point.BorderDashStyle );
+
+ // Set Border Width;
+ PointF [] points = GetPiePoints( graph, area, pieWidth, rectangle, startAngle, sweepAngle, true, doughnutRadius, exploded );
+
+ if( points == null )
+ return;
+
+ // Remember data point anchor location
+ point.positionRel.X = points[(int)PiePoints.TopLabelLine].X;
+ point.positionRel.Y = points[(int)PiePoints.TopLabelLine].Y;
+ point.positionRel = graph.GetRelativePoint(point.positionRel);
+
+
+ float midAngle = startAngle + sweepAngle / 2F;
+ float endAngle = startAngle + sweepAngle;
+
+ if( turn == 0 )
+ {
+ // Draw back pie slice (do not fill).
+ // Used for transparency.
+ if( !this.Doughnut )
+ {
+ graph.FillPieSlice(
+ area,
+ point,
+ brush,
+ backSlicePen,
+ points[(int)PiePoints.BottomRectTopLeftPoint],
+ points[(int)PiePoints.BottomStart],
+ points[(int)PiePoints.BottomRectBottomRightPoint],
+ points[(int)PiePoints.BottomEnd],
+ points[(int)PiePoints.BottomCenter],
+ startAngle,
+ sweepAngle,
+ false,
+ pointIndex
+ );
+ }
+ else
+ {
+ graph.FillDoughnutSlice(
+ area,
+ point,
+ brush,
+ backSlicePen,
+ points[(int)PiePoints.BottomRectTopLeftPoint],
+ points[(int)PiePoints.BottomStart],
+ points[(int)PiePoints.BottomRectBottomRightPoint],
+ points[(int)PiePoints.BottomEnd],
+ points[(int)PiePoints.DoughnutBottomEnd],
+ points[(int)PiePoints.DoughnutBottomStart],
+ startAngle,
+ sweepAngle,
+ false,
+ doughnutRadius,
+ pointIndex
+ );
+ }
+
+ }
+ else if( turn == 1 )
+ {
+ // Case when there is big pie slice ( > 180 ) and big slice is
+ // back and front point in same time.
+ if( sameBackFront )
+ {
+
+
+ // Draw the first part of the curve of the big slice and
+ // all curves from other slices. Big pie slice could be on the
+ // right or the left side.
+ if( midAngle > -90 && midAngle < 90 || midAngle > 270 && midAngle < 450 )
+ {
+ // Draw Inner Arc for Doughnut
+ if( Doughnut )
+ {
+ DrawDoughnutCurves( graph, area, point, startAngle, sweepAngle, points, brush, penCurve, false, true, pointIndex );
+ }
+
+ DrawPieCurves( graph, area, point, startAngle, sweepAngle, points, brush, penCurve, true, true, pointIndex );
+ }
+ else
+ {
+ // Draw Inner Arc for Doughnut
+ if( Doughnut )
+ {
+ DrawDoughnutCurves( graph, area, point, startAngle, sweepAngle, points, brush, penCurve, true, true, pointIndex );
+ }
+
+ DrawPieCurves( graph, area, point, startAngle, sweepAngle, points, brush, penCurve, false, true, pointIndex );
+ }
+
+ // Draw sides of pie slices
+ graph.FillPieSides( area, area.Area3DStyle.Inclination, startAngle, sweepAngle, points, brush, pen, Doughnut );
+
+
+ }
+ else
+ {
+ // Draw Inner Arc for Doughnut
+ if( Doughnut )
+ {
+ DrawDoughnutCurves( graph, area, point, startAngle, sweepAngle, points, brush, penCurve, false, false, pointIndex );
+ }
+
+ // This is regular case. There is no big pie slice
+ // which is back nad front point in same time.
+ graph.FillPieSides( area, area.Area3DStyle.Inclination, startAngle, sweepAngle, points, brush, pen, Doughnut );
+
+ DrawPieCurves( graph, area, point, startAngle, sweepAngle, points, brush, penCurve, false, false, pointIndex );
+ }
+
+ }
+ else if( turn == 2 )
+ {
+ // This second turned is used only for big pie slice (>180). If big pie
+ // slice exist it has to be split if it is necessary. If the big pie slice
+ // cover other pie slice from both sides, the big pie slice have to curves.
+ // The first curve from big pie slice is drawn first, after that all other
+ // pie slices and at the end second curve from big pie slice.
+ if( sameBackFront && sweepAngle > 180 )
+ {
+ // Condition when two draw Doughnut arcs after sides for big pie slice ( > 180 ).
+ bool BackFrontDoughnut = ( startAngle > -180 && startAngle < 0 || startAngle > 180 && startAngle < 360 ) && ( endAngle > -180 && endAngle < 0 || endAngle > 180 && endAngle < 360 );
+
+ if( area.Area3DStyle.Inclination > 0 )
+ BackFrontDoughnut = !BackFrontDoughnut;
+
+ if( midAngle > -90 && midAngle < 90 || midAngle > 270 && midAngle < 450 )
+ {
+ // Draw Inner Arc for Doughnut
+ if( Doughnut )
+ {
+ // Draw second part of doughnut curve only for very big slices > 300 ( Visibility issue for Big point depth ).
+ if( BackFrontDoughnut && sweepAngle > 300 )
+ {
+ DrawDoughnutCurves( graph, area, point, startAngle, sweepAngle, points, brush, penCurve, true, true, pointIndex );
+ }
+ }
+
+ DrawPieCurves( graph, area, point, startAngle, sweepAngle, points, brush, penCurve, false, true, pointIndex );
+ }
+ else
+ {
+ // Draw Inner Arc for Doughnut
+ if( Doughnut )
+ {
+ // Draw second part of doughnut curve only for very big slices > 300( Visibility issue for Big point depth ).
+ if( BackFrontDoughnut && sweepAngle > 300 )
+ {
+ DrawDoughnutCurves( graph, area, point, startAngle, sweepAngle, points, brush, penCurve, false, true, pointIndex );
+ }
+ }
+ DrawPieCurves( graph, area, point, startAngle, sweepAngle, points, brush, penCurve, true, true, pointIndex );
+ }
+ }
+ }
+ else if( turn == 3 )
+ {
+ if( !this.Doughnut )
+ {
+ // Fill pie slice
+ graph.FillPieSlice(
+ area,
+ point,
+ brush,
+ pen,
+ points[(int)PiePoints.TopRectTopLeftPoint],
+ points[(int)PiePoints.TopStart],
+ points[(int)PiePoints.TopRectBottomRightPoint],
+ points[(int)PiePoints.TopEnd],
+ points[(int)PiePoints.TopCenter],
+ startAngle,
+ sweepAngle,
+ true,
+ pointIndex
+ );
+
+ // Draw Border
+ graph.FillPieSlice(
+ area,
+ point,
+ brush,
+ pen,
+ points[(int)PiePoints.TopRectTopLeftPoint],
+ points[(int)PiePoints.TopStart],
+ points[(int)PiePoints.TopRectBottomRightPoint],
+ points[(int)PiePoints.TopEnd],
+ points[(int)PiePoints.TopCenter],
+ startAngle,
+ sweepAngle,
+ false,
+ pointIndex
+ );
+ }
+ else
+ {
+ // Fill
+ graph.FillDoughnutSlice(
+ area,
+ point,
+ brush,
+ pen,
+ points[(int)PiePoints.TopRectTopLeftPoint],
+ points[(int)PiePoints.TopStart],
+ points[(int)PiePoints.TopRectBottomRightPoint],
+ points[(int)PiePoints.TopEnd],
+ points[(int)PiePoints.DoughnutTopEnd],
+ points[(int)PiePoints.DoughnutTopStart],
+ startAngle,
+ sweepAngle,
+ true,
+ doughnutRadius,
+ pointIndex
+ );
+
+ // Draw Border
+ graph.FillDoughnutSlice(
+ area,
+ point,
+ brush,
+ pen,
+ points[(int)PiePoints.TopRectTopLeftPoint],
+ points[(int)PiePoints.TopStart],
+ points[(int)PiePoints.TopRectBottomRightPoint],
+ points[(int)PiePoints.TopEnd],
+ points[(int)PiePoints.DoughnutTopEnd],
+ points[(int)PiePoints.DoughnutTopStart],
+ startAngle,
+ sweepAngle,
+ false,
+ doughnutRadius,
+ pointIndex
+ );
+ }
+
+ // Draw 3D Outside labels
+ if( GetLabelStyle( point ) == PieLabelStyle.Outside )
+ {
+ // Check if special color properties are set
+ Color pieLineColor = pen.Color;
+ if(point.IsCustomPropertySet(CustomPropertyName.PieLineColor) || (point.series != null && point.series.IsCustomPropertySet(CustomPropertyName.PieLineColor)) )
+ {
+ ColorConverter colorConverter = new ColorConverter();
+ bool failed = false;
+
+ try
+ {
+ if(point.IsCustomPropertySet(CustomPropertyName.PieLineColor))
+ {
+ pieLineColor = (Color)colorConverter.ConvertFromString(point[CustomPropertyName.PieLineColor]);
+ }
+ else if(point.series != null && point.series.IsCustomPropertySet(CustomPropertyName.PieLineColor))
+ {
+ pieLineColor = (Color)colorConverter.ConvertFromString(point.series[CustomPropertyName.PieLineColor]);
+ }
+ }
+ catch (ArgumentException)
+ {
+ failed = true;
+ }
+ catch (NotSupportedException)
+ {
+ failed = true;
+ }
+
+ if(failed)
+ {
+ if(point.IsCustomPropertySet(CustomPropertyName.PieLineColor))
+ {
+ pieLineColor = (Color)colorConverter.ConvertFromInvariantString(point[CustomPropertyName.PieLineColor]);
+ }
+ else if(point.series != null && point.series.IsCustomPropertySet(CustomPropertyName.PieLineColor))
+ {
+ pieLineColor = (Color)colorConverter.ConvertFromInvariantString(point.series[CustomPropertyName.PieLineColor]);
+ }
+ }
+ }
+
+ // Draw labels
+ using (Pen labelPen = new Pen(pieLineColor, pen.Width))
+ {
+ Draw3DOutsideLabels(graph, area, labelPen, points, point, midAngle, pointIndex);
+ }
+ }
+
+ }
+ else
+ {
+
+ // Draw 3D Inside labels
+ if( GetLabelStyle( point ) == PieLabelStyle.Inside )
+ {
+ Draw3DInsideLabels( graph, points, point, pointIndex );
+ }
+ }
+
+ //Clean up resources
+ if (brush!=null)
+ brush.Dispose();
+ if (pen != null)
+ pen.Dispose();
+ if (penCurve != null)
+ penCurve.Dispose();
+ }
+
+ /// <summary>
+ /// This method transforms in 3D space important points for
+ /// doughnut or pie slice.
+ /// </summary>
+ /// <param name="graph">Chart Graphics</param>
+ /// <param name="area">Chart Area</param>
+ /// <param name="pieWidth">The width of a pie.</param>
+ /// <param name="rectangle">Rectangle used for drawing pie clice.</param>
+ /// <param name="startAngle">Start angle for pie slice.</param>
+ /// <param name="sweepAngle">End angle for pie slice.</param>
+ /// <param name="relativeCoordinates">true if relative coordinates has to be returned.</param>
+ /// <param name="doughnutRadius">Doughnut Radius</param>
+ /// <param name="exploded">Exploded pie slice</param>
+ /// <returns>Returns 3D Transformed pie or doughnut points.</returns>
+ private PointF [] GetPiePoints(
+ ChartGraphics graph,
+ ChartArea area,
+ float pieWidth,
+ RectangleF rectangle,
+ float startAngle,
+ float sweepAngle,
+ bool relativeCoordinates,
+ float doughnutRadius,
+ bool exploded
+ )
+ {
+ doughnutRadius = 1 - doughnutRadius / 100F;
+
+ Point3D [] points;
+ PointF [] result;
+
+ // Doughnut chart has 12 more points
+ if( Doughnut )
+ {
+ points = new Point3D[29];
+ result = new PointF[29];
+ }
+ else
+ {
+ points = new Point3D[17];
+ result = new PointF[17];
+ }
+
+ // Angle 180 Top point on the arc
+ points[(int)PiePoints.Top180] = new Point3D(
+ rectangle.X + (float)Math.Cos( 180 * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F,
+ rectangle.Y + (float)Math.Sin( 180 * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F,
+ pieWidth );
+
+ // Angle 180 Bottom point on the arc
+ points[(int)PiePoints.Bottom180] = new Point3D(
+ rectangle.X + (float)Math.Cos( 180 * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F,
+ rectangle.Y + (float)Math.Sin( 180 * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F,
+ 0 );
+
+ // Angle 0 Top point on the arc
+ points[(int)PiePoints.Top0] = new Point3D(
+ rectangle.X + (float)Math.Cos( 0 * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F,
+ rectangle.Y + (float)Math.Sin( 0 * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F,
+ pieWidth );
+
+ // Angle 0 Bottom point on the arc
+ points[(int)PiePoints.Bottom0] = new Point3D(
+ rectangle.X + (float)Math.Cos( 0 * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F,
+ rectangle.Y + (float)Math.Sin( 0 * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F,
+ 0 );
+
+ // Top Start Angle point on the arc
+ points[(int)PiePoints.TopStart] = new Point3D(
+ rectangle.X + (float)Math.Cos( startAngle * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F,
+ rectangle.Y + (float)Math.Sin( startAngle * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F,
+ pieWidth );
+
+ // Top End Angle point on the arc
+ points[(int)PiePoints.TopEnd] = new Point3D(
+ rectangle.X + (float)Math.Cos( ( startAngle + sweepAngle ) * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F,
+ rectangle.Y + (float)Math.Sin( ( startAngle + sweepAngle ) * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F,
+ pieWidth );
+
+ // Bottom Start Angle point on the arc
+ points[(int)PiePoints.BottomStart] = new Point3D(
+ rectangle.X + (float)Math.Cos( startAngle * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F,
+ rectangle.Y + (float)Math.Sin( startAngle * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F,
+ 0 );
+
+ // Bottom End Angle point on the arc
+ points[(int)PiePoints.BottomEnd] = new Point3D(
+ rectangle.X + (float)Math.Cos( ( startAngle + sweepAngle ) * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F,
+ rectangle.Y + (float)Math.Sin( ( startAngle + sweepAngle ) * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F,
+ 0 );
+
+ // Center Top
+ points[(int)PiePoints.TopCenter] = new Point3D(
+ rectangle.X + rectangle.Width / 2F,
+ rectangle.Y + rectangle.Height / 2F,
+ pieWidth );
+
+ // Center Bottom
+ points[(int)PiePoints.BottomCenter] = new Point3D(
+ rectangle.X + rectangle.Width / 2F,
+ rectangle.Y + rectangle.Height / 2F,
+ 0 );
+
+ // Top Label Line
+ points[(int)PiePoints.TopLabelLine] = new Point3D(
+ rectangle.X + (float)Math.Cos( ( startAngle + sweepAngle / 2 ) * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F,
+ rectangle.Y + (float)Math.Sin( ( startAngle + sweepAngle / 2 ) * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F,
+ pieWidth );
+
+ // If Pie slice is exploded Label line out size is changed
+ float sizeOut;
+ if( exploded )
+ {
+ sizeOut = 1.1F;
+ }
+ else
+ {
+ sizeOut = 1.3F;
+ }
+
+ // Top Label Line Out
+ points[(int)PiePoints.TopLabelLineout] = new Point3D(
+ rectangle.X + (float)Math.Cos( ( startAngle + sweepAngle / 2 ) * Math.PI / 180 ) * rectangle.Width * sizeOut / 2F + rectangle.Width / 2F,
+ rectangle.Y + (float)Math.Sin( ( startAngle + sweepAngle / 2 ) * Math.PI / 180 ) * rectangle.Height * sizeOut / 2F + rectangle.Height / 2F,
+ pieWidth );
+
+ // Top Label Center
+ if( this.Doughnut )
+ {
+ points[(int)PiePoints.TopLabelCenter] = new Point3D(
+ rectangle.X + (float)Math.Cos( ( startAngle + sweepAngle / 2 ) * Math.PI / 180 ) * rectangle.Width * ( 1 + doughnutRadius ) / 4F + rectangle.Width / 2F,
+ rectangle.Y + (float)Math.Sin( ( startAngle + sweepAngle / 2 ) * Math.PI / 180 ) * rectangle.Height * ( 1 + doughnutRadius ) / 4F + rectangle.Height / 2F,
+ pieWidth );
+ }
+ else
+ {
+ points[(int)PiePoints.TopLabelCenter] = new Point3D(
+ rectangle.X + (float)Math.Cos( ( startAngle + sweepAngle / 2 ) * Math.PI / 180 ) * rectangle.Width * 0.5F / 2F + rectangle.Width / 2F,
+ rectangle.Y + (float)Math.Sin( ( startAngle + sweepAngle / 2 ) * Math.PI / 180 ) * rectangle.Height * 0.5F / 2F + rectangle.Height / 2F,
+ pieWidth );
+ }
+
+
+ // Top Rectangle Top Left Point
+ points[(int)PiePoints.TopRectTopLeftPoint] = new Point3D(rectangle.X,rectangle.Y,pieWidth);
+
+ // Top Rectangle Right Bottom Point
+ points[(int)PiePoints.TopRectBottomRightPoint] = new Point3D(rectangle.Right,rectangle.Bottom,pieWidth);
+
+ // Bottom Rectangle Top Left Point
+ points[(int)PiePoints.BottomRectTopLeftPoint] = new Point3D(rectangle.X,rectangle.Y,0);
+
+ // Bottom Rectangle Right Bottom Point
+ points[(int)PiePoints.BottomRectBottomRightPoint] = new Point3D(rectangle.Right,rectangle.Bottom,0);
+
+ if( Doughnut )
+ {
+ // Angle 180 Top point on the Doughnut arc
+ points[(int)PiePoints.DoughnutTop180] = new Point3D(
+ rectangle.X + (float)Math.Cos( 180 * Math.PI / 180 ) * rectangle.Width * doughnutRadius / 2F + rectangle.Width / 2F,
+ rectangle.Y + (float)Math.Sin( 180 * Math.PI / 180 ) * rectangle.Height * doughnutRadius / 2F + rectangle.Height / 2F,
+ pieWidth );
+
+ // Angle 180 Bottom point on the Doughnut arc
+ points[(int)PiePoints.DoughnutBottom180] = new Point3D(
+ rectangle.X + (float)Math.Cos( 180 * Math.PI / 180 ) * rectangle.Width * doughnutRadius / 2F + rectangle.Width / 2F,
+ rectangle.Y + (float)Math.Sin( 180 * Math.PI / 180 ) * rectangle.Height * doughnutRadius / 2F + rectangle.Height / 2F,
+ 0 );
+
+ // Angle 0 Top point on the Doughnut arc
+ points[(int)PiePoints.DoughnutTop0] = new Point3D(
+ rectangle.X + (float)Math.Cos( 0 * Math.PI / 180 ) * rectangle.Width * doughnutRadius / 2F + rectangle.Width / 2F,
+ rectangle.Y + (float)Math.Sin( 0 * Math.PI / 180 ) * rectangle.Height * doughnutRadius / 2F + rectangle.Height / 2F,
+ pieWidth );
+
+ // Angle 0 Bottom point on the Doughnut arc
+ points[(int)PiePoints.DoughnutBottom0] = new Point3D(
+ rectangle.X + (float)Math.Cos( 0 * Math.PI / 180 ) * rectangle.Width * doughnutRadius / 2F + rectangle.Width / 2F,
+ rectangle.Y + (float)Math.Sin( 0 * Math.PI / 180 ) * rectangle.Height * doughnutRadius / 2F + rectangle.Height / 2F,
+ 0 );
+
+ // Top Start Angle point on the Doughnut arc
+ points[(int)PiePoints.DoughnutTopStart] = new Point3D(
+ rectangle.X + (float)Math.Cos( startAngle * Math.PI / 180 ) * rectangle.Width * doughnutRadius / 2F + rectangle.Width / 2F,
+ rectangle.Y + (float)Math.Sin( startAngle * Math.PI / 180 ) * rectangle.Height * doughnutRadius / 2F + rectangle.Height / 2F,
+ pieWidth );
+
+ // Top End Angle point on the Doughnut arc
+ points[(int)PiePoints.DoughnutTopEnd] = new Point3D(
+ rectangle.X + (float)Math.Cos( ( startAngle + sweepAngle ) * Math.PI / 180 ) * rectangle.Width * doughnutRadius / 2F + rectangle.Width / 2F,
+ rectangle.Y + (float)Math.Sin( ( startAngle + sweepAngle ) * Math.PI / 180 ) * rectangle.Height * doughnutRadius / 2F + rectangle.Height / 2F,
+ pieWidth );
+
+ // Bottom Start Angle point on the Doughnut arc
+ points[(int)PiePoints.DoughnutBottomStart] = new Point3D(
+ rectangle.X + (float)Math.Cos( startAngle * Math.PI / 180 ) * rectangle.Width * doughnutRadius / 2F + rectangle.Width / 2F,
+ rectangle.Y + (float)Math.Sin( startAngle * Math.PI / 180 ) * rectangle.Height * doughnutRadius / 2F + rectangle.Height / 2F,
+ 0 );
+
+ // Bottom End Angle point on the Doughnut arc
+ points[(int)PiePoints.DoughnutBottomEnd] = new Point3D(
+ rectangle.X + (float)Math.Cos( ( startAngle + sweepAngle ) * Math.PI / 180 ) * rectangle.Width * doughnutRadius / 2F + rectangle.Width / 2F,
+ rectangle.Y + (float)Math.Sin( ( startAngle + sweepAngle ) * Math.PI / 180 ) * rectangle.Height * doughnutRadius / 2F + rectangle.Height / 2F,
+ 0 );
+
+ rectangle.Inflate( -rectangle.Width * (1 - doughnutRadius) / 2F, -rectangle.Height * (1 - doughnutRadius) / 2F);
+
+ // Doughnut Top Rectangle Top Left Point
+ points[(int)PiePoints.DoughnutTopRectTopLeftPoint] = new Point3D(rectangle.X,rectangle.Y,pieWidth);
+
+ // Doughnut Top Rectangle Right Bottom Point
+ points[(int)PiePoints.DoughnutTopRectBottomRightPoint] = new Point3D(rectangle.Right,rectangle.Bottom,pieWidth);
+
+ // Doughnut Bottom Rectangle Top Left Point
+ points[(int)PiePoints.DoughnutBottomRectTopLeftPoint] = new Point3D(rectangle.X,rectangle.Y,0);
+
+ // Doughnut Bottom Rectangle Right Bottom Point
+ points[(int)PiePoints.DoughnutBottomRectBottomRightPoint] = new Point3D(rectangle.Right,rectangle.Bottom,0);
+
+
+ }
+
+ // Make 3D transformations
+ area.matrix3D.TransformPoints(points);
+
+ int pointIndx = 0;
+ foreach( Point3D point in points )
+ {
+ result[pointIndx] = point.PointF;
+
+ // Convert Relative coordinates to absolute.
+ if( relativeCoordinates )
+ {
+ result[pointIndx] = graph.GetAbsolutePoint(result[pointIndx]);
+ }
+ pointIndx++;
+ }
+
+ return result;
+
+ }
+
+
+
+
+ #endregion
+
+ #region 3D Drawing surfaces
+
+ /// <summary>
+ /// This method is used for drawing curve around pie slices. This is
+ /// the most complex part of 3D Pie slice. There is special case if
+ /// pie slice is bigger then 180 degree.
+ /// </summary>
+ /// <param name="graph">Chart Grahics.</param>
+ /// <param name="area">Chart Area.</param>
+ /// <param name="dataPoint">Data Point used for pie slice.</param>
+ /// <param name="startAngle">Start angle of a pie slice.</param>
+ /// <param name="sweepAngle">Sweep angle of a pie slice.</param>
+ /// <param name="points">Important 3d points of a pie slice.</param>
+ /// <param name="brushWithoutLight">Brush without lithing efects.</param>
+ /// <param name="pen">Pen used for border.</param>
+ /// <param name="rightPosition">Position of the curve of big pie slice. Big pie slice coud have to visible curves - left and right</param>
+ /// <param name="sameBackFront">This is big pie slice which is in same time back and front slice.</param>
+ /// <param name="pointIndex">Data Point Index</param>
+ private void DrawPieCurves(
+ ChartGraphics graph,
+ ChartArea area,
+ DataPoint dataPoint,
+ float startAngle,
+ float sweepAngle,
+ PointF [] points,
+ SolidBrush brushWithoutLight,
+ Pen pen,
+ bool rightPosition,
+ bool sameBackFront,
+ int pointIndex
+ )
+ {
+ // Create a graphics path
+ using (GraphicsPath path = new GraphicsPath())
+ {
+ Brush brush;
+
+ if (area.Area3DStyle.LightStyle == LightStyle.None)
+ {
+ brush = brushWithoutLight;
+ }
+ else
+ {
+ brush = graph.GetGradientBrush(graph.GetAbsoluteRectangle(area.Position.ToRectangleF()), Color.FromArgb(brushWithoutLight.Color.A, 0, 0, 0), brushWithoutLight.Color, GradientStyle.VerticalCenter);
+ }
+
+ float endAngle = startAngle + sweepAngle;
+
+ // Very big pie slice ( > 180 degree )
+ if (sweepAngle > 180)
+ {
+ if (DrawPieCurvesBigSlice(graph, area, dataPoint, startAngle, sweepAngle, points, brush, pen, rightPosition, sameBackFront, pointIndex))
+ return;
+ }
+
+ // Pie slice pass throw 180 degree. Curve has to be spited.
+ if (startAngle < 180 && endAngle > 180)
+ {
+ if (area.Area3DStyle.Inclination < 0)
+ {
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.TopRectTopLeftPoint],
+ points[(int)PiePoints.TopRectBottomRightPoint],
+ points[(int)PiePoints.BottomRectTopLeftPoint],
+ points[(int)PiePoints.BottomRectBottomRightPoint],
+ points[(int)PiePoints.TopStart],
+ points[(int)PiePoints.Top180],
+ points[(int)PiePoints.BottomStart],
+ points[(int)PiePoints.Bottom180],
+ startAngle,
+ 180 - startAngle,
+ pointIndex
+ );
+
+ }
+ else
+ {
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.TopRectTopLeftPoint],
+ points[(int)PiePoints.TopRectBottomRightPoint],
+ points[(int)PiePoints.BottomRectTopLeftPoint],
+ points[(int)PiePoints.BottomRectBottomRightPoint],
+ points[(int)PiePoints.Top180],
+ points[(int)PiePoints.TopEnd],
+ points[(int)PiePoints.Bottom180],
+ points[(int)PiePoints.BottomEnd],
+ 180,
+ startAngle + sweepAngle - 180,
+ pointIndex
+ );
+
+ }
+ }
+
+ // Pie slice pass throw 0 degree. Curve has to be spited.
+ else if (startAngle < 0 && endAngle > 0)
+ {
+ if (area.Area3DStyle.Inclination > 0)
+ {
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.TopRectTopLeftPoint],
+ points[(int)PiePoints.TopRectBottomRightPoint],
+ points[(int)PiePoints.BottomRectTopLeftPoint],
+ points[(int)PiePoints.BottomRectBottomRightPoint],
+ points[(int)PiePoints.TopStart],
+ points[(int)PiePoints.Top0],
+ points[(int)PiePoints.BottomStart],
+ points[(int)PiePoints.Bottom0],
+ startAngle,
+ -startAngle,
+ pointIndex
+ );
+
+ }
+ else
+ {
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.TopRectTopLeftPoint],
+ points[(int)PiePoints.TopRectBottomRightPoint],
+ points[(int)PiePoints.BottomRectTopLeftPoint],
+ points[(int)PiePoints.BottomRectBottomRightPoint],
+ points[(int)PiePoints.Top0],
+ points[(int)PiePoints.TopEnd],
+ points[(int)PiePoints.Bottom0],
+ points[(int)PiePoints.BottomEnd],
+ 0,
+ sweepAngle + startAngle,
+ pointIndex
+ );
+
+ }
+ }
+ // Pie slice pass throw 360 degree. Curve has to be spited.
+ else if (startAngle < 360 && endAngle > 360)
+ {
+ if (area.Area3DStyle.Inclination > 0)
+ {
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.TopRectTopLeftPoint],
+ points[(int)PiePoints.TopRectBottomRightPoint],
+ points[(int)PiePoints.BottomRectTopLeftPoint],
+ points[(int)PiePoints.BottomRectBottomRightPoint],
+ points[(int)PiePoints.TopStart],
+ points[(int)PiePoints.Top0],
+ points[(int)PiePoints.BottomStart],
+ points[(int)PiePoints.Bottom0],
+ startAngle,
+ 360 - startAngle,
+ pointIndex
+ );
+
+ }
+ else
+ {
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.TopRectTopLeftPoint],
+ points[(int)PiePoints.TopRectBottomRightPoint],
+ points[(int)PiePoints.BottomRectTopLeftPoint],
+ points[(int)PiePoints.BottomRectBottomRightPoint],
+ points[(int)PiePoints.Top0],
+ points[(int)PiePoints.TopEnd],
+ points[(int)PiePoints.Bottom0],
+ points[(int)PiePoints.BottomEnd],
+ 0,
+ endAngle - 360,
+ pointIndex
+ );
+ }
+ }
+ else
+ {
+ // ***************************************************
+ // REGULAR CASE: The curve is not split.
+ // ***************************************************
+ if (startAngle < 180 && startAngle >= 0 && area.Area3DStyle.Inclination < 0
+ || startAngle < 540 && startAngle >= 360 && area.Area3DStyle.Inclination < 0
+ || startAngle >= 180 && startAngle < 360 && area.Area3DStyle.Inclination > 0
+ || startAngle >= -180 && startAngle < 0 && area.Area3DStyle.Inclination > 0
+ )
+ {
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.TopRectTopLeftPoint],
+ points[(int)PiePoints.TopRectBottomRightPoint],
+ points[(int)PiePoints.BottomRectTopLeftPoint],
+ points[(int)PiePoints.BottomRectBottomRightPoint],
+ points[(int)PiePoints.TopStart],
+ points[(int)PiePoints.TopEnd],
+ points[(int)PiePoints.BottomStart],
+ points[(int)PiePoints.BottomEnd],
+ startAngle,
+ sweepAngle,
+ pointIndex
+ );
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// This method is used for special case when big pie slice has to be drawn.
+ /// </summary>
+ /// <param name="graph">Chart Grahics.</param>
+ /// <param name="area">Chart Area.</param>
+ /// <param name="dataPoint">Data Point used for pie slice.</param>
+ /// <param name="startAngle">Start angle of a pie slice.</param>
+ /// <param name="sweepAngle">Sweep angle of a pie slice.</param>
+ /// <param name="points">Important 3d points of a pie slice.</param>
+ /// <param name="brush">Brush without lithing efects.</param>
+ /// <param name="pen">Pen used for border.</param>
+ /// <param name="rightPosition">Position of the curve of big pie slice. Big pie slice coud have to visible curves - left and right</param>
+ /// <param name="sameBackFront">This is big pie slice which is in same time back and front slice.</param>
+ /// <param name="pointIndex">Data Point Index</param>
+ /// <returns>True if slice is special case and it is drawn as a special case.</returns>
+ private bool DrawPieCurvesBigSlice
+ (
+ ChartGraphics graph,
+ ChartArea area,
+ DataPoint dataPoint,
+ float startAngle,
+ float sweepAngle,
+ PointF [] points,
+ Brush brush,
+ Pen pen,
+ bool rightPosition,
+ bool sameBackFront,
+ int pointIndex
+ )
+ {
+ float endAngle = startAngle + sweepAngle;
+
+ // Two different cases connected with X angle.
+ // *****************************************************
+ // X angle is positive
+ // *****************************************************
+ if( area.Area3DStyle.Inclination > 0 )
+ {
+ // Show curve from 0 to 180.
+ if( startAngle < 180 && endAngle > 360 )
+ {
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.TopRectTopLeftPoint],
+ points[(int)PiePoints.TopRectBottomRightPoint],
+ points[(int)PiePoints.BottomRectTopLeftPoint],
+ points[(int)PiePoints.BottomRectBottomRightPoint],
+ points[(int)PiePoints.Top0],
+ points[(int)PiePoints.Top180],
+ points[(int)PiePoints.Bottom0],
+ points[(int)PiePoints.Bottom180],
+ 0,
+ -180,
+ pointIndex
+ );
+ }
+ else if( startAngle < 0 && endAngle > 180 )
+ {
+ // There is big data point which is back and
+ // front point in same time.
+ if( sameBackFront )
+ {
+ // The big pie slice has to be split. This part makes
+ // decision which part of this big slice will be
+ // drawn first.
+ if( rightPosition )
+ {
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.TopRectTopLeftPoint],
+ points[(int)PiePoints.TopRectBottomRightPoint],
+ points[(int)PiePoints.BottomRectTopLeftPoint],
+ points[(int)PiePoints.BottomRectBottomRightPoint],
+ points[(int)PiePoints.Top180],
+ points[(int)PiePoints.TopEnd],
+ points[(int)PiePoints.Bottom180],
+ points[(int)PiePoints.BottomEnd],
+ 180,
+ endAngle - 180,
+ pointIndex
+ );
+ }
+ else
+ {
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.TopRectTopLeftPoint],
+ points[(int)PiePoints.TopRectBottomRightPoint],
+ points[(int)PiePoints.BottomRectTopLeftPoint],
+ points[(int)PiePoints.BottomRectBottomRightPoint],
+ points[(int)PiePoints.TopStart],
+ points[(int)PiePoints.Top0],
+ points[(int)PiePoints.BottomStart],
+ points[(int)PiePoints.Bottom0],
+ startAngle,
+ -startAngle,
+ pointIndex
+ );
+ }
+ }
+ else
+ {
+ // There is big pie slice (>180), but that pie slice
+ // is not back and front point in same time.
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.TopRectTopLeftPoint],
+ points[(int)PiePoints.TopRectBottomRightPoint],
+ points[(int)PiePoints.BottomRectTopLeftPoint],
+ points[(int)PiePoints.BottomRectBottomRightPoint],
+ points[(int)PiePoints.TopStart],
+ points[(int)PiePoints.Top0],
+ points[(int)PiePoints.BottomStart],
+ points[(int)PiePoints.Bottom0],
+ startAngle,
+ -startAngle,
+ pointIndex
+ );
+
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.TopRectTopLeftPoint],
+ points[(int)PiePoints.TopRectBottomRightPoint],
+ points[(int)PiePoints.BottomRectTopLeftPoint],
+ points[(int)PiePoints.BottomRectBottomRightPoint],
+ points[(int)PiePoints.Top180],
+ points[(int)PiePoints.TopEnd],
+ points[(int)PiePoints.Bottom180],
+ points[(int)PiePoints.BottomEnd],
+ 180,
+ endAngle - 180,
+ pointIndex
+ );
+ }
+
+ }
+ else
+ {
+ // Big pie slice behaves as normal pie slice. Continue
+ // Non special case alghoritham
+ return false;
+ }
+ }
+ // *********************************************
+ // X angle negative
+ // *********************************************
+ else
+ {
+ // Show curve from 0 to 180.
+ if( startAngle < 0 && endAngle > 180 )
+ {
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.TopRectTopLeftPoint],
+ points[(int)PiePoints.TopRectBottomRightPoint],
+ points[(int)PiePoints.BottomRectTopLeftPoint],
+ points[(int)PiePoints.BottomRectBottomRightPoint],
+ points[(int)PiePoints.Top0],
+ points[(int)PiePoints.Top180],
+ points[(int)PiePoints.Bottom0],
+ points[(int)PiePoints.Bottom180],
+ 0,
+ 180,
+ pointIndex
+ );
+ }
+ else if( startAngle < 180 && endAngle > 360 )
+ {
+ // There is big data point which is back and
+ // front point in same time.
+ if( sameBackFront )
+ {
+ // The big pie slice has to be split. This part makes
+ // decision which part of this big slice will be
+ // drawn first.
+ if( rightPosition )
+ {
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.TopRectTopLeftPoint],
+ points[(int)PiePoints.TopRectBottomRightPoint],
+ points[(int)PiePoints.BottomRectTopLeftPoint],
+ points[(int)PiePoints.BottomRectBottomRightPoint],
+ points[(int)PiePoints.TopStart],
+ points[(int)PiePoints.Top180],
+ points[(int)PiePoints.BottomStart],
+ points[(int)PiePoints.Bottom180],
+ startAngle,
+ 180 - startAngle,
+ pointIndex
+ );
+ }
+ else
+ {
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.TopRectTopLeftPoint],
+ points[(int)PiePoints.TopRectBottomRightPoint],
+ points[(int)PiePoints.BottomRectTopLeftPoint],
+ points[(int)PiePoints.BottomRectBottomRightPoint],
+ points[(int)PiePoints.Top0],
+ points[(int)PiePoints.TopEnd],
+ points[(int)PiePoints.Bottom0],
+ points[(int)PiePoints.BottomEnd],
+ 0,
+ endAngle - 360,
+ pointIndex
+ );
+ }
+ }
+ else
+ {
+ // There is big pie slice (>180), but that pie slice
+ // is not back and front point in same time.
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.TopRectTopLeftPoint],
+ points[(int)PiePoints.TopRectBottomRightPoint],
+ points[(int)PiePoints.BottomRectTopLeftPoint],
+ points[(int)PiePoints.BottomRectBottomRightPoint],
+ points[(int)PiePoints.Top0],
+ points[(int)PiePoints.TopEnd],
+ points[(int)PiePoints.Bottom0],
+ points[(int)PiePoints.BottomEnd],
+ 0,
+ endAngle - 360,
+ pointIndex
+ );
+
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.TopRectTopLeftPoint],
+ points[(int)PiePoints.TopRectBottomRightPoint],
+ points[(int)PiePoints.BottomRectTopLeftPoint],
+ points[(int)PiePoints.BottomRectBottomRightPoint],
+ points[(int)PiePoints.TopStart],
+ points[(int)PiePoints.Top180],
+ points[(int)PiePoints.BottomStart],
+ points[(int)PiePoints.Bottom180],
+ startAngle,
+ 180 - startAngle,
+ pointIndex
+ );
+ }
+
+ }
+ else
+ {
+ // Big pie slice behaves as normal pie slice. Continue
+ // Non special case alghoritham
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /// <summary>
+ /// This method is used for drawing curve around doughnut slices - inner curve.
+ /// This is the most complex part of 3D Doughnut slice. There is special case if
+ /// pie slice is bigger then 180 degree.
+ /// </summary>
+ /// <param name="graph">Chart Grahics.</param>
+ /// <param name="area">Chart Area.</param>
+ /// <param name="dataPoint">Data Point used for pie slice.</param>
+ /// <param name="startAngle">Start angle of a pie slice.</param>
+ /// <param name="sweepAngle">Sweep angle of a pie slice.</param>
+ /// <param name="points">Important 3d points of a pie slice.</param>
+ /// <param name="brushWithoutLight">Brush without lithing efects.</param>
+ /// <param name="pen">Pen used for border.</param>
+ /// <param name="rightPosition">Position of the curve of big pie slice. Big pie slice coud have to visible curves - left and right</param>
+ /// <param name="sameBackFront">This is big pie slice which is in same time back and front slice.</param>
+ /// <param name="pointIndex">Data Point Index</param>
+ private void DrawDoughnutCurves(
+ ChartGraphics graph,
+ ChartArea area,
+ DataPoint dataPoint,
+ float startAngle,
+ float sweepAngle,
+ PointF [] points,
+ SolidBrush brushWithoutLight,
+ Pen pen,
+ bool rightPosition,
+ bool sameBackFront,
+ int pointIndex
+ )
+ {
+ // Create a graphics path
+ using (GraphicsPath path = new GraphicsPath())
+ {
+
+ Brush brush;
+
+ if (area.Area3DStyle.LightStyle == LightStyle.None)
+ {
+ brush = brushWithoutLight;
+ }
+ else
+ {
+ brush = graph.GetGradientBrush(graph.GetAbsoluteRectangle(area.Position.ToRectangleF()), Color.FromArgb(brushWithoutLight.Color.A, 0, 0, 0), brushWithoutLight.Color, GradientStyle.VerticalCenter);
+ }
+
+ float endAngle = startAngle + sweepAngle;
+
+ // Very big pie slice ( > 180 degree )
+ if (sweepAngle > 180)
+ {
+ if (DrawDoughnutCurvesBigSlice(graph, area, dataPoint, startAngle, sweepAngle, points, brush, pen, rightPosition, sameBackFront, pointIndex))
+ return;
+ }
+
+ // Pie slice pass throw 180 degree. Curve has to be spited.
+ if (startAngle < 180 && endAngle > 180)
+ {
+ if (area.Area3DStyle.Inclination > 0)
+ {
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.DoughnutTopRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutTopRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutBottomRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutBottomRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutTopStart],
+ points[(int)PiePoints.DoughnutTop180],
+ points[(int)PiePoints.DoughnutBottomStart],
+ points[(int)PiePoints.DoughnutBottom180],
+ startAngle,
+ 180 - startAngle,
+ pointIndex
+ );
+
+ }
+ else
+ {
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.DoughnutTopRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutTopRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutBottomRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutBottomRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutTop180],
+ points[(int)PiePoints.DoughnutTopEnd],
+ points[(int)PiePoints.DoughnutBottom180],
+ points[(int)PiePoints.DoughnutBottomEnd],
+ 180,
+ startAngle + sweepAngle - 180,
+ pointIndex
+ );
+
+ }
+ }
+
+ // Pie slice pass throw 0 degree. Curve has to be spited.
+ else if (startAngle < 0 && endAngle > 0)
+ {
+ if (area.Area3DStyle.Inclination < 0)
+ {
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.DoughnutTopRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutTopRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutBottomRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutBottomRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutTopStart],
+ points[(int)PiePoints.DoughnutTop0],
+ points[(int)PiePoints.DoughnutBottomStart],
+ points[(int)PiePoints.DoughnutBottom0],
+ startAngle,
+ -startAngle,
+ pointIndex
+ );
+
+ }
+ else
+ {
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.DoughnutTopRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutTopRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutBottomRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutBottomRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutTop0],
+ points[(int)PiePoints.DoughnutTopEnd],
+ points[(int)PiePoints.DoughnutBottom0],
+ points[(int)PiePoints.DoughnutBottomEnd],
+ 0,
+ sweepAngle + startAngle,
+ pointIndex
+ );
+
+ }
+ }
+ // Pie slice pass throw 360 degree. Curve has to be spited.
+ else if (startAngle < 360 && endAngle > 360)
+ {
+ if (area.Area3DStyle.Inclination < 0)
+ {
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.DoughnutTopRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutTopRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutBottomRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutBottomRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutTopStart],
+ points[(int)PiePoints.DoughnutTop0],
+ points[(int)PiePoints.DoughnutBottomStart],
+ points[(int)PiePoints.DoughnutBottom0],
+ startAngle,
+ 360 - startAngle,
+ pointIndex
+ );
+
+ }
+ else
+ {
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.DoughnutTopRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutTopRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutBottomRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutBottomRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutTop0],
+ points[(int)PiePoints.DoughnutTopEnd],
+ points[(int)PiePoints.DoughnutBottom0],
+ points[(int)PiePoints.DoughnutBottomEnd],
+ 0,
+ endAngle - 360,
+ pointIndex
+ );
+ }
+ }
+ else
+ {
+ // ***************************************************
+ // REGULAR CASE: The curve is not split.
+ // ***************************************************
+ if (startAngle < 180 && startAngle >= 0 && area.Area3DStyle.Inclination > 0
+ || startAngle < 540 && startAngle >= 360 && area.Area3DStyle.Inclination > 0
+ || startAngle >= 180 && startAngle < 360 && area.Area3DStyle.Inclination < 0
+ || startAngle >= -180 && startAngle < 0 && area.Area3DStyle.Inclination < 0
+ )
+ {
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.DoughnutTopRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutTopRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutBottomRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutBottomRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutTopStart],
+ points[(int)PiePoints.DoughnutTopEnd],
+ points[(int)PiePoints.DoughnutBottomStart],
+ points[(int)PiePoints.DoughnutBottomEnd],
+ startAngle,
+ sweepAngle,
+ pointIndex
+ );
+ }
+ }
+
+ }
+
+ }
+
+
+ /// <summary>
+ /// This method is used for special case when big doughnut slice has to be drawn.
+ /// </summary>
+ /// <param name="graph">Chart Grahics.</param>
+ /// <param name="area">Chart Area.</param>
+ /// <param name="dataPoint">Data Point used for pie slice.</param>
+ /// <param name="startAngle">Start angle of a pie slice.</param>
+ /// <param name="sweepAngle">Sweep angle of a pie slice.</param>
+ /// <param name="points">Important 3d points of a pie slice.</param>
+ /// <param name="brush">Brush without lithing efects.</param>
+ /// <param name="pen">Pen used for border.</param>
+ /// <param name="rightPosition">Position of the curve of big pie slice. Big pie slice coud have to visible curves - left and right</param>
+ /// <param name="sameBackFront">This is big pie slice which is in same time back and front slice.</param>
+ /// <param name="pointIndex">Data Point Index</param>
+ /// <returns>True if slice is special case and it is drawn as a special case.</returns>
+ private bool DrawDoughnutCurvesBigSlice
+ (
+ ChartGraphics graph,
+ ChartArea area,
+ DataPoint dataPoint,
+ float startAngle,
+ float sweepAngle,
+ PointF [] points,
+ Brush brush,
+ Pen pen,
+ bool rightPosition,
+ bool sameBackFront,
+ int pointIndex
+ )
+ {
+ float endAngle = startAngle + sweepAngle;
+
+ // Two different cases connected with X angle.
+ // *****************************************************
+ // X angle is positive
+ // *****************************************************
+ if( area.Area3DStyle.Inclination < 0 )
+ {
+ // Show curve from 0 to 180.
+ if( startAngle < 180 && endAngle > 360 )
+ {
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.DoughnutTopRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutTopRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutBottomRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutBottomRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutTop0],
+ points[(int)PiePoints.DoughnutTop180],
+ points[(int)PiePoints.DoughnutBottom0],
+ points[(int)PiePoints.DoughnutBottom180],
+ 0,
+ -180,
+ pointIndex
+ );
+ }
+ else if( startAngle < 0 && endAngle > 180 )
+ {
+ // There is big data point which is back and
+ // front point in same time.
+ if( sameBackFront )
+ {
+ // The big pie slice has to be split. This part makes
+ // decision which part of this big slice will be
+ // drawn first.
+ if( rightPosition )
+ {
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.DoughnutTopRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutTopRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutBottomRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutBottomRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutTop180],
+ points[(int)PiePoints.DoughnutTopEnd],
+ points[(int)PiePoints.DoughnutBottom180],
+ points[(int)PiePoints.DoughnutBottomEnd],
+ 180,
+ endAngle - 180,
+ pointIndex
+ );
+ }
+ else
+ {
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.DoughnutTopRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutTopRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutBottomRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutBottomRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutTopStart],
+ points[(int)PiePoints.DoughnutTop0],
+ points[(int)PiePoints.DoughnutBottomStart],
+ points[(int)PiePoints.DoughnutBottom0],
+ startAngle,
+ -startAngle,
+ pointIndex
+ );
+ }
+ }
+ else
+ {
+ // There is big pie slice (>180), but that pie slice
+ // is not back and front point in same time.
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.DoughnutTopRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutTopRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutBottomRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutBottomRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutTopStart],
+ points[(int)PiePoints.DoughnutTop0],
+ points[(int)PiePoints.DoughnutBottomStart],
+ points[(int)PiePoints.DoughnutBottom0],
+ startAngle,
+ -startAngle,
+ pointIndex
+ );
+
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.DoughnutTopRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutTopRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutBottomRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutBottomRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutTop180],
+ points[(int)PiePoints.DoughnutTopEnd],
+ points[(int)PiePoints.DoughnutBottom180],
+ points[(int)PiePoints.DoughnutBottomEnd],
+ 180,
+ endAngle - 180,
+ pointIndex
+ );
+ }
+
+ }
+ else
+ {
+ // Big pie slice behaves as normal pie slice. Continue
+ // Non special case alghoritham
+ return false;
+ }
+ }
+ // *********************************************
+ // X angle negative
+ // *********************************************
+ else
+ {
+ // Show curve from 0 to 180.
+ if( startAngle < 0 && endAngle > 180 )
+ {
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.DoughnutTopRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutTopRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutBottomRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutBottomRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutTop0],
+ points[(int)PiePoints.DoughnutTop180],
+ points[(int)PiePoints.DoughnutBottom0],
+ points[(int)PiePoints.DoughnutBottom180],
+ 0,
+ 180,
+ pointIndex
+ );
+ }
+ else if( startAngle < 180 && endAngle > 360 )
+ {
+ // There is big data point which is back and
+ // front point in same time.
+ if( sameBackFront )
+ {
+ // The big pie slice has to be split. This part makes
+ // decision which part of this big slice will be
+ // drawn first.
+ if( rightPosition )
+ {
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.DoughnutTopRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutTopRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutBottomRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutBottomRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutTopStart],
+ points[(int)PiePoints.DoughnutTop180],
+ points[(int)PiePoints.DoughnutBottomStart],
+ points[(int)PiePoints.DoughnutBottom180],
+ startAngle,
+ 180 - startAngle,
+ pointIndex
+ );
+ }
+ else
+ {
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.DoughnutTopRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutTopRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutBottomRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutBottomRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutTop0],
+ points[(int)PiePoints.DoughnutTopEnd],
+ points[(int)PiePoints.DoughnutBottom0],
+ points[(int)PiePoints.DoughnutBottomEnd],
+ 0,
+ endAngle - 360,
+ pointIndex
+ );
+ }
+ }
+ else
+ {
+ // There is big pie slice (>180), but that pie slice
+ // is not back and front point in same time.
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.DoughnutTopRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutTopRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutBottomRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutBottomRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutTop0],
+ points[(int)PiePoints.DoughnutTopEnd],
+ points[(int)PiePoints.DoughnutBottom0],
+ points[(int)PiePoints.DoughnutBottomEnd],
+ 0,
+ endAngle - 360,
+ pointIndex
+ );
+
+ graph.FillPieCurve(
+ area,
+ dataPoint,
+ brush,
+ pen,
+ points[(int)PiePoints.DoughnutTopRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutTopRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutBottomRectTopLeftPoint],
+ points[(int)PiePoints.DoughnutBottomRectBottomRightPoint],
+ points[(int)PiePoints.DoughnutTopStart],
+ points[(int)PiePoints.DoughnutTop180],
+ points[(int)PiePoints.DoughnutBottomStart],
+ points[(int)PiePoints.DoughnutBottom180],
+ startAngle,
+ 180 - startAngle,
+ pointIndex
+ );
+ }
+
+ }
+ else
+ {
+ // Big pie slice behaves as normal pie slice. Continue
+ // Non special case alghoritham
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+
+
+ #endregion
+
+ #region 3D Order of points Methods
+
+ /// <summary>
+ /// This method sort data points on specific way. Because
+ /// of order of drawing in 3D space, the back data point
+ /// (point which pass throw 270 degree has to be drawn first.
+ /// After that side data points have to be drawn. At the end
+ /// front data point (data point which pass throw 0 degree)
+ /// has to be drawn. There is special case if there is big
+ /// data point, which is back and front point in same time.
+ /// </summary>
+ /// <param name="series">Data series</param>
+ /// <param name="area">Chart area</param>
+ /// <param name="newStartAngleList">Unsorted List of Start angles.</param>
+ /// <param name="newSweepAngleList">Unsorted List of Sweep angles.</param>
+ /// <param name="newPointIndexList">Data Point index list</param>
+ /// <param name="sameBackFrontPoint">Beck and Fron Points are same - There is a big pie slice.</param>
+ /// <returns>Sorted data point list.</returns>
+ private DataPoint [] PointOrder( Series series, ChartArea area, out float [] newStartAngleList, out float [] newSweepAngleList, out int [] newPointIndexList, out bool sameBackFrontPoint )
+ {
+
+ double startAngle;
+ double sweepAngle;
+ double endAngle;
+ int backPoint = -1;
+ int frontPoint = -1;
+ sameBackFrontPoint = false;
+
+ // The data points loop. Find Sum of data points.
+ double sum = 0;
+ int numOfEmpty = 0;
+ foreach( DataPoint point in series.Points )
+ {
+ if( point.IsEmpty )
+ numOfEmpty++;
+
+ if( !point.IsEmpty )
+ {
+ sum += Math.Abs(point.YValues[0]);
+ }
+ }
+
+ // Find number of data points
+ int numOfPoints = series.Points.Count - numOfEmpty;
+
+ DataPoint [] points = new DataPoint[ numOfPoints ];
+ float [] startAngleList = new float[ numOfPoints ];
+ float [] sweepAngleList = new float[ numOfPoints ];
+ int [] pointIndexList = new int[ numOfPoints ];
+ newStartAngleList = new float[ numOfPoints ];
+ newSweepAngleList = new float[ numOfPoints ];
+ newPointIndexList = new int[ numOfPoints ];
+
+ // If sum is less then 0 do not draw pie chart
+ if( sum <= 0 )
+ {
+ return null;
+ }
+ // *****************************************************
+ // Find Back and Front Points. Back point is a point
+ // which pass throw 270 degree. Front point pass
+ // throw 90 degree.
+ // There are two points in the data point list which will be
+ // placed at the end and at the beginning on the sorted list: Back
+ // point (beginning) and Front point (the end). Back point could
+ // be only after Front point at the unsorted list.
+ // *****************************************************
+ int pointIndx = 0;
+ startAngle = area.Area3DStyle.Rotation;
+ foreach( DataPoint point in series.Points )
+ {
+ // Do not process empty points
+ if( point.IsEmpty )
+ {
+ continue;
+ }
+
+ // Find angles
+ sweepAngle = (float)( Math.Abs(point.YValues[0]) * 360 / sum );
+ endAngle = startAngle + sweepAngle;
+
+ startAngleList[ pointIndx ] = (float)startAngle;
+ sweepAngleList[ pointIndx ] = (float)sweepAngle;
+ pointIndexList[ pointIndx ] = pointIndx;
+
+ // ***************************************************************
+ // Find Back point.
+ // Because angle could be between -180 and 540 ( Y axis
+ // rotation from -180 to 180 ), Back point could be at -90 and 270
+ // ***************************************************************
+ if( startAngle <= -90 && endAngle > -90 || startAngle <= 270 && endAngle > 270 && points[0] == null )
+ {
+ /*if( points[0] != null )
+ throw new InvalidOperationException(SR.ExceptionPiePointOrderInvalid);
+ */
+ backPoint = pointIndx;
+ points[0] = point;
+ newStartAngleList[0] = startAngleList[pointIndx];
+ newSweepAngleList[0] = sweepAngleList[pointIndx];
+ newPointIndexList[0] = pointIndexList[pointIndx];
+ }
+
+ // ***************************************************************
+ // Find Front point.
+ // Because angle could be between -180 and 540 ( Y axis
+ // rotation from -180 to 180 ), Front point could be at 90 and 450
+ // Case frontPoint == -1 is set because of rounding error.
+ // ***************************************************************
+ if( startAngle <= 90 && endAngle > 90 || startAngle <= 450 && endAngle > 450 && frontPoint == -1 && ( points[points.Length-1] == null || points.Length == 1 ) )
+ {
+ /*
+ if( points[points.Length-1] != null && points.Length != 1)
+ throw new InvalidOperationException(SR.ExceptionPiePointOrderInvalid);
+ */
+ frontPoint = pointIndx;
+ points[points.Length-1] = point;
+ newStartAngleList[points.Length-1] = startAngleList[pointIndx];
+ newSweepAngleList[points.Length-1] = sweepAngleList[pointIndx];
+ newPointIndexList[points.Length-1] = pointIndexList[pointIndx];
+ }
+
+ pointIndx++;
+ startAngle += sweepAngle;
+ }
+
+ if( frontPoint == -1 || backPoint == -1 )
+ {
+ throw new InvalidOperationException(SR.ExceptionPieUnassignedFrontBackPoints);
+ }
+
+ // If front point and back point are same do not
+ // put same point in two fields.
+ if( frontPoint == backPoint && points.Length != 1 )
+ {
+ points[points.Length-1] = null;
+ newStartAngleList[points.Length-1] = 0;
+ newSweepAngleList[points.Length-1] = 0;
+ newPointIndexList[points.Length-1] = 0;
+ sameBackFrontPoint = true;
+ }
+
+ // ********************************************
+ // Special case. Front Point and Back points
+ // are same.
+ // ********************************************
+ if( frontPoint == backPoint )
+ {
+ // Find middle angle of a data point
+ float midAngle = startAngleList[backPoint] + sweepAngleList[backPoint] / 2F;
+
+ int listIndx;
+ bool rightSidePoints = false;
+
+ // If big pie slice is on the right and all other
+ // pie slices are on the left.
+ if( midAngle > -90 && midAngle < 90 || midAngle > 270 && midAngle < 450 )
+ {
+ rightSidePoints = true;
+ }
+
+ listIndx = numOfPoints - frontPoint;
+ pointIndx = 0;
+ foreach( DataPoint point in series.Points )
+ {
+ // Do not process empty points
+ if( point.IsEmpty )
+ {
+ continue;
+ }
+
+ // If Front and back points continue with loop
+ if( pointIndx == frontPoint )
+ {
+ pointIndx++;
+ continue;
+ }
+
+ if( pointIndx < frontPoint )
+ {
+ if( points[listIndx] != null )
+ throw new InvalidOperationException(SR.ExceptionPiePointOrderInvalid);
+ points[listIndx] = point;
+ newStartAngleList[listIndx] = startAngleList[pointIndx];
+ newSweepAngleList[listIndx] = sweepAngleList[pointIndx];
+ newPointIndexList[listIndx] = pointIndexList[pointIndx];
+
+ listIndx++;
+ }
+ pointIndx++;
+ }
+
+ pointIndx = 0;
+ listIndx = 1;
+ foreach( DataPoint point in series.Points )
+ {
+ // Do not process empty points
+ if( point.IsEmpty )
+ {
+ continue;
+ }
+
+ // If Front and back points continue with loop
+ if( pointIndx == frontPoint )
+ {
+ pointIndx++;
+ continue;
+ }
+
+ if( pointIndx > frontPoint )
+ {
+ if( points[listIndx] != null )
+ throw new InvalidOperationException(SR.ExceptionPiePointOrderInvalid);
+ points[listIndx] = point;
+ newStartAngleList[listIndx] = startAngleList[pointIndx];
+ newSweepAngleList[listIndx] = sweepAngleList[pointIndx];
+ newPointIndexList[listIndx] = pointIndexList[pointIndx];
+ listIndx++;
+ }
+ pointIndx++;
+ }
+ if( rightSidePoints )
+ {
+ SwitchPoints( numOfPoints, ref points, ref newStartAngleList, ref newSweepAngleList, ref newPointIndexList, backPoint == frontPoint );
+ }
+ }
+ else if( frontPoint < backPoint )
+ {
+
+ // ************************************************
+ // Fill From Back Point to the end of unsorted list
+ // ************************************************
+ pointIndx = 0;
+ int listIndx = 1;
+ foreach( DataPoint point in series.Points )
+ {
+ // Do not process empty points
+ if( point.IsEmpty )
+ {
+ continue;
+ }
+
+ // If Front and back points continue with loop
+ if( pointIndx == frontPoint || pointIndx == backPoint )
+ {
+ pointIndx++;
+ continue;
+ }
+
+ // If curent point is after front point.
+ else if( pointIndx > backPoint )
+ {
+ if( points[listIndx] != null )
+ throw new InvalidOperationException(SR.ExceptionPiePointOrderInvalid);
+ points[listIndx] = point;
+ newStartAngleList[listIndx] = startAngleList[pointIndx];
+ newSweepAngleList[listIndx] = sweepAngleList[pointIndx];
+ newPointIndexList[listIndx] = pointIndexList[pointIndx];
+ listIndx++;
+ }
+
+ pointIndx++;
+ }
+
+ // ******************************************************
+ // Fill from the begining of unsorted list to Front Point
+ // ******************************************************
+ pointIndx = 0;
+ foreach( DataPoint point in series.Points )
+ {
+ // Do not process empty points
+ if( point.IsEmpty )
+ {
+ continue;
+ }
+
+ // If Front and back points continue with loop
+ if( pointIndx == frontPoint || pointIndx == backPoint )
+ {
+ pointIndx++;
+ continue;
+ }
+
+ // If curent point is before front point.
+ else if( pointIndx < frontPoint )
+ {
+ if( points[listIndx] != null )
+ throw new InvalidOperationException(SR.ExceptionPiePointOrderInvalid);
+ points[listIndx] = point;
+ newStartAngleList[listIndx] = startAngleList[pointIndx];
+ newSweepAngleList[listIndx] = sweepAngleList[pointIndx];
+ newPointIndexList[listIndx] = pointIndexList[pointIndx];
+ listIndx++;
+ }
+
+ pointIndx++;
+ }
+
+
+ // *********************************************************
+ // This code run only if special case is not active.
+ // Special case: FrontPoint and back point are same. This is
+ // happening because pie slice is bigger then 180 degree.
+ // *********************************************************
+
+
+ // **********************************
+ // Fill from Front Point to Back Point
+ // **********************************
+ listIndx = points.Length - 2;
+ pointIndx = 0;
+ foreach( DataPoint point in series.Points )
+ {
+ // Do not process empty points
+ if( point.IsEmpty )
+ {
+ continue;
+ }
+
+ // If Front and back points continue with loop
+ if( pointIndx == frontPoint || pointIndx == backPoint )
+ {
+ pointIndx++;
+ continue;
+ }
+
+ // If curent point is between front point and back point.
+ else if( pointIndx > frontPoint && pointIndx < backPoint )
+ {
+ if (points[listIndx] != null) throw new InvalidOperationException(SR.ExceptionPiePointOrderInvalid);
+ points[listIndx] = point;
+ newStartAngleList[listIndx] = startAngleList[pointIndx];
+ newSweepAngleList[listIndx] = sweepAngleList[pointIndx];
+ newPointIndexList[listIndx] = pointIndexList[pointIndx];
+ listIndx--;
+ }
+
+ pointIndx++;
+ }
+ }
+ else
+ {
+ // **********************************
+ // Fill from Back Point to Front Point
+ // **********************************
+ int listIndx = 1;
+ pointIndx = 0;
+ foreach( DataPoint point in series.Points )
+ {
+ // Do not process empty points
+ if( point.IsEmpty )
+ {
+ continue;
+ }
+
+ // If Front and back points continue with loop
+ if( pointIndx == frontPoint || pointIndx == backPoint )
+ {
+ pointIndx++;
+ continue;
+ }
+
+ // If curent point is between front back and front points.
+ else if( pointIndx > backPoint && pointIndx < frontPoint )
+ {
+ if (points[listIndx] != null) throw new InvalidOperationException(SR.ExceptionPiePointOrderInvalid);
+ points[listIndx] = point;
+ newStartAngleList[listIndx] = startAngleList[pointIndx];
+ newSweepAngleList[listIndx] = sweepAngleList[pointIndx];
+ newPointIndexList[listIndx] = pointIndexList[pointIndx];
+ listIndx++;
+ }
+
+ pointIndx++;
+ }
+
+ // ************************************************
+ // Fill From Front Point to the end of unsorted list
+ // ************************************************
+ listIndx = points.Length - 2;
+ pointIndx = 0;
+ foreach( DataPoint point in series.Points )
+ {
+ // Do not process empty points
+ if( point.IsEmpty )
+ {
+ continue;
+ }
+
+ // If Front and back points continue with loop
+ if( pointIndx == frontPoint || pointIndx == backPoint )
+ {
+ pointIndx++;
+ continue;
+ }
+ // If curent point is after front point.
+ else if( pointIndx > frontPoint )
+ {
+ if( points[listIndx] != null )
+ throw new InvalidOperationException(SR.ExceptionPiePointOrderInvalid);
+ points[listIndx] = point;
+ newStartAngleList[listIndx] = startAngleList[pointIndx];
+ newSweepAngleList[listIndx] = sweepAngleList[pointIndx];
+ newPointIndexList[listIndx] = pointIndexList[pointIndx];
+ listIndx--;
+ }
+
+ pointIndx++;
+ }
+
+ // ******************************************************
+ // Fill from the begining of unsorted list to Back Point
+ // ******************************************************
+ pointIndx = 0;
+ foreach( DataPoint point in series.Points )
+ {
+ // Do not process empty points
+ if( point.IsEmpty )
+ {
+ continue;
+ }
+
+ // If Front and back points continue with loop
+ if( pointIndx == frontPoint || pointIndx == backPoint )
+ {
+ pointIndx++;
+ continue;
+ }
+
+ // If curent point is before front point.
+ else if( pointIndx < backPoint )
+ {
+ if( points[listIndx] != null )
+ throw new InvalidOperationException(SR.ExceptionPiePointOrderInvalid);
+ points[listIndx] = point;
+ newStartAngleList[listIndx] = startAngleList[pointIndx];
+ newSweepAngleList[listIndx] = sweepAngleList[pointIndx];
+ newPointIndexList[listIndx] = pointIndexList[pointIndx];
+ listIndx--;
+ }
+
+ pointIndx++;
+ }
+
+
+ // *********************************************************
+ // This code run only if special case is not active.
+ // Special case: FrontPoint and back point are same. This is
+ // happening because pie slice is bigger then 180 degree.
+ // *********************************************************
+
+
+
+ }
+
+
+ // *******************************************************
+ // If X angle is positive direction of drawing data points
+ // should be opposite. This part of code switch order of
+ // data points.
+ // *******************************************************
+ if( area.Area3DStyle.Inclination > 0 )
+ {
+ SwitchPoints( numOfPoints, ref points, ref newStartAngleList, ref newSweepAngleList, ref newPointIndexList, backPoint == frontPoint );
+ }
+
+ return points;
+ }
+
+ /// <summary>
+ /// This method switches order of data points in the array of points.
+ /// </summary>
+ /// <param name="numOfPoints">Number of data points</param>
+ /// <param name="points">Array of Data points</param>
+ /// <param name="newStartAngleList">List of start angles which has to be switched together with data points</param>
+ /// <param name="newSweepAngleList">List of sweep angles which has to be switched together with data points</param>
+ /// <param name="newPointIndexList">Indexes (position) of data points in the series</param>
+ /// <param name="sameBackFront">There is big pie slice which has same back and front pie slice</param>
+ private void SwitchPoints( int numOfPoints, ref DataPoint [] points, ref float [] newStartAngleList, ref float [] newSweepAngleList, ref int [] newPointIndexList, bool sameBackFront )
+ {
+ float [] tempStartAngles = new float[ numOfPoints ];
+ float [] tempSweepAngles = new float[ numOfPoints ];
+ int [] tempPointIndexList = new int[ numOfPoints ];
+ DataPoint [] tempPoints = new DataPoint[ numOfPoints ];
+ int start = 0;;
+
+ // The big pie slice (special case) is always on the beginning.
+ if( sameBackFront )
+ {
+ start = 1;
+
+ // Switch order.
+ tempPoints[0] = points[0];
+ tempStartAngles[0] = newStartAngleList[0];
+ tempSweepAngles[0] = newSweepAngleList[0];
+ tempPointIndexList[0] = newPointIndexList[0];
+ }
+
+ for( int index = start; index < numOfPoints; index++ )
+ {
+ if( points[ index ] == null )
+ {
+ throw new InvalidOperationException(SR.ExceptionPieOrderOperationInvalid);
+ }
+
+ // Switch order.
+ tempPoints[ numOfPoints - index - 1 + start] = points[ index ];
+ tempStartAngles[ numOfPoints - index - 1 + start] = newStartAngleList[ index ];
+ tempSweepAngles[ numOfPoints - index - 1 + start] = newSweepAngleList[ index ];
+ tempPointIndexList[ numOfPoints - index - 1 + start] = newPointIndexList[ index ];
+
+ }
+
+ points = tempPoints;
+ newStartAngleList = tempStartAngles;
+ newSweepAngleList = tempSweepAngles;
+ newPointIndexList = tempPointIndexList;
+
+ }
+
+ #endregion
+
+ #region 3D Label column class
+
+ /// <summary>
+ /// LabelColumn class is used for labels manipulation - outside label style
+ /// </summary>
+ internal class LabelColumn
+ {
+ // Fields of Label Column class
+ private RectangleF _chartAreaPosition;
+ private RectangleF _innerPlotPosition;
+ internal float columnHeight;
+ internal int numOfItems = 0;
+ private int _numOfInsertedLabels = 0;
+ private DataPoint [] _points;
+ private float [] _yPositions;
+ private bool _rightPosition = true;
+ private float _labelLineSize;
+
+ /// <summary>
+ /// Constructor
+ /// </summary>
+ /// <param name="position">Chart Area position.</param>
+ public LabelColumn( RectangleF position )
+ {
+ _chartAreaPosition = position;
+ }
+
+ /// <summary>
+ /// Return index of label position in the column.
+ /// </summary>
+ /// <param name="y">y coordinate</param>
+ /// <returns>Index of column</returns>
+ internal int GetLabelIndex( float y )
+ {
+ // y coordinate is out of chart area.
+ if( y < _chartAreaPosition.Y )
+ {
+ y = _chartAreaPosition.Y;
+ }
+ else if( y > _chartAreaPosition.Bottom )
+ {
+ y = _chartAreaPosition.Bottom - columnHeight;
+ }
+
+ return (int) (( y - _chartAreaPosition.Y ) / columnHeight ) ;
+ }
+
+ /// <summary>
+ /// This method sorts labels by y Position
+ /// </summary>
+ internal void Sort()
+ {
+ for( int indexA = 0; indexA < _points.Length; indexA++ )
+ {
+ for( int indexB = 0; indexB < indexA; indexB++ )
+ {
+ if( _yPositions[indexA] < _yPositions[indexB] && _points[indexA] != null && _points[indexB] != null )
+ {
+ float tempYPos;
+ DataPoint tempPoint;
+ tempYPos = _yPositions[indexA];
+ tempPoint = _points[indexA];
+ _yPositions[indexA] = _yPositions[indexB];
+ _points[indexA] = _points[indexB];
+ _yPositions[indexB] = tempYPos;
+ _points[indexB] = tempPoint;
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Returns label position y coordinate from index position
+ /// </summary>
+ /// <param name="index">Index position of the row</param>
+ /// <returns>Y coordinate row position</returns>
+ internal float GetLabelPosition( int index )
+ {
+ if( index < 0 || index > numOfItems - 1 )
+ throw new InvalidOperationException(SR.Exception3DPieLabelsIndexInvalid);
+
+ return (float) _chartAreaPosition.Y + columnHeight * index + columnHeight / 2;
+ }
+
+ /// <summary>
+ /// This method finds X and Y position for outside
+ /// labels. There is discrete number of cells and
+ /// Y position depends on cell position. X position
+ /// is connected with angle between invisible
+ /// line (which connects center of a pie and label)
+ /// and any horizontal line.
+ /// </summary>
+ /// <param name="dataPoint">Data Point</param>
+ /// <returns>Position of a label</returns>
+ internal PointF GetLabelPosition( DataPoint dataPoint )
+ {
+ PointF position = PointF.Empty;
+ int pointIndex = 0;
+
+ // Find Y position of Data Point
+ // Loop is necessary to find index of data point in the array list.
+ foreach( DataPoint point in _points )
+ {
+ if( point == dataPoint )
+ {
+ position.Y = GetLabelPosition( pointIndex );
+ break;
+ }
+ pointIndex++;
+ }
+
+ // Find initial X position for labels ( All labels are aligne ).
+ if( _rightPosition )
+ {
+ position.X = _innerPlotPosition.Right + _chartAreaPosition.Width * this._labelLineSize;
+ }
+ else
+ {
+ position.X = _innerPlotPosition.Left - _chartAreaPosition.Width * this._labelLineSize;
+ }
+
+ // Find angle between invisible line (which connects center of a pie and label)
+ // and any horizontal line.
+ float angle;
+ angle = (float)Math.Atan( ( position.Y - _innerPlotPosition.Top - _innerPlotPosition.Height / 2) / ( position.X - _innerPlotPosition.Left - _innerPlotPosition.Width / 2 ));
+
+ // Make Angle correction for X Position
+ float correct;
+ if( Math.Cos( angle ) == 0 )
+ {
+ correct = 0;
+ }
+ else
+ {
+ correct = (float)(_innerPlotPosition.Width * 0.4 - _innerPlotPosition.Width * 0.4 / Math.Cos( angle ));
+ }
+
+ // Set Corrected X Position
+ if( _rightPosition )
+ {
+ position.X += correct;
+ }
+ else
+ {
+ position.X -= correct;
+ }
+
+ return position;
+ }
+
+ /// <summary>
+ /// This method inserts outside labels in Column label list. Column label
+ /// list has defined number of cells. This method has to put labels on
+ /// the best position in the list. If two labels according to their
+ /// positions belong to same cell of the list, this method should
+ /// assign to them different positions.
+ /// </summary>
+ /// <param name="point">Data Point which label has to be inserted</param>
+ /// <param name="yCoordinate">Y coordinate which is the best position for this label</param>
+ /// <param name="pointIndx">Point index of this data point in the series</param>
+ internal void InsertLabel( DataPoint point, float yCoordinate, int pointIndx )
+ {
+
+ // Find index of label list by Y value
+ int indexYValue = GetLabelIndex( yCoordinate );
+
+ // This position is already used.
+ if( _points[indexYValue] != null )
+ {
+ // All even elements go up and other
+ // Down (If there are many labels which use this position).
+ if( pointIndx % 2 == 0 )
+ {
+ // Check if there is space Down
+ if( CheckFreeSpace( indexYValue, false ) )
+ {
+ // Move labels Down
+ MoveLabels( indexYValue, false );
+ }
+ else
+ {
+ // Move labels Up
+ MoveLabels( indexYValue, true );
+ }
+ }
+ else
+ {
+ // Check if there is space Up
+ if( CheckFreeSpace( indexYValue, true ) )
+ {
+ // Move labels Up
+ MoveLabels( indexYValue, true );
+ }
+ else
+ {
+ // Move labels Down
+ MoveLabels( indexYValue, false );
+ }
+ }
+ }
+
+ // Set label position
+ _points[indexYValue] = point;
+ _yPositions[indexYValue] = yCoordinate;
+ _numOfInsertedLabels++;
+ }
+
+ /// <summary>
+ /// This method is used for inserting labels. When label is inserted
+ /// and that position was previously used, labels have to be
+ /// moved on proper way.
+ /// </summary>
+ /// <param name="position">Position which has to be free</param>
+ /// <param name="upDirection">Direction for moving labels</param>
+ private void MoveLabels( int position, bool upDirection )
+ {
+ if( upDirection )
+ {
+ DataPoint point = _points[position];
+ float yValue = _yPositions[position];
+ _points[position] = null;
+ _yPositions[position] = 0;
+
+ for( int index = position; index > 0; index-- )
+ {
+ // IsEmpty position found. Stop moving cells UP
+ if( _points[index-1] == null )
+ {
+ _points[index-1] = point;
+ _yPositions[index-1] = yValue;
+ break;
+ }
+ else
+ {
+ DataPoint tempPoint;
+ float tempYValue;
+
+ tempPoint = _points[index-1];
+ tempYValue = _yPositions[index-1];
+ _points[index-1] = point;
+ _yPositions[index-1] = yValue;
+ point = tempPoint;
+ yValue = tempYValue;
+ }
+ }
+ }
+ else
+ {
+ DataPoint point = _points[position];
+ float yValue = _yPositions[position];
+ _points[position] = null;
+ _yPositions[position] = 0;
+
+ for( int index = position; index < numOfItems-1; index++ )
+ {
+ // IsEmpty position found. Stop moving cells UP
+ if( _points[index+1] == null )
+ {
+ _points[index+1] = point;
+ _yPositions[index+1] = yValue;
+ break;
+ }
+ else
+ {
+ DataPoint tempPoint;
+ float tempYValue;
+
+ tempPoint = _points[index+1];
+ tempYValue = _yPositions[index+1];
+ _points[index+1] = point;
+ _yPositions[index+1] = yValue;
+ point = tempPoint;
+ yValue = tempYValue;
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// This method is used to center labels in
+ /// the middle of chart area (vertically).
+ /// </summary>
+ internal void AdjustPositions()
+ {
+ int numEmptyUp = 0;
+ int numEmptyDown = 0;
+
+ // Adjust position only if there are many labels
+ if( _numOfInsertedLabels < _points.Length / 2 )
+ return;
+
+ // Find the number of empty label positions on the top.
+ for( int point = 0; point < _points.Length && _points[point] == null; point++ )
+ {
+ numEmptyUp++;
+ }
+
+ // Find the number of empty label positions on the bottom.
+ for( int point = _points.Length - 1; point >= 0 && _points[point] == null; point-- )
+ {
+ numEmptyDown++;
+ }
+
+ // Find where are more empty spaces – on the top or on the bottom.
+ bool moreEmptyUp = numEmptyUp > numEmptyDown ? true : false;
+
+ // Find average number of empty spaces for top and bottom.
+ int numMove = ( numEmptyUp + numEmptyDown ) / 2;
+
+ // If difference between empty spaces on the top and
+ // the bottom is not bigger then 2 do not adjust labels.
+ if( Math.Abs( numEmptyUp - numEmptyDown ) < 2 )
+ return;
+
+ if( moreEmptyUp )
+ {
+ // Move labels UP
+ int indexPoint = 0;
+ for( int point = numMove; point < _points.Length; point++ )
+ {
+ if(numEmptyUp+indexPoint > _points.Length - 1)
+ break;
+
+ _points[point] = _points[numEmptyUp+indexPoint];
+ _points[numEmptyUp+indexPoint] = null;
+ indexPoint++;
+ }
+ }
+ else
+ {
+ // Move labels DOWN
+ int indexPoint = _points.Length - 1;
+ for( int point = _points.Length - 1 - numMove; point >= 0; point-- )
+ {
+ if(indexPoint - numEmptyDown < 0)
+ break;
+
+ _points[point] = _points[indexPoint - numEmptyDown];
+ _points[indexPoint - numEmptyDown] = null;
+ indexPoint--;
+ }
+ }
+ }
+
+
+ /// <summary>
+ /// Check if there is empty cell Labels column in
+ /// specified direction from specified position
+ /// </summary>
+ /// <param name="position">Start Position for testing</param>
+ /// <param name="upDirection">True if direction is upward, false if downward</param>
+ /// <returns>True if there is empty cell</returns>
+ private bool CheckFreeSpace( int position, bool upDirection )
+ {
+ if( upDirection )
+ {
+ // Position is on the beginning. There is no empty space.
+ if( position == 0 )
+ {
+ return false;
+ }
+
+ for( int index = position - 1; index >= 0; index-- )
+ {
+ // There is empty space
+ if( _points[index] == null )
+ {
+ return true;
+ }
+ }
+ }
+ else
+ {
+ // Position is on the end. There is no empty space.
+ if( position == numOfItems - 1 )
+ {
+ return false;
+ }
+
+ for( int index = position + 1; index < numOfItems; index++ )
+ {
+ // There is empty space
+ if( _points[index] == null )
+ {
+ return true;
+ }
+ }
+ }
+
+ // There is no empty space
+ return false;
+ }
+
+
+ /// <summary>
+ /// This method initialize label column.
+ /// </summary>
+ /// <param name="rectangle">Rectangle used for labels</param>
+ /// <param name="rightPosition">True if labels are on the right side of chart area.</param>
+ /// <param name="maxNumOfRows">Maximum nuber of rows.</param>
+ /// <param name="labelLineSize">Value for label line size from custom attribute.</param>
+ internal void Initialize( RectangleF rectangle, bool rightPosition, int maxNumOfRows, float labelLineSize )
+ {
+
+ // Minimum number of rows.
+ numOfItems = Math.Max( numOfItems, maxNumOfRows );
+
+ // Find height of rows
+ columnHeight = _chartAreaPosition.Height / numOfItems;
+
+ // Set inner plot position
+ _innerPlotPosition = rectangle;
+
+ // Init data column
+ _points = new DataPoint[numOfItems];
+
+ // Init y position column
+ _yPositions = new float[numOfItems];
+
+ // Label column position
+ this._rightPosition = rightPosition;
+
+ // 3D Label line size
+ this._labelLineSize = labelLineSize;
+
+ }
+
+ }
+
+ #endregion // 3D Label column class
+
+ #region 3D Labels
+
+ /// <summary>
+ /// This method calculates initial pie size if outside 3D labels is active.
+ /// </summary>
+ /// <param name="graph">Chart Graphics object.</param>
+ /// <param name="area">Chart Area.</param>
+ /// <param name="pieRectangle">Rectangle which is used for drawing pie.</param>
+ /// <param name="pieWidth">Width of pie slice.</param>
+ /// <param name="dataPoints">List of data points.</param>
+ /// <param name="startAngleList">List of start angles.</param>
+ /// <param name="sweepAngleList">List of sweep angles.</param>
+ /// <param name="series">Data series used for drawing pie chart.</param>
+ /// <param name="labelLineSize">Custom Attribute for label line size.</param>
+ private void InitPieSize(
+ ChartGraphics graph,
+ ChartArea area,
+ ref RectangleF pieRectangle,
+ ref float pieWidth,
+ DataPoint [] dataPoints,
+ float [] startAngleList,
+ float [] sweepAngleList,
+ Series series,
+ float labelLineSize
+ )
+ {
+ labelColumnLeft = new LabelColumn(area.Position.ToRectangleF());
+ labelColumnRight = new LabelColumn(area.Position.ToRectangleF());
+ float maxSize = float.MinValue;
+ float maxSizeVertical = float.MinValue;
+
+ int pointIndx = 0;
+ // Loop which finds max label size and number of label rows.
+ foreach( DataPoint point in dataPoints )
+ {
+ // Do not process empty points
+ if( point.IsEmpty )
+ {
+ continue;
+ }
+
+ float midAngle = startAngleList[pointIndx] + sweepAngleList[pointIndx] / 2F;
+
+ if( midAngle >= -90 && midAngle < 90 || midAngle >= 270 && midAngle < 450 )
+ {
+ labelColumnRight.numOfItems++;
+ }
+ else
+ {
+ labelColumnLeft.numOfItems++;
+ }
+
+ // Find size of the maximum label string.
+ SizeF size = graph.MeasureStringRel( GetLabelText( point ).Replace("\\n", "\n"), point.Font );
+
+ maxSize = Math.Max( size.Width, maxSize );
+ maxSizeVertical = Math.Max( size.Height, maxSizeVertical );
+
+ pointIndx++;
+ }
+
+ float oldWidth = pieRectangle.Width;
+ float oldHeight = pieRectangle.Height;
+
+ // Find size of inner plot are
+ pieRectangle.Width = pieRectangle.Width - 2F * maxSize - 2 * pieRectangle.Width * labelLineSize;
+
+ pieRectangle.Height = pieRectangle.Height - pieRectangle.Height * 0.3F;
+
+ // Size of pie chart can not be less then MinimumRelativePieSize of chart area.
+ if( pieRectangle.Width < oldWidth * (float)this.MinimumRelativePieSize( area ) )
+ {
+ pieRectangle.Width = oldWidth * (float)this.MinimumRelativePieSize( area );
+ }
+
+ // Size of pie chart can not be less then MinimumRelativePieSize of chart area.
+ if( pieRectangle.Height < oldHeight * (float)this.MinimumRelativePieSize( area ) )
+ {
+ pieRectangle.Height = oldHeight * (float)this.MinimumRelativePieSize( area );
+ }
+
+ // Size has to be reduce always because of label lines.
+ if( oldWidth * 0.8F < pieRectangle.Width )
+ {
+ pieRectangle.Width *= 0.8F;
+ }
+
+ pieRectangle.X = pieRectangle.X + ( oldWidth - pieRectangle.Width ) / 2F;
+ pieWidth = pieRectangle.Width / oldWidth * pieWidth;
+
+ pieRectangle.Y = pieRectangle.Y + ( oldHeight - pieRectangle.Height ) / 2F;
+
+ // Find maximum number of rows. Number of rows will be changed
+ // but this is only recommendation, which depends on font size
+ // and Height of chart area.
+ SizeF fontSize = new SizeF(1.4F * series.Font.Size,1.4F * series.Font.Size);
+ fontSize = graph.GetRelativeSize( fontSize );
+ int maxNumOfRows = (int)( pieRectangle.Height / maxSizeVertical/*fontSize.Height*/ );
+
+ // Initialize label column
+ labelColumnRight.Initialize( pieRectangle, true, maxNumOfRows, labelLineSize );
+ labelColumnLeft.Initialize( pieRectangle, false, maxNumOfRows, labelLineSize );
+
+ }
+
+ /// <summary>
+ /// This method inserts outside 3D labels into array of Label column class.
+ /// </summary>
+ /// <param name="graph">Chart Graphics object.</param>
+ /// <param name="area">Chart Area.</param>
+ /// <param name="pieRectangle">Rectangle used for drawing pie slices.</param>
+ /// <param name="pieWidth">Width of a pie slice.</param>
+ /// <param name="point">Data Point.</param>
+ /// <param name="startAngle">Start angle of a pie slice.</param>
+ /// <param name="sweepAngle">Sweep angle of a pie slice.</param>
+ /// <param name="pointIndx">Data point index.</param>
+ /// <param name="doughnutRadius">Inner Radius of the doughnut.</param>
+ /// <param name="exploded">true if pie slice is exploded.</param>
+ private void FillPieLabelOutside(
+ ChartGraphics graph,
+ ChartArea area,
+ RectangleF pieRectangle,
+ float pieWidth,
+ DataPoint point,
+ float startAngle,
+ float sweepAngle,
+ int pointIndx,
+ float doughnutRadius,
+ bool exploded
+ )
+ {
+ float midAngle = startAngle + sweepAngle / 2F;
+
+ PointF [] piePoints = GetPiePoints( graph, area, pieWidth, pieRectangle, startAngle, sweepAngle, false, doughnutRadius, exploded );
+
+ float y = piePoints[(int)PiePoints.TopLabelLineout].Y;
+ if( midAngle >= -90 && midAngle < 90 || midAngle >= 270 && midAngle < 450 )
+ {
+ labelColumnRight.InsertLabel( point, y, pointIndx );
+ }
+ else
+ {
+ labelColumnLeft.InsertLabel( point, y, pointIndx );
+ }
+ }
+
+ /// <summary>
+ /// This method draws outside labels with lines, which
+ /// connect labels with pie slices.
+ /// </summary>
+ /// <param name="graph">Chart Graphics object</param>
+ /// <param name="area">Chart Area</param>
+ /// <param name="pen">Pen object</param>
+ /// <param name="points">Important pie points</param>
+ /// <param name="point">Data point</param>
+ /// <param name="midAngle">Middle Angle for pie slice</param>
+ /// <param name="pointIndex">Point Index.</param>
+ private void Draw3DOutsideLabels(
+ ChartGraphics graph,
+ ChartArea area,
+ Pen pen,
+ PointF [] points,
+ DataPoint point,
+ float midAngle,
+ int pointIndex)
+ {
+ // Take label text
+ string text = GetLabelText( point );
+ if(text.Length == 0)
+ {
+ return;
+ }
+
+ graph.DrawLine( pen, points[(int)PiePoints.TopLabelLine], points[(int)PiePoints.TopLabelLineout] );
+ LabelColumn columnLabel;
+
+ using (StringFormat format = new StringFormat())
+ {
+ format.LineAlignment = StringAlignment.Center;
+
+ RectangleF chartAreaPosition = graph.GetAbsoluteRectangle(area.Position.ToRectangleF());
+ RectangleF labelPosition = RectangleF.Empty;
+
+ PointF labelPoint;
+
+ if (midAngle >= -90 && midAngle < 90 || midAngle >= 270 && midAngle < 450)
+ {
+ columnLabel = labelColumnRight;
+ format.Alignment = StringAlignment.Near;
+
+ float labelVertSize = graph.GetAbsoluteSize(new SizeF(0f, this.labelColumnRight.columnHeight)).Height;
+ labelPoint = graph.GetAbsolutePoint(columnLabel.GetLabelPosition(point));
+
+ // Label has to be right from TopLabelLineOut
+ if (points[(int)PiePoints.TopLabelLineout].X > labelPoint.X)
+ {
+ labelPoint.X = points[(int)PiePoints.TopLabelLineout].X + 10;
+ }
+
+ labelPosition.X = labelPoint.X;
+ labelPosition.Width = chartAreaPosition.Right - labelPosition.X;
+ labelPosition.Y = labelPoint.Y - labelVertSize / 2;
+ labelPosition.Height = labelVertSize;
+
+ }
+ else
+ {
+ columnLabel = labelColumnLeft;
+ format.Alignment = StringAlignment.Far;
+
+ float labelVertSize = graph.GetAbsoluteSize(new SizeF(0f, this.labelColumnLeft.columnHeight)).Height;
+ labelPoint = graph.GetAbsolutePoint(columnLabel.GetLabelPosition(point));
+
+ // Label has to be left from TopLabelLineOut
+ if (points[(int)PiePoints.TopLabelLineout].X < labelPoint.X)
+ {
+ labelPoint.X = points[(int)PiePoints.TopLabelLineout].X - 10;
+ }
+
+ labelPosition.X = chartAreaPosition.X;
+ labelPosition.Width = labelPoint.X - labelPosition.X;
+ labelPosition.Y = labelPoint.Y - labelVertSize / 2;
+ labelPosition.Height = labelVertSize;
+ }
+ format.FormatFlags = StringFormatFlags.NoWrap | StringFormatFlags.LineLimit;
+ format.Trimming = StringTrimming.EllipsisWord;
+
+ graph.DrawLine(pen, points[(int)PiePoints.TopLabelLineout], labelPoint);
+
+ // Get label relative position
+ labelPosition = graph.GetRelativeRectangle(labelPosition);
+
+ // Get label background position
+ SizeF valueTextSize = graph.MeasureStringRel(text.Replace("\\n", "\n"), point.Font);
+ valueTextSize.Height += valueTextSize.Height / 8;
+ float spacing = valueTextSize.Width / text.Length / 2;
+ valueTextSize.Width += spacing;
+ RectangleF labelBackPosition = new RectangleF(
+ labelPosition.X,
+ labelPosition.Y + labelPosition.Height / 2f - valueTextSize.Height / 2f,
+ valueTextSize.Width,
+ valueTextSize.Height);
+
+ // Adjust position based on alignment
+ if (format.Alignment == StringAlignment.Near)
+ {
+ labelBackPosition.X -= spacing / 2f;
+ }
+ else if (format.Alignment == StringAlignment.Center)
+ {
+ labelBackPosition.X = labelPosition.X + (labelPosition.Width - valueTextSize.Width) / 2f;
+ }
+ else if (format.Alignment == StringAlignment.Far)
+ {
+ labelBackPosition.X = labelPosition.Right - valueTextSize.Width - spacing / 2f;
+ }
+
+ // Draw label text
+ using (Brush brush = new SolidBrush(point.LabelForeColor))
+ {
+ graph.DrawPointLabelStringRel(
+ graph.Common,
+ text,
+ point.Font,
+ brush,
+ labelPosition,
+ format,
+ 0,
+ labelBackPosition,
+ point.LabelBackColor,
+ point.LabelBorderColor,
+ point.LabelBorderWidth,
+ point.LabelBorderDashStyle,
+ point.series,
+ point,
+ pointIndex);
+ }
+ }
+ }
+
+ /// <summary>
+ /// This method draws inside labels.
+ /// </summary>
+ /// <param name="graph">Chart Graphics object</param>
+ /// <param name="points">Important pie points</param>
+ /// <param name="point">Data point</param>
+ /// <param name="pointIndex">Data point index</param>
+ private void Draw3DInsideLabels( ChartGraphics graph, PointF [] points, DataPoint point, int pointIndex )
+ {
+ // Set String Alignment
+ StringFormat format = new StringFormat();
+ format.LineAlignment = StringAlignment.Center;
+ format.Alignment = StringAlignment.Center;
+
+ // Take label text
+ string text = GetLabelText( point );
+
+ // Get label relative position
+ PointF labelPosition = graph.GetRelativePoint(points[(int)PiePoints.TopLabelCenter]);
+
+ // Measure string
+ SizeF sizeFont = graph.GetRelativeSize(
+ graph.MeasureString(
+ text.Replace("\\n", "\n"),
+ point.Font,
+ new SizeF(1000f, 1000f),
+ new StringFormat(StringFormat.GenericTypographic)));
+
+ // Get label background position
+ RectangleF labelBackPosition = RectangleF.Empty;
+ SizeF sizeLabel = new SizeF(sizeFont.Width, sizeFont.Height);
+ sizeLabel.Height += sizeFont.Height / 8;
+ sizeLabel.Width += sizeLabel.Width / text.Length;
+ labelBackPosition = new RectangleF(
+ labelPosition.X - sizeLabel.Width/2,
+ labelPosition.Y - sizeLabel.Height/2 - sizeFont.Height / 10,
+ sizeLabel.Width,
+ sizeLabel.Height);
+
+ // Draw label text
+ using (Brush brush = new SolidBrush(point.LabelForeColor))
+ {
+ graph.DrawPointLabelStringRel(
+ graph.Common,
+ text,
+ point.Font,
+ brush,
+ labelPosition,
+ format,
+ 0,
+ labelBackPosition,
+ point.LabelBackColor,
+ point.LabelBorderColor,
+ point.LabelBorderWidth,
+ point.LabelBorderDashStyle,
+ point.series,
+ point,
+ pointIndex);
+ }
+ }
+
+ /// <summary>
+ /// Gets the point label.
+ /// </summary>
+ /// <param name="point">The point.</param>
+ /// <returns></returns>
+ private String GetPointLabel(DataPoint point)
+ {
+ String pointLabel = String.Empty;
+
+ // If There is no Label take axis Label
+ if( point.Label.Length == 0 )
+ {
+ pointLabel = point.AxisLabel;
+ // remove axis label if is set the CustomPropertyName.PieAutoAxisLabels and is set to false
+ if (point.series != null &&
+ point.series.IsCustomPropertySet(CustomPropertyName.PieAutoAxisLabels) &&
+ String.Equals(point.series.GetCustomProperty(CustomPropertyName.PieAutoAxisLabels), "false", StringComparison.OrdinalIgnoreCase))
+ {
+ pointLabel = String.Empty;
+ }
+ }
+ else
+ pointLabel = point.Label;
+
+ return point.ReplaceKeywords(pointLabel);
+ }
+
+ /// <summary>
+ /// Take formated text from label or axis label
+ /// </summary>
+ /// <param name="point">Data point which is used.</param>
+ /// <returns>Formated text</returns>
+ private string GetLabelText( DataPoint point )
+ {
+ string pointLabel = this.GetPointLabel(point);
+ // Get label text
+ string text;
+ if( point.Label.Length == 0 && point.IsValueShownAsLabel )
+ {
+ text = ValueConverter.FormatValue(
+ point.series.Chart,
+ point,
+ point.Tag,
+ point.YValues[0],
+ point.LabelFormat,
+ point.series.YValueType,
+ ChartElementType.DataPoint);
+ }
+ else
+ {
+ text = pointLabel;
+ }
+
+ // Retuen formated label or axis label text
+ return text;
+ }
+
+
+ #endregion
+
+ #region SmartLabelStyle methods
+
+ /// <summary>
+ /// Adds markers position to the list. Used to check SmartLabelStyle overlapping.
+ /// </summary>
+ /// <param name="common">Common chart elements.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="series">Series values to be used.</param>
+ /// <param name="list">List to add to.</param>
+ public void AddSmartLabelMarkerPositions(CommonElements common, ChartArea area, Series series, ArrayList list)
+ {
+ }
+
+ #endregion
+
+ #region IDisposable interface implementation
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected virtual void Dispose(bool disposing)
+ {
+ //Nothing to dispose at the base class.
+ }
+
+ /// <summary>
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// </summary>
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+ #endregion
+ }
+}
+
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/PointAndFigureChart.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/PointAndFigureChart.cs
new file mode 100644
index 00000000000..751db755255
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/PointAndFigureChart.cs
@@ -0,0 +1,913 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: PointAndFigureChart.cs
+//
+// Namespace: DataVisualization.Charting.ChartTypes
+//
+// Classes: PointAndFigureChart
+//
+// Purpose: Point and Figure chart type do not plot series data
+// point directly as most of the other chart types.
+// Instead it uses different calculation to create a
+// new RangeColumn type series based on its data in
+// the PrepareData method. All the changes in this
+// method are reversed back in the UnPrepareData
+// method. RangeColumn chart type is extended to
+// display a column of Os or Xs.
+//
+// Point and Figure Charts Overview:
+// ---------------------------------
+//
+// Point and Figure charts differ from traditional price charts in
+// that they completely disregard the passage of time, and only
+// display changes in prices. Rather than having price on the y-axis,
+// and time on the x-axis, Point and Figure charts display price
+// changes on both axes. This is similar to the Kagi, Renko, and
+// Three Line Break charts.
+//
+// The Point and Figure chart displays the underlying supply and
+// demand as reflected in the price values. A column of Xs shows
+// that demand is exceeding supply, which is known as a rally,
+// a column of Os shows that supply is exceeding demand, which is
+// known as a decline, and a series of short columns shows that
+// supply and demand are relatively equal, which of course,
+// represents a market equilibrium.
+//
+// The following should be taken into account when working with
+// this type of chart:
+//
+// - The X values of data points are automatically indexed. For
+// more information see the topic on Indexing Data Point X Values.
+//
+// - There is a formula applied to the original data before it gets
+// plotted. This formula changes the number of points, as well as
+// their X/Y values.
+//
+// - Due to the data being recalculated, we do not recommend setting
+// the minimum, or maximum values for the X axis. This is because it
+// cannot be determined how many data points will actually be plotted.
+// However, if the axis' Maximum, or Minimum is set, then the Maximum,
+// and Minimum properties will use data point index values.
+//
+// - Data point anchoring, used for annotations, is not supported
+// with this type of chart.
+//
+// Reviewed: AG - Microsoft 6, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Resources;
+using System.Reflection;
+using System.Collections;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.ComponentModel.Design;
+using System.Globalization;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+#else
+using System.Web.UI.DataVisualization.Charting;
+
+using System.Web.UI.DataVisualization.Charting.ChartTypes;
+using System.Web.UI.DataVisualization.Charting.Data;
+using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.ChartTypes
+#else
+namespace System.Web.UI.DataVisualization.Charting.ChartTypes
+#endif
+{
+ /// <summary>
+ /// PointAndFigureChart class contains all the code necessary for calculation
+ /// and drawing Point and Figure chart.
+ /// </summary>
+ internal class PointAndFigureChart : RangeColumnChart
+ {
+ #region Fields
+
+ /// <summary>
+ /// Indicates that class subscribed fro the customize event.
+ /// </summary>
+ static private bool _customizeSubscribed = false;
+
+ #endregion // Fields
+
+ #region Methods
+
+ /// <summary>
+ /// Prepares PointAndFigure chart type for rendering. We hide original series
+ /// during rendering and only using the data for calculations. New RangeColumn
+ /// type series is added wich displayes the columns of Os or Xs.
+ /// All the changes in this method are reversed back in the UnPrepareData method.
+ /// </summary>
+ /// <param name="series">Series to be prepared.</param>
+ internal static void PrepareData(Series series)
+ {
+ // Check series chart type
+ if(String.Compare( series.ChartTypeName, ChartTypeNames.PointAndFigure, StringComparison.OrdinalIgnoreCase ) != 0 || !series.IsVisible())
+ {
+ return;
+ }
+
+ // Get reference to the chart control
+ Chart chart = series.Chart;
+ if(chart == null)
+ {
+ throw (new InvalidOperationException(SR.ExceptionPointAndFigureNullReference));
+ }
+
+ // PointAndFigure chart may not be combined with any other chart types
+ ChartArea area = chart.ChartAreas[series.ChartArea];
+ foreach (Series currentSeries in chart.Series)
+ {
+ if (currentSeries.IsVisible() && currentSeries != series && area == chart.ChartAreas[currentSeries.ChartArea])
+ {
+ throw (new InvalidOperationException(SR.ExceptionPointAndFigureCanNotCombine));
+ }
+ }
+
+ // Subscribe for customize event
+ if(!_customizeSubscribed)
+ {
+ _customizeSubscribed = true;
+ chart.Customize += new EventHandler(OnCustomize);
+ }
+
+ // Create a temp series which will hold original series data points
+ string tempSeriesName = "POINTANDFIGURE_ORIGINAL_DATA_" + series.Name;
+ if (chart.Series.IndexOf(tempSeriesName) != -1)
+ {
+ return; // the temp series has already been added
+ }
+ Series seriesOriginalData = new Series(tempSeriesName, series.YValuesPerPoint);
+ seriesOriginalData.Enabled = false;
+ seriesOriginalData.IsVisibleInLegend = false;
+ seriesOriginalData.YValuesPerPoint = series.YValuesPerPoint;
+ chart.Series.Add(seriesOriginalData);
+ foreach(DataPoint dp in series.Points)
+ {
+ seriesOriginalData.Points.Add(dp);
+ }
+ series.Points.Clear();
+ if(series.IsCustomPropertySet("TempDesignData"))
+ {
+ seriesOriginalData["TempDesignData"] = "true";
+ }
+
+
+ // Remember prev. series parameters
+ series["OldXValueIndexed"] = series.IsXValueIndexed.ToString(CultureInfo.InvariantCulture);
+ series["OldYValuesPerPoint"] = series.YValuesPerPoint.ToString(CultureInfo.InvariantCulture);
+ series.IsXValueIndexed = true;
+
+ // Calculate date-time interval for indexed series
+ if(series.ChartArea.Length > 0 &&
+ series.IsXValueDateTime())
+ {
+ // Get X axis connected to the series
+ Axis xAxis = area.GetAxis(AxisName.X, series.XAxisType, series.XSubAxisName);
+
+ // Change interval for auto-calculated interval only
+ if(xAxis.Interval == 0 && xAxis.IntervalType == DateTimeIntervalType.Auto)
+ {
+ // Check if original data has X values set to date-time values and
+ // calculate min/max X values.
+ bool nonZeroXValues = false;
+ double minX = double.MaxValue;
+ double maxX = double.MinValue;
+ foreach(DataPoint dp in seriesOriginalData.Points)
+ {
+ if(!dp.IsEmpty)
+ {
+ if(dp.XValue != 0.0)
+ {
+ nonZeroXValues = true;
+ }
+ if(dp.XValue > maxX)
+ {
+ maxX = dp.XValue;
+ }
+ if(dp.XValue < minX)
+ {
+ minX = dp.XValue;
+ }
+ }
+ }
+
+ if(nonZeroXValues)
+ {
+ // Save flag that axis interval is automatic
+ series["OldAutomaticXAxisInterval"] = "true";
+
+ // Calculate and set axis date-time interval
+ DateTimeIntervalType intervalType = DateTimeIntervalType.Auto;
+ xAxis.interval = xAxis.CalcInterval(minX, maxX, true, out intervalType, series.XValueType);
+ xAxis.intervalType = intervalType;
+ }
+ }
+ }
+
+ // Calculate PointAndFigure bricks data points values
+ FillPointAndFigureData(series, seriesOriginalData);
+ }
+
+ /// <summary>
+ /// Remove any changes done while preparing PointAndFigure chart type for rendering.
+ /// </summary>
+ /// <param name="series">Series to be un-prepared.</param>
+ /// <returns>True if series was removed from collection.</returns>
+ internal static bool UnPrepareData(Series series)
+ {
+ if(series.Name.StartsWith("POINTANDFIGURE_ORIGINAL_DATA_", StringComparison.Ordinal))
+ {
+ // Get reference to the chart control
+ Chart chart = series.Chart;
+ if(chart == null)
+ {
+ throw (new InvalidOperationException(SR.ExceptionPointAndFigureNullReference));
+ }
+
+ // Unsubscribe for customize event
+ if(_customizeSubscribed)
+ {
+ _customizeSubscribed = false;
+ chart.Customize -= new EventHandler(OnCustomize);
+ }
+
+ // Get original PointAndFigure series
+ Series pointAndFigureSeries = chart.Series[series.Name.Substring(29)];
+ Series.MovePositionMarkers(pointAndFigureSeries, series);
+
+ // Copy data back to original PointAndFigure series
+ pointAndFigureSeries.Points.Clear();
+ if(!series.IsCustomPropertySet("TempDesignData"))
+ {
+ foreach(DataPoint dp in series.Points)
+ {
+ pointAndFigureSeries.Points.Add(dp);
+ }
+ }
+
+ // Restore series properties
+ bool xValIndexed;
+ bool parseSucceed = bool.TryParse(pointAndFigureSeries["OldXValueIndexed"], out xValIndexed);
+
+ pointAndFigureSeries.IsXValueIndexed = parseSucceed && xValIndexed;
+
+ int yVals;
+ parseSucceed = int.TryParse(pointAndFigureSeries["OldYValuesPerPoint"], NumberStyles.Any, CultureInfo.InvariantCulture, out yVals);
+
+ if (parseSucceed)
+ {
+ pointAndFigureSeries.YValuesPerPoint = yVals;
+ }
+
+ pointAndFigureSeries.DeleteCustomProperty("OldXValueIndexed");
+ pointAndFigureSeries.DeleteCustomProperty("OldYValuesPerPoint");
+ pointAndFigureSeries.DeleteCustomProperty(CustomPropertyName.EmptyPointValue);
+
+ series["OldAutomaticXAxisInterval"] = "true";
+ if(pointAndFigureSeries.IsCustomPropertySet("OldAutomaticXAxisInterval"))
+ {
+ pointAndFigureSeries.DeleteCustomProperty("OldAutomaticXAxisInterval");
+
+ // Reset automatic interval for X axis
+ if(pointAndFigureSeries.ChartArea.Length > 0)
+ {
+ // Get X axis connected to the series
+ ChartArea area = chart.ChartAreas[pointAndFigureSeries.ChartArea];
+ Axis xAxis = area.GetAxis(AxisName.X, pointAndFigureSeries.XAxisType, pointAndFigureSeries.XSubAxisName);
+
+ xAxis.interval = 0.0;
+ xAxis.intervalType = DateTimeIntervalType.Auto;
+ }
+ }
+
+ // Remove series from the collection
+ chart.Series.Remove(series);
+ return true;
+ }
+
+ return false;
+ }
+
+ /// <summary>
+ /// Gets price range in the point and figure chart.
+ /// </summary>
+ /// <param name="originalData">Series with original data.</param>
+ /// <param name="yValueHighIndex">Index of the Y value to use as High price.</param>
+ /// <param name="yValueLowIndex">Index of the Y value to use as Low price.</param>
+ /// <param name="minPrice">Returns max price.</param>
+ /// <param name="maxPrice">Returns min price.</param>
+ private static void GetPriceRange(
+ Series originalData,
+ int yValueHighIndex,
+ int yValueLowIndex,
+ out double minPrice,
+ out double maxPrice)
+ {
+ // Calculate percent of the highest and lowest price difference.
+ maxPrice = double.MinValue;
+ minPrice = double.MaxValue;
+ foreach(DataPoint dp in originalData.Points)
+ {
+ if(!dp.IsEmpty)
+ {
+ // Check required Y values number
+ if(dp.YValues.Length < 2)
+ {
+ throw(new InvalidOperationException(SR.ExceptionChartTypeRequiresYValues(ChartTypeNames.PointAndFigure, ((int)(2)).ToString(CultureInfo.CurrentCulture))));
+ }
+
+ if(dp.YValues[yValueHighIndex] > maxPrice)
+ {
+ maxPrice = dp.YValues[yValueHighIndex];
+ }
+ else if(dp.YValues[yValueLowIndex] > maxPrice)
+ {
+ maxPrice = dp.YValues[yValueLowIndex];
+ }
+
+ if(dp.YValues[yValueHighIndex] < minPrice)
+ {
+ minPrice = dp.YValues[yValueHighIndex];
+ }
+ else if(dp.YValues[yValueLowIndex] < minPrice)
+ {
+ minPrice = dp.YValues[yValueLowIndex];
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets box size of the renko chart.
+ /// </summary>
+ /// <param name="series">Range column chart series used to dispaly the renko chart.</param>
+ /// <param name="minPrice">Max price.</param>
+ /// <param name="maxPrice">Min price.</param>
+ private static double GetBoxSize(
+ Series series,
+ double minPrice,
+ double maxPrice)
+ {
+ // Check "BoxSize" custom attribute
+ double boxSize = 1.0;
+ double percentOfPriceRange = 4.0;
+ bool roundBoxSize = true;
+ if (series.IsCustomPropertySet(CustomPropertyName.BoxSize))
+ {
+ string attrValue = series[CustomPropertyName.BoxSize].Trim();
+ bool usePercentage = attrValue.EndsWith("%", StringComparison.Ordinal);
+ if (usePercentage)
+ {
+ attrValue = attrValue.Substring(0, attrValue.Length - 1);
+ }
+
+ bool parseSucceed = false;
+ if (usePercentage)
+ {
+ double percent;
+ parseSucceed = double.TryParse(attrValue, NumberStyles.Any, CultureInfo.InvariantCulture, out percent);
+ if (parseSucceed)
+ {
+ percentOfPriceRange = percent;
+ roundBoxSize = false;
+ }
+ }
+ else
+ {
+ double b = 0;
+ parseSucceed = double.TryParse(attrValue, NumberStyles.Any, CultureInfo.InvariantCulture, out b);
+ if (parseSucceed)
+ {
+ boxSize = b;
+ percentOfPriceRange = 0.0;
+ }
+ }
+ if (!parseSucceed)
+ {
+ throw (new InvalidOperationException(SR.ExceptionRenkoBoxSizeFormatInvalid));
+ }
+ }
+
+ // Calculate box size using the percentage of price range
+ if(percentOfPriceRange > 0.0)
+ {
+ // Set default box size
+ boxSize = 1.0;
+
+ // Calculate box size as percentage of price difference
+ if(minPrice == maxPrice)
+ {
+ boxSize = 1.0;
+ }
+ else if( (maxPrice - minPrice) < 0.000001)
+ {
+ boxSize = 0.000001;
+ }
+ else
+ {
+ boxSize = (maxPrice - minPrice) * (percentOfPriceRange / 100.0);
+ }
+
+
+ // Round calculated value
+ if(roundBoxSize)
+ {
+
+ double[] availableBoxSizes = new double[]
+ { 0.000001, 0.00001, 0.0001, 0.001, 0.01, 0.1, 0.25, 0.5, 1.0, 2.0, 2.5, 3.0, 4.0, 5.0, 7.5, 10.0, 15.0, 20.0, 25.0, 50.0, 100.0, 200.0, 500.0, 1000.0, 5000.0, 10000.0, 50000.0, 100000.0, 1000000.0, 1000000.0};
+
+ for(int index = 1; index < availableBoxSizes.Length; index ++)
+ {
+ if(boxSize > availableBoxSizes[index - 1] &&
+ boxSize < availableBoxSizes[index])
+ {
+ boxSize = availableBoxSizes[index];
+ }
+ }
+ }
+ }
+
+ // Save current box size as a custom attribute of the original series
+ series["CurrentBoxSize"] = boxSize.ToString(CultureInfo.InvariantCulture);
+
+ return boxSize;
+ }
+
+ /// <summary>
+ /// Gets reversal amount of the pointAndFigure chart.
+ /// </summary>
+ /// <param name="series">Step line chart series used to dispaly the pointAndFigure chart.</param>
+ private static double GetReversalAmount(
+ Series series)
+ {
+ // Check "ReversalAmount" custom attribute
+ double reversalAmount = 3.0;
+ if (series.IsCustomPropertySet(CustomPropertyName.ReversalAmount))
+ {
+ string attrValue = series[CustomPropertyName.ReversalAmount].Trim();
+
+ double amount;
+ bool parseSucceed = double.TryParse(attrValue, NumberStyles.Any, CultureInfo.InvariantCulture, out amount);
+ if (parseSucceed)
+ {
+ reversalAmount = amount;
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionPointAndFigureReversalAmountInvalidFormat));
+ }
+ }
+
+ return reversalAmount;
+ }
+
+
+ /// <summary>
+ /// Fills step line series with data to draw the PointAndFigure chart.
+ /// </summary>
+ /// <param name="series">Step line chart series used to dispaly the PointAndFigure chart.</param>
+ /// <param name="originalData">Series with original data.</param>
+ private static void FillPointAndFigureData(Series series, Series originalData)
+ {
+ // Get index of the Y values used for High/Low
+ int yValueHighIndex = 0;
+ if(series.IsCustomPropertySet(CustomPropertyName.UsedYValueHigh))
+ {
+ try
+ {
+
+ yValueHighIndex = int.Parse(series[CustomPropertyName.UsedYValueHigh], CultureInfo.InvariantCulture);
+ }
+ catch
+ {
+ throw (new InvalidOperationException(SR.ExceptionPointAndFigureUsedYValueHighInvalidFormat));
+ }
+
+ if(yValueHighIndex >= series.YValuesPerPoint)
+ {
+ throw (new InvalidOperationException(SR.ExceptionPointAndFigureUsedYValueHighOutOfRange));
+ }
+ }
+ int yValueLowIndex = 1;
+ if(series.IsCustomPropertySet(CustomPropertyName.UsedYValueLow))
+ {
+ try
+ {
+ yValueLowIndex = int.Parse(series[CustomPropertyName.UsedYValueLow], CultureInfo.InvariantCulture);
+ }
+ catch
+ {
+ throw (new InvalidOperationException(SR.ExceptionPointAndFigureUsedYValueLowInvalidFormat));
+ }
+
+ if(yValueLowIndex >= series.YValuesPerPoint)
+ {
+ throw (new InvalidOperationException(SR.ExceptionPointAndFigureUsedYValueLowOutOfrange));
+ }
+ }
+
+ // Get Up Brick color
+ Color upPriceColor = ChartGraphics.GetGradientColor(series.Color, Color.Black, 0.5);
+ string upPriceColorString = series[CustomPropertyName.PriceUpColor];
+ if(upPriceColorString != null)
+ {
+ try
+ {
+ ColorConverter colorConverter = new ColorConverter();
+ upPriceColor = (Color)colorConverter.ConvertFromString(null, CultureInfo.InvariantCulture, upPriceColorString);
+ }
+ catch
+ {
+ throw (new InvalidOperationException(SR.ExceptionPointAndFigureUpBrickColorInvalidFormat));
+ }
+ }
+
+ // Get price range
+ double priceHigh, priceLow;
+ GetPriceRange(originalData, yValueHighIndex, yValueLowIndex, out priceHigh, out priceLow);
+
+ // Calculate box size
+ double boxSize = GetBoxSize(series, priceHigh, priceLow);
+
+ // Calculate reversal amount
+ double reversalAmount = GetReversalAmount(series);
+
+ // Fill points
+ double prevHigh = double.NaN;
+ double prevLow = double.NaN;
+ int prevDirection = 0; // 1 up; -1 down; 0 none
+ int pointIndex = 0;
+ foreach(DataPoint dataPoint in originalData.Points)
+ {
+ if(!dataPoint.IsEmpty)
+ {
+ // Indicates that all updates are already performed and no further processing required
+ bool doNotUpdate = false;
+
+ // Number of brciks total or added to the curent column
+ int numberOfBricks = 0;
+
+ // Check if previus values exists
+ if(double.IsNaN(prevHigh))
+ {
+ prevHigh = dataPoint.YValues[yValueHighIndex];
+ prevLow = dataPoint.YValues[yValueLowIndex];
+ ++pointIndex;
+ continue;
+ }
+
+ // Check direction of the price change
+ int direction = 0;
+ if(prevDirection == 1 || prevDirection == 0)
+ {
+ if(dataPoint.YValues[yValueHighIndex] >= (prevHigh + boxSize))
+ {
+ direction = 1;
+ numberOfBricks = (int)Math.Floor(
+ (dataPoint.YValues[yValueHighIndex] - prevHigh) / boxSize);
+ }
+ else if(dataPoint.YValues[yValueLowIndex] <= (prevHigh - boxSize * reversalAmount))
+ {
+ direction = -1;
+ numberOfBricks = (int)Math.Floor(
+ (prevHigh - dataPoint.YValues[yValueLowIndex]) / boxSize);
+ }
+ // Adjust the lower part of the column while going up
+ else if (dataPoint.YValues[yValueHighIndex] <= (prevLow - boxSize))
+ {
+ doNotUpdate = true;
+ numberOfBricks = (int)Math.Floor(
+ (prevLow - dataPoint.YValues[yValueHighIndex]) / boxSize);
+
+ if (series.Points.Count > 0)
+ {
+ series.Points[series.Points.Count - 1].YValues[0] -= numberOfBricks * boxSize;
+ }
+ prevLow -= numberOfBricks * boxSize;
+ }
+
+ }
+ if(direction == 0 &&
+ (prevDirection == -1 || prevDirection == 0) )
+ {
+ if(dataPoint.YValues[yValueLowIndex] <= (prevLow - boxSize))
+ {
+ direction = -1;
+ numberOfBricks = (int)Math.Floor(
+ (prevLow - dataPoint.YValues[yValueLowIndex]) / boxSize);
+ }
+ else if(dataPoint.YValues[yValueHighIndex] >= (prevLow + boxSize * reversalAmount))
+ {
+ direction = 1;
+ numberOfBricks = (int)Math.Floor(
+ (dataPoint.YValues[yValueHighIndex] - prevLow) / boxSize);
+ }
+ // Adjust the upper part of the column while going down
+ else if (dataPoint.YValues[yValueLowIndex] >= (prevHigh + boxSize))
+ {
+ doNotUpdate = true;
+ numberOfBricks = (int)Math.Floor(
+ (prevHigh - dataPoint.YValues[yValueLowIndex]) / boxSize);
+
+ if (series.Points.Count > 0)
+ {
+ series.Points[series.Points.Count - 1].YValues[1] += numberOfBricks * boxSize;
+ }
+ prevHigh += numberOfBricks * boxSize;
+ }
+
+ }
+
+ // Check if value was changed - otherwise do nothing
+ if (direction != 0 && !doNotUpdate)
+ {
+ // Extend line in same direction
+ if(direction == prevDirection)
+ {
+ if (direction == 1)
+ {
+ series.Points[series.Points.Count - 1].YValues[1] += numberOfBricks * boxSize;
+ prevHigh += numberOfBricks * boxSize;
+ series.Points[series.Points.Count - 1]["OriginalPointIndex"] = pointIndex.ToString(CultureInfo.InvariantCulture);
+ }
+ else
+ {
+ series.Points[series.Points.Count - 1].YValues[0] -= numberOfBricks * boxSize;
+ prevLow -= numberOfBricks * boxSize;
+ series.Points[series.Points.Count - 1]["OriginalPointIndex"] = pointIndex.ToString(CultureInfo.InvariantCulture);
+ }
+ }
+ else
+ {
+ // Opposite direction by more than reversal amount
+ DataPoint newDataPoint = (DataPoint)dataPoint.Clone();
+ newDataPoint["OriginalPointIndex"] = pointIndex.ToString(CultureInfo.InvariantCulture);
+ newDataPoint.series = series;
+ newDataPoint.XValue = dataPoint.XValue;
+ if(direction == 1)
+ {
+ newDataPoint.Color = upPriceColor;
+ newDataPoint["PriceUpPoint"] = "true";
+ newDataPoint.YValues[0] = prevLow + ((prevDirection != 0) ? boxSize : 0.0);
+ newDataPoint.YValues[1] = newDataPoint.YValues[0] + numberOfBricks * boxSize - ((prevDirection != 0) ? boxSize : 0.0);
+ }
+ else
+ {
+ newDataPoint.YValues[1] = prevHigh - ((prevDirection != 0) ? boxSize : 0.0);
+ newDataPoint.YValues[0] = newDataPoint.YValues[1] - numberOfBricks * boxSize;
+ }
+
+ prevHigh = newDataPoint.YValues[1];
+ prevLow = newDataPoint.YValues[0];
+
+ // Add PointAndFigure to the range step line series
+ series.Points.Add(newDataPoint);
+ }
+
+ // Save previous close value and direction
+ prevDirection = direction;
+ }
+ }
+ ++pointIndex;
+ }
+
+ }
+
+ /// <summary>
+ /// Customize chart event, used to add empty points to make point and
+ /// figure chart symbols look proportional.
+ /// </summary>
+ /// <param name="sender">The source Chart object of this event.</param>
+ /// <param name="e">The EventArgs object that contains the event data.</param>
+ static private void OnCustomize(Object sender, EventArgs e)
+ {
+ bool chartResized = false;
+ Chart chart = (Chart)sender;
+ // Loop through all series
+ foreach(Series series in chart.Series)
+ {
+ // Check for the PointAndFigure chart type
+ if(series.Name.StartsWith("POINTANDFIGURE_ORIGINAL_DATA_", StringComparison.Ordinal))
+ {
+ // Get original series
+ Series pointAndFigureSeries = chart.Series[series.Name.Substring(29)];
+
+ // Check if proportional symbol custom attribute is set
+ bool proportionalSymbols = true;
+ string attrValue = pointAndFigureSeries[CustomPropertyName.ProportionalSymbols];
+ if(attrValue != null && String.Compare( attrValue, "True", StringComparison.OrdinalIgnoreCase ) != 0 )
+ {
+ proportionalSymbols = false;
+ }
+
+ if(proportionalSymbols &&
+ pointAndFigureSeries.Enabled &&
+ pointAndFigureSeries.ChartArea.Length > 0)
+ {
+ // Resize chart
+ if(!chartResized)
+ {
+ chartResized = true;
+ chart.chartPicture.Resize(chart.chartPicture.ChartGraph, false);
+ }
+
+ // Find series chart area, X & Y axes
+ ChartArea chartArea = chart.ChartAreas[pointAndFigureSeries.ChartArea];
+ Axis axisX = chartArea.GetAxis(AxisName.X, pointAndFigureSeries.XAxisType, pointAndFigureSeries.XSubAxisName);
+ Axis axisY = chartArea.GetAxis(AxisName.Y, pointAndFigureSeries.YAxisType, pointAndFigureSeries.YSubAxisName);
+
+ // Symbols are drawn only in 2D mode
+ if(!chartArea.Area3DStyle.Enable3D)
+ {
+ // Get current box size
+ double boxSize = double.Parse(
+ pointAndFigureSeries["CurrentBoxSize"],
+ CultureInfo.InvariantCulture);
+
+ // Calculate symbol width and height
+ double boxYSize = Math.Abs(
+ axisY.GetPosition(axisY.Minimum) -
+ axisY.GetPosition(axisY.Minimum + boxSize) );
+ double boxXSize = Math.Abs(
+ axisX.GetPosition(1.0) -
+ axisX.GetPosition(0.0) );
+ boxXSize *= 0.8;
+
+ // Get absolute size in pixels
+ SizeF markSize = chart.chartPicture.ChartGraph.GetAbsoluteSize(
+ new SizeF((float)boxXSize, (float)boxYSize));
+
+ // Calculate number of empty points that should be added
+ int pointCount = 0;
+ if(markSize.Width > markSize.Height)
+ {
+ pointCount = (int)(pointAndFigureSeries.Points.Count * (markSize.Width / markSize.Height));
+ }
+
+ // Add empty points
+ DataPoint emptyPoint = new DataPoint(pointAndFigureSeries);
+ emptyPoint.IsEmpty = true;
+ emptyPoint.AxisLabel = " ";
+ while(pointAndFigureSeries.Points.Count < pointCount)
+ {
+ pointAndFigureSeries.Points.Add(emptyPoint);
+ }
+
+ // Always use zeros for Y values of empty points
+ pointAndFigureSeries[CustomPropertyName.EmptyPointValue] = "Zero";
+
+ // RecalculateAxesScale chart are data
+ chartArea.ReCalcInternal();
+ }
+ }
+ }
+ }
+ }
+
+ #endregion // Methods
+
+ #region Drawing methods
+
+ /// <summary>
+ /// Draws 2D column using 'X' or 'O' symbols.
+ /// </summary>
+ /// <param name="graph">Chart graphics.</param>
+ /// <param name="vAxis">Vertical axis.</param>
+ /// <param name="rectSize">Column position and size.</param>
+ /// <param name="point">Column data point.</param>
+ /// <param name="ser">Column series.</param>
+ protected override void DrawColumn2D(
+ ChartGraphics graph,
+ Axis vAxis,
+ RectangleF rectSize,
+ DataPoint point,
+ Series ser)
+ {
+ // Get box size
+ double boxSize = double.Parse(ser["CurrentBoxSize"], CultureInfo.InvariantCulture);
+ double boxSizeRel = vAxis.GetLogValue(vAxis.ViewMinimum);
+ boxSizeRel = vAxis.GetLinearPosition(boxSizeRel);
+ boxSizeRel = Math.Abs(boxSizeRel -
+ vAxis.GetLinearPosition(vAxis.GetLogValue(vAxis.ViewMinimum + boxSize)));
+
+ // Draw a series of Xs or Os
+ for(float positionY = rectSize.Y; positionY < rectSize.Bottom - (float)(boxSizeRel - boxSizeRel/4.0); positionY += (float)boxSizeRel)
+ {
+ // Get position of symbol
+ RectangleF position = RectangleF.Empty;
+ position.X = rectSize.X;
+ position.Y = positionY;
+ position.Width = rectSize.Width;
+ position.Height = (float)boxSizeRel;
+
+ // Get absolute position and add 1 pixel spacing
+ position = graph.GetAbsoluteRectangle(position);
+ int spacing = 1 + point.BorderWidth / 2;
+ position.Y += spacing;
+ position.Height -= 2 * spacing;
+
+ // Calculate shadow position
+ RectangleF shadowPosition = new RectangleF(position.Location, position.Size);
+ shadowPosition.Offset(ser.ShadowOffset, ser.ShadowOffset);
+
+ if(point.IsCustomPropertySet("PriceUpPoint"))
+ {
+ // Draw shadow
+ if(ser.ShadowOffset != 0)
+ {
+ graph.DrawLineAbs(
+ ser.ShadowColor,
+ point.BorderWidth,
+ ChartDashStyle.Solid,
+ new PointF(shadowPosition.Left, shadowPosition.Top),
+ new PointF(shadowPosition.Right, shadowPosition.Bottom));
+ graph.DrawLineAbs(
+ ser.ShadowColor,
+ point.BorderWidth,
+ ChartDashStyle.Solid,
+ new PointF(shadowPosition.Left, shadowPosition.Bottom),
+ new PointF(shadowPosition.Right, shadowPosition.Top));
+ }
+
+ // Draw 'X' symbol
+ graph.DrawLineAbs(
+ point.Color,
+ point.BorderWidth,
+ ChartDashStyle.Solid,
+ new PointF(position.Left, position.Top),
+ new PointF(position.Right, position.Bottom));
+ graph.DrawLineAbs(
+ point.Color,
+ point.BorderWidth,
+ ChartDashStyle.Solid,
+ new PointF(position.Left, position.Bottom),
+ new PointF(position.Right, position.Top));
+ }
+ else
+ {
+ // Draw circles when price is dropping
+ if(ser.ShadowOffset != 0)
+ {
+ graph.DrawCircleAbs(
+ new Pen(ser.ShadowColor, point.BorderWidth),
+ null,
+ shadowPosition,
+ 1,
+ false);
+ }
+
+ // Draw 'O' symbol
+ graph.DrawCircleAbs(
+ new Pen(point.Color, point.BorderWidth),
+ null,
+ position,
+ 1,
+ false);
+ }
+ }
+
+
+ }
+
+ #endregion // Drawing methods
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ override public string Name { get{ return ChartTypeNames.PointAndFigure;}}
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ override public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+ #endregion
+ }
+}
+
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/PointChart.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/PointChart.cs
new file mode 100644
index 00000000000..468256fc006
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/PointChart.cs
@@ -0,0 +1,1822 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: PointChart.cs
+//
+// Namespace: DataVisualization.Charting.ChartTypes
+//
+// Classes: PointChart
+//
+// Purpose: Provides 2D/3D drawing and hit testing functionality
+// for the Point chart.
+//
+// Reviewed: AG - Aug 6, 2002
+// AG - Microsoft 6, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Resources;
+using System.Reflection;
+using System.Collections;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Globalization;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+#else
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.ChartTypes
+#else
+ namespace System.Web.UI.DataVisualization.Charting.ChartTypes
+#endif
+{
+ /// <summary>
+ /// PointChart class provides 2D/3D drawing and hit testing
+ /// functionality for the Point chart.
+ /// </summary>
+ internal class PointChart : IChartType
+ {
+ #region Fields
+
+ /// <summary>
+ /// Indicates that markers will be always drawn
+ /// </summary>
+ internal bool alwaysDrawMarkers = true;
+
+ /// <summary>
+ /// Index of the Y value used to draw chart
+ /// </summary>
+ internal int YValueIndex { get; set; }
+
+ /// <summary>
+ /// Index of the Y value used to be shown as point value label
+ /// </summary>
+ internal int labelYValueIndex = -1;
+
+ /// <summary>
+ /// Auto label position flag
+ /// </summary>
+ internal bool autoLabelPosition = true;
+
+ /// <summary>
+ /// Label position
+ /// </summary>
+ internal LabelAlignmentStyles labelPosition = LabelAlignmentStyles.Top;
+
+ /// <summary>
+ /// Vertical axes
+ /// </summary>
+ internal Axis VAxis { get; set; }
+
+ /// <summary>
+ /// Horizontal axes
+ /// </summary>
+ internal Axis HAxis { get; set; }
+
+ /// <summary>
+ /// Indexed series flag
+ /// </summary>
+ internal bool indexedSeries = false;
+
+ /// <summary>
+ /// Common elements object
+ /// </summary>
+ internal CommonElements Common { get; set; }
+
+ /// <summary>
+ /// Chart area object
+ /// </summary>
+ internal ChartArea Area { get; set; }
+
+ /// <summary>
+ /// Indicates that marker and label are drawn in the middle of 3D depth
+ /// </summary>
+ internal bool middleMarker = true;
+
+ /// <summary>
+ /// Stores information about 3D labels. Used to draw 3D labels in layers.
+ /// </summary>
+ internal ArrayList label3DInfoList = null;
+
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// Class public constructor.
+ /// </summary>
+ public PointChart()
+ {
+ }
+
+ /// <summary>
+ /// Class public constructor.
+ /// </summary>
+ /// <param name="alwaysDrawMarkers">Indicates if markers should be always painted.</param>
+ public PointChart(bool alwaysDrawMarkers)
+ {
+ this.alwaysDrawMarkers = alwaysDrawMarkers;
+ }
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ virtual public string Name { get{ return ChartTypeNames.Point;}}
+
+ /// <summary>
+ /// True if chart type is stacked
+ /// </summary>
+ virtual public bool Stacked { get{ return false;}}
+
+
+ /// <summary>
+ /// True if stacked chart type supports groups
+ /// </summary>
+ virtual public bool SupportStackedGroups { get { return false; } }
+
+
+ /// <summary>
+ /// True if stacked chart type should draw separately positive and
+ /// negative data points ( Bar and column Stacked types ).
+ /// </summary>
+ public bool StackSign { get{ return false;}}
+
+ /// <summary>
+ /// True if chart type supports axeses
+ /// </summary>
+ virtual public bool RequireAxes { get{ return true;} }
+
+ /// <summary>
+ /// Chart type with two y values used for scale ( bubble chart type )
+ /// </summary>
+ virtual public bool SecondYScale{ get{ return false;} }
+
+ /// <summary>
+ /// True if chart type requires circular chart area.
+ /// </summary>
+ public bool CircularChartArea { get{ return false;} }
+
+ /// <summary>
+ /// True if chart type supports logarithmic axes
+ /// </summary>
+ virtual public bool SupportLogarithmicAxes { get{ return true;} }
+
+ /// <summary>
+ /// True if chart type requires to switch the value (Y) axes position
+ /// </summary>
+ virtual public bool SwitchValueAxes { get{ return false;} }
+
+ /// <summary>
+ /// True if chart series can be placed side-by-side.
+ /// </summary>
+ virtual public bool SideBySideSeries { get{ return false;} }
+
+ /// <summary>
+ /// True if each data point of a chart must be represented in the legend
+ /// </summary>
+ virtual public bool DataPointsInLegend { get{ return false;} }
+
+ /// <summary>
+ /// If the crossing value is auto Crossing value should be
+ /// automatically set to zero for some chart
+ /// types (Bar, column, area etc.)
+ /// </summary>
+ virtual public bool ZeroCrossing { get{ return false;} }
+
+ /// <summary>
+ /// True if palette colors should be applied for each data paoint.
+ /// Otherwise the color is applied to the series.
+ /// </summary>
+ virtual public bool ApplyPaletteColorsToPoints { get { return false; } }
+
+ /// <summary>
+ /// Indicates that extra Y values are connected to the scale of the Y axis
+ /// </summary>
+ virtual public bool ExtraYValuesConnectedToYAxis{ get { return false; } }
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ virtual public bool HundredPercent{ get{return false;} }
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ virtual public bool HundredPercentSupportNegative{ get{return false;} }
+
+ /// <summary>
+ /// How to draw series/points in legend:
+ /// Filled rectangle, Line or Marker
+ /// </summary>
+ /// <param name="series">Legend item series.</param>
+ /// <returns>Legend item style.</returns>
+ virtual public LegendImageStyle GetLegendImageStyle(Series series)
+ {
+ return LegendImageStyle.Marker;
+ }
+
+ /// <summary>
+ /// Number of supported Y value(s) per point
+ /// </summary>
+ virtual public int YValuesPerPoint { get { return 1; } }
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ virtual public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+
+ #endregion
+
+ #region Painting and Selection
+
+ /// <summary>
+ /// Paint Point Chart.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ virtual public void Paint( ChartGraphics graph, CommonElements common, ChartArea area, Series seriesToDraw )
+ {
+ this.Common = common;
+ this.Area = area;
+ ProcessChartType( false, graph, common, area, seriesToDraw);
+ }
+
+ /// <summary>
+ /// This method recalculates size of the bars. This method is used
+ /// from Paint or Select method.
+ /// </summary>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ virtual protected void ProcessChartType(
+ bool selection,
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ Series seriesToDraw )
+ {
+
+ this.Common = common;
+ // Prosess 3D chart type
+ if(area.Area3DStyle.Enable3D)
+ {
+ ProcessChartType3D( selection, graph, common, area, seriesToDraw );
+ return;
+ }
+
+ // Check if series is indexed
+ if( ShiftedSerName.Length == 0)
+ {
+ indexedSeries = ChartHelper.IndexedSeries(this.Common, area.GetSeriesFromChartType(this.Name).ToArray());
+ }
+ else
+ {
+ indexedSeries = ChartHelper.IndexedSeries( common.DataManager.Series[ShiftedSerName] );
+ }
+
+ //************************************************************
+ //** Loop through all series
+ //************************************************************
+ foreach( Series ser in common.DataManager.Series )
+ {
+ // Labels and markers have to be shifted if there
+ // is more than one series for column chart. This property
+ // will give a name of the series, which is used, for
+ // labels and markers.
+ bool breakSeriesLoop = false;
+ if( ShiftedSerName.Length > 0)
+ {
+ if( ShiftedSerName != ser.Name )
+ {
+ continue;
+ }
+ breakSeriesLoop = true;
+ }
+
+ // Process only point chart series in this chart area
+ if( String.Compare( ser.ChartTypeName, this.Name, true, System.Globalization.CultureInfo.CurrentCulture ) != 0
+ || ser.ChartArea != area.Name || !ser.IsVisible())
+ {
+ continue;
+ }
+
+ // Check if only 1 specified series must be processed
+ if (seriesToDraw != null && seriesToDraw.Name != ser.Name)
+ {
+ continue;
+ }
+
+ //************************************************************
+ //** Set active horizontal/vertical axis
+ //************************************************************
+ HAxis = area.GetAxis(AxisName.X, ser.XAxisType, ser.XSubAxisName);
+ VAxis = area.GetAxis(AxisName.Y, ser.YAxisType, ser.YSubAxisName);
+ double horizontalViewMax = HAxis.ViewMaximum;
+ double horizontalViewMin = HAxis.ViewMinimum;
+ double verticalViewMax = VAxis.ViewMaximum;
+ double verticalViewMin = VAxis.ViewMinimum;
+
+ //************************************************************
+ //** Call Back Paint event
+ //************************************************************
+ if( !selection )
+ {
+ common.Chart.CallOnPrePaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+
+ //************************************************************
+ //** Loop through all data points in the series
+ //************************************************************
+ int markerIndex = 0; // Marker index
+ int index = 1; // Data points loop
+ foreach( DataPoint point in ser.Points )
+ {
+ // Reset pre-calculated point position
+ point.positionRel = new PointF(float.NaN, float.NaN);
+
+ //************************************************************
+ //** Check if point values are in the chart area
+ //************************************************************
+
+ // Check for min/max X values
+ double xValue = (indexedSeries) ? (double)index : point.XValue;
+ xValue = HAxis.GetLogValue(xValue);
+ if(xValue > horizontalViewMax || xValue < horizontalViewMin)
+ {
+ index++;
+ continue;
+ }
+
+ // Check for min/max Y values
+ double yValue = GetYValue(common, area, ser, point, index - 1, YValueIndex);
+
+ // Axis is logarithmic
+ yValue = VAxis.GetLogValue( yValue );
+
+ if( yValue > verticalViewMax || yValue < verticalViewMin)
+ {
+ index++;
+ continue;
+ }
+
+
+ // Check if point should be drawn on the edge of the data scaleView.
+ bool skipMarker = false;
+ if(!ShouldDrawMarkerOnViewEdgeX())
+ {
+ // Check for min/max X values
+ if(xValue == horizontalViewMax && ShiftedX >= 0)
+ {
+ skipMarker = true;
+ }
+
+ // Check for min/max X values
+ if(xValue == horizontalViewMin && ShiftedX <= 0)
+ {
+ skipMarker = true;
+ }
+ }
+
+ //************************************************************
+ //** Get marker position and size
+ //************************************************************
+ int pointMarkerSize = point.MarkerSize;
+ string pointMarkerImage = point.MarkerImage;
+ MarkerStyle pointMarkerStyle = point.MarkerStyle;
+
+
+ // Get marker position
+ PointF markerPosition = PointF.Empty;
+ markerPosition.Y = (float)VAxis.GetLinearPosition(yValue);
+ if( indexedSeries )
+ {
+ // The formula for position is based on a distance
+ // from the grid line or nPoints position.
+ markerPosition.X = (float)HAxis.GetPosition( (double)index );
+ }
+ else
+ {
+ markerPosition.X = (float)HAxis.GetPosition( point.XValue );
+ }
+
+ // Labels and markers have to be shifted if there
+ // is more than one series for column chart.
+ markerPosition.X += (float)ShiftedX;
+
+ // Remeber pre-calculated point position
+ point.positionRel = new PointF(markerPosition.X, markerPosition.Y);
+
+ // Get marker size
+ SizeF markerSize = GetMarkerSize(
+ graph,
+ common,
+ area,
+ point,
+ pointMarkerSize,
+ pointMarkerImage);
+
+ //************************************************************
+ //** Skip marker drawing
+ //************************************************************
+ if( skipMarker )
+ {
+ index++;
+ continue;
+ }
+
+ //************************************************************
+ //** Draw point chart
+ //************************************************************
+ if(alwaysDrawMarkers ||
+ pointMarkerStyle != MarkerStyle.None ||
+ pointMarkerImage.Length > 0)
+ {
+ if( common.ProcessModePaint )
+ {
+ // Check marker index
+ if(markerIndex == 0)
+ {
+ // Start Svg Selection mode
+ graph.StartHotRegion( point );
+
+ // Draw the marker
+ this.DrawPointMarker(
+ graph,
+ point.series,
+ point,
+ markerPosition,
+ (pointMarkerStyle == MarkerStyle.None) ? MarkerStyle.Circle : pointMarkerStyle,
+ (int)markerSize.Height,
+ (point.MarkerColor == Color.Empty) ? point.Color : point.MarkerColor,
+ (point.MarkerBorderColor == Color.Empty) ? point.BorderColor : point.MarkerBorderColor,
+ GetMarkerBorderSize(point),
+ pointMarkerImage,
+ point.MarkerImageTransparentColor,
+ (point.series != null) ? point.series.ShadowOffset : 0,
+ (point.series != null) ? point.series.ShadowColor : Color.Empty,
+ new RectangleF(markerPosition.X, markerPosition.Y, markerSize.Width, markerSize.Height));
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+ }
+
+ if( common.ProcessModeRegions )
+ {
+ SetHotRegions(
+ common,
+ graph,
+ point,
+ markerSize,
+ point.series.Name,
+ index - 1,
+ pointMarkerStyle,
+ markerPosition );
+ }
+ }
+
+ // Increase the markers counter
+ ++markerIndex;
+ if(ser.MarkerStep == markerIndex)
+ {
+ markerIndex = 0;
+ }
+ }
+
+ // Start Svg Selection mode
+ graph.StartHotRegion( point, true );
+
+ // Draw labels
+ DrawLabels(
+ area,
+ graph,
+ common,
+ markerPosition,
+ (int)markerSize.Height,
+ point,
+ ser,
+ index - 1);
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+
+
+ ++index;
+ }
+
+ // Call Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPostPaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+
+ // Break series loop.
+ if( breakSeriesLoop )
+ {
+ break;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Draw series point marker.
+ /// </summary>
+ /// <param name="graph">Chart Graphics used for drawing.</param>
+ /// <param name="series">Series.</param>
+ /// <param name="dataPoint">Series data point.</param>
+ /// <param name="point">Coordinates of the center.</param>
+ /// <param name="markerStyle">Marker style.</param>
+ /// <param name="markerSize">Marker size.</param>
+ /// <param name="markerColor">Marker color.</param>
+ /// <param name="markerBorderColor">Marker border color.</param>
+ /// <param name="markerBorderSize">Marker border size.</param>
+ /// <param name="markerImage">Marker image name.</param>
+ /// <param name="markerImageTransparentColor">Color of the marker image transparent.</param>
+ /// <param name="shadowSize">Marker shadow size.</param>
+ /// <param name="shadowColor">Marker shadow color.</param>
+ /// <param name="imageScaleRect">Rectangle to which marker image should be scaled.</param>
+ protected virtual void DrawPointMarker(
+ ChartGraphics graph,
+ Series series,
+ DataPoint dataPoint,
+ PointF point,
+ MarkerStyle markerStyle,
+ int markerSize,
+ Color markerColor,
+ Color markerBorderColor,
+ int markerBorderSize,
+ string markerImage,
+ Color markerImageTransparentColor,
+ int shadowSize,
+ Color shadowColor,
+ RectangleF imageScaleRect
+ )
+ {
+ // Draw marker using relative coordinates
+ graph.DrawMarkerRel(
+ point,
+ markerStyle,
+ markerSize,
+ markerColor,
+ markerBorderColor,
+ markerBorderSize,
+ markerImage,
+ markerImageTransparentColor,
+ shadowSize,
+ shadowColor,
+ imageScaleRect);
+ }
+
+ /// <summary>
+ /// Inserts Hot Regions used for image maps, tool tips and
+ /// hit test function
+ /// </summary>
+ /// <param name="common">Common elements object</param>
+ /// <param name="graph">Chart Graphics object</param>
+ /// <param name="point">Data point used for hot region</param>
+ /// <param name="markerSize">Size of the marker</param>
+ /// <param name="seriesName">Name of the series</param>
+ /// <param name="pointIndex">Data point index</param>
+ /// <param name="pointMarkerStyle">Marker Style</param>
+ /// <param name="markerPosition">Marker Position</param>
+ private void SetHotRegions( CommonElements common, ChartGraphics graph, DataPoint point, SizeF markerSize, string seriesName, int pointIndex, MarkerStyle pointMarkerStyle, PointF markerPosition )
+ {
+
+ // Get relative marker size
+ SizeF relativeMarkerSize = graph.GetRelativeSize(markerSize);
+
+ int insertIndex = common.HotRegionsList.FindInsertIndex();
+
+ // Insert circle area
+ if( pointMarkerStyle == MarkerStyle.Circle )
+ {
+ common.HotRegionsList.AddHotRegion( insertIndex, graph, markerPosition.X, markerPosition.Y, relativeMarkerSize.Width/2f, point, seriesName, pointIndex );
+ }
+ // All other markers represented as rectangles
+ else
+ {
+ // Insert area
+ common.HotRegionsList.AddHotRegion(
+ new RectangleF(markerPosition.X - relativeMarkerSize.Width/2f, markerPosition.Y - relativeMarkerSize.Height/2f, relativeMarkerSize.Width, relativeMarkerSize.Height),
+ point,
+ seriesName,
+ pointIndex );
+ }
+
+ }
+
+ /// <summary>
+ /// This method draws labels in point chart.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object</param>
+ /// <param name="common">The Common elements object</param>
+ /// <param name="area">Chart area for this chart</param>
+ /// <param name="markerPosition">Marker position</param>
+ /// <param name="markerSize">Marker size</param>
+ /// <param name="point">Data point</param>
+ /// <param name="ser">Data series</param>
+ /// <param name="pointIndex">Data point index.</param>
+ private void DrawLabels(
+ ChartArea area,
+ ChartGraphics graph,
+ CommonElements common,
+ PointF markerPosition,
+ int markerSize,
+ DataPoint point,
+ Series ser,
+ int pointIndex)
+ {
+ // Get some properties for performance
+ string pointLabel = point.Label;
+ bool pointShowLabelAsValue = point.IsValueShownAsLabel;
+
+ // ****************************
+ // Draw data point value label
+ // ****************************
+ if((!point.IsEmpty && (ser.IsValueShownAsLabel || pointShowLabelAsValue || pointLabel.Length > 0)) ||
+ (pointShowLabelAsValue || pointLabel.Length > 0))
+ {
+ // Label text format
+ using (StringFormat format = new StringFormat())
+ {
+ format.Alignment = StringAlignment.Near;
+ format.LineAlignment = StringAlignment.Center;
+
+ // Get label text
+ string text;
+ if (pointLabel.Length == 0)
+ {
+ text = ValueConverter.FormatValue(
+ ser.Chart,
+ point,
+ point.Tag,
+ point.YValues[(labelYValueIndex == -1) ? YValueIndex : labelYValueIndex],
+ point.LabelFormat,
+ ser.YValueType,
+ ChartElementType.DataPoint);
+ }
+ else
+ {
+ text = point.ReplaceKeywords(pointLabel);
+ }
+
+ // Get point label style attribute
+ SizeF sizeMarker = graph.GetRelativeSize(new SizeF(markerSize, markerSize));
+ SizeF sizeFont = graph.GetRelativeSize(
+ graph.MeasureString(text, point.Font, new SizeF(1000f, 1000f), StringFormat.GenericTypographic));
+
+ SizeF sizeSingleCharacter = graph.GetRelativeSize(
+ graph.MeasureString("W", point.Font, new SizeF(1000f, 1000f), StringFormat.GenericTypographic));
+
+ // Increase label size when background is drawn
+ SizeF sizeLabel = new SizeF(sizeFont.Width, sizeFont.Height);
+ float horizontalSpacing = sizeLabel.Width / text.Length;
+ sizeLabel.Height += sizeSingleCharacter.Height / 2;
+ sizeLabel.Width += horizontalSpacing;
+
+ // Get attribute from point or series
+ string attrib = point[CustomPropertyName.LabelStyle];
+ if (attrib == null || attrib.Length == 0)
+ {
+ attrib = ser[CustomPropertyName.LabelStyle];
+ }
+ this.autoLabelPosition = true;
+ if (attrib != null && attrib.Length > 0)
+ {
+ this.autoLabelPosition = false;
+
+ // Get label position from attribute
+ if (String.Compare(attrib, "Auto", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this.autoLabelPosition = true;
+ }
+ else if (String.Compare(attrib, "Center", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this.labelPosition = LabelAlignmentStyles.Center;
+ }
+ else if (String.Compare(attrib, "Bottom", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this.labelPosition = LabelAlignmentStyles.Bottom;
+ }
+ else if (String.Compare(attrib, "TopLeft", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this.labelPosition = LabelAlignmentStyles.TopLeft;
+ }
+ else if (String.Compare(attrib, "TopRight", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this.labelPosition = LabelAlignmentStyles.TopRight;
+ }
+ else if (String.Compare(attrib, "BottomLeft", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this.labelPosition = LabelAlignmentStyles.BottomLeft;
+ }
+ else if (String.Compare(attrib, "BottomRight", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this.labelPosition = LabelAlignmentStyles.BottomRight;
+ }
+ else if (String.Compare(attrib, "Left", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this.labelPosition = LabelAlignmentStyles.Left;
+ }
+ else if (String.Compare(attrib, "Right", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this.labelPosition = LabelAlignmentStyles.Right;
+ }
+ else if (String.Compare(attrib, "Top", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this.labelPosition = LabelAlignmentStyles.Top;
+ }
+ else
+ {
+ throw (new ArgumentException(SR.ExceptionCustomAttributeValueInvalid(attrib, "LabelStyle")));
+ }
+ }
+
+ // Try to get automatic label position
+ if (this.autoLabelPosition)
+ {
+ this.labelPosition = GetAutoLabelPosition(ser, pointIndex);
+ }
+
+ // Calculate label position
+ PointF position = new PointF(markerPosition.X, markerPosition.Y);
+ switch (this.labelPosition)
+ {
+ case LabelAlignmentStyles.Center:
+ format.Alignment = StringAlignment.Center;
+ break;
+ case LabelAlignmentStyles.Bottom:
+ format.Alignment = StringAlignment.Center;
+ position.Y += sizeMarker.Height / 1.75F;
+ position.Y += sizeLabel.Height / 2F;
+ break;
+ case LabelAlignmentStyles.Top:
+ format.Alignment = StringAlignment.Center;
+ position.Y -= sizeMarker.Height / 1.75F;
+ position.Y -= sizeLabel.Height / 2F;
+ break;
+ case LabelAlignmentStyles.Left:
+ format.Alignment = StringAlignment.Far;
+ position.X -= sizeMarker.Height / 1.75F + horizontalSpacing / 2f;
+ break;
+ case LabelAlignmentStyles.TopLeft:
+ format.Alignment = StringAlignment.Far;
+ position.X -= sizeMarker.Height / 1.75F + horizontalSpacing / 2f;
+ position.Y -= sizeMarker.Height / 1.75F;
+ position.Y -= sizeLabel.Height / 2F;
+ break;
+ case LabelAlignmentStyles.BottomLeft:
+ format.Alignment = StringAlignment.Far;
+ position.X -= sizeMarker.Height / 1.75F + horizontalSpacing / 2f;
+ position.Y += sizeMarker.Height / 1.75F;
+ position.Y += sizeLabel.Height / 2F;
+ break;
+ case LabelAlignmentStyles.Right:
+ //format.Alignment = StringAlignment.Near;
+ position.X += sizeMarker.Height / 1.75F + horizontalSpacing / 2f;
+ break;
+ case LabelAlignmentStyles.TopRight:
+ //format.Alignment = StringAlignment.Near;
+ position.X += sizeMarker.Height / 1.75F + horizontalSpacing / 2f;
+ position.Y -= sizeMarker.Height / 1.75F;
+ position.Y -= sizeLabel.Height / 2F;
+ break;
+ case LabelAlignmentStyles.BottomRight:
+ //format.Alignment = StringAlignment.Near;
+ position.X += sizeMarker.Height / 1.75F + horizontalSpacing / 2f;
+ position.Y += sizeMarker.Height / 1.75F;
+ position.Y += sizeLabel.Height / 2F;
+ break;
+ }
+
+ // Get text angle
+ int textAngle = point.LabelAngle;
+
+ // Check if text contains white space only
+ if (text.Trim().Length != 0)
+ {
+
+
+ // Check if Smart Labels are enabled
+ if (ser.SmartLabelStyle.Enabled)
+ {
+ // Adjust label position using SmartLabelStyle algorithm
+ position = area.smartLabels.AdjustSmartLabelPosition(
+ common,
+ graph,
+ area,
+ ser.SmartLabelStyle,
+ position,
+ sizeFont,
+ format,
+ markerPosition,
+ sizeMarker,
+ this.labelPosition);
+
+ // Smart labels always use 0 degrees text angle
+ textAngle = 0;
+ }
+
+
+
+ // Adjust alignment of vertical labels
+ // NOTE: Fixes issue #4560
+ if (textAngle == 90 || textAngle == -90)
+ {
+ switch (this.labelPosition)
+ {
+ case LabelAlignmentStyles.Top:
+ format.Alignment = StringAlignment.Near;
+ position.Y += sizeLabel.Height / 2F;
+ break;
+ case LabelAlignmentStyles.Bottom:
+ format.Alignment = StringAlignment.Far;
+ position.Y -= sizeLabel.Height / 2F;
+ break;
+ case LabelAlignmentStyles.Right:
+ format.Alignment = StringAlignment.Center;
+ format.LineAlignment = StringAlignment.Near;
+ break;
+ case LabelAlignmentStyles.Left:
+ format.Alignment = StringAlignment.Center;
+ format.LineAlignment = StringAlignment.Center;
+ break;
+ case LabelAlignmentStyles.TopLeft:
+ format.Alignment = StringAlignment.Near;
+ break;
+ case LabelAlignmentStyles.TopRight:
+ break;
+ case LabelAlignmentStyles.BottomLeft:
+ break;
+ case LabelAlignmentStyles.BottomRight:
+ format.Alignment = StringAlignment.Far;
+ break;
+ }
+ }
+
+ // Draw label
+ if (!position.IsEmpty)
+ {
+ // Get label background position
+ RectangleF labelBackPosition = RectangleF.Empty;
+ sizeLabel.Height -= sizeFont.Height / 2;
+ sizeLabel.Height += sizeFont.Height / 8;
+ labelBackPosition = GetLabelPosition(
+ graph,
+ position,
+ sizeLabel,
+ format,
+ true);
+
+ // Adjust rectangle position due to horizontal spacing
+ switch (this.labelPosition)
+ {
+ case LabelAlignmentStyles.Left:
+ labelBackPosition.X += horizontalSpacing / 2f;
+ break;
+ case LabelAlignmentStyles.TopLeft:
+ labelBackPosition.X += horizontalSpacing / 2f;
+ break;
+ case LabelAlignmentStyles.BottomLeft:
+ labelBackPosition.X += horizontalSpacing / 2f;
+ break;
+ case LabelAlignmentStyles.Right:
+ labelBackPosition.X -= horizontalSpacing / 2f;
+ break;
+ case LabelAlignmentStyles.TopRight:
+ labelBackPosition.X -= horizontalSpacing / 2f;
+ break;
+ case LabelAlignmentStyles.BottomRight:
+ labelBackPosition.X -= horizontalSpacing / 2f;
+ break;
+ }
+
+ // Draw label text
+ using (Brush brush = new SolidBrush(point.LabelForeColor))
+ {
+ graph.DrawPointLabelStringRel(
+ common,
+ text,
+ point.Font,
+ brush,
+ position,
+ format,
+ textAngle,
+ labelBackPosition,
+ point.LabelBackColor,
+ point.LabelBorderColor,
+ point.LabelBorderWidth,
+ point.LabelBorderDashStyle,
+ ser,
+ point,
+ pointIndex);
+ }
+ }
+ }
+ }
+ }
+ }
+
+
+ /// <summary>
+ /// Gets rectangle position of the label.
+ /// </summary>
+ /// <param name="graph">Chart graphics object.</param>
+ /// <param name="position">Original label position.</param>
+ /// <param name="size">Label text size.</param>
+ /// <param name="format">Label string format.</param>
+ /// <param name="adjustForDrawing">Result position is adjusted for drawing.</param>
+ /// <returns>Label rectangle position.</returns>
+ internal static RectangleF GetLabelPosition(
+ ChartGraphics graph,
+ PointF position,
+ SizeF size,
+ StringFormat format,
+ bool adjustForDrawing)
+ {
+ // Calculate label position rectangle
+ RectangleF labelPosition = RectangleF.Empty;
+ labelPosition.Width = size.Width;
+ labelPosition.Height = size.Height;
+
+ // Calculate pixel size in relative coordiantes
+ SizeF pixelSize = SizeF.Empty;
+ if(graph != null)
+ {
+ pixelSize = graph.GetRelativeSize(new SizeF(1f, 1f));
+ }
+
+ if(format.Alignment == StringAlignment.Far)
+ {
+ labelPosition.X = position.X - size.Width;
+ if(adjustForDrawing && !pixelSize.IsEmpty)
+ {
+ labelPosition.X -= 4f*pixelSize.Width;
+ labelPosition.Width += 4f*pixelSize.Width;
+ }
+ }
+ else if(format.Alignment == StringAlignment.Near)
+ {
+ labelPosition.X = position.X;
+ if(adjustForDrawing && !pixelSize.IsEmpty)
+ {
+ labelPosition.Width += 4f*pixelSize.Width;
+ }
+ }
+ else if(format.Alignment == StringAlignment.Center)
+ {
+ labelPosition.X = position.X - size.Width/2F;
+ if(adjustForDrawing && !pixelSize.IsEmpty)
+ {
+ labelPosition.X -= 2f*pixelSize.Width;
+ labelPosition.Width += 4f*pixelSize.Width;
+ }
+ }
+
+ if(format.LineAlignment == StringAlignment.Far)
+ {
+ labelPosition.Y = position.Y - size.Height;
+ }
+ else if(format.LineAlignment == StringAlignment.Near)
+ {
+ labelPosition.Y = position.Y;
+ }
+ else if(format.LineAlignment == StringAlignment.Center)
+ {
+ labelPosition.Y = position.Y - size.Height/2F;
+ }
+
+ labelPosition.Y -= 1f * pixelSize.Height;
+
+ return labelPosition;
+ }
+
+ #endregion
+
+ #region 3D painting and Selection
+
+ /// <summary>
+ /// This method recalculates size of the point marker. This method is used
+ /// from Paint or Select method.
+ /// </summary>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ virtual protected void ProcessChartType3D(
+ bool selection,
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ Series seriesToDraw )
+ {
+
+ // Get list of series to draw
+ List<string> typeSeries = null;
+ if( (area.Area3DStyle.IsClustered && this.SideBySideSeries) ||
+ this.Stacked)
+ {
+ // Draw all series of the same chart type
+ typeSeries = area.GetSeriesFromChartType(Name);
+ }
+ else
+ {
+ // Draw just one chart series
+ typeSeries = new List<string>();
+ typeSeries.Add(seriesToDraw.Name);
+ }
+
+
+ //************************************************************
+ //** Get order of data points drawing
+ //************************************************************
+ ArrayList dataPointDrawingOrder = area.GetDataPointDrawingOrder(typeSeries, this, selection, COPCoordinates.X, null, this.YValueIndex, false);
+
+ //************************************************************
+ //** Loop through all data poins
+ //************************************************************
+ foreach(object obj in dataPointDrawingOrder)
+ {
+ // Process single point
+ ProcessSinglePoint3D(
+ (DataPoint3D) obj,
+ graph,
+ common,
+ area
+ );
+ }
+
+ // Finish processing 3D labels
+ this.DrawAccumulated3DLabels(graph, common, area);
+
+ }
+
+
+ /// <summary>
+ /// Draws\Hit tests single 3D point.
+ /// </summary>
+ /// <param name="pointEx">3D point information.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ internal void ProcessSinglePoint3D(
+ DataPoint3D pointEx,
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area
+ )
+ {
+ // Get point & series
+ DataPoint point = pointEx.dataPoint;
+ Series ser = point.series;
+
+ // Reset pre-calculated point position
+ point.positionRel = new PointF(float.NaN, float.NaN);
+
+ //************************************************************
+ //** Set active horizontal/vertical axis
+ //************************************************************
+ HAxis = area.GetAxis(AxisName.X, ser.XAxisType, ser.XSubAxisName);
+ VAxis = area.GetAxis(AxisName.Y, ser.YAxisType, ser.YSubAxisName);
+
+ //************************************************************
+ //** Check if point values are in the chart area
+ //************************************************************
+
+ // Check for min/max Y values
+ double yValue = GetYValue(common, area, ser, pointEx.dataPoint, pointEx.index - 1, YValueIndex);
+
+ // Axis is logarithmic
+ yValue = VAxis.GetLogValue( yValue );
+
+ if( yValue > VAxis.ViewMaximum || yValue < VAxis.ViewMinimum)
+ {
+ return;
+ }
+
+ // Check for min/max X values
+ double xValue = (pointEx.indexedSeries) ? (double)pointEx.index : point.XValue;
+ xValue = HAxis.GetLogValue(xValue);
+ if(xValue > HAxis.ViewMaximum || xValue < HAxis.ViewMinimum)
+ {
+ return;
+ }
+
+ // Check if point should be drawn on the edge of the data scaleView.
+ if(!ShouldDrawMarkerOnViewEdgeX())
+ {
+ // Check for min/max X values
+ if(xValue == HAxis.ViewMaximum && ShiftedX >= 0)
+ {
+ return;
+ }
+
+ // Check for min/max X values
+ if(xValue == HAxis.ViewMinimum && ShiftedX <= 0)
+ {
+ return;
+ }
+ }
+
+ //************************************************************
+ //** Get marker position and size
+ //************************************************************
+
+ // Get marker position
+ PointF markerPosition = PointF.Empty;
+ markerPosition.Y = (float)pointEx.yPosition;
+ markerPosition.X = (float)HAxis.GetLinearPosition(xValue); // No Log transformation required. Done above!
+
+ // Labels and markers have to be shifted if there
+ // is more than one series for column chart.
+ markerPosition.X += (float)ShiftedX;
+
+ // Remeber pre-calculated point position
+ point.positionRel = new PointF(markerPosition.X, markerPosition.Y);
+
+ // Get point some point properties and save them in variables
+ int pointMarkerSize = point.MarkerSize;
+ string pointMarkerImage = point.MarkerImage;
+ MarkerStyle pointMarkerStyle = point.MarkerStyle;
+
+ // Get marker size
+ SizeF markerSize = GetMarkerSize(
+ graph,
+ common,
+ area,
+ point,
+ pointMarkerSize,
+ pointMarkerImage);
+
+ //************************************************************
+ //** Transform marker position in 3D space
+ //************************************************************
+ // Get projection coordinates
+ Point3D[] marker3DPosition = new Point3D[1];
+ marker3DPosition[0] = new Point3D(markerPosition.X, markerPosition.Y, (float)(pointEx.zPosition + ((this.middleMarker) ? pointEx.depth/2f : pointEx.depth)));
+
+ // Transform coordinates of text size
+ area.matrix3D.TransformPoints(marker3DPosition);
+ PointF markerRotatedPosition = marker3DPosition[0].PointF;
+
+ //************************************************************
+ //** Draw point chart
+ //************************************************************
+ GraphicsPath rectPath = null;
+
+ if(alwaysDrawMarkers ||
+ pointMarkerStyle != MarkerStyle.None ||
+ pointMarkerImage.Length > 0)
+ {
+ // Check marker index
+ if((pointEx.index % ser.MarkerStep) == 0)
+ {
+ // Detect if we need to get graphical path of drawn object
+ DrawingOperationTypes drawingOperationType = DrawingOperationTypes.DrawElement;
+
+ if( common.ProcessModeRegions )
+ {
+ drawingOperationType |= DrawingOperationTypes.CalcElementPath;
+ }
+
+ // Start Svg Selection mode
+ graph.StartHotRegion( point );
+
+ // Draw the marker
+ rectPath = graph.DrawMarker3D(area.matrix3D,
+ area.Area3DStyle.LightStyle,
+ pointEx.zPosition + ((this.middleMarker) ? pointEx.depth/2f : pointEx.depth),
+ markerPosition,
+ (pointMarkerStyle == MarkerStyle.None) ? MarkerStyle.Circle : pointMarkerStyle,
+ (int)markerSize.Height,
+ (point.MarkerColor == Color.Empty) ? point.Color : point.MarkerColor,
+ (point.MarkerBorderColor == Color.Empty) ? point.BorderColor : point.MarkerBorderColor,
+ GetMarkerBorderSize(point),
+ pointMarkerImage,
+ point.MarkerImageTransparentColor,
+ (point.series != null) ? point.series.ShadowOffset : 0,
+ (point.series != null) ? point.series.ShadowColor : Color.Empty,
+ new RectangleF(markerRotatedPosition.X, markerRotatedPosition.Y, markerSize.Width, markerSize.Height),
+ drawingOperationType);
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+ }
+ }
+
+
+ //**********************************************************************
+ //** Data point label is not drawn with the data point. Instead the
+ //** information about label is collected and drawn when all points
+ //** with current Z position are drawn.
+ //** This is done to achieve correct Z order layering of labels.
+ //**********************************************************************
+ if(this.label3DInfoList != null &&
+ this.label3DInfoList.Count > 0 &&
+ ((Label3DInfo)this.label3DInfoList[this.label3DInfoList.Count-1]).PointEx.zPosition != pointEx.zPosition)
+ {
+ // Draw labels with information previously collected
+ this.DrawAccumulated3DLabels(graph, common, area);
+ }
+
+ // Check if labels info list was created
+ if(this.label3DInfoList == null)
+ {
+ this.label3DInfoList = new ArrayList();
+ }
+
+ // Store information about the label for future drawing
+ Label3DInfo label3DInfo = new Label3DInfo();
+ label3DInfo.PointEx = pointEx;
+ label3DInfo.MarkerPosition = markerRotatedPosition;
+ label3DInfo.MarkerSize = markerSize;
+ this.label3DInfoList.Add(label3DInfo);
+
+ if( common.ProcessModeRegions )
+ {
+ // Get relative marker size
+ SizeF relativeMarkerSize = graph.GetRelativeSize(markerSize);
+
+ // Insert area just after the last custom area
+ int insertIndex = common.HotRegionsList.FindInsertIndex();
+
+ // Insert circle area
+ if(pointMarkerStyle == MarkerStyle.Circle)
+ {
+ float[] circCoord = new float[3];
+ circCoord[0] = markerRotatedPosition.X;
+ circCoord[1] = markerRotatedPosition.Y;
+ circCoord[2] = relativeMarkerSize.Width/2f;
+
+ common.HotRegionsList.AddHotRegion(
+ insertIndex,
+ graph,
+ circCoord[0],
+ circCoord[1],
+ circCoord[2],
+ point,
+ ser.Name,
+ pointEx.index - 1
+ );
+ }
+
+ // Insert path for 3D bar
+ if(pointMarkerStyle == MarkerStyle.Square)
+ {
+ common.HotRegionsList.AddHotRegion(
+ rectPath,
+ false,
+ graph,
+ point,
+ ser.Name,
+ pointEx.index - 1
+ );
+ }
+
+ // All other markers represented as rectangles
+ else
+ {
+ common.HotRegionsList.AddHotRegion(
+ new RectangleF(markerRotatedPosition.X - relativeMarkerSize.Width/2f, markerRotatedPosition.Y - relativeMarkerSize.Height/2f, relativeMarkerSize.Width, relativeMarkerSize.Height),
+ point,
+ ser.Name,
+ pointEx.index - 1
+ );
+ }
+ }
+ if (rectPath != null)
+ {
+ rectPath.Dispose();
+ }
+ }
+
+ /// <summary>
+ /// Draws labels which are srored in the collection.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ internal void DrawAccumulated3DLabels(
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area)
+ {
+ if(this.label3DInfoList != null)
+ {
+ foreach(Label3DInfo labelInfo in this.label3DInfoList)
+ {
+ // Draw labels
+ DrawLabels(
+ area,
+ graph,
+ common,
+ labelInfo.MarkerPosition,
+ (int)labelInfo.MarkerSize.Height,
+ labelInfo.PointEx.dataPoint,
+ labelInfo.PointEx.dataPoint.series,
+ labelInfo.PointEx.index - 1);
+
+ }
+
+ // Clear labels info list
+ this.label3DInfoList.Clear();
+ }
+ }
+
+ #endregion
+
+ #region Marker and Labels related methods
+
+ /// <summary>
+ /// Indicates that markers are drawnd on the X edge of the data scaleView.
+ /// </summary>
+ /// <returns>True. Point chart always draws markers on the edge.</returns>
+ virtual protected bool ShouldDrawMarkerOnViewEdgeX()
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Gets marker border size.
+ /// </summary>
+ /// <param name="point">Data point.</param>
+ /// <returns>Marker border size.</returns>
+ virtual protected int GetMarkerBorderSize(DataPointCustomProperties point)
+ {
+ return point.MarkerBorderWidth;
+ }
+
+ /// <summary>
+ /// Gets label position. For point chart this function always returns 'Top'.
+ /// </summary>
+ /// <param name="series">Series.</param>
+ /// <param name="pointIndex">Data point index in series.</param>
+ /// <returns>Return automaticly detected label position.</returns>
+ virtual protected LabelAlignmentStyles GetAutoLabelPosition(Series series, int pointIndex)
+ {
+ return LabelAlignmentStyles.Top;
+ }
+
+ /// <summary>
+ /// Returns marker size.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="point">Data point.</param>
+ /// <param name="markerSize">Marker size.</param>
+ /// <param name="markerImage">Marker image.</param>
+ /// <returns>Marker width and height.</returns>
+ virtual protected SizeF GetMarkerSize(
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ DataPoint point,
+ int markerSize,
+ string markerImage)
+ {
+ SizeF size = new SizeF(markerSize, markerSize);
+ if (graph != null && graph.Graphics != null)
+ {
+ // Marker size is in pixels and we do the mapping for higher DPIs
+ size.Width = markerSize * graph.Graphics.DpiX / 96;
+ size.Height = markerSize * graph.Graphics.DpiY / 96;
+ }
+
+ if (markerImage.Length > 0) // Get image size
+ common.ImageLoader.GetAdjustedImageSize(markerImage, graph.Graphics, ref size);
+
+ return size;
+ }
+
+ #endregion
+
+ #region Labels shifting properties
+
+ /// <summary>
+ /// Labels and markers have to be shifted if there
+ /// is more than one series for column chart.
+ /// NOT USED IN POINT CHART.
+ /// </summary>
+ virtual public double ShiftedX
+ {
+ get
+ {
+ return 0;
+ }
+ set
+ {
+ }
+ }
+
+ /// <summary>
+ /// Labels and markers have to be shifted if there
+ /// is more than one series for column chart. This property
+ /// will give a name of the series, which is used, for
+ /// labels and markers.
+ /// NOT USED IN POINT CHART.
+ /// </summary>
+ virtual public string ShiftedSerName
+ {
+ get
+ {
+ return "";
+ }
+ set
+ {
+ }
+ }
+
+ #endregion
+
+ #region Y values related methods
+
+ /// <summary>
+ /// Helper function, which returns the Y value of the point.
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="area">Chart area the series belongs to.</param>
+ /// <param name="series">Sereis of the point.</param>
+ /// <param name="point">Point object.</param>
+ /// <param name="pointIndex">Index of the point.</param>
+ /// <param name="yValueIndex">Index of the Y value to get.</param>
+ /// <returns>Y value of the point.</returns>
+ virtual public double GetYValue(
+ CommonElements common,
+ ChartArea area,
+ Series series,
+ DataPoint point,
+ int pointIndex,
+ int yValueIndex)
+ {
+
+ // Point chart do not have height
+ if(yValueIndex == -1)
+ {
+ return 0.0;
+ }
+
+ // Check required Y values number
+ if (point.YValues.Length <= yValueIndex)
+ {
+ throw (new InvalidOperationException(SR.ExceptionChartTypeRequiresYValues(this.Name, this.YValuesPerPoint.ToString(CultureInfo.InvariantCulture))));
+ }
+
+ // Check empty point
+ if (point.IsEmpty || double.IsNaN(point.YValues[yValueIndex]))
+ {
+ double result = GetEmptyPointValue( point, pointIndex );
+
+ // NOTE: Fixes issue #6921
+ // If empty point Y value is zero then check if the scale of
+ // the Y axis and if it is not containing zero adjust the Y value
+ // of the empty point, so it will be visible
+ if (result == 0.0)
+ {
+ Axis yAxis = area.GetAxis(AxisName.Y, series.YAxisType, series.YSubAxisName);
+ double yViewMax = yAxis.maximum;
+ double yViewMin = yAxis.minimum;
+ if (result < yViewMin)
+ {
+ result = yViewMin;
+ }
+ else if (result > yViewMax)
+ {
+ result = yViewMax;
+ }
+ }
+
+ return result;
+ }
+
+ return point.YValues[yValueIndex];
+ }
+
+ /// <summary>
+ /// This method will find previous and next data point, which is not
+ /// empty and recalculate a new value for current empty data point.
+ /// New value depends on custom attribute “EmptyPointValue” and
+ /// it could be zero or average.
+ /// </summary>
+ /// <param name="point">IsEmpty data point.</param>
+ /// <param name="pointIndex">IsEmpty data point index.</param>
+ /// <returns>A Value for empty data point.</returns>
+ internal double GetEmptyPointValue( DataPoint point, int pointIndex )
+ {
+ Series series = point.series; // Data series
+ double previousPoint = 0; // Previous data point value (not empty)
+ double nextPoint = 0; // Next data point value (not empty)
+ int prevIndx = 0; // Previous data point index
+ int nextIndx = series.Points.Count - 1; // Next data point index
+
+ //************************************************************
+ //** Check custom attribute "EmptyPointValue"
+ //************************************************************
+ string emptyPointValue = "";
+ if( series.EmptyPointStyle.IsCustomPropertySet(CustomPropertyName.EmptyPointValue) )
+ {
+ emptyPointValue = series.EmptyPointStyle[CustomPropertyName.EmptyPointValue];
+ }
+ else if( series.IsCustomPropertySet(CustomPropertyName.EmptyPointValue) )
+ {
+ emptyPointValue = series[CustomPropertyName.EmptyPointValue];
+ }
+
+ // Take attribute value
+ if( String.Compare(emptyPointValue, "Zero", StringComparison.OrdinalIgnoreCase) == 0 )
+ {
+ // IsEmpty points represented with zero values
+ return 0.0;
+ }
+
+ //************************************************************
+ //** IsEmpty point value is an average of neighbour points
+ //************************************************************
+
+ // Find previous non-empty point value
+ for( int indx = pointIndex; indx >= 0; indx-- )
+ {
+ if( !series.Points[indx].IsEmpty )
+ {
+ previousPoint = series.Points[indx].YValues[YValueIndex];
+ prevIndx = indx;
+ break;
+ }
+ previousPoint = Double.NaN;
+ }
+
+ // Find next non-empty point value
+ for( int indx = pointIndex; indx < series.Points.Count; indx++ )
+ {
+ if( !series.Points[indx].IsEmpty )
+ {
+ nextPoint = series.Points[indx].YValues[YValueIndex];
+ nextIndx = indx;
+ break;
+ }
+ nextPoint = Double.NaN;
+ }
+
+ // All Previous points are empty
+ if( Double.IsNaN( previousPoint ) )
+ {
+ // All points are empty
+ if( Double.IsNaN( nextPoint ) )
+ {
+ previousPoint = 0;
+ }
+ else // Next point is equal to previous point
+ {
+ previousPoint = nextPoint;
+ }
+ }
+
+ // All next points are empty
+ if( Double.IsNaN( nextPoint ) )
+ {
+ // Previous point is equal to next point
+ nextPoint = previousPoint;
+ }
+
+ // If points value are the same use average
+ if( series.Points[nextIndx].XValue == series.Points[prevIndx].XValue )
+ {
+ return ( previousPoint + nextPoint ) / 2;
+ }
+
+ // Calculate and return average value
+ double aCoeff = (previousPoint - nextPoint) / (series.Points[nextIndx].XValue - series.Points[prevIndx].XValue);
+ return -aCoeff * (point.XValue - series.Points[prevIndx].XValue) + previousPoint;
+ }
+
+ #endregion
+
+ #region SmartLabelStyle methods
+
+ /// <summary>
+ /// Adds markers position to the list. Used to check SmartLabelStyle overlapping.
+ /// </summary>
+ /// <param name="common">Common chart elements.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="series">Series values to be used.</param>
+ /// <param name="list">List to add to.</param>
+ public void AddSmartLabelMarkerPositions(CommonElements common, ChartArea area, Series series, ArrayList list)
+ {
+ this.Common = common;
+ // Check if series is indexed
+ indexedSeries = ChartHelper.IndexedSeries(this.Common, area.GetSeriesFromChartType(this.Name).ToArray());
+
+ //************************************************************
+ //** Set active horizontal/vertical axis
+ //************************************************************
+ Axis hAxis = area.GetAxis(AxisName.X, series.XAxisType, series.XSubAxisName);
+ Axis vAxis = area.GetAxis(AxisName.Y, series.YAxisType, series.YSubAxisName);
+
+ //************************************************************
+ //** Loop through all data points in the series
+ //************************************************************
+ int markerIndex = 0; // Marker index
+ int index = 1; // Data points loop
+ foreach( DataPoint point in series.Points )
+ {
+ //************************************************************
+ //** Check if point values are in the chart area
+ //************************************************************
+
+ // Check for min/max Y values
+ double yValue = GetYValue(common, area, series, point, index - 1, YValueIndex);
+
+ // Axis is logarithmic
+ yValue = vAxis.GetLogValue( yValue );
+
+ if( yValue > vAxis.ViewMaximum || yValue < vAxis.ViewMinimum)
+ {
+ index++;
+ continue;
+ }
+
+ // Check for min/max X values
+ double xValue = (indexedSeries) ? (double)index : point.XValue;
+ xValue = hAxis.GetLogValue(xValue);
+ if(xValue > hAxis.ViewMaximum || xValue < hAxis.ViewMinimum)
+ {
+ index++;
+ continue;
+ }
+
+ // Check if point should be drawn on the edge of the data scaleView.
+ if(!ShouldDrawMarkerOnViewEdgeX())
+ {
+ // Check for min/max X values
+ if(xValue == hAxis.ViewMaximum && ShiftedX >= 0)
+ {
+ index++;
+ continue;
+ }
+
+ // Check for min/max X values
+ if(xValue == hAxis.ViewMinimum && ShiftedX <= 0)
+ {
+ index++;
+ continue;
+ }
+ }
+
+ //************************************************************
+ //** Get marker position and size
+ //************************************************************
+
+ // Get marker position
+ PointF markerPosition = PointF.Empty;
+ markerPosition.Y = (float)vAxis.GetLinearPosition(yValue);
+ if( indexedSeries )
+ {
+ // The formula for position is based on a distance
+ // from the grid line or nPoints position.
+ markerPosition.X = (float)hAxis.GetPosition( (double)index );
+ }
+ else
+ {
+ markerPosition.X = (float)hAxis.GetPosition( point.XValue );
+ }
+
+ // Labels and markers have to be shifted if there
+ // is more than one series for column chart.
+ markerPosition.X += (float)ShiftedX;
+
+ // Get point some point properties and save them in variables
+ int pointMarkerSize = point.MarkerSize;
+ string pointMarkerImage = point.MarkerImage;
+ MarkerStyle pointMarkerStyle = point.MarkerStyle;
+
+ // Get marker size
+ SizeF markerSize = GetMarkerSize(
+ common.graph,
+ common,
+ area,
+ point,
+ pointMarkerSize,
+ pointMarkerImage);
+
+ // Transform marker position in 3D space
+ if(area.Area3DStyle.Enable3D)
+ {
+ // Get series depth and Z position
+ float seriesDepth, seriesZPosition;
+ area.GetSeriesZPositionAndDepth(series, out seriesDepth, out seriesZPosition);
+
+ Point3D[] marker3DPosition = new Point3D[1];
+ marker3DPosition[0] = new Point3D(
+ markerPosition.X,
+ markerPosition.Y,
+ (float)(seriesZPosition + ((this.middleMarker) ? seriesDepth/2f : seriesDepth)));
+
+ // Transform coordinates
+ area.matrix3D.TransformPoints(marker3DPosition);
+ markerPosition = marker3DPosition[0].PointF;
+ }
+
+ // Check if marker visible
+ if(alwaysDrawMarkers ||
+ pointMarkerStyle != MarkerStyle.None ||
+ pointMarkerImage.Length > 0)
+ {
+ // Check marker index
+ if(markerIndex == 0)
+ {
+ markerSize = common.graph.GetRelativeSize(markerSize);
+
+ // Add marker position into the list
+ RectangleF markerRect = new RectangleF(
+ markerPosition.X - markerSize.Width / 2f,
+ markerPosition.Y - markerSize.Height / 2f,
+ markerSize.Width,
+ markerSize.Height);
+ list.Add(markerRect);
+ }
+
+ // Increase the markers counter
+ ++markerIndex;
+ if(series.MarkerStep == markerIndex)
+ {
+ markerIndex = 0;
+ }
+ }
+
+ ++index;
+ }
+ }
+
+ #endregion
+
+ #region 3D Label Info class
+
+ /// <summary>
+ /// 3D LabelStyle info.
+ /// </summary>
+ internal class Label3DInfo
+ {
+ internal DataPoint3D PointEx = null;
+ internal PointF MarkerPosition = PointF.Empty;
+ internal SizeF MarkerSize = SizeF.Empty;
+ }
+
+ #endregion // 3D Label Info class
+
+ #region IDisposable interface implementation
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected virtual void Dispose(bool disposing)
+ {
+ //Nothing to dispose at the base class.
+ }
+
+ /// <summary>
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// </summary>
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/PolarChart.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/PolarChart.cs
new file mode 100644
index 00000000000..15837fb225f
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/PolarChart.cs
@@ -0,0 +1,271 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: PolarChart.cs
+//
+// Namespace: DataVisualization.Charting.ChartTypes
+//
+// Classes: PolarChart
+//
+// Purpose: Polar chart type is similar to the Radar chart.
+// All the drawing functionality is located in the
+// RadarChart class and PolarChart class provides
+// positionning and style methods required only in
+// Polar chart.
+//
+// Polar Chart Overview:
+// ---------------------
+//
+// The polar chart type is a circular graph on which data points
+// are displayed using the angle, and the distance from the center
+// point. The X axis is located on the boundaries of the circle and
+// the Y axis connects the center of the circle with the X axis.
+//
+// By default, the angle scale ranges from 0 to 360 degrees. However,
+// the X Axis Minimum and Maximum properties may be used to specify
+// a different angular scale. The Minimum angle value starts at the
+// top (12 O'Clock position) of the chart but can be changed to
+// another angle using the Crossing property. For example, setting
+// the Crossing property to 90 will move the "zero" value to the
+// 3 O'Clock position.
+//
+// Reviewed: AG - Microsoft 6, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Resources;
+using System.Reflection;
+using System.Collections;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+
+#if Microsoft_CONTROL
+using System.Windows.Forms.DataVisualization.Charting;
+using System.Windows.Forms.DataVisualization.Charting.Data;
+using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+using System.Windows.Forms.DataVisualization.Charting.Utilities;
+using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+
+#else
+using System.Web.UI.DataVisualization.Charting;
+
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.ChartTypes
+#else
+ namespace System.Web.UI.DataVisualization.Charting.ChartTypes
+#endif
+{
+ /// <summary>
+ /// PolarChart class uses its base class RadarChart to perform most of the
+ /// drawing and calculation operations.
+ /// </summary>
+ internal class PolarChart : RadarChart
+ {
+ #region Constructors
+
+ /// <summary>
+ /// Class public constructor.
+ /// </summary>
+ public PolarChart()
+ {
+ }
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ override public string Name { get{ return ChartTypeNames.Polar;}}
+
+ #endregion
+
+ #region ICircularChartType interface implementation
+
+ /// <summary>
+ /// Checks if closed figure should be drawn even in Line drawing mode.
+ /// </summary>
+ /// <returns>True if closed figure should be drawn even in Line drawing mode.</returns>
+ public override bool RequireClosedFigure()
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// Checks if Y axis position may be changed using X axis Crossing property.
+ /// </summary>
+ /// <returns>True if Y axis position may be changed using X axis Crossing property.</returns>
+ public override bool XAxisCrossingSupported()
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Checks if automatic X axis labels are supported.
+ /// </summary>
+ /// <returns>True if automatic X axis labels are supported.</returns>
+ public override bool XAxisLabelsSupported()
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Checks if radial grid lines (X axis) are supported by the chart type.
+ /// </summary>
+ /// <returns>True if radial grid lines are supported.</returns>
+ public override bool RadialGridLinesSupported()
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Gets number of sectors in the circular chart area.
+ /// </summary>
+ /// <param name="area">Chart area to get number of sectors for.</param>
+ /// <param name="seriesCollection">Collection of series.</param>
+ /// <returns>Returns number of sectors in circular chart.</returns>
+ public override int GetNumerOfSectors(ChartArea area, SeriesCollection seriesCollection)
+ {
+ // By default we split polar chart into 12 sectors (30 degrees in case of 360 degrees scale)
+ int sectorNumber = 12;
+
+ // Custom interval is set on the X axis
+ double interval = area.AxisX.Interval;
+ if(area.AxisX.LabelStyle.GetInterval() > 0)
+ {
+ interval = area.AxisX.LabelStyle.GetInterval();
+ }
+ if(interval != 0)
+ {
+ // Get X axis scale size
+ double max = (area.AxisX.AutoMaximum) ? 360.0 : area.AxisX.Maximum;
+ double min = (area.AxisX.AutoMinimum) ? 0.0 : area.AxisX.Minimum;
+
+ // Calculate number of sectors
+ sectorNumber = (int)(Math.Abs(max - min) / interval);
+ }
+
+ return sectorNumber;
+ }
+
+ /// <summary>
+ /// Get a location of Y axis in degrees.
+ /// </summary>
+ /// <param name="area">Chart area to get Y axes locations for.</param>
+ /// <returns>Returns an array of one or more locations of Y axis.</returns>
+ public override float[] GetYAxisLocations(ChartArea area)
+ {
+ float[] axesLocation = new float[1];
+ axesLocation[0] = 0f;
+
+ // Check if X axis crossing is set to change location of Y axis
+ if( !double.IsNaN(area.AxisX.Crossing) )
+ {
+ axesLocation[0] = (float)area.AxisX.Crossing;
+ while(axesLocation[0] < 0)
+ {
+ axesLocation[0] = 360f + axesLocation[0];
+ }
+
+ }
+
+ return axesLocation;
+ }
+
+ #endregion // ICircularChartType interface implementation
+
+ #region Helper Methods
+
+ /// <summary>
+ /// Gets polar chart drawing style.
+ /// </summary>
+ /// <param name="ser">Chart series.</param>
+ /// <param name="point">Series point.</param>
+ /// <returns>Returns polar drawing style.</returns>
+ override protected RadarDrawingStyle GetDrawingStyle(Series ser, DataPoint point)
+ {
+ RadarDrawingStyle drawingStyle = RadarDrawingStyle.Line;
+ if (point.IsCustomPropertySet(CustomPropertyName.PolarDrawingStyle) ||
+ ser.IsCustomPropertySet(CustomPropertyName.PolarDrawingStyle))
+ {
+ string attributeValue =
+ (point.IsCustomPropertySet(CustomPropertyName.PolarDrawingStyle)) ?
+ point[CustomPropertyName.PolarDrawingStyle] :
+ ser[CustomPropertyName.PolarDrawingStyle];
+ if(String.Compare(attributeValue, "Line", StringComparison.OrdinalIgnoreCase ) == 0)
+ {
+ drawingStyle = RadarDrawingStyle.Line;
+ }
+ else if(String.Compare(attributeValue, "Marker", StringComparison.OrdinalIgnoreCase ) == 0)
+ {
+ drawingStyle = RadarDrawingStyle.Marker;
+ }
+ else
+ {
+ throw(new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid(attributeValue, "PolarDrawingStyle")));
+ }
+ }
+ return drawingStyle;
+ }
+
+ /// <summary>
+ /// Fills a PointF array of data points absolute pixel positions.
+ /// </summary>
+ /// <param name="graph">Graphics object.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="series">Point series.</param>
+ /// <returns>Array of data points position.</returns>
+ override protected PointF[] GetPointsPosition(ChartGraphics graph, ChartArea area, Series series)
+ {
+ PointF[] pointPos = new PointF[series.Points.Count + 1];
+ int index = 0;
+ foreach( DataPoint point in series.Points )
+ {
+ // Change Y value if line is out of plot area
+ double yValue = GetYValue(Common, area, series, point, index, 0);
+
+ // Recalculates y position
+ double yPosition = area.AxisY.GetPosition( yValue );
+
+ // Recalculates x position
+ double xPosition = area.circularCenter.X;
+
+ // Add point position into array
+ pointPos[index] = graph.GetAbsolutePoint(new PointF((float)xPosition, (float)yPosition));
+
+ // Rotate position
+ float sectorAngle = area.CircularPositionToAngle(point.XValue);
+ Matrix matrix = new Matrix();
+ matrix.RotateAt(sectorAngle, graph.GetAbsolutePoint(area.circularCenter));
+ PointF[] rotatedPoint = new PointF[] { pointPos[index] };
+ matrix.TransformPoints(rotatedPoint);
+ pointPos[index] = rotatedPoint[0];
+
+ index++;
+ }
+
+ // Add last center point
+ pointPos[index] = graph.GetAbsolutePoint(area.circularCenter);
+
+ return pointPos;
+ }
+
+ #endregion // Helper Methods
+ }
+}
+
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/RadarChart.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/RadarChart.cs
new file mode 100644
index 00000000000..bf94333c944
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/RadarChart.cs
@@ -0,0 +1,1685 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: RadarChart.cs
+//
+// Namespace: DataVisualization.Charting.ChartTypes
+//
+// Classes: RadarChart, ICircularChartType
+//
+// Purpose: Provides 2D/3D drawing and hit testing functionality
+// for the Radar chart. RadarChart class is used as a
+// base class for the PolarChart.
+//
+// Reviewed: GS - Jul 15, 2003
+// AG - Microsoft 6, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Resources;
+using System.Reflection;
+using System.Collections;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+
+#if Microsoft_CONTROL
+using System.Windows.Forms.DataVisualization.Charting;
+using System.Windows.Forms.DataVisualization.Charting.Data;
+using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+using System.Windows.Forms.DataVisualization.Charting.Utilities;
+using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+
+#else
+using System.Web.UI.DataVisualization.Charting;
+
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+namespace System.Windows.Forms.DataVisualization.Charting.ChartTypes
+#else
+namespace System.Web.UI.DataVisualization.Charting.ChartTypes
+#endif
+{
+ #region Enumerations
+
+ /// <summary>
+ /// Circular chart drawing style.
+ /// </summary>
+ internal enum RadarDrawingStyle
+ {
+ /// <summary>
+ /// Series are drawn as filled areas.
+ /// </summary>
+ Area,
+ /// <summary>
+ /// Series are drawn as lines.
+ /// </summary>
+ Line,
+ /// <summary>
+ /// Series are drawn as markers.
+ /// </summary>
+ Marker
+ }
+
+ #endregion // Enumerations
+
+ /// <summary>
+ /// RadarChart class provides 2D/3D drawing and hit testing
+ /// functionality for the Radar chart. It is also used as a
+ /// base class for the PolarChart.
+ /// </summary>
+ internal class RadarChart : IChartType, ICircularChartType
+ {
+ #region Fields
+
+ /// <summary>
+ /// Common elements object
+ /// </summary>
+ internal CommonElements Common { get; set; }
+
+ /// <summary>
+ /// Chart area object
+ /// </summary>
+ internal ChartArea Area { get; set; }
+
+ /// <summary>
+ /// Auto label position flag
+ /// </summary>
+ private bool _autoLabelPosition = true;
+
+ /// <summary>
+ /// Label position
+ /// </summary>
+ private LabelAlignmentStyles _labelPosition = LabelAlignmentStyles.Top;
+
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// Class public constructor.
+ /// </summary>
+ public RadarChart()
+ {
+ }
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ virtual public string Name { get{ return ChartTypeNames.Radar;}}
+
+ /// <summary>
+ /// True if chart type is stacked
+ /// </summary>
+ virtual public bool Stacked { get{ return false;}}
+
+
+ /// <summary>
+ /// True if stacked chart type supports groups
+ /// </summary>
+ virtual public bool SupportStackedGroups { get { return false; } }
+
+
+ /// <summary>
+ /// True if stacked chart type should draw separately positive and
+ /// negative data points ( Bar and column Stacked types ).
+ /// </summary>
+ public bool StackSign { get{ return false;}}
+
+ /// <summary>
+ /// True if chart type supports axes
+ /// </summary>
+ virtual public bool RequireAxes { get{ return true;} }
+
+ /// <summary>
+ /// Chart type with two y values used for scale ( bubble chart type )
+ /// </summary>
+ public bool SecondYScale{ get{ return false;} }
+
+ /// <summary>
+ /// True if chart type requires circular chart area.
+ /// </summary>
+ public bool CircularChartArea { get{ return true;} }
+
+ /// <summary>
+ /// True if chart type supports logarithmic axes
+ /// </summary>
+ virtual public bool SupportLogarithmicAxes { get{ return false;} }
+
+ /// <summary>
+ /// True if chart type requires to switch the value (Y) axes position
+ /// </summary>
+ virtual public bool SwitchValueAxes { get{ return false;} }
+
+ /// <summary>
+ /// True if chart series can be placed side-by-side.
+ /// </summary>
+ virtual public bool SideBySideSeries { get{ return false;} }
+
+ /// <summary>
+ /// True if each data point of a chart must be represented in the legend
+ /// </summary>
+ virtual public bool DataPointsInLegend { get{ return false;} }
+
+ /// <summary>
+ /// If the crossing value is auto Crossing value should be
+ /// automatically set to zero for some chart
+ /// types (Bar, column, area etc.)
+ /// </summary>
+ virtual public bool ZeroCrossing { get{ return false;} }
+
+ /// <summary>
+ /// True if palette colors should be applied for each data point.
+ /// Otherwise the color is applied to the series.
+ /// </summary>
+ virtual public bool ApplyPaletteColorsToPoints { get { return false; } }
+
+ /// <summary>
+ /// Indicates that extra Y values are connected to the scale of the Y axis
+ /// </summary>
+ virtual public bool ExtraYValuesConnectedToYAxis{ get { return false; } }
+
+ /// <summary>
+ /// Indicates that this is a one hundred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ virtual public bool HundredPercent{ get{return false;} }
+
+ /// <summary>
+ /// Indicates that negative 100% stacked values are shown on
+ /// the other side of the X axis
+ /// </summary>
+ virtual public bool HundredPercentSupportNegative{ get{return false;} }
+
+ /// <summary>
+ /// How to draw series/points in legend:
+ /// Filled rectangle, Line or Marker
+ /// </summary>
+ /// <param name="series">Legend item series.</param>
+ /// <returns>Legend item style.</returns>
+ virtual public LegendImageStyle GetLegendImageStyle(Series series)
+ {
+ if(series != null)
+ {
+ RadarDrawingStyle drawingStyle = GetDrawingStyle(series, new DataPoint(series));
+ if(drawingStyle == RadarDrawingStyle.Line)
+ {
+ return LegendImageStyle.Line;
+ }
+ else if(drawingStyle == RadarDrawingStyle.Marker)
+ {
+ return LegendImageStyle.Marker;
+ }
+ }
+ return LegendImageStyle.Rectangle;
+ }
+
+ /// <summary>
+ /// Number of supported Y value(s) per point
+ /// </summary>
+ virtual public int YValuesPerPoint { get { return 1; } }
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ virtual public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+
+ #endregion
+
+ #region ICircularChartType interface implementation
+
+ /// <summary>
+ /// Checks if closed figure should be drawn even in Line drawing mode.
+ /// </summary>
+ /// <returns>True if closed figure should be drawn even in Line drawing mode.</returns>
+ public virtual bool RequireClosedFigure()
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Checks if Y axis position may be changed using X axis Crossing property.
+ /// </summary>
+ /// <returns>True if Y axis position may be changed using X axis Crossing property.</returns>
+ public virtual bool XAxisCrossingSupported()
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// Checks if automatic X axis labels are supported.
+ /// </summary>
+ /// <returns>True if automatic X axis labels are supported.</returns>
+ public virtual bool XAxisLabelsSupported()
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// Checks if radial grid lines (X axis) are supported by the chart type.
+ /// </summary>
+ /// <returns>True if radial grid lines are supported.</returns>
+ public virtual bool RadialGridLinesSupported()
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// Gets number of sectors in the circular chart area.
+ /// </summary>
+ /// <param name="area">Chart area to get number of sectors for.</param>
+ /// <param name="seriesCollection">Collection of series.</param>
+ /// <returns>Returns number of sectors in circular chart.</returns>
+ public virtual int GetNumerOfSectors(ChartArea area, SeriesCollection seriesCollection)
+ {
+ int sectorNumber = 0;
+
+ // Get maximum number of points in all series
+ foreach(Series series in seriesCollection)
+ {
+ if(series.IsVisible() && series.ChartArea == area.Name)
+ {
+ sectorNumber = (int)Math.Max(series.Points.Count, sectorNumber);
+ }
+ }
+ return sectorNumber;
+ }
+
+ /// <summary>
+ /// Get a location of each Y axis in degrees.
+ /// </summary>
+ /// <param name="area">Chart area to get Y axes locations for.</param>
+ /// <returns>Returns an array of one or more locations of Y axis.</returns>
+ public virtual float[] GetYAxisLocations(ChartArea area)
+ {
+ float[] axesLocation = new float[area.CircularSectorsNumber];
+ float sectorSize = 360f / ((float)axesLocation.Length);
+ for(int index = 0; index < axesLocation.Length; index++)
+ {
+ axesLocation[index] = sectorSize * index;
+ }
+ return axesLocation;
+ }
+
+ #endregion // ICircularChartType interface implementation
+
+ #region Painting and Selection
+
+ /// <summary>
+ /// Paint Radar Chart.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ virtual public void Paint( ChartGraphics graph, CommonElements common, ChartArea area, Series seriesToDraw )
+ {
+ this.Common = common;
+ this.Area = area;
+
+ // Draw chart
+ ProcessChartType( false, graph, common, area, seriesToDraw );
+ }
+
+ /// <summary>
+ /// This method recalculates size of the bars. This method is used
+ /// from Paint or Select method.
+ /// </summary>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ virtual protected void ProcessChartType(
+ bool selection,
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ Series seriesToDraw )
+ {
+
+ //************************************************************
+ //** Loop through all series
+ //************************************************************
+ foreach( Series ser in common.DataManager.Series )
+ {
+ // Process only series in this chart area
+ if( ser.ChartArea != area.Name || !ser.IsVisible())
+ {
+ continue;
+ }
+
+ // All series attached to this chart area must have Radar chart type
+ if(String.Compare( ser.ChartTypeName, this.Name, true, System.Globalization.CultureInfo.CurrentCulture ) != 0 )
+ {
+ throw(new InvalidOperationException(SR.ExceptionChartTypeCanNotCombine(ser.ChartTypeName, this.Name)));
+ }
+
+ //************************************************************
+ //** Call Back Paint event
+ //************************************************************
+ if( !selection )
+ {
+ common.Chart.CallOnPrePaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+
+ // Chart type do not supprot secondary axes
+ //if (ser.YAxisType == AxisType.Secondary)
+ //{
+ // throw (new InvalidOperationException(SR.ExceptionChartTypeSecondaryYAxisUnsupported(this.Name)));
+ //}
+ //if (ser.XAxisType == AxisType.Secondary)
+ //{
+ // throw (new InvalidOperationException(SR.ExceptionChartTypeSecondaryXAxisUnsupported(this.Name)));
+ //}
+
+ // Set active vertical axis and scaleView boundary
+ Axis vAxis = area.GetAxis(AxisName.Y, AxisType.Primary, ser.YSubAxisName);
+ double vAxisMin = vAxis.ViewMinimum;
+ double vAxisMax = vAxis.ViewMaximum;
+
+ //************************************************************
+ //** Fill the array of data points coordinates (absolute)
+ //************************************************************
+ PointF[] dataPointPos = GetPointsPosition(graph, area, ser);
+
+ //************************************************************
+ //** Draw shadow of area first
+ //************************************************************
+ int index = 0; // Data points loop
+ if(ser.ShadowOffset != 0 && !selection)
+ {
+ foreach( DataPoint point in ser.Points )
+ {
+ // Calculate second point index
+ int secondPointIndex = index + 1;
+ if(secondPointIndex >= ser.Points.Count)
+ {
+ secondPointIndex = 0;
+ }
+
+ // Get visual properties of the point
+ DataPointCustomProperties pointAttributes = point;
+
+ if(ser.Points[secondPointIndex].IsEmpty)
+ {
+ pointAttributes = ser.Points[secondPointIndex];
+ }
+
+
+ //************************************************************
+ //** Check what is the main element of radar point. It can be
+ //** area (default), line or marker.
+ //************************************************************
+ Color areaColor = pointAttributes.Color;
+ Color borderColor = pointAttributes.BorderColor;
+ int borderWidth = pointAttributes.BorderWidth;
+ ChartDashStyle borderDashStyle = pointAttributes.BorderDashStyle;
+ RadarDrawingStyle drawingStyle = GetDrawingStyle(ser, point);
+
+ // Check if point Y value is in axis scaleView
+ if(vAxis.GetLogValue(point.YValues[0]) > vAxisMax || vAxis.GetLogValue(point.YValues[0]) < vAxisMin ||
+ vAxis.GetLogValue(ser.Points[secondPointIndex].YValues[0]) > vAxisMax || vAxis.GetLogValue(ser.Points[secondPointIndex].YValues[0]) < vAxisMin)
+ {
+ ++index;
+ continue;
+ }
+
+ if(drawingStyle == RadarDrawingStyle.Line)
+ {
+ // Use the main color for the border and make sure border is visible
+ borderColor = pointAttributes.Color;
+ borderWidth = (borderWidth < 1) ? 1 : borderWidth;
+ borderDashStyle = (borderDashStyle == ChartDashStyle.NotSet) ? ChartDashStyle.Solid : borderDashStyle;
+
+ // Area is not visible
+ areaColor = Color.Transparent;
+ }
+ else if(drawingStyle == RadarDrawingStyle.Marker)
+ {
+ // Area is not visible
+ areaColor = Color.Transparent;
+ }
+
+ // Check if line should be always closed
+ if(secondPointIndex == 0 &&
+ !RequireClosedFigure() &&
+ drawingStyle != RadarDrawingStyle.Area)
+ {
+ break;
+ }
+
+ //************************************************************
+ //** Fill area
+ //************************************************************
+ if (areaColor != Color.Transparent && areaColor != Color.Empty && ser.ShadowOffset != 0)
+ {
+ // Create sector path
+ using (GraphicsPath fillPath = new GraphicsPath())
+ {
+ fillPath.AddLine(graph.GetAbsolutePoint(area.circularCenter), dataPointPos[index]);
+ fillPath.AddLine(dataPointPos[index], dataPointPos[secondPointIndex]);
+ fillPath.AddLine(dataPointPos[secondPointIndex], graph.GetAbsolutePoint(area.circularCenter));
+
+ // Shift shadow position
+ Matrix shadowMatrix = new Matrix();
+ shadowMatrix.Translate(ser.ShadowOffset, ser.ShadowOffset);
+ fillPath.Transform(shadowMatrix);
+
+ // Fill shadow sector
+ using (Brush brush = new SolidBrush(ser.ShadowColor))
+ {
+ graph.FillPath(brush, fillPath);
+ }
+ }
+ }
+
+ // Increase index
+ ++index;
+ }
+ }
+
+
+ //************************************************************
+ //** Loop through all data points in the series and fill areas
+ //** and draw border lines.
+ //************************************************************
+ index = 0; // Data points loop
+ foreach( DataPoint point in ser.Points )
+ {
+ // Set pre-calculated point position
+ point.positionRel = graph.GetRelativePoint(dataPointPos[index]);
+
+ // Calculate second point index
+ int secondPointIndex = index + 1;
+ if(secondPointIndex >= ser.Points.Count)
+ {
+ secondPointIndex = 0;
+ }
+
+ // Get visual properties of the point
+ DataPointCustomProperties pointAttributes = point;
+
+ if(ser.Points[secondPointIndex].IsEmpty)
+ {
+ pointAttributes = ser.Points[secondPointIndex];
+ }
+
+
+ //************************************************************
+ //** Check what is the main element of radar point. It can be
+ //** area (default), line or marker.
+ //************************************************************
+ Color areaColor = pointAttributes.Color;
+ Color borderColor = pointAttributes.BorderColor;
+ int borderWidth = pointAttributes.BorderWidth;
+ ChartDashStyle borderDashStyle = pointAttributes.BorderDashStyle;
+ RadarDrawingStyle drawingStyle = GetDrawingStyle(ser, point);
+
+ // Check if point Y value is in axis scaleView
+ if(vAxis.GetLogValue(point.YValues[0]) > vAxisMax || vAxis.GetLogValue(point.YValues[0]) < vAxisMin ||
+ vAxis.GetLogValue(ser.Points[secondPointIndex].YValues[0]) > vAxisMax || vAxis.GetLogValue(ser.Points[secondPointIndex].YValues[0]) < vAxisMin)
+ {
+ ++index;
+ continue;
+ }
+
+ if(drawingStyle == RadarDrawingStyle.Line)
+ {
+ // Use the main color for the border and make sure border is visible
+ borderColor = pointAttributes.Color;
+ borderWidth = (borderWidth < 1) ? 1 : borderWidth;
+ borderDashStyle = (borderDashStyle == ChartDashStyle.NotSet) ? ChartDashStyle.Solid : borderDashStyle;
+
+ // Area is not visible
+ areaColor = Color.Transparent;
+ }
+ else if(drawingStyle == RadarDrawingStyle.Marker)
+ {
+ // Area is not visible
+ areaColor = Color.Transparent;
+ }
+
+ // Check if line should be always closed
+ using (GraphicsPath selectionPath = new GraphicsPath())
+ {
+ if (secondPointIndex == 0 &&
+ !RequireClosedFigure() &&
+ drawingStyle != RadarDrawingStyle.Area)
+ {
+ // Process hot region for the last point
+ if (common.ProcessModeRegions)
+ {
+ // Add area to the selection path
+ AddSelectionPath(area, selectionPath, dataPointPos, index, secondPointIndex, graph.GetAbsolutePoint(area.circularCenter), 0);
+
+ // Insert area just after the last custom area
+ int insertIndex = common.HotRegionsList.FindInsertIndex();
+
+ // Insert area
+ common.HotRegionsList.AddHotRegion(
+ insertIndex,
+ selectionPath,
+ false,
+ graph,
+ point,
+ ser.Name,
+ index);
+ }
+ break;
+ }
+
+ //************************************************************
+ //** Fill area
+ //************************************************************
+ if (areaColor != Color.Transparent && areaColor != Color.Empty)
+ {
+ // Create sector path
+ using (GraphicsPath fillPath = new GraphicsPath())
+ {
+ fillPath.AddLine(graph.GetAbsolutePoint(area.circularCenter), dataPointPos[index]);
+ fillPath.AddLine(dataPointPos[index], dataPointPos[secondPointIndex]);
+ fillPath.AddLine(dataPointPos[secondPointIndex], graph.GetAbsolutePoint(area.circularCenter));
+
+ if (common.ProcessModePaint)
+ {
+ // Create fill brush
+ using (Brush brush = graph.CreateBrush(
+ fillPath.GetBounds(),
+ areaColor,
+ pointAttributes.BackHatchStyle,
+ pointAttributes.BackImage,
+ pointAttributes.BackImageWrapMode,
+ pointAttributes.BackImageTransparentColor,
+ pointAttributes.BackGradientStyle,
+ pointAttributes.BackSecondaryColor))
+ {
+
+ // Start Svg Selection mode
+ graph.StartHotRegion(point);
+
+ // Fill sector
+ graph.FillPath(brush, fillPath);
+
+ // End Svg Selection mode
+ graph.EndHotRegion();
+ }
+ }
+ }
+
+ if (common.ProcessModeRegions)
+ {
+ // Add area to the selection path
+ AddSelectionPath(area, selectionPath, dataPointPos, index, secondPointIndex, graph.GetAbsolutePoint(area.circularCenter), 0);
+ }
+
+ }
+
+ //************************************************************
+ //** Draw Line
+ //************************************************************
+ if (borderColor != Color.Empty && borderWidth > 0 && borderDashStyle != ChartDashStyle.NotSet)
+ {
+ if (secondPointIndex < ser.Points.Count)
+ {
+ if (common.ProcessModePaint)
+ {
+ // Start Svg Selection mode
+ graph.StartHotRegion(point);
+
+ graph.DrawLineAbs(
+ borderColor,
+ borderWidth,
+ borderDashStyle,
+ dataPointPos[index],
+ dataPointPos[secondPointIndex],
+ ser.ShadowColor,
+ (areaColor == Color.Transparent || areaColor == Color.Empty) ? ser.ShadowOffset : 0);
+
+ // End Svg Selection mode
+ graph.EndHotRegion();
+ }
+
+ if (common.ProcessModeRegions)
+ {
+ // Add line to the selection path
+ AddSelectionPath(area, selectionPath, dataPointPos, index, secondPointIndex, PointF.Empty, borderWidth);
+ }
+ }
+ }
+
+ //************************************************************
+ //** Image map for the area and line
+ //************************************************************
+ if (common.ProcessModeRegions)
+ {
+ // Insert area just after the last custom area
+ int insertIndex = common.HotRegionsList.FindInsertIndex();
+
+ // Insert area
+ common.HotRegionsList.AddHotRegion(
+ insertIndex,
+ selectionPath,
+ false,
+ graph,
+ point,
+ ser.Name,
+ index);
+ }
+ }
+ // Increase index
+ ++index;
+ }
+
+ //************************************************************
+ //** Loop through all data points in the series and draw
+ //** markers and points labels.
+ //************************************************************
+ int markerIndex = 0; // Marker index
+ index = 0; // Data points loop
+ foreach( DataPoint point in ser.Points )
+ {
+ //************************************************************
+ //** Check what is the main element of radar point. It can be
+ //** area (default), line or marker.
+ //************************************************************
+ Color markerColor = point.MarkerColor;
+ MarkerStyle markerStyle = point.MarkerStyle;
+ RadarDrawingStyle drawingStyle = GetDrawingStyle(ser, point);
+
+ // Check if point Y value is in axis scaleView
+ if(vAxis.GetLogValue(point.YValues[0]) > vAxisMax ||
+ vAxis.GetLogValue(point.YValues[0]) < vAxisMin)
+ {
+ ++index;
+ continue;
+ }
+
+ if(drawingStyle == RadarDrawingStyle.Marker &&
+ markerColor.IsEmpty)
+ {
+ // Set main color to marker
+ markerColor = point.Color;
+ }
+
+ //************************************************************
+ //** Get marker size
+ //************************************************************
+ // Get marker size
+ SizeF markerSize = GetMarkerSize(
+ graph,
+ common,
+ area,
+ point,
+ point.MarkerSize,
+ point.MarkerImage);
+
+ //************************************************************
+ //** Draw point chart
+ //************************************************************
+ if( common.ProcessModePaint )
+ {
+ if(markerStyle != MarkerStyle.None || point.MarkerImage.Length > 0)
+ {
+ // If marker style is set and color is not - use main color of point
+ if(markerColor.IsEmpty)
+ {
+ markerColor = point.Color;
+ }
+
+ // Check marker index
+ if(markerIndex == 0)
+ {
+ // Start Svg Selection mode
+ graph.StartHotRegion( point );
+
+ // Draw the marker
+ graph.DrawMarkerAbs(dataPointPos[index],
+ markerStyle,
+ (int)markerSize.Height,
+ markerColor,
+ point.MarkerBorderColor,
+ point.MarkerBorderWidth,
+ point.MarkerImage,
+ point.MarkerImageTransparentColor,
+ (point.series != null) ? point.series.ShadowOffset : 0,
+ (point.series != null) ? point.series.ShadowColor : Color.Empty,
+ new RectangleF(dataPointPos[index].X, dataPointPos[index].Y, markerSize.Width, markerSize.Height),
+ false);
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+ }
+
+ // Increase the markers counter
+ ++markerIndex;
+ if(ser.MarkerStep == markerIndex)
+ {
+ markerIndex = 0;
+ }
+ }
+
+ // Draw labels
+ DrawLabels(
+ area,
+ graph,
+ common,
+ dataPointPos[index],
+ (int)markerSize.Height,
+ point,
+ ser,
+ index);
+ }
+
+ if( common.ProcessModeRegions )
+ {
+ // Get relative marker size
+ SizeF relativeMarkerSize = graph.GetRelativeSize(markerSize);
+
+ // Get relative marker position
+ PointF relativeMarkerPosition = graph.GetRelativePoint(dataPointPos[index]);
+
+ // Insert area just after the last custom area
+ int insertIndex = common.HotRegionsList.FindInsertIndex();
+
+ // Insert circle area
+ if(point.MarkerStyle == MarkerStyle.Circle)
+ {
+ float[] circCoord = new float[3];
+ circCoord[0] = relativeMarkerPosition.X;
+ circCoord[1] = relativeMarkerPosition.Y;
+ circCoord[2] = relativeMarkerSize.Width/2f;
+
+ common.HotRegionsList.AddHotRegion(
+ insertIndex,
+ graph,
+ circCoord[0],
+ circCoord[1],
+ circCoord[2],
+ point,
+ ser.Name,
+ index );
+ }
+
+ // All other markers represented as rectangles
+ else
+ {
+ common.HotRegionsList.AddHotRegion(
+ new RectangleF(relativeMarkerPosition.X - relativeMarkerSize.Width/2f, relativeMarkerPosition.Y - relativeMarkerSize.Height/2f, relativeMarkerSize.Width, relativeMarkerSize.Height),
+ point,
+ ser.Name,
+ index );
+ }
+ }
+
+ ++index;
+ }
+
+ // Call Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPrePaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+ }
+ }
+
+ /// <summary>
+ /// Creates selection path for one data point.
+ /// </summary>
+ /// <param name="area">Chart area object.</param>
+ /// <param name="selectionPath">Selection path used for data storing.</param>
+ /// <param name="dataPointPos">Array of points positions.</param>
+ /// <param name="firstPointIndex">First point index.</param>
+ /// <param name="secondPointIndex">Second point index.</param>
+ /// <param name="centerPoint">Center point for segment area.</param>
+ /// <param name="borderWidth">Border width</param>
+ internal void AddSelectionPath(
+ ChartArea area,
+ GraphicsPath selectionPath,
+ PointF[] dataPointPos,
+ int firstPointIndex,
+ int secondPointIndex,
+ PointF centerPoint,
+ int borderWidth)
+ {
+ // Calculate "half" points on the left and right side of the point
+ PointF rightSidePoint = GetMiddlePoint(dataPointPos[firstPointIndex], dataPointPos[secondPointIndex]);
+ PointF leftSidePoint = PointF.Empty;
+ if(firstPointIndex > 0)
+ {
+ leftSidePoint = GetMiddlePoint(dataPointPos[firstPointIndex], dataPointPos[firstPointIndex - 1]);
+ }
+ else if(firstPointIndex == 0)
+ {
+ if(area.CircularSectorsNumber == dataPointPos.Length - 1)
+ {
+ leftSidePoint = GetMiddlePoint(dataPointPos[firstPointIndex], dataPointPos[dataPointPos.Length - 2]);
+ }
+ }
+
+ // Add area segment
+ if(!centerPoint.IsEmpty)
+ {
+ selectionPath.AddLine(centerPoint, rightSidePoint);
+ selectionPath.AddLine(rightSidePoint, dataPointPos[firstPointIndex]);
+ if(leftSidePoint.IsEmpty)
+ {
+ selectionPath.AddLine(dataPointPos[firstPointIndex], centerPoint);
+ }
+ else
+ {
+ selectionPath.AddLine(dataPointPos[firstPointIndex], leftSidePoint);
+ selectionPath.AddLine(leftSidePoint, centerPoint);
+ }
+ }
+ else
+ {
+ // Add line
+ GraphicsPath linePath = new GraphicsPath();
+ if(!leftSidePoint.IsEmpty)
+ {
+ linePath.AddLine(leftSidePoint, dataPointPos[firstPointIndex]);
+ }
+ linePath.AddLine(dataPointPos[firstPointIndex], rightSidePoint);
+
+ // Widen path
+ try
+ {
+ linePath.Widen(new Pen(Color.Black, borderWidth + 2));
+ linePath.Flatten();
+ }
+ catch (OutOfMemoryException)
+ {
+ // GraphicsPath.Widen incorrectly throws OutOfMemoryException
+ // catching here and reacting by not widening
+ }
+ catch (ArgumentException)
+ {
+ }
+
+ // Add to the selection path
+ selectionPath.AddPath(linePath, false);
+ }
+
+ }
+
+ /// <summary>
+ /// Gets the middle point of the line.
+ /// </summary>
+ /// <param name="p1">First line point.</param>
+ /// <param name="p2">Second line point.</param>
+ /// <returns></returns>
+ private PointF GetMiddlePoint(PointF p1, PointF p2)
+ {
+ PointF middlePoint = PointF.Empty;
+ middlePoint.X = (p1.X + p2.X) / 2f;
+ middlePoint.Y = (p1.Y + p2.Y) / 2f;
+ return middlePoint;
+ }
+
+ /// <summary>
+ /// Returns marker size.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="point">Data point.</param>
+ /// <param name="markerSize">Marker size.</param>
+ /// <param name="markerImage">Marker image.</param>
+ /// <returns>Marker width and height.</returns>
+ virtual protected SizeF GetMarkerSize(
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ DataPoint point,
+ int markerSize,
+ string markerImage)
+ {
+ SizeF size = new SizeF(markerSize, markerSize);
+ if (graph != null && graph.Graphics != null)
+ {
+ // Marker size is in pixels and we do the mapping for higher DPIs
+ size.Width = markerSize * graph.Graphics.DpiX / 96;
+ size.Height = markerSize * graph.Graphics.DpiY / 96;
+ }
+
+ if(markerImage.Length > 0)
+ common.ImageLoader.GetAdjustedImageSize(markerImage, graph.Graphics, ref size);
+
+ return size;
+ }
+
+ /// <summary>
+ /// Fills a PointF array of data points absolute pixel positions.
+ /// </summary>
+ /// <param name="graph">Graphics object.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="series">Point series.</param>
+ /// <returns>Array of data points position.</returns>
+ virtual protected PointF[] GetPointsPosition(ChartGraphics graph, ChartArea area, Series series)
+ {
+ PointF[] pointPos = new PointF[series.Points.Count + 1];
+ int index = 0;
+ foreach( DataPoint point in series.Points )
+ {
+ // Change Y value if line is out of plot area
+ double yValue = GetYValue(Common, area, series, point, index, 0);
+
+ // Recalculates y position
+ double yPosition = area.AxisY.GetPosition( yValue );
+
+ // Recalculates x position
+ double xPosition = area.circularCenter.X;
+
+ // Add point position into array
+ pointPos[index] = graph.GetAbsolutePoint(new PointF((float)xPosition, (float)yPosition));
+
+ // Rotate position
+ float sectorAngle = 360f / area.CircularSectorsNumber * index;
+ Matrix matrix = new Matrix();
+ matrix.RotateAt(sectorAngle, graph.GetAbsolutePoint(area.circularCenter));
+ PointF[] rotatedPoint = new PointF[] { pointPos[index] };
+ matrix.TransformPoints(rotatedPoint);
+ pointPos[index] = rotatedPoint[0];
+
+ index++;
+ }
+
+ // Add last center point
+ pointPos[index] = graph.GetAbsolutePoint(area.circularCenter);
+
+ return pointPos;
+ }
+
+ /// <summary>
+ /// This method draws labels in point chart.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object</param>
+ /// <param name="common">The Common elements object</param>
+ /// <param name="area">Chart area for this chart</param>
+ /// <param name="markerPosition">Marker position</param>
+ /// <param name="markerSize">Marker size</param>
+ /// <param name="point">Data point</param>
+ /// <param name="ser">Data series</param>
+ /// <param name="pointIndex">Data point index.</param>
+ internal void DrawLabels(
+ ChartArea area,
+ ChartGraphics graph,
+ CommonElements common,
+ PointF markerPosition,
+ int markerSize,
+ DataPoint point,
+ Series ser,
+ int pointIndex)
+ {
+ // Get some properties for performance
+ string pointLabel = point.Label;
+ bool pointShowLabelAsValue = point.IsValueShownAsLabel;
+
+ // ****************************
+ // Draw data point value label
+ // ****************************
+ if((!point.IsEmpty && (ser.IsValueShownAsLabel || pointShowLabelAsValue || pointLabel.Length > 0)) ||
+ (pointShowLabelAsValue || pointLabel.Length > 0))
+ {
+ // Label text format
+ using (StringFormat format = new StringFormat())
+ {
+ format.Alignment = StringAlignment.Near;
+ format.LineAlignment = StringAlignment.Center;
+
+ // Get label text
+ string text;
+ if (pointLabel.Length == 0)
+ {
+ text = ValueConverter.FormatValue(
+ ser.Chart,
+ point,
+ point.Tag,
+ point.YValues[0],
+ point.LabelFormat,
+ ser.YValueType,
+ ChartElementType.DataPoint);
+ }
+ else
+ {
+ text = point.ReplaceKeywords(pointLabel);
+ }
+
+ // Get point label style attribute
+ SizeF sizeMarker = new SizeF(markerSize, markerSize);
+ SizeF sizeFont = graph.MeasureString(text, point.Font, new SizeF(1000f, 1000f), StringFormat.GenericTypographic);
+
+ // Increase label size when background is drawn
+ SizeF sizeLabel = new SizeF(sizeFont.Width, sizeFont.Height);
+ sizeLabel.Height += sizeLabel.Height / 2;
+ sizeLabel.Width += sizeLabel.Width / text.Length;
+
+ // Get attribute from point or series
+ this._autoLabelPosition = true;
+ string attrib = point[CustomPropertyName.LabelStyle];
+ if (attrib == null || attrib.Length == 0)
+ {
+ attrib = ser[CustomPropertyName.LabelStyle];
+ }
+ if (attrib != null && attrib.Length > 0)
+ {
+ this._autoLabelPosition = false;
+
+ // Get label position from attribute
+ if (String.Compare(attrib, "Auto", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this._autoLabelPosition = true;
+ }
+ else if (String.Compare(attrib, "Center", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this._labelPosition = LabelAlignmentStyles.Center;
+ }
+ else if (String.Compare(attrib, "Bottom", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this._labelPosition = LabelAlignmentStyles.Bottom;
+ }
+ else if (String.Compare(attrib, "TopLeft", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this._labelPosition = LabelAlignmentStyles.TopLeft;
+ }
+ else if (String.Compare(attrib, "TopRight", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this._labelPosition = LabelAlignmentStyles.TopRight;
+ }
+ else if (String.Compare(attrib, "BottomLeft", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this._labelPosition = LabelAlignmentStyles.BottomLeft;
+ }
+ else if (String.Compare(attrib, "BottomRight", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this._labelPosition = LabelAlignmentStyles.BottomRight;
+ }
+ else if (String.Compare(attrib, "Left", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this._labelPosition = LabelAlignmentStyles.Left;
+ }
+ else if (String.Compare(attrib, "Right", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this._labelPosition = LabelAlignmentStyles.Right;
+ }
+ else if (String.Compare(attrib, "Top", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this._labelPosition = LabelAlignmentStyles.Top;
+ }
+ else
+ {
+ throw (new ArgumentException(SR.ExceptionCustomAttributeValueInvalid(attrib, "LabelStyle")));
+ }
+ }
+
+ // Try to get automatic label position
+ if (this._autoLabelPosition)
+ {
+ this._labelPosition = GetAutoLabelPosition(area, ser, pointIndex);
+ }
+
+ // Calculate label position
+ PointF position = new PointF(markerPosition.X, markerPosition.Y);
+ switch (this._labelPosition)
+ {
+ case LabelAlignmentStyles.Center:
+ format.Alignment = StringAlignment.Center;
+ break;
+ case LabelAlignmentStyles.Bottom:
+ format.Alignment = StringAlignment.Center;
+ position.Y += sizeMarker.Height / 1.75F;
+ position.Y += sizeLabel.Height / 2F;
+ break;
+ case LabelAlignmentStyles.Top:
+ format.Alignment = StringAlignment.Center;
+ position.Y -= sizeMarker.Height / 1.75F;
+ position.Y -= sizeLabel.Height / 2F;
+ break;
+
+ case LabelAlignmentStyles.Left:
+ format.Alignment = StringAlignment.Far;
+ position.X -= sizeMarker.Height / 1.75F;
+ break;
+ case LabelAlignmentStyles.TopLeft:
+ format.Alignment = StringAlignment.Far;
+ position.X -= sizeMarker.Height / 1.75F;
+ position.Y -= sizeMarker.Height / 1.75F;
+ position.Y -= sizeLabel.Height / 2F;
+ break;
+ case LabelAlignmentStyles.BottomLeft:
+ format.Alignment = StringAlignment.Far;
+ position.X -= sizeMarker.Height / 1.75F;
+ position.Y += sizeMarker.Height / 1.75F;
+ position.Y += sizeLabel.Height / 2F;
+ break;
+ case LabelAlignmentStyles.Right:
+ //format.Alignment = StringAlignment.Near;
+ position.X += sizeMarker.Height / 1.75F;
+ break;
+ case LabelAlignmentStyles.TopRight:
+ //format.Alignment = StringAlignment.Near;
+ position.X += sizeMarker.Height / 1.75F;
+ position.Y -= sizeMarker.Height / 1.75F;
+ position.Y -= sizeLabel.Height / 2F;
+ break;
+ case LabelAlignmentStyles.BottomRight:
+ //format.Alignment = StringAlignment.Near;
+ position.X += sizeMarker.Height / 1.75F;
+ position.Y += sizeMarker.Height / 1.75F;
+ position.Y += sizeLabel.Height / 2F;
+ break;
+ }
+
+ // Get text angle
+ int textAngle = point.LabelAngle;
+
+ // Check if text contains white space only
+ if (text.Trim().Length != 0)
+ {
+
+
+ // Check if Smart Labels are enabled
+ if (ser.SmartLabelStyle.Enabled)
+ {
+ position = graph.GetRelativePoint(position);
+ markerPosition = graph.GetRelativePoint(markerPosition);
+ sizeFont = graph.GetRelativeSize(sizeFont);
+ sizeMarker = graph.GetRelativeSize(sizeMarker);
+
+ // Adjust label position using SmartLabelStyle algorithm
+ position = area.smartLabels.AdjustSmartLabelPosition(
+ common,
+ graph,
+ area,
+ ser.SmartLabelStyle,
+ position,
+ sizeFont,
+ format,
+ markerPosition,
+ sizeMarker,
+ this._labelPosition);
+
+ // Restore absolute coordinates
+ if (!position.IsEmpty)
+ {
+ position = graph.GetAbsolutePoint(position);
+ }
+ sizeFont = graph.GetAbsoluteSize(sizeFont);
+
+ // Smart labels always use 0 degrees text angle
+ textAngle = 0;
+ }
+
+
+ // Draw label
+ if (!position.IsEmpty)
+ {
+ position = graph.GetRelativePoint(position);
+
+ // Get label background position
+ RectangleF labelBackPosition = RectangleF.Empty;
+ sizeLabel = graph.GetRelativeSize(sizeFont);
+ sizeLabel.Height += sizeLabel.Height / 8;
+ labelBackPosition = PointChart.GetLabelPosition(
+ graph,
+ position,
+ sizeLabel,
+ format,
+ true);
+
+ // Draw label text
+ using (Brush brush = new SolidBrush(point.LabelForeColor))
+ {
+ graph.DrawPointLabelStringRel(
+ common,
+ text,
+ point.Font,
+ brush,
+ position,
+ format,
+ textAngle,
+ labelBackPosition,
+
+ point.LabelBackColor,
+ point.LabelBorderColor,
+ point.LabelBorderWidth,
+ point.LabelBorderDashStyle,
+ ser,
+ point,
+ pointIndex);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets label position depending on the prev/next point values.
+ /// This method will reduce label overlapping with the chart itself (line).
+ /// </summary>
+ /// <param name="area">Chart area for this chart</param>
+ /// <param name="series">Series.</param>
+ /// <param name="pointIndex">Data point index in series.</param>
+ /// <returns>Return automaticly detected label position.</returns>
+ virtual protected LabelAlignmentStyles GetAutoLabelPosition(ChartArea area, Series series, int pointIndex)
+ {
+ LabelAlignmentStyles labelAlignment = LabelAlignmentStyles.Top;
+
+ // Calculate data point sector angle
+ float sectorAngle = 360f / area.CircularSectorsNumber * pointIndex;
+
+ if(sectorAngle == 0f)
+ {
+ labelAlignment = LabelAlignmentStyles.TopRight;
+ }
+ else if(sectorAngle >= 0 && sectorAngle <= 45)
+ {
+ labelAlignment = LabelAlignmentStyles.Top;
+ }
+ else if(sectorAngle >= 45 && sectorAngle <= 90)
+ {
+ labelAlignment = LabelAlignmentStyles.TopRight;
+ }
+ else if(sectorAngle >= 90 && sectorAngle <= 135)
+ {
+ labelAlignment = LabelAlignmentStyles.BottomRight;
+ }
+ else if(sectorAngle >= 135 && sectorAngle <= 180)
+ {
+ labelAlignment = LabelAlignmentStyles.BottomRight;
+ }
+ else if(sectorAngle >= 180 && sectorAngle <= 225)
+ {
+ labelAlignment = LabelAlignmentStyles.BottomLeft;
+ }
+ else if(sectorAngle >= 225 && sectorAngle <= 270)
+ {
+ labelAlignment = LabelAlignmentStyles.BottomLeft;
+ }
+ else if(sectorAngle >= 270 && sectorAngle <= 315)
+ {
+ labelAlignment = LabelAlignmentStyles.TopLeft;
+ }
+ else if(sectorAngle >= 315 && sectorAngle <= 360)
+ {
+ labelAlignment = LabelAlignmentStyles.TopLeft;
+ }
+
+ return labelAlignment;
+ }
+
+ /// <summary>
+ /// Gets radar chart drawing style.
+ /// </summary>
+ /// <param name="ser">Chart series.</param>
+ /// <param name="point">Series point.</param>
+ /// <returns>Returns radar drawing style.</returns>
+ virtual protected RadarDrawingStyle GetDrawingStyle(Series ser, DataPoint point)
+ {
+ RadarDrawingStyle drawingStyle = RadarDrawingStyle.Area;
+ if(point.IsCustomPropertySet(CustomPropertyName.RadarDrawingStyle) ||
+ ser.IsCustomPropertySet(CustomPropertyName.RadarDrawingStyle))
+ {
+ string attributeValue =
+ (point.IsCustomPropertySet(CustomPropertyName.RadarDrawingStyle)) ?
+ point[CustomPropertyName.RadarDrawingStyle] :
+ ser[CustomPropertyName.RadarDrawingStyle];
+ if(String.Compare(attributeValue, "Area", StringComparison.OrdinalIgnoreCase) == 0 )
+ {
+ drawingStyle = RadarDrawingStyle.Area;
+ }
+ else if (String.Compare(attributeValue, "Line", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ drawingStyle = RadarDrawingStyle.Line;
+ }
+ else if(String.Compare(attributeValue, "Marker", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ drawingStyle = RadarDrawingStyle.Marker;
+ }
+ else
+ {
+ throw(new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid(attributeValue, "RadarDrawingStyle")));
+ }
+ }
+ return drawingStyle;
+ }
+
+ #endregion
+
+ #region Y values related methods
+
+ /// <summary>
+ /// Helper function that returns the Y value of the point.
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="area">Chart area the series belongs to.</param>
+ /// <param name="series">Sereis of the point.</param>
+ /// <param name="point">Point object.</param>
+ /// <param name="pointIndex">Index of the point.</param>
+ /// <param name="yValueIndex">Index of the Y value to get.</param>
+ /// <returns>Y value of the point.</returns>
+ virtual public double GetYValue(
+ CommonElements common,
+ ChartArea area,
+ Series series,
+ DataPoint point,
+ int pointIndex,
+ int yValueIndex)
+ {
+
+ // Point chart do not have height
+ if(yValueIndex == -1)
+ {
+ return 0.0;
+ }
+
+ if( point.IsEmpty )
+ {
+ double result = GetEmptyPointValue(point, pointIndex);
+
+ // NOTE: Fixes issue #6921
+ // If empty point Y value is zero then check if the scale of
+ // the Y axis and if it is not containing zero adjust the Y value
+ // of the empty point, so it will be visible
+ if (result == 0.0)
+ {
+ Axis yAxis = area.GetAxis(AxisName.Y, series.YAxisType, series.YSubAxisName);
+ double yViewMax = yAxis.maximum;
+ double yViewMin = yAxis.minimum;
+ if (result < yViewMin)
+ {
+ result = yViewMin;
+ }
+ else if (result > yViewMax)
+ {
+ result = yViewMax;
+ }
+ }
+
+ return result;
+ }
+ return point.YValues[yValueIndex];
+ }
+
+ /// <summary>
+ /// This method will find previous and next data point, which is not
+ /// empty and recalculate a new value for current empty data point.
+ /// New value depends on custom attribute “EmptyPointValue” and
+ /// it could be zero or average.
+ /// </summary>
+ /// <param name="point">IsEmpty data point.</param>
+ /// <param name="pointIndex">IsEmpty data point index.</param>
+ /// <returns>A Value for empty data point.</returns>
+ internal double GetEmptyPointValue( DataPoint point, int pointIndex )
+ {
+ Series series = point.series; // Data series
+ double previousPoint = 0; // Previous data point value (not empty)
+ double nextPoint = 0; // Next data point value (not empty)
+ int prevIndx = 0; // Previous data point index
+ int nextIndx = series.Points.Count - 1; // Next data point index
+
+ //************************************************************
+ //** Check custom attribute "EmptyPointValue"
+ //************************************************************
+ string emptyPointValue = "";
+ if( series.EmptyPointStyle.IsCustomPropertySet(CustomPropertyName.EmptyPointValue) )
+ {
+ emptyPointValue = series.EmptyPointStyle[CustomPropertyName.EmptyPointValue];
+ }
+ else if( series.IsCustomPropertySet(CustomPropertyName.EmptyPointValue) )
+ {
+ emptyPointValue = series[CustomPropertyName.EmptyPointValue];
+ }
+
+ // Take attribute value
+ if( String.Compare(emptyPointValue, "Zero", StringComparison.OrdinalIgnoreCase) == 0 )
+ {
+ // IsEmpty points represented with zero values
+ return 0;
+ }
+
+ //************************************************************
+ //** IsEmpty point value is an average of neighbour points
+ //************************************************************
+
+ // Find previous non-empty point value
+ for( int indx = pointIndex; indx >= 0; indx-- )
+ {
+ if( !series.Points[indx].IsEmpty )
+ {
+ previousPoint = series.Points[indx].YValues[0];
+ prevIndx = indx;
+ break;
+ }
+ previousPoint = Double.NaN;
+ }
+
+ // Find next non-empty point value
+ for( int indx = pointIndex; indx < series.Points.Count; indx++ )
+ {
+ if( !series.Points[indx].IsEmpty )
+ {
+ nextPoint = series.Points[indx].YValues[0];
+ nextIndx = indx;
+ break;
+ }
+ nextPoint = Double.NaN;
+ }
+
+ // All Previous points are empty
+ if( Double.IsNaN( previousPoint ) )
+ {
+ // All points are empty
+ if( Double.IsNaN( nextPoint ) )
+ {
+ previousPoint = 0;
+ }
+ else // Next point is equal to previous point
+ {
+ previousPoint = nextPoint;
+ }
+ }
+
+ // All next points are empty
+ if( Double.IsNaN( nextPoint ) )
+ {
+ // Previous point is equal to next point
+ nextPoint = previousPoint;
+ }
+
+ // If points value are the same use average
+ if( series.Points[nextIndx].XValue == series.Points[prevIndx].XValue )
+ {
+ return ( previousPoint + nextPoint ) / 2;
+ }
+
+ // Calculate and return average value
+ double aCoeff = (previousPoint - nextPoint) / (series.Points[nextIndx].XValue - series.Points[prevIndx].XValue);
+ return -aCoeff * (point.XValue - series.Points[prevIndx].XValue) + previousPoint;
+ }
+
+ #endregion
+
+ #region SmartLabelStyle methods
+
+ /// <summary>
+ /// Adds markers position to the list. Used to check SmartLabelStyle overlapping.
+ /// </summary>
+ /// <param name="common">Common chart elements.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="series">Series values to be used.</param>
+ /// <param name="list">List to add to.</param>
+ public void AddSmartLabelMarkerPositions(CommonElements common, ChartArea area, Series series, ArrayList list)
+ {
+ //************************************************************
+ //** Fill the array of data points coordinates (absolute)
+ //************************************************************
+ PointF[] dataPointPos = GetPointsPosition(common.graph, area, series);
+
+ //************************************************************
+ //** Loop through all data points in the series and draw
+ //** markers and points labels.
+ //************************************************************
+ int markerIndex = 0; // Marker index
+ int index = 0; // Data points loop
+ foreach( DataPoint point in series.Points )
+ {
+ //************************************************************
+ //** Check what is the main element of radar point. It can be
+ //** area (default), line or marker.
+ //************************************************************
+ Color markerColor = point.MarkerColor;
+ MarkerStyle markerStyle = point.MarkerStyle;
+ RadarDrawingStyle drawingStyle = GetDrawingStyle(series, point);
+ if(drawingStyle == RadarDrawingStyle.Marker)
+ {
+ // Set main color to marker
+ markerColor = point.Color;
+ }
+
+ //************************************************************
+ //** Get marker size
+ //************************************************************
+ // Get marker size
+ SizeF markerSize = GetMarkerSize(
+ common.graph,
+ common,
+ area,
+ point,
+ point.MarkerSize,
+ point.MarkerImage);
+
+ //************************************************************
+ //** Draw point chart
+ //************************************************************
+ if(markerStyle != MarkerStyle.None || point.MarkerImage.Length > 0)
+ {
+ // If marker style is set and color is not - use main color of point
+ if(markerColor.IsEmpty)
+ {
+ markerColor = point.Color;
+ }
+
+ // Check marker index
+ if(markerIndex == 0)
+ {
+ PointF markerPosition = common.graph.GetRelativePoint(dataPointPos[index]);
+ markerSize = common.graph.GetRelativeSize(markerSize);
+ RectangleF markerRect = new RectangleF(
+ markerPosition.X - markerSize.Width/2f,
+ markerPosition.Y - markerSize.Height/2f,
+ markerSize.Width,
+ markerSize.Height);
+ list.Add(markerRect);
+ }
+
+ // Increase the markers counter
+ ++markerIndex;
+ if(series.MarkerStep == markerIndex)
+ {
+ markerIndex = 0;
+ }
+ }
+
+ ++index;
+ }
+ }
+
+ #endregion
+
+ #region IDisposable interface implementation
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected virtual void Dispose(bool disposing)
+ {
+ //Nothing to dispose at the base class.
+ }
+
+ /// <summary>
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// </summary>
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+ #endregion
+ }
+
+ /// <summary>
+ /// ICircularChartType interface provides behaviuour information for circular
+ /// chart types like Radar or Polar. This interface is similar to IChartType
+ /// interface.
+ /// </summary>
+ internal interface ICircularChartType
+ {
+ #region Methods
+
+ /// <summary>
+ /// Checks if closed figure should be drawn even in Line drawing mode.
+ /// </summary>
+ /// <returns>True if closed figure should be drawn even in Line drawing mode.</returns>
+ bool RequireClosedFigure();
+
+ /// <summary>
+ /// Checks if Y axis position may be changed using X axis Crossing property.
+ /// </summary>
+ /// <returns>True if Y axis position may be changed using X axis Crossing property.</returns>
+ bool XAxisCrossingSupported();
+
+ /// <summary>
+ /// Checks if automatic X axis labels are supported.
+ /// </summary>
+ /// <returns>True if automatic X axis labels are supported.</returns>
+ bool XAxisLabelsSupported();
+
+ /// <summary>
+ /// Checks if radial grid lines (X axis) are supported by the chart type.
+ /// </summary>
+ /// <returns>True if radial grid lines are supported.</returns>
+ bool RadialGridLinesSupported();
+
+ /// <summary>
+ /// Gets number of sectors in the circular chart area.
+ /// </summary>
+ /// <param name="area">Chart area to get number of sectors for.</param>
+ /// <param name="seriesCollection">Collection of series.</param>
+ /// <returns>Returns number of sectors in circular chart.</returns>
+ int GetNumerOfSectors(ChartArea area, SeriesCollection seriesCollection);
+
+ /// <summary>
+ /// Get a location of each Y axis in degrees.
+ /// </summary>
+ /// <param name="area">Chart area to get Y axes locations for.</param>
+ /// <returns>Returns an array of one or more locations of Y axis.</returns>
+ float[] GetYAxisLocations(ChartArea area);
+
+ #endregion // Methods
+ }
+
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/RangeChart.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/RangeChart.cs
new file mode 100644
index 00000000000..e61b4027e58
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/RangeChart.cs
@@ -0,0 +1,1820 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: RangeChart.cs
+//
+// Namespace: DataVisualization.Charting.ChartTypes
+//
+// Classes: RangeChart, SplineRangeChart
+//
+// Purpose: Provides 2D/3D drawing and hit testing functionality
+// for the Range and SplineRange charts. The Range chart
+// displays a range of data by plotting two Y values per
+// data point, with each Y value being drawn as a line
+// chart. The range between the Y values can then be
+// filled with color. Spline Range chart changes the
+// default tension of the lines between data points.
+//
+// Reviewed: AG - Aug 6, 2002
+// AG - Microsoft 6, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Resources;
+using System.Reflection;
+using System.Collections;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+
+#else
+using System.Web.UI.DataVisualization.Charting;
+
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.ChartTypes
+#else
+ namespace System.Web.UI.DataVisualization.Charting.ChartTypes
+#endif
+{
+ /// <summary>
+ /// SplineRangeChart class extends the RangeChart class by
+ /// providing a different initial tension for the lines.
+ /// </summary>
+ internal class SplineRangeChart : RangeChart
+ {
+ #region Constructor
+
+ /// <summary>
+ /// Default constructor.
+ /// </summary>
+ public SplineRangeChart()
+ {
+ // Set default line tension
+ base.lineTension = 0.5f;
+ }
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ public override string Name { get{ return ChartTypeNames.SplineRange;}}
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ override public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+
+ #endregion
+
+ #region Default tension method
+
+ /// <summary>
+ /// Gets default line tension.
+ /// </summary>
+ /// <returns>Default line tension.</returns>
+ override protected float GetDefaultTension()
+ {
+ return 0.5f;
+ }
+
+ /// <summary>
+ /// Checks if line tension is supported by the chart type.
+ /// </summary>
+ /// <returns>True if line tension is supported.</returns>
+ protected override bool IsLineTensionSupported()
+ {
+ return true;
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// RangeChart class provides 2D/3D drawing and hit testing
+ /// functionality for the Range and SplineRange charts. The
+ /// only difference of the SplineRange chart is the default
+ /// tension of the line.
+ ///
+ /// SplineChart base class provides most of the functionality
+ /// like drawing lines, labels and markers.
+ /// </summary>
+ internal class RangeChart : SplineChart
+ {
+ #region Fields
+
+ /// <summary>
+ /// Fields used to fill area with gradient
+ /// </summary>
+ internal bool gradientFill = false;
+
+ /// <summary>
+ /// Shape of the low values
+ /// </summary>
+ internal GraphicsPath areaBottomPath = new GraphicsPath();
+
+ /// <summary>
+ /// Coordinates of the area path
+ /// </summary>
+ protected GraphicsPath areaPath = null;
+
+ /// <summary>
+ /// Reference to the current series object
+ /// </summary>
+ private Series _series = null;
+
+ /// <summary>
+ /// Array of low line values
+ /// </summary>
+ internal PointF[] lowPoints = null;
+
+ /// <summary>
+ /// Check if series are indexed based
+ /// </summary>
+ internal bool indexedBasedX = false;
+
+ /// <summary>
+ /// Secondary Y coordinate that should be used for bottom line of the range (left point)
+ /// </summary>
+ private float _thirdPointY2Value = float.NaN;
+
+ /// <summary>
+ /// Secondary Y coordinate that should be used for bottom line of the range (right point)
+ /// </summary>
+ private float _fourthPointY2Value = float.NaN;
+
+ #endregion
+
+ #region Constructor
+
+ /// <summary>
+ /// Default constructor.
+ /// </summary>
+ public RangeChart()
+ {
+ this.drawOutsideLines = true;
+ }
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ public override string Name { get{ return ChartTypeNames.Range;}}
+
+ /// <summary>
+ /// Number of supported Y value(s) per point
+ /// </summary>
+ override public int YValuesPerPoint { get { return 2; } }
+
+ /// <summary>
+ /// Indicates that extra Y values are connected to the scale of the Y axis
+ /// </summary>
+ override public bool ExtraYValuesConnectedToYAxis{ get { return true; } }
+
+ /// <summary>
+ /// How to draw series/points in legend:
+ /// Filled rectangle, Line or Marker
+ /// </summary>
+ /// <param name="series">Legend item series.</param>
+ /// <returns>Legend item style.</returns>
+ override public LegendImageStyle GetLegendImageStyle(Series series)
+ {
+ return LegendImageStyle.Rectangle;
+ }
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ override public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+
+ #endregion
+
+ #region Default tension method
+
+ /// <summary>
+ /// Gets default line tension.
+ /// </summary>
+ /// <returns>Line tension.</returns>
+ override protected float GetDefaultTension()
+ {
+ return 0.0f;
+ }
+
+ /// <summary>
+ /// Checks if line tension is supported by the chart type.
+ /// </summary>
+ /// <returns>True if line tension is supported.</returns>
+ protected override bool IsLineTensionSupported()
+ {
+ return false;
+ }
+
+ #endregion
+
+ #region Painting and Selection related methods
+
+ /// <summary>
+ /// Fills last series area with gradient.
+ /// If gradient is used as a back color of the series it must be drawn
+ /// at the same time.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object.</param>
+ private void FillLastSeriesGradient(ChartGraphics graph)
+ {
+ // Add last line in the path
+ if(areaPath != null)
+ {
+ areaPath.AddLine(
+ areaPath.GetLastPoint().X,
+ areaPath.GetLastPoint().Y,
+ areaPath.GetLastPoint().X,
+ areaBottomPath.GetLastPoint().Y);
+ }
+
+ // Fill whole area with gradient
+ if(gradientFill && areaPath != null)
+ {
+ // Set clip region
+ graph.SetClip( Area.PlotAreaPosition.ToRectangleF() );
+
+ // Create new path from high/low lines
+ using (GraphicsPath gradientPath = new GraphicsPath())
+ {
+ gradientPath.AddPath(areaPath, true);
+ areaBottomPath.Reverse();
+ gradientPath.AddPath(areaBottomPath, true);
+
+ // Create brush
+ using (Brush areaGradientBrush = graph.GetGradientBrush(gradientPath.GetBounds(), this._series.Color, this._series.BackSecondaryColor, this._series.BackGradientStyle))
+ {
+ // Fill area with gradient
+ graph.FillPath(areaGradientBrush, gradientPath);
+ gradientFill = false;
+ }
+ }
+
+ // Reset clip region
+ graph.ResetClip();
+ }
+ if(areaPath != null)
+ {
+ areaPath.Dispose();
+ areaPath = null;
+ }
+
+ // Reset bottom area path
+ areaBottomPath.Reset();
+ }
+
+ /// <summary>
+ /// This method recalculates position of the end points of lines. This method
+ /// is used from Paint or Select method.
+ /// </summary>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ protected override void ProcessChartType(
+ bool selection,
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ Series seriesToDraw )
+ {
+ gradientFill = false;
+ lowPoints = null;
+
+ // Check if series is indexed based
+ indexedBasedX = ChartHelper.IndexedSeries(common, area.GetSeriesFromChartType(this.Name).ToArray());
+
+ // Call base class
+ base.ProcessChartType(selection, graph, common, area, seriesToDraw);
+
+ // Fill gradient fro the previous series
+ FillLastSeriesGradient(graph);
+ }
+
+ /// <summary>
+ /// Override line drawing method to fill the range and draw lines.
+ /// </summary>
+ /// <param name="graph">Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="point">Point to draw the line for.</param>
+ /// <param name="series">Point series.</param>
+ /// <param name="points">Array of oints coordinates.</param>
+ /// <param name="pointIndex">Index of point to draw.</param>
+ /// <param name="tension">Line tension.</param>
+ override protected void DrawLine(
+ ChartGraphics graph,
+ CommonElements common,
+ DataPoint point,
+ Series series,
+ PointF[] points,
+ int pointIndex,
+ float tension)
+ {
+ // Two Y values required
+ if(point.YValues.Length < 2)
+ {
+ throw(new InvalidOperationException( SR.ExceptionChartTypeRequiresYValues( this.Name, "2" )));
+ }
+
+ // Start drawing from the second point
+ if(pointIndex <= 0)
+ {
+ return;
+ }
+
+ // Do nothing for the low values line
+ if(this.YValueIndex == 1)
+ {
+ return;
+ }
+
+ // Check if its a beginning of a new series
+ if(this._series != null)
+ {
+ if(this._series.Name != series.Name)
+ {
+ // Fill gradient from the previous series
+ FillLastSeriesGradient(graph);
+ this._series = series;
+ lowPoints = null;
+ areaBottomPath.Reset();
+ }
+ }
+ else
+ {
+ this._series = series;
+ }
+
+ // Fill array of lower points of the range
+ if(lowPoints == null)
+ {
+ this.YValueIndex = 1;
+ lowPoints = GetPointsPosition(graph, series, indexedBasedX);
+ this.YValueIndex = 0;
+ }
+
+ // Calculate points position
+ PointF highPoint1 = points[pointIndex-1];
+ PointF highPoint2 = points[pointIndex];
+ PointF lowPoint1 = lowPoints[pointIndex-1];
+ PointF lowPoint2 = lowPoints[pointIndex];
+
+ // Create area brush
+ Brush areaBrush = null;
+ if( point.BackHatchStyle != ChartHatchStyle.None )
+ {
+ areaBrush = graph.GetHatchBrush( point.BackHatchStyle, point.Color, point.BackSecondaryColor);
+ }
+ else if( point.BackGradientStyle != GradientStyle.None )
+ {
+ this.gradientFill = true;
+ this._series = point.series;
+ }
+ else if( point.BackImage.Length > 0 && point.BackImageWrapMode != ChartImageWrapMode.Unscaled && point.BackImageWrapMode != ChartImageWrapMode.Scaled)
+ {
+ areaBrush = graph.GetTextureBrush(point.BackImage, point.BackImageTransparentColor, point.BackImageWrapMode, point.Color );
+ }
+ else
+ {
+ areaBrush = new SolidBrush(point.Color);
+ }
+
+ // Calculate data point area segment path
+ GraphicsPath path = new GraphicsPath();
+ path.AddLine(highPoint1.X, lowPoint1.Y, highPoint1.X, highPoint1.Y);
+ if(this.lineTension == 0)
+ {
+ path.AddLine(points[pointIndex-1], points[pointIndex]);
+ }
+ else
+ {
+ path.AddCurve(points, pointIndex-1, 1, this.lineTension);
+ }
+
+ path.AddLine(highPoint2.X, highPoint2.Y, highPoint2.X, lowPoint2.Y);
+
+ // Because of SVG Rendering order of points in the close shape
+ // has to be respected.
+ if( graph.ActiveRenderingType == RenderingType.Svg )
+ {
+ using (GraphicsPath pathReverse = new GraphicsPath())
+ {
+ // Add curve to the new graphics path
+ if (this.lineTension == 0)
+ {
+ path.AddLine(lowPoints[pointIndex - 1], lowPoints[pointIndex]);
+ }
+ else
+ {
+ pathReverse.AddCurve(lowPoints, pointIndex - 1, 1, this.lineTension);
+
+ // Convert to polygon
+ pathReverse.Flatten();
+
+ // Reversed points order in the aray
+ PointF[] pointsReversed = pathReverse.PathPoints;
+ PointF[] pointF = new PointF[pointsReversed.Length];
+ int pntIndex = pointsReversed.Length - 1;
+ foreach (PointF pp in pointsReversed)
+ {
+ pointF[pntIndex] = pp;
+ pntIndex--;
+ }
+
+ // Path can not have polygon width two points
+ if (pointF.Length == 2)
+ {
+ PointF[] newPointF = new PointF[3];
+ newPointF[0] = pointF[0];
+ newPointF[1] = pointF[1];
+ newPointF[2] = pointF[1];
+ pointF = newPointF;
+ }
+
+ // Add Polygon to the path
+ path.AddPolygon(pointF);
+ }
+ }
+ }
+ else
+ {
+ if(this.lineTension == 0)
+ {
+ path.AddLine(lowPoints[pointIndex-1], lowPoints[pointIndex]);
+ }
+ else
+ {
+ path.AddCurve(lowPoints, pointIndex-1, 1, this.lineTension);
+ }
+
+ }
+
+ // Check if bottom line is partialy in the data scaleView
+ if(!clipRegionSet)
+ {
+ double xValue = (indexedSeries) ? pointIndex + 1 : series.Points[pointIndex].XValue;
+ double xPrevValue = (indexedSeries) ? pointIndex : series.Points[pointIndex - 1].XValue;
+ if(xPrevValue < hAxisMin || xPrevValue > hAxisMax ||
+ xValue > hAxisMax || xValue < hAxisMin ||
+ series.Points[pointIndex-1].YValues[1] < vAxisMin || series.Points[pointIndex-1].YValues[1] > vAxisMax ||
+ series.Points[pointIndex].YValues[1] < vAxisMin || series.Points[pointIndex].YValues[1] > vAxisMax )
+ {
+ // Set clipping region for bottom line drawing
+ graph.SetClip( Area.PlotAreaPosition.ToRectangleF() );
+ clipRegionSet = true;
+ }
+ }
+
+ // Draw shadow
+ if(series.ShadowColor != Color.Empty && series.ShadowOffset != 0)
+ {
+ if(point.Color != Color.Empty && point.Color != Color.Transparent)
+ {
+ // Translate drawing matrix
+ Matrix translateMatrix = graph.Transform.Clone();
+ translateMatrix.Translate(series.ShadowOffset, series.ShadowOffset);
+ Matrix oldMatrix = graph.Transform;
+ graph.Transform = translateMatrix;
+
+ Region shadowRegion = new Region(path);
+ using (Brush shadowBrush = new SolidBrush((series.ShadowColor.A != 255) ? series.ShadowColor : Color.FromArgb(point.Color.A / 2, series.ShadowColor)))
+ {
+ Region clipRegion = null;
+ if (!graph.IsClipEmpty && !graph.Clip.IsInfinite(graph.Graphics))
+ {
+ clipRegion = graph.Clip;
+ clipRegion.Translate(series.ShadowOffset + 1, series.ShadowOffset + 1);
+ graph.Clip = clipRegion;
+
+ }
+
+ // Fill region
+ graph.FillRegion(shadowBrush, shadowRegion);
+
+ // Draw leftmost and rightmost vertical lines
+ using (Pen areaLinePen = new Pen(shadowBrush, 1))
+ {
+ if (pointIndex == 0)
+ {
+ graph.DrawLine(areaLinePen, highPoint1.X, lowPoint1.Y, highPoint1.X, highPoint1.Y);
+ }
+ if (pointIndex == series.Points.Count - 1)
+ {
+ graph.DrawLine(areaLinePen, highPoint2.X, highPoint2.Y, highPoint2.X, lowPoint2.Y);
+ }
+ }
+
+ // Restore graphics parameters
+ graph.Transform = oldMatrix;
+
+ // Draw high and low line shadows
+ this.drawShadowOnly = true;
+ base.DrawLine(graph, common, point, series, points, pointIndex, tension);
+ this.YValueIndex = 1;
+ base.DrawLine(graph, common, point, series, lowPoints, pointIndex, tension);
+ this.YValueIndex = 0;
+ this.drawShadowOnly = false;
+
+ // Restore clip region
+ if (clipRegion != null)
+ {
+ clipRegion = graph.Clip;
+ clipRegion.Translate(-(series.ShadowOffset + 1), -(series.ShadowOffset + 1));
+ graph.Clip = clipRegion;
+ }
+ }
+ }
+ }
+
+ // Draw area
+ if(!gradientFill)
+ {
+ // Turn off anti aliasing and fill area
+ SmoothingMode oldMode = graph.SmoothingMode;
+ graph.SmoothingMode = SmoothingMode.None;
+ path.CloseAllFigures();
+ graph.FillPath(areaBrush, path);
+ graph.SmoothingMode = oldMode;
+
+ // Draw top and bottom lines, because anti aliasing is not working for the FillPath method
+ if(graph.SmoothingMode != SmoothingMode.None)
+ {
+ Pen areaLinePen = new Pen(areaBrush, 1);
+
+ // This code is introduce because of problem
+ // with Svg and Hatch Color
+ HatchBrush hatchBrush = areaBrush as HatchBrush;
+ if( hatchBrush != null )
+ {
+ areaLinePen.Color = hatchBrush.ForegroundColor;
+ }
+
+ if(pointIndex == 0)
+ {
+ graph.DrawLine(areaLinePen, highPoint1.X, lowPoint1.Y, highPoint1.X, highPoint1.Y);
+ }
+ if(pointIndex == series.Points.Count - 1)
+ {
+ graph.DrawLine(areaLinePen, highPoint2.X, highPoint2.Y, highPoint2.X, lowPoint2.Y);
+ }
+
+ if(this.lineTension == 0)
+ {
+ graph.DrawLine(areaLinePen, points[pointIndex - 1], points[pointIndex]);
+ }
+ else
+ {
+ graph.DrawCurve(areaLinePen, points, pointIndex-1, 1, this.lineTension);
+ }
+
+ if(this.lineTension == 0)
+ {
+ graph.DrawLine(areaLinePen, lowPoints[pointIndex - 1], lowPoints[pointIndex]);
+ }
+ else
+ {
+ graph.DrawCurve(areaLinePen, lowPoints, pointIndex-1, 1, this.lineTension);
+ }
+ }
+ }
+
+ // Add first line
+ if(areaPath == null)
+ {
+ areaPath = new GraphicsPath();
+ areaPath.AddLine(highPoint1.X, lowPoint1.Y, highPoint1.X, highPoint1.Y);
+ }
+
+ // Add line to the gradient path
+ if(this.lineTension == 0)
+ {
+ areaPath.AddLine(points[pointIndex-1], points[pointIndex]);
+ }
+ else
+ {
+ areaPath.AddCurve(points, pointIndex-1, 1, this.lineTension);
+ }
+
+ if(this.lineTension == 0)
+ {
+ areaBottomPath.AddLine(lowPoints[pointIndex-1], lowPoints[pointIndex]);
+ }
+ else
+ {
+ areaBottomPath.AddCurve(lowPoints, pointIndex-1, 1, this.lineTension);
+ }
+
+ // Draw range High and Low border lines
+ if((point.BorderWidth > 0 &&
+ point.BorderDashStyle != ChartDashStyle.NotSet &&
+ point.BorderColor != Color.Empty) ||
+ areaBrush is SolidBrush)
+ {
+ this.useBorderColor = true;
+ this.disableShadow = true;
+ base.DrawLine(graph, common, point, series, points, pointIndex, tension);
+ this.YValueIndex = 1;
+ base.DrawLine(graph, common, point, series, lowPoints, pointIndex, tension);
+ this.YValueIndex = 0;
+ this.useBorderColor = false;
+ this.disableShadow = false;
+ }
+
+ if( common.ProcessModeRegions )
+ {
+ //**************************************************************
+ //** Add area for the inside of the area
+ //**************************************************************
+
+ path.AddLine(highPoint1.X, lowPoint1.Y, highPoint1.X, highPoint1.Y);
+ if(this.lineTension == 0)
+ {
+ path.AddLine(points[pointIndex-1], points[pointIndex]);
+ }
+ else
+ {
+ path.AddCurve(points, pointIndex-1, 1, this.lineTension);
+ }
+ path.AddLine(highPoint2.X, highPoint2.Y, highPoint2.X, lowPoint2.Y);
+ if(this.lineTension == 0)
+ {
+ path.AddLine(lowPoints[pointIndex-1], lowPoints[pointIndex]);
+ }
+ else
+ {
+ path.AddCurve(lowPoints, pointIndex-1, 1, this.lineTension);
+ }
+
+ // Create grapics path object dor the curved area
+ GraphicsPath mapAreaPath = new GraphicsPath();
+ mapAreaPath.AddLine(highPoint1.X, lowPoint1.Y, highPoint1.X, highPoint1.Y);
+ if(this.lineTension == 0)
+ {
+ mapAreaPath.AddLine(points[pointIndex - 1], points[pointIndex]);
+ }
+ else
+ {
+ mapAreaPath.AddCurve(points, pointIndex-1, 1, this.lineTension);
+ mapAreaPath.Flatten();
+ }
+ mapAreaPath.AddLine(highPoint2.X, highPoint2.Y, highPoint2.X, lowPoint2.Y);
+ if(this.lineTension == 0)
+ {
+ mapAreaPath.AddLine(lowPoints[pointIndex - 1], lowPoints[pointIndex]);
+ }
+ else
+ {
+ mapAreaPath.AddCurve(lowPoints, pointIndex-1, 1, this.lineTension);
+ mapAreaPath.Flatten();
+ }
+
+ // Allocate array of floats
+ PointF pointNew = PointF.Empty;
+ float[] coord = new float[mapAreaPath.PointCount * 2];
+ PointF[] pathPoints = mapAreaPath.PathPoints;
+ for( int i = 0; i < mapAreaPath.PointCount; i++ )
+ {
+ pointNew = graph.GetRelativePoint( pathPoints[i] );
+ coord[2*i] = pointNew.X;
+ coord[2*i + 1] = pointNew.Y;
+ }
+
+ common.HotRegionsList.AddHotRegion(
+ mapAreaPath,
+ false,
+ coord,
+ point,
+ series.Name,
+ pointIndex );
+
+ }
+ //Clean up
+ if (areaBrush != null)
+ areaBrush.Dispose();
+ if (path != null)
+ {
+ path.Dispose();
+ path = null;
+ }
+
+ }
+
+
+ #endregion
+
+ #region 3D painting and selection methods
+
+ /// <summary>
+ /// Draws a 3D surface connecting the two specified points in 2D space.
+ /// Used to draw Line based charts.
+ /// </summary>
+ /// <param name="area">Chart area reference.</param>
+ /// <param name="graph">Chart graphics.</param>
+ /// <param name="matrix">Coordinates transformation matrix.</param>
+ /// <param name="lightStyle">LightStyle style (None, Simplistic, Realistic).</param>
+ /// <param name="prevDataPointEx">Previous data point object.</param>
+ /// <param name="positionZ">Z position of the back side of the 3D surface.</param>
+ /// <param name="depth">Depth of the 3D surface.</param>
+ /// <param name="points">Array of points.</param>
+ /// <param name="pointIndex">Index of point to draw.</param>
+ /// <param name="pointLoopIndex">Index of points loop.</param>
+ /// <param name="tension">Line tension.</param>
+ /// <param name="operationType">AxisName of operation Drawing, Calculating Path or Both</param>
+ /// <param name="topDarkening">Darkenning scale for top surface. 0 - None.</param>
+ /// <param name="bottomDarkening">Darkenning scale for bottom surface. 0 - None.</param>
+ /// <param name="thirdPointPosition">Position where the third point is actually located or float.NaN if same as in "firstPoint".</param>
+ /// <param name="fourthPointPosition">Position where the fourth point is actually located or float.NaN if same as in "secondPoint".</param>
+ /// <param name="clippedSegment">Indicates that drawn segment is 3D clipped. Only top/bottom should be drawn.</param>
+ /// <returns>Returns elemnt shape path if operationType parameter is set to CalcElementPath, otherwise Null.</returns>
+ protected override GraphicsPath Draw3DSurface(
+ ChartArea area,
+ ChartGraphics graph,
+ Matrix3D matrix,
+ LightStyle lightStyle,
+ DataPoint3D prevDataPointEx,
+ float positionZ,
+ float depth,
+ ArrayList points,
+ int pointIndex,
+ int pointLoopIndex,
+ float tension,
+ DrawingOperationTypes operationType,
+ float topDarkening,
+ float bottomDarkening,
+ PointF thirdPointPosition,
+ PointF fourthPointPosition,
+ bool clippedSegment)
+ {
+ // Create graphics path for selection
+ GraphicsPath resultPath = ((operationType & DrawingOperationTypes.CalcElementPath) == DrawingOperationTypes.CalcElementPath)
+ ? new GraphicsPath() : null;
+
+
+ //****************************************************************
+ //** Find line first and second points.
+ //****************************************************************
+
+ // Check if points are drawn from sides to center (do only once)
+ if(centerPointIndex == int.MaxValue)
+ {
+ centerPointIndex = GetCenterPointIndex(points);
+ }
+
+ //************************************************************
+ //** Find line first & second points
+ //************************************************************
+ DataPoint3D secondPoint = (DataPoint3D)points[pointIndex];
+ int pointArrayIndex = pointIndex;
+ DataPoint3D firstPoint = ChartGraphics.FindPointByIndex(
+ points,
+ secondPoint.index - 1,
+ (this.multiSeries) ? secondPoint : null,
+ ref pointArrayIndex);
+
+ //****************************************************************
+ //** Switch first and second points.
+ //****************************************************************
+ bool reversed = false;
+ if(firstPoint.index > secondPoint.index)
+ {
+ DataPoint3D tempPoint = firstPoint;
+ firstPoint = secondPoint;
+ secondPoint = tempPoint;
+ reversed = true;
+ }
+
+
+ // Points can be drawn from sides to the center.
+ // In this case can't use index in the list to find first point.
+ // Use point series and real point index to find the first point.
+ // Get required point index
+ if(matrix.Perspective != 0 && centerPointIndex != int.MaxValue)
+ {
+ pointArrayIndex = pointIndex;
+ if( pointIndex != (centerPointIndex + 1))
+ {
+ firstPoint = ChartGraphics.FindPointByIndex(points, secondPoint.index - 1, (this.multiSeries) ? secondPoint : null, ref pointArrayIndex);
+ }
+ else
+ {
+ if (!area.ReverseSeriesOrder)
+ {
+ secondPoint = ChartGraphics.FindPointByIndex(points, firstPoint.index + 1, (this.multiSeries) ? secondPoint : null, ref pointArrayIndex);
+ }
+ else
+ {
+ firstPoint = secondPoint;
+ secondPoint = ChartGraphics.FindPointByIndex(points, secondPoint.index - 1, (this.multiSeries) ? secondPoint : null, ref pointArrayIndex);
+ }
+ }
+ }
+
+ // Check if points are not null
+ if(firstPoint == null || secondPoint == null)
+ {
+ return resultPath;
+ }
+
+
+ // Area point is drawn as one segment
+ return Draw3DSurface( firstPoint, secondPoint, reversed,
+ area, graph, matrix, lightStyle, prevDataPointEx,
+ positionZ, depth, points, pointIndex, pointLoopIndex,
+ tension, operationType, LineSegmentType.Single,
+ topDarkening, bottomDarkening,
+ thirdPointPosition, fourthPointPosition,
+ clippedSegment,
+ true, true);
+ }
+
+ /// <summary>
+ /// Draws a 3D surface connecting the two specified points in 2D space.
+ /// Used to draw Line based charts.
+ /// </summary>
+ /// <param name="firstPoint">First data point.</param>
+ /// <param name="secondPoint">Second data point.</param>
+ /// <param name="reversed">Points are in reversed order.</param>
+ /// <param name="area">Chart area reference.</param>
+ /// <param name="graph">Chart graphics.</param>
+ /// <param name="matrix">Coordinates transformation matrix.</param>
+ /// <param name="lightStyle">LightStyle style (None, Simplistic, Realistic).</param>
+ /// <param name="prevDataPointEx">Previous data point object.</param>
+ /// <param name="positionZ">Z position of the back side of the 3D surface.</param>
+ /// <param name="depth">Depth of the 3D surface.</param>
+ /// <param name="points">Array of points.</param>
+ /// <param name="pointIndex">Index of point to draw.</param>
+ /// <param name="pointLoopIndex">Index of points loop.</param>
+ /// <param name="tension">Line tension.</param>
+ /// <param name="operationType">AxisName of operation Drawing, Calculating Path or Both</param>
+ /// <param name="surfaceSegmentType">Define surface segment type if it consists of several segments.</param>
+ /// <param name="topDarkening">Darkenning scale for top surface. 0 - None.</param>
+ /// <param name="bottomDarkening">Darkenning scale for bottom surface. 0 - None.</param>
+ /// <param name="thirdPointPosition">Position where the third point is actually located or float.NaN if same as in "firstPoint".</param>
+ /// <param name="fourthPointPosition">Position where the fourth point is actually located or float.NaN if same as in "secondPoint".</param>
+ /// <param name="clippedSegment">Indicates that drawn segment is 3D clipped. Only top/bottom should be drawn.</param>
+ /// <param name="clipOnTop">Indicates that top segment line should be clipped to the pkot area.</param>
+ /// <param name="clipOnBottom">Indicates that bottom segment line should be clipped to the pkot area.</param>
+ /// <returns>Returns elemnt shape path if operationType parameter is set to CalcElementPath, otherwise Null.</returns>
+ protected override GraphicsPath Draw3DSurface(
+ DataPoint3D firstPoint,
+ DataPoint3D secondPoint,
+ bool reversed,
+ ChartArea area,
+ ChartGraphics graph,
+ Matrix3D matrix,
+ LightStyle lightStyle,
+ DataPoint3D prevDataPointEx,
+ float positionZ,
+ float depth,
+ ArrayList points,
+ int pointIndex,
+ int pointLoopIndex,
+ float tension,
+ DrawingOperationTypes operationType,
+ LineSegmentType surfaceSegmentType,
+ float topDarkening,
+ float bottomDarkening,
+ PointF thirdPointPosition,
+ PointF fourthPointPosition,
+ bool clippedSegment,
+ bool clipOnTop,
+ bool clipOnBottom)
+ {
+ // Create graphics path for selection
+ GraphicsPath resultPath = ((operationType & DrawingOperationTypes.CalcElementPath) == DrawingOperationTypes.CalcElementPath)
+ ? new GraphicsPath() : null;
+
+ // Fint point with line properties
+ DataPoint3D pointAttr = secondPoint;
+ if(prevDataPointEx.dataPoint.IsEmpty)
+ {
+ pointAttr = prevDataPointEx;
+ }
+ else if(firstPoint.index > secondPoint.index)
+ {
+ pointAttr = firstPoint;
+ }
+
+ //****************************************************************
+ //** Adjust point visual properties.
+ //****************************************************************
+ Color color = (useBorderColor) ? pointAttr.dataPoint.BorderColor : pointAttr.dataPoint.Color;
+ ChartDashStyle dashStyle = pointAttr.dataPoint.BorderDashStyle;
+ if( pointAttr.dataPoint.IsEmpty && pointAttr.dataPoint.Color == Color.Empty)
+ {
+ color = Color.Gray;
+ }
+ if( pointAttr.dataPoint.IsEmpty && pointAttr.dataPoint.BorderDashStyle == ChartDashStyle.NotSet )
+ {
+ dashStyle = ChartDashStyle.Solid;
+ }
+
+ //****************************************************************
+ //** Get axis position
+ //****************************************************************
+ float axisPosition = (float)VAxis.GetPosition(this.VAxis.Crossing);
+
+
+ //****************************************************************
+ //** Calculate position of top/bootom points.
+ //****************************************************************
+ PointF thirdPoint, fourthPoint;
+ GetBottomPointsPosition(
+ Common,
+ area,
+ axisPosition,
+ ref firstPoint,
+ ref secondPoint,
+ out thirdPoint,
+ out fourthPoint);
+
+ // Check if point's position provided as parameter
+ if(!float.IsNaN(thirdPointPosition.Y))
+ {
+ thirdPoint.Y = thirdPointPosition.Y;
+ }
+ if(!float.IsNaN(fourthPointPosition.Y))
+ {
+ fourthPoint.Y = fourthPointPosition.Y;
+ }
+
+
+ //****************************************************************
+ //** Check if top/bottom lines of range segment intersect.
+ //****************************************************************
+ double smallDouble = 0.0001;
+ if (Math.Abs(firstPoint.yPosition - (double)thirdPoint.Y) > smallDouble &&
+ Math.Abs(secondPoint.yPosition - (double)fourthPoint.Y) > smallDouble &&
+ ((firstPoint.yPosition > thirdPoint.Y && secondPoint.yPosition < fourthPoint.Y) ||
+ (firstPoint.yPosition < thirdPoint.Y && secondPoint.yPosition > fourthPoint.Y)))
+ {
+ // This feature is not supported in 3D SplineRange chart type
+ if(tension != 0f)
+ {
+ throw (new InvalidOperationException(SR.Exception3DSplineY1ValueIsLessThenY2));
+ }
+
+ // Find intersection point
+ PointF intersectionCoordinates = ChartGraphics.GetLinesIntersection(
+ (float)firstPoint.xPosition, (float)firstPoint.yPosition,
+ (float)secondPoint.xPosition, (float)secondPoint.yPosition,
+ thirdPoint.X, thirdPoint.Y,
+ fourthPoint.X, fourthPoint.Y);
+ DataPoint3D intersectionPoint = new DataPoint3D();
+ intersectionPoint.xPosition = intersectionCoordinates.X;
+ intersectionPoint.yPosition = intersectionCoordinates.Y;
+
+ // Check if intersection point is valid
+ bool splitDraw = true;
+ if( double.IsNaN(intersectionCoordinates.X) ||
+ double.IsNaN(intersectionCoordinates.Y) )
+ {
+ splitDraw = false;
+ }
+ else
+ {
+ if( (decimal)intersectionCoordinates.X == (decimal)firstPoint.xPosition &&
+ (decimal)intersectionCoordinates.Y == (decimal)firstPoint.yPosition )
+ {
+ splitDraw = false;
+ }
+ if( (decimal)intersectionCoordinates.X == (decimal)secondPoint.xPosition &&
+ (decimal)intersectionCoordinates.Y == (decimal)secondPoint.yPosition )
+ {
+ splitDraw = false;
+ }
+ }
+
+ if(splitDraw)
+ {
+ // Check if reversed drawing order required
+ reversed = false;
+ if((pointIndex + 1) < points.Count)
+ {
+ DataPoint3D p = (DataPoint3D)points[pointIndex + 1];
+ if(p.index == firstPoint.index)
+ {
+ reversed = true;
+ }
+ }
+
+ // Draw two segments
+ for(int segmentIndex = 0; segmentIndex <= 1; segmentIndex++)
+ {
+ GraphicsPath segmentPath = null;
+ if(segmentIndex == 0 && !reversed ||
+ segmentIndex == 1 && reversed)
+ {
+ // Set coordinates of bottom points
+ _fourthPointY2Value = (float)intersectionPoint.yPosition;
+
+ // Draw first segment
+ intersectionPoint.dataPoint = secondPoint.dataPoint;
+ intersectionPoint.index = secondPoint.index;
+ segmentPath = Draw3DSurface( firstPoint, intersectionPoint, reversed,
+ area, graph, matrix, lightStyle, prevDataPointEx,
+ positionZ, depth, points, pointIndex, pointLoopIndex,
+ tension, operationType, surfaceSegmentType,
+ topDarkening, bottomDarkening,
+ new PointF(float.NaN, float.NaN),
+ new PointF(float.NaN, float.NaN),
+ clippedSegment,
+ true, true);
+ }
+
+ if(segmentIndex == 1 && !reversed ||
+ segmentIndex == 0 && reversed)
+ {
+ // Set coordinates of bottom points
+ _thirdPointY2Value = (float)intersectionPoint.yPosition;
+
+ // Draw second segment
+ intersectionPoint.dataPoint = firstPoint.dataPoint;
+ intersectionPoint.index = firstPoint.index;
+ segmentPath = Draw3DSurface( intersectionPoint, secondPoint, reversed,
+ area, graph, matrix, lightStyle, prevDataPointEx,
+ positionZ, depth, points, pointIndex, pointLoopIndex,
+ tension, operationType, surfaceSegmentType,
+ topDarkening, bottomDarkening,
+ new PointF(float.NaN, float.NaN),
+ new PointF(float.NaN, float.NaN),
+ clippedSegment,
+ true, true);
+ }
+
+ // Add segment path
+ if(resultPath != null && segmentPath != null && segmentPath.PointCount > 0)
+ {
+ resultPath.AddPath(segmentPath, true);
+ }
+
+ // Reset bottom line "forced" Y coordinates
+ _thirdPointY2Value = float.NaN;
+ _fourthPointY2Value = float.NaN;
+
+ }
+
+ return resultPath;
+ }
+ }
+
+
+ //****************************************************************
+ //** Detect visibility of the bounding rectangle.
+ //****************************************************************
+ float minX = (float)Math.Min(firstPoint.xPosition, secondPoint.xPosition);
+ float minY = (float)Math.Min(firstPoint.yPosition, secondPoint.yPosition);
+ minY = (float)Math.Min(minY, axisPosition);
+ float maxX = (float)Math.Max(firstPoint.xPosition, secondPoint.xPosition);
+ float maxY = (float)Math.Max(firstPoint.yPosition, secondPoint.yPosition);
+ maxY = (float)Math.Max(maxY, axisPosition);
+ RectangleF position = new RectangleF(minX, minY, maxX - minX, maxY - minY);
+ SurfaceNames visibleSurfaces = graph.GetVisibleSurfaces(position,positionZ,depth,matrix);
+
+ // Check if area point is drawn upside down.
+ bool upSideDown = false;
+ if(firstPoint.yPosition >= thirdPoint.Y && secondPoint.yPosition >= fourthPoint.Y)
+ {
+ upSideDown = true;
+
+ // Switch visibility between Top & Bottom surfaces
+ bool topVisible = ( (visibleSurfaces & SurfaceNames.Top) == SurfaceNames.Top );
+ bool bottomVisible = ( (visibleSurfaces & SurfaceNames.Bottom) == SurfaceNames.Bottom );
+ visibleSurfaces ^= SurfaceNames.Bottom;
+ visibleSurfaces ^= SurfaceNames.Top;
+ if(topVisible)
+ {
+ visibleSurfaces |= SurfaceNames.Bottom;
+ }
+ if(bottomVisible)
+ {
+ visibleSurfaces |= SurfaceNames.Top;
+ }
+ }
+
+ // Check Top/Bottom surface visibility
+ GetTopSurfaceVisibility(area, firstPoint, secondPoint, upSideDown, positionZ, depth, matrix, ref visibleSurfaces);
+
+ // Top and bottom surfaces are always visible for spline range
+ bool bottomFirst = true;
+ if(tension != 0f)
+ {
+ if( (visibleSurfaces & SurfaceNames.Bottom) == SurfaceNames.Bottom )
+ {
+ bottomFirst = false;
+ }
+ if( (visibleSurfaces & SurfaceNames.Bottom) == 0 &&
+ (visibleSurfaces & SurfaceNames.Top) == 0 )
+ {
+ bottomFirst = false;
+ }
+
+
+ visibleSurfaces |= SurfaceNames.Bottom;
+ visibleSurfaces |= SurfaceNames.Top;
+ }
+
+ // Round double values to 5 decimals
+ firstPoint.xPosition = Math.Round(firstPoint.xPosition, 5);
+ firstPoint.yPosition = Math.Round(firstPoint.yPosition, 5);
+ secondPoint.xPosition = Math.Round(secondPoint.xPosition, 5);
+ secondPoint.yPosition = Math.Round(secondPoint.yPosition, 5);
+
+ //****************************************************************
+ //** Clip area first and second data points inside
+ //** the plotting area.
+ //****************************************************************
+ if(ClipTopPoints(
+ resultPath,
+ ref firstPoint,
+ ref secondPoint,
+ reversed,
+ area,
+ graph,
+ matrix,
+ lightStyle,
+ prevDataPointEx,
+ positionZ,
+ depth,
+ points,
+ pointIndex,
+ pointLoopIndex,
+ tension,
+ operationType,
+ surfaceSegmentType,
+ topDarkening,
+ bottomDarkening
+ ) == true)
+ {
+ return resultPath;
+ }
+
+ //****************************************************************
+ //** Clip area third and fourth data points inside
+ //** the plotting area.
+ //****************************************************************
+ if(ClipBottomPoints(
+ resultPath,
+ ref firstPoint,
+ ref secondPoint,
+ ref thirdPoint,
+ ref fourthPoint,
+ reversed,
+ area,
+ graph,
+ matrix,
+ lightStyle,
+ prevDataPointEx,
+ positionZ,
+ depth,
+ points,
+ pointIndex,
+ pointLoopIndex,
+ tension,
+ operationType,
+ surfaceSegmentType,
+ topDarkening,
+ bottomDarkening
+ ) == true)
+ {
+ return resultPath;
+ }
+
+ //****************************************************************
+ //** Draw elements of area chart in 2 layers (back & front)
+ //****************************************************************
+ for(int elemLayer = 1; elemLayer <= 2; elemLayer++)
+ {
+ // Loop through all surfaces
+ SurfaceNames[] surfacesOrder = null;
+ if(bottomFirst)
+ surfacesOrder = new SurfaceNames[] {SurfaceNames.Back, SurfaceNames.Bottom, SurfaceNames.Top, SurfaceNames.Left, SurfaceNames.Right, SurfaceNames.Front};
+ else
+ surfacesOrder = new SurfaceNames[] {SurfaceNames.Back, SurfaceNames.Top, SurfaceNames.Bottom, SurfaceNames.Left, SurfaceNames.Right, SurfaceNames.Front};
+
+ LineSegmentType lineSegmentType = LineSegmentType.Middle;
+ foreach(SurfaceNames currentSurface in surfacesOrder)
+ {
+ // Check id surface should be drawn
+ if (ChartGraphics.ShouldDrawLineChartSurface(area, area.ReverseSeriesOrder, currentSurface, visibleSurfaces, color,
+ points, firstPoint, secondPoint, this.multiSeries, ref lineSegmentType) != elemLayer)
+ {
+ continue;
+ }
+
+ // Draw only borders of the invisible elements on the back layer
+ Color surfaceColor = color;
+ Color surfaceBorderColor = pointAttr.dataPoint.BorderColor;
+ if(elemLayer == 1)
+ {
+ // Draw only if point color is semi-transparent
+ if(surfaceColor.A == 255)
+ {
+ continue;
+ }
+
+ // Define drawing colors
+ surfaceColor = Color.Transparent;
+ if(surfaceBorderColor == Color.Empty)
+ {
+ // If border color is emty use color slightly darker than main back color
+ surfaceBorderColor = ChartGraphics.GetGradientColor( color, Color.Black, 0.2 );
+ }
+ }
+
+ // Draw surfaces
+ GraphicsPath surfacePath = null;
+ switch(currentSurface)
+ {
+ case(SurfaceNames.Top):
+ surfacePath = graph.Draw3DSurface( area, matrix, lightStyle, currentSurface, positionZ, depth,
+ surfaceColor, surfaceBorderColor, pointAttr.dataPoint.BorderWidth, dashStyle,
+ firstPoint, secondPoint, points, pointIndex,
+ tension, operationType, LineSegmentType.Middle,
+ (this.showPointLines) ? true : false, false, area.ReverseSeriesOrder, this.multiSeries, 0, true);
+ break;
+ case(SurfaceNames.Bottom):
+ {
+ // Calculate coordinates
+ DataPoint3D dp1 = new DataPoint3D();
+ dp1.dataPoint = firstPoint.dataPoint;
+ dp1.index = firstPoint.index;
+ dp1.xPosition = firstPoint.xPosition;
+ dp1.yPosition = thirdPoint.Y;
+ DataPoint3D dp2 = new DataPoint3D();
+ dp2.dataPoint = secondPoint.dataPoint;
+ dp2.index = secondPoint.index;
+ dp2.xPosition = secondPoint.xPosition;
+ dp2.yPosition = fourthPoint.Y;
+
+ // Draw surface
+ surfacePath = graph.Draw3DSurface( area, matrix, lightStyle, currentSurface, positionZ, depth,
+ surfaceColor, surfaceBorderColor, pointAttr.dataPoint.BorderWidth, dashStyle,
+ dp1, dp2, points, pointIndex,
+ tension, operationType, LineSegmentType.Middle,
+ (this.showPointLines) ? true : false, false, area.ReverseSeriesOrder, this.multiSeries, 1, true);
+ break;
+ }
+
+ case(SurfaceNames.Left):
+ {
+ if(surfaceSegmentType == LineSegmentType.Single ||
+ (!area.ReverseSeriesOrder && surfaceSegmentType == LineSegmentType.First) ||
+ (area.ReverseSeriesOrder && surfaceSegmentType == LineSegmentType.Last))
+ {
+
+ // Calculate coordinates
+ DataPoint3D leftMostPoint = (firstPoint.xPosition <= secondPoint.xPosition) ? firstPoint : secondPoint;
+ DataPoint3D dp1 = new DataPoint3D();
+ dp1.xPosition = leftMostPoint.xPosition;
+ dp1.yPosition = (firstPoint.xPosition <= secondPoint.xPosition) ? thirdPoint.Y : fourthPoint.Y;
+ DataPoint3D dp2 = new DataPoint3D();
+ dp2.xPosition = leftMostPoint.xPosition;;
+ dp2.yPosition = leftMostPoint.yPosition;
+
+ // Draw surface
+ surfacePath = graph.Draw3DSurface( area, matrix, lightStyle, currentSurface, positionZ, depth,
+ surfaceColor, surfaceBorderColor, pointAttr.dataPoint.BorderWidth, dashStyle,
+ dp1, dp2, points, pointIndex,
+ 0f, operationType, LineSegmentType.Single, false, true, area.ReverseSeriesOrder, this.multiSeries, 0, true);
+
+ }
+ break;
+ }
+ case(SurfaceNames.Right):
+ {
+ if(surfaceSegmentType == LineSegmentType.Single ||
+ (!area.ReverseSeriesOrder && surfaceSegmentType == LineSegmentType.Last) ||
+ (area.ReverseSeriesOrder && surfaceSegmentType == LineSegmentType.First))
+
+ {
+ // Calculate coordinates
+ DataPoint3D rightMostPoint = (secondPoint.xPosition >= firstPoint.xPosition) ? secondPoint : firstPoint;
+ DataPoint3D dp1 = new DataPoint3D();
+ dp1.xPosition = rightMostPoint.xPosition;
+ dp1.yPosition = (secondPoint.xPosition >= firstPoint.xPosition) ? fourthPoint.Y : thirdPoint.Y;
+ DataPoint3D dp2 = new DataPoint3D();
+ dp2.xPosition = rightMostPoint.xPosition;
+ dp2.yPosition = rightMostPoint.yPosition;
+
+ // Draw surface
+ surfacePath = graph.Draw3DSurface( area, matrix, lightStyle, currentSurface, positionZ, depth,
+ surfaceColor, surfaceBorderColor, pointAttr.dataPoint.BorderWidth, dashStyle,
+ dp1, dp2, points, pointIndex,
+ 0f, operationType, LineSegmentType.Single, false, true, area.ReverseSeriesOrder, this.multiSeries, 0, true);
+ }
+
+ break;
+ }
+ case(SurfaceNames.Back):
+ {
+ // Calculate coordinates
+ DataPoint3D dp1 = new DataPoint3D();
+ dp1.dataPoint = firstPoint.dataPoint;
+ dp1.index = firstPoint.index;
+ dp1.xPosition = firstPoint.xPosition;
+ dp1.yPosition = thirdPoint.Y;
+ DataPoint3D dp2 = new DataPoint3D();
+ dp2.dataPoint = secondPoint.dataPoint;
+ dp2.index = secondPoint.index;
+ dp2.xPosition = secondPoint.xPosition;
+ dp2.yPosition = fourthPoint.Y;
+
+ // Draw surface
+ surfacePath = Draw3DSplinePolygon( graph, area, positionZ,
+ surfaceColor, surfaceBorderColor, pointAttr.dataPoint.BorderWidth,
+ firstPoint, secondPoint, dp2, dp1, points,
+ tension, operationType, lineSegmentType,
+ (this.showPointLines) ? true : false);
+
+ break;
+ }
+ case(SurfaceNames.Front):
+ {
+
+ // Calculate coordinates
+ DataPoint3D dp1 = new DataPoint3D();
+ dp1.dataPoint = firstPoint.dataPoint;
+ dp1.index = firstPoint.index;
+ dp1.xPosition = firstPoint.xPosition;
+ dp1.yPosition = thirdPoint.Y;
+ DataPoint3D dp2 = new DataPoint3D();
+ dp2.dataPoint = secondPoint.dataPoint;
+ dp2.index = secondPoint.index;
+ dp2.xPosition = secondPoint.xPosition;
+ dp2.yPosition = fourthPoint.Y;
+
+ // Change segment type for the reversed series order
+ if (area.ReverseSeriesOrder)
+ {
+ if(lineSegmentType == LineSegmentType.First)
+ {
+ lineSegmentType = LineSegmentType.Last;
+ }
+ else if(lineSegmentType == LineSegmentType.Last)
+ {
+ lineSegmentType = LineSegmentType.First;
+ }
+ }
+
+ if(surfaceSegmentType != LineSegmentType.Single)
+ {
+ if( surfaceSegmentType == LineSegmentType.Middle ||
+ ( surfaceSegmentType == LineSegmentType.First && lineSegmentType != LineSegmentType.First) ||
+ ( surfaceSegmentType == LineSegmentType.Last && lineSegmentType != LineSegmentType.Last) )
+ {
+ lineSegmentType = LineSegmentType.Middle;
+ }
+ if(reversed)
+ {
+ if(lineSegmentType == LineSegmentType.First)
+ {
+ lineSegmentType = LineSegmentType.Last;
+ }
+ else if(lineSegmentType == LineSegmentType.Last)
+ {
+ lineSegmentType = LineSegmentType.First;
+ }
+ }
+ }
+
+ // Draw surface
+ surfacePath = Draw3DSplinePolygon( graph, area, positionZ + depth,
+ surfaceColor, surfaceBorderColor, pointAttr.dataPoint.BorderWidth,
+ firstPoint, secondPoint, dp2, dp1, points,
+ tension, operationType, lineSegmentType,
+ (this.showPointLines) ? true : false);
+
+ break;
+ }
+ }
+
+ // Add path of the fully visible surfaces to the result surface
+ if(elemLayer == 2 && resultPath != null && surfacePath != null && surfacePath.PointCount > 0)
+ {
+ resultPath.CloseFigure();
+ resultPath.AddPath(surfacePath, true);
+ }
+
+ }
+ }
+
+ return resultPath;
+ }
+
+ /// <summary>
+ /// Gets visibility of the top surface.
+ /// </summary>
+ /// <param name="area">Chart area object.</param>
+ /// <param name="firstPoint">First data point of the line.</param>
+ /// <param name="secondPoint">Second data point of the line.</param>
+ /// <param name="upSideDown">Indicates that Y values of the data points are below axis line.</param>
+ /// <param name="positionZ">Z coordinate of the back side of the cube.</param>
+ /// <param name="depth">Cube depth.</param>
+ /// <param name="matrix">Coordinate transformation matrix.</param>
+ /// <param name="visibleSurfaces">Surface visibility reference. Initialized with bounary cube visibility.</param>
+ protected virtual void GetTopSurfaceVisibility(
+ ChartArea area,
+ DataPoint3D firstPoint,
+ DataPoint3D secondPoint,
+ bool upSideDown,
+ float positionZ,
+ float depth,
+ Matrix3D matrix,
+ ref SurfaceNames visibleSurfaces)
+ {
+ //***********************************************************************
+ //** Check Top surface visibility
+ //***********************************************************************
+ // If Top surface visibility in bounding rectangle - do not gurantee angled linde visibility
+ if( (visibleSurfaces & SurfaceNames.Top) == SurfaceNames.Top)
+ {
+ visibleSurfaces ^= SurfaceNames.Top;
+ }
+
+ // Create top surface coordinates in 3D space
+ Point3D[] cubePoints = new Point3D[3];
+ if (!area.ReverseSeriesOrder)
+ {
+ if(!upSideDown && firstPoint.xPosition < secondPoint.xPosition ||
+ upSideDown && firstPoint.xPosition > secondPoint.xPosition)
+ {
+ cubePoints[0] = new Point3D( (float)firstPoint.xPosition, (float)firstPoint.yPosition, positionZ + depth );
+ cubePoints[1] = new Point3D( (float)firstPoint.xPosition, (float)firstPoint.yPosition, positionZ );
+ cubePoints[2] = new Point3D( (float)secondPoint.xPosition, (float)secondPoint.yPosition, positionZ );
+ }
+ else
+ {
+ cubePoints[0] = new Point3D( (float)secondPoint.xPosition, (float)secondPoint.yPosition, positionZ + depth );
+ cubePoints[1] = new Point3D( (float)secondPoint.xPosition, (float)secondPoint.yPosition, positionZ );
+ cubePoints[2] = new Point3D( (float)firstPoint.xPosition, (float)firstPoint.yPosition, positionZ );
+ }
+ }
+ else
+ {
+ if(!upSideDown && secondPoint.xPosition < firstPoint.xPosition ||
+ upSideDown && secondPoint.xPosition > firstPoint.xPosition)
+ {
+ cubePoints[0] = new Point3D( (float)secondPoint.xPosition, (float)secondPoint.yPosition, positionZ + depth );
+ cubePoints[1] = new Point3D( (float)secondPoint.xPosition, (float)secondPoint.yPosition, positionZ );
+ cubePoints[2] = new Point3D( (float)firstPoint.xPosition, (float)firstPoint.yPosition, positionZ );
+ }
+ else
+ {
+ cubePoints[0] = new Point3D( (float)firstPoint.xPosition, (float)firstPoint.yPosition, positionZ + depth );
+ cubePoints[1] = new Point3D( (float)firstPoint.xPosition, (float)firstPoint.yPosition, positionZ );
+ cubePoints[2] = new Point3D( (float)secondPoint.xPosition, (float)secondPoint.yPosition, positionZ );
+ }
+ }
+
+ // Tranform coordinates
+ matrix.TransformPoints( cubePoints );
+
+ // Check the top side visibility
+ if(ChartGraphics.IsSurfaceVisible(cubePoints[0],cubePoints[1],cubePoints[2]))
+ {
+ visibleSurfaces |= SurfaceNames.Top;
+ }
+
+
+ //***********************************************************************
+ //** Check Bottom surface visibility
+ //***********************************************************************
+
+ // Get bottom surface points
+ PointF thirdPoint, fourthPoint;
+ GetBottomPointsPosition(area.Common, area, 0, ref firstPoint, ref secondPoint, out thirdPoint, out fourthPoint);
+
+
+ // If Bottom surface visibility in bounding rectangle - do not gurantee angled linde visibility
+ if( (visibleSurfaces & SurfaceNames.Bottom) == SurfaceNames.Bottom)
+ {
+ visibleSurfaces ^= SurfaceNames.Bottom;
+ }
+
+ // Create top surface coordinates in 3D space
+ cubePoints = new Point3D[3];
+ if (!area.ReverseSeriesOrder)
+ {
+ if(!upSideDown && firstPoint.xPosition < secondPoint.xPosition ||
+ upSideDown && firstPoint.xPosition > secondPoint.xPosition)
+ {
+ cubePoints[0] = new Point3D( (float)firstPoint.xPosition, (float)thirdPoint.Y, positionZ + depth );
+ cubePoints[1] = new Point3D( (float)firstPoint.xPosition, (float)thirdPoint.Y, positionZ );
+ cubePoints[2] = new Point3D( (float)secondPoint.xPosition, (float)fourthPoint.Y, positionZ );
+ }
+ else
+ {
+ cubePoints[0] = new Point3D( (float)secondPoint.xPosition, (float)fourthPoint.Y, positionZ + depth );
+ cubePoints[1] = new Point3D( (float)secondPoint.xPosition, (float)fourthPoint.Y, positionZ );
+ cubePoints[2] = new Point3D( (float)firstPoint.xPosition, (float)thirdPoint.Y, positionZ );
+ }
+ }
+ else
+ {
+ if(!upSideDown && secondPoint.xPosition < firstPoint.xPosition ||
+ upSideDown && secondPoint.xPosition > firstPoint.xPosition)
+ {
+ cubePoints[0] = new Point3D( (float)secondPoint.xPosition, (float)fourthPoint.Y, positionZ + depth );
+ cubePoints[1] = new Point3D( (float)secondPoint.xPosition, (float)fourthPoint.Y, positionZ );
+ cubePoints[2] = new Point3D( (float)firstPoint.xPosition, (float)thirdPoint.Y, positionZ );
+ }
+ else
+ {
+ cubePoints[0] = new Point3D( (float)firstPoint.xPosition, (float)thirdPoint.Y, positionZ + depth );
+ cubePoints[1] = new Point3D( (float)firstPoint.xPosition, (float)thirdPoint.Y, positionZ );
+ cubePoints[2] = new Point3D( (float)secondPoint.xPosition, (float)fourthPoint.Y, positionZ );
+ }
+ }
+
+ // Tranform coordinates
+ matrix.TransformPoints( cubePoints );
+
+ // Check the top side visibility
+ if(ChartGraphics.IsSurfaceVisible(cubePoints[2],cubePoints[1],cubePoints[0]))
+ {
+ visibleSurfaces |= SurfaceNames.Bottom;
+ }
+
+ }
+
+ /// <summary>
+ /// Gets position ob the bottom points in area chart.
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="area">Chart area the series belongs to.</param>
+ /// <param name="axisPosition">Axis position.</param>
+ /// <param name="firstPoint">First top point coordinates.</param>
+ /// <param name="secondPoint">Second top point coordinates.</param>
+ /// <param name="thirdPoint">Returns third bottom point coordinates.</param>
+ /// <param name="fourthPoint">Returns fourth bottom point coordinates.</param>
+ protected virtual void GetBottomPointsPosition(
+ CommonElements common,
+ ChartArea area,
+ float axisPosition,
+ ref DataPoint3D firstPoint,
+ ref DataPoint3D secondPoint,
+ out PointF thirdPoint,
+ out PointF fourthPoint)
+ {
+ // Set active vertical axis
+ Axis vAxis = area.GetAxis(AxisName.Y, firstPoint.dataPoint.series.YAxisType, firstPoint.dataPoint.series.YSubAxisName);
+
+ // Initialize points using second Y value
+ float secondYValue = (float)vAxis.GetPosition(firstPoint.dataPoint.YValues[1]);
+ thirdPoint = new PointF((float)firstPoint.xPosition, secondYValue);
+ secondYValue = (float)vAxis.GetPosition(secondPoint.dataPoint.YValues[1]);
+ fourthPoint = new PointF((float)secondPoint.xPosition, secondYValue);
+
+ // Check if "forced" Y values where set
+ if(!float.IsNaN(_thirdPointY2Value))
+ {
+ thirdPoint.Y = _thirdPointY2Value;
+
+ }
+ if(!float.IsNaN(_fourthPointY2Value))
+ {
+ fourthPoint.Y = _fourthPointY2Value;
+ }
+ }
+
+ /// <summary>
+ /// Draws a 3D polygon defined by 4 points in 2D space.
+ /// Top and Bottom lines are drawn as splines of specified tension.
+ /// </summary>
+ /// <param name="area">Chart area reference.</param>
+ /// <param name="graph">Chart graphics.</param>
+ /// <param name="positionZ">Z position of the back side of the 3D surface.</param>
+ /// <param name="backColor">Color of rectangle</param>
+ /// <param name="borderColor">Border Color</param>
+ /// <param name="borderWidth">Border Width</param>
+ /// <param name="firstPoint">First point.</param>
+ /// <param name="secondPoint">Second point.</param>
+ /// <param name="thirdPoint">Third point.</param>
+ /// <param name="fourthPoint">Fourth point.</param>
+ /// <param name="points">Array of points.</param>
+ /// <param name="tension">Line tension.</param>
+ /// <param name="operationType">AxisName of operation Drawing, Calculating Path or Both</param>
+ /// <param name="lineSegmentType">AxisName of line segment. Used for step lines and splines.</param>
+ /// <param name="forceThinBorder">Thin border will be drawn on all segments.</param>
+ /// <returns>Returns elemnt shape path if operationType parameter is set to CalcElementPath, otherwise Null.</returns>
+ internal GraphicsPath Draw3DSplinePolygon(
+ ChartGraphics graph,
+ ChartArea area,
+ float positionZ,
+ Color backColor,
+ Color borderColor,
+ int borderWidth,
+ DataPoint3D firstPoint,
+ DataPoint3D secondPoint,
+ DataPoint3D thirdPoint,
+ DataPoint3D fourthPoint,
+ ArrayList points,
+ float tension,
+ DrawingOperationTypes operationType,
+ LineSegmentType lineSegmentType,
+ bool forceThinBorder)
+ {
+ // Check tension parameter
+ if(tension == 0f)
+ {
+ SurfaceNames thinBorderSides = 0;
+ if(forceThinBorder)
+ {
+ thinBorderSides = SurfaceNames.Left | SurfaceNames.Right;
+ }
+
+ return graph.Draw3DPolygon( area, area.matrix3D, SurfaceNames.Front, positionZ,
+ backColor, borderColor, borderWidth,
+ firstPoint, secondPoint, thirdPoint, fourthPoint,
+ operationType, lineSegmentType, thinBorderSides);
+ }
+
+ // Create graphics path for selection
+ bool drawElements = ((operationType & DrawingOperationTypes.DrawElement) == DrawingOperationTypes.DrawElement);
+ GraphicsPath resultPath = new GraphicsPath();
+
+ //**********************************************************************
+ //** Prepare, transform polygon coordinates
+ //**********************************************************************
+
+ // Get top line path
+ GraphicsPath topLine = graph.GetSplineFlattenPath(
+ area, positionZ,
+ firstPoint, secondPoint, points, tension, false, true, 0);
+
+ // Get bottom line path
+ GraphicsPath bottomLine = graph.GetSplineFlattenPath(
+ area, positionZ,
+ thirdPoint, fourthPoint, points, tension, false, true, 1);
+
+ // Add paths to the result path
+ resultPath.AddPath(topLine, true);
+ resultPath.AddPath(bottomLine, true);
+ resultPath.CloseAllFigures();
+
+
+ //**********************************************************************
+ //** Define drawing colors
+ //**********************************************************************
+
+ // Define 3 points polygon
+ Point3D [] points3D = new Point3D[3];
+ points3D[0] = new Point3D((float)firstPoint.xPosition, (float)firstPoint.yPosition, positionZ);
+ points3D[1] = new Point3D((float)secondPoint.xPosition, (float)secondPoint.yPosition, positionZ);
+ points3D[2] = new Point3D((float)thirdPoint.xPosition, (float)thirdPoint.yPosition, positionZ);
+
+ // Transform coordinates
+ area.matrix3D.TransformPoints( points3D );
+
+ // Get colors
+ bool topIsVisible = ChartGraphics.IsSurfaceVisible( points3D[0], points3D[1], points3D[2]);
+ Color polygonColor = area.matrix3D.GetPolygonLight(points3D, backColor, topIsVisible, area.Area3DStyle.Rotation, SurfaceNames.Front, area.ReverseSeriesOrder);
+ Color surfaceBorderColor = borderColor;
+ if(surfaceBorderColor == Color.Empty)
+ {
+ // If border color is emty use color slightly darker than main back color
+ surfaceBorderColor = ChartGraphics.GetGradientColor( backColor, Color.Black, 0.2 );
+ }
+
+ //**********************************************************************
+ //** Draw elements if required.
+ //**********************************************************************
+ Pen thickBorderPen = null;
+ if(drawElements)
+ {
+ // Remember SmoothingMode and turn off anti aliasing
+ SmoothingMode oldSmoothingMode = graph.SmoothingMode;
+ graph.SmoothingMode = SmoothingMode.Default;
+
+ // Draw the polygon
+ using (Brush brush = new SolidBrush(polygonColor))
+ {
+ graph.FillPath(brush, resultPath);
+ }
+
+ // Return old smoothing mode
+ graph.SmoothingMode = oldSmoothingMode;
+
+ // Draw thin polygon border of darker color around the whole polygon
+ if(forceThinBorder)
+ {
+ graph.DrawPath(new Pen(surfaceBorderColor, 1), resultPath);
+ }
+ else if(polygonColor.A == 255)
+ {
+ graph.DrawPath(new Pen(polygonColor, 1), resultPath);
+ }
+
+ // Create thick border line pen
+ thickBorderPen = new Pen(surfaceBorderColor, borderWidth);
+ thickBorderPen.StartCap = LineCap.Round;
+ thickBorderPen.EndCap = LineCap.Round;
+
+ // Draw thick Top & Bottom lines
+ graph.DrawPath(thickBorderPen, topLine);
+ graph.DrawPath(thickBorderPen, bottomLine);
+
+ // Draw thick Right & Left lines on first & last segments of the line
+ if(lineSegmentType == LineSegmentType.First)
+ {
+ graph.DrawLine(thickBorderPen, topLine.PathPoints[0], bottomLine.GetLastPoint());
+
+ }
+ else if(lineSegmentType == LineSegmentType.Last)
+ {
+ graph.DrawLine(thickBorderPen, topLine.GetLastPoint(), bottomLine.PathPoints[0]);
+ }
+ }
+
+
+ // Calculate path for selection
+ if(resultPath != null && thickBorderPen != null)
+ {
+ // Widen result path
+ try
+ {
+ resultPath.Widen(thickBorderPen);
+ }
+ catch (OutOfMemoryException)
+ {
+ // GraphicsPath.Widen incorrectly throws OutOfMemoryException
+ // catching here and reacting by not widening
+ }
+ catch (ArgumentException)
+ {
+ }
+ }
+
+ return resultPath;
+ }
+
+ #endregion
+
+ #region IDisposable overrides
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ // Dispose managed resources
+ if (this.areaBottomPath != null)
+ {
+ this.areaBottomPath.Dispose();
+ this.areaBottomPath = null;
+ }
+ if (this.areaPath != null)
+ {
+ this.areaPath.Dispose();
+ this.areaPath = null;
+ }
+ }
+ base.Dispose(disposing);
+ }
+ #endregion
+
+ }
+}
+
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/RenkoChart.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/RenkoChart.cs
new file mode 100644
index 00000000000..2f337381402
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/RenkoChart.cs
@@ -0,0 +1,722 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: RenkoChart.cs
+//
+// Namespace: DataVisualization.Charting.ChartTypes
+//
+// Classes: RenkoChart
+//
+// Purpose: Renko chart type provides methods for calculations and
+// depends on the Range Column chart type to do all the
+// drawing. PrepareData method is used to create temporary
+// RangeColumn series and fill it with data. Changes are
+// then reversed in the UnPrepareData method.
+//
+// Renko Chart Overview:
+// ---------------------
+// The Renko charting method is thought to have acquired its name
+// from Renga, a Japanese word for bricks. Renko charts isolate the
+// underlying price trends by filtering out minor price changes.
+// These charts can be very useful for determining major trend lines,
+// or support and resistance levels.
+//
+// Basic trend reversals are signaled with the emergence of a new
+// color brick which depends on the choice of colors used in the
+// series. Since the Renko chart is used as a trend following aid,
+// there are times when Renko charts produce whip saws, giving
+// signals near the end of short-lived trends. However, the
+// expectation with any trend following technique is that it allows
+// you to ride the major portion of any significant trends.
+//
+// Renko charts are normally based on closing price values. However,
+// unless otherwise specified, the value reflected in the chart will
+// be the first YValue. You can also specify a box size that
+// determines the minimum price change to display in the chart. The
+// default box size is calculated from the average share price over
+// the charted period.
+
+// The following should be taken into account when working with Renko
+// charts:
+//
+// - The X values of data points are automatically indexed.
+//
+// - There is a formula applied to the original data before that data
+// gets plotted. This formula changes the number of points in the data,
+// and also changes the X and Y values of the data points.
+//
+// - Due to data being recalculated, we do not recommend setting the
+// minimum and/or maximum values for the X axis. This is because it
+// cannot be determined how many data points will actually be plotted.
+// However, if the axis' Maximum, or Minimum is set, then the Maximum,
+// or Minimum properties should use data point index values.
+//
+// - Data point anchoring, used for annotations, is not supported in
+// this type of chart.
+//
+// Reviewed: AG - Microsoft 7, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Resources;
+using System.Reflection;
+using System.Collections;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.ComponentModel.Design;
+using System.Globalization;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+#else
+using System.Web.UI.DataVisualization.Charting;
+
+using System.Web.UI.DataVisualization.Charting.ChartTypes;
+using System.Web.UI.DataVisualization.Charting.Data;
+using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.ChartTypes
+#else
+namespace System.Web.UI.DataVisualization.Charting.ChartTypes
+#endif
+{
+ /// <summary>
+ /// RenkoChart class provides methods to perform all nessesary
+ /// calculations to display Renko chart with the help of the
+ /// temporary RangeColumn series. This series is created in the
+ /// PrepareData method and then removed in the UnPrepareData method.
+ /// </summary>
+ internal class RenkoChart : IChartType
+ {
+ #region Methods
+
+ /// <summary>
+ /// Prepares renko chart type for rendering.
+ /// </summary>
+ /// <param name="series">Series to be prepared.</param>
+ internal static void PrepareData(Series series)
+ {
+ // Check series chart type
+ if( String.Compare( series.ChartTypeName, ChartTypeNames.Renko, StringComparison.OrdinalIgnoreCase ) != 0 || !series.IsVisible())
+ {
+ return;
+ }
+
+ // Get reference to the chart control
+ Chart chart = series.Chart;
+ if(chart == null)
+ {
+ throw (new InvalidOperationException(SR.ExceptionRenkoNullReference));
+ }
+
+ // Renko chart may not be combined with any other chart types
+ ChartArea area = chart.ChartAreas[series.ChartArea];
+ foreach (Series currentSeries in chart.Series)
+ {
+ if (currentSeries.IsVisible() && currentSeries != series && area == chart.ChartAreas[currentSeries.ChartArea])
+ {
+ throw (new InvalidOperationException(SR.ExceptionRenkoCanNotCobine));
+ }
+ }
+
+
+ // Create a temp series which will hold original series data points
+ Series seriesOriginalData = new Series("RENKO_ORIGINAL_DATA_" + series.Name, series.YValuesPerPoint);
+ seriesOriginalData.Enabled = false;
+ seriesOriginalData.IsVisibleInLegend = false;
+ chart.Series.Add(seriesOriginalData);
+ foreach(DataPoint dp in series.Points)
+ {
+ seriesOriginalData.Points.Add(dp);
+ }
+ series.Points.Clear();
+ if(series.IsCustomPropertySet("TempDesignData"))
+ {
+ seriesOriginalData["TempDesignData"] = "true";
+ }
+
+
+ // Change renko series type to range column
+ series["OldXValueIndexed"] = series.IsXValueIndexed.ToString(CultureInfo.InvariantCulture);
+ series["OldYValuesPerPoint"] = series.YValuesPerPoint.ToString(CultureInfo.InvariantCulture);
+ series.ChartType = SeriesChartType.RangeColumn;
+ series.IsXValueIndexed = true;
+ series.YValuesPerPoint = 2;
+
+ // Calculate date-time interval for indexed series
+ if(series.ChartArea.Length > 0 &&
+ series.IsXValueDateTime())
+ {
+ // Get X axis connected to the series
+ Axis xAxis = area.GetAxis(AxisName.X, series.XAxisType, series.XSubAxisName);
+
+ // Change interval for auto-calculated interval only
+ if(xAxis.Interval == 0 && xAxis.IntervalType == DateTimeIntervalType.Auto)
+ {
+ // Check if original data has X values set to date-time values and
+ // calculate min/max X values.
+ bool nonZeroXValues = false;
+ double minX = double.MaxValue;
+ double maxX = double.MinValue;
+ foreach(DataPoint dp in seriesOriginalData.Points)
+ {
+ if(!dp.IsEmpty)
+ {
+ if(dp.XValue != 0.0)
+ {
+ nonZeroXValues = true;
+ }
+ if(dp.XValue > maxX)
+ {
+ maxX = dp.XValue;
+ }
+ if(dp.XValue < minX)
+ {
+ minX = dp.XValue;
+ }
+ }
+ }
+
+ if(nonZeroXValues)
+ {
+ // Save flag that axis interval is automatic
+ series["OldAutomaticXAxisInterval"] = "true";
+
+ // Calculate and set axis date-time interval
+ DateTimeIntervalType intervalType = DateTimeIntervalType.Auto;
+ xAxis.interval = xAxis.CalcInterval(minX, maxX, true, out intervalType, series.XValueType);
+ xAxis.intervalType = intervalType;
+ }
+ }
+ }
+
+ // Calculate renko bricks data points values
+ FillRenkoData(series, seriesOriginalData);
+ }
+
+ /// <summary>
+ /// Remove any changes done while preparing renko chart type for rendering.
+ /// </summary>
+ /// <param name="series">Series to be un-prepared.</param>
+ /// <returns>True if series was removed from collection.</returns>
+ internal static bool UnPrepareData(Series series)
+ {
+ if (series.Name.StartsWith("RENKO_ORIGINAL_DATA_", StringComparison.Ordinal))
+ {
+ // Get reference to the chart control
+ Chart chart = series.Chart;
+ if (chart == null)
+ {
+ throw (new InvalidOperationException(SR.ExceptionRenkoNullReference));
+ }
+
+ // Get original Renko series
+ Series renkoSeries = chart.Series[series.Name.Substring(20)];
+ Series.MovePositionMarkers(renkoSeries, series);
+ // Copy data back to original Renko series
+ renkoSeries.Points.Clear();
+ if (!series.IsCustomPropertySet("TempDesignData"))
+ {
+ foreach (DataPoint dp in series.Points)
+ {
+ renkoSeries.Points.Add(dp);
+ }
+ }
+
+ // Restore renko series properties
+ renkoSeries.ChartType = SeriesChartType.Renko;
+
+ bool isXValIndexed;
+ bool parseSucceed = bool.TryParse(renkoSeries["OldXValueIndexed"], out isXValIndexed);
+ renkoSeries.IsXValueIndexed = parseSucceed && isXValIndexed;
+
+ int yValsPerPoint;
+ parseSucceed = int.TryParse(renkoSeries["OldYValuesPerPoint"], NumberStyles.Any, CultureInfo.InvariantCulture, out yValsPerPoint);
+
+ if (parseSucceed)
+ {
+ renkoSeries.YValuesPerPoint = yValsPerPoint;
+ }
+
+ renkoSeries.DeleteCustomProperty("OldXValueIndexed");
+ renkoSeries.DeleteCustomProperty("OldYValuesPerPoint");
+
+ series["OldAutomaticXAxisInterval"] = "true";
+ if (renkoSeries.IsCustomPropertySet("OldAutomaticXAxisInterval"))
+ {
+ renkoSeries.DeleteCustomProperty("OldAutomaticXAxisInterval");
+
+ // Reset automatic interval for X axis
+ if (renkoSeries.ChartArea.Length > 0)
+ {
+ // Get X axis connected to the series
+ ChartArea area = chart.ChartAreas[renkoSeries.ChartArea];
+ Axis xAxis = area.GetAxis(AxisName.X, renkoSeries.XAxisType, renkoSeries.XSubAxisName);
+
+ xAxis.interval = 0.0;
+ xAxis.intervalType = DateTimeIntervalType.Auto;
+ }
+ }
+
+ // Remove series from the collection
+ chart.Series.Remove(series);
+ return true;
+ }
+
+ // Remove current box size attribute
+ if(series.IsCustomPropertySet("CurrentBoxSize"))
+ {
+ series.DeleteCustomProperty("CurrentBoxSize");
+ }
+
+ return false;
+ }
+
+ /// <summary>
+ /// Gets box size of the renko chart.
+ /// </summary>
+ /// <param name="series">Range column chart series used to dispaly the renko chart.</param>
+ /// <param name="originalData">Series with original data.</param>
+ /// <param name="yValueIndex">Index of the Y value to use.</param>
+ private static double GetBoxSize(Series series, Series originalData, int yValueIndex)
+ {
+ // Check "BoxSize" custom attribute
+ double boxSize = 1.0;
+ double percentOfPriceRange = 4.0;
+ bool roundBoxSize = true;
+ if(series.IsCustomPropertySet(CustomPropertyName.BoxSize))
+ {
+ string attrValue = series[CustomPropertyName.BoxSize].Trim();
+ bool usePercentage = attrValue.EndsWith("%", StringComparison.Ordinal);
+ if(usePercentage)
+ {
+ attrValue = attrValue.Substring(0, attrValue.Length - 1);
+ }
+
+ try
+ {
+ if(usePercentage)
+ {
+ percentOfPriceRange = double.Parse(attrValue, CultureInfo.InvariantCulture);
+ roundBoxSize = false;
+ }
+ else
+ {
+ boxSize = double.Parse(attrValue, CultureInfo.InvariantCulture);
+ percentOfPriceRange = 0.0;
+ }
+ }
+ catch
+ {
+ throw (new InvalidOperationException(SR.ExceptionRenkoBoxSizeFormatInvalid));
+ }
+ }
+
+ // Calculate box size using the percentage of price range
+ if(percentOfPriceRange > 0.0)
+ {
+ // Set default box size
+ boxSize = 1.0;
+
+ // Calculate percent of the highest and lowest price difference.
+ double highest = double.MinValue;
+ double lowest = double.MaxValue;
+ foreach(DataPoint dp in originalData.Points)
+ {
+ if(!dp.IsEmpty)
+ {
+ if(dp.YValues[yValueIndex] > highest)
+ {
+ highest = dp.YValues[yValueIndex];
+ }
+ if(dp.YValues[yValueIndex] < lowest)
+ {
+ lowest = dp.YValues[yValueIndex];
+ }
+ }
+ }
+
+ // Calculate box size as percentage of price difference
+ if(lowest == highest)
+ {
+ boxSize = 1.0;
+ }
+ else if( (highest - lowest) < 0.000001)
+ {
+ boxSize = 0.000001;
+ }
+ else
+ {
+ boxSize = (highest - lowest) * (percentOfPriceRange / 100.0);
+ }
+
+
+ // Round calculated value
+ if(roundBoxSize)
+ {
+
+ double[] availableBoxSizes = new double[]
+ { 0.000001, 0.00001, 0.0001, 0.001, 0.01, 0.1, 0.25, 0.5, 1.0, 2.0, 2.5, 3.0, 4.0, 5.0, 7.5, 10.0, 15.0, 20.0, 25.0, 50.0, 100.0, 200.0, 500.0, 1000.0, 5000.0, 10000.0, 50000.0, 100000.0, 1000000.0, 1000000.0};
+
+ for(int index = 1; index < availableBoxSizes.Length; index ++)
+ {
+ if(boxSize > availableBoxSizes[index - 1] &&
+ boxSize < availableBoxSizes[index])
+ {
+ boxSize = availableBoxSizes[index];
+ }
+ }
+ }
+ }
+
+ // Save current box size as a custom attribute of the original series
+ series["CurrentBoxSize"] = boxSize.ToString(CultureInfo.InvariantCulture);
+
+ return boxSize;
+ }
+
+ /// <summary>
+ /// Fills range column series with data to draw the renko chart.
+ /// </summary>
+ /// <param name="series">Range column chart series used to dispaly the renko chart.</param>
+ /// <param name="originalData">Series with original data.</param>
+ private static void FillRenkoData(Series series, Series originalData)
+ {
+ // Get index of the Y values used
+ int yValueIndex = 0;
+ if(series.IsCustomPropertySet(CustomPropertyName.UsedYValue))
+ {
+ try
+ {
+ yValueIndex = int.Parse(series[CustomPropertyName.UsedYValue], CultureInfo.InvariantCulture);
+ }
+ catch
+ {
+ throw (new InvalidOperationException(SR.ExceptionRenkoUsedYValueFormatInvalid));
+ }
+
+ if(yValueIndex >= series.YValuesPerPoint)
+ {
+ throw (new InvalidOperationException(SR.ExceptionRenkoUsedYValueOutOfRange));
+ }
+ }
+
+ // Calculate box size
+ double boxSize = GetBoxSize(series, originalData, yValueIndex);
+
+ // Fill points
+ double prevLow = double.NaN;
+ double prevHigh = double.NaN;
+ int pointIndex = 0;
+ foreach(DataPoint dataPoint in originalData.Points)
+ {
+ if(!dataPoint.IsEmpty)
+ {
+ int numberOfBricks = 0;
+ bool goingUp = true;
+
+ // Check if previus values exists
+ if(double.IsNaN(prevLow) || double.IsNaN(prevHigh))
+ {
+ prevHigh = dataPoint.YValues[yValueIndex];
+ prevLow = dataPoint.YValues[yValueIndex];
+ ++pointIndex;
+ continue;
+ }
+
+ // Get Up Brick color
+ Color upBrickColor = Color.Transparent;
+ string upBrickColorString = dataPoint[CustomPropertyName.PriceUpColor];
+ if(upBrickColorString == null)
+ {
+ upBrickColorString = series[CustomPropertyName.PriceUpColor];
+ }
+ if(upBrickColorString != null)
+ {
+ try
+ {
+ ColorConverter colorConverter = new ColorConverter();
+ upBrickColor = (Color)colorConverter.ConvertFromString(null, CultureInfo.InvariantCulture, upBrickColorString);
+ }
+ catch
+ {
+ throw (new InvalidOperationException(SR.ExceptionRenkoUpBrickColorInvalid));
+ }
+ }
+
+ // Check if close value exceeds last brick position by box size
+ if(dataPoint.YValues[yValueIndex] >= (prevHigh + boxSize))
+ {
+ goingUp = true;
+ numberOfBricks = (int)Math.Floor((dataPoint.YValues[yValueIndex] - prevHigh) / boxSize);
+ }
+ else if(dataPoint.YValues[yValueIndex] <= (prevLow - boxSize))
+ {
+ goingUp = false;
+ numberOfBricks = (int)Math.Floor((prevLow - dataPoint.YValues[yValueIndex]) / boxSize);
+ }
+
+ // Add points
+ while(numberOfBricks > 0)
+ {
+ // Create new point
+ DataPoint newDataPoint = (DataPoint)dataPoint.Clone();
+ newDataPoint["OriginalPointIndex"] = pointIndex.ToString(CultureInfo.InvariantCulture);
+ newDataPoint.series = series;
+ newDataPoint.YValues = new double[2];
+ newDataPoint.XValue = dataPoint.XValue;
+ newDataPoint.Tag = dataPoint;
+ if(goingUp)
+ {
+ newDataPoint.YValues[1] = prevHigh;
+ newDataPoint.YValues[0] = prevHigh + boxSize;
+ prevLow = prevHigh;
+ prevHigh = prevLow + boxSize;
+
+ // Set renko up brick appearance
+ newDataPoint.Color = upBrickColor;
+ if(newDataPoint.BorderWidth < 1)
+ {
+ newDataPoint.BorderWidth = 1;
+ }
+ if(newDataPoint.BorderDashStyle == ChartDashStyle.NotSet)
+ {
+ newDataPoint.BorderDashStyle = ChartDashStyle.Solid;
+ }
+ if( (newDataPoint.BorderColor == Color.Empty || newDataPoint.BorderColor == Color.Transparent) &&
+ (newDataPoint.Color == Color.Empty || newDataPoint.Color == Color.Transparent) )
+ {
+ newDataPoint.BorderColor = series.Color;
+ }
+ }
+ else
+ {
+ newDataPoint.YValues[1] = prevLow;
+ newDataPoint.YValues[0] = prevLow - boxSize;
+ prevHigh = prevLow;
+ prevLow = prevHigh - boxSize;
+ }
+
+ // Add renko brick to the range column series
+ series.Points.Add(newDataPoint);
+ --numberOfBricks;
+ }
+ }
+ ++pointIndex;
+ }
+ }
+
+ #endregion // Methods
+
+ #region Painting and Selection methods
+
+ /// <summary>
+ /// Paint stock chart.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ virtual public void Paint( ChartGraphics graph, CommonElements common, ChartArea area, Series seriesToDraw )
+ {
+ // Renko series is never drawn directly. It is replaced with the range column chart.
+ // See PrepareData method.
+ }
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ virtual public string Name { get{ return ChartTypeNames.Renko;}}
+
+ /// <summary>
+ /// True if chart type is stacked
+ /// </summary>
+ virtual public bool Stacked { get{ return false;}}
+
+
+ /// <summary>
+ /// True if stacked chart type supports groups
+ /// </summary>
+ virtual public bool SupportStackedGroups { get { return false; } }
+
+
+ /// <summary>
+ /// True if stacked chart type should draw separately positive and
+ /// negative data points ( Bar and column Stacked types ).
+ /// </summary>
+ public bool StackSign { get{ return false;}}
+
+ /// <summary>
+ /// True if chart type supports axeses
+ /// </summary>
+ virtual public bool RequireAxes { get{ return true;} }
+
+ /// <summary>
+ /// Chart type with two y values used for scale ( bubble chart type )
+ /// </summary>
+ public bool SecondYScale{ get{ return false;} }
+
+ /// <summary>
+ /// True if chart type requires circular chart area.
+ /// </summary>
+ public bool CircularChartArea { get{ return false;} }
+
+ /// <summary>
+ /// True if chart type supports logarithmic axes
+ /// </summary>
+ virtual public bool SupportLogarithmicAxes { get{ return true;} }
+
+ /// <summary>
+ /// True if chart type requires to switch the value (Y) axes position
+ /// </summary>
+ virtual public bool SwitchValueAxes { get{ return false;} }
+
+ /// <summary>
+ /// True if chart series can be placed side-by-side.
+ /// </summary>
+ public bool SideBySideSeries { get{ return false;} }
+
+ /// <summary>
+ /// True if each data point of a chart must be represented in the legend
+ /// </summary>
+ virtual public bool DataPointsInLegend { get{ return false;} }
+
+ /// <summary>
+ /// If the crossing value is auto Crossing value should be
+ /// automatically set to zero for some chart
+ /// types (Bar, column, area etc.)
+ /// </summary>
+ virtual public bool ZeroCrossing { get{ return false;} }
+
+ /// <summary>
+ /// True if palette colors should be applied for each data paoint.
+ /// Otherwise the color is applied to the series.
+ /// </summary>
+ virtual public bool ApplyPaletteColorsToPoints { get { return false; } }
+
+ /// <summary>
+ /// Indicates that extra Y values are connected to the scale of the Y axis
+ /// </summary>
+ virtual public bool ExtraYValuesConnectedToYAxis{ get { return true; } }
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ virtual public bool HundredPercent{ get{return false;} }
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ virtual public bool HundredPercentSupportNegative{ get{return false;} }
+
+ /// <summary>
+ /// How to draw series/points in legend:
+ /// Filled rectangle, Line or Marker
+ /// </summary>
+ /// <param name="series">Legend item series.</param>
+ /// <returns>Legend item style.</returns>
+ virtual public LegendImageStyle GetLegendImageStyle(Series series)
+ {
+ return LegendImageStyle.Rectangle;
+ }
+
+ /// <summary>
+ /// Number of supported Y value(s) per point
+ /// </summary>
+ virtual public int YValuesPerPoint { get { return 1; } }
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ virtual public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+ #endregion
+
+ #region Y values related methods
+
+ /// <summary>
+ /// Helper function, which returns the Y value of the point.
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="area">Chart area the series belongs to.</param>
+ /// <param name="series">Sereis of the point.</param>
+ /// <param name="point">Point object.</param>
+ /// <param name="pointIndex">Index of the point.</param>
+ /// <param name="yValueIndex">Index of the Y value to get.</param>
+ /// <returns>Y value of the point.</returns>
+ virtual public double GetYValue(
+ CommonElements common,
+ ChartArea area,
+ Series series,
+ DataPoint point,
+ int pointIndex,
+ int yValueIndex)
+ {
+ return point.YValues[yValueIndex];
+ }
+
+ #endregion
+
+ #region SmartLabelStyle methods
+
+ /// <summary>
+ /// Adds markers position to the list. Used to check SmartLabelStyle overlapping.
+ /// </summary>
+ /// <param name="common">Common chart elements.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="series">Series values to be used.</param>
+ /// <param name="list">List to add to.</param>
+ public void AddSmartLabelMarkerPositions(CommonElements common, ChartArea area, Series series, ArrayList list)
+ {
+ // NOTE: SmartLabelStyle feature is not supported by this chart type.
+ }
+
+ #endregion
+
+ #region IDisposable interface implementation
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected virtual void Dispose(bool disposing)
+ {
+ //Nothing to dispose at the base class.
+ }
+
+ /// <summary>
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// </summary>
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+ #endregion
+ }
+}
+
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/StackedAreaChart.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/StackedAreaChart.cs
new file mode 100644
index 00000000000..a20586e673f
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/StackedAreaChart.cs
@@ -0,0 +1,1695 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: StackedAreaChart.cs
+//
+// Namespace: DataVisualization.Charting.ChartTypes
+//
+// Classes: StackedAreaChart, HundredPercentStackedAreaChart
+//
+// Purpose: Stacked area and hundred percent stacked area charts.
+//
+// Reviewed: AG - Aug 6, 2002
+// AG - Microsoft 7, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Resources;
+using System.Reflection;
+using System.Collections;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+
+#else
+using System.Web.UI.DataVisualization.Charting;
+
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.ChartTypes
+#else
+ namespace System.Web.UI.DataVisualization.Charting.ChartTypes
+#endif
+{
+ /// <summary>
+ /// HundredPercentStackedAreaChart class extends StackedAreaChart class
+ /// by providing its own algorithm for calculating series data point
+ /// Y values. It makes sure that total Y value of all data points in a
+ /// single cluster from all series adds up to 100%.
+ /// </summary>
+ internal class HundredPercentStackedAreaChart : StackedAreaChart
+ {
+ #region Constructor
+
+ /// <summary>
+ /// Default constructor.
+ /// </summary>
+ public HundredPercentStackedAreaChart()
+ {
+ hundredPercentStacked = true;
+ }
+
+ #endregion
+
+ #region Fields
+
+ // Array of total points values
+ double[] _totalPerPoint = null;
+ int _seriesCount = -1;
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ override public string Name { get{ return ChartTypeNames.OneHundredPercentStackedArea;}}
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ override public bool HundredPercent{ get{return true;} }
+
+ #endregion
+
+ #region Painting and Selection methods
+
+ /// <summary>
+ /// Paint HundredPercentStackedAreaChart Chart
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object</param>
+ /// <param name="common">The Common elements object</param>
+ /// <param name="area">Chart area for this chart</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ override public void Paint( ChartGraphics graph, CommonElements common, ChartArea area, Series seriesToDraw )
+ {
+ this.Common = common;
+ // Reset total per point value
+ _totalPerPoint = null;
+ _seriesCount = -1;
+ // Call base class implementation
+ base.Paint( graph, common, area, seriesToDraw );
+ }
+
+ #endregion
+
+ #region Y values related methods
+ /// <summary>
+ /// Returns series count of same type for given chart area.
+ /// </summary>
+ /// <param name="common">The common elements</param>
+ /// <param name="area">The chart area to inspect</param>
+ /// <returns>Series count of same type</returns>
+ private int GetSeriesCount(CommonElements common, ChartArea area)
+ {
+ if (_seriesCount == -1)
+ {
+ // Get number of series
+ int seriesCount = 0;
+ foreach (Series ser in common.DataManager.Series)
+ {
+ // Use series of the same type which belong to this area
+ if (String.Compare(ser.ChartTypeName, Name, true, System.Globalization.CultureInfo.CurrentCulture) == 0
+ && ser.ChartArea == area.Name && ser.IsVisible())
+ {
+ ++seriesCount;
+ }
+ }
+ _seriesCount = seriesCount;
+ }
+ return _seriesCount;
+ }
+
+ /// <summary>
+ /// Helper function, which returns the Y value of the point
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="area">Chart area the series belongs to.</param>
+ /// <param name="series">Sereis of the point.</param>
+ /// <param name="point">Point object.</param>
+ /// <param name="pointIndex">Index of the point.</param>
+ /// <param name="yValueIndex">Index of the Y value to get.</param>
+ /// <returns>Y value of the point.</returns>
+ override public double GetYValue(CommonElements common, ChartArea area, Series series, DataPoint point, int pointIndex, int yValueIndex)
+ {
+
+ // Calculate the totals of all Y values for all series
+ if(_totalPerPoint == null)
+ {
+ // Get number of series
+ int seriesCount = GetSeriesCount(common, area);
+ // Fill array of series with this type, which are drawn on this area
+ Series[] seriesArray = new Series[seriesCount];
+ int seriesIndex = 0;
+ foreach( Series ser in common.DataManager.Series )
+ {
+ // Use series of the same type which belong to this area
+ if( String.Compare( ser.ChartTypeName, Name, true, System.Globalization.CultureInfo.CurrentCulture ) == 0
+ && ser.ChartArea == area.Name && ser.IsVisible())
+ {
+ seriesArray[seriesIndex++] = ser;
+ }
+ }
+
+ // Check if series are aligned
+ common.DataManipulator.CheckXValuesAlignment(seriesArray);
+
+ // Allocate memory for the array
+ _totalPerPoint = new double[series.Points.Count];
+
+ // Calculate the total of Y value per point
+ for(int index = 0; index < series.Points.Count; index++)
+ {
+ _totalPerPoint[index] = 0;
+ foreach( Series ser in seriesArray )
+ {
+ _totalPerPoint[index] += Math.Abs(ser.Points[index].YValues[0]);
+ }
+ }
+ }
+
+ // NOTE: In stacked area chart we need to do processing even if Y value is not set
+// if(point.YValues[0] == 0 || point.IsEmpty)
+// {
+// return 0;
+// }
+
+ // Calculate stacked area Y value for 2D chart
+ if(area.Area3DStyle.Enable3D == false)
+ {
+ if (_totalPerPoint[pointIndex] == 0)
+ {
+ // Get number of series
+ int seriesCount = GetSeriesCount(common, area);
+ return 100.0 / seriesCount;
+ }
+ return (point.YValues[0] / _totalPerPoint[pointIndex]) * 100.0;
+ }
+
+ // Get point Height if pointIndex == -1
+ double yValue = double.NaN;
+ if(yValueIndex == -1)
+ {
+ Axis vAxis = area.GetAxis(AxisName.Y, series.YAxisType, series.YSubAxisName);
+ double areaZeroValue = vAxis.Crossing;
+ yValue = GetYValue(common, area, series, point, pointIndex, 0);
+ if(area.Area3DStyle.Enable3D && yValue < 0.0)
+ {
+ // No negative values support in 3D stacked area chart
+ yValue = -yValue;
+ }
+ if( yValue >= 0 )
+ {
+ if(!double.IsNaN(prevPosY))
+ {
+ areaZeroValue = prevPosY;
+ }
+ }
+ else
+ {
+ if(!double.IsNaN(prevNegY))
+ {
+ areaZeroValue = prevNegY;
+ }
+ }
+
+ return yValue - areaZeroValue;
+ }
+
+
+ // Loop through all series
+ prevPosY = double.NaN;
+ prevNegY = double.NaN;
+ prevPositionX = double.NaN;
+ foreach(Series ser in common.DataManager.Series)
+ {
+ // Check series of the current chart type & area
+ if(String.Compare(series.ChartArea, ser.ChartArea, true, System.Globalization.CultureInfo.CurrentCulture) == 0 &&
+ String.Compare(series.ChartTypeName, ser.ChartTypeName, true, System.Globalization.CultureInfo.CurrentCulture) == 0 &&
+ series.IsVisible())
+ {
+ yValue = (ser.Points[pointIndex].YValues[0] / _totalPerPoint[pointIndex]) * 100.0;
+
+ // Fix of bug #677411 - Dev10 3D stacked area throws an exception when casting NaN to decimal
+ if (double.IsNaN(yValue) && _totalPerPoint[pointIndex] == 0)
+ {
+ yValue = 100.0 / GetSeriesCount(common, area);
+ }
+
+ if(!double.IsNaN(yValue))
+ if(area.Area3DStyle.Enable3D && yValue < 0.0)
+ {
+ // No negative values support in 3D stacked area chart
+ yValue = -yValue;
+ }
+ {
+ if(yValue >= 0.0 && !double.IsNaN(prevPosY))
+ {
+ yValue += prevPosY;
+ }
+ if(yValue < 0.0 && !double.IsNaN(prevNegY))
+ {
+ yValue += prevNegY;
+ }
+ }
+
+ // Exit loop when current series was found
+ if (String.Compare(series.Name, ser.Name, StringComparison.Ordinal) == 0)
+ {
+ break;
+ }
+
+ // Remenber privious position
+ if(yValue >= 0.0)
+ {
+ prevPosY = yValue;
+ }
+ else
+ {
+ prevNegY = yValue;
+ }
+ prevPositionX = ser.Points[pointIndex].XValue;
+ if(prevPositionX == 0.0 && ChartHelper.IndexedSeries(series))
+ {
+ prevPositionX = pointIndex + 1;
+ }
+ }
+ }
+
+ // Y value can't be more than a 100%
+ if(yValue > 100.0)
+ {
+ return 100.0;
+ }
+
+ return yValue;
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// StackedAreaChart class extends AreaChart so that chart series are
+ /// positioned on top of each other.
+ /// </summary>
+ internal class StackedAreaChart : AreaChart
+ {
+ #region Fields
+
+ /// <summary>
+ /// Shape of the previous series
+ /// </summary>
+ protected GraphicsPath areaBottomPath = new GraphicsPath();
+
+ /// <summary>
+ /// Previous stacked positive Y values.
+ /// </summary>
+ protected double prevPosY = double.NaN;
+
+ /// <summary>
+ /// Previous stacked negative Y values.
+ /// </summary>
+ protected double prevNegY = double.NaN;
+
+ /// <summary>
+ /// Previous X value.
+ /// </summary>
+ protected double prevPositionX = double.NaN;
+
+ /// <summary>
+ /// Indicates if chart is 100% stacked
+ /// </summary>
+ protected bool hundredPercentStacked = false;
+
+ #endregion
+
+ #region Constructor
+
+ /// <summary>
+ /// Public constructor.
+ /// </summary>
+ public StackedAreaChart()
+ {
+ multiSeries = true;
+ COPCoordinatesToCheck = COPCoordinates.X | COPCoordinates.Y;
+ }
+
+ #endregion
+
+ #region Default tension method
+
+ /// <summary>
+ /// Gets default line tension.
+ /// </summary>
+ /// <returns>Line tension.</returns>
+ override protected float GetDefaultTension()
+ {
+ return 0f;
+ }
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ public override string Name { get{ return ChartTypeNames.StackedArea;}}
+
+ /// <summary>
+ /// True if chart type is stacked
+ /// </summary>
+ public override bool Stacked { get{ return true;}}
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ override public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+
+ #endregion
+
+ #region Painting and Selection methods
+
+ /// <summary>
+ /// Paint Stacked Area Chart.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ public override void Paint( ChartGraphics graph, CommonElements common, ChartArea area, Series seriesToDraw )
+ {
+ this.Common = common;
+ // Set Clip Region
+ graph.SetClip( area.PlotAreaPosition.ToRectangleF() );
+
+ // Draw chart
+ ProcessChartType( false, graph, common, area, seriesToDraw );
+
+ // Reset Clip Region
+ ((ChartGraphics)graph).ResetClip();
+ }
+
+ /// <summary>
+ /// This method calculates position of the area and either draws it or checks selection.
+ /// </summary>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ override protected void ProcessChartType(
+ bool selection,
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ Series seriesToDraw)
+ {
+ this.Common = common;
+ ArrayList prevPointsArray = null;
+ ArrayList curentPointsArray = null;
+
+ // Prosess 3D chart type
+ if(area.Area3DStyle.Enable3D)
+ {
+ base.ProcessChartType(
+ selection,
+ graph,
+ common,
+ area,
+ seriesToDraw);
+ return;
+ }
+
+ // Zero X values mode.
+ bool indexedSeries = ChartHelper.IndexedSeries(this.Common, area.GetSeriesFromChartType(this.Name).ToArray() );
+
+ // Indicates that the second point loop for drawing lines or labels is required
+ bool requiresSecondPointLoop = false;
+ bool requiresThirdPointLoop = false;
+
+ //************************************************************
+ //** Loop through all series
+ //************************************************************
+ int seriesPointsNumber = -1;
+ foreach( Series ser in common.DataManager.Series )
+ {
+ // Process non empty series of the area with area chart type
+ if( String.Compare( ser.ChartTypeName, this.Name, StringComparison.OrdinalIgnoreCase ) != 0
+ || ser.ChartArea != area.Name || !ser.IsVisible())
+ {
+ continue;
+ }
+
+ // Reset area shape paths
+ if(areaPath != null)
+ {
+ areaPath.Dispose();
+ areaPath = null;
+ }
+ areaBottomPath.Reset();
+
+ // Check that all seres has the same number of points
+ if(seriesPointsNumber == -1)
+ {
+ seriesPointsNumber = ser.Points.Count;
+ }
+ else if(seriesPointsNumber != ser.Points.Count)
+ {
+ throw (new ArgumentException(SR.ExceptionStackedAreaChartSeriesDataPointsNumberMismatch));
+ }
+
+ // Set active horizontal/vertical axis
+ HAxis = area.GetAxis(AxisName.X, ser.XAxisType, ser.XSubAxisName);
+ VAxis = area.GetAxis(AxisName.Y, ser.YAxisType, ser.YSubAxisName);
+ hAxisMin = HAxis.ViewMinimum;
+ hAxisMax = HAxis.ViewMaximum;
+ vAxisMin = VAxis.ViewMinimum;
+ vAxisMax = VAxis.ViewMaximum;
+
+
+ // Get axis position
+ axisPos.X = (float)VAxis.GetPosition(this.VAxis.Crossing);
+ axisPos.Y = (float)VAxis.GetPosition(this.VAxis.Crossing);
+ axisPos = graph.GetAbsolutePoint(axisPos);
+
+ // Fill previous series values array
+ if(curentPointsArray == null)
+ {
+ curentPointsArray = new ArrayList(ser.Points.Count);
+ }
+ else
+ {
+ prevPointsArray = curentPointsArray;
+ curentPointsArray = new ArrayList(ser.Points.Count);
+ }
+
+ // Call Back Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPrePaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+
+ // The data points loop
+ int index = 0;
+ float prevYValue1 = axisPos.Y;
+ float prevYValue2 = axisPos.Y;
+ PointF firstPoint = PointF.Empty;
+ PointF secondPoint = PointF.Empty;
+ foreach( DataPoint point in ser.Points )
+ {
+ // Reset pre-calculated point position
+ point.positionRel = new PointF(float.NaN, float.NaN);
+
+ // Get point value
+ double yValue = (point.IsEmpty) ? 0.0 : GetYValue(common, area, ser, point, index, 0);
+ double xValue = (indexedSeries) ? (index + 1.0) : point.XValue;
+
+ // Adjust point position with previous value
+ if(prevPointsArray != null && index < prevPointsArray.Count)
+ {
+ yValue += (double)prevPointsArray[index];
+ }
+ curentPointsArray.Insert(index, yValue);
+
+ // Get point position
+ float yPosition = (float)VAxis.GetPosition(yValue);
+ float xPosition = (float)HAxis.GetPosition(xValue);
+
+ // Remeber pre-calculated point position
+ point.positionRel = new PointF(xPosition, yPosition);
+
+ yValue = VAxis.GetLogValue(yValue);
+ xValue = HAxis.GetLogValue(xValue);
+
+ // Calculate 2 points to draw area and line
+ if(firstPoint == PointF.Empty)
+ {
+ firstPoint.X = xPosition;
+ firstPoint.Y = yPosition;
+ if(prevPointsArray != null && index < prevPointsArray.Count)
+ {
+ prevYValue1 = (float)VAxis.GetPosition((double)prevPointsArray[index]);
+ prevYValue1 = graph.GetAbsolutePoint(new PointF(prevYValue1, prevYValue1)).Y;
+ }
+ firstPoint = graph.GetAbsolutePoint(firstPoint);
+
+ ++index;
+ continue;
+ }
+ else
+ {
+ secondPoint.X = xPosition;
+ secondPoint.Y = yPosition;
+ if(prevPointsArray != null && index < prevPointsArray.Count)
+ {
+ prevYValue2 = (float)VAxis.GetPosition((double)prevPointsArray[index]);
+ prevYValue2 = graph.GetAbsolutePoint(new PointF(prevYValue2, prevYValue2)).Y;
+ }
+ secondPoint = graph.GetAbsolutePoint(secondPoint);
+ }
+
+ // Round X coordinates
+ firstPoint.X = (float)Math.Round(firstPoint.X);
+ secondPoint.X = (float)Math.Round(secondPoint.X);
+
+
+ // Calculate data point area segment path
+ using (GraphicsPath path = new GraphicsPath())
+ {
+ path.AddLine(firstPoint.X, firstPoint.Y, secondPoint.X, secondPoint.Y);
+ path.AddLine(secondPoint.X, secondPoint.Y, secondPoint.X, prevYValue2);
+ path.AddLine(secondPoint.X, prevYValue2, firstPoint.X, prevYValue1);
+ path.AddLine(firstPoint.X, prevYValue1, firstPoint.X, firstPoint.Y);
+
+ // Painting mode
+ if (common.ProcessModePaint)
+ {
+ // Get previous point value
+ double xPrevValue = (indexedSeries) ? (index) : ser.Points[index - 1].XValue;
+
+ // Check if line is completly out of the data scaleView
+ if ((xValue <= hAxisMin && xPrevValue <= hAxisMin) ||
+ (xValue >= hAxisMax && xPrevValue >= hAxisMax))
+ {
+ // Save previous point
+ firstPoint = secondPoint;
+ prevYValue1 = prevYValue2;
+
+ // Increase data point index
+ ++index;
+
+ continue;
+ }
+
+ // Create area brush
+ Brush areaBrush = null;
+ if (point.BackHatchStyle != ChartHatchStyle.None)
+ {
+ areaBrush = graph.GetHatchBrush(point.BackHatchStyle, point.Color, point.BackSecondaryColor);
+ }
+ else if (point.BackGradientStyle != GradientStyle.None)
+ {
+ this.gradientFill = true;
+ this.Series = point.series;
+ }
+ else if (point.BackImage.Length > 0 && point.BackImageWrapMode != ChartImageWrapMode.Unscaled && point.BackImageWrapMode != ChartImageWrapMode.Scaled)
+ {
+ areaBrush = graph.GetTextureBrush(point.BackImage, point.BackImageTransparentColor, point.BackImageWrapMode, point.Color);
+ }
+ else if (point.IsEmpty && point.Color == Color.Empty)
+ {
+ // Stacked area chart empty points should always use
+ // series color, otherwise chart will have empty 'holes'.
+ areaBrush = new SolidBrush(ser.Color);
+ }
+ else
+ {
+ areaBrush = new SolidBrush(point.Color);
+ }
+
+ // Check if we need second loop to draw area border
+ if ((point.BorderColor != Color.Empty && point.BorderWidth > 0))
+ {
+ requiresSecondPointLoop = true;
+ }
+
+ // Check if we need third loop to draw labels
+ if (point.Label.Length > 0 || point.IsValueShownAsLabel)
+ {
+ requiresThirdPointLoop = true;
+ }
+
+ // Draw area
+ if (!this.gradientFill)
+ {
+ // Start Svg Selection mode
+ graph.StartHotRegion(point);
+
+ // Turn off anti aliasing and fill area
+ SmoothingMode oldMode = graph.SmoothingMode;
+ graph.SmoothingMode = SmoothingMode.None;
+ graph.FillPath(areaBrush, path);
+ graph.SmoothingMode = oldMode;
+
+ // Draw top and bottom lines with antialiasing turned On.
+ // Process only if line is drawn by an angle
+ Pen areaLinePen = new Pen(areaBrush, 1);
+ if (!(firstPoint.X == secondPoint.X || firstPoint.Y == secondPoint.Y))
+ {
+ graph.DrawLine(areaLinePen, firstPoint.X, firstPoint.Y, secondPoint.X, secondPoint.Y);
+ }
+ if (!(firstPoint.X == secondPoint.X || prevYValue2 == prevYValue1))
+ {
+ graph.DrawLine(areaLinePen, secondPoint.X, prevYValue2, firstPoint.X, prevYValue1);
+ }
+
+ // End Svg Selection mode
+ graph.EndHotRegion();
+ }
+
+ if (areaPath == null)
+ {
+ areaPath = new GraphicsPath();
+ }
+ areaPath.AddLine(firstPoint.X, firstPoint.Y, secondPoint.X, secondPoint.Y);
+ areaBottomPath.AddLine(firstPoint.X, prevYValue1, secondPoint.X, prevYValue2);
+
+ //Clean up
+ if (areaBrush != null)
+ areaBrush.Dispose();
+ }
+
+ if (common.ProcessModeRegions)
+ {
+ //**************************************************************
+ //** Add area for the inside of the area
+ //**************************************************************
+
+ // Allocate array of floats
+ PointF pointNew = PointF.Empty;
+ float[] coord = new float[path.PointCount * 2];
+ PointF[] pathPoints = path.PathPoints;
+ for (int i = 0; i < path.PointCount; i++)
+ {
+ pointNew = graph.GetRelativePoint(pathPoints[i]);
+ coord[2 * i] = pointNew.X;
+ coord[2 * i + 1] = pointNew.Y;
+ }
+
+ common.HotRegionsList.AddHotRegion(
+ path,
+ false,
+ coord,
+ point,
+ ser.Name,
+ index);
+
+ //**************************************************************
+ //** Add area for the top line (with thickness)
+ //**************************************************************
+ if (point.BorderWidth > 1 && point.BorderDashStyle != ChartDashStyle.NotSet && point.BorderColor != Color.Empty)
+ {
+ // Create grapics path object dor the curve
+ using (GraphicsPath linePath = new GraphicsPath())
+ {
+ try
+ {
+ linePath.AddLine(firstPoint.X, firstPoint.Y, secondPoint.X, secondPoint.Y);
+
+ // Widen the lines to the size of pen plus 2
+ linePath.Widen(new Pen(point.Color, point.BorderWidth + 2));
+ }
+ catch (OutOfMemoryException)
+ {
+ // GraphicsPath.Widen incorrectly throws OutOfMemoryException
+ // catching here and reacting by not widening
+ }
+ catch (ArgumentException)
+ {
+ }
+
+ // Allocate array of floats
+ pointNew = PointF.Empty;
+ coord = new float[linePath.PointCount * 2];
+ for (int i = 0; i < linePath.PointCount; i++)
+ {
+ pointNew = graph.GetRelativePoint(linePath.PathPoints[i]);
+ coord[2 * i] = pointNew.X;
+ coord[2 * i + 1] = pointNew.Y;
+ }
+
+ common.HotRegionsList.AddHotRegion(
+ linePath,
+ false,
+ coord,
+ point,
+ ser.Name,
+ index);
+ }
+ }
+ }
+ }
+ // Save previous point
+ firstPoint = secondPoint;
+ prevYValue1 = prevYValue2;
+
+ // Increase data point index
+ ++index;
+
+ }
+
+ // Fill whole series area with gradient
+ if(gradientFill && areaPath != null)
+ {
+ // Create gradient path
+ using (GraphicsPath gradientPath = new GraphicsPath())
+ {
+ gradientPath.AddPath(areaPath, true);
+ areaBottomPath.Reverse();
+ gradientPath.AddPath(areaBottomPath, true);
+
+ // Create brush
+ using (Brush areaBrush = graph.GetGradientBrush(gradientPath.GetBounds(), this.Series.Color, this.Series.BackSecondaryColor, this.Series.BackGradientStyle))
+ {
+ // Fill area with gradient
+ graph.FillPath(areaBrush, gradientPath);
+ }
+ }
+
+ areaPath.Dispose();
+ areaPath = null;
+ gradientFill = false;
+ }
+ areaBottomPath.Reset();
+
+ // Call Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPostPaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+ }
+
+ //************************************************************
+ //** Loop through all series/points for the second time
+ //** Draw border lines.
+ //************************************************************
+ if(requiresSecondPointLoop)
+ {
+ prevPointsArray = null;
+ curentPointsArray = null;
+ foreach( Series ser in common.DataManager.Series )
+ {
+ if( String.Compare( ser.ChartTypeName, this.Name, StringComparison.OrdinalIgnoreCase ) != 0
+ || ser.ChartArea != area.Name || !ser.IsVisible())
+ {
+ continue;
+ }
+
+ // Set active horizontal/vertical axis
+ HAxis = area.GetAxis(AxisName.X, ser.XAxisType, ser.XSubAxisName);
+ VAxis = area.GetAxis(AxisName.Y, ser.YAxisType, ser.YSubAxisName);
+
+ // Get axis position
+ axisPos.X = (float)VAxis.GetPosition(this.VAxis.Crossing);
+ axisPos.Y = (float)VAxis.GetPosition(this.VAxis.Crossing);
+ axisPos = graph.GetAbsolutePoint(axisPos);
+
+ // Fill previous series values array
+ if(curentPointsArray == null)
+ {
+ curentPointsArray = new ArrayList(ser.Points.Count);
+ }
+ else
+ {
+ prevPointsArray = curentPointsArray;
+ curentPointsArray = new ArrayList(ser.Points.Count);
+ }
+
+ // The data points loop
+ int index = 0;
+ float prevYValue1 = axisPos.Y;
+ float prevYValue2 = axisPos.Y;
+ PointF firstPoint = PointF.Empty;
+ PointF secondPoint = PointF.Empty;
+ foreach( DataPoint point in ser.Points )
+ {
+ // Get point value
+ double yValue = (point.IsEmpty) ? 0.0 : GetYValue(common, area, ser, point, index, 0);
+ double xValue = (indexedSeries) ? (index + 1.0) : point.XValue;
+
+ // Adjust point position with previous value
+ if(prevPointsArray != null && index < prevPointsArray.Count)
+ {
+ yValue += (double)prevPointsArray[index];
+ }
+ curentPointsArray.Insert(index, yValue);
+
+ // Get point position
+ float yPosition = (float)VAxis.GetPosition(yValue);
+ float xPosition = (float)HAxis.GetPosition(xValue);
+
+
+ // Calculate 2 points to draw area and line
+ if(firstPoint == PointF.Empty)
+ {
+ firstPoint.X = xPosition;
+ firstPoint.Y = yPosition;
+ if(prevPointsArray != null && index < prevPointsArray.Count)
+ {
+ prevYValue1 = (float)VAxis.GetPosition((double)prevPointsArray[index]);
+ prevYValue1 = graph.GetAbsolutePoint(new PointF(prevYValue1, prevYValue1)).Y;
+ }
+ firstPoint = graph.GetAbsolutePoint(firstPoint);
+ secondPoint = firstPoint;
+ prevYValue2 = prevYValue1;
+ }
+ else
+ {
+ secondPoint.X = xPosition;
+ secondPoint.Y = yPosition;
+ if(prevPointsArray != null && index < prevPointsArray.Count)
+ {
+ prevYValue2 = (float)VAxis.GetPosition((double)prevPointsArray[index]);
+ prevYValue2 = graph.GetAbsolutePoint(new PointF(prevYValue2, prevYValue2)).Y;
+ }
+ secondPoint = graph.GetAbsolutePoint(secondPoint);
+ }
+
+ if(index != 0)
+ {
+ // Round X coordinates
+ firstPoint.X = (float)Math.Round(firstPoint.X);
+ secondPoint.X = (float)Math.Round(secondPoint.X);
+
+ // Draw border
+ graph.DrawLineRel(point.BorderColor, point.BorderWidth, point.BorderDashStyle, graph.GetRelativePoint(firstPoint), graph.GetRelativePoint(secondPoint), point.series.ShadowColor, point.series.ShadowOffset );
+ }
+
+ // Save previous point
+ firstPoint = secondPoint;
+ prevYValue1 = prevYValue2;
+
+ // Increase data point index
+ ++index;
+ }
+ }
+ }
+
+ //************************************************************
+ //** Loop through all series/points for the second time
+ //** Draw labels.
+ //************************************************************
+ if(requiresThirdPointLoop)
+ {
+ prevPointsArray = null;
+ curentPointsArray = null;
+ foreach( Series ser in common.DataManager.Series )
+ {
+ if( String.Compare( ser.ChartTypeName, this.Name, StringComparison.OrdinalIgnoreCase ) != 0
+ || ser.ChartArea != area.Name || !ser.IsVisible())
+ {
+ continue;
+ }
+
+ // Set active horizontal/vertical axis
+ HAxis = area.GetAxis(AxisName.X, ser.XAxisType, ser.XSubAxisName);
+ VAxis = area.GetAxis(AxisName.Y, ser.YAxisType, ser.YSubAxisName);
+
+ // Get axis position
+ axisPos.X = (float)VAxis.GetPosition(this.VAxis.Crossing);
+ axisPos.Y = (float)VAxis.GetPosition(this.VAxis.Crossing);
+ axisPos = graph.GetAbsolutePoint(axisPos);
+
+ // Fill previous series values array
+ if(curentPointsArray == null)
+ {
+ curentPointsArray = new ArrayList(ser.Points.Count);
+ }
+ else
+ {
+ prevPointsArray = curentPointsArray;
+ curentPointsArray = new ArrayList(ser.Points.Count);
+ }
+
+ // The data points loop
+ int index = 0;
+ float prevYValue1 = axisPos.Y;
+ float prevYValue2 = axisPos.Y;
+ PointF firstPoint = PointF.Empty;
+ PointF secondPoint = PointF.Empty;
+ foreach( DataPoint point in ser.Points )
+ {
+ // Get point value
+ double yValue = (point.IsEmpty) ? 0.0 : GetYValue(common, area, ser, point, index, 0);
+ double xValue = (indexedSeries) ? (index + 1.0) : point.XValue;
+
+ // Adjust point position with previous value
+ if(prevPointsArray != null && index < prevPointsArray.Count)
+ {
+ yValue += (double)prevPointsArray[index];
+ }
+ curentPointsArray.Insert(index, yValue);
+
+ // Get point position
+ float yPosition = (float)VAxis.GetPosition(yValue);
+ float xPosition = (float)HAxis.GetPosition(xValue);
+
+
+ // Calculate 2 points to draw area and line
+ if(firstPoint == PointF.Empty)
+ {
+ firstPoint.X = xPosition;
+ firstPoint.Y = yPosition;
+ if(prevPointsArray != null && index < prevPointsArray.Count)
+ {
+ prevYValue1 = (float)VAxis.GetPosition((double)prevPointsArray[index]);
+ prevYValue1 = graph.GetAbsolutePoint(new PointF(prevYValue1, prevYValue1)).Y;
+ }
+ firstPoint = graph.GetAbsolutePoint(firstPoint);
+ secondPoint = firstPoint;
+ prevYValue2 = prevYValue1;
+ }
+ else
+ {
+ secondPoint.X = xPosition;
+ secondPoint.Y = yPosition;
+ if(prevPointsArray != null && index < prevPointsArray.Count)
+ {
+ prevYValue2 = (float)VAxis.GetPosition((double)prevPointsArray[index]);
+ prevYValue2 = graph.GetAbsolutePoint(new PointF(prevYValue2, prevYValue2)).Y;
+ }
+ secondPoint = graph.GetAbsolutePoint(secondPoint);
+ }
+
+ if(!point.IsEmpty && (ser.IsValueShownAsLabel || point.IsValueShownAsLabel || point.Label.Length > 0))
+ {
+ // Label text format
+ using (StringFormat format = new StringFormat())
+ {
+ format.Alignment = StringAlignment.Center;
+ format.LineAlignment = StringAlignment.Center;
+
+ // Get label text
+ string text;
+ if (point.Label.Length == 0)
+ {
+ double pointLabelValue = GetYValue(common, area, ser, point, index, 0);
+ // Round Y values for 100% stacked area
+ if (this.hundredPercentStacked && point.LabelFormat.Length == 0)
+ {
+ pointLabelValue = Math.Round(pointLabelValue, 2);
+ }
+ text = ValueConverter.FormatValue(
+ ser.Chart,
+ point,
+ point.Tag,
+ pointLabelValue,
+ point.LabelFormat,
+ ser.YValueType,
+ ChartElementType.DataPoint);
+ }
+ else
+ {
+ text = point.ReplaceKeywords(point.Label);
+ }
+
+ // Disable the clip region
+ Region oldClipRegion = graph.Clip;
+ graph.Clip = new Region();
+
+ // Draw label
+ PointF labelPosition = PointF.Empty;
+ labelPosition.X = secondPoint.X;
+ labelPosition.Y = secondPoint.Y - (secondPoint.Y - prevYValue2) / 2f;
+ labelPosition = graph.GetRelativePoint(labelPosition);
+
+ // Measure string
+ SizeF sizeFont = graph.GetRelativeSize(
+ graph.MeasureString(
+ text,
+ point.Font,
+ new SizeF(1000f, 1000f),
+ StringFormat.GenericTypographic));
+
+ // Get label background position
+ RectangleF labelBackPosition = RectangleF.Empty;
+ SizeF sizeLabel = new SizeF(sizeFont.Width, sizeFont.Height);
+ sizeLabel.Height += sizeFont.Height / 8;
+ sizeLabel.Width += sizeLabel.Width / text.Length;
+ labelBackPosition = new RectangleF(
+ labelPosition.X - sizeLabel.Width / 2,
+ labelPosition.Y - sizeLabel.Height / 2 - sizeFont.Height / 10,
+ sizeLabel.Width,
+ sizeLabel.Height);
+
+ // Draw label text
+ using (Brush brush = new SolidBrush(point.LabelForeColor))
+ {
+ graph.DrawPointLabelStringRel(
+ common,
+ text,
+ point.Font,
+ brush,
+ labelPosition,
+ format,
+ point.LabelAngle,
+ labelBackPosition,
+ point.LabelBackColor,
+ point.LabelBorderColor,
+ point.LabelBorderWidth,
+ point.LabelBorderDashStyle,
+ ser,
+ point,
+ index);
+ }
+
+ // Restore old clip region
+ graph.Clip = oldClipRegion;
+ }
+ }
+
+
+ // Save previous point
+ firstPoint = secondPoint;
+ prevYValue1 = prevYValue2;
+
+ // Increase data point index
+ ++index;
+
+ }
+ }
+ }
+ }
+
+ #endregion
+
+ #region 3D Drawing and selection methods
+
+ /// <summary>
+ /// Draws a 3D surface connecting the two specified points in 2D space.
+ /// Used to draw Line based charts.
+ /// </summary>
+ /// <param name="area">Chart area reference.</param>
+ /// <param name="graph">Chart graphics.</param>
+ /// <param name="matrix">Coordinates transformation matrix.</param>
+ /// <param name="lightStyle">LightStyle style (None, Simplistic, Realistic).</param>
+ /// <param name="prevDataPointEx">Previous data point object.</param>
+ /// <param name="positionZ">Z position of the back side of the 3D surface.</param>
+ /// <param name="depth">Depth of the 3D surface.</param>
+ /// <param name="points">Array of points.</param>
+ /// <param name="pointIndex">Index of point to draw.</param>
+ /// <param name="pointLoopIndex">Index of points loop.</param>
+ /// <param name="tension">Line tension.</param>
+ /// <param name="operationType">AxisName of operation Drawing, Calculating Path or Both</param>
+ /// <param name="topDarkening">Darkenning scale for top surface. 0 - None.</param>
+ /// <param name="bottomDarkening">Darkenning scale for bottom surface. 0 - None.</param>
+ /// <param name="thirdPointPosition">Position where the third point is actually located or float.NaN if same as in "firstPoint".</param>
+ /// <param name="fourthPointPosition">Position where the fourth point is actually located or float.NaN if same as in "secondPoint".</param>
+ /// <param name="clippedSegment">Indicates that drawn segment is 3D clipped. Only top/bottom should be drawn.</param>
+ /// <returns>Returns elemnt shape path if operationType parameter is set to CalcElementPath, otherwise Null.</returns>
+ protected override GraphicsPath Draw3DSurface(
+ ChartArea area,
+ ChartGraphics graph,
+ Matrix3D matrix,
+ LightStyle lightStyle,
+ DataPoint3D prevDataPointEx,
+ float positionZ,
+ float depth,
+ ArrayList points,
+ int pointIndex,
+ int pointLoopIndex,
+ float tension,
+ DrawingOperationTypes operationType,
+ float topDarkening,
+ float bottomDarkening,
+ PointF thirdPointPosition,
+ PointF fourthPointPosition,
+ bool clippedSegment)
+ {
+ // Call base method
+
+ if(pointLoopIndex != 2)
+ {
+ return base.Draw3DSurface(
+ area,
+ graph,
+ matrix,
+ lightStyle,
+ prevDataPointEx,
+ positionZ,
+ depth,
+ points,
+ pointIndex,
+ pointLoopIndex,
+ tension,
+ operationType,
+ topDarkening,
+ bottomDarkening,
+ thirdPointPosition,
+ fourthPointPosition,
+ clippedSegment);
+ }
+
+ // Draw labels in the third loop
+ else
+ {
+ DataPoint3D pointEx = ((DataPoint3D)points[pointIndex]);
+
+ // Draw label for the first point
+ if(pointEx.index == 2)
+ {
+ // Get point with prev index
+ int neighborPointIndex = 0;
+ DataPoint3D pointPrevEx = ChartGraphics.FindPointByIndex(points, pointEx.index - 1, pointEx, ref neighborPointIndex);
+
+ // Draw labels in the third loop
+ DrawLabels3D(
+ area,
+ graph,
+ area.Common,
+ pointPrevEx,
+ positionZ,
+ depth);
+ }
+
+ // Draw labels in the third loop
+ DrawLabels3D(
+ area,
+ graph,
+ area.Common,
+ pointEx,
+ positionZ,
+ depth);
+ }
+
+ return new GraphicsPath();
+ }
+
+ /// <summary>
+ /// Gets visibility of the top surface.
+ /// </summary>
+ /// <param name="area">Chart area object.</param>
+ /// <param name="firstPoint">First data point of the line.</param>
+ /// <param name="secondPoint">Second data point of the line.</param>
+ /// <param name="upSideDown">Indicates that Y values of the data points are below axis line.</param>
+ /// <param name="positionZ">Z coordinate of the back side of the cube.</param>
+ /// <param name="depth">Cube depth.</param>
+ /// <param name="matrix">Coordinate transformation matrix.</param>
+ /// <param name="visibleSurfaces">Surface visibility reference. Initialized with bounary cube visibility.</param>
+ protected override void GetTopSurfaceVisibility(
+ ChartArea area,
+ DataPoint3D firstPoint,
+ DataPoint3D secondPoint,
+ bool upSideDown,
+ float positionZ,
+ float depth,
+ Matrix3D matrix,
+ ref SurfaceNames visibleSurfaces)
+ {
+ // Call base class method first
+ base.GetTopSurfaceVisibility(area, firstPoint, secondPoint, upSideDown,
+ positionZ, depth, matrix, ref visibleSurfaces);
+
+ // Check if the Top surface is overlapped with data point from other series
+ if( (visibleSurfaces & SurfaceNames.Top) == SurfaceNames.Top )
+ {
+ // Try to find data point with same index from the series above
+ bool seriesFound = false;
+ foreach(Series ser in area.Common.DataManager.Series)
+ {
+ if(String.Compare(ser.ChartTypeName, secondPoint.dataPoint.series.ChartTypeName, true, System.Globalization.CultureInfo.CurrentCulture) == 0)
+ {
+ // If series on top of current was found - check point transparency
+ if(seriesFound)
+ {
+ DataPointCustomProperties pointProperties = ser.Points[secondPoint.index - 1];
+ if(ser.Points[secondPoint.index - 1].IsEmpty)
+ {
+ pointProperties = ser.EmptyPointStyle;
+ }
+ if (pointProperties.Color.A == 255)
+ {
+ visibleSurfaces ^= SurfaceNames.Top;
+ }
+ break;
+ }
+
+ // Check series name
+ if(String.Compare(ser.Name, secondPoint.dataPoint.series.Name, StringComparison.Ordinal) == 0)
+ {
+ seriesFound = true;
+ }
+ }
+ }
+ }
+
+ // Check if the Bottom surface is on top of the transparent data point from other series
+ if( (visibleSurfaces & SurfaceNames.Bottom) != SurfaceNames.Bottom )
+ {
+ // Try to find data point with same index from the series above
+ DataPointCustomProperties pointProperties = null;
+ foreach(Series ser in area.Common.DataManager.Series)
+ {
+ if(String.Compare(ser.ChartTypeName, secondPoint.dataPoint.series.ChartTypeName, StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ // Check series name
+ if (pointProperties != null && String.Compare(ser.Name, secondPoint.dataPoint.series.Name, StringComparison.Ordinal) == 0)
+ {
+ if (pointProperties.Color.A != 255)
+ {
+ visibleSurfaces |= SurfaceNames.Bottom;
+ }
+ break;
+ }
+
+ // Get properties
+ pointProperties = ser.Points[secondPoint.index - 1];
+ if(ser.Points[secondPoint.index - 1].IsEmpty)
+ {
+ pointProperties = ser.EmptyPointStyle;
+ }
+ }
+ }
+ }
+
+ }
+
+ /// <summary>
+ /// Gets position ob the bottom points in area chart.
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="area">Chart area the series belongs to.</param>
+ /// <param name="axisPosition">Axis position.</param>
+ /// <param name="firstPoint">First top point coordinates.</param>
+ /// <param name="secondPoint">Second top point coordinates.</param>
+ /// <param name="thirdPointPosition">Position where the third point is actually located or float.NaN if same as in "firstPoint".</param>
+ /// <param name="fourthPointPosition">Position where the fourth point is actually located or float.NaN if same as in "secondPoint".</param>
+ /// <param name="thirdPoint">Returns third bottom point coordinates.</param>
+ /// <param name="fourthPoint">Returns fourth bottom point coordinates.</param>
+ protected override void GetBottomPointsPosition(
+ CommonElements common,
+ ChartArea area,
+ float axisPosition,
+ ref DataPoint3D firstPoint,
+ ref DataPoint3D secondPoint,
+ PointF thirdPointPosition,
+ PointF fourthPointPosition,
+ out PointF thirdPoint,
+ out PointF fourthPoint)
+ {
+ // Set active vertical/horizontal axis
+ Axis vAxis = area.GetAxis(AxisName.Y, firstPoint.dataPoint.series.YAxisType, firstPoint.dataPoint.series.YSubAxisName);
+ Axis hAxis = area.GetAxis(AxisName.X, firstPoint.dataPoint.series.XAxisType, firstPoint.dataPoint.series.XSubAxisName);
+
+ // Find bottom points position
+ double yValue = GetYValue(area.Common, area, firstPoint.dataPoint.series, firstPoint.dataPoint, firstPoint.index - 1, 0);
+ double xValue = (float)firstPoint.xPosition;
+ if(yValue >= 0.0)
+ {
+ if(double.IsNaN(this.prevPosY))
+ {
+ yValue = axisPosition;
+ }
+ else
+ {
+ yValue = vAxis.GetPosition(this.prevPosY);
+ xValue = hAxis.GetPosition(this.prevPositionX);
+ }
+ }
+ else
+ {
+ if(double.IsNaN(this.prevNegY))
+ {
+ yValue = axisPosition;
+ }
+ else
+ {
+ yValue = vAxis.GetPosition(this.prevNegY);
+ xValue = hAxis.GetPosition(this.prevPositionX);
+ }
+ }
+ thirdPoint = new PointF((float)xValue, (float)yValue);
+
+
+ yValue = GetYValue(area.Common, area, secondPoint.dataPoint.series, secondPoint.dataPoint, secondPoint.index - 1, 0);
+ xValue = (float)secondPoint.xPosition;
+ if(yValue >= 0.0)
+ {
+ if(double.IsNaN(this.prevPosY))
+ {
+ yValue = axisPosition;
+ }
+ else
+ {
+ yValue = vAxis.GetPosition(this.prevPosY);
+ xValue = hAxis.GetPosition(this.prevPositionX);
+ }
+ }
+ else
+ {
+ if(double.IsNaN(this.prevNegY))
+ {
+ yValue = axisPosition;
+ }
+ else
+ {
+ yValue = vAxis.GetPosition(this.prevNegY);
+ xValue = hAxis.GetPosition(this.prevPositionX);
+ }
+ }
+ fourthPoint = new PointF((float)xValue, (float)yValue);
+
+ // Check if position of the third and/or fourth point(s) should be adjusted
+ if(!float.IsNaN(thirdPointPosition.X))
+ {
+ thirdPoint.X = (float)((firstPoint.xCenterVal == 0.0) ? firstPoint.xPosition : firstPoint.xCenterVal);
+
+ // Calculate new Y value as an intersection point of two lines:
+ // line between current 3d & 4th points and vertical line with X value = thirdPointPositionX.
+ thirdPoint.Y = (thirdPointPosition.X - fourthPoint.X) /
+ (thirdPoint.X - fourthPoint.X) *
+ (thirdPoint.Y - fourthPoint.Y) +
+ fourthPoint.Y;
+
+ // Set new X value
+ thirdPoint.X = thirdPointPosition.X;
+ }
+ if(!float.IsNaN(thirdPointPosition.Y))
+ {
+ thirdPoint.Y = thirdPointPosition.Y;
+ }
+
+ if(!float.IsNaN(fourthPointPosition.X))
+ {
+ fourthPoint.X = (float)((secondPoint.xCenterVal == 0.0) ? secondPoint.xPosition : secondPoint.xCenterVal);
+
+ // Calculate new Y value as an intersection point of two lines:
+ // line between current 3d & 4th points and vertical line with X value = thirdPointPositionX.
+ fourthPoint.Y = (fourthPointPosition.X - fourthPoint.X) /
+ (thirdPoint.X - fourthPoint.X) *
+ (thirdPoint.Y - fourthPoint.Y) +
+ fourthPoint.Y;
+
+ // Set new X value
+ fourthPoint.X = fourthPointPosition.X;
+ }
+ if(!float.IsNaN(fourthPointPosition.Y))
+ {
+ fourthPoint.Y = fourthPointPosition.Y;
+ }
+
+ }
+
+ /// <summary>
+ /// Returns how many loops through all data points is required (1 or 2)
+ /// </summary>
+ /// <param name="selection">Selection indicator.</param>
+ /// <param name="pointsArray">Points array list.</param>
+ /// <returns>Number of loops (1 or 2).</returns>
+ override protected int GetPointLoopNumber(bool selection, ArrayList pointsArray)
+ {
+ // Always one loop for selection
+ if(selection)
+ {
+ return 1;
+ }
+
+ // Second loop will be required for semi-transparent colors
+ int loopNumber = 1;
+ foreach(object obj in pointsArray)
+ {
+ // Get point & series
+ DataPoint3D pointEx = (DataPoint3D) obj;
+
+ // Check properties
+ if(pointEx.dataPoint.Color.A != 255)
+ {
+ loopNumber = 2;
+ }
+
+ // Check title
+ // VSTS fix #529011: 3-d stacked area and 100% stacked area charts do not show data labels.
+ if( pointEx.dataPoint.Label.Length > 0 ||
+ pointEx.dataPoint.IsValueShownAsLabel ||
+ pointEx.dataPoint.series.IsValueShownAsLabel)
+ {
+ // S loops through all data points required
+ loopNumber = 3;
+ break;
+ }
+ }
+
+ return loopNumber;
+ }
+
+ /// <summary>
+ /// This method draws labels in point chart.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="pointEx">Data point 3D.</param>
+ /// <param name="positionZ">Z position of the back side of the 3D surface.</param>
+ /// <param name="depth">Depth of the 3D surface.</param>
+ private void DrawLabels3D(
+ ChartArea area,
+ ChartGraphics graph,
+ CommonElements common,
+ DataPoint3D pointEx,
+ float positionZ,
+ float depth)
+ {
+ // Get some properties for performance
+ string pointLabel = pointEx.dataPoint.Label;
+ bool pointShowLabelAsValue = pointEx.dataPoint.IsValueShownAsLabel;
+
+ // ****************************
+ // Draw data point value label
+ // ****************************
+ if((!pointEx.dataPoint.IsEmpty && (pointEx.dataPoint.series.IsValueShownAsLabel || pointShowLabelAsValue || pointLabel.Length > 0)) ||
+ (pointShowLabelAsValue || pointLabel.Length > 0))
+ {
+ // Label text format
+ using (StringFormat format = new StringFormat())
+ {
+ format.Alignment = StringAlignment.Center;
+ format.LineAlignment = StringAlignment.Center;
+
+ // Get label text
+ string text;
+ if (pointLabel.Length == 0)
+ {
+ // Round Y values for 100% stacked area
+ double pointLabelValue = pointEx.dataPoint.YValues[(labelYValueIndex == -1) ? YValueIndex : labelYValueIndex];
+ if (this.hundredPercentStacked && pointEx.dataPoint.LabelFormat.Length == 0)
+ {
+ pointLabelValue = Math.Round(pointLabelValue, 2);
+ }
+
+ text = ValueConverter.FormatValue(
+ pointEx.dataPoint.series.Chart,
+ pointEx.dataPoint,
+ pointEx.dataPoint.Tag,
+ pointLabelValue,
+ pointEx.dataPoint.LabelFormat,
+ pointEx.dataPoint.series.YValueType,
+ ChartElementType.DataPoint);
+ }
+ else
+ {
+ text = pointEx.dataPoint.ReplaceKeywords(pointLabel);
+ }
+
+ // Get label position
+ Point3D[] points = new Point3D[1];
+ points[0] = new Point3D((float)pointEx.xPosition, (float)(pointEx.yPosition + pointEx.height) / 2f, positionZ + depth);
+ area.matrix3D.TransformPoints(points);
+
+ // Measure string
+ SizeF sizeFont = graph.GetRelativeSize(
+ graph.MeasureString(
+ text,
+ pointEx.dataPoint.Font,
+ new SizeF(1000f, 1000f),
+ StringFormat.GenericTypographic));
+
+ // Get label background position
+ RectangleF labelBackPosition = RectangleF.Empty;
+ SizeF sizeLabel = new SizeF(sizeFont.Width, sizeFont.Height);
+ sizeLabel.Height += sizeFont.Height / 8;
+ sizeLabel.Width += sizeLabel.Width / text.Length;
+ labelBackPosition = new RectangleF(
+ points[0].PointF.X - sizeLabel.Width / 2,
+ points[0].PointF.Y - sizeLabel.Height / 2 - sizeFont.Height / 10,
+ sizeLabel.Width,
+ sizeLabel.Height);
+
+ // Draw label text
+ using (Brush brush = new SolidBrush(pointEx.dataPoint.LabelForeColor))
+ {
+ graph.DrawPointLabelStringRel(
+ common,
+ text,
+ pointEx.dataPoint.Font,
+ brush,
+ points[0].PointF,
+ format,
+ pointEx.dataPoint.LabelAngle,
+ labelBackPosition,
+ pointEx.dataPoint.LabelBackColor,
+ pointEx.dataPoint.LabelBorderColor,
+ pointEx.dataPoint.LabelBorderWidth,
+ pointEx.dataPoint.LabelBorderDashStyle,
+ pointEx.dataPoint.series,
+ pointEx.dataPoint,
+ pointEx.index - 1);
+ }
+ }
+ }
+ }
+
+ #endregion
+
+ #region Y values methods
+
+ /// <summary>
+ /// Helper function, which returns the Y value of the point.
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="area">Chart area the series belongs to.</param>
+ /// <param name="series">Sereis of the point.</param>
+ /// <param name="point">Point object.</param>
+ /// <param name="pointIndex">Index of the point.</param>
+ /// <param name="yValueIndex">Index of the Y value to get. Set to -1 to get the height.</param>
+ /// <returns>Y value of the point.</returns>
+ override public double GetYValue(
+ CommonElements common,
+ ChartArea area,
+ Series series,
+ DataPoint point,
+ int pointIndex,
+ int yValueIndex)
+ {
+ double yValue = double.NaN;
+
+ // Calculate stacked column Y value for 2D chart
+ if(area.Area3DStyle.Enable3D == false)
+ {
+ return point.YValues[0];
+ }
+
+ // Get point Height if pointIndex == -1
+ if(yValueIndex == -1)
+ {
+ Axis vAxis = area.GetAxis(AxisName.Y, series.YAxisType, series.YSubAxisName);
+ double areaZeroValue = vAxis.Crossing;
+ yValue = GetYValue(common, area, series, point, pointIndex, 0);
+ if(area.Area3DStyle.Enable3D && yValue < 0.0)
+ {
+ // No negative values support in 3D stacked area chart
+ yValue = -yValue;
+ }
+ if( yValue >= 0 )
+ {
+ if(!double.IsNaN(prevPosY))
+ {
+ areaZeroValue = prevPosY;
+ }
+ }
+ else
+ {
+ if(!double.IsNaN(prevNegY))
+ {
+ areaZeroValue = prevNegY;
+ }
+ }
+
+ return yValue - areaZeroValue;
+ }
+
+
+ // Loop through all series
+ prevPosY = double.NaN;
+ prevNegY = double.NaN;
+ prevPositionX = double.NaN;
+ foreach(Series ser in common.DataManager.Series)
+ {
+ // Check series of the current chart type & area
+ if(String.Compare(series.ChartArea, ser.ChartArea, StringComparison.Ordinal) == 0 &&
+ String.Compare(series.ChartTypeName, ser.ChartTypeName, StringComparison.OrdinalIgnoreCase) == 0 &&
+ ser.IsVisible())
+ {
+ yValue = ser.Points[pointIndex].YValues[0];
+ if(area.Area3DStyle.Enable3D && yValue < 0.0)
+ {
+ // No negative values support in 3D stacked area chart
+ yValue = -yValue;
+ }
+ if(!double.IsNaN(yValue))
+ {
+ if(yValue >= 0.0 && !double.IsNaN(prevPosY))
+ {
+ yValue += prevPosY;
+ }
+ if(yValue < 0.0 && !double.IsNaN(prevNegY))
+ {
+ yValue += prevNegY;
+ }
+ }
+
+ // Exit loop when current series was found
+ if (String.Compare(series.Name, ser.Name, StringComparison.Ordinal) == 0)
+ {
+ break;
+ }
+
+ // Remember privious position
+ if(yValue >= 0.0)
+ {
+ prevPosY = yValue;
+ }
+ if(yValue < 0.0)
+ {
+ prevNegY = yValue;
+ }
+ prevPositionX = ser.Points[pointIndex].XValue;
+ if(prevPositionX == 0.0 && ChartHelper.IndexedSeries(series))
+ {
+ prevPositionX = pointIndex + 1;
+ }
+ }
+ }
+
+ return yValue;
+ }
+
+ #endregion
+
+ #region IDisposable overrides
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ // Dispose managed resources
+ if (this.areaBottomPath != null)
+ {
+ this.areaBottomPath.Dispose();
+ this.areaBottomPath = null;
+ }
+ }
+ base.Dispose(disposing);
+ }
+ #endregion
+
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/StackedBarChart.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/StackedBarChart.cs
new file mode 100644
index 00000000000..097ab507780
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/StackedBarChart.cs
@@ -0,0 +1,2156 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: StackedBarChart.cs
+//
+// Namespace: DataVisualization.Charting.ChartTypes
+//
+// Classes: StackedBarChart, HundredPercentStackedBarChart
+//
+// Purpose: This class contains all necessary methods and
+// properties for drawing and selection of the stacked
+// bar and hundred percent stacked bar charts.
+// Every data point in the Stacked bar chart is
+// represented with one rectangle. If there is
+// more then one series with this chart type from
+// same chart area, bars with same X values are
+// Stacked.
+//
+// Reviewed: AG - Aug 6, 2002
+// AG - Microsoft 7, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+
+#else
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.ChartTypes
+#else
+ namespace System.Web.UI.DataVisualization.Charting.ChartTypes
+#endif
+{
+ /// <summary>
+ /// HundredPercentStackedBarChart class extends StackedBarChart class
+ /// by providing its own algorithm for calculating series data point
+ /// Y values. It makes sure that total Y value of all data points in a
+ /// single cluster from all series adds up to 100%.
+ /// </summary>
+ internal class HundredPercentStackedBarChart : StackedBarChart
+ {
+ #region Constructor
+
+ /// <summary>
+ /// Default constructor.
+ /// </summary>
+ public HundredPercentStackedBarChart()
+ {
+ hundredPercentStacked = true;
+ }
+
+ #endregion
+
+ #region Fields
+
+
+
+ // Total Y values from all series at specified index orgonized by stacked groups
+ // Hashtable will contain arrays of doubles stored by group name key.
+ Hashtable _stackedGroupsTotalPerPoint = null;
+
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ override public string Name { get{ return ChartTypeNames.OneHundredPercentStackedBar;}}
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ override public bool HundredPercent{ get{return true;} }
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ override public bool HundredPercentSupportNegative{ get{return true;} }
+
+ #endregion
+
+ #region Painting and selection methods
+
+ /// <summary>
+ /// Paint HundredPercentStackedBarChart Chart.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ override public void Paint( ChartGraphics graph, CommonElements common, ChartArea area, Series seriesToDraw )
+ {
+ // Reset pre-calculated totals
+
+ this._stackedGroupsTotalPerPoint = null;
+
+ // Call base class painting
+ base.Paint( graph, common, area, seriesToDraw );
+ }
+
+ #endregion
+
+ #region Y values related methods
+
+ /// <summary>
+ /// Helper function, which returns the Y value of the point.
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="area">Chart area the series belongs to.</param>
+ /// <param name="series">Sereis of the point.</param>
+ /// <param name="point">Point object.</param>
+ /// <param name="pointIndex">Index of the point.</param>
+ /// <param name="yValueIndex">Index of the Y value to get.</param>
+ /// <returns>Y value of the point.</returns>
+ override public double GetYValue(CommonElements common, ChartArea area, Series series, DataPoint point, int pointIndex, int yValueIndex)
+ {
+ // Array of Y totals for individual series index in the current stacked group
+ double[] currentGroupTotalPerPoint = null;
+
+
+ string currentStackedGroupName = HundredPercentStackedColumnChart.GetSeriesStackGroupName(series);
+ if(this._stackedGroupsTotalPerPoint == null)
+ {
+ // Create new hashtable
+ this._stackedGroupsTotalPerPoint = new Hashtable();
+
+ // Iterate through all stacked groups
+ foreach(string groupName in this.stackGroupNames)
+ {
+ // Get series that belong to the same group
+ Series[] seriesArray = HundredPercentStackedColumnChart.GetSeriesByStackedGroupName(
+ common, groupName, series.ChartTypeName, series.ChartArea);
+
+ // Check if series are aligned
+ common.DataManipulator.CheckXValuesAlignment(seriesArray);
+
+ // Allocate memory for the array of totals
+ double[] totals = new double[series.Points.Count];
+
+ // Calculate the total of Y value per point
+ for(int index = 0; index < series.Points.Count; index++)
+ {
+ totals[index] = 0;
+ foreach( Series ser in seriesArray )
+ {
+ totals[index] += Math.Abs(ser.Points[index].YValues[0]);
+ }
+ }
+
+ // Add totals array into the hashtable
+ this._stackedGroupsTotalPerPoint.Add(groupName, totals);
+ }
+ }
+
+ // Find array of total Y values based on the current stacked group name
+ currentGroupTotalPerPoint = (double[])this._stackedGroupsTotalPerPoint[currentStackedGroupName];
+
+
+ if(!area.Area3DStyle.Enable3D)
+ {
+ if(point.YValues[0] == 0 || point.IsEmpty)
+ {
+ return 0;
+ }
+ }
+
+ // Calculate stacked column Y value for 2D chart
+ if(area.Area3DStyle.Enable3D == false || yValueIndex == -2)
+ {
+ if(currentGroupTotalPerPoint[pointIndex] == 0.0)
+ {
+ return 0.0;
+ }
+ return (point.YValues[0] / currentGroupTotalPerPoint[pointIndex]) * 100.0;
+ }
+
+ // Get point Height if pointIndex == -1
+ double yValue = double.NaN;
+ if(yValueIndex == -1)
+ {
+ Axis vAxis = area.GetAxis(AxisName.Y, series.YAxisType, series.YSubAxisName);
+ double barZeroValue = vAxis.Crossing;
+ yValue = GetYValue(common, area, series, point, pointIndex, 0);
+ if( yValue >= 0 )
+ {
+ if(!double.IsNaN(prevPosY))
+ {
+ barZeroValue = prevPosY;
+ }
+ }
+ else
+ {
+ if(!double.IsNaN(prevNegY))
+ {
+ barZeroValue = prevNegY;
+ }
+ }
+
+ return yValue - barZeroValue;
+ }
+
+
+ // Loop through all series to find point value
+ prevPosY = double.NaN;
+ prevNegY = double.NaN;
+ foreach(Series ser in common.DataManager.Series)
+ {
+ // Check series of the current chart type & area
+ if(String.Compare(series.ChartArea, ser.ChartArea, StringComparison.Ordinal) == 0 &&
+ String.Compare(series.ChartTypeName, ser.ChartTypeName, StringComparison.OrdinalIgnoreCase) == 0 &&
+ ser.IsVisible())
+ {
+
+ // Series must belong to the same stacked group
+ if(currentStackedGroupName != HundredPercentStackedColumnChart.GetSeriesStackGroupName(ser))
+ {
+ continue;
+ }
+
+
+ if(double.IsNaN(yValue))
+ {
+ if(currentGroupTotalPerPoint[pointIndex] == 0.0)
+ {
+ yValue = 0.0;
+ }
+ else
+ {
+ yValue = (ser.Points[pointIndex].YValues[0] / currentGroupTotalPerPoint[pointIndex]) * 100.0;
+ }
+ }
+ else
+ {
+ if(currentGroupTotalPerPoint[pointIndex] == 0.0)
+ {
+ yValue = 0.0;
+ }
+ else
+ {
+ yValue = (ser.Points[pointIndex].YValues[0] / currentGroupTotalPerPoint[pointIndex]) * 100.0;
+ }
+ if(yValue >= 0.0 && !double.IsNaN(prevPosY))
+ {
+ yValue += prevPosY;
+ }
+ if(yValue < 0.0 && !double.IsNaN(prevNegY))
+ {
+ yValue += prevNegY;
+ }
+ }
+
+ // Exit loop when current series was found
+ if (String.Compare(series.Name, ser.Name, StringComparison.Ordinal) == 0)
+ {
+ break;
+ }
+
+ // Save previous value
+ if(yValue >= 0.0)
+ {
+ prevPosY = yValue;
+ }
+ else
+ {
+ prevNegY = yValue;
+ }
+ }
+ }
+
+ return (yValue > 100.0) ? 100.0 : yValue;
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// StackedBarChart class contains all the code necessary to draw
+ /// and hit test Stacked Bar chart.
+ /// </summary>
+ internal class StackedBarChart : IChartType
+ {
+ #region Fields
+
+ /// <summary>
+ /// Previous stacked positive Y values.
+ /// </summary>
+ protected double prevPosY = double.NaN;
+
+ /// <summary>
+ /// Previous stacked negative Y values.
+ /// </summary>
+ protected double prevNegY = double.NaN;
+
+ /// <summary>
+ /// Indicates if chart is 100% stacked
+ /// </summary>
+ protected bool hundredPercentStacked = false;
+
+
+
+ /// <summary>
+ /// True if stacke group name is applicable
+ /// </summary>
+ internal bool stackGroupNameUsed = false;
+
+ /// <summary>
+ /// List of all stack group names
+ /// </summary>
+ internal ArrayList stackGroupNames = null;
+
+ /// <summary>
+ /// Name of the current stack group.
+ /// </summary>
+ internal string currentStackGroup = string.Empty;
+
+
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ virtual public string Name { get{ return ChartTypeNames.StackedBar;}}
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ virtual public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+
+ /// <summary>
+ /// True if chart type is stacked
+ /// </summary>
+ public bool Stacked { get{ return true;}}
+
+
+ /// <summary>
+ /// True if stacked chart type supports groups
+ /// </summary>
+ virtual public bool SupportStackedGroups { get { return true; } }
+
+
+ /// <summary>
+ /// True if stacked chart type should draw separately positive and
+ /// negative data points ( Bar and column Stacked types ).
+ /// </summary>
+ public bool StackSign { get{ return true;}}
+
+ /// <summary>
+ /// True if chart type supports axeses
+ /// </summary>
+ public bool RequireAxes { get{ return true;} }
+
+ /// <summary>
+ /// Chart type with two y values used for scale ( bubble chart type )
+ /// </summary>
+ public bool SecondYScale{ get{ return false;} }
+
+ /// <summary>
+ /// True if chart type requires circular chart area.
+ /// </summary>
+ public bool CircularChartArea { get{ return false;} }
+
+ /// <summary>
+ /// True if chart type supports logarithmic axes
+ /// </summary>
+ public bool SupportLogarithmicAxes { get{ return true;} }
+
+ /// <summary>
+ /// True if chart type requires to switch the value (Y) axes position
+ /// </summary>
+ public bool SwitchValueAxes { get{ return true;} }
+
+ /// <summary>
+ /// True if chart series can be placed side-by-side.
+ /// </summary>
+ public bool SideBySideSeries { get{ return false;} }
+
+ /// <summary>
+ /// If the crossing value is auto Crossing value should be
+ /// automatically set to zero for some chart
+ /// types (Bar, column, area etc.)
+ /// </summary>
+ public bool ZeroCrossing { get{ return true;} }
+
+ /// <summary>
+ /// True if each data point of a chart must be represented in the legend
+ /// </summary>
+ public bool DataPointsInLegend { get{ return false;} }
+
+ /// <summary>
+ /// Indicates that extra Y values are connected to the scale of the Y axis
+ /// </summary>
+ virtual public bool ExtraYValuesConnectedToYAxis{ get { return false; } }
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ virtual public bool HundredPercent{ get{return false;} }
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ virtual public bool HundredPercentSupportNegative{ get{return false;} }
+
+ /// <summary>
+ /// True if palette colors should be applied for each data paoint.
+ /// Otherwise the color is applied to the series.
+ /// </summary>
+ public bool ApplyPaletteColorsToPoints { get { return false; } }
+
+ /// <summary>
+ /// How to draw series/points in legend:
+ /// Filled rectangle, Line or Marker
+ /// </summary>
+ /// <param name="series">Legend item series.</param>
+ /// <returns>Legend item style.</returns>
+ public LegendImageStyle GetLegendImageStyle(Series series)
+ {
+ return LegendImageStyle.Rectangle;
+ }
+
+ /// <summary>
+ /// Number of supported Y value(s) per point
+ /// </summary>
+ public int YValuesPerPoint{ get { return 1; } }
+
+ #endregion
+
+ #region Painting and selection methods
+
+ /// <summary>
+ /// Paint Stacked Bar Chart.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object</param>
+ /// <param name="common">The Common elements object</param>
+ /// <param name="area">Chart area for this chart</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ virtual public void Paint( ChartGraphics graph, CommonElements common, ChartArea area, Series seriesToDraw )
+ {
+
+ // Reset stacked group names flag
+ this.stackGroupNameUsed = true;
+
+
+ // Set Clip Region in rounded to a pixel coordinates
+ RectangleF areaPosition = ((ChartGraphics)graph).GetAbsoluteRectangle( area.PlotAreaPosition.ToRectangleF());
+ float right = (float)Math.Ceiling(areaPosition.Right);
+ float bottom = (float)Math.Ceiling(areaPosition.Bottom);
+ areaPosition.X = (float)Math.Floor(areaPosition.X);
+ areaPosition.Width = right - areaPosition.X;
+ areaPosition.Y = (float)Math.Floor(areaPosition.Y);
+ areaPosition.Height = bottom - areaPosition.Y;
+ ((ChartGraphics)graph).SetClipAbs( areaPosition );
+
+ // Draw shadow
+ ProcessChartType( false, graph, common, area, true, false, seriesToDraw );
+
+ // Draw stacked bars
+ ProcessChartType( false, graph, common, area, false, false, seriesToDraw );
+
+ // Draw labels
+ ProcessChartType( false, graph, common, area, false, true, seriesToDraw );
+
+ // Reset Clip Region
+ ((ChartGraphics)graph).ResetClip();
+ }
+
+ /// <summary>
+ /// This method recalculates size of the stacked bars. This method is used
+ /// from Paint or Select method.
+ /// </summary>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="shadow">True if shadow mode is active.</param>
+ /// <param name="labels">Labels drawing mode.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ private void ProcessChartType(
+ bool selection,
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ bool shadow,
+ bool labels,
+ Series seriesToDraw )
+ {
+
+ //************************************************************
+ //** If stacked series is attached to diferent X and Y axis
+ //** they can not be processed. To solve this issue series
+ //** will be orgonized in groups based on the axes.
+ //************************************************************
+
+ // Loop through all series and check if different axes are used
+ bool differentAxesAreUsed = false;
+ AxisType xAxisType = AxisType.Primary;
+ AxisType yAxisType = AxisType.Primary;
+ string xSubAxisName = string.Empty;
+ string ySubAxisName = string.Empty;
+ for(int seriesIndex = 0; seriesIndex < common.DataManager.Series.Count; seriesIndex++)
+ {
+ // Process non empty series of the area with stacked column chart type
+ Series ser = common.DataManager.Series[seriesIndex];
+ if( String.Compare( ser.ChartTypeName, Name, StringComparison.OrdinalIgnoreCase ) != 0
+ || ser.ChartArea != area.Name || !ser.IsVisible())
+ {
+ continue;
+ }
+
+ if(seriesIndex == 0)
+ {
+ xAxisType = ser.XAxisType;
+ yAxisType = ser.YAxisType;
+ xSubAxisName = ser.XSubAxisName;
+ ySubAxisName = ser.YSubAxisName;
+ }
+ else if(xAxisType != ser.XAxisType ||
+ yAxisType != ser.YAxisType ||
+ xSubAxisName != ser.XSubAxisName ||
+ ySubAxisName != ser.YSubAxisName)
+ {
+ differentAxesAreUsed = true;
+ break;
+ }
+ }
+
+ // Set stacked groups based on the axes used
+ if(differentAxesAreUsed)
+ {
+ for(int seriesIndex = 0; seriesIndex < common.DataManager.Series.Count; seriesIndex++)
+ {
+ // Process non empty series of the area with stacked column chart type
+ Series ser = common.DataManager.Series[seriesIndex];
+ if( String.Compare( ser.ChartTypeName, Name, StringComparison.OrdinalIgnoreCase ) != 0
+ || ser.ChartArea != area.Name || !ser.IsVisible())
+ {
+ continue;
+ }
+
+ // Set new group name
+ string stackGroupName = StackedColumnChart.GetSeriesStackGroupName(ser);
+ stackGroupName = "_X_" + ser.XAxisType.ToString() + ser.XSubAxisName + "_Y_" + ser.YAxisType.ToString() + ser.YSubAxisName + "__";
+ ser[CustomPropertyName.StackedGroupName] = stackGroupName;
+ }
+ }
+
+ //************************************************************
+ //** Check how many stack groups are available.
+ //************************************************************
+
+ // Loop through all series and get unique stack group names.
+ this.stackGroupNames = new ArrayList();
+ foreach( Series ser in common.DataManager.Series )
+ {
+ // Process non empty series of the area with stacked column chart type
+ if( String.Compare( ser.ChartTypeName, Name, StringComparison.OrdinalIgnoreCase ) != 0
+ || ser.ChartArea != area.Name || !ser.IsVisible())
+ {
+ continue;
+ }
+
+ // Get stack group name from the series
+ string stackGroupName = StackedColumnChart.GetSeriesStackGroupName(ser);
+
+ // Add group name if it do not already exsist
+ if(!this.stackGroupNames.Contains(stackGroupName))
+ {
+ this.stackGroupNames.Add(stackGroupName);
+ }
+ }
+
+
+ // Prosess 3D chart type
+ if(area.Area3DStyle.Enable3D)
+ {
+ if(!shadow)
+ {
+ ProcessChartType3D(
+ selection,
+ graph,
+ common,
+ area,
+ labels,
+ seriesToDraw );
+ }
+
+ return;
+ }
+
+ // All data series from chart area which have Stacked Bar chart type
+ string[] seriesList = area.GetSeriesFromChartType(Name).ToArray();
+
+ // Get maximum number of data points for all series
+ int maxNumOfPoints = common.DataManager.GetNumberOfPoints(seriesList);
+
+ // Zero X values mode.
+ bool indexedSeries = ChartHelper.IndexedSeries( common, seriesList);
+
+ //************************************************************
+ //** Loop through all data points
+ //************************************************************
+ for( int pointIndx = 0; pointIndx < maxNumOfPoints; pointIndx++ )
+ {
+
+ //************************************************************
+ //** Loop through all stack groups
+ //************************************************************
+ for(int groupIndex = 0; groupIndex < this.stackGroupNames.Count; groupIndex++)
+ {
+ // Rememmber current stack group name
+ this.currentStackGroup = (string)this.stackGroupNames[groupIndex];
+
+ int seriesIndx = 0; // Data series index
+ double PreviousPosY = 0; // Previous positive Y value
+ double PreviousNegY = 0; // Previous negative Y value
+
+ //************************************************************
+ //** Loop through all series
+ //************************************************************
+ foreach( Series ser in common.DataManager.Series )
+ {
+ // Process non empty series of the area with stacked bar chart type
+ if( String.Compare( ser.ChartTypeName, Name, StringComparison.OrdinalIgnoreCase ) != 0
+ || ser.ChartArea != area.Name || !ser.IsVisible())
+ {
+ continue;
+ }
+
+ // Series point index is out of range
+ if( pointIndx >= ser.Points.Count )
+ {
+ continue;
+ }
+
+
+ // Check if series belongs to the current group name
+ string seriesStackGroupName = StackedColumnChart.GetSeriesStackGroupName(ser);
+ if(seriesStackGroupName != this.currentStackGroup)
+ {
+ continue;
+ }
+
+
+
+ // Get data point
+ DataPoint point = ser.Points[ pointIndx ];
+
+ // Reset pre-calculated point position
+ point.positionRel = new PointF(float.NaN, float.NaN);
+
+ // Set active horizontal/vertical axis
+ Axis vAxis = area.GetAxis(AxisName.X, ser.XAxisType, ser.XSubAxisName);
+ Axis hAxis = area.GetAxis(AxisName.Y, ser.YAxisType, ser.YSubAxisName);
+
+ // Interval between bars
+ double interval = 1;
+ if( !indexedSeries )
+ {
+ if (ser.Points.Count == 1 &&
+ (ser.XValueType == ChartValueType.Date ||
+ ser.XValueType == ChartValueType.DateTime ||
+ ser.XValueType == ChartValueType.Time ||
+ ser.XValueType == ChartValueType.DateTimeOffset))
+ {
+ // Check if interval is the same
+ bool sameInterval = false;
+ List<string> typeSeries = area.GetSeriesFromChartType(Name);
+ area.GetPointsInterval(typeSeries, vAxis.IsLogarithmic, vAxis.logarithmBase, true, out sameInterval);
+
+ // Special case when there is only one data point and date scale is used.
+ if (!double.IsNaN(vAxis.majorGrid.GetInterval()) && vAxis.majorGrid.GetIntervalType() != DateTimeIntervalType.NotSet)
+ {
+ interval = ChartHelper.GetIntervalSize(vAxis.minimum, vAxis.majorGrid.GetInterval(), vAxis.majorGrid.GetIntervalType());
+ }
+ else
+ {
+ interval = ChartHelper.GetIntervalSize(vAxis.minimum, vAxis.Interval, vAxis.IntervalType);
+ }
+ }
+ else
+ {
+ interval = area.GetPointsInterval(vAxis.IsLogarithmic, vAxis.logarithmBase);
+ }
+ }
+
+ // Calculates the width of bars.
+ double width = ser.GetPointWidth(graph, vAxis, interval, 0.8);
+
+
+ // Adjust width by number of stacked groups
+ width = width / (double)this.stackGroupNames.Count;
+
+
+ // Call Back Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPrePaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+
+ // Change Y value if Bar is out of plot area
+ double yValue = GetYValue(common, area, ser, point, pointIndx, 0);
+ if( seriesIndx != 0 )
+ {
+ if( yValue >= 0 )
+ {
+ yValue = yValue + PreviousPosY;
+ }
+ else
+ {
+ yValue = yValue + PreviousNegY;
+ }
+ }
+
+ // Check if scrolling/zooming frames cutting mode is enabled
+ bool ajaxScrollingEnabled = false;
+
+ // Save original Y Value
+ double originalYValue = yValue;
+
+ // Axis is logarithmic
+ if( hAxis.IsLogarithmic )
+ {
+ yValue = Math.Log( yValue, hAxis.logarithmBase );
+ }
+
+ // Recalculates Height position and zero position of bars
+ double height = hAxis.GetLinearPosition( yValue );
+
+ // Set x position
+ double xValue = point.XValue;
+ if( indexedSeries )
+ {
+ // The formula for position is based on a distance
+ //from the grid line or nPoints position.
+ xValue = (double)pointIndx + 1;
+ }
+ double xPosition = vAxis.GetPosition( xValue );
+
+ // Adjust X position of each stack group
+ if(this.stackGroupNames.Count > 1)
+ {
+ xPosition = xPosition - width * ((double) this.stackGroupNames.Count) / 2.0 + width / 2.0 + groupIndex * width;
+ }
+
+
+ xValue = vAxis.GetLogValue(xValue);
+
+
+ // Set Start position for a bar
+ double barZeroValue;
+ if( seriesIndx == 0 )
+ {
+ if (ajaxScrollingEnabled && labels)
+ {
+ // If AJAX scrolling is used always use 0.0 as a starting point
+ barZeroValue = 0.0;
+ }
+ else
+ {
+ // Set Start position for a Column
+ barZeroValue = hAxis.Crossing;
+ }
+ }
+ else if( GetYValue(common, area, ser, point, pointIndx, 0) >= 0 )
+ {
+ barZeroValue = PreviousPosY;
+ }
+ else
+ {
+ barZeroValue = PreviousNegY;
+ }
+ double zero = hAxis.GetPosition(barZeroValue);
+
+ // Calculate bar position
+ RectangleF rectSize = RectangleF.Empty;
+ try
+ {
+ // Set the bar rectangle
+ rectSize.Y = (float)(xPosition - width/2);
+ rectSize.Height = (float)(width);
+
+ // The left side of rectangle has always
+ // smaller value than a right value
+ if( zero < height )
+ {
+ rectSize.X = (float)zero;
+ rectSize.Width = (float)height - rectSize.X;
+ }
+ else
+ {
+ rectSize.X = (float)height;
+ rectSize.Width = (float)zero - rectSize.X;
+ }
+ }
+ catch(OverflowException)
+ {
+ continue;
+ }
+
+ // Remeber pre-calculated point position
+ point.positionRel = new PointF(rectSize.Right, (float)xPosition);
+
+
+ // if data point is not empty
+ if( point.IsEmpty )
+ {
+ continue;
+ }
+
+ // Axis is logarithmic
+ if( hAxis.IsLogarithmic )
+ {
+ barZeroValue = Math.Log( barZeroValue, hAxis.logarithmBase );
+ }
+
+ // Check if column is completly out of the data scaleView
+ bool skipPoint = false;
+ if(xValue < vAxis.ViewMinimum ||
+ xValue > vAxis.ViewMaximum ||
+ (yValue < hAxis.ViewMinimum && barZeroValue < hAxis.ViewMinimum) ||
+ (yValue > hAxis.ViewMaximum && barZeroValue > hAxis.ViewMaximum) )
+ {
+ skipPoint = true;
+ }
+
+ // ***************************************************
+ // Painting mode
+ // ***************************************************
+ if(!skipPoint)
+ {
+ if( common.ProcessModePaint )
+ {
+ // Check if column is partialy in the data scaleView
+ bool clipRegionSet = false;
+ if(rectSize.Y < area.PlotAreaPosition.Y ||
+ rectSize.Bottom > area.PlotAreaPosition.Bottom ||
+ rectSize.X < area.PlotAreaPosition.X ||
+ rectSize.Right > area.PlotAreaPosition.Right)
+ {
+ // Set clipping region for line drawing
+ graph.SetClip( area.PlotAreaPosition.ToRectangleF() );
+ clipRegionSet = true;
+ }
+
+ // Set shadow
+ int shadowOffset = 0;
+ if( shadow )
+ {
+ shadowOffset = ser.ShadowOffset;
+ }
+
+ if( !labels )
+ {
+ // Start Svg Selection mode
+ graph.StartHotRegion( point );
+
+ // Draw the bar rectangle
+ graph.FillRectangleRel( rectSize,
+ (!shadow)? point.Color : Color.Transparent,
+ point.BackHatchStyle,
+ point.BackImage,
+ point.BackImageWrapMode,
+ point.BackImageTransparentColor,
+ point.BackImageAlignment,
+ point.BackGradientStyle,
+ (!shadow)? point.BackSecondaryColor : Color.Transparent,
+ point.BorderColor,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ ser.ShadowColor,
+ shadowOffset,
+ PenAlignment.Inset,
+ (shadow) ? BarDrawingStyle.Default : ChartGraphics.GetBarDrawingStyle(point),
+ false);
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+ }
+
+ // Draw labels
+ else
+ {
+ // Calculate label rectangle
+ RectangleF labelRect = new RectangleF(rectSize.Location, rectSize.Size);
+ if (clipRegionSet && !ajaxScrollingEnabled)
+ {
+ labelRect.Intersect(area.PlotAreaPosition.ToRectangleF());
+ }
+
+ // Draw Labels
+ DrawLabels( common, graph, area, point, pointIndx, ser, labelRect );
+ }
+
+ // Reset Clip Region
+ if(clipRegionSet)
+ {
+ graph.ResetClip();
+ }
+ }
+
+ // ***************************************************
+ // Hot Regions Mode
+ // ***************************************************
+ if( common.ProcessModeRegions && !shadow && !labels)
+ {
+ common.HotRegionsList.AddHotRegion( rectSize, point, ser.Name, pointIndx );
+
+ // Process labels and markers regions only if it was not done while painting
+ if(labels && !common.ProcessModePaint)
+ {
+ DrawLabels( common, graph, area, point, pointIndx, ser, rectSize );
+ }
+ }
+
+ // Call Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPostPaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+ }
+
+ // Axis is logarithmic
+ if( hAxis.IsLogarithmic )
+ {
+ yValue = Math.Pow( hAxis.logarithmBase, yValue );
+ }
+
+ // Data series index
+ seriesIndx++;
+ if( GetYValue(common, area, ser, point, pointIndx, 0) >= 0 )
+ {
+ PreviousPosY = originalYValue;
+ }
+ else
+ {
+ PreviousNegY = originalYValue;
+ }
+ }
+
+ }
+
+ }
+
+
+
+ //************************************************************
+ //** Remove stacked groups created for series attached to different axis
+ //************************************************************
+
+ if(differentAxesAreUsed)
+ {
+ for(int seriesIndex = 0; seriesIndex < common.DataManager.Series.Count; seriesIndex++)
+ {
+ // Process non empty series of the area with stacked column chart type
+ Series ser = common.DataManager.Series[seriesIndex];
+ if( String.Compare( ser.ChartTypeName, Name, StringComparison.OrdinalIgnoreCase ) != 0
+ || ser.ChartArea != area.Name || !ser.IsVisible())
+ {
+ continue;
+ }
+
+ // Set new group name
+ string stackGroupName = StackedColumnChart.GetSeriesStackGroupName(ser);
+ int index = stackGroupName.IndexOf("__", StringComparison.Ordinal);
+ if(index >= 0)
+ {
+ stackGroupName = stackGroupName.Substring(index + 2);
+ }
+ if(stackGroupName.Length > 0)
+ {
+ ser[CustomPropertyName.StackedGroupName] = stackGroupName;
+ }
+ else
+ {
+ ser.DeleteCustomProperty(CustomPropertyName.StackedGroupName);
+ }
+ }
+ }
+
+
+
+ }
+
+ /// <summary>
+ /// Draw Stacked Column labels.
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="graph">Chart Graphics.</param>
+ /// <param name="area">Chart area the series belongs to.</param>
+ /// <param name="point">Data point.</param>
+ /// <param name="pointIndex">Data point index.</param>
+ /// <param name="series">Data series.</param>
+ /// <param name="rectangle">Column rectangle.</param>
+ public void DrawLabels(
+ CommonElements common,
+ ChartGraphics graph,
+ ChartArea area,
+ DataPoint point,
+ int pointIndex,
+ Series series,
+ RectangleF rectangle )
+ {
+ // Label text format
+ using (StringFormat format = new StringFormat())
+ {
+ format.Alignment = StringAlignment.Center;
+ format.LineAlignment = StringAlignment.Center;
+
+ // Disable the clip region
+ Region oldClipRegion = graph.Clip;
+ graph.Clip = new Region();
+
+ if (point.IsValueShownAsLabel || point.Label.Length > 0)
+ {
+ // Round Y values for 100% stacked bar
+ double pointLabelValue = GetYValue(common, area, series, point, pointIndex, 0);
+ if (this.hundredPercentStacked && point.LabelFormat.Length == 0)
+ {
+ pointLabelValue = Math.Round(pointLabelValue, 2);
+ }
+
+ // Get label text
+ string text;
+ if (point.Label.Length == 0)
+ {
+ text = ValueConverter.FormatValue(
+ series.Chart,
+ point,
+ point.Tag,
+ pointLabelValue,
+ point.LabelFormat,
+ series.YValueType,
+ ChartElementType.DataPoint);
+ }
+ else
+ {
+ text = point.ReplaceKeywords(point.Label);
+ }
+
+ // Calculate position
+ PointF labelPosition = PointF.Empty;
+ labelPosition.X = rectangle.X + rectangle.Width / 2f;
+ labelPosition.Y = rectangle.Y + rectangle.Height / 2f;
+
+ // Get text angle
+ int textAngle = point.LabelAngle;
+
+ // Check if text contains white space only
+ if (text.Trim().Length != 0)
+ {
+ //************************************************************
+ // Measure string
+ //************************************************************
+ SizeF sizeFont = graph.GetRelativeSize(
+ graph.MeasureString(
+ text,
+ point.Font,
+ new SizeF(1000f, 1000f),
+ StringFormat.GenericTypographic));
+
+ //************************************************************
+ // Check labels style custom properties
+ //************************************************************
+ BarValueLabelDrawingStyle drawingStyle = BarValueLabelDrawingStyle.Center;
+ string valueLabelAttrib = "";
+ if (point.IsCustomPropertySet(CustomPropertyName.BarLabelStyle))
+ {
+ valueLabelAttrib = point[CustomPropertyName.BarLabelStyle];
+ }
+ else if (series.IsCustomPropertySet(CustomPropertyName.BarLabelStyle))
+ {
+ valueLabelAttrib = series[CustomPropertyName.BarLabelStyle];
+ }
+
+ if (valueLabelAttrib != null && valueLabelAttrib.Length > 0)
+ {
+ if (String.Compare(valueLabelAttrib, "Left", StringComparison.OrdinalIgnoreCase) == 0)
+ drawingStyle = BarValueLabelDrawingStyle.Left;
+ else if (String.Compare(valueLabelAttrib, "Right", StringComparison.OrdinalIgnoreCase) == 0)
+ drawingStyle = BarValueLabelDrawingStyle.Right;
+ else if (String.Compare(valueLabelAttrib, "Center", StringComparison.OrdinalIgnoreCase) == 0)
+ drawingStyle = BarValueLabelDrawingStyle.Center;
+ else if (String.Compare(valueLabelAttrib, "Outside", StringComparison.OrdinalIgnoreCase) == 0)
+ drawingStyle = BarValueLabelDrawingStyle.Outside;
+ }
+
+ //************************************************************
+ // Adjust label position based on the label drawing style
+ //************************************************************
+ if (drawingStyle == BarValueLabelDrawingStyle.Left)
+ {
+ labelPosition.X = rectangle.X + sizeFont.Width / 2f;
+ }
+ else if (drawingStyle == BarValueLabelDrawingStyle.Right)
+ {
+ labelPosition.X = rectangle.Right - sizeFont.Width / 2f;
+ }
+ else if (drawingStyle == BarValueLabelDrawingStyle.Outside)
+ {
+ labelPosition.X = rectangle.Right + sizeFont.Width / 2f;
+ }
+
+
+ // Check if Smart Labels are enabled
+ if (series.SmartLabelStyle.Enabled)
+ {
+ // Force some SmartLabelStyle settings for column chart
+ bool oldMarkerOverlapping = series.SmartLabelStyle.IsMarkerOverlappingAllowed;
+ LabelAlignmentStyles oldMovingDirection = series.SmartLabelStyle.MovingDirection;
+ series.SmartLabelStyle.IsMarkerOverlappingAllowed = true;
+ if (series.SmartLabelStyle.MovingDirection == (LabelAlignmentStyles.Top | LabelAlignmentStyles.Bottom | LabelAlignmentStyles.Right | LabelAlignmentStyles.Left | LabelAlignmentStyles.TopLeft | LabelAlignmentStyles.TopRight | LabelAlignmentStyles.BottomLeft | LabelAlignmentStyles.BottomRight))
+ {
+ series.SmartLabelStyle.MovingDirection = LabelAlignmentStyles.Left | LabelAlignmentStyles.Right;
+ }
+
+ // Adjust label position using SmartLabelStyle algorithm
+ labelPosition = area.smartLabels.AdjustSmartLabelPosition(
+ common,
+ graph,
+ area,
+ series.SmartLabelStyle,
+ labelPosition,
+ sizeFont,
+ format,
+ labelPosition,
+ new SizeF(0f, 0f),
+ LabelAlignmentStyles.Center);
+
+ // Restore forced values
+ series.SmartLabelStyle.IsMarkerOverlappingAllowed = oldMarkerOverlapping;
+ series.SmartLabelStyle.MovingDirection = oldMovingDirection;
+
+ // Smart labels always use 0 degrees text angle
+ textAngle = 0;
+ }
+
+
+
+ // Draw label
+ if (!labelPosition.IsEmpty)
+ {
+ // Get label background position
+ RectangleF labelBackPosition = RectangleF.Empty;
+ SizeF sizeLabel = new SizeF(sizeFont.Width, sizeFont.Height);
+ sizeLabel.Height += sizeFont.Height / 8;
+ sizeLabel.Width += sizeLabel.Width / text.Length;
+ labelBackPosition = new RectangleF(
+ labelPosition.X - sizeLabel.Width / 2,
+ labelPosition.Y - sizeLabel.Height / 2 - sizeFont.Height / 10,
+ sizeLabel.Width,
+ sizeLabel.Height);
+
+
+
+ // Adjust label background position that can be changed by the
+ // Smart Labels algorithm
+ // NOTE: Fixes issue #4688
+ labelBackPosition = area.smartLabels.GetLabelPosition(
+ graph,
+ labelPosition,
+ sizeLabel,
+ format,
+ true);
+
+
+
+ // Draw label text
+ using (Brush brush = new SolidBrush(point.LabelForeColor))
+ {
+ graph.DrawPointLabelStringRel(
+ common,
+ text,
+ point.Font,
+ brush,
+ labelPosition,
+ format,
+ textAngle,
+ labelBackPosition,
+ point.LabelBackColor,
+ point.LabelBorderColor,
+ point.LabelBorderWidth,
+ point.LabelBorderDashStyle,
+ series,
+ point,
+ pointIndex);
+ }
+ }
+
+ }
+ }
+
+ // Restore old clip region
+ graph.Clip = oldClipRegion;
+ }
+ }
+
+ #endregion
+
+ #region Y values related methods
+
+ /// <summary>
+ /// Helper function, which returns the Y value of the point.
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="area">Chart area the series belongs to.</param>
+ /// <param name="series">Sereis of the point.</param>
+ /// <param name="point">Point object.</param>
+ /// <param name="pointIndex">Index of the point.</param>
+ /// <param name="yValueIndex">Index of the Y value to get. Set to -1 to get the height.</param>
+ /// <returns>Y value of the point.</returns>
+ virtual public double GetYValue(CommonElements common, ChartArea area, Series series, DataPoint point, int pointIndex, int yValueIndex)
+ {
+ double yValue = double.NaN;
+
+ // Calculate stacked column Y value for 2D chart
+ if(area.Area3DStyle.Enable3D == false || yValueIndex == -2)
+ {
+ return point.YValues[0];
+ }
+
+ // Get point Height if pointIndex == -1
+ if(yValueIndex == -1)
+ {
+ Axis vAxis = area.GetAxis(AxisName.Y, series.YAxisType, series.YSubAxisName);
+ double barZeroValue = vAxis.Crossing;
+ yValue = GetYValue(common, area, series, point, pointIndex, 0);
+ if( yValue >= 0 )
+ {
+ if(!double.IsNaN(prevPosY))
+ {
+ barZeroValue = prevPosY;
+ }
+ }
+ else
+ {
+ if(!double.IsNaN(prevNegY))
+ {
+ barZeroValue = prevNegY;
+ }
+ }
+
+ return yValue - barZeroValue;
+ }
+
+ // Loop through all series
+ prevPosY = double.NaN;
+ prevNegY = double.NaN;
+ foreach(Series ser in common.DataManager.Series)
+ {
+ // Check series of the current chart type & area
+ if(String.Compare(series.ChartArea, ser.ChartArea, StringComparison.Ordinal) == 0 &&
+ String.Compare(series.ChartTypeName, ser.ChartTypeName, StringComparison.OrdinalIgnoreCase) == 0 &&
+ ser.IsVisible())
+ {
+
+ // Check if series belongs to the current group name
+ string seriesStackGroupName = StackedColumnChart.GetSeriesStackGroupName(ser);
+ if(this.stackGroupNameUsed &&
+ seriesStackGroupName != this.currentStackGroup)
+ {
+ continue;
+ }
+
+
+
+ if(double.IsNaN(yValue))
+ {
+ yValue = ser.Points[pointIndex].YValues[0];
+ }
+ else
+ {
+ yValue = ser.Points[pointIndex].YValues[0];
+ if(yValue >= 0.0 && !double.IsNaN(prevPosY))
+ {
+ yValue += prevPosY;
+ }
+ if(yValue < 0.0 && !double.IsNaN(prevNegY))
+ {
+ yValue += prevNegY;
+ }
+ }
+
+ // Exit loop when current series was found
+ if (String.Compare(series.Name, ser.Name, StringComparison.Ordinal) == 0)
+ {
+ break;
+ }
+
+ // Save previous value
+ if(yValue >= 0.0)
+ {
+ prevPosY = yValue;
+ }
+ if(yValue < 0.0)
+ {
+ prevNegY = yValue;
+ }
+ }
+ }
+
+ return yValue;
+ }
+
+ #endregion
+
+ #region 3D Painting and selection methods
+
+ /// <summary>
+ /// This method recalculates size of the stacked bars in 3D space. This method is used
+ /// from Paint or Select method.
+ /// </summary>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="drawLabels">True if labels must be drawn.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ private void ProcessChartType3D(
+ bool selection,
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ bool drawLabels,
+ Series seriesToDraw )
+ {
+
+ // Get list of series to draw
+ List<string> typeSeries = null;
+
+
+ // Get all series names that belong the same cluster
+ typeSeries = area.GetClusterSeriesNames(seriesToDraw.Name);
+
+
+ //************************************************************
+ //** Get order of data points drawing
+ //************************************************************
+ ArrayList dataPointDrawingOrder = area.GetDataPointDrawingOrder(
+ typeSeries,
+ this,
+ selection,
+ COPCoordinates.X | COPCoordinates.Y,
+ new BarPointsDrawingOrderComparer(area, selection, COPCoordinates.X | COPCoordinates.Y),
+ 0,
+ false);
+
+
+ //************************************************************
+ //** Loop through all data poins and draw them
+ //************************************************************
+ if(!drawLabels)
+ {
+ foreach(object obj in dataPointDrawingOrder)
+ {
+ // Get point & series
+ DataPoint3D pointEx = (DataPoint3D) obj;
+ DataPoint point = pointEx.dataPoint;
+ Series ser = point.series;
+
+
+ // Set current stack group name
+ this.currentStackGroup = StackedColumnChart.GetSeriesStackGroupName(ser);
+
+
+ // Reset pre-calculated point position
+ point.positionRel = new PointF(float.NaN, float.NaN);
+
+ // Set active horizontal/vertical axis
+ Axis vAxis = area.GetAxis(AxisName.X, ser.XAxisType, ser.XSubAxisName);
+ Axis hAxis = area.GetAxis(AxisName.Y, ser.YAxisType, ser.YSubAxisName);
+
+ // Get point bar drawing style
+ BarDrawingStyle barDrawingStyle = ChartGraphics.GetBarDrawingStyle(point);
+
+ // All cut points are darkened except of the first and last series
+ float rightDarkening = 0.5f;
+ float leftDarkening = 0.5f;
+
+ // NOTE: Following code was replaced with the code below to fix issue #5391
+// if((string)typeSeries[typeSeries.Count - 1] == ser.Name)
+// {
+// leftDarkening = 0f;
+// }
+// if((string)typeSeries[0] == ser.Name)
+// {
+// rightDarkening = 0f;
+// }
+ bool firstVisibleSeries = true;
+ bool lastVisibleSeries = false;
+ for(int seriesIndex = 0; seriesIndex < typeSeries.Count; seriesIndex++)
+ {
+ // Get series object
+ Series currentSeries = common.DataManager.Series[seriesIndex];
+
+ // Check if it is a first series with non-zero Y value
+ if(firstVisibleSeries)
+ {
+ // Make series has non zero vallue
+ if(pointEx.index <= currentSeries.Points.Count &&
+ currentSeries.Points[pointEx.index - 1].YValues[0] != 0.0)
+ {
+ firstVisibleSeries = false;
+ if(currentSeries.Name == ser.Name)
+ {
+ rightDarkening = 0f;
+ }
+ }
+ }
+
+ // Check if it is a last series with non-zero Y value
+ if(currentSeries.Name == ser.Name)
+ {
+ lastVisibleSeries = true;
+ }
+ else if(pointEx.index <= currentSeries.Points.Count &&
+ currentSeries.Points[pointEx.index - 1].YValues[0] != 0.0)
+ {
+ lastVisibleSeries = false;
+ }
+ }
+
+ // Remove darkenning from the last series in the group
+ if(lastVisibleSeries)
+ {
+ leftDarkening = 0f;
+ }
+
+
+ // If stacked groups are used remove darkenning from the
+ // first/last series in the group
+ if (area.StackGroupNames != null &&
+ area.StackGroupNames.Count > 1 &&
+ area.Area3DStyle.IsClustered)
+ {
+ // Get series group name
+ string groupName = StackedColumnChart.GetSeriesStackGroupName(ser);
+
+ // Iterate through all series in the group
+ bool firstSeries = true;
+ bool lastSeries = false;
+ foreach(string seriesName in typeSeries)
+ {
+ Series currentSeries = common.DataManager.Series[seriesName];
+ if(StackedColumnChart.GetSeriesStackGroupName(currentSeries) == groupName)
+ {
+ // check if first seris
+ if(firstSeries)
+ {
+ // Make series has non zero vallue
+ if(pointEx.index < currentSeries.Points.Count &&
+ currentSeries.Points[pointEx.index - 1].YValues[0] != 0.0)
+ {
+ firstSeries = false;
+ if(seriesName == ser.Name)
+ {
+ rightDarkening = 0f;
+ }
+ }
+ }
+
+ // check if last series
+ if(seriesName == ser.Name)
+ {
+ lastSeries = true;
+ }
+ else if(pointEx.index < currentSeries.Points.Count &&
+ currentSeries.Points[pointEx.index - 1].YValues[0] != 0.0)
+ {
+ lastSeries = false;
+ }
+ }
+ }
+
+ // Remove darkenning from the last series in the group
+ if(lastSeries)
+ {
+ leftDarkening = 0f;
+ }
+ }
+
+
+
+ // Change Y value if Bar is out of plot area
+ double yValue = GetYValue(common, area, ser, pointEx.dataPoint, pointEx.index - 1, 0);
+
+ // Set Start position for a bar
+ double barZeroValue = yValue - GetYValue(common, area, ser, pointEx.dataPoint, pointEx.index - 1, -1);
+
+ // Convert values if logarithmic axis is used
+ yValue = hAxis.GetLogValue(yValue);
+ barZeroValue = hAxis.GetLogValue(barZeroValue);
+
+ if( barZeroValue > hAxis.ViewMaximum )
+ {
+ leftDarkening = 0.5f;
+ barZeroValue = hAxis.ViewMaximum;
+ }
+ else if( barZeroValue < hAxis.ViewMinimum )
+ {
+ rightDarkening = 0.5f;
+ barZeroValue = hAxis.ViewMinimum;
+ }
+ if( yValue > hAxis.ViewMaximum )
+ {
+ leftDarkening = 0.5f;
+ yValue = hAxis.ViewMaximum;
+ }
+ else if( yValue < hAxis.ViewMinimum )
+ {
+ rightDarkening = 0.5f;
+ yValue = hAxis.ViewMinimum;
+ }
+
+ // Recalculates Height position and zero position of bars
+ double height = hAxis.GetLinearPosition(yValue);
+ double zero = hAxis.GetLinearPosition(barZeroValue);
+
+ // Set x position
+ double xValue = (pointEx.indexedSeries) ? pointEx.index : point.XValue;
+ xValue = vAxis.GetLogValue(xValue);
+
+
+ // Calculate bar position
+ RectangleF rectSize = RectangleF.Empty;
+ try
+ {
+ // Set the bar rectangle
+ rectSize.Y = (float)(pointEx.xPosition - pointEx.width/2);
+ rectSize.Height = (float)(pointEx.width);
+
+ // The left side of rectangle has always
+ // smaller value than a right value
+ if( zero < height )
+ {
+ float temp = leftDarkening;
+ leftDarkening = rightDarkening;
+ rightDarkening = temp;
+
+ rectSize.X = (float)zero;
+ rectSize.Width = (float)height - rectSize.X;
+ }
+ else
+ {
+ rectSize.X = (float)height;
+ rectSize.Width = (float)zero - rectSize.X;
+ }
+ }
+ catch(OverflowException)
+ {
+ continue;
+ }
+
+ // Remeber pre-calculated point position
+ point.positionRel = new PointF(rectSize.Right, (float)pointEx.xPosition);
+
+ // if data point is not empty
+ if( point.IsEmpty )
+ {
+ continue;
+ }
+
+ GraphicsPath rectPath = null;
+
+ // Check if column is completly out of the data scaleView
+ if(xValue < vAxis.ViewMinimum ||
+ xValue > vAxis.ViewMaximum ||
+ (yValue < hAxis.ViewMinimum && barZeroValue < hAxis.ViewMinimum) ||
+ (yValue > hAxis.ViewMaximum && barZeroValue > hAxis.ViewMaximum) )
+ {
+ continue;
+ }
+
+ // Check if column is partialy in the data scaleView
+ bool clipRegionSet = false;
+ if(rectSize.Bottom <= area.PlotAreaPosition.Y || rectSize.Y >= area.PlotAreaPosition.Bottom)
+ {
+ continue;
+ }
+ if(rectSize.Y < area.PlotAreaPosition.Y)
+ {
+ rectSize.Height -= area.PlotAreaPosition.Y - rectSize.Y;
+ rectSize.Y = area.PlotAreaPosition.Y;
+ }
+ if(rectSize.Bottom > area.PlotAreaPosition.Bottom)
+ {
+ rectSize.Height -= rectSize.Bottom - area.PlotAreaPosition.Bottom;
+ }
+ if(rectSize.Height < 0)
+ {
+ rectSize.Height = 0;
+ }
+ if(rectSize.Height == 0f || rectSize.Width == 0f)
+ {
+ continue;
+ }
+
+
+ // Detect if we need to get graphical path of drawn object
+ DrawingOperationTypes drawingOperationType = DrawingOperationTypes.DrawElement;
+
+ if( common.ProcessModeRegions )
+ {
+ drawingOperationType |= DrawingOperationTypes.CalcElementPath;
+ }
+
+ // Start Svg Selection mode
+ graph.StartHotRegion( point );
+
+ // Draw the Bar rectangle
+ rectPath = graph.Fill3DRectangle(
+ rectSize,
+ pointEx.zPosition,
+ pointEx.depth,
+ area.matrix3D,
+ area.Area3DStyle.LightStyle,
+ point.Color,
+ rightDarkening,
+ leftDarkening,
+ point.BorderColor,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ barDrawingStyle,
+ false,
+ drawingOperationType);
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+
+ // Reset Clip Region
+ if(clipRegionSet)
+ {
+ graph.ResetClip();
+ }
+
+ if( common.ProcessModeRegions && !drawLabels)
+ {
+ common.HotRegionsList.AddHotRegion(
+ rectPath,
+ false,
+ graph,
+ point,
+ ser.Name,
+ pointEx.index - 1
+ );
+ }
+ if (rectPath != null)
+ {
+ rectPath.Dispose();
+ }
+ }
+ }
+
+ //************************************************************
+ //** Loop through all data poins and draw labels
+ //************************************************************
+ if(drawLabels)
+ {
+ foreach(object obj in dataPointDrawingOrder)
+ {
+ // Get point & series
+ DataPoint3D pointEx = (DataPoint3D) obj;
+ DataPoint point = pointEx.dataPoint;
+ Series ser = point.series;
+
+ // Set active horizontal/vertical axis
+ Axis vAxis = area.GetAxis(AxisName.X, ser.XAxisType, ser.XSubAxisName);
+ Axis hAxis = area.GetAxis(AxisName.Y, ser.YAxisType, ser.YSubAxisName);
+
+ // Change Y value if Bar is out of plot area
+ double yValue = GetYValue(common, area, ser, pointEx.dataPoint, pointEx.index - 1, 0);
+
+ // Axis is logarithmic
+ if( hAxis.IsLogarithmic )
+ {
+ yValue = Math.Log( yValue, hAxis.logarithmBase );
+ }
+
+ // Recalculates Height position and zero position of bars
+ double height = pointEx.yPosition;;
+
+ // Set x position
+ double xValue = (pointEx.indexedSeries) ? pointEx.index : point.XValue;
+
+ // Set Start position for a bar
+ double barZeroValue = yValue - GetYValue(common, area, ser, pointEx.dataPoint, pointEx.index - 1, -1);
+ double zero = pointEx.height;
+
+ // Calculate bar position
+ RectangleF rectSize = RectangleF.Empty;
+ try
+ {
+ // Set the bar rectangle
+ rectSize.Y = (float)(pointEx.xPosition - pointEx.width/2);
+ rectSize.Height = (float)(pointEx.width);
+
+ // The left side of rectangle has always
+ // smaller value than a right value
+ if( zero < height )
+ {
+ rectSize.X = (float)zero;
+ rectSize.Width = (float)height - rectSize.X;
+ }
+ else
+ {
+ rectSize.X = (float)height;
+ rectSize.Width = (float)zero - rectSize.X;
+ }
+ }
+ catch(OverflowException)
+ {
+ continue;
+ }
+
+ // if data point is not empty
+ if( point.IsEmpty )
+ {
+ continue;
+ }
+
+ // Axis is logarithmic
+ if( hAxis.IsLogarithmic )
+ {
+ barZeroValue = Math.Log( barZeroValue, hAxis.logarithmBase );
+ }
+
+ // Check if column is completly out of the data scaleView
+ if(xValue < vAxis.ViewMinimum ||
+ xValue > vAxis.ViewMaximum ||
+ (yValue < hAxis.ViewMinimum && barZeroValue < hAxis.ViewMinimum) ||
+ (yValue > hAxis.ViewMaximum && barZeroValue > hAxis.ViewMaximum) )
+ {
+ continue;
+ }
+
+ // Draw 3D labels
+ DrawLabels3D( area, graph, common, rectSize, pointEx, ser, barZeroValue, height, pointEx.width, pointEx.index - 1);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Draws labels in 3D.
+ /// </summary>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="rectSize">Bar rectangle.</param>
+ /// <param name="pointEx">Data point.</param>
+ /// <param name="ser">Data series.</param>
+ /// <param name="barStartPosition">The zero position or the bottom of bars.</param>
+ /// <param name="barSize">The Height of bars.</param>
+ /// <param name="width">The width of bars.</param>
+ /// <param name="pointIndex">Point index.</param>
+ private void DrawLabels3D(
+ ChartArea area,
+ ChartGraphics graph,
+ CommonElements common,
+ RectangleF rectSize,
+ DataPoint3D pointEx,
+ Series ser,
+ double barStartPosition,
+ double barSize,
+ double width,
+ int pointIndex)
+ {
+ DataPoint point = pointEx.dataPoint;
+
+ //************************************************************
+ // Draw data point value label
+ //************************************************************
+ if(ser.IsValueShownAsLabel || point.IsValueShownAsLabel || point.Label.Length > 0)
+ {
+ // Label rectangle
+ RectangleF rectLabel = RectangleF.Empty;
+
+ // Label text format
+ using (StringFormat format = new StringFormat())
+ {
+
+ //************************************************************
+ // Get label text
+ //************************************************************
+ string text;
+ if (point.Label.Length == 0)
+ {
+ // Round Y values for 100% stacked bar
+ double pointLabelValue = GetYValue(common, area, ser, point, pointIndex, -2);
+ if (this.hundredPercentStacked && point.LabelFormat.Length == 0)
+ {
+ pointLabelValue = Math.Round(pointLabelValue, 2);
+ }
+
+ text = ValueConverter.FormatValue(
+ ser.Chart,
+ point,
+ point.Tag,
+ pointLabelValue,
+ point.LabelFormat,
+ ser.YValueType,
+ ChartElementType.DataPoint);
+ }
+ else
+ {
+ text = point.ReplaceKeywords(point.Label);
+ }
+
+
+ //************************************************************
+ // Check labels style custom properties
+ //************************************************************
+ BarValueLabelDrawingStyle drawingStyle = BarValueLabelDrawingStyle.Center;
+ string valueLabelAttrib = "";
+ if (point.IsCustomPropertySet(CustomPropertyName.BarLabelStyle))
+ {
+ valueLabelAttrib = point[CustomPropertyName.BarLabelStyle];
+ }
+ else if (ser.IsCustomPropertySet(CustomPropertyName.BarLabelStyle))
+ {
+ valueLabelAttrib = ser[CustomPropertyName.BarLabelStyle];
+ }
+
+ if (valueLabelAttrib != null && valueLabelAttrib.Length > 0)
+ {
+ if (String.Compare(valueLabelAttrib, "Left", StringComparison.OrdinalIgnoreCase) == 0)
+ drawingStyle = BarValueLabelDrawingStyle.Left;
+ else if (String.Compare(valueLabelAttrib, "Right", StringComparison.OrdinalIgnoreCase) == 0)
+ drawingStyle = BarValueLabelDrawingStyle.Right;
+ else if (String.Compare(valueLabelAttrib, "Center", StringComparison.OrdinalIgnoreCase) == 0)
+ drawingStyle = BarValueLabelDrawingStyle.Center;
+ else if (String.Compare(valueLabelAttrib, "Outside", StringComparison.OrdinalIgnoreCase) == 0)
+ drawingStyle = BarValueLabelDrawingStyle.Outside;
+ }
+
+ //************************************************************
+ // Make sure label fits. Otherwise change it style
+ //************************************************************
+ bool labelFit = false;
+ while (!labelFit)
+ {
+ // Label text format
+ format.Alignment = StringAlignment.Near;
+ format.LineAlignment = StringAlignment.Center;
+
+ // LabelStyle rectangle
+ if (barStartPosition < barSize)
+ {
+ rectLabel.X = rectSize.Right;
+ rectLabel.Width = area.PlotAreaPosition.Right - rectSize.Right;
+ }
+ else
+ {
+ rectLabel.X = area.PlotAreaPosition.X;
+ rectLabel.Width = rectSize.X - area.PlotAreaPosition.X;
+ }
+
+ // Adjust label rectangle
+ rectLabel.Y = rectSize.Y - (float)width / 2F;
+ rectLabel.Height = rectSize.Height + (float)width;
+
+ // Adjust label position depending on the drawing style
+ if (drawingStyle == BarValueLabelDrawingStyle.Left)
+ {
+ rectLabel = rectSize;
+ format.Alignment = StringAlignment.Near;
+ }
+ else if (drawingStyle == BarValueLabelDrawingStyle.Center)
+ {
+ rectLabel = rectSize;
+ format.Alignment = StringAlignment.Center;
+ }
+ else if (drawingStyle == BarValueLabelDrawingStyle.Right)
+ {
+ rectLabel = rectSize;
+ format.Alignment = StringAlignment.Far;
+ }
+
+ // Reversed string alignment
+ if (barStartPosition >= barSize)
+ {
+ if (format.Alignment == StringAlignment.Far)
+ format.Alignment = StringAlignment.Near;
+ else if (format.Alignment == StringAlignment.Near)
+ format.Alignment = StringAlignment.Far;
+ }
+
+ // Stacked bar chart can not change the BarValueLabelDrawingStyle trying to
+ // fit data point labels because it will cause label overlapping.
+ // NOTE: Code below is commented. Fixes issue #4687 - AG
+ labelFit = true;
+
+ // // Make sure value label fits rectangle.
+ // SizeF valueTextSize = graph.MeasureStringRel(text, point.Font);
+ // if(!labelSwitched && valueTextSize.Width > rectLabel.Width)
+ // {
+ // // Switch label style only once
+ // labelSwitched = true;
+ //
+ // // If text do not fit - try to switch between Outside/Inside drawing styles
+ // if(drawingStyle == BarValueLabelDrawingStyle.Outside)
+ // {
+ // drawingStyle = BarValueLabelDrawingStyle.Right;
+ // }
+ // else
+ // {
+ // drawingStyle = BarValueLabelDrawingStyle.Outside;
+ // }
+ // }
+ // else
+ // {
+ // labelFit = true;
+ // }
+ }
+
+ //************************************************************
+ // Find text rotation center point
+ //************************************************************
+
+ // Measure string size
+ SizeF size = graph.MeasureStringRel(text, point.Font, new SizeF(rectLabel.Width, rectLabel.Height), format);
+
+ PointF rotationCenter = PointF.Empty;
+ if (format.Alignment == StringAlignment.Near)
+ { // Near
+ rotationCenter.X = rectLabel.X + size.Width / 2;
+ }
+ else if (format.Alignment == StringAlignment.Far)
+ { // Far
+ rotationCenter.X = rectLabel.Right - size.Width / 2;
+ }
+ else
+ { // Center
+ rotationCenter.X = (rectLabel.Left + rectLabel.Right) / 2;
+ }
+
+ if (format.LineAlignment == StringAlignment.Near)
+ { // Near
+ rotationCenter.Y = rectLabel.Top + size.Height / 2;
+ }
+ else if (format.LineAlignment == StringAlignment.Far)
+ { // Far
+ rotationCenter.Y = rectLabel.Bottom - size.Height / 2;
+ }
+ else
+ { // Center
+ rotationCenter.Y = (rectLabel.Bottom + rectLabel.Top) / 2;
+ }
+
+ // Reset string alignment to center point
+ format.Alignment = StringAlignment.Center;
+ format.LineAlignment = StringAlignment.Center;
+
+
+ //************************************************************
+ // Adjust label rotation angle
+ //************************************************************
+ int angle = point.LabelAngle;
+
+ // Get projection coordinates
+ Point3D[] rotationCenterProjection = new Point3D[] {
+ new Point3D(rotationCenter.X, rotationCenter.Y, pointEx.zPosition + pointEx.depth),
+ new Point3D(rotationCenter.X - 20f, rotationCenter.Y, pointEx.zPosition + pointEx.depth) };
+ // Transform coordinates of text rotation point
+ area.matrix3D.TransformPoints(rotationCenterProjection);
+
+ // Adjust rotation point
+ rotationCenter = rotationCenterProjection[0].PointF;
+
+ // Adjust angle of the horisontal text
+ if (angle == 0 || angle == 180)
+ {
+ // Convert coordinates to absolute
+ rotationCenterProjection[0].PointF = graph.GetAbsolutePoint(rotationCenterProjection[0].PointF);
+ rotationCenterProjection[1].PointF = graph.GetAbsolutePoint(rotationCenterProjection[1].PointF);
+
+ // Calcuate axis angle
+ float angleXAxis = (float)Math.Atan(
+ (rotationCenterProjection[1].Y - rotationCenterProjection[0].Y) /
+ (rotationCenterProjection[1].X - rotationCenterProjection[0].X));
+ angleXAxis = (float)Math.Round(angleXAxis * 180f / (float)Math.PI);
+ angle += (int)angleXAxis;
+ }
+
+ SizeF sizeFont = SizeF.Empty;
+
+
+ // Check if Smart Labels are enabled
+ if (ser.SmartLabelStyle.Enabled)
+ {
+ sizeFont = graph.GetRelativeSize(
+ graph.MeasureString(
+ text,
+ point.Font,
+ new SizeF(1000f, 1000f),
+ StringFormat.GenericTypographic));
+
+ // Force some SmartLabelStyle settings for column chart
+ bool oldMarkerOverlapping = ser.SmartLabelStyle.IsMarkerOverlappingAllowed;
+ LabelAlignmentStyles oldMovingDirection = ser.SmartLabelStyle.MovingDirection;
+ ser.SmartLabelStyle.IsMarkerOverlappingAllowed = true;
+ if(ser.SmartLabelStyle.MovingDirection == (LabelAlignmentStyles.Top | LabelAlignmentStyles.Bottom | LabelAlignmentStyles.Right | LabelAlignmentStyles.Left | LabelAlignmentStyles.TopLeft | LabelAlignmentStyles.TopRight | LabelAlignmentStyles.BottomLeft | LabelAlignmentStyles.BottomRight) )
+ {
+ ser.SmartLabelStyle.MovingDirection = LabelAlignmentStyles.Left | LabelAlignmentStyles.Right;
+ }
+
+ // Adjust label position using SmartLabelStyle algorithm
+ rotationCenter = area.smartLabels.AdjustSmartLabelPosition(
+ common,
+ graph,
+ area,
+ ser.SmartLabelStyle,
+ rotationCenter,
+ sizeFont,
+ format,
+ rotationCenter,
+ new SizeF(0f, 0f),
+ LabelAlignmentStyles.Center);
+
+ // Restore forced values
+ ser.SmartLabelStyle.IsMarkerOverlappingAllowed = oldMarkerOverlapping;
+ ser.SmartLabelStyle.MovingDirection = oldMovingDirection;
+
+ // Smart labels always use 0 degrees text angle
+ angle = 0;
+ }
+
+
+
+
+
+ //************************************************************
+ // Draw label
+ //************************************************************
+ if (!rotationCenter.IsEmpty)
+ {
+ // Measure string
+ if (sizeFont.IsEmpty)
+ {
+ sizeFont = graph.GetRelativeSize(
+ graph.MeasureString(
+ text,
+ point.Font,
+ new SizeF(1000f, 1000f),
+ new StringFormat(StringFormat.GenericTypographic)));
+ }
+
+ // Get label background position
+ RectangleF labelBackPosition = RectangleF.Empty;
+ SizeF sizeLabel = new SizeF(sizeFont.Width, sizeFont.Height);
+ sizeLabel.Height += sizeFont.Height / 8;
+ sizeLabel.Width += sizeLabel.Width / text.Length;
+ labelBackPosition = new RectangleF(
+ rotationCenter.X - sizeLabel.Width / 2,
+ rotationCenter.Y - sizeLabel.Height / 2 - sizeFont.Height / 10,
+ sizeLabel.Width,
+ sizeLabel.Height);
+
+ // Draw label text
+ using (Brush brush = new SolidBrush(point.LabelForeColor))
+ {
+ graph.DrawPointLabelStringRel(
+ common,
+ text,
+ point.Font,
+ brush,
+ rotationCenter,
+ format,
+ angle,
+ labelBackPosition,
+ point.LabelBackColor,
+ point.LabelBorderColor,
+ point.LabelBorderWidth,
+ point.LabelBorderDashStyle,
+ ser,
+ point,
+ pointIndex);
+ }
+ }
+ }
+ }
+ }
+
+ #endregion
+
+ #region SmartLabelStyle methods
+
+ /// <summary>
+ /// Adds markers position to the list. Used to check SmartLabelStyle overlapping.
+ /// </summary>
+ /// <param name="common">Common chart elements.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="series">Series values to be used.</param>
+ /// <param name="list">List to add to.</param>
+ public void AddSmartLabelMarkerPositions(CommonElements common, ChartArea area, Series series, ArrayList list)
+ {
+ // NOTE: Stacked Bar chart type do not support SmartLabelStyle feature
+ }
+
+ #endregion
+
+ #region IDisposable interface implementation
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected virtual void Dispose(bool disposing)
+ {
+ //Nothing to dispose at the base class.
+ }
+
+ /// <summary>
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// </summary>
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/StackedColumnChart.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/StackedColumnChart.cs
new file mode 100644
index 00000000000..cd0a1e4a0e5
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/StackedColumnChart.cs
@@ -0,0 +1,2023 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: StackedColumnChart.cs
+//
+// Namespace: DataVisualization.Charting.ChartTypes
+//
+// Classes: StackedColumnChart, HundredPercentStackedColumnChart
+//
+// Purpose: This class contains all necessary methods and
+// properties for drawing and selection of the stacked
+// Column chart. Every data point in the Stacked Column
+// chart is represented with one rectangle. If there is
+// more then one series with this chart type from
+// same chart area, Column with same X values are
+// Stacked.
+//
+// Reviewed: AG - Aug 6, 2002
+// AG - Microsoft 7, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Drawing.Text;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+#else
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.ChartTypes
+#else
+ namespace System.Web.UI.DataVisualization.Charting.ChartTypes
+#endif
+{
+ /// <summary>
+ /// HundredPercentStackedColumnChart class extends StackedColumnChart class
+ /// by providing its own algorithm for calculating series data point
+ /// Y values. It makes sure that total Y value of all data points in a
+ /// single cluster from all series adds up to 100%.
+ /// </summary>
+ internal class HundredPercentStackedColumnChart : StackedColumnChart
+ {
+ #region Constructor
+
+ /// <summary>
+ /// Default constructor.
+ /// </summary>
+ public HundredPercentStackedColumnChart()
+ {
+ hundredPercentStacked = true;
+ }
+
+ #endregion
+
+ #region Fields
+
+
+ // Total Y values from all series at specified index orgonized by stacked groups
+ // Hashtable will contain arrays of doubles stored by group name key.
+ Hashtable _stackedGroupsTotalPerPoint = null;
+
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ override public string Name { get{ return ChartTypeNames.OneHundredPercentStackedColumn;}}
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ override public bool HundredPercent{ get{return true;} }
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ override public bool HundredPercentSupportNegative{ get{return true;} }
+
+ #endregion
+
+ #region Painting and Selection methods
+
+ /// <summary>
+ /// Paint HundredPercentStackedColumnChart Chart.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ override public void Paint( ChartGraphics graph, CommonElements common, ChartArea area, Series seriesToDraw )
+ {
+ // Reset pre-calculated totals
+
+ this._stackedGroupsTotalPerPoint = null;
+
+ base.Paint( graph, common, area, seriesToDraw );
+ }
+
+ #endregion
+
+ #region Y values methods
+
+ /// <summary>
+ /// Helper function, which returns the Y value of the point
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="area">Chart area the series belongs to.</param>
+ /// <param name="series">Sereis of the point.</param>
+ /// <param name="point">Point object.</param>
+ /// <param name="pointIndex">Index of the point.</param>
+ /// <param name="yValueIndex">Index of the Y value to get.</param>
+ /// <returns>Y value of the point.</returns>
+ override public double GetYValue(CommonElements common, ChartArea area, Series series, DataPoint point, int pointIndex, int yValueIndex)
+ {
+ // Array of Y totals for individual series index in the current stacked group
+ double[] currentGroupTotalPerPoint = null;
+
+
+
+ string currentStackedGroupName = HundredPercentStackedColumnChart.GetSeriesStackGroupName(series);
+ if(this._stackedGroupsTotalPerPoint == null)
+ {
+ // Create new hashtable
+ this._stackedGroupsTotalPerPoint = new Hashtable();
+
+ // Iterate through all stacked groups
+ foreach(string groupName in this.stackGroupNames)
+ {
+ // Get series that belong to the same group
+ Series[] seriesArray = HundredPercentStackedColumnChart.GetSeriesByStackedGroupName(
+ common, groupName, series.ChartTypeName, series.ChartArea);
+
+ // Check if series are aligned
+ common.DataManipulator.CheckXValuesAlignment(seriesArray);
+
+ // Allocate memory for the array of totals
+ double[] totals = new double[series.Points.Count];
+
+ // Calculate the total of Y value per point
+ for(int index = 0; index < series.Points.Count; index++)
+ {
+ totals[index] = 0;
+ foreach( Series ser in seriesArray )
+ {
+ totals[index] += Math.Abs(ser.Points[index].YValues[0]);
+ }
+ }
+
+ // Add totals array into the hashtable
+ this._stackedGroupsTotalPerPoint.Add(groupName, totals);
+ }
+ }
+
+ // Find array of total Y values based on the current stacked group name
+ currentGroupTotalPerPoint = (double[])this._stackedGroupsTotalPerPoint[currentStackedGroupName];
+
+
+ // IsEmpty point
+ if(!area.Area3DStyle.Enable3D)
+ {
+ if(point.YValues[0] == 0 || point.IsEmpty)
+ {
+ return 0;
+ }
+ }
+
+ // Calculate stacked column Y value for 2D chart
+ if(area.Area3DStyle.Enable3D == false || yValueIndex == -2)
+ {
+ if(currentGroupTotalPerPoint[pointIndex] == 0.0)
+ {
+ return 0.0;
+ }
+ return (point.YValues[0] / currentGroupTotalPerPoint[pointIndex]) * 100.0;
+ }
+
+
+ // Get point Height if pointIndex == -1
+ double yValue = double.NaN;
+ if(yValueIndex == -1)
+ {
+ Axis vAxis = area.GetAxis(AxisName.Y, series.YAxisType, series.YSubAxisName);
+ double barZeroValue = vAxis.Crossing;
+ yValue = GetYValue(common, area, series, point, pointIndex, 0);
+ if( yValue >= 0 )
+ {
+ if(!double.IsNaN(prevPosY))
+ {
+ barZeroValue = prevPosY;
+ }
+ }
+ else
+ {
+ if(!double.IsNaN(prevNegY))
+ {
+ barZeroValue = prevNegY;
+ }
+ }
+
+ return yValue - barZeroValue;
+ }
+
+
+ // Loop through all series to find point value
+ prevPosY = double.NaN;
+ prevNegY = double.NaN;
+ foreach(Series ser in common.DataManager.Series)
+ {
+ // Check series of the current chart type & area
+ if(String.Compare(series.ChartArea, ser.ChartArea, StringComparison.Ordinal) == 0 &&
+ String.Compare(series.ChartTypeName, ser.ChartTypeName, StringComparison.OrdinalIgnoreCase) == 0 &&
+ ser.IsVisible())
+ {
+
+ // Series must belong to the same stacked group
+ if(currentStackedGroupName != HundredPercentStackedColumnChart.GetSeriesStackGroupName(ser))
+ {
+ continue;
+ }
+
+
+ if(double.IsNaN(yValue))
+ {
+ if(currentGroupTotalPerPoint[pointIndex] == 0.0)
+ {
+ yValue = 0.0;
+ }
+ else
+ {
+ yValue = (ser.Points[pointIndex].YValues[0] / currentGroupTotalPerPoint[pointIndex]) * 100.0;
+ }
+ }
+ else
+ {
+ if(currentGroupTotalPerPoint[pointIndex] == 0.0)
+ {
+ yValue = 0.0;
+ }
+ else
+ {
+ yValue = (ser.Points[pointIndex].YValues[0] / currentGroupTotalPerPoint[pointIndex]) * 100.0;
+ }
+ if(yValue >= 0.0 && !double.IsNaN(prevPosY))
+ {
+ yValue += prevPosY;
+ }
+ if(yValue < 0.0 && !double.IsNaN(prevNegY))
+ {
+ yValue += prevNegY;
+ }
+ }
+
+ // Exit loop when current series was found
+ if (String.Compare(series.Name, ser.Name, StringComparison.Ordinal) == 0)
+ {
+ break;
+ }
+
+ // Save previous value
+ if(yValue >= 0.0)
+ {
+ prevPosY = yValue;
+ }
+ else
+ {
+ prevNegY = yValue;
+ }
+ }
+ }
+
+ return (yValue > 100.0) ? 100.0 : yValue;
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// StackedColumnChart class contains all the code necessary to draw
+ /// and hit test Stacked Column chart.
+ /// </summary>
+ internal class StackedColumnChart : IChartType
+ {
+ #region Fields
+
+ /// <summary>
+ /// Previous stacked positive Y values.
+ /// </summary>
+ protected double prevPosY = double.NaN;
+
+ /// <summary>
+ /// Previous stacked negative Y values.
+ /// </summary>
+ protected double prevNegY = double.NaN;
+
+ /// <summary>
+ /// Indicates if chart is 100% stacked
+ /// </summary>
+ protected bool hundredPercentStacked = false;
+
+
+
+ /// <summary>
+ /// True if stacke group name is applicable
+ /// </summary>
+ internal bool stackGroupNameUsed = false;
+
+ /// <summary>
+ /// List of all stack group names
+ /// </summary>
+ internal ArrayList stackGroupNames = null;
+
+ /// <summary>
+ /// Name of the current stack group.
+ /// </summary>
+ internal string currentStackGroup = string.Empty;
+
+
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ virtual public string Name { get{ return ChartTypeNames.StackedColumn;}}
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ virtual public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+
+ /// <summary>
+ /// True if chart type is stacked
+ /// </summary>
+ virtual public bool Stacked { get{ return true;}}
+
+
+ /// <summary>
+ /// True if stacked chart type supports groups
+ /// </summary>
+ virtual public bool SupportStackedGroups { get { return true; } }
+
+
+ /// <summary>
+ /// True if stacked chart type should draw separately positive and
+ /// negative data points ( Bar and column Stacked types ).
+ /// </summary>
+ public bool StackSign { get{ return true;}}
+
+ /// <summary>
+ /// True if chart type supports axeses
+ /// </summary>
+ virtual public bool RequireAxes { get{ return true;} }
+
+ /// <summary>
+ /// Chart type with two y values used for scale ( bubble chart type )
+ /// </summary>
+ virtual public bool SecondYScale{ get{ return false;} }
+
+ /// <summary>
+ /// True if chart type requires circular chart area.
+ /// </summary>
+ public bool CircularChartArea { get{ return false;} }
+
+ /// <summary>
+ /// True if chart type supports logarithmic axes
+ /// </summary>
+ virtual public bool SupportLogarithmicAxes { get{ return true;} }
+
+ /// <summary>
+ /// True if chart type requires to switch the value (Y) axes position
+ /// </summary>
+ virtual public bool SwitchValueAxes { get{ return false;} }
+
+ /// <summary>
+ /// True if chart series can be placed side-by-side.
+ /// </summary>
+ public bool SideBySideSeries { get{ return false;} }
+
+ /// <summary>
+ /// True if each data point of a chart must be represented in the legend
+ /// </summary>
+ virtual public bool DataPointsInLegend { get{ return false;} }
+
+ /// <summary>
+ /// Indicates that extra Y values are connected to the scale of the Y axis
+ /// </summary>
+ virtual public bool ExtraYValuesConnectedToYAxis{ get { return false; } }
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ virtual public bool HundredPercent{ get{return false;} }
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ virtual public bool HundredPercentSupportNegative{ get{return false;} }
+
+ /// <summary>
+ /// True if palette colors should be applied for each data paoint.
+ /// Otherwise the color is applied to the series.
+ /// </summary>
+ virtual public bool ApplyPaletteColorsToPoints { get { return false; } }
+
+ /// <summary>
+ /// How to draw series/points in legend:
+ /// Filled rectangle, Line or Marker
+ /// </summary>
+ /// <param name="series">Legend item series.</param>
+ /// <returns>Legend item style.</returns>
+ virtual public LegendImageStyle GetLegendImageStyle(Series series)
+ {
+ return LegendImageStyle.Rectangle;
+ }
+
+ /// <summary>
+ /// Number of supported Y value(s) per point
+ /// </summary>
+ virtual public int YValuesPerPoint{ get { return 1; } }
+
+ /// <summary>
+ /// If the crossing value is auto Crossing value should be
+ /// automatically set to zero for some chart
+ /// types (Bar, column, area etc.)
+ /// </summary>
+ virtual public bool ZeroCrossing { get{ return true;} }
+
+ #endregion
+
+ #region Constructor
+
+ /// <summary>
+ /// Default constructor.
+ /// </summary>
+ public StackedColumnChart()
+ {
+ }
+
+ #endregion
+
+ #region Painting and Selection methods
+
+ /// <summary>
+ /// Paint StackedColumnChart Chart
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object</param>
+ /// <param name="common">The Common elements object</param>
+ /// <param name="area">Chart area for this chart</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ virtual public void Paint( ChartGraphics graph, CommonElements common, ChartArea area, Series seriesToDraw )
+ {
+
+ // Reset stacked group names flag
+ stackGroupNameUsed = true;
+
+
+ // Set Clip Region in rounded to a pixel coordinates
+ RectangleF areaPosition = ((ChartGraphics)graph).GetAbsoluteRectangle( area.PlotAreaPosition.ToRectangleF());
+ float right = (float)Math.Ceiling(areaPosition.Right);
+ float bottom = (float)Math.Ceiling(areaPosition.Bottom);
+ areaPosition.X = (float)Math.Floor(areaPosition.X);
+ areaPosition.Width = right - areaPosition.X;
+ areaPosition.Y = (float)Math.Floor(areaPosition.Y);
+ areaPosition.Height = bottom - areaPosition.Y;
+ ((ChartGraphics)graph).SetClipAbs( areaPosition );
+
+ // Draw shadow first
+ ProcessChartType( false, graph, common, area, true, false, seriesToDraw );
+
+ // Draw stacked bars
+ ProcessChartType( false, graph, common, area, false, false, seriesToDraw );
+
+ // Draw labels
+ ProcessChartType( false, graph, common, area, false, true, seriesToDraw );
+
+ // Reset Clip Region
+ ((ChartGraphics)graph).ResetClip();
+ }
+
+ /// <summary>
+ /// This method recalculates size of the Columns. This method is used
+ /// from Paint or Select method.
+ /// </summary>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active.</param>
+ /// <param name="graph">The Chart Graphics objec.t</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="shadow">True if shadow mode is active.</param>
+ /// <param name="labels">Labels drawing mode.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ private void ProcessChartType(
+ bool selection,
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ bool shadow,
+ bool labels,
+ Series seriesToDraw )
+ {
+
+
+ //************************************************************
+ //** If stacked series is attached to diferent X and Y axis
+ //** they can not be processed. To solve this issue series
+ //** will be orgonized in groups based on the axes.
+ //************************************************************
+
+ // Loop through all series and check if different axes are used
+ bool differentAxesAreUsed = false;
+ AxisType xAxisType = AxisType.Primary;
+ AxisType yAxisType = AxisType.Primary;
+ string xSubAxisName = string.Empty;
+ string ySubAxisName = string.Empty;
+ for(int seriesIndex = 0; seriesIndex < common.DataManager.Series.Count; seriesIndex++)
+ {
+ // Process non empty series of the area with stacked column chart type
+ Series ser = common.DataManager.Series[seriesIndex];
+ if( String.Compare( ser.ChartTypeName, Name, StringComparison.OrdinalIgnoreCase ) != 0
+ || ser.ChartArea != area.Name || !ser.IsVisible())
+ {
+ continue;
+ }
+
+ if(seriesIndex == 0)
+ {
+ xAxisType = ser.XAxisType;
+ yAxisType = ser.YAxisType;
+ xSubAxisName = ser.XSubAxisName;
+ ySubAxisName = ser.YSubAxisName;
+ }
+ else if(xAxisType != ser.XAxisType ||
+ yAxisType != ser.YAxisType ||
+ xSubAxisName != ser.XSubAxisName ||
+ ySubAxisName != ser.YSubAxisName)
+ {
+ differentAxesAreUsed = true;
+ break;
+ }
+ }
+
+ // Set stacked groups based on the axes used
+ if(differentAxesAreUsed)
+ {
+ for(int seriesIndex = 0; seriesIndex < common.DataManager.Series.Count; seriesIndex++)
+ {
+ // Process non empty series of the area with stacked column chart type
+ Series ser = common.DataManager.Series[seriesIndex];
+ if( String.Compare( ser.ChartTypeName, Name, StringComparison.OrdinalIgnoreCase ) != 0
+ || ser.ChartArea != area.Name || !ser.IsVisible())
+ {
+ continue;
+ }
+
+ // Set new group name
+ string stackGroupName = StackedColumnChart.GetSeriesStackGroupName(ser);
+ stackGroupName = "_X_" + ser.XAxisType.ToString() + ser.XSubAxisName + "_Y_" + ser.YAxisType.ToString() + ser.YSubAxisName + "__";
+ ser[CustomPropertyName.StackedGroupName] = stackGroupName;
+ }
+ }
+
+ //************************************************************
+ //** Check how many stack groups are available.
+ //************************************************************
+
+ // Loop through all series and get unique stack group names.
+ this.stackGroupNames = new ArrayList();
+ foreach( Series ser in common.DataManager.Series )
+ {
+ // Process non empty series of the area with stacked column chart type
+ if( String.Compare( ser.ChartTypeName, Name, StringComparison.OrdinalIgnoreCase ) != 0
+ || ser.ChartArea != area.Name || !ser.IsVisible())
+ {
+ continue;
+ }
+
+ // Get stack group name from the series
+ string stackGroupName = StackedColumnChart.GetSeriesStackGroupName(ser);
+
+ // Add group name if it do not already exsist
+ if(!this.stackGroupNames.Contains(stackGroupName))
+ {
+ this.stackGroupNames.Add(stackGroupName);
+ }
+ }
+
+
+ //************************************************************
+ //** Prosess 3D chart type.
+ //************************************************************
+ if(area.Area3DStyle.Enable3D)
+ {
+ if(!shadow)
+ {
+ ProcessChartType3D(
+ selection,
+ graph,
+ common,
+ area,
+ labels,
+ seriesToDraw );
+ }
+
+ return;
+ }
+
+
+ // All data series from chart area which have Column chart type
+ string[] seriesList = area.GetSeriesFromChartType(Name).ToArray();
+
+ // Get maximum number of data points for all series
+ int maxNumOfPoints = common.DataManager.GetNumberOfPoints(seriesList);
+
+ // Zero X values mode.
+ bool indexedSeries = ChartHelper.IndexedSeries(common, seriesList);
+
+ //************************************************************
+ //** Loop through all data points
+ //************************************************************
+ for( int pointIndx = 0; pointIndx < maxNumOfPoints; pointIndx++ )
+ {
+
+ //************************************************************
+ //** Loop through all stack groups
+ //************************************************************
+ for(int groupIndex = 0; groupIndex < this.stackGroupNames.Count; groupIndex++)
+ {
+ // Rememmber current stack group name
+ this.currentStackGroup = (string)this.stackGroupNames[groupIndex];
+
+ int seriesIndx = 0; // Data series index
+ double PreviousPosY = 0; // Previous positive Y value
+ double PreviousNegY = 0; // Previous negative Y value
+
+ //************************************************************
+ //** Loop through all series
+ //************************************************************
+ foreach( Series ser in common.DataManager.Series )
+ {
+ // Process non empty series of the area with stacked column chart type
+ if( String.Compare( ser.ChartTypeName, Name, StringComparison.OrdinalIgnoreCase ) != 0
+ || ser.ChartArea != area.Name || !ser.IsVisible())
+ {
+ continue;
+ }
+
+ // Series point index is out of range
+ if( pointIndx >= ser.Points.Count )
+ {
+ continue;
+ }
+
+
+ // Check if series belongs to the current group name
+ string seriesStackGroupName = StackedColumnChart.GetSeriesStackGroupName(ser);
+ if(seriesStackGroupName != this.currentStackGroup)
+ {
+ continue;
+ }
+
+
+ // Get data point
+ DataPoint point = ser.Points[ pointIndx ];
+
+ // Reset pre-calculated point position
+ point.positionRel = new PointF(float.NaN, float.NaN);
+
+ // Set active horizontal/vertical axis
+ Axis vAxis = area.GetAxis(AxisName.Y, ser.YAxisType, ser.YSubAxisName);
+ Axis hAxis = area.GetAxis(AxisName.X, ser.XAxisType, ser.XSubAxisName);
+
+ // Interval between Columns
+ bool sameInterval = false;
+ double interval = 1;
+ if( !indexedSeries )
+ {
+ if (ser.Points.Count == 1 &&
+ (ser.XValueType == ChartValueType.Date ||
+ ser.XValueType == ChartValueType.DateTime ||
+ ser.XValueType == ChartValueType.Time ||
+ ser.XValueType == ChartValueType.DateTimeOffset))
+ {
+ // Check if interval is the same
+ List<string> typeSeries = area.GetSeriesFromChartType(Name);
+ area.GetPointsInterval(typeSeries, hAxis.IsLogarithmic, hAxis.logarithmBase, true, out sameInterval);
+
+ // Special case when there is only one data point and date scale is used.
+ if (!double.IsNaN(hAxis.majorGrid.GetInterval()) && hAxis.majorGrid.GetIntervalType() != DateTimeIntervalType.NotSet)
+ {
+ interval = ChartHelper.GetIntervalSize(hAxis.minimum, hAxis.majorGrid.GetInterval(), hAxis.majorGrid.GetIntervalType());
+ }
+ else
+ {
+ interval = ChartHelper.GetIntervalSize(hAxis.minimum, hAxis.Interval, hAxis.IntervalType);
+ }
+ }
+ else
+ {
+ interval = area.GetPointsInterval(hAxis.IsLogarithmic, hAxis.logarithmBase);
+ }
+ }
+
+ // Calculates the width of Columns.
+ double width = ser.GetPointWidth(graph, hAxis, interval, 0.8);
+
+
+ // Adjust width by number of stacked groups
+ width = width / (double)this.stackGroupNames.Count;
+
+
+ // Call Back Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPrePaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+
+ // Change Y value if Column is out of plot area
+ double yValue = GetYValue(common, area, ser, point, pointIndx, 0);
+ if( seriesIndx != 0 )
+ {
+ if( yValue >= 0 )
+ {
+ yValue = yValue + PreviousPosY;
+ }
+ else
+ {
+ yValue = yValue + PreviousNegY;
+ }
+ }
+
+ // Check if scrolling/zooming frames cutting mode is enabled
+ bool ajaxScrollingEnabled = false;
+
+ // Save original Y Value
+ double originalYValue = yValue;
+
+ // Get IsLogarithmic value
+ yValue = vAxis.GetLogValue(yValue);
+
+ // Check if value is inside plotting area
+ if ( !( ajaxScrollingEnabled && labels) )
+ {
+ if (yValue > vAxis.ViewMaximum)
+ {
+ yValue = vAxis.ViewMaximum;
+ }
+ if (yValue < vAxis.ViewMinimum)
+ {
+ yValue = vAxis.ViewMinimum;
+ }
+ }
+
+ // Recalculates Height position and zero position of Columns
+ double height = vAxis.GetLinearPosition( yValue );
+
+ // Set Start position for a column
+ double barZeroValue = 0.0;
+ if( seriesIndx == 0 )
+ {
+ if (ajaxScrollingEnabled && labels)
+ {
+ // If AJAX scrolling is used always use 0.0 as a starting point
+ barZeroValue = 0.0;
+ }
+ else
+ {
+ // Set Start position for a Column
+ barZeroValue = vAxis.Crossing;
+ }
+
+ }
+ else if( GetYValue(common, area, ser, point, pointIndx, 0) >= 0 )
+ {
+ barZeroValue = PreviousPosY;
+ }
+ else
+ {
+ barZeroValue = PreviousNegY;
+ }
+ double zero = vAxis.GetPosition(barZeroValue);
+
+ // Set x position
+ double xValue = point.XValue;
+ if( indexedSeries )
+ {
+ // The formula for position is based on a distance
+ //from the grid line or nPoints position.
+ xValue = (double)pointIndx + 1;
+ }
+
+ double xPosition = hAxis.GetPosition( xValue );
+
+ // Adjust X position of each stack group
+ if(this.stackGroupNames.Count > 1)
+ {
+ xPosition = xPosition - width * ((double) this.stackGroupNames.Count) / 2.0 + width / 2.0 + groupIndex * width;
+ }
+
+
+ xValue = hAxis.GetLogValue(xValue);
+
+ // Calculate column position
+ RectangleF rectSize = RectangleF.Empty;
+ try
+ {
+ // Set the Column rectangle
+ rectSize.X = (float)(xPosition - width/2);
+ rectSize.Width = (float)(width);
+
+ // The top side of rectangle has always
+ // smaller value than a bottom value
+ if( zero < height )
+ {
+ rectSize.Y = (float)zero;
+ rectSize.Height = (float)height - rectSize.Y;
+ }
+ else
+ {
+ rectSize.Y = (float)height;
+ rectSize.Height = (float)zero - rectSize.Y;
+ }
+ }
+ catch(OverflowException)
+ {
+ seriesIndx++;
+ continue;
+ }
+
+ // Remeber pre-calculated point position
+ point.positionRel = new PointF((float)xPosition, rectSize.Top);
+
+ // if data point is not empty
+ if( point.IsEmpty )
+ {
+ seriesIndx++;
+ continue;
+ }
+
+ // **************************************************
+ // Painting mode
+ // **************************************************
+ if( common.ProcessModePaint )
+ {
+ // Check if column is completly out of the data scaleView
+ bool skipPoint = false;
+ if(xValue < hAxis.ViewMinimum ||
+ xValue > hAxis.ViewMaximum ||
+ (yValue < vAxis.ViewMinimum && barZeroValue < vAxis.ViewMinimum) ||
+ (yValue > vAxis.ViewMaximum && barZeroValue > vAxis.ViewMaximum) )
+ {
+ skipPoint = true;
+ }
+
+ if(!skipPoint)
+ {
+
+ // Ser shadow
+ int shadowOffset = 0;
+ if( shadow )
+ {
+ shadowOffset = ser.ShadowOffset;
+ }
+
+ if( !labels )
+ {
+ // Check if column is partialy in the data scaleView
+ bool clipRegionSet = false;
+ if(rectSize.X < area.PlotAreaPosition.X ||
+ rectSize.Right > area.PlotAreaPosition.Right ||
+ rectSize.Y < area.PlotAreaPosition.Y ||
+ rectSize.Bottom > area.PlotAreaPosition.Bottom)
+ {
+ // Set clipping region for line drawing
+ graph.SetClip( area.PlotAreaPosition.ToRectangleF() );
+ clipRegionSet = true;
+ }
+
+ // Start Svg Selection mode
+ graph.StartHotRegion( point );
+
+ if(!shadow || shadowOffset != 0)
+ {
+ // Draw the Column rectangle
+ graph.FillRectangleRel( rectSize,
+ (!shadow)? point.Color : Color.Transparent,
+ point.BackHatchStyle,
+ point.BackImage,
+ point.BackImageWrapMode,
+ point.BackImageTransparentColor,
+ point.BackImageAlignment,
+ point.BackGradientStyle,
+ (!shadow)? point.BackSecondaryColor : Color.Transparent,
+ point.BorderColor,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ ser.ShadowColor,
+ shadowOffset,
+ PenAlignment.Inset,
+ (shadow) ? BarDrawingStyle.Default : ChartGraphics.GetBarDrawingStyle(point),
+ true);
+ }
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+
+ // Reset Clip Region
+ if(clipRegionSet)
+ {
+ graph.ResetClip();
+ }
+ }
+ else
+ {
+ // Draw labels
+ DrawLabels( common, graph, area, point, pointIndx, ser, rectSize );
+ }
+ }
+ }
+
+ // **************************************************
+ // Create Hot Regions
+ // **************************************************
+ if( common.ProcessModeRegions && !shadow && !labels)
+ {
+ common.HotRegionsList.AddHotRegion( rectSize, point, ser.Name, pointIndx );
+ }
+
+ // Call Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPostPaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+
+
+ // Axis is logarithmic
+ if( vAxis.IsLogarithmic )
+ {
+ yValue = Math.Pow( vAxis.logarithmBase, yValue );
+ }
+
+ // Data series index
+ seriesIndx++;
+ if( GetYValue(common, area, ser, point, pointIndx, 0) >= 0 )
+ {
+ PreviousPosY = originalYValue;
+ }
+ else
+ {
+ PreviousNegY = originalYValue;
+ }
+ }
+
+ }
+
+ }
+
+
+
+
+ //************************************************************
+ //** Remove stacked groups created for series attached to different axis
+ //************************************************************
+
+ if(differentAxesAreUsed)
+ {
+ for(int seriesIndex = 0; seriesIndex < common.DataManager.Series.Count; seriesIndex++)
+ {
+ // Process non empty series of the area with stacked column chart type
+ Series ser = common.DataManager.Series[seriesIndex];
+ if( String.Compare( ser.ChartTypeName, Name, StringComparison.OrdinalIgnoreCase ) != 0
+ || ser.ChartArea != area.Name || !ser.IsVisible())
+ {
+ continue;
+ }
+
+ // Set new group name
+ string stackGroupName = StackedColumnChart.GetSeriesStackGroupName(ser);
+ int index = stackGroupName.IndexOf("__", StringComparison.Ordinal);
+ if(index >= 0)
+ {
+ stackGroupName = stackGroupName.Substring(index + 2);
+ }
+ if(stackGroupName.Length > 0)
+ {
+ ser[CustomPropertyName.StackedGroupName] = stackGroupName;
+ }
+ else
+ {
+ ser.DeleteCustomProperty(CustomPropertyName.StackedGroupName);
+ }
+ }
+ }
+
+
+
+ }
+
+
+
+ /// <summary>
+ /// Helper method that gets an array of series that belong to the specified
+ /// stacked group.
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="groupName">Group name to get the list of series for.</param>
+ /// <param name="chartTypeName">Series chart type name to include in the result list.</param>
+ /// <param name="chartAreaName">Series chart are name where series should belong to.</param>
+ /// <returns>Array of series that belong to the specified group.</returns>
+ static internal Series[] GetSeriesByStackedGroupName(CommonElements common, string groupName, string chartTypeName, string chartAreaName)
+ {
+ // Get a list of series with specified group name
+ ArrayList list = new ArrayList();
+ foreach(Series series in common.DataManager.Series)
+ {
+ if (String.Compare(series.ChartTypeName, chartTypeName, StringComparison.OrdinalIgnoreCase) == 0 &&
+ chartAreaName == series.ChartArea &&
+ series.IsVisible())
+ {
+ if (GetSeriesStackGroupName(series) == groupName)
+ {
+ list.Add(series);
+ }
+ }
+ }
+
+ // Convert array list to array of series
+ int index = 0;
+ Series[] arrayOfSeries = new Series[list.Count];
+ foreach(Series series in list)
+ {
+ arrayOfSeries[index++] = series;
+ }
+
+ return arrayOfSeries;
+ }
+
+ /// <summary>
+ /// Helper method that gets stacked group name from specified series.
+ /// </summary>
+ /// <param name="series">Series to get the group name from.</param>
+ /// <returns>Series stacked group name.</returns>
+ static internal string GetSeriesStackGroupName(Series series)
+ {
+ // Get stack group name from the series
+ string stackGroupName = string.Empty;
+ if(series.IsCustomPropertySet(CustomPropertyName.StackedGroupName))
+ {
+ stackGroupName = series[CustomPropertyName.StackedGroupName];
+ }
+ return stackGroupName;
+ }
+
+ /// <summary>
+ /// Checks if series supports stacked group names.
+ /// </summary>
+ /// <param name="series">Series to check.</param>
+ /// <returns>True if feature supported.</returns>
+ static internal bool IsSeriesStackGroupNameSupported(Series series)
+ {
+ if( series.ChartType == SeriesChartType.StackedColumn ||
+ series.ChartType == SeriesChartType.StackedColumn100 ||
+ series.ChartType == SeriesChartType.StackedBar ||
+ series.ChartType == SeriesChartType.StackedBar100)
+ {
+ return true;
+ }
+ return false;
+ }
+
+
+
+ /// <summary>
+ /// Draw Stacked Column labels.
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="graph">Chart Graphics.</param>
+ /// <param name="area">Chart area the series belongs to.</param>
+ /// <param name="point">Data point.</param>
+ /// <param name="pointIndex">Data point index.</param>
+ /// <param name="series">Data series.</param>
+ /// <param name="rectangle">Column rectangle.</param>
+ public void DrawLabels(
+ CommonElements common,
+ ChartGraphics graph,
+ ChartArea area,
+ DataPoint point,
+ int pointIndex,
+ Series series,
+ RectangleF rectangle )
+ {
+ // Label text format
+ using (StringFormat format = new StringFormat())
+ {
+ format.Alignment = StringAlignment.Center;
+ format.LineAlignment = StringAlignment.Center;
+
+ // Disable the clip region
+ Region oldClipRegion = graph.Clip;
+ graph.Clip = new Region();
+
+ if (point.IsValueShownAsLabel || point.Label.Length > 0)
+ {
+ // Get label text
+ string text;
+ if (point.Label.Length == 0)
+ {
+ // Round Y values for 100% stacked area
+ double pointLabelValue = GetYValue(common, area, series, point, pointIndex, 0);
+ if (this.hundredPercentStacked && point.LabelFormat.Length == 0)
+ {
+ pointLabelValue = Math.Round(pointLabelValue, 2);
+ }
+
+ text = ValueConverter.FormatValue(
+ series.Chart,
+ point,
+ point.Tag,
+ pointLabelValue,
+ point.LabelFormat,
+ series.YValueType,
+ ChartElementType.DataPoint);
+ }
+ else
+ {
+ text = point.ReplaceKeywords(point.Label);
+ }
+
+ // Calculate label position
+ PointF labelPosition = PointF.Empty;
+ labelPosition.X = rectangle.X + rectangle.Width / 2f;
+ labelPosition.Y = rectangle.Y + rectangle.Height / 2f;
+
+ // Get text angle
+ int textAngle = point.LabelAngle;
+
+ // Check if text contains white space only
+ if (text.Trim().Length != 0)
+ {
+ SizeF sizeFont = SizeF.Empty;
+
+
+ // Check if Smart Labels are enabled
+ if (series.SmartLabelStyle.Enabled)
+ {
+ sizeFont = graph.GetRelativeSize(
+ graph.MeasureString(
+ text,
+ point.Font,
+ new SizeF(1000f, 1000f),
+ StringFormat.GenericTypographic));
+ // Force some SmartLabelStyle settings for column chart
+ bool oldMarkerOverlapping = series.SmartLabelStyle.IsMarkerOverlappingAllowed;
+ LabelAlignmentStyles oldMovingDirection = series.SmartLabelStyle.MovingDirection;
+ series.SmartLabelStyle.IsMarkerOverlappingAllowed = true;
+
+ // Change default moving direction
+ if (series.SmartLabelStyle.MovingDirection == (LabelAlignmentStyles.Top | LabelAlignmentStyles.Bottom | LabelAlignmentStyles.Right | LabelAlignmentStyles.Left | LabelAlignmentStyles.TopLeft | LabelAlignmentStyles.TopRight | LabelAlignmentStyles.BottomLeft | LabelAlignmentStyles.BottomRight))
+ {
+ series.SmartLabelStyle.MovingDirection = LabelAlignmentStyles.Bottom | LabelAlignmentStyles.Top;
+ }
+
+ // Adjust label position using SmartLabelStyle algorithm
+ labelPosition = area.smartLabels.AdjustSmartLabelPosition(
+ common,
+ graph,
+ area,
+ series.SmartLabelStyle,
+ labelPosition,
+ sizeFont,
+ format,
+ labelPosition,
+ new SizeF(0f, 0f),
+ LabelAlignmentStyles.Center);
+
+ // Restore forced values
+ series.SmartLabelStyle.IsMarkerOverlappingAllowed = oldMarkerOverlapping;
+ series.SmartLabelStyle.MovingDirection = oldMovingDirection;
+
+ // Smart labels always use 0 degrees text angle
+ textAngle = 0;
+ }
+
+
+
+ // Draw label
+ if (!labelPosition.IsEmpty)
+ {
+ // Fix the .Net issue that text looks shifted to the left.
+ PointF absPosition = graph.GetAbsolutePoint(labelPosition);
+ if (graph.TextRenderingHint != TextRenderingHint.AntiAlias)
+ {
+ absPosition.X = (float)Math.Ceiling(absPosition.X) + 1f;
+ labelPosition = graph.GetRelativePoint(absPosition);
+ }
+
+ // Measure string
+ if (sizeFont.IsEmpty)
+ {
+ sizeFont = graph.GetRelativeSize(
+ graph.MeasureString(
+ text,
+ point.Font,
+ new SizeF(1000f, 1000f),
+ StringFormat.GenericTypographic));
+ }
+
+ // Get label background position
+ RectangleF labelBackPosition = RectangleF.Empty;
+ SizeF sizeLabel = new SizeF(sizeFont.Width, sizeFont.Height);
+ sizeLabel.Height += sizeFont.Height / 8;
+ sizeLabel.Width += sizeLabel.Width / text.Length;
+ labelBackPosition = new RectangleF(
+ labelPosition.X - sizeLabel.Width / 2,
+ labelPosition.Y - sizeLabel.Height / 2 - sizeFont.Height / 10,
+ sizeLabel.Width,
+ sizeLabel.Height);
+
+ // Draw label text
+ using (Brush brush = new SolidBrush(point.LabelForeColor))
+ {
+
+ graph.DrawPointLabelStringRel(
+ common,
+ text,
+ point.Font,
+ brush,
+ labelPosition,
+ format,
+ textAngle,
+ labelBackPosition,
+ point.LabelBackColor,
+ point.LabelBorderColor,
+ point.LabelBorderWidth,
+ point.LabelBorderDashStyle,
+ series,
+ point,
+ pointIndex);
+ }
+ }
+ }
+ }
+
+ // Restore old clip region
+ graph.Clip = oldClipRegion;
+ }
+ }
+
+ #endregion
+
+ #region Y values methods
+
+ /// <summary>
+ /// Helper function, which returns the Y value of the point.
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="area">Chart area the series belongs to.</param>
+ /// <param name="series">Sereis of the point.</param>
+ /// <param name="point">Point object.</param>
+ /// <param name="pointIndex">Index of the point.</param>
+ /// <param name="yValueIndex">Index of the Y value to get. Set to -1 to get the height.</param>
+ /// <returns>Y value of the point.</returns>
+ virtual public double GetYValue(CommonElements common, ChartArea area, Series series, DataPoint point, int pointIndex, int yValueIndex)
+ {
+ double yValue = double.NaN;
+
+ // Calculate stacked column Y value for 2D chart
+ if(area.Area3DStyle.Enable3D == false || yValueIndex == -2)
+ {
+ return point.YValues[0];
+ }
+
+ // Get point Height if pointIndex == -1
+ if(yValueIndex == -1)
+ {
+ Axis vAxis = area.GetAxis(AxisName.Y, series.YAxisType, series.YSubAxisName);
+ double barZeroValue = vAxis.Crossing;
+ yValue = GetYValue(common, area, series, point, pointIndex, 0);
+ if( yValue >= 0 )
+ {
+ if(!double.IsNaN(prevPosY))
+ {
+ barZeroValue = prevPosY;
+ }
+ }
+ else
+ {
+ if(!double.IsNaN(prevNegY))
+ {
+ barZeroValue = prevNegY;
+ }
+ }
+
+ return yValue - barZeroValue;
+ }
+
+ // Loop through all series
+ prevPosY = double.NaN;
+ prevNegY = double.NaN;
+ foreach(Series ser in common.DataManager.Series)
+ {
+ // Check series of the current chart type & area
+ if(String.Compare(series.ChartArea, ser.ChartArea, StringComparison.Ordinal) == 0 &&
+ String.Compare(series.ChartTypeName, ser.ChartTypeName, StringComparison.OrdinalIgnoreCase) == 0 &&
+ ser.IsVisible())
+ {
+
+ // Check if series belongs to the current group name
+ string seriesStackGroupName = StackedColumnChart.GetSeriesStackGroupName(ser);
+ if(this.stackGroupNameUsed &&
+ seriesStackGroupName != this.currentStackGroup)
+ {
+ continue;
+ }
+
+
+
+ if(double.IsNaN(yValue))
+ {
+ yValue = ser.Points[pointIndex].YValues[0];
+ }
+ else
+ {
+ yValue = ser.Points[pointIndex].YValues[0];
+ if(yValue >= 0.0 && !double.IsNaN(prevPosY))
+ {
+ yValue += prevPosY;
+ }
+ if(yValue < 0.0 && !double.IsNaN(prevNegY))
+ {
+ yValue += prevNegY;
+ }
+ }
+
+ // Exit loop when current series was found
+ if (String.Compare(series.Name, ser.Name, StringComparison.Ordinal) == 0)
+ {
+ break;
+ }
+
+ // Save previous value
+ if(yValue >= 0.0)
+ {
+ prevPosY = yValue;
+ }
+
+ if(yValue < 0.0)
+ {
+ prevNegY = yValue;
+ }
+ }
+ }
+
+ return yValue;
+ }
+
+ #endregion
+
+ #region 3D Painting and Selection method
+
+ /// <summary>
+ /// This method recalculates size of the Columns. This method is used
+ /// from Paint or Select method in 3D space.
+ /// </summary>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active.</param>
+ /// <param name="graph">The Chart Graphics objec.t</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="labels">Labels drawing mode.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ private void ProcessChartType3D(
+ bool selection,
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ bool labels,
+ Series seriesToDraw )
+ {
+ // Labels & markers are drawn with the data points in the first iteration
+ if(labels && !selection)
+ {
+ return;
+ }
+
+ // Get list of series to draw
+ List<string> typeSeries = null;
+
+
+ // Get all series names that belong the same cluster
+ typeSeries = area.GetClusterSeriesNames(seriesToDraw.Name);
+
+
+ //************************************************************
+ //** Get order of data points drawing
+ //************************************************************
+ ArrayList dataPointDrawingOrder = area.GetDataPointDrawingOrder(typeSeries, this, selection, COPCoordinates.X | COPCoordinates.Y, null, 0, false);
+
+
+ //************************************************************
+ //** Loop through all data poins and draw them
+ //************************************************************
+ bool drawLabels = false;
+ foreach(object obj in dataPointDrawingOrder)
+ {
+ // Get point & series
+ DataPoint3D pointEx = (DataPoint3D) obj;
+ DataPoint point = pointEx.dataPoint;
+ Series ser = point.series;
+
+
+ // Set current stack group name
+ this.currentStackGroup = StackedColumnChart.GetSeriesStackGroupName(ser);
+
+
+ // Reset pre-calculated point position
+ point.positionRel = new PointF(float.NaN, float.NaN);
+
+ // Set active vertical/horizontal axis
+ Axis vAxis = area.GetAxis(AxisName.Y, ser.YAxisType, ser.YSubAxisName);
+ Axis hAxis = area.GetAxis(AxisName.X, ser.XAxisType, ser.XSubAxisName);
+
+ // Get point bar drawing style
+ BarDrawingStyle barDrawingStyle = ChartGraphics.GetBarDrawingStyle(point);
+
+ // All cut points are darkened except of the first and last series
+ float topDarkening = 0.5f;
+ float bottomDarkening = 0.5f;
+
+ // NOTE: Following code was replaced with the code below to fix issue #5391
+// if((string)typeSeries[typeSeries.Count - 1] == ser.Name)
+// {
+// topDarkening = 0f;
+// }
+// if((string)typeSeries[0] == ser.Name)
+// {
+// bottomDarkening = 0f;
+// }
+
+ bool firstVisibleSeries = true;
+ bool lastVisibleSeries = false;
+ for(int seriesIndex = 0; seriesIndex < typeSeries.Count; seriesIndex++)
+ {
+ // Get series object
+ Series currentSeries = common.DataManager.Series[seriesIndex];
+
+ // Check if it is a first series with non-zero Y value
+ if(firstVisibleSeries)
+ {
+ // Make series has non zero vallue
+ if(pointEx.index <= currentSeries.Points.Count &&
+ currentSeries.Points[pointEx.index - 1].YValues[0] != 0.0)
+ {
+ firstVisibleSeries = false;
+ if(currentSeries.Name == ser.Name)
+ {
+ bottomDarkening = 0f;
+ }
+ }
+ }
+
+ // Check if it is a last series with non-zero Y value
+ if(currentSeries.Name == ser.Name)
+ {
+ lastVisibleSeries = true;
+ }
+ else if(pointEx.index <= currentSeries.Points.Count &&
+ currentSeries.Points[pointEx.index - 1].YValues[0] != 0.0)
+ {
+ lastVisibleSeries = false;
+ }
+ }
+
+ // Remove darkenning from the last series in the group
+ if(lastVisibleSeries)
+ {
+ topDarkening = 0f;
+ }
+
+
+
+ // If stacked groups are used remove darkenning from the
+ // first/last series in the group
+ if(area.StackGroupNames != null &&
+ area.StackGroupNames.Count > 1 &&
+ area.Area3DStyle.IsClustered)
+ {
+ // Get series group name
+ string groupName = StackedColumnChart.GetSeriesStackGroupName(ser);
+
+ // Iterate through all series in the group
+ bool firstSeries = true;
+ bool lastSeries = false;
+ foreach(string seriesName in typeSeries)
+ {
+ Series currentSeries = common.DataManager.Series[seriesName];
+ if(StackedColumnChart.GetSeriesStackGroupName(currentSeries) == groupName)
+ {
+ // check if first seris
+ if(firstSeries)
+ {
+ if(pointEx.index < currentSeries.Points.Count &&
+ currentSeries.Points[pointEx.index - 1].YValues[0] != 0.0)
+ {
+ firstSeries = false;
+ if(seriesName == ser.Name)
+ {
+ bottomDarkening = 0f;
+ }
+
+ }
+ }
+
+ // check if last series
+ if(seriesName == ser.Name)
+ {
+ lastSeries = true;
+ }
+ else if(pointEx.index < currentSeries.Points.Count &&
+ currentSeries.Points[pointEx.index - 1].YValues[0] != 0.0)
+ {
+ lastSeries = false;
+ }
+ }
+ }
+
+ // Remove darkenning from the last series in the group
+ if(lastSeries)
+ {
+ topDarkening = 0f;
+ }
+ }
+
+
+
+ // Check if value is inside plotting area
+ double yValue = GetYValue(common, area, ser, pointEx.dataPoint, pointEx.index - 1, 0);
+
+ // Set Start position for a column
+ double barZeroValue = yValue - GetYValue(common, area, ser, pointEx.dataPoint, pointEx.index - 1, -1);
+
+ // Convert values if logarithmic axis is used
+ yValue = vAxis.GetLogValue(yValue);
+ barZeroValue = vAxis.GetLogValue(barZeroValue);
+
+ if( barZeroValue > vAxis.ViewMaximum )
+ {
+ topDarkening = 0.5f;
+ barZeroValue = vAxis.ViewMaximum;
+ }
+ else if( barZeroValue < vAxis.ViewMinimum )
+ {
+ bottomDarkening = 0.5f;
+ barZeroValue = vAxis.ViewMinimum;
+ }
+ if( yValue > vAxis.ViewMaximum )
+ {
+ topDarkening = 0.5f;
+ yValue = vAxis.ViewMaximum;
+ }
+ else if( yValue < vAxis.ViewMinimum )
+ {
+ bottomDarkening = 0.5f;
+ yValue = vAxis.ViewMinimum;
+ }
+
+ // Recalculates Height position and zero position of Columns
+ double height = vAxis.GetLinearPosition(yValue);
+ double zero = vAxis.GetLinearPosition(barZeroValue);
+
+ // Calculate column position
+ RectangleF rectSize = RectangleF.Empty;
+ try
+ {
+ // Set the Column rectangle
+ rectSize.X = (float)(pointEx.xPosition - pointEx.width/2);
+ rectSize.Width = (float)(pointEx.width);
+
+ // The top side of rectangle has always
+ // smaller value than a bottom value
+ if( zero < height )
+ {
+ float temp = bottomDarkening;
+ bottomDarkening = topDarkening;
+ topDarkening = temp;
+
+ rectSize.Y = (float)zero;
+ rectSize.Height = (float)height - rectSize.Y;
+ }
+ else
+ {
+ rectSize.Y = (float)height;
+ rectSize.Height = (float)zero - rectSize.Y;
+ }
+ }
+ catch(OverflowException)
+ {
+ continue;
+ }
+
+ // Remeber pre-calculated point position
+ point.positionRel = new PointF((float)pointEx.xPosition, rectSize.Top);
+
+ // if data point is not empty
+ if( point.IsEmpty )
+ {
+ continue;
+ }
+
+ // Painting mode
+ // Check if column is completly out of the data scaleView
+ double xValue = (pointEx.indexedSeries) ? pointEx.index : point.XValue;
+ xValue = hAxis.GetLogValue(xValue);
+ if(xValue < hAxis.ViewMinimum ||
+ xValue > hAxis.ViewMaximum ||
+ (yValue < vAxis.ViewMinimum && barZeroValue < vAxis.ViewMinimum) ||
+ (yValue > vAxis.ViewMaximum && barZeroValue > vAxis.ViewMaximum) )
+ {
+ continue;
+ }
+
+ // Check if column is partialy in the data scaleView
+ bool clipRegionSet = false;
+ if(rectSize.Right <= area.PlotAreaPosition.X || rectSize.X >= area.PlotAreaPosition.Right)
+ {
+ continue;
+ }
+
+ if(rectSize.X < area.PlotAreaPosition.X)
+ {
+ rectSize.Width -= area.PlotAreaPosition.X - rectSize.X;
+ rectSize.X = area.PlotAreaPosition.X;
+ }
+ if(rectSize.Right > area.PlotAreaPosition.Right)
+ {
+ rectSize.Width -= rectSize.Right - area.PlotAreaPosition.Right;
+ }
+ if(rectSize.Width < 0)
+ {
+ rectSize.Width = 0;
+ }
+ if(rectSize.Height == 0f || rectSize.Width == 0f)
+ {
+ continue;
+ }
+
+ // Detect if we need to get graphical path of drawn object
+ DrawingOperationTypes drawingOperationType = DrawingOperationTypes.DrawElement;
+
+ if( common.ProcessModeRegions )
+ {
+ drawingOperationType |= DrawingOperationTypes.CalcElementPath;
+ }
+
+ // Start Svg Selection mode
+ graph.StartHotRegion( point );
+
+ // Draw the Column rectangle
+ using ( GraphicsPath rectPath = graph.Fill3DRectangle(
+ rectSize,
+ pointEx.zPosition,
+ pointEx.depth,
+ area.matrix3D,
+ area.Area3DStyle.LightStyle,
+ point.Color,
+ topDarkening,
+ bottomDarkening,
+ point.BorderColor,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ barDrawingStyle,
+ true,
+ drawingOperationType))
+ {
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+
+ // Reset Clip Region
+ if(clipRegionSet)
+ {
+ graph.ResetClip();
+ }
+
+ if( common.ProcessModeRegions && !labels)
+ {
+ common.HotRegionsList.AddHotRegion( rectPath, false, graph, point, ser.Name, pointEx.index - 1 );
+ }
+
+ // Check if labels should be drawn
+ if( point.IsValueShownAsLabel || point.Label.Length > 0 )
+ {
+ drawLabels = true;
+ }
+ }
+ }
+
+
+
+ //************************************************************
+ //** Loop through all data poins and draw labels
+ //************************************************************
+ if(drawLabels)
+ {
+ foreach(object obj in dataPointDrawingOrder)
+ {
+ // Get point & series
+ DataPoint3D pointEx = (DataPoint3D) obj;
+ DataPoint point = pointEx.dataPoint;
+ Series ser = point.series;
+
+ // Set active vertical/horizontal axis
+ Axis vAxis = area.GetAxis(AxisName.Y, ser.YAxisType, ser.YSubAxisName);
+ Axis hAxis = area.GetAxis(AxisName.X, ser.XAxisType, ser.XSubAxisName);
+
+ // Check if value is inside plotting area
+ double yValue = GetYValue(common, area, ser, pointEx.dataPoint, pointEx.index - 1, 0);
+ if( yValue > vAxis.ViewMaximum )
+ {
+ yValue = vAxis.ViewMaximum;
+ }
+ if( yValue < vAxis.ViewMinimum )
+ {
+ yValue = vAxis.ViewMinimum;
+ }
+ yValue = vAxis.GetLogValue(yValue);
+
+ // Recalculates Height position and zero position of Columns
+ double height = pointEx.yPosition;
+
+ // Set Start position for a column
+ double barZeroValue = yValue - vAxis.GetLogValue(GetYValue(common, area, ser, pointEx.dataPoint, pointEx.index - 1, -1));
+ double zero = pointEx.height;
+
+ // Calculate column position
+ RectangleF rectSize = RectangleF.Empty;
+ try
+ {
+ // Set the Column rectangle
+ rectSize.X = (float)(pointEx.xPosition - pointEx.width/2);
+ rectSize.Width = (float)(pointEx.width);
+
+ // The top side of rectangle has always
+ // smaller value than a bottom value
+ if( zero < height )
+ {
+ rectSize.Y = (float)zero;
+ rectSize.Height = (float)height - rectSize.Y;
+ }
+ else
+ {
+ rectSize.Y = (float)height;
+ rectSize.Height = (float)zero - rectSize.Y;
+ }
+ }
+ catch(OverflowException)
+ {
+ continue;
+ }
+
+ // if data point is not empty
+ if( point.IsEmpty )
+ {
+ continue;
+ }
+
+ // Painting mode
+ if( !selection )
+ {
+ // Check if column is completly out of the data scaleView
+ double xValue = (pointEx.indexedSeries) ? pointEx.index : point.XValue;
+ xValue = hAxis.GetLogValue(xValue);
+ if(xValue < hAxis.ViewMinimum ||
+ xValue > hAxis.ViewMaximum ||
+ (yValue < vAxis.ViewMinimum && barZeroValue < vAxis.ViewMinimum) ||
+ (yValue > vAxis.ViewMaximum && barZeroValue > vAxis.ViewMaximum) )
+ {
+ continue;
+ }
+
+ // Draw labels
+ DrawLabels3D( common, graph, area, pointEx, pointEx.index - 1, ser, rectSize );
+
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Draw Stacked Column labels.
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="graph">Chart Graphics.</param>
+ /// <param name="area">Chart area the series belongs to.</param>
+ /// <param name="pointEx">Data point.</param>
+ /// <param name="pointIndex">Data point index.</param>
+ /// <param name="series">Data series.</param>
+ /// <param name="rectangle">Column rectangle.</param>
+ internal void DrawLabels3D(
+ CommonElements common,
+ ChartGraphics graph,
+ ChartArea area,
+ DataPoint3D pointEx,
+ int pointIndex,
+ Series series,
+ RectangleF rectangle )
+ {
+ DataPoint point = pointEx.dataPoint;
+
+ // Label text format
+ using (StringFormat format = new StringFormat())
+ {
+ format.Alignment = StringAlignment.Center;
+ format.LineAlignment = StringAlignment.Center;
+
+ // Disable the clip region
+ Region oldClipRegion = graph.Clip;
+ graph.Clip = new Region();
+
+ if (point.IsValueShownAsLabel || point.Label.Length > 0)
+ {
+ // Get label text
+ string text;
+ if (point.Label.Length == 0)
+ {
+ // Round Y values for 100% stacked area
+ double pointLabelValue = GetYValue(common, area, series, point, pointIndex, -2);
+ if (this.hundredPercentStacked && point.LabelFormat.Length == 0)
+ {
+ pointLabelValue = Math.Round(pointLabelValue, 2);
+ }
+
+ text = ValueConverter.FormatValue(
+ series.Chart,
+ point,
+ point.Tag,
+ pointLabelValue,
+ point.LabelFormat,
+ series.YValueType,
+ ChartElementType.DataPoint);
+ }
+ else
+ {
+ text = point.ReplaceKeywords(point.Label);
+ }
+
+ // Calculate label position
+ PointF labelPosition = PointF.Empty;
+ labelPosition.X = rectangle.X + rectangle.Width / 2f;
+ labelPosition.Y = rectangle.Y + rectangle.Height / 2f;
+
+ // Transform coordinates
+ Point3D[] marker3DPosition = new Point3D[1];
+ marker3DPosition[0] = new Point3D(labelPosition.X, labelPosition.Y, (float)(pointEx.zPosition + pointEx.depth));
+ area.matrix3D.TransformPoints(marker3DPosition);
+
+ labelPosition.X = marker3DPosition[0].X;
+ labelPosition.Y = marker3DPosition[0].Y;
+
+ int textAngle = point.LabelAngle;
+
+ SizeF sizeFont = SizeF.Empty;
+
+
+ // Check if Smart Labels are enabled
+ if (series.SmartLabelStyle.Enabled)
+ {
+ sizeFont = graph.GetRelativeSize(
+ graph.MeasureString(
+ text,
+ point.Font,
+ new SizeF(1000f, 1000f),
+ StringFormat.GenericTypographic));
+
+ // Force some SmartLabelStyle settings for column chart
+ bool oldMarkerOverlapping = series.SmartLabelStyle.IsMarkerOverlappingAllowed;
+ LabelAlignmentStyles oldMovingDirection = series.SmartLabelStyle.MovingDirection;
+ series.SmartLabelStyle.IsMarkerOverlappingAllowed = true;
+
+ // Change default moving direction
+ if (series.SmartLabelStyle.MovingDirection == (LabelAlignmentStyles.Top | LabelAlignmentStyles.Bottom | LabelAlignmentStyles.Right | LabelAlignmentStyles.Left | LabelAlignmentStyles.TopLeft | LabelAlignmentStyles.TopRight | LabelAlignmentStyles.BottomLeft | LabelAlignmentStyles.BottomRight))
+ {
+ series.SmartLabelStyle.MovingDirection = LabelAlignmentStyles.Bottom | LabelAlignmentStyles.Top;
+ }
+
+ // Adjust label position using SmartLabelStyle algorithm
+ labelPosition = area.smartLabels.AdjustSmartLabelPosition(
+ common,
+ graph,
+ area,
+ series.SmartLabelStyle,
+ labelPosition,
+ sizeFont,
+ format,
+ labelPosition,
+ new SizeF(0f, 0f),
+ LabelAlignmentStyles.Center);
+
+ // Restore forced values
+ series.SmartLabelStyle.IsMarkerOverlappingAllowed = oldMarkerOverlapping;
+ series.SmartLabelStyle.MovingDirection = oldMovingDirection;
+
+ // Smart labels always use 0 degrees text angle
+ textAngle = 0;
+ }
+
+
+
+ if (!labelPosition.IsEmpty)
+ {
+ // Measure string
+ if (sizeFont.IsEmpty)
+ {
+ sizeFont = graph.GetRelativeSize(
+ graph.MeasureString(
+ text,
+ point.Font,
+ new SizeF(1000f, 1000f),
+ StringFormat.GenericTypographic));
+ }
+
+ // Get label background position
+ RectangleF labelBackPosition = RectangleF.Empty;
+ SizeF sizeLabel = new SizeF(sizeFont.Width, sizeFont.Height);
+ sizeLabel.Height += sizeFont.Height / 8;
+ sizeLabel.Width += sizeLabel.Width / text.Length;
+ labelBackPosition = new RectangleF(
+ labelPosition.X - sizeLabel.Width / 2,
+ labelPosition.Y - sizeLabel.Height / 2 - sizeFont.Height / 10,
+ sizeLabel.Width,
+ sizeLabel.Height);
+
+ // Draw label text
+ using (Brush brush = new SolidBrush(point.LabelForeColor))
+ {
+ graph.DrawPointLabelStringRel(
+ common,
+ text,
+ point.Font,
+ brush,
+ labelPosition,
+ format,
+ textAngle,
+ labelBackPosition,
+ point.LabelBackColor,
+ point.LabelBorderColor,
+ point.LabelBorderWidth,
+ point.LabelBorderDashStyle,
+ series,
+ point,
+ pointIndex);
+ }
+ }
+ }
+
+ // Restore old clip region
+ graph.Clip = oldClipRegion;
+ }
+ }
+ #endregion
+
+ #region SmartLabelStyle methods
+
+ /// <summary>
+ /// Adds markers position to the list. Used to check SmartLabelStyle overlapping.
+ /// </summary>
+ /// <param name="common">Common chart elements.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="series">Series values to be used.</param>
+ /// <param name="list">List to add to.</param>
+ public void AddSmartLabelMarkerPositions(CommonElements common, ChartArea area, Series series, ArrayList list)
+ {
+ }
+
+ #endregion
+
+ #region IDisposable interface implementation
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected virtual void Dispose(bool disposing)
+ {
+ //Nothing to dispose at the base class.
+ }
+
+ /// <summary>
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// </summary>
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+ #endregion
+
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/StepLineChart.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/StepLineChart.cs
new file mode 100644
index 00000000000..c2a5caac6a1
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/StepLineChart.cs
@@ -0,0 +1,409 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: StepLineChart.cs
+//
+// Namespace: DataVisualization.Charting.ChartTypes
+//
+// Classes: StepLineChart
+//
+// Purpose: Step Line chart uses two line segments (horizontal
+// and vertical) to connect data points. Markers and
+// labels drawing code is inherited from the Line chart.
+//
+// Reviewed: AG - Aug 6, 2002
+// AG - Microsoft 7, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Resources;
+using System.Reflection;
+using System.Collections;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+ using System.Windows.Forms.DataVisualization.Charting;
+#else
+using System.Web.UI.DataVisualization.Charting;
+
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.ChartTypes
+#else
+ namespace System.Web.UI.DataVisualization.Charting.ChartTypes
+#endif
+{
+ /// <summary>
+ /// StepLine class extends its base class LineChart by changing how two
+ /// neighbouring data points are connected with a line. Step Line chart
+ /// uses two line segments (horizontal and vertical) to connect data
+ /// points. Markers and labels drawing code is inherited from the Line chart.
+ /// </summary>
+ internal class StepLineChart : LineChart
+ {
+ #region Constructor
+
+ /// <summary>
+ /// StepLineChart class constructor.
+ /// </summary>
+ public StepLineChart()
+ {
+ }
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ public override string Name { get{ return ChartTypeNames.StepLine;}}
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ override public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+
+ #endregion
+
+ #region Line drawing and selecting methods
+
+ /// <summary>
+ /// Draw chart line using horisontal and vertical lines.
+ /// </summary>
+ /// <param name="graph">Graphics object.</param>
+ /// <param name="common">The Common elements object</param>
+ /// <param name="point">Point to draw the line for.</param>
+ /// <param name="series">Point series.</param>
+ /// <param name="points">Array of points coordinates.</param>
+ /// <param name="pointIndex">Index of point to draw.</param>
+ /// <param name="tension">Line tension</param>
+ override protected void DrawLine(
+ ChartGraphics graph,
+ CommonElements common,
+ DataPoint point,
+ Series series,
+ PointF[] points,
+ int pointIndex,
+ float tension)
+ {
+ // Start drawing from the second point
+ if(pointIndex <= 0)
+ {
+ return;
+ }
+
+ // Darw two lines
+ PointF point1 = points[pointIndex - 1];
+ PointF point2 = new PointF(points[pointIndex].X, points[pointIndex - 1].Y);
+ PointF point3 = points[pointIndex];
+ graph.DrawLineRel( point.Color, point.BorderWidth, point.BorderDashStyle, graph.GetRelativePoint(point1), graph.GetRelativePoint(point2), series.ShadowColor, series.ShadowOffset );
+ graph.DrawLineRel( point.Color, point.BorderWidth, point.BorderDashStyle, graph.GetRelativePoint(point2), graph.GetRelativePoint(point3), series.ShadowColor, series.ShadowOffset );
+
+ if( common.ProcessModeRegions )
+ {
+ // Create grapics path object for the line
+ // Split line into 2 segments.
+ GraphicsPath path = new GraphicsPath();
+ try
+ {
+ path.AddLine(point2, point3);
+ if (!point2.Equals(point3))
+ {
+ path.Widen(new Pen(point.Color, point.BorderWidth + 2));
+ }
+ }
+ catch (OutOfMemoryException)
+ {
+ // GraphicsPath.Widen incorrectly throws OutOfMemoryException
+ // catching here and reacting by not widening
+ }
+ catch (ArgumentException)
+ {
+ }
+
+ // Allocate array of floats
+ PointF pointNew = PointF.Empty;
+ float[] coord = new float[path.PointCount * 2];
+ PointF[] pathPoints = path.PathPoints;
+ for( int i = 0; i < path.PointCount; i++ )
+ {
+ pointNew = graph.GetRelativePoint( pathPoints[i] );
+ coord[2*i] = pointNew.X;
+ coord[2*i + 1] = pointNew.Y;
+ }
+
+ common.HotRegionsList.AddHotRegion(
+ path,
+ false,
+ coord,
+ point,
+ series.Name,
+ pointIndex );
+ path.Dispose();
+ // Create grapics path object for the line
+ path = new GraphicsPath();
+ try
+ {
+ path.AddLine(point1, point2);
+ path.Widen(new Pen(point.Color, point.BorderWidth + 2));
+ }
+ catch (OutOfMemoryException)
+ {
+ // GraphicsPath.Widen incorrectly throws OutOfMemoryException
+ // catching here and reacting by not widening
+ }
+ catch (ArgumentException)
+ {
+ }
+
+ // Allocate array of floats
+ coord = new float[path.PointCount * 2];
+ pathPoints = path.PathPoints;
+ for( int i = 0; i < path.PointCount; i++ )
+ {
+ pointNew = graph.GetRelativePoint( pathPoints[i] );
+ coord[2*i] = pointNew.X;
+ coord[2*i + 1] = pointNew.Y;
+ }
+
+ common.HotRegionsList.AddHotRegion(
+ path,
+ false,
+ coord,
+ series.Points[pointIndex - 1],
+ series.Name,
+ pointIndex - 1);
+ path.Dispose();
+ }
+ }
+
+ #endregion
+
+ #region 3D Line drawing and selection
+
+ /// <summary>
+ /// Draws a 3D surface connecting the two specified points in 2D space.
+ /// Used to draw Line based charts.
+ /// </summary>
+ /// <param name="area">Chart area reference.</param>
+ /// <param name="graph">Chart graphics.</param>
+ /// <param name="matrix">Coordinates transformation matrix.</param>
+ /// <param name="lightStyle">LightStyle style (None, Simplistic, Realistic).</param>
+ /// <param name="prevDataPointEx">Previous data point object.</param>
+ /// <param name="positionZ">Z position of the back side of the 3D surface.</param>
+ /// <param name="depth">Depth of the 3D surface.</param>
+ /// <param name="points">Array of points.</param>
+ /// <param name="pointIndex">Index of point to draw.</param>
+ /// <param name="pointLoopIndex">Index of points loop.</param>
+ /// <param name="tension">Line tension.</param>
+ /// <param name="operationType">AxisName of operation Drawing, Calculating Path or Both</param>
+ /// <param name="topDarkening">Darkenning scale for top surface. 0 - None.</param>
+ /// <param name="bottomDarkening">Darkenning scale for bottom surface. 0 - None.</param>
+ /// <param name="thirdPointPosition">Position where the third point is actually located or float.NaN if same as in "firstPoint".</param>
+ /// <param name="fourthPointPosition">Position where the fourth point is actually located or float.NaN if same as in "secondPoint".</param>
+ /// <param name="clippedSegment">Indicates that drawn segment is 3D clipped. Only top/bottom should be drawn.</param>
+ /// <returns>Returns elemnt shape path if operationType parameter is set to CalcElementPath, otherwise Null.</returns>
+ protected override GraphicsPath Draw3DSurface(
+ ChartArea area,
+ ChartGraphics graph,
+ Matrix3D matrix,
+ LightStyle lightStyle,
+ DataPoint3D prevDataPointEx,
+ float positionZ,
+ float depth,
+ ArrayList points,
+ int pointIndex,
+ int pointLoopIndex,
+ float tension,
+ DrawingOperationTypes operationType,
+ float topDarkening,
+ float bottomDarkening,
+ PointF thirdPointPosition,
+ PointF fourthPointPosition,
+ bool clippedSegment)
+ {
+ // Create graphics path for selection
+ GraphicsPath resultPath = ((operationType & DrawingOperationTypes.CalcElementPath) == DrawingOperationTypes.CalcElementPath)
+ ? new GraphicsPath() : null;
+
+ // Check if points are drawn from sides to center (do only once)
+ if(centerPointIndex == int.MaxValue)
+ {
+ centerPointIndex = GetCenterPointIndex(points);
+ }
+
+ //************************************************************
+ //** Find line first & second points
+ //************************************************************
+ DataPoint3D secondPoint = (DataPoint3D)points[pointIndex];
+ int pointArrayIndex = pointIndex;
+ DataPoint3D firstPoint = ChartGraphics.FindPointByIndex(
+ points,
+ secondPoint.index - 1,
+ (this.multiSeries) ? secondPoint : null,
+ ref pointArrayIndex);
+
+ // Fint point with line properties
+ DataPoint3D pointAttr = secondPoint;
+ if(prevDataPointEx.dataPoint.IsEmpty)
+ {
+ pointAttr = prevDataPointEx;
+ }
+ else if(firstPoint.index > secondPoint.index)
+ {
+ pointAttr = firstPoint;
+ }
+
+ // Adjust point visual properties
+ Color color = (useBorderColor) ? pointAttr.dataPoint.BorderColor : pointAttr.dataPoint.Color;
+ ChartDashStyle dashStyle = pointAttr.dataPoint.BorderDashStyle;
+ if( pointAttr.dataPoint.IsEmpty && pointAttr.dataPoint.Color == Color.Empty)
+ {
+ color = Color.Gray;
+ }
+ if( pointAttr.dataPoint.IsEmpty && pointAttr.dataPoint.BorderDashStyle == ChartDashStyle.NotSet )
+ {
+ dashStyle = ChartDashStyle.Solid;
+ }
+
+ //************************************************************
+ //** Create "middle" point
+ //************************************************************
+ DataPoint3D middlePoint = new DataPoint3D();
+ middlePoint.xPosition = secondPoint.xPosition;
+ middlePoint.yPosition = firstPoint.yPosition;
+
+ // Check if reversed drawing order required
+ bool originalDrawOrder = true;
+ if((pointIndex + 1) < points.Count)
+ {
+ DataPoint3D p = (DataPoint3D)points[pointIndex + 1];
+ if(p.index == firstPoint.index)
+ {
+ originalDrawOrder = false;
+ }
+ }
+
+ // Check in which order vertical & horizontal lines segments should be drawn
+ if(centerPointIndex != int.MaxValue)
+ {
+ if(pointIndex >= centerPointIndex)
+ {
+ originalDrawOrder = false;
+ }
+ }
+
+ // Draw two segments of the step line
+ GraphicsPath resultPathLine1, resultPathLine2;
+ if(originalDrawOrder)
+ {
+ // Draw first line
+ middlePoint.dataPoint = secondPoint.dataPoint;
+ resultPathLine1 = graph.Draw3DSurface(
+ area, matrix, lightStyle, SurfaceNames.Top, positionZ, depth, color,
+ pointAttr.dataPoint.BorderColor, pointAttr.dataPoint.BorderWidth, dashStyle,
+ firstPoint, middlePoint,
+ points, pointIndex, 0f, operationType, LineSegmentType.First,
+ (this.showPointLines) ? true : false, false,
+ area.ReverseSeriesOrder,
+ this.multiSeries, 0, true);
+
+ // No second draw of the prev. front line required
+ graph.frontLinePen = null;
+
+ // Draw second line
+ middlePoint.dataPoint = firstPoint.dataPoint;
+ resultPathLine2 = graph.Draw3DSurface(
+ area, matrix, lightStyle, SurfaceNames.Top, positionZ, depth, color,
+ pointAttr.dataPoint.BorderColor, pointAttr.dataPoint.BorderWidth, dashStyle,
+ middlePoint, secondPoint,
+ points, pointIndex, 0f, operationType, LineSegmentType.Last,
+ (this.showPointLines) ? true : false, false,
+ area.ReverseSeriesOrder,
+ this.multiSeries, 0, true);
+
+ // No second draw of the prev. front line required
+ graph.frontLinePen = null;
+ }
+ else
+ {
+ // Draw second line
+ middlePoint.dataPoint = firstPoint.dataPoint;
+ resultPathLine2 = graph.Draw3DSurface(
+ area, matrix, lightStyle, SurfaceNames.Top, positionZ, depth, color,
+ pointAttr.dataPoint.BorderColor, pointAttr.dataPoint.BorderWidth, dashStyle,
+ middlePoint, secondPoint,
+ points, pointIndex, 0f, operationType, LineSegmentType.Last,
+ (this.showPointLines) ? true : false, false,
+ area.ReverseSeriesOrder,
+ this.multiSeries, 0, true);
+
+ // No second draw of the prev. front line required
+ graph.frontLinePen = null;
+
+ // Draw first line
+ middlePoint.dataPoint = secondPoint.dataPoint;
+ resultPathLine1 = graph.Draw3DSurface(
+ area, matrix, lightStyle, SurfaceNames.Top, positionZ, depth, color,
+ pointAttr.dataPoint.BorderColor, pointAttr.dataPoint.BorderWidth, dashStyle,
+ firstPoint, middlePoint,
+ points, pointIndex, 0f, operationType, LineSegmentType.First,
+ (this.showPointLines) ? true : false, false,
+ area.ReverseSeriesOrder,
+ this.multiSeries, 0, true);
+
+ // No second draw of the prev. front line required
+ graph.frontLinePen = null;
+ }
+
+ if(resultPath != null)
+ {
+ if( area.Common.ProcessModeRegions)
+ {
+ if(resultPathLine1 != null && resultPathLine1.PointCount > 0)
+ {
+ area.Common.HotRegionsList.AddHotRegion(
+ resultPathLine1,
+ false,
+ graph,
+ prevDataPointEx.dataPoint,
+ prevDataPointEx.dataPoint.series.Name,
+ prevDataPointEx.index - 1 );
+ }
+ }
+
+ if(resultPathLine2 != null && resultPathLine2.PointCount > 0)
+ {
+ resultPath.AddPath(resultPathLine2, true);
+ }
+ }
+ return resultPath;
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/StockChart.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/StockChart.cs
new file mode 100644
index 00000000000..ca1b33de85b
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/StockChart.cs
@@ -0,0 +1,1957 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: StockChart.cs
+//
+// Namespace: DataVisualization.Charting.ChartTypes
+//
+// Classes: StockChart, CandleStickChart
+//
+// Purpose: Stock chart requires 4 Y values High, Low, Open and Close.
+//
+// The Stock chart displays opening and closing values by using
+// markers, which are typically lines or triangles. “OpenCloseStyle”
+// custom attribute may be used to control the style of the markers.
+// The opening values are shown by the markers on the left, and the
+// closing values are shown by the markers on the right.
+//
+// A stock chart is typically used to illustrate significant stock
+// price points including a stock's open, close, high, and low price
+// points. However, this type of chart can also be used to analyze
+// scientific data, because each series of data displays a high, low,
+// open, and close value.
+//
+// Reviewed: AG - Aug 6, 2002
+// AG - Microsoft 7, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Collections;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Collections.Generic;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+#else
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.ChartTypes
+#else
+ namespace System.Web.UI.DataVisualization.Charting.ChartTypes
+#endif
+{
+ #region Open/close marks style enumeration
+
+ /// <summary>
+ /// Style of the Open-Close marks in the stock chart
+ /// </summary>
+ internal enum StockOpenCloseMarkStyle
+ {
+ /// <summary>
+ /// Line
+ /// </summary>
+ Line,
+
+ /// <summary>
+ /// Triangle
+ /// </summary>
+ Triangle,
+
+ /// <summary>
+ /// CandleStick. Color of the bar depends if Open value was bigger than Close value.
+ /// </summary>
+ Candlestick
+ }
+
+ #endregion
+
+ /// <summary>
+ /// CandleStick class provides chart unique name and changes the marking
+ /// style in the StockChart class to StockOpenCloseMarkStyle.CandleStick.
+ /// </summary>
+ internal class CandleStickChart : StockChart
+ {
+ #region Constructor
+
+ /// <summary>
+ /// CandleStick chart constructor.
+ /// </summary>
+ public CandleStickChart() : base(StockOpenCloseMarkStyle.Candlestick)
+ {
+ forceCandleStick = true;
+ }
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ override public string Name { get{ return ChartTypeNames.Candlestick;}}
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ override public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// StockChart class provides 2D/3D drawing and hit testing
+ /// functionality for the Stock and CandleStick charts.
+ /// </summary>
+ internal class StockChart : IChartType
+ {
+ #region Fields
+
+ /// <summary>
+ /// Vertical axis
+ /// </summary>
+ internal Axis VAxis { get; set; }
+
+ /// <summary>
+ /// Horizontal axis
+ /// </summary>
+ internal Axis HAxis { get; set; }
+
+ /// <summary>
+ /// Default open-close style
+ /// </summary>
+ protected StockOpenCloseMarkStyle openCloseStyle = StockOpenCloseMarkStyle.Line;
+
+ /// <summary>
+ /// Indicates that only candle-stick type of the open-close marks should be used
+ /// </summary>
+ protected bool forceCandleStick = false;
+
+ #endregion
+
+ #region Constructor
+
+ /// <summary>
+ /// Stock chart constructor.
+ /// </summary>
+ public StockChart()
+ {
+ }
+
+ /// <summary>
+ /// Stock chart constructor.
+ /// </summary>
+ /// <param name="style">Open-close marks default style.</param>
+ public StockChart(StockOpenCloseMarkStyle style)
+ {
+ this.openCloseStyle = style;
+ }
+
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ virtual public string Name { get{ return ChartTypeNames.Stock;}}
+
+ /// <summary>
+ /// True if chart type is stacked
+ /// </summary>
+ virtual public bool Stacked { get{ return false;}}
+
+
+ /// <summary>
+ /// True if stacked chart type supports groups
+ /// </summary>
+ virtual public bool SupportStackedGroups { get { return false; } }
+
+
+ /// <summary>
+ /// True if stacked chart type should draw separately positive and
+ /// negative data points ( Bar and column Stacked types ).
+ /// </summary>
+ public bool StackSign { get{ return false;}}
+
+ /// <summary>
+ /// True if chart type supports axeses
+ /// </summary>
+ virtual public bool RequireAxes { get{ return true;} }
+
+ /// <summary>
+ /// Chart type with two y values used for scale ( bubble chart type )
+ /// </summary>
+ public bool SecondYScale{ get{ return false;} }
+
+ /// <summary>
+ /// True if chart type requires circular chart area.
+ /// </summary>
+ public bool CircularChartArea { get{ return false;} }
+
+ /// <summary>
+ /// True if chart type supports Logarithmic axes
+ /// </summary>
+ virtual public bool SupportLogarithmicAxes { get{ return true;} }
+
+ /// <summary>
+ /// True if chart type requires to switch the value (Y) axes position
+ /// </summary>
+ virtual public bool SwitchValueAxes { get{ return false;} }
+
+ /// <summary>
+ /// True if chart series can be placed side-by-side.
+ /// </summary>
+ public bool SideBySideSeries { get{ return false;} }
+
+ /// <summary>
+ /// True if each data point of a chart must be represented in the legend
+ /// </summary>
+ virtual public bool DataPointsInLegend { get{ return false;} }
+
+ /// <summary>
+ /// If the crossing value is auto Crossing value should be
+ /// automatically set to zero for some chart
+ /// types (Bar, column, area etc.)
+ /// </summary>
+ virtual public bool ZeroCrossing { get{ return false;} }
+
+ /// <summary>
+ /// True if palette colors should be applied for each data paoint.
+ /// Otherwise the color is applied to the series.
+ /// </summary>
+ virtual public bool ApplyPaletteColorsToPoints { get { return false; } }
+
+ /// <summary>
+ /// Indicates that extra Y values are connected to the scale of the Y axis
+ /// </summary>
+ virtual public bool ExtraYValuesConnectedToYAxis{ get { return true; } }
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ virtual public bool HundredPercent{ get{return false;} }
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ virtual public bool HundredPercentSupportNegative{ get{return false;} }
+
+ /// <summary>
+ /// How to draw series/points in legend:
+ /// Filled rectangle, Line or Marker
+ /// </summary>
+ /// <param name="series">Legend item series.</param>
+ /// <returns>Legend item style.</returns>
+ virtual public LegendImageStyle GetLegendImageStyle(Series series)
+ {
+ return LegendImageStyle.Line;
+ }
+
+ /// <summary>
+ /// Number of supported Y value(s) per point
+ /// </summary>
+ virtual public int YValuesPerPoint { get { return 4; } }
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ virtual public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+ #endregion
+
+ #region Painting and Selection methods
+
+ /// <summary>
+ /// Paint stock chart.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ virtual public void Paint( ChartGraphics graph, CommonElements common, ChartArea area, Series seriesToDraw )
+ {
+ ProcessChartType( false, graph, common, area, seriesToDraw );
+ }
+
+ /// <summary>
+ /// This method recalculates size of the bars. This method is used
+ /// from Paint or Select method.
+ /// </summary>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ virtual protected void ProcessChartType(
+ bool selection,
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ Series seriesToDraw )
+ {
+
+ // Prosess 3D chart type
+ if(area.Area3DStyle.Enable3D)
+ {
+ ProcessChartType3D( selection, graph, common, area, seriesToDraw );
+ return;
+ }
+
+
+ // All data series from chart area which have Stock chart type
+ List<string> typeSeries = area.GetSeriesFromChartType(this.Name);
+
+ // Zero X values mode.
+ bool indexedSeries = ChartHelper.IndexedSeries(common, typeSeries.ToArray() );
+
+ //************************************************************
+ //** Loop through all series
+ //************************************************************
+ foreach( Series ser in common.DataManager.Series )
+ {
+ // Process non empty series of the area with stock chart type
+ if( String.Compare( ser.ChartTypeName, this.Name, StringComparison.OrdinalIgnoreCase ) != 0
+ || ser.ChartArea != area.Name || !ser.IsVisible())
+ {
+ continue;
+ }
+
+ // Check that we have at least 4 Y values
+ if(ser.YValuesPerPoint < 4)
+ {
+ throw(new ArgumentException(SR.ExceptionChartTypeRequiresYValues("StockChart", "4")));
+ }
+
+ // Set active horizontal/vertical axis
+ HAxis = area.GetAxis(AxisName.X, ser.XAxisType, ser.XSubAxisName);
+ VAxis = area.GetAxis(AxisName.Y, ser.YAxisType, ser.YSubAxisName);
+
+ // Get interval between points
+ double interval = (indexedSeries) ? 1 : area.GetPointsInterval( HAxis.IsLogarithmic, HAxis.logarithmBase );
+
+ // Calculates the width of the candles.
+ float width = (float)(ser.GetPointWidth(graph, HAxis, interval, 0.8));
+
+ // Call Back Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPrePaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+
+
+ //************************************************************
+ //** Series data points loop
+ //************************************************************
+ int index = 1;
+ foreach( DataPoint point in ser.Points )
+ {
+ // Reset pre-calculated point position
+ point.positionRel = new PointF(float.NaN, float.NaN);
+
+ // Get point X position
+ double xValue = point.XValue;
+ if( indexedSeries )
+ {
+ xValue = (double)index;
+ }
+ float xPosition = (float)HAxis.GetPosition( xValue );
+
+ double yValue0 = VAxis.GetLogValue( point.YValues[0] );
+ double yValue1 = VAxis.GetLogValue( point.YValues[1] );
+ xValue = HAxis.GetLogValue(xValue);
+
+ // Check if chart is completly out of the data scaleView
+ if(xValue < HAxis.ViewMinimum ||
+ xValue > HAxis.ViewMaximum ||
+ (yValue0 < VAxis.ViewMinimum && yValue1 < VAxis.ViewMinimum) ||
+ (yValue0 > VAxis.ViewMaximum && yValue1 > VAxis.ViewMaximum) )
+ {
+ ++index;
+ continue;
+ }
+
+ // Make sure High/Low values are in data scaleView range
+ double high = VAxis.GetLogValue( point.YValues[0] );
+ double low = VAxis.GetLogValue( point.YValues[1] );
+
+ if( high > VAxis.ViewMaximum )
+ {
+ high = VAxis.ViewMaximum;
+ }
+ if( high < VAxis.ViewMinimum )
+ {
+ high = VAxis.ViewMinimum;
+ }
+ high = (float)VAxis.GetLinearPosition(high);
+
+ if( low > VAxis.ViewMaximum )
+ {
+ low = VAxis.ViewMaximum;
+ }
+ if( low < VAxis.ViewMinimum )
+ {
+ low = VAxis.ViewMinimum;
+ }
+ low = VAxis.GetLinearPosition(low);
+
+ // Remeber pre-calculated point position
+ point.positionRel = new PointF((float)xPosition, (float)high);
+
+ if( common.ProcessModePaint )
+ {
+
+ // Check if chart is partialy in the data scaleView
+ bool clipRegionSet = false;
+ if(xValue == HAxis.ViewMinimum || xValue == HAxis.ViewMaximum )
+ {
+ // Set clipping region for line drawing
+ graph.SetClip( area.PlotAreaPosition.ToRectangleF() );
+ clipRegionSet = true;
+ }
+
+ // Start Svg Selection mode
+ graph.StartHotRegion( point );
+
+ // Draw Hi-Low line
+ graph.DrawLineRel(
+ point.Color,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ new PointF(xPosition, (float)high),
+ new PointF(xPosition, (float)low),
+ ser.ShadowColor,
+ ser.ShadowOffset );
+
+ // Draw Open-Close marks
+ DrawOpenCloseMarks(graph, area, ser, point, xPosition, width);
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+
+ // Reset Clip Region
+ if(clipRegionSet)
+ {
+ graph.ResetClip();
+ }
+ }
+
+ if( common.ProcessModeRegions )
+ {
+ // Calculate rect around the hi-lo line and open-close marks
+ RectangleF areaRect = RectangleF.Empty;
+ areaRect.X = xPosition - width / 2f;
+ areaRect.Y = (float)Math.Min(high, low);
+ areaRect.Width = width;
+ areaRect.Height = (float)Math.Max(high, low) - areaRect.Y;
+
+ common.HotRegionsList.AddHotRegion(
+ areaRect,
+ point,
+ ser.Name,
+ index - 1 );
+
+ }
+ ++index;
+ }
+
+ //************************************************************
+ //** Second series data points loop, when markers and labels
+ //** are drawn.
+ //************************************************************
+
+ int markerIndex = 0;
+ index = 1;
+ foreach( DataPoint point in ser.Points )
+ {
+ // Get point X position
+ double xValue = point.XValue;
+ if( indexedSeries )
+ {
+ xValue = (double)index;
+ }
+ float xPosition = (float)HAxis.GetPosition( xValue );
+
+ double yValue0 = VAxis.GetLogValue( point.YValues[0] );
+ double yValue1 = VAxis.GetLogValue( point.YValues[1] );
+ xValue = HAxis.GetLogValue(xValue);
+
+ // Check if chart is completly out of the data scaleView
+ if(xValue < HAxis.ViewMinimum ||
+ xValue > HAxis.ViewMaximum ||
+ (yValue0 < VAxis.ViewMinimum && yValue1 < VAxis.ViewMinimum) ||
+ (yValue0 > VAxis.ViewMaximum && yValue1 > VAxis.ViewMaximum) )
+ {
+ ++index;
+ continue;
+ }
+
+ // Make sure High/Low values are in data scaleView range
+ double high = VAxis.GetLogValue( point.YValues[0] );
+ double low = VAxis.GetLogValue( point.YValues[1] );
+
+ if( high > VAxis.ViewMaximum )
+ {
+ high = VAxis.ViewMaximum;
+ }
+ if( high < VAxis.ViewMinimum )
+ {
+ high = VAxis.ViewMinimum;
+ }
+ high = (float)VAxis.GetLinearPosition(high);
+
+ if( low > VAxis.ViewMaximum )
+ {
+ low = VAxis.ViewMaximum;
+ }
+ if( low < VAxis.ViewMinimum )
+ {
+ low = VAxis.ViewMinimum;
+ }
+ low = VAxis.GetLinearPosition(low);
+
+ // Draw marker
+ if(point.MarkerStyle != MarkerStyle.None || point.MarkerImage.Length > 0)
+ {
+ // Get marker size
+ SizeF markerSize = SizeF.Empty;
+ markerSize.Width = point.MarkerSize;
+ markerSize.Height = point.MarkerSize;
+ if (graph != null && graph.Graphics != null)
+ {
+ // Marker size is in pixels and we do the mapping for higher DPIs
+ markerSize.Width = point.MarkerSize * graph.Graphics.DpiX / 96;
+ markerSize.Height = point.MarkerSize * graph.Graphics.DpiY / 96;
+ }
+
+ if (point.MarkerImage.Length > 0)
+ common.ImageLoader.GetAdjustedImageSize(point.MarkerImage, graph.Graphics, ref markerSize);
+
+ // Get marker position
+ PointF markerPosition = PointF.Empty;
+ markerPosition.X = xPosition;
+ markerPosition.Y = (float)high - graph.GetRelativeSize(markerSize).Height/2f;
+
+ // Draw marker
+ if(markerIndex == 0)
+ {
+ // Draw the marker
+ graph.DrawMarkerRel(markerPosition,
+ point.MarkerStyle,
+ (int)markerSize.Height,
+ (point.MarkerColor == Color.Empty) ? point.Color : point.MarkerColor,
+ (point.MarkerBorderColor == Color.Empty) ? point.BorderColor : point.MarkerBorderColor,
+ point.MarkerBorderWidth,
+ point.MarkerImage,
+ point.MarkerImageTransparentColor,
+ (point.series != null) ? point.series.ShadowOffset : 0,
+ (point.series != null) ? point.series.ShadowColor : Color.Empty,
+ new RectangleF(markerPosition.X, markerPosition.Y, markerSize.Width, markerSize.Height));
+
+ if( common.ProcessModeRegions )
+ {
+ // Get relative marker size
+ SizeF relativeMarkerSize = graph.GetRelativeSize(markerSize);
+
+ // Insert area just after the last custom area
+ int insertIndex = common.HotRegionsList.FindInsertIndex();
+ common.HotRegionsList.FindInsertIndex();
+
+ // Insert circle area
+ if(point.MarkerStyle == MarkerStyle.Circle)
+ {
+ float[] circCoord = new float[3];
+ circCoord[0] = markerPosition.X;
+ circCoord[1] = markerPosition.Y;
+ circCoord[2] = relativeMarkerSize.Width/2f;
+
+ common.HotRegionsList.AddHotRegion(
+ insertIndex,
+ graph,
+ circCoord[0],
+ circCoord[1],
+ circCoord[2],
+ point,
+ ser.Name,
+ index - 1 );
+ }
+ // All other markers represented as rectangles
+ else
+ {
+ common.HotRegionsList.AddHotRegion(
+ new RectangleF(markerPosition.X - relativeMarkerSize.Width/2f, markerPosition.Y - relativeMarkerSize.Height/2f, relativeMarkerSize.Width, relativeMarkerSize.Height),
+ point,
+ ser.Name,
+ index - 1 );
+ }
+ }
+
+ }
+
+ // Increase the markers counter
+ ++markerIndex;
+ if(ser.MarkerStep == markerIndex)
+ {
+ markerIndex = 0;
+ }
+ }
+
+ // Draw label
+ DrawLabel(common, area, graph, ser, point, new PointF(xPosition, (float)Math.Min(high, low)), index);
+
+ // Increase point counter
+ ++index;
+ }
+
+ // Call Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPostPaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+ }
+ }
+
+ /// <summary>
+ /// Draws stock chart open-close marks depending on selected style.
+ /// </summary>
+ /// <param name="graph">Chart graphics object.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="ser">Data point series.</param>
+ /// <param name="point">Data point to draw.</param>
+ /// <param name="xPosition">X position.</param>
+ /// <param name="width">Point width.</param>
+ virtual protected void DrawOpenCloseMarks(
+ ChartGraphics graph,
+ ChartArea area,
+ Series ser,
+ DataPoint point,
+ float xPosition,
+ float width)
+ {
+ double openY = VAxis.GetLogValue( point.YValues[2] );
+ double closeY = VAxis.GetLogValue( point.YValues[3] );
+
+ // Check if mark is inside data scaleView
+ if( (openY > VAxis.ViewMaximum ||
+ openY < VAxis.ViewMinimum) &&
+ (closeY > VAxis.ViewMaximum ||
+ closeY < VAxis.ViewMinimum) )
+ {
+ //return;
+ }
+
+ // Calculate open-close position
+ float open = (float)VAxis.GetLinearPosition(openY);
+ float close = (float)VAxis.GetLinearPosition(closeY);
+ SizeF absSize = graph.GetAbsoluteSize(new SizeF(width, width));
+ float height = graph.GetRelativeSize(absSize).Height;
+
+ // Detect style
+ StockOpenCloseMarkStyle style = openCloseStyle;
+ string styleType = "";
+ if(point.IsCustomPropertySet(CustomPropertyName.OpenCloseStyle))
+ {
+ styleType = point[CustomPropertyName.OpenCloseStyle];
+ }
+ else if(ser.IsCustomPropertySet(CustomPropertyName.OpenCloseStyle))
+ {
+ styleType = ser[CustomPropertyName.OpenCloseStyle];
+ }
+
+ if(styleType != null && styleType.Length > 0)
+ {
+ if(String.Compare(styleType, "Candlestick", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ style = StockOpenCloseMarkStyle.Candlestick;
+ }
+ else if (String.Compare(styleType, "Triangle", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ style = StockOpenCloseMarkStyle.Triangle;
+ }
+ else if (String.Compare(styleType, "Line", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ style = StockOpenCloseMarkStyle.Line;
+ }
+ }
+
+ // Get attribute which controls if open/close marks are shown
+ bool showOpen = true;
+ bool showClose = true;
+ string showOpenClose = "";
+ if(point.IsCustomPropertySet(CustomPropertyName.ShowOpenClose))
+ {
+ showOpenClose = point[CustomPropertyName.ShowOpenClose];
+ }
+ else if(ser.IsCustomPropertySet(CustomPropertyName.ShowOpenClose))
+ {
+ showOpenClose = ser[CustomPropertyName.ShowOpenClose];
+ }
+
+ if(showOpenClose != null && showOpenClose.Length > 0)
+ {
+ if(String.Compare(showOpenClose, "Both", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ showOpen = true;
+ showClose = true;
+ }
+ else if (String.Compare(showOpenClose, "Open", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ showOpen = true;
+ showClose = false;
+ }
+ else if (String.Compare(showOpenClose, "Close", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ showOpen = false;
+ showClose = true;
+ }
+ }
+
+ // Check if chart is partialy in the data scaleView
+ bool clipRegionSet = false;
+ if( style == StockOpenCloseMarkStyle.Candlestick || (xPosition - width / 2f) < area.PlotAreaPosition.X || (xPosition + width / 2f) > area.PlotAreaPosition.Right)
+ {
+ // Set clipping region for line drawing
+ graph.SetClip( area.PlotAreaPosition.ToRectangleF() );
+ clipRegionSet = true;
+ }
+
+
+ // Draw open-close marks as bar
+ if(forceCandleStick || style == StockOpenCloseMarkStyle.Candlestick)
+ {
+ // Colors used to draw bar of the open-close style
+ ColorConverter colorConverter = new ColorConverter();
+ Color priceUpColor = point.Color;
+ Color priceDownColor = point.BackSecondaryColor;
+
+ // Check if special color properties are set
+ string attrValue = point[CustomPropertyName.PriceUpColor];
+ if(attrValue != null && attrValue.Length > 0)
+ {
+ bool failed = false;
+ try
+ {
+ priceUpColor = (Color)colorConverter.ConvertFromString(attrValue);
+ }
+ catch (ArgumentException)
+ {
+ failed = true;
+ }
+ catch (NotSupportedException)
+ {
+ failed = true;
+ }
+
+ if (failed)
+ {
+ priceUpColor = (Color)colorConverter.ConvertFromInvariantString(attrValue);
+ }
+ }
+
+ attrValue = point[CustomPropertyName.PriceDownColor];
+ if(attrValue != null && attrValue.Length > 0)
+ {
+ bool failed = false;
+ try
+ {
+ priceDownColor = (Color)colorConverter.ConvertFromString(attrValue);
+ }
+ catch (ArgumentException)
+ {
+ failed = true;
+ }
+ catch (NotSupportedException)
+ {
+ failed = true;
+ }
+
+ if (failed)
+ {
+ priceDownColor = (Color)colorConverter.ConvertFromInvariantString(attrValue);
+ }
+ }
+
+ // Calculate bar rectangle
+ RectangleF rect = RectangleF.Empty;
+ rect.Y = (float)Math.Min(open, close);
+ rect.X = xPosition - width / 2f;
+ rect.Height = (float)Math.Max(open, close) - rect.Y;
+ rect.Width = width;
+
+ // Bar and border color
+ Color barColor = (open > close) ? priceUpColor : priceDownColor;
+ Color barBorderColor = (point.BorderColor == Color.Empty) ? (barColor == Color.Empty) ? point.Color : barColor : point.BorderColor;
+
+ // Get absolute height
+ SizeF sizeOfHeight = new SizeF( rect.Height, rect.Height );
+ sizeOfHeight = graph.GetAbsoluteSize( sizeOfHeight );
+
+ // Draw open-close bar
+ if( sizeOfHeight.Height > 1 )
+ {
+ graph.FillRectangleRel(
+ rect,
+ barColor,
+ point.BackHatchStyle,
+ point.BackImage,
+ point.BackImageWrapMode,
+ point.BackImageTransparentColor,
+ point.BackImageAlignment,
+ point.BackGradientStyle,
+ point.BackSecondaryColor,
+ barBorderColor,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ ser.ShadowColor,
+ ser.ShadowOffset,
+ PenAlignment.Inset );
+ }
+ else
+ {
+ graph.DrawLineRel(barBorderColor, point.BorderWidth, point.BorderDashStyle,
+ new PointF(rect.X, rect.Y),
+ new PointF(rect.Right, rect.Y),
+ ser.ShadowColor, ser.ShadowOffset );
+ }
+ }
+
+ // Draw open-close marks as triangals
+ else if(style == StockOpenCloseMarkStyle.Triangle)
+ {
+ using (GraphicsPath path = new GraphicsPath())
+ {
+ PointF point1 = graph.GetAbsolutePoint(new PointF(xPosition, open));
+ PointF point2 = graph.GetAbsolutePoint(new PointF(xPosition - width / 2f, open + height / 2f));
+ PointF point3 = graph.GetAbsolutePoint(new PointF(xPosition - width / 2f, open - height / 2f));
+
+ using (Brush brush = new SolidBrush(point.Color))
+ {
+ // Draw Open mark line
+ if (showOpen)
+ {
+ if (openY <= VAxis.ViewMaximum && openY >= VAxis.ViewMinimum)
+ {
+ path.AddLine(point2, point1);
+ path.AddLine(point1, point3);
+ path.AddLine(point3, point3);
+ graph.FillPath(brush, path);
+ }
+ }
+
+ // Draw close mark line
+ if (showClose)
+ {
+ if (closeY <= VAxis.ViewMaximum && closeY >= VAxis.ViewMinimum)
+ {
+ path.Reset();
+ point1 = graph.GetAbsolutePoint(new PointF(xPosition, close));
+ point2 = graph.GetAbsolutePoint(new PointF(xPosition + width / 2f, close + height / 2f));
+ point3 = graph.GetAbsolutePoint(new PointF(xPosition + width / 2f, close - height / 2f));
+ path.AddLine(point2, point1);
+ path.AddLine(point1, point3);
+ path.AddLine(point3, point3);
+ graph.FillPath(brush, path);
+ }
+ }
+ }
+ }
+
+ }
+
+ // Draw ope-close marks as lines
+ else
+ {
+ // Draw Open mark line
+ if(showOpen)
+ {
+ if(openY <= VAxis.ViewMaximum && openY >= VAxis.ViewMinimum)
+ {
+ graph.DrawLineRel(point.Color, point.BorderWidth, point.BorderDashStyle,
+ new PointF(xPosition - width/2f, open),
+ new PointF(xPosition, open),
+ ser.ShadowColor, ser.ShadowOffset );
+ }
+ }
+
+ // Draw Close mark line
+ if(showClose)
+ {
+ if(closeY <= VAxis.ViewMaximum && closeY >= VAxis.ViewMinimum)
+ {
+ graph.DrawLineRel(point.Color, point.BorderWidth, point.BorderDashStyle,
+ new PointF(xPosition, close),
+ new PointF(xPosition + width/2f, close),
+ ser.ShadowColor, ser.ShadowOffset );
+ }
+ }
+ }
+
+ // Reset Clip Region
+ if(clipRegionSet)
+ {
+ graph.ResetClip();
+ }
+ }
+
+ /// <summary>
+ /// Draws stock chart data point label.
+ /// </summary>
+ /// <param name="common">The Common elements object</param>
+ /// <param name="area">Chart area for this chart</param>
+ /// <param name="graph">Chart graphics object.</param>
+ /// <param name="ser">Data point series.</param>
+ /// <param name="point">Data point to draw.</param>
+ /// <param name="position">Label position.</param>
+ /// <param name="pointIndex">Data point index in the series.</param>
+ virtual protected void DrawLabel(
+ CommonElements common,
+ ChartArea area,
+ ChartGraphics graph,
+ Series ser,
+ DataPoint point,
+ PointF position,
+ int pointIndex)
+ {
+ if(ser.IsValueShownAsLabel || point.IsValueShownAsLabel || point.Label.Length > 0)
+ {
+ // Label text format
+ using (StringFormat format = new StringFormat())
+ {
+ format.Alignment = StringAlignment.Near;
+ format.LineAlignment = StringAlignment.Center;
+ if (point.LabelAngle == 0)
+ {
+ format.Alignment = StringAlignment.Center;
+ format.LineAlignment = StringAlignment.Far;
+ }
+
+ // Get label text
+ string text;
+ if (point.Label.Length == 0)
+ {
+ // Check what value to show (High, Low, Open, Close)
+ int valueIndex = 3;
+ string valueType = "";
+ if (point.IsCustomPropertySet(CustomPropertyName.LabelValueType))
+ {
+ valueType = point[CustomPropertyName.LabelValueType];
+ }
+ else if (ser.IsCustomPropertySet(CustomPropertyName.LabelValueType))
+ {
+ valueType = ser[CustomPropertyName.LabelValueType];
+ }
+
+ if (String.Compare(valueType, "High", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ valueIndex = 0;
+ }
+ else if (String.Compare(valueType, "Low", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ valueIndex = 1;
+ }
+ else if (String.Compare(valueType, "Open", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ valueIndex = 2;
+ }
+
+ text = ValueConverter.FormatValue(
+ ser.Chart,
+ point,
+ point.Tag,
+ point.YValues[valueIndex],
+ point.LabelFormat,
+ ser.YValueType,
+ ChartElementType.DataPoint);
+ }
+ else
+ {
+ text = point.ReplaceKeywords(point.Label);
+ }
+
+ // Get text angle
+ int textAngle = point.LabelAngle;
+
+ // Check if text contains white space only
+ if (text.Trim().Length != 0)
+ {
+ SizeF sizeFont = SizeF.Empty;
+
+
+ // Check if Smart Labels are enabled
+ if (ser.SmartLabelStyle.Enabled)
+ {
+ // Get marker size
+ SizeF markerSize = SizeF.Empty;
+ markerSize.Width = point.MarkerSize;
+ markerSize.Height = point.MarkerSize;
+ if (graph != null && graph.Graphics != null)
+ {
+ // Marker size is in pixels and we do the mapping for higher DPIs
+ markerSize.Width = point.MarkerSize * graph.Graphics.DpiX / 96;
+ markerSize.Height = point.MarkerSize * graph.Graphics.DpiY / 96;
+ }
+
+ if (point.MarkerImage.Length > 0)
+ common.ImageLoader.GetAdjustedImageSize(point.MarkerImage, graph.Graphics, ref markerSize);
+
+ // Get point label style attribute
+ markerSize = graph.GetRelativeSize(markerSize);
+ sizeFont = graph.GetRelativeSize(graph.MeasureString(text, point.Font, new SizeF(1000f, 1000f), StringFormat.GenericTypographic));
+
+ // Adjust label position using SmartLabelStyle algorithm
+ position = area.smartLabels.AdjustSmartLabelPosition(
+ common,
+ graph,
+ area,
+ ser.SmartLabelStyle,
+ position,
+ sizeFont,
+ format,
+ position,
+ markerSize,
+ LabelAlignmentStyles.Top);
+
+ // Smart labels always use 0 degrees text angle
+ textAngle = 0;
+
+ }
+
+
+
+ // Draw label
+ if (!position.IsEmpty)
+ {
+ RectangleF labelBackPosition = RectangleF.Empty;
+
+ if (!point.LabelBackColor.IsEmpty ||
+ point.LabelBorderWidth > 0 ||
+ !point.LabelBorderColor.IsEmpty)
+ {
+ // Get text size
+ if (sizeFont.IsEmpty)
+ {
+ sizeFont = graph.GetRelativeSize(graph.MeasureString(text, point.Font, new SizeF(1000f, 1000f), StringFormat.GenericTypographic));
+ }
+
+ // Adjust label y coordinate
+ position.Y -= sizeFont.Height / 8;
+
+ // Get label background position
+ SizeF sizeLabel = new SizeF(sizeFont.Width, sizeFont.Height);
+ sizeLabel.Height += sizeFont.Height / 8;
+ sizeLabel.Width += sizeLabel.Width / text.Length;
+ labelBackPosition = PointChart.GetLabelPosition(
+ graph,
+ position,
+ sizeLabel,
+ format,
+ true);
+ }
+
+
+ // Draw label text
+ using (Brush brush = new SolidBrush(point.LabelForeColor))
+ {
+ graph.DrawPointLabelStringRel(
+ common,
+ text,
+ point.Font,
+ brush,
+ position,
+ format,
+ textAngle,
+ labelBackPosition,
+
+ point.LabelBackColor,
+ point.LabelBorderColor,
+ point.LabelBorderWidth,
+ point.LabelBorderDashStyle,
+ ser,
+ point,
+ pointIndex - 1);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ #endregion
+
+ #region 3D Drawing and Selection methods
+
+ /// <summary>
+ /// This method recalculates size of the bars. This method is used
+ /// from Paint or Select method.
+ /// </summary>
+ /// <param name="selection">If True selection mode is active, otherwise paint mode is active.</param>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ virtual protected void ProcessChartType3D(
+ bool selection,
+ ChartGraphics graph,
+ CommonElements common,
+ ChartArea area,
+ Series seriesToDraw )
+ {
+
+ // All data series from chart area which have Stock chart type
+ List<string> typeSeries = area.GetSeriesFromChartType(this.Name);
+
+ // Zero X values mode.
+ bool indexedSeries = ChartHelper.IndexedSeries(common, typeSeries.ToArray() );
+
+ //************************************************************
+ //** Loop through all series
+ //************************************************************
+ foreach( Series ser in common.DataManager.Series )
+ {
+ // Process non empty series of the area with stock chart type
+ if( String.Compare( ser.ChartTypeName, this.Name, StringComparison.OrdinalIgnoreCase ) != 0
+ || ser.ChartArea != area.Name || !ser.IsVisible())
+ {
+ continue;
+ }
+
+ // Check if drawn series is specified
+ if(seriesToDraw != null && seriesToDraw.Name != ser.Name)
+ {
+ continue;
+ }
+
+ // Check that we have at least 4 Y values
+ if(ser.YValuesPerPoint < 4)
+ {
+ throw(new ArgumentException(SR.ExceptionChartTypeRequiresYValues("StockChart", "4" )));
+ }
+
+ // Set active horizontal/vertical axis
+ HAxis = area.GetAxis(AxisName.X, ser.XAxisType, ser.XSubAxisName);
+ VAxis = area.GetAxis(AxisName.Y, ser.YAxisType, ser.YSubAxisName);
+
+ // Get interval between points
+ double interval = (indexedSeries) ? 1 : area.GetPointsInterval( HAxis.IsLogarithmic, HAxis.logarithmBase );
+
+ // Calculates the width of the candles.
+ float width = (float)(ser.GetPointWidth(graph, HAxis, interval, 0.8));
+
+ // Call Back Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPrePaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+
+ //************************************************************
+ //** Get series depth and Z position
+ //************************************************************
+ float seriesDepth, seriesZPosition;
+ area.GetSeriesZPositionAndDepth(ser, out seriesDepth, out seriesZPosition);
+
+ //************************************************************
+ //** Series data points loop
+ //************************************************************
+ int index = 1;
+ foreach( DataPoint point in ser.Points )
+ {
+ // Reset pre-calculated point position
+ point.positionRel = new PointF(float.NaN, float.NaN);
+
+ // Get point X position
+ double xValue = point.XValue;
+ if( indexedSeries )
+ {
+ xValue = (double)index;
+ }
+ float xPosition = (float)HAxis.GetPosition( xValue );
+
+ double yValue0 = VAxis.GetLogValue( point.YValues[0] );
+ double yValue1 = VAxis.GetLogValue( point.YValues[1] );
+ xValue = HAxis.GetLogValue(xValue);
+
+ // Check if chart is completly out of the data scaleView
+ if(xValue < HAxis.ViewMinimum ||
+ xValue > HAxis.ViewMaximum ||
+ (yValue0 < VAxis.ViewMinimum && yValue1 < VAxis.ViewMinimum) ||
+ (yValue0 > VAxis.ViewMaximum && yValue1 > VAxis.ViewMaximum) )
+ {
+ ++index;
+ continue;
+ }
+
+ // Check if chart is partialy in the data scaleView
+ bool clipRegionSet = false;
+ if(xValue == HAxis.ViewMinimum || xValue == HAxis.ViewMaximum )
+ {
+ // Set clipping region for line drawing
+ graph.SetClip( area.PlotAreaPosition.ToRectangleF() );
+ clipRegionSet = true;
+ }
+
+ // Make sure High/Low values are in data scaleView range
+ double high = VAxis.GetLogValue( point.YValues[0] );
+ double low = VAxis.GetLogValue( point.YValues[1] );
+
+ if( high > VAxis.ViewMaximum )
+ {
+ high = VAxis.ViewMaximum;
+ }
+ if( high < VAxis.ViewMinimum )
+ {
+ high = VAxis.ViewMinimum;
+ }
+ high = (float)VAxis.GetLinearPosition(high);
+
+ if( low > VAxis.ViewMaximum )
+ {
+ low = VAxis.ViewMaximum;
+ }
+ if( low < VAxis.ViewMinimum )
+ {
+ low = VAxis.ViewMinimum;
+ }
+ low = VAxis.GetLinearPosition(low);
+
+ // Remeber pre-calculated point position
+ point.positionRel = new PointF((float)xPosition, (float)high);
+
+ // 3D Transform coordinates
+ Point3D[] points = new Point3D[2];
+ points[0] = new Point3D(xPosition, (float)high, seriesZPosition+seriesDepth/2f);
+ points[1] = new Point3D(xPosition, (float)low, seriesZPosition+seriesDepth/2f);
+ area.matrix3D.TransformPoints(points);
+
+ // Start Svg Selection mode
+ graph.StartHotRegion( point );
+
+ // Draw Hi-Low line
+ graph.DrawLineRel(
+ point.Color,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ points[0].PointF,
+ points[1].PointF,
+ ser.ShadowColor,
+ ser.ShadowOffset );
+
+ // Draw Open-Close marks
+ DrawOpenCloseMarks3D(graph, area, ser, point, xPosition, width, seriesZPosition, seriesDepth);
+ xPosition = points[0].X;
+ high = points[0].Y;
+ low = points[1].Y;
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+
+ // Reset Clip Region
+ if(clipRegionSet)
+ {
+ graph.ResetClip();
+ }
+
+ if( common.ProcessModeRegions )
+ {
+ // Calculate rect around the hi-lo line and open-close marks
+ RectangleF areaRect = RectangleF.Empty;
+ areaRect.X = xPosition - width / 2f;
+ areaRect.Y = (float)Math.Min(high, low);
+ areaRect.Width = width;
+ areaRect.Height = (float)Math.Max(high, low) - areaRect.Y;
+
+ common.HotRegionsList.AddHotRegion(
+ areaRect,
+ point,
+ ser.Name,
+ index - 1 );
+
+ }
+
+ ++index;
+ }
+
+ //************************************************************
+ //** Second series data points loop, when markers and labels
+ //** are drawn.
+ //************************************************************
+ int markerIndex = 0;
+ index = 1;
+ foreach( DataPoint point in ser.Points )
+ {
+ // Get point X position
+ double xValue = point.XValue;
+ if( indexedSeries )
+ {
+ xValue = (double)index;
+ }
+ float xPosition = (float)HAxis.GetPosition( xValue );
+
+ double yValue0 = VAxis.GetLogValue( point.YValues[0] );
+ double yValue1 = VAxis.GetLogValue( point.YValues[1] );
+ xValue = HAxis.GetLogValue(xValue);
+
+ // Check if chart is completly out of the data scaleView
+ if(xValue < HAxis.ViewMinimum ||
+ xValue > HAxis.ViewMaximum ||
+ (yValue0 < VAxis.ViewMinimum && yValue1 < VAxis.ViewMinimum) ||
+ (yValue0 > VAxis.ViewMaximum && yValue1 > VAxis.ViewMaximum) )
+ {
+ ++index;
+ continue;
+ }
+
+ // Make sure High/Low values are in data scaleView range
+ double high = VAxis.GetLogValue( point.YValues[0] );
+ double low = VAxis.GetLogValue( point.YValues[1] );
+
+ if( high > VAxis.ViewMaximum )
+ {
+ high = VAxis.ViewMaximum;
+ }
+ if( high < VAxis.ViewMinimum )
+ {
+ high = VAxis.ViewMinimum;
+ }
+ high = (float)VAxis.GetLinearPosition(high);
+
+ if( low > VAxis.ViewMaximum )
+ {
+ low = VAxis.ViewMaximum;
+ }
+ if( low < VAxis.ViewMinimum )
+ {
+ low = VAxis.ViewMinimum;
+ }
+ low = VAxis.GetLinearPosition(low);
+
+
+ // 3D Transform coordinates
+ Point3D[] points = new Point3D[2];
+ points[0] = new Point3D(xPosition, (float)high, seriesZPosition+seriesDepth/2f);
+ points[1] = new Point3D(xPosition, (float)low, seriesZPosition+seriesDepth/2f);
+ area.matrix3D.TransformPoints(points);
+ xPosition = points[0].X;
+ high = points[0].Y;
+ low = points[1].Y;
+
+ // Draw label
+ DrawLabel(common, area, graph, ser, point, new PointF(xPosition, (float)Math.Min(high, low)), index);
+
+ // Draw marker
+ if(point.MarkerStyle != MarkerStyle.None || point.MarkerImage.Length > 0)
+ {
+ // Get marker size
+ SizeF markerSize = SizeF.Empty;
+ markerSize.Width = point.MarkerSize;
+ markerSize.Height = point.MarkerSize;
+ if (graph != null && graph.Graphics != null)
+ {
+ // Marker size is in pixels and we do the mapping for higher DPIs
+ markerSize.Width = point.MarkerSize * graph.Graphics.DpiX / 96;
+ markerSize.Height = point.MarkerSize * graph.Graphics.DpiY / 96;
+ }
+
+ if (point.MarkerImage.Length > 0)
+ common.ImageLoader.GetAdjustedImageSize(point.MarkerImage, graph.Graphics, ref markerSize);
+
+ // Get marker position
+ PointF markerPosition = PointF.Empty;
+ markerPosition.X = xPosition;
+ markerPosition.Y = (float)high - graph.GetRelativeSize(markerSize).Height/2f;
+
+ // Draw marker
+ if(markerIndex == 0)
+ {
+ // Draw the marker
+ graph.DrawMarkerRel(markerPosition,
+ point.MarkerStyle,
+ (int)markerSize.Height,
+ (point.MarkerColor == Color.Empty) ? point.Color : point.MarkerColor,
+ (point.MarkerBorderColor == Color.Empty) ? point.BorderColor : point.MarkerBorderColor,
+ point.MarkerBorderWidth,
+ point.MarkerImage,
+ point.MarkerImageTransparentColor,
+ (point.series != null) ? point.series.ShadowOffset : 0,
+ (point.series != null) ? point.series.ShadowColor : Color.Empty,
+ new RectangleF(markerPosition.X, markerPosition.Y, markerSize.Width, markerSize.Height));
+
+ if( common.ProcessModeRegions )
+ {
+ // Get relative marker size
+ SizeF relativeMarkerSize = graph.GetRelativeSize(markerSize);
+
+ // Insert area just after the last custom area
+ int insertIndex = common.HotRegionsList.FindInsertIndex();
+ common.HotRegionsList.FindInsertIndex();
+
+ // Insert circle area
+ if(point.MarkerStyle == MarkerStyle.Circle)
+ {
+ float[] circCoord = new float[3];
+ circCoord[0] = markerPosition.X;
+ circCoord[1] = markerPosition.Y;
+ circCoord[2] = relativeMarkerSize.Width/2f;
+
+ common.HotRegionsList.AddHotRegion(
+ insertIndex,
+ graph,
+ circCoord[0],
+ circCoord[1],
+ circCoord[2],
+ point,
+ ser.Name,
+ index - 1 );
+ }
+ // All other markers represented as rectangles
+ else
+ {
+ common.HotRegionsList.AddHotRegion(
+ new RectangleF(markerPosition.X - relativeMarkerSize.Width/2f, markerPosition.Y - relativeMarkerSize.Height/2f, relativeMarkerSize.Width, relativeMarkerSize.Height),
+ point,
+ ser.Name,
+ index - 1 );
+ }
+ }
+ }
+
+ // Increase the markers counter
+ ++markerIndex;
+ if(ser.MarkerStep == markerIndex)
+ {
+ markerIndex = 0;
+ }
+ }
+ ++index;
+ }
+
+ // Call Paint event
+ if( !selection )
+ {
+ common.Chart.CallOnPostPaint(new ChartPaintEventArgs(ser, graph, common, area.PlotAreaPosition));
+ }
+ }
+ }
+
+ /// <summary>
+ /// Draws stock chart open-close marks depending on selected style.
+ /// </summary>
+ /// <param name="graph">Chart graphics object.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="ser">Data point series.</param>
+ /// <param name="point">Data point to draw.</param>
+ /// <param name="xPosition">X position.</param>
+ /// <param name="width">Point width.</param>
+ /// <param name="zPosition">Series Z position.</param>
+ /// <param name="depth">Series depth.</param>
+ virtual protected void DrawOpenCloseMarks3D(
+ ChartGraphics graph,
+ ChartArea area,
+ Series ser,
+ DataPoint point,
+ float xPosition,
+ float width,
+ float zPosition,
+ float depth)
+ {
+ double openY = VAxis.GetLogValue( point.YValues[2] );
+ double closeY = VAxis.GetLogValue( point.YValues[3] );
+
+ // Check if mark is inside data scaleView
+ if( (openY > VAxis.ViewMaximum ||
+ openY < VAxis.ViewMinimum) &&
+ (closeY > VAxis.ViewMaximum ||
+ closeY < VAxis.ViewMinimum) )
+ {
+ //return;
+ }
+
+ // Calculate open-close position
+ float open = (float)VAxis.GetLinearPosition(openY);
+ float close = (float)VAxis.GetLinearPosition(closeY);
+ SizeF absSize = graph.GetAbsoluteSize(new SizeF(width, width));
+ float height = graph.GetRelativeSize(absSize).Height;
+
+ // Detect style
+ StockOpenCloseMarkStyle style = openCloseStyle;
+ string styleType = "";
+ if(point.IsCustomPropertySet(CustomPropertyName.OpenCloseStyle))
+ {
+ styleType = point[CustomPropertyName.OpenCloseStyle];
+ }
+ else if(ser.IsCustomPropertySet(CustomPropertyName.OpenCloseStyle))
+ {
+ styleType = ser[CustomPropertyName.OpenCloseStyle];
+ }
+
+ if(styleType != null && styleType.Length > 0)
+ {
+ if(String.Compare(styleType, "Candlestick", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ style = StockOpenCloseMarkStyle.Candlestick;
+ }
+ else if (String.Compare(styleType, "Triangle", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ style = StockOpenCloseMarkStyle.Triangle;
+ }
+ else if (String.Compare(styleType, "Line", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ style = StockOpenCloseMarkStyle.Line;
+ }
+ }
+
+ // Get attribute which controls if open/close marks are shown
+ bool showOpen = true;
+ bool showClose = true;
+ string showOpenClose = "";
+ if(point.IsCustomPropertySet(CustomPropertyName.ShowOpenClose))
+ {
+ showOpenClose = point[CustomPropertyName.ShowOpenClose];
+ }
+ else if(ser.IsCustomPropertySet(CustomPropertyName.ShowOpenClose))
+ {
+ showOpenClose = ser[CustomPropertyName.ShowOpenClose];
+ }
+
+ if(showOpenClose != null && showOpenClose.Length > 0)
+ {
+ if(String.Compare(showOpenClose, "Both", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ showOpen = true;
+ showClose = true;
+ }
+ else if (String.Compare(showOpenClose, "Open", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ showOpen = true;
+ showClose = false;
+ }
+ else if (String.Compare(showOpenClose, "Close", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ showOpen = false;
+ showClose = true;
+ }
+ }
+
+ // Check if chart is partialy in the data scaleView
+ bool clipRegionSet = false;
+ if((xPosition - width / 2f) < area.PlotAreaPosition.X || (xPosition + width / 2f) > area.PlotAreaPosition.Right)
+ {
+ // Set clipping region for line drawing
+ graph.SetClip( area.PlotAreaPosition.ToRectangleF() );
+ clipRegionSet = true;
+ }
+
+
+ // Draw open-close marks as bar
+ if(forceCandleStick || style == StockOpenCloseMarkStyle.Candlestick)
+ {
+ // Colors used to draw bar of the open-close style
+ ColorConverter colorConverter = new ColorConverter();
+ Color priceUpColor = point.Color;
+ Color priceDownColor = point.BackSecondaryColor;
+
+ // Check if special color properties are set
+ string attrValue = point[CustomPropertyName.PriceUpColor];
+ if(attrValue != null && attrValue.Length > 0)
+ {
+ bool failed = false;
+ try
+ {
+ priceUpColor = (Color)colorConverter.ConvertFromString(attrValue);
+ }
+ catch (NotSupportedException)
+ {
+ failed = true;
+ }
+ catch (ArgumentException)
+ {
+ failed = true;
+ }
+
+ if (failed)
+ {
+ priceUpColor = (Color)colorConverter.ConvertFromInvariantString(attrValue);
+ }
+ }
+
+ attrValue = point[CustomPropertyName.PriceDownColor];
+ if(attrValue != null && attrValue.Length > 0)
+ {
+ bool failed = false;
+ try
+ {
+ priceDownColor = (Color)colorConverter.ConvertFromString(attrValue);
+ }
+ catch (ArgumentException)
+ {
+ failed = true;
+ }
+ catch (NotSupportedException)
+ {
+ failed = true;
+ }
+
+ if (failed)
+ {
+ priceDownColor = (Color)colorConverter.ConvertFromInvariantString(attrValue);
+ }
+ }
+
+ // Calculate bar rectangle
+ RectangleF rect = RectangleF.Empty;
+ rect.Y = (float)Math.Min(open, close);
+ rect.X = xPosition - width / 2f;
+ rect.Height = (float)Math.Max(open, close) - rect.Y;
+ rect.Width = width;
+
+ // Bar and border color
+ Color barColor = (open > close) ? priceUpColor : priceDownColor;
+ Color barBorderColor = (point.BorderColor == Color.Empty) ? (barColor == Color.Empty) ? point.Color : barColor : point.BorderColor;
+
+ // Translate coordinates
+ Point3D[] points = new Point3D[2];
+ points[0] = new Point3D(rect.X, rect.Y, zPosition + depth/2f);
+ points[1] = new Point3D(rect.Right, rect.Bottom, zPosition + depth/2f);
+ area.matrix3D.TransformPoints(points);
+ rect.Location = points[0].PointF;
+ rect.Width = (float)Math.Abs(points[1].X - points[0].X);
+ rect.Height = (float)Math.Abs(points[1].Y - points[0].Y);
+
+ // Draw open-close bar
+ if(rect.Height > 1)
+ {
+ graph.FillRectangleRel(
+ rect,
+ barColor,
+ point.BackHatchStyle,
+ point.BackImage,
+ point.BackImageWrapMode,
+ point.BackImageTransparentColor,
+ point.BackImageAlignment,
+ point.BackGradientStyle,
+ point.BackSecondaryColor,
+ barBorderColor,
+ point.BorderWidth,
+ point.BorderDashStyle,
+ ser.ShadowColor,
+ ser.ShadowOffset,
+ PenAlignment.Inset);
+ }
+ else
+ {
+ graph.DrawLineRel(barBorderColor, point.BorderWidth, point.BorderDashStyle,
+ new PointF(rect.X, rect.Y),
+ new PointF(rect.Right, rect.Y),
+ ser.ShadowColor, ser.ShadowOffset );
+ }
+ }
+
+ // Draw open-close marks as triangals
+ else if(style == StockOpenCloseMarkStyle.Triangle)
+ {
+ using (GraphicsPath path = new GraphicsPath())
+ {
+
+ // Translate coordinates
+ Point3D[] points = new Point3D[3];
+ points[0] = new Point3D(xPosition, open, zPosition + depth / 2f);
+ points[1] = new Point3D(xPosition - width / 2f, open + height / 2f, zPosition + depth / 2f);
+ points[2] = new Point3D(xPosition - width / 2f, open - height / 2f, zPosition + depth / 2f);
+ area.matrix3D.TransformPoints(points);
+ points[0].PointF = graph.GetAbsolutePoint(points[0].PointF);
+ points[1].PointF = graph.GetAbsolutePoint(points[1].PointF);
+ points[2].PointF = graph.GetAbsolutePoint(points[2].PointF);
+
+ using (Brush brush = new SolidBrush(point.Color))
+ {
+ // Draw Open mark line
+ if (showOpen)
+ {
+ if (openY <= VAxis.ViewMaximum && openY >= VAxis.ViewMinimum)
+ {
+ path.AddLine(points[1].PointF, points[0].PointF);
+ path.AddLine(points[0].PointF, points[2].PointF);
+ path.AddLine(points[2].PointF, points[2].PointF);
+ graph.FillPath(brush, path);
+ }
+ }
+
+ // Draw close mark line
+ if (showClose)
+ {
+ if (closeY <= VAxis.ViewMaximum && closeY >= VAxis.ViewMinimum)
+ {
+ points[0] = new Point3D(xPosition, close, zPosition + depth / 2f);
+ points[1] = new Point3D(xPosition + width / 2f, close + height / 2f, zPosition + depth / 2f);
+ points[2] = new Point3D(xPosition + width / 2f, close - height / 2f, zPosition + depth / 2f);
+ area.matrix3D.TransformPoints(points);
+ points[0].PointF = graph.GetAbsolutePoint(points[0].PointF);
+ points[1].PointF = graph.GetAbsolutePoint(points[1].PointF);
+ points[2].PointF = graph.GetAbsolutePoint(points[2].PointF);
+
+ path.Reset();
+ path.AddLine(points[1].PointF, points[0].PointF);
+ path.AddLine(points[0].PointF, points[2].PointF);
+ path.AddLine(points[2].PointF, points[2].PointF);
+ graph.FillPath(brush, path);
+ }
+ }
+ }
+ }
+ }
+
+ // Draw ope-close marks as lines
+ else
+ {
+ // Draw Open mark line
+ if(showOpen)
+ {
+ if(openY <= VAxis.ViewMaximum && openY >= VAxis.ViewMinimum)
+ {
+ // Translate coordinates
+ Point3D[] points = new Point3D[2];
+ points[0] = new Point3D(xPosition - width/2f, open, zPosition + depth/2f);
+ points[1] = new Point3D(xPosition, open, zPosition + depth/2f);
+ area.matrix3D.TransformPoints(points);
+
+ graph.DrawLineRel(point.Color, point.BorderWidth, point.BorderDashStyle,
+ points[0].PointF,
+ points[1].PointF,
+ ser.ShadowColor, ser.ShadowOffset );
+ }
+ }
+
+ // Draw Close mark line
+ if(showClose)
+ {
+ if(closeY <= VAxis.ViewMaximum && closeY >= VAxis.ViewMinimum)
+ {
+ // Translate coordinates
+ Point3D[] points = new Point3D[2];
+ points[0] = new Point3D(xPosition, close, zPosition + depth/2f);
+ points[1] = new Point3D(xPosition + width/2f, close, zPosition + depth/2f);
+ area.matrix3D.TransformPoints(points);
+
+ graph.DrawLineRel(point.Color, point.BorderWidth, point.BorderDashStyle,
+ points[0].PointF,
+ points[1].PointF,
+ ser.ShadowColor, ser.ShadowOffset );
+ }
+ }
+ }
+
+ // Reset Clip Region
+ if(clipRegionSet)
+ {
+ graph.ResetClip();
+ }
+ }
+
+ #endregion
+
+ #region Y values related methods
+
+ /// <summary>
+ /// Helper function, which returns the Y value of the point.
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="area">Chart area the series belongs to.</param>
+ /// <param name="series">Sereis of the point.</param>
+ /// <param name="point">Point object.</param>
+ /// <param name="pointIndex">Index of the point.</param>
+ /// <param name="yValueIndex">Index of the Y value to get.</param>
+ /// <returns>Y value of the point.</returns>
+ virtual public double GetYValue(
+ CommonElements common,
+ ChartArea area,
+ Series series,
+ DataPoint point,
+ int pointIndex,
+ int yValueIndex)
+ {
+ return point.YValues[yValueIndex];
+ }
+
+ #endregion
+
+ #region SmartLabelStyle methods
+
+ /// <summary>
+ /// Adds markers position to the list. Used to check SmartLabelStyle overlapping.
+ /// </summary>
+ /// <param name="common">Common chart elements.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="series">Series values to be used.</param>
+ /// <param name="list">List to add to.</param>
+ public void AddSmartLabelMarkerPositions(CommonElements common, ChartArea area, Series series, ArrayList list)
+ {
+ // Check if series is indexed
+ bool indexedSeries = ChartHelper.IndexedSeries(common, area.GetSeriesFromChartType(this.Name).ToArray() );
+
+ //************************************************************
+ //** Set active horizontal/vertical axis
+ //************************************************************
+ Axis hAxis = area.GetAxis(AxisName.X, series.XAxisType, series.XSubAxisName);
+ Axis vAxis = area.GetAxis(AxisName.Y, series.YAxisType, series.YSubAxisName);
+
+ //************************************************************
+ //** Loop through all data points in the series
+ //************************************************************
+ int markerIndex = 0; // Marker index
+ int index = 1; // Data points loop
+ foreach( DataPoint point in series.Points )
+ {
+ //************************************************************
+ //** Check if point values are in the chart area
+ //************************************************************
+
+ // Check for min/max Y values
+ double yValue = GetYValue(common, area, series, point, index - 1, 0);
+
+ // Axis is Logarithmic
+ yValue = vAxis.GetLogValue( yValue );
+
+ if( yValue > vAxis.ViewMaximum || yValue < vAxis.ViewMinimum)
+ {
+ index++;
+ continue;
+ }
+
+ // Check for min/max X values
+ double xValue = (indexedSeries) ? (double)index : point.XValue;
+ xValue = hAxis.GetLogValue(xValue);
+ if(xValue > hAxis.ViewMaximum || xValue < hAxis.ViewMinimum)
+ {
+ index++;
+ continue;
+ }
+
+ //************************************************************
+ //** Get marker position and size
+ //************************************************************
+
+ // Get marker position
+ PointF markerPosition = PointF.Empty;
+ markerPosition.Y = (float)vAxis.GetLinearPosition(yValue);
+ if( indexedSeries )
+ {
+ // The formula for position is based on a distance
+ // from the grid line or nPoints position.
+ markerPosition.X = (float)hAxis.GetPosition( (double)index );
+ }
+ else
+ {
+ markerPosition.X = (float)hAxis.GetPosition( point.XValue );
+ }
+
+ // Get point some point properties and save them in variables
+ string pointMarkerImage = point.MarkerImage;
+ MarkerStyle pointMarkerStyle = point.MarkerStyle;
+
+ // Get marker size
+ SizeF markerSize = SizeF.Empty;
+ markerSize.Width = point.MarkerSize;
+ markerSize.Height = point.MarkerSize;
+ if (common != null && common.graph != null && common.graph.Graphics != null)
+ {
+ // Marker size is in pixels and we do the mapping for higher DPIs
+ markerSize.Width = point.MarkerSize * common.graph.Graphics.DpiX / 96;
+ markerSize.Height = point.MarkerSize * common.graph.Graphics.DpiY / 96;
+ }
+
+ if (point.MarkerImage.Length > 0)
+ if(common.graph != null)
+ common.ImageLoader.GetAdjustedImageSize(point.MarkerImage, common.graph.Graphics, ref markerSize);
+
+ // Transform marker position in 3D space
+ if(area.Area3DStyle.Enable3D)
+ {
+ // Get series depth and Z position
+ float seriesDepth, seriesZPosition;
+ area.GetSeriesZPositionAndDepth(series, out seriesDepth, out seriesZPosition);
+
+ Point3D[] marker3DPosition = new Point3D[1];
+ marker3DPosition[0] = new Point3D(
+ markerPosition.X,
+ markerPosition.Y,
+ (float)(seriesZPosition + seriesDepth/2f));
+
+ // Transform coordinates
+ area.matrix3D.TransformPoints(marker3DPosition);
+ markerPosition = marker3DPosition[0].PointF;
+ }
+
+ // Check if marker visible
+ if(pointMarkerStyle != MarkerStyle.None ||
+ pointMarkerImage.Length > 0)
+ {
+ // Check marker index
+ if(markerIndex == 0)
+ {
+ markerSize = common.graph.GetRelativeSize(markerSize);
+
+ // Add marker position into the list
+ RectangleF markerRect = new RectangleF(
+ markerPosition.X - markerSize.Width / 2f,
+ markerPosition.Y - markerSize.Height,
+ markerSize.Width,
+ markerSize.Height);
+ list.Add(markerRect);
+ }
+
+ // Increase the markers counter
+ ++markerIndex;
+ if(series.MarkerStep == markerIndex)
+ {
+ markerIndex = 0;
+ }
+ }
+
+ ++index;
+ }
+ }
+
+ #endregion
+
+ #region IDisposable interface implementation
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected virtual void Dispose(bool disposing)
+ {
+ //Nothing to dispose at the base class.
+ }
+
+ /// <summary>
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// </summary>
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/ThreeLineBreakChart.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/ThreeLineBreakChart.cs
new file mode 100644
index 00000000000..5b0b74e0994
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/ChartTypes/ThreeLineBreakChart.cs
@@ -0,0 +1,716 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: ThreeLineBreakChart.cs
+//
+// Namespace: DataVisualization.Charting.ChartTypes
+//
+// Purpose: ThreeLineBreak chart type provides methods for
+// calculations and depends on the Range Column chart
+// type to do all the drawing. PrepareData method is
+// used to create temporary RangeColumn series and fill
+// it with data. Changes are then reversed in the
+// UnPrepareData method.
+//
+// ThreeLineBreak Chart Overview:
+// ------------------------------
+//
+// The Three Line Break chart is popular in Japan for financial
+// charting. These charts display a series of vertical boxes ("lines")
+// that reflect changes in price values. Similar to Kagi, Renko, and
+// Point & Figure charts, the Three Line Break chart ignores the
+// passage of time.
+//
+// The Three Line Break charting method is so-named because of the
+// number of lines typically used. Each line may indicate "Buy",
+// "Sell", and "trend less" markets. An advantage of Three Line Break
+// charts is that there is no arbitrary fixed reversal amount. It is
+// the price action which gives the indication of a reversal. The
+// disadvantage of Three Line Break charts is that the signals are
+// generated after the new trend is well under way. However, many
+// traders are willing to accept the late signals in exchange for
+// calling major trends.
+//
+// The sensitivity of the reversal criteria can be set by changing
+// the number of lines in the break. For example, short-term traders
+// might use two-line breaks to get more reversals, while a
+// longer-term investor might use four-line, or even 10-line breaks
+// to reduce the number of reversals. This is done using the
+// NumberOfLinesInBreak custom attribute.
+//
+// The following should be taken into account when working with
+// Three Line Break charts:
+//
+// - The X values of data points are automatically indexed.
+//
+// - There is a formula applied to the original data before that data
+// gets plotted. This formula changes the number of points in the data,
+// and also changes the data points' X/Y values.
+//
+// - Due to data being recalculated, we do not recommend setting the
+// minimum and/or maximum values for the X axis. This is because it
+// cannot be determined how many data points will actually be plotted.
+// However, if the axis' Maximum, or Minimum is set, then the Maximum,
+// or Minimum properties should use data point index values.
+//
+// - Data point anchoring, used for annotations, is not supported in
+// this type of chart.
+//
+// Reviewed: AG - Microsoft 7, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Resources;
+using System.Reflection;
+using System.Collections;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.ComponentModel.Design;
+using System.Globalization;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+#else
+using System.Web.UI.DataVisualization.Charting;
+
+using System.Web.UI.DataVisualization.Charting.ChartTypes;
+using System.Web.UI.DataVisualization.Charting.Data;
+using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.ChartTypes
+#else
+namespace System.Web.UI.DataVisualization.Charting.ChartTypes
+#endif
+{
+ /// <summary>
+ /// ThreeLineBreakChart class provides methods to perform all nessesary
+ /// calculations to display ThreeLineBreak chart with the help of the
+ /// temporary RangeColumn series. This series is created in the
+ /// PrepareData method and then removed in the UnPrepareData method.
+ /// </summary>
+ internal class ThreeLineBreakChart : IChartType
+ {
+ #region Methods
+
+ /// <summary>
+ /// Prepares ThreeLineBreak chart type for rendering.
+ /// </summary>
+ /// <param name="series">Series to be prepared.</param>
+ internal static void PrepareData(Series series)
+ {
+ // Check series chart type
+ if(String.Compare(series.ChartTypeName, ChartTypeNames.ThreeLineBreak, StringComparison.OrdinalIgnoreCase ) != 0 || !series.IsVisible())
+ {
+ return;
+ }
+
+ // Get reference to the chart control
+ Chart chart = series.Chart;
+ if(chart == null)
+ {
+ throw (new InvalidOperationException(SR.ExceptionThreeLineBreakNullReference));
+ }
+
+ // ThreeLineBreak chart may not be combined with any other chart types
+ ChartArea area = chart.ChartAreas[series.ChartArea];
+ foreach (Series currentSeries in chart.Series)
+ {
+ if (currentSeries.IsVisible() && currentSeries != series && area == chart.ChartAreas[currentSeries.ChartArea])
+ {
+ throw (new InvalidOperationException(SR.ExceptionThreeLineBreakCanNotCobine));
+ }
+ }
+
+ // Create a temp series which will hold original series data points
+ Series seriesOriginalData = new Series("THREELINEBREAK_ORIGINAL_DATA_" + series.Name, series.YValuesPerPoint);
+ seriesOriginalData.Enabled = false;
+ seriesOriginalData.IsVisibleInLegend = false;
+ chart.Series.Add(seriesOriginalData);
+ foreach(DataPoint dp in series.Points)
+ {
+ seriesOriginalData.Points.Add(dp);
+ }
+ series.Points.Clear();
+ if(series.IsCustomPropertySet("TempDesignData"))
+ {
+ seriesOriginalData["TempDesignData"] = "true";
+ }
+
+
+ // Change ThreeLineBreak series type to range column
+ series["OldXValueIndexed"] = series.IsXValueIndexed.ToString(CultureInfo.InvariantCulture);
+ series["OldYValuesPerPoint"] = series.YValuesPerPoint.ToString(CultureInfo.InvariantCulture);
+ series.ChartType = SeriesChartType.RangeColumn;
+ series.IsXValueIndexed = true;
+ series.YValuesPerPoint = 2;
+
+ // Calculate date-time interval for indexed series
+ if(series.ChartArea.Length > 0 &&
+ series.IsXValueDateTime())
+ {
+ // Get X axis connected to the series
+ Axis xAxis = area.GetAxis(AxisName.X, series.XAxisType, series.XSubAxisName);
+
+ // Change interval for auto-calculated interval only
+ if(xAxis.Interval == 0 && xAxis.IntervalType == DateTimeIntervalType.Auto)
+ {
+ // Check if original data has X values set to date-time values and
+ // calculate min/max X values.
+ bool nonZeroXValues = false;
+ double minX = double.MaxValue;
+ double maxX = double.MinValue;
+ foreach(DataPoint dp in seriesOriginalData.Points)
+ {
+ if(!dp.IsEmpty)
+ {
+ if(dp.XValue != 0.0)
+ {
+ nonZeroXValues = true;
+ }
+ if(dp.XValue > maxX)
+ {
+ maxX = dp.XValue;
+ }
+ if(dp.XValue < minX)
+ {
+ minX = dp.XValue;
+ }
+ }
+ }
+
+ if(nonZeroXValues)
+ {
+ // Save flag that axis interval is automatic
+ series["OldAutomaticXAxisInterval"] = "true";
+
+ // Calculate and set axis date-time interval
+ DateTimeIntervalType intervalType = DateTimeIntervalType.Auto;
+ xAxis.interval = xAxis.CalcInterval(minX, maxX, true, out intervalType, series.XValueType);
+ xAxis.intervalType = intervalType;
+ }
+ }
+ }
+
+ // Calculate ThreeLineBreak bricks data points values
+ FillThreeLineBreakData(series, seriesOriginalData);
+ }
+
+ /// <summary>
+ /// Remove any changes done while preparing ThreeLineBreak chart type for rendering.
+ /// </summary>
+ /// <param name="series">Series to be un-prepared.</param>
+ /// <returns>True if series was removed from collection.</returns>
+ internal static bool UnPrepareData(Series series)
+ {
+ if (series.Name.StartsWith("THREELINEBREAK_ORIGINAL_DATA_", StringComparison.Ordinal))
+ {
+ // Get reference to the chart control
+ Chart chart = series.Chart;
+ if (chart == null)
+ {
+ throw (new InvalidOperationException(SR.ExceptionThreeLineBreakNullReference));
+ }
+
+ // Get original ThreeLineBreak series
+ Series threeLineBreakSeries = chart.Series[series.Name.Substring(29)];
+ Series.MovePositionMarkers(threeLineBreakSeries, series);
+ // Copy data back to original ThreeLineBreak series
+ threeLineBreakSeries.Points.Clear();
+ if (!series.IsCustomPropertySet("TempDesignData"))
+ {
+ foreach (DataPoint dp in series.Points)
+ {
+ threeLineBreakSeries.Points.Add(dp);
+ }
+ }
+
+ // Restore ThreeLineBreak series properties
+ threeLineBreakSeries.ChartType = SeriesChartType.ThreeLineBreak;
+
+ bool xValIndexed;
+ bool parseSucceed = bool.TryParse(threeLineBreakSeries["OldXValueIndexed"], out xValIndexed);
+ threeLineBreakSeries.IsXValueIndexed = parseSucceed && xValIndexed;
+
+ int yValsPerPoint;
+ parseSucceed = int.TryParse(threeLineBreakSeries["OldYValuesPerPoint"], NumberStyles.Any, CultureInfo.InvariantCulture, out yValsPerPoint);
+
+ if (parseSucceed)
+ {
+ threeLineBreakSeries.YValuesPerPoint = yValsPerPoint;
+ }
+
+
+ threeLineBreakSeries.DeleteCustomProperty("OldXValueIndexed");
+ threeLineBreakSeries.DeleteCustomProperty("OldYValuesPerPoint");
+
+ series["OldAutomaticXAxisInterval"] = "true";
+ if (threeLineBreakSeries.IsCustomPropertySet("OldAutomaticXAxisInterval"))
+ {
+ threeLineBreakSeries.DeleteCustomProperty("OldAutomaticXAxisInterval");
+
+ // Reset automatic interval for X axis
+ if (threeLineBreakSeries.ChartArea.Length > 0)
+ {
+ // Get X axis connected to the series
+ ChartArea area = chart.ChartAreas[threeLineBreakSeries.ChartArea];
+ Axis xAxis = area.GetAxis(AxisName.X, threeLineBreakSeries.XAxisType, threeLineBreakSeries.XSubAxisName);
+
+ xAxis.interval = 0.0;
+ xAxis.intervalType = DateTimeIntervalType.Auto;
+ }
+ }
+
+ // Remove series from the collection
+ chart.Series.Remove(series);
+ return true;
+ }
+
+ return false;
+ }
+
+ /// <summary>
+ /// Fills range column series with data to draw the ThreeLineBreak chart.
+ /// </summary>
+ /// <param name="series">Range column chart series used to dispaly the ThreeLineBreak chart.</param>
+ /// <param name="originalData">Series with original data.</param>
+ private static void FillThreeLineBreakData(Series series, Series originalData)
+ {
+ // Get index of the Y values used
+ int yValueIndex = 0;
+ if(series.IsCustomPropertySet(CustomPropertyName.UsedYValue))
+ {
+ try
+ {
+ yValueIndex = int.Parse(series[CustomPropertyName.UsedYValue], CultureInfo.InvariantCulture);
+ }
+ catch
+ {
+ throw (new InvalidOperationException(SR.ExceptionThreeLineBreakUsedYValueInvalid));
+ }
+
+ if(yValueIndex >= series.YValuesPerPoint)
+ {
+ throw (new InvalidOperationException(SR.ExceptionThreeLineBreakUsedYValueOutOfRange));
+ }
+ }
+
+ // Get number of lines in the break
+ int linesInBreak = 3;
+ if(series.IsCustomPropertySet(CustomPropertyName.NumberOfLinesInBreak))
+ {
+ try
+ {
+ linesInBreak = int.Parse(series[CustomPropertyName.NumberOfLinesInBreak], CultureInfo.InvariantCulture);
+ }
+ catch
+ {
+ throw (new InvalidOperationException(SR.ExceptionThreeLineBreakNumberOfLinesInBreakFormatInvalid));
+ }
+
+ if(linesInBreak <= 0)
+ {
+ throw (new InvalidOperationException(SR.ExceptionThreeLineBreakNumberOfLinesInBreakValueInvalid));
+ }
+ }
+
+ // Create an array to store the history of high/low values of drawn lines
+ ArrayList highLowHistory = new ArrayList();
+
+ // Fill points
+ double prevLow = double.NaN;
+ double prevHigh = double.NaN;
+ int sameDirectionLines = 0;
+ int prevDirection = 0;
+ int pointIndex = 0;
+ foreach(DataPoint dataPoint in originalData.Points)
+ {
+ int direction = 0; // 1 up; -1 down
+
+ // Skip empty points
+ if(dataPoint.IsEmpty)
+ {
+ ++pointIndex;
+ continue;
+ }
+
+ // Check if previus values exists
+ if(double.IsNaN(prevLow) || double.IsNaN(prevHigh))
+ {
+ prevHigh = dataPoint.YValues[yValueIndex];
+ prevLow = dataPoint.YValues[yValueIndex];
+ ++pointIndex;
+ continue;
+ }
+
+ // Get up price color
+ Color priceUpColor = Color.Transparent;
+ string priceUpColorString = dataPoint[CustomPropertyName.PriceUpColor];
+ if(priceUpColorString == null)
+ {
+ priceUpColorString = series[CustomPropertyName.PriceUpColor];
+ }
+ if(priceUpColorString != null)
+ {
+ try
+ {
+ ColorConverter colorConverter = new ColorConverter();
+ priceUpColor = (Color)colorConverter.ConvertFromString(null, CultureInfo.InvariantCulture, priceUpColorString);
+ }
+ catch
+ {
+ throw (new InvalidOperationException(SR.ExceptionThreeLineBreakUpBrickColorInvalid));
+ }
+ }
+
+ // Check if close value exceeds last brick position by box size
+ if(dataPoint.YValues[yValueIndex] > prevHigh)
+ {
+ direction = 1;
+ }
+ else if(dataPoint.YValues[yValueIndex] < prevLow)
+ {
+ direction = -1;
+ }
+ else
+ {
+ direction = 0;
+ }
+
+ // Process up/down direction
+ if(direction != 0)
+ {
+ // Check if direction is same as previous
+ if(prevDirection == direction)
+ {
+ ++sameDirectionLines;
+ }
+ else
+ {
+ // If number of lines darwn in same direction is more or equal
+ // to number of lines in the break, the price must extend the
+ // high or low price of the lines in the whole break.
+ if(sameDirectionLines >= linesInBreak)
+ {
+ if(direction == 1)
+ {
+ // Calculate high value for the last N lines
+ double lineBreakHigh = double.MinValue;
+ for(int index = 0; index < highLowHistory.Count; index += 2)
+ {
+ if(((double)highLowHistory[index]) > lineBreakHigh)
+ {
+ lineBreakHigh = ((double)highLowHistory[index]);
+ }
+ }
+
+ // If point value is less - ignore it
+ if(dataPoint.YValues[yValueIndex] <= lineBreakHigh)
+ {
+ direction = 0;
+ }
+ }
+ else if(direction == -1)
+ {
+ // Calculate low value for the last N lines
+ double lineBreakLow = double.MaxValue;
+ for(int index = 1; index < highLowHistory.Count; index += 2)
+ {
+ if(((double)highLowHistory[index]) < lineBreakLow)
+ {
+ lineBreakLow = ((double)highLowHistory[index]);
+ }
+ }
+
+ // If point value is more - ignore it
+ if(dataPoint.YValues[yValueIndex] >= lineBreakLow)
+ {
+ direction = 0;
+ }
+ }
+ }
+
+ if(direction != 0)
+ {
+ sameDirectionLines = 1;
+ }
+ }
+
+ if(direction != 0)
+ {
+ // Add point
+ DataPoint newDataPoint = (DataPoint)dataPoint.Clone();
+ newDataPoint["OriginalPointIndex"] = pointIndex.ToString(CultureInfo.InvariantCulture);
+ newDataPoint.series = series;
+ newDataPoint.YValues = new double[2];
+ newDataPoint.XValue = dataPoint.XValue;
+ newDataPoint.Tag = dataPoint;
+ if(direction == 1)
+ {
+ newDataPoint.YValues[1] = prevHigh;
+ newDataPoint.YValues[0] = dataPoint.YValues[yValueIndex];
+ prevLow = prevHigh;
+ prevHigh = dataPoint.YValues[yValueIndex];
+
+ // Set ThreeLineBreak up brick appearance
+ newDataPoint.Color = priceUpColor;
+ if(newDataPoint.BorderWidth < 1)
+ {
+ newDataPoint.BorderWidth = 1;
+ }
+ if(newDataPoint.BorderDashStyle == ChartDashStyle.NotSet)
+ {
+ newDataPoint.BorderDashStyle = ChartDashStyle.Solid;
+ }
+ if( (newDataPoint.BorderColor == Color.Empty || newDataPoint.BorderColor == Color.Transparent) &&
+ (newDataPoint.Color == Color.Empty || newDataPoint.Color == Color.Transparent) )
+ {
+ newDataPoint.BorderColor = series.Color;
+ }
+ }
+ else
+ {
+ newDataPoint.YValues[1] = prevLow;
+ newDataPoint.YValues[0] = dataPoint.YValues[yValueIndex];
+ prevHigh = prevLow;
+ prevLow = dataPoint.YValues[yValueIndex];
+ }
+
+ // Add ThreeLineBreak brick to the range column series
+ series.Points.Add(newDataPoint);
+
+ // Remember high/low values of drawn line
+ highLowHistory.Add(prevHigh);
+ highLowHistory.Add(prevLow);
+
+ // Do not store all values in array only number of break lines
+ if(highLowHistory.Count > linesInBreak * 2)
+ {
+ // Remove two items at a time (high & low)
+ highLowHistory.RemoveAt(0);
+ highLowHistory.RemoveAt(0);
+ }
+ }
+ }
+
+ // Remember last direction
+ if(direction != 0)
+ {
+ prevDirection = direction;
+ }
+
+ ++pointIndex;
+ }
+ }
+
+ #endregion // Methods
+
+ #region Painting and Selection methods
+
+ /// <summary>
+ /// Paint chart.
+ /// </summary>
+ /// <param name="graph">The Chart Graphics object.</param>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="area">Chart area for this chart.</param>
+ /// <param name="seriesToDraw">Chart series to draw.</param>
+ virtual public void Paint( ChartGraphics graph, CommonElements common, ChartArea area, Series seriesToDraw )
+ {
+ // Three Line Break series is never drawn directly. It is replaced with the range column chart.
+ // See PrepareData method.
+ }
+ #endregion
+
+ #region IChartType interface implementation
+
+ /// <summary>
+ /// Chart type name
+ /// </summary>
+ virtual public string Name { get{ return ChartTypeNames.ThreeLineBreak;}}
+
+ /// <summary>
+ /// True if chart type is stacked
+ /// </summary>
+ virtual public bool Stacked { get{ return false;}}
+
+
+ /// <summary>
+ /// True if stacked chart type supports groups
+ /// </summary>
+ virtual public bool SupportStackedGroups { get { return false; } }
+
+
+ /// <summary>
+ /// True if stacked chart type should draw separately positive and
+ /// negative data points ( Bar and column Stacked types ).
+ /// </summary>
+ public bool StackSign { get{ return false;}}
+
+ /// <summary>
+ /// True if chart type supports axeses
+ /// </summary>
+ virtual public bool RequireAxes { get{ return true;} }
+
+ /// <summary>
+ /// Chart type with two y values used for scale ( bubble chart type )
+ /// </summary>
+ public bool SecondYScale{ get{ return false;} }
+
+ /// <summary>
+ /// True if chart type requires circular chart area.
+ /// </summary>
+ public bool CircularChartArea { get{ return false;} }
+
+ /// <summary>
+ /// True if chart type supports logarithmic axes
+ /// </summary>
+ virtual public bool SupportLogarithmicAxes { get{ return true;} }
+
+ /// <summary>
+ /// True if chart type requires to switch the value (Y) axes position
+ /// </summary>
+ virtual public bool SwitchValueAxes { get{ return false;} }
+
+ /// <summary>
+ /// True if chart series can be placed side-by-side.
+ /// </summary>
+ public bool SideBySideSeries { get{ return false;} }
+
+ /// <summary>
+ /// True if each data point of a chart must be represented in the legend
+ /// </summary>
+ virtual public bool DataPointsInLegend { get{ return false;} }
+
+ /// <summary>
+ /// If the crossing value is auto Crossing value should be
+ /// automatically set to zero for some chart
+ /// types (Bar, column, area etc.)
+ /// </summary>
+ virtual public bool ZeroCrossing { get{ return false;} }
+
+ /// <summary>
+ /// True if palette colors should be applied for each data paoint.
+ /// Otherwise the color is applied to the series.
+ /// </summary>
+ virtual public bool ApplyPaletteColorsToPoints { get { return false; } }
+
+ /// <summary>
+ /// Indicates that extra Y values are connected to the scale of the Y axis
+ /// </summary>
+ virtual public bool ExtraYValuesConnectedToYAxis{ get { return true; } }
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ virtual public bool HundredPercent{ get{return false;} }
+
+ /// <summary>
+ /// Indicates that it's a hundredred percent chart.
+ /// Axis scale from 0 to 100 percent should be used.
+ /// </summary>
+ virtual public bool HundredPercentSupportNegative{ get{return false;} }
+
+ /// <summary>
+ /// How to draw series/points in legend:
+ /// Filled rectangle, Line or Marker
+ /// </summary>
+ /// <param name="series">Legend item series.</param>
+ /// <returns>Legend item style.</returns>
+ virtual public LegendImageStyle GetLegendImageStyle(Series series)
+ {
+ return LegendImageStyle.Rectangle;
+ }
+
+ /// <summary>
+ /// Number of supported Y value(s) per point
+ /// </summary>
+ virtual public int YValuesPerPoint { get { return 1; } }
+
+ /// <summary>
+ /// Gets chart type image.
+ /// </summary>
+ /// <param name="registry">Chart types registry object.</param>
+ /// <returns>Chart type image.</returns>
+ virtual public System.Drawing.Image GetImage(ChartTypeRegistry registry)
+ {
+ return (System.Drawing.Image)registry.ResourceManager.GetObject(this.Name + "ChartType");
+ }
+ #endregion
+
+ #region Y values related methods
+
+ /// <summary>
+ /// Helper function, which returns the Y value of the point.
+ /// </summary>
+ /// <param name="common">Chart common elements.</param>
+ /// <param name="area">Chart area the series belongs to.</param>
+ /// <param name="series">Sereis of the point.</param>
+ /// <param name="point">Point object.</param>
+ /// <param name="pointIndex">Index of the point.</param>
+ /// <param name="yValueIndex">Index of the Y value to get.</param>
+ /// <returns>Y value of the point.</returns>
+ virtual public double GetYValue(
+ CommonElements common,
+ ChartArea area,
+ Series series,
+ DataPoint point,
+ int pointIndex,
+ int yValueIndex)
+ {
+ return point.YValues[yValueIndex];
+ }
+
+ #endregion
+
+ #region SmartLabelStyle methods
+
+ /// <summary>
+ /// Adds markers position to the list. Used to check SmartLabelStyle overlapping.
+ /// </summary>
+ /// <param name="common">Common chart elements.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="series">Series values to be used.</param>
+ /// <param name="list">List to add to.</param>
+ public void AddSmartLabelMarkerPositions(CommonElements common, ChartArea area, Series series, ArrayList list)
+ {
+ }
+
+ #endregion
+
+ #region IDisposable interface implementation
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected virtual void Dispose(bool disposing)
+ {
+ //Nothing to dispose at the base class.
+ }
+
+ /// <summary>
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// </summary>
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+ #endregion
+ }
+}
+
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/AnnotationConverters.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/AnnotationConverters.cs
new file mode 100644
index 00000000000..8c7c21ef8df
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/AnnotationConverters.cs
@@ -0,0 +1,136 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: AnnotationConverters.cs
+//
+// Namespace: DataVisualization.Charting
+//
+// Classes: AnchorPointValueConverter, AnnotationAxisValueConverter
+//
+// Purpose: Annotation Converters.
+//
+// Reviewed:
+//
+//===================================================================
+
+
+#region Used namespace
+using System;
+using System.Globalization;
+using System.Collections;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Text;
+using System.Drawing.Drawing2D;
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+#else
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.DataVisualization.Charting;
+using System.Web.UI.DataVisualization.Charting.Data;
+using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+ namespace System.Web.UI.DataVisualization.Charting
+#endif
+{
+ /// <summary>
+ /// Converts anchor data point to string name.
+ /// </summary>
+ internal class AnchorPointValueConverter : TypeConverter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// Converts anchor data point to string name.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert.</param>
+ /// <param name="destinationType">Convertion destination type.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+ {
+ if (destinationType == typeof(string))
+ {
+ if (value == null)
+ {
+ return Constants.NotSetValue;
+ }
+ DataPoint dataPoint = value as DataPoint;
+
+ if (dataPoint != null)
+ {
+ if (dataPoint.series != null)
+ {
+ int pointIndex = dataPoint.series.Points.IndexOf(dataPoint) + 1;
+ return dataPoint.series.Name + " - " + SR.DescriptionTypePoint + pointIndex.ToString(CultureInfo.InvariantCulture);
+ }
+ }
+ }
+
+ // Call base class
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
+ #endregion
+ }
+
+ /// <summary>
+ /// Converts anchor data point to string name.
+ /// </summary>
+ internal class AnnotationAxisValueConverter : TypeConverter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// Converts axis associated with anootation to string.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert.</param>
+ /// <param name="destinationType">Convertion destination type.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+ {
+ if (destinationType == typeof(string))
+ {
+ if (value == null)
+ {
+ return Constants.NotSetValue;
+ }
+
+ Axis axis = value as Axis;
+ if (axis != null)
+ {
+ if (axis.ChartArea != null)
+ {
+ return axis.ChartArea.Name + " - " + axis.Name;
+ }
+ }
+ }
+
+ // Call base class
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
+ #endregion
+ }
+}
+
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/AxesArrayConverter.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/AxesArrayConverter.cs
new file mode 100644
index 00000000000..8eb22e152c8
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/AxesArrayConverter.cs
@@ -0,0 +1,94 @@
+
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: AxesArrayConverter.cs
+//
+// Namespace: DataVisualization.Charting.Design
+//
+// Classes: AxesArrayConverter
+//
+// Purpose: Converter for the Axes array.
+//
+// Reviewed: AG - August 7, 2002
+//
+//===================================================================
+
+#region Used Namespaces
+
+using System;
+using System.Collections;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Diagnostics;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Drawing.Design;
+using System.IO;
+using System.Globalization;
+using System.Data;
+using System.Reflection;
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+
+
+#else
+ using System.Web;
+ using System.Web.UI;
+ using System.Web.UI.WebControls;
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+ namespace System.Web.UI.DataVisualization.Charting
+#endif
+{
+ /// <summary>
+ /// Converter object of axes array
+ /// </summary>
+ internal class AxesArrayConverter : TypeConverter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// Subproperties NOT suported.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Always false.</returns>
+ public override bool GetPropertiesSupported(ITypeDescriptorContext context)
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// Overrides the ConvertTo method of TypeConverter.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value.</param>
+ /// <param name="destinationType">Destination type.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+ {
+ // Convert collection to string
+ if (destinationType == typeof(string))
+ {
+ return (new CollectionConverter()).ConvertToString(new ArrayList());
+ }
+
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/AxisConverters.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/AxisConverters.cs
new file mode 100644
index 00000000000..339a5ed02c8
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/AxisConverters.cs
@@ -0,0 +1,691 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: AxisConverter.cs
+//
+// Namespace: DataVisualization.Charting.Design
+//
+// Classes: AxisLabelDateValueConverter, AxisCrossingValueConverter
+// AxisMinMaxValueConverter, AxisMinMaxAutoValueConverter,
+// StripLineTitleAngleConverter
+//
+// Purpose: Converters for the Axis object properties.
+//
+// Reviewed: AG - August 7, 2002
+//
+//===================================================================
+
+
+#region Used Namespaces
+
+using System;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Collections;
+using System.Globalization;
+using System.Reflection;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+#else
+ using System.Web;
+ using System.Web.UI;
+ using System.Web.UI.DataVisualization.Charting;
+
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+ namespace System.Web.UI.DataVisualization.Charting
+#endif
+{
+ /// <summary>
+ /// Converts labels, grid and ticks start position to support dates format
+ /// </summary>
+ internal class AxisLabelDateValueConverter : DoubleConverter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// Convert Min and Max values to string if step type is set to one of the DateTime type
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert.</param>
+ /// <param name="destinationType">Convertion destination type.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+ {
+ if (context != null && context.Instance != null)
+ {
+ // Convert to string
+ if (destinationType == typeof(string))
+ {
+ DateTimeIntervalType intervalType = DateTimeIntervalType.Auto;
+ double interval = 0;
+
+ // Get IntervalType property using reflection
+ PropertyInfo propertyInfo = context.Instance.GetType().GetProperty("IntervalType");
+ if(propertyInfo != null)
+ {
+ intervalType = (DateTimeIntervalType)propertyInfo.GetValue(context.Instance, null);
+ }
+
+ // Get Interval property using reflection
+ propertyInfo = context.Instance.GetType().GetProperty("Interval");
+ if(propertyInfo != null)
+ {
+ interval = (double)propertyInfo.GetValue(context.Instance, null);
+ }
+
+ // Try to get interval information from the axis
+ if(intervalType == DateTimeIntervalType.Auto)
+ {
+ // Get object's axis
+ Axis axis = null;
+ if(context.Instance is Axis)
+ {
+ axis = (Axis)context.Instance;
+ }
+ else
+ {
+ MethodInfo methodInfo = context.Instance.GetType().GetMethod("GetAxis");
+ if(methodInfo != null)
+ {
+ // Get axis object
+ axis = (Axis)methodInfo.Invoke(context.Instance, null);
+ }
+ }
+
+ // Get axis value type
+ if(axis != null)
+ {
+ intervalType = axis.GetAxisIntervalType();
+ }
+ }
+
+ // Convert value to date/time string
+ if(context.Instance.GetType() != typeof(StripLine) || interval == 0)
+ {
+ if(intervalType != DateTimeIntervalType.Number && intervalType != DateTimeIntervalType.Auto)
+ {
+ // Covert value to date/time
+ if(intervalType < DateTimeIntervalType.Hours)
+ {
+ return DateTime.FromOADate((double)value).ToShortDateString();
+ }
+ return DateTime.FromOADate((double)value).ToString("g", System.Globalization.CultureInfo.CurrentCulture);
+ }
+ }
+ }
+ }
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
+
+ /// <summary>
+ /// Convert Min and Max values from string if step type is set to one of the DateTime type
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert from.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
+ {
+ object result = null;
+ bool convertFromDate = false;
+ string stringValue = value as string;
+
+ // If context interface provided check if we are dealing with DateTime values
+ if (context != null && context.Instance != null)
+ {
+ DateTimeIntervalType intervalType = DateTimeIntervalType.Auto;
+
+ // Get intervalType property using reflection
+ PropertyInfo propertyInfo = context.Instance.GetType().GetProperty("intervalType");
+ if(propertyInfo != null)
+ {
+ intervalType = (DateTimeIntervalType)propertyInfo.GetValue(context.Instance, null);
+ }
+
+ // Try to get interval information from the axis
+ if(intervalType == DateTimeIntervalType.Auto)
+ {
+ // Get object's axis
+ Axis axis = null;
+ if(context.Instance is Axis)
+ {
+ axis = (Axis)context.Instance;
+ }
+ else
+ {
+ MethodInfo methodInfo = context.Instance.GetType().GetMethod("GetAxis");
+ if(methodInfo != null)
+ {
+ // Get axis object
+ axis = (Axis)methodInfo.Invoke(context.Instance, null);
+ }
+ }
+
+ // Get axis value type
+ if(axis != null)
+ {
+ intervalType = axis.GetAxisIntervalType();
+ }
+ }
+
+ if (stringValue != null && intervalType != DateTimeIntervalType.Number && intervalType != DateTimeIntervalType.Auto)
+ {
+ convertFromDate = true;
+ }
+
+ }
+
+ // Try to convert from double string
+ try
+ {
+ result = base.ConvertFrom(context, culture, value);
+ }
+ catch (ArgumentException)
+ {
+ result = null;
+ }
+ catch (NotSupportedException)
+ {
+ result = null;
+ }
+
+ // Try to convert from date/time string
+ if (stringValue != null && (convertFromDate || result == null))
+ {
+ DateTime valueAsDate;
+ bool parseSucceed = DateTime.TryParse(stringValue, CultureInfo.InvariantCulture, DateTimeStyles.None, out valueAsDate);
+
+ if (parseSucceed)
+ {
+ // Succeded converting from date format
+ return valueAsDate.ToOADate();
+ }
+ }
+
+ // Call base converter
+ return base.ConvertFrom(context, culture, value);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Converts crossing property of the axis.
+ /// Possible values: double, date, "Auto", "Min", "Max"
+ /// </summary>
+ internal class AxisCrossingValueConverter : AxisMinMaxValueConverter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// Standart values supported - return true.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Standard values supported.</returns>
+ public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Standart values are not exclusive - return false
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Non exclusive standard values.</returns>
+ public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// Fill in the list of standart values.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Standart values collection.</returns>
+ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
+ {
+ ArrayList values = new ArrayList();
+ values.Add(Double.NaN);
+ values.Add(Double.MinValue);
+ values.Add(Double.MaxValue);
+
+ return new StandardValuesCollection(values);
+ }
+
+ /// <summary>
+ /// Convert crossing value to string.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert.</param>
+ /// <param name="destinationType">Convertion destination type.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+ {
+ double doubleValue = (double)value;
+ if (destinationType == typeof(string))
+ {
+ if(Double.IsNaN(doubleValue))
+ {
+ return Constants.AutoValue;
+ }
+ else if(doubleValue == Double.MinValue)
+ {
+ return Constants.MinValue;
+ }
+ else if(doubleValue == Double.MaxValue)
+ {
+ return Constants.MaxValue;
+ }
+ }
+
+ // Call base class
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
+
+ /// <summary>
+ /// Convert crossing values from string
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert from.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
+ {
+ // If converting from string value
+ string crossingValue = value as string;
+ if (crossingValue != null)
+ {
+ if (String.Compare(crossingValue, Constants.AutoValue, StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ return Double.NaN;
+ }
+ else if (String.Compare(crossingValue, Constants.MinValue, StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ return Double.MinValue;
+ }
+ else if (String.Compare(crossingValue, Constants.MaxValue, StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ return Double.MaxValue;
+ }
+ }
+
+ // Call base converter
+ return base.ConvertFrom(context, culture, value);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Converts min and max properties of the axis depending on the values type
+ /// </summary>
+ internal class AxisMinMaxValueConverter : DoubleConverter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// Convert Min and Max values to string if step type is set to one of the DateTime type
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert.</param>
+ /// <param name="destinationType">Convertion destination type.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+ {
+ if (context != null && context.Instance != null && context.Instance is Axis)
+ {
+ Axis axis = (Axis)context.Instance;
+ if (destinationType == typeof(string))
+ {
+ string strValue = DoubleDateNanValueConverter.ConvertDateTimeToString(
+ (double)value,
+ axis.GetAxisValuesType(),
+ axis.InternalIntervalType);
+
+ if (strValue != null)
+ return strValue;
+ }
+ }
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
+
+ /// <summary>
+ /// Convert Min and Max values from string if step type is set to one of the DateTime type
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert from.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
+ {
+ object result = null;
+ bool convertFromDate = false;
+ string stringValue = value as string;
+
+ // If context interface provided check if we are dealing with DateTime values
+ if (context != null && context.Instance != null && context.Instance is Axis)
+ {
+ Axis axis = (Axis)context.Instance;
+
+ if (stringValue != null)
+ {
+ if (axis.InternalIntervalType == DateTimeIntervalType.Auto)
+ {
+ if (axis.GetAxisValuesType() == ChartValueType.DateTime ||
+ axis.GetAxisValuesType() == ChartValueType.Date ||
+ axis.GetAxisValuesType() == ChartValueType.Time ||
+ axis.GetAxisValuesType() == ChartValueType.DateTimeOffset)
+ {
+ convertFromDate = true;
+ }
+ }
+ else
+ {
+ if (axis.InternalIntervalType != DateTimeIntervalType.Number)
+ {
+ convertFromDate = true;
+ }
+ }
+ }
+ }
+
+ // Try to convert from double string
+ try
+ {
+ result = base.ConvertFrom(context, culture, value);
+ }
+ catch (ArgumentException)
+ {
+ result = null;
+ }
+ catch (NotSupportedException)
+ {
+ result = null;
+ }
+
+ // Try to convert from date/time string
+ if (stringValue != null && (convertFromDate || result == null))
+ {
+ DateTime valueAsDate;
+ bool parseSucceed = DateTime.TryParse(stringValue, CultureInfo.CurrentCulture, DateTimeStyles.None, out valueAsDate);
+
+ if (parseSucceed)
+ {
+ return valueAsDate.ToOADate();
+ }
+ }
+
+ // Call base converter
+ return base.ConvertFrom(context, culture, value);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Converts maximum and minimum property of the axis.
+ /// Possible values: double, date, "Auto",
+ /// </summary>
+ internal class AxisMinMaxAutoValueConverter : AxisMinMaxValueConverter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// Standart values supported - return true
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Standard values supported.</returns>
+ public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Standart values are not exclusive - return false
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Non exclusive standard values.</returns>
+ public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// Fill in the list of data series names.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
+ {
+ ArrayList values = new ArrayList();
+ values.Add(Double.NaN);
+
+ return new StandardValuesCollection(values);
+ }
+
+ /// <summary>
+ /// Convert minimum or maximum value to string
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert.</param>
+ /// <param name="destinationType">Convertion destination type.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+ {
+ double doubleValue = (double)value;
+ if (destinationType == typeof(string))
+ {
+ if(Double.IsNaN(doubleValue))
+ {
+ return Constants.AutoValue;
+ }
+ }
+
+ // Call base class
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
+
+ /// <summary>
+ /// Convert minimum or maximum values from string
+ /// </summary>
+ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
+ {
+ // If converting from string value
+ string crossingValue = value as string;
+ if (crossingValue != null)
+ {
+ if (String.Compare(crossingValue, Constants.AutoValue, StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ return Double.NaN;
+ }
+ }
+
+ // Call base converter
+ return base.ConvertFrom(context, culture, value);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Converts title angle property of the strip line
+ /// Possible values: 0, 90, 180, 270
+ /// </summary>
+ internal class StripLineTitleAngleConverter : Int32Converter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// Standart values supported - return true
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Standard values supported.</returns>
+ public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Standart values are not exclusive - return false
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Non exclusive standard values.</returns>
+ public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Fill in the list of data series names.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
+ {
+ ArrayList values = new ArrayList();
+ values.Add(0);
+ values.Add(90);
+ values.Add(180);
+ values.Add(270);
+
+ return new StandardValuesCollection(values);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Converts Interval and IntervalOffset properties of the axis
+ /// </summary>
+ internal class AxisIntervalValueConverter : DoubleConverter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// Inicates that "NotSet" option is available
+ /// </summary>
+ internal bool hideNotSet = true;
+
+ /// <summary>
+ /// Standart values supported - return true.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Standard values supported.</returns>
+ public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Standart values are not exclusive - return false
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Non exclusive standard values.</returns>
+ public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// Fill in the list of standart values.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Standart values collection.</returns>
+ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
+ {
+ ArrayList values = new ArrayList();
+ if(!hideNotSet)
+ {
+ values.Add(Double.NaN);
+ }
+ values.Add(0.0);
+
+ return new StandardValuesCollection(values);
+ }
+
+ /// <summary>
+ /// Convert crossing value to string.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert.</param>
+ /// <param name="destinationType">Convertion destination type.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+ {
+ double doubleValue = (double)value;
+ if (destinationType == typeof(string))
+ {
+ if(Double.IsNaN(doubleValue))
+ {
+ return Constants.NotSetValue;
+ }
+ else if(doubleValue == 0.0)
+ {
+ return Constants.AutoValue;
+ }
+ }
+
+ // Call base class
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
+
+ /// <summary>
+ /// Convert crossing values from string
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert from.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
+ {
+ // If converting from string value
+ string crossingValue = value as string;
+ if (crossingValue != null)
+ {
+ if (String.Compare(crossingValue, Constants.AutoValue, StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ return 0.0;
+ }
+ else if (String.Compare(crossingValue, Constants.NotSetValue, StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ return Double.NaN;
+ }
+ }
+
+ // Call base converter
+ return base.ConvertFrom(context, culture, value);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Converts Interval and IntervalOffset properties of the label style, tick marks and grids
+ /// </summary>
+ internal class AxisElementIntervalValueConverter : AxisIntervalValueConverter
+ {
+ /// <summary>
+ /// Show the NotSet option for interval
+ /// </summary>
+ public AxisElementIntervalValueConverter()
+ {
+ base.hideNotSet = false;
+ }
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/CustomAttributesConverters.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/CustomAttributesConverters.cs
new file mode 100644
index 00000000000..98783d5968b
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/CustomAttributesConverters.cs
@@ -0,0 +1,985 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: CustomattributesConverter.cs
+//
+// Namespace: DataVisualization.Charting.Design
+//
+// Interfaces: IDataPointCustomPropertiesProvider
+//
+// Classes: CustomPropertiesTypeConverter, DynamicPropertyDescriptor
+//
+// Purpose: AxisName converter of the design-time CustomProperties
+// property object.
+//
+// Reviewed:
+//
+//===================================================================
+
+#region Used Namespaces
+
+using System;
+using System.Collections;
+using System.ComponentModel;
+using System.Drawing;
+using System.Globalization;
+using System.Diagnostics.CodeAnalysis;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting;
+#else
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+ using System.Web.UI.DataVisualization.Charting;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+#endif
+{
+ /// <summary>
+ /// Custom properties object type converter.
+ /// </summary>
+ internal class CustomPropertiesTypeConverter : TypeConverter
+ {
+ #region String to/from convertion methods
+
+ /// <summary>
+ /// Overrides the CanConvertFrom method of TypeConverter.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="sourceType">Convertion source type.</param>
+ /// <returns>Indicates if convertion is possible.</returns>
+ public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
+ {
+ if(sourceType == typeof(string))
+ {
+ return true;
+ }
+
+ return base.CanConvertFrom(context, sourceType);
+ }
+
+ /// <summary>
+ /// Overrides the CanConvertTo method of TypeConverter.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="destinationType">Destination type.</param>
+ /// <returns>Indicates if convertion is possible.</returns>
+ public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
+ {
+ if(destinationType == typeof(CustomProperties))
+ {
+ return true;
+ }
+
+ return base.CanConvertTo(context, destinationType);
+ }
+
+ /// <summary>
+ /// Overrides the ConvertTo method of TypeConverter.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert.</param>
+ /// <param name="destinationType">Convertion destination type.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
+ {
+ if (destinationType == typeof(string))
+ {
+ return ((CustomProperties)value).DataPointCustomProperties.CustomProperties;
+ }
+
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
+
+ /// <summary>
+ /// Overrides the ConvertFrom method of TypeConverter.
+ /// Converts from string with comma separated values.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert from.</param>
+ /// <returns>Indicates if convertion is possible.</returns>
+ [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily",
+ Justification = "Too large of a code change to justify making this change")]
+ public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
+ {
+ string stringValue = value as string;
+ if(stringValue != null && context != null && context.Instance != null)
+ {
+ // Create new custom attribute class with a reference to the DataPointCustomProperties
+ if(context.Instance is DataPointCustomProperties)
+ {
+ ((DataPointCustomProperties)context.Instance).CustomProperties = stringValue;
+ CustomProperties newAttributes = new CustomProperties(((DataPointCustomProperties)context.Instance));
+ return newAttributes;
+ }
+
+ else if (context.Instance is CustomProperties)
+ {
+ CustomProperties newAttributes = new CustomProperties(((CustomProperties)context.Instance).DataPointCustomProperties);
+ return newAttributes;
+ }
+ else if (context.Instance is IDataPointCustomPropertiesProvider)
+ {
+ CustomProperties newAttributes = new CustomProperties(((IDataPointCustomPropertiesProvider)context.Instance).DataPointCustomProperties);
+ return newAttributes;
+ }
+
+ else if (context.Instance is Array)
+ {
+ DataPointCustomProperties attributes = null;
+ foreach (object obj in ((Array)context.Instance))
+ {
+ if (obj is DataPointCustomProperties)
+ {
+ attributes = (DataPointCustomProperties)obj;
+ attributes.CustomProperties = stringValue;
+ }
+ }
+ if (attributes != null)
+ {
+ CustomProperties newAttributes = new CustomProperties(attributes);
+ return newAttributes;
+ }
+ }
+ }
+ return base.ConvertFrom(context, culture, value);
+ }
+
+ #endregion // String to/from convertion methods
+
+ #region Property Descriptor Collection methods
+
+ /// <summary>
+ /// Returns whether this object supports properties.
+ /// </summary>
+ /// <param name="context">An ITypeDescriptorContext that provides a format context.</param>
+ /// <returns>true if GetProperties should be called to find the properties of this object; otherwise, false.</returns>
+ public override bool GetPropertiesSupported(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Returns a collection of properties for the type of array specified by the value parameter,
+ /// using the specified context and properties.
+ /// </summary>
+ /// <param name="context">An ITypeDescriptorContext that provides a format context.</param>
+ /// <param name="obj">An Object that specifies the type of array for which to get properties.</param>
+ /// <param name="attributes">An array of type Attribute that is used as a filter.</param>
+ /// <returns>A PropertyDescriptorCollection with the properties that are exposed for this data type, or a null reference (Nothing in Visual Basic) if there are no properties.</returns>
+ public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object obj, Attribute[] attributes)
+ {
+ PropertyDescriptorCollection propCollection = new PropertyDescriptorCollection(null);
+ CustomProperties attr = obj as CustomProperties;
+ if(attr != null && context != null)
+ {
+ // Get series associated with custom attribute
+ Series series = (attr.DataPointCustomProperties is Series) ? ( (Series) attr.DataPointCustomProperties) : attr.DataPointCustomProperties.series;
+ if(series != null &&
+ series.Common != null)
+ {
+ // Loop through all registered custom properties
+ CustomPropertyRegistry registry = (CustomPropertyRegistry)series.Common.container.GetService(typeof(CustomPropertyRegistry));
+ foreach(CustomPropertyInfo attrInfo in registry.registeredCustomProperties)
+ {
+ // Check if attribute description matches curent selection in property browser
+ if(IsApplicableCustomProperty(attrInfo, context.Instance))
+ {
+ // Get array of property properties
+ Attribute[] propAttributes = GetPropertyAttributes(attrInfo);
+
+ // Create property descriptor
+ CustomAttributesPropertyDescriptor propertyDescriptor = new CustomAttributesPropertyDescriptor(
+ typeof(CustomProperties),
+ attrInfo.Name,
+ attrInfo.ValueType,
+ propAttributes,
+ attrInfo);
+
+ // Add descriptor into the collection
+ propCollection.Add(propertyDescriptor);
+ }
+ }
+
+ // Always add "UserDefined" property for all user defined custom properties
+ Attribute[] propUserDefinedAttributes = new Attribute[] {
+ new NotifyParentPropertyAttribute(true),
+ new RefreshPropertiesAttribute(RefreshProperties.All),
+ new DescriptionAttribute(SR.DescriptionAttributeUserDefined)
+ };
+
+ // Create property descriptor
+ CustomAttributesPropertyDescriptor propertyUserDefinedDescriptor = new CustomAttributesPropertyDescriptor(
+ typeof(CustomProperties),
+ "UserDefined",
+ typeof(string),
+ propUserDefinedAttributes,
+ null);
+
+ // Add descriptor into the collection
+ propCollection.Add(propertyUserDefinedDescriptor);
+ }
+ }
+
+ return propCollection;
+ }
+
+ /// <summary>
+ /// Checks if provided custom attribute appies to the selected points or series.
+ /// </summary>
+ /// <param name="attrInfo">Custom attribute information.</param>
+ /// <param name="obj">Selected series or points.</param>
+ /// <returns>True if custom attribute applies.</returns>
+ private bool IsApplicableCustomProperty(CustomPropertyInfo attrInfo, object obj)
+ {
+
+ CustomProperties customProperties = obj as CustomProperties;
+ if (customProperties != null)
+ {
+ obj = customProperties.DataPointCustomProperties;
+ }
+
+ // Check if custom attribute applies to the series or points
+ if( (IsDataPoint(obj) && attrInfo.AppliesToDataPoint) ||
+ (!IsDataPoint(obj) && attrInfo.AppliesToSeries) )
+ {
+ // Check if attribute do not apply to 3D or 2D chart types
+ if( (Is3DChartType(obj) && attrInfo.AppliesTo3D) ||
+ (!Is3DChartType(obj) && attrInfo.AppliesTo2D) )
+ {
+
+ // Check if custom attribute applies to the chart types selected
+ SeriesChartType[] chartTypes = GetSelectedChartTypes(obj);
+ foreach(SeriesChartType chartType in chartTypes)
+ {
+ foreach(SeriesChartType attrChartType in attrInfo.AppliesToChartType)
+ {
+ if(attrChartType == chartType)
+ {
+ return true;
+ }
+ }
+ }
+
+ }
+ }
+
+ return false;
+ }
+
+ /// <summary>
+ /// Checks if specified object represent a single or array of data points.
+ /// </summary>
+ /// <param name="obj">Object to test.</param>
+ /// <returns>True if specified object contains one or more data points.</returns>
+ private bool IsDataPoint(object obj)
+ {
+ Series series = obj as Series;
+ if(series != null)
+ {
+ return false;
+ }
+
+ Array array = obj as Array;
+ if(array != null && array.Length > 0)
+ {
+ if (array.GetValue(0) is Series)
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /// <summary>
+ /// Checks if specified object represent a single or array of data points.
+ /// </summary>
+ /// <param name="obj">Object to test.</param>
+ /// <returns>True if specified object contains one or more data points.</returns>
+ private bool Is3DChartType(object obj)
+ {
+ // Get array of series
+ Series[] seriesArray = GetSelectedSeries(obj);
+
+ // Loop through all series and check if its plotted on 3D chart area
+ foreach(Series series in seriesArray)
+ {
+ ChartArea chartArea = series.Chart.ChartAreas[series.ChartArea];
+ if(chartArea.Area3DStyle.Enable3D)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /// <summary>
+ /// Get array of selected series.
+ /// </summary>
+ /// <param name="obj">Selected objects.</param>
+ /// <returns>Selected series array.</returns>
+ [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily",
+ Justification = "Too large of a code change to justify making this change")]
+ private Series[] GetSelectedSeries(object obj)
+ {
+ // Get array of series
+ Series[] seriesArray = new Series[0];
+ if(obj is Array && ((Array)obj).Length > 0)
+ {
+ if(((Array)obj).GetValue(0) is Series)
+ {
+ seriesArray = new Series[((Array)obj).Length];
+ ((Array)obj).CopyTo(seriesArray, 0);
+ }
+ else if(((Array)obj).GetValue(0) is DataPointCustomProperties)
+ {
+ seriesArray = new Series[] { ((DataPointCustomProperties)((Array)obj).GetValue(0)).series };
+ }
+ }
+ else if(obj is Series)
+ {
+ seriesArray = new Series[] { ((Series)obj) };
+ }
+ else if(obj is DataPointCustomProperties)
+ {
+ seriesArray = new Series[] { ((DataPointCustomProperties)obj).series };
+ }
+
+ return seriesArray;
+ }
+
+ /// <summary>
+ /// Get array of chart types from the selected series.
+ /// </summary>
+ /// <param name="obj">Selected series or data points.</param>
+ /// <returns>Array of selected chart types.</returns>
+ private SeriesChartType[] GetSelectedChartTypes(object obj)
+ {
+ // Get array of series
+ Series[] seriesArray = GetSelectedSeries(obj);
+
+ // Create array of chart types
+ int index = 0;
+ SeriesChartType[] chartTypes = new SeriesChartType[seriesArray.Length];
+ foreach(Series series in seriesArray)
+ {
+ chartTypes[index++] = series.ChartType;
+ }
+
+ return chartTypes;
+ }
+
+ /// <summary>
+ /// Gets array of properties for the dynamic property.
+ /// </summary>
+ /// <param name="attrInfo">Custom attribute information.</param>
+ /// <returns>Array of properties.</returns>
+ private Attribute[] GetPropertyAttributes(CustomPropertyInfo attrInfo)
+ {
+ // Create default value attribute
+ DefaultValueAttribute defaultValueAttribute = null;
+ if (attrInfo.DefaultValue.GetType() == attrInfo.ValueType)
+ {
+ defaultValueAttribute = new DefaultValueAttribute(attrInfo.DefaultValue);
+ }
+ else if (attrInfo.DefaultValue is string)
+ {
+ defaultValueAttribute = new DefaultValueAttribute(attrInfo.ValueType, (string)attrInfo.DefaultValue);
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionCustomAttributeDefaultValueTypeInvalid));
+ }
+ // Add all properties into the list
+ ArrayList propList = new ArrayList();
+
+ propList.Add(new NotifyParentPropertyAttribute(true));
+ propList.Add(new RefreshPropertiesAttribute(RefreshProperties.All));
+ propList.Add(new DescriptionAttribute(attrInfo.Description));
+ propList.Add(defaultValueAttribute);
+
+ if (attrInfo.Name.Equals(CustomPropertyName.ErrorBarType, StringComparison.Ordinal))
+ {
+ propList.Add(new TypeConverterAttribute(typeof(ErrorBarTypeConverter)));
+ }
+
+ // Convert list to array
+ int index = 0;
+ Attribute[] propAttributes = new Attribute[propList.Count];
+ foreach(Attribute attr in propList)
+ {
+ propAttributes[index++] = attr;
+ }
+ return propAttributes;
+ }
+
+ /// <summary>
+ /// Special convertor for ErrorBarType custom attribute
+ /// </summary>
+ internal class ErrorBarTypeConverter : StringConverter
+ {
+ /// <summary>
+ /// Returns whether this object supports a standard set of values that can be picked from a list, using the specified context.
+ /// </summary>
+ /// <param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext"/> that provides a format context.</param>
+ /// <returns>
+ /// true if <see cref="M:System.ComponentModel.TypeConverter.GetStandardValues"/> should be called to find a common set of values the object supports; otherwise, false.
+ /// </returns>
+ public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Returns whether the collection of standard values returned from <see cref="M:System.ComponentModel.TypeConverter.GetStandardValues"/> is an exclusive list of possible values, using the specified context.
+ /// </summary>
+ /// <param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext"/> that provides a format context.</param>
+ /// <returns>
+ /// true if the <see cref="T:System.ComponentModel.TypeConverter.StandardValuesCollection"/> returned from <see cref="M:System.ComponentModel.TypeConverter.GetStandardValues"/> is an exhaustive list of possible values; false if other values are possible.
+ /// </returns>
+ public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// Returns a collection of standard values for the data type this type converter is designed for when provided with a format context.
+ /// </summary>
+ /// <param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext"/> that provides a format context that can be used to extract additional information about the environment from which this converter is invoked. This parameter or properties of this parameter can be null.</param>
+ /// <returns>
+ /// A <see cref="T:System.ComponentModel.TypeConverter.StandardValuesCollection"/> that holds a standard set of valid values, or null if the data type does not support a standard set of values.
+ /// </returns>
+ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
+ {
+ ArrayList result = new ArrayList();
+ foreach (ChartTypes.ErrorBarType item in Enum.GetValues(typeof(ChartTypes.ErrorBarType)))
+ {
+ string itemStr = String.Format(CultureInfo.InvariantCulture, "{0}({1:N0})", item, ChartTypes.ErrorBarChart.DefaultErrorBarTypeValue(item));
+ result.Add(itemStr);
+ }
+ return new StandardValuesCollection(result);
+ }
+ }
+
+ #endregion // Property Descriptor Collection methods
+
+ #region Custom Attributes Property Descriptor
+
+ /// <summary>
+ /// Custom properties inner property descriptor class.
+ /// </summary>
+ protected class CustomAttributesPropertyDescriptor : TypeConverter.SimplePropertyDescriptor
+ {
+ #region Fields
+
+ // Property name
+ private string _name = string.Empty;
+
+ // Custom attribute information
+ private CustomPropertyInfo _customAttributeInfo = null;
+
+ #endregion // Fields
+
+ #region Constructor
+
+ /// <summary>
+ /// Property descriptor constructor.
+ /// </summary>
+ /// <param name="componentType">Component type.</param>
+ /// <param name="name">Property name.</param>
+ /// <param name="propertyType">Property type.</param>
+ /// <param name="attributes">Property attributes.</param>
+ /// <param name="customAttributeInfo">Custom attribute information.</param>
+ internal CustomAttributesPropertyDescriptor(
+ Type componentType,
+ string name,
+ Type propertyType,
+ Attribute[] attributes,
+ CustomPropertyInfo customAttributeInfo)
+ : base(componentType, name, propertyType, attributes)
+ {
+ this._name = name;
+ this._customAttributeInfo = customAttributeInfo;
+ }
+
+ #endregion // Constructor
+
+ #region Methods
+
+ /// <summary>
+ /// Gets the current value of the property on a component.
+ /// </summary>
+ /// <param name="component">The component with the property for which to retrieve the value.</param>
+ /// <returns>The value of a property for a given component.</returns>
+ public override object GetValue(object component)
+ {
+ // "UserDefined" property expose comma separated user defined properties
+ CustomProperties customAttr = component as CustomProperties;
+ if(this._name == "UserDefined")
+ {
+ return customAttr.GetUserDefinedCustomProperties();
+ }
+ else
+ {
+ object val = null;
+
+ // Check if custom attribute with this name is set
+ string stringValue = customAttr.DataPointCustomProperties[this._name];
+ if(this._customAttributeInfo != null)
+ {
+ if(stringValue == null || stringValue.Length == 0)
+ {
+ val = GetValueFromString(this._customAttributeInfo.DefaultValue);
+ }
+ else
+ {
+ val = GetValueFromString(stringValue);
+ }
+ }
+ else
+ {
+ val = stringValue;
+ }
+
+ return val;
+ }
+ }
+
+ /// <summary>
+ /// Sets the value of the component to a different value.
+ /// </summary>
+ /// <param name="component">The component with the property value that is to be set.</param>
+ /// <param name="value">The new value.</param>
+ public override void SetValue(object component, object value)
+ {
+ // Validate new value
+ ValidateValue(this._name, value);
+
+ // Get new value as string
+ string stringValue = GetStringFromValue(value);
+
+ // "UserDefined" property expose comma separated user defined properties
+ CustomProperties customAttr = component as CustomProperties;
+ if( this._name == "UserDefined" )
+ {
+ customAttr.SetUserDefinedAttributes(stringValue);
+ }
+ else
+ {
+ // Check if the new value is the same as DefaultValue
+ bool setAttributeValue = true;
+ if( IsDefaultValue(stringValue) )
+ {
+ // Remove custom properties with default values from data point
+ // only when series do not have this attribute set.
+ if( !(customAttr.DataPointCustomProperties is DataPoint) ||
+ !((DataPoint)customAttr.DataPointCustomProperties).series.IsCustomPropertySet(this._name) )
+ {
+ // Delete attribute
+ if(customAttr.DataPointCustomProperties.IsCustomPropertySet(this._name))
+ {
+ customAttr.DataPointCustomProperties.DeleteCustomProperty(this._name);
+ setAttributeValue = false;
+ }
+ }
+ }
+
+ // Set custom attribute value
+ if( setAttributeValue )
+ {
+ customAttr.DataPointCustomProperties[this._name] = stringValue;
+ }
+ }
+ customAttr.DataPointCustomProperties.CustomProperties = customAttr.DataPointCustomProperties.CustomProperties;
+
+ IChangeTracking changeTracking = component as IChangeTracking;
+ if (changeTracking != null)
+ {
+ changeTracking.AcceptChanges();
+ }
+
+ }
+
+ /// <summary>
+ /// Checks if specified value is the default value of the attribute.
+ /// </summary>
+ /// <param name="val">Value to check.</param>
+ /// <returns>True if specified value is the default attribute value.</returns>
+ public bool IsDefaultValue(string val)
+ {
+ // Get default value string
+ string defaultValue = GetStringFromValue(this._customAttributeInfo.DefaultValue);
+ return (String.Compare(val, defaultValue, StringComparison.Ordinal) == 0);
+ }
+
+ /// <summary>
+ /// Gets value from string a native type of attribute.
+ /// </summary>
+ /// <param name="obj">Object to convert to string.</param>
+ /// <returns>String representation of the specified object.</returns>
+ public virtual object GetValueFromString(object obj)
+ {
+ object result = null;
+ if(obj != null)
+ {
+ if(this._customAttributeInfo.ValueType == obj.GetType() )
+ {
+ return obj;
+ }
+
+ string stringValue = obj as string;
+ if (stringValue != null)
+ {
+ if(this._customAttributeInfo.ValueType == typeof(string) )
+ {
+ result = stringValue;
+ }
+ else if(this._customAttributeInfo.ValueType == typeof(float) )
+ {
+ result = float.Parse(stringValue, System.Globalization.CultureInfo.InvariantCulture);
+ }
+ else if(this._customAttributeInfo.ValueType == typeof(double) )
+ {
+ result = double.Parse(stringValue, System.Globalization.CultureInfo.InvariantCulture);
+ }
+ else if(this._customAttributeInfo.ValueType == typeof(int) )
+ {
+ result = int.Parse(stringValue, System.Globalization.CultureInfo.InvariantCulture);
+ }
+ else if(this._customAttributeInfo.ValueType == typeof(bool) )
+ {
+ result = bool.Parse(stringValue);
+ }
+ else if(this._customAttributeInfo.ValueType == typeof(Color) )
+ {
+ ColorConverter colorConverter = new ColorConverter();
+ result = (Color)colorConverter.ConvertFromString(null, System.Globalization.CultureInfo.InvariantCulture, stringValue);
+ }
+ else if(this._customAttributeInfo.ValueType.IsEnum)
+ {
+ result = Enum.Parse(this._customAttributeInfo.ValueType, stringValue, true);
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionCustomAttributeTypeUnsupported( this._customAttributeInfo.ValueType.ToString() )));
+ }
+
+ }
+ }
+ return result;
+ }
+
+
+ /// <summary>
+ /// Converts attribute value to string.
+ /// </summary>
+ /// <param name="value">Attribute value to convert.</param>
+ /// <returns>Return attribute value converted to string.</returns>
+ public string GetStringFromValue(object value)
+ {
+ if(value is Color)
+ {
+ ColorConverter colorConverter = new ColorConverter();
+ return colorConverter.ConvertToString(null, System.Globalization.CultureInfo.InvariantCulture, value);
+ }
+ else if(value is float)
+ {
+ return ((float)value).ToString(System.Globalization.CultureInfo.InvariantCulture);
+ }
+ else if(value is double)
+ {
+ return ((double)value).ToString(System.Globalization.CultureInfo.InvariantCulture);
+ }
+ else if(value is int)
+ {
+ return ((int)value).ToString(System.Globalization.CultureInfo.InvariantCulture);
+ }
+ else if(value is bool)
+ {
+ return ((bool)value).ToString();
+ }
+
+ return value.ToString();
+ }
+
+ /// <summary>
+ /// Validates attribute value. Method throws exception in case of any issues.
+ /// </summary>
+ /// <param name="attrName">Attribute name.</param>
+ /// <param name="value">Attribute value to validate.</param>
+ [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily",
+ Justification = "Too large of a code change to justify making this change")]
+ public virtual void ValidateValue(string attrName, object value)
+ {
+ // Check for validation rules
+ if(this._customAttributeInfo == null)
+ {
+ return;
+ }
+
+ // Check if property Min/Max value is provided
+ bool outOfRange = false;
+ if(this._customAttributeInfo.MaxValue != null)
+ {
+ if(value.GetType() != this._customAttributeInfo.MaxValue.GetType())
+ {
+ throw(new InvalidOperationException(SR.ExceptionCustomAttributeTypeOrMaximumPossibleValueInvalid( attrName ) ) );
+ }
+
+ if(value is float)
+ {
+ if((float)value > (float)this._customAttributeInfo.MaxValue)
+ {
+ outOfRange = true;
+ }
+ }
+ else if(value is double)
+ {
+ if((double)value > (double)this._customAttributeInfo.MaxValue)
+ {
+ outOfRange = true;
+ }
+ }
+ else if(value is int)
+ {
+ if((int)value > (int)this._customAttributeInfo.MaxValue)
+ {
+ outOfRange = true;
+ }
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionCustomAttributeTypeOrMinimumPossibleValueUnsupported(attrName)));
+ }
+
+ }
+
+ // Check if property Min value is provided
+ if(this._customAttributeInfo.MinValue != null)
+ {
+ if(value.GetType() != this._customAttributeInfo.MinValue.GetType())
+ {
+ throw (new InvalidOperationException(SR.ExceptionCustomAttributeTypeOrMinimumPossibleValueInvalid( attrName ) ) );
+ }
+
+ if(value is float)
+ {
+ if((float)value < (float)this._customAttributeInfo.MinValue)
+ {
+ outOfRange = true;
+ }
+ }
+ else if(value is double)
+ {
+ if((double)value < (double)this._customAttributeInfo.MinValue)
+ {
+ outOfRange = true;
+ }
+ }
+ else if(value is int)
+ {
+ if((int)value < (int)this._customAttributeInfo.MinValue)
+ {
+ outOfRange = true;
+ }
+ }
+ else
+ {
+ throw(new InvalidOperationException(SR.ExceptionCustomAttributeTypeOrMinimumPossibleValueUnsupported(attrName)));
+ }
+ }
+
+ // Value out of range exception
+ if(outOfRange)
+ {
+ if(this._customAttributeInfo.MaxValue != null && this._customAttributeInfo.MinValue != null)
+ {
+ throw(new InvalidOperationException(SR.ExceptionCustomAttributeMustBeInRange(attrName, this._customAttributeInfo.MinValue.ToString(),this._customAttributeInfo.MaxValue.ToString() )));
+ }
+ else if(this._customAttributeInfo.MinValue != null)
+ {
+ throw(new InvalidOperationException(SR.ExceptionCustomAttributeMustBeBiggerThenValue(attrName, this._customAttributeInfo.MinValue.ToString())));
+ }
+ else if(this._customAttributeInfo.MaxValue != null)
+ {
+ throw(new InvalidOperationException(SR.ExceptionCustomAttributeMustBeMoreThenValue(attrName, this._customAttributeInfo.MaxValue.ToString())));
+ }
+ }
+ }
+
+ #endregion // Methods
+ }
+
+ #endregion // Custom Attributes Property Descriptor
+ }
+
+
+ /// <summary>
+ /// Property descriptor with ability to dynamically change properties
+ /// of the base property descriptor object.
+ /// </summary>
+ internal class DynamicPropertyDescriptor : PropertyDescriptor
+ {
+ #region Fields
+
+ // Reference to the base property descriptor
+ private PropertyDescriptor _basePropertyDescriptor = null;
+
+ // Dynamic display name of the property
+ private string _displayName = string.Empty;
+
+ #endregion // Fields
+
+ #region Constructor
+
+ /// <summary>
+ /// Constructor of the dynamic property descriptor.
+ /// </summary>
+ /// <param name="basePropertyDescriptor">Base property descriptor.</param>
+ /// <param name="displayName">New display name of the property.</param>
+ public DynamicPropertyDescriptor(
+ PropertyDescriptor basePropertyDescriptor,
+ string displayName)
+ : base(basePropertyDescriptor)
+ {
+ this._displayName = displayName;
+ this._basePropertyDescriptor = basePropertyDescriptor;
+ }
+
+ #endregion // Constructor
+
+ #region Properties
+
+ /// <summary>
+ /// Gets the type of the component this property is bound to.
+ /// </summary>
+ public override Type ComponentType
+ {
+ get
+ {
+ return _basePropertyDescriptor.ComponentType;
+ }
+ }
+
+ /// <summary>
+ /// Gets the name that can be displayed in a window, such as a Properties window.
+ /// </summary>
+ public override string DisplayName
+ {
+ get
+ {
+ if(this._displayName.Length > 0)
+ {
+ return this._displayName;
+ }
+ return this._basePropertyDescriptor.DisplayName;
+ }
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether this property is browsable.
+ /// </summary>
+ public override bool IsBrowsable
+ {
+ get
+ {
+ return this._basePropertyDescriptor.IsBrowsable;
+ }
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether this property is read-only.
+ /// </summary>
+ public override bool IsReadOnly
+ {
+ get
+ {
+ return this._basePropertyDescriptor.IsReadOnly;
+ }
+ }
+
+ /// <summary>
+ /// Gets the type of the property.
+ /// </summary>
+ public override Type PropertyType
+ {
+ get
+ {
+ return this._basePropertyDescriptor.PropertyType;
+ }
+ }
+
+ #endregion // Properties
+
+ #region Methods
+
+ /// <summary>
+ /// Returns whether resetting an object changes its value.
+ /// </summary>
+ /// <param name="component">The component to test for reset capability.</param>
+ /// <returns>true if resetting the component changes its value; otherwise, false.</returns>
+ public override bool CanResetValue(object component)
+ {
+ return _basePropertyDescriptor.CanResetValue(component);
+ }
+
+ /// <summary>
+ /// Gets the current value of the property on a component.
+ /// </summary>
+ /// <param name="component">The component with the property for which to retrieve the value.</param>
+ /// <returns>The value of a property for a given component.</returns>
+ public override object GetValue(object component)
+ {
+ return this._basePropertyDescriptor.GetValue(component);
+ }
+
+ /// <summary>
+ /// Resets the value for this property of the component to the default value.
+ /// </summary>
+ /// <param name="component">The component with the property value that is to be reset to the default value.</param>
+ public override void ResetValue(object component)
+ {
+ this._basePropertyDescriptor.ResetValue(component);
+ }
+
+ /// <summary>
+ /// Determines a value indicating whether the value of this property needs to be persisted.
+ /// </summary>
+ /// <param name="component">The component with the property to be examined for persistence.</param>
+ /// <returns>True if the property should be persisted; otherwise, false.</returns>
+ public override bool ShouldSerializeValue(object component)
+ {
+ return this._basePropertyDescriptor.ShouldSerializeValue(component);
+ }
+
+ /// <summary>
+ /// Sets the value of the component to a different value.
+ /// </summary>
+ /// <param name="component">The component with the property value that is to be set.</param>
+ /// <param name="value">The new value.</param>
+ public override void SetValue(object component, object value)
+ {
+ this._basePropertyDescriptor.SetValue(component, value);
+ }
+
+ #endregion // Methods
+ }
+
+ internal interface IDataPointCustomPropertiesProvider
+ {
+ DataPointCustomProperties DataPointCustomProperties { get; }
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/DataManagerConverters.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/DataManagerConverters.cs
new file mode 100644
index 00000000000..c72c7a762d4
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/DataManagerConverters.cs
@@ -0,0 +1,899 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: DataManagerConverters.cs
+//
+// Namespace: DataVisualization.Charting.Design
+//
+// Classes: SeriesAreaNameConverter,
+// ChartTypeConverter, SeriesNameConverter,
+// NoNameExpandableObjectConverter, DoubleArrayConverter,
+// DataPointValueConverter, SeriesYValueTypeConverter
+//
+// Purpose: Converter classes for the Series and DataPoint properties.
+//
+// Reviewed: AG - August 7, 2002
+//
+//===================================================================
+
+
+
+using System.ComponentModel.Design.Serialization;
+#region Used Namespaces
+
+using System;
+using System.Resources;
+using System.Collections;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Diagnostics;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Drawing.Design;
+using System.Drawing.Text;
+using System.IO;
+using System.Globalization;
+using System.Data;
+using System.Reflection;
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+ using System.Collections.Generic;
+
+#else
+ using System.Web;
+ using System.Web.UI;
+ using System.Web.UI.WebControls;
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+ namespace System.Web.UI.DataVisualization.Charting
+#endif
+{
+ /// <summary>
+ /// Chart area name converter. Displays list of available areas names
+ /// </summary>
+ internal class SeriesAreaNameConverter : StringConverter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// Standart values supported - return true
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Standard values supported.</returns>
+ public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Standart values are not exclusive - return false
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Non exclusive standard values.</returns>
+ public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// Fill in the list of the chart areas for the series.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Standart values collection.</returns>
+ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
+ {
+ ArrayList values = new ArrayList();
+
+ Chart chart = ConverterHelper.GetChartFromContext(context);
+
+ if (chart != null)
+ {
+ foreach (ChartArea area in chart.ChartAreas)
+ {
+ values.Add(area.Name);
+ }
+ }
+ return new StandardValuesCollection(values);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Chart data source design-time converter. Displays list of available data sources.
+ /// </summary>
+ internal class ChartDataSourceConverter : StringConverter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// Standart values supported - return true
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Standard values supported.</returns>
+ public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Standart values are not exclusive - return false
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Non exclusive standard values.</returns>
+ public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Fill in the list of chart type names.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Standard values collection.</returns>
+ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
+ {
+ ArrayList values = new ArrayList();
+
+ if (context != null && context.Container != null)
+ {
+ // Loop through all components in the container
+ foreach(IComponent comonent in context.Container.Components)
+ {
+ // Check if component can be a data source
+ if(ChartImage.IsValidDataSource(comonent))
+ {
+ // Add component name
+ values.Add(comonent.Site.Name);
+ }
+ }
+ }
+
+ // Add "None" data source
+ values.Add("(none)");
+
+ return new StandardValuesCollection(values);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Series data source members converter.
+ /// </summary>
+ internal class SeriesDataSourceMemberConverter : StringConverter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// Standart values supported - return true
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Standard values supported.</returns>
+ public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Standart values are not exclusive - return false
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Non exclusive standard values.</returns>
+ public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// Fill in the list of the data source members.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Standart values collection.</returns>
+ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
+ {
+ ArrayList values = new ArrayList();
+
+ Chart chart = ConverterHelper.GetChartFromContext(context);
+ object dataSource = null;
+
+ if(chart != null)
+ {
+ if (chart != null && ChartImage.IsValidDataSource(chart.DataSource))
+ {
+ dataSource = chart.DataSource;
+ }
+
+ // Check if it's Y values member
+ bool usedForYValues = false;
+ if (context.PropertyDescriptor != null && context.PropertyDescriptor.Name == "YValueMembers")
+ {
+ usedForYValues = true;
+ }
+
+ // Populate list with all members names
+ ArrayList memberNames = ChartImage.GetDataSourceMemberNames(dataSource, usedForYValues);
+ foreach(string name in memberNames)
+ {
+ values.Add(name);
+ }
+
+ values.Add("(none)");
+ }
+
+ return new StandardValuesCollection(values);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Chart legend name converter. Displays list of available legend names
+ /// </summary>
+ internal class SeriesLegendNameConverter : StringConverter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// Standart values supported - return true
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Standard values supported.</returns>
+ public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Standart values are not exclusive - return false
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Non exclusive standard values.</returns>
+ public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// Fill in the list of the chart legend for the series.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Standart values collection.</returns>
+ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
+ {
+ ArrayList values = new ArrayList();
+
+ Chart chart = ConverterHelper.GetChartFromContext(context);
+
+ if (chart != null)
+ {
+ foreach (Legend legend in chart.Legends)
+ {
+ values.Add(legend.Name);
+ }
+ }
+
+ return new StandardValuesCollection(values);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Chart type converter. Displays list of available chart type names
+ /// </summary>
+ internal class ChartTypeConverter : StringConverter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// Standart values supported - return true
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Standard values supported.</returns>
+ public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Standart values are not exclusive - return false
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Non exclusive standard values.</returns>
+ public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Fill in the list of chart type names.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Standard values collection.</returns>
+ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
+ {
+ ChartTypeRegistry registry = null;
+ ArrayList values = new ArrayList();
+
+ Chart chart = ConverterHelper.GetChartFromContext(context);
+ if (chart!=null)
+ {
+ // Get chart type registry service
+ registry = (ChartTypeRegistry)chart.GetService(typeof(ChartTypeRegistry));
+ if(registry != null)
+ {
+ // Enumerate all chart types names
+ foreach(Object obj in registry.registeredChartTypes.Keys)
+ {
+ if(obj is string)
+ {
+ values.Add(obj);
+ }
+ }
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionEditorChartTypeRegistryServiceInaccessible));
+ }
+ }
+
+ // Sort all values
+ values.Sort();
+
+ return new StandardValuesCollection(values);
+ }
+
+ #endregion
+ }
+
+
+ /// <summary>
+ /// Data series name converter. Displays list of available series names
+ /// </summary>
+ internal class SeriesNameConverter : StringConverter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// Standart values supported - return true
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Standard values supported.</returns>
+ public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Standart values are not exclusive - return false
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Non exclusive standard values.</returns>
+ public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// Fill in the list of data series names.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Standard values collection.</returns>
+ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
+ {
+ DataManager dataManager = null;
+ ArrayList values = new ArrayList();
+
+ if (context != null && context.Instance != null)
+ {
+ // Call GetService method using reflection
+ MethodInfo methodInfo = context.Instance.GetType().GetMethod("GetService");
+ if(methodInfo != null)
+ {
+ object[] parameters = new object[1];
+ parameters[0] = typeof(DataManager);
+ dataManager = (DataManager)methodInfo.Invoke(context.Instance, parameters);
+ }
+
+ // If data manager service was seccesfully retrived
+ if(dataManager != null)
+ {
+ foreach(Series series in dataManager.Series)
+ {
+ values.Add(series.Name);
+ }
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionEditorChartTypeRegistryServiceInObjectInaccessible(context.Instance.GetType().ToString())));
+ }
+ }
+
+ return new StandardValuesCollection(values);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Data point properties converter
+ /// </summary>
+ internal class NoNameExpandableObjectConverter : ExpandableObjectConverter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// Overrides the ConvertTo method of TypeConverter.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert.</param>
+ /// <param name="destinationType">Convertion destination type.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+ {
+ if (context != null && context.Instance != null)
+ {
+ if (destinationType == typeof(string))
+ {
+ return "";
+ }
+ }
+
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Converter for the array of doubles
+ /// </summary>
+ internal class DoubleArrayConverter : ArrayConverter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// Overrides the CanConvertFrom method of TypeConverter.
+ /// The ITypeDescriptorContext interface provides the context for the
+ /// conversion. Typically this interface is used at design time to
+ /// provide information about the design-time container.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="sourceType">Convertion source type.</param>
+ /// <returns>Indicates if convertion is possible.</returns>
+ public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
+ {
+ if (sourceType == typeof(string))
+ {
+ return true;
+ }
+ return base.CanConvertFrom(context, sourceType);
+ }
+
+ /// <summary>
+ /// Overrides the ConvertFrom method of TypeConverter.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert from.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
+ {
+ object result = null;
+ bool convertFromDate = false;
+
+ // Try to check if value type is date
+ if (context != null && context.Instance != null)
+ {
+ DataPoint dataPoint = (DataPoint)context.Instance;
+ if(dataPoint.series != null && dataPoint.series.IsYValueDateTime())
+ {
+ convertFromDate = true;
+ }
+ }
+
+ // Can convert from string where each array element is separated by comma
+ string stringValue = value as string;
+ if (stringValue != null)
+ {
+ string[] values = stringValue.Split(new char[] {','});
+ double[] array = new double[values.Length];
+ for(int index = 0; index < values.Length; index ++)
+ {
+ // Try to convert from date-time string format
+ if (convertFromDate)
+ {
+ DateTime valueAsDate;
+ if (DateTime.TryParse(values[index], CultureInfo.InvariantCulture, DateTimeStyles.None, out valueAsDate))
+ {
+ result = valueAsDate;
+ }
+ else if (DateTime.TryParse(values[index], CultureInfo.CurrentCulture, DateTimeStyles.None, out valueAsDate))
+ {
+ result = valueAsDate;
+ }
+ else
+ {
+ result = null;
+ }
+ }
+
+ // Save converted value in the array
+ if(result != null)
+ {
+ array[index] = (double)result;
+ }
+ else
+ {
+ array[index] = CommonElements.ParseDouble(values[index]);
+ }
+ }
+
+ return array;
+ }
+
+ // Call base class
+ return base.ConvertFrom(context, culture, value);
+ }
+
+ /// <summary>
+ /// Overrides the ConvertTo method of TypeConverter.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert.</param>
+ /// <param name="destinationType">Convertion destination type.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+ {
+ bool convertToDate = false;
+
+ // Check if we should convert to date string format
+ if (context != null && context.Instance != null)
+ {
+ DataPoint dataPoint = (DataPoint)context.Instance;
+ if(dataPoint.series != null && dataPoint.series.IsYValueDateTime())
+ {
+ convertToDate = true;
+ }
+ }
+
+
+ if (destinationType == typeof(string))
+ {
+ double[] array = (double[]) value;
+ string result = "";
+
+ foreach(double d in array)
+ {
+ if(convertToDate)
+ {
+ result += DateTime.FromOADate(d).ToString("g", System.Globalization.CultureInfo.InvariantCulture) + ",";
+ }
+ else
+ {
+ result += d.ToString(System.Globalization.CultureInfo.InvariantCulture) + ",";
+ }
+ }
+
+ return result.TrimEnd(',');
+ }
+
+
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Converts data point values to and from date string format
+ /// </summary>
+ internal class DataPointValueConverter : DoubleConverter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// Convert values to date string
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert.</param>
+ /// <param name="destinationType">Convertion destination type.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+ {
+ if (context != null && context.Instance != null)
+ {
+ DataPoint dataPoint = (DataPoint)context.Instance;
+
+ if (destinationType == typeof(string) && dataPoint.series.IsXValueDateTime())
+ {
+ DateTime valueAsSate = DateTime.FromOADate((double)value);
+ return valueAsSate.ToString("g", System.Globalization.CultureInfo.CurrentCulture);
+ }
+ }
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
+
+ /// <summary>
+ /// Convert values from date string.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert from.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
+ {
+ if (context != null && context.Instance != null)
+ {
+ string stringValue = value as string;
+
+ if (stringValue != null)
+ {
+ DataPoint dataPoint = (DataPoint)context.Instance;
+
+ if (dataPoint.series.IsXValueDateTime())
+ {
+ DateTime valueAsSate = DateTime.Parse(stringValue, System.Globalization.CultureInfo.CurrentCulture);
+ return valueAsSate.ToOADate();
+ }
+ }
+ }
+
+ return base.ConvertFrom(context, culture, value);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Removes the String type for Y axes
+ /// </summary>
+ internal class SeriesYValueTypeConverter : EnumConverter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// Public constructor
+ /// </summary>
+ /// <param name="type">Enumeration type.</param>
+ public SeriesYValueTypeConverter(Type type) : base(type)
+ {
+ }
+
+ /// <summary>
+ /// Fill in the list of data series names.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Standard values collection.</returns>
+ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
+ {
+ ArrayList values = new ArrayList();
+
+ // Call base class
+ StandardValuesCollection val = base.GetStandardValues(context);
+
+ // Remove string type
+ foreach(object o in val)
+ {
+ if(o.ToString() != "String")
+ {
+
+ values.Add(o);
+ }
+ }
+
+ return new StandardValuesCollection(values);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Data point properties converter
+ /// </summary>
+ internal class ColorArrayConverter : TypeConverter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// This method overrides CanConvertTo from TypeConverter. This is called when someone
+ /// wants to convert an instance of object to another type. Here,
+ /// only conversion to an InstanceDescriptor is supported.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="destinationType">Destination type.</param>
+ /// <returns>True if object can be converted.</returns>
+ public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
+ {
+ if (destinationType == typeof(string))
+ {
+ return true;
+ }
+
+ // Always call the base to see if it can perform the conversion.
+ return base.CanConvertTo(context, destinationType);
+ }
+
+ /// <summary>
+ /// Overrides the CanConvertFrom method of TypeConverter.
+ /// The ITypeDescriptorContext interface provides the context for the
+ /// conversion. Typically this interface is used at design time to
+ /// provide information about the design-time container.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="sourceType">Convertion source type.</param>
+ /// <returns>Indicates if convertion is possible.</returns>
+ public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
+ {
+ if (sourceType == typeof(string))
+ {
+ return true;
+ }
+ return base.CanConvertFrom(context, sourceType);
+ }
+
+ /// <summary>
+ /// Overrides the ConvertTo method of TypeConverter.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert.</param>
+ /// <param name="destinationType">Convertion destination type.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+ {
+ if (destinationType == typeof(string))
+ {
+ return ColorArrayToString(value as Color[]);
+ }
+
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
+
+ /// <summary>
+ /// Overrides the ConvertFrom method of TypeConverter.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert from.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
+ {
+ // Can convert from string where each array element is separated by comma
+ string stringValue = value as string;
+ if (stringValue != null)
+ {
+ return StringToColorArray(stringValue);
+ }
+
+ // Call base class
+ return base.ConvertFrom(context, culture, value);
+ }
+
+ /// <summary>
+ /// Converts array of colors into string.
+ /// </summary>
+ /// <param name="colors">Colors array.</param>
+ /// <returns>Result string.</returns>
+ public static string ColorArrayToString(Color[] colors)
+ {
+ if(colors != null && colors.GetLength(0) > 0)
+ {
+ ColorConverter colorConverter = new ColorConverter();
+ string result = string.Empty;
+ foreach(Color color in colors)
+ {
+ if(result.Length > 0)
+ {
+ result += "; ";
+ }
+ result += colorConverter.ConvertToInvariantString(color);
+ }
+ return result;
+ }
+ return string.Empty;
+ }
+
+ /// <summary>
+ /// Converts string into array of colors.
+ /// </summary>
+ /// <param name="colorNames">String data.</param>
+ /// <returns>Array of colors.</returns>
+ public static Color[] StringToColorArray(String colorNames)
+ {
+ ColorConverter colorConverter = new ColorConverter();
+ Color[] array = new Color[0];
+ if(colorNames.Length > 0)
+ {
+ string[] colorValues = colorNames.Split(';');
+ array = new Color[colorValues.Length];
+ int index = 0;
+ foreach(string str in colorValues)
+ {
+ array[index++] = (Color)colorConverter.ConvertFromInvariantString(str);
+ }
+ }
+ return array;
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Provides a set of helper methods used by converters
+ /// </summary>
+ internal static class ConverterHelper
+ {
+
+ #region Static
+ /// <summary>
+ /// Gets the chart from context.
+ /// </summary>
+ /// <param name="context">The context.</param>
+ public static Chart GetChartFromContext(ITypeDescriptorContext context)
+ {
+ if (context == null || context.Instance == null)
+ {
+ return null;
+ }
+
+ IChartElement element = context.Instance as IChartElement;
+ if (element != null && element.Common != null)
+ {
+ return element.Common.Chart;
+ }
+
+ IList list = context.Instance as IList;
+ if (list != null && list.Count > 0)
+ {
+ element = list[0] as IChartElement;
+ if (element.Common != null)
+ {
+ return element.Common.Chart;
+ }
+
+ }
+
+ Chart chart = context.Instance as Chart;
+ if (chart != null)
+ {
+ return chart;
+ }
+
+ IServiceProvider provider = context.Instance as IServiceProvider;
+ if (provider != null)
+ {
+ chart = provider.GetService(typeof(Chart)) as Chart;
+ if (chart != null)
+ {
+ return chart;
+ }
+ }
+
+ return null;
+ }
+ #endregion
+ }
+}
+
+
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/ElementPositionConverter.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/ElementPositionConverter.cs
new file mode 100644
index 00000000000..63b3b85e132
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/ElementPositionConverter.cs
@@ -0,0 +1,140 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: ElementPositionConverter.cs
+//
+// Namespace: DataVisualization.Charting.Design
+//
+// Classes: ElementPositionConverter
+//
+// Purpose: Converter of the element position.
+//
+// Reviewed: AG - August 7, 2002
+//
+//===================================================================
+
+
+#region Used Namespaces
+
+using System;
+using System.ComponentModel;
+using System.Drawing;
+using System.Globalization;
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+#else
+ using System.Web.UI.DataVisualization.Charting;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+
+ namespace System.Windows.Forms.DataVisualization.Charting
+
+#else
+ namespace System.Web.UI.DataVisualization.Charting
+#endif
+{
+ /// <summary>
+ /// Element position converter.
+ /// </summary>
+ internal class ElementPositionConverter : ExpandableObjectConverter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// Overrides the CanConvertFrom method of TypeConverter.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="sourceType">Convertion source type.</param>
+ /// <returns>Indicates if convertion is possible.</returns>
+ public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
+ {
+ if(sourceType == typeof(string))
+ {
+ return true;
+ }
+
+ return base.CanConvertFrom(context, sourceType);
+ }
+
+ /// <summary>
+ /// Overrides the CanConvertTo method of TypeConverter.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="destinationType">Destination type.</param>
+ /// <returns>Indicates if convertion is possible.</returns>
+ public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
+ {
+ if (destinationType == typeof(string))
+ {
+ return true;
+ }
+
+ return base.CanConvertTo(context, destinationType);
+ }
+
+ /// <summary>
+ /// Overrides the ConvertTo method of TypeConverter.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert.</param>
+ /// <param name="destinationType">Convertion destination type.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+ {
+ if (destinationType == typeof(string))
+ {
+ return ((ElementPosition)value).ToString();
+ }
+
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
+
+ /// <summary>
+ /// Overrides the ConvertFrom method of TypeConverter.
+ /// Converts from string with comma separated values.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert from.</param>
+ /// <returns>Indicates if convertion is possible.</returns>
+ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
+ {
+ string posValue = value as string;
+ if(posValue != null)
+ {
+ if (String.Compare(posValue, Constants.AutoValue, StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ return new ElementPosition();
+ }
+ else
+ {
+ string[] array = posValue.Split(',');
+ if(array.Length == 4)
+ {
+ return new ElementPosition(
+ float.Parse(array[0], System.Globalization.CultureInfo.CurrentCulture),
+ float.Parse(array[1], System.Globalization.CultureInfo.CurrentCulture),
+ float.Parse(array[2], System.Globalization.CultureInfo.CurrentCulture),
+ float.Parse(array[3], System.Globalization.CultureInfo.CurrentCulture));
+ }
+ else
+ {
+ throw(new ArgumentException( SR.ExceptionElementPositionConverter ));
+ }
+ }
+ }
+ return base.ConvertFrom(context, culture, value);
+ }
+
+ #endregion
+ }
+
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/LegendConverters.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/LegendConverters.cs
new file mode 100644
index 00000000000..b036d17e706
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Converters/LegendConverters.cs
@@ -0,0 +1,502 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: LegendConverters.cs
+//
+// Namespace: DataVisualization.Charting.Design
+//
+// Classes: LegendAreaNameConverter, LegendConverter,
+// SizeEmptyValueConverter, MarginExpandableObjectConverter,
+// IntNanValueConverter
+//
+// Purpose: Converter classes for Legend.
+//
+// Reviewed: AG - August 7, 2002
+//
+//===================================================================
+
+#region Used Namespaces
+
+using System;
+using System.Collections;
+using System.ComponentModel;
+using System.Reflection;
+using System.Globalization;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+#else
+ using System.Web.UI.WebControls;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+ namespace System.Web.UI.DataVisualization.Charting
+#endif
+
+{
+ /// <summary>
+ /// Chart area name converter. Displays list of available areas names
+ /// </summary>
+ internal class LegendAreaNameConverter : StringConverter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// Standart values supported - return true
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Standard values supported.</returns>
+ public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Standart values are not exclusive - return false
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Non exclusive standard values.</returns>
+ public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// Fill in the list of data series names.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Standart values collection.</returns>
+ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
+ {
+ ArrayList values = new ArrayList();
+ values.Add(Constants.NotSetValue);
+
+ ChartAreaCollection areaCollection = null;
+ string areaName = "";
+ if (context != null && context.Instance != null)
+ {
+ if (context.Instance is Legend)
+ {
+ Legend legend = (Legend)context.Instance;
+ if(legend.Common != null && legend.Common.ChartPicture != null)
+ {
+ areaCollection = legend.Common.ChartPicture.ChartAreas;
+ }
+ }
+ else if (context.Instance is ChartArea)
+ {
+ ChartArea area = (ChartArea)context.Instance;
+ if(area.Common != null && area.Common.ChartPicture != null)
+ {
+ areaCollection = area.Common.ChartPicture.ChartAreas;
+ areaName = area.Name;
+ }
+ }
+ else if (context.Instance is Title)
+ {
+ Title title = (Title)context.Instance;
+ if(title.Chart != null && title.Chart.chartPicture != null)
+ {
+ areaCollection = title.Chart.chartPicture.ChartAreas;
+ }
+ }
+
+ else if (context.Instance is Annotation)
+ {
+ Annotation annotation = (Annotation)context.Instance;
+ if(annotation.Chart != null && annotation.Chart.chartPicture != null)
+ {
+ areaCollection = annotation.Chart.chartPicture.ChartAreas;
+ }
+ }
+ else if (context.Instance is IServiceProvider)
+ {
+ IServiceProvider provider = context.Instance as IServiceProvider;
+
+ Chart chart = provider.GetService(typeof(Chart)) as Chart;
+
+ if (chart != null)
+ {
+ areaCollection = chart.ChartAreas;
+ }
+ }
+ else if (context.Instance is Array)
+ {
+ if (((Array)context.Instance).Length > 0 && ((Array)context.Instance).GetValue(0) is Legend)
+ {
+ Legend legend = (Legend)((Array)context.Instance).GetValue(0);
+ if (legend.Common != null && legend.Common.ChartPicture != null)
+ {
+ areaCollection = legend.Common.ChartPicture.ChartAreas;
+ }
+ }
+ else if (((Array)context.Instance).Length > 0 && ((Array)context.Instance).GetValue(0) is ChartArea)
+ {
+ ChartArea area = (ChartArea)((Array)context.Instance).GetValue(0);
+ if (area.Common != null && area.Common.ChartPicture != null)
+ {
+ areaCollection = area.Common.ChartPicture.ChartAreas;
+ }
+ }
+ else if (((Array)context.Instance).Length > 0 && ((Array)context.Instance).GetValue(0) is Title)
+ {
+ Title title = (Title)((Array)context.Instance).GetValue(0);
+ if (title.Chart != null && title.Chart.chartPicture != null)
+ {
+ areaCollection = title.Chart.chartPicture.ChartAreas;
+ }
+ }
+
+ else if (((Array)context.Instance).Length > 0 && ((Array)context.Instance).GetValue(0) is Annotation)
+ {
+ Annotation annotation = (Annotation)((Array)context.Instance).GetValue(0);
+ if (annotation.Chart != null && annotation.Chart.chartPicture != null)
+ {
+ areaCollection = annotation.Chart.chartPicture.ChartAreas;
+ }
+ }
+
+
+ }
+ }
+
+ if (areaCollection != null)
+ {
+ foreach(ChartArea area in areaCollection)
+ {
+ if(area.Name != areaName)
+ {
+ values.Add(area.Name);
+ }
+ }
+ }
+
+ return new StandardValuesCollection(values);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Legend converter
+ /// </summary>
+ internal class LegendConverter : NoNameExpandableObjectConverter
+ {
+ #region Converter methods
+
+#if !Microsoft_CONTROL
+ /// <summary>
+ /// Overrides the GetPropertiesSupported method of TypeConverter.
+ /// Save reference to the descriptor context.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Indicates if properties are supported.</returns>
+ public override bool GetPropertiesSupported(ITypeDescriptorContext context)
+ {
+ if (context != null && context.Instance != null)
+ {
+ // Save current control type descriptor context
+ if(context.Instance is Chart)
+ {
+ Chart.controlCurrentContext = context;
+ }
+ }
+ return base.GetPropertiesSupported(context);
+ }
+#endif // !Microsoft_CONTROL
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Designer converter class
+ /// Converts Size.Emty tofrom "Auto".
+ /// </summary>
+ internal class SizeEmptyValueConverter : System.Drawing.SizeConverter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// Standard values supported - return true
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Standard values supported.</returns>
+ public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Standard values are not exclusive - return false
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Non exclusive standard values.</returns>
+ public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// Fill in the list of predefined values.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
+ {
+ ArrayList values = new ArrayList();
+ values.Add(System.Drawing.Size.Empty);
+
+ return new StandardValuesCollection(values);
+ }
+
+ /// <summary>
+ /// Convert Size.IsEmpty value to string "Auto"
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert.</param>
+ /// <param name="destinationType">Convertion destination type.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
+ {
+ if (destinationType == typeof(string))
+ {
+ if(((System.Drawing.Size)value).IsEmpty)
+ {
+ return Constants.AutoValue;
+ }
+ }
+
+ // Call base class
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
+
+ /// <summary>
+ /// Convert minimum or maximum values from string
+ /// </summary>
+ public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
+ {
+ // If converting from string value
+ string stringValue = value as string;
+ if (stringValue != null)
+ {
+ if (String.Compare(stringValue, Constants.AutoValue, StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ return System.Drawing.Size.Empty;
+ }
+ }
+
+ // Call base converter
+ return base.ConvertFrom(context, culture, value);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Data point properties converter
+ /// </summary>
+ internal class MarginExpandableObjectConverter : ExpandableObjectConverter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// This method overrides CanConvertTo from TypeConverter. This is called when someone
+ /// wants to convert an instance of object to another type. Here,
+ /// only conversion to an InstanceDescriptor is supported.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="destinationType">Destination type.</param>
+ /// <returns>True if object can be converted.</returns>
+ public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
+ {
+ if (destinationType == typeof(string))
+ {
+ return true;
+ }
+
+
+ // Always call the base to see if it can perform the conversion.
+ return base.CanConvertTo(context, destinationType);
+ }
+
+ /// <summary>
+ /// Returns whether this converter can convert an object of the given type
+ /// to the type of this converter, using the specified context.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="sourceType">Source type.</param>
+ /// <returns>True if object can be converted.</returns>
+ public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
+ {
+ if (sourceType == typeof(string))
+ {
+ return true;
+ }
+
+ // Always call the base to see if it can perform the conversion.
+ return base.CanConvertFrom(context, sourceType);
+ }
+
+ /// <summary>
+ /// This code performs the actual conversion from an object to a string.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Object value.</param>
+ /// <param name="destinationType">Destination type.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+ {
+ Margins margins = value as Margins;
+ if (destinationType == typeof(string) && margins != null)
+ {
+ return string.Format(
+ CultureInfo.InvariantCulture,
+ "{0:D}, {1:D}, {2:D}, {3:D}",
+ margins.Top,
+ margins.Bottom,
+ margins.Left,
+ margins.Right);
+ }
+
+ // Always call base, even if you can't convert.
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
+
+ /// <summary>
+ /// Overrides the ConvertFrom method of TypeConverter.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert from.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
+ {
+ // Can convert from string where each array element is separated by comma
+ string stringValue = value as string;
+ if (stringValue != null)
+ {
+ Margins margins = new Margins();
+ string[] values = stringValue.Split(',');
+ if(values.Length == 4)
+ {
+ try
+ {
+ margins.Top = int.Parse(values[0].Trim(), CultureInfo.InvariantCulture);
+ margins.Bottom = int.Parse(values[1].Trim(), CultureInfo.InvariantCulture);
+ margins.Left = int.Parse(values[2].Trim(), CultureInfo.InvariantCulture);
+ margins.Right = int.Parse(values[3].Trim(), CultureInfo.InvariantCulture);
+ }
+ catch
+ {
+ throw (new InvalidOperationException(SR.ExceptionLegendDesignerMarginObjectInvalid(stringValue)));
+ }
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionLegendDesignerMarginObjectInvalid(stringValue)));
+ }
+
+ return margins;
+ }
+
+ // Call base class
+ return base.ConvertFrom(context, culture, value);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Designer converter class
+ /// Converts Integer value -1 to/from "Auto".
+ /// </summary>
+ internal class IntNanValueConverter : Int32Converter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// Standard values supported - return true
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Standard values supported.</returns>
+ public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Standard values are not exclusive - return false
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Non exclusive standard values.</returns>
+ public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// Fill in the list of predefined values.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
+ {
+ ArrayList values = new ArrayList();
+ values.Add(-1);
+
+ return new StandardValuesCollection(values);
+ }
+
+ /// <summary>
+ /// Convert integer value -1 to string "Auto"
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert.</param>
+ /// <param name="destinationType">Convertion destination type.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
+ {
+ int intValue = (int)value;
+ if (destinationType == typeof(string))
+ {
+ if(intValue == -1)
+ {
+ return Constants.AutoValue;
+ }
+ }
+
+ // Call base class
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
+
+ /// <summary>
+ /// Convert minimum or maximum values from string
+ /// </summary>
+ public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
+ {
+ // If converting from string value
+ string stringValue = value as string;
+ if (stringValue != null)
+ {
+ if (String.Compare(stringValue, Constants.AutoValue, StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ return -1;
+ }
+ }
+
+ // Call base converter
+ return base.ConvertFrom(context, culture, value);
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/DataManager/DataManager.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/DataManager/DataManager.cs
new file mode 100644
index 00000000000..51b9afd4932
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/DataManager/DataManager.cs
@@ -0,0 +1,1183 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: DataManager.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting.Data
+//
+// Classes: DataManager
+//
+// Purpose: Series storage and manipulation class.
+//
+// Reviewed: AG - Aug 1, 2002; GS - Aug 7, 2002
+//
+//===================================================================
+
+
+#region Used namespaces
+
+using System;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+
+#if Microsoft_CONTROL
+
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+
+
+#else
+ using System.Web.UI;
+ using System.Web.UI.WebControls;
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.Data
+#else
+ namespace System.Web.UI.DataVisualization.Charting.Data
+#endif
+{
+ /// <summary>
+ /// Data Manager.
+ /// </summary>
+ internal class DataManager : ChartElement, IServiceProvider
+ {
+ #region Fields
+ // Series collection
+ private SeriesCollection _series = null;
+
+ // Servise container reference
+ internal IServiceContainer serviceContainer = null;
+
+ // Chart color palette
+ private ChartColorPalette _colorPalette = ChartColorPalette.BrightPastel;
+
+ #endregion
+
+ #region Constructors and initialization
+
+ /// <summary>
+ /// Data manager public constructor
+ /// </summary>
+ /// <param name="container">Service container object.</param>
+ public DataManager(IServiceContainer container)
+ {
+ if(container == null)
+ {
+ throw(new ArgumentNullException(SR.ExceptionInvalidServiceContainer));
+ }
+ serviceContainer = container;
+ Common = new CommonElements(container);
+ _series = new SeriesCollection(this);
+ }
+
+ /// <summary>
+ /// Returns Data Manager service object.
+ /// </summary>
+ /// <param name="serviceType">Service type requested.</param>
+ /// <returns>Data Manager service object.</returns>
+ [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+ object IServiceProvider.GetService(Type serviceType)
+ {
+ if(serviceType == typeof(DataManager))
+ {
+ return this;
+ }
+ throw (new ArgumentException( SR.ExceptionDataManagerUnsupportedType(serviceType.ToString())));
+ }
+
+ /// <summary>
+ /// Initialize data manger object
+ /// </summary>
+ internal void Initialize()
+ {
+ // Attach to the Chart Picture painting events
+ ChartImage chartPicture = (ChartImage)serviceContainer.GetService(typeof(ChartImage));
+ chartPicture.BeforePaint += new EventHandler<ChartPaintEventArgs>(this.ChartPicture_BeforePaint);
+ chartPicture.AfterPaint += new EventHandler<ChartPaintEventArgs>(this.ChartPicture_AfterPaint);
+ }
+
+ #endregion
+
+ #region Chart picture painting events hanlers
+
+ internal override void Invalidate()
+ {
+ base.Invalidate();
+
+#if Microsoft_CONTROL
+ if (Chart!=null)
+ Chart.Invalidate();
+#endif
+ }
+
+
+ /// <summary>
+ /// Event fired when chart picture is going to be painted.
+ /// </summary>
+ /// <param name="sender">Sender object.</param>
+ /// <param name="e">Event arguments.</param>
+ private void ChartPicture_BeforePaint(object sender, ChartPaintEventArgs e)
+ {
+ // Prepare series for drawing
+ int markerIndex = 1;
+ for(int index = 0; index < this.Series.Count; index++)
+ {
+ Series series = this.Series[index];
+
+ // Reset series "X values are zeros" flag
+ series.xValuesZerosChecked = false;
+ series.xValuesZeros = false;
+
+ // Set series colors from palette
+ IChartType chartType = e.CommonElements.ChartTypeRegistry.GetChartType(series.ChartTypeName);
+ bool paletteColorsInPoints = chartType.ApplyPaletteColorsToPoints;
+ // if the series palette is set the we can color all data points, even on column chart.
+ if (series.Palette != ChartColorPalette.None)
+ {
+ paletteColorsInPoints = true;
+ }
+
+ this.PrepareData(
+ paletteColorsInPoints,
+ series.Name);
+
+ // Clear temp. marker style
+ if(series.tempMarkerStyleIsSet)
+ {
+ series.MarkerStyle = MarkerStyle.None;
+ series.tempMarkerStyleIsSet = false;
+ }
+
+ // Set marker style for chart types based on markes
+ if(chartType.GetLegendImageStyle(series) == LegendImageStyle.Marker && series.MarkerStyle == MarkerStyle.None)
+ {
+ series.MarkerStyle = (MarkerStyle)markerIndex++;
+ series.tempMarkerStyleIsSet = true;
+
+ if(markerIndex > 9)
+ {
+ markerIndex = 1;
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Event fired after chart picture was painted.
+ /// </summary>
+ /// <param name="sender">Sender object.</param>
+ /// <param name="e">Event arguments.</param>
+ private void ChartPicture_AfterPaint(object sender, ChartPaintEventArgs e)
+ {
+ Chart control = (Chart)serviceContainer.GetService(typeof(Chart));
+ if(control != null)
+ {
+ // Clean up series after drawing
+ for(int index = 0; index < this.Series.Count; index++)
+ {
+ Series series = this.Series[index];
+ if(series.UnPrepareData(control.Site))
+ {
+ --index;
+ }
+ }
+ }
+ }
+
+ #endregion
+
+ #region Series data preparation methods
+
+ /// <summary>
+ /// Apply palette colors to the data series if UsePaletteColors property is set.
+ /// </summary>
+ internal void ApplyPaletteColors()
+ {
+ ChartColorPalette palette = this.Palette;
+ // switch to default pallette if is none and custom collors array is empty.
+ if (palette == ChartColorPalette.None && this.PaletteCustomColors.Length == 0)
+ {
+ palette = ChartColorPalette.BrightPastel;
+ }
+
+ // Get palette colors
+ int colorIndex = 0;
+ Color[] paletteColors = (palette == ChartColorPalette.None) ?
+ this.PaletteCustomColors : ChartPaletteColors.GetPaletteColors(palette);
+
+ foreach (Series dataSeries in _series)
+ {
+ // Check if chart area name is valid
+ bool validAreaName = false;
+ if (Chart!=null)
+ {
+ validAreaName = Chart.ChartAreas.IsNameReferenceValid(dataSeries.ChartArea);
+ }
+
+ // Change color of the series only if valid chart area name is specified
+ if(validAreaName)
+ {
+ // Change color of the series only if default color is set
+ if(dataSeries.Color == Color.Empty || dataSeries.tempColorIsSet)
+ {
+ dataSeries.color = paletteColors[colorIndex++];
+ dataSeries.tempColorIsSet = true;
+ if(colorIndex >= paletteColors.Length)
+ {
+ colorIndex = 0;
+ }
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Called just before the data from the series to be used to perform these operations:
+ /// - apply palette colors to the data series
+ /// - prepare data in series
+ /// </summary>
+ /// <param name="pointsApplyPaletteColors">If true each data point will be assigned a color from the palette (if it's set)</param>
+ /// <param name="series">List of series indexes, which requires data preparation</param>
+ internal void PrepareData(bool pointsApplyPaletteColors, params string[] series)
+ {
+ this.ApplyPaletteColors();
+
+ // Prepare data in series
+ Chart control = (Chart)serviceContainer.GetService(typeof(Chart));
+ if(control != null)
+ {
+ foreach(string seriesName in series)
+ {
+ this.Series[seriesName].PrepareData(pointsApplyPaletteColors);
+ }
+ }
+ }
+
+ #endregion
+
+ #region Series Min/Max values methods
+
+ /// <summary>
+ /// This method checks if data point should be skipped. This
+ /// method will return true if data point is empty.
+ /// </summary>
+ /// <param name="point">Data point</param>
+ /// <returns>This method returns true if data point is empty.</returns>
+ private bool IsPointSkipped( DataPoint point )
+ {
+ if( point.IsEmpty )
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ /// <summary>
+ /// Gets max number of data points in specified series.
+ /// </summary>
+ /// <param name="series">Series IDs</param>
+ /// <returns>Maximum number of data points</returns>
+ internal int GetNumberOfPoints(params string[] series)
+ {
+ int numberOfPoints = 0;
+ foreach(string seriesName in series)
+ {
+ numberOfPoints = Math.Max(numberOfPoints, this._series[seriesName].Points.Count);
+ }
+ return numberOfPoints;
+ }
+
+ /// <summary>
+ /// Gets maximum Y value from many series
+ /// </summary>
+ /// <param name="valueIndex">Index of Y value to use</param>
+ /// <param name="series">Series IDs</param>
+ /// <returns>Maximum Y value</returns>
+ internal double GetMaxYValue(int valueIndex, params string[] series)
+ {
+ double returnValue = Double.MinValue;
+ foreach(string seriesName in series)
+ {
+ foreach(DataPoint seriesPoint in this._series[seriesName].Points)
+ {
+ // The empty point
+ if( IsPointSkipped( seriesPoint ) )
+ {
+ continue;
+ }
+
+ if(!double.IsNaN(seriesPoint.YValues[valueIndex]))
+ {
+ returnValue = Math.Max(returnValue, seriesPoint.YValues[valueIndex]);
+ }
+ }
+ }
+ return returnValue;
+ }
+
+ /// <summary>
+ /// Get Maximum value for Y and and Radius (Y2) ( used for bubble chart )
+ /// </summary>
+ /// <param name="area">Chart Area</param>
+ /// <param name="series">Series IDs</param>
+ /// <returns>Maximum Y value</returns>
+ internal double GetMaxYWithRadiusValue( ChartArea area, params string[] series )
+ {
+ double returnValue = Double.MinValue;
+ foreach(string seriesName in series)
+ {
+ foreach(DataPoint seriesPoint in this._series[seriesName].Points)
+ {
+ // The empty point
+ if( IsPointSkipped( seriesPoint ) )
+ {
+ continue;
+ }
+
+ if(!double.IsNaN(seriesPoint.YValues[0]))
+ {
+ if (seriesPoint.YValues.Length > 1)
+ {
+ returnValue = Math.Max(returnValue, seriesPoint.YValues[0] + BubbleChart.AxisScaleBubbleSize(area.Common, area, seriesPoint.YValues[1], true));
+ }
+ else
+ {
+ returnValue = Math.Max(returnValue, seriesPoint.YValues[0]);
+ }
+ }
+ }
+ }
+ return returnValue;
+ }
+
+ /// <summary>
+ /// Get Maximum value for X and Radius (Y2) ( used for bubble chart )
+ /// </summary>
+ /// <param name="area">Chart Area</param>
+ /// <param name="series">Series IDs</param>
+ /// <returns>Maximum X value</returns>
+ internal double GetMaxXWithRadiusValue( ChartArea area, params string[] series )
+ {
+ double returnValue = Double.MinValue;
+ foreach(string seriesName in series)
+ {
+ foreach(DataPoint seriesPoint in this._series[seriesName].Points)
+ {
+ // The empty point
+ if( IsPointSkipped( seriesPoint ) )
+ {
+ continue;
+ }
+
+ if(!double.IsNaN(seriesPoint.XValue))
+ {
+ if (seriesPoint.YValues.Length > 1)
+ {
+ returnValue = Math.Max(returnValue, seriesPoint.XValue + BubbleChart.AxisScaleBubbleSize(area.Common, area, seriesPoint.XValue, false));
+ }
+ else
+ {
+ returnValue = Math.Max(returnValue, seriesPoint.XValue);
+ }
+ }
+ }
+ }
+ return returnValue;
+ }
+
+ /// <summary>
+ /// Get Minimum value for X and Radius Y2 ( used for bubble chart )
+ /// </summary>
+ /// <param name="area">Chart Area</param>
+ /// <param name="series">Series IDs</param>
+ /// <returns>Minimum X value</returns>
+ internal double GetMinXWithRadiusValue( ChartArea area, params string[] series )
+ {
+ double returnValue = Double.MaxValue;
+ foreach(string seriesName in series)
+ {
+ foreach(DataPoint seriesPoint in this._series[seriesName].Points)
+ {
+ // The empty point
+ if( IsPointSkipped( seriesPoint ) )
+ {
+ continue;
+ }
+
+ if(!double.IsNaN(seriesPoint.XValue))
+ {
+ if (seriesPoint.YValues.Length > 1)
+ {
+ returnValue = Math.Min(returnValue, seriesPoint.XValue - BubbleChart.AxisScaleBubbleSize(area.Common, area, seriesPoint.YValues[1], false));
+ }
+ else
+ {
+ returnValue = Math.Min(returnValue, seriesPoint.XValue);
+ }
+ }
+ }
+ }
+ return returnValue;
+ }
+
+ /// <summary>
+ /// Gets maximum Y value from many series
+ /// </summary>
+ /// <param name="series">Series IDs</param>
+ /// <returns>Maximum Y value</returns>
+ internal double GetMaxYValue(params string[] series)
+ {
+ double returnValue = Double.MinValue;
+ foreach(string seriesName in series)
+ {
+ foreach(DataPoint seriesPoint in this._series[seriesName].Points)
+ {
+ // The empty point
+ if( IsPointSkipped( seriesPoint ) )
+ {
+ continue;
+ }
+
+ foreach( double y in seriesPoint.YValues )
+ {
+ if(!double.IsNaN(y))
+ {
+ returnValue = Math.Max(returnValue, y);
+ }
+ }
+ }
+ }
+ return returnValue;
+ }
+
+ /// <summary>
+ /// Gets maximum X value from many series
+ /// </summary>
+ /// <param name="series">Series IDs</param>
+ /// <returns>Maximum X value</returns>
+ internal double GetMaxXValue(params string[] series)
+ {
+ double returnValue = Double.MinValue;
+ foreach(string seriesName in series)
+ {
+ foreach(DataPoint seriesPoint in this._series[seriesName].Points)
+ {
+ returnValue = Math.Max(returnValue, seriesPoint.XValue);
+ }
+ }
+ return returnValue;
+ }
+
+ /// <summary>
+ /// Gets minimum and maximum X value from many series.
+ /// </summary>
+ /// <param name="min">Returns maximum X value.</param>
+ /// <param name="max">Returns minimum X value.</param>
+ /// <param name="series">Series IDs</param>
+ internal void GetMinMaxXValue(out double min, out double max, params string[] series)
+ {
+ max = Double.MinValue;
+ min = Double.MaxValue;
+ foreach(string seriesName in series)
+ {
+ foreach(DataPoint seriesPoint in this._series[seriesName].Points)
+ {
+ max = Math.Max(max, seriesPoint.XValue);
+ min = Math.Min(min, seriesPoint.XValue);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets minimum and maximum Y value from many series.
+ /// </summary>
+ /// <param name="valueIndex">Index of Y value to use.</param>
+ /// <param name="min">Returns maximum Y value.</param>
+ /// <param name="max">Returns minimum Y value.</param>
+ /// <param name="series">Series IDs</param>
+ internal void GetMinMaxYValue(int valueIndex, out double min, out double max, params string[] series)
+ {
+ max = Double.MinValue;
+ min = Double.MaxValue;
+ foreach(string seriesName in series)
+ {
+ foreach(DataPoint seriesPoint in this._series[seriesName].Points)
+ {
+ // Skip empty point
+ if( IsPointSkipped( seriesPoint ) )
+ {
+ continue;
+ }
+
+ double yValue = seriesPoint.YValues[valueIndex];
+ if(!double.IsNaN(yValue))
+ {
+ max = Math.Max(max, yValue);
+ min = Math.Min(min, yValue);
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets minimum and maximum Y value from many series.
+ /// </summary>
+ /// <param name="min">Returns maximum Y value.</param>
+ /// <param name="max">Returns minimum Y value.</param>
+ /// <param name="series">Series IDs</param>
+ internal void GetMinMaxYValue(out double min, out double max, params string[] series)
+ {
+ max = Double.MinValue;
+ min = Double.MaxValue;
+ foreach(string seriesName in series)
+ {
+ foreach(DataPoint seriesPoint in this._series[seriesName].Points)
+ {
+ // Skip empty point
+ if( IsPointSkipped( seriesPoint ) )
+ {
+ continue;
+ }
+
+ // Iterate through all Y values
+ foreach( double y in seriesPoint.YValues )
+ {
+ if(!double.IsNaN(y))
+ {
+ max = Math.Max(max, y);
+ min = Math.Min(min, y);
+ }
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets minimum and maximum Y value from many series.
+ /// </summary>
+ /// <param name="seriesList">Series objects list.</param>
+ /// <param name="min">Returns maximum Y value.</param>
+ /// <param name="max">Returns minimum Y value.</param>
+ internal void GetMinMaxYValue(System.Collections.ArrayList seriesList, out double min, out double max)
+ {
+ max = Double.MinValue;
+ min = Double.MaxValue;
+ foreach(Series series in seriesList)
+ {
+ foreach(DataPoint seriesPoint in series.Points)
+ {
+ // Skip empty point
+ if( IsPointSkipped( seriesPoint ) )
+ {
+ continue;
+ }
+
+ // Iterate through all Y values
+ foreach( double y in seriesPoint.YValues )
+ {
+ if(!double.IsNaN(y))
+ {
+ max = Math.Max(max, y);
+ min = Math.Min(min, y);
+ }
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets maximum stacked Y value from many series
+ /// </summary>
+ /// <param name="valueIndex">Index of Y value to use</param>
+ /// <param name="series">Series IDs</param>
+ /// <returns>Maximum stacked Y value</returns>
+ internal double GetMaxStackedYValue(int valueIndex, params string[] series)
+ {
+ double returnValue = 0;
+ double numberOfPoints = GetNumberOfPoints(series);
+ for(int pointIndex = 0; pointIndex < numberOfPoints; pointIndex++)
+ {
+ double stackedMax = 0;
+ double noStackedMax = 0;
+ foreach(string seriesName in series)
+ {
+ if(this._series[seriesName].Points.Count > pointIndex)
+ {
+ // Take chart type from the series
+ ChartTypeRegistry chartTypeRegistry = (ChartTypeRegistry)serviceContainer.GetService(typeof(ChartTypeRegistry));
+ IChartType chartType = chartTypeRegistry.GetChartType(this._series[seriesName].ChartTypeName);
+
+ // If stacked area
+ if( !chartType.StackSign )
+ continue;
+
+ if( chartType.Stacked )
+ {
+ if(this._series[seriesName].Points[pointIndex].YValues[valueIndex] > 0)
+ {
+ stackedMax += this._series[seriesName].Points[pointIndex].YValues[valueIndex];
+ }
+ }
+ else
+ {
+ noStackedMax = Math.Max(noStackedMax,this._series[seriesName].Points[pointIndex].YValues[valueIndex]);
+ }
+ }
+ }
+ stackedMax = Math.Max(stackedMax, noStackedMax);
+ returnValue = Math.Max(returnValue, stackedMax);
+ }
+ return returnValue;
+ }
+
+ /// <summary>
+ /// Gets maximum Unsigned stacked Y value from many series ( Stacked Area chart )
+ /// </summary>
+ /// <param name="valueIndex">Index of Y value to use</param>
+ /// <param name="series">Series IDs</param>
+ /// <returns>Maximum stacked Y value</returns>
+ internal double GetMaxUnsignedStackedYValue(int valueIndex, params string[] series)
+ {
+ double returnValue = 0;
+ double maxValue = Double.MinValue;
+ double numberOfPoints = GetNumberOfPoints(series);
+ for(int pointIndex = 0; pointIndex < numberOfPoints; pointIndex++)
+ {
+ double stackedMax = 0;
+ double noStackedMax = 0;
+ foreach(string seriesName in series)
+ {
+ if (this._series[seriesName].Points.Count > pointIndex)
+ {
+ // Take chart type from the series
+ ChartTypeRegistry chartTypeRegistry = (ChartTypeRegistry)serviceContainer.GetService(typeof(ChartTypeRegistry));
+ IChartType chartType = chartTypeRegistry.GetChartType(this._series[seriesName].ChartTypeName);
+
+ // If stacked column and bar
+ if (chartType.StackSign || double.IsNaN(this._series[seriesName].Points[pointIndex].YValues[valueIndex]))
+ {
+ continue;
+ }
+
+ if (chartType.Stacked)
+ {
+ maxValue = Double.MinValue;
+ stackedMax += this._series[seriesName].Points[pointIndex].YValues[valueIndex];
+ if (stackedMax > maxValue)
+ maxValue = stackedMax;
+ }
+ else
+ {
+ noStackedMax = Math.Max(noStackedMax, this._series[seriesName].Points[pointIndex].YValues[valueIndex]);
+ }
+ }
+ }
+ maxValue = Math.Max(maxValue, noStackedMax);
+ returnValue = Math.Max(returnValue, maxValue);
+ }
+ return returnValue;
+ }
+
+ /// <summary>
+ /// Gets maximum stacked X value from many series
+ /// </summary>
+ /// <param name="series">Series IDs</param>
+ /// <returns>Maximum stacked X value</returns>
+ internal double GetMaxStackedXValue(params string[] series)
+ {
+ double returnValue = 0;
+ double numberOfPoints = GetNumberOfPoints(series);
+ for(int pointIndex = 0; pointIndex < numberOfPoints; pointIndex++)
+ {
+ double doubleIndexValue = 0;
+ foreach(string seriesName in series)
+ {
+ if (this._series[seriesName].Points.Count > pointIndex)
+ {
+ if (this._series[seriesName].Points[pointIndex].XValue > 0)
+ {
+ doubleIndexValue += this._series[seriesName].Points[pointIndex].XValue;
+ }
+ }
+ }
+ returnValue = Math.Max(returnValue, doubleIndexValue);
+ }
+ return returnValue;
+ }
+
+ /// <summary>
+ /// Gets minimum Y value from many series
+ /// </summary>
+ /// <param name="valueIndex">Index of Y value to use</param>
+ /// <param name="series">Series IDs</param>
+ /// <returns>Minimum Y value</returns>
+ internal double GetMinYValue(int valueIndex, params string[] series)
+ {
+ double returnValue = Double.MaxValue;
+ foreach(string seriesName in series)
+ {
+ foreach(DataPoint seriesPoint in this._series[seriesName].Points)
+ {
+ // The empty point
+ if( IsPointSkipped( seriesPoint ) )
+ {
+ continue;
+ }
+
+ if(!double.IsNaN(seriesPoint.YValues[valueIndex]))
+ {
+ returnValue = Math.Min(returnValue, seriesPoint.YValues[valueIndex]);
+ }
+ }
+ }
+ return returnValue;
+ }
+
+ /// <summary>
+ /// Get Minimum value for Y and and Radius (Y2) ( used for bubble chart )
+ /// </summary>
+ /// <param name="area">Chart Area</param>
+ /// <param name="series">Series IDs</param>
+ /// <returns>Minimum Y value</returns>
+ internal double GetMinYWithRadiusValue( ChartArea area, params string[] series )
+ {
+ double returnValue = Double.MaxValue;
+ foreach(string seriesName in series)
+ {
+ foreach(DataPoint seriesPoint in this._series[seriesName].Points)
+ {
+ // The empty point
+ if( IsPointSkipped( seriesPoint ) )
+ {
+ continue;
+ }
+
+ if(!double.IsNaN(seriesPoint.YValues[0]))
+ {
+ if (seriesPoint.YValues.Length > 1)
+ {
+ returnValue = Math.Min(returnValue, seriesPoint.YValues[0] - BubbleChart.AxisScaleBubbleSize(area.Common, area, seriesPoint.YValues[1], true));
+ }
+ else
+ {
+ returnValue = Math.Min(returnValue, seriesPoint.YValues[0]);
+ }
+ }
+ }
+ }
+ return returnValue;
+ }
+
+ /// <summary>
+ /// Gets minimum Y value from many series
+ /// </summary>
+ /// <param name="series">Series IDs</param>
+ /// <returns>Minimum Y value</returns>
+ internal double GetMinYValue(params string[] series)
+ {
+ double returnValue = Double.MaxValue;
+ foreach(string seriesName in series)
+ {
+ foreach(DataPoint seriesPoint in this._series[seriesName].Points)
+ {
+ // The empty point
+ if( IsPointSkipped( seriesPoint ) )
+ {
+ continue;
+ }
+
+ foreach(double y in seriesPoint.YValues)
+ {
+ if(!double.IsNaN(y))
+ {
+ returnValue = Math.Min(returnValue, y);
+ }
+ }
+ }
+ }
+ return returnValue;
+ }
+
+ /// <summary>
+ /// Gets minimum X value from many series
+ /// </summary>
+ /// <param name="series">Series IDs</param>
+ /// <returns>Minimum X value</returns>
+ internal double GetMinXValue(params string[] series)
+ {
+ double returnValue = Double.MaxValue;
+ foreach(string seriesName in series)
+ {
+ foreach(DataPoint seriesPoint in this._series[seriesName].Points)
+ {
+ returnValue = Math.Min(returnValue, seriesPoint.XValue);
+ }
+ }
+ return returnValue;
+ }
+
+ /// <summary>
+ /// Gets minimum stacked Y value from many series
+ /// </summary>
+ /// <param name="valueIndex">Index of Y value to use</param>
+ /// <param name="series">Series IDs</param>
+ /// <returns>Minimum stacked Y value</returns>
+ internal double GetMinStackedYValue(int valueIndex, params string[] series)
+ {
+ double returnValue = Double.MaxValue;
+ double numberOfPoints = GetNumberOfPoints(series);
+ for(int pointIndex = 0; pointIndex < numberOfPoints; pointIndex++)
+ {
+ double stackedMin = 0;
+ double noStackedMin = 0;
+ foreach(string seriesName in series)
+ {
+ if(this._series[seriesName].Points.Count > pointIndex)
+ {
+ // Take chart type from the series
+ ChartTypeRegistry chartTypeRegistry = (ChartTypeRegistry)serviceContainer.GetService(typeof(ChartTypeRegistry));
+ IChartType chartType = chartTypeRegistry.GetChartType(this._series[seriesName].ChartTypeName);
+
+ // If stacked area
+ if( !chartType.StackSign || double.IsNaN(this._series[seriesName].Points[pointIndex].YValues[valueIndex]))
+ continue;
+
+ if( chartType.Stacked )
+ {
+ if(this._series[seriesName].Points[pointIndex].YValues[valueIndex] < 0)
+ {
+ stackedMin += this._series[seriesName].Points[pointIndex].YValues[valueIndex];
+ }
+ }
+ else
+ {
+ noStackedMin = Math.Min(noStackedMin,this._series[seriesName].Points[pointIndex].YValues[valueIndex]);
+ }
+ }
+ }
+ stackedMin = Math.Min(stackedMin, noStackedMin);
+ if( stackedMin == 0 )
+ {
+ stackedMin = this._series[series[0]].Points[this._series[series[0]].Points.Count - 1].YValues[valueIndex];
+ }
+ returnValue = Math.Min(returnValue, stackedMin);
+ }
+ return returnValue;
+ }
+
+ /// <summary>
+ /// Gets minimum Unsigned stacked Y value from many series
+ /// </summary>
+ /// <param name="valueIndex">Index of Y value to use</param>
+ /// <param name="series">Series IDs</param>
+ /// <returns>Minimum stacked Y value</returns>
+ internal double GetMinUnsignedStackedYValue(int valueIndex, params string[] series)
+ {
+ double returnValue = Double.MaxValue;
+ double minValue = Double.MaxValue;
+ double numberOfPoints = GetNumberOfPoints(series);
+ for(int pointIndex = 0; pointIndex < numberOfPoints; pointIndex++)
+ {
+ double stackedMin = 0;
+ double noStackedMin = 0;
+ minValue = Double.MaxValue;
+ foreach(string seriesName in series)
+ {
+ if (this._series[seriesName].Points.Count > pointIndex)
+ {
+ // Take chart type from the series
+ ChartTypeRegistry chartTypeRegistry = (ChartTypeRegistry)serviceContainer.GetService(typeof(ChartTypeRegistry));
+ IChartType chartType = chartTypeRegistry.GetChartType(this._series[seriesName].ChartTypeName);
+
+ // If stacked column and bar
+ if (chartType.StackSign || double.IsNaN(this._series[seriesName].Points[pointIndex].YValues[valueIndex]))
+ {
+ continue;
+ }
+
+ if (chartType.Stacked)
+ {
+ if (this._series[seriesName].Points[pointIndex].YValues[valueIndex] < 0)
+ {
+ stackedMin += this._series[seriesName].Points[pointIndex].YValues[valueIndex];
+ if (stackedMin < minValue)
+ minValue = stackedMin;
+ }
+ }
+ else
+ {
+ noStackedMin = Math.Min(noStackedMin, this._series[seriesName].Points[pointIndex].YValues[valueIndex]);
+ }
+ }
+ }
+ minValue = Math.Min(noStackedMin, minValue);
+ returnValue = Math.Min(returnValue, minValue);
+ }
+ return returnValue;
+ }
+
+ /// <summary>
+ /// Gets minimum stacked X value from many series
+ /// </summary>
+ /// <param name="series">Series IDs</param>
+ /// <returns>Minimum stacked X value</returns>
+ internal double GetMinStackedXValue(params string[] series)
+ {
+ double returnValue = 0;
+ double numberOfPoints = GetNumberOfPoints(series);
+ for(int pointIndex = 0; pointIndex < numberOfPoints; pointIndex++)
+ {
+ double doubleIndexValue = 0;
+ foreach(string seriesName in series)
+ {
+ if(this._series[seriesName].Points[pointIndex].XValue < 0)
+ {
+ doubleIndexValue += this._series[seriesName].Points[pointIndex].XValue;
+ }
+ }
+ returnValue = Math.Min(returnValue, doubleIndexValue);
+ }
+ return returnValue;
+ }
+
+
+ /// <summary>
+ /// Gets maximum hundred percent stacked Y value
+ /// </summary>
+ /// <param name="supportNegative">Indicates that negative values are shown on the other side of the axis.</param>
+ /// <param name="series">Series names</param>
+ /// <returns>Maximum 100% stacked Y value</returns>
+ internal double GetMaxHundredPercentStackedYValue(bool supportNegative, params string[] series)
+ {
+ double returnValue = 0;
+
+ // Convert array of series names into array of series
+ Series[] seriesArray = new Series[series.Length];
+ int seriesIndex = 0;
+ foreach(string seriesName in series)
+ {
+ seriesArray[seriesIndex++] = this._series[seriesName];
+ }
+
+ // Loop through all dat points
+ try
+ {
+ for(int pointIndex = 0; pointIndex < this._series[series[0]].Points.Count; pointIndex++)
+ {
+ // Calculate the total for all series
+ double totalPerPoint = 0;
+ double positiveTotalPerPoint = 0;
+ foreach(Series ser in seriesArray)
+ {
+ if(supportNegative)
+ {
+ totalPerPoint += Math.Abs(ser.Points[pointIndex].YValues[0]);
+ }
+ else
+ {
+ totalPerPoint += ser.Points[pointIndex].YValues[0];
+ }
+
+ if(ser.Points[pointIndex].YValues[0] > 0 || supportNegative == false)
+ {
+ positiveTotalPerPoint += ser.Points[pointIndex].YValues[0];
+ }
+ }
+ totalPerPoint = Math.Abs(totalPerPoint);
+
+ // Calculate percentage of total
+ if(totalPerPoint != 0)
+ {
+ returnValue = Math.Max(returnValue,
+ (positiveTotalPerPoint / totalPerPoint) * 100.0);
+ }
+ }
+ }
+ catch(System.Exception)
+ {
+ throw (new InvalidOperationException(SR.ExceptionDataManager100StackedSeriesPointsNumeberMismatch));
+ }
+
+ return returnValue;
+ }
+
+ /// <summary>
+ /// Gets minimum hundred percent stacked Y value
+ /// </summary>
+ /// <param name="supportNegative">Indicates that negative values are shown on the other side of the axis.</param>
+ /// <param name="series">Series names</param>
+ /// <returns>Minimum 100% stacked Y value</returns>
+ internal double GetMinHundredPercentStackedYValue(bool supportNegative, params string[] series)
+ {
+ double returnValue = 0.0;
+
+ // Convert array of series names into array of series
+ Series[] seriesArray = new Series[series.Length];
+ int seriesIndex = 0;
+ foreach(string seriesName in series)
+ {
+ seriesArray[seriesIndex++] = this._series[seriesName];
+ }
+
+ // Loop through all dat points
+ try
+ {
+ for(int pointIndex = 0; pointIndex < this._series[series[0]].Points.Count; pointIndex++)
+ {
+ // Calculate the total for all series
+ double totalPerPoint = 0;
+ double negativeTotalPerPoint = 0;
+ foreach(Series ser in seriesArray)
+ {
+ if(supportNegative)
+ {
+ totalPerPoint += Math.Abs(ser.Points[pointIndex].YValues[0]);
+ }
+ else
+ {
+ totalPerPoint += ser.Points[pointIndex].YValues[0];
+ }
+
+ if(ser.Points[pointIndex].YValues[0] < 0 || supportNegative == false)
+ {
+ negativeTotalPerPoint += ser.Points[pointIndex].YValues[0];
+ }
+ }
+
+ totalPerPoint = Math.Abs(totalPerPoint);
+
+ // Calculate percentage of total
+ if(totalPerPoint != 0)
+ {
+ returnValue = Math.Min(returnValue,
+ (negativeTotalPerPoint / totalPerPoint) * 100.0);
+ }
+ }
+ }
+ catch(System.Exception)
+ {
+ throw (new InvalidOperationException(SR.ExceptionDataManager100StackedSeriesPointsNumeberMismatch));
+ }
+
+ return returnValue;
+ }
+
+ #endregion
+
+ #region DataManager Properties
+
+ /// <summary>
+ /// Chart series collection.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ Editor(Editors.SeriesCollectionEditor.Editor, Editors.SeriesCollectionEditor.Base),
+ Bindable(true)
+ ]
+ public SeriesCollection Series
+ {
+ get
+ {
+ return _series;
+ }
+ }
+
+ /// <summary>
+ /// Color palette to use
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributePalette"),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ DefaultValue(ChartColorPalette.BrightPastel),
+ Editor(Editors.ColorPaletteEditor.Editor, Editors.ColorPaletteEditor.Base)
+ ]
+ public ChartColorPalette Palette
+ {
+ get
+ {
+ return _colorPalette;
+ }
+ set
+ {
+ _colorPalette = value;
+ }
+ }
+
+ // Array of custom palette colors.
+ private Color[] _paletteCustomColors = new Color[0];
+
+ /// <summary>
+ /// Array of custom palette colors.
+ /// </summary>
+ /// <remarks>
+ /// When this custom colors array is non-empty the <b>Palette</b> property is ignored.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+ SerializationVisibilityAttribute(SerializationVisibility.Attribute),
+ SRDescription("DescriptionAttributeDataManager_PaletteCustomColors"),
+ TypeConverter(typeof(ColorArrayConverter))
+ ]
+ public Color[] PaletteCustomColors
+ {
+ set
+ {
+ this._paletteCustomColors = value;
+ }
+ get
+ {
+ return this._paletteCustomColors;
+ }
+ }
+
+
+
+
+ #endregion
+
+ #region IDisposable Members
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ if (_series != null)
+ {
+ _series.Dispose();
+ _series = null;
+ }
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/DataManager/DataPoint.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/DataManager/DataPoint.cs
new file mode 100644
index 00000000000..de9402c6c5e
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/DataManager/DataPoint.cs
@@ -0,0 +1,7044 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: DataPoint.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting.Data
+//
+// Classes: DataPoint, DataPointCustomProperties, DataPointCollection,
+// DataPointComparer, DataPoint3D, CustomProperties
+//
+// Purpose: Classes related to the Data Points:
+// DataPointCollection - data points collection class
+// DataPoint - data point properties and methods
+// DataPointCustomProperties - data point & series properties
+// DataPointComparer - used for sorting data points in series
+//
+// Reviewed: AG - Aug 1, 2002, GS - Aug 7, 2002
+//
+//===================================================================
+
+
+#region Used namespaces
+
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Data.Common;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Drawing2D;
+using System.Globalization;
+using System.Diagnostics.CodeAnalysis;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Text;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+
+
+ using System.ComponentModel.Design.Serialization;
+ using System.Reflection;
+ using System.CodeDom;
+ using System.Windows.Forms.Design;
+#else
+ using System.Web;
+ using System.Web.UI;
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+ using System.IO;
+
+#endif
+
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+#endif
+ {
+ #region CustomProperties enumeration
+
+ /// <summary>
+ /// Enumeration of common properties names.
+ /// </summary>
+ internal enum CommonCustomProperties
+ {
+ PointName,
+ Label,
+ AxisLabel,
+ LabelFormat,
+ IsValueShownAsLabel,
+ Color,
+ BorderColor,
+ BorderDashStyle,
+ BorderWidth,
+ BackImage,
+ BackImageWrapMode,
+ BackImageAlignment,
+ BackImageTransparentColor,
+ BackGradientStyle,
+ BackSecondaryColor,
+ BackHatchStyle,
+ Font,
+ LabelForeColor,
+ LabelAngle,
+ MarkerStyle,
+ MarkerSize,
+ MarkerImage,
+ MarkerImageTransparentColor,
+ MarkerColor,
+ MarkerBorderColor,
+ MarkerBorderWidth,
+ MapAreaAttributes,
+ PostBackValue,
+ MapAreaType,
+ LegendMapAreaType,
+ LabelMapAreaType,
+ Url,
+ ToolTip,
+ Tag,
+ LegendUrl,
+ LegendToolTip,
+ LegendText,
+ LegendMapAreaAttributes,
+ LegendPostBackValue,
+ IsVisibleInLegend,
+ LabelUrl,
+ LabelToolTip,
+ LabelMapAreaAttributes,
+ LabelPostBackValue,
+ LabelBorderColor,
+ LabelBorderDashStyle,
+ LabelBorderWidth,
+ LabelBackColor,
+ };
+
+ #endregion
+
+ /// <summary>
+ /// Data points comparer class
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeDataPointComparer_DataPointComparer")
+ ]
+ public class DataPointComparer : IComparer<DataPoint>
+ {
+ #region Fields
+
+ // Sorting order
+ private PointSortOrder _sortingOrder = PointSortOrder.Ascending;
+
+ // Sorting value index
+ private int _sortingValueIndex = 1;
+
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// Private default constructor.
+ /// </summary>
+ private DataPointComparer()
+ {
+ }
+
+ /// <summary>
+ /// Data points comparer class constructor.
+ /// </summary>
+ /// <param name="series">Data series.</param>
+ /// <param name="sortOrder">Sorting order.</param>
+ /// <param name="sortBy">Value used for sorting ("X", "Y or Y1", "Y2", ...).</param>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public DataPointComparer(Series series, PointSortOrder sortOrder, string sortBy)
+ {
+ // Check if sorting value is valid
+ sortBy = sortBy.ToUpper(System.Globalization.CultureInfo.InvariantCulture);
+ if(String.Compare(sortBy, "X", StringComparison.Ordinal) == 0)
+ {
+ _sortingValueIndex = -1;
+ }
+ else if (String.Compare(sortBy, "Y", StringComparison.Ordinal) == 0)
+ {
+ _sortingValueIndex = 0;
+ }
+ else if (String.Compare(sortBy, "AXISLABEL", StringComparison.Ordinal) == 0)
+ {
+ _sortingValueIndex = -2;
+ }
+ else if(sortBy.Length == 2 &&
+ sortBy.StartsWith("Y", StringComparison.Ordinal) &&
+ Char.IsDigit(sortBy[1]))
+ {
+ _sortingValueIndex = Int32.Parse(sortBy.Substring(1), System.Globalization.CultureInfo.InvariantCulture) - 1;
+ }
+ else
+ {
+ throw(new ArgumentException( SR.ExceptionDataPointConverterInvalidSorting, "sortBy"));
+ }
+
+ // Check if data series support as many Y values as required
+ if(_sortingValueIndex > 0 && _sortingValueIndex >= series.YValuesPerPoint)
+ {
+ throw(new ArgumentException( SR.ExceptionDataPointConverterUnavailableSorting(sortBy, series.YValuesPerPoint.ToString(System.Globalization.CultureInfo.InvariantCulture) ), "sortBy"));
+ }
+
+ this._sortingOrder = sortOrder;
+ }
+
+ #endregion
+
+ #region Comparing method
+
+ /// <summary>
+ /// Compares two data points.
+ /// </summary>
+ /// <param name="x">First data point.</param>
+ /// <param name="y">Second data point.</param>
+ /// <returns>If the two values are equal, it returns zero. If point 1 is greater than point 2,
+ /// it returns a positive integer; otherwise, it returns a negative integer.
+ /// </returns>
+ public int Compare(DataPoint x, DataPoint y)
+ {
+ int result = -1;
+
+ // Compare X value
+ if(_sortingValueIndex == -1)
+ {
+ result = x.XValue.CompareTo(y.XValue);
+ }
+ // Compare Axis Label value
+ else if(_sortingValueIndex == -2)
+ {
+ result = string.Compare(x.AxisLabel, y.AxisLabel, StringComparison.CurrentCulture);
+ }
+ // Compare one of the Y value(s)
+ else
+ {
+ result = x.YValues[_sortingValueIndex].CompareTo(y.YValues[_sortingValueIndex]);
+ }
+
+ // Invert result depending on the sorting order
+ if(this._sortingOrder == PointSortOrder.Descending)
+ {
+ result = -result;
+ }
+
+ return result;
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// A collection of data points.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeDataPointCollection_DataPointCollection"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+#if !Microsoft_CONTROL
+ [Themeable(false)]
+#endif
+ public class DataPointCollection : ChartElementCollection<DataPoint>
+ {
+ #region Fields
+
+ // Reference to the sereies of data points
+ internal Series series = null;
+
+ #endregion
+
+ #region Constructors and Initialization
+
+ /// <summary>
+ /// Data Point Collection object constructor.
+ /// </summary>
+ /// <param name="series">Series object, which the Data Point Collection belongs to.</param>
+ internal DataPointCollection(Series series) : base(series)
+ {
+ this.series = series;
+ }
+
+ /// <summary>
+ /// Initialize data point series and name.
+ /// </summary>
+ /// <param name="dataPoint">Reference to the data point object to initialize.</param>
+ internal void DataPointInit(ref DataPoint dataPoint)
+ {
+ DataPointInit(this.series, ref dataPoint);
+ }
+
+ /// <summary>
+ /// Initialize data point series and name.
+ /// </summary>
+ /// <param name="series">Series the data point belongs to.</param>
+ /// <param name="dataPoint">Reference to the data point object to initialize.</param>
+ internal static void DataPointInit(Series series, ref DataPoint dataPoint)
+ {
+ dataPoint.series = series;
+
+ if(dataPoint.AxisLabel.Length > 0 && series != null)
+ {
+ series.noLabelsInPoints = false;
+ }
+
+#if Microsoft_CONTROL
+ // Set flag that tooltips flags should be recalculated
+ if(dataPoint.ToolTip.Length > 0 &&
+ dataPoint.LegendToolTip.Length > 0 &&
+ dataPoint.LabelToolTip.Length > 0 &&
+ series != null && series.Chart != null && series.Chart.selection != null)
+ {
+ series.Chart.selection.enabledChecked = false;
+ }
+#endif
+ }
+
+ #endregion
+
+ #region Data point binding, adding and inserting methods
+
+ /// <summary>
+ /// Adds the new DataPoint to a collection and sets its Y values.
+ /// </summary>
+ /// <param name="y">The y.</param>
+ /// <returns></returns>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X and Y are cartesian coordinates and well understood")]
+ public DataPoint Add(params double[] y)
+ {
+ DataPoint point = new DataPoint(0, y);
+ this.Add(point);
+ return point;
+ }
+
+ /// <summary>
+ /// Parse the input parameter with other point attribute binding rule
+ /// in format: PointProperty=Field[{Format}] [,PointProperty=Field[{Format}]].
+ /// For example: "Tooltip=Price{C1},Url=WebSiteName".
+ /// </summary>
+ /// <param name="otherFields">Other fields parameter.</param>
+ /// <param name="otherAttributeNames">Returns array of attribute names.</param>
+ /// <param name="otherFieldNames">Returns array of field names.</param>
+ /// <param name="otherValueFormat">Returns array of format strings.</param>
+ internal static void ParsePointFieldsParameter(
+ string otherFields,
+ ref string[] otherAttributeNames,
+ ref string[] otherFieldNames,
+ ref string[] otherValueFormat)
+ {
+ if(otherFields != null && otherFields.Length > 0)
+ {
+ // Split string by comma
+ otherAttributeNames = otherFields.Replace(",,", "\n").Split(',');
+ otherFieldNames = new string[otherAttributeNames.Length];
+ otherValueFormat = new string[otherAttributeNames.Length];
+
+ // Loop through all strings
+ for(int index = 0; index < otherAttributeNames.Length; index++)
+ {
+ // Split string by equal sign
+ int equalSignIndex = otherAttributeNames[index].IndexOf('=');
+ if(equalSignIndex > 0)
+ {
+ otherFieldNames[index] = otherAttributeNames[index].Substring(equalSignIndex + 1);
+ otherAttributeNames[index] = otherAttributeNames[index].Substring(0, equalSignIndex);
+ }
+ else
+ {
+ throw (new ArgumentException(SR.ExceptionParameterFormatInvalid, "otherFields"));
+ }
+
+ // Check if format string was specified
+ int bracketIndex = otherFieldNames[index].IndexOf('{');
+ if(bracketIndex > 0 && otherFieldNames[index][otherFieldNames[index].Length - 1] == '}')
+ {
+ otherValueFormat[index] = otherFieldNames[index].Substring(bracketIndex + 1);
+ otherValueFormat[index] = otherValueFormat[index].Trim('{', '}');
+ otherFieldNames[index] = otherFieldNames[index].Substring(0, bracketIndex);
+ }
+
+ // Trim and replace new line character
+ otherAttributeNames[index] = otherAttributeNames[index].Trim().Replace("\n", ",");
+ otherFieldNames[index] = otherFieldNames[index].Trim().Replace("\n", ",");
+ if ( otherValueFormat[index] != null )
+ otherValueFormat[index] = otherValueFormat[index].Trim().Replace("\n", ",");
+ }
+ }
+ }
+
+ /// <summary>
+ /// Data bind X, Y and other values (like Tooltip, LabelStyle,...) of the data points to the data source.
+ /// Data source can be the Ole(SQL)DataReader, DataView, DataSet, DataTable or DataRow.
+ /// </summary>
+ /// <param name="dataSource">Data source.</param>
+ /// <param name="xField">Name of the field for X values.</param>
+ /// <param name="yFields">Comma separated names of the fields for Y values.</param>
+ /// <param name="otherFields">Other point properties binding rule in format: PointProperty=Field[{Format}] [,PointProperty=Field[{Format}]]. For example: "Tooltip=Price{C1},Url=WebSiteName".</param>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X and Y are cartesian coordinates and well understood")]
+ public void DataBind(IEnumerable dataSource, string xField, string yFields, string otherFields)
+ {
+ // Check arguments
+ if (dataSource == null)
+ throw new ArgumentNullException("dataSource", SR.ExceptionDataPointInsertionNoDataSource);
+ if (dataSource is string)
+ throw (new ArgumentException(SR.ExceptionDataBindSeriesToString, "dataSource"));
+ if (yFields == null)
+ throw new ArgumentNullException("yFields");
+
+ // Convert comma separated Y values field names string to array of names
+ string[] yFieldNames = yFields.Replace(",,", "\n").Split(',');
+ for(int index = 0; index < yFieldNames.Length; index++)
+ {
+ yFieldNames[index] = yFieldNames[index].Replace("\n", ",");
+ }
+
+ if (yFieldNames.GetLength(0) > series.YValuesPerPoint)
+ throw (new ArgumentOutOfRangeException("yFields", SR.ExceptionDataPointYValuesCountMismatch(series.YValuesPerPoint.ToString(System.Globalization.CultureInfo.InvariantCulture))));
+
+ // Convert other fields/properties names to two arrays of names
+ string[] otherAttributeNames = null;
+ string[] otherFieldNames = null;
+ string[] otherValueFormat = null;
+ ParsePointFieldsParameter(
+ otherFields,
+ ref otherAttributeNames,
+ ref otherFieldNames,
+ ref otherValueFormat);
+
+ // Remove all existing data points
+ this.Clear();
+
+ // Get and reset enumerator
+ IEnumerator enumerator = GetDataSourceEnumerator(dataSource);
+ if (enumerator.GetType() != typeof(System.Data.Common.DbEnumerator))
+ {
+ try
+ {
+ enumerator.Reset();
+ }
+ // Some enumerators may not support Resetting
+ catch (InvalidOperationException)
+ {
+ }
+ catch (NotImplementedException)
+ {
+ }
+ catch (NotSupportedException)
+ {
+ }
+ }
+
+ // Add data points
+ bool valueExsist = true;
+ object[] yValuesObj = new object[yFieldNames.Length];
+ object xValueObj = null;
+ bool autoDetectType = true;
+
+ this.SuspendUpdates();
+ try
+ {
+ do
+ {
+ // Move to the next objects in the enumerations
+ if (valueExsist)
+ {
+ valueExsist = enumerator.MoveNext();
+ }
+
+ // Auto detect valu(s) type
+ if (autoDetectType)
+ {
+ autoDetectType = false;
+ AutoDetectValuesType(this.series, enumerator, xField, enumerator, yFieldNames[0]);
+ }
+
+ // Create and initialize data point
+ if (valueExsist)
+ {
+ DataPoint newDataPoint = new DataPoint(series);
+ bool emptyValues = false;
+
+ // Set X to the value provided
+ if (xField.Length > 0)
+ {
+ xValueObj = ConvertEnumerationItem(enumerator.Current, xField);
+ if (IsEmptyValue(xValueObj))
+ {
+ emptyValues = true;
+ xValueObj = 0.0;
+ }
+ }
+
+ // Set Y values
+ if (yFieldNames.Length == 0)
+ {
+ yValuesObj[0] = ConvertEnumerationItem(enumerator.Current, null);
+ if (IsEmptyValue(yValuesObj[0]))
+ {
+ emptyValues = true;
+ yValuesObj[0] = 0.0;
+ }
+ }
+ else
+ {
+ for (int i = 0; i < yFieldNames.Length; i++)
+ {
+ yValuesObj[i] = ConvertEnumerationItem(enumerator.Current, yFieldNames[i]);
+ if (IsEmptyValue(yValuesObj[i]))
+ {
+ emptyValues = true;
+ yValuesObj[i] = 0.0;
+ }
+ }
+ }
+
+ // Set other values
+ if (otherAttributeNames != null &&
+ otherAttributeNames.Length > 0)
+ {
+ for (int i = 0; i < otherFieldNames.Length; i++)
+ {
+ // Get object by field name
+ object obj = ConvertEnumerationItem(enumerator.Current, otherFieldNames[i]);
+ if (!IsEmptyValue(obj))
+ {
+ newDataPoint.SetPointCustomProperty(
+ obj,
+ otherAttributeNames[i],
+ otherValueFormat[i]);
+ }
+ }
+ }
+
+ // IsEmpty value was detected
+ if (emptyValues)
+ {
+ if (xValueObj != null)
+ {
+ newDataPoint.SetValueXY(xValueObj, yValuesObj);
+ }
+ else
+ {
+ newDataPoint.SetValueXY(0, yValuesObj);
+ }
+ DataPointInit(ref newDataPoint);
+ newDataPoint.IsEmpty = true;
+ this.Add(newDataPoint);
+ }
+ else
+ {
+ if (xValueObj != null)
+ {
+ newDataPoint.SetValueXY(xValueObj, yValuesObj);
+ }
+ else
+ {
+ newDataPoint.SetValueXY(0, yValuesObj);
+ }
+ DataPointInit(ref newDataPoint);
+ this.Add(newDataPoint);
+ }
+ }
+
+ } while (valueExsist);
+
+ }
+ finally
+ {
+ this.ResumeUpdates();
+ }
+ }
+
+ /// <summary>
+ /// Data bind Y values of the data points to the data source.
+ /// Data source can be the Array, Collection, Ole(SQL)DataReader, DataView, DataSet, DataTable or DataRow.
+ /// </summary>
+ /// <param name="yValue">One or more enumerable objects with Y values.</param>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "Y is a cartesian coordinate and well understood")]
+ public void DataBindY(params IEnumerable[] yValue)
+ {
+ DataBindXY(null, yValue);
+ }
+
+ /// <summary>
+ /// Data bind X and Y values of the data points to the data source.
+ /// Data source can be the Array, Collection, Ole(SQL)DataReader, DataView, DataSet, DataTable or DataRow.
+ /// </summary>
+ /// <param name="xValue">Enumerable objects with X values.</param>
+ /// <param name="yValues">One or more enumerable objects with Y values.</param>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X and Y are cartesian coordinates and well understood")]
+ public void DataBindXY(IEnumerable xValue, params IEnumerable[] yValues)
+ {
+ // Y value must be provided
+ if (yValues == null ||
+ yValues.Length==1 && yValues[0]==null)
+ throw new ArgumentNullException("yValues");
+ if (yValues.GetLength(0) == 0)
+ throw new ArgumentException(SR.ExceptionDataPointBindingYValueNotSpecified, "yValues");
+
+ // Double check that a string object is not provided for data binding
+ for(int i = 0; i < yValues.Length; i++)
+ {
+ if(yValues[i] is string)
+ {
+ throw (new ArgumentException(SR.ExceptionDataBindYValuesToString, "yValues"));
+ }
+ }
+
+ // Check if number of Y values do not out of range
+ if(yValues.GetLength(0) > series.YValuesPerPoint)
+ {
+ throw(new ArgumentOutOfRangeException("yValues", SR.ExceptionDataPointYValuesBindingCountMismatch( series.YValuesPerPoint.ToString(System.Globalization.CultureInfo.InvariantCulture) ) ) );
+ }
+
+ // Remove all existing data points
+ this.Clear();
+
+ // Reset X, Y enumerators
+ IEnumerator xEnumerator = null;
+ IEnumerator[] yEnumerator = new IEnumerator[yValues.GetLength(0)];
+ if(xValue != null)
+ {
+ // Double check that a string object is not provided for data binding
+ if(xValue is string)
+ {
+ throw (new ArgumentException(SR.ExceptionDataBindXValuesToString, "xValue"));
+ }
+
+ // Get and reset Y values enumerators
+ xEnumerator = GetDataSourceEnumerator(xValue);
+ if(xEnumerator.GetType() != typeof(System.Data.Common.DbEnumerator))
+ {
+ xEnumerator.Reset();
+ }
+ }
+ for(int i = 0; i < yValues.Length; i++)
+ {
+ // Get and reset Y values enumerators
+ yEnumerator[i] = GetDataSourceEnumerator(yValues[i]);
+ if(yEnumerator[i].GetType() != typeof(System.Data.Common.DbEnumerator))
+ {
+ yEnumerator[i].Reset();
+ }
+ }
+
+ // Add data points
+ bool xValueExsist = false;
+ bool yValueExsist = true;
+ object[] yValuesObj = new object[series.YValuesPerPoint];
+ object xValueObj = null;
+ bool autoDetectType = true;
+
+ SuspendUpdates();
+ try
+ {
+ do
+ {
+ // Move to the next objects in the enumerations
+ yValueExsist = true;
+ for (int i = 0; i < yValues.Length; i++)
+ {
+ if (yValueExsist)
+ {
+ yValueExsist = yEnumerator[i].MoveNext();
+ }
+ }
+ if (xValue != null)
+ {
+ xValueExsist = xEnumerator.MoveNext();
+ if (yValueExsist && !xValueExsist)
+ {
+ throw (new ArgumentOutOfRangeException("xValue", SR.ExceptionDataPointInsertionXValuesQtyIsLessYValues));
+ }
+ }
+
+ // Auto detect value(s) type
+ if (autoDetectType)
+ {
+ autoDetectType = false;
+ AutoDetectValuesType(this.series, xEnumerator, null, yEnumerator[0], null);
+ }
+
+ // Create and initialize data point
+ if (xValueExsist || yValueExsist)
+ {
+ DataPoint newDataPoint = new DataPoint(series);
+ bool emptyValues = false;
+
+ // Set X to the value provided
+ if (xValueExsist)
+ {
+ xValueObj = ConvertEnumerationItem(xEnumerator.Current, null);
+ if (xValueObj is System.DBNull || xValueObj == null)
+ {
+ emptyValues = true;
+ xValueObj = 0.0;
+ }
+ }
+
+ // Set Y values
+ for (int i = 0; i < yValues.Length; i++)
+ {
+ yValuesObj[i] = ConvertEnumerationItem(yEnumerator[i].Current, null);
+ if (yValuesObj[i] is System.DBNull || yValuesObj[i] == null)
+ {
+ emptyValues = true;
+ yValuesObj[i] = 0.0;
+ }
+ }
+
+ // IsEmpty value was detected
+ if (emptyValues)
+ {
+ if (xValueObj != null)
+ {
+ newDataPoint.SetValueXY(xValueObj, yValuesObj);
+ }
+ else
+ {
+ newDataPoint.SetValueXY(0, yValuesObj);
+ }
+ DataPointInit(ref newDataPoint);
+ newDataPoint.IsEmpty = true;
+ this.Add(newDataPoint);
+ }
+ else
+ {
+ if (xValueObj != null)
+ {
+ newDataPoint.SetValueXY(xValueObj, yValuesObj);
+ }
+ else
+ {
+ newDataPoint.SetValueXY(0, yValuesObj);
+ }
+ DataPointInit(ref newDataPoint);
+ this.Add(newDataPoint);
+ }
+
+ }
+
+ } while (xValueExsist || yValueExsist);
+
+ }
+ finally
+ {
+ this.ResumeUpdates();
+ }
+ }
+
+ /// <summary>
+ /// Data bind Y values of the data points to the data source.
+ /// Data source can be the Array, Collection, Ole(SQL)DataReader, DataView, DataSet, DataTable or DataRow.
+ /// </summary>
+ /// <param name="yValue">Enumerable objects with Y values.</param>
+ /// <param name="yFields">Name of the fields for Y values.</param>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X and Y are cartesian coordinates and well understood")]
+ public void DataBindY(IEnumerable yValue, string yFields)
+ {
+ DataBindXY(null, null, yValue, yFields);
+ }
+
+ /// <summary>
+ /// Data bind X and Y values of the data points to the data source.
+ /// Data source can be the Array, Collection, Ole(SQL)DataReader, DataView, DataSet, DataTable or DataRow.
+ /// </summary>
+ /// <param name="xValue">Enumerable object with X values.</param>
+ /// <param name="xField">Name of the field for X values.</param>
+ /// <param name="yValue">Enumerable objects with Y values.</param>
+ /// <param name="yFields">Comma separated names of the fields for Y values.</param>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X and Y are cartesian coordinates and well understood")]
+ public void DataBindXY(IEnumerable xValue, string xField, IEnumerable yValue, string yFields)
+ {
+ // Check arguments
+ if (xValue is string)
+ throw new ArgumentException(SR.ExceptionDataBindXValuesToString, "xValue");
+ if (yValue == null)
+ throw new ArgumentNullException("yValue", SR.ExceptionDataPointInsertionYValueNotSpecified);
+ if (yValue is string)
+ throw new ArgumentException(SR.ExceptionDataBindYValuesToString, "yValue");
+ if (yFields == null)
+ throw new ArgumentOutOfRangeException("yFields", SR.ExceptionDataPointYValuesCountMismatch(series.YValuesPerPoint.ToString(System.Globalization.CultureInfo.InvariantCulture)));
+
+ // Convert comma separated field names string to array of names
+ string[] yFieldNames = yFields.Replace(",,", "\n").Split(',');;
+ for(int index = 0; index < yFieldNames.Length; index++)
+ {
+ yFieldNames[index] = yFieldNames[index].Replace("\n", ",");
+ }
+ if (yFieldNames.GetLength(0) > series.YValuesPerPoint)
+ throw new ArgumentOutOfRangeException("yFields", SR.ExceptionDataPointYValuesCountMismatch(series.YValuesPerPoint.ToString(System.Globalization.CultureInfo.InvariantCulture)));
+
+ // Remove all existing data points
+ this.Clear();
+
+ // Reset X, Y enumerators
+ IEnumerator xEnumerator = null;
+ IEnumerator yEnumerator = GetDataSourceEnumerator(yValue);
+
+ if(yEnumerator.GetType() != typeof(System.Data.Common.DbEnumerator))
+ {
+ yEnumerator.Reset();
+ }
+
+ if(xValue != null)
+ {
+ if(xValue != yValue)
+ {
+ xEnumerator = GetDataSourceEnumerator(xValue);
+ if(xEnumerator.GetType() != typeof(System.Data.Common.DbEnumerator))
+ {
+ xEnumerator.Reset();
+ }
+ }
+ else
+ {
+ xEnumerator = yEnumerator;
+ }
+ }
+
+ // Add data points
+ bool xValueExsist = false;
+ bool yValueExsist = true;
+ object[] yValuesObj = new object[yFieldNames.Length];
+ object xValueObj = null;
+ bool autoDetectType = true;
+
+ this.SuspendUpdates();
+ try
+ {
+ do
+ {
+ // Move to the next objects in the enumerations
+ if (yValueExsist)
+ {
+ yValueExsist = yEnumerator.MoveNext();
+ }
+ if (xValue != null)
+ {
+ if (xValue != yValue)
+ {
+ xValueExsist = xEnumerator.MoveNext();
+ if (yValueExsist && !xValueExsist)
+ {
+ throw (new ArgumentOutOfRangeException("xValue", SR.ExceptionDataPointInsertionXValuesQtyIsLessYValues));
+ }
+ }
+ else
+ {
+ xValueExsist = yValueExsist;
+ }
+ }
+
+ // Auto detect valu(s) type
+ if (autoDetectType)
+ {
+ autoDetectType = false;
+ AutoDetectValuesType(this.series, xEnumerator, xField, yEnumerator, yFieldNames[0]);
+ }
+
+ // Create and initialize data point
+ if (xValueExsist || yValueExsist)
+ {
+ DataPoint newDataPoint = new DataPoint(series);
+ bool emptyValues = false;
+
+ // Set X to the value provided or use sequence numbers starting with 1
+ if (xValueExsist)
+ {
+ xValueObj = ConvertEnumerationItem(xEnumerator.Current, xField);
+ if (IsEmptyValue(xValueObj))
+ {
+ emptyValues = true;
+ xValueObj = 0.0;
+ }
+
+ }
+
+ if (yFieldNames.Length == 0)
+ {
+ yValuesObj[0] = ConvertEnumerationItem(yEnumerator.Current, null);
+ if (IsEmptyValue(yValuesObj[0]))
+ {
+ emptyValues = true;
+ yValuesObj[0] = 0.0;
+ }
+ }
+ else
+ {
+ for (int i = 0; i < yFieldNames.Length; i++)
+ {
+ yValuesObj[i] = ConvertEnumerationItem(yEnumerator.Current, yFieldNames[i]);
+ if (IsEmptyValue(yValuesObj[i]))
+ {
+ emptyValues = true;
+ yValuesObj[i] = 0.0;
+ }
+ }
+ }
+
+ // IsEmpty value was detected
+ if (emptyValues)
+ {
+ if (xValueObj != null)
+ {
+ newDataPoint.SetValueXY(xValueObj, yValuesObj);
+ }
+ else
+ {
+ newDataPoint.SetValueXY(0, yValuesObj);
+ }
+ DataPointInit(ref newDataPoint);
+ newDataPoint.IsEmpty = true;
+ this.Add(newDataPoint);
+ }
+ else
+ {
+ if (xValueObj != null)
+ {
+ newDataPoint.SetValueXY(xValueObj, yValuesObj);
+ }
+ else
+ {
+ newDataPoint.SetValueXY(0, yValuesObj);
+ }
+ DataPointInit(ref newDataPoint);
+ this.Add(newDataPoint);
+ }
+ }
+
+ } while (xValueExsist || yValueExsist);
+
+ }
+ finally
+ {
+ this.ResumeUpdates();
+ }
+ }
+
+ /// <summary>
+ /// Returns true if objet represents an empty value.
+ /// </summary>
+ /// <param name="val">Value to test.</param>
+ /// <returns>True if empty.</returns>
+ internal static bool IsEmptyValue(object val)
+ {
+ if(val is System.DBNull || val == null)
+ {
+ return true;
+ }
+ if(val is double && double.IsNaN((double)val))
+ {
+ return true;
+ }
+ if(val is Single && Single.IsNaN((Single)val))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ /// <summary>
+ /// Adds one data point with one Y value.
+ /// </summary>
+ /// <param name="yValue">Y value of the data point.</param>
+ /// <returns>Index of newly added data point.</returns>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "Y is a cartesian coordinate and well understood")]
+ public int AddY(double yValue)
+ {
+ // Create new point object
+ DataPoint newDataPoint = new DataPoint(series);
+ newDataPoint.SetValueY(yValue);
+ DataPointInit(ref newDataPoint);
+ Add(newDataPoint);
+ return Count - 1;
+ }
+
+ /// <summary>
+ /// Adds one data point with one or more Y values.
+ /// </summary>
+ /// <param name="yValue">List of Y values of the data point.</param>
+ /// <returns>Index of newly added data point.</returns>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "Y is a cartesian coordinate and well understood")]
+ public int AddY(params object[] yValue)
+ {
+ //Check arguments
+ if (yValue == null ||
+ yValue.Length==1 && yValue[0]==null)
+ throw new ArgumentNullException("yValue");
+
+ // Auto detect DateTime values type
+ if(this.series.YValueType == ChartValueType.Auto &&
+ yValue.Length > 0 &&
+ yValue[0] != null)
+ {
+ if (yValue[0] is DateTime)
+ {
+ this.series.YValueType = ChartValueType.DateTime;
+ this.series.autoYValueType = true;
+ }
+ else if (yValue[0] is DateTimeOffset)
+ {
+ this.series.YValueType = ChartValueType.DateTimeOffset;
+ this.series.autoYValueType = true;
+ }
+ }
+
+ // Create new point object
+ DataPoint newDataPoint = new DataPoint(series);
+ newDataPoint.SetValueY(yValue);
+ DataPointInit(ref newDataPoint);
+ Add(newDataPoint);
+ return Count - 1;
+ }
+
+ /// <summary>
+ /// Adds one data point with X value and one Y value.
+ /// </summary>
+ /// <param name="yValue">Y value of the data point.</param>
+ /// <param name="xValue">X value of the data point.</param>
+ /// <returns>Index of newly added data poit.</returns>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X and Y are cartesian coordinates and well understood")]
+ public int AddXY(double xValue, double yValue)
+ {
+ // Create new point object
+ DataPoint newDataPoint = new DataPoint(series);
+ newDataPoint.SetValueXY(xValue, yValue);
+ DataPointInit(ref newDataPoint);
+ Add(newDataPoint);
+ return Count - 1;
+ }
+
+ /// <summary>
+ /// Adds one data point with X value and one or more Y values.
+ /// </summary>
+ /// <param name="yValue">List of Y values of the data point.</param>
+ /// <param name="xValue">X value of the data point.</param>
+ /// <returns>Index of newly added data poit.</returns>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X and Y are cartesian coordinates and well understood")]
+ public int AddXY(object xValue, params object[] yValue)
+ {
+
+ // Auto detect DateTime and String values type
+ if(this.series.XValueType == ChartValueType.Auto)
+ {
+ if(xValue is DateTime)
+ {
+ this.series.XValueType = ChartValueType.DateTime;
+ }
+ if(xValue is DateTimeOffset)
+ {
+ this.series.XValueType = ChartValueType.DateTimeOffset;
+ }
+ if(xValue is string)
+ {
+ this.series.XValueType = ChartValueType.String;
+ }
+
+ this.series.autoXValueType = true;
+ }
+
+ if(this.series.YValueType == ChartValueType.Auto &&
+ yValue.Length > 0 &&
+ yValue[0] != null)
+ {
+ if (yValue[0] is DateTime)
+ {
+ this.series.YValueType = ChartValueType.DateTime;
+ this.series.autoYValueType = true;
+ }
+ else if (yValue[0] is DateTimeOffset)
+ {
+ this.series.YValueType = ChartValueType.DateTimeOffset;
+ this.series.autoYValueType = true;
+ }
+ }
+
+ // Create new point object
+ DataPoint newDataPoint = new DataPoint(series);
+ newDataPoint.SetValueXY(xValue, yValue);
+ DataPointInit(ref newDataPoint);
+ Add(newDataPoint);
+ return Count - 1;
+ }
+
+ /// <summary>
+ /// Insert one data point with X value and one or more Y values.
+ /// </summary>
+ /// <param name="index">Index after which to insert the data point.</param>
+ /// <param name="xValue">X value of the data point.</param>
+ /// <param name="yValue">List of Y values of the data point.</param>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X and Y are cartesian coordinates and well understood")]
+ public void InsertXY(int index, object xValue, params object[] yValue)
+ {
+ DataPoint newDataPoint = new DataPoint(series);
+ newDataPoint.SetValueXY(xValue, yValue);
+ DataPointInit(ref newDataPoint);
+ this.Insert(index, newDataPoint);
+ }
+
+ /// <summary>
+ /// Insert one data point with one or more Y values.
+ /// </summary>
+ /// <param name="index">Index after which to insert the data point.</param>
+ /// <param name="yValue">List of Y values of the data point.</param>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "Y is a cartesian coordinate and well understood")]
+ public void InsertY(int index, params object[] yValue)
+ {
+ DataPoint newDataPoint = new DataPoint(series);
+ newDataPoint.SetValueY(yValue);
+ DataPointInit(ref newDataPoint);
+ this.Insert(index, newDataPoint);
+ }
+
+ /// <summary>
+ /// Get data source enumerator object helper function.
+ /// </summary>
+ /// <param name="dataSource">Data source.</param>
+ /// <returns>Returns data source enumerator.</returns>
+ internal static IEnumerator GetDataSourceEnumerator(IEnumerable dataSource)
+ {
+ DataView dataView = dataSource as DataView;
+ if(dataView != null)
+ {
+ return dataView.GetEnumerator();
+ }
+ DataSet dataSet = dataSource as DataSet;
+ if(dataSet != null)
+ {
+ if(dataSet.Tables.Count > 0)
+ {
+ return dataSet.Tables[0].Rows.GetEnumerator();
+ }
+ }
+
+ return dataSource.GetEnumerator();
+ }
+
+ /// <summary>
+ /// Convert enumeration item object from DataRow and DataRowView
+ /// to the actual value of specified column in row
+ /// </summary>
+ /// <param name="item">Enumeration item.</param>
+ /// <param name="fieldName">Converted item.</param>
+ /// <returns></returns>
+ internal static object ConvertEnumerationItem(object item, string fieldName)
+ {
+ object result = item;
+
+ // If original object is DataRow
+ DataRow dataRow = item as DataRow;
+ if(dataRow != null)
+ {
+ if(fieldName != null && fieldName.Length > 0)
+ {
+ // Check if specified column exist
+ bool failed = true;
+ if (dataRow.Table.Columns.Contains(fieldName))
+ {
+ result = dataRow[fieldName];
+ failed = false;
+ }
+ else
+ {
+ // Try to treat field name as column index number
+ int columnIndex;
+ failed = !int.TryParse(fieldName, NumberStyles.Any, CultureInfo.InvariantCulture, out columnIndex);
+
+ if (!failed && columnIndex < dataRow.Table.Columns.Count && columnIndex >= 0)
+ {
+ result = dataRow[columnIndex];
+ }
+ }
+
+ if(failed)
+ {
+ throw(new ArgumentException( SR.ExceptionColumnNameNotFound( fieldName) ) );
+ }
+ }
+ else
+ {
+ // Get first column value if name not specified
+ result = dataRow[0];
+ }
+ }
+
+ // If original object is DataRowView
+
+ DataRowView dataRowView = item as DataRowView;
+ if(dataRowView != null)
+ {
+ if(fieldName != null && fieldName.Length > 0)
+ {
+ // Check if specified column exist
+ bool failed = true;
+ if (dataRowView.DataView.Table.Columns.Contains(fieldName))
+ {
+ result = dataRowView[fieldName];
+ failed = false;
+ }
+ else
+ {
+ // Try to treat field name as column index number
+ int columnIndex;
+ failed = !int.TryParse(fieldName, NumberStyles.Any, CultureInfo.InvariantCulture, out columnIndex);
+ if (!failed && columnIndex < dataRowView.DataView.Table.Columns.Count && columnIndex >= 0)
+ {
+ result = dataRowView[columnIndex];
+ }
+ }
+
+ if(failed)
+ {
+ throw(new ArgumentException( SR.ExceptionColumnNameNotFound(fieldName)));
+ }
+ }
+ else
+ {
+ // Get first column value if name not specified
+ result = dataRowView[0];
+ }
+ }
+
+ // If original object is DbDataRecord
+ DbDataRecord dbDataRecord = item as DbDataRecord;
+ if(dbDataRecord != null)
+ {
+ if(fieldName != null && fieldName.Length > 0)
+ {
+ // Check if specified column exist
+ bool failed = true;
+ if(!Char.IsNumber(fieldName, 0))
+ {
+ try
+ {
+ result = dbDataRecord[fieldName];
+ failed = false;
+ }
+ catch (IndexOutOfRangeException)
+ {
+ failed = true;
+ }
+ }
+
+ if(failed)
+ {
+ // Try to treat field name as column index number
+ try
+ {
+ int columnIndex;
+ bool parseSucceed = int.TryParse(fieldName, NumberStyles.Any, CultureInfo.InvariantCulture, out columnIndex);
+
+ if (parseSucceed)
+ {
+ result = dbDataRecord[columnIndex];
+ failed = false;
+ }
+ else
+ {
+ failed = true;
+ }
+ }
+ catch (IndexOutOfRangeException)
+ {
+ failed = true;
+ }
+ }
+
+ if(failed)
+ {
+ throw(new ArgumentException( SR.ExceptionColumnNameNotFound(fieldName)));
+ }
+
+ }
+ else
+ {
+ // Get first column value if name not specified
+ result = dbDataRecord[0];
+ }
+ }
+ else
+ {
+ if (fieldName != null && fieldName.Length > 0)
+ {
+ PropertyDescriptor descriptor = TypeDescriptor.GetProperties(item).Find(fieldName, true);
+ if (descriptor != null)
+ {
+ result = descriptor.GetValue(item);
+ return result ?? null;
+
+ }
+ }
+ }
+
+ return result;
+ }
+ /// <summary>
+ /// Auto detects the X and Y(s) values type
+ /// </summary>
+ /// <param name="series">Series the values type is detected for.</param>
+ /// <param name="xEnumerator">X values enumerator.</param>
+ /// <param name="xField">X value field.</param>
+ /// <param name="yEnumerator">Y values enumerator.</param>
+ /// <param name="yField">Y value field.</param>
+ internal static void AutoDetectValuesType(
+ Series series,
+ IEnumerator xEnumerator,
+ string xField,
+ IEnumerator yEnumerator,
+ string yField)
+ {
+ if(series.XValueType == ChartValueType.Auto)
+ {
+ series.XValueType = GetValueType(xEnumerator, xField);
+ if(series.XValueType != ChartValueType.Auto)
+ {
+ series.autoXValueType = true;
+ }
+ }
+ if(series.YValueType == ChartValueType.Auto)
+ {
+ series.YValueType = GetValueType(yEnumerator, yField);
+ if(series.YValueType != ChartValueType.Auto)
+ {
+ series.autoYValueType = true;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Return value type.
+ /// </summary>
+ /// <param name="enumerator">Values enumerator.</param>
+ /// <param name="field">Value field.</param>
+ private static ChartValueType GetValueType(IEnumerator enumerator, string field)
+ {
+ ChartValueType type = ChartValueType.Auto;
+ Type columnDataType = null;
+
+ // Check parameters
+ if(enumerator == null)
+ {
+ return type;
+ }
+
+ // Check if current enumeration element is available
+ try
+ {
+ if(enumerator.Current == null)
+ {
+ return type;
+ }
+ }
+ catch(InvalidOperationException)
+ {
+ return type;
+ }
+
+
+ // If original object is DataRow
+ if(enumerator.Current is DataRow)
+ {
+ if(field != null && field.Length > 0)
+ {
+ // Check if specified column exist
+ bool failed = true;
+ if(((DataRow)enumerator.Current).Table.Columns.Contains(field))
+ {
+ columnDataType = ((DataRow)enumerator.Current).Table.Columns[field].DataType;
+ failed = false;
+ }
+
+ // Try to treat field as column number
+ if (failed)
+ {
+ int columnIndex;
+ bool parseSucceed = int.TryParse(field, NumberStyles.Any, CultureInfo.InvariantCulture, out columnIndex);
+
+ if (parseSucceed)
+ {
+ columnDataType = ((DataRow)enumerator.Current).Table.Columns[columnIndex].DataType;
+ failed = false;
+ }
+ else
+ {
+ failed = true;
+ }
+ }
+
+ if(failed)
+ {
+ throw(new ArgumentException( SR.ExceptionColumnNameNotFound(field)));
+ }
+
+ }
+ else if(((DataRow)enumerator.Current).Table.Columns.Count > 0)
+ {
+ columnDataType = ((DataRow)enumerator.Current).Table.Columns[0].DataType;
+ }
+ }
+
+ // If original object is DataRowView
+ else if(enumerator.Current is DataRowView)
+ {
+ if(field != null && field.Length > 0)
+ {
+ // Check if specified column exist
+ bool failed = true;
+ if(((DataRowView)enumerator.Current).DataView.Table.Columns.Contains(field))
+ {
+ columnDataType = ((DataRowView)enumerator.Current).DataView.Table.Columns[field].DataType;
+ failed = false;
+ }
+
+ // Try to treat field as column number
+ if (failed)
+ {
+ int columnIndex;
+ bool parseSucceed = int.TryParse(field, NumberStyles.Any, CultureInfo.InvariantCulture, out columnIndex);
+ if (parseSucceed)
+ {
+ columnDataType = ((DataRowView)enumerator.Current).DataView.Table.Columns[columnIndex].DataType;
+ failed = false;
+ }
+ else
+ {
+ failed = true;
+ }
+ }
+
+ if(failed)
+ {
+ throw(new ArgumentException(SR.ExceptionColumnNameNotFound(field)));
+ }
+
+ }
+ else if(((DataRowView)enumerator.Current).DataView.Table.Columns.Count > 0)
+ {
+ columnDataType = ((DataRowView)enumerator.Current).DataView.Table.Columns[0].DataType;
+ }
+ }
+
+ // If original object is DbDataRecord
+ else if(enumerator.Current is DbDataRecord)
+ {
+ if(field != null && field.Length > 0)
+ {
+ bool failed = true;
+ int columnIndex = 0;
+ if(!Char.IsNumber(field, 0))
+ {
+ columnIndex = ((DbDataRecord)enumerator.Current).GetOrdinal(field);
+ columnDataType = ((DbDataRecord)enumerator.Current).GetFieldType(columnIndex);
+ failed = false;
+ }
+
+ // Try to treat field as column number
+ if (failed)
+ {
+ failed = !int.TryParse(field, NumberStyles.Any, CultureInfo.InvariantCulture, out columnIndex);
+
+ if (!failed)
+ {
+ columnDataType = ((DbDataRecord)enumerator.Current).GetFieldType(columnIndex);
+ }
+ }
+
+ if(failed)
+ {
+ throw(new ArgumentException(SR.ExceptionColumnNameNotFound(field)));
+ }
+
+ }
+ else if(((DbDataRecord)enumerator.Current).FieldCount > 0)
+ {
+ columnDataType = ((DbDataRecord)enumerator.Current).GetFieldType(0);
+ }
+ }
+ // Try detecting simple data types
+ else
+ {
+ if (field != null && field.Length > 0)
+ {
+ PropertyDescriptor descriptor = TypeDescriptor.GetProperties(enumerator.Current).Find(field, true);
+ if (descriptor != null)
+ {
+ columnDataType = descriptor.PropertyType;
+ }
+ }
+ if ( columnDataType == null )
+ {
+ columnDataType = enumerator.Current.GetType();
+ }
+ }
+
+ // Use data type
+ if(columnDataType != null)
+ {
+ if(columnDataType == typeof(DateTime))
+ type = ChartValueType.DateTime;
+ else if (columnDataType == typeof(DateTimeOffset))
+ type = ChartValueType.DateTimeOffset;
+ else if (columnDataType == typeof(TimeSpan))
+ type = ChartValueType.Time;
+ else if (columnDataType == typeof(Double))
+ type = ChartValueType.Double;
+ else if (columnDataType == typeof(Int32))
+ type = ChartValueType.Int32;
+ else if(columnDataType == typeof(Int64))
+ type = ChartValueType.Int64;
+ else if(columnDataType == typeof(Single))
+ type = ChartValueType.Single;
+ else if(columnDataType == typeof(String))
+ type = ChartValueType.String;
+ else if(columnDataType == typeof(UInt32))
+ type = ChartValueType.UInt32;
+ else if(columnDataType == typeof(UInt64))
+ type = ChartValueType.UInt64;
+ }
+
+ return type;
+ }
+
+ #endregion
+
+ #region DataPoint finding functions
+
+ /// <summary>
+ /// Find all the points that equal to the specified value starting from the specified index.
+ /// </summary>
+ /// <param name="valueToFind">Point value to find.</param>
+ /// <param name="useValue">Which point value to use (X, Y1, Y2,...).</param>
+ /// <param name="startIndex">Index of the point to start looking from.</param>
+ /// <returns>Enumerator of datapoints.</returns>
+ public IEnumerable<DataPoint> FindAllByValue(double valueToFind, string useValue, int startIndex)
+ {
+ // Loop through all points from specified index
+ for (int i = startIndex; i < this.Count; i++)
+ {
+ DataPoint point = this[i];
+ if (point.GetValueByName(useValue) == valueToFind)
+ {
+ yield return point;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Find all the points that equal to the specified value.
+ /// </summary>
+ /// <param name="valueToFind">Point value to find.</param>
+ /// <param name="useValue">Which point value to use (X, Y1, Y2,...).</param>
+ /// <returns>Enumerator of datapoints.</returns>
+ public IEnumerable<DataPoint> FindAllByValue(double valueToFind, string useValue)
+ {
+ // Loop through all points from specified index
+ for (int i = 0; i < this.Count; i++)
+ {
+ DataPoint point = this[i];
+ if (point.GetValueByName(useValue) == valueToFind)
+ {
+ yield return point;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Find all the points that equal to the specified value.
+ /// </summary>
+ /// <param name="valueToFind">Point value to find.</param>
+ /// <returns>Enumerator of datapoints.</returns>
+ public IEnumerable<DataPoint> FindAllByValue(double valueToFind)
+ {
+ return FindAllByValue(valueToFind, "Y");
+ }
+
+ /// <summary>
+ /// Find the first point that equals to the specified value starting from the specified index.
+ /// </summary>
+ /// <param name="valueToFind">Point value to find.</param>
+ /// <param name="useValue">Which point value to use (X, Y1, Y2,...).</param>
+ /// <param name="startIndex">Index of the point to start looking from.</param>
+ /// <returns>Datapoint which matches the value. Null if there is no match.</returns>
+ public DataPoint FindByValue(double valueToFind, string useValue, int startIndex)
+ {
+ //Check arguments
+ if (useValue == null)
+ throw new ArgumentNullException("useValue");
+ if (startIndex < 0 || startIndex >= this.Count)
+ throw new ArgumentOutOfRangeException("startIndex");
+
+ // Loop through all points from specified index
+ for (int i = startIndex; i < this.Count; i++)
+ {
+ DataPoint point = this[i];
+ if (point.GetValueByName(useValue) == valueToFind)
+ {
+ return point;
+ }
+ }
+
+ // Nothing was found
+ return null;
+ }
+
+ /// <summary>
+ /// Find the first point that equals to the specified value.
+ /// </summary>
+ /// <param name="valueToFind">Point value to find.</param>
+ /// <param name="useValue">Which point value to use (X, Y1, Y2,...).</param>
+ /// <returns>Datapoint which matches the value. Null if there is no match.</returns>
+ public DataPoint FindByValue(double valueToFind, string useValue)
+ {
+ return FindByValue(valueToFind, useValue, 0);
+ }
+
+ /// <summary>
+ /// Find the first point that equals to the specified value.
+ /// </summary>
+ /// <param name="valueToFind">Point value to find.</param>
+ /// <returns>Datapoint which matches the value. Null if there is no match.</returns>
+ public DataPoint FindByValue(double valueToFind)
+ {
+ return FindByValue(valueToFind, "Y");
+ }
+
+ /// <summary>
+ /// Find point with the maximum value starting from specified index.
+ /// </summary>
+ /// <param name="useValue">Which point value to use (X, Y1, Y2,...).</param>
+ /// <param name="startIndex">Index of the point to start looking from.</param>
+ /// <returns>Datapoint with the maximum value.</returns>
+ public DataPoint FindMaxByValue(string useValue, int startIndex)
+ {
+ //Check arguments
+ if (useValue == null)
+ throw new ArgumentNullException("useValue");
+ if (startIndex < 0 || startIndex >= this.Count)
+ throw new ArgumentOutOfRangeException("startIndex");
+
+ bool isYValue = useValue.StartsWith("Y", StringComparison.OrdinalIgnoreCase);
+ double maxValue = double.MinValue;
+ DataPoint maxPoint = null;
+
+ for (int i = startIndex; i < this.Count; i++)
+ {
+ DataPoint point = this[i];
+
+ // Skip empty points when searching for the Y values
+ if (point.IsEmpty && isYValue)
+ continue;
+
+ double pointValue = point.GetValueByName(useValue);
+
+ if (maxValue < pointValue)
+ {
+ maxValue = pointValue;
+ maxPoint = point;
+ }
+ }
+
+ return maxPoint;
+ }
+
+ /// <summary>
+ /// Find point with the maximum value.
+ /// </summary>
+ /// <param name="useValue">Which point value to use (X, Y1, Y2,...).</param>
+ /// <returns>Datapoint with the maximum value.</returns>
+ public DataPoint FindMaxByValue(string useValue)
+ {
+ return FindMaxByValue(useValue, 0);
+ }
+
+ /// <summary>
+ /// Find data point with the maximum value.
+ /// </summary>
+ /// <returns>Datapoint with the maximum value.</returns>
+ public DataPoint FindMaxByValue()
+ {
+ return FindMaxByValue("Y");
+ }
+
+ /// <summary>
+ /// Find point with the Min value starting from specified index.
+ /// </summary>
+ /// <param name="useValue">Which point value to use (X, Y1, Y2,...).</param>
+ /// <param name="startIndex">Index of the point to start looking from.</param>
+ /// <returns>Datapoint with the Min value.</returns>
+ public DataPoint FindMinByValue(string useValue, int startIndex)
+ {
+ if (useValue == null)
+ throw new ArgumentNullException("useValue");
+ if (startIndex < 0 || startIndex >= this.Count)
+ throw new ArgumentOutOfRangeException("startIndex");
+
+ bool isYValue = useValue.StartsWith("Y", StringComparison.OrdinalIgnoreCase);
+ double minValue = double.MaxValue;
+ DataPoint minPoint = null;
+
+ for (int i = startIndex; i < this.Count; i++)
+ {
+ DataPoint point = this[i];
+
+ // Skip empty points when searching for the Y values
+ if (point.IsEmpty && isYValue)
+ continue;
+
+ double pointValue = point.GetValueByName(useValue);
+
+ if (minValue > pointValue)
+ {
+ minValue = pointValue;
+ minPoint = point;
+ }
+ }
+
+ return minPoint;
+ }
+
+ /// <summary>
+ /// Find point with the Min value.
+ /// </summary>
+ /// <param name="useValue">Which point value to use (X, Y1, Y2,...).</param>
+ /// <returns>Datapoint with the Min value.</returns>
+ public DataPoint FindMinByValue(string useValue)
+ {
+ return FindMinByValue(useValue, 0);
+ }
+
+ /// <summary>
+ /// Find point with the Min value
+ /// </summary>
+ /// <returns>Datapoint with the Min value.</returns>
+ public DataPoint FindMinByValue()
+ {
+ return FindMinByValue("Y");
+ }
+
+ #endregion
+
+ #region Collection<T> overrides
+
+ /// <summary>
+ /// Initializes the specified item.
+ /// </summary>
+ /// <param name="item">The item.</param>
+ internal override void Initialize(DataPoint item)
+ {
+ DataPointInit(ref item);
+ base.Initialize(item);
+ }
+
+#if Microsoft_CONTROL
+ /// <summary>
+ /// Removes all elements from the <see cref="T:System.Collections.ObjectModel.Collection`1"/>.
+ /// </summary>
+ protected override void ClearItems()
+ {
+
+ // Refresh Minimum and Maximum from data
+ // after recalc and set data
+ if (Common != null && Common.ChartPicture != null)
+ {
+ Common.ChartPicture.ResetMinMaxFromData();
+ }
+
+ base.ClearItems();
+ }
+#endif
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Stores values and properties of a DataPoint of a Series.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeDataPoint_DataPoint"),
+ DefaultProperty("YValues"),
+ TypeConverter(Editors.DataPointConverter.Convertor)
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+#if !Microsoft_CONTROL
+ [Themeable(false)]
+#endif
+ public class DataPoint : DataPointCustomProperties
+ {
+ #region Fields
+
+ // Point X value
+ private double _xValue;
+
+ // Point Y values
+ private double[] _yValue = new double[1];
+
+ // Pre calculated (during painting) relative position of data point
+ internal PointF positionRel = PointF.Empty;
+
+ // VSTS:199794 - Accessibility needs the last rendered label content to be exposed.
+ // The current label content evaluation is scattered over different chart types and cannot be isolated without risk of regression.
+ // This variable will cache the label content taken just before drawing.
+ internal string _lastLabelText = String.Empty;
+
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// DataPoint object constructor.
+ /// </summary>
+ public DataPoint() : base(null, true)
+ {
+ _yValue = new double[1];
+ }
+
+ /// <summary>
+ /// DataPoint object constructor.
+ /// </summary>
+ /// <param name="series">series object, which the DataPoint belongs to.</param>
+ public DataPoint(Series series) : base(series, true)
+ {
+ // Create Y value(s) array
+ _yValue = new double[series.YValuesPerPoint];
+ _xValue = 0;
+ }
+
+ /// <summary>
+ /// DataPoint object constructor.
+ /// </summary>
+ /// <param name="xValue">X value.</param>
+ /// <param name="yValue">Y value.</param>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X and Y are cartesian coordinates and well understood")]
+ public DataPoint(double xValue, double yValue)
+ : base(null, true)
+ {
+ // Set Y value
+ this._yValue = new double[1];
+ this._yValue[0] = yValue;
+
+ // Set X value
+ this._xValue = xValue;
+ }
+
+ /// <summary>
+ /// DataPoint object constructor.
+ /// </summary>
+ /// <param name="xValue">X value.</param>
+ /// <param name="yValues">Array of Y values.</param>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X and Y are cartesian coordinates and well understood")]
+ public DataPoint(double xValue, double[] yValues)
+ : base(null, true)
+ {
+ // Set Y value
+ this._yValue = yValues;
+
+ // Set X value
+ this._xValue = xValue;
+ }
+
+ /// <summary>
+ /// DataPoint object constructor.
+ /// </summary>
+ /// <remarks>
+ /// This method is only used during the Windows Forms serialization of the chart.
+ /// </remarks>
+ /// <param name="xValue">X value.</param>
+ /// <param name="yValues">String of comma separated Y values.</param>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X and Y are cartesian coordinates and well understood")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public DataPoint(double xValue, string yValues)
+ : base(null, true)
+ {
+ string[] values = yValues.Split(',');
+
+ // Create Y value(s) array
+ _yValue = new double[values.Length];
+
+ for (int index = 0; index < values.Length; index++)
+ {
+ _yValue[index] = CommonElements.ParseDouble(values[index], true);
+ }
+
+ // Set X value
+ this._xValue = xValue;
+ }
+
+ #endregion
+
+ #region Data point methods
+
+ /// <summary>
+ /// Sets the specified data point attribute to the specified value.
+ /// </summary>
+ /// <param name="obj">Attribute value.</param>
+ /// <param name="propertyName">Attribute name.</param>
+ /// <param name="format">Value format.</param>
+ internal void SetPointCustomProperty(
+ object obj,
+ string propertyName,
+ string format)
+ {
+ // Convert value to string
+ string stringValue = obj as string;
+ if(stringValue == null)
+ {
+ double doubleObj = double.NaN;
+ ChartValueType valueType = ChartValueType.Auto;
+ if(obj is DateTime)
+ {
+ doubleObj = ((DateTime)obj).ToOADate();
+ valueType = ChartValueType.Date;
+ }
+ else
+ {
+ doubleObj = this.ConvertValue(obj);
+ }
+
+ // Try converting to string
+ if( !double.IsNaN(doubleObj) )
+ {
+ try
+ {
+ stringValue = ValueConverter.FormatValue(
+ this.Chart,
+ this,
+ this.Tag,
+ doubleObj,
+ format,
+ valueType,
+ ChartElementType.DataPoint);
+ }
+ catch(FormatException)
+ {
+ // Use basic string converter
+ stringValue = obj.ToString();
+ }
+ }
+ else
+ {
+ // Use basic string converter
+ stringValue = obj.ToString();
+ }
+ }
+
+ // Assign data point attribute by name
+ if(stringValue.Length > 0)
+ {
+ if(String.Compare(propertyName, "AxisLabel", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this.AxisLabel = stringValue;
+ }
+ else if (String.Compare(propertyName, "Tooltip", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this.ToolTip = stringValue;
+ }
+#if !Microsoft_CONTROL
+ else if(String.Compare(propertyName, "Url", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this.Url = stringValue;
+ }
+ else if (String.Compare(propertyName, "PostBackValue", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this.PostBackValue = stringValue;
+ }
+ else if (String.Compare(propertyName, "LabelUrl", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this.LabelUrl = stringValue;
+ }
+ else if (String.Compare(propertyName, "LabelPostBackValue", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this.LabelPostBackValue = stringValue;
+ }
+ else if (String.Compare(propertyName, "LegendUrl", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this.LegendUrl = stringValue;
+ }
+ else if (String.Compare(propertyName, "LegendPostBackValue", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this.LegendPostBackValue = stringValue;
+ }
+#endif // !Microsoft_CONTROL
+ else if (String.Compare(propertyName, "Label", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this.Label = stringValue;
+ }
+ else if (String.Compare(propertyName, "LegendTooltip", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this.LegendToolTip = stringValue;
+ }
+ else if (String.Compare(propertyName, "LegendText", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this.LegendText = stringValue;
+ }
+ else if (String.Compare(propertyName, "LabelToolTip", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ this.LabelToolTip = stringValue;
+ }
+ else
+ {
+ this[propertyName] = stringValue;
+ }
+ }
+ }
+
+
+ /// <summary>
+ /// Converts object to double.
+ /// </summary>
+ /// <param name="value">Object to convert.</param>
+ /// <returns>Double value.</returns>
+ private double ConvertValue(object value)
+ {
+ if(value == null)
+ {
+ return 0;
+ }
+
+ if(value is Double)
+ {
+ return (double)value;
+ }
+ else if(value is Single)
+ {
+ return (double)((float)value);
+ }
+ else if(value is Decimal)
+ {
+ return (double)((Decimal)value);
+ }
+ else if(value is Int32)
+ {
+ return (double)((Int32)value);
+ }
+ else if(value is UInt32)
+ {
+ return (double)((UInt32)value);
+ }
+ else if(value is Int64)
+ {
+ return (double)((Int64)value);
+ }
+ else if(value is UInt64)
+ {
+ return (double)((UInt64)value);
+ }
+ else if(value is Byte)
+ {
+ return (double)((Byte)value);
+ }
+ else if(value is SByte)
+ {
+ return (double)((SByte)value);
+ }
+ else if(value is Boolean)
+ {
+ return ((Boolean)value) ? 1.0 : 0.0;
+ }
+ else
+ {
+ string stringValue = "";
+ stringValue = value.ToString();
+ return CommonElements.ParseDouble(stringValue);
+ }
+ }
+
+ /// <summary>
+ /// Set X value and one or more Y values of the data point.
+ /// </summary>
+ /// <param name="xValue">X value of the data point.</param>
+ /// <param name="yValue">List of Y values of the data point.</param>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X and Y are cartesian coordinates and well understood")]
+ public void SetValueXY(object xValue, params object[] yValue)
+ {
+ // Check arguments
+ if (xValue == null)
+ throw new ArgumentNullException("xValue");
+
+ // Set Y value first
+ SetValueY(yValue);
+
+ // Check if parameters type matches with series type
+ Type paramType = xValue.GetType();
+ if(base.series != null)
+ {
+ base.series.CheckSupportedTypes(paramType);
+ }
+
+ // Save value in the array
+ if(paramType == typeof(String))
+ {
+ AxisLabel = (string)xValue;
+ }
+ else if(paramType == typeof(DateTime))
+ {
+ this._xValue = ((DateTime)xValue).ToOADate();
+ }
+ else
+ {
+ this._xValue = ConvertValue(xValue);
+ }
+
+ // Get Date or Time if required
+ if(base.series != null && xValue is DateTime)
+ {
+ if(base.series.XValueType == ChartValueType.Date)
+ {
+ DateTime time = new DateTime(
+ ((DateTime)xValue).Year,
+ ((DateTime)xValue).Month,
+ ((DateTime)xValue).Day,
+ 0,
+ 0,
+ 0,
+ 0);
+ this._xValue = time.ToOADate();
+ }
+ else if(base.series.XValueType == ChartValueType.Time)
+ {
+ DateTime time = new DateTime(
+ 1899,
+ 12,
+ 30,
+ ((DateTime)xValue).Hour,
+ ((DateTime)xValue).Minute,
+ ((DateTime)xValue).Second,
+ ((DateTime)xValue).Millisecond);
+ this._xValue = time.ToOADate();
+ }
+ }
+
+ // Check if one of Y values are not avilable
+ bool empty = false;
+ foreach(double d in this._yValue)
+ {
+ if(double.IsNaN(d))
+ {
+ empty = true;
+ break;
+ }
+ }
+
+ // Set point empty flag and values to zero
+ if(empty)
+ {
+ this.IsEmpty = true;
+ for(int valueIndex = 0; valueIndex < this._yValue.Length; valueIndex++)
+ {
+ this._yValue[valueIndex] = 0.0;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Set one or more Y values of the data point.
+ /// </summary>
+ /// <param name="yValue">List of Y values of the data point.</param>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "Y is a cartesian coordinate and well understood")]
+ public void SetValueY(params object[] yValue)
+ {
+ // Check arguments
+ if (yValue == null)
+ throw new ArgumentNullException("yValue");
+
+ // Check number of parameters. Should be more than 0 and
+ if(yValue.Length == 0 || (base.series != null && yValue.Length > base.series.YValuesPerPoint))
+ throw(new ArgumentOutOfRangeException("yValue", SR.ExceptionDataPointYValuesSettingCountMismatch(base.series.YValuesPerPoint.ToString(System.Globalization.CultureInfo.InvariantCulture))));
+
+ // Check if there is a Null Y value
+ for( int i = 0 ; i < yValue.Length ; i++ )
+ {
+ if(yValue[i] == null || yValue[i] is System.DBNull)
+ {
+ yValue[i] = 0.0;
+ if(i == 0)
+ {
+ this.IsEmpty = true;
+ }
+ }
+ }
+
+ // Check if parameters type matches with series type
+ Type paramType = yValue[0].GetType();
+ if(base.series != null)
+ {
+ base.series.CheckSupportedTypes(paramType);
+ }
+
+ // Make sure the Y values array is big enough
+ if (this._yValue.Length < yValue.Length)
+ {
+ this._yValue = new double[yValue.Length];
+ }
+
+ // Save value in the array
+ if(paramType == typeof(String))
+ {
+ try
+ {
+ for (int i = 0; i < yValue.Length; i++)
+ {
+ this._yValue[i] = CommonElements.ParseDouble((string)yValue[i]);
+ }
+ }
+ catch
+ {
+ // Get reference to the chart object
+ if (Common!=null && Common.ChartPicture!=null && Common.ChartPicture.SuppressExceptions)
+ {
+ this.IsEmpty = true;
+ for (int i = 0; i < yValue.Length; i++)
+ {
+ yValue[i] = 0.0;
+ }
+ }
+ else
+ {
+ throw (new ArgumentException( SR.ExceptionDataPointYValueStringFormat));
+ }
+ }
+
+ }
+ else if(paramType == typeof(DateTime))
+ {
+ for( int i = 0 ; i < yValue.Length ; i++ )
+ {
+ if(yValue[i] == null ||
+ (yValue[i] is double && ((double)yValue[i]) == 0.0) )
+ {
+ this._yValue[i] = DateTime.Now.ToOADate();
+ }
+ else
+ {
+ this._yValue[i] = ((DateTime)yValue[i]).ToOADate();
+ }
+ }
+ }
+ else
+ {
+ for( int i = 0 ; i < yValue.Length ; i++ )
+ {
+ this._yValue[i] = ConvertValue(yValue[i]);
+ }
+ }
+
+ // Get Date or Time if required
+ if(base.series != null)
+ {
+ for( int i = 0 ; i < yValue.Length ; i++ )
+ {
+ if(yValue[i] == null ||
+ (yValue[i] is double && ((double)yValue[i]) == 0.0) )
+ {
+ if(base.series.YValueType == ChartValueType.Date)
+ {
+ this._yValue[i] = Math.Floor(this._yValue[i]);
+ }
+ else if(base.series.YValueType == ChartValueType.Time)
+ {
+ this._yValue[i] = this._xValue - Math.Floor(this._yValue[i]);
+ }
+ }
+ else
+ {
+ if(base.series.YValueType == ChartValueType.Date)
+ {
+ DateTime yDate;
+ if (yValue[i] is DateTime)
+ yDate = (DateTime)yValue[i];
+ else if (yValue[i] is Double)
+ yDate = DateTime.FromOADate((Double)yValue[i]);
+ else
+ yDate = Convert.ToDateTime(yValue[i], CultureInfo.InvariantCulture); //This will throw an exception in case when the yValue type is not compatible with the DateTime
+
+ DateTime date = new DateTime(
+ yDate.Year,
+ yDate.Month,
+ yDate.Day,
+ 0,
+ 0,
+ 0,
+ 0);
+
+ this._yValue[i] = date.ToOADate();
+ }
+ else if (base.series.YValueType == ChartValueType.Time)
+ {
+ DateTime yTime;
+ if (yValue[i] is DateTime)
+ yTime = (DateTime)yValue[i];
+ if (yValue[i] is Double)
+ yTime = DateTime.FromOADate((Double)yValue[i]);
+ else
+ yTime = Convert.ToDateTime(yValue[i], CultureInfo.InvariantCulture); //This will throw an exception in case when the yValue type is not compatible with the DateTime
+
+ DateTime time = new DateTime(
+ 1899,
+ 12,
+ 30,
+ yTime.Hour,
+ yTime.Minute,
+ yTime.Second,
+ yTime.Millisecond);
+
+ this._yValue[i] = time.ToOADate();
+ }
+ }
+ }
+ }
+
+ }
+
+ /// <summary>
+ /// Creates an exact copy of this DataPoint object.
+ /// </summary>
+ /// <returns>An exact copy of this DataPoint object.</returns>
+ public DataPoint Clone()
+ {
+ // Create new data point
+ DataPoint clonePoint = new DataPoint();
+
+ // Reset series pointer
+ clonePoint.series = null;
+ clonePoint.pointCustomProperties = this.pointCustomProperties;
+
+ // Copy values
+ clonePoint._xValue = this.XValue;
+ clonePoint._yValue = new double[this._yValue.Length];
+ this._yValue.CopyTo(clonePoint._yValue, 0);
+ clonePoint.tempColorIsSet = this.tempColorIsSet;
+ clonePoint.isEmptyPoint = this.isEmptyPoint;
+
+ // Copy properties
+ foreach(object key in this.properties.Keys)
+ {
+ clonePoint.properties.Add(key, this.properties[key]);
+ }
+
+ return clonePoint;
+ }
+
+ /// <summary>
+ /// Resize Y values array.
+ /// </summary>
+ /// <param name="newSize">New number of Y values in array.</param>
+ internal void ResizeYValueArray(int newSize)
+ {
+ // Create new array
+ double[] newArray = new Double[newSize];
+
+ // Copy elements
+ if(_yValue != null)
+ {
+ for(int i = 0; i < ((_yValue.Length < newSize) ? _yValue.Length : newSize); i++)
+ {
+ newArray[i] = _yValue[i];
+ }
+ }
+
+ _yValue = newArray;
+ }
+
+ /// <summary>
+ /// Helper function, which returns point value by it's name.
+ /// </summary>
+ /// <param name="valueName">Point value names. X, Y, Y2,...</param>
+ /// <returns>Point value.</returns>
+ public double GetValueByName(string valueName)
+ {
+ // Check arguments
+ if (valueName == null)
+ throw new ArgumentNullException("valueName");
+
+ valueName = valueName.ToUpper(System.Globalization.CultureInfo.InvariantCulture);
+ if(String.Compare(valueName, "X", StringComparison.Ordinal) == 0)
+ {
+ return this.XValue;
+ }
+ else if (valueName.StartsWith("Y", StringComparison.Ordinal))
+
+ {
+ if(valueName.Length == 1)
+ {
+ return this.YValues[0];
+ }
+ else
+ {
+ int yIndex = 0;
+ try
+ {
+ yIndex = Int32.Parse(valueName.Substring(1), System.Globalization.CultureInfo.InvariantCulture) - 1;
+ }
+ catch(System.Exception)
+ {
+ throw(new ArgumentException( SR.ExceptionDataPointValueNameInvalid, "valueName"));
+ }
+
+ if(yIndex < 0)
+ {
+ throw(new ArgumentException( SR.ExceptionDataPointValueNameYIndexIsNotPositive, "valueName"));
+ }
+
+ if(yIndex >= this.YValues.Length)
+ {
+ throw(new ArgumentException( SR.ExceptionDataPointValueNameYIndexOutOfRange, "valueName"));
+ }
+
+ return this.YValues[yIndex];
+ }
+ }
+ else
+ {
+ throw(new ArgumentException( SR.ExceptionDataPointValueNameInvalid, "valueName"));
+ }
+ }
+
+ /// <summary>
+ /// Replaces predefined keyword inside the string with their values.
+ /// </summary>
+ /// <param name="strOriginal">Original string with keywords.</param>
+ /// <returns>Modified string.</returns>
+ internal override string ReplaceKeywords(string strOriginal)
+ {
+ // Nothing to process
+ if(strOriginal == null || strOriginal.Length == 0)
+ return strOriginal;
+
+ // Replace all "\n" strings with '\n' character
+ string result = strOriginal;
+ result = result.Replace("\\n", "\n");
+
+ // #LABEL - point label
+ result = result.Replace(KeywordName.Label, this.Label);
+
+ // #LEGENDTEXT - series name
+ result = result.Replace(KeywordName.LegendText, this.LegendText);
+
+ // #AXISLABEL - series name
+ result = result.Replace(KeywordName.AxisLabel, this.AxisLabel);
+
+ // #CUSTOMPROPERTY - one of the custom properties by name
+ result = DataPoint.ReplaceCustomPropertyKeyword(result, this);
+
+ if(this.series != null)
+ {
+ // #INDEX - point index
+ result = result.Replace(KeywordName.Index, this.series.Points.IndexOf(this).ToString(System.Globalization.CultureInfo.InvariantCulture));
+
+ // Replace series keywords
+ result = this.series.ReplaceKeywords(result);
+
+ // #PERCENT - percentage of Y value from total
+ result = this.series.ReplaceOneKeyword(
+ this.Chart,
+ this,
+ this.Tag,
+ ChartElementType.DataPoint,
+ result,
+ KeywordName.Percent,
+ (this.YValues[0]/(this.series.GetTotalYValue())),
+ ChartValueType.Double,
+ "P");
+
+ // #VAL[X] - point value X, Y, Y2, ...
+ if(this.series.XValueType == ChartValueType.String)
+ {
+ result = result.Replace(KeywordName.ValX, this.AxisLabel);
+ }
+ else
+ {
+ result = this.series.ReplaceOneKeyword(
+ this.Chart,
+ this,
+ this.Tag,
+ ChartElementType.DataPoint,
+ result,
+ KeywordName.ValX,
+ this.XValue,
+ this.series.XValueType,
+ "");
+ }
+
+ // remove keywords #VAL? for unexisted Y value indices
+ for (int index = this.YValues.Length; index <= 7; index++)
+ {
+ result = this.RemoveOneKeyword(result, KeywordName.ValY + index + 1, SR.FormatErrorString);
+ }
+
+ for(int index = 1; index <= this.YValues.Length; index++)
+ {
+ result = this.series.ReplaceOneKeyword(
+ this.Chart,
+ this,
+ this.Tag,
+ ChartElementType.DataPoint,
+ result,
+ KeywordName.ValY + index,
+ this.YValues[index - 1],
+ this.series.YValueType,
+ "");
+ }
+
+ result = this.series.ReplaceOneKeyword(
+ Chart,
+ this,
+ this.Tag,
+ ChartElementType.DataPoint,
+ result,
+ KeywordName.ValY,
+ this.YValues[0],
+ this.series.YValueType,
+ "");
+
+ result = this.series.ReplaceOneKeyword(
+ Chart,
+ this,
+ this.Tag,
+ ChartElementType.DataPoint,
+ result,
+ KeywordName.Val,
+ this.YValues[0],
+ this.series.YValueType,
+ "");
+ }
+
+ return result;
+ }
+
+ /// <summary>
+ /// Removes one keyword from format string.
+ /// </summary>
+ /// <param name="strOriginal">Original format string</param>
+ /// <param name="keyword">The keyword</param>
+ /// <param name="strToReplace">String to replace the keyword.</param>
+ /// <returns>Modified format string</returns>
+ private string RemoveOneKeyword(string strOriginal, string keyword, string strToReplace)
+ {
+ string result = strOriginal;
+ int keyIndex = -1;
+ while ((keyIndex = result.IndexOf(keyword, StringComparison.Ordinal)) != -1)
+ {
+ // Get optional format
+ int keyEndIndex = keyIndex + keyword.Length;
+ if (result.Length > keyEndIndex && result[keyEndIndex] == '{')
+ {
+ int formatEnd = result.IndexOf('}', keyEndIndex);
+ if (formatEnd == -1)
+ {
+ throw (new InvalidOperationException(SR.ExceptionDataSeriesKeywordFormatInvalid(result)));
+ }
+
+ keyEndIndex = formatEnd + 1;
+ }
+ // Remove keyword string (with optional format)
+ result = result.Remove(keyIndex, keyEndIndex - keyIndex);
+ if (!String.IsNullOrEmpty(strToReplace))
+ {
+ result = result.Insert(keyIndex, strToReplace);
+ }
+ }
+ return result;
+ }
+
+
+ /// <summary>
+ /// Replaces all "#CUSTOMPROPERTY(XXX)" (where XXX is the custom attribute name)
+ /// keywords in the string provided.
+ /// </summary>
+ /// <param name="originalString">String where the keyword need to be replaced.</param>
+ /// <param name="properties">DataPoint or Series properties class.</param>
+ /// <returns>Converted string.</returns>
+ internal static string ReplaceCustomPropertyKeyword(string originalString, DataPointCustomProperties properties)
+ {
+ string result = originalString;
+ int keyStartIndex = -1;
+ while ((keyStartIndex = result.IndexOf(KeywordName.CustomProperty, StringComparison.Ordinal)) >= 0)
+ {
+ string attributeValue = string.Empty;
+ string attributeName = string.Empty;
+
+ // Forward to the end of the keyword
+ int keyEndIndex = keyStartIndex + KeywordName.CustomProperty.Length;
+
+ // An opening bracket '(' must follow
+ if (result.Length > keyEndIndex && result[keyEndIndex] == '(')
+ {
+ ++keyEndIndex;
+ int attributeNameStartIndex = keyEndIndex;
+
+ // Search for the closing bracket
+ int closingBracketIndex = result.IndexOf(')', keyEndIndex);
+ if (closingBracketIndex >= keyEndIndex)
+ {
+ keyEndIndex = closingBracketIndex + 1;
+ attributeName = result.Substring(attributeNameStartIndex, keyEndIndex - attributeNameStartIndex - 1);
+
+ // Get attribute value
+ if (properties.IsCustomPropertySet(attributeName))
+ {
+ attributeValue = properties.GetCustomProperty(attributeName);
+ }
+ else
+ {
+ // In case of the DataPoint check if the attribute is set in the parent series
+ DataPoint dataPoint = properties as DataPoint;
+ if (dataPoint != null && dataPoint.series != null)
+ {
+ if (dataPoint.series.IsCustomPropertySet(attributeName))
+ {
+ attributeValue = dataPoint.series.GetCustomProperty(attributeName);
+ }
+ }
+ }
+ }
+ }
+
+ // Remove keyword string with attribute name
+ result = result.Remove(keyStartIndex, keyEndIndex - keyStartIndex);
+
+ // Insert value of the custom attribute
+ result = result.Insert(keyStartIndex, attributeValue);
+ }
+
+ return result;
+ }
+
+ /// <summary>
+ /// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
+ /// </summary>
+ /// <returns>
+ /// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
+ /// </returns>
+ internal override string ToStringInternal()
+ {
+ StringBuilder sb = new StringBuilder();
+ sb.AppendFormat(CultureInfo.CurrentCulture, "{{X={0}, ", XValue);
+ if (YValues.Length == 1)
+ {
+ sb.AppendFormat(CultureInfo.CurrentCulture, "Y={0}", YValues[0]);
+ }
+ else
+ {
+ sb.Append("Y={");
+ for (int i = 0; i < YValues.Length; i++)
+ if (i == 0)
+ sb.AppendFormat(CultureInfo.CurrentCulture, "{0}", YValues[i]);
+ else
+ sb.AppendFormat(CultureInfo.CurrentCulture, ", {0}", YValues[i]);
+ sb.Append("}");
+ }
+ sb.Append("}");
+ return sb.ToString();
+ }
+ #endregion
+
+ #region DataPoint Properties
+
+
+ /// <summary>
+ /// X value of the data point.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeDataPoint_XValue"),
+ TypeConverter(typeof(DataPointValueConverter)),
+ DefaultValue(typeof(double), "0.0"),
+
+
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
+#else
+ PersistenceMode(PersistenceMode.Attribute)
+#endif
+ ]
+ public double XValue
+ {
+ get
+ {
+ return _xValue;
+ }
+ set
+ {
+ _xValue = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// List of Y values of the data point.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ SRDescription("DescriptionAttributeDataPoint_YValues"),
+ Bindable(true),
+
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
+#else
+ PersistenceMode(PersistenceMode.Attribute),
+#endif
+ TypeConverter(typeof(DoubleArrayConverter)),
+ Editor(typeof(UITypeEditor), typeof(UITypeEditor)),
+ RefreshProperties(RefreshProperties.All),
+ SerializationVisibilityAttribute(SerializationVisibility.Attribute)
+ ]
+ [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
+ public double[] YValues
+ {
+ get
+ {
+ return _yValue;
+ }
+ set
+ {
+ if(value == null)
+ {
+ // Clear array data
+ for(int i=0; i < _yValue.Length; i++)
+ {
+ _yValue[i] = 0;
+ }
+ }
+ else
+ {
+ _yValue = value;
+ }
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// A flag which indicates whether the data point is empty.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+
+ Bindable(true),
+ SRDescription("DescriptionAttributeDataPoint_Empty"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ DefaultValue(false)
+ ]
+ public bool IsEmpty
+ {
+ get
+ {
+ return base.isEmptyPoint;
+ }
+ set
+ {
+ base.isEmptyPoint = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Name of the data point. This field is reserved for internal use only.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ Bindable(true),
+ Browsable(false),
+ SRDescription("DescriptionAttributeDataPoint_Name"),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden)
+ ]
+ public override string Name
+ {
+ get
+ {
+ return "DataPoint";
+ }
+ set
+ {
+ //Dont call the base method - the names don't need to be unique
+ }
+ }
+
+ #endregion
+
+ }
+
+ /// <summary>
+ /// Stores properties of one Data Point and Data series.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeDataPointCustomProperties_DataPointCustomProperties"),
+ DefaultProperty("LabelStyle"),
+ TypeConverter(Editors.DataPointCustomPropertiesConverter.Convertor)
+ ]
+#if Microsoft_CONTROL
+ public class DataPointCustomProperties : ChartNamedElement
+#else
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class DataPointCustomProperties : ChartNamedElement, IChartMapArea
+#endif
+ {
+ #region Fields and enumerations
+
+ // True indicates data point properties. Otherwise - series.
+ internal bool pointCustomProperties = true;
+
+ // Reference to the data point series
+ internal Series series = null;
+
+ // Storage for the custom properties names/values
+ internal Hashtable properties = new Hashtable();
+
+ // Flag indicating that temp. color was set
+ internal bool tempColorIsSet = false;
+
+ // Design time custom properties data
+ internal CustomProperties customProperties = null;
+
+ // IsEmpty point indicator
+ internal bool isEmptyPoint = false;
+
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// DataPointCustomProperties constructor.
+ /// </summary>
+ public DataPointCustomProperties()
+ {
+ // Initialize the data series
+ this.series = null;
+ this.customProperties = new CustomProperties(this);
+ }
+
+ /// <summary>
+ /// DataPointCustomProperties constructor.
+ /// </summary>
+ /// <param name="series">The series which the data point belongs to.</param>
+ /// <param name="pointProperties">Indicates whether this is a data point custom properties.</param>
+ public DataPointCustomProperties(Series series, bool pointProperties): base( series, String.Empty)
+ {
+ // Initialize the data series
+ this.series = series;
+ this.pointCustomProperties = pointProperties;
+ this.customProperties = new CustomProperties(this);
+ }
+
+ #endregion
+
+ #region Custom Properties methods
+
+ /// <summary>
+ /// Checks if custom property with specified name was set.
+ /// </summary>
+ /// <param name="name">Name of the custom property to check.</param>
+ /// <returns>True if custom property was set.</returns>
+ virtual public bool IsCustomPropertySet(string name)
+ {
+ return properties.ContainsKey(name);
+ }
+
+ /// <summary>
+ /// Checks if the custom property with specified name was set.
+ /// </summary>
+ /// <param name="property">The CommonCustomProperties object to check for.</param>
+ /// <returns>True if attribute was set.</returns>
+ internal bool IsCustomPropertySet(CommonCustomProperties property)
+ {
+ return properties.ContainsKey((int)property);
+ }
+
+ /// <summary>
+ /// Delete the data point custom property with the specified name.
+ /// </summary>
+ /// <param name="name">Name of the property to delete.</param>
+ virtual public void DeleteCustomProperty(string name)
+ {
+ if(name == null)
+ {
+ throw (new ArgumentNullException(SR.ExceptionAttributeNameIsEmpty));
+ }
+
+ // Check if trying to delete the common attribute
+ string[] AttributesNames = CommonCustomProperties.GetNames(typeof(CommonCustomProperties));
+ foreach(string commonName in AttributesNames)
+ {
+ if(name == commonName)
+ {
+ DeleteCustomProperty((CommonCustomProperties)Enum.Parse(typeof(CommonCustomProperties), commonName));
+ }
+ }
+
+ // Remove attribute
+ properties.Remove(name);
+ }
+
+ /// <summary>
+ /// Delete Data Point attribute with specified name.
+ /// </summary>
+ /// <param name="property">ID of the attribute to delete.</param>
+ internal void DeleteCustomProperty(CommonCustomProperties property)
+ {
+ // Check if trying to delete the common attribute from the series
+ if(!this.pointCustomProperties)
+ {
+ throw(new ArgumentException( SR.ExceptionAttributeUnableToDelete));
+ }
+
+ // Remove attribute
+ properties.Remove((int)property);
+ }
+
+ /// <summary>
+ /// Gets the data point custom property with the specified name.
+ /// </summary>
+ /// <param name="name">Name of the property to get.</param>
+ /// <returns>Returns the data point custom property with the specified name. If the requested one is not set,
+ /// the default custom property of the data series will be returned.</returns>
+ virtual public string GetCustomProperty(string name)
+ {
+ if(!IsCustomPropertySet(name) && this.pointCustomProperties)
+ {
+ // Check if we are in serialization mode
+ bool serializing = false;
+
+ if(Chart != null && Chart.serializing)
+ {
+ serializing = true;
+ }
+
+ if(!serializing)
+ {
+
+ if(this.isEmptyPoint)
+ {
+ // Return empty point properties from series
+ return (string)series.EmptyPointStyle.properties[name];
+ }
+
+ // Return properties from series
+ return (string)series.properties[name];
+ }
+ else
+ {
+ // Return default properties
+ return (string)Series.defaultCustomProperties[name];
+ }
+ }
+
+ return (string)properties[name];
+ }
+
+
+ /// <summary>
+ /// Checks if data is currently serialized.
+ /// </summary>
+ /// <returns>True if serialized.</returns>
+ internal bool IsSerializing()
+ {
+ // Check if series object is provided
+ if(series == null)
+ {
+ return true;
+ }
+
+ // Check if we are in serialization mode
+ if(Chart != null)
+ {
+ return Chart.serializing;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /// <summary>
+ /// Returns an attribute object of the Data Point. If required attribute is not set
+ /// in the Data Point the default attribute of the Data series is returned.
+ /// </summary>
+ /// <param name="attrib">Attribute name ID.</param>
+ /// <returns>Attribute value.</returns>
+ internal object GetAttributeObject(CommonCustomProperties attrib)
+ {
+ // Get series properties
+ if(!this.pointCustomProperties || series == null)
+ {
+ return properties[(int)attrib];
+ }
+
+ // Get data point properties
+ if(properties.Count == 0 || !IsCustomPropertySet(attrib))
+ {
+ // Check if we are in serialization mode
+ bool serializing = false;
+ if(Chart != null)
+ {
+ serializing = Chart.serializing;
+ }
+
+ if(!serializing)
+ {
+ if(this.isEmptyPoint)
+ {
+ // Return empty point properties from series
+ return series.EmptyPointStyle.properties[(int)attrib];
+ }
+
+ // Return properties from series
+ return series.properties[(int)attrib];
+ }
+ else
+ {
+ // Return default properties
+ return Series.defaultCustomProperties.properties[(int)attrib];
+ }
+ }
+ return properties[(int)attrib];
+ }
+
+ /// <summary>
+ /// Sets a custom property of the data point.
+ /// </summary>
+ /// <param name="name">Property name.</param>
+ /// <param name="propertyValue">Property value.</param>
+ virtual public void SetCustomProperty(string name, string propertyValue)
+ {
+ properties[name] = propertyValue;
+ }
+
+ /// <summary>
+ /// Sets an attribute of the Data Point as an object.
+ /// </summary>
+ /// <param name="attrib">Attribute name ID.</param>
+ /// <param name="attributeValue">Attribute new value.</param>
+ internal void SetAttributeObject(CommonCustomProperties attrib, object attributeValue)
+ {
+ properties[(int)attrib] = attributeValue;
+ }
+
+ /// <summary>
+ /// Set the default properties of the data point.
+ /// <param name="clearAll">Indicates that previous properties must be cleared.</param>
+ /// </summary>
+ virtual public void SetDefault(bool clearAll)
+ {
+ // If setting defaults for the data series - clear all properties and initialize common one
+ if(!this.pointCustomProperties)
+ {
+ if(clearAll)
+ {
+ properties.Clear();
+ }
+
+ // !!! IMPORTANT !!!
+ // After changing the default value of the common attribute you must also
+ // change the DefaultAttribute of the property representing this attribute.
+ if(!IsCustomPropertySet(CommonCustomProperties.ToolTip))
+ SetAttributeObject(CommonCustomProperties.ToolTip, "");
+ if(!IsCustomPropertySet(CommonCustomProperties.LegendToolTip))
+ SetAttributeObject(CommonCustomProperties.LegendToolTip, "");
+ if(!IsCustomPropertySet(CommonCustomProperties.Color))
+ SetAttributeObject(CommonCustomProperties.Color, Color.Empty);
+ if(!IsCustomPropertySet(CommonCustomProperties.IsValueShownAsLabel))
+ SetAttributeObject(CommonCustomProperties.IsValueShownAsLabel, false);
+ if(!IsCustomPropertySet(CommonCustomProperties.MarkerStyle))
+ SetAttributeObject(CommonCustomProperties.MarkerStyle, MarkerStyle.None);
+ if(!IsCustomPropertySet(CommonCustomProperties.MarkerSize))
+ SetAttributeObject(CommonCustomProperties.MarkerSize, 5);
+ if(!IsCustomPropertySet(CommonCustomProperties.MarkerImage))
+ SetAttributeObject(CommonCustomProperties.MarkerImage, "");
+ if(!IsCustomPropertySet(CommonCustomProperties.Label))
+ SetAttributeObject(CommonCustomProperties.Label, "");
+ if(!IsCustomPropertySet(CommonCustomProperties.BorderWidth))
+ SetAttributeObject(CommonCustomProperties.BorderWidth, 1);
+ if(!IsCustomPropertySet(CommonCustomProperties.BorderDashStyle))
+ SetAttributeObject(CommonCustomProperties.BorderDashStyle, ChartDashStyle.Solid);
+
+
+ if(!IsCustomPropertySet(CommonCustomProperties.AxisLabel))
+ SetAttributeObject(CommonCustomProperties.AxisLabel, "");
+ if(!IsCustomPropertySet(CommonCustomProperties.LabelFormat))
+ SetAttributeObject(CommonCustomProperties.LabelFormat, "");
+ if(!IsCustomPropertySet(CommonCustomProperties.BorderColor))
+ SetAttributeObject(CommonCustomProperties.BorderColor, Color.Empty);
+ if(!IsCustomPropertySet(CommonCustomProperties.BackImage))
+ SetAttributeObject(CommonCustomProperties.BackImage, "");
+ if(!IsCustomPropertySet(CommonCustomProperties.BackImageWrapMode))
+ SetAttributeObject(CommonCustomProperties.BackImageWrapMode, ChartImageWrapMode.Tile);
+ if(!IsCustomPropertySet(CommonCustomProperties.BackImageAlignment))
+ SetAttributeObject(CommonCustomProperties.BackImageAlignment, ChartImageAlignmentStyle.TopLeft);
+ if(!IsCustomPropertySet(CommonCustomProperties.BackImageTransparentColor))
+ SetAttributeObject(CommonCustomProperties.BackImageTransparentColor, Color.Empty);
+ if(!IsCustomPropertySet(CommonCustomProperties.BackGradientStyle))
+ SetAttributeObject(CommonCustomProperties.BackGradientStyle, GradientStyle.None);
+ if(!IsCustomPropertySet(CommonCustomProperties.BackSecondaryColor))
+ SetAttributeObject(CommonCustomProperties.BackSecondaryColor, Color.Empty);
+ if(!IsCustomPropertySet(CommonCustomProperties.BackHatchStyle))
+ SetAttributeObject(CommonCustomProperties.BackHatchStyle, ChartHatchStyle.None);
+ if(!IsCustomPropertySet(CommonCustomProperties.Font))
+ SetAttributeObject(CommonCustomProperties.Font, null);
+ if(!IsCustomPropertySet(CommonCustomProperties.MarkerImageTransparentColor))
+ SetAttributeObject(CommonCustomProperties.MarkerImageTransparentColor, Color.Empty);
+ if(!IsCustomPropertySet(CommonCustomProperties.MarkerColor))
+ SetAttributeObject(CommonCustomProperties.MarkerColor, Color.Empty);
+ if(!IsCustomPropertySet(CommonCustomProperties.MarkerBorderColor))
+ SetAttributeObject(CommonCustomProperties.MarkerBorderColor, Color.Empty);
+ if(!IsCustomPropertySet(CommonCustomProperties.MarkerBorderWidth))
+ SetAttributeObject(CommonCustomProperties.MarkerBorderWidth, 1);
+ if(!IsCustomPropertySet(CommonCustomProperties.MapAreaAttributes))
+ SetAttributeObject(CommonCustomProperties.MapAreaAttributes, "");
+ if (!IsCustomPropertySet(CommonCustomProperties.PostBackValue))
+ SetAttributeObject(CommonCustomProperties.PostBackValue, "");
+
+ if (!IsCustomPropertySet(CommonCustomProperties.LabelForeColor))
+ SetAttributeObject(CommonCustomProperties.LabelForeColor, Color.Black);
+ if (!IsCustomPropertySet(CommonCustomProperties.LabelAngle))
+ SetAttributeObject(CommonCustomProperties.LabelAngle, 0);
+ if (!IsCustomPropertySet(CommonCustomProperties.LabelToolTip))
+ SetAttributeObject(CommonCustomProperties.LabelToolTip, "");
+ if(!IsCustomPropertySet(CommonCustomProperties.LabelUrl))
+ SetAttributeObject(CommonCustomProperties.LabelUrl, "");
+ if (!IsCustomPropertySet(CommonCustomProperties.LabelPostBackValue))
+ SetAttributeObject(CommonCustomProperties.LabelPostBackValue, "");
+ if (!IsCustomPropertySet(CommonCustomProperties.LabelMapAreaAttributes))
+ SetAttributeObject(CommonCustomProperties.LabelMapAreaAttributes, "");
+ if(!IsCustomPropertySet(CommonCustomProperties.LabelBackColor))
+ SetAttributeObject(CommonCustomProperties.LabelBackColor, Color.Empty);
+ if(!IsCustomPropertySet(CommonCustomProperties.LabelBorderWidth))
+ SetAttributeObject(CommonCustomProperties.LabelBorderWidth, 1);
+ if(!IsCustomPropertySet(CommonCustomProperties.LabelBorderDashStyle))
+ SetAttributeObject(CommonCustomProperties.LabelBorderDashStyle, ChartDashStyle.Solid);
+ if(!IsCustomPropertySet(CommonCustomProperties.LabelBorderColor))
+ SetAttributeObject(CommonCustomProperties.LabelBorderColor, Color.Empty);
+
+ if(!IsCustomPropertySet(CommonCustomProperties.Url))
+ SetAttributeObject(CommonCustomProperties.Url, "");
+ if(!IsCustomPropertySet(CommonCustomProperties.LegendUrl))
+ SetAttributeObject(CommonCustomProperties.LegendUrl, "");
+ if (!IsCustomPropertySet(CommonCustomProperties.LegendPostBackValue))
+ SetAttributeObject(CommonCustomProperties.LegendPostBackValue, "");
+ if (!IsCustomPropertySet(CommonCustomProperties.LegendText))
+ SetAttributeObject(CommonCustomProperties.LegendText, "");
+ if(!IsCustomPropertySet(CommonCustomProperties.LegendMapAreaAttributes))
+ SetAttributeObject(CommonCustomProperties.LegendMapAreaAttributes, "");
+ if(!IsCustomPropertySet(CommonCustomProperties.IsVisibleInLegend))
+ SetAttributeObject(CommonCustomProperties.IsVisibleInLegend, true);
+ }
+
+ // If setting defaults for the data point - clear all properties
+ else
+ {
+ properties.Clear();
+ }
+ }
+
+ #endregion
+
+ #region DataPointCustomProperties Properties
+
+ /// <summary>
+ /// Indexer of the custom properties. Returns the DataPointCustomProperties object by index.
+ /// </summary>
+ /// <param name="index">Index of the custom property.</param>
+ public string this[int index]
+ {
+ get
+ {
+ int currentIndex = 0;
+ foreach(object key in properties.Keys)
+ {
+ if(currentIndex == index)
+ {
+ string keyStr = key as string;
+ if (keyStr != null)
+ {
+ return keyStr;
+ }
+ else if (key is int)
+ {
+ return Enum.GetName(typeof(CommonCustomProperties), key);
+ }
+ return key.ToString();
+ }
+ ++currentIndex;
+ }
+ // we can't throw IndexOutOfRangeException here, it is reserved
+ // by the CLR.
+ throw (new InvalidOperationException());
+ }
+ }
+
+ /// <summary>
+ /// Indexer of the custom properties. Returns the DataPointCustomProperties object by name.
+ /// </summary>
+ /// <param name="name">Name of the custom property.</param>
+ public string this[string name]
+ {
+ get
+ {
+ // If attribute is not set in data point - try getting it from the series
+ if(!IsCustomPropertySet(name) && this.pointCustomProperties)
+ {
+ if(this.isEmptyPoint)
+ {
+ return (string)series.EmptyPointStyle.properties[name];
+ }
+
+ return (string)series.properties[name];
+ }
+ return (string)properties[name];
+ }
+ set
+ {
+ properties[name] = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// The text of the data point label.
+ /// </summary>
+ [
+ Editor(Editors.KeywordsStringEditor.Editor, Editors.KeywordsStringEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ SRCategory("CategoryAttributeLabel"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeLabel"),
+ ]
+ virtual public string Label
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.Label))
+ {
+ return (string)GetAttributeObject(CommonCustomProperties.Label);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return "";
+ }
+ if(this.isEmptyPoint)
+ {
+ return (string)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.Label);
+ }
+
+ return series.label;
+ }
+ }
+ else
+ {
+ return series.label;
+ }
+ }
+ set
+ {
+ // Replace NULL with empty string
+ if(value == null)
+ {
+ value = string.Empty;
+ }
+
+ if (this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.Label, value);
+ else
+ series.label = value;
+
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// The text of X axis label for the data point.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeAxisLabel"),
+ Editor(Editors.KeywordsStringEditor.Editor, Editors.KeywordsStringEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ virtual public string AxisLabel
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.AxisLabel))
+ {
+ return (string)GetAttributeObject(CommonCustomProperties.AxisLabel);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return "";
+ }
+ if(this.isEmptyPoint)
+ {
+ return (string)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.AxisLabel);
+ }
+
+ return series.axisLabel;
+
+ }
+ }
+ else
+ {
+ return series.axisLabel;
+ }
+ }
+ set
+ {
+ // Replace NULL with empty string
+ if(value == null)
+ {
+ value = string.Empty;
+ }
+
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.AxisLabel, value);
+ else
+ series.axisLabel = value;
+
+ // Set flag that there are non-empy axis labels in series or points
+ if(value.Length > 0 && series != null)
+ {
+ series.noLabelsInPoints = false;
+ }
+
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Format string of the data point label.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeLabel"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeLabelFormat"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ ]
+ public string LabelFormat
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.LabelFormat))
+ {
+ return (string)GetAttributeObject(CommonCustomProperties.LabelFormat);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return "";
+ }
+ if(this.isEmptyPoint)
+ {
+ return (string)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.LabelFormat);
+ }
+
+ return series.labelFormat;
+ }
+ }
+ else
+ {
+ return series.labelFormat;
+ }
+ }
+ set
+ {
+ // Replace NULL with empty string
+ if(value == null)
+ {
+ value = string.Empty;
+ }
+
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.LabelFormat, value);
+ else
+ series.labelFormat = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// A flag which indicates whether to show the data point's value on the label.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeLabel"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeShowLabelAsValue"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public bool IsValueShownAsLabel
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.IsValueShownAsLabel))
+ {
+ return (bool)GetAttributeObject(CommonCustomProperties.IsValueShownAsLabel);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return false;
+ }
+ if(this.isEmptyPoint)
+ {
+ return (bool)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.IsValueShownAsLabel);
+ }
+
+ return series.showLabelAsValue;
+
+ }
+ }
+ else
+ {
+ return series.showLabelAsValue;
+ }
+ }
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.IsValueShownAsLabel, value);
+ else
+ series.showLabelAsValue = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Color of the data point.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeColor4"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color Color
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.Color))
+ {
+ return (Color)GetAttributeObject(CommonCustomProperties.Color);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return Color.Empty;
+ }
+ if(this.isEmptyPoint)
+ {
+ return (Color)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.Color);
+ }
+
+ return series.color;
+ }
+ }
+ else
+ {
+ return series.color;
+ }
+ }
+ set
+ {
+ // Remove the temp color flag
+ this.tempColorIsSet = false;
+
+ if(value == Color.Empty && this.pointCustomProperties)
+ {
+ DeleteCustomProperty(CommonCustomProperties.Color);
+ }
+ else
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.Color, value);
+ else
+ series.color = value;
+ this.Invalidate(true);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Border color of the data point.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeBorderColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BorderColor
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.BorderColor))
+ {
+ return (Color)GetAttributeObject(CommonCustomProperties.BorderColor);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return Color.Empty;
+ }
+ if(this.isEmptyPoint)
+ {
+ return (Color)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.BorderColor);
+ }
+
+ return series.borderColor;
+ }
+ }
+ else
+ {
+ return series.borderColor;
+ }
+ }
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.BorderColor, value);
+ else
+ series.borderColor = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Border style of the data point.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeBorderDashStyle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public ChartDashStyle BorderDashStyle
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.BorderDashStyle))
+ {
+ return (ChartDashStyle)GetAttributeObject(CommonCustomProperties.BorderDashStyle);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return ChartDashStyle.Solid;
+ }
+ if(this.isEmptyPoint)
+ {
+ return (ChartDashStyle)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.BorderDashStyle);
+ }
+
+ return series.borderDashStyle;
+
+ }
+ }
+ else
+ {
+ return series.borderDashStyle;
+ }
+ }
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.BorderDashStyle, value);
+ else
+ series.borderDashStyle = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Border width of the data point.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeBorderWidth"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public int BorderWidth
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.BorderWidth))
+ {
+ return (int)GetAttributeObject(CommonCustomProperties.BorderWidth);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return 1;
+ }
+ if(this.isEmptyPoint)
+ {
+ return (int)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.BorderWidth);
+ }
+
+ return series.borderWidth;
+
+ }
+ }
+ else
+ {
+ return series.borderWidth;
+ }
+ }
+ set
+ {
+ if(value < 0)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionBorderWidthIsNotPositive));
+ }
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.BorderWidth, value);
+ else
+ series.borderWidth = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Background image of the data point.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeBackImage"),
+ Editor(Editors.ImageValueEditor.Editor, Editors.ImageValueEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ ]
+ public string BackImage
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.BackImage))
+ {
+ return (string)GetAttributeObject(CommonCustomProperties.BackImage);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return "";
+ }
+ if(this.isEmptyPoint)
+ {
+ return (string)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.BackImage);
+ }
+
+ return series.backImage;
+
+ }
+ }
+ else
+ {
+ return series.backImage;
+ }
+ }
+ set
+ {
+ // Replace NULL with empty string
+ if(value == null)
+ {
+ value = string.Empty;
+ }
+
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.BackImage, value);
+ else
+ series.backImage = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the drawing mode of the background image.
+ /// </summary>
+ /// <value>
+ /// A <see cref="ChartImageWrapMode"/> value that defines the drawing mode of the image.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeImageWrapMode"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public ChartImageWrapMode BackImageWrapMode
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.BackImageWrapMode))
+ {
+ return (ChartImageWrapMode)GetAttributeObject(CommonCustomProperties.BackImageWrapMode);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return ChartImageWrapMode.Tile;
+ }
+ if(this.isEmptyPoint)
+ {
+ return (ChartImageWrapMode)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.BackImageWrapMode);
+ }
+
+ return series.backImageWrapMode;
+
+ }
+ }
+ else
+ {
+ return series.backImageWrapMode;
+ }
+ }
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.BackImageWrapMode, value);
+ else
+ series.backImageWrapMode = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a color which will be replaced with a transparent color while drawing the background image.
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value which will be replaced with a transparent color while drawing the image.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeImageTransparentColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BackImageTransparentColor
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.BackImageTransparentColor))
+ {
+ return (Color)GetAttributeObject(CommonCustomProperties.BackImageTransparentColor);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return Color.Empty;
+ }
+ if(this.isEmptyPoint)
+ {
+ return (Color)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.BackImageTransparentColor);
+ }
+
+ return series.backImageTransparentColor;
+
+ }
+ }
+ else
+ {
+ return series.backImageTransparentColor;
+ }
+ }
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.BackImageTransparentColor, value);
+ else
+ series.backImageTransparentColor = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the alignment of the background image which is used by ClampUnscale drawing mode.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackImageAlign"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public ChartImageAlignmentStyle BackImageAlignment
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.BackImageAlignment))
+ {
+ return (ChartImageAlignmentStyle)GetAttributeObject(CommonCustomProperties.BackImageAlignment);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return ChartImageAlignmentStyle.TopLeft;
+ }
+ if(this.isEmptyPoint)
+ {
+ return (ChartImageAlignmentStyle)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.BackImageAlignment);
+ }
+
+ return series.backImageAlignment;
+
+ }
+ }
+ else
+ {
+ return series.backImageAlignment;
+ }
+ }
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.BackImageAlignment, value);
+ else
+ series.backImageAlignment = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background gradient style.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeBackGradientStyle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ Editor(Editors.GradientEditor.Editor, Editors.GradientEditor.Base)
+ ]
+ public GradientStyle BackGradientStyle
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.BackGradientStyle))
+ {
+ return (GradientStyle)GetAttributeObject(CommonCustomProperties.BackGradientStyle);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return GradientStyle.None;
+ }
+ if(this.isEmptyPoint)
+ {
+ return (GradientStyle)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.BackGradientStyle);
+ }
+
+ return series.backGradientStyle;
+
+ }
+ }
+ else
+ {
+ return series.backGradientStyle;
+ }
+ }
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.BackGradientStyle, value);
+ else
+ series.backGradientStyle = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the secondary background color.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeBackSecondaryColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BackSecondaryColor
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.BackSecondaryColor))
+ {
+ return (Color)GetAttributeObject(CommonCustomProperties.BackSecondaryColor);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return Color.Empty;
+ }
+ if(this.isEmptyPoint)
+ {
+ return (Color)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.BackSecondaryColor);
+ }
+
+ return series.backSecondaryColor;
+
+ }
+ }
+ else
+ {
+ return series.backSecondaryColor;
+ }
+ }
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.BackSecondaryColor, value);
+ else
+ series.backSecondaryColor = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background hatch style.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeBackHatchStyle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ Editor(Editors.HatchStyleEditor.Editor, Editors.HatchStyleEditor.Base)
+ ]
+ public ChartHatchStyle BackHatchStyle
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.BackHatchStyle))
+ {
+ return (ChartHatchStyle)GetAttributeObject(CommonCustomProperties.BackHatchStyle);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return ChartHatchStyle.None;
+ }
+ if(this.isEmptyPoint)
+ {
+ return (ChartHatchStyle)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.BackHatchStyle);
+ }
+
+ return series.backHatchStyle;
+
+ }
+ }
+ else
+ {
+ return series.backHatchStyle;
+ }
+ }
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.BackHatchStyle, value);
+ else
+ series.backHatchStyle = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the font of the data point.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeLabelAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeFont"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Font Font
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.Font))
+ {
+ Font font = GetAttributeObject(CommonCustomProperties.Font) as Font;
+ if (font != null)
+ return font;
+ }
+
+ if(IsSerializing())
+ {
+ return series.FontCache.DefaultFont;
+ }
+
+ if(this.isEmptyPoint)
+ {
+ return series.EmptyPointStyle.Font;
+ }
+
+ return series.font;
+ }
+ else
+ {
+ return series.font;
+ }
+ }
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.Font, value);
+ else
+ series.font = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the label color.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeLabelAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeFontColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color LabelForeColor
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.LabelForeColor))
+ {
+ Color color = (Color)GetAttributeObject(CommonCustomProperties.LabelForeColor);
+ return color;
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return Color.Black;
+ }
+ if(this.isEmptyPoint)
+ {
+ return (Color)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.LabelForeColor);
+ }
+
+ return series.fontColor;
+
+ }
+ }
+ else
+ {
+ return series.fontColor;
+ }
+ }
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.LabelForeColor, value);
+ else
+ series.fontColor = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the angle of the label.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeLabelAppearance"),
+ Bindable(true),
+ SRDescription(SR.Keys.DescriptionAttributeLabel_FontAngle),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ ]
+ public int LabelAngle
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.LabelAngle))
+ {
+ return (int)GetAttributeObject(CommonCustomProperties.LabelAngle);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return 0;
+ }
+ if(this.isEmptyPoint)
+ {
+ return (int)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.LabelAngle);
+ }
+
+ return series.fontAngle;
+
+ }
+ }
+ else
+ {
+ return series.fontAngle;
+ }
+ }
+ set
+ {
+ if(value < -90 || value > 90)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionAngleRangeInvalid));
+ }
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.LabelAngle, value);
+ else
+ series.fontAngle = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the marker style.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMarker"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeMarkerStyle4"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ Editor(Editors.MarkerStyleEditor.Editor, Editors.MarkerStyleEditor.Base),
+ RefreshProperties(RefreshProperties.All)
+ ]
+ public MarkerStyle MarkerStyle
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.MarkerStyle))
+ {
+ return (MarkerStyle)GetAttributeObject(CommonCustomProperties.MarkerStyle);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return MarkerStyle.None;
+ }
+ if(this.isEmptyPoint)
+ {
+ return (MarkerStyle)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.MarkerStyle);
+ }
+
+ return series.markerStyle;
+
+ }
+ }
+ else
+ {
+ return series.markerStyle;
+ }
+ }
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.MarkerStyle, value);
+ else
+ series.markerStyle = value;
+
+ Series thisSeries = this as Series;
+ if(thisSeries != null)
+ {
+ thisSeries.tempMarkerStyleIsSet = false;
+ }
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the size of the marker.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMarker"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeMarkerSize"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ RefreshProperties(RefreshProperties.All)
+ ]
+ public int MarkerSize
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.MarkerSize))
+ {
+ return (int)GetAttributeObject(CommonCustomProperties.MarkerSize);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return 5;
+ }
+ if(this.isEmptyPoint)
+ {
+ return (int)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.MarkerSize);
+ }
+
+ return series.markerSize;
+
+ }
+ }
+ else
+ {
+ return series.markerSize;
+ }
+ }
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.MarkerSize, value);
+ else
+ series.markerSize = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the marker image.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMarker"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeMarkerImage"),
+ Editor(Editors.ImageValueEditor.Editor, Editors.ImageValueEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ RefreshProperties(RefreshProperties.All)
+ ]
+ public string MarkerImage
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.MarkerImage))
+ {
+ return (string)GetAttributeObject(CommonCustomProperties.MarkerImage);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return "";
+ }
+ if(this.isEmptyPoint)
+ {
+ return (string)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.MarkerImage);
+ }
+
+ return series.markerImage;
+
+ }
+ }
+ else
+ {
+ return series.markerImage;
+ }
+ }
+ set
+ {
+ // Replace NULL with empty string
+ if(value == null)
+ {
+ value = string.Empty;
+ }
+
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.MarkerImage, value);
+ else
+ series.markerImage = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the color which will be replaced with a transparent color while drawing the marker image.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMarker"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeImageTransparentColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ RefreshProperties(RefreshProperties.All)
+ ]
+ public Color MarkerImageTransparentColor
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.MarkerImageTransparentColor))
+ {
+ return (Color)GetAttributeObject(CommonCustomProperties.MarkerImageTransparentColor);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return Color.Empty;
+ }
+ if(this.isEmptyPoint)
+ {
+ return (Color)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.MarkerImageTransparentColor);
+ }
+
+ return series.markerImageTransparentColor;
+
+ }
+ }
+ else
+ {
+ return series.markerImageTransparentColor;
+ }
+ }
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.MarkerImageTransparentColor, value);
+ else
+ series.markerImageTransparentColor = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the marker color.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMarker"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeMarkerColor3"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ RefreshProperties(RefreshProperties.All)
+ ]
+ public Color MarkerColor
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.MarkerColor))
+ {
+ return (Color)GetAttributeObject(CommonCustomProperties.MarkerColor);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return Color.Empty;
+ }
+ if(this.isEmptyPoint)
+ {
+ return (Color)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.MarkerColor);
+ }
+
+ return series.markerColor;
+
+ }
+ }
+ else
+ {
+ return series.markerColor;
+ }
+ }
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.MarkerColor, value);
+ else
+ series.markerColor = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the border color of the marker.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMarker"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeMarkerBorderColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ RefreshProperties(RefreshProperties.All)
+ ]
+ public Color MarkerBorderColor
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.MarkerBorderColor))
+ {
+ return (Color)GetAttributeObject(CommonCustomProperties.MarkerBorderColor);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return Color.Empty;
+ }
+ if(this.isEmptyPoint)
+ {
+ return (Color)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.MarkerBorderColor);
+ }
+
+ return series.markerBorderColor;
+
+ }
+ }
+ else
+ {
+ return series.markerBorderColor;
+ }
+ }
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.MarkerBorderColor, value);
+ else
+ series.markerBorderColor = value;
+ this.Invalidate(true);
+ }
+ }
+
+
+
+ /// <summary>
+ /// Gets or sets the border width of the marker.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeMarker"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeMarkerBorderWidth"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public int MarkerBorderWidth
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.MarkerBorderWidth))
+ {
+ return (int)GetAttributeObject(CommonCustomProperties.MarkerBorderWidth);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return 1;
+ }
+ if(this.isEmptyPoint)
+ {
+ return (int)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.MarkerBorderWidth);
+ }
+
+ return series.markerBorderWidth;
+
+ }
+ }
+ else
+ {
+ return series.markerBorderWidth;
+ }
+ }
+ set
+ {
+ if(value < 0)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionBorderWidthIsNotPositive));
+ }
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.MarkerBorderWidth, value);
+ else
+ series.markerBorderWidth = value;
+ this.Invalidate(true);
+ }
+ }
+
+
+
+ /// <summary>
+ /// Gets or sets the extended custom properties of the data point.
+ /// Extended custom properties can be specified in the following format:
+ /// AttrName1=Value1, AttrName2=Value2, ...
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(false),
+ SRDescription("DescriptionAttributeCustomAttributesExtended"),
+ DefaultValue(null),
+ RefreshProperties(RefreshProperties.All),
+ NotifyParentPropertyAttribute(true),
+ DesignOnlyAttribute(true),
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DisplayName("CustomProperties")
+ ]
+ public CustomProperties CustomPropertiesExtended
+ {
+ set
+ {
+ customProperties = value;
+ }
+ get
+ {
+ return customProperties;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the custom properties of the data point.
+ /// Custom properties can be specified in the following format:
+ /// AttrName1=Value1, AttrName2=Value2, ...
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ Browsable(false),
+ SRDescription("DescriptionAttributeCustomAttributesExtended"),
+ DefaultValue(""),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public string CustomProperties
+ {
+ get
+ {
+ // Save all custom properties in a string
+ string result = "";
+ string[] attributesNames = CommonCustomProperties.GetNames(typeof(CommonCustomProperties));
+ for(int i = properties.Count - 1; i >= 0; i--)
+ {
+ if(this[i] != null)
+ {
+ string attributeName = this[i];
+
+ // Check if attribute is custom
+ bool customAttribute = true;
+ foreach(string name in attributesNames)
+ {
+ if(String.Compare(attributeName, name, StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ customAttribute = false;
+ break;
+ }
+ }
+
+ // Add custom attribute to the string
+ if(customAttribute && properties[attributeName] != null)
+ {
+ if(result.Length > 0)
+ {
+ result += ", ";
+ }
+ string attributeValue = properties[attributeName].ToString().Replace(",", "\\,");
+ attributeValue = attributeValue.Replace("=", "\\=");
+
+ result += attributeName + "=" + attributeValue;
+ }
+ }
+ }
+
+ return result;
+ }
+ set
+ {
+ // Replace NULL with empty string
+ if(value == null)
+ {
+ value = string.Empty;
+ }
+
+ // Copy all common properties to the new collection
+ Hashtable newAttributes = new Hashtable();
+ Array enumValues = Enum.GetValues(typeof(CommonCustomProperties));
+ foreach(object val in enumValues)
+ {
+ if(IsCustomPropertySet((CommonCustomProperties)val))
+ {
+ newAttributes[(int)val] = properties[(int)val];
+ }
+ }
+
+ if(value.Length > 0)
+ {
+ // Replace commas in value string
+ value = value.Replace("\\,", "\\x45");
+ value = value.Replace("\\=", "\\x46");
+
+ // Add new custom properties
+ string[] nameValueStrings = value.Split(',');
+ foreach(string nameValue in nameValueStrings)
+ {
+ string[] values = nameValue.Split('=');
+
+ // Check format
+ if(values.Length != 2)
+ {
+ throw(new FormatException( SR.ExceptionAttributeInvalidFormat));
+ }
+
+ // Check for empty name or value
+ values[0] = values[0].Trim();
+ values[1] = values[1].Trim();
+ if(values[0].Length == 0)
+ {
+ throw(new FormatException( SR.ExceptionAttributeInvalidFormat));
+ }
+
+ // Check if value already defined
+ foreach(object existingAttributeName in newAttributes.Keys)
+ {
+ string existingAttributeNameStr = existingAttributeName as string;
+ if (existingAttributeNameStr != null)
+ {
+ if (String.Compare(existingAttributeNameStr, values[0], StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ throw(new FormatException( SR.ExceptionAttributeNameIsNotUnique(values[0] ) ) );
+ }
+ }
+ }
+
+ string newValue = values[1].Replace("\\x45", ",");
+ newAttributes[values[0]] = newValue.Replace("\\x46", "=");
+
+ }
+ }
+ properties = newAttributes;
+ this.Invalidate(true);
+ }
+ }
+
+ #endregion
+
+ #region IMapAreaAttributesutes Properties implementation
+
+ /// <summary>
+ /// Tooltip.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMapArea"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeToolTip"),
+ Editor(Editors.KeywordsStringEditor.Editor, Editors.KeywordsStringEditor.Base),
+#if !Microsoft_CONTROL
+ DefaultValue(""),
+ PersistenceMode(PersistenceMode.Attribute)
+#endif
+ ]
+ public string ToolTip
+ {
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.ToolTip, value);
+ else
+ series.toolTip = value;
+
+#if Microsoft_CONTROL
+ if(Chart != null && Chart.selection != null)
+ {
+ Chart.selection.enabledChecked = false;
+ }
+#endif
+ }
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.ToolTip))
+ {
+ return (String)GetAttributeObject(CommonCustomProperties.ToolTip);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return "";
+ }
+ if(this.isEmptyPoint)
+ {
+ return (string)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.ToolTip);
+ }
+
+ return series.toolTip;
+
+ }
+ }
+ else
+ {
+ return series.toolTip;
+ }
+ }
+ }
+
+#if !Microsoft_CONTROL
+
+ /// <summary>
+ /// URL target of the area.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMapArea"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeUrl"),
+ DefaultValue(""),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ Editor(Editors.UrlValueEditor.Editor, Editors.UrlValueEditor.Base)
+#endif
+ ]
+ public string Url
+ {
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.Url, value);
+ else
+ series.url = value;
+ }
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.Url))
+ {
+ return (String)GetAttributeObject(CommonCustomProperties.Url);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return "";
+ }
+ if(this.isEmptyPoint)
+ {
+ return (string)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.Url);
+ }
+
+ return series.url;
+
+ }
+ }
+ else
+ {
+ return series.url;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Other attributes of the area.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMapArea"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeMapAreaAttributes"),
+ DefaultValue(""),
+ PersistenceMode(PersistenceMode.Attribute),
+ Editor(Editors.KeywordsStringEditor.Editor, Editors.KeywordsStringEditor.Base)
+ ]
+ public string MapAreaAttributes
+ {
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.MapAreaAttributes, value);
+ else
+ series.mapAreaAttributes = value;
+ }
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.MapAreaAttributes))
+ {
+ return (String)GetAttributeObject(CommonCustomProperties.MapAreaAttributes);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return "";
+ }
+ if(this.isEmptyPoint)
+ {
+ return (string)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.MapAreaAttributes);
+ }
+
+ return series.mapAreaAttributes;
+ }
+ }
+ else
+ {
+ return series.mapAreaAttributes;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the postback value which can be processed on click event.
+ /// </summary>
+ /// <value>The value which is passed to click event as argument.</value>
+ [DefaultValue("")]
+ [SRCategory(SR.Keys.CategoryAttributeMapArea)]
+ [SRDescription(SR.Keys.DescriptionAttributePostBackValue)]
+ [Editor(Editors.KeywordsStringEditor.Editor, Editors.KeywordsStringEditor.Base)]
+ public string PostBackValue
+ {
+ get
+ {
+ if (this.pointCustomProperties)
+ {
+ if (properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.PostBackValue))
+ {
+ return (String)GetAttributeObject(CommonCustomProperties.PostBackValue);
+ }
+ else
+ {
+ if (IsSerializing())
+ {
+ return "";
+ }
+ if (this.isEmptyPoint)
+ {
+ return (string)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.PostBackValue);
+ }
+
+ return series.postbackValue;
+ }
+ }
+ else
+ {
+ return series.postbackValue;
+ }
+ }
+ set
+ {
+ if (this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.PostBackValue, value);
+ else
+ series.postbackValue = value;
+ }
+ }
+
+
+
+
+#endif
+ /// <summary>
+ /// Replaces predefined keyword inside the string with their values.
+ /// </summary>
+ /// <param name="strOriginal">Original string with keywords.</param>
+ /// <returns>Modified string.</returns>
+ internal virtual string ReplaceKeywords(string strOriginal)
+ {
+ return strOriginal;
+ }
+
+ #endregion
+
+ #region Legend properties
+
+ /// <summary>
+ /// Indicates whether the item is shown in the legend.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeLegend"),
+
+ Bindable(true),
+ SRDescription("DescriptionAttributeShowInLegend"),
+ #if !Microsoft_CONTROL
+ DefaultValue(true),
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public bool IsVisibleInLegend
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.IsVisibleInLegend))
+ {
+ return (bool)GetAttributeObject(CommonCustomProperties.IsVisibleInLegend);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return true;
+ }
+ if(this.isEmptyPoint)
+ {
+ return (bool)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.IsVisibleInLegend);
+ }
+
+ return series.showInLegend;
+ }
+ }
+ else
+ {
+ return series.showInLegend;
+ }
+ }
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.IsVisibleInLegend, value);
+ else
+ series.showInLegend = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Text of the item in the legend
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeLegend"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeLegendText"),
+ Editor(Editors.KeywordsStringEditor.Editor, Editors.KeywordsStringEditor.Base),
+ #if !Microsoft_CONTROL
+ DefaultValue(""),
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public string LegendText
+ {
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.LegendText, value);
+ else
+ series.legendText = value;
+ this.Invalidate(true);
+ }
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.LegendText))
+ {
+ return (String)GetAttributeObject(CommonCustomProperties.LegendText);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return "";
+ }
+ if(this.isEmptyPoint)
+ {
+ return (string)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.LegendText);
+ }
+
+ return series.legendText;
+ }
+ }
+ else
+ {
+ return series.legendText;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Tooltip of the item in the legend
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeLegend"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeLegendToolTip"),
+ Editor(Editors.KeywordsStringEditor.Editor, Editors.KeywordsStringEditor.Base),
+ #if !Microsoft_CONTROL
+ DefaultValue(""),
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public string LegendToolTip
+ {
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.LegendToolTip, value);
+ else
+ series.legendToolTip = value;
+
+#if Microsoft_CONTROL
+ if(Chart != null && Chart.selection != null)
+ {
+ Chart.selection.enabledChecked = false;
+ }
+#endif
+ }
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.LegendToolTip))
+ {
+ return (String)GetAttributeObject(CommonCustomProperties.LegendToolTip);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return "";
+ }
+ if(this.isEmptyPoint)
+ {
+ return (string)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.LegendToolTip);
+ }
+
+ return series.legendToolTip;
+
+ }
+ }
+ else
+ {
+ return series.legendToolTip;
+ }
+ }
+ }
+
+
+
+ /// <summary>
+ /// Background color of the data point label.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeLabelAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeLabelBackColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ DefaultValue(typeof(Color), ""),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color LabelBackColor
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.LabelBackColor))
+ {
+ return (Color)GetAttributeObject(CommonCustomProperties.LabelBackColor);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return Color.Empty;
+ }
+ if(this.isEmptyPoint)
+ {
+ return (Color)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.LabelBackColor);
+ }
+
+ return series.labelBackColor;
+ }
+ }
+ else
+ {
+ return series.labelBackColor;
+ }
+ }
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.LabelBackColor, value);
+ else
+ series.labelBackColor = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Border color of the data point label.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeLabelAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeBorderColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ DefaultValue(typeof(Color), ""),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color LabelBorderColor
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.LabelBorderColor))
+ {
+ return (Color)GetAttributeObject(CommonCustomProperties.LabelBorderColor);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return Color.Empty;
+ }
+ if(this.isEmptyPoint)
+ {
+ return (Color)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.LabelBorderColor);
+ }
+
+ return series.labelBorderColor;
+ }
+ }
+ else
+ {
+ return series.labelBorderColor;
+ }
+ }
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.LabelBorderColor, value);
+ else
+ series.labelBorderColor = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Border style of the label.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeLabelAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeLabelBorderDashStyle"),
+ #if !Microsoft_CONTROL
+ DefaultValue(ChartDashStyle.Solid),
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public ChartDashStyle LabelBorderDashStyle
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.LabelBorderDashStyle))
+ {
+ return (ChartDashStyle)GetAttributeObject(CommonCustomProperties.LabelBorderDashStyle);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return ChartDashStyle.Solid;
+ }
+ if(this.isEmptyPoint)
+ {
+ return (ChartDashStyle)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.LabelBorderDashStyle);
+ }
+
+ return series.labelBorderDashStyle;
+
+ }
+ }
+ else
+ {
+ return series.labelBorderDashStyle;
+ }
+ }
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.LabelBorderDashStyle, value);
+ else
+ series.labelBorderDashStyle = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Border width of the label.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeLabelAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeBorderWidth"),
+ #if !Microsoft_CONTROL
+ DefaultValue(1),
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public int LabelBorderWidth
+ {
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.LabelBorderWidth))
+ {
+ return (int)GetAttributeObject(CommonCustomProperties.LabelBorderWidth);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return 1;
+ }
+ if(this.isEmptyPoint)
+ {
+ return (int)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.LabelBorderWidth);
+ }
+
+ return series.labelBorderWidth;
+
+ }
+ }
+ else
+ {
+ return series.labelBorderWidth;
+ }
+ }
+ set
+ {
+ if(value < 0)
+ {
+ throw(new ArgumentOutOfRangeException("value", SR.ExceptionLabelBorderIsNotPositive));
+ }
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.LabelBorderWidth, value);
+ else
+ series.labelBorderWidth = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Tooltip of the data point label.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeLabel"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeLabelToolTip"),
+ Editor(Editors.KeywordsStringEditor.Editor, Editors.KeywordsStringEditor.Base),
+ #if !Microsoft_CONTROL
+ DefaultValue(""),
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public string LabelToolTip
+ {
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.LabelToolTip, value);
+ else
+ series.labelToolTip = value;
+
+#if Microsoft_CONTROL
+ if(Chart != null && Chart.selection != null)
+ {
+ Chart.selection.enabledChecked = false;
+ }
+#endif
+ }
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.LabelToolTip))
+ {
+ return (String)GetAttributeObject(CommonCustomProperties.LabelToolTip);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return "";
+ }
+ if(this.isEmptyPoint)
+ {
+ return (string)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.LabelToolTip);
+ }
+
+ return series.labelToolTip;
+
+ }
+ }
+ else
+ {
+ return series.labelToolTip;
+ }
+ }
+ }
+
+
+#if !Microsoft_CONTROL
+
+ /// <summary>
+ /// URL target of the item in the legend.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeLegend"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeLegendUrl"),
+ DefaultValue(""),
+ PersistenceMode(PersistenceMode.Attribute),
+ Editor(Editors.UrlValueEditor.Editor, Editors.UrlValueEditor.Base),
+ SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")
+ ]
+ public string LegendUrl
+ {
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.LegendUrl, value);
+ else
+ series.legendUrl = value;
+ }
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.LegendUrl))
+ {
+ return (String)GetAttributeObject(CommonCustomProperties.LegendUrl);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return "";
+ }
+ if(this.isEmptyPoint)
+ {
+ return (string)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.LegendUrl);
+ }
+
+ return series.legendUrl;
+ }
+ }
+ else
+ {
+ return series.legendUrl;
+ }
+ }
+ }
+
+#endif
+
+#if !Microsoft_CONTROL
+
+ /// <summary>
+ /// Other attributes of the legend map area.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeLegend"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeMapAreaAttributes"),
+ DefaultValue(""),
+ PersistenceMode(PersistenceMode.Attribute),
+ Editor(Editors.KeywordsStringEditor.Editor, Editors.KeywordsStringEditor.Base)
+ ]
+ public string LegendMapAreaAttributes
+ {
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.LegendMapAreaAttributes, value);
+ else
+ series.legendMapAreaAttributes = value;
+ }
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.LegendMapAreaAttributes))
+ {
+ return (String)GetAttributeObject(CommonCustomProperties.LegendMapAreaAttributes);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return "";
+ }
+ if(this.isEmptyPoint)
+ {
+ return (string)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.LegendMapAreaAttributes);
+ }
+
+ return series.legendMapAreaAttributes;
+
+ }
+ }
+ else
+ {
+ return series.legendMapAreaAttributes;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the postback value which can be processed on click event.
+ /// </summary>
+ /// <value>The value which is passed to click event as argument.</value>
+ [DefaultValue("")]
+ [SRCategory("CategoryAttributeLegend")]
+ [SRDescription(SR.Keys.DescriptionAttributePostBackValue)]
+ [Editor(Editors.KeywordsStringEditor.Editor, Editors.KeywordsStringEditor.Base)]
+ public string LegendPostBackValue
+ {
+ get
+ {
+ if (this.pointCustomProperties)
+ {
+ if (properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.LegendPostBackValue))
+ {
+ return (String)GetAttributeObject(CommonCustomProperties.LegendPostBackValue);
+ }
+ else
+ {
+ if (IsSerializing())
+ {
+ return "";
+ }
+ if (this.isEmptyPoint)
+ {
+ return (string)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.LegendPostBackValue);
+ }
+
+ return series.legendPostbackValue;
+ }
+ }
+ else
+ {
+ return series.legendPostbackValue;
+ }
+ }
+ set
+ {
+ if (this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.LegendPostBackValue, value);
+ else
+ series.legendPostbackValue = value;
+ }
+ }
+
+#endif // !Microsoft_CONTROL
+
+
+
+#if !Microsoft_CONTROL
+
+ /// <summary>
+ /// URL target of the data point label.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMapArea"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeUrl"),
+ DefaultValue(""),
+ PersistenceMode(PersistenceMode.Attribute),
+ Editor(Editors.UrlValueEditor.Editor, Editors.UrlValueEditor.Base),
+ SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")
+ ]
+ public string LabelUrl
+ {
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.LabelUrl, value);
+ else
+ series.labelUrl = value;
+ }
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.LabelUrl))
+ {
+ return (String)GetAttributeObject(CommonCustomProperties.LabelUrl);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return "";
+ }
+ if(this.isEmptyPoint)
+ {
+ return (string)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.LabelUrl);
+ }
+
+ return series.labelUrl;
+ }
+ }
+ else
+ {
+ return series.labelUrl;
+ }
+ }
+ }
+
+#endif //if !Microsoft_CONTROL
+
+#if !Microsoft_CONTROL
+
+ /// <summary>
+ /// Other attributes of the data point label.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeLabel"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeMapAreaAttributes"),
+ DefaultValue(""),
+ PersistenceMode(PersistenceMode.Attribute)
+ ]
+ public string LabelMapAreaAttributes
+ {
+ set
+ {
+ if(this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.LabelMapAreaAttributes, value);
+ else
+ series.labelMapAreaAttributes = value;
+ }
+ get
+ {
+ if(this.pointCustomProperties)
+ {
+ if(properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.LabelMapAreaAttributes))
+ {
+ return (String)GetAttributeObject(CommonCustomProperties.LabelMapAreaAttributes);
+ }
+ else
+ {
+ if(IsSerializing())
+ {
+ return "";
+ }
+ if(this.isEmptyPoint)
+ {
+ return (string)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.LabelMapAreaAttributes);
+ }
+
+ return series.labelMapAreaAttributes;
+
+ }
+ }
+ else
+ {
+ return series.labelMapAreaAttributes;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the postback value which can be processed on click event.
+ /// </summary>
+ /// <value>The value which is passed to click event as argument.</value>
+ [DefaultValue("")]
+ [SRCategory("CategoryAttributeLabel")]
+ [SRDescription(SR.Keys.DescriptionAttributePostBackValue)]
+ [Editor(Editors.KeywordsStringEditor.Editor, Editors.KeywordsStringEditor.Base)]
+ public string LabelPostBackValue
+ {
+ get
+ {
+ if (this.pointCustomProperties)
+ {
+ if (properties.Count != 0 && IsCustomPropertySet(CommonCustomProperties.LabelPostBackValue))
+ {
+ return (String)GetAttributeObject(CommonCustomProperties.LabelPostBackValue);
+ }
+ else
+ {
+ if (IsSerializing())
+ {
+ return "";
+ }
+ if (this.isEmptyPoint)
+ {
+ return (string)series.EmptyPointStyle.GetAttributeObject(CommonCustomProperties.LabelPostBackValue);
+ }
+
+ return series.labelPostbackValue;
+ }
+ }
+ else
+ {
+ return series.labelPostbackValue;
+ }
+ }
+ set
+ {
+ if (this.pointCustomProperties)
+ SetAttributeObject(CommonCustomProperties.LabelPostBackValue, value);
+ else
+ series.labelPostbackValue = value;
+ }
+ }
+
+
+#endif // !Microsoft_CONTROL
+
+
+
+ #endregion
+
+ #region Serialization control
+
+
+
+ private bool CheckIfSerializationRequired(CommonCustomProperties attribute)
+ {
+ if(this is DataPoint)
+ {
+ return IsCustomPropertySet(attribute);
+ }
+ else
+ {
+ object attr1 = this.GetAttributeObject(attribute);
+ object attr2 = Series.defaultCustomProperties.GetAttributeObject(attribute);
+ if(attr1 == null || attr2 == null)
+ {
+ return false;
+ }
+ return ! attr1.Equals(attr2);
+ }
+ }
+
+ private void ResetProperty(CommonCustomProperties attribute)
+ {
+ if(this is DataPoint)
+ {
+ DeleteCustomProperty(attribute);
+ }
+ else
+ {
+ this.SetAttributeObject(attribute, Series.defaultCustomProperties.GetAttributeObject(attribute));
+ }
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeLabel()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.Label);
+ else
+ return !String.IsNullOrEmpty(series.label);
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeAxisLabel()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.AxisLabel);
+ else
+ return !String.IsNullOrEmpty(series.axisLabel);
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeLabelFormat()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.LabelFormat);
+ else
+ return !String.IsNullOrEmpty(series.labelFormat);
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeIsValueShownAsLabel()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.IsValueShownAsLabel);
+ else
+ return series.showLabelAsValue != false;
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeColor()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.Color);
+ else
+ return series.color != Color.Empty;
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeBorderColor()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.BorderColor);
+ else
+ return series.borderColor != Color.Empty;
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeBorderDashStyle()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.BorderDashStyle);
+ else
+ return series.borderDashStyle != ChartDashStyle.Solid;
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeBorderWidth()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.BorderWidth);
+ else
+ return series.borderWidth != 1;
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeMarkerBorderWidth()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.MarkerBorderWidth);
+ else
+ return series.markerBorderWidth != 1;
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeBackImage()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.BackImage);
+ else
+ return !String.IsNullOrEmpty(series.backImage);
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeBackImageWrapMode()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.BackImageWrapMode);
+ else
+ return series.backImageWrapMode != ChartImageWrapMode.Tile;
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeBackImageTransparentColor()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.BackImageTransparentColor);
+ else
+ return series.backImageTransparentColor != Color.Empty;
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeBackImageAlignment()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.BackImageAlignment);
+ else
+ return series.backImageAlignment != ChartImageAlignmentStyle.TopLeft;
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeBackGradientStyle()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.BackGradientStyle);
+ else
+ return series.backGradientStyle != GradientStyle.None;
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeBackSecondaryColor()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.BackSecondaryColor);
+ else
+ return series.backSecondaryColor != Color.Empty;
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeBackHatchStyle()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.BackHatchStyle);
+ else
+ return series.backHatchStyle != ChartHatchStyle.None;
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeFont()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.Font);
+ else
+ {
+ return series.font != series.FontCache.DefaultFont;
+ }
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+ internal bool ShouldSerializeLabelForeColor()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.LabelForeColor);
+ else
+ return series.fontColor != Color.Black;
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeLabelAngle()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.LabelAngle);
+ else
+ return series.fontAngle != 0f;
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeMarkerStyle()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.MarkerStyle);
+ else
+ return series.markerStyle != MarkerStyle.None;
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeMarkerSize()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.MarkerSize);
+ else
+ return series.markerSize != 5;
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeMarkerImage()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.MarkerImage);
+ else
+ return !String.IsNullOrEmpty(series.markerImage);
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeMarkerImageTransparentColor()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.MarkerImageTransparentColor);
+ else
+ return series.markerImageTransparentColor != Color.Empty;
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeMarkerColor()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.MarkerColor);
+ else
+ return series.markerColor != Color.Empty;
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeMarkerBorderColor()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.MarkerBorderColor);
+ else
+ return series.markerBorderColor != Color.Empty;
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeToolTip()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.ToolTip);
+ else
+ return !String.IsNullOrEmpty(series.toolTip);
+ }
+
+#if !Microsoft_CONTROL
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeUrl()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.Url);
+ else
+ return !String.IsNullOrEmpty(series.url);
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeMapAreaAttributes()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.MapAreaAttributes);
+ else
+ return !String.IsNullOrEmpty(series.mapAreaAttributes);
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+ internal bool ShouldSerializePostBackValue()
+ {
+ if (this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.PostBackValue);
+ else
+ return !String.IsNullOrEmpty(series.postbackValue);
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeLegendUrl()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.LegendUrl);
+ else
+ return !String.IsNullOrEmpty(series.legendUrl);
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeLegendMapAreaAttributes()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.LegendMapAreaAttributes);
+ else
+ return !String.IsNullOrEmpty(series.legendMapAreaAttributes);
+ }
+
+
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeLabelUrl()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.LabelUrl);
+ else
+ return !String.IsNullOrEmpty(series.labelUrl);
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeLabelMapAreaAttributes()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.LabelMapAreaAttributes);
+ else
+ return !String.IsNullOrEmpty(series.labelMapAreaAttributes);
+ }
+
+
+
+#endif // !Microsoft_CONTROL
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeIsVisibleInLegend()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.IsVisibleInLegend);
+ else
+ return series.showInLegend != true;
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeLegendText()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.LegendText);
+ else
+ return !String.IsNullOrEmpty(series.legendText);
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeLegendToolTip()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.LegendToolTip);
+ else
+ return !String.IsNullOrEmpty(series.legendToolTip);
+ }
+
+
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeLabelToolTip()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.LabelToolTip);
+ else
+ return !String.IsNullOrEmpty(series.labelToolTip);
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeLabelBackColor()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.LabelBackColor);
+ else
+ return series.labelBackColor != Color.Empty;
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeLabelBorderColor()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.LabelBorderColor);
+ else
+ return series.labelBorderColor != Color.Empty;
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeLabelBorderDashStyle()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.LabelBorderDashStyle);
+ else
+ return series.labelBorderDashStyle != ChartDashStyle.Solid;
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized.
+ /// </summary>
+
+ internal bool ShouldSerializeLabelBorderWidth()
+ {
+ if(this.pointCustomProperties)
+ return CheckIfSerializationRequired(CommonCustomProperties.LabelBorderWidth);
+ else
+ return series.labelBorderWidth != 1;
+ }
+
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetLabel()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.Label);
+ else
+ series.label = "";
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetAxisLabel()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.AxisLabel);
+ else
+ series.axisLabel = "";
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetLabelFormat()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.LabelFormat);
+ else
+ series.labelFormat = "";
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ public void ResetIsValueShownAsLabel()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.IsValueShownAsLabel);
+ else
+ series.IsValueShownAsLabel = false;
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetColor()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.Color);
+ else
+ series.color = Color.Empty;
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetBorderColor()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.BorderColor);
+ else
+ series.borderColor = Color.Empty;
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetBorderDashStyle()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.BorderDashStyle);
+ else
+ series.borderDashStyle = ChartDashStyle.Solid;
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetBorderWidth()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.BorderWidth);
+ else
+ series.borderWidth = 1;
+ }
+
+
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetMarkerBorderWidth()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.MarkerBorderWidth);
+ else
+ series.markerBorderWidth = 1;
+ }
+
+
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetBackImage()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.BackImage);
+ else
+ series.backImage = "";
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetBackImageWrapMode()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.BackImageWrapMode);
+ else
+ series.backImageWrapMode = ChartImageWrapMode.Tile;
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetBackImageTransparentColor()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.BackImageTransparentColor);
+ else
+ series.backImageTransparentColor = Color.Empty;
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetBackSecondaryColor()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.BackSecondaryColor);
+ else
+ series.backSecondaryColor = Color.Empty;
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetBackHatchStyle()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.BackHatchStyle);
+ else
+ series.backHatchStyle = ChartHatchStyle.None;
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetFont()
+ {
+ if (this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.Font);
+ else
+ {
+ series.font = series.FontCache.DefaultFont;
+ }
+ }
+
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetLabelAngle()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.LabelAngle);
+ else
+ series.fontAngle = 0;
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetMarkerStyle()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.MarkerStyle);
+ else
+ series.markerStyle = MarkerStyle.None;
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetMarkerSize()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.MarkerSize);
+ else
+ series.markerSize = 5;
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetMarkerImage()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.MarkerImage);
+ else
+ series.markerImage = "";
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetMarkerImageTransparentColor()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.MarkerImageTransparentColor);
+ else
+ series.markerImageTransparentColor = Color.Empty;
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetMarkerColor()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.MarkerColor);
+ else
+ series.markerColor = Color.Empty;
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetMarkerBorderColor()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.MarkerBorderColor);
+ else
+ series.markerBorderColor = Color.Empty;
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetToolTip()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.ToolTip);
+ else
+ series.toolTip = "";
+
+#if Microsoft_CONTROL
+ if(Chart != null && Chart.selection != null)
+ {
+ Chart.selection.enabledChecked = false;
+ }
+#endif
+ }
+
+#if !Microsoft_CONTROL
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetUrl()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.Url);
+ else
+ series.url = "";
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetMapAreaAttributes()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.MapAreaAttributes);
+ else
+ series.mapAreaAttributes = "";
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+ internal void ResetPostBackValue()
+ {
+ if (this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.PostBackValue);
+ else
+ series.postbackValue = "";
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetLegendUrl()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.LegendUrl);
+ else
+ series.legendUrl = "";
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetLegendMapAreaAttributes()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.LegendMapAreaAttributes);
+ else
+ series.legendMapAreaAttributes = "";
+ }
+
+
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetLabelUrl()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.LabelUrl);
+ else
+ series.labelUrl = "";
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetLabelMapAreaAttributes()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.LabelMapAreaAttributes);
+ else
+ series.labelMapAreaAttributes = "";
+ }
+
+
+#endif // !Microsoft_CONTROL
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ public void ResetIsVisibleInLegend()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.IsVisibleInLegend);
+ else
+ series.showInLegend = true;
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetLegendText()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.LegendText);
+ else
+ series.legendText = "";
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetLegendToolTip()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.LegendToolTip);
+ else
+ series.legendToolTip = "";
+
+#if Microsoft_CONTROL
+ if(Chart != null && Chart.selection != null)
+ {
+ Chart.selection.enabledChecked = false;
+ }
+#endif
+ }
+
+
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetLabelBackColor()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.LabelBackColor);
+ else
+ series.labelBackColor = Color.Empty;
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetLabelBorderColor()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.LabelBorderColor);
+ else
+ series.labelBorderColor = Color.Empty;
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetLabelBorderDashStyle()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.LabelBorderDashStyle);
+ else
+ series.labelBorderDashStyle = ChartDashStyle.Solid;
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetLabelBorderWidth()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.LabelBorderWidth);
+ else
+ series.labelBorderWidth = 1;
+ }
+
+ /// <summary>
+ /// Resets property to its default value.
+ /// </summary>
+
+ internal void ResetLabelToolTip()
+ {
+ if(this.pointCustomProperties)
+ ResetProperty(CommonCustomProperties.LabelToolTip);
+ else
+ series.labelToolTip = "";
+
+#if Microsoft_CONTROL
+ if(Chart != null && Chart.selection != null)
+ {
+ Chart.selection.enabledChecked = false;
+ }
+#endif
+ }
+
+
+
+ #endregion
+
+ #region Invalidating method
+
+ /// <summary>
+ /// Invalidate chart area.
+ /// </summary>
+ /// <param name="invalidateLegend">Invalidate legend area only.</param>
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Justification = "This parameter is used when compiling for the Microsoft version of Chart")]
+ internal void Invalidate(bool invalidateLegend)
+ {
+#if Microsoft_CONTROL
+ if(this.series != null)
+ {
+ series.Invalidate(true, invalidateLegend);
+ }
+ else
+ {
+ Series thisSeries = this as Series;
+ if (thisSeries != null)
+ {
+ thisSeries.Invalidate(true, invalidateLegend);
+ }
+ }
+#endif
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Class stores additional information about the data point in 3D space.
+ /// </summary>
+ internal class DataPoint3D
+ {
+ #region Fields
+
+ /// <summary>
+ /// Reference to the 2D data point object
+ /// </summary>
+ internal DataPoint dataPoint = null;
+
+ /// <summary>
+ /// Data point index.
+ /// </summary>
+ internal int index = 0;
+
+ /// <summary>
+ /// Point X position in relative coordinates.
+ /// </summary>
+ internal double xPosition = 0.0;
+
+ /// <summary>
+ /// Point Y position in relative coordinates.
+ /// </summary>
+ internal double yPosition = 0.0;
+
+ /// <summary>
+ /// Point X center position in relative coordinates. Used for side-by-side charts.
+ /// </summary>
+ internal double xCenterVal = 0.0;
+
+ /// <summary>
+ /// Point Z position in relative coordinates.
+ /// </summary>
+ internal float zPosition = 0f;
+
+ /// <summary>
+ /// Point width.
+ /// </summary>
+ internal double width = 0.0;
+
+ /// <summary>
+ /// Point height.
+ /// </summary>
+ internal double height = 0.0;
+
+ /// <summary>
+ /// Point depth.
+ /// </summary>
+ internal float depth = 0f;
+
+ /// <summary>
+ /// Indicates that point belongs to indexed series.
+ /// </summary>
+ internal bool indexedSeries = false;
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Design-time representation of the CustomProperties.
+ /// This class is used instead of the string "CustomProperties"
+ /// property at design time and supports expandable list
+ /// of custom properties.
+ /// </summary>
+ [ TypeConverter(typeof(CustomPropertiesTypeConverter)) ]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class CustomProperties
+ {
+ #region Fields
+
+ // Reference to the properties class
+ internal DataPointCustomProperties m_DataPointCustomProperties = null;
+
+ #endregion // Fields
+
+ #region Constructor
+
+ /// <summary>
+ /// Constructor
+ /// </summary>
+ /// <param name="properties">Attributes object.</param>
+ internal CustomProperties(DataPointCustomProperties properties)
+ {
+ this.m_DataPointCustomProperties = properties;
+ }
+
+ #endregion // Constructor
+
+ #region Properties
+
+ internal virtual DataPointCustomProperties DataPointCustomProperties
+ {
+ get
+ {
+ return this.m_DataPointCustomProperties;
+ }
+ set
+ {
+ this.m_DataPointCustomProperties = value;
+ }
+
+ }
+
+ #endregion //Properties
+
+ #region Methods
+
+ /// <summary>
+ /// Gets a comma separated string of user defined custom properties.
+ /// </summary>
+ /// <returns>Comma separated string of user defined custom properties.</returns>
+ internal virtual string GetUserDefinedCustomProperties()
+ {
+ return GetUserDefinedCustomProperties(true);
+ }
+
+ /// <summary>
+ /// Gets a comma separated string of user defined or non-user defined custom properties.
+ /// </summary>
+ /// <param name="userDefined">True if user defined properties must be returned.</param>
+ /// <returns>Comma separated string of user defined custom properties.</returns>
+ internal virtual string GetUserDefinedCustomProperties(bool userDefined)
+ {
+ // Get comma separated string of custom properties
+ string customAttribute = this.DataPointCustomProperties.CustomProperties;
+ string userDefinedCustomAttribute = string.Empty;
+
+ // Get custom attribute registry
+ CustomPropertyRegistry registry = (CustomPropertyRegistry)this.DataPointCustomProperties.Common.container.GetService(typeof(CustomPropertyRegistry));
+
+ // Replace commas in value string
+ customAttribute = customAttribute.Replace("\\,", "\\x45");
+ customAttribute = customAttribute.Replace("\\=", "\\x46");
+
+ // Split custom properties by commas into individual properties
+ if(customAttribute.Length > 0)
+ {
+ string[] nameValueStrings = customAttribute.Split(',');
+ foreach(string nameValue in nameValueStrings)
+ {
+ string[] values = nameValue.Split('=');
+
+ // Check format
+ if(values.Length != 2)
+ {
+ throw(new FormatException(SR.ExceptionAttributeInvalidFormat));
+ }
+
+ // Check for empty name or value
+ values[0] = values[0].Trim();
+ values[1] = values[1].Trim();
+ if(values[0].Length == 0)
+ {
+ throw(new FormatException(SR.ExceptionAttributeInvalidFormat));
+ }
+
+ // Check if attribute is registered or user defined
+ bool userDefinedAttribute = true;
+ foreach(CustomPropertyInfo info in registry.registeredCustomProperties)
+ {
+ if(string.Compare(info.Name, values[0], StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ userDefinedAttribute = false;
+ }
+ }
+
+ // Copy attribute into the output string
+ if(userDefinedAttribute == userDefined)
+ {
+ if(userDefinedCustomAttribute.Length > 0)
+ {
+ userDefinedCustomAttribute += ", ";
+ }
+
+ string val = values[1].Replace("\\x45", ",");
+ val = val.Replace("\\x46", "=");
+ userDefinedCustomAttribute += values[0] + "=" + val;
+ }
+ }
+ }
+
+ return userDefinedCustomAttribute;
+ }
+
+ /// <summary>
+ /// Sets user defined custom properties without cleaning registered properties.
+ /// </summary>
+ /// <param name="val">New user defined properties.</param>
+ internal virtual void SetUserDefinedAttributes(string val)
+ {
+ // Get non-user defined custom properties
+ string properties = GetUserDefinedCustomProperties(false);
+
+ // Check if new string is empty
+ if(val.Length > 0)
+ {
+ // Add comma at the end
+ if(properties.Length > 0)
+ {
+ properties += ", ";
+ }
+
+ // Add new user defined properties
+ properties += val;
+ }
+
+ // Set new custom attribute string
+ this.DataPointCustomProperties.CustomProperties = properties;
+ }
+
+
+ #endregion // Methods
+ }
+}
+
+
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/DataManager/DataSeries.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/DataManager/DataSeries.cs
new file mode 100644
index 00000000000..9f16542df99
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/DataManager/DataSeries.cs
@@ -0,0 +1,2694 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: DataSries.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting.Data
+//
+// Classes: SeriesCollection, Series
+//
+// Purpose: Chart series collection class and series properties class.
+//
+// Reviewed: AG - Aug 1, 2002;
+// GS - Aug 7, 2002
+//
+//===================================================================
+
+
+#region Used namespaces
+
+using System;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Collections.Generic;
+using System.Collections;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Globalization;
+using System.Diagnostics.CodeAnalysis;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.ComponentModel.Design.Serialization;
+ using System.Reflection;
+#else
+ using System.Web;
+ using System.Web.UI;
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+ using System.Web.UI.DataVisualization.Charting.Data;
+#endif
+
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+ namespace System.Web.UI.DataVisualization.Charting
+#endif
+{
+ #region Series enumerations
+
+ /// <summary>
+ /// Chart axis type (Primary or Secondary).
+ /// </summary>
+ public enum AxisType
+ {
+ /// <summary>
+ /// Primary axis. For X axis - bottom, for Y axis - left.
+ /// </summary>
+ Primary,
+
+ /// <summary>
+ /// Secondary axis. For X axis - top, for Y axis - right.
+ /// </summary>
+ Secondary
+ };
+
+ /// <summary>
+ /// Sorting order (Ascending or Descending).
+ /// </summary>
+ public enum PointSortOrder
+ {
+ /// <summary>
+ /// Ascending sorting order
+ /// </summary>
+ Ascending,
+
+ /// <summary>
+ /// Descending sorting order
+ /// </summary>
+ Descending
+ }
+
+ #endregion
+
+ /// <summary>
+ /// Data series collection
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeSeriesCollection_SeriesCollection"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class SeriesCollection : ChartNamedElementCollection<Series>
+ {
+
+ #region Constructors
+
+ /// <summary>
+ /// Data series collection object constructor.
+ /// </summary>
+ internal SeriesCollection(DataManager dataManager)
+ : base(dataManager)
+ {
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Creates a new Series with the specified name and adds it to the collection.
+ /// </summary>
+ /// <param name="name">The new chart area name.</param>
+ /// <returns>New series</returns>
+ public Series Add(string name)
+ {
+ Series series = new Series(name);
+ this.Add(series);
+ return series;
+ }
+
+ /// <summary>
+ /// Fixes the name references of the item.
+ /// </summary>
+ /// <param name="item">Item to verify and fix.</param>
+ internal override void FixNameReferences(Series item)
+ {
+ if (item != null && Chart != null)
+ {
+ if (String.IsNullOrEmpty(item.ChartArea) && Chart.ChartAreas != null)
+ {
+ item.ChartArea = Chart.ChartAreas.DefaultNameReference;
+ }
+ if (String.IsNullOrEmpty(item.Legend) && Chart.Legends != null)
+ {
+ item.Legend = Chart.Legends.DefaultNameReference;
+ }
+ }
+ }
+ #endregion
+
+ #region Event handlers
+ /// <summary>
+ /// Updates the Series' references to ChartAreas.
+ /// </summary>
+ /// <param name="sender">The sender.</param>
+ /// <param name="e">The <see cref="Charting.NameReferenceChangedEventArgs"/> instance containing the event data.</param>
+ internal void ChartAreaNameReferenceChanged(object sender, NameReferenceChangedEventArgs e)
+ {
+ foreach (Series series in this)
+ if (series.ChartArea == e.OldName)
+ series.ChartArea = e.NewName;
+ }
+
+ /// <summary>
+ /// Updates the Series' references to Legends.
+ /// </summary>
+ /// <param name="sender">The sender.</param>
+ /// <param name="e">The <see cref="Charting.NameReferenceChangedEventArgs"/> instance containing the event data.</param>
+ internal void LegendNameReferenceChanged(object sender, NameReferenceChangedEventArgs e)
+ {
+ foreach (Series series in this)
+ if (series.Legend == e.OldName)
+ series.Legend = e.NewName;
+ }
+ #endregion
+
+ }
+
+ /// <summary>
+ /// The class stores the data points and the default series properties.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeSeries_Series"),
+ DefaultProperty("Points"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class Series : DataPointCustomProperties
+ {
+ #region Fields
+
+ // Private data members, which store properties values
+ private ChartValueType _xValueType = ChartValueType.Auto;
+ private ChartValueType _yValueType = ChartValueType.Auto;
+ private bool _isXValueIndexed = false;
+ private int _yValuesPerPoint = 1;
+ private int _markersStep = 1;
+ private ChartColorPalette _colorPalette = ChartColorPalette.None;
+ private AxisType _xAxisType = AxisType.Primary;
+ private AxisType _yAxisType = AxisType.Primary;
+#if SUBAXES
+ private string _ySubAxisName = string.Empty;
+ private string _xSubAxisName = string.Empty;
+#endif // SUBAXES
+ private DataPointCustomProperties _emptyPointCustomProperties = null;
+ private DataPointCollection _points;
+ private int _shadowOffset = 0;
+ private Color _shadowColor = Color.FromArgb(128, 0, 0, 0);
+ private string _chartType = ChartTypeNames.Column;
+ private string _chartArea = String.Empty;
+
+ // Series enabled flag
+ private bool _enabled = true;
+
+ // Legend name used by this series
+ private string _legend = String.Empty;
+
+ // Member of the chart data source used to data bind to the X value of the series.
+ private string _dataSourceXMember = String.Empty;
+
+ // Members of the chart data source used to data bind to the Y values of the series.
+ private string _dataSourceYMembers = String.Empty;
+
+ // Automatic values type flags
+ internal bool autoXValueType = false;
+ internal bool autoYValueType = false;
+
+ // Total Y value of all data points
+ private double _totalYvalue = double.NaN;
+
+ // Array of dummy data used at design time
+ private double[] _dummyDoubleValues = null;
+
+ // X value type if X value is indexed
+ internal ChartValueType indexedXValueType = ChartValueType.Auto;
+
+ // Default properties
+ static internal DataPointCustomProperties defaultCustomProperties = InitializeDefaultCustomProperties();
+
+ // Indicates that a temp. marker style was set for drawing
+ internal bool tempMarkerStyleIsSet = false;
+
+ // Indicates that number of Y values should be checked
+ private bool _checkPointsNumber = true;
+
+ // SmartLabelStyle style
+ private SmartLabelStyle _smartLabelStyle = null;
+
+ // Indicates that there is no custom axis labels in data points or series
+ internal bool noLabelsInPoints = true;
+
+ // Indicates if series has all X values set to 0
+ internal bool xValuesZeros = false;
+
+ // Indicates if check for series X zero values was done
+ internal bool xValuesZerosChecked = false;
+
+
+ // fake data points for selector service in design time.
+ // note: in design time fake points are generated
+ // with short life time - during painting.
+ // this collection keep a copy of design time datapoints.
+ internal DataPointCollection fakeDataPoints;
+
+
+ #endregion
+
+ #region Series properties fields
+
+ /// <summary>
+ /// Data point label text.
+ /// </summary>
+ internal string label = "";
+
+ /// <summary>
+ /// Data point X axis label text.
+ /// </summary>
+ internal string axisLabel = "";
+
+ /// <summary>
+ /// Data point label format string
+ /// </summary>
+ internal string labelFormat = "";
+
+ /// <summary>
+ /// If true shows point's value as a label.
+ /// </summary>
+ internal bool showLabelAsValue = false;
+
+ /// <summary>
+ /// Data point color
+ /// </summary>
+ internal Color color = Color.Empty;
+
+ /// <summary>
+ /// Data point border color
+ /// </summary>
+ internal Color borderColor = Color.Empty;
+
+ /// <summary>
+ /// Data point border style
+ /// </summary>
+ internal ChartDashStyle borderDashStyle = ChartDashStyle.Solid;
+
+ /// <summary>
+ /// Data point border width
+ /// </summary>
+ internal int borderWidth = 1;
+
+ /// <summary>
+ /// Data point marker border width
+ /// </summary>
+ internal int markerBorderWidth = 1;
+
+ /// <summary>
+ /// Data point background image
+ /// </summary>
+ internal string backImage = "";
+
+ /// <summary>
+ /// Data point background image drawing mode.
+ /// </summary>
+ internal ChartImageWrapMode backImageWrapMode = ChartImageWrapMode.Tile;
+
+ /// <summary>
+ /// Background image transparent color.
+ /// </summary>
+ internal Color backImageTransparentColor = Color.Empty;
+
+ /// <summary>
+ /// Background image alignment used by ClampUnscale drawing mode.
+ /// </summary>
+ internal ChartImageAlignmentStyle backImageAlignment = ChartImageAlignmentStyle.TopLeft;
+
+ /// <summary>
+ /// Data point background gradient type.
+ /// </summary>
+ internal GradientStyle backGradientStyle = GradientStyle.None;
+
+ /// <summary>
+ /// Data point background gradient end color
+ /// </summary>
+ internal Color backSecondaryColor = Color.Empty;
+
+ /// <summary>
+ /// Data point hatch style
+ /// </summary>
+ internal ChartHatchStyle backHatchStyle = ChartHatchStyle.None;
+
+ /// <summary>
+ /// Font cache for the fonts used in the Series and DataPoint
+ /// </summary>
+ private FontCache _fontCache = new FontCache();
+
+ /// <summary>
+ /// Data point font
+ /// </summary>
+ internal Font font = null;
+
+ /// <summary>
+ /// Data point line color
+ /// </summary>
+ internal Color fontColor = Color.Black;
+
+ /// <summary>
+ /// Data point font angle
+ /// </summary>
+ internal int fontAngle = 0;
+
+ /// <summary>
+ /// Data point marker style
+ /// </summary>
+ internal MarkerStyle markerStyle = MarkerStyle.None;
+
+ /// <summary>
+ /// Data point marker size
+ /// </summary>
+ internal int markerSize = 5;
+
+ /// <summary>
+ /// Data point marker image
+ /// </summary>
+ internal string markerImage = "";
+
+ /// <summary>
+ /// Data point marker image transparent color.
+ /// </summary>
+ internal Color markerImageTransparentColor = Color.Empty;
+
+ /// <summary>
+ /// Data point marker color
+ /// </summary>
+ internal Color markerColor = Color.Empty;
+
+ /// <summary>
+ /// Data point marker border color
+ /// </summary>
+ internal Color markerBorderColor = Color.Empty;
+
+ /// <summary>
+ /// The tooltip.
+ /// </summary>
+ internal string toolTip = "";
+
+#if !Microsoft_CONTROL
+
+ /// <summary>
+ /// URL target of the area.
+ /// </summary>
+ internal string url = "";
+ /// <summary>
+ /// Other attributes of the area.
+ /// </summary>
+ internal string mapAreaAttributes = "";
+
+ /// <summary>
+ /// Other attributes of the area.
+ /// </summary>
+ internal string postbackValue = "";
+
+#endif
+
+ /// <summary>
+ /// Indicates that item is shown in the legend.
+ /// </summary>
+ internal bool showInLegend = true;
+
+ /// <summary>
+ /// Text of the item in the legend
+ /// </summary>
+ internal string legendText = "";
+
+ /// <summary>
+ /// Tooltip of the item in the legend
+ /// </summary>
+ internal string legendToolTip = "";
+
+ /// <summary>
+ /// Data point label back color
+ /// </summary>
+ internal Color labelBackColor = Color.Empty;
+
+ /// <summary>
+ /// Data point label border color
+ /// </summary>
+ internal Color labelBorderColor = Color.Empty;
+
+ /// <summary>
+ /// Data point label border style
+ /// </summary>
+ internal ChartDashStyle labelBorderDashStyle = ChartDashStyle.Solid;
+
+ /// <summary>
+ /// Data point label border width
+ /// </summary>
+ internal int labelBorderWidth = 1;
+
+ /// <summary>
+ /// Tooltip of the data point label
+ /// </summary>
+ internal string labelToolTip = "";
+
+#if !Microsoft_CONTROL
+
+ /// <summary>
+ /// URL target of the data point label.
+ /// </summary>
+ internal string labelUrl = "";
+
+ /// <summary>
+ /// Other attributes of the data point label.
+ /// </summary>
+ internal string labelMapAreaAttributes = "";
+
+ /// <summary>
+ /// Other attributes of the area.
+ /// </summary>
+ internal string labelPostbackValue = "";
+
+ /// <summary>
+ /// URL target of the item in the legend.
+ /// </summary>
+ internal string legendUrl = "";
+
+ /// <summary>
+ /// Other attributes of the legend map area.
+ /// </summary>
+ internal string legendMapAreaAttributes = "";
+
+ /// <summary>
+ /// Other attributes of the area.
+ /// </summary>
+ internal string legendPostbackValue = "";
+
+
+#endif
+
+ #endregion
+
+ #region Constructors and initialization
+
+ /// <summary>
+ /// Initializes the default custom properties field.
+ /// </summary>
+ /// <returns>A DataPointCustomProperties initialized to defaults</returns>
+ private static DataPointCustomProperties InitializeDefaultCustomProperties()
+ {
+ DataPointCustomProperties customProperties = new DataPointCustomProperties(null, false);
+ customProperties.SetDefault(true);
+ customProperties.pointCustomProperties = true;
+
+ return customProperties;
+ }
+
+ /// <summary>
+ /// Series object constructor.
+ /// </summary>
+ public Series() : base(null, false)
+ {
+ InitProperties(null, 0);
+ }
+
+ /// <summary>
+ /// Series object constructor.
+ /// </summary>
+ /// <param name="name">Name of the data series</param>
+ public Series(string name) : base(null, false)
+ {
+ if(name == null)
+ {
+ throw (new ArgumentNullException(SR.ExceptionDataSeriesNameIsEmpty));
+ }
+
+ InitProperties(name, 0);
+ }
+
+ /// <summary>
+ /// Series object constructor.
+ /// </summary>
+ /// <param name="name">Name of the data series.</param>
+ /// <param name="yValues">Number of y values per data point.</param>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "Y is a cartesian coordinate and well understood")]
+ public Series(string name, int yValues)
+ : base(null, false)
+ {
+ if(name == null)
+ {
+ throw (new ArgumentNullException("name", SR.ExceptionDataSeriesNameIsEmpty));
+ }
+ if(YValuesPerPoint < 1)
+ {
+ throw (new ArgumentOutOfRangeException("yValues", SR.ExceptionDataSeriesYValuesPerPointIsZero));
+ }
+
+ InitProperties(name, yValues);
+ }
+
+ /// <summary>
+ /// Initialize series properties
+ /// </summary>
+ private void InitProperties(string name, int YValuesPerPoint)
+ {
+ this.font = _fontCache.DefaultFont;
+ this.series = this;
+ this._emptyPointCustomProperties = new DataPointCustomProperties(this, false);
+ this._emptyPointCustomProperties.series = this;
+
+ // Initialize properties
+ _points = new DataPointCollection(this);
+
+ fakeDataPoints = new DataPointCollection(this);
+
+ if(name != null)
+ {
+ base.Name = name;
+ }
+ if(YValuesPerPoint != 0)
+ {
+ _yValuesPerPoint = YValuesPerPoint;
+ }
+ base.SetDefault(true);
+ _emptyPointCustomProperties.SetDefault(true);
+ _emptyPointCustomProperties.pointCustomProperties = true;
+//
+#if !SQLRS_CONTROL
+ // Use transparent colors for empty points
+ emptyPointAttributes.Color = Color.Transparent;
+ emptyPointAttributes.BorderColor = Color.Transparent;
+ emptyPointAttributes.FontColor = Color.Transparent;
+ emptyPointAttributes.MarkerColor = Color.Transparent;
+ emptyPointAttributes.MarkerBorderColor = Color.Transparent;
+#endif //!SQLRS_CONTROL
+
+ // Create SmartLabelStyle style object
+ _smartLabelStyle = new SmartLabelStyle(this);
+
+ }
+
+
+ #endregion
+
+ #region Helper methods
+
+ /// <summary>
+ /// Gets series caption that may not be the same as series name.
+ /// </summary>
+ /// <returns>Series caption string.</returns>
+ internal string GetCaption()
+ {
+ if (this.IsCustomPropertySet("SeriesCaption"))
+ {
+ return this["SeriesCaption"];
+ }
+ return this.Name;
+ }
+
+ /// <summary>
+ /// Gets custom points depth and gap depth from series properties.
+ /// </summary>
+ /// <param name="graph">Chart graphics.</param>
+ /// <param name="axis">Cate----cal axis.</param>
+ /// <param name="pointDepth">Returns point depth.</param>
+ /// <param name="pointGapDepth">Return point gap depth.</param>
+ internal void GetPointDepthAndGap(
+ ChartGraphics graph,
+ Axis axis,
+ ref double pointDepth,
+ ref double pointGapDepth)
+ {
+
+
+ // Check if series provide custom value for point depth in pixels
+ string attribValue = this[CustomPropertyName.PixelPointDepth];
+ if(attribValue != null)
+ {
+ try
+ {
+ pointDepth = CommonElements.ParseDouble(attribValue);
+ }
+ catch
+ {
+ throw (new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid2("PixelPointDepth")));
+ }
+
+ if (pointDepth <= 0)
+ {
+ throw (new InvalidOperationException(SR.ExceptionCustomAttributeIsNotLargerThenZiro("PixelPointDepth")));
+ }
+ if (pointDepth > CustomPropertyRegistry.MaxValueOfPixelAttribute)
+ {
+ throw (new InvalidOperationException(SR.ExceptionCustomAttributeMustBeInRange("PixelPointDepth", (0).ToString(CultureInfo.CurrentCulture), CustomPropertyRegistry.MaxValueOfPixelAttribute.ToString(CultureInfo.CurrentCulture))));
+ }
+
+ SizeF relativeSize = graph.GetRelativeSize(new SizeF((float)pointDepth, (float)pointDepth));
+ pointDepth = relativeSize.Width;
+ if(axis.AxisPosition == AxisPosition.Left || axis.AxisPosition == AxisPosition.Right)
+ {
+ pointDepth = relativeSize.Height;
+ }
+ }
+
+ // Check if series provide custom value for point gap depth in pixels
+ attribValue = this[CustomPropertyName.PixelPointGapDepth];
+ if(attribValue != null)
+ {
+ try
+ {
+ pointGapDepth = CommonElements.ParseDouble(attribValue);
+ }
+ catch
+ {
+ throw (new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid2("PixelPointGapDepth")));
+ }
+
+ if (pointGapDepth <= 0)
+ {
+ throw (new InvalidOperationException(SR.ExceptionCustomAttributeIsNotLargerThenZiro("PixelPointGapDepth")));
+ }
+ if (pointGapDepth > CustomPropertyRegistry.MaxValueOfPixelAttribute)
+ {
+ throw (new InvalidOperationException(SR.ExceptionCustomAttributeMustBeInRange("PixelPointGapDepth", (0).ToString(CultureInfo.CurrentCulture), CustomPropertyRegistry.MaxValueOfPixelAttribute.ToString(CultureInfo.CurrentCulture))));
+ }
+
+ SizeF relativeSize = graph.GetRelativeSize(new SizeF((float)pointGapDepth, (float)pointGapDepth));
+ pointGapDepth = relativeSize.Width;
+ if(axis.AxisPosition == AxisPosition.Left || axis.AxisPosition == AxisPosition.Right)
+ {
+ pointGapDepth = relativeSize.Height;
+ }
+ }
+
+
+ }
+
+
+ /// <summary>
+ /// Gets data point width in relative coordinates.
+ /// </summary>
+ /// <param name="graph">Chart graphics.</param>
+ /// <param name="axis">Axis object.</param>
+ /// <param name="interval">Current minimum axis interval.</param>
+ /// <param name="defaultWidth">Default width in percentage of interval.</param>
+ /// <returns>Point width.</returns>
+ internal double GetPointWidth(
+ ChartGraphics graph,
+ Axis axis,
+ double interval,
+ double defaultWidth)
+ {
+ double pointPercentageWidth = defaultWidth;
+ double pointWidth = 0.0;
+
+ // Check if series provide custom value for point width in percentage of interval
+ string strWidth = this[CustomPropertyName.PointWidth];
+ if(strWidth != null)
+ {
+ pointPercentageWidth = CommonElements.ParseDouble(strWidth);
+ }
+
+ // Get column width in relative and pixel coordinates
+ pointWidth = axis.GetPixelInterval( interval * pointPercentageWidth );
+ SizeF pointSize = graph.GetAbsoluteSize(new SizeF((float)pointWidth, (float)pointWidth));
+ double pixelPointWidth = pointSize.Width;
+ if(axis.AxisPosition == AxisPosition.Left || axis.AxisPosition == AxisPosition.Right)
+ {
+ pixelPointWidth = pointSize.Height;
+ }
+
+
+ // Check if series provide custom value for Min point width in pixels
+ bool usePixelWidth = false;
+ string attribValue = this[CustomPropertyName.MinPixelPointWidth];
+ if(attribValue != null)
+ {
+ double minPixelPointWidth = 0.0;
+ try
+ {
+ minPixelPointWidth = CommonElements.ParseDouble(attribValue);
+ }
+ catch
+ {
+ throw(new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid2("MinPixelPointWidth")));
+ }
+ if(minPixelPointWidth <= 0.0)
+ {
+ throw(new InvalidOperationException(SR.ExceptionCustomAttributeIsNotLargerThenZiro("MinPixelPointWidth")));
+ }
+ if (minPixelPointWidth > CustomPropertyRegistry.MaxValueOfPixelAttribute)
+ {
+ throw (new InvalidOperationException(SR.ExceptionCustomAttributeMustBeInRange("MinPixelPointWidth", (0).ToString(CultureInfo.CurrentCulture), CustomPropertyRegistry.MaxValueOfPixelAttribute.ToString(CultureInfo.CurrentCulture))));
+ }
+
+ if(pixelPointWidth < minPixelPointWidth)
+ {
+ usePixelWidth = true;
+ pixelPointWidth = minPixelPointWidth;
+ }
+ }
+
+ // Check if series provide custom value for Max point width in pixels
+ attribValue = this[CustomPropertyName.MaxPixelPointWidth];
+ if(attribValue != null)
+ {
+ double maxPixelPointWidth = 0.0;
+ try
+ {
+ maxPixelPointWidth = CommonElements.ParseDouble(attribValue);
+ }
+ catch
+ {
+ throw(new InvalidOperationException( SR.ExceptionCustomAttributeValueInvalid2("MaxPixelPointWidth")));
+ }
+ if(maxPixelPointWidth <= 0)
+ {
+ throw(new InvalidOperationException(SR.ExceptionCustomAttributeIsNotLargerThenZiro("MaxPixelPointWidth")));
+ }
+
+ if(pixelPointWidth > maxPixelPointWidth)
+ {
+ usePixelWidth = true;
+ pixelPointWidth = maxPixelPointWidth;
+ }
+ }
+
+ // Check if series provide custom value for point width in pixels
+ attribValue = this[CustomPropertyName.PixelPointWidth];
+ if(attribValue != null)
+ {
+ usePixelWidth = true;
+ pixelPointWidth = 0.0;
+ try
+ {
+ pixelPointWidth = CommonElements.ParseDouble(attribValue);
+ }
+ catch
+ {
+ throw(new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid2("PixelPointWidth")));
+ }
+ if(pixelPointWidth <= 0)
+ {
+ throw(new InvalidOperationException(SR.ExceptionCustomAttributeIsNotLargerThenZiro("PixelPointWidth")));
+ }
+ if (pixelPointWidth > CustomPropertyRegistry.MaxValueOfPixelAttribute)
+ {
+ throw (new InvalidOperationException(SR.ExceptionCustomAttributeMustBeInRange("PixelPointWidth", (0).ToString(CultureInfo.CurrentCulture), CustomPropertyRegistry.MaxValueOfPixelAttribute.ToString(CultureInfo.CurrentCulture))));
+ }
+ }
+
+ // Translate pixel width to relative coordinates
+ if(usePixelWidth)
+ {
+ SizeF pointRelativeSize = graph.GetRelativeSize(new SizeF((float)pixelPointWidth, (float)pixelPointWidth));
+ pointWidth = pointRelativeSize.Width;
+ if(axis.AxisPosition == AxisPosition.Left || axis.AxisPosition == AxisPosition.Right)
+ {
+ pointWidth = pointRelativeSize.Height;
+ }
+ }
+
+
+
+ return pointWidth;
+ }
+
+ /// <summary>
+ /// Get chart type name by it's type
+ /// </summary>
+ /// <param name="type">Chart type.</param>
+ /// <returns>Chart type name.</returns>
+ static internal string GetChartTypeName(SeriesChartType type)
+ {
+ if(type == SeriesChartType.StackedArea100)
+ return ChartTypeNames.OneHundredPercentStackedArea;
+ if(type == SeriesChartType.StackedBar100)
+ return ChartTypeNames.OneHundredPercentStackedBar;
+ if(type == SeriesChartType.StackedColumn100)
+ return ChartTypeNames.OneHundredPercentStackedColumn;
+ return Enum.GetName(typeof(SeriesChartType), type);
+ }
+
+ /// <summary>
+ /// Checks if Y values of the series represent date-time.
+ /// </summary>
+ /// <returns>True if date-time.</returns>
+ internal bool IsYValueDateTime()
+ {
+ if(this.YValueType == ChartValueType.Date ||
+ this.YValueType == ChartValueType.DateTime ||
+ this.YValueType == ChartValueType.Time ||
+ this.YValueType == ChartValueType.DateTimeOffset)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// Checks if X values of the series represent date-time.
+ /// </summary>
+ /// <returns>True if date-time.</returns>
+ internal bool IsXValueDateTime()
+ {
+ if(this.XValueType == ChartValueType.Date ||
+ this.XValueType == ChartValueType.DateTime ||
+ this.XValueType == ChartValueType.Time ||
+ this.XValueType == ChartValueType.DateTimeOffset)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// Checks if series is visible.
+ /// </summary>
+ /// <returns>True if series is visible.</returns>
+ internal bool IsVisible()
+ {
+ // Check if enabled flag is set and the ChartArea is defined
+ if(this.Enabled && !String.IsNullOrEmpty(this.ChartArea))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// Checks if series chart type uses a "Fast" mode chart type.
+ /// </summary>
+ /// <returns>True if series uses "Fast" mode chart type.</returns>
+ internal bool IsFastChartType()
+ {
+
+ // Check if fast mode chart type is used in the series
+ if(this.ChartType == SeriesChartType.FastLine)
+ {
+ return true;
+ }
+
+ // Check if fast mode chart type is used in the series
+ if(this.ChartType == SeriesChartType.FastPoint)
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ /// <summary>
+ /// Throws exception if specified value type is not supported.
+ /// </summary>
+ /// <param name="type">Value type to check.</param>
+ internal void CheckSupportedTypes(Type type)
+ {
+ // Check parameters type
+ if(type == typeof(Double) ||
+ type == typeof(DateTime) ||
+ type == typeof(String) ||
+ type == typeof(Int32) ||
+ type == typeof(UInt32) ||
+ type == typeof(Decimal) ||
+ type == typeof(Single) ||
+ type == typeof(Int16) ||
+ type == typeof(UInt16) ||
+ type == typeof(Int64) ||
+ type == typeof(UInt64) ||
+ type == typeof(Byte) ||
+ type == typeof(SByte) ||
+ type == typeof(System.DBNull) ||
+ type == typeof(Boolean) )
+ {
+ return;
+ }
+
+ // Unsupported parameter type
+ throw(new ArgumentException(SR.ExceptionDataSeriesPointTypeUnsupported( type.ToString() ) ));
+
+ }
+
+ /// <summary>
+ /// Apply palette colors to the data series points if UsePaletteColors property is set.
+ /// </summary>
+ internal void ApplyPaletteColors()
+ {
+ // Use Series or Data Manager palette
+ DataManager dataManager = this.Common.DataManager;
+
+ ChartColorPalette currentPalette = (this.Palette == ChartColorPalette.None) ?
+ dataManager.Palette : this.Palette;
+
+ // if it is still none - check if custom colors pallete is empty.
+ if (
+ currentPalette == ChartColorPalette.None &&
+ dataManager.PaletteCustomColors.Length == 0
+ )
+ {
+ currentPalette = ChartColorPalette.BrightPastel;
+ }
+
+ // Get palette colors
+ int colorIndex = 0;
+ Color[] paletteColors = (currentPalette == ChartColorPalette.None) ?
+ dataManager.PaletteCustomColors : ChartPaletteColors.GetPaletteColors(currentPalette);
+ foreach(DataPoint dataPoint in _points)
+ {
+ // Change color of the series data points only if no color is set
+ if((!dataPoint.IsCustomPropertySet(CommonCustomProperties.Color) || dataPoint.tempColorIsSet ) && !dataPoint.IsEmpty)
+ {
+ dataPoint.SetAttributeObject(CommonCustomProperties.Color, paletteColors[colorIndex]);
+ dataPoint.tempColorIsSet = true;
+ ++colorIndex;
+ if(colorIndex >= paletteColors.Length)
+ {
+ colorIndex = 0;
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets design time dummy data.
+ /// </summary>
+ /// <param name="type">AxisName of the data to get.</param>
+ /// <returns>Dummy data for chart in design-time.</returns>
+ internal IEnumerable GetDummyData(ChartValueType type)
+ {
+ string[] stringValues = { "abc1", "abc2", "abc3", "abc4", "abc5", "abc6" };
+ DateTime[] dateValues = { DateTime.Now.Date, DateTime.Now.Date.AddDays(1), DateTime.Now.Date.AddDays(2), DateTime.Now.Date.AddDays(3), DateTime.Now.Date.AddDays(4), DateTime.Now.Date.AddDays(4) };
+
+ // Fill array of random data
+ if(_dummyDoubleValues == null)
+ {
+#if !SQLRS_CONTROL
+ Random random2 = new Random(unchecked((int)DateTime.Now.Ticks +
+ this.Color.B + this.Color.G + this.Color.R));
+#else
+ int seed = 0;
+ for (int index = 0; index < this.Name.Length; index++)
+ seed += (int)this.Name[index];
+
+ Random random2 = new Random(seed);
+
+#endif
+ _dummyDoubleValues = new double[6];
+ for(int valueIndex = 0; valueIndex < 6; valueIndex++)
+ {
+ _dummyDoubleValues[valueIndex] = random2.Next(10, 100);
+ }
+ }
+
+ // Return dummy data
+ if(type == ChartValueType.DateTime || type == ChartValueType.Date || type == ChartValueType.DateTimeOffset)
+ {
+ return dateValues;
+ }
+ else if(type == ChartValueType.Time)
+ {
+ dateValues = new DateTime[] { DateTime.Now, DateTime.Now.AddMinutes(1), DateTime.Now.AddMinutes(2), DateTime.Now.AddMinutes(3), DateTime.Now.AddMinutes(4), DateTime.Now.AddMinutes(4) };
+ return dateValues;
+ }
+ else if(type == ChartValueType.String)
+ {
+ return stringValues;
+ }
+ return _dummyDoubleValues;
+ }
+
+ /// <summary>
+ /// Returns total of the Y values.
+ /// </summary>
+ /// <returns>Y values total.</returns>
+ internal double GetTotalYValue()
+ {
+ return this.GetTotalYValue(0);
+ }
+
+ /// <summary>
+ /// Returns total of the Y values.
+ /// </summary>
+ /// <param name="yValueIndex">Index of the Y value to use</param>
+ /// <returns>Y values total.</returns>
+ internal double GetTotalYValue(int yValueIndex)
+ {
+ if(yValueIndex == 0)
+ {
+ // Total was already calculated
+ if(!double.IsNaN(_totalYvalue))
+ {
+ return _totalYvalue;
+ }
+
+ // Calculate total
+ _totalYvalue = 0;
+ foreach(DataPoint point in this.Points)
+ {
+ _totalYvalue += point.YValues[yValueIndex];
+ }
+
+ return _totalYvalue;
+ }
+
+ // Check if series has enough Y values
+ if(yValueIndex >= this.YValuesPerPoint)
+ {
+ throw(new InvalidOperationException( SR.ExceptionDataSeriesYValueIndexNotExists(yValueIndex.ToString(CultureInfo.InvariantCulture), this.Name ) ) );
+ }
+
+ // Calculate total
+ double yValue = 0;
+ foreach(DataPoint point in this.Points)
+ {
+ yValue += point.YValues[yValueIndex];
+ }
+
+ return yValue;
+ }
+
+ /// <summary>
+ /// Replaces predefined keyword inside the string with their values.
+ /// </summary>
+ /// <param name="strOriginal">Original string with keywords.</param>
+ /// <returns>Modified string.</returns>
+ internal override string ReplaceKeywords(string strOriginal)
+ {
+ // Nothing to process
+ if(strOriginal == null || strOriginal.Length == 0)
+ return strOriginal;
+
+ // Replace all "\n" strings with '\n' character
+ string result = strOriginal.Replace("\\n", "\n");
+
+ // #SERIESNAME - series name
+ result = result.Replace(KeywordName.SeriesName, this.Name);
+ result = result.Replace(KeywordName.Ser, this.Name); // #SER Depricated Keyword
+
+ // #CUSTOMPROPERTY - one of the custom attributes by name
+ result = DataPoint.ReplaceCustomPropertyKeyword(result, this);
+
+ // #TOTAL - total of Y values
+ result = ReplaceOneKeyword(
+ this.Chart,
+ this,
+ this.Tag,
+ ChartElementType.Nothing,
+ result,
+ KeywordName.Total,
+ SeriesValuesFormulaType.Total,
+ this.YValueType,
+ "");
+
+ // #AVG - total of Y values
+ result = ReplaceOneKeyword(
+ this.Chart,
+ this,
+ this.Tag,
+ ChartElementType.Nothing,
+ result,
+ KeywordName.Avg,
+ SeriesValuesFormulaType.Average,
+ this.YValueType,
+ "");
+
+ // #MAX - total of Y values
+ result = ReplaceOneKeyword(
+ this.Chart,
+ this,
+ this.Tag,
+ ChartElementType.Nothing,
+ result,
+ KeywordName.Max,
+ SeriesValuesFormulaType.Maximum,
+ this.YValueType,
+ "");
+
+ // #MIN - total of Y values
+ result = ReplaceOneKeyword(
+ this.Chart,
+ this,
+ this.Tag,
+ ChartElementType.Nothing,
+ result,
+ KeywordName.Min,
+ SeriesValuesFormulaType.Minimum,
+ this.YValueType,
+ "");
+
+ // #FIRST - total of Y values
+ result = ReplaceOneKeyword(
+ this.Chart,
+ this,
+ this.Tag,
+ ChartElementType.Nothing,
+ result,
+ KeywordName.First,
+ SeriesValuesFormulaType.First,
+ this.YValueType,
+ "");
+
+ // #LAST - total of Y values
+ result = ReplaceOneKeyword(
+ this.Chart,
+ this,
+ this.Tag,
+ ChartElementType.Nothing,
+ result,
+ KeywordName.Last,
+ SeriesValuesFormulaType.Last,
+ this.YValueType,
+ "");
+
+
+ // #LEGENDTEXT - series name
+ result = result.Replace(KeywordName.LegendText, this.LegendText);
+
+ return result;
+ }
+
+
+ /// <summary>
+ /// Helper function which replaces one keyword.
+ /// </summary>
+ /// <param name="chart">Chart object reference.</param>
+ /// <param name="elementType">Chart element type.</param>
+ /// <param name="obj">Object being formatted.</param>
+ /// <param name="objTag">Additional object tag.</param>
+ /// <param name="strOriginal">Original string.</param>
+ /// <param name="keyword">Keyword to replace.</param>
+ /// <param name="formulaType">Formula used to calculate the value.</param>
+ /// <param name="valueType">AxisName of value.</param>
+ /// <param name="defaultFormat">Default format string.</param>
+ /// <returns>Result string.</returns>
+ internal string ReplaceOneKeyword(
+ Chart chart,
+ object obj,
+ object objTag,
+ ChartElementType elementType,
+ string strOriginal,
+ string keyword,
+ SeriesValuesFormulaType formulaType,
+ ChartValueType valueType,
+ string defaultFormat)
+ {
+ string result = strOriginal;
+ int keyIndex = -1;
+ while((keyIndex = result.IndexOf(keyword, StringComparison.Ordinal)) != -1)
+ {
+ int keyEndIndex = keyIndex + keyword.Length;
+
+ // Get optional Y value index
+ int yValueIndex = 0;
+ if(result.Length > keyEndIndex + 1 &&
+ result[keyEndIndex] == 'Y' &&
+ char.IsDigit(result[keyEndIndex + 1]))
+ {
+ yValueIndex = int.Parse(result.Substring(keyEndIndex + 1, 1), CultureInfo.InvariantCulture);
+ keyEndIndex += 2;
+ }
+
+ // Get optional format
+ string format = defaultFormat;
+ if(result.Length > keyEndIndex && result[keyEndIndex] == '{')
+ {
+ int formatEnd = result.IndexOf('}', keyEndIndex);
+ if(formatEnd == -1)
+ {
+ throw(new InvalidOperationException( SR.ExceptionDataSeriesKeywordFormatInvalid( result )));
+ }
+
+ format = result.Substring(keyEndIndex, formatEnd - keyEndIndex).Trim('{', '}');
+ keyEndIndex = formatEnd + 1;
+ }
+
+ // Remove keyword string (with optional format)
+ result = result.Remove(keyIndex, keyEndIndex - keyIndex);
+
+ // Calculate value
+ double totalValue = this.GetTotalYValue(yValueIndex);
+ double keywordValue = 0.0;
+ switch(formulaType)
+ {
+ case(SeriesValuesFormulaType.Average):
+ {
+ if(this.Points.Count > 0)
+ {
+ keywordValue = totalValue / this.Points.Count;
+ }
+ break;
+ }
+ case(SeriesValuesFormulaType.First):
+ {
+ if(this.Points.Count > 0)
+ {
+ keywordValue = this.Points[0].YValues[yValueIndex];
+ }
+ break;
+ }
+ case(SeriesValuesFormulaType.Last):
+ {
+ if(this.Points.Count > 0)
+ {
+ keywordValue = this.Points[this.Points.Count - 1].YValues[yValueIndex];
+ }
+ break;
+ }
+ case(SeriesValuesFormulaType.Maximum):
+ {
+ if (this.Points.Count > 0)
+ {
+ keywordValue = double.MinValue;
+ foreach (DataPoint point in this.Points)
+ {
+ keywordValue = Math.Max(keywordValue, point.YValues[yValueIndex]);
+ }
+ }
+ break;
+ }
+ case(SeriesValuesFormulaType.Minimum):
+ {
+ if (this.Points.Count > 0)
+ {
+ keywordValue = double.MaxValue;
+ foreach (DataPoint point in this.Points)
+ {
+ keywordValue = Math.Min(keywordValue, point.YValues[yValueIndex]);
+ }
+ }
+ break;
+ }
+ case(SeriesValuesFormulaType.Total):
+ {
+ keywordValue = totalValue;
+ break;
+ }
+ }
+
+ // Insert value
+ result = result.Insert(keyIndex,
+ ValueConverter.FormatValue(chart, obj, objTag, keywordValue, format, valueType, elementType));
+ }
+
+ return result;
+ }
+
+
+ /// <summary>
+ /// Helper function which replaces one keyword.
+ /// </summary>
+ /// <param name="chart">Chart object reference.</param>
+ /// <param name="elementType">Chart element type.</param>
+ /// <param name="obj">Object being formatted.</param>
+ /// <param name="objTag">Additional object tag.</param>
+ /// <param name="strOriginal">Original string.</param>
+ /// <param name="keyword">Keyword to replace.</param>
+ /// <param name="value">Value to replace with.</param>
+ /// <param name="valueType">AxisName of value.</param>
+ /// <param name="defaultFormat">Default format string.</param>
+ /// <returns>Result string.</returns>
+ internal string ReplaceOneKeyword(Chart chart, object obj, object objTag, ChartElementType elementType, string strOriginal, string keyword, double value, ChartValueType valueType, string defaultFormat)
+
+ {
+ string result = strOriginal;
+ int keyIndex = -1;
+ while((keyIndex = result.IndexOf(keyword, StringComparison.Ordinal)) != -1)
+ {
+ // Get optional format
+ int keyEndIndex = keyIndex + keyword.Length;
+ string format = defaultFormat;
+ if(result.Length > keyEndIndex && result[keyEndIndex] == '{')
+ {
+ int formatEnd = result.IndexOf('}', keyEndIndex);
+ if(formatEnd == -1)
+ {
+ throw(new InvalidOperationException( SR.ExceptionDataSeriesKeywordFormatInvalid(result)));
+ }
+
+ format = result.Substring(keyEndIndex, formatEnd - keyEndIndex).Trim('{', '}');
+ keyEndIndex = formatEnd + 1;
+ }
+
+ // Remove keyword string (with optional format)
+ result = result.Remove(keyIndex, keyEndIndex - keyIndex);
+
+ // Insert value
+ result = result.Insert(keyIndex,
+ ValueConverter.FormatValue(chart, obj, objTag, value, format, valueType, elementType));
+ }
+
+ return result;
+ }
+
+
+ #endregion
+
+ #region Points sorting methods
+
+ /// <summary>
+ /// Sorts the points in the series.
+ /// </summary>
+ /// <param name="pointSortOrder">Sorting order.</param>
+ /// <param name="sortBy">Value used for sorting (X, Y, Y2, ...).</param>
+ public void Sort(PointSortOrder pointSortOrder, string sortBy)
+ {
+ // Check arguments
+ if (sortBy==null)
+ throw new ArgumentNullException("sortBy");
+
+ // Sort items using data points comparer class
+ DataPointComparer comparer = new DataPointComparer(this, pointSortOrder, sortBy);
+ this.Points.ItemList.Sort(comparer);
+
+ // Invalidate chart area only
+ this.Invalidate(true, false);
+ }
+
+ /// <summary>
+ /// Sorts the points in the series.
+ /// </summary>
+ /// <param name="pointSortOrder">Sorting order.</param>
+ public void Sort(PointSortOrder pointSortOrder)
+ {
+ Sort(pointSortOrder, "Y");
+ }
+
+ /// <summary>
+ /// Sorts the points in the series using IComparer interface.
+ /// </summary>
+ /// <param name="comparer">IComparer interface.</param>
+ public void Sort(IComparer<DataPoint> comparer)
+ {
+ // Check arguments
+ if (comparer == null)
+ throw new ArgumentNullException("comparer");
+
+ // Sort points
+ this.Points.ItemList.Sort(comparer);
+
+ // Invalidate chart area only
+ this.Invalidate(true, false);
+
+ }
+
+ #endregion
+
+ #region Series preparation/cleanup for drawing
+
+ /// <summary>
+ /// Moves the position markers.
+ /// </summary>
+ /// <param name="fromSeries">From series.</param>
+ /// <param name="toSeries">To series.</param>
+ internal static void MovePositionMarkers(Series fromSeries, Series toSeries)
+ {
+ foreach (DataPoint dp in fromSeries.Points)
+ {
+ if (dp.IsCustomPropertySet("OriginalPointIndex"))
+ {
+ int index = -1;
+ if (Int32.TryParse(dp["OriginalPointIndex"], NumberStyles.Integer, CultureInfo.InvariantCulture, out index))
+ {
+ if (index > -1 && index < toSeries.Points.Count)
+ {
+ toSeries.Points[index].positionRel = dp.positionRel;
+ }
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Called after the series was drawn.
+ /// </summary>
+ /// <param name="controlSite">Site interface of the control.</param>
+ /// <returns>True if series was removed from collection.</returns>
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Justification = "This parameter is used when compiling for the Microsoft version of Chart")]
+ internal bool UnPrepareData(ISite controlSite)
+ {
+ bool result = false;
+
+
+
+
+ // Process Renko chart type data calculations
+ if(RenkoChart.UnPrepareData(this))
+ {
+ result = true;
+ }
+
+ // Process ThreeLineBreak chart type data calculations
+ if(ThreeLineBreakChart.UnPrepareData(this))
+ {
+ result = true;
+ }
+
+ // Process Kagi chart type data calculations
+ if(KagiChart.UnPrepareData(this))
+ {
+ result = true;
+ }
+
+ // Process PointAndFigure chart type data calculations
+ if(PointAndFigureChart.UnPrepareData(this))
+ {
+ result = true;
+ }
+
+ // Undo all changes done for the collected slice support
+ if(PieChart.UnPrepareData(this))
+ {
+ result = true;
+ }
+
+
+ // Reset original value type which was temp. set to String
+ if(_isXValueIndexed)
+ {
+ _xValueType = indexedXValueType;
+ }
+
+ // Reset auro values only at design time
+ bool reset = false;
+ if(controlSite != null && controlSite.DesignMode)
+ {
+ reset = true;
+ }
+
+ ResetAutoValues(reset);
+
+ return result;
+ }
+
+ /// <summary>
+ /// Reset auto calculated series values.
+ /// </summary>
+ internal void ResetAutoValues()
+ {
+ ResetAutoValues(true);
+ }
+
+ /// <summary>
+ /// Reset auto calculated series values.
+ /// </summary>
+ /// <param name="reset">Indicates that value types should be reset.</param>
+ internal void ResetAutoValues(bool reset)
+ {
+ // If temporary data attribute is set - remove all data points
+ if(this.IsCustomPropertySet("TempDesignData"))
+ {
+ this.DeleteCustomProperty("TempDesignData");
+
+ // save the fake DataPoints for selector service
+ bool savePoints = true;
+ if (this.Chart != null && !this.Chart.IsDesignMode())
+ {
+ savePoints = false;
+ }
+ if ( savePoints )
+ {
+ fakeDataPoints.Clear();
+ foreach (DataPoint p in this.Points)
+ {
+ fakeDataPoints.Add(p);
+ }
+ }
+
+ this.Points.Clear();
+ }
+
+ // Reset series color
+ if(this.tempColorIsSet)
+ {
+ this.tempColorIsSet = false;
+ this.Color = Color.Empty;
+ }
+
+ // Reset series marker
+ if(this.tempMarkerStyleIsSet)
+ {
+ this.tempMarkerStyleIsSet = false;
+ this.MarkerStyle = MarkerStyle.None;
+ }
+
+ // Reset points color
+ foreach(DataPoint dataPoint in _points)
+ {
+ if(dataPoint.tempColorIsSet)
+ {
+ dataPoint.Color = Color.Empty;
+ }
+ }
+
+ // Reset value type to Auto (if not Serializing data)
+ if(reset)
+ {
+ if(this.Chart == null || this.Chart.serializing == false)
+ {
+ if(autoXValueType)
+ {
+ _xValueType = ChartValueType.Auto;
+ autoXValueType = false;
+ }
+ if(autoYValueType)
+ {
+ _yValueType = ChartValueType.Auto;
+ autoYValueType = false;
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Called just before the data from the series to be used to perform these operations:
+ /// - apply palette colors to the data points
+ /// - fill empty data points
+ /// - provide fake data in design mode
+ /// - retrieving data from the DataSource
+ /// </summary>
+ /// <param name="applyPaletteColors">If true each data point will be assigned a color from the palette (if it's set)</param>
+ internal void PrepareData(bool applyPaletteColors)
+ {
+ if(!this.IsVisible())
+ {
+ return;
+ }
+
+ // Series chart area name can be empty or a valid area name
+ Chart.ChartAreas.VerifyNameReference(this.ChartArea);
+
+ // Check if sereis data points have required number of Y values
+ if(this.Points.Count > 0 && this.Points[0].YValues.Length < this.YValuesPerPoint)
+ {
+ // Resize data points Y value(s) arrays
+ foreach(DataPoint dp in this.Points)
+ {
+ dp.ResizeYValueArray(this.YValuesPerPoint);
+ }
+ }
+
+ // Get series data source
+ bool fillTempData = false;
+ if(this.Points.Count == 0)
+ {
+ // If there is no points defined in design-time
+ if(Chart.IsDesignMode())
+ {
+ fillTempData = true;
+ }
+ else if(this.IsCustomPropertySet("UseDummyData"))
+ {
+ if(String.Compare(this["UseDummyData"], "True", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ fillTempData = true;
+ }
+ }
+ }
+
+ // Create dummy data only if there was no points
+ if(fillTempData)
+ {
+ if(this.IsXValueDateTime() || _xValueType == ChartValueType.String)
+ {
+ this.Points.DataBindXY(GetDummyData(_xValueType), GetDummyData(_yValueType));
+ }
+ else
+ {
+ double[] xValues = new double[] { 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 };
+ if(this.ChartType == SeriesChartType.Polar)
+ {
+ xValues = new double[] { 0.0, 45.0, 115.0, 145.0, 180.0, 220.0 };
+ }
+ this.Points.DataBindXY(xValues, GetDummyData(_yValueType));
+ }
+
+ // If point has more than one Y value - copy the data from first value
+ if(this.YValuesPerPoint > 1)
+ {
+ foreach(DataPoint point in this.Points)
+ {
+ for(int valueIndex = 1; valueIndex < this.YValuesPerPoint; valueIndex++)
+ {
+ point.YValues[valueIndex] = point.YValues[0];
+ }
+
+ if(this.YValuesPerPoint >= 2)
+ {
+ point.YValues[1] = point.YValues[0] / 2 - 1;
+ }
+
+ if(this.YValuesPerPoint >= 4)
+ {
+ point.YValues[2] = point.YValues[1] + (point.YValues[0] - point.YValues[1]) / 3;
+ point.YValues[3] = point.YValues[2] + (point.YValues[0] - point.YValues[1]) / 3;
+ }
+
+ if(this.YValuesPerPoint >= 6)
+ {
+ point.YValues[4] = point.YValues[2] + (point.YValues[3] - point.YValues[2]) / 2;
+ point.YValues[5] = point.YValues[2] + (point.YValues[3] - point.YValues[2]) / 3;
+ }
+
+ }
+ }
+
+ // Set data series attribute that data is temporary
+ this["TempDesignData"] = "true";
+ }
+
+ // If value type was not Auto detected - set it to double
+ if(_xValueType == ChartValueType.Auto)
+ {
+ _xValueType = ChartValueType.Double;
+ autoXValueType = true;
+ }
+ if(_yValueType == ChartValueType.Auto)
+ {
+ _yValueType = ChartValueType.Double;
+ autoYValueType = true;
+ }
+
+ // Use data point index as X value
+ indexedXValueType = _xValueType;
+
+ // Reset total Y value
+ _totalYvalue = double.NaN;
+
+ // Supress zero and negative values with logarithmic axis exceptions
+ if(this.Chart != null && this.Chart.chartPicture.SuppressExceptions)
+ {
+ // Get series axis
+ Axis axisY = this.Chart.ChartAreas[this.ChartArea].GetAxis(AxisName.Y, this.YAxisType, this.YSubAxisName);
+
+ foreach(DataPoint point in this.Points)
+ {
+ for(int yValueIndex = 0; yValueIndex < point.YValues.Length; yValueIndex++)
+ {
+ if(axisY.IsLogarithmic)
+ {
+ // Look for Y values less or equal to Zero
+ if(point.YValues[yValueIndex] <= 0.0)
+ {
+ point.YValues[yValueIndex] = 1.0;
+ point.IsEmpty = true;
+ }
+ }
+
+ // Check All Y values for NaN
+ if(double.IsNaN(point.YValues[yValueIndex]))
+ {
+ point.YValues[yValueIndex] = 0.0;
+ point.IsEmpty = true;
+ }
+ }
+ }
+ }
+
+
+
+ // Process Error Bar chart type data linking and calculations
+ ErrorBarChart.GetDataFromLinkedSeries(this);
+ ErrorBarChart.CalculateErrorAmount(this);
+
+ // Process Box chart type data calculations
+ BoxPlotChart.CalculateBoxPlotFromLinkedSeries(this);
+
+ // Process Renko chart type data calculations
+ RenkoChart.PrepareData(this);
+
+ // Process ThreeLineBreak chart type data calculations
+ ThreeLineBreakChart.PrepareData(this);
+
+ // Process Kagi chart type data calculations
+ KagiChart.PrepareData(this);
+
+ // Process PointAndFigure chart type data calculations
+ PointAndFigureChart.PrepareData(this);
+
+ // Check if Collected slice should be displayed in Pie/Doughnut charts
+ PieChart.PrepareData(this);
+
+
+ // Apply palette colors to the data points
+ if (applyPaletteColors)
+ {
+ this.ApplyPaletteColors();
+ }
+ }
+
+ #endregion
+
+ #region Series Properties
+
+ /// <summary>
+ /// Data series name.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeSeries_Name"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public override string Name
+ {
+ get
+ {
+ return base.Name;
+ }
+ set
+ {
+ base.Name = value;
+ }
+ }
+
+ /// <summary>
+ /// Member of the chart data source used to data bind to the X value of the series.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeDataSource"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeSeries_ValueMemberX"),
+ DefaultValue(""),
+ #if !Microsoft_CONTROL
+ TypeConverter(Editors.SeriesDataFieldXConvertor.Convertor)
+ #else
+ TypeConverter(typeof(SeriesDataSourceMemberConverter))
+ #endif
+ ]
+ public string XValueMember
+ {
+ get
+ {
+ return _dataSourceXMember;
+ }
+ set
+ {
+ if(value == "(none)")
+ {
+ _dataSourceXMember = String.Empty;
+ }
+ else
+ {
+ _dataSourceXMember = value;
+ }
+
+ // Reset data bound flag
+ if(this.Common!=null && this.Common.ChartPicture!=null)
+ {
+ this.Common.ChartPicture.boundToDataSource = false;
+ }
+
+ }
+ }
+
+ /// <summary>
+ /// Members of the chart data source used to data bind to the Y values of the series.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeDataSource"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeSeries_ValueMembersY"),
+ DefaultValue(""),
+ #if !Microsoft_CONTROL
+ TypeConverter(Editors.SeriesDataFieldYConvertor.Convertor),
+ Editor(Editors.SeriesDataFieldValueAxisUITypeEditor.Editor, Editors.SeriesDataFieldValueAxisUITypeEditor.Base)
+ #else
+ TypeConverter(typeof(SeriesDataSourceMemberConverter)),
+ Editor(Editors.SeriesDataSourceMemberValueAxisUITypeEditor.Editor, Editors.SeriesDataSourceMemberValueAxisUITypeEditor.Base)
+ #endif
+ ]
+ public string YValueMembers
+ {
+ get
+ {
+ return _dataSourceYMembers;
+ }
+ set
+ {
+ if(value == "(none)")
+ {
+ _dataSourceYMembers = String.Empty;
+ }
+ else
+ {
+ _dataSourceYMembers = value;
+ }
+
+ // Reset data bound flag
+ if(this.Common != null && this.Common.ChartPicture!=null)
+ {
+ this.Common.ChartPicture.boundToDataSource = false;
+ }
+
+ }
+ }
+
+
+ /// <summary>
+ /// Name of the Chart legend used by the series.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeLegend"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeSeries_Legend"),
+ DefaultValue(""),
+ TypeConverter(typeof(SeriesLegendNameConverter))
+ ]
+ public string Legend
+ {
+ get
+ {
+ return _legend;
+ }
+ set
+ {
+ if (value != _legend)
+ {
+ if (Chart != null && Chart.Legends != null)
+ {
+ Chart.Legends.VerifyNameReference(value);
+ }
+ _legend = value;
+ this.Invalidate(false, true);
+ }
+ }
+ }
+
+ /// <summary>
+ /// The value type of the X axis.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeSeries_XValueType"),
+ DefaultValue(ChartValueType.Auto),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public ChartValueType XValueType
+ {
+ get
+ {
+ return _xValueType;
+ }
+ set
+ {
+ _xValueType = value;
+ this.autoXValueType = false;
+ this.Invalidate(true, false);
+ }
+ }
+
+ /// <summary>
+ /// Indicates whether a data point index (1,2,...) will be used for the X value.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeSeries_XValueIndexed"),
+ DefaultValue(false),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public bool IsXValueIndexed
+ {
+ get
+ {
+ return _isXValueIndexed;
+ }
+ set
+ {
+ _isXValueIndexed = value;
+ this.Invalidate(true, false);
+ }
+ }
+
+ /// <summary>
+ /// The value type of the Y axis.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeSeries_YValueType"),
+ DefaultValue(ChartValueType.Auto),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ TypeConverter(typeof(SeriesYValueTypeConverter)),
+ ]
+ public ChartValueType YValueType
+ {
+ get
+ {
+ return _yValueType;
+ }
+ set
+ {
+ _yValueType = value;
+ this.autoYValueType = false;
+ this.Invalidate(true, false);
+ }
+ }
+
+ /// <summary>
+ /// Number of Y values stored for each Data Point.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeData"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeSeries_YValuesPerPoint"),
+ DefaultValue(1),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public int YValuesPerPoint
+ {
+ get
+ {
+ // If number of Y value(s) is not set - get one from the chart type
+ if(this._checkPointsNumber && this.ChartTypeName.Length > 0 && this.Common != null)
+ {
+ _checkPointsNumber = false;
+ ChartTypeRegistry chartTypeRegistry = this.Common.ChartTypeRegistry;
+ IChartType chartType = chartTypeRegistry.GetChartType(this.ChartTypeName);
+ if(chartType.YValuesPerPoint > _yValuesPerPoint)
+ {
+ _yValuesPerPoint = chartType.YValuesPerPoint;
+
+ // Resize Y value(s) array of data points
+ if(_points.Count > 0)
+ {
+ // Resize data points Y value(s) arrays
+ foreach(DataPoint dp in _points)
+ {
+ dp.ResizeYValueArray(_yValuesPerPoint);
+ }
+ }
+ }
+ }
+
+ return _yValuesPerPoint;
+ }
+ set
+ {
+ // Check if argument is in range
+ if(value < 1 || value > 32)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionDataSeriesYValueNumberInvalid));
+ }
+
+ _checkPointsNumber = true;
+
+ // Resize Y value(s) array of data points
+ if(_points.Count > 0)
+ {
+ // Resize data points Y value(s) arrays
+ foreach(DataPoint dp in _points)
+ {
+ dp.ResizeYValueArray(value);
+ }
+ }
+
+ _yValuesPerPoint = value;
+ this.Invalidate(true, false);
+ }
+ }
+
+ /// <summary>
+ /// Collection of data points in the series.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeSeries_Points"),
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else
+ Themeable(false),
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ Editor(Editors.DataPointCollectionEditor.Editor, Editors.DataPointCollectionEditor.Base)
+ ]
+ public DataPointCollection Points
+ {
+ get
+ {
+ return _points;
+ }
+ }
+
+ /// <summary>
+ /// Default properties of an empty data point.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeEmptyPoints"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeSeries_EmptyPointStyle"),
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+
+ ]
+ public DataPointCustomProperties EmptyPointStyle
+ {
+ get
+ {
+ return _emptyPointCustomProperties;
+ }
+ set
+ {
+ if (value.series == null && _emptyPointCustomProperties.series != null)
+ {
+ value.series = _emptyPointCustomProperties.series;
+ }
+ _emptyPointCustomProperties = value;
+ _emptyPointCustomProperties.pointCustomProperties = false;
+ _emptyPointCustomProperties.SetDefault(false);
+ _emptyPointCustomProperties.pointCustomProperties = true;
+ _emptyPointCustomProperties.Parent = this;
+ this.Invalidate(true, false);
+ }
+ }
+
+ /// <summary>
+ /// Color palette to use.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributePalette"),
+ DefaultValue(ChartColorPalette.None),
+ Editor(Editors.ColorPaletteEditor.Editor, Editors.ColorPaletteEditor.Base)
+ ]
+ public ChartColorPalette Palette
+ {
+ get
+ {
+ return _colorPalette;
+ }
+ set
+ {
+ _colorPalette = value;
+ this.Invalidate(true, true);
+ }
+ }
+
+ /// <summary>
+ /// Specify how often to display data point markers.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMarker"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeSeries_MarkerStep"),
+ DefaultValue(1)
+ ]
+ public int MarkerStep
+ {
+ get
+ {
+ return _markersStep;
+ }
+ set
+ {
+ if(value <= 0)
+ {
+ throw(new ArgumentException( SR.ExceptionMarkerStepNegativeValue, "value"));
+ }
+ _markersStep = value;
+ this.Invalidate(true, false);
+ }
+ }
+
+ /// <summary>
+ /// Shadow offset of series.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+
+ SRDescription("DescriptionAttributeShadowOffset"),
+ DefaultValue(0)
+ ]
+ public int ShadowOffset
+ {
+ get
+ {
+ return _shadowOffset;
+ }
+ set
+ {
+ _shadowOffset = value;
+ this.Invalidate(true, true);
+ }
+ }
+
+ /// <summary>
+ /// Shadow color of series.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), "128,0,0,0"),
+ SRDescription("DescriptionAttributeShadowColor"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color ShadowColor
+ {
+ get
+ {
+ return _shadowColor;
+ }
+ set
+ {
+ _shadowColor = value;
+ this.Invalidate(true, true);
+ }
+ }
+
+
+#if SUBAXES
+
+ /// <summary>
+ /// Name of the Y sub-axis this series is attached to.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxes"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeSeries_YSubAxisName"),
+ DefaultValue("")
+ ]
+ public string YSubAxisName
+ {
+ get
+ {
+ return this._ySubAxisName;
+ }
+ set
+ {
+ this._ySubAxisName = value;
+ this.Invalidate(true, false);
+ }
+ }
+
+ /// <summary>
+ /// Name of the X sub-axis this series is attached to.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAxes"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeSeries_XSubAxisName"),
+ DefaultValue("")
+ ]
+ public string XSubAxisName
+ {
+ get
+ {
+ return this._xSubAxisName;
+ }
+ set
+ {
+ this._xSubAxisName = value;
+ this.Invalidate(true, false);
+ }
+ }
+
+#else // SUBAXES
+ /// <summary>
+ /// Name of the Y sub-axis this series is attached to.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxes"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeSeries_YSubAxisName"),
+ DefaultValue(""),
+ System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "value")
+ ]
+ internal string YSubAxisName
+ {
+ get
+ {
+ return string.Empty;
+ }
+ set
+ {
+ }
+ }
+
+ /// <summary>
+ /// Name of the X sub-axis this series is attached to.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxes"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeSeries_XSubAxisName"),
+ DefaultValue(""),
+ System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "value")
+ ]
+ internal string XSubAxisName
+ {
+ get
+ {
+ return string.Empty;
+ }
+ set
+ {
+ }
+ }
+#endif // SUBAXES
+
+ /// <summary>
+ /// Axis type of horizontal axes.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxes"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeSeries_XAxisType"),
+ DefaultValue(AxisType.Primary)
+ ]
+ public AxisType XAxisType
+ {
+ get
+ {
+ return _xAxisType;
+ }
+ set
+ {
+ _xAxisType = value;
+ this.Invalidate(true, false);
+ }
+ }
+
+ /// <summary>
+ /// Axis type of vertical axes.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxes"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeSeries_YAxisType"),
+ DefaultValue(AxisType.Primary)
+ ]
+ public AxisType YAxisType
+ {
+ get
+ {
+ return _yAxisType;
+ }
+ set
+ {
+ _yAxisType = value;
+ this.Invalidate(true, false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag which indicates whether the series is enabled.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeSeries_Enabled"),
+ NotifyParentPropertyAttribute(true),
+ ParenthesizePropertyNameAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public bool Enabled
+ {
+ get
+ {
+ return _enabled;
+ }
+ set
+ {
+ _enabled = value;
+ this.Invalidate(true, true);
+ }
+ }
+
+ /// <summary>
+ /// Chart type used to draw the series.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeChart"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeSeries_Type"),
+ DefaultValue(SeriesChartType.Column),
+ RefreshProperties(RefreshProperties.All),
+ Editor(Editors.ChartTypeEditor.Editor, Editors.ChartTypeEditor.Base)
+ ]
+ public SeriesChartType ChartType
+ {
+ get
+ {
+ SeriesChartType type = SeriesChartType.Column;
+ if(String.Compare(this.ChartTypeName, ChartTypeNames.OneHundredPercentStackedArea, StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ type = SeriesChartType.StackedArea100;
+ }
+ else if (String.Compare(this.ChartTypeName, ChartTypeNames.OneHundredPercentStackedBar, StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ type = SeriesChartType.StackedBar100;
+ }
+ else if (String.Compare(this.ChartTypeName, ChartTypeNames.OneHundredPercentStackedColumn, StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ type = SeriesChartType.StackedColumn100;
+ }
+ else
+ {
+ try
+ {
+ type = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), this.ChartTypeName, true);
+ }
+ catch (ArgumentException)
+ {
+ }
+ }
+
+ return type;
+ }
+ set
+ {
+ this.ChartTypeName = Series.GetChartTypeName(value);
+ }
+ }
+
+ /// <summary>
+ /// Chart type used to draw the series.
+ /// </summary>
+ [
+ Browsable(false),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ SRCategory("CategoryAttributeChart"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeSeries_Type"),
+ DefaultValue(ChartTypeNames.Column),
+ TypeConverter(typeof(ChartTypeConverter)),
+ Editor(Editors.ChartTypeEditor.Editor, Editors.ChartTypeEditor.Base),
+ RefreshProperties(RefreshProperties.All),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)
+ ]
+ public string ChartTypeName
+ {
+ get
+ {
+ return _chartType;
+ }
+ set
+ {
+ if(_chartType != value && value.Length > 0)
+ {
+ if(Common != null)
+ {
+ ChartTypeRegistry chartTypeRegistry = Common.ChartTypeRegistry;
+ if(chartTypeRegistry != null)
+ {
+ IChartType type = chartTypeRegistry.GetChartType(value);
+ if(_yValuesPerPoint < type.YValuesPerPoint)
+ {
+ // Set minimum Y values number for the chart type
+ _yValuesPerPoint = type.YValuesPerPoint;
+
+ // Resize Y value(s) array of data points
+ if(_points.Count > 0)
+ {
+ // Resize data points Y value(s) arrays
+ foreach(DataPoint dp in _points)
+ {
+ dp.ResizeYValueArray(_yValuesPerPoint);
+ }
+ }
+ }
+#if Microsoft_CONTROL
+ // Refresh Minimum and Maximum from data
+ // after recalc and set data
+ if(Chart != null && Chart.chartPicture != null)
+ {
+ Chart.chartPicture.ResetMinMaxFromData();
+ }
+#endif
+ }
+ }
+ }
+
+ _chartType = value;
+
+ this.Invalidate(false, true);
+ }
+ }
+
+
+ /// <summary>
+ /// Chart area in which this series is drawn.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeChart"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeSeries_ChartArea"),
+ DefaultValue(""),
+ TypeConverter(typeof(SeriesAreaNameConverter))
+ ]
+ public string ChartArea
+ {
+ get
+ {
+ return _chartArea;
+ }
+ set
+ {
+ if (value != _chartArea)
+ {
+ if (Chart != null && Chart.ChartAreas != null)
+ {
+ Chart.ChartAreas.VerifyNameReference(value);
+ }
+ _chartArea = value;
+ this.Invalidate(false, true);
+ }
+ }
+ }
+/*
+ /// <summary>
+ /// If set to true, each data point of the series will use a random color from the palette.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeChart"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeDataSeriesGroupID"),
+ PersistenceModeAttribute(PersistenceMode.Attribute),
+ DefaultValue("")
+ ]
+ public string GroupID
+ {
+ get
+ {
+ return groupID;
+ }
+ set
+ {
+ groupID = value;
+ }
+ }
+*/
+ /// <summary>
+ /// Text of X axis label.
+ /// </summary>
+ [
+ Browsable(false),
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeAxisLabel"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ override public string AxisLabel
+ {
+ get
+ {
+ return base.AxisLabel;
+ }
+ set
+ {
+ base.AxisLabel = value;
+ this.Invalidate(true, false);
+ }
+ }
+
+
+
+ /// <summary>
+ /// Style of the SmartLabel.
+ /// </summary>
+ [
+ Browsable(true),
+ SRCategory("CategoryAttributeLabel"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeSeries_SmartLabels"),
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ ]
+ public SmartLabelStyle SmartLabelStyle
+ {
+ get
+ {
+ return _smartLabelStyle;
+ }
+ set
+ {
+ value.chartElement = this;
+ _smartLabelStyle = value;
+ this.Invalidate(false, false);
+ }
+ }
+
+
+ /// <summary>
+ /// Series font cache is reused by points.
+ /// </summary>
+ /// <value>The font cache.</value>
+ internal FontCache FontCache
+ {
+ get { return _fontCache; }
+ }
+
+
+ #endregion
+
+ #region Invalidating method
+
+ /// <summary>
+ /// Invalidate chart or just a chart area and/or legend when collection is changed
+ /// </summary>
+ /// <param name="invalidateAreaOnly">Invalidate chart area only.</param>
+ /// <param name="invalidateLegend">Invalidate legend area only.</param>
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Justification = "This parameter is used when compiling for the Microsoft version of Chart")]
+ internal void Invalidate(bool invalidateAreaOnly, bool invalidateLegend)
+ {
+#if Microsoft_CONTROL
+
+
+ if(Chart != null)
+ {
+ if(!invalidateAreaOnly)
+ {
+ this.Invalidate();
+ }
+ else
+ {
+ // Invalidate one chart area (area with this name may not exist)
+ try
+ {
+ Chart.ChartAreas[this.ChartArea].Invalidate();
+ }
+ catch(ArgumentException)
+ {
+ // occurs if the chart area is not found in the collection
+ }
+
+ // Invalidate legend
+ if(invalidateLegend && Chart.Legends.IndexOf(this.Legend) >= 0)
+ {
+ Chart.Legends[this.Legend].Invalidate(true);
+ }
+ }
+ }
+#endif
+ }
+
+ #endregion
+
+ #region Series Enumeration
+
+
+
+ /// <summary>
+ /// Series values formula type used in the keywords
+ /// </summary>
+ internal enum SeriesValuesFormulaType
+ {
+ Total,
+ Average,
+ Maximum,
+ Minimum,
+ First,
+ Last
+ }
+
+
+
+ #endregion // Series Enumeration
+
+ #region IDisposable Members
+
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ if (_fontCache != null)
+ {
+ _fontCache.Dispose();
+ _fontCache = null;
+ }
+ if (this._emptyPointCustomProperties != null)
+ {
+ this._emptyPointCustomProperties.Dispose();
+ this._emptyPointCustomProperties = null;
+ }
+ if (this._points != null)
+ {
+ this._points.Dispose();
+ this._points = null;
+ }
+ if (this.fakeDataPoints != null)
+ {
+ this.fakeDataPoints.Dispose();
+ this.fakeDataPoints = null;
+ }
+ }
+ base.Dispose(disposing);
+ }
+
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/EditorNames.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/EditorNames.cs
new file mode 100644
index 00000000000..e6c16bca32c
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/EditorNames.cs
@@ -0,0 +1,263 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+#if WINFORMS_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+#endif
+{
+ internal static class Editors
+ {
+ #region Assembly configuration strings
+
+#if WINFORMS_CONTROL
+ private const string AssemblyName = "System.Windows.Forms.DataVisualization.Design";
+ internal const string Version = ThisAssembly.Version;
+ private const string Culture = "neutral";
+ private const string PublicKeyToken = AssemblyRef.SharedLibPublicKeyToken;
+ private const string Namespace = "System.Windows.Forms.Design.DataVisualization.Charting";
+#else
+ private const string AssemblyName = "System.Web.DataVisualization.Design";
+ internal const string Version = ThisAssembly.Version;
+ private const string Culture = "neutral";
+ private const string PublicKeyToken = AssemblyRef.SharedLibPublicKeyToken;
+ private const string Namespace = "System.Web.UI.Design.DataVisualization.Charting";
+#endif
+ #endregion Assembly configuration strings
+
+ public const string UITypeEditorBase = "System.Drawing.Design.UITypeEditor, System.Drawing, Version=" + Version + ", Culture=neutral, PublicKeyToken=" + AssemblyRef.MicrosoftPublicKeyToken;
+
+ internal static class ChartColorEditor
+ {
+ private const string ClassName = "ChartColorEditor";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class FlagsEnumUITypeEditor
+ {
+ private const string ClassName = "FlagsEnumUITypeEditor";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class SeriesDataSourceMemberValueAxisUITypeEditor
+ {
+ private const string ClassName = "SeriesDataSourceMemberValueAxisUITypeEditor";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class SeriesDataFieldValueAxisUITypeEditor
+ {
+ private const string ClassName = "SeriesDataFieldValueAxisUITypeEditor";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class ChartTypeEditor
+ {
+ private const string ClassName = "ChartTypeEditor";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class ChartCollectionEditor
+ {
+ private const string ClassName = "ChartCollectionEditor";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class DataPointCollectionEditor
+ {
+ private const string ClassName = "DataPointCollectionEditor";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class SeriesCollectionEditor
+ {
+ private const string ClassName = "SeriesCollectionEditor";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class AreaCollectionEditor
+ {
+ private const string ClassName = "AreaCollectionEditor";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class AnnotationCollectionEditor
+ {
+ private const string ClassName = "AnnotationCollectionEditor";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class AnchorPointUITypeEditor
+ {
+ private const string ClassName = "AnchorPointUITypeEditor";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class AnnotationAxisUITypeEditor
+ {
+ private const string ClassName = "AnnotationAxisUITypeEditor";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class ImageValueEditor
+ {
+ private const string ClassName = "ImageValueEditor";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class HatchStyleEditor
+ {
+ private const string ClassName = "HatchStyleEditor";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class UITypeEditorProxy
+ {
+ private const string ClassName = "UITypeEditorProxy";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class UITypeEditorProxyEx
+ {
+ private const string ClassName = "UITypeEditorProxyEx";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class ColorPaletteEditor
+ {
+ private const string ClassName = "ColorPaletteEditor";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class UIPropertyEditor
+ {
+ private const string ClassName = "UIPropertyEditor";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class MarkerStyleEditor
+ {
+ private const string ClassName = "MarkerStyleEditor";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class GradientEditor
+ {
+ private const string ClassName = "GradientEditor";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class AxesArrayEditor
+ {
+ private const string ClassName = "AxesArrayEditor";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class LegendItemCollectionEditor
+ {
+ private const string ClassName = "LegendItemCollectionEditor";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class LegendCollectionEditor
+ {
+ private const string ClassName = "LegendCollectionEditor";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class LegendCellColumnCollectionEditor
+ {
+ private const string ClassName = "LegendCellColumnCollectionEditor";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class LegendCellCollectionEditor
+ {
+ private const string ClassName = "LegendCellCollectionEditor";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class KeywordsStringEditor
+ {
+ private const string ClassName = "KeywordsStringEditor";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class UrlValueEditor
+ {
+ private const string ClassName = "UrlValueEditor";
+ public const string Editor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = UITypeEditorBase;
+ }
+
+ internal static class SeriesDataFieldXConvertor
+ {
+ private const string ClassName = "SeriesDataFieldXConvertor";
+ public const string Convertor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ }
+
+ internal static class SeriesDataFieldYConvertor
+ {
+ private const string ClassName = "SeriesDataFieldYConvertor";
+ public const string Convertor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ }
+
+
+ internal static class DataPointCustomPropertiesConverter
+ {
+ private const string ClassName = "DataPointCustomPropertiesConverter";
+ public const string Convertor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ }
+
+ internal static class DataPointConverter
+ {
+ private const string ClassName = "DataPointConverter";
+ public const string Convertor = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ }
+
+
+ #region Designers
+
+ public const string ChartWinDesigner = Namespace + ".ChartWinDesigner, " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+
+ internal static class ChartWinDesignerSerializer
+ {
+ private const string ClassName = "ChartWinDesignerSerializer";
+ public const string Designer = Namespace + "." + ClassName + ", " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+ public const string Base = "System.ComponentModel.Design.Serialization.CodeDomSerializer, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
+ }
+
+ public const string ChartWebDesigner = Namespace + ".ChartWebDesigner, " + AssemblyName + ", Version=" + Version + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;
+
+
+ #endregion Designers
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/FormulaHelpers.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/FormulaHelpers.cs
new file mode 100644
index 00000000000..bcc8882027e
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/FormulaHelpers.cs
@@ -0,0 +1,1636 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=victark, alexgor, deliant
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Globalization;
+using System.Diagnostics;
+
+#if Microsoft_CONTROL
+namespace System.Windows.Forms.DataVisualization.Charting.Formulas
+#else
+namespace System.Web.UI.DataVisualization.Charting.Formulas
+#endif
+{
+
+ #region class FormulaHelper
+ /// <summary>
+ /// Formula helper is a static utility class implementing common formula related routines.
+ /// </summary>
+ internal static class FormulaHelper
+ {
+ #region Static
+ /// <summary>
+ /// Gets the formula info instance.
+ /// </summary>
+ /// <param name="formula">The formula.</param>
+ /// <returns>FomulaInfo instance</returns>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")]
+ internal static FormulaInfo GetFormulaInfo(FinancialFormula formula)
+ {
+ switch (formula)
+ {
+ //Price indicators
+ case FinancialFormula.MovingAverage:
+ return new MovingAverageFormulaInfo();
+ case FinancialFormula.ExponentialMovingAverage:
+ return new ExponentialMovingAverageFormulaInfo();
+ case FinancialFormula.WeightedMovingAverage:
+ return new WeightedMovingAverageFormulaInfo();
+ case FinancialFormula.TriangularMovingAverage:
+ return new TriangularMovingAverageFormulaInfo();
+ case FinancialFormula.TripleExponentialMovingAverage:
+ return new TripleExponentialMovingAverageFormulaInfo();
+ case FinancialFormula.BollingerBands:
+ return new BollingerBandsFormulaInfo();
+ case FinancialFormula.TypicalPrice:
+ return new TypicalPriceFormulaInfo();
+ case FinancialFormula.WeightedClose:
+ return new WeightedCloseFormulaInfo();
+ case FinancialFormula.MedianPrice:
+ return new MedianPriceFormulaInfo();
+ case FinancialFormula.Envelopes:
+ return new EnvelopesFormulaInfo();
+ case FinancialFormula.StandardDeviation:
+ return new StandardDeviationFormulaInfo();
+
+ // Oscilators
+ case FinancialFormula.ChaikinOscillator:
+ return new ChaikinOscillatorFormulaInfo();
+ case FinancialFormula.DetrendedPriceOscillator:
+ return new DetrendedPriceOscillatorFormulaInfo();
+ case FinancialFormula.VolatilityChaikins:
+ return new VolatilityChaikinsFormulaInfo();
+ case FinancialFormula.VolumeOscillator:
+ return new VolumeOscillatorFormulaInfo();
+ case FinancialFormula.StochasticIndicator:
+ return new StochasticIndicatorFormulaInfo();
+ case FinancialFormula.WilliamsR:
+ return new WilliamsRFormulaInfo();
+
+ // General technical indicators
+ case FinancialFormula.AverageTrueRange:
+ return new AverageTrueRangeFormulaInfo();
+ case FinancialFormula.EaseOfMovement:
+ return new EaseOfMovementFormulaInfo();
+ case FinancialFormula.MassIndex:
+ return new MassIndexFormulaInfo();
+ case FinancialFormula.Performance:
+ return new PerformanceFormulaInfo();
+ case FinancialFormula.RateOfChange:
+ return new RateOfChangeFormulaInfo();
+ case FinancialFormula.RelativeStrengthIndex:
+ return new RelativeStrengthIndexFormulaInfo();
+ case FinancialFormula.MovingAverageConvergenceDivergence:
+ return new MovingAverageConvergenceDivergenceFormulaInfo();
+ case FinancialFormula.CommodityChannelIndex:
+ return new CommodityChannelIndexFormulaInfo();
+
+ // Forecasting
+ case FinancialFormula.Forecasting:
+ return new ForecastingFormulaInfo();
+
+ // Volume Indicators
+ case FinancialFormula.MoneyFlow:
+ return new MoneyFlowFormulaInfo();
+ case FinancialFormula.PriceVolumeTrend:
+ return new PriceVolumeTrendFormulaInfo();
+ case FinancialFormula.OnBalanceVolume:
+ return new OnBalanceVolumeFormulaInfo();
+ case FinancialFormula.NegativeVolumeIndex:
+ return new NegativeVolumeIndexFormulaInfo();
+ case FinancialFormula.PositiveVolumeIndex:
+ return new PositiveVolumeIndexFormulaInfo();
+ case FinancialFormula.AccumulationDistribution:
+ return new AccumulationDistributionFormulaInfo();
+
+ default:
+ Debug.Fail(String.Format(CultureInfo.InvariantCulture, "{0} case is not defined", formula));
+ return null;
+ }
+ }
+
+ /// <summary>
+ /// Gets the data fields of the specified chart type.
+ /// </summary>
+ /// <param name="chartType">Type of the chart.</param>
+ /// <returns>Data fields</returns>
+ internal static IList<DataField> GetDataFields(SeriesChartType chartType)
+ {
+ switch (chartType)
+ {
+ case SeriesChartType.BoxPlot:
+ return new DataField[] {
+ DataField.LowerWisker, DataField.UpperWisker,
+ DataField.LowerBox, DataField.UpperBox,
+ DataField.Average, DataField.Median };
+ case SeriesChartType.Bubble:
+ return new DataField[] {
+ DataField.Bubble, DataField.BubbleSize };
+ case SeriesChartType.Candlestick:
+ case SeriesChartType.Stock:
+ return new DataField[] {
+ DataField.High, DataField.Low,
+ DataField.Open, DataField.Close };
+ case SeriesChartType.ErrorBar:
+ return new DataField[] {
+ DataField.Center,
+ DataField.LowerError, DataField.UpperError};
+ case SeriesChartType.RangeBar:
+ case SeriesChartType.Range:
+ case SeriesChartType.RangeColumn:
+ case SeriesChartType.SplineRange:
+ return new DataField[] {
+ DataField.Top, DataField.Bottom };
+ default:
+ return new DataField[] { DataField.Y };
+ }
+ }
+
+ /// <summary>
+ /// Gets the default type of the chart associated with this field name.
+ /// </summary>
+ /// <param name="field">The field.</param>
+ /// <returns></returns>
+ internal static SeriesChartType GetDefaultChartType(DataField field)
+ {
+ switch (field)
+ {
+ default:
+ case DataField.Y:
+ return SeriesChartType.Line;
+ case DataField.LowerWisker:
+ case DataField.UpperWisker:
+ case DataField.LowerBox:
+ case DataField.UpperBox:
+ case DataField.Average:
+ case DataField.Median:
+ return SeriesChartType.BoxPlot;
+ case DataField.Bubble:
+ case DataField.BubbleSize:
+ return SeriesChartType.Bubble;
+ case DataField.High:
+ case DataField.Low:
+ case DataField.Open:
+ case DataField.Close:
+ return SeriesChartType.Stock;
+ case DataField.Center:
+ case DataField.LowerError:
+ case DataField.UpperError:
+ return SeriesChartType.ErrorBar;
+ case DataField.Top:
+ case DataField.Bottom:
+ return SeriesChartType.Range;
+ }
+ }
+
+ /// <summary>
+ /// Maps formula data field to a chart type specific data field.
+ /// </summary>
+ /// <param name="chartType">Type of the chart.</param>
+ /// <param name="formulaField">The formula field to be mapped.</param>
+ /// <returns>The series field</returns>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
+ internal static DataField? MapFormulaDataField(SeriesChartType chartType, DataField formulaField)
+ {
+ switch (formulaField)
+ {
+ case DataField.Top:
+ case DataField.High:
+ switch (chartType)
+ {
+ default: return null;
+ case SeriesChartType.BoxPlot: return DataField.UpperBox;
+ case SeriesChartType.Candlestick:
+ case SeriesChartType.Stock: return DataField.High;
+ case SeriesChartType.ErrorBar: return DataField.UpperError;
+ case SeriesChartType.RangeBar:
+ case SeriesChartType.Range:
+ case SeriesChartType.RangeColumn:
+ case SeriesChartType.SplineRange: return DataField.Top;
+ }
+
+ case DataField.Bottom:
+ case DataField.Low:
+ switch (chartType)
+ {
+ default: return null;
+ case SeriesChartType.BoxPlot: return DataField.LowerBox;
+ case SeriesChartType.Candlestick:
+ case SeriesChartType.Stock: return DataField.Low;
+ case SeriesChartType.ErrorBar: return DataField.LowerError;
+ case SeriesChartType.RangeBar:
+ case SeriesChartType.Range:
+ case SeriesChartType.RangeColumn:
+ case SeriesChartType.SplineRange: return DataField.Bottom;
+ }
+
+ case DataField.Open:
+ switch (chartType)
+ {
+ default: return null;
+ case SeriesChartType.BoxPlot: return DataField.Average;
+ case SeriesChartType.Candlestick:
+ case SeriesChartType.Stock: return DataField.Open;
+ case SeriesChartType.ErrorBar: return DataField.Center;
+ case SeriesChartType.RangeBar:
+ case SeriesChartType.Range:
+ case SeriesChartType.RangeColumn:
+ case SeriesChartType.SplineRange: return DataField.Bottom;
+ }
+
+ case DataField.Close:
+ case DataField.Y:
+ switch (chartType)
+ {
+ default: return DataField.Y;
+ case SeriesChartType.BoxPlot: return DataField.Average;
+ case SeriesChartType.Bubble: return DataField.Bubble;
+ case SeriesChartType.Candlestick:
+ case SeriesChartType.Stock: return DataField.Close;
+ case SeriesChartType.ErrorBar: return DataField.Center;
+ case SeriesChartType.RangeBar:
+ case SeriesChartType.Range:
+ case SeriesChartType.RangeColumn:
+ case SeriesChartType.SplineRange: return DataField.Top;
+ }
+ default:
+ return null;
+ }
+ }
+
+ #endregion
+ }
+ #endregion
+
+ #region class FormulaInfo and inherited FormulaSpecific classes
+
+ /// <summary>
+ /// This a base class of the formula metainfo classes.
+ /// </summary>
+ internal abstract class FormulaInfo
+ {
+ #region Fields
+ DataField[] _inputFields;
+ DataField[] _outputFields;
+ object[] _parameters;
+ #endregion
+
+ #region Properties
+ /// <summary>
+ /// Gets the input data fields of the formula.
+ /// </summary>
+ /// <value>The input fields.</value>
+ public DataField[] InputFields
+ {
+ get { return _inputFields; }
+ }
+
+ /// <summary>
+ /// Gets the output data fields of the formula.
+ /// </summary>
+ /// <value>The output fields.</value>
+ public DataField[] OutputFields
+ {
+ get { return _outputFields; }
+ }
+
+ /// <summary>
+ /// Gets the parameters of the formula.
+ /// </summary>
+ /// <value>The parameters.</value>
+ public object[] Parameters
+ {
+ get { return _parameters; }
+ }
+ #endregion
+
+ #region Constructors
+ /// <summary>
+ /// Initializes a new instance of the <see cref="FormulaInfo"/> class.
+ /// </summary>
+ /// <param name="inputFields">The input data fields.</param>
+ /// <param name="outputFields">The output data fields.</param>
+ /// <param name="defaultParams">The default formula params.</param>
+ public FormulaInfo(DataField[] inputFields, DataField[] outputFields, params object[] defaultParams)
+ {
+ _inputFields = inputFields;
+ _outputFields = outputFields;
+ _parameters = defaultParams;
+ }
+ #endregion
+
+ #region Methods
+ /// <summary>
+ /// Saves the formula parameters to a string.
+ /// </summary>
+ /// <returns>Csv string with parameters</returns>
+ internal virtual string SaveParametersToString()
+ {
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < _parameters.Length; i++)
+ {
+ if (i > 0) sb.Append(',');
+ sb.AppendFormat(CultureInfo.InvariantCulture, "{0}", _parameters[i]);
+ }
+ return sb.ToString();
+ }
+
+ /// <summary>
+ /// Loads the formula parameters from string.
+ /// </summary>
+ /// <param name="parameters">Csv string with parameters.</param>
+ internal virtual void LoadParametersFromString(string parameters)
+ {
+ if (String.IsNullOrEmpty(parameters))
+ return;
+
+ string[] paramStringList = parameters.Split(',');
+ int paramStringIndex = 0;
+ for (int i = 0; i < _parameters.Length && paramStringIndex < paramStringList.Length; i++)
+ {
+ string newParamValue = paramStringList[paramStringIndex++];
+ if (!String.IsNullOrEmpty(newParamValue))
+ {
+ _parameters[i] = ParseParameter(i, newParamValue);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Parses the formula parameter.
+ /// </summary>
+ /// <param name="index">The param index.</param>
+ /// <param name="newParamValue">The parameter value string.</param>
+ /// <returns>Parameter value.</returns>
+ internal virtual object ParseParameter(int index, string newParamValue)
+ {
+ object param = _parameters[index];
+ if (param is int)
+ {
+ return Convert.ToInt32(newParamValue, CultureInfo.InvariantCulture);
+ }
+ else if (param is bool)
+ {
+ return Convert.ToBoolean(newParamValue, CultureInfo.InvariantCulture);
+ }
+ else if (param is double)
+ {
+ return Convert.ToDouble(newParamValue, CultureInfo.InvariantCulture);
+ }
+ return null;
+ }
+
+ /// <summary>
+ /// Checks the formula parameter string.
+ /// </summary>
+ /// <param name="parameters">The parameters.</param>
+ internal virtual void CheckParameterString(string parameters)
+ {
+ if (String.IsNullOrEmpty(parameters))
+ return;
+
+ string[] paramStringList = parameters.Split(',');
+ int paramStringIndex = 0;
+ for (int i = 0; i < _parameters.Length && paramStringIndex < paramStringList.Length; i++)
+ {
+ string newParamValue = paramStringList[paramStringIndex++];
+ if (!String.IsNullOrEmpty(newParamValue))
+ {
+ try
+ {
+ ParseParameter(i, newParamValue);
+ }
+ catch (FormatException)
+ {
+ throw new ArgumentException(SR.ExceptionFormulaDataFormatInvalid(parameters));
+ }
+ }
+ }
+ }
+ #endregion
+ }
+
+ /// <summary>
+ /// MovingAverage FormulaInfo
+ /// </summary>
+ internal class MovingAverageFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MovingAverageFormulaInfo"/> class.
+ /// </summary>
+ public MovingAverageFormulaInfo()
+ : this(2, false) //Defaults
+ {
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MovingAverageFormulaInfo"/> class.
+ /// </summary>
+ /// <param name="period">The period.</param>
+ /// <param name="startFromFirst">if set to <c>true</c> [start from first].</param>
+ public MovingAverageFormulaInfo(int period, bool startFromFirst)
+ : base(
+ new DataField[] { DataField.Y }, //Input fields
+ new DataField[] { DataField.Y }, //Output fields
+ period, startFromFirst)
+ {
+ }
+ }
+
+ /// <summary>
+ /// ExponentialMoving AverageFormulaInfo
+ /// </summary>
+ internal class ExponentialMovingAverageFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ExponentialMovingAverageFormulaInfo"/> class.
+ /// </summary>
+ public ExponentialMovingAverageFormulaInfo()
+ : this(2, false) //Defaults
+ {
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ExponentialMovingAverageFormulaInfo"/> class.
+ /// </summary>
+ /// <param name="period">The period.</param>
+ /// <param name="startFromFirst">if set to <c>true</c> [start from first].</param>
+ public ExponentialMovingAverageFormulaInfo(int period, bool startFromFirst)
+ : base(
+ new DataField[] { DataField.Y }, //Input fields
+ new DataField[] { DataField.Y }, //Output fields
+ period, startFromFirst)
+ {
+ }
+ }
+
+ /// <summary>
+ /// WeightedMovingAverageFormulaInfo
+ /// </summary>
+ internal class WeightedMovingAverageFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="WeightedMovingAverageFormulaInfo"/> class.
+ /// </summary>
+ public WeightedMovingAverageFormulaInfo()
+ : this(2, false) //Defaults
+ {
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="WeightedMovingAverageFormulaInfo"/> class.
+ /// </summary>
+ /// <param name="period">The period.</param>
+ /// <param name="startFromFirst">if set to <c>true</c> [start from first].</param>
+ public WeightedMovingAverageFormulaInfo(int period, bool startFromFirst)
+ : base(
+ new DataField[] { DataField.Y }, //Input fields
+ new DataField[] { DataField.Y }, //Output fields
+ period, startFromFirst)
+ {
+ }
+ }
+
+ /// <summary>
+ /// TriangularMovingAverage FormulaInfo
+ /// </summary>
+ internal class TriangularMovingAverageFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="TriangularMovingAverageFormulaInfo"/> class.
+ /// </summary>
+ public TriangularMovingAverageFormulaInfo()
+ : this(2, false) //Defaults
+ {
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="TriangularMovingAverageFormulaInfo"/> class.
+ /// </summary>
+ /// <param name="period">The period.</param>
+ /// <param name="startFromFirst">if set to <c>true</c> [start from first].</param>
+ public TriangularMovingAverageFormulaInfo(int period, bool startFromFirst)
+ : base(
+ new DataField[] { DataField.Y }, //Input fields
+ new DataField[] { DataField.Y }, //Output fields
+ period, startFromFirst)
+ {
+ }
+ }
+
+ /// <summary>
+ /// TripleExponentialMovingAverage FormulaInfo
+ /// </summary>
+ internal class TripleExponentialMovingAverageFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="TripleExponentialMovingAverageFormulaInfo"/> class.
+ /// </summary>
+ public TripleExponentialMovingAverageFormulaInfo()
+ : this(12) //Defaults
+ {
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="TripleExponentialMovingAverageFormulaInfo"/> class.
+ /// </summary>
+ /// <param name="period">The period.</param>
+ public TripleExponentialMovingAverageFormulaInfo(int period)
+ : base(
+ new DataField[] { DataField.Y }, //Input fields
+ new DataField[] { DataField.Y }, //Output fields
+ period)
+ {
+ }
+ }
+
+ /// <summary>
+ /// BollingerBands FormulaInfo
+ /// </summary>
+ internal class BollingerBandsFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="BollingerBandsFormulaInfo"/> class.
+ /// </summary>
+ public BollingerBandsFormulaInfo()
+ : this(3, 2, true) //Defaults
+ {
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="BollingerBandsFormulaInfo"/> class.
+ /// </summary>
+ /// <param name="period">The period.</param>
+ /// <param name="deviation">The deviation.</param>
+ /// <param name="startFromFirst">if set to <c>true</c> [start from first].</param>
+ public BollingerBandsFormulaInfo(int period, double deviation, bool startFromFirst)
+ : base(
+ new DataField[] { DataField.Y }, //Input fields
+ new DataField[] { DataField.Top, DataField.Bottom }, //Output fields
+ period, deviation, startFromFirst)
+ {
+ }
+ }
+
+ /// <summary>
+ /// TypicalPrice FormulaInfo
+ /// </summary>
+ internal class TypicalPriceFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="TypicalPriceFormulaInfo"/> class.
+ /// </summary>
+ public TypicalPriceFormulaInfo()
+ : base(
+ new DataField[] { DataField.Close, DataField.High, DataField.Low }, //Input fields
+ new DataField[] { DataField.Y }) //Output fields
+ {
+ }
+ }
+
+ /// <summary>
+ /// WeightedClose FormulaInfo
+ /// </summary>
+ internal class WeightedCloseFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="WeightedCloseFormulaInfo"/> class.
+ /// </summary>
+ public WeightedCloseFormulaInfo()
+ : base(
+ new DataField[] { DataField.Close, DataField.High, DataField.Low }, //Input fields
+ new DataField[] { DataField.Y }) //Output fields
+ {
+ }
+ }
+
+ /// <summary>
+ /// MedianPrice FormulaInfo
+ /// </summary>
+ internal class MedianPriceFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MedianPriceFormulaInfo"/> class.
+ /// </summary>
+ public MedianPriceFormulaInfo()
+ : base(
+ new DataField[] { DataField.High, DataField.Low }, //Input fields
+ new DataField[] { DataField.Y }) //Output fields
+ {
+ }
+ }
+
+
+ /// <summary>
+ /// Envelopes FormulaInfo
+ /// </summary>
+ internal class EnvelopesFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="EnvelopesFormulaInfo"/> class.
+ /// </summary>
+ public EnvelopesFormulaInfo()
+ : this(2, 10, true) //Defaults
+ {
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="EnvelopesFormulaInfo"/> class.
+ /// </summary>
+ /// <param name="period">The period.</param>
+ /// <param name="shiftPercentage">The shift percentage.</param>
+ /// <param name="startFromFirst">if set to <c>true</c> [start from first].</param>
+ public EnvelopesFormulaInfo(int period, double shiftPercentage, bool startFromFirst)
+ : base(
+ new DataField[] { DataField.Y }, //Input fields
+ new DataField[] { DataField.Top, DataField.Bottom }, //Output fields
+ period, shiftPercentage, startFromFirst)
+ {
+ }
+ }
+
+
+ /// <summary>
+ /// StandardDeviation FormulaInfo
+ /// </summary>
+ internal class StandardDeviationFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="StandardDeviationFormulaInfo"/> class.
+ /// </summary>
+ public StandardDeviationFormulaInfo()
+ : this(2, false) //Defaults
+ {
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="StandardDeviationFormulaInfo"/> class.
+ /// </summary>
+ /// <param name="period">The period.</param>
+ /// <param name="startFromFirst">if set to <c>true</c> [start from first].</param>
+ public StandardDeviationFormulaInfo(int period, bool startFromFirst)
+ : base(
+ new DataField[] { DataField.Y }, //Input fields
+ new DataField[] { DataField.Y }, //Output fields
+ period, startFromFirst)
+ {
+ }
+ }
+
+ /// <summary>
+ /// ChaikinOscillatorFormulaInfo
+ /// </summary>
+ internal class ChaikinOscillatorFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ChaikinOscillatorFormulaInfo"/> class.
+ /// </summary>
+ public ChaikinOscillatorFormulaInfo()
+ : this(3, 10, false) //Defaults
+ {
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ChaikinOscillatorFormulaInfo"/> class.
+ /// </summary>
+ /// <param name="shortPeriod">The short period.</param>
+ /// <param name="longPeriod">The long period.</param>
+ /// <param name="startFromFirst">if set to <c>true</c> [start from first].</param>
+ public ChaikinOscillatorFormulaInfo(int shortPeriod, int longPeriod, bool startFromFirst)
+ : base(
+ new DataField[] { DataField.High, DataField.Low, DataField.Close, DataField.Y }, //Input fields
+ new DataField[] { DataField.Y }, //Output fields
+ shortPeriod, longPeriod, startFromFirst)
+ {
+ }
+ }
+
+ /// <summary>
+ /// DetrendedPriceOscillator FormulaInfo
+ /// </summary>
+ internal class DetrendedPriceOscillatorFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="DetrendedPriceOscillatorFormulaInfo"/> class.
+ /// </summary>
+ public DetrendedPriceOscillatorFormulaInfo()
+ : this(2, false) //Defaults
+ {
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="DetrendedPriceOscillatorFormulaInfo"/> class.
+ /// </summary>
+ /// <param name="period">The period.</param>
+ /// <param name="startFromFirst">if set to <c>true</c> [start from first].</param>
+ public DetrendedPriceOscillatorFormulaInfo(int period, bool startFromFirst)
+ : base(
+ new DataField[] { DataField.Y }, //Input fields
+ new DataField[] { DataField.Y }, //Output fields
+ period, startFromFirst)
+ {
+ }
+ }
+
+
+ /// <summary>
+ /// VolatilityChaikins FormulaInfo
+ /// </summary>
+ internal class VolatilityChaikinsFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="VolatilityChaikinsFormulaInfo"/> class.
+ /// </summary>
+ public VolatilityChaikinsFormulaInfo()
+ : this(10, 10) //Defaults
+ {
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="VolatilityChaikinsFormulaInfo"/> class.
+ /// </summary>
+ /// <param name="period">The period.</param>
+ /// <param name="signalPeriod">The signal period.</param>
+ public VolatilityChaikinsFormulaInfo(int period, int signalPeriod)
+ : base(
+ new DataField[] { DataField.High, DataField.Low }, //Input fields
+ new DataField[] { DataField.Y }, //Output fields
+ period, signalPeriod)
+ {
+ }
+ }
+
+ /// <summary>
+ /// VolumeOscillator FormulaInfo
+ /// </summary>
+ internal class VolumeOscillatorFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="VolumeOscillatorFormulaInfo"/> class.
+ /// </summary>
+ public VolumeOscillatorFormulaInfo()
+ : this(5, 10, true) //Defaults
+ {
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="VolumeOscillatorFormulaInfo"/> class.
+ /// </summary>
+ /// <param name="shortPeriod">The short period.</param>
+ /// <param name="longPeriod">The long period.</param>
+ /// <param name="percentage">if set to <c>true</c> [percentage].</param>
+ public VolumeOscillatorFormulaInfo(int shortPeriod, int longPeriod, bool percentage)
+ : base(
+ new DataField[] { DataField.Y }, //Input fields
+ new DataField[] { DataField.Y }, //Output fields
+ shortPeriod, longPeriod, percentage)
+ {
+ }
+ }
+
+ /// <summary>
+ /// StochasticIndicatorFormulaInfo
+ /// </summary>
+ internal class StochasticIndicatorFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="StochasticIndicatorFormulaInfo"/> class.
+ /// </summary>
+ public StochasticIndicatorFormulaInfo()
+ : this(10, 10) //Defaults
+ {
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="StochasticIndicatorFormulaInfo"/> class.
+ /// </summary>
+ /// <param name="periodD">The period D.</param>
+ /// <param name="periodK">The period K.</param>
+ public StochasticIndicatorFormulaInfo(int periodD, int periodK)
+ : base(
+ new DataField[] { DataField.High, DataField.Low, DataField.Close }, //Input fields
+ new DataField[] { DataField.Y, DataField.Y }, //Output fields
+ periodD, periodK)
+ {
+ }
+ }
+
+ /// <summary>
+ /// WilliamsRFormulaInfo
+ /// </summary>
+ internal class WilliamsRFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="WilliamsRFormulaInfo"/> class.
+ /// </summary>
+ public WilliamsRFormulaInfo()
+ : this(14) //Defaults
+ {
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="WilliamsRFormulaInfo"/> class.
+ /// </summary>
+ /// <param name="period">The period.</param>
+ public WilliamsRFormulaInfo(int period)
+ : base(
+ new DataField[] { DataField.High, DataField.Low, DataField.Close }, //Input fields
+ new DataField[] { DataField.Y }, //Output fields
+ period)
+ {
+ }
+ }
+
+ /// <summary>
+ /// AverageTrueRange FormulaInfo
+ /// </summary>
+ internal class AverageTrueRangeFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="AverageTrueRangeFormulaInfo"/> class.
+ /// </summary>
+ public AverageTrueRangeFormulaInfo()
+ : this(14) //Defaults
+ {
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="AverageTrueRangeFormulaInfo"/> class.
+ /// </summary>
+ /// <param name="period">The period.</param>
+ public AverageTrueRangeFormulaInfo(int period)
+ : base(
+ new DataField[] { DataField.High, DataField.Low, DataField.Close }, //Input fields
+ new DataField[] { DataField.Y }, //Output fields
+ period)
+ {
+ }
+ }
+
+ /// <summary>
+ /// EaseOfMovement FormulaInfo
+ /// </summary>
+ internal class EaseOfMovementFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="EaseOfMovementFormulaInfo"/> class.
+ /// </summary>
+ public EaseOfMovementFormulaInfo()
+ : base(
+ new DataField[] { DataField.High, DataField.Low, DataField.Close }, //Input fields
+ new DataField[] { DataField.Y }) //Output fields
+ {
+ }
+ }
+
+ /// <summary>
+ /// MassIndex FormulaInfo
+ /// </summary>
+ internal class MassIndexFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MassIndexFormulaInfo"/> class.
+ /// </summary>
+ public MassIndexFormulaInfo()
+ : this(25, 9) //Defaults
+ {
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MassIndexFormulaInfo"/> class.
+ /// </summary>
+ /// <param name="period">The period.</param>
+ /// <param name="averagePeriod">The average period.</param>
+ public MassIndexFormulaInfo(int period, int averagePeriod)
+ : base(
+ new DataField[] { DataField.High, DataField.Low }, //Input fields
+ new DataField[] { DataField.Y }, //Output fields
+ period, averagePeriod)
+ {
+ }
+ }
+
+ /// <summary>
+ /// Performance FormulaInfo
+ /// </summary>
+ internal class PerformanceFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="PerformanceFormulaInfo"/> class.
+ /// </summary>
+ public PerformanceFormulaInfo()
+ : base(
+ new DataField[] { DataField.Close }, //Input fields
+ new DataField[] { DataField.Y }) //Output fields
+ {
+ }
+ }
+
+ /// <summary>
+ /// RateOfChange FormulaInfo
+ /// </summary>
+ internal class RateOfChangeFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="RateOfChangeFormulaInfo"/> class.
+ /// </summary>
+ public RateOfChangeFormulaInfo()
+ : this(10) //Defaults
+ {
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="RateOfChangeFormulaInfo"/> class.
+ /// </summary>
+ /// <param name="period">The period.</param>
+ public RateOfChangeFormulaInfo(int period)
+ : base(
+ new DataField[] { DataField.Close }, //Input fields
+ new DataField[] { DataField.Y }, //Output fields
+ period)
+ {
+ }
+ }
+
+ /// <summary>
+ /// RelativeStrengthIndex FormulaInfo
+ /// </summary>
+ internal class RelativeStrengthIndexFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="RelativeStrengthIndexFormulaInfo"/> class.
+ /// </summary>
+ public RelativeStrengthIndexFormulaInfo()
+ : this(10) //Defaults
+ {
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="RelativeStrengthIndexFormulaInfo"/> class.
+ /// </summary>
+ /// <param name="period">The period.</param>
+ public RelativeStrengthIndexFormulaInfo(int period)
+ : base(
+ new DataField[] { DataField.Close }, //Input fields
+ new DataField[] { DataField.Y }, //Output fields
+ period)
+ {
+ }
+ }
+
+ /// <summary>
+ /// MovingAverageConvergenceDivergence FormulaInfo
+ /// </summary>
+ internal class MovingAverageConvergenceDivergenceFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MovingAverageConvergenceDivergenceFormulaInfo"/> class.
+ /// </summary>
+ public MovingAverageConvergenceDivergenceFormulaInfo()
+ : this(12, 26) //Defaults
+ {
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MovingAverageConvergenceDivergenceFormulaInfo"/> class.
+ /// </summary>
+ /// <param name="shortPeriod">The short period.</param>
+ /// <param name="longPeriod">The long period.</param>
+ public MovingAverageConvergenceDivergenceFormulaInfo(int shortPeriod, int longPeriod)
+ : base(
+ new DataField[] { DataField.Close }, //Input fields
+ new DataField[] { DataField.Y }, //Output fields
+ shortPeriod, longPeriod)
+ {
+ }
+ }
+
+ /// <summary>
+ /// CommodityChannelIndex FormulaInfo
+ /// </summary>
+ internal class CommodityChannelIndexFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="CommodityChannelIndexFormulaInfo"/> class.
+ /// </summary>
+ public CommodityChannelIndexFormulaInfo()
+ : this(10) //Defaults
+ {
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="CommodityChannelIndexFormulaInfo"/> class.
+ /// </summary>
+ /// <param name="period">The period.</param>
+ public CommodityChannelIndexFormulaInfo(int period)
+ : base(
+ new DataField[] { DataField.High, DataField.Low, DataField.Close }, //Input fields
+ new DataField[] { DataField.Y }, //Output fields
+ period)
+ {
+ }
+ }
+
+ /// <summary>
+ /// Forecasting FormulaInfo
+ /// </summary>
+ internal class ForecastingFormulaInfo : FormulaInfo
+ {
+ //Fields
+ string _parameters;
+
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ForecastingFormulaInfo"/> class.
+ /// </summary>
+ public ForecastingFormulaInfo()
+ : this(TimeSeriesAndForecasting.RegressionType.Polynomial, 2, 0, true, true) //Defaults
+ {
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ForecastingFormulaInfo"/> class.
+ /// </summary>
+ /// <param name="regressionType">Type of the regression.</param>
+ /// <param name="polynomialDegree">The polynomial degree.</param>
+ /// <param name="forecastingPeriod">The forecasting period.</param>
+ /// <param name="returnApproximationError">if set to <c>true</c> [return approximation error].</param>
+ /// <param name="returnForecastingError">if set to <c>true</c> [return forecasting error].</param>
+ public ForecastingFormulaInfo(TimeSeriesAndForecasting.RegressionType regressionType, int polynomialDegree, int forecastingPeriod, bool returnApproximationError, bool returnForecastingError)
+ : base(
+ new DataField[] { DataField.Close }, //Input fields
+ new DataField[] { DataField.Close, DataField.High, DataField.Low }, //Output fields
+ regressionType, polynomialDegree, forecastingPeriod, returnApproximationError, returnForecastingError)
+ {
+ }
+
+ //Methods
+ /// <summary>
+ /// Loads the formula parameters from string.
+ /// </summary>
+ /// <param name="parameters">Csv string with parameters.</param>
+ internal override void LoadParametersFromString(string parameters)
+ {
+ _parameters = parameters;
+ }
+
+ /// <summary>
+ /// Checks the formula parameter string.
+ /// </summary>
+ /// <param name="parameters">The parameters.</param>
+ internal override void CheckParameterString(string parameters)
+ {
+ if (String.IsNullOrEmpty(parameters))
+ return;
+
+ string[] paramStringList = parameters.Split(',');
+ int paramStringIndex = 1;
+ //Don't check the first param
+ for (int i = 2; i < Parameters.Length && paramStringIndex < paramStringList.Length; i++)
+ {
+ string newParamValue = paramStringList[paramStringIndex++];
+ if (!String.IsNullOrEmpty(newParamValue))
+ {
+ try
+ {
+ ParseParameter(i, newParamValue);
+ }
+ catch (FormatException)
+ {
+ throw new ArgumentException(SR.ExceptionFormulaDataFormatInvalid(parameters));
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Saves the formula parameters to a string.
+ /// </summary>
+ /// <returns>Csv string with parameters</returns>
+ internal override string SaveParametersToString()
+ {
+ if (String.IsNullOrEmpty(_parameters))
+ return _parameters;
+ else
+ return "2,0,true,true";
+ }
+ }
+
+ /// <summary>
+ /// MoneyFlow FormulaInfo
+ /// </summary>
+ internal class MoneyFlowFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MoneyFlowFormulaInfo"/> class.
+ /// </summary>
+ public MoneyFlowFormulaInfo()
+ : this(2) //Defaults
+ {
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MoneyFlowFormulaInfo"/> class.
+ /// </summary>
+ /// <param name="period">The period.</param>
+ public MoneyFlowFormulaInfo(int period)
+ : base(
+ new DataField[] { DataField.High, DataField.Low, DataField.Close, DataField.Y }, //Input fields: High,Low,Close,Volume
+ new DataField[] { DataField.Y }, //Output fields
+ period)
+ {
+ }
+ }
+
+ /// <summary>
+ /// PriceVolumeTrend FormulaInfo
+ /// </summary>
+ internal class PriceVolumeTrendFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="PriceVolumeTrendFormulaInfo"/> class.
+ /// </summary>
+ public PriceVolumeTrendFormulaInfo()
+ : base(
+ new DataField[] { DataField.Close, DataField.Y }, //Input=Close,Volume
+ new DataField[] { DataField.Y }) //Output fields
+ {
+ }
+ }
+
+ /// <summary>
+ /// OnBalanceVolume FormulaInfo
+ /// </summary>
+ internal class OnBalanceVolumeFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="OnBalanceVolumeFormulaInfo"/> class.
+ /// </summary>
+ public OnBalanceVolumeFormulaInfo()
+ : base(
+ new DataField[] { DataField.Close, DataField.Y }, //Input=Close,Volume
+ new DataField[] { DataField.Y }) //Output fields
+ {
+ }
+ }
+
+ /// <summary>
+ /// NegativeVolumeIndex FormulaInfo
+ /// </summary>
+ internal class NegativeVolumeIndexFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="NegativeVolumeIndexFormulaInfo"/> class.
+ /// </summary>
+ public NegativeVolumeIndexFormulaInfo() //Note about parameters: Start value is mandatory so we don't provide the default
+ : this(double.NaN)
+ {
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="NegativeVolumeIndexFormulaInfo"/> class.
+ /// </summary>
+ /// <param name="startValue">The start value.</param>
+ public NegativeVolumeIndexFormulaInfo(double startValue)
+ : base(
+ new DataField[] { DataField.Close, DataField.Y }, //Input=Close,Volume
+ new DataField[] { DataField.Y },
+ startValue) //Output fields
+ {
+ }
+ }
+
+ /// <summary>
+ /// PositiveVolumeIndex FormulaInfo
+ /// </summary>
+ internal class PositiveVolumeIndexFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="PositiveVolumeIndexFormulaInfo"/> class.
+ /// </summary>
+ public PositiveVolumeIndexFormulaInfo() //Note about parameters: Start value is mandatory so we don't provide the default
+ : this(double.NaN)
+ {
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="PositiveVolumeIndexFormulaInfo"/> class.
+ /// </summary>
+ /// <param name="startValue">The start value.</param>
+ public PositiveVolumeIndexFormulaInfo(double startValue)
+ : base(
+ new DataField[] { DataField.Close, DataField.Y }, //Input=Close,Volume
+ new DataField[] { DataField.Y },
+ startValue) //Output fields
+ {
+ }
+ }
+
+ /// <summary>
+ /// AccumulationDistribution FormulaInfo
+ /// </summary>
+ internal class AccumulationDistributionFormulaInfo : FormulaInfo
+ {
+ //Constructor
+ /// <summary>
+ /// Initializes a new instance of the <see cref="AccumulationDistributionFormulaInfo"/> class.
+ /// </summary>
+ public AccumulationDistributionFormulaInfo() //Note about parameters: Start value is mandatory so we don't provide the default
+ : base(
+ new DataField[] { DataField.High, DataField.Low, DataField.Close, DataField.Y }, //Input=High, Low, Close, Volume
+ new DataField[] { DataField.Y }) //Output fields
+ {
+ }
+ }
+
+ #endregion
+
+ #region enum DataField
+ /// <summary>
+ /// Chart data fields
+ /// </summary>
+ internal enum DataField
+ {
+ X,
+ Y,
+ LowerWisker,
+ UpperWisker,
+ LowerBox,
+ UpperBox,
+ Average,
+ Median,
+ Bubble,
+ BubbleSize,
+ High,
+ Low,
+ Open,
+ Close,
+ Center,
+ LowerError,
+ UpperError,
+ Top,
+ Bottom
+ }
+ #endregion
+
+ #region class SeriesFieldInfo
+ /// <summary>
+ /// SeriesFieldInfo class is a OO representation formula input/output data params ("Series1:Y2")
+ /// </summary>
+ internal class SeriesFieldInfo
+ {
+ #region Fields
+ private Series _series;
+ private string _seriesName;
+ private DataField _dataField;
+ #endregion
+
+ #region Properties
+ /// <summary>
+ /// Gets the series.
+ /// </summary>
+ /// <value>The series.</value>
+ public Series Series
+ {
+ get { return _series; }
+ }
+ /// <summary>
+ /// Gets the name of the series.
+ /// </summary>
+ /// <value>The name of the series.</value>
+ public string SeriesName
+ {
+ get { return _series != null ? _series.Name : _seriesName; }
+ }
+ /// <summary>
+ /// Gets the data field.
+ /// </summary>
+ /// <value>The data field.</value>
+ public DataField DataField
+ {
+ get { return _dataField; }
+ }
+ #endregion
+
+ #region Constructors
+ /// <summary>
+ /// Initializes a new instance of the <see cref="SeriesFieldInfo"/> class.
+ /// </summary>
+ /// <param name="series">The series.</param>
+ /// <param name="dataField">The data field.</param>
+ public SeriesFieldInfo(Series series, DataField dataField)
+ {
+ _series = series;
+ _dataField = dataField;
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="SeriesFieldInfo"/> class.
+ /// </summary>
+ /// <param name="seriesName">Name of the series.</param>
+ /// <param name="dataField">The data field.</param>
+ public SeriesFieldInfo(string seriesName, DataField dataField)
+ {
+ _seriesName = seriesName;
+ _dataField = dataField;
+ }
+ #endregion
+ }
+ #endregion
+
+ #region class SeriesFieldList
+ /// <summary>
+ /// SeriesFieldInfo class is a OO representation formula input/output data params ("Series1:Y2,Series2.Y4")
+ /// </summary>
+ internal class SeriesFieldList : List<SeriesFieldInfo>
+ {
+ /// <summary>
+ /// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
+ /// </summary>
+ /// <returns>
+ /// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
+ /// </returns>
+ public override string ToString()
+ {
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < this.Count; i++)
+ {
+ SeriesFieldInfo info = this[i];
+
+ if (i > 0)
+ sb.Append(',');
+
+ SeriesChartType seriesChartType = info.Series != null ?
+ info.Series.ChartType :
+ FormulaHelper.GetDefaultChartType(info.DataField);
+
+ IList<DataField> dataFields = FormulaHelper.GetDataFields(seriesChartType);
+
+ int dataFieldIndex = dataFields.IndexOf(info.DataField);
+ if (dataFieldIndex == 0)
+ sb.AppendFormat(CultureInfo.InvariantCulture, "{0}:Y", info.SeriesName); //The string field descriptor is 1 based ;-(
+ else
+ sb.AppendFormat(CultureInfo.InvariantCulture, "{0}:Y{1}", info.SeriesName, dataFieldIndex + 1); //The string field descriptor is 1 based ;-(
+ }
+ return sb.ToString();
+ }
+
+ //Static
+ /// <summary>
+ /// Parse the string defining the formula's input/output series and fields.
+ /// </summary>
+ /// <param name="chart">The chart.</param>
+ /// <param name="seriesFields">The series fields list. The series name can be followed by the field names. For example: "Series1:Y,Series1:Y3,Series2:Close"</param>
+ /// <param name="formulaFields">The formula fields list.</param>
+ /// <returns></returns>
+ public static SeriesFieldList FromString(Chart chart, string seriesFields, IList<DataField> formulaFields)
+ {
+ SeriesFieldList result = new SeriesFieldList();
+ if (String.IsNullOrEmpty(seriesFields))
+ {
+ return result;
+ }
+
+ List<DataField> unmappedFormulaFields = new List<DataField>(formulaFields);
+
+ //Loop through the series/field pairs
+ foreach (string seriesField in seriesFields.Split(','))
+ {
+ //Stop processing if all the formula fields are mapped
+ if (unmappedFormulaFields.Count == 0)
+ break;
+
+ //Split a pair into a series + field
+ string[] seriesFieldParts = seriesField.Split(':');
+ if (seriesFieldParts.Length > 2)
+ {
+ throw new ArgumentException(SR.ExceptionFormulaDataFormatInvalid(seriesField));
+ }
+
+ //Get the series and series fields
+ string seriesName = seriesFieldParts[0].Trim();
+ Series series = chart.Series.FindByName(seriesName);
+ if (series != null)
+ {
+ switch (seriesFieldParts.Length)
+ {
+ case 1: //Only series name is specified: "Series1"
+ AddSeriesFieldInfo(result, series, unmappedFormulaFields);
+ break;
+ case 2: //Series and field names are provided: "Series1:Y3"
+ AddSeriesFieldInfo(result, series, unmappedFormulaFields, seriesFieldParts[1]);
+ break;
+ }
+ }
+ else
+ {
+ switch (seriesFieldParts.Length)
+ {
+ case 1: //Only series name is specified: "Series1"
+ AddSeriesFieldInfo(result, seriesName, unmappedFormulaFields);
+ break;
+ case 2: //Series and field names are provided: "Series1:Y3"
+ AddSeriesFieldInfo(result, seriesName, unmappedFormulaFields, seriesFieldParts[1]);
+ break;
+ }
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// Adds the series field info.
+ /// </summary>
+ /// <param name="result">The result.</param>
+ /// <param name="series">The series.</param>
+ /// <param name="unmappedFormulaFields">The unmapped formula fields.</param>
+ private static void AddSeriesFieldInfo(SeriesFieldList result, Series series, IList<DataField> unmappedFormulaFields)
+ {
+ List<DataField> seriesFields = new List<DataField>(FormulaHelper.GetDataFields(series.ChartType));
+
+ for (int i = 0; i < unmappedFormulaFields.Count && seriesFields.Count > 0; )
+ {
+ DataField formulaField = unmappedFormulaFields[i];
+ DataField? seriesField = null;
+
+ // Case 1. Check if the formulaField is valid for this chart type
+ if (seriesFields.Contains(formulaField))
+ {
+ seriesField = formulaField;
+ }
+ // Case 2. Try to map the formula field to the series field
+ if (seriesField == null)
+ {
+ seriesField = FormulaHelper.MapFormulaDataField(series.ChartType, formulaField);
+ }
+
+ // If the seriesField is found - add it to the results
+ if (seriesField != null)
+ {
+ result.Add(new SeriesFieldInfo(series, (DataField)seriesField));
+ seriesFields.Remove((DataField)formulaField);
+ unmappedFormulaFields.Remove(formulaField);
+ }
+ else
+ {
+ i++;
+ }
+ }
+ }
+ /// <summary>
+ /// Adds the series field info.
+ /// </summary>
+ /// <param name="result">The result.</param>
+ /// <param name="series">The series.</param>
+ /// <param name="unmappedFormulaFields">The unmapped formula fields.</param>
+ /// <param name="seriesFieldId">The series field id.</param>
+ private static void AddSeriesFieldInfo(SeriesFieldList result, Series series, IList<DataField> unmappedFormulaFields, string seriesFieldId)
+ {
+ IList<DataField> seriesFields = FormulaHelper.GetDataFields(series.ChartType);
+
+ DataField? seriesField = null;
+
+ seriesFieldId = seriesFieldId.ToUpperInvariant().Trim();
+ if (seriesFieldId == "Y")
+ {
+ seriesField = seriesFields[0];
+ }
+ else if (seriesFieldId.StartsWith("Y", StringComparison.Ordinal))
+ {
+ int id = 0;
+ if (int.TryParse(seriesFieldId.Substring(1), out id))
+ if (id - 1 < seriesFields.Count)
+ {
+ seriesField = seriesFields[id - 1];
+ }
+ else
+ {
+ throw (new ArgumentException(SR.ExceptionFormulaYIndexInvalid, seriesFieldId));
+ }
+ }
+ else
+ {
+ seriesField = (DataField)Enum.Parse(typeof(DataField), seriesFieldId, true);
+ }
+
+ // Add the seriesField to the results
+ if (seriesField != null)
+ {
+ result.Add(new SeriesFieldInfo(series, (DataField)seriesField));
+ if (unmappedFormulaFields.Contains((DataField)seriesField))
+ unmappedFormulaFields.Remove((DataField)seriesField);
+ else
+ unmappedFormulaFields.RemoveAt(0);
+ }
+ else
+ {
+ throw new ArgumentException(SR.ExceptionDataPointValueNameInvalid, seriesFieldId);
+ }
+
+ }
+
+ /// <summary>
+ /// Adds the series field info.
+ /// </summary>
+ /// <param name="result">The result.</param>
+ /// <param name="seriesName">Name of the series.</param>
+ /// <param name="unmappedFormulaFields">The unmapped formula fields.</param>
+ private static void AddSeriesFieldInfo(SeriesFieldList result, string seriesName, IList<DataField> unmappedFormulaFields)
+ {
+ SeriesChartType chartType = FormulaHelper.GetDefaultChartType(unmappedFormulaFields[0]);
+ List<DataField> seriesFields = new List<DataField>(FormulaHelper.GetDataFields(chartType));
+
+ for (int i = 0; i < unmappedFormulaFields.Count && seriesFields.Count > 0; )
+ {
+ DataField formulaField = unmappedFormulaFields[i];
+ DataField? seriesField = null;
+
+ // Check if the formulaField is valid for this chart type
+ if (seriesFields.Contains(formulaField))
+ {
+ seriesField = formulaField;
+ }
+
+ // If the seriesField is found - add it to the results
+ if (seriesField != null)
+ {
+ result.Add(new SeriesFieldInfo(seriesName, (DataField)seriesField));
+ seriesFields.Remove((DataField)formulaField);
+ unmappedFormulaFields.Remove(formulaField);
+ }
+ else
+ {
+ i++;
+ }
+ }
+ }
+ /// <summary>
+ /// Adds the series field info.
+ /// </summary>
+ /// <param name="result">The result.</param>
+ /// <param name="seriesName">Name of the series.</param>
+ /// <param name="unmappedFormulaFields">The unmapped formula fields.</param>
+ /// <param name="seriesFieldId">The series field id.</param>
+ private static void AddSeriesFieldInfo(SeriesFieldList result, string seriesName, IList<DataField> unmappedFormulaFields, string seriesFieldId)
+ {
+ SeriesChartType chartType = FormulaHelper.GetDefaultChartType(unmappedFormulaFields[0]);
+ IList<DataField> seriesFields = FormulaHelper.GetDataFields(chartType);
+
+ //Find the field
+ DataField? seriesField = null;
+
+ seriesFieldId = seriesFieldId.ToUpperInvariant().Trim();
+
+ if (seriesFieldId == "Y")
+ {
+ seriesField = seriesFields[0];
+ }
+ else if (seriesFieldId.StartsWith("Y", StringComparison.Ordinal))
+ {
+ int seriesFieldIndex = 0;
+ if (int.TryParse(seriesFieldId.Substring(1), out seriesFieldIndex))
+ if (seriesFieldIndex < seriesFields.Count)
+ {
+ seriesField = seriesFields[seriesFieldIndex - 1];
+ }
+ else
+ {
+ throw (new ArgumentException(SR.ExceptionFormulaYIndexInvalid, seriesFieldId));
+ }
+ }
+ else
+ {
+ //Try parse the field name
+ try
+ {
+ seriesField = (DataField)Enum.Parse(typeof(DataField), seriesFieldId, true);
+ }
+ catch (ArgumentException)
+ { }
+ }
+
+ if (seriesField != null)
+ {
+ result.Add(new SeriesFieldInfo(seriesName, (DataField)seriesField));
+ unmappedFormulaFields.Remove((DataField)seriesField);
+ }
+ else
+ {
+ throw new ArgumentException(SR.ExceptionDataPointValueNameInvalid, seriesFieldId);
+ }
+ }
+ }
+ #endregion
+
+}
+
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/FormulaRegistry.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/FormulaRegistry.cs
new file mode 100644
index 00000000000..c220c3795ff
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/FormulaRegistry.cs
@@ -0,0 +1,201 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: FormulaRegistry.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting.Formulas
+//
+// Classes: FormulaRegistry
+//
+// Purpose: Keep track of all registered formula module types.
+//
+// Reviewed: GS - August 6, 2002
+// AG - August 7, 2002
+//
+//===================================================================
+
+
+#region Used namespace
+
+using System;
+using System.Collections;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+
+#endregion
+
+
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.Formulas
+#else
+ namespace System.Web.UI.DataVisualization.Charting.Formulas
+#endif
+{
+ /// <summary>
+ /// Keep track of all registered formula modules types.
+ /// </summary>
+ internal class FormulaRegistry : IServiceProvider
+ {
+ #region Fields
+
+ // Storage for all registered formula modules
+ internal Hashtable registeredModules = new Hashtable(StringComparer.OrdinalIgnoreCase);
+ private Hashtable _createdModules = new Hashtable(StringComparer.OrdinalIgnoreCase);
+ private ArrayList _modulesNames = new ArrayList();
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Formula Registry public constructor
+ /// </summary>
+ public FormulaRegistry()
+ {
+ }
+
+ /// <summary>
+ /// Adds modules into the registry.
+ /// </summary>
+ /// <param name="name">Module name.</param>
+ /// <param name="moduleType">Module class type.</param>
+ public void Register(string name, Type moduleType)
+ {
+ // First check if module with specified name already registered
+ if(registeredModules.Contains(name))
+ {
+ // If same type provided - ignore
+ if(registeredModules[name].GetType() == moduleType)
+ {
+ return;
+ }
+
+ // Error - throw exception
+ throw( new ArgumentException( SR.ExceptionFormulaModuleNameIsNotUnique( name ) ) );
+ }
+
+ // Add Module Name
+ _modulesNames.Add(name);
+
+ // Make sure that specified class support IFormula interface
+ bool found = false;
+ Type[] interfaces = moduleType.GetInterfaces();
+ foreach(Type type in interfaces)
+ {
+ if(type == typeof(IFormula))
+ {
+ found = true;
+ break;
+ }
+ }
+ if(!found)
+ {
+ throw( new ArgumentException( SR.ExceptionFormulaModuleHasNoInterface));
+ }
+
+ // Add formula module to the hash table
+ registeredModules[name] = moduleType;
+ }
+
+ /// <summary>
+ /// Returns formula module registry service object.
+ /// </summary>
+ /// <param name="serviceType">Service AxisName.</param>
+ /// <returns>Service object.</returns>
+ [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+ object IServiceProvider.GetService(Type serviceType)
+ {
+ if(serviceType == typeof(FormulaRegistry))
+ {
+ return this;
+ }
+ throw (new ArgumentException( SR.ExceptionFormulaModuleRegistryUnsupportedType( serviceType.ToString())));
+ }
+
+ /// <summary>
+ /// Returns formula module object by name.
+ /// </summary>
+ /// <param name="name">Formula Module name.</param>
+ /// <returns>Formula module object derived from IFormula.</returns>
+ public IFormula GetFormulaModule(string name)
+ {
+ // First check if formula module with specified name registered
+ if(!registeredModules.Contains(name))
+ {
+ throw( new ArgumentException( SR.ExceptionFormulaModuleNameUnknown( name ) ) );
+ }
+
+ // Check if the formula module object is already created
+ if(!_createdModules.Contains(name))
+ {
+ // Create formula module object
+ _createdModules[name] =
+ ((Type)registeredModules[name]).Assembly.
+ CreateInstance(((Type)registeredModules[name]).ToString());
+ }
+
+ return (IFormula)_createdModules[name];
+ }
+
+ /// <summary>
+ /// Returns the name of the module.
+ /// </summary>
+ /// <param name="index">Module index.</param>
+ /// <returns>Module Name.</returns>
+ public string GetModuleName( int index )
+ {
+ return (string)_modulesNames[index];
+ }
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Return the number of registered modules.
+ /// </summary>
+ public int Count
+ {
+ get
+ {
+ return _modulesNames.Count;
+ }
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Interface which defines the set of standard methods and
+ /// properties for each formula module
+ /// </summary>
+ internal interface IFormula
+ {
+ #region IFormula Properties and Methods
+
+ /// <summary>
+ /// Formula Module name
+ /// </summary>
+ string Name { get; }
+
+ /// <summary>
+ /// The first method in the module, which converts a formula
+ /// name to the corresponding private method.
+ /// </summary>
+ /// <param name="formulaName">String which represent a formula name</param>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Formula parameters</param>
+ /// <param name="extraParameterList">Array of strings - Extra Formula parameters from DataManipulator object</param>
+ /// <param name="outLabels">Array of strings - Used for Labels. Description for output results.</param>
+ void Formula(string formulaName, double [][] inputValues, out double [][] outputValues, string [] parameterList, string [] extraParameterList, out string [][] outLabels );
+
+ #endregion
+ }
+}
+
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/GeneralFormulas.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/GeneralFormulas.cs
new file mode 100644
index 00000000000..ac8cf448ba2
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/GeneralFormulas.cs
@@ -0,0 +1,193 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: GeneralFormulas.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting.Formulas
+//
+// Classes: GeneralFormulas
+//
+// Purpose: This class calculates Running total and average.
+// Could be used for Pareto chart.
+//
+// Reviewed: GS - August 6, 2002
+// AG - August 7, 2002
+//
+//===================================================================
+
+
+using System;
+
+
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.Formulas
+#else
+ namespace System.Web.UI.DataVisualization.Charting.Formulas
+#endif
+{
+ /// <summary>
+ /// This class calculates Running total and average.
+ /// Could be used for Pareto chart
+ /// </summary>
+ internal class GeneralFormulas : PriceIndicators
+ {
+ #region Properties
+
+ /// <summary>
+ /// Formula Module name
+ /// </summary>
+ override public string Name { get { return SR.FormulaNameGeneralFormulas; } }
+
+ #endregion
+
+ #region Formulas
+
+ /// <summary>
+ /// Formula which calculates cumulative total.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - Y values.
+ /// Output:
+ /// - Running Total.
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles: 1. row - X values, 2. row - Y values</param>
+ /// <param name="outputValues">Arrays of doubles: 1. row - X values, 2. row - Moving average</param>
+ private void RuningTotal(double [][] inputValues, out double [][] outputValues)
+ {
+ // There is not enough series
+ if( inputValues.Length != 2 )
+ {
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsFormulaRequiresOneArray);
+ }
+
+ // Different number of x and y values
+ CheckNumOfValues( inputValues, 1 );
+
+ outputValues = new double [2][];
+
+ outputValues[0] = new double [inputValues[0].Length];
+ outputValues[1] = new double [inputValues[1].Length];
+
+ // Cumulative total
+ for( int index = 0; index < inputValues[0].Length; index++ )
+ {
+ outputValues[0][index] = inputValues[0][index];
+
+ if( index > 0 )
+ {
+ outputValues[1][index] = inputValues[1][index] + outputValues[1][index-1];
+ }
+ else
+ {
+ outputValues[1][index] = inputValues[1][index];
+ }
+ }
+ }
+
+ /// <summary>
+ /// Running Average Formula
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - Y values.
+ /// Output:
+ /// - Running Average.
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles: 1. row - X values, 2. row - Y values</param>
+ /// <param name="outputValues">Arrays of doubles: 1. row - X values, 2. row - Moving average</param>
+ private void RunningAverage(double [][] inputValues, out double [][] outputValues)
+ {
+ // There is no enough series
+ if( inputValues.Length != 2 )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsFormulaRequiresOneArray);
+
+ // Different number of x and y values
+ CheckNumOfValues( inputValues, 1 );
+
+ outputValues = new double [2][];
+
+ outputValues[0] = new double [inputValues[0].Length];
+ outputValues[1] = new double [inputValues[1].Length];
+
+ // Total
+ double total = 0;
+ for( int index = 0; index < inputValues[0].Length; index++ )
+ {
+ total += inputValues[1][index];
+ }
+
+ // Runing Average
+ for( int index = 0; index < inputValues[0].Length; index++ )
+ {
+ outputValues[0][index] = inputValues[0][index];
+
+ if( index > 0 )
+ outputValues[1][index] = inputValues[1][index] / total * 100 + outputValues[1][index-1];
+ else
+ outputValues[1][index] = inputValues[1][index] / total * 100;
+ }
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Default constructor.
+ /// </summary>
+ public GeneralFormulas()
+ {
+ }
+
+ /// <summary>
+ /// The first method in the module, which converts a formula
+ /// name to the corresponding private method.
+ /// </summary>
+ /// <param name="formulaName">String which represent a formula name.</param>
+ /// <param name="inputValues">Arrays of doubles - Input values.</param>
+ /// <param name="outputValues">Arrays of doubles - Output values.</param>
+ /// <param name="parameterList">Array of strings - Formula parameters.</param>
+ /// <param name="extraParameterList">Array of strings - Extra Formula parameters from DataManipulator object.</param>
+ /// <param name="outLabels">Array of strings - Used for Labels. Description for output results.</param>
+ override public void Formula( string formulaName, double [][] inputValues, out double [][] outputValues, string [] parameterList, string [] extraParameterList, out string [][] outLabels )
+ {
+ string name;
+ outputValues = null;
+
+ // Not used for these formulas.
+ outLabels = null;
+
+ name = formulaName.ToUpper(System.Globalization.CultureInfo.InvariantCulture);
+
+ try
+ {
+ switch( name )
+ {
+ case "RUNINGTOTAL":
+ RuningTotal( inputValues, out outputValues );
+ break;
+ case "RUNINGAVERAGE":
+ RunningAverage( inputValues, out outputValues );
+ break;
+ default:
+ outputValues = null;
+ break;
+ }
+ }
+ catch( IndexOutOfRangeException )
+ {
+ throw new InvalidOperationException( SR.ExceptionFormulaInvalidPeriod(name) );
+ }
+ catch( OverflowException )
+ {
+ throw new InvalidOperationException( SR.ExceptionFormulaNotEnoughDataPoints(name) );
+ }
+ }
+ #endregion
+
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/Oscillator.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/Oscillator.cs
new file mode 100644
index 00000000000..8f90849d5a3
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/Oscillator.cs
@@ -0,0 +1,686 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: Oscillator.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting.Formulas
+//
+// Classes: Oscillators
+//
+// Purpose: This class is used to calculate oscillator
+// indicators used in Technical Analyses.
+//
+// Reviewed: GS - August 7, 2002
+// AG - August 7, 2002
+//
+//===================================================================
+
+
+using System;
+using System.Globalization;
+
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.Formulas
+#else
+ namespace System.Web.UI.DataVisualization.Charting.Formulas
+#endif
+{
+ /// <summary>
+ /// This class is used to calculate oscillator
+ /// indicators used in Technical Analyses.
+ /// </summary>
+ internal class Oscillators : PriceIndicators
+ {
+ #region Properties
+
+ /// <summary>
+ /// Formula Module name
+ /// </summary>
+ override public string Name { get{ return "Oscillators";}}
+
+ #endregion
+
+ #region Formulas
+
+ /// <summary>
+ /// The Chaikin Oscillator is created by subtracting a 10 period
+ /// exponential moving average of the Accumulation/Distribution
+ /// line from a 3 period moving average of the
+ /// Accumulation/Distribution Line.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 4 Y values ( Hi, Low, Close, Volume ).
+ /// Output:
+ /// - 1 Y value Chaikin Oscillator
+ /// Parameters:
+ /// - Short Period for Exponential Moving average (default=3)
+ /// - Int64 Period for Exponential Moving average (default=10)
+ /// Extra Parameters:
+ /// - Start from First
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ /// <param name="extraParameterList">Array of strings - Extra parameters</param>
+ private void ChaikinOscillator(double [][] inputValues, out double [][] outputValues, string [] parameterList, string [] extraParameterList)
+ {
+ // There is no enough input series
+ if( inputValues.Length != 5 )
+ {
+ throw new ArgumentException( SR.ExceptionPriceIndicatorsFormulaRequiresFourArrays);
+ }
+
+ // Different number of x and y values
+ CheckNumOfValues( inputValues, 4 );
+
+ // Short Period for Exp moving average
+ int shortPeriod;
+ if (parameterList.Length < 1 ||
+ !int.TryParse(parameterList[0], NumberStyles.Any, CultureInfo.InvariantCulture, out shortPeriod))
+ {
+ shortPeriod = 3;
+ }
+
+ // Int64 Period for Exp moving average
+ int longPeriod;
+ if (parameterList.Length < 2 ||
+ !int.TryParse(parameterList[1], NumberStyles.Any, CultureInfo.InvariantCulture, out longPeriod))
+ {
+ longPeriod = 10;
+ }
+
+ if( shortPeriod > longPeriod || longPeriod <= 0 || shortPeriod <= 0 )
+ {
+ throw new ArgumentException(SR.ExceptionOscillatorObjectInvalidPeriod);
+ }
+
+ // Starting average from the first data point or after period.
+ bool startFromFirst = bool.Parse( extraParameterList[0] );
+
+ VolumeIndicators volume = new VolumeIndicators();
+
+ double [][] outputDistribution = new double [2][];
+
+ // Accumulation Distribution
+ volume.AccumulationDistribution( inputValues, out outputDistribution );
+
+ double [] ExpAvgDistribution;
+
+ // Exponential Moving average of Accumulation Distribution
+ ExponentialMovingAverage(outputDistribution[1],out ExpAvgDistribution,longPeriod,startFromFirst);
+
+ double [] ExpAvg;
+
+ // Exponential Moving average of close
+ ExponentialMovingAverage(outputDistribution[1],out ExpAvg,shortPeriod,startFromFirst);
+
+ outputValues = new double [2][];
+
+ int period = Math.Min(ExpAvg.Length,ExpAvgDistribution.Length);
+
+ outputValues[0] = new double [period];
+ outputValues[1] = new double [period];
+
+ // Accumulation Distribution
+ int expIndex = 0;
+ for( int index = inputValues[1].Length - period; index < inputValues[1].Length; index++ )
+ {
+ // Set X values
+ outputValues[0][expIndex] = inputValues[0][index];
+
+ // Set Y values
+ if(startFromFirst)
+ {
+ // Number of items in all arays is the same and they are aligned by time.
+ outputValues[1][expIndex] = ExpAvg[expIndex] - ExpAvgDistribution[expIndex];
+ }
+ else if( (expIndex + longPeriod - shortPeriod) < ExpAvg.Length)
+ {
+ // Number of items in MovingAverages arrays is different and requires adjustment.
+ outputValues[1][expIndex] = ExpAvg[expIndex + longPeriod - shortPeriod] - ExpAvgDistribution[expIndex];
+ }
+ else
+ {
+ outputValues[1][expIndex] = Double.NaN;
+ }
+ expIndex++;
+ }
+ }
+
+ /// <summary>
+ /// The Detrended Price Oscillator ("DPO") attempts to
+ /// eliminate the trend in prices. Detrended prices allow
+ /// you to more easily identify cycles and overbought/oversold
+ /// levels. To calculate the DPO, you specify a time period.
+ /// Cycles longer than this time period are removed from
+ /// prices, leaving the shorter-term cycles.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 1 Y value ( Close ).
+ /// Output:
+ /// - 1 Y value Detrended Price Oscillator
+ /// Parameters:
+ /// - Period
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ private void DetrendedPriceOscillator(double [][] inputValues, out double [][] outputValues, string [] parameterList)
+ {
+ // There is no enough input series
+ if( inputValues.Length != 2 )
+ {
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsFormulaRequiresOneArray);
+ }
+
+ // Different number of x and y values
+ CheckNumOfValues( inputValues, 1 );
+
+ // Short Period for Exp moving average
+ int period;
+ try
+ {period = int.Parse( parameterList[0], System.Globalization.CultureInfo.InvariantCulture );}
+ catch( Exception e )
+ {
+ if (e.Message == SR.ExceptionObjectReferenceIsNull)
+ throw new InvalidOperationException(SR.ExceptionPriceIndicatorsPeriodMissing);
+ else
+ throw new InvalidOperationException(SR.ExceptionPriceIndicatorsPeriodMissing + e.Message);
+ }
+
+ if( period <= 0 )
+ throw new InvalidOperationException(SR.ExceptionPeriodParameterIsNegative);
+
+ double [] outputAverage;
+
+ // Moving Average
+ MovingAverage( inputValues[1], out outputAverage, period, false );
+
+ outputValues = new double [2][];
+
+ outputValues[0] = new double [inputValues[0].Length - period*3/2];
+ outputValues[1] = new double [inputValues[1].Length - period*3/2];
+
+ // Detrended Price Oscillator
+ for( int index = 0; index < outputValues[1].Length; index++ )
+ {
+ // Set X values
+ outputValues[0][index] = inputValues[0][index + period + period/2];
+
+ // Set Y values
+ outputValues[1][index] = inputValues[1][index + period + period/2] - outputAverage[index];
+ }
+ }
+
+ /// <summary>
+ /// Chaikin's Volatility indicator compares the spread
+ /// between a security's high and low prices.
+ /// It quantifies volatility as a widening of the range
+ /// between the high and the low price. There are two ways
+ /// to interpret this measure of volatility. One method
+ /// assumes that market tops are generally accompanied by
+ /// increased volatility (as investors get nervous and
+ /// indecisive) and that the latter stages of a market
+ /// bottom are generally accompanied by decreased volatility
+ /// (as investors get bored). Another method (Mr. Chaikin's)
+ /// assumes that an increase in the Volatility indicator over
+ /// a relatively short time period indicates that a bottom is
+ /// near (e.g., a panic sell-off) and that a decrease in
+ /// volatility over a longer time period indicates an
+ /// approaching top (e.g., a mature bull market). As with
+ /// almost all experienced investors, Mr. Chaikin recommends
+ /// that you do not rely on any one indicator. He suggests
+ /// using a moving average ----ion or trading band system
+ /// to confirm this (or any) indicator.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 2 Y values ( Hi, Low ).
+ /// Output:
+ /// - 1 Y value Volatility Chaikins
+ /// Parameters:
+ /// - Periods (default 10)- is used to specify the Shift days, By default this property is set to 10.
+ /// - SignalPeriod (default 10)- is used to calculate Exponential Moving Avg of the Signal line, By default this property is set to 10.
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ private void VolatilityChaikins(double [][] inputValues, out double [][] outputValues, string [] parameterList)
+ {
+ // There is no enough input series
+ if( inputValues.Length != 3 )
+ {
+ throw new ArgumentException( SR.ExceptionPriceIndicatorsFormulaRequiresTwoArrays);
+ }
+
+ // Different number of x and y values
+ CheckNumOfValues( inputValues, 2 );
+
+ // Period
+ int period;
+ if (parameterList.Length < 1 ||
+ !int.TryParse(parameterList[0], NumberStyles.Any, CultureInfo.InvariantCulture, out period))
+ {
+ period = 10;
+ }
+
+ if( period <= 0 )
+ throw new InvalidOperationException(SR.ExceptionOscillatorNegativePeriodParameter);
+
+ // Signal Period for Exp moving average
+ int signalPeriod;
+ if (parameterList.Length < 2 ||
+ !int.TryParse(parameterList[1], NumberStyles.Any, CultureInfo.InvariantCulture, out signalPeriod))
+ {
+ signalPeriod = 10;
+ }
+
+ if( signalPeriod <= 0 )
+ throw new InvalidOperationException(SR.ExceptionOscillatorNegativeSignalPeriod);
+
+ double [] outputAverage;
+
+ double [] hiLowInput = new double[inputValues[1].Length];
+
+ // Find Hi - Low
+ for( int index = 0; index < inputValues[1].Length; index++ )
+ {
+ hiLowInput[index] = inputValues[1][index] - inputValues[2][index];
+ }
+
+ // Exponential Moving Average
+ ExponentialMovingAverage( hiLowInput, out outputAverage, signalPeriod, false );
+
+ outputValues = new double [2][];
+
+ outputValues[0] = new double [outputAverage.Length - period];
+ outputValues[1] = new double [outputAverage.Length - period];
+
+ // Volatility Chaikins
+ for( int index = 0; index < outputValues[1].Length; index++ )
+ {
+ // Set X values
+ outputValues[0][index] = inputValues[0][index + period + signalPeriod - 1];
+
+ // Set Y values
+ if( outputAverage[index] != 0.0 )
+ outputValues[1][index] = ( outputAverage[index + period] - outputAverage[index] ) / outputAverage[index] * 100.0;
+ else
+ // Div with zero error.
+ outputValues[1][index] = 0.0;
+ }
+ }
+
+ /// <summary>
+ /// The Volume Oscillator displays the difference between two
+ /// moving averages of a security's volume. The difference
+ /// between the moving averages can be expressed in either
+ /// points or percentages. You can use the difference between
+ /// two moving averages of volume to determine if the overall
+ /// volume trend is increasing or decreasing. When the Volume
+ /// Oscillator rises above zero, it signifies that the
+ /// shorter-term volume moving average has risen above
+ /// the longer-term volume moving average, and thus, that
+ /// the short-term volume trend is higher (i.e., more volume)
+ /// than the longer-term volume trend.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 1 Y values ( Volume ).
+ /// Output:
+ /// - 1 Y value VolumeOscillator
+ /// Parameters:
+ /// - ShortPeriod (Default 5)= is used to configure the short period.
+ /// - LongPeriod (Default 10)= is used to configure the Int64 period.
+ /// - Percentage (Default true)= The Volume Oscillator can display the difference between the two moving averages as either points or percentages.
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ private void VolumeOscillator(double [][] inputValues, out double [][] outputValues, string [] parameterList)
+ {
+ // There is no enough input series
+ if( inputValues.Length != 2 )
+ {
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsFormulaRequiresOneArray);
+ }
+
+ // Different number of x and y values
+ CheckNumOfValues( inputValues, 1 );
+
+ // Short Period
+ int shortPeriod;
+ if (parameterList.Length < 1 ||
+ !int.TryParse(parameterList[0], NumberStyles.Any, CultureInfo.InvariantCulture, out shortPeriod))
+ {
+ shortPeriod = 5;
+ }
+
+ // Int64 Period
+ int longPeriod;
+ if (parameterList.Length < 2 ||
+ !int.TryParse(parameterList[1], NumberStyles.Any, CultureInfo.InvariantCulture, out longPeriod))
+ {
+ longPeriod = 10;
+ }
+
+ if( shortPeriod > longPeriod || longPeriod <= 0 || shortPeriod <= 0 )
+ throw new ArgumentException(SR.ExceptionOscillatorObjectInvalidPeriod);
+
+ // percentage
+ bool percentage;
+ if (parameterList.Length < 3 ||
+ !bool.TryParse(parameterList[2], out percentage))
+ {
+ percentage = true;
+ }
+
+ double [] shortAverage;
+ double [] longAverage;
+
+ // Find Short moving average
+ MovingAverage( inputValues[1], out shortAverage, shortPeriod, false );
+
+ // Find Int64 moving average
+ MovingAverage( inputValues[1], out longAverage, longPeriod, false );
+
+ outputValues = new double [2][];
+
+ outputValues[0] = new double [longAverage.Length];
+ outputValues[1] = new double [longAverage.Length];
+
+ // Volume Oscillator
+ for( int index = 0; index < longAverage.Length; index++ )
+ {
+ // Set X values
+ outputValues[0][index] = inputValues[0][index + longPeriod-1];
+
+ // Set Y values
+ outputValues[1][index] = shortAverage[index + shortPeriod] - longAverage[index];
+
+ // RecalculateAxesScale difference in %
+ if( percentage )
+ {
+ // Div by zero error.
+ if( longAverage[index] == 0.0 )
+ outputValues[1][index]=0.0;
+ else
+ outputValues[1][index] = outputValues[1][index] / shortAverage[index + shortPeriod] * 100;
+ }
+ }
+ }
+
+ /// <summary>
+ /// The Stochastic Indicator is based on the observation that
+ /// as prices increase, closing prices tend to accumulate ever
+ /// closer to the highs for the period. Conversely, as prices
+ /// decrease, closing prices tend to accumulate ever closer to
+ /// the lows for the period. Trading decisions are made with
+ /// respect to divergence between % of "D" (one of the two
+ /// lines generated by the study) and the item's price. For
+ /// example, when a commodity or stock makes a high, reacts,
+ /// and subsequently moves to a higher high while corresponding
+ /// peaks on the % of "D" line make a high and then a lower
+ /// high, a bearish divergence is indicated. When a commodity
+ /// or stock has established a new low, reacts, and moves to a
+ /// lower low while the corresponding low points on the % of
+ /// "D" line make a low and then a higher low, a bullish
+ /// divergence is indicated. Traders act upon this divergence
+ /// when the other line generated by the study (K) crosses on
+ /// the right-hand side of the peak of the % of "D" line in the
+ /// case of a top, or on the right-hand side of the low point
+ /// of the % of "D" line in the case of a bottom. The Stochastic
+ /// Oscillator is displayed as two lines. The main line is
+ /// called "%K." The second line, called "%D," is a moving
+ /// average of %K.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 3 Y values ( Hi, Low, Close ).
+ /// Output:
+ /// - 2 Y value ( %K, %D )
+ /// Parameters:
+ /// - PeriodD (Default 10) = is used for %D calculation as SMA of %K.
+ /// - PeriodK (Default 10) = is used to calculate %K.
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ internal void StochasticIndicator(double [][] inputValues, out double [][] outputValues, string [] parameterList)
+ {
+ // There is no enough input series
+ if( inputValues.Length != 4 )
+ {
+ throw new ArgumentException( SR.ExceptionPriceIndicatorsFormulaRequiresThreeArrays);
+ }
+
+ // Different number of x and y values
+ CheckNumOfValues( inputValues, 3 );
+
+ // PeriodD for moving average
+ int periodD;
+ if (parameterList.Length < 2 ||
+ !int.TryParse(parameterList[1], NumberStyles.Any, CultureInfo.InvariantCulture, out periodD))
+ {
+ periodD = 10;
+ }
+
+ if( periodD <= 0 )
+ throw new InvalidOperationException(SR.ExceptionPeriodParameterIsNegative);
+
+ // PeriodK for moving average
+ int periodK;
+ if (parameterList.Length < 1 ||
+ !int.TryParse(parameterList[0], NumberStyles.Any, CultureInfo.InvariantCulture, out periodK))
+ {
+ periodK = 10;
+ }
+
+ if( periodK <= 0 )
+ throw new InvalidOperationException(SR.ExceptionPeriodParameterIsNegative);
+
+ // Output arrays
+ outputValues = new double [3][];
+
+ // X
+ outputValues[0] = new double [inputValues[0].Length - periodK - periodD + 2];
+
+ // K%
+ outputValues[1] = new double [inputValues[0].Length - periodK - periodD + 2];
+
+ // D%
+ outputValues[2] = new double [inputValues[0].Length - periodK - periodD + 2];
+
+ double [] K = new double [inputValues[0].Length - periodK + 1];
+
+ // Find K%
+ for( int index = periodK - 1; index < inputValues[0].Length; index++ )
+ {
+ // Find Lowest Low and Highest High
+ double minLow = double.MaxValue;
+ double maxHi = double.MinValue;
+ for( int indexHL = index - periodK + 1; indexHL <= index; indexHL++ )
+ {
+ if( minLow > inputValues[2][indexHL] )
+ minLow = inputValues[2][indexHL];
+
+ if( maxHi < inputValues[1][indexHL] )
+ maxHi = inputValues[1][indexHL];
+ }
+ // Find K%
+ K[index - periodK + 1] = ( inputValues[3][index] - minLow ) / ( maxHi - minLow ) * 100;
+
+ // Set X and Y K output
+ if( index >= periodK + periodD - 2 )
+ {
+ outputValues[0][index - periodK - periodD + 2] = inputValues[0][index];
+ outputValues[1][index - periodK - periodD + 2] = K[index - periodK + 1];
+ }
+ }
+
+ // Find D%
+ MovingAverage( K, out outputValues[2], periodD, false );
+ }
+
+ /// <summary>
+ /// Williams’ %R (pronounced "percent R") is a momentum
+ /// indicator that measures overbought/oversold levels.
+ /// Williams’ %R was developed by Larry Williams. The
+ /// interpretation of Williams' %R is very similar to that
+ /// of the Stochastic Oscillator except that %R is plotted
+ /// upside-down and the Stochastic Oscillator has internal
+ /// smoothing. To display the Williams’ %R indicator on an
+ /// upside-down scale, it is usually plotted using negative
+ /// values (e.g., -20%). Readings in the range of 80 to 100%
+ /// indicate that the security is oversold while readings in
+ /// the 0 to 20% range suggest that it is overbought.
+ /// As with all overbought/oversold indicators, it is best to
+ /// wait for the security's price to change direction before
+ /// placing your trades. For example, if an overbought/oversold
+ /// indicator (such as the Stochastic Oscillator or Williams'
+ /// %R) is showing an overbought condition, it is wise to wait
+ /// for the security's price to turn down before selling the
+ /// security. (The MovingAverageConvergenceDivergence is a good indicator to monitor change
+ /// in a security's price.) It is not unusual for
+ /// overbought/oversold indicators to remain in an
+ /// overbought/oversold condition for a long time period as
+ /// the security's price continues to climb/fall. Selling
+ /// simply because the security appears overbought may take
+ /// you out of the security long before its price shows signs
+ /// of deterioration.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 3 Y values ( Hi, Low, Close ).
+ /// Output:
+ /// - 2 Y value ( %R )
+ /// Parameters:
+ /// - Period (Default 14) = is used to configure the number of periods to calculate the WilliamsR
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ internal void WilliamsR(double [][] inputValues, out double [][] outputValues, string [] parameterList)
+ {
+ // There is no enough input series
+ if( inputValues.Length != 4 )
+ throw new ArgumentException( SR.ExceptionPriceIndicatorsFormulaRequiresThreeArrays);
+
+ // Different number of x and y values
+ CheckNumOfValues( inputValues, 3 );
+
+ // PeriodD for moving average
+ int period;
+ if (parameterList.Length < 1 ||
+ !int.TryParse(parameterList[0], NumberStyles.Any, CultureInfo.InvariantCulture, out period))
+ {
+ period = 14;
+ }
+
+ if( period <= 0 )
+ throw new InvalidOperationException(SR.ExceptionPeriodParameterIsNegative);
+
+ // Output arrays
+ outputValues = new double [2][];
+
+ // X
+ outputValues[0] = new double [inputValues[0].Length - period + 1];
+
+ // R%
+ outputValues[1] = new double [inputValues[0].Length - period + 1];
+
+ // Find R%
+ for( int index = period - 1; index < inputValues[0].Length; index++ )
+ {
+ // Find Lowest Low and Highest High
+ double minLow = double.MaxValue;
+ double maxHi = double.MinValue;
+ for( int indexHL = index - period + 1; indexHL <= index; indexHL++ )
+ {
+ if( minLow > inputValues[2][indexHL] )
+ minLow = inputValues[2][indexHL];
+
+ if( maxHi < inputValues[1][indexHL] )
+ maxHi = inputValues[1][indexHL];
+ }
+ // Set X value
+ outputValues[0][index - period + 1] = inputValues[0][index];
+
+ // Find R%
+ outputValues[1][index - period + 1] = ( maxHi - inputValues[3][index] ) / ( maxHi - minLow ) * (-100.0);
+ }
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Constructor
+ /// </summary>
+ public Oscillators()
+ {
+ }
+
+
+ /// <summary>
+ /// The first method in the module, which converts a formula
+ /// name to the corresponding private method.
+ /// </summary>
+ /// <param name="formulaName">String which represent a formula name</param>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Formula parameters</param>
+ /// <param name="extraParameterList">Array of strings - Extra Formula parameters from DataManipulator object</param>
+ /// <param name="outLabels">Array of strings - Used for Labels. Description for output results.</param>
+ override public void Formula( string formulaName, double [][] inputValues, out double [][] outputValues, string [] parameterList, string [] extraParameterList, out string [][] outLabels )
+ {
+ string name;
+ outputValues = null;
+
+ // Not used for these formulas.
+ outLabels = null;
+
+ name = formulaName.ToUpper(System.Globalization.CultureInfo.InvariantCulture);
+ try
+ {
+ switch( name )
+ {
+ case "STOCHASTICINDICATOR":
+ StochasticIndicator( inputValues, out outputValues, parameterList );
+ break;
+ case "CHAIKINOSCILLATOR":
+ ChaikinOscillator( inputValues, out outputValues, parameterList, extraParameterList );
+ break;
+ case "DETRENDEDPRICEOSCILLATOR":
+ DetrendedPriceOscillator( inputValues, out outputValues, parameterList );
+ break;
+ case "VOLATILITYCHAIKINS":
+ VolatilityChaikins( inputValues, out outputValues, parameterList );
+ break;
+ case "VOLUMEOSCILLATOR":
+ VolumeOscillator( inputValues, out outputValues, parameterList );
+ break;
+ case "WILLIAMSR":
+ WilliamsR( inputValues, out outputValues, parameterList );
+ break;
+ default:
+ outputValues = null;
+ break;
+ }
+ }
+ catch( IndexOutOfRangeException )
+ {
+ throw new InvalidOperationException( SR.ExceptionFormulaInvalidPeriod( name ) );
+ }
+ catch( OverflowException )
+ {
+ throw new InvalidOperationException( SR.ExceptionFormulaNotEnoughDataPoints( name ) );
+ }
+ }
+
+ #endregion
+
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/PriceIndicators.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/PriceIndicators.cs
new file mode 100644
index 00000000000..60dab3fdd23
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/PriceIndicators.cs
@@ -0,0 +1,1174 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: PriceIndicators.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting.Formulas
+//
+// Classes: PriceIndicators
+//
+// Purpose: This class is used to calculate Price
+// indicators used in Technical Analyses.
+//
+// Reviewed: GS - August 7, 2002
+// AG - August 7, 2002
+//
+//===================================================================
+
+
+using System;
+
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.Formulas
+#else
+ namespace System.Web.UI.DataVisualization.Charting.Formulas
+#endif
+{
+ /// <summary>
+ /// Price indicator is module with mathematical calculations
+ /// that apply to a security's price.
+ /// </summary>
+ internal class PriceIndicators : IFormula
+ {
+ #region Error strings
+
+ // Error strings
+ //internal string inputArrayStart = "Formula requires";
+ //internal string inputArrayEnd = "arrays";
+ //internal string SR.ExceptionPriceIndicatorsSameYNumber = "Formula requires the same number of Y values for each input data point";
+ //internal string SR.ExceptionPriceIndicatorsFormulaRequiresFourArrays = "Formula requires the same number of X and Y values for each input data point";
+ //internal string periodMissing = "Formula error - Period parameter is missing. ";
+ //internal string SR.ExceptionPriceIndicatorsFormulaRequiresFourArrays = "Formula error - There are not enough data points for the Period. ";
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Formula Module name
+ /// </summary>
+ virtual public string Name { get { return SR.FormulaNamePriceIndicators; } }
+
+ #endregion
+
+ #region Formulas
+
+ /// <summary>
+ /// A Moving Average is an indicator that shows the average
+ /// value of a security's price over a period of time. When
+ /// calculating a moving average, a mathematical analysis of
+ /// the security's average value over a predetermined time
+ /// period is made. As the security's price changes,
+ /// its average price moves up or down.
+ /// A simple, or arithmetic, moving average is calculated by
+ /// adding the closing price of the security for a number of
+ /// time periods (e.g., 12 days) and then dividing this total
+ /// by the number of time periods. The result is the average
+ /// price of the security over the time period. Simple moving
+ /// averages give equal weight to each daily price.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - Y values.
+ /// Output:
+ /// - Moving Average.
+ /// Parameters:
+ /// - Period
+ /// Extra Parameters:
+ /// - Start from First
+ ///
+ /// </summary>
+ /// <param name="inputValues">Array of doubles: Y values</param>
+ /// <param name="outputValues">Arrays of doubles: Moving average</param>
+ /// <param name="period">Period</param>
+ /// <param name="FromFirst">Start from first value</param>
+ internal void MovingAverage(double [] inputValues, out double [] outputValues, int period, bool FromFirst )
+ {
+ double [][] tempInput = new double [2][];
+ double [][] tempOutput = new double [2][];
+ string [] parList = new string [1];
+ string [] extList = new string [1];
+
+ parList[0] = period.ToString(System.Globalization.CultureInfo.InvariantCulture);
+ extList[0] = FromFirst.ToString(System.Globalization.CultureInfo.InvariantCulture);
+
+ tempInput[0] = new double[inputValues.Length];
+ tempInput[1] = inputValues;
+
+ MovingAverage( tempInput, out tempOutput, parList, extList );
+
+ outputValues = tempOutput[1];
+ }
+
+ /// <summary>
+ /// A Moving Average is an indicator that shows the average
+ /// value of a security's price over a period of time. When
+ /// calculating a moving average, a mathematical analysis of
+ /// the security's average value over a predetermined time
+ /// period is made. As the security's price changes,
+ /// its average price moves up or down.
+ /// A simple, or arithmetic, moving average is calculated by
+ /// adding the closing price of the security for a number of
+ /// time periods (e.g., 12 days) and then dividing this total
+ /// by the number of time periods. The result is the average
+ /// price of the security over the time period. Simple moving
+ /// averages give equal weight to each daily price.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - Y values.
+ /// Output:
+ /// - Moving Average.
+ /// Parameters:
+ /// - Period
+ /// Extra Parameters:
+ /// - Start from First
+ ///
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles: 1. row - X values, 2. row - Y values</param>
+ /// <param name="outputValues">Arrays of doubles: 1. row - X values, 2. row - Moving average</param>
+ /// <param name="parameterList">Array of strings: 1. Period</param>
+ /// <param name="extraParameterList">Array of strings: 1. Start from zero</param>
+ private void MovingAverage(double [][] inputValues, out double [][] outputValues, string [] parameterList, string [] extraParameterList)
+ {
+ int length = inputValues.Length;
+
+ // Period for moving average
+ int period;
+ try
+ {period = int.Parse( parameterList[0], System.Globalization.CultureInfo.InvariantCulture );}
+ catch( Exception e )
+ {
+ if (e.Message == SR.ExceptionObjectReferenceIsNull)
+ throw new InvalidOperationException(SR.ExceptionPriceIndicatorsPeriodMissing);
+ else
+ throw new InvalidOperationException(SR.ExceptionPriceIndicatorsPeriodMissing + e.Message);
+ }
+
+ if( period <= 0 )
+ throw new InvalidOperationException(SR.ExceptionPeriodParameterIsNegative);
+
+ // Starting average from the first data point or after period.
+ bool startFromFirst = bool.Parse( extraParameterList[0]);
+
+ // There is no enough series
+ if( length != 2 )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsFormulaRequiresOneArray);
+
+ // Different number of x and y values
+ if( inputValues[0].Length != inputValues[1].Length )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsSameXYNumber);
+
+ // Not enough values for moving average.
+ if( inputValues[0].Length < period )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsNotEnoughPoints);
+
+ outputValues = new double [2][];
+
+ if( startFromFirst )
+ {
+ // X values
+ outputValues[0] = new double [inputValues[0].Length];
+
+ // Y values
+ outputValues[1] = new double [inputValues[1].Length];
+
+ for( int point = 0; point < inputValues[0].Length; point++ )
+ {
+ // Set X value
+ outputValues[0][point] = inputValues[0][point];
+
+ // Find sum of Y values
+ double sum = 0;
+ int startSum = 0;
+
+ // Find the begining of the period
+ if( point - period + 1 > 0 )
+ {
+ startSum = point - period + 1;
+ }
+
+ // Find sum fro real period.
+ for( int pointSum = startSum; pointSum <= point; pointSum++ )
+ {
+ sum += inputValues[1][pointSum];
+ }
+
+ // Find real period if start from first data point.
+ int realPeriod = period;
+ if( period > point + 1 )
+ {
+ realPeriod = point + 1;
+ }
+
+ outputValues[1][point] = sum / realPeriod;
+ }
+ }
+ else
+ {
+ // X values
+ outputValues[0] = new double [inputValues[0].Length - period + 1];
+
+ // Y values
+ outputValues[1] = new double [inputValues[1].Length - period + 1];
+
+ // Find sum of Y values for the period
+ double sum = 0;
+ for( int pointSum = 0; pointSum < period; pointSum++ )
+ {
+ sum += inputValues[1][pointSum];
+ }
+
+ for( int point = 0; point < outputValues[0].Length; point++ )
+ {
+ // Set X value
+ outputValues[0][point] = inputValues[0][point + period - 1];
+
+ outputValues[1][point] = sum / period;
+
+ // Change Sum
+ if( point < outputValues[0].Length - 1 )
+ {
+ sum -= inputValues[1][point];
+ sum += inputValues[1][point + period];
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// An exponential (or exponentially weighted) moving average
+ /// is calculated by applying a percentage of today’s closing
+ /// price to yesterday’s moving average value. Exponential
+ /// moving averages place more weight on recent prices. For
+ /// example, to calculate a 9% exponential moving average
+ /// of IBM, you would first take today’s closing price and
+ /// multiply it by 9%. Next, you would add this product to
+ /// the value of yesterday’s moving average multiplied by
+ /// 91% (100% - 9% = 91%).
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - Y values.
+ /// Output:
+ /// - Exponential Moving Average.
+ /// Parameters:
+ /// - Period
+ /// Extra Parameters:
+ /// - Start from First
+ ///
+ /// </summary>
+ /// <param name="inputValues">Array of doubles: Y values</param>
+ /// <param name="outputValues">Arrays of doubles: Exponential Moving average</param>
+ /// <param name="period">Period</param>
+ /// <param name="startFromFirst">Start from first value</param>
+ internal void ExponentialMovingAverage(double []inputValues, out double []outputValues, int period, bool startFromFirst)
+ {
+ double [][] tempInput = new double [2][];
+ double [][] tempOutput = new double [2][];
+ string [] parList = new string [1];
+ string [] extList = new string [1];
+
+ parList[0] = period.ToString(System.Globalization.CultureInfo.InvariantCulture);
+ extList[0] = startFromFirst.ToString(System.Globalization.CultureInfo.InvariantCulture);
+
+ tempInput[0] = new double[inputValues.Length];
+ tempInput[1] = inputValues;
+
+ ExponentialMovingAverage( tempInput, out tempOutput, parList, extList );
+
+ outputValues = tempOutput[1];
+ }
+
+ /// <summary>
+ /// An exponential (or exponentially weighted) moving average
+ /// is calculated by applying a percentage of today’s closing
+ /// price to yesterday’s moving average value. Exponential
+ /// moving averages place more weight on recent prices. For
+ /// example, to calculate a 9% exponential moving average
+ /// of IBM, you would first take today’s closing price and
+ /// multiply it by 9%. Next, you would add this product to
+ /// the value of yesterday’s moving average multiplied by
+ /// 91% (100% - 9% = 91%).
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - Y values.
+ /// Output:
+ /// - Exponential Moving Average.
+ /// Parameters:
+ /// - Period
+ /// Extra Parameters:
+ /// - Start from First
+ ///
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles: 1. row - X values, 2. row - Y values</param>
+ /// <param name="outputValues">Arrays of doubles: 1. row - X values, 2. row - Moving average</param>
+ /// <param name="parameterList">Array of strings: 1. Period</param>
+ /// <param name="extraParameterList">Array of strings: 1. Start from zero</param>
+ private void ExponentialMovingAverage(double [][] inputValues, out double [][] outputValues, string [] parameterList, string [] extraParameterList)
+ {
+ int length = inputValues.Length;
+
+ // Period for moving average
+ int period;
+ try
+ {period = int.Parse( parameterList[0], System.Globalization.CultureInfo.InvariantCulture );}
+ catch( Exception e )
+ {
+ if (e.Message == SR.ExceptionObjectReferenceIsNull)
+ throw new InvalidOperationException(SR.ExceptionPriceIndicatorsPeriodMissing);
+ else
+ throw new InvalidOperationException(SR.ExceptionPriceIndicatorsPeriodMissing + e.Message);
+ }
+
+ if( period <= 0 )
+ throw new InvalidOperationException(SR.ExceptionPeriodParameterIsNegative);
+
+ // Formula for converting period to percentage
+ double exponentialPercentage = 2.0 / ( period + 1.0 );
+
+ // Starting average from the first data point or after period.
+ bool startFromFirst = bool.Parse( extraParameterList[0] );
+
+ // There is no enough series
+ if( length != 2 )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsFormulaRequiresOneArray);
+
+ // Different number of x and y values
+ if( inputValues[0].Length != inputValues[1].Length )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsSameXYNumber);
+
+ // Not enough values for moving average.
+ if( inputValues[0].Length < period )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsNotEnoughPoints);
+
+ outputValues = new double [2][];
+
+ if( startFromFirst )
+ {
+ // X values
+ outputValues[0] = new double [inputValues[0].Length];
+
+ // Y values
+ outputValues[1] = new double [inputValues[1].Length];
+
+ for( int point = 0; point < inputValues[0].Length; point++ )
+ {
+ // Set X value
+ outputValues[0][point] = inputValues[0][point];
+
+ // Find sum of Y values
+ double sum = 0;
+ int startSum = 0;
+
+ if( point - period + 1 > 0 )
+ {
+ startSum = point - period + 1;
+ }
+
+ for( int pointSum = startSum; pointSum < point; pointSum++ )
+ {
+ sum += inputValues[1][pointSum];
+ }
+
+ int realPeriod = period;
+ if( period > point + 1 )
+ realPeriod = point + 1;
+
+ double movingAvr;
+
+ // Find real period if start from first data point.
+ if( realPeriod <= 1 )
+ movingAvr = 0;
+ else
+ movingAvr = sum / ( realPeriod - 1 );
+
+ // Formula for converting period to percentage
+ exponentialPercentage = 2.0 / ( realPeriod + 1.0 );
+
+ // Exponential influence
+ outputValues[1][point] = movingAvr * (1 - exponentialPercentage ) + inputValues[1][point] * exponentialPercentage;
+
+ }
+ }
+ else
+ {
+ // X values
+ outputValues[0] = new double [inputValues[0].Length - period + 1];
+
+ // Y values
+ outputValues[1] = new double [inputValues[1].Length - period + 1];
+
+ for( int point = 0; point < outputValues[0].Length; point++ )
+ {
+ // Set X value
+ outputValues[0][point] = inputValues[0][point + period - 1];
+
+ double movingAvr;
+ // if point is less than period calulate simple moving average
+ if( point == 0 )
+ {
+ // Find sum of Y values
+ double sum = 0;
+ for( int pointSum = point; pointSum < point + period; pointSum++ )
+ {
+ sum += inputValues[1][pointSum];
+ }
+
+ movingAvr = sum / ( period );
+ }
+ // else use previos day exponential moving average
+ else
+ movingAvr = outputValues[1][point-1];
+
+ // Exponential influence
+ outputValues[1][point] = movingAvr * (1 - exponentialPercentage ) + inputValues[1][point + period - 1] * exponentialPercentage;
+
+ }
+ }
+ }
+
+ /// <summary>
+ /// Triangular moving averages place the majority of the weight
+ /// on the middle portion of the price series. They are actually
+ /// double-smoothed simple moving averages. The periods used
+ /// in the simple moving averages varies depending on if you
+ /// specify an odd or even number of time periods.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - Y values.
+ /// Output:
+ /// - Moving Average.
+ /// Parameters:
+ /// - Period
+ /// Extra Parameters:
+ /// - Start from First
+ ///
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles: 1. row - X values, 2. row - Y values</param>
+ /// <param name="outputValues">Arrays of doubles: 1. row - X values, 2. row - Moving average</param>
+ /// <param name="parameterList">Array of strings: 1. Period</param>
+ /// <param name="extraParameterList">Array of strings: 1. Start from zero</param>
+ private void TriangularMovingAverage(double [][] inputValues, out double [][] outputValues, string [] parameterList, string [] extraParameterList)
+ {
+ int length = inputValues.Length;
+
+ // Period for moving average
+ int period;
+ try
+ {period = int.Parse( parameterList[0], System.Globalization.CultureInfo.InvariantCulture );}
+ catch( Exception e )
+ {
+ if (e.Message == SR.ExceptionObjectReferenceIsNull)
+ throw new InvalidOperationException(SR.ExceptionPriceIndicatorsPeriodMissing);
+ else
+ throw new InvalidOperationException(SR.ExceptionPriceIndicatorsPeriodMissing + e.Message);
+ }
+
+ if( period <= 0 )
+ throw new InvalidOperationException(SR.ExceptionPeriodParameterIsNegative);
+
+ // Starting average from the first data point or after period.
+ bool startFromFirst = bool.Parse( extraParameterList[0] );
+
+ // There is no enough series
+ if( length != 2 )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsFormulaRequiresOneArray);
+
+ // Different number of x and y values
+ if( inputValues[0].Length != inputValues[1].Length )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsSameXYNumber);
+
+ // Not enough values for moving average.
+ if( inputValues[0].Length < period )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsNotEnoughPoints);
+
+ outputValues = new double [2][];
+
+ // Find triangular period
+ double tempPeriod = ((double)period + 1.0) / 2.0;
+ tempPeriod = Math.Round(tempPeriod);
+ double [] tempOut;
+ double [] tempIn = inputValues[1];
+
+ // Call moving averages first time
+ MovingAverage( tempIn, out tempOut, (int)tempPeriod, startFromFirst );
+ // Call moving averages second time (Moving average of moving average)
+ MovingAverage( tempOut, out tempOut, (int)tempPeriod, startFromFirst );
+
+ outputValues[1] = tempOut;
+
+ // X values
+ outputValues[0] = new double [outputValues[1].Length];
+
+ // Set X values
+ if( startFromFirst )
+ outputValues[0] = inputValues[0];
+ else
+ {
+ for( int index = 0; index < outputValues[1].Length; index++ )
+ outputValues[0][index] = inputValues[0][((int)(tempPeriod)-1) * 2 + index];
+ }
+ }
+
+ /// <summary>
+ /// A weighted moving average is designed to put more weight on
+ /// recent data and less weight on past data. A weighted moving
+ /// average is calculated by multiplying each of the previous
+ /// day’s data by a weight. The following table shows the calculation
+ /// of a 5-day weighted moving average.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - Y values.
+ /// Output:
+ /// - Moving Average.
+ /// Parameters:
+ /// - Period
+ /// Extra Parameters:
+ /// - Start from First
+ ///
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles: 1. row - X values, 2. row - Y values</param>
+ /// <param name="outputValues">Arrays of doubles: 1. row - X values, 2. row - Moving average</param>
+ /// <param name="parameterList">Array of strings: 1. Period</param>
+ /// <param name="extraParameterList">Array of strings: 1. Start from zero</param>
+ private void WeightedMovingAverage(double [][] inputValues, out double [][] outputValues, string [] parameterList, string [] extraParameterList)
+ {
+ int length = inputValues.Length;
+
+ // Period for moving average
+ int period;
+ try
+ {period = int.Parse( parameterList[0], System.Globalization.CultureInfo.InvariantCulture );}
+ catch( Exception e )
+ {
+ if (e.Message == SR.ExceptionObjectReferenceIsNull)
+ throw new InvalidOperationException(SR.ExceptionPriceIndicatorsPeriodMissing);
+ else
+ throw new InvalidOperationException(SR.ExceptionPriceIndicatorsPeriodMissing + e.Message);
+ }
+
+ if( period <= 0 )
+ throw new InvalidOperationException(SR.ExceptionPeriodParameterIsNegative);
+
+ // Starting average from the first data point or after period.
+ bool startFromFirst = bool.Parse( extraParameterList[0] );
+
+ // There is no enough series
+ if( length != 2 )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsFormulaRequiresOneArray);
+
+ // Different number of x and y values
+ if( inputValues[0].Length != inputValues[1].Length )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsSameXYNumber);
+
+ // Not enough values for moving average.
+ if( inputValues[0].Length < period )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsNotEnoughPoints);
+
+ outputValues = new double [2][];
+
+ if( startFromFirst )
+ {
+ // X values
+ outputValues[0] = new double [inputValues[0].Length];
+
+ // Y values
+ outputValues[1] = new double [inputValues[1].Length];
+
+ for( int point = 0; point < inputValues[0].Length; point++ )
+ {
+ // Set X value
+ outputValues[0][point] = inputValues[0][point];
+
+ // Find sum of Y values
+ double sum = 0;
+ int startSum = 0;
+
+ if( point - period + 1 > 0 )
+ {
+ startSum = point - period + 1;
+ }
+
+ int index = 1;
+ int indexSum = 0;
+ for( int pointSum = startSum; pointSum <= point; pointSum++ )
+ {
+ sum += inputValues[1][pointSum] * index;
+ indexSum += index;
+ index++;
+ }
+
+ double movingAvr;
+
+ // Avoid division by zero.
+ if( point == 0 )
+ movingAvr = inputValues[1][0];
+ else
+ movingAvr = sum / indexSum;
+
+ // Weighted average
+ outputValues[1][point] = movingAvr;
+
+ }
+ }
+ else
+ {
+ // X values
+ outputValues[0] = new double [inputValues[0].Length - period + 1];
+
+ // Y values
+ outputValues[1] = new double [inputValues[1].Length - period + 1];
+
+ for( int point = 0; point < outputValues[0].Length; point++ )
+ {
+ // Set X value
+ outputValues[0][point] = inputValues[0][point + period - 1];
+
+ // Find sum of Y values
+ double sum = 0;
+
+ int index = 1;
+ int indexSum = 0;
+ for( int pointSum = point; pointSum < point + period; pointSum++ )
+ {
+ sum += inputValues[1][pointSum] * index;
+ indexSum += index;
+ index++;
+ }
+
+ double movingAvr = sum / indexSum;
+
+ // Weighted average
+ outputValues[1][point] = movingAvr;
+
+ }
+ }
+ }
+
+ /// <summary>
+ /// Bollinger Bands plot trading bands above and below
+ /// a simple moving average. The standard deviation of
+ /// closing prices for a period equal to the moving
+ /// average employed is used to determine the band width.
+ /// This causes the bands to tighten in quiet markets and
+ /// loosen in volatile markets. The bands can be used to
+ /// determine overbought and oversold levels, locate
+ /// reversal areas, project targets for market moves, and
+ /// determine appropriate stop levels. The bands are used
+ /// in conjunction with indicators such as RSI, MovingAverageConvergenceDivergence
+ /// histogram, CCI and Rate of Change. Divergences between
+ /// Bollinger bands and other indicators show potential
+ /// action points.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 1 Y value.
+ /// Output:
+ /// - 2 Y values (Bollinger Band Hi and Low).
+ /// Parameters:
+ /// - period
+ /// Extra Parameters:
+ /// - startFromFirst
+ ///
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles: 1. row - X values, 2. row - Y values</param>
+ /// <param name="outputValues">Arrays of doubles: 1. row - X values, 2. row - Bollinger Band Up, 3. row - Bollinger Band Down</param>
+ /// <param name="parameterList">Array of strings: 1. Period</param>
+ /// <param name="extraParameterList">Array of strings: 1. Start from zero</param>
+ private void BollingerBands(double [][] inputValues, out double [][] outputValues, string [] parameterList, string [] extraParameterList)
+ {
+ int length = inputValues.Length;
+
+ // Period for moving average
+ int period;
+ try
+ {period = int.Parse( parameterList[0], System.Globalization.CultureInfo.InvariantCulture );}
+ catch( Exception e )
+ {
+ if (e.Message == SR.ExceptionObjectReferenceIsNull)
+ throw new InvalidOperationException(SR.ExceptionPriceIndicatorsPeriodMissing);
+ else
+ throw new InvalidOperationException(SR.ExceptionPriceIndicatorsPeriodMissing + e.Message);
+ }
+
+ if( period <= 0 )
+ throw new InvalidOperationException(SR.ExceptionPeriodParameterIsNegative);
+
+ // Standard deviation
+ double deviation;
+ try
+ {deviation = double.Parse( parameterList[1], System.Globalization.CultureInfo.InvariantCulture );}
+ catch(System.Exception)
+ { throw new InvalidOperationException(SR.ExceptionIndicatorsDeviationMissing); }
+
+ // Starting average from the first data point or after period.
+ bool startFromFirst = bool.Parse( extraParameterList[0] );
+
+ // There is no enough series
+ if( length != 2 )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsFormulaRequiresOneArray);
+
+ // Different number of x and y values
+ if( inputValues[0].Length != inputValues[1].Length )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsSameXYNumber);
+
+ // Not enough values for moving average.
+ if( inputValues[0].Length < period )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsNotEnoughPoints);
+
+ outputValues = new double [3][];
+
+ if( startFromFirst )
+ {
+ // X values
+ outputValues[0] = new double [inputValues[0].Length];
+
+ // Y values
+ outputValues[1] = new double [inputValues[1].Length];
+ outputValues[2] = new double [inputValues[1].Length];
+
+ // average
+ double [] average = new double [inputValues[1].Length];
+
+ MovingAverage( inputValues[1], out average, period, true );
+
+ for( int point = 0; point < outputValues[0].Length; point++ )
+ {
+ // Set X value
+ outputValues[0][point] = inputValues[0][point];
+
+ // Find sum of Y values
+ double sum = 0;
+ int startSum = 0;
+
+ // Find the begining of the period
+ if( point - period + 1 > 0 )
+ {
+ startSum = point - period + 1;
+ }
+
+ for( int pointSum = startSum; pointSum <= point; pointSum++ )
+ {
+ sum += ((inputValues[1][pointSum] - average[point])*(inputValues[1][pointSum] - average[point]));
+ }
+
+ outputValues[1][point] = average[point] + Math.Sqrt(sum / period) * deviation;
+ outputValues[2][point] = average[point] - Math.Sqrt(sum / period) * deviation;
+ }
+ }
+ else
+ {
+ // X values
+ outputValues[0] = new double [inputValues[0].Length - period + 1];
+
+ // Y values
+ outputValues[1] = new double [inputValues[1].Length - period + 1];
+ outputValues[2] = new double [inputValues[1].Length - period + 1];
+
+ // average
+ double [] average = new double [inputValues[1].Length - period + 1];
+
+ MovingAverage( inputValues[1], out average, period, false );
+
+ for( int point = 0; point < outputValues[0].Length; point++ )
+ {
+ // Set X value
+ outputValues[0][point] = inputValues[0][point + period - 1];
+
+ // Find sum of Y values
+ double sum = 0;
+
+ for( int pointSum = point; pointSum < point + period; pointSum++ )
+ {
+ sum += ((inputValues[1][pointSum] - average[point])*(inputValues[1][pointSum] - average[point]));
+ }
+
+ outputValues[1][point] = average[point] + Math.Sqrt(sum / period) * deviation;
+ outputValues[2][point] = average[point] - Math.Sqrt(sum / period) * deviation;
+ }
+ }
+ }
+
+ /// <summary>
+ /// The Typical Price indicator is simply an average of each
+ /// day's price. The Median Price and Weighted Close are
+ /// similar indicators. The Typical Price indicator provides
+ /// a simple, single-line plot of the day's average price.
+ /// Some investors use the Typical Price rather than the
+ /// closing price when creating moving average ----ion
+ /// systems.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 3 Y values ( Close, High, Low ).
+ /// Output:
+ /// - 1 Y value Weighted Close Indicator.
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles: 1. row - X values, 2. row - Y values (Close), 3. row - Y values (High), 4. row - Y values (Low)</param>
+ /// <param name="outputValues">Arrays of doubles: 1. row - X values, 2. row - Weighted Close</param>
+ private void TypicalPrice(double [][] inputValues, out double [][] outputValues)
+ {
+ int length = inputValues.Length;
+
+ // There is no enough series
+ if( length != 4 )
+ throw new ArgumentException( SR.ExceptionPriceIndicatorsFormulaRequiresThreeArrays);
+
+ // Different number of x and y values
+ CheckNumOfValues( inputValues, 3 );
+
+ outputValues = new double [2][];
+
+ outputValues[0] = new double [inputValues[0].Length];
+ outputValues[1] = new double [inputValues[1].Length];
+
+ for( int index = 0; index < inputValues[1].Length; index++ )
+ {
+ // Set X values
+ outputValues[0][index] = inputValues[0][index];
+
+ // Set median price
+ outputValues[1][index] = (inputValues[1][index] + inputValues[2][index] + inputValues[3][index])/3.0;
+ }
+
+ }
+
+ /// <summary>
+ /// The Median Price indicator is simply the midpoint of each
+ /// day's price. The Typical Price and Weighted Close are
+ /// similar indicators. The Median Price indicator provides
+ /// a simple, single-line chart of the day's "average price."
+ /// This average price is useful when you want a simpler
+ /// scaleView of prices.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 2 Y values ( High, Low ).
+ /// Output:
+ /// - 1 Y value Median Price Indicator.
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles: 1. row - X values, 2. row - Y values (High), 3. row - Y values (Low)</param>
+ /// <param name="outputValues">Arrays of doubles: 1. row - X values, 2. row - Median Price</param>
+ private void MedianPrice(double [][] inputValues, out double [][] outputValues)
+ {
+ int length = inputValues.Length;
+
+ // There is no enough series
+ if( length != 3 )
+ throw new ArgumentException( SR.ExceptionPriceIndicatorsFormulaRequiresTwoArrays);
+
+ // Different number of x and y values
+ CheckNumOfValues( inputValues, 2 );
+
+ outputValues = new double [2][];
+
+ outputValues[0] = new double [inputValues[0].Length];
+ outputValues[1] = new double [inputValues[1].Length];
+
+ for( int index = 0; index < inputValues[1].Length; index++ )
+ {
+ // Set X values
+ outputValues[0][index] = inputValues[0][index];
+
+ // Set median price
+ outputValues[1][index] = (inputValues[1][index] + inputValues[2][index])/2.0;
+ }
+
+ }
+
+ /// <summary>
+ /// The Weighted Close indicator is simply an average of each day's
+ /// price. It gets its name from the fact that extra weight is
+ /// given to the closing price. The Median Price and Typical Price
+ /// are similar indicators. When plotting and back-testing moving
+ /// averages, indicators, trendlines, etc, some investors like
+ /// the simplicity that a line chart offers. However, line
+ /// charts that only show the closing price can be misleading
+ /// since they ignore the high and low price. A Weighted Close
+ /// chart combines the simplicity of the line chart with the
+ /// scope of a bar chart, by plotting a single point for each
+ /// day that includes the high, low, and closing price.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 3 Y values ( Close, High, Low ).
+ /// Output:
+ /// - 1 Y value Weighted Close Indicator.
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles: 1. row - X values, 2. row - Y values (Close), 3. row - Y values (High), 4. row - Y values (Low)</param>
+ /// <param name="outputValues">Arrays of doubles: 1. row - X values, 2. row - Weighted Close</param>
+ private void WeightedClose(double [][] inputValues, out double [][] outputValues)
+ {
+ int length = inputValues.Length;
+
+ // There is no enough series
+ if( length != 4 )
+ throw new ArgumentException( SR.ExceptionPriceIndicatorsFormulaRequiresThreeArrays);
+
+ // Different number of x and y values
+ CheckNumOfValues( inputValues, 3 );
+
+ outputValues = new double [2][];
+
+ outputValues[0] = new double [inputValues[0].Length];
+ outputValues[1] = new double [inputValues[1].Length];
+
+ for( int index = 0; index < inputValues[1].Length; index++ )
+ {
+ // Set X values
+ outputValues[0][index] = inputValues[0][index];
+
+ // Set median price
+ outputValues[1][index] = (inputValues[1][index] + inputValues[2][index] + inputValues[3][index] * 2)/4.0;
+ }
+
+ }
+
+ /// <summary>
+ /// An envelope is comprised of two moving averages. One moving
+ /// average is shifted upward and the second moving average
+ /// is shifted downward. Envelopes define the upper and lower
+ /// boundaries of a security's normal trading range. A sell
+ /// signal is generated when the security reaches the upper
+ /// band whereas a buy signal is generated at the lower band.
+ /// The optimum percentage shift depends on the volatility of
+ /// the security--the more volatile, the larger the percentage.
+ /// The logic behind envelopes is that overzealous buyers and
+ /// sellers push the price to the extremes (i.e., the upper
+ /// and lower bands), at which point the prices often stabilize
+ /// by moving to more realistic levels. This is similar to the
+ /// interpretation of Bollinger Bands.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 1 Y value.
+ /// Output:
+ /// - 2 Y values (Envelope Hi and Low).
+ /// Parameters:
+ /// - period
+ /// - shift in percentages
+ /// Extra Parameters:
+ /// - startFromFirst
+ ///
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles: 1. row - X values, 2. row - Y values</param>
+ /// <param name="outputValues">Arrays of doubles: 1. row - X values, 2. row - Envelopes Up, 3. row - Envelopes Down</param>
+ /// <param name="parameterList">Array of strings: parameters</param>
+ /// <param name="extraParameterList">Array of strings: Extra parameters </param>
+ private void Envelopes(double [][] inputValues, out double [][] outputValues, string [] parameterList, string [] extraParameterList)
+ {
+ int length = inputValues.Length;
+
+ // Period for moving average
+ int period;
+ try
+ {period = int.Parse( parameterList[0], System.Globalization.CultureInfo.InvariantCulture );}
+ catch( Exception e )
+ {
+ if (e.Message == SR.ExceptionObjectReferenceIsNull)
+ throw new InvalidOperationException(SR.ExceptionPriceIndicatorsPeriodMissing);
+ else
+ throw new InvalidOperationException(SR.ExceptionPriceIndicatorsPeriodMissing + e.Message);
+ }
+
+ if( period <= 0 )
+ throw new InvalidOperationException(SR.ExceptionPeriodParameterIsNegative);
+
+ // Shift
+ double shift;
+ try
+ {shift = double.Parse( parameterList[1], System.Globalization.CultureInfo.InvariantCulture );}
+ catch(System.Exception)
+ { throw new InvalidOperationException(SR.ExceptionPriceIndicatorsShiftParameterMissing); }
+
+ // There is no enough series
+ if( length != 2 )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsFormulaRequiresOneArray);
+
+ // Different number of x and y values
+ if( inputValues[0].Length != inputValues[1].Length )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsSameXYNumber);
+
+ double [][] movingAverage;
+
+ MovingAverage( inputValues, out movingAverage, parameterList, extraParameterList );
+
+ outputValues = new double[3][];
+ outputValues[0] = new double[movingAverage[0].Length];
+ outputValues[1] = new double[movingAverage[0].Length];
+ outputValues[2] = new double[movingAverage[0].Length];
+
+ for( int index = 0; index < movingAverage[0].Length; index++ )
+ {
+ outputValues[0][index] = movingAverage[0][index];
+ outputValues[1][index] = movingAverage[1][index] + shift*movingAverage[1][index]/100.0;
+ outputValues[2][index] = movingAverage[1][index] - shift*movingAverage[1][index]/100.0;
+
+ }
+ }
+
+ /// <summary>
+ /// Standard Deviation is a statistical measure of volatility.
+ /// Standard Deviation is typically used as a component of
+ /// other indicators, rather than as a stand-alone indicator.
+ /// For example, Bollinger Bands are calculated by adding
+ /// a security's Standard Deviation to a moving average.
+ /// High Standard Deviation values occur when the data item
+ /// being analyzed (e.g., prices or an indicator) is changing
+ /// dramatically. Similarly, low Standard Deviation values
+ /// occur when prices are stable.
+ /// </summary>
+ /// <param name="inputValues">Input Y values</param>
+ /// <param name="outputValues">Output standard deviation</param>
+ /// <param name="period">Period</param>
+ /// <param name="startFromFirst">Start calculation from the first Y value</param>
+ internal void StandardDeviation(double [] inputValues, out double [] outputValues, int period, bool startFromFirst )
+ {
+ double [] movingOut;
+
+ // Start calculation from the first Y value
+ if( startFromFirst )
+ {
+ outputValues = new double[inputValues.Length];
+ double sum;
+ MovingAverage( inputValues, out movingOut, period, startFromFirst );
+ int outIndex = 0;
+ for( int index = 0; index < inputValues.Length; index++ )
+ {
+ sum = 0;
+ int startSum = 0;
+
+ // Find the begining of the period
+ if( index - period + 1 > 0 )
+ {
+ startSum = index - period + 1;
+ }
+ for( int indexDev = startSum; indexDev <= index; indexDev++ )
+ {
+ sum += (inputValues[indexDev] - movingOut[outIndex])*(inputValues[indexDev] - movingOut[outIndex]);
+ }
+ outputValues[outIndex] = Math.Sqrt( sum / period );
+ outIndex++;
+ }
+ }
+ // Do not start calculation from the first Y value
+ else
+ {
+ outputValues = new double[inputValues.Length - period + 1];
+ double sum;
+ MovingAverage( inputValues, out movingOut, period, startFromFirst );
+ int outIndex = 0;
+ for( int index = period - 1; index < inputValues.Length; index++ )
+ {
+ sum = 0;
+ for( int indexDev = index - period + 1; indexDev <= index; indexDev++ )
+ {
+ sum += (inputValues[indexDev] - movingOut[outIndex])*(inputValues[indexDev] - movingOut[outIndex]);
+ }
+ outputValues[outIndex] = Math.Sqrt( sum / period );
+ outIndex++;
+ }
+ }
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public PriceIndicators()
+ {
+ }
+
+ /// <summary>
+ /// This methods checks the number of X and Y values and
+ /// fire exception if the numbers are different.
+ /// </summary>
+ /// <param name="inputValues">Input X and Y values</param>
+ /// <param name="numOfYValues">The number of Y values</param>
+ public void CheckNumOfValues( double [][] inputValues, int numOfYValues )
+ {
+ // Different number of x and y values
+ if( inputValues[0].Length != inputValues[1].Length )
+ {
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsSameXYNumber);
+ }
+
+ // Different number of y values
+ for( int index = 1; index < numOfYValues; index++ )
+ {
+ if( inputValues[index].Length != inputValues[index+1].Length )
+ {
+ throw new ArgumentException( SR.ExceptionPriceIndicatorsSameYNumber );
+ }
+ }
+ }
+
+ /// <summary>
+ /// The first method in the module, which converts a formula
+ /// name to the corresponding private method.
+ /// </summary>
+ /// <param name="formulaName">String which represent a formula name</param>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Formula parameters</param>
+ /// <param name="extraParameterList">Array of strings - Extra Formula parameters from DataManipulator object</param>
+ /// <param name="outLabels">Array of strings - Used for Labels. Description for output results.</param>
+ virtual public void Formula( string formulaName, double [][] inputValues, out double [][] outputValues, string [] parameterList, string [] extraParameterList, out string [][] outLabels )
+ {
+ string name;
+
+ name = formulaName.ToUpper(System.Globalization.CultureInfo.InvariantCulture);
+
+ // Not used for these formulas.
+ outLabels = null;
+
+ try
+ {
+ switch( name )
+ {
+ case "MOVINGAVERAGE":
+ MovingAverage( inputValues, out outputValues, parameterList, extraParameterList );
+ break;
+ case "EXPONENTIALMOVINGAVERAGE":
+ ExponentialMovingAverage( inputValues, out outputValues, parameterList, extraParameterList );
+ break;
+ case "TRIANGULARMOVINGAVERAGE":
+ TriangularMovingAverage( inputValues, out outputValues, parameterList, extraParameterList );
+ break;
+ case "WEIGHTEDMOVINGAVERAGE":
+ WeightedMovingAverage( inputValues, out outputValues, parameterList, extraParameterList );
+ break;
+ case "BOLLINGERBANDS":
+ BollingerBands( inputValues, out outputValues, parameterList, extraParameterList );
+ break;
+ case "MEDIANPRICE":
+ MedianPrice( inputValues, out outputValues );
+ break;
+ case "TYPICALPRICE":
+ TypicalPrice( inputValues, out outputValues );
+ break;
+ case "WEIGHTEDCLOSE":
+ WeightedClose( inputValues, out outputValues );
+ break;
+ case "ENVELOPES":
+ Envelopes( inputValues, out outputValues, parameterList, extraParameterList );
+ break;
+ default:
+ outputValues = null;
+ break;
+ }
+ }
+ catch( IndexOutOfRangeException )
+ {
+ throw new InvalidOperationException(SR.ExceptionFormulaInvalidPeriod( name ) );
+ }
+ catch( OverflowException )
+ {
+ throw new InvalidOperationException( SR.ExceptionFormulaNotEnoughDataPoints( name ) );
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/StatisticalAnalysis.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/StatisticalAnalysis.cs
new file mode 100644
index 00000000000..579c7bc9c0b
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/StatisticalAnalysis.cs
@@ -0,0 +1,2189 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: StatisticalAnalysis.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting.Formulas
+//
+// Classes: StatisticalAnalysis
+//
+// Purpose: This class is used for Statistical Analysis
+//
+// Reviewed: AG - Apr 1, 2003
+//
+//===================================================================
+
+
+using System;
+using System.Collections;
+
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.Formulas
+#else
+ namespace System.Web.UI.DataVisualization.Charting.Formulas
+#endif
+{
+ /// <summary>
+ ///
+ /// </summary>
+ internal class StatisticalAnalysis : IFormula
+ {
+
+ #region Error strings
+
+ // Error strings
+ //internal string inputArrayStart = "Formula requires";
+ //internal string inputArrayEnd = "arrays";
+
+ #endregion
+
+ #region Parameters
+
+ /// <summary>
+ /// Formula Module name
+ /// </summary>
+ virtual public string Name { get { return SR.FormulaNameStatisticalAnalysis; } }
+
+ #endregion // Parameters
+
+ #region Methods
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public StatisticalAnalysis()
+ {
+ }
+
+ /// <summary>
+ /// The first method in the module, which converts a formula
+ /// name to the corresponding private method.
+ /// </summary>
+ /// <param name="formulaName">String which represent a formula name</param>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Formula parameters</param>
+ /// <param name="extraParameterList">Array of strings - Extra Formula parameters from DataManipulator object</param>
+ /// <param name="outLabels">Array of strings - Used for Labels. Description for output results.</param>
+ virtual public void Formula( string formulaName, double [][] inputValues, out double [][] outputValues, string [] parameterList, string [] extraParameterList, out string [][] outLabels )
+ {
+ string name;
+
+ outLabels = null;
+
+ name = formulaName.ToUpper(System.Globalization.CultureInfo.InvariantCulture);
+
+ try
+ {
+ switch( name )
+ {
+ case "TTESTEQUALVARIANCES":
+ TTest( inputValues, out outputValues, parameterList, out outLabels, true );
+ break;
+ case "TTESTUNEQUALVARIANCES":
+ TTest( inputValues, out outputValues, parameterList, out outLabels, false );
+ break;
+ case "TTESTPAIRED":
+ TTestPaired( inputValues, out outputValues, parameterList, out outLabels );
+ break;
+ case "ZTEST":
+ ZTest( inputValues, out outputValues, parameterList, out outLabels );
+ break;
+ case "FTEST":
+ FTest( inputValues, out outputValues, parameterList, out outLabels );
+ break;
+ case "COVARIANCE":
+ Covariance( inputValues, out outputValues, out outLabels );
+ break;
+ case "CORRELATION":
+ Correlation( inputValues, out outputValues, out outLabels );
+ break;
+ case "ANOVA":
+ Anova( inputValues, out outputValues, parameterList, out outLabels );
+ break;
+ case "TDISTRIBUTION":
+ TDistribution( out outputValues, parameterList, out outLabels );
+ break;
+ case "FDISTRIBUTION":
+ FDistribution( out outputValues, parameterList, out outLabels );
+ break;
+ case "NORMALDISTRIBUTION":
+ NormalDistribution( out outputValues, parameterList, out outLabels );
+ break;
+ case "INVERSETDISTRIBUTION":
+ TDistributionInverse( out outputValues, parameterList, out outLabels );
+ break;
+ case "INVERSEFDISTRIBUTION":
+ FDistributionInverse( out outputValues, parameterList, out outLabels );
+ break;
+ case "INVERSENORMALDISTRIBUTION":
+ NormalDistributionInverse( out outputValues, parameterList, out outLabels );
+ break;
+ case "MEAN":
+ Average( inputValues, out outputValues, out outLabels );
+ break;
+ case "VARIANCE":
+ Variance( inputValues, out outputValues, parameterList, out outLabels );
+ break;
+ case "MEDIAN":
+ Median( inputValues, out outputValues, out outLabels );
+ break;
+ case "BETAFUNCTION":
+ BetaFunction( out outputValues, parameterList, out outLabels );
+ break;
+ case "GAMMAFUNCTION":
+ GammaFunction( out outputValues, parameterList, out outLabels );
+ break;
+ default:
+ outputValues = null;
+ break;
+ }
+ }
+ catch( IndexOutOfRangeException )
+ {
+ throw new InvalidOperationException( SR.ExceptionFormulaInvalidPeriod(name) );
+ }
+ catch( OverflowException )
+ {
+ throw new InvalidOperationException( SR.ExceptionFormulaNotEnoughDataPoints(name) );
+ }
+ }
+
+ #endregion // Methods
+
+ #region Statistical Tests
+
+ /// <summary>
+ /// Anova test
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ /// <param name="outLabels">Array of strings - Used for Labels. Description for output results.</param>
+ private void Anova(double [][] inputValues, out double [][] outputValues, string [] parameterList, out string [][] outLabels )
+ {
+ // There is no enough input series
+ if( inputValues.Length < 3 )
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesNotEnoughInputSeries);
+
+ outLabels = null;
+
+ for( int index = 0; index < inputValues.Length - 1; index++ )
+ {
+ if( inputValues[index].Length != inputValues[index+1].Length )
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidAnovaTest);
+ }
+
+ // Alpha value
+ double alpha;
+ try
+ {
+ alpha = double.Parse( parameterList[0], System.Globalization.CultureInfo.InvariantCulture );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidAlphaValue);
+ }
+
+ if( alpha < 0 || alpha > 1 )
+ {
+ throw new ArgumentOutOfRangeException(SR.ExceptionStatisticalAnalysesInvalidAlphaValue);
+ }
+
+ // Output arrays
+ outputValues = new double [2][];
+
+ // Output Labels
+ outLabels = new string [1][];
+
+ // Parameters description
+ outLabels[0] = new string [10];
+
+ // X
+ outputValues[0] = new double [10];
+
+ // Y
+ outputValues[1] = new double [10];
+
+ int m = inputValues.Length - 1;
+ int n = inputValues[0].Length;
+
+ double [] average = new double[ m ];
+ double [] variance = new double[ m ];
+
+ // Find averages
+ for( int group = 0; group < m; group++ )
+ {
+ average[group] = Mean( inputValues[group+1] );
+ }
+
+ // Find variances
+ for( int group = 0; group < m; group++ )
+ {
+ variance[group] = Variance( inputValues[group+1], true );
+ }
+
+ // Total Average ( for all groups )
+ double averageTotal = Mean( average );
+
+ // Total Sample Variance
+ double totalS = 0;
+ foreach( double avr in average )
+ {
+ totalS += ( avr - averageTotal ) * ( avr - averageTotal );
+ }
+
+ totalS /= ( m - 1 );
+
+ // Group Sample Variance
+ double groupS = Mean( variance );
+
+ // F Statistica
+ double f = totalS * ( n ) / groupS;
+
+ // ****************************************
+ // Sum of Squares
+ // ****************************************
+
+ // Grend Total Average
+ double grandTotalAverage = 0;
+ for( int group = 0; group < m; group++ )
+ {
+ foreach( double point in inputValues[group+1] )
+ {
+ grandTotalAverage += point;
+ }
+ }
+
+ grandTotalAverage /= ( m * n );
+
+ // Treatment Sum of Squares
+ double trss = 0;
+ for( int group = 0; group < m; group++ )
+ {
+ trss += ( average[group] - grandTotalAverage ) * ( average[group] - grandTotalAverage );
+ }
+
+ trss *= n;
+
+ // Error Sum of Squares
+ double erss = 0;
+ for( int group = 0; group < m; group++ )
+ {
+ foreach( double point in inputValues[group+1] )
+ {
+ erss += ( point - average[group] ) * ( point - average[group] );
+ }
+ }
+
+ outLabels[0][0] = SR.LabelStatisticalSumOfSquaresBetweenGroups;
+ outputValues[0][0] = 1;
+ outputValues[1][0] = trss;
+
+ outLabels[0][1] = SR.LabelStatisticalSumOfSquaresWithinGroups;
+ outputValues[0][1] = 2;
+ outputValues[1][1] = erss;
+
+ outLabels[0][2] = SR.LabelStatisticalSumOfSquaresTotal;
+ outputValues[0][2] = 3;
+ outputValues[1][2] = trss + erss;
+
+ outLabels[0][3] = SR.LabelStatisticalDegreesOfFreedomBetweenGroups;
+ outputValues[0][3] = 4;
+ outputValues[1][3] = m - 1;
+
+ outLabels[0][4] = SR.LabelStatisticalDegreesOfFreedomWithinGroups;
+ outputValues[0][4] = 5;
+ outputValues[1][4] = m * ( n - 1 );
+
+ outLabels[0][5] = SR.LabelStatisticalDegreesOfFreedomTotal;
+ outputValues[0][5] = 6;
+ outputValues[1][5] = m * n - 1;
+
+ outLabels[0][6] = SR.LabelStatisticalMeanSquareVarianceBetweenGroups;
+ outputValues[0][6] = 7;
+ outputValues[1][6] = trss / ( m - 1 );
+
+ outLabels[0][7] = SR.LabelStatisticalMeanSquareVarianceWithinGroups;
+ outputValues[0][7] = 8;
+ outputValues[1][7] = erss / ( m * ( n - 1 ) );
+
+ outLabels[0][8] = SR.LabelStatisticalFRatio;
+ outputValues[0][8] = 9;
+ outputValues[1][8] = f;
+
+ outLabels[0][9] = SR.LabelStatisticalFCriteria;
+ outputValues[0][9] = 10;
+ outputValues[1][9] = FDistributionInverse( alpha, m - 1, m * ( n - 1 ) );
+
+ }
+
+
+
+
+ /// <summary>
+ /// Correlation measure the relationship between two data sets that
+ /// are scaled to be independent of the unit of measurement. The
+ /// population correlation calculation returns the covariance
+ /// of two data sets divided by the product of their standard
+ /// deviations: You can use the Correlation to determine whether two
+ /// ranges of data move together — that is, whether large values of
+ /// one set are associated with large values of the other
+ /// (positive correlation), whether small values of one set are
+ /// associated with large values of the other (negative correlation),
+ /// or whether values in both sets are unrelated (correlation
+ /// near zero).
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="outLabels">Array of strings - Used for Labels. Description for output results.</param>
+ private void Correlation(double [][] inputValues, out double [][] outputValues, out string [][] outLabels )
+ {
+ // There is no enough input series
+ if( inputValues.Length != 3 )
+ throw new ArgumentException( SR.ExceptionPriceIndicatorsFormulaRequiresTwoArrays);
+
+ outLabels = null;
+
+ // Output arrays
+ outputValues = new double [2][];
+
+ // Output Labels
+ outLabels = new string [1][];
+
+ // Parameters description
+ outLabels[0] = new string [1];
+
+ // X
+ outputValues[0] = new double [1];
+
+ // Y
+ outputValues[1] = new double [1];
+
+ // Find Covariance.
+ double covar = Covar( inputValues[1], inputValues[2] );
+
+ double varianceX = Variance( inputValues[1], false );
+ double varianceY = Variance( inputValues[2], false );
+
+ // Correlation
+ double correl = covar / Math.Sqrt( varianceX * varianceY );
+
+ outLabels[0][0] = SR.LabelStatisticalCorrelation;
+ outputValues[0][0] = 1;
+ outputValues[1][0] = correl;
+
+ }
+
+ /// <summary>
+ /// Returns covariance, the average of the products of deviations
+ /// for each data point pair. Use covariance to determine the
+ /// relationship between two data sets. For example, you can
+ /// examine whether greater income accompanies greater
+ /// levels of education.
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="outLabels">Array of strings - Used for Labels. Description for output results.</param>
+ private void Covariance(double [][] inputValues, out double [][] outputValues, out string [][] outLabels )
+ {
+ // There is no enough input series
+ if( inputValues.Length != 3 )
+ throw new ArgumentException( SR.ExceptionPriceIndicatorsFormulaRequiresTwoArrays);
+
+ outLabels = null;
+
+ // Output arrays
+ outputValues = new double [2][];
+
+ // Output Labels
+ outLabels = new string [1][];
+
+ // Parameters description
+ outLabels[0] = new string [1];
+
+ // X
+ outputValues[0] = new double [1];
+
+ // Y
+ outputValues[1] = new double [1];
+
+ // Find Covariance.
+ double covar = Covar( inputValues[1], inputValues[2] );
+
+ outLabels[0][0] = SR.LabelStatisticalCovariance;
+ outputValues[0][0] = 1;
+ outputValues[1][0] = covar;
+
+ }
+
+ /// <summary>
+ /// Returns the result of an F-test. An F-test returns the one-tailed
+ /// probability that the variances in array1 and array2 are not
+ /// significantly different. Use this function to determine
+ /// whether two samples have different variances. For example,
+ /// given test scores from public and private schools, you can
+ /// test whether these schools have different levels of diversity.
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ /// <param name="outLabels">Array of strings - Used for Labels. Description for output results.</param>
+ private void FTest(double [][] inputValues, out double [][] outputValues, string [] parameterList, out string [][] outLabels )
+ {
+ // There is no enough input series
+ if( inputValues.Length != 3 )
+ throw new ArgumentException( SR.ExceptionPriceIndicatorsFormulaRequiresTwoArrays);
+
+ outLabels = null;
+
+ double alpha;
+
+ // The number of data points has to be > 1.
+ CheckNumOfPoints( inputValues );
+
+ // Alpha value
+ try
+ {
+ alpha = double.Parse( parameterList[0], System.Globalization.CultureInfo.InvariantCulture );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidAlphaValue);
+ }
+
+ if( alpha < 0 || alpha > 1 )
+ {
+ throw new ArgumentOutOfRangeException(SR.ExceptionStatisticalAnalysesInvalidAlphaValue);
+ }
+
+ // Output arrays
+ outputValues = new double [2][];
+
+ // Output Labels
+ outLabels = new string [1][];
+
+ // Parameters description
+ outLabels[0] = new string [7];
+
+ // X
+ outputValues[0] = new double [7];
+
+ // Y
+ outputValues[1] = new double [7];
+
+ // Find Variance of the first group
+ double variance1 = Variance( inputValues[1], true );
+
+ // Find Variance of the second group
+ double variance2 = Variance( inputValues[2], true );
+
+ // Find Mean of the first group
+ double mean1 = Mean( inputValues[1] );
+
+ // Find Mean of the second group
+ double mean2 = Mean( inputValues[2] );
+
+ // F Value
+ double valueF = variance1 / variance2;
+
+ if( variance2 == 0 )
+ {
+ throw new InvalidOperationException(SR.ExceptionStatisticalAnalysesZeroVariance);
+ }
+
+ // The way to find a left critical value is to reversed the degrees of freedom,
+ // look up the right critical value, and then take the reciprocal of this value.
+ // For example, the critical value with 0.05 on the left with 12 numerator and 15
+ // denominator degrees of freedom is found of taking the reciprocal of the critical
+ // value with 0.05 on the right with 15 numerator and 12 denominator degrees of freedom.
+ // Avoiding Left Critical Values. Since the left critical values are a pain to calculate,
+ // they are often avoided altogether. This is the procedure followed in the textbook.
+ // You can force the F test into a right tail test by placing the sample with the large
+ // variance in the numerator and the smaller variance in the denominator. It does not
+ // matter which sample has the larger sample size, only which sample has the larger
+ // variance. The numerator degrees of freedom will be the degrees of freedom for
+ // whichever sample has the larger variance (since it is in the numerator) and the
+ // denominator degrees of freedom will be the degrees of freedom for whichever sample
+ // has the smaller variance (since it is in the denominator).
+ bool lessOneF = valueF <= 1;
+
+ double fDistInv;
+ double fDist;
+
+ if( lessOneF )
+ {
+ fDistInv = FDistributionInverse( 1 - alpha, inputValues[1].Length - 1, inputValues[2].Length - 1 );
+ fDist = 1 - FDistribution( valueF, inputValues[1].Length - 1, inputValues[2].Length - 1 );
+ }
+ else
+ {
+ fDistInv = FDistributionInverse( alpha, inputValues[1].Length - 1, inputValues[2].Length - 1 );
+ fDist = FDistribution( valueF, inputValues[1].Length - 1, inputValues[2].Length - 1 );
+ }
+
+ outLabels[0][0] = SR.LabelStatisticalTheFirstGroupMean;
+ outputValues[0][0] = 1;
+ outputValues[1][0] = mean1;
+
+ outLabels[0][1] = SR.LabelStatisticalTheSecondGroupMean;
+ outputValues[0][1] = 2;
+ outputValues[1][1] = mean2;
+
+ outLabels[0][2] = SR.LabelStatisticalTheFirstGroupVariance;
+ outputValues[0][2] = 3;
+ outputValues[1][2] = variance1;
+
+ outLabels[0][3] = SR.LabelStatisticalTheSecondGroupVariance;
+ outputValues[0][3] = 4;
+ outputValues[1][3] = variance2;
+
+ outLabels[0][4] = SR.LabelStatisticalFValue;
+ outputValues[0][4] = 5;
+ outputValues[1][4] = valueF;
+
+ outLabels[0][5] = SR.LabelStatisticalPFLessEqualSmallFOneTail;
+ outputValues[0][5] = 6;
+ outputValues[1][5] = fDist;
+
+ outLabels[0][6] = SR.LabelStatisticalFCriticalValueOneTail;
+ outputValues[0][6] = 7;
+ outputValues[1][6] = fDistInv;
+ }
+
+
+ /// <summary>
+ /// Returns the two-tailed P-value of a z-test. The z-test
+ /// generates a standard score for x with respect to the data set,
+ /// array, and returns the two-tailed probability for the
+ /// normal distribution. You can use this function to assess
+ /// the likelihood that a particular observation is drawn
+ /// from a particular population.
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ /// <param name="outLabels">Array of strings - Used for Labels. Description for output results.</param>
+ private void ZTest(double [][] inputValues, out double [][] outputValues, string [] parameterList, out string [][] outLabels )
+ {
+ // There is no enough input series
+ if( inputValues.Length != 3 )
+ throw new ArgumentException( SR.ExceptionPriceIndicatorsFormulaRequiresTwoArrays);
+
+ // The number of data points has to be > 1.
+ CheckNumOfPoints( inputValues );
+
+ outLabels = null;
+
+ double variance1;
+ double variance2;
+ double alpha;
+ double HypothesizedMeanDifference;
+
+ // Find Hypothesized Mean Difference parameter
+ try
+ {
+ HypothesizedMeanDifference = double.Parse( parameterList[0], System.Globalization.CultureInfo.InvariantCulture );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidMeanDifference);
+ }
+
+ if( HypothesizedMeanDifference < 0.0 )
+ {
+ throw new ArgumentOutOfRangeException(SR.ExceptionStatisticalAnalysesNegativeMeanDifference);
+ }
+
+ // Find variance of the first group
+ try
+ {
+ variance1 = double.Parse( parameterList[1], System.Globalization.CultureInfo.InvariantCulture );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidVariance);
+ }
+
+ // Find variance of the second group
+ try
+ {
+ variance2 = double.Parse( parameterList[2], System.Globalization.CultureInfo.InvariantCulture );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidVariance);
+ }
+
+ // Alpha value
+ try
+ {
+ alpha = double.Parse( parameterList[3], System.Globalization.CultureInfo.InvariantCulture );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidAlphaValue);
+ }
+
+ if( alpha < 0 || alpha > 1 )
+ {
+ throw new ArgumentOutOfRangeException(SR.ExceptionStatisticalAnalysesInvalidAlphaValue);
+ }
+
+ // Output arrays
+ outputValues = new double [2][];
+
+ // Output Labels
+ outLabels = new string [1][];
+
+ // Parameters description
+ outLabels[0] = new string [9];
+
+ // X
+ outputValues[0] = new double [9];
+
+ // Y
+ outputValues[1] = new double [9];
+
+ // Find Mean of the first group
+ double mean1 = Mean( inputValues[1] );
+
+ // Find Mean of the second group
+ double mean2 = Mean( inputValues[2] );
+
+ double dev = Math.Sqrt( variance1 / inputValues[1].Length + variance2 / inputValues[2].Length );
+
+ // Z Value
+ double valueZ = ( mean1 - mean2 - HypothesizedMeanDifference ) / dev;
+
+ double normalDistTwoInv = NormalDistributionInverse( 1 - alpha / 2 );
+ double normalDistOneInv = NormalDistributionInverse( 1 - alpha);
+ double normalDistOne;
+ double normalDistTwo;
+
+ if( valueZ < 0.0 )
+ {
+ normalDistOne = NormalDistribution( valueZ );
+ }
+ else
+ {
+ normalDistOne = 1.0 - NormalDistribution( valueZ );
+ }
+
+ normalDistTwo = 2.0 * normalDistOne;
+
+ outLabels[0][0] = SR.LabelStatisticalTheFirstGroupMean;
+ outputValues[0][0] = 1;
+ outputValues[1][0] = mean1;
+
+ outLabels[0][1] = SR.LabelStatisticalTheSecondGroupMean;
+ outputValues[0][1] = 2;
+ outputValues[1][1] = mean2;
+
+ outLabels[0][2] = SR.LabelStatisticalTheFirstGroupVariance;
+ outputValues[0][2] = 3;
+ outputValues[1][2] = variance1;
+
+ outLabels[0][3] = SR.LabelStatisticalTheSecondGroupVariance;
+ outputValues[0][3] = 4;
+ outputValues[1][3] = variance2;
+
+ outLabels[0][4] = SR.LabelStatisticalZValue;
+ outputValues[0][4] = 5;
+ outputValues[1][4] = valueZ;
+
+ outLabels[0][5] = SR.LabelStatisticalPZLessEqualSmallZOneTail;
+ outputValues[0][5] = 6;
+ outputValues[1][5] = normalDistOne;
+
+ outLabels[0][6] = SR.LabelStatisticalZCriticalValueOneTail;
+ outputValues[0][6] = 7;
+ outputValues[1][6] = normalDistOneInv;
+
+ outLabels[0][7] = SR.LabelStatisticalPZLessEqualSmallZTwoTail;
+ outputValues[0][7] = 8;
+ outputValues[1][7] = normalDistTwo;
+
+ outLabels[0][8] = SR.LabelStatisticalZCriticalValueTwoTail;
+ outputValues[0][8] = 9;
+ outputValues[1][8] = normalDistTwoInv;
+ }
+
+ /// <summary>
+ /// Returns the two-tailed P-value of a z-test. The z-test
+ /// generates a standard score for x with respect to the data set,
+ /// array, and returns the two-tailed probability for the
+ /// normal distribution. You can use this function to assess
+ /// the likelihood that a particular observation is drawn
+ /// from a particular population.
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ /// <param name="outLabels">Array of strings - Used for Labels. Description for output results.</param>
+ /// <param name="equalVariances">True if Variances are equal.</param>
+ private void TTest(double [][] inputValues, out double [][] outputValues, string [] parameterList, out string [][] outLabels, bool equalVariances )
+ {
+ // There is no enough input series
+ if( inputValues.Length != 3 )
+ throw new ArgumentException( SR.ExceptionPriceIndicatorsFormulaRequiresTwoArrays);
+
+ outLabels = null;
+
+ double variance1;
+ double variance2;
+ double alpha;
+ double HypothesizedMeanDifference;
+
+ // Find Hypothesized Mean Difference parameter
+ try
+ {
+ HypothesizedMeanDifference = double.Parse( parameterList[0], System.Globalization.CultureInfo.InvariantCulture );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidMeanDifference);
+ }
+
+ if( HypothesizedMeanDifference < 0.0 )
+ {
+ throw new ArgumentOutOfRangeException(SR.ExceptionStatisticalAnalysesNegativeMeanDifference);
+ }
+
+ // Alpha value
+ try
+ {
+ alpha = double.Parse( parameterList[1], System.Globalization.CultureInfo.InvariantCulture );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidAlphaValue);
+ }
+
+ if( alpha < 0 || alpha > 1 )
+ {
+ throw new ArgumentOutOfRangeException(SR.ExceptionStatisticalAnalysesInvalidAlphaValue);
+ }
+
+ // The number of data points has to be > 1.
+ CheckNumOfPoints( inputValues );
+
+ // Output arrays
+ outputValues = new double [2][];
+
+ // Output Labels
+ outLabels = new string [1][];
+
+ // Parameters description
+ outLabels[0] = new string [10];
+
+ // X
+ outputValues[0] = new double [10];
+
+ // Y
+ outputValues[1] = new double [10];
+
+ // Find Mean of the first group
+ double mean1 = Mean( inputValues[1] );
+
+ // Find Mean of the second group
+ double mean2 = Mean( inputValues[2] );
+
+ variance1 = Variance( inputValues[1], true );
+
+ variance2 = Variance( inputValues[2], true );
+
+ double s;
+ double T;
+ int freedom;
+ if( equalVariances )
+ {
+ freedom = inputValues[1].Length + inputValues[2].Length - 2;
+
+ // S value
+ s = ( ( inputValues[1].Length - 1 ) * variance1 + ( inputValues[2].Length - 1 ) * variance2 ) / ( inputValues[1].Length + inputValues[2].Length - 2 );
+
+ // T value
+ T = ( mean1 - mean2 - HypothesizedMeanDifference ) / ( Math.Sqrt( s * ( 1.0 / inputValues[1].Length + 1.0 / inputValues[2].Length ) ) );
+
+ }
+ else
+ {
+ double m = inputValues[1].Length;
+ double n = inputValues[2].Length;
+ double s1 = variance1;
+ double s2 = variance2;
+ double f = ( s1 / m + s2 / n ) * ( s1 / m + s2 / n ) / ( ( s1 / m ) * ( s1 / m ) / ( m - 1 ) + ( s2 / n ) * ( s2 / n ) / ( n - 1 ) );
+ freedom = (int)Math.Round(f);
+
+ s = Math.Sqrt( variance1 / inputValues[1].Length + variance2 / inputValues[2].Length );
+
+ // Z Value
+ T = ( mean1 - mean2 - HypothesizedMeanDifference ) / s;
+ }
+
+ double TDistTwoInv = StudentsDistributionInverse( alpha , freedom );
+
+ bool more50 = alpha > 0.5;
+
+ if( more50 )
+ {
+ alpha = 1 - alpha;
+ }
+
+ double TDistOneInv = StudentsDistributionInverse( alpha * 2.0, freedom );
+
+ if( more50 )
+ {
+ TDistOneInv *= -1.0;
+ }
+
+ double TDistTwo = StudentsDistribution( T, freedom, false );
+ double TDistOne = StudentsDistribution( T, freedom, true );
+
+ outLabels[0][0] = SR.LabelStatisticalTheFirstGroupMean;
+ outputValues[0][0] = 1;
+ outputValues[1][0] = mean1;
+
+ outLabels[0][1] = SR.LabelStatisticalTheSecondGroupMean;
+ outputValues[0][1] = 2;
+ outputValues[1][1] = mean2;
+
+ outLabels[0][2] = SR.LabelStatisticalTheFirstGroupVariance;
+ outputValues[0][2] = 3;
+ outputValues[1][2] = variance1;
+
+ outLabels[0][3] = SR.LabelStatisticalTheSecondGroupVariance;
+ outputValues[0][3] = 4;
+ outputValues[1][3] = variance2;
+
+ outLabels[0][4] = SR.LabelStatisticalTValue;
+ outputValues[0][4] = 5;
+ outputValues[1][4] = T;
+
+ outLabels[0][5] = SR.LabelStatisticalDegreeOfFreedom;
+ outputValues[0][5] = 6;
+ outputValues[1][5] = freedom;
+
+ outLabels[0][6] = SR.LabelStatisticalPTLessEqualSmallTOneTail;
+ outputValues[0][6] = 7;
+ outputValues[1][6] = TDistOne;
+
+ outLabels[0][7] = SR.LabelStatisticalSmallTCrititcalOneTail;
+ outputValues[0][7] = 8;
+ outputValues[1][7] = TDistOneInv;
+
+ outLabels[0][8] = SR.LabelStatisticalPTLessEqualSmallTTwoTail;
+ outputValues[0][8] = 9;
+ outputValues[1][8] = TDistTwo;
+
+ outLabels[0][9] = SR.LabelStatisticalSmallTCrititcalTwoTail;
+ outputValues[0][9] = 10;
+ outputValues[1][9] = TDistTwoInv;
+ }
+
+
+ /// <summary>
+ /// Returns the two-tailed P-value of a z-test. The z-test
+ /// generates a standard score for x with respect to the data set,
+ /// array, and returns the two-tailed probability for the
+ /// normal distribution. You can use this function to assess
+ /// the likelihood that a particular observation is drawn
+ /// from a particular population.
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ /// <param name="outLabels">Array of strings - Used for Labels. Description for output results.</param>
+ private void TTestPaired(double [][] inputValues, out double [][] outputValues, string [] parameterList, out string [][] outLabels )
+ {
+ // There is no enough input series
+ if( inputValues.Length != 3 )
+ throw new ArgumentException( SR.ExceptionPriceIndicatorsFormulaRequiresTwoArrays);
+
+ if( inputValues[1].Length != inputValues[2].Length )
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidVariableRanges);
+
+ outLabels = null;
+
+ double variance;
+ double alpha;
+ double HypothesizedMeanDifference;
+ int freedom;
+
+ // Find Hypothesized Mean Difference parameter
+ try
+ {
+ HypothesizedMeanDifference = double.Parse( parameterList[0], System.Globalization.CultureInfo.InvariantCulture );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidMeanDifference);
+ }
+
+ if( HypothesizedMeanDifference < 0.0 )
+ {
+ throw new ArgumentOutOfRangeException(SR.ExceptionStatisticalAnalysesNegativeMeanDifference);
+ }
+
+ // Alpha value
+ try
+ {
+ alpha = double.Parse( parameterList[1], System.Globalization.CultureInfo.InvariantCulture );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidAlphaValue);
+ }
+
+ if( alpha < 0 || alpha > 1 )
+ {
+ throw new ArgumentOutOfRangeException(SR.ExceptionStatisticalAnalysesInvalidAlphaValue);
+ }
+
+ // The number of data points has to be > 1.
+ CheckNumOfPoints( inputValues );
+
+ // Output arrays
+ outputValues = new double [2][];
+
+ // Output Labels
+ outLabels = new string [1][];
+
+ // Parameters description
+ outLabels[0] = new string [10];
+
+ // X
+ outputValues[0] = new double [10];
+
+ // Y
+ outputValues[1] = new double [10];
+
+ double [] difference = new double[inputValues[1].Length];
+
+ for( int item = 0; item < inputValues[1].Length; item++ )
+ {
+ difference[item] = inputValues[1][item] - inputValues[2][item];
+ }
+
+ // Find Mean of the second group
+ double mean = Mean( difference );
+
+ variance = Math.Sqrt( Variance( difference, true ) );
+
+ double T = ( Math.Sqrt( inputValues[1].Length ) * ( mean - HypothesizedMeanDifference ) ) / variance;
+
+ freedom = inputValues[1].Length - 1;
+
+ double TDistTwoInv = StudentsDistributionInverse( alpha , freedom );
+ double TDistOneInv = alpha <= 0.5 ? StudentsDistributionInverse(2 * alpha, freedom) : double.NaN;
+ double TDistTwo = StudentsDistribution( T, freedom, false );
+ double TDistOne = StudentsDistribution( T, freedom, true );
+
+ outLabels[0][0] = SR.LabelStatisticalTheFirstGroupMean;
+ outputValues[0][0] = 1;
+ outputValues[1][0] = Mean(inputValues[1]);
+
+ outLabels[0][1] = SR.LabelStatisticalTheSecondGroupMean;
+ outputValues[0][1] = 2;
+ outputValues[1][1] = Mean(inputValues[2]);
+
+ outLabels[0][2] = SR.LabelStatisticalTheFirstGroupVariance;
+ outputValues[0][2] = 3;
+ outputValues[1][2] = Variance(inputValues[1],true);
+
+ outLabels[0][3] = SR.LabelStatisticalTheSecondGroupVariance;
+ outputValues[0][3] = 4;
+ outputValues[1][3] = Variance(inputValues[2],true);
+
+ outLabels[0][4] = SR.LabelStatisticalTValue;
+ outputValues[0][4] = 5;
+ outputValues[1][4] = T;
+
+ outLabels[0][5] = SR.LabelStatisticalDegreeOfFreedom;
+ outputValues[0][5] = 6;
+ outputValues[1][5] = freedom;
+
+ outLabels[0][6] = SR.LabelStatisticalPTLessEqualSmallTOneTail;
+ outputValues[0][6] = 7;
+ outputValues[1][6] = TDistOne;
+
+ outLabels[0][7] = SR.LabelStatisticalSmallTCrititcalOneTail;
+ outputValues[0][7] = 8;
+ outputValues[1][7] = TDistOneInv;
+
+ outLabels[0][8] = SR.LabelStatisticalPTLessEqualSmallTTwoTail;
+ outputValues[0][8] = 9;
+ outputValues[1][8] = TDistTwo;
+
+ outLabels[0][9] = SR.LabelStatisticalSmallTCrititcalTwoTail;
+ outputValues[0][9] = 10;
+ outputValues[1][9] = TDistTwoInv;
+ }
+
+
+ #endregion // Statistical Tests
+
+ #region Public distributions
+
+ /// <summary>
+ /// Returns the Percentage Points (probability) for the Student
+ /// t-distribution. The t-distribution is used in the hypothesis
+ /// testing of small sample data sets. Use this function in place
+ /// of a table of critical values for the t-distribution.
+ /// </summary>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ /// <param name="outLabels">Array of strings - Used for Labels. Description for output results.</param>
+ private void TDistribution(out double [][] outputValues, string [] parameterList, out string [][] outLabels )
+ {
+ // T value value
+ double tValue;
+ try
+ {
+ tValue = double.Parse( parameterList[0], System.Globalization.CultureInfo.InvariantCulture );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidTValue);
+ }
+
+ // DegreeOfFreedom
+ int freedom;
+ try
+ {
+ freedom = int.Parse( parameterList[1], System.Globalization.CultureInfo.InvariantCulture );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidDegreeOfFreedom);
+ }
+
+ // One Tailed distribution
+ int oneTailed;
+ try
+ {
+ oneTailed = int.Parse( parameterList[2], System.Globalization.CultureInfo.InvariantCulture );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidTailedParameter);
+ }
+
+
+ outLabels = null;
+
+ // Output arrays
+ outputValues = new double [2][];
+
+ // Output Labels
+ outLabels = new string [1][];
+
+ // Parameters description
+ outLabels[0] = new string [1];
+
+ // X
+ outputValues[0] = new double [1];
+
+ // Y
+ outputValues[1] = new double [1];
+
+ outLabels[0][0] = SR.LabelStatisticalProbability;
+ outputValues[0][0] = 1;
+ outputValues[1][0] = StudentsDistribution( tValue, freedom, oneTailed == 1 );
+
+ }
+
+ /// <summary>
+ /// Returns the F probability distribution. You can use
+ /// this function to determine whether two data sets have
+ /// different degrees of diversity. For example, you can
+ /// examine test scores given to men and women entering
+ /// high school and determine if the variability in the
+ /// females is different from that found in the males.
+ /// </summary>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ /// <param name="outLabels">Array of strings - Used for Labels. Description for output results.</param>
+ private void FDistribution(out double [][] outputValues, string [] parameterList, out string [][] outLabels )
+ {
+ // F value value
+ double fValue;
+ try
+ {
+ fValue = double.Parse( parameterList[0], System.Globalization.CultureInfo.InvariantCulture );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidTValue);
+ }
+
+ // Degree Of Freedom 1
+ int freedom1;
+ try
+ {
+ freedom1 = int.Parse( parameterList[1], System.Globalization.CultureInfo.InvariantCulture );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidDegreeOfFreedom);
+ }
+
+ // Degree Of Freedom 2
+ int freedom2;
+ try
+ {
+ freedom2 = int.Parse( parameterList[2], System.Globalization.CultureInfo.InvariantCulture );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidDegreeOfFreedom);
+ }
+
+ outLabels = null;
+
+ // Output arrays
+ outputValues = new double [2][];
+
+ // Output Labels
+ outLabels = new string [1][];
+
+ // Parameters description
+ outLabels[0] = new string [1];
+
+ // X
+ outputValues[0] = new double [1];
+
+ // Y
+ outputValues[1] = new double [1];
+
+ outLabels[0][0] = SR.LabelStatisticalProbability;
+ outputValues[0][0] = 1;
+ outputValues[1][0] = FDistribution( fValue, freedom1, freedom2 );
+ }
+
+ /// <summary></summary>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ /// <param name="outLabels">Array of strings - Used for Labels. Description for output results.</param>
+ private void NormalDistribution(out double [][] outputValues, string [] parameterList, out string [][] outLabels )
+ {
+ // F value value
+ double zValue;
+ try
+ {
+ zValue = double.Parse( parameterList[0], System.Globalization.CultureInfo.InvariantCulture );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidZValue);
+ }
+
+ outLabels = null;
+
+ // Output arrays
+ outputValues = new double [2][];
+
+ // Output Labels
+ outLabels = new string [1][];
+
+ // Parameters description
+ outLabels[0] = new string [1];
+
+ // X
+ outputValues[0] = new double [1];
+
+ // Y
+ outputValues[1] = new double [1];
+
+ outLabels[0][0] = SR.LabelStatisticalProbability;
+ outputValues[0][0] = 1;
+ outputValues[1][0] = this.NormalDistribution( zValue );
+ }
+
+ /// <summary>
+ /// Returns the t-value of the Student's t-distribution
+ /// as a function of the probability and the degrees
+ /// of freedom.
+ /// </summary>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ /// <param name="outLabels">Array of strings - Used for Labels. Description for output results.</param>
+ private void TDistributionInverse(out double [][] outputValues, string [] parameterList, out string [][] outLabels )
+ {
+ // T value value
+ double probability;
+ try
+ {
+ probability = double.Parse( parameterList[0], System.Globalization.CultureInfo.InvariantCulture );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidProbabilityValue);
+ }
+
+ // DegreeOfFreedom
+ int freedom;
+ try
+ {
+ freedom = int.Parse( parameterList[1], System.Globalization.CultureInfo.InvariantCulture );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidDegreeOfFreedom);
+ }
+
+ outLabels = null;
+
+ // Output arrays
+ outputValues = new double [2][];
+
+ // Output Labels
+ outLabels = new string [1][];
+
+ // Parameters description
+ outLabels[0] = new string [1];
+
+ // X
+ outputValues[0] = new double [1];
+
+ // Y
+ outputValues[1] = new double [1];
+
+ outLabels[0][0] = SR.LabelStatisticalProbability;
+ outputValues[0][0] = 1;
+ outputValues[1][0] = StudentsDistributionInverse( probability, freedom );
+
+ }
+
+ /// <summary>
+ /// Returns the inverse of the F probability distribution.
+ /// If p = FDIST(x,...), then FINV(p,...) = x. The F distribution
+ /// can be used in an F-test that compares the degree of
+ /// variability in two data sets. For example, you can analyze
+ /// income distributions in the United States and Canada to
+ /// determine whether the two ---- have a similar degree
+ /// of diversity.
+ /// </summary>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ /// <param name="outLabels">Array of strings - Used for Labels. Description for output results.</param>
+ private void FDistributionInverse(out double [][] outputValues, string [] parameterList, out string [][] outLabels )
+ {
+ // Probability value value
+ double probability;
+ try
+ {
+ probability = double.Parse( parameterList[0], System.Globalization.CultureInfo.InvariantCulture );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidProbabilityValue);
+ }
+
+ // Degree Of Freedom 1
+ int freedom1;
+ try
+ {
+ freedom1 = int.Parse( parameterList[1], System.Globalization.CultureInfo.InvariantCulture );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidDegreeOfFreedom);
+ }
+
+ // Degree Of Freedom 2
+ int freedom2;
+ try
+ {
+ freedom2 = int.Parse( parameterList[2], System.Globalization.CultureInfo.InvariantCulture );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidDegreeOfFreedom);
+ }
+
+ outLabels = null;
+
+ // Output arrays
+ outputValues = new double [2][];
+
+ // Output Labels
+ outLabels = new string [1][];
+
+ // Parameters description
+ outLabels[0] = new string [1];
+
+ // X
+ outputValues[0] = new double [1];
+
+ // Y
+ outputValues[1] = new double [1];
+
+ outLabels[0][0] = SR.LabelStatisticalProbability;
+ outputValues[0][0] = 1;
+ outputValues[1][0] = FDistributionInverse( probability, freedom1, freedom2 );
+ }
+
+ /// <summary>
+ /// Returns the inverse of the standard normal
+ /// cumulative distribution. The distribution
+ /// has a mean of zero and a standard deviation
+ /// of one.
+ /// </summary>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ /// <param name="outLabels">Array of strings - Used for Labels. Description for output results.</param>
+ private void NormalDistributionInverse(out double [][] outputValues, string [] parameterList, out string [][] outLabels )
+ {
+ // Alpha value value
+ double alpha;
+ try
+ {
+ alpha = double.Parse( parameterList[0], System.Globalization.CultureInfo.InvariantCulture );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidAlphaValue);
+ }
+
+ outLabels = null;
+
+ // Output arrays
+ outputValues = new double [2][];
+
+ // Output Labels
+ outLabels = new string [1][];
+
+ // Parameters description
+ outLabels[0] = new string [1];
+
+ // X
+ outputValues[0] = new double [1];
+
+ // Y
+ outputValues[1] = new double [1];
+
+ outLabels[0][0] = SR.LabelStatisticalProbability;
+ outputValues[0][0] = 1;
+ outputValues[1][0] = this.NormalDistributionInverse( alpha );
+ }
+
+ #endregion
+
+ #region Utility Statistical Functions
+
+
+ /// <summary>
+ /// Check number of data points. The number should be greater then 1.
+ /// </summary>
+ /// <param name="inputValues">Input series</param>
+ private void CheckNumOfPoints( double [][] inputValues )
+ {
+ if( inputValues[1].Length < 2 )
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesNotEnoughDataPoints);
+ }
+
+ if( inputValues.Length > 2 )
+ {
+ if( inputValues[2].Length < 2 )
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesNotEnoughDataPoints);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Returns covariance, the average of the products of deviations
+ /// for each data point pair. Use covariance to determine the
+ /// relationship between two data sets. For example, you can
+ /// examine whether greater income accompanies greater
+ /// levels of education.
+ /// </summary>
+ /// <param name="arrayX">First data set from X random variable.</param>
+ /// <param name="arrayY">Second data set from Y random variable.</param>
+ /// <returns>Returns covariance</returns>
+ private double Covar( double [] arrayX, double [] arrayY )
+ {
+ // Check the number of data points
+ if( arrayX.Length != arrayY.Length )
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesCovariance);
+ }
+
+ double [] arrayXY = new double[arrayX.Length];
+
+ // Find XY
+ for( int index = 0; index < arrayX.Length; index++ )
+ {
+ arrayXY[index] = arrayX[index] * arrayY[index];
+ }
+
+ // Find means
+ double meanXY = Mean( arrayXY );
+ double meanX = Mean( arrayX );
+ double meanY = Mean( arrayY );
+
+ // return covariance
+ return meanXY - meanX * meanY;
+ }
+
+ /// <summary>
+ /// Returns the natural logarithm of the gamma function, G(x).
+ /// </summary>
+ /// <param name="n">The value for which you want to calculate gamma function.</param>
+ /// <returns>Returns the natural logarithm of the gamma function.</returns>
+ private double GammLn( double n )
+ {
+ double x;
+ double y;
+ double tmp;
+ double sum;
+ double [] cof = {76.18009172947146, -86.50532032941677, 24.01409824083091, -1.231739572450155, 0.1208650973866179e-2, -0.5395239384953e-5};
+
+ if( n < 0 )
+ {
+ throw new ArgumentOutOfRangeException(SR.ExceptionStatisticalAnalysesGammaBetaNegativeParameters);
+ }
+
+ // Iterative method for Gamma function
+ y = x = n;
+ tmp = x + 5.5;
+ tmp -= ( x + 0.5 ) * Math.Log( tmp );
+ sum = 1.000000000190015;
+ for( int item = 0; item <=5; item++ )
+ {
+ sum += cof[item] / ++y;
+ }
+
+ return -tmp + Math.Log( 2.5066282746310005 * sum / x );
+ }
+
+ /// <summary>
+ /// Calculates Beta function
+ /// </summary>
+ /// <param name="m">First parameter for beta function</param>
+ /// <param name="n">Second parameter for beta function</param>
+ /// <returns>returns beta function</returns>
+ private double BetaFunction( double m, double n )
+ {
+ return Math.Exp( GammLn( m ) + GammLn( n ) - GammLn( m + n ) );
+ }
+
+ /// <summary>
+ /// Used by betai: Evaluates continued fraction for
+ /// incomplete beta function by modified Lentz’s
+ /// </summary>
+ /// <param name="a">Beta incomplete parameter</param>
+ /// <param name="b">Beta incomplete parameter</param>
+ /// <param name="x">Beta incomplete parameter</param>
+ /// <returns>Value used for Beta incomplete function</returns>
+ private double BetaCF( double a, double b, double x )
+ {
+ int MAXIT = 100;
+ double EPS = 3.0e-7;
+ double FPMIN = 1.0e-30;
+
+ int m,m2;
+ double aa,c,d,del,h,qab,qam,qap;
+ qab = a + b;
+ qap= a + 1.0;
+ qam = a - 1.0;
+ c = 1.0;
+ d = 1.0 - qab * x / qap;
+ if ( Math.Abs(d) < FPMIN ) d=FPMIN;
+ d = 1.0 / d;
+ h = d;
+
+ // Numerical approximation for Beta incomplete function
+ for( m=1; m<=MAXIT; m++ )
+ {
+ m2 = 2*m;
+ aa = m*(b-m)*x/((qam+m2)*(a+m2));
+
+ // Find d coeficient
+ d = 1.0 + aa*d;
+ if( Math.Abs(d) < FPMIN ) d=FPMIN;
+
+ // Find c coeficient
+ c = 1.0 + aa / c;
+ if( Math.Abs(c) < FPMIN ) c = FPMIN;
+
+ // Find d coeficient
+ d = 1.0 / d;
+
+ // Find h coeficient
+ h *= d*c;
+
+ aa = -(a+m)*(qab+m)*x/((a+m2)*(qap+m2));
+
+ // Recalc d coeficient
+ d=1.0+aa*d;
+ if (Math.Abs(d) < FPMIN) d=FPMIN;
+
+ // Recalc c coeficient
+ c=1.0+aa/c;
+ if (Math.Abs(c) < FPMIN) c=FPMIN;
+
+ // Recalc d coeficient
+ d=1.0/d;
+ del=d*c;
+
+ // Recalc h coeficient
+ h *= del;
+
+ if (Math.Abs(del-1.0) < EPS)
+ {
+ break;
+ }
+ }
+
+ if (m > MAXIT)
+ {
+ throw new InvalidOperationException(SR.ExceptionStatisticalAnalysesIncompleteBetaFunction);
+ }
+
+ return h;
+ }
+
+ /// <summary>
+ /// Standard normal density function
+ /// </summary>
+ /// <param name="t">T Value</param>
+ /// <returns>Standard normal density</returns>
+ private double NormalDistributionFunction(double t)
+ {
+ return 0.398942280401433 * Math.Exp( -t * t / 2 );
+ }
+
+ /// <summary>
+ /// Returns the incomplete beta function Ix(a, b).
+ /// </summary>
+ /// <param name="a">Beta incomplete parameter</param>
+ /// <param name="b">Beta incomplete parameter</param>
+ /// <param name="x">Beta incomplete parameter</param>
+ /// <returns>Beta Incomplete value</returns>
+ private double BetaIncomplete( double a, double b, double x )
+ {
+ double bt;
+ if (x < 0.0 || x > 1.0)
+ throw new ArgumentOutOfRangeException(SR.ExceptionStatisticalAnalysesInvalidInputParameter);
+ if (x == 0.0 || x == 1.0)
+ {
+ bt = 0.0;
+ }
+ else
+ { // Factors in front of the continued fraction.
+ bt = Math.Exp(GammLn(a + b) - GammLn(a) - GammLn(b) + a * Math.Log(x) + b * Math.Log(1.0 - x));
+ }
+
+ if (x < (a + 1.0) / (a + b + 2.0))
+ { //Use continued fraction directly.
+ return bt * BetaCF(a, b, x) / a;
+ }
+ else
+ { // Use continued fraction after making the symmetry transformation.
+ return 1.0 - bt * BetaCF(b, a, 1.0 - x) / b;
+ }
+ }
+
+
+ #endregion // Utility Statistical Functions
+
+ #region Statistical Parameters
+
+ /// <summary>
+ /// Returns the average (arithmetic mean) of the arguments.
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="outLabels">Array of strings - Used for Labels. Description for output results.</param>
+ private void Average(double [][] inputValues, out double [][] outputValues, out string [][] outLabels )
+ {
+
+ outLabels = null;
+
+ // Invalid number of data series
+ if( inputValues.Length != 2 )
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidSeriesNumber);
+
+ // Output arrays
+ outputValues = new double [2][];
+
+ // Output Labels
+ outLabels = new string [1][];
+
+ // Parameters description
+ outLabels[0] = new string [1];
+
+ // X
+ outputValues[0] = new double [1];
+
+ // Y
+ outputValues[1] = new double [1];
+
+ outLabels[0][0] = SR.LabelStatisticalAverage;
+ outputValues[0][0] = 1;
+ outputValues[1][0] = Mean( inputValues[1] );
+
+ }
+
+ /// <summary>
+ /// Calculates variance
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ /// <param name="outLabels">Array of strings - Used for Labels. Description for output results.</param>
+ private void Variance(double [][] inputValues, out double [][] outputValues, string [] parameterList, out string [][] outLabels )
+ {
+
+ // Sample Variance value
+ bool sampleVariance;
+ try
+ {
+ sampleVariance = bool.Parse( parameterList[0] );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidVariance);
+ }
+
+ CheckNumOfPoints(inputValues);
+
+ // Invalid number of data series
+ if( inputValues.Length != 2 )
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidSeriesNumber);
+
+ outLabels = null;
+
+ // Output arrays
+ outputValues = new double [2][];
+
+ // Output Labels
+ outLabels = new string [1][];
+
+ // Parameters description
+ outLabels[0] = new string [1];
+
+ // X
+ outputValues[0] = new double [1];
+
+ // Y
+ outputValues[1] = new double [1];
+
+ outLabels[0][0] = SR.LabelStatisticalVariance;
+ outputValues[0][0] = 1;
+ outputValues[1][0] = Variance( inputValues[1], sampleVariance );
+
+ }
+
+ /// <summary>
+ /// Calculates Median
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="outLabels">Array of strings - Used for Labels. Description for output results.</param>
+ private void Median(double [][] inputValues, out double [][] outputValues, out string [][] outLabels )
+ {
+
+ outLabels = null;
+
+ // Invalid number of data series
+ if( inputValues.Length != 2 )
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidSeriesNumber);
+
+ // Output arrays
+ outputValues = new double [2][];
+
+ // Output Labels
+ outLabels = new string [1][];
+
+ // Parameters description
+ outLabels[0] = new string [1];
+
+ // X
+ outputValues[0] = new double [1];
+
+ // Y
+ outputValues[1] = new double [1];
+
+ outLabels[0][0] = SR.LabelStatisticalMedian;
+ outputValues[0][0] = 1;
+ outputValues[1][0] = Median( inputValues[1] );
+
+ }
+
+ /// <summary>
+ /// Calculates Beta Function
+ /// </summary>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ /// <param name="outLabels">Array of strings - Used for Labels. Description for output results.</param>
+ private void BetaFunction(out double [][] outputValues, string [] parameterList, out string [][] outLabels )
+ {
+ // Degree of freedom
+ double m;
+ try
+ {
+ m = double.Parse( parameterList[0], System.Globalization.CultureInfo.InvariantCulture );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidDegreeOfFreedom);
+ }
+
+ // Degree of freedom
+ double n;
+ try
+ {
+ n = double.Parse( parameterList[1], System.Globalization.CultureInfo.InvariantCulture );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidDegreeOfFreedom);
+ }
+
+ outLabels = null;
+
+ // Output arrays
+ outputValues = new double [2][];
+
+ // Output Labels
+ outLabels = new string [1][];
+
+ // Parameters description
+ outLabels[0] = new string [1];
+
+ // X
+ outputValues[0] = new double [1];
+
+ // Y
+ outputValues[1] = new double [1];
+
+ outLabels[0][0] = SR.LabelStatisticalBetaFunction;
+ outputValues[0][0] = 1;
+ outputValues[1][0] = BetaFunction( m, n );
+
+ }
+
+ /// <summary>
+ /// Calculates Gamma Function
+ /// </summary>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ /// <param name="outLabels">Array of strings - Used for Labels. Description for output results.</param>
+ private void GammaFunction(out double [][] outputValues, string [] parameterList, out string [][] outLabels )
+ {
+ // Degree of freedom
+ double m;
+ try
+ {
+ m = double.Parse( parameterList[0], System.Globalization.CultureInfo.InvariantCulture );
+ }
+ catch(System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidInputParameter);
+ }
+
+ if( m < 0 )
+ {
+ throw new ArgumentOutOfRangeException(SR.ExceptionStatisticalAnalysesGammaBetaNegativeParameters);
+ }
+
+ outLabels = null;
+
+ // Output arrays
+ outputValues = new double [2][];
+
+ // Output Labels
+ outLabels = new string [1][];
+
+ // Parameters description
+ outLabels[0] = new string [1];
+
+ // X
+ outputValues[0] = new double [1];
+
+ // Y
+ outputValues[1] = new double [1];
+
+ outLabels[0][0] = SR.LabelStatisticalGammaFunction;
+ outputValues[0][0] = 1;
+ outputValues[1][0] = Math.Exp( GammLn( m ) );
+
+ }
+
+
+ /// <summary>
+ /// Sort array of double values.
+ /// </summary>
+ /// <param name="values">Array of doubles which should be sorted.</param>
+ private void Sort( ref double [] values )
+ {
+
+ double tempValue;
+ for( int outLoop = 0; outLoop < values.Length; outLoop++ )
+ {
+ for( int inLoop = outLoop + 1; inLoop < values.Length; inLoop++ )
+ {
+ if( values[ outLoop ] > values[ inLoop ] )
+ {
+ tempValue = values[ outLoop ];
+ values[ outLoop ] = values[ inLoop ];
+ values[ inLoop ] = tempValue;
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Returns the median of the given numbers
+ /// </summary>
+ /// <param name="values">Array of double numbers</param>
+ /// <returns>Median</returns>
+ private double Median( double [] values )
+ {
+ // Exception for zero lenght of series.
+ if( values.Length == 0 )
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidMedianConditions);
+ }
+
+ // Sort array
+ Sort( ref values );
+
+ int position = values.Length / 2;
+
+ // if number of points is even
+ if( values.Length % 2 == 0 )
+ {
+ return ( values[position-1] + values[position] ) / 2.0;
+ }
+ else
+ {
+ return values[position];
+ }
+ }
+
+ /// <summary>
+ /// Calculates a Mean for a series of numbers.
+ /// </summary>
+ /// <param name="values">series with double numbers</param>
+ /// <returns>Returns Mean</returns>
+ private double Mean( double [] values )
+ {
+ // Exception for zero lenght of series.
+ if( values.Length == 0 )
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidMeanConditions);
+ }
+
+ // Find sum of values
+ double sum = 0;
+ foreach( double item in values )
+ {
+ sum += item;
+ }
+
+ // Calculate Mean
+ return sum / values.Length;
+ }
+
+ /// <summary>
+ /// Calculates a Variance for a series of numbers.
+ /// </summary>
+ /// <param name="values">double values</param>
+ /// <param name="sampleVariance">If variance is calculated from sample sum has to be divided by n-1.</param>
+ /// <returns>Variance</returns>
+ private double Variance( double [] values, bool sampleVariance )
+ {
+
+ // Exception for zero lenght of series.
+ if( values.Length < 1 )
+ {
+ throw new ArgumentException(SR.ExceptionStatisticalAnalysesInvalidVarianceConditions);
+ }
+
+ // Find sum of values
+ double sum = 0;
+ double mean = Mean( values );
+ foreach( double item in values )
+ {
+ sum += (item - mean) * (item - mean);
+ }
+
+ // Calculate Variance
+ if( sampleVariance )
+ {
+ return sum / ( values.Length - 1 );
+ }
+ else
+ {
+ return sum / values.Length;
+ }
+ }
+
+ #endregion // Statistical Parameters
+
+ # region Distributions
+
+ /// <summary>
+ /// Calculates the Percentage Points (probability) for the Student
+ /// t-distribution. The t-distribution is used in the hypothesis
+ /// testing of small sample data sets. Use this function in place
+ /// of a table of critical values for the t-distribution.
+ /// </summary>
+ /// <param name="tValue">The numeric value at which to evaluate the distribution.</param>
+ /// <param name="n">An integer indicating the number of degrees of freedom.</param>
+ /// <param name="oneTailed">Specifies the number of distribution tails to return.</param>
+ /// <returns>Returns the Percentage Points (probability) for the Student t-distribution.</returns>
+ private double StudentsDistribution( double tValue, int n, bool oneTailed )
+ {
+ // Validation
+ tValue = Math.Abs( tValue );
+ if( n > 300 )
+ {
+ n = 300;
+ }
+
+ if( n < 1 )
+ {
+ throw new ArgumentOutOfRangeException(SR.ExceptionStatisticalAnalysesStudentsNegativeFreedomDegree);
+ }
+
+ double result = 1 - BetaIncomplete( n / 2.0, 0.5, n / (n + tValue * tValue) );
+
+ if( oneTailed )
+ return ( 1.0 - result ) / 2.0;
+ else
+ return 1.0 - result;
+ }
+
+ /// <summary>
+ /// Returns the standard normal cumulative distribution
+ /// function. The distribution has a mean of 0 (zero) and
+ /// a standard deviation of one. Use this function in place
+ /// of a table of standard normal curve areas.
+ /// </summary>
+ /// <param name="zValue">The value for which you want the distribution.</param>
+ /// <returns>Returns the standard normal cumulative distribution.</returns>
+ private double NormalDistribution( double zValue )
+ {
+
+ double [] a = {0.31938153,-0.356563782,1.781477937,-1.821255978,1.330274429};
+ double result;
+ if (zValue<-7.0)
+ {
+ result = NormalDistributionFunction(zValue)/Math.Sqrt(1.0+zValue*zValue);
+ }
+ else if (zValue>7.0)
+ {
+ result = 1.0 - NormalDistribution(-zValue);
+ }
+ else
+ {
+ result = 0.2316419;
+ result=1.0/(1+result*Math.Abs(zValue));
+ result=1-NormalDistributionFunction(zValue)*(result*(a[0]+result*(a[1]+result*(a[2]+result*(a[3]+result*a[4])))));
+ if (zValue<=0.0)
+ result=1.0-result;
+ }
+ return result;
+ }
+
+ private double FDistribution( double x, int freedom1, int freedom2 )
+ {
+ if (x < 0)
+ throw new ArgumentOutOfRangeException(SR.ExceptionStatisticalAnalysesInvalidTValue);
+ if (freedom1 <= 0)
+ throw new ArgumentOutOfRangeException(SR.ExceptionStatisticalAnalysesInvalidDegreeOfFreedom);
+ if (freedom2 <= 0)
+ throw new ArgumentOutOfRangeException(SR.ExceptionStatisticalAnalysesInvalidDegreeOfFreedom);
+ if (x == 0)
+ return 1;
+ if (x == double.PositiveInfinity)
+ return 0;
+
+ return BetaIncomplete( freedom2 / 2.0, freedom1 / 2.0, freedom2 / ( freedom2 + freedom1 * x ) );
+ }
+
+ #endregion // Distributions
+
+ # region Inverse Distributions
+
+ /// <summary>
+ /// Calculates the t-value of the Student's t-distribution
+ /// as a function of the probability and the degrees of freedom.
+ /// </summary>
+ /// <param name="probability">The probability associated with the two-tailed Student's t-distribution.</param>
+ /// <param name="n">The number of degrees of freedom to characterize the distribution.</param>
+ /// <returns>Returns the t-value of the Student's t-distribution.</returns>
+ private double StudentsDistributionInverse( double probability, int n )
+ {
+ //Fix for boundary cases
+ if (probability == 0)
+ return double.PositiveInfinity;
+ else if (probability == 1)
+ return 0;
+ else if (probability < 0 || probability > 1)
+ throw new ArgumentOutOfRangeException(SR.ExceptionStatisticalAnalysesInvalidProbabilityValue);
+
+ int step = 0;
+ return StudentsDistributionSearch( probability, n, step, 0.0, 100000.0 );
+ }
+
+ /// <summary>
+ /// Method for calculation of Inverse T Distribution (Binary tree)
+ /// solution for non linear equations
+ /// </summary>
+ /// <param name="probability">Probability value</param>
+ /// <param name="n">Degree of freedom</param>
+ /// <param name="step">Step for Numerical solution for non linear equations</param>
+ /// <param name="start">Start for numerical process</param>
+ /// <param name="end">End for numerical process</param>
+ /// <returns>Returns F ditribution inverse</returns>
+ private double StudentsDistributionSearch( double probability, int n, int step, double start, double end )
+ {
+ step++;
+
+ double mid = ( start + end ) / 2.0;
+ double result = StudentsDistribution( mid, n, false );
+ double resultX;
+
+ if( step > 100 )
+ {
+ return mid;
+ }
+
+ if( result <= probability )
+ {
+ resultX = StudentsDistributionSearch( probability, n, step, start, mid );
+ }
+ else
+ {
+ resultX = StudentsDistributionSearch( probability, n, step, mid, end );
+ }
+
+ return resultX;
+ }
+
+ /// <summary>
+ /// Returns the inverse of the standard normal cumulative distribution.
+ /// The distribution has a mean of zero and a standard deviation of one.
+ /// </summary>
+ /// <param name="probability">A probability corresponding to the normal distribution.</param>
+ /// <returns>Returns the inverse of the standard normal cumulative distribution.</returns>
+ private double NormalDistributionInverse( double probability )
+ {
+
+ // Validation
+ if( probability < 0.00001 || probability > 0.99999 )
+ {
+ throw new ArgumentOutOfRangeException(SR.ExceptionStatisticalAnalysesNormalInvalidProbabilityValue);
+ }
+
+ double [] a = { 2.50662823884, -18.61500062529, 41.39119773534, -25.44106049637 };
+ double [] b = { -8.47351093090, 23.08336743743, -21.06224101826, 3.13082909833 };
+ double [] c = { 0.3374754822726147, 0.9761690190917186, 0.1607979714918209, 0.0276438810333863, 0.0038405729373609, 0.0003951896511919, 0.0000321767881768, 0.0000002888167364, 0.0000003960315187};
+
+ double x,r;
+
+ // Numerical Integration
+ x = probability - 0.5;
+
+ if ( Math.Abs(x) < 0.42 )
+ {
+ r = x * x;
+ r = x * ( ( ( a[3] * r + a[2] ) * r + a[1] ) * r + a[0] ) / ( ( ( ( b[3] * r + b[2] ) * r + b[1] ) * r + b[0] ) * r + 1.0 );
+ return( r );
+ }
+ r= probability;
+ if( x > 0.0 )
+ {
+ r = 1.0 - probability;
+ }
+
+ r = Math.Log( -Math.Log( r ) );
+ r = c[0] + r * ( c[1] + r * ( c[2] + r * ( c[3] + r * ( c[4] + r * ( c[5] + r * ( c[6] + r * ( c[7]+r * c[8] ) ) ) ) ) ) );
+ if( x < 0.0 )
+ {
+ r = -r;
+ }
+
+ return r;
+ }
+
+ /// <summary>
+ /// Calculates the inverse of the F probability distribution.
+ /// The F distribution can be used in an F-test that compares
+ /// the degree of variability in two data sets.
+ /// </summary>
+ /// <param name="probability">A probability associated with the F cumulative distribution.</param>
+ /// <param name="m">The numerator degrees of freedom.</param>
+ /// <param name="n">The denominator degrees of freedom.</param>
+ /// <returns>Returns the inverse of the F probability distribution.</returns>
+ private double FDistributionInverse( double probability, int m, int n )
+ {
+ //Fix for boundary cases
+ if (probability == 0)
+ return double.PositiveInfinity;
+ else if (probability == 1)
+ return 0;
+ else if (probability < 0 || probability > 1)
+ throw new ArgumentOutOfRangeException(SR.ExceptionStatisticalAnalysesInvalidProbabilityValue);
+
+ int step = 0;
+ return FDistributionSearch( probability, m, n, step, 0.0, 10000.0 );
+ }
+
+ /// <summary>
+ /// Method for calculation of Inverse F Distribution (Binary tree)
+ /// solution for non linear equations
+ /// </summary>
+ /// <param name="probability">Probability value</param>
+ /// <param name="m">Degree of freedom</param>
+ /// <param name="n">Degree of freedom</param>
+ /// <param name="step">Step for solution for non linear equations.</param>
+ /// <param name="start">Start for numerical process</param>
+ /// <param name="end">End for numerical process</param>
+ /// <returns>Returns F ditribution inverse</returns>
+ private double FDistributionSearch( double probability, int m, int n, int step, double start, double end )
+ {
+ step++;
+
+ double mid = ( start + end ) / 2.0;
+ double result = FDistribution( mid, m, n );
+ double resultX;
+
+ if( step > 30 )
+ {
+ return mid;
+ }
+
+ if( result <= probability )
+ {
+ resultX = FDistributionSearch( probability, m, n, step, start, mid );
+ }
+ else
+ {
+ resultX = FDistributionSearch( probability, m, n, step, mid, end );
+ }
+
+ return resultX;
+ }
+
+
+ #endregion // Inverse Distributions
+
+ }
+}
+
+
+
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/TechGeneralIndicators.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/TechGeneralIndicators.cs
new file mode 100644
index 00000000000..b411be63253
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/TechGeneralIndicators.cs
@@ -0,0 +1,876 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: TechGeneralIndicators.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting.Formulas
+//
+// Classes: TechGeneralIndicators
+//
+// Purpose: This class is used for calculations of
+// general technical analyses indicators.
+//
+// Reviewed: GS - August 7, 2002
+// AG - August 7, 2002
+//
+//===================================================================
+
+
+using System;
+using System.Globalization;
+
+
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.Formulas
+#else
+ namespace System.Web.UI.DataVisualization.Charting.Formulas
+#endif
+{
+ /// <summary>
+ /// This class is used for calculations of general
+ /// technical analyses indicators.
+ /// </summary>
+ internal class GeneralTechnicalIndicators : PriceIndicators
+ {
+ #region Properties
+
+ /// <summary>
+ /// Formula Module name
+ /// </summary>
+ override public string Name { get { return SR.FormulaNameGeneralTechnicalIndicators; } }
+
+ #endregion
+
+ #region Formulas
+
+ /// <summary>
+ /// Standard Deviation is a statistical measure of volatility.
+ /// Standard Deviation is typically used as a component of
+ /// other indicators, rather than as a stand-alone indicator.
+ /// For example, Bollinger Bands are calculated by adding
+ /// a security's Standard Deviation to a moving average.
+ /// High Standard Deviation values occur when the data item
+ /// being analyzed (e.g., prices or an indicator) is changing
+ /// dramatically. Similarly, low Standard Deviation values
+ /// occur when prices are stable.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 1 Y value.
+ /// Output:
+ /// - 1 Y value Standard Deviation
+ /// Parameters:
+ /// - Periods for standard deviation ( used for moving average )
+ /// Extra Parameters:
+ /// -
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ /// <param name="extraParameterList">Array of strings - Extra parameters</param>
+ private void StandardDeviation(double [][] inputValues, out double [][] outputValues, string [] parameterList, string [] extraParameterList)
+ {
+ int length = inputValues.Length;
+
+ // Period for standard deviation ( used for moving average )
+ int period;
+ try
+ {period = int.Parse( parameterList[0], System.Globalization.CultureInfo.InvariantCulture );}
+ catch( Exception e )
+ {
+ if (e.Message == SR.ExceptionObjectReferenceIsNull)
+ throw new InvalidOperationException(SR.ExceptionPriceIndicatorsPeriodMissing);
+ else
+ throw new InvalidOperationException(SR.ExceptionPriceIndicatorsPeriodMissing + e.Message);
+ }
+
+ if( period <= 0 )
+ throw new InvalidOperationException(SR.ExceptionPeriodParameterIsNegative);
+
+ // Starting average from the first data point or after period.
+ bool startFromFirst = bool.Parse( extraParameterList[0] );
+
+ // There is no enough series
+ if( length != 2 )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsFormulaRequiresOneArray);
+
+ // Different number of x and y values
+ if( inputValues[0].Length != inputValues[1].Length )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsSameXYNumber);
+
+ // Not enough values for moving average in Standard deviation.
+ if( inputValues[0].Length < period )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsNotEnoughPoints);
+
+ outputValues = new double [2][];
+
+ StandardDeviation( inputValues[1], out outputValues[1], period, startFromFirst );
+
+ // Set X values
+ outputValues[0] = new double [outputValues[1].Length];
+ for( int index = 0; index < outputValues[1].Length; index++ )
+ {
+ if( startFromFirst )
+ outputValues[0][index] = inputValues[0][index];
+ else
+ outputValues[0][index] = inputValues[0][index+period-1];
+ }
+ }
+
+ /// <summary>
+ /// The Average True Range ("ATR") is a measure of volatility. It was introduced
+ /// by Welles Wilder in his book, New Concepts in Technical Trading Systems, and
+ /// has since been used as a component of many indicators and trading systems. Wilder
+ /// has found that high ATR values often occur at market bottoms following a "panic"
+ /// sell-off. Low Average True Range values are often found during extended sideways
+ /// periods, such as those found at tops and after consolidation periods. The Average
+ /// True Range can be interpreted using the same techniques that are used with
+ /// the other volatility indicators.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 3 Y values ( High, Low, Close ).
+ /// Output:
+ /// - 1 Y value AverageTrueRange
+ /// Parameters:
+ /// - Periods (Default 14) = is used to configure the number of periods to calculate the ATR
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ private void AverageTrueRange(double [][] inputValues, out double [][] outputValues, string [] parameterList)
+ {
+ // There is no enough input series
+ if( inputValues.Length != 4 )
+ throw new ArgumentException( SR.ExceptionPriceIndicatorsFormulaRequiresThreeArrays);
+
+ // Different number of x and y values
+ CheckNumOfValues( inputValues, 3 );
+
+ // Period
+ int period;
+ if (parameterList.Length < 1 ||
+ !int.TryParse(parameterList[0], NumberStyles.Any, CultureInfo.InvariantCulture, out period))
+ {
+ period = 14;
+ }
+
+ if( period <= 0 )
+ throw new InvalidOperationException(SR.ExceptionPeriodParameterIsNegative);
+
+ // The distance from today's high to today's low
+ double distanceOne;
+
+ // The distance from yesterday's close to today's high
+ double distanceTwo;
+
+ // The distance from yesterday's close to today's low
+ double distanceTree;
+
+ double [] trueRange = new double [inputValues[0].Length - 1];
+
+ // True Range
+ for( int index = 1; index < inputValues[0].Length; index++ )
+ {
+ // The distance from today's high to today's low
+ distanceOne = Math.Abs( inputValues[1][index] - inputValues[2][index] );
+
+ // The distance from yesterday's close to today's high
+ distanceTwo = Math.Abs( inputValues[3][index-1] - inputValues[1][index] );
+
+ // The distance from yesterday's close to today's low
+ distanceTree = Math.Abs( inputValues[3][index-1] - inputValues[2][index] );
+
+ // True Range
+ trueRange[index-1] = Math.Max( Math.Max( distanceOne, distanceTwo ), distanceTree );
+ }
+
+ outputValues = new double [2][];
+
+ outputValues[0] = new double [inputValues[0].Length-period];
+
+ // Moving average of true range
+ MovingAverage( trueRange, out outputValues[1], period, false );
+
+ // Set X values
+ for( int index = period; index < inputValues[0].Length; index++ )
+ {
+ outputValues[0][index-period] = inputValues[0][index];
+ }
+ }
+
+ /// <summary>
+ /// The Ease of Movement indicator shows the relationship between volume and price
+ /// change. This indicator shows how much volume is required to move prices. The Ease
+ /// of Movement indicator was developed Richard W. Arms, Jr., the creator of Equivolume.
+ /// High Ease of Movement values occur when prices are moving upward on lightStyle volume.
+ /// Low Ease of Movement values occur when prices are moving downward on lightStyle volume.
+ /// If prices are not moving, or if heavy volume is required to move prices, then
+ /// indicator will also be near zero.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 3 Y values ( High, Low, Volume ).
+ /// Output:
+ /// - 1 Y value Ease Of Movement
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ private void EaseOfMovement(double [][] inputValues, out double [][] outputValues)
+ {
+ // There is no enough input series
+ if( inputValues.Length != 4 )
+ throw new ArgumentException( SR.ExceptionPriceIndicatorsFormulaRequiresThreeArrays);
+
+ // Different number of x and y values
+ CheckNumOfValues( inputValues, 3 );
+
+ double MidPointMove;
+ double BoxRattio;
+
+ outputValues = new double [2][];
+
+ outputValues[0] = new double [inputValues[0].Length - 1];
+ outputValues[1] = new double [inputValues[0].Length - 1];
+
+ // Ease Of Movement
+ for( int index = 1; index < inputValues[0].Length; index++ )
+ {
+ // Set X values
+ outputValues[0][index - 1] = inputValues[0][index];
+
+ // Calculate the Mid-point Move for each day:
+ MidPointMove = ( inputValues[1][index] + inputValues[2][index] ) / 2 - ( inputValues[1][index - 1] + inputValues[2][index - 1] ) / 2;
+
+ // The Box Ratio determines the ratio between height and width of the Equivolume box:
+ BoxRattio = ( inputValues[3][index] ) / (( inputValues[1][index] - inputValues[2][index] ) );
+
+ // Ease of Movement is then calculated as:
+ outputValues[1][index - 1] = MidPointMove / BoxRattio;
+ }
+ }
+
+ /// <summary>
+ /// The Mass Index was designed to identify trend reversals by measuring the narrowing
+ /// and widening of the range between the high and low prices. As this range widens, the
+ /// Mass Index increases; as the range narrows the Mass Index decreases.
+ /// The Mass Index was developed by Donald Dorsey. According to Mr. Dorsey, the most
+ /// significant pattern to watch for is a "reversal bulge." A reversal bulge occurs when
+ /// a 25-period Mass Index rises above 27.0 and subsequently falls below 26.5. A reversal
+ /// in price is then likely. The overall price trend (i.e., trending or trading range)
+ /// is unimportant.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 2 Y values ( High, Low ).
+ /// Output:
+ /// - 1 Y value Mass Index
+ /// Parameters:
+ /// - Period = is used to calculate the accumulation, By default this property is set to 25.
+ /// - AveragePeriod = is used to calculate Simple Moving Avg, By default this property is set to 9.
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ private void MassIndex(double [][] inputValues, out double [][] outputValues, string [] parameterList)
+ {
+ // There is no enough input series
+ if( inputValues.Length != 3 )
+ throw new ArgumentException( SR.ExceptionPriceIndicatorsFormulaRequiresTwoArrays);
+
+ // Different number of x and y values
+ CheckNumOfValues( inputValues, 2 );
+
+ // Period
+ int period;
+ if (parameterList.Length < 1 ||
+ !int.TryParse(parameterList[0], NumberStyles.Any, CultureInfo.InvariantCulture, out period))
+ {
+ period = 25;
+ }
+
+ if( period <= 0 )
+ throw new InvalidOperationException(SR.ExceptionPeriodParameterIsNegative);
+
+ // Average Period
+ int averagePeriod;
+ if (parameterList.Length < 2 ||
+ !int.TryParse(parameterList[1], NumberStyles.Any, CultureInfo.InvariantCulture, out averagePeriod))
+ {
+ averagePeriod = 9;
+ }
+
+ if( period <= 0 )
+ throw new InvalidOperationException(SR.ExceptionPeriodAverageParameterIsNegative);
+
+ double [] highLow = new double [inputValues[0].Length];
+ double [] average;
+ double [] secondAverage;
+
+ for( int index = 0; index < inputValues[0].Length; index++ )
+ {
+ highLow[index] = inputValues[1][index] - inputValues[2][index];
+ }
+
+ // Find exponential moving average
+ ExponentialMovingAverage( highLow, out average, averagePeriod, false );
+
+ // Find exponential moving average of exponential moving average
+ ExponentialMovingAverage( average, out secondAverage, averagePeriod, false );
+
+ outputValues = new double [2][];
+
+ outputValues[0] = new double [secondAverage.Length - period + 1];
+ outputValues[1] = new double [secondAverage.Length - period + 1];
+
+ // Mass Index
+ int outIndex = 0;
+ double sum = 0;
+ for( int index = 2 * averagePeriod - 3 + period; index < inputValues[0].Length; index++ )
+ {
+ // Set X values
+ outputValues[0][outIndex] = inputValues[0][index];
+
+ sum = 0;
+ for( int indexSum = index - period + 1; indexSum <= index; indexSum++ )
+ {
+ sum += average[indexSum - averagePeriod + 1] / secondAverage[indexSum - 2 * averagePeriod + 2];
+ }
+
+ // Set Y values
+ outputValues[1][outIndex] = sum;
+
+ outIndex++;
+ }
+ }
+
+ /// <summary>
+ /// The Performance indicator displays a security's price performance as
+ /// a percentage. This is sometimes called a "normalized" chart. The
+ /// Performance indicator displays the percentage that the security
+ /// has increased since the first period displayed. For example, if
+ /// the Performance indicator is 10, it means that the security's
+ /// price has increased 10% since the first period displayed on the
+ /// left side of the chart. Similarly, a value of -10% means that
+ /// the security's price has fallen by 10% since the first period
+ /// displayed.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 1 Y value ( Close ).
+ /// Output:
+ /// - 1 Y value Performance
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ private void Performance(double [][] inputValues, out double [][] outputValues)
+ {
+ // There is no enough input series
+ if( inputValues.Length != 2 )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsFormulaRequiresOneArray);
+
+ // Different number of x and y values
+ CheckNumOfValues( inputValues, 1 );
+
+ outputValues = new double [2][];
+
+ outputValues[0] = new double [inputValues[0].Length];
+ outputValues[1] = new double [inputValues[0].Length];
+
+ // Performance indicator
+ for( int index = 0; index < inputValues[0].Length; index++ )
+ {
+ // Set X values
+ outputValues[0][index] = inputValues[0][index];
+
+ // Set Y values
+ outputValues[1][index] = ( inputValues[1][index] - inputValues[1][0] ) / inputValues[1][0] * 100;
+ }
+ }
+
+ /// <summary>
+ /// Rate of Change is used to monitor momentum by making direct comparisons between current
+ /// and past prices on a continual basis. The results can be used to determine the strength
+ /// of price trends. Note: This study is the same as the Momentum except that Momentum uses
+ /// subtraction in its calculations while Rate of Change uses division. The resulting lines
+ /// of these two studies operated over the same data will look exactly the same - only the
+ /// scale values will differ. The Price Rate-of-Change ("----") indicator displays the
+ /// difference between the current price and the price x-time periods ago. The difference
+ /// can be displayed in either points or as a percentage. The Momentum indicator displays
+ /// the same information, but expresses it as a ratio. When the Rate-of-Change displays
+ /// the price change in points, it subtracts the price x-time periods ago from today’s price.
+ /// When the Rate-of-Change displays the price change as a percentage, it divides
+ /// the price change by price x-time period’s ago.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 1 Y value ( Close ).
+ /// Output:
+ /// - 1 Y value Rate of Change
+ /// Parameters:
+ /// - Periods = is used to configure the number of periods to calculate the rate of Change. By default the Periods property is set to 10.
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ private void RateOfChange(double [][] inputValues, out double [][] outputValues, string [] parameterList)
+ {
+ // There is no enough input series
+ if( inputValues.Length != 2 )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsFormulaRequiresOneArray);
+
+ // Different number of x and y values
+ CheckNumOfValues( inputValues, 1 );
+
+ // Period
+ int period;
+ if (parameterList.Length < 1 ||
+ !int.TryParse(parameterList[0], NumberStyles.Any, CultureInfo.InvariantCulture, out period))
+ {
+ period = 10;
+ }
+
+ if( period <= 0 )
+ throw new InvalidOperationException(SR.ExceptionPeriodParameterIsNegative);
+
+ outputValues = new double [2][];
+
+ outputValues[0] = new double [inputValues[0].Length - period];
+ outputValues[1] = new double [inputValues[0].Length - period];
+
+ // Rate Of Change
+ for( int index = period; index < inputValues[0].Length; index++ )
+ {
+ // Set X values
+ outputValues[0][index - period] = inputValues[0][index];
+
+ // Set Y values
+ outputValues[1][index - period] = ( inputValues[1][index] - inputValues[1][index - period] ) / inputValues[1][index - period] * 100;
+ }
+ }
+
+ /// <summary>
+ /// This indicator was developed by Welles Wilder Jr. Relative Strength is often
+ /// used to identify price tops and bottoms by keying on specific levels
+ /// (usually "30" and "70") on the RSI chart which is scaled from from 0-100.
+ /// The study is also useful to detect the following:
+ /// - Movement which might not be as readily apparent on the bar chart
+ /// - Failure swings above 70 or below 30 which can warn of coming reversals
+ /// - Support and resistance levels
+ /// - Divergence between the RSI and price which is often a useful reversal indicator
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 1 Y value ( Close ).
+ /// Output:
+ /// - 1 Y value RelativeStrengthIndex
+ /// Parameters:
+ /// - Periods = is used to configure the number of periods to calculate the RSI indicator. By default the Periods property is set to 10.
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ private void RelativeStrengthIndex(double [][] inputValues, out double [][] outputValues, string [] parameterList)
+ {
+ // There is no enough input series
+ if( inputValues.Length != 2 )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsFormulaRequiresOneArray);
+
+ // Different number of x and y values
+ CheckNumOfValues( inputValues, 1 );
+
+ // Period
+ int period;
+ if (parameterList.Length < 1 ||
+ !int.TryParse(parameterList[0], NumberStyles.Any, CultureInfo.InvariantCulture, out period))
+ {
+ period = 10;
+ }
+
+ if( period <= 0 )
+ throw new InvalidOperationException(SR.ExceptionPeriodParameterIsNegative);
+
+ double [] upward = new double[inputValues[0].Length-1];
+ double [] downward = new double[inputValues[0].Length-1];
+
+ for( int index = 1; index < inputValues[0].Length; index++ )
+ {
+ // Upward - price is going up
+ if( inputValues[1][index - 1] < inputValues[1][index] )
+ {
+ upward[index-1] = inputValues[1][index] - inputValues[1][index - 1];
+ downward[index-1] = 0.0;
+ }
+ // Downward - price is going down
+ if( inputValues[1][index - 1] > inputValues[1][index] )
+ {
+ upward[index-1] = 0.0;
+ downward[index-1] = inputValues[1][index - 1] - inputValues[1][index];
+ }
+ }
+
+ double [] averageUpward = new double[inputValues[0].Length];
+ double [] averageDownward = new double[inputValues[0].Length];
+
+ ExponentialMovingAverage(downward, out averageDownward, period, false );
+ ExponentialMovingAverage(upward, out averageUpward, period, false );
+
+ outputValues = new double [2][];
+
+ outputValues[0] = new double [averageDownward.Length];
+ outputValues[1] = new double [averageDownward.Length];
+
+ // Find RSI
+ for( int index = 0; index < averageDownward.Length; index++ )
+ {
+ // Set X values
+ outputValues[0][index] = inputValues[0][index + period];
+
+ // Calculate the Relative Strength Index (RSI):
+ outputValues[1][index] = 100 - 100 / ( 1 + averageUpward[index] / averageDownward[index] );
+ }
+ }
+
+ /// <summary>
+ /// TripleExponentialMovingAverage is a momentum indicator that displays the percent rate-of-change of a triple
+ /// exponentially smoothed moving average of the security's closing price. It is designed
+ /// to keep you in trends equal to or shorter than the number of periods you specify.
+ /// The TripleExponentialMovingAverage indicator oscillates around a zero line. Its triple exponential smoothing is
+ /// designed to filter out "insignificant" cycles (i.e., those that are shorter than
+ /// the number of periods you specify). Trades should be placed when the indicator changes
+ /// direction (i.e., buy when it turns up and sell when it turns down). You may want to
+ /// plot a 9-period moving average of the TripleExponentialMovingAverage to create a "signal" line (similar to the
+ /// MovingAverageConvergenceDivergence indicator, and then buy when the TripleExponentialMovingAverage rises above its signal, and sell when it
+ /// falls below its signal. Divergences between the security and the TripleExponentialMovingAverage can also help
+ /// identify turning points.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 1 Y values ( Close ).
+ /// Output:
+ /// - 1 Y value ( TripleExponentialMovingAverage ).
+ /// Parameters:
+ /// - Period = is used to calculate the Exponential Moving Avg, By default this property is set to 12.
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ private void Trix(double [][] inputValues, out double [][] outputValues, string [] parameterList)
+ {
+ // There is no enough input series
+ if( inputValues.Length != 2 )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsFormulaRequiresOneArray);
+
+ // Different number of x and y values
+ CheckNumOfValues( inputValues, 1 );
+
+ // Period
+ int period;
+ if (parameterList.Length < 1 ||
+ !int.TryParse(parameterList[0], NumberStyles.Any, CultureInfo.InvariantCulture, out period))
+ {
+ period = 12;
+ }
+
+ if( period <= 0 )
+ throw new InvalidOperationException(SR.ExceptionPeriodParameterIsNegative);
+
+ double [] exp1; // Exponential Moving average of input values
+ double [] exp2; // Exponential Moving average of exp1
+ double [] exp3; // Exponential Moving average of exp2
+
+ // Find exponential moving average
+ ExponentialMovingAverage( inputValues[1], out exp1, period, false );
+
+ // Find exponential moving average
+ ExponentialMovingAverage( exp1, out exp2, period, false );
+
+ // Find exponential moving average
+ ExponentialMovingAverage( exp2, out exp3, period, false );
+
+ outputValues = new double [2][];
+
+ outputValues[0] = new double [inputValues[0].Length - period * 3 + 2];
+ outputValues[1] = new double [inputValues[0].Length - period * 3 + 2];
+
+ // Calculate TripleExponentialMovingAverage
+ int outIndex = 0;
+ for( int index = period * 3 - 2; index < inputValues[0].Length; index++ )
+ {
+ // set X value
+ outputValues[0][outIndex] = inputValues[0][index];
+
+ // set Y value
+ outputValues[1][outIndex] = ( exp3[outIndex+1] - exp3[outIndex] ) / exp3[outIndex];
+
+ outIndex++;
+ }
+ }
+
+ /// <summary>
+ /// The MovingAverageConvergenceDivergence is used to determine overbought or oversold conditions in the market. Written
+ /// for stocks and stock indices, MovingAverageConvergenceDivergence can be used for commodities as well. The MovingAverageConvergenceDivergence line
+ /// is the difference between the long and short exponential moving averages of the chosen
+ /// item. The signal line is an exponential moving average of the MovingAverageConvergenceDivergence line. Signals are
+ /// generated by the relationship of the two lines. As with RSI and Stochastics,
+ /// divergences between the MovingAverageConvergenceDivergence and prices may indicate an upcoming trend reversal. The MovingAverageConvergenceDivergence
+ /// is a trend following momentum indicator that shows the relationship between two
+ /// moving averages of prices. The MovingAverageConvergenceDivergence is the difference between a 26-day and 12-day
+ /// exponential moving average. A 9-day exponential moving average, called the "signal"
+ /// (or "trigger") line is plotted on top of the MovingAverageConvergenceDivergence to show buy/sell opportunities. The
+ /// MovingAverageConvergenceDivergence is calculated by subtracting the value of a 26-day exponential moving average
+ /// from a 12-day exponential moving average. A 9-day dotted exponential moving average of
+ /// the MovingAverageConvergenceDivergence (the "signal" line) is then plotted on top of the MovingAverageConvergenceDivergence.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 1 Y value ( Close ).
+ /// Output:
+ /// - 1 Y value ( MovingAverageConvergenceDivergence ).
+ /// Parameters:
+ /// - ShortPeriod = is used to configure the short Exponential Moving Average, By default this property is set to 12.
+ /// - LongPeriod = is used to configure the Int64 Exponential Moving Average, By default this property is set to 26.
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ private void Macd(double [][] inputValues, out double [][] outputValues, string [] parameterList)
+ {
+ // There is no enough input series
+ if( inputValues.Length != 2 )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsFormulaRequiresOneArray);
+
+ // Different number of x and y values
+ CheckNumOfValues( inputValues, 1 );
+
+ // Short Period
+ int shortPeriod;
+ if (parameterList.Length < 1 ||
+ !int.TryParse(parameterList[0], NumberStyles.Any, CultureInfo.InvariantCulture, out shortPeriod))
+ {
+ shortPeriod = 12;
+ }
+
+ if( shortPeriod <= 0 )
+ throw new InvalidOperationException(SR.ExceptionPeriodShortParameterIsNegative);
+
+ // Int64 Period
+ int longPeriod;
+ if (parameterList.Length < 2 ||
+ !int.TryParse(parameterList[1], NumberStyles.Any, CultureInfo.InvariantCulture, out longPeriod))
+ {
+ longPeriod = 26;
+ }
+
+ if( longPeriod <= 0 )
+ throw new InvalidOperationException(SR.ExceptionPeriodLongParameterIsNegative);
+
+ if( longPeriod <= shortPeriod )
+ throw new InvalidOperationException(SR.ExceptionIndicatorsLongPeriodLessThenShortPeriod);
+
+ double [] longAverage; // Int64 Average
+ double [] shortAverage; // Short Average
+
+ // Find Int64 exponential moving average
+ ExponentialMovingAverage( inputValues[1], out longAverage, longPeriod, false );
+
+ // Find Short exponential moving average
+ ExponentialMovingAverage( inputValues[1], out shortAverage, shortPeriod, false );
+
+ outputValues = new double [2][];
+
+ outputValues[0] = new double [inputValues[0].Length - longPeriod + 1];
+ outputValues[1] = new double [inputValues[0].Length - longPeriod + 1];
+
+ // Calculate MovingAverageConvergenceDivergence
+ int outIndex = 0;
+ for( int index = longPeriod - 1; index < inputValues[0].Length; index++ )
+ {
+ // set X value
+ outputValues[0][outIndex] = inputValues[0][index];
+
+ // set Y value
+ outputValues[1][outIndex] = shortAverage[ outIndex + longPeriod - shortPeriod ] - longAverage[outIndex];
+
+ outIndex++;
+ }
+ }
+
+ /// <summary>
+ /// The CCI is a timing system that is best applied to commodity contracts which
+ /// have cyclical or seasonal tendencies. CCI does not determine the length of
+ /// cycles - it is designed to detect when such cycles begin and end through
+ /// the use of a statistical analysis which incorporates a moving average and a divisor
+ /// reflecting both the possible and actual trading ranges. Although developed primarily
+ /// for commodities, the CCI could conceivably be used to analyze stocks as well. The
+ /// Commodity Channel Index ("CCI") measures the variation of a security’s price from
+ /// its statistical mean. High values show that prices are unusually high compared to
+ /// average prices whereas low values indicate that prices are unusually low.
+ /// 1. Calculate today's Typical Price (TP) = (H+L+C)/3 where H = high; L = low, and C = close.
+ /// 2. Calculate today's 20-day Simple Moving Average of the Typical Price (SMATP).
+ /// 3. Calculate today's Mean Deviation. First, calculate the absolute value of the difference
+ /// between today's SMATP and the typical price for each of the past 20 days.
+ /// Add all of these absolute values together and divide by 20 to find the Mean Deviation.
+ /// 4. The final step is to apply the Typical Price (TP), the Simple Moving Average of the
+ /// Typical Price (SMATP), the Mean Deviation and a Constant (.015).
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 3 Y values ( Hi, Low, Close ).
+ /// Output:
+ /// - 1 Y value ( CCI ).
+ /// Parameters:
+ /// - Periods = is used to configure the number of periods to calculate the CCI. By default the Periods property is set to 10.
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ private void CommodityChannelIndex(double [][] inputValues, out double [][] outputValues, string [] parameterList)
+ {
+ // There is no enough input series
+ if( inputValues.Length != 4 )
+ throw new ArgumentException( SR.ExceptionPriceIndicatorsFormulaRequiresThreeArrays);
+
+ // Different number of x and y values
+ CheckNumOfValues( inputValues, 3 );
+
+ // Period
+ int period;
+ if (parameterList.Length < 1 ||
+ !int.TryParse(parameterList[0], NumberStyles.Any, CultureInfo.InvariantCulture, out period))
+ {
+ period = 10;
+ }
+
+ if( period <= 0 )
+ throw new InvalidOperationException(SR.ExceptionPeriodParameterIsNegative);
+
+ // Typical Price
+ double [] typicalPrice = new double[inputValues[0].Length];
+
+ // Typical Price loop
+ for( int index = 0; index < inputValues[0].Length; index++ )
+ {
+ typicalPrice[index] = ( inputValues[1][index] + inputValues[2][index] + inputValues[3][index] ) / 3.0;
+ }
+
+ // Moving Average
+ double [] movingAverage;
+
+ // Simple Moving Average of the Typical Price
+ MovingAverage( typicalPrice, out movingAverage, period, false );
+
+ // Calculate today's Mean Deviation. First, calculate the absolute value
+ // of the difference between today's SMATP and the typical price for each
+ // of the past 20 days. Add all of these absolute values together and
+ // divide by 20 to find the Mean Deviation.
+
+ // Mean Deviation
+ double [] meanDeviation = new double[movingAverage.Length];
+
+ double sum =0;
+ for( int index = 0; index < movingAverage.Length; index++ )
+ {
+ sum = 0;
+ for( int indexSum = index; indexSum < index + period; indexSum++ )
+ {
+ sum += Math.Abs( movingAverage[index] - typicalPrice[indexSum] );
+ }
+ meanDeviation[index] = sum / period;
+ }
+
+ outputValues = new double [2][];
+
+ outputValues[0] = new double [meanDeviation.Length];
+ outputValues[1] = new double [meanDeviation.Length];
+
+
+ for( int index = 0; index < meanDeviation.Length; index++ )
+ {
+ // Set X values
+ outputValues[0][index] = inputValues[0][index + period - 1];
+
+ // Set Y values
+ outputValues[1][index] = ( typicalPrice[index + period - 1] - movingAverage[index] ) / ( 0.015 * meanDeviation[index] );
+
+ }
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public GeneralTechnicalIndicators()
+ {
+ }
+
+ /// <summary>
+ /// The first method in the module, which converts a formula
+ /// name to the corresponding private method.
+ /// </summary>
+ /// <param name="formulaName">String which represent a formula name</param>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Formula parameters</param>
+ /// <param name="extraParameterList">Array of strings - Extra Formula parameters from DataManipulator object</param>
+ /// <param name="outLabels">Array of strings - Used for Labels. Description for output results.</param>
+ override public void Formula( string formulaName, double [][] inputValues, out double [][] outputValues, string [] parameterList, string [] extraParameterList, out string [][] outLabels )
+ {
+ string name;
+ outputValues = null;
+
+ name = formulaName.ToUpper(System.Globalization.CultureInfo.InvariantCulture);
+
+ // Not used for these formulas.
+ outLabels = null;
+
+ try
+ {
+ switch( name )
+ {
+ case "STANDARDDEVIATION":
+ StandardDeviation( inputValues, out outputValues, parameterList, extraParameterList );
+ break;
+ case "AVERAGETRUERANGE":
+ AverageTrueRange( inputValues, out outputValues, parameterList );
+ break;
+ case "EASEOFMOVEMENT":
+ EaseOfMovement( inputValues, out outputValues );
+ break;
+ case "MASSINDEX":
+ MassIndex( inputValues, out outputValues, parameterList );
+ break;
+ case "PERFORMANCE":
+ Performance( inputValues, out outputValues );
+ break;
+ case "RATEOFCHANGE":
+ RateOfChange( inputValues, out outputValues, parameterList );
+ break;
+ case "RELATIVESTRENGTHINDEX":
+ RelativeStrengthIndex( inputValues, out outputValues, parameterList );
+ break;
+ case "TRIPLEEXPONENTIALMOVINGAVERAGE":
+ Trix( inputValues, out outputValues, parameterList );
+ break;
+ case "MOVINGAVERAGECONVERGENCEDIVERGENCE":
+ Macd( inputValues, out outputValues, parameterList );
+ break;
+ case "COMMODITYCHANNELINDEX":
+ CommodityChannelIndex( inputValues, out outputValues, parameterList );
+ break;
+ default:
+ outputValues = null;
+ break;
+ }
+ }
+ catch( IndexOutOfRangeException )
+ {
+ throw new InvalidOperationException( SR.ExceptionFormulaInvalidPeriod( name ) );
+ }
+ catch( OverflowException )
+ {
+ throw new InvalidOperationException( SR.ExceptionFormulaNotEnoughDataPoints( name ) );
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/TimeSeriesAndForecasting.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/TimeSeriesAndForecasting.cs
new file mode 100644
index 00000000000..4af27bec55a
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/TimeSeriesAndForecasting.cs
@@ -0,0 +1,647 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: TimeSeriesAndForecasting.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting.Formulas
+//
+// Classes: TimeSeriesAndForecasting
+//
+// Purpose: This class is used for calculations of
+// time series and forecasting
+//
+// Reviewed: GS - August 7, 2002
+// AG - August 7, 2002
+//
+//===================================================================
+
+using System;
+using System.Globalization;
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.Formulas
+#else
+ namespace System.Web.UI.DataVisualization.Charting.Formulas
+#endif
+{
+ /// <summary>
+ /// This class is used for calculations of
+ /// time series and forecasting
+ /// </summary>
+ internal class TimeSeriesAndForecasting : IFormula
+ {
+ #region Enumeration
+
+ /// <summary>
+ /// AxisName of regression
+ /// </summary>
+ internal enum RegressionType
+ {
+ /// <summary>
+ /// Polynomial trend
+ /// </summary>
+ Polynomial,
+
+ /// <summary>
+ /// IsLogarithmic trend
+ /// </summary>
+ Logarithmic,
+
+ /// <summary>
+ /// Power trend
+ /// </summary>
+ Power,
+
+ /// <summary>
+ /// Exponential trend
+ /// </summary>
+ Exponential
+ }
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Formula Module name
+ /// </summary>
+ virtual public string Name { get { return SR.FormulaNameTimeSeriesAndForecasting; } }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Public constructor.
+ /// </summary>
+ public TimeSeriesAndForecasting()
+ {
+
+ }
+
+ /// <summary>
+ /// The first method in the module, which converts a formula
+ /// name to the corresponding private method.
+ /// </summary>
+ /// <param name="formulaName">String which represent a formula name</param>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Formula parameters</param>
+ /// <param name="extraParameterList">Array of strings - Extra Formula parameters from DataManipulator object</param>
+ /// <param name="outLabels">Array of strings - Used for Labels. Description for output results.</param>
+ virtual public void Formula( string formulaName, double [][] inputValues, out double [][] outputValues, string [] parameterList, string [] extraParameterList, out string [][] outLabels )
+ {
+ string name;
+
+ name = formulaName.ToUpper(System.Globalization.CultureInfo.InvariantCulture);
+
+ // Not used for these formulas.
+ outLabels = null;
+
+ try
+ {
+ switch( name )
+ {
+ case "FORECASTING":
+ Forecasting( inputValues, out outputValues, parameterList );
+ break;
+ default:
+ outputValues = null;
+ break;
+ }
+ }
+ catch( IndexOutOfRangeException )
+ {
+ throw new InvalidOperationException( SR.ExceptionFormulaInvalidPeriod(name) );
+ }
+ catch( OverflowException )
+ {
+ throw new InvalidOperationException( SR.ExceptionFormulaNotEnoughDataPoints( name ) );
+ }
+ }
+
+ #endregion
+
+ #region Formulas
+
+ /// <summary>
+ /// Forecasting formula predicts future values of the time series variable.
+ /// Multiple regressions are used for this forecasting model. Any method
+ /// of fitting equations to data may be called regression. Such equations
+ /// are valuable for at least two purposes: making predictions and judging
+ /// the strength of relationships. Of the various methods of performing
+ /// regression, Last Square is the most widely used. This formula returns
+ /// two more series, which represents upper and lower bond of error. Error
+ /// is based on standard deviation and represents a linear combination of
+ /// approximation error and forecasting error.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - Y values.
+ /// Output:
+ /// - Forecasting
+ /// - upper bond error
+ /// - lower bond error
+ /// Parameters:
+ /// - Polynomial degree (Default: 2 - Linear regression )
+ /// - Forecasting period (Default: Half of the series length )
+ /// - Returns Approximation error (Default: true)
+ /// - Returns Forecasting error (Default: true)
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
+ private void Forecasting(double[][] inputValues, out double[][] outputValues, string[] parameterList)
+ {
+ // Polynomial degree
+ int degree;
+ RegressionType regressionType = RegressionType.Polynomial;
+
+ if (String.Equals(parameterList[0],"Exponential", StringComparison.OrdinalIgnoreCase))
+ {
+ regressionType = RegressionType.Exponential;
+ degree = 2;
+ }
+ else if (String.Equals(parameterList[0],"Linear", StringComparison.OrdinalIgnoreCase))
+ {
+ regressionType = RegressionType.Polynomial;
+ degree = 2;
+ }
+ else if (String.Equals(parameterList[0],"IsLogarithmic", StringComparison.OrdinalIgnoreCase) ||
+ String.Equals(parameterList[0],"Logarithmic", StringComparison.OrdinalIgnoreCase))
+ {
+ regressionType = RegressionType.Logarithmic;
+ degree = 2;
+ }
+ else if (String.Equals(parameterList[0],"Power", StringComparison.OrdinalIgnoreCase))
+ {
+ regressionType = RegressionType.Power;
+ degree = 2;
+ }
+ else
+ {
+ if (parameterList.Length < 1 ||
+ !int.TryParse(parameterList[0], NumberStyles.Any, CultureInfo.InvariantCulture, out degree))
+ {
+ degree = 2;
+ }
+ }
+
+
+ if (degree > 5 || degree < 1)
+ throw new InvalidOperationException(SR.ExceptionForecastingDegreeInvalid);
+
+ if (degree > inputValues[0].Length)
+ throw new InvalidOperationException(SR.ExceptionForecastingNotEnoughDataPoints(degree.ToString(System.Globalization.CultureInfo.InvariantCulture)));
+
+ // Forecasting period
+ int period;
+ if (parameterList.Length < 2 ||
+ !int.TryParse(parameterList[1], NumberStyles.Any, CultureInfo.InvariantCulture, out period))
+ {
+ period = inputValues[0].Length / 2;
+ }
+
+ // Approximation error
+ bool approximationError;
+ if (parameterList.Length < 3 ||
+ !bool.TryParse(parameterList[2], out approximationError))
+ {
+ approximationError = true;
+ }
+
+ // Forecasting error
+ bool forecastingError;
+ if (parameterList.Length < 4 ||
+ !bool.TryParse(parameterList[3], out forecastingError))
+ {
+ forecastingError = true;
+ }
+
+ double[][] tempOut;
+ // Find regresion
+ Regression(regressionType, inputValues, out tempOut, degree, period);
+
+ // If error disabled get out from procedure
+ if (!forecastingError && !approximationError)
+ {
+ outputValues = tempOut;
+ return;
+ }
+
+ double[][] inputErrorEst = new double[2][];
+ double[][] outputErrorEst;
+ inputErrorEst[0] = new double[inputValues[0].Length / 2];
+ inputErrorEst[1] = new double[inputValues[0].Length / 2];
+
+ for (int index = 0; index < inputValues[0].Length / 2; index++)
+ {
+ inputErrorEst[0][index] = inputValues[0][index];
+ inputErrorEst[1][index] = inputValues[1][index];
+ }
+
+ Regression(regressionType, inputErrorEst, out outputErrorEst, degree, inputValues[0].Length / 2);
+
+ // Find the average for forecasting error
+ double error = 0;
+ for (int index = inputValues[0].Length / 2; index < outputErrorEst[1].Length; index++)
+ {
+ error += (outputErrorEst[1][index] - inputValues[1][index]) * (outputErrorEst[1][index] - inputValues[1][index]);
+ }
+ error /= inputValues[0].Length - inputValues[0].Length / 2;
+ error = Math.Sqrt(error);
+ error /= (inputValues[0].Length / 4);
+
+ // Find the standard deviation
+ double dev = 0;
+ for (int index = 0; index < inputValues[0].Length; index++)
+ {
+ dev += (tempOut[1][index] - inputValues[1][index]) * (tempOut[1][index] - inputValues[1][index]);
+ }
+ dev /= inputValues[0].Length;
+ dev = Math.Sqrt(dev);
+
+ outputValues = new double[4][];
+ outputValues[0] = tempOut[0];
+ outputValues[1] = tempOut[1];
+ outputValues[2] = new double[tempOut[0].Length];
+ outputValues[3] = new double[tempOut[0].Length];
+
+ if (!approximationError)
+ dev = 0;
+
+ if (!forecastingError)
+ error = 0;
+
+ for (int index = 0; index < inputValues[0].Length; index++)
+ {
+ outputValues[2][index] = tempOut[1][index] + 2 * dev;
+ outputValues[3][index] = tempOut[1][index] - 2 * dev;
+ }
+ double sumError = 0;
+ for (int index = inputValues[0].Length; index < tempOut[0].Length; index++)
+ {
+ sumError += error;
+ outputValues[2][index] = tempOut[1][index] + sumError + 2 * dev;
+ outputValues[3][index] = tempOut[1][index] - sumError - 2 * dev;
+ }
+ }
+
+ /// <summary>
+ /// Any method of fitting equations to data may be called regression.
+ /// Such equations are valuable for at least two purposes: making
+ /// predictions and judging the strength of relationships. Of the
+ /// various methods of performing regression, Last Square is the
+ /// most widely used.
+ /// </summary>
+ /// <param name="regressionType">AxisName of regression Polynomial, exponential, etc.</param>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="polynomialDegree">Polynomial degree (Default: 2 - Linear regression )</param>
+ /// <param name="forecastingPeriod">Forecasting period (Default: Half of the series length )</param>
+ private void Regression( RegressionType regressionType, double [][] inputValues, out double [][] outputValues, int polynomialDegree, int forecastingPeriod )
+ {
+ if( regressionType == RegressionType.Exponential )
+ {
+ double [] oldYValues = new double[ inputValues[1].Length ];
+ for( int index = 0; index < inputValues[1].Length; index++ )
+ {
+ oldYValues[ index ] = inputValues[1][index];
+ if( inputValues[1][index] <= 0 )
+ {
+ throw new InvalidOperationException(SR.ExceptionForecastingExponentialRegressionHasZeroYValues);
+ }
+ inputValues[1][index] = Math.Log( inputValues[1][index] );
+ }
+
+
+
+ PolynomialRegression( regressionType, inputValues, out outputValues, 2, forecastingPeriod, 0 );
+
+ inputValues[1] = oldYValues;
+ }
+ else if( regressionType == RegressionType.Logarithmic )
+ {
+ double interval;
+ double first = inputValues[0][0];
+
+ // Find Interval for X values
+ interval = Math.Abs( inputValues[0][0] - inputValues[0][inputValues[0].Length - 1] ) / ( inputValues[0].Length - 1 );
+
+ if( interval <= 0 )
+ interval = 1;
+
+ for( int index = 0; index < inputValues[0].Length; index++ )
+ {
+ inputValues[0][index] = Math.Log( inputValues[0][index] );
+ }
+
+ PolynomialRegression( regressionType, inputValues, out outputValues, 2, forecastingPeriod, interval );
+
+ // Create Y values based on approximation.
+ for( int i = 0; i < outputValues[0].Length; i++ )
+ {
+ // Set X value
+ outputValues[0][i] = first + i * interval;
+ }
+ }
+ else if( regressionType == RegressionType.Power )
+ {
+ double [] oldYValues = new double[ inputValues[1].Length ];
+ double interval;
+ double first = inputValues[0][0];
+
+ for( int index = 0; index < inputValues[1].Length; index++ )
+ {
+ oldYValues[ index ] = inputValues[1][index];
+ if( inputValues[1][index] <= 0 )
+ {
+ throw new InvalidOperationException(SR.ExceptionForecastingPowerRegressionHasZeroYValues);
+ }
+ }
+
+ // Find Interval for X values
+ interval = Math.Abs( inputValues[0][0] - inputValues[0][inputValues[0].Length - 1] ) / ( inputValues[0].Length - 1 );
+
+ if( interval <= 0 )
+ interval = 1;
+
+ PolynomialRegression( regressionType, inputValues, out outputValues, 2, forecastingPeriod, interval );
+
+ inputValues[1] = oldYValues;
+
+ // Create Y values based on approximation.
+ for( int i = 0; i < outputValues[0].Length; i++ )
+ {
+ // Set X value
+ outputValues[0][i] = first + i * interval;
+ }
+ }
+ else
+ {
+ PolynomialRegression( regressionType, inputValues, out outputValues, polynomialDegree, forecastingPeriod, 0 );
+ }
+ }
+
+ /// <summary>
+ /// Any method of fitting equations to data may be called regression.
+ /// Such equations are valuable for at least two purposes: making
+ /// predictions and judging the strength of relationships. Of the
+ /// various methods of performing regression, Last Square is the
+ /// most widely used.
+ /// </summary>
+ /// <param name="regressionType">AxisName of regression Polynomial, exponential, etc.</param>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="polynomialDegree">Polynomial degree (Default: 2 - Linear regression )</param>
+ /// <param name="forecastingPeriod">Forecasting period (Default: Half of the series length )</param>
+ /// <param name="logInterval">Interval for logarithmic scale</param>
+ private void PolynomialRegression( RegressionType regressionType, double [][] inputValues, out double [][] outputValues, int polynomialDegree, int forecastingPeriod, double logInterval )
+ {
+ double [] coefficients = new double [polynomialDegree];
+ int size = inputValues[0].Length;
+ double minimumX = double.MaxValue;
+ double interval = 1.0;
+
+ // Find Interval for X values
+ interval = Math.Abs( inputValues[0][0] - inputValues[0][inputValues[0].Length - 1] ) / ( inputValues[0].Length - 1 );
+
+ if( interval <= 0 )
+ interval = 1;
+
+ if( regressionType != RegressionType.Logarithmic )
+ {
+ // Avoid Rounding error because of big X values.
+ // Find Minimum X value
+ for( int xIndex = 0; xIndex < inputValues[0].Length; xIndex++ )
+ {
+ if( minimumX > inputValues[0][xIndex] )
+ minimumX = inputValues[0][xIndex];
+ }
+
+ // Change X values.
+ for( int xIndex = 0; xIndex < inputValues[0].Length; xIndex++ )
+ {
+ inputValues[0][xIndex] -= minimumX - 1;
+ }
+ }
+
+ if( regressionType == RegressionType.Power )
+ {
+ for( int index = 0; index < inputValues[0].Length; index++ )
+ {
+ inputValues[0][index] = Math.Log( inputValues[0][index] );
+ inputValues[1][index] = Math.Log( inputValues[1][index] );
+ }
+ }
+
+ double [][] mainDeterminant = new double [polynomialDegree][];
+ for(int arrayIndex = 0; arrayIndex < polynomialDegree; arrayIndex++)
+ {
+ mainDeterminant[arrayIndex] = new double [polynomialDegree];
+ }
+
+ // Main determinant
+ for( int k = 0; k < polynomialDegree; k++ )
+ {
+ for( int i = 0; i < polynomialDegree; i++ )
+ {
+ mainDeterminant[i][k] = 0;
+ for( int j = 0; j < inputValues[0].Length; j++ )
+ {
+ mainDeterminant[i][k] += (double)Math.Pow( inputValues[0][j], (i+k) );
+ }
+ }
+ }
+ double mainValue = Determinant(mainDeterminant);
+
+ // Coefficient determinant
+ for( int i = 0; i < polynomialDegree; i++ )
+ {
+ double [][] coeffDeterminant = CopyDeterminant(mainDeterminant);
+ for( int k = 0; k < polynomialDegree; k++ )
+ {
+ coeffDeterminant[i][k] = 0;
+ for( int j = 0; j < inputValues[0].Length; j++ )
+ {
+ coeffDeterminant[i][k] += (double)inputValues[1][j] * (double)Math.Pow( inputValues[0][j], k );
+ }
+ }
+ coefficients[i] = Determinant(coeffDeterminant) / mainValue;
+ }
+
+ // Create output arrays for approximation and forecasting
+ outputValues = new double[2][];
+ outputValues[0] = new double[size + forecastingPeriod];
+ outputValues[1] = new double[size + forecastingPeriod];
+
+ if( regressionType == RegressionType.Polynomial )
+ {
+ // Create Y values based on approximation.
+ for( int i = 0; i < size + forecastingPeriod; i++ )
+ {
+ // Set X value
+ outputValues[0][i] = inputValues[0][0] + i * interval;
+
+ outputValues[1][i] = 0;
+ for( int j = 0; j < polynomialDegree; j++ )
+ {
+ outputValues[1][i]+= (double)coefficients[j]*Math.Pow(outputValues[0][i],j);
+ }
+ }
+ }
+ else if( regressionType == RegressionType.Exponential )
+ {
+ // Create Y values based on approximation.
+ for( int i = 0; i < size + forecastingPeriod; i++ )
+ {
+ // Set X value
+ outputValues[0][i] = inputValues[0][0] + i * interval;
+
+ outputValues[1][i]= Math.Exp( coefficients[0] ) * Math.Exp( coefficients[1] * outputValues[0][i] );
+ }
+ }
+ else if( regressionType == RegressionType.Logarithmic )
+ {
+ // Create Y values based on approximation.
+ for( int i = 0; i < size + forecastingPeriod; i++ )
+ {
+ // Set X value
+ outputValues[0][i] = Math.Exp( inputValues[0][0] ) + i * logInterval;
+
+ outputValues[1][i]= coefficients[1] * Math.Log( outputValues[0][i] ) + coefficients[0];
+ }
+ }
+ else if( regressionType == RegressionType.Power )
+ {
+ // Create Y values based on approximation.
+ for( int i = 0; i < size + forecastingPeriod; i++ )
+ {
+ // Set X value
+ outputValues[0][i] = Math.Exp( inputValues[0][0] ) + i * logInterval;
+
+ outputValues[1][i]= Math.Exp( coefficients[0] ) * Math.Pow( outputValues[0][i], coefficients[1] );
+ }
+ }
+
+ if( regressionType != RegressionType.Logarithmic )
+ {
+ // Return X values.
+ for( int xIndex = 0; xIndex < size + forecastingPeriod; xIndex++ )
+ {
+ outputValues[0][xIndex] += minimumX - 1;
+ }
+ }
+ }
+
+ /// <summary>
+ /// This method recalculates determinant. This method is used for
+ /// recursive calls for sub determinants too.
+ /// </summary>
+ /// <param name="inputDeterminant">Input determinant</param>
+ /// <returns>Result of determinant</returns>
+ private double Determinant( double [][] inputDeterminant )
+ {
+ double sum = 0;
+ double sign = 1.0;
+
+ // Determinant is 2X2 - calculate value
+ if( inputDeterminant.Length == 2 )
+ {
+ return inputDeterminant[0][0]*inputDeterminant[1][1] - inputDeterminant[0][1]*inputDeterminant[1][0];
+ }
+
+ // Determinant is biger than 2X2. Go to recursive
+ // call of Determinant method
+ for( int column = 0; column < inputDeterminant.GetLength(0); column++ )
+ {
+ // Make sub determinant
+ double [][] newDeterminant = MakeSubDeterminant( inputDeterminant, column );
+
+ sum += sign * Determinant( newDeterminant ) * inputDeterminant[column][0];
+ sign *= -1.0;
+ }
+ return sum;
+ }
+
+ /// <summary>
+ /// This method will create a new determinant, which is
+ /// smaller by one rank (dimension). Specified column
+ /// and zero rows will be skipped.
+ /// </summary>
+ /// <param name="inputDeterminant">Input determinant</param>
+ /// <param name="columnPos">Position of column, which has to be skipped</param>
+ /// <returns>New determinant</returns>
+ private double [][] MakeSubDeterminant( double [][] inputDeterminant, int columnPos )
+ {
+ // Get Determinant Size
+ int size = inputDeterminant.GetLength(0);
+
+ // Prepare sub Determinant
+ double [][] newDeterminant = new double [size - 1][];
+ for(int arrayIndex = 0; arrayIndex < size - 1; arrayIndex++)
+ {
+ newDeterminant[arrayIndex] = new double [size - 1];
+ }
+
+
+ int newColumn = 0;
+ // Copy columns
+ for( int column = 0; column < size; column++ )
+ {
+ // Skeep this column
+ if( column == columnPos )
+ continue;
+
+ // Copy rows
+ for( int row = 1; row < size; row++ )
+ {
+ newDeterminant[newColumn][row-1] = inputDeterminant[column][row];
+ }
+
+ // Go to new column for new determinant
+ newColumn++;
+ }
+
+ // Return new determinant
+ return newDeterminant;
+ }
+
+ /// <summary>
+ /// This method will copy determinant
+ /// </summary>
+ /// <param name="inputDeterminant">Input determinant</param>
+ /// <returns>New determinant</returns>
+ private double [][] CopyDeterminant( double [][] inputDeterminant )
+ {
+ // Get Determinant Size
+ int size = inputDeterminant.GetLength(0);
+
+ // Prepare sub Determinant
+ double [][] newDeterminant = new double [size][];
+ for(int arrayIndex = 0; arrayIndex < size; arrayIndex++)
+ {
+ newDeterminant[arrayIndex] = new double [size];
+ }
+
+ // Copy columns
+ for( int column = 0; column < size; column++ )
+ {
+ // Copy rows
+ for( int row = 0; row < size; row++ )
+ {
+ newDeterminant[column][row] = inputDeterminant[column][row];
+ }
+ }
+
+ // Return new determinant
+ return newDeterminant;
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/VolumeIndicator.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/VolumeIndicator.cs
new file mode 100644
index 00000000000..b9450870dac
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Formulas/VolumeIndicator.cs
@@ -0,0 +1,527 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: VolumeIndicator.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting.Formulas
+//
+// Classes: VolumeIndicators
+//
+// Purpose: This class is used for calculations of
+// technical analyses volume indicators.
+//
+// Reviewed: GS - August 7, 2002
+// AG - August 7, 2002
+//
+//===================================================================
+
+
+using System;
+
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.Formulas
+#else
+ namespace System.Web.UI.DataVisualization.Charting.Formulas
+#endif
+{
+ /// <summary>
+ /// This class is used for calculations of
+ /// technical analyses volume indicators.
+ /// </summary>
+ internal class VolumeIndicators : PriceIndicators
+ {
+ #region Properties
+
+ /// <summary>
+ /// Formula Module name
+ /// </summary>
+ override public string Name { get { return SR.FormulaNameVolumeIndicators; } }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Default Constructor
+ /// </summary>
+ public VolumeIndicators()
+ {
+
+ }
+
+ /// <summary>
+ /// The first method in the module, which converts a formula
+ /// name to the corresponding private method.
+ /// </summary>
+ /// <param name="formulaName">String which represent a formula name</param>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Formula parameters</param>
+ /// <param name="extraParameterList">Array of strings - Extra Formula parameters from DataManipulator object</param>
+ /// <param name="outLabels">Array of strings - Used for Labels. Description for output results.</param>
+ override public void Formula( string formulaName, double [][] inputValues, out double [][] outputValues, string [] parameterList, string [] extraParameterList, out string [][] outLabels )
+ {
+ string name;
+
+ name = formulaName.ToUpper(System.Globalization.CultureInfo.InvariantCulture);
+
+ // Not used for these formulas.
+ outLabels = null;
+
+ try
+ {
+ switch( name )
+ {
+ case "MONEYFLOW":
+ MoneyFlow( inputValues, out outputValues, parameterList );
+ break;
+ case "ONBALANCEVOLUME":
+ OnBalanceVolume( inputValues, out outputValues );
+ break;
+ case "NEGATIVEVOLUMEINDEX":
+ NegativeVolumeIndex( inputValues, out outputValues, parameterList );
+ break;
+ case "POSITIVEVOLUMEINDEX":
+ PositiveVolumeIndex( inputValues, out outputValues, parameterList );
+ break;
+ case "PRICEVOLUMETREND":
+ PriceVolumeTrend( inputValues, out outputValues );
+ break;
+ case "ACCUMULATIONDISTRIBUTION":
+ AccumulationDistribution( inputValues, out outputValues );
+ break;
+ default:
+ outputValues = null;
+ break;
+ }
+ }
+ catch( IndexOutOfRangeException )
+ {
+ throw new InvalidOperationException( SR.ExceptionFormulaInvalidPeriod( name ) );
+ }
+ catch( OverflowException )
+ {
+ throw new InvalidOperationException( SR.ExceptionFormulaNotEnoughDataPoints( name ) );
+ }
+ }
+
+ #endregion
+
+ #region Formulas
+
+ /// <summary>
+ /// The Money Flow Index ("MFI") is a momentum indicator that
+ /// measures the strength of money flowing in and out of
+ /// a security. It is related to the Relative Strength Index,
+ /// but where the RSI only incorporates prices, the Money Flow
+ /// Index accounts for volume.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 4 Y values ( High, Low, Close, Volume ).
+ /// Output:
+ /// - 1 Y value Money Flow Indicator.
+ /// Parameters:
+ /// - Period
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles</param>
+ /// <param name="outputValues">Arrays of doubles</param>
+ /// <param name="parameterList">Array of strings</param>
+ private void MoneyFlow(double [][] inputValues, out double [][] outputValues, string [] parameterList)
+ {
+ int length = inputValues.Length;
+
+ // There is no enough series
+ if( length != 5 )
+ throw new ArgumentException( SR.ExceptionPriceIndicatorsFormulaRequiresFourArrays);
+
+ // Different number of x and y values
+ CheckNumOfValues( inputValues, 4 );
+
+ // Period for moving average
+ int period;
+ try
+ {period = int.Parse( parameterList[0], System.Globalization.CultureInfo.InvariantCulture );}
+ catch( Exception e )
+ {
+ if (e.Message == SR.ExceptionObjectReferenceIsNull)
+ throw new InvalidOperationException(SR.ExceptionPriceIndicatorsPeriodMissing);
+ else
+ throw new InvalidOperationException(SR.ExceptionPriceIndicatorsPeriodMissing + e.Message);
+ }
+
+ if( period <= 0 )
+ throw new InvalidOperationException(SR.ExceptionPeriodParameterIsNegative);
+
+ // Not enough values for Money Flow.
+ if( inputValues[0].Length < period )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsNotEnoughPoints);
+
+ outputValues = new double [2][];
+
+ outputValues[0] = new double [inputValues[0].Length - period + 1];
+ outputValues[1] = new double [inputValues[0].Length - period + 1];
+ double [] TypicalPrice = new double [inputValues[1].Length];
+ double [] MoneyFlow = new double [inputValues[1].Length];
+ double [] PositiveMoneyFlow = new double [inputValues[1].Length];
+ double [] NegativeMoneyFlow = new double [inputValues[1].Length];
+
+ // Find Money Flow
+ for( int index = 0; index < inputValues[1].Length; index++ )
+ {
+ // Find Typical Price
+ TypicalPrice[index] = (inputValues[1][index] + inputValues[2][index] + inputValues[3][index])/3.0;
+ // Find Money Flow
+ MoneyFlow[index] = (inputValues[1][index] + inputValues[2][index] + inputValues[3][index])/3.0 * inputValues[4][index];
+ }
+
+ // Find Money Flow
+ for( int index = 1; index < inputValues[1].Length; index++ )
+ {
+ // Positive Typical Price
+ if( TypicalPrice[index] > TypicalPrice[index - 1] )
+ {
+ PositiveMoneyFlow[index] = MoneyFlow[index];
+ NegativeMoneyFlow[index] = 0;
+ }
+ // Negative Typical Price
+ if( TypicalPrice[index] < TypicalPrice[index - 1] )
+ {
+ NegativeMoneyFlow[index] = MoneyFlow[index];
+ PositiveMoneyFlow[index] = 0;
+ }
+ }
+
+ double PosMoney = 0;
+ double NegMoney = 0;
+ for( int index = period - 1; index < inputValues[1].Length; index++ )
+ {
+ PosMoney = 0;
+ NegMoney = 0;
+ // Find Money flow using period
+ for( int periodIndex = index - period + 1; periodIndex <= index; periodIndex++ )
+ {
+ NegMoney += NegativeMoneyFlow[periodIndex];
+ PosMoney += PositiveMoneyFlow[periodIndex];
+ }
+
+ // X value
+ outputValues[0][index - period + 1] = inputValues[0][index];
+
+ // Money Flow Index
+ outputValues[1][index - period + 1] = 100.0 - 100.0 / ( 1.0 + (PosMoney / NegMoney) );
+
+ }
+ }
+
+ /// <summary>
+ /// The Price and Volume Trend ("PVT") is similar to
+ /// On Balance Volume ("OBV,") in that it is a cumulative
+ /// total of volume that is adjusted depending on changes
+ /// in closing prices. But where OBV adds all volume on days
+ /// when prices close higher and subtracts all volume on days
+ /// when prices close lower, the PVT adds/subtracts only
+ /// a portion of the daily volume. The amount of volume
+ /// added to the PVT is determined by the amount that prices
+ /// rose or fell relative to the previous day’s close.
+ /// The PVT is calculated by multiplying the day’s volume
+ /// by the percent that the security’s price changed, and
+ /// adding this value to a cumulative total.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 2 Y values ( Close, Volume ).
+ /// Output:
+ /// - 1 Y value Price Volume Trend Indicator.
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ private void PriceVolumeTrend(double [][] inputValues, out double [][] outputValues)
+ {
+ // There is no enough input series
+ if( inputValues.Length != 3 )
+ throw new ArgumentException(SR.ExceptionPriceIndicatorsFormulaRequiresTwoArrays);
+
+ // Different number of x and y values
+ CheckNumOfValues( inputValues, 2 );
+
+ outputValues = new double [2][];
+
+ outputValues[0] = new double [inputValues[0].Length];
+ outputValues[1] = new double [inputValues[0].Length];
+
+ // Set X and Y zero values
+ outputValues[0][0] = inputValues[0][0];
+ outputValues[1][0] = 0;
+
+ double yesterdayClose;
+ double todayClose;
+
+ // Price Volume Trend Indicator
+ for( int index = 1; index < inputValues[1].Length; index++ )
+ {
+ // Set X values
+ outputValues[0][index] = inputValues[0][index];
+
+ // Set Y values
+ yesterdayClose = inputValues[1][index-1];
+ todayClose = inputValues[1][index];
+
+ // Price Volume Trend for one point
+ outputValues[1][index] = ( todayClose - yesterdayClose ) / yesterdayClose * inputValues[2][index] + outputValues[1][index-1];
+ }
+ }
+
+ /// <summary>
+ /// On Balance Volume ("OBV") is a momentum indicator that
+ /// relates volume to price change. OBV is one of the most
+ /// popular volume indicators and was developed by
+ /// Joseph Granville. Constructing an OBV line is very
+ /// simple: The total volume for each day is assigned a
+ /// positive or negative value depending on whether prices
+ /// closed higher or lower that day. A higher close results
+ /// in the volume for that day to get a positive value, while
+ /// a lower close results in negative value. A running total
+ /// is kept by adding or subtracting each day's volume based
+ /// on the direction of the close. The direction of the OBV
+ /// line is the thing to watch, not the actual volume numbers.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 2 Y values ( Close, Volume ).
+ /// Output:
+ /// - 1 Y value On Balance Volume Indicator.
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ private void OnBalanceVolume(double [][] inputValues, out double [][] outputValues)
+ {
+ // There is no enough input series
+ if( inputValues.Length != 3 )
+ throw new ArgumentException( SR.ExceptionPriceIndicatorsFormulaRequiresTwoArrays);
+
+ // Different number of x and y values
+ CheckNumOfValues( inputValues, 2 );
+
+ outputValues = new double [2][];
+
+ outputValues[0] = new double [inputValues[0].Length];
+ outputValues[1] = new double [inputValues[0].Length];
+
+ outputValues[0][0] = inputValues[0][0];
+ outputValues[1][0] = inputValues[2][0];
+
+ // Find On Balance Volume
+ for( int index = 1; index < inputValues[1].Length; index++ )
+ {
+ // Set X values
+ outputValues[0][index] = inputValues[0][index];
+
+ // Set Y Values
+ // If today’s close is greater than yesterday’s close then
+ if( inputValues[1][index - 1] < inputValues[1][index] )
+ outputValues[1][index] = outputValues[1][index - 1] + inputValues[2][index];
+ // If today’s close is less than yesterday’s close then
+ else if( inputValues[1][index - 1] > inputValues[1][index] )
+ outputValues[1][index] = outputValues[1][index - 1] - inputValues[2][index];
+ // If today’s close is equal to yesterday’s close then
+ else
+ outputValues[1][index] = outputValues[1][index - 1];
+ }
+ }
+
+ /// <summary>
+ /// The Negative Volume Index ("NVI") focuses on days where
+ /// the volume decreases from the previous day. The premise
+ /// being that the "smart money" takes positions on days when
+ /// volume decreases.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 2 Y values ( Close, Volume ).
+ /// Output:
+ /// - 1 Y value Negative Volume index.
+ /// Parameters:
+ /// - StartValue : double
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ private void NegativeVolumeIndex(double [][] inputValues, out double [][] outputValues, string [] parameterList)
+ {
+ // There is no enough input series
+ if( inputValues.Length != 3 )
+ throw new ArgumentException( SR.ExceptionPriceIndicatorsFormulaRequiresTwoArrays);
+
+ // Different number of x and y values
+ CheckNumOfValues( inputValues, 2 );
+
+ // Start Value
+ double startValue;
+ try
+ {startValue = double.Parse( parameterList[0], System.Globalization.CultureInfo.InvariantCulture );}
+ catch(System.Exception)
+ { throw new InvalidOperationException(SR.ExceptionVolumeIndicatorStartValueMissing); }
+
+ outputValues = new double [2][];
+
+ outputValues[0] = new double [inputValues[0].Length];
+ outputValues[1] = new double [inputValues[0].Length];
+
+ outputValues[0][0] = inputValues[0][0];
+ outputValues[1][0] = startValue;
+
+ // Find Negative Volume Index
+ for( int index = 1; index < inputValues[1].Length; index++ )
+ {
+ // Set X values
+ outputValues[0][index] = inputValues[0][index];
+
+ // If today’s volume is less than yesterday’s volume then
+ if( inputValues[2][index] < inputValues[2][index-1] )
+ {
+ double yesterdayClose = inputValues[1][index-1];
+ double todayClose = inputValues[1][index];
+
+ outputValues[1][index] = ( todayClose - yesterdayClose ) / yesterdayClose * outputValues[1][index-1] + outputValues[1][index-1];
+ }
+ // If today’s volume is greater than or equal to yesterday’s volume then:
+ else
+ outputValues[1][index] = outputValues[1][index-1];
+
+ }
+ }
+
+ /// <summary>
+ /// The Positive Volume Index ("PVI") focuses on days where
+ /// the volume increased from the previous day. The premise
+ /// being that the "crowd" takes positions on days when
+ /// volume increases. Interpretation of the PVI assumes that
+ /// on days when volume increases, the crowd-following
+ /// "uninformed" investors are in the market. Conversely, on
+ /// days with decreased volume, the "smart money" is quietly
+ /// taking positions. Thus, the PVI displays what the
+ /// not-so-smart-money is doing. (The Negative Volume Index,
+ /// displays what the smart money is doing.) Note, however,
+ /// that the PVI is not a contrarian indicator. Even though
+ /// the PVI is supposed to show what the not-so-smart-money
+ /// is doing, it still trends in the same direction as prices.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 2 Y values ( Close, Volume ).
+ /// Output:
+ /// - 1 Y value On Positive Volume index.
+ /// Parameters:
+ /// - StartValue : double
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ /// <param name="parameterList">Array of strings - Parameters</param>
+ private void PositiveVolumeIndex(double [][] inputValues, out double [][] outputValues, string [] parameterList)
+ {
+ // There is no enough input series
+ if( inputValues.Length != 3 )
+ throw new ArgumentException( SR.ExceptionPriceIndicatorsFormulaRequiresTwoArrays);
+
+ // Different number of x and y values
+ CheckNumOfValues( inputValues, 2 );
+
+ // Start Value
+ double startValue;
+ try
+ {startValue = double.Parse( parameterList[0], System.Globalization.CultureInfo.InvariantCulture );}
+ catch(System.Exception)
+ { throw new InvalidOperationException(SR.ExceptionVolumeIndicatorStartValueMissing); }
+
+ outputValues = new double [2][];
+
+ outputValues[0] = new double [inputValues[0].Length];
+ outputValues[1] = new double [inputValues[0].Length];
+
+ outputValues[0][0] = inputValues[0][0];
+ outputValues[1][0] = startValue;
+
+ // Find Negative Volume Index
+ for( int index = 1; index < inputValues[1].Length; index++ )
+ {
+ // Set X values
+ outputValues[0][index] = inputValues[0][index];
+
+ // If today’s volume is greater than yesterday’s volume then
+ if( inputValues[2][index] > inputValues[2][index-1] )
+ {
+ double yesterdayClose = inputValues[1][index-1];
+ double todayClose = inputValues[1][index];
+
+ outputValues[1][index] = ( todayClose - yesterdayClose ) / yesterdayClose * outputValues[1][index-1] + outputValues[1][index-1];
+ }
+ // If today’s volume is less than or equal to yesterday’s volume then:
+ else
+ outputValues[1][index] = outputValues[1][index-1];
+ }
+ }
+
+ /// <summary>
+ /// The Accumulation/Distribution is a momentum indicator that
+ /// associates changes in price and volume. The indicator is
+ /// based on the premise that the more volume that accompanies
+ /// a price move, the more significant the price move. A portion
+ /// of each day’s volume is added or subtracted from
+ /// a cumulative total. The nearer the closing price is to
+ /// the high for the day, the more volume added to
+ /// the cumulative total. The nearer the closing price is to
+ /// the low for the day, the more volume subtracted from the
+ /// cumulative total. If the close is exactly between the high
+ /// and low prices, nothing is added to the cumulative total.
+ /// ---------------------------------------------------------
+ /// Input:
+ /// - 4 Y values ( Hi, Low, Close, Volume ).
+ /// Output:
+ /// - 1 Y value Accumulation Distribution
+ /// </summary>
+ /// <param name="inputValues">Arrays of doubles - Input values</param>
+ /// <param name="outputValues">Arrays of doubles - Output values</param>
+ internal void AccumulationDistribution(double [][] inputValues, out double [][] outputValues)
+ {
+ // There is no enough input series
+ if( inputValues.Length != 5 )
+ throw new ArgumentException( SR.ExceptionPriceIndicatorsFormulaRequiresFourArrays);
+
+ // Different number of x and y values
+ CheckNumOfValues( inputValues, 4 );
+
+ outputValues = new double [2][];
+
+ outputValues[0] = new double [inputValues[0].Length];
+ outputValues[1] = new double [inputValues[0].Length];
+
+ double [] distribution = new double [inputValues[0].Length];
+
+ // Set X and Y zero values
+ outputValues[0][0] = inputValues[0][0];
+ outputValues[1][0] = 0;
+
+
+ // Accumulation Distribution
+ for( int index = 0; index < inputValues[1].Length; index++ )
+ {
+ // Set X values
+ outputValues[0][index] = inputValues[0][index];
+
+ // Distribution {(Close - Low) - (High - Close)} / (High - Low) * Volume
+ distribution[index] = ((inputValues[3][index] - inputValues[2][index])-(inputValues[1][index] - inputValues[3][index]))/(inputValues[1][index] - inputValues[2][index])*inputValues[4][index];
+ }
+
+ // The Accumulation Distribution Index is calculated as a cumulative total of each day's reading
+ double sum = 0;
+ for( int index = 0; index < inputValues[1].Length; index++ )
+ {
+ sum += distribution[index];
+ outputValues[1][index] = sum;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Axis.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Axis.cs
new file mode 100644
index 00000000000..9b313d01ee1
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Axis.cs
@@ -0,0 +1,6508 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: Axis.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: Axis
+//
+// Purpose: Axis related properties and methods. Axis class gives
+// information to Common.Chart series about
+// position in the Common.Chart area and keeps all necessary
+// information about axes.
+//
+// Reviewed: GS - August 6, 2002
+// AG - August 7, 2002
+//
+//===================================================================
+
+#region Used namespace
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Text;
+using System.Drawing.Drawing2D;
+using System.Diagnostics.CodeAnalysis;
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+
+#else
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.DataVisualization.Charting;
+using System.Web.UI.DataVisualization.Charting.Data;
+using System.Web.UI.DataVisualization.Charting.Utilities;
+using System.Web.UI.DataVisualization.Charting.ChartTypes;
+#endif
+
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ #region Axis name enumeration
+
+ /// <summary>
+ /// An enumeration of auto-fitting styles of the axis labels.
+ /// </summary>
+ [Flags]
+ public enum LabelAutoFitStyles
+ {
+ /// <summary>
+ /// No auto-fitting.
+ /// </summary>
+ None = 0,
+ /// <summary>
+ /// Allow font size increasing.
+ /// </summary>
+ IncreaseFont = 1,
+ /// <summary>
+ /// Allow font size decreasing.
+ /// </summary>
+ DecreaseFont = 2,
+ /// <summary>
+ /// Allow using staggered labels.
+ /// </summary>
+ StaggeredLabels = 4,
+ /// <summary>
+ /// Allow changing labels angle using values of 0, 30, 60 and 90 degrees.
+ /// </summary>
+ LabelsAngleStep30 = 8,
+ /// <summary>
+ /// Allow changing labels angle using values of 0, 45, 90 degrees.
+ /// </summary>
+ LabelsAngleStep45 = 16,
+ /// <summary>
+ /// Allow changing labels angle using values of 0 and 90 degrees.
+ /// </summary>
+ LabelsAngleStep90 = 32,
+ /// <summary>
+ /// Allow replacing spaces with the new line character.
+ /// </summary>
+ WordWrap = 64,
+ }
+
+ /// <summary>
+ /// An enumeration of axis names.
+ /// </summary>
+ public enum AxisName
+ {
+ /// <summary>
+ /// Primary X Axis.
+ /// </summary>
+
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "X")]
+ X = 0,
+ /// <summary>
+ /// Primary Y Axis.
+ /// </summary>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Y")]
+ Y = 1,
+ /// <summary>
+ /// Secondary X Axis.
+ /// </summary>
+ X2 = 2,
+ /// <summary>
+ /// Secondary Y Axis.
+ /// </summary>
+ Y2 = 3
+ }
+
+ #endregion
+
+ /// <summary>
+ /// The Axis class gives information to the Common.Chart series
+ /// about positions in the Common.Chart area and keeps all of
+ /// the data about the axis.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeAxis_Axis"),
+ DefaultProperty("Enabled"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+#if Microsoft_CONTROL
+ public partial class Axis : ChartNamedElement
+#else
+ public partial class Axis : ChartNamedElement, IChartMapArea
+#endif
+ {
+ #region Axis fields
+
+ /// <summary>
+ /// Plot area position
+ /// </summary>
+ internal ElementPosition PlotAreaPosition;
+
+ // This field synchronies Store and Reset temporary values
+ private bool _storeValuesEnabled = true;
+
+ private FontCache _fontCache = new FontCache();
+ private Font _titleFont;
+ private Color _titleForeColor = Color.Black;
+ private StringAlignment _titleAlignment = StringAlignment.Center;
+ private string _title = "";
+ private int _lineWidth = 1;
+ private ChartDashStyle _lineDashStyle = ChartDashStyle.Solid;
+ private Color _lineColor = Color.Black;
+ private bool _isLabelAutoFit = true;
+ private AxisArrowStyle _arrowStyle = AxisArrowStyle.None;
+ private StripLinesCollection _stripLines = null;
+ private bool _isMarksNextToAxis = true;
+
+ // Default text orientation
+ private TextOrientation _textOrientation = TextOrientation.Auto;
+
+ // Size of the axis elements in percentage
+ internal float titleSize = 0F;
+ internal float labelSize = 0F;
+ internal float labelNearOffset = 0F;
+ internal float labelFarOffset = 0F;
+ internal float unRotatedLabelSize = 0F;
+ internal float markSize = 0F;
+ internal float scrollBarSize = 0F;
+ internal float totlaGroupingLabelsSize = 0F;
+ internal float[] groupingLabelSizes = null;
+ internal float totlaGroupingLabelsSizeAdjustment = 0f;
+ private LabelAutoFitStyles _labelAutoFitStyle = LabelAutoFitStyles.DecreaseFont |
+ LabelAutoFitStyles.IncreaseFont |
+ LabelAutoFitStyles.LabelsAngleStep30 |
+ LabelAutoFitStyles.StaggeredLabels |
+ LabelAutoFitStyles.WordWrap;
+
+ // Auto calculated font for labels
+ internal Font autoLabelFont = null;
+ internal int autoLabelAngle = -1000;
+ internal int autoLabelOffset = -1;
+
+ // Labels auto fitting constants
+ private float _aveLabelFontSize = 10F;
+ private float _minLabelFontSize = 5F;
+ // Determines maximum label size of the chart area.
+ private float _maximumAutoSize = 75f;
+
+ // Chart title position rectangle
+ private RectangleF _titlePosition = RectangleF.Empty;
+
+ // Element spacing size
+ internal const float elementSpacing = 1F;
+
+ // Maximum total size of the axis's elements in percentage
+ private const float maxAxisElementsSize = 75F;
+
+ // Maximum size of the axis title in percentage
+ private const float maxAxisTitleSize = 20F;
+
+ // Maximum size of the axis second row of labels in percentage
+ // of the total labels size
+ private const float maxAxisLabelRow2Size = 45F;
+
+ // Maximum size of the axis tick marks in percentage
+ private const float maxAxisMarkSize = 20F;
+
+ // Minimum cached value from data series.
+ internal double minimumFromData = double.NaN;
+
+ // Maximum cached value from data series.
+ internal double maximumFromData = double.NaN;
+
+ // Flag, which tells to Set Data method to take, again values from
+ // data source and not to use cached values.
+ internal bool refreshMinMaxFromData = true;
+
+ // Flag, which tells to Set Data method to take, again values from
+ // data source and not to use cached values.
+ internal int numberOfPointsInAllSeries = 0;
+
+ // Original axis scaleView position
+ private double _originalViewPosition = double.NaN;
+
+
+ /// <summary>
+ /// Indicates that isInterlaced strip lines will be displayed for the axis.
+ /// </summary>
+ private bool _isInterlaced = false;
+
+ /// <summary>
+ /// Color used to draw isInterlaced strip lines for the axis.
+ /// </summary>
+ private Color _interlacedColor = Color.Empty;
+
+ /// <summary>
+ /// Axis interval offset.
+ /// </summary>
+ private double _intervalOffset = 0;
+
+ /// <summary>
+ /// Axis interval.
+ /// </summary>
+ internal double interval = 0;
+
+ /// <summary>
+ /// Axis interval units type.
+ /// </summary>
+ internal DateTimeIntervalType intervalType = DateTimeIntervalType.Auto;
+
+ /// <summary>
+ /// Axis interval offset units type.
+ /// </summary>
+ internal DateTimeIntervalType intervalOffsetType = DateTimeIntervalType.Auto;
+
+ /// <summary>
+ /// Minimum font size that can be used by the labels auto-fitting algorithm.
+ /// </summary>
+ internal int labelAutoFitMinFontSize = 6;
+
+ /// <summary>
+ /// Maximum font size that can be used by the labels auto-fitting algorithm.
+ /// </summary>
+ internal int labelAutoFitMaxFontSize = 10;
+
+ /// <summary>
+ /// Axis tooltip
+ /// </summary>
+ private string _toolTip = String.Empty;
+
+ /// <summary>
+ /// Axis HREF
+ /// </summary>
+ private string _url = String.Empty;
+
+#if !Microsoft_CONTROL
+
+
+ /// <summary>
+ /// Axis map area attributes
+ /// </summary>
+ private string _mapAreaAttributes = String.Empty;
+
+ private string _postbackValue = String.Empty;
+
+#endif
+
+ #endregion
+
+ #region Axis constructor and initialization
+
+ /// <summary>
+ /// Default constructor of Axis.
+ /// </summary>
+ public Axis()
+ : base(null, GetName(AxisName.X))
+ {
+ Initialize(AxisName.X);
+ }
+
+ /// <summary>
+ /// Axis constructor.
+ /// </summary>
+ /// <param name="chartArea">The chart area the axis belongs to.</param>
+ /// <param name="axisTypeName">The type of the axis.</param>
+ public Axis(ChartArea chartArea, AxisName axisTypeName)
+ : base(chartArea, GetName(axisTypeName))
+ {
+ Initialize(axisTypeName);
+ }
+
+ /// <summary>
+ /// Initialize axis class
+ /// </summary>
+ /// <param name="axisTypeName">Name of the axis type.</param>
+ private void Initialize(AxisName axisTypeName)
+ {
+ // DT: Axis could be already created. Don't recreate new labelstyle and other objects.
+ // Initialize axis labels
+ if (labelStyle == null)
+ {
+ labelStyle = new LabelStyle(this);
+ }
+ if (_customLabels == null)
+ {
+ _customLabels = new CustomLabelsCollection(this);
+ }
+ if (_scaleView == null)
+ {
+ // Create axis data scaleView object
+ _scaleView = new AxisScaleView(this);
+ }
+#if Microsoft_CONTROL
+ if (scrollBar == null)
+ {
+ // Create axis croll bar class
+ scrollBar = new AxisScrollBar(this);
+ }
+#endif // Microsoft_CONTROL
+
+ this.axisType = axisTypeName;
+
+ // Create grid & tick marks objects
+ if (minorTickMark == null)
+ {
+ minorTickMark = new TickMark(this, false);
+ }
+ if (majorTickMark == null)
+ {
+ majorTickMark = new TickMark(this, true);
+ majorTickMark.Interval = double.NaN;
+ majorTickMark.IntervalOffset = double.NaN;
+ majorTickMark.IntervalType = DateTimeIntervalType.NotSet;
+ majorTickMark.IntervalOffsetType = DateTimeIntervalType.NotSet;
+ }
+ if (minorGrid == null)
+ {
+ minorGrid = new Grid(this, false);
+ }
+ if (majorGrid == null)
+ {
+ majorGrid = new Grid(this, true);
+ majorGrid.Interval = double.NaN;
+ majorGrid.IntervalOffset = double.NaN;
+ majorGrid.IntervalType = DateTimeIntervalType.NotSet;
+ majorGrid.IntervalOffsetType = DateTimeIntervalType.NotSet;
+ }
+ if (this._stripLines == null)
+ {
+ this._stripLines = new StripLinesCollection(this);
+ }
+
+ if (_titleFont == null)
+ {
+ _titleFont = _fontCache.DefaultFont;
+ }
+#if SUBAXES
+ if(this.subAxes == null)
+ {
+ this.subAxes = new SubAxisCollection(this);
+ }
+#endif // SUBAXES
+
+#if Microsoft_CONTROL
+
+ // Initialize axis scroll bar class
+ this.ScrollBar.Initialize();
+
+#endif // Microsoft_CONTROL
+
+ // Create collection of scale segments
+ if (this.scaleSegments == null)
+ {
+ this.scaleSegments = new AxisScaleSegmentCollection(this);
+ }
+
+ // Create scale break style
+ if (this.axisScaleBreakStyle == null)
+ {
+ this.axisScaleBreakStyle = new AxisScaleBreakStyle(this);
+ }
+ }
+
+ /// <summary>
+ /// Initialize axis class
+ /// </summary>
+ /// <param name="chartArea">Chart area that the axis belongs.</param>
+ /// <param name="axisTypeName">Axis type.</param>
+ internal void Initialize(ChartArea chartArea, AxisName axisTypeName)
+ {
+ this.Initialize(axisTypeName);
+ this.Parent = chartArea;
+ this.Name = GetName(axisTypeName);
+ }
+
+ /// <summary>
+ /// Set Axis Name
+ /// </summary>
+ internal static string GetName(AxisName axisName)
+ {
+ // Set axis name.
+ // NOTE: Strings below should neber be localized. Name properties in the chart are never localized
+ // and represent consisten object name in all locales.
+ switch (axisName)
+ {
+ case (AxisName.X):
+ return "X axis";
+ case (AxisName.Y):
+ return "Y (Value) axis";
+ case (AxisName.X2):
+ return "Secondary X axis";
+ case (AxisName.Y2):
+ return "Secondary Y (Value) axis";
+ }
+ return null;
+ }
+
+ #endregion
+
+ #region Axis properies
+
+ // Internal
+ internal ChartArea ChartArea
+ {
+ get { return Parent as ChartArea; }
+ }
+
+ /// <summary>
+ /// Text orientation.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeTitle"),
+ Bindable(true),
+ DefaultValue(TextOrientation.Auto),
+ SRDescription("DescriptionAttribute_TextOrientation"),
+ NotifyParentPropertyAttribute(true),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+#endif
+]
+ public TextOrientation TextOrientation
+ {
+ get
+ {
+ return this._textOrientation;
+ }
+ set
+ {
+ this._textOrientation = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Returns sub-axis name.
+ /// </summary>
+ virtual internal string SubAxisName
+ {
+ get
+ {
+ return string.Empty;
+ }
+ }
+
+#if SUBAXES
+
+ /// <summary>
+ /// Indicates if this axis object present the main or sub axis.
+ /// </summary>
+ virtual internal bool IsSubAxis
+ {
+ get
+ {
+ return false;
+ }
+ }
+
+ private SubAxisCollection subAxes = null;
+
+ /// <summary>
+ /// Sub-axes collection.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeSubAxes"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeSubAxes"),
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ Editor(Editors.ChartCollectionEditor.Editor, Editors.ChartCollectionEditor.Base)
+ ]
+ virtual public SubAxisCollection SubAxes
+ {
+ get
+ {
+ return this.subAxes;
+ }
+ }
+
+#endif // SUBAXES
+
+ /// <summary>
+ /// Gets or sets a flag which indicates whether interlaced strip lines will be displayed for the axis.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeInterlaced"),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+#endif
+ NotifyParentPropertyAttribute(true),
+ ]
+ public bool IsInterlaced
+ {
+ get
+ {
+ return _isInterlaced;
+ }
+ set
+ {
+ _isInterlaced = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the color used to draw interlaced strip lines for the axis.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeInterlacedColor"),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+#endif
+]
+ public Color InterlacedColor
+ {
+ get
+ {
+ return _interlacedColor;
+ }
+ set
+ {
+ _interlacedColor = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Axis name. This field is reserved for internal use only.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ Browsable(false),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeAxis_Name"),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+#endif
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden)
+ ]
+ public override string Name
+ {
+ get
+ {
+ return base.Name;
+ }
+ set
+ {
+ base.Name = value;
+ }
+ }
+
+ /// <summary>
+ /// Axis name. This field is reserved for internal use only.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ Browsable(false),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeType"),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+#endif
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden)
+ ]
+ virtual public AxisName AxisName
+ {
+ get
+ {
+ return axisType;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the arrow style used for the axis.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(AxisArrowStyle.None),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeArrows"),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+#endif
+]
+ public AxisArrowStyle ArrowStyle
+ {
+ get
+ {
+ return _arrowStyle;
+ }
+ set
+ {
+ _arrowStyle = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the properties used for the major gridlines.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeGridTickMarks"),
+ Bindable(true),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeMajorGrid"),
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ TypeConverter(typeof(NoNameExpandableObjectConverter))
+ ]
+ public Grid MajorGrid
+ {
+ get
+ {
+ return majorGrid;
+ }
+ set
+ {
+ majorGrid = value;
+ majorGrid.Axis = this;
+ majorGrid.majorGridTick = true;
+
+ if (!majorGrid.intervalChanged)
+ majorGrid.Interval = double.NaN;
+ if (!majorGrid.intervalOffsetChanged)
+ majorGrid.IntervalOffset = double.NaN;
+ if (!majorGrid.intervalTypeChanged)
+ majorGrid.IntervalType = DateTimeIntervalType.NotSet;
+ if (!majorGrid.intervalOffsetTypeChanged)
+ majorGrid.IntervalOffsetType = DateTimeIntervalType.NotSet;
+
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the properties used for the minor gridlines.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeGridTickMarks"),
+ Bindable(true),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeMinorGrid"),
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ TypeConverter(typeof(NoNameExpandableObjectConverter))
+ ]
+ public Grid MinorGrid
+ {
+ get
+ {
+ return minorGrid;
+ }
+ set
+ {
+ minorGrid = value;
+ minorGrid.Initialize(this, false);
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the properties used for the major tick marks.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeGridTickMarks"),
+ Bindable(true),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeMajorTickMark"),
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ TypeConverter(typeof(NoNameExpandableObjectConverter))
+ ]
+ public TickMark MajorTickMark
+ {
+ get
+ {
+ return majorTickMark;
+ }
+ set
+ {
+ majorTickMark = value;
+ majorTickMark.Axis = this;
+ majorTickMark.majorGridTick = true;
+
+ if (!majorTickMark.intervalChanged)
+ majorTickMark.Interval = double.NaN;
+ if (!majorTickMark.intervalOffsetChanged)
+ majorTickMark.IntervalOffset = double.NaN;
+ if (!majorTickMark.intervalTypeChanged)
+ majorTickMark.IntervalType = DateTimeIntervalType.NotSet;
+ if (!majorTickMark.intervalOffsetTypeChanged)
+ majorTickMark.IntervalOffsetType = DateTimeIntervalType.NotSet;
+
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the properties used for the minor tick marks.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeGridTickMarks"),
+ Bindable(true),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeMinorTickMark"),
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ TypeConverter(typeof(NoNameExpandableObjectConverter))
+ ]
+ public TickMark MinorTickMark
+ {
+ get
+ {
+ return minorTickMark;
+ }
+ set
+ {
+ minorTickMark = value;
+ minorTickMark.Initialize(this, false);
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag which indicates whether auto-fitting of labels is enabled.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeLabels"),
+ Bindable(true),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeLabelsAutoFit"),
+ NotifyParentPropertyAttribute(true),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+#endif
+ RefreshPropertiesAttribute(RefreshProperties.All)
+ ]
+ public bool IsLabelAutoFit
+ {
+ get
+ {
+ return _isLabelAutoFit;
+ }
+ set
+ {
+ _isLabelAutoFit = value;
+ this.Invalidate();
+ }
+ }
+
+
+
+ /// <summary>
+ /// Gets or sets the minimum font size that can be used by
+ /// the label auto-fitting algorithm.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeLabels"),
+ Bindable(true),
+ DefaultValue(6),
+ SRDescription("DescriptionAttributeLabelsAutoFitMinFontSize"),
+ NotifyParentPropertyAttribute(true),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+#endif
+ RefreshPropertiesAttribute(RefreshProperties.All)
+ ]
+ public int LabelAutoFitMinFontSize
+ {
+ get
+ {
+ return this.labelAutoFitMinFontSize;
+ }
+ set
+ {
+ // Font size cannot be less than 5
+ if(value < 5)
+ {
+ throw (new InvalidOperationException(SR.ExceptionAxisLabelsAutoFitMinFontSizeValueInvalid));
+ }
+
+ this.labelAutoFitMinFontSize = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the maximum font size that can be used by
+ /// the label auto-fitting algorithm.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeLabels"),
+ Bindable(true),
+ DefaultValue(10),
+ SRDescription("DescriptionAttributeLabelsAutoFitMaxFontSize"),
+ NotifyParentPropertyAttribute(true),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+#endif
+ RefreshPropertiesAttribute(RefreshProperties.All)
+ ]
+ public int LabelAutoFitMaxFontSize
+ {
+ get
+ {
+ return this.labelAutoFitMaxFontSize;
+ }
+ set
+ {
+ // Font size cannot be less than 5
+ if(value < 5)
+ {
+ throw (new InvalidOperationException(SR.ExceptionAxisLabelsAutoFitMaxFontSizeInvalid));
+ }
+
+ this.labelAutoFitMaxFontSize = value;
+ this.Invalidate();
+ }
+ }
+
+
+
+ /// <summary>
+ /// Gets or sets the auto-fitting style used for the labels.
+ /// IsLabelAutoFit must be set to true.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeLabels"),
+ Bindable(true),
+ DefaultValue(LabelAutoFitStyles.DecreaseFont | LabelAutoFitStyles.IncreaseFont | LabelAutoFitStyles.LabelsAngleStep30 | LabelAutoFitStyles.StaggeredLabels | LabelAutoFitStyles.WordWrap),
+ SRDescription("DescriptionAttributeLabelsAutoFitStyle"),
+ NotifyParentPropertyAttribute(true),
+ Editor(Editors.FlagsEnumUITypeEditor.Editor, Editors.FlagsEnumUITypeEditor.Base),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+#endif
+]
+ public LabelAutoFitStyles LabelAutoFitStyle
+ {
+ get
+ {
+ return this._labelAutoFitStyle;
+ }
+ set
+ {
+ this._labelAutoFitStyle = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag which indicates whether
+ /// tick marks and labels move with the axis when
+ /// the crossing value changes.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeMarksNextToAxis"),
+ NotifyParentPropertyAttribute(true),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+#endif
+]
+ virtual public bool IsMarksNextToAxis
+ {
+ get
+ {
+ return _isMarksNextToAxis;
+ }
+ set
+ {
+ _isMarksNextToAxis = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the axis title.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeTitle"),
+ Bindable(true),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeTitle6"),
+ NotifyParentPropertyAttribute(true),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+#endif
+]
+ public string Title
+ {
+ get
+ {
+ return _title;
+ }
+ set
+ {
+ _title = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the color of the axis title.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeTitle"),
+ Bindable(true),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeTitleColor"),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+#endif
+]
+ public Color TitleForeColor
+ {
+ get
+ {
+ return _titleForeColor;
+ }
+ set
+ {
+ _titleForeColor = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the alignment of the axis title.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeTitle"),
+ Bindable(true),
+ DefaultValue(typeof(StringAlignment), "Center"),
+ SRDescription("DescriptionAttributeTitleAlignment"),
+ NotifyParentPropertyAttribute(true),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+#endif
+]
+ public StringAlignment TitleAlignment
+ {
+ get
+ {
+ return _titleAlignment;
+ }
+ set
+ {
+ _titleAlignment = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the font used for the axis title.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeTitle"),
+ Bindable(true),
+ DefaultValue(typeof(Font), "Microsoft Sans Serif, 8pt"),
+ SRDescription("DescriptionAttributeTitleFont"),
+ NotifyParentPropertyAttribute(true),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+#endif
+]
+ public Font TitleFont
+ {
+ get
+ {
+ return _titleFont;
+ }
+ set
+ {
+ _titleFont = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the line color of the axis.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeLineColor"),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+#endif
+]
+ public Color LineColor
+ {
+ get
+ {
+ return _lineColor;
+ }
+ set
+ {
+ _lineColor = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the line width of the axis.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(1),
+ SRDescription("DescriptionAttributeLineWidth"),
+ NotifyParentPropertyAttribute(true),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+#endif
+]
+ public int LineWidth
+ {
+ get
+ {
+ return _lineWidth;
+ }
+ set
+ {
+ if (value < 0)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionAxisWidthIsNegative));
+ }
+ _lineWidth = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the line style of the axis.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartDashStyle.Solid),
+ SRDescription("DescriptionAttributeLineDashStyle"),
+ NotifyParentPropertyAttribute(true),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+#endif
+]
+ public ChartDashStyle LineDashStyle
+ {
+ get
+ {
+ return _lineDashStyle;
+ }
+ set
+ {
+ _lineDashStyle = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// The collection of strip lines of the axis.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeStripLines"),
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ Editor(Editors.ChartCollectionEditor.Editor, Editors.ChartCollectionEditor.Base)
+ ]
+ public StripLinesCollection StripLines
+ {
+ get
+ {
+ return _stripLines;
+ }
+ }
+
+
+ /// <summary>
+ /// Gets or sets the maximum size (in percentage) of the axis used in the automatic layout algorithm.
+ /// </summary>
+ /// <remarks>
+ /// This property determines the maximum size of the axis, measured as a percentage of the chart area.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeLabels"),
+ DefaultValue(75f),
+ SRDescription("DescriptionAttributeAxis_MaxAutoSize"),
+ ]
+ public float MaximumAutoSize
+ {
+ get
+ {
+ return this._maximumAutoSize;
+ }
+ set
+ {
+ if (value < 0f || value > 100f)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionValueMustBeInRange("MaximumAutoSize", "0", "100")));
+ }
+ this._maximumAutoSize = value;
+ this.Invalidate();
+ }
+ }
+ #endregion
+
+ #region IMapAreaAttributes Properties implementation
+
+ /// <summary>
+ /// Tooltip of the axis.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMapArea"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeToolTip"),
+ DefaultValue(""),
+ ]
+ public string ToolTip
+ {
+ set
+ {
+ this._toolTip = value;
+ }
+ get
+ {
+ return this._toolTip;
+ }
+ }
+
+#if !Microsoft_CONTROL
+
+ /// <summary>
+ /// URL target of the axis.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMapArea"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeUrl"),
+ DefaultValue(""),
+ PersistenceMode(PersistenceMode.Attribute),
+ Editor(Editors.UrlValueEditor.Editor, Editors.UrlValueEditor.Base)
+ ]
+ public string Url
+ {
+ set
+ {
+ this._url = value;
+ }
+ get
+ {
+ return this._url;
+ }
+ }
+
+
+ /// <summary>
+ /// Gets or sets the map area attributes.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMapArea"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeMapAreaAttributes"),
+ DefaultValue(""),
+ PersistenceMode(PersistenceMode.Attribute)
+ ]
+ public string MapAreaAttributes
+ {
+ set
+ {
+ this._mapAreaAttributes = value;
+ }
+ get
+ {
+ return this._mapAreaAttributes;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the postback value which can be processed on click event.
+ /// </summary>
+ /// <value>The value which is passed to click event as argument.</value>
+ [DefaultValue("")]
+ [SRCategory(SR.Keys.CategoryAttributeMapArea)]
+ [SRDescription(SR.Keys.DescriptionAttributePostBackValue)]
+ public string PostBackValue
+ {
+ get
+ {
+ return this._postbackValue;
+ }
+ set
+ {
+ this._postbackValue = value;
+ }
+ }
+
+
+#endif // !Microsoft_CONTROL
+
+
+
+ #endregion
+
+ #region Axis Interavl properies
+
+ /// <summary>
+ /// Axis interval size.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeInterval"),
+ Bindable(true),
+ DefaultValue(0.0),
+ SRDescription("DescriptionAttributeInterval4"),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ TypeConverter(typeof(AxisIntervalValueConverter)),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+#endif
+]
+ public double Interval
+ {
+ get
+ {
+ return interval;
+ }
+ set
+ {
+ // Axis interval properties must be set
+ if (double.IsNaN(value))
+ {
+ interval = 0;
+ }
+ else
+ {
+ interval = value;
+ }
+
+ // Reset initial values
+ majorGrid.interval = tempMajorGridInterval;
+ majorTickMark.interval = tempMajorTickMarkInterval;
+ minorGrid.interval = tempMinorGridInterval;
+ minorTickMark.interval = tempMinorTickMarkInterval;
+ labelStyle.interval = tempLabelInterval;
+
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Axis interval offset.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeInterval"),
+ Bindable(true),
+ DefaultValue(0.0),
+ SRDescription("DescriptionAttributeIntervalOffset6"),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+#endif
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ TypeConverter(typeof(AxisIntervalValueConverter))
+ ]
+ public double IntervalOffset
+ {
+ get
+ {
+ return _intervalOffset;
+ }
+ set
+ {
+ // Axis interval properties must be set
+ if (double.IsNaN(value))
+ {
+ _intervalOffset = 0;
+ }
+ else
+ {
+ _intervalOffset = value;
+ }
+
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Axis interval type.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeInterval"),
+ Bindable(true),
+ DefaultValue(DateTimeIntervalType.Auto),
+ SRDescription("DescriptionAttributeIntervalType4"),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+#endif
+]
+ public DateTimeIntervalType IntervalType
+ {
+ get
+ {
+ return intervalType;
+ }
+ set
+ {
+ // Axis interval properties must be set
+ if (value == DateTimeIntervalType.NotSet)
+ {
+ intervalType = DateTimeIntervalType.Auto;
+ }
+ else
+ {
+ intervalType = value;
+ }
+
+ // Reset initial values
+ majorGrid.intervalType = tempGridIntervalType;
+ majorTickMark.intervalType = tempTickMarkIntervalType;
+ labelStyle.intervalType = tempLabelIntervalType;
+
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Axis interval offset type.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeInterval"),
+ Bindable(true),
+ DefaultValue(DateTimeIntervalType.Auto),
+ SRDescription("DescriptionAttributeIntervalOffsetType4"),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+#endif
+]
+ public DateTimeIntervalType IntervalOffsetType
+ {
+ get
+ {
+ return intervalOffsetType;
+ }
+ set
+ {
+ // Axis interval properties must be set
+ if (value == DateTimeIntervalType.NotSet)
+ {
+ intervalOffsetType = DateTimeIntervalType.Auto;
+ }
+ else
+ {
+ intervalOffsetType = value;
+ }
+
+ this.Invalidate();
+ }
+ }
+
+ #endregion
+
+ #region Axis painting methods
+
+ /// <summary>
+ /// Checks if Common.Chart axis title is drawn vertically.
+ /// Note: From the drawing perspective stacked text orientation is not vertical.
+ /// </summary>
+ /// <returns>True if text is vertical.</returns>
+ private bool IsTextVertical
+ {
+ get
+ {
+ TextOrientation currentTextOrientation = this.GetTextOrientation();
+ return currentTextOrientation == TextOrientation.Rotated90 || currentTextOrientation == TextOrientation.Rotated270;
+ }
+ }
+
+ /// <summary>
+ /// Returns axis title text orientation. If set to Auto automatically determines the
+ /// orientation based on the axis position.
+ /// </summary>
+ /// <returns>Current text orientation.</returns>
+ private TextOrientation GetTextOrientation()
+ {
+ if (this.TextOrientation == TextOrientation.Auto)
+ {
+ if (this.AxisPosition == AxisPosition.Left)
+ {
+ return TextOrientation.Rotated270;
+ }
+ else if (this.AxisPosition == AxisPosition.Right)
+ {
+ return TextOrientation.Rotated90;
+ }
+ return TextOrientation.Horizontal;
+ }
+ return this.TextOrientation;
+ }
+
+ /// <summary>
+ /// Paint Axis elements on the back of the 3D scene.
+ /// </summary>
+ /// <param name="graph">Reference to the Chart Graphics object</param>
+ internal void PrePaint(ChartGraphics graph)
+ {
+ if (enabled != false)
+ {
+ // draw axis hot region
+ DrawAxisLineHotRegion(graph, true);
+
+ // Paint Major Tick Marks
+ majorTickMark.Paint(graph, true);
+
+ // Paint Minor Tick Marks
+ minorTickMark.Paint(graph, true);
+
+ // Draw axis line
+ DrawAxisLine(graph, true);
+
+ // Paint Labels
+ labelStyle.Paint(graph, true);
+ }
+
+#if SUBAXES
+ // Process all sub-axis
+ if(!ChartArea.Area3DStyle.Enable3D &&
+ !ChartArea.chartAreaIsCurcular)
+ {
+ foreach(SubAxis subAxis in this.SubAxes)
+ {
+ subAxis.PrePaint( graph );
+ }
+ }
+#endif // SUBAXES
+ }
+
+ /// <summary>
+ /// Paint Axis
+ /// </summary>
+ /// <param name="graph">Reference to the Chart Graphics object</param>
+ internal void Paint(ChartGraphics graph)
+ {
+ // Only Y axis is drawn in the circular Common.Chart area
+ if (ChartArea != null && ChartArea.chartAreaIsCurcular)
+ {
+ // Y circular axes
+ if (this.axisType == AxisName.Y && enabled != false)
+ {
+ ICircularChartType chartType = ChartArea.GetCircularChartType();
+ if (chartType != null)
+ {
+ Matrix oldMatrix = graph.Transform;
+ float[] axesLocation = chartType.GetYAxisLocations(ChartArea);
+ bool drawLabels = true;
+ foreach (float curentSector in axesLocation)
+ {
+ // Set graphics rotation matrix
+ Matrix newMatrix = oldMatrix.Clone();
+ newMatrix.RotateAt(
+ curentSector,
+ graph.GetAbsolutePoint(ChartArea.circularCenter));
+ graph.Transform = newMatrix;
+
+ // draw axis hot region
+ DrawAxisLineHotRegion(graph, false);
+
+ // Paint Minor Tick Marks
+ minorTickMark.Paint(graph, false);
+
+ // Paint Major Tick Marks
+ majorTickMark.Paint(graph, false);
+
+ // Draw axis line
+ DrawAxisLine(graph, false);
+
+ // Only first Y axis has labels
+ if (drawLabels)
+ {
+ drawLabels = false;
+
+ // Save current font angle
+ int currentAngle = labelStyle.Angle;
+
+ // Set labels text angle
+ if (labelStyle.Angle == 0)
+ {
+ if (curentSector >= 45f && curentSector <= 180f)
+ {
+ labelStyle.angle = -90;
+ }
+ else if (curentSector > 180f && curentSector <= 315f)
+ {
+ labelStyle.angle = 90;
+ }
+ }
+
+ // Draw labels
+ labelStyle.Paint(graph, false);
+
+ // Restore font angle
+ labelStyle.angle = currentAngle;
+ }
+ }
+
+ graph.Transform = oldMatrix;
+ }
+ }
+
+ // X circular axes
+ if (this.axisType == AxisName.X && enabled != false)
+ {
+ labelStyle.PaintCircular(graph);
+ }
+
+ DrawAxisTitle(graph);
+
+ return;
+ }
+
+ // If axis is disabled draw only Title
+ if (enabled != false)
+ {
+
+ // draw axis hot region
+ DrawAxisLineHotRegion(graph, false);
+
+ // Paint Minor Tick Marks
+ minorTickMark.Paint(graph, false);
+
+ // Paint Major Tick Marks
+ majorTickMark.Paint(graph, false);
+
+ // Draw axis line
+ DrawAxisLine(graph, false);
+
+ // Paint Labels
+ labelStyle.Paint(graph, false);
+
+#if Microsoft_CONTROL
+
+ // Scroll bar is supoorted only in 2D charts
+ if (ChartArea != null && ChartArea.Area3DStyle.Enable3D == false)
+ {
+ // Draw axis scroll bar
+ ScrollBar.Paint(graph);
+ }
+#endif // Microsoft_CONTROL
+
+ }
+
+ // Draw axis title
+ this.DrawAxisTitle(graph);
+
+#if SUBAXES
+ // Process all sub-axis
+ if(ChartArea.IsSubAxesSupported)
+ {
+ foreach(SubAxis subAxis in this.SubAxes)
+ {
+ subAxis.Paint( graph );
+ }
+ }
+#endif // SUBAXES
+
+ // Reset temp axis offset for side-by-side charts like column
+ this.ResetTempAxisOffset();
+ }
+
+
+
+ /// <summary>
+ /// Paint Axis element when segmented axis scale feature is used.
+ /// </summary>
+ /// <param name="graph">Reference to the Chart Graphics object</param>
+ internal void PaintOnSegmentedScalePassOne( ChartGraphics graph )
+ {
+ // If axis is disabled draw only Title
+ if( enabled != false )
+ {
+ // Paint Minor Tick Marks
+ minorTickMark.Paint( graph, false );
+
+ // Paint Major Tick Marks
+ majorTickMark.Paint( graph, false );
+ }
+
+#if SUBAXES
+ // Process all sub-axis
+ if(ChartArea.IsSubAxesSupported)
+ {
+ foreach(SubAxis subAxis in this.SubAxes)
+ {
+ subAxis.PaintOnSegmentedScalePassOne( graph );
+ }
+ }
+#endif // SUBAXES
+
+ }
+
+ /// <summary>
+ /// Paint Axis element when segmented axis scale feature is used.
+ /// </summary>
+ /// <param name="graph">Reference to the Chart Graphics object</param>
+ internal void PaintOnSegmentedScalePassTwo( ChartGraphics graph )
+ {
+ // If axis is disabled draw only Title
+ if( enabled != false )
+ {
+ // Draw axis line
+ DrawAxisLine( graph, false );
+
+ // Paint Labels
+ labelStyle.Paint( graph, false);
+ }
+
+ // Draw axis title
+ this.DrawAxisTitle( graph );
+
+ // Reset temp axis offset for side-by-side charts like column
+ this.ResetTempAxisOffset();
+
+#if SUBAXES
+ // Process all sub-axis
+ if(ChartArea.IsSubAxesSupported)
+ {
+ foreach(SubAxis subAxis in this.SubAxes)
+ {
+ subAxis.PaintOnSegmentedScalePassTwo( graph );
+ }
+ }
+#endif // SUBAXES
+
+ }
+
+ /// <summary>
+ /// Draw axis title
+ /// </summary>
+ /// <param name="graph">Reference to the Chart Graphics object</param>
+ private void DrawAxisTitle(ChartGraphics graph)
+ {
+ if (!this.enabled)
+ return;
+
+ // Draw axis title
+ if (this.Title.Length > 0)
+ {
+ Matrix oldTransform = null;
+
+ // Draw title in 3D
+ if (ChartArea.Area3DStyle.Enable3D && !ChartArea.chartAreaIsCurcular)
+ {
+ DrawAxis3DTitle(graph);
+ return;
+ }
+
+ string axisTitle = this.Title;
+
+ //******************************************************
+ //** Check axis position
+ //******************************************************
+ float axisPosition = (float)this.GetAxisPosition();
+ if (this.AxisPosition == AxisPosition.Bottom)
+ {
+ if (!this.GetIsMarksNextToAxis())
+ {
+ axisPosition = ChartArea.PlotAreaPosition.Bottom;
+ }
+ axisPosition = ChartArea.PlotAreaPosition.Bottom - axisPosition;
+ }
+ else if (this.AxisPosition == AxisPosition.Top)
+ {
+ if (!this.GetIsMarksNextToAxis())
+ {
+ axisPosition = ChartArea.PlotAreaPosition.Y;
+ }
+ axisPosition = axisPosition - ChartArea.PlotAreaPosition.Y;
+ }
+ else if (this.AxisPosition == AxisPosition.Right)
+ {
+ if (!this.GetIsMarksNextToAxis())
+ {
+ axisPosition = ChartArea.PlotAreaPosition.Right;
+ }
+ axisPosition = ChartArea.PlotAreaPosition.Right - axisPosition;
+ }
+ else if (this.AxisPosition == AxisPosition.Left)
+ {
+ if (!this.GetIsMarksNextToAxis())
+ {
+ axisPosition = ChartArea.PlotAreaPosition.X;
+ }
+ axisPosition = axisPosition - ChartArea.PlotAreaPosition.X;
+ }
+
+ //******************************************************
+ //** Adjust axis elements size with axis position
+ //******************************************************
+ // Calculate total size of axis elements
+ float axisSize = this.markSize + this.labelSize;
+ axisSize -= axisPosition;
+ if (axisSize < 0)
+ {
+ axisSize = 0;
+ }
+ // Set title alignment
+ using (StringFormat format = new StringFormat())
+ {
+ format.Alignment = this.TitleAlignment;
+ format.Trimming = StringTrimming.EllipsisCharacter;
+ // VSTS #144398
+ // We need to have the StringFormatFlags set to FitBlackBox as othwerwise axis titles using Fonts like
+ // "Algerian" or "Forte" are completly clipped (= not drawn) due to the fact that MeasureString returns
+ // a bounding rectangle that is too small.
+ format.FormatFlags |= StringFormatFlags.FitBlackBox;
+
+ // Calculate title rectangle
+ _titlePosition = ChartArea.PlotAreaPosition.ToRectangleF();
+ float titleSizeWithoutSpacing = this.titleSize - elementSpacing;
+ if (this.AxisPosition == AxisPosition.Left)
+ {
+ _titlePosition.X = ChartArea.PlotAreaPosition.X - titleSizeWithoutSpacing - axisSize;
+ _titlePosition.Y = ChartArea.PlotAreaPosition.Y;
+
+ if (!this.IsTextVertical)
+ {
+ SizeF axisTitleSize = new SizeF(titleSizeWithoutSpacing, ChartArea.PlotAreaPosition.Height);
+ _titlePosition.Width = axisTitleSize.Width;
+ _titlePosition.Height = axisTitleSize.Height;
+
+ format.Alignment = StringAlignment.Center;
+ if (this.TitleAlignment == StringAlignment.Far)
+ {
+ format.LineAlignment = StringAlignment.Near;
+ }
+ else if (this.TitleAlignment == StringAlignment.Near)
+ {
+ format.LineAlignment = StringAlignment.Far;
+ }
+ else
+ {
+ format.LineAlignment = StringAlignment.Center;
+ }
+ }
+ else
+ {
+ SizeF axisTitleSize = graph.GetAbsoluteSize(new SizeF(titleSizeWithoutSpacing, ChartArea.PlotAreaPosition.Height));
+ axisTitleSize = graph.GetRelativeSize(new SizeF(axisTitleSize.Height, axisTitleSize.Width));
+
+ _titlePosition.Width = axisTitleSize.Width;
+ _titlePosition.Height = axisTitleSize.Height;
+
+ _titlePosition.Y += ChartArea.PlotAreaPosition.Height / 2f - _titlePosition.Height / 2f;
+ _titlePosition.X += titleSizeWithoutSpacing / 2f - _titlePosition.Width / 2f;
+
+ // Set graphics rotation transformation
+ oldTransform = this.SetRotationTransformation(graph, _titlePosition);
+
+ // Set alignment
+ format.LineAlignment = StringAlignment.Center;
+ }
+ }
+ else if (this.AxisPosition == AxisPosition.Right)
+ {
+ _titlePosition.X = ChartArea.PlotAreaPosition.Right + axisSize;
+ _titlePosition.Y = ChartArea.PlotAreaPosition.Y;
+
+ if (!this.IsTextVertical)
+ {
+ SizeF axisTitleSize = new SizeF(titleSizeWithoutSpacing, ChartArea.PlotAreaPosition.Height);
+ _titlePosition.Width = axisTitleSize.Width;
+ _titlePosition.Height = axisTitleSize.Height;
+
+ format.Alignment = StringAlignment.Center;
+ if (this.TitleAlignment == StringAlignment.Far)
+ {
+ format.LineAlignment = StringAlignment.Near;
+ }
+ else if (this.TitleAlignment == StringAlignment.Near)
+ {
+ format.LineAlignment = StringAlignment.Far;
+ }
+ else
+ {
+ format.LineAlignment = StringAlignment.Center;
+ }
+ }
+ else
+ {
+ SizeF axisTitleSize = graph.GetAbsoluteSize(new SizeF(titleSizeWithoutSpacing, ChartArea.PlotAreaPosition.Height));
+ axisTitleSize = graph.GetRelativeSize(new SizeF(axisTitleSize.Height, axisTitleSize.Width));
+
+ _titlePosition.Width = axisTitleSize.Width;
+ _titlePosition.Height = axisTitleSize.Height;
+
+ _titlePosition.Y += ChartArea.PlotAreaPosition.Height / 2f - _titlePosition.Height / 2f;
+ _titlePosition.X += titleSizeWithoutSpacing / 2f - _titlePosition.Width / 2f;
+
+ // Set graphics rotation transformation
+ oldTransform = this.SetRotationTransformation(graph, _titlePosition);
+
+ // Set alignment
+ format.LineAlignment = StringAlignment.Center;
+ }
+ }
+ else if (this.AxisPosition == AxisPosition.Top)
+ {
+ _titlePosition.Y = ChartArea.PlotAreaPosition.Y - titleSizeWithoutSpacing - axisSize;
+ _titlePosition.Height = titleSizeWithoutSpacing;
+ _titlePosition.X = ChartArea.PlotAreaPosition.X;
+ _titlePosition.Width = ChartArea.PlotAreaPosition.Width;
+
+ if (this.IsTextVertical)
+ {
+ // Set graphics rotation transformation
+ oldTransform = this.SetRotationTransformation(graph, _titlePosition);
+ }
+
+ // Set alignment
+ format.LineAlignment = StringAlignment.Center;
+ }
+ else if (this.AxisPosition == AxisPosition.Bottom)
+ {
+ _titlePosition.Y = ChartArea.PlotAreaPosition.Bottom + axisSize;
+ _titlePosition.Height = titleSizeWithoutSpacing;
+ _titlePosition.X = ChartArea.PlotAreaPosition.X;
+ _titlePosition.Width = ChartArea.PlotAreaPosition.Width;
+
+ if (this.IsTextVertical)
+ {
+ // Set graphics rotation transformation
+ oldTransform = this.SetRotationTransformation(graph, _titlePosition);
+ }
+
+ // Set alignment
+ format.LineAlignment = StringAlignment.Center;
+ }
+
+#if DEBUG
+ // TESTING CODE: Shows labels rectangle position.
+ // RectangleF rr = graph.GetAbsoluteRectangle(_titlePosition);
+ // graph.DrawRectangle(Pens.Blue, rr.X, rr.Y, rr.Width, rr.Height);
+#endif // DEBUG
+
+ // Draw title
+ using (Brush brush = new SolidBrush(this.TitleForeColor))
+ {
+ graph.DrawStringRel(
+ axisTitle.Replace("\\n", "\n"),
+ this.TitleFont,
+ brush,
+ _titlePosition,
+ format,
+ this.GetTextOrientation());
+ }
+ }
+
+ // Process selection regions
+ if (this.Common.ProcessModeRegions)
+ {
+ // NOTE: Solves Issue #4423
+ // Transform title position coordinates using curent Graphics matrix
+ RectangleF transformedTitlePosition = graph.GetAbsoluteRectangle(_titlePosition);
+ PointF[] rectPoints = new PointF[] {
+ new PointF(transformedTitlePosition.X, transformedTitlePosition.Y),
+ new PointF(transformedTitlePosition.Right, transformedTitlePosition.Bottom) };
+ graph.Transform.TransformPoints(rectPoints);
+ transformedTitlePosition = new RectangleF(
+ rectPoints[0].X,
+ rectPoints[0].Y,
+ rectPoints[1].X - rectPoints[0].X,
+ rectPoints[1].Y - rectPoints[0].Y);
+ if (transformedTitlePosition.Width < 0)
+ {
+ transformedTitlePosition.Width = Math.Abs(transformedTitlePosition.Width);
+ transformedTitlePosition.X -= transformedTitlePosition.Width;
+ }
+ if (transformedTitlePosition.Height < 0)
+ {
+ transformedTitlePosition.Height = Math.Abs(transformedTitlePosition.Height);
+ transformedTitlePosition.Y -= transformedTitlePosition.Height;
+ }
+
+ // Add hot region
+ this.Common.HotRegionsList.AddHotRegion(
+ transformedTitlePosition, this, ChartElementType.AxisTitle, false, false);
+ }
+
+ // Restore old transformation
+ if (oldTransform != null)
+ {
+ graph.Transform = oldTransform;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Helper method which sets 90 or -90 degrees transformation in the middle of the
+ /// specified rectangle. It is used to draw title text rotated 90 or 270 degrees.
+ /// </summary>
+ /// <param name="graph">Chart graphics to apply transformation for.</param>
+ /// <param name="titlePosition">Title position.</param>
+ /// <returns>Old graphics transformation matrix.</returns>
+ private Matrix SetRotationTransformation(ChartGraphics graph, RectangleF titlePosition)
+ {
+ // Save old graphics transformation
+ Matrix oldTransform = graph.Transform.Clone();
+
+ // Rotate left tile 90 degrees at center
+ PointF center = PointF.Empty;
+ center.X = titlePosition.X + titlePosition.Width / 2F;
+ center.Y = titlePosition.Y + titlePosition.Height / 2F;
+
+ // Create and set new transformation matrix
+ float angle = (this.GetTextOrientation() == TextOrientation.Rotated90) ? 90f : -90f;
+ Matrix newMatrix = graph.Transform.Clone();
+ newMatrix.RotateAt(angle, graph.GetAbsolutePoint(center));
+ graph.Transform = newMatrix;
+
+ return oldTransform;
+ }
+
+
+ /// <summary>
+ /// Draws a radial line in circular Common.Chart area.
+ /// </summary>
+ /// <param name="obj">Object requesting the painting.</param>
+ /// <param name="graph">Graphics path.</param>
+ /// <param name="color">Line color.</param>
+ /// <param name="width">Line width.</param>
+ /// <param name="style">Line style.</param>
+ /// <param name="position">X axis circular position.</param>
+ internal void DrawRadialLine(
+ object obj,
+ ChartGraphics graph,
+ Color color,
+ int width,
+ ChartDashStyle style,
+ double position)
+ {
+ // Create circle position rectangle
+ RectangleF rect = ChartArea.PlotAreaPosition.ToRectangleF();
+ rect = graph.GetAbsoluteRectangle(rect);
+
+ // Make sure the rectangle width equals rectangle height for the circle
+ if (rect.Width != rect.Height)
+ {
+ if (rect.Width > rect.Height)
+ {
+ rect.X += (rect.Width - rect.Height) / 2f;
+ rect.Width = rect.Height;
+ }
+ else
+ {
+ rect.Y += (rect.Height - rect.Width) / 2f;
+ rect.Height = rect.Width;
+ }
+ }
+
+ // Convert axis position to angle
+ float angle = ChartArea.CircularPositionToAngle(position);
+
+ // Set clipping region to the polygon
+ Region oldRegion = null;
+ if (ChartArea.CircularUsePolygons)
+ {
+ oldRegion = graph.Clip;
+ graph.Clip = new Region(graph.GetPolygonCirclePath(rect, ChartArea.CircularSectorsNumber));
+ }
+
+ // Get center point
+ PointF centerPoint = graph.GetAbsolutePoint(ChartArea.circularCenter);
+
+ // Set graphics rotation matrix
+ Matrix oldMatrix = graph.Transform;
+ Matrix newMatrix = oldMatrix.Clone();
+ newMatrix.RotateAt(
+ angle,
+ centerPoint);
+ graph.Transform = newMatrix;
+
+ // Draw Line
+ PointF endPoint = new PointF(rect.X + rect.Width / 2f, rect.Y);
+ graph.DrawLineAbs(color, width, style, centerPoint, endPoint);
+
+ // Process selection regions
+ if (this.Common.ProcessModeRegions)
+ {
+ using (GraphicsPath path = new GraphicsPath())
+ {
+ path.AddLine(centerPoint, endPoint);
+ path.Transform(newMatrix);
+ try
+ {
+ using (Pen pen = new Pen(Color.Black, width + 2))
+ {
+ path.Widen(pen);
+ this.Common.HotRegionsList.AddHotRegion(path, false, ChartElementType.Gridlines, obj);
+ }
+ }
+ catch (OutOfMemoryException)
+ {
+ // GraphicsPath.Widen incorrectly throws OutOfMemoryException
+ // catching here and reacting by not widening
+ }
+ catch (ArgumentException)
+ {
+ }
+ }
+ }
+
+ // Restore graphics
+ graph.Transform = oldMatrix;
+ newMatrix.Dispose();
+
+ // Restore clip region
+ if (ChartArea.CircularUsePolygons)
+ {
+ graph.Clip = oldRegion;
+ }
+
+ }
+
+ /// <summary>
+ /// Draws a circular line in circular Common.Chart area.
+ /// </summary>
+ /// <param name="obj">Object requesting the painting.</param>
+ /// <param name="graph">Graphics path.</param>
+ /// <param name="color">Line color.</param>
+ /// <param name="width">Line width.</param>
+ /// <param name="style">Line style.</param>
+ /// <param name="position">Line position.</param>
+ internal void DrawCircularLine(
+ object obj,
+ ChartGraphics graph,
+ Color color,
+ int width,
+ ChartDashStyle style,
+ float position
+ )
+ {
+ // Create circle position rectangle
+ RectangleF rect = ChartArea.PlotAreaPosition.ToRectangleF();
+ rect = graph.GetAbsoluteRectangle(rect);
+
+ // Make sure the rectangle width equals rectangle height for the circle
+ if (rect.Width != rect.Height)
+ {
+ if (rect.Width > rect.Height)
+ {
+ rect.X += (rect.Width - rect.Height) / 2f;
+ rect.Width = rect.Height;
+ }
+ else
+ {
+ rect.Y += (rect.Height - rect.Width) / 2f;
+ rect.Height = rect.Width;
+ }
+ }
+
+ // Inflate rectangle
+ PointF absPoint = graph.GetAbsolutePoint(new PointF(position, position));
+ float rectInflate = absPoint.Y - rect.Top;
+ rect.Inflate(-rectInflate, -rectInflate);
+
+ // Create circle pen
+ Pen circlePen = new Pen(color, width);
+ circlePen.DashStyle = graph.GetPenStyle(style);
+
+ // Draw circle
+ if (ChartArea.CircularUsePolygons)
+ {
+ // Draw eaqula sides polygon
+ graph.DrawCircleAbs(circlePen, null, rect, ChartArea.CircularSectorsNumber, false);
+ }
+ else
+ {
+ graph.DrawEllipse(circlePen, rect);
+ }
+
+ // Process selection regions
+ if (this.Common.ProcessModeRegions)
+ {
+ // Bounding rectangle must be more than 1 pixel by 1 pixel
+ if (rect.Width >= 1f && rect.Height > 1)
+ {
+ GraphicsPath path = null;
+ try
+ {
+ if (ChartArea.CircularUsePolygons)
+ {
+ path = graph.GetPolygonCirclePath(rect, ChartArea.CircularSectorsNumber);
+ }
+ else
+ {
+ path = new GraphicsPath();
+ path.AddEllipse(rect);
+ }
+ circlePen.Width += 2;
+ path.Widen(circlePen);
+ this.Common.HotRegionsList.AddHotRegion(path, false, ChartElementType.Gridlines, obj);
+ }
+ catch (OutOfMemoryException)
+ {
+ // GraphicsPath.Widen incorrectly throws OutOfMemoryException
+ // catching here and reacting by not widening
+ }
+ catch (ArgumentException)
+ {
+ }
+ finally
+ {
+ path.Dispose();
+ }
+ }
+ }
+
+ }
+
+ /// <summary>
+ /// Draw axis title in 3D.
+ /// </summary>
+ /// <param name="graph">Reference to the Chart Graphics object</param>
+ private void DrawAxis3DTitle(ChartGraphics graph)
+ {
+ // Do not draw title if axis is not enabled
+ if (!this.enabled)
+ {
+ return;
+ }
+
+ string axisTitle = this.Title;
+
+ // Draw axis title
+ PointF rotationCenter = PointF.Empty;
+ int angle = 0;
+
+ // Set title alignment
+ using (StringFormat format = new StringFormat())
+ {
+ format.Alignment = this.TitleAlignment;
+ format.Trimming = StringTrimming.EllipsisCharacter;
+ format.FormatFlags |= StringFormatFlags.LineLimit;
+
+ // Measure title size for non-centered aligment
+ SizeF realTitleSize = graph.MeasureString(axisTitle.Replace("\\n", "\n"), this.TitleFont, new SizeF(10000f, 10000f), format, this.GetTextOrientation());
+ SizeF axisTitleSize = SizeF.Empty;
+ if (format.Alignment != StringAlignment.Center)
+ {
+ axisTitleSize = realTitleSize;
+ if (this.IsTextVertical)
+ {
+ // Switch height and width for vertical axis
+ float tempValue = axisTitleSize.Height;
+ axisTitleSize.Height = axisTitleSize.Width;
+ axisTitleSize.Width = tempValue;
+ }
+
+ // Get relative size
+ axisTitleSize = graph.GetRelativeSize(axisTitleSize);
+
+ // Change format aligment for the reversed mode
+ if (ChartArea.ReverseSeriesOrder)
+ {
+ if (format.Alignment == StringAlignment.Near)
+ {
+ format.Alignment = StringAlignment.Far;
+ }
+ else
+ {
+ format.Alignment = StringAlignment.Near;
+ }
+ }
+ }
+
+ // Set text rotation angle based on the text orientation
+ if (this.GetTextOrientation() == TextOrientation.Rotated90)
+ {
+ angle = 90;
+ }
+ else if (this.GetTextOrientation() == TextOrientation.Rotated270)
+ {
+ angle = -90;
+ }
+
+ // Calculate title center point on the axis
+ if (this.AxisPosition == AxisPosition.Left)
+ {
+ rotationCenter = new PointF(ChartArea.PlotAreaPosition.X, ChartArea.PlotAreaPosition.Y + ChartArea.PlotAreaPosition.Height / 2f);
+ if (format.Alignment == StringAlignment.Near)
+ {
+ rotationCenter.Y = ChartArea.PlotAreaPosition.Bottom - axisTitleSize.Height / 2f;
+ }
+ else if (format.Alignment == StringAlignment.Far)
+ {
+ rotationCenter.Y = ChartArea.PlotAreaPosition.Y + axisTitleSize.Height / 2f;
+ }
+ }
+ else if (this.AxisPosition == AxisPosition.Right)
+ {
+ rotationCenter = new PointF(ChartArea.PlotAreaPosition.Right, ChartArea.PlotAreaPosition.Y + ChartArea.PlotAreaPosition.Height / 2f);
+ if (format.Alignment == StringAlignment.Near)
+ {
+ rotationCenter.Y = ChartArea.PlotAreaPosition.Bottom - axisTitleSize.Height / 2f;
+ }
+ else if (format.Alignment == StringAlignment.Far)
+ {
+ rotationCenter.Y = ChartArea.PlotAreaPosition.Y + axisTitleSize.Height / 2f;
+ }
+ }
+ else if (this.AxisPosition == AxisPosition.Top)
+ {
+ rotationCenter = new PointF(ChartArea.PlotAreaPosition.X + ChartArea.PlotAreaPosition.Width / 2f, ChartArea.PlotAreaPosition.Y);
+ if (format.Alignment == StringAlignment.Near)
+ {
+ rotationCenter.X = ChartArea.PlotAreaPosition.X + axisTitleSize.Width / 2f;
+ }
+ else if (format.Alignment == StringAlignment.Far)
+ {
+ rotationCenter.X = ChartArea.PlotAreaPosition.Right - axisTitleSize.Width / 2f;
+ }
+ }
+ else if (this.AxisPosition == AxisPosition.Bottom)
+ {
+ rotationCenter = new PointF(ChartArea.PlotAreaPosition.X + ChartArea.PlotAreaPosition.Width / 2f, ChartArea.PlotAreaPosition.Bottom);
+ if (format.Alignment == StringAlignment.Near)
+ {
+ rotationCenter.X = ChartArea.PlotAreaPosition.X + axisTitleSize.Width / 2f;
+ }
+ else if (format.Alignment == StringAlignment.Far)
+ {
+ rotationCenter.X = ChartArea.PlotAreaPosition.Right - axisTitleSize.Width / 2f;
+ }
+ }
+
+ // Transform center of title coordinates and calculate axis angle
+ bool isOnEdge = false;
+ float zPosition = this.GetMarksZPosition(out isOnEdge);
+ Point3D[] rotationCenterPoints = null;
+ float angleAxis = 0;
+ if (this.AxisPosition == AxisPosition.Top || this.AxisPosition == AxisPosition.Bottom)
+ {
+ rotationCenterPoints = new Point3D[] {
+ new Point3D(rotationCenter.X, rotationCenter.Y, zPosition),
+ new Point3D(rotationCenter.X - 20f, rotationCenter.Y, zPosition) };
+
+ // Transform coordinates of text rotation point
+ ChartArea.matrix3D.TransformPoints(rotationCenterPoints);
+ rotationCenter = rotationCenterPoints[0].PointF;
+
+ // Get absolute coordinates
+ rotationCenterPoints[0].PointF = graph.GetAbsolutePoint(rotationCenterPoints[0].PointF);
+ rotationCenterPoints[1].PointF = graph.GetAbsolutePoint(rotationCenterPoints[1].PointF);
+
+ // Calculate X axis angle
+ angleAxis = (float)Math.Atan(
+ (rotationCenterPoints[1].Y - rotationCenterPoints[0].Y) /
+ (rotationCenterPoints[1].X - rotationCenterPoints[0].X));
+ }
+ else
+ {
+ rotationCenterPoints = new Point3D[] {
+ new Point3D(rotationCenter.X, rotationCenter.Y, zPosition),
+ new Point3D(rotationCenter.X, rotationCenter.Y - 20f, zPosition) };
+
+ // Transform coordinates of text rotation point
+ ChartArea.matrix3D.TransformPoints(rotationCenterPoints);
+ rotationCenter = rotationCenterPoints[0].PointF;
+
+ // Get absolute coordinates
+ rotationCenterPoints[0].PointF = graph.GetAbsolutePoint(rotationCenterPoints[0].PointF);
+ rotationCenterPoints[1].PointF = graph.GetAbsolutePoint(rotationCenterPoints[1].PointF);
+
+ // Calculate Y axis angle
+ if (rotationCenterPoints[1].Y != rotationCenterPoints[0].Y)
+ {
+ angleAxis = -(float)Math.Atan(
+ (rotationCenterPoints[1].X - rotationCenterPoints[0].X) /
+ (rotationCenterPoints[1].Y - rotationCenterPoints[0].Y));
+ }
+ }
+ angle += (int)Math.Round(angleAxis * 180f / (float)Math.PI);
+
+
+ // Calculate title center offset from the axis line
+ float offset = this.labelSize + this.markSize + this.titleSize / 2f;
+ float dX = 0f, dY = 0f;
+
+
+ // Adjust center of title with labels, marker and title size
+ if (this.AxisPosition == AxisPosition.Left)
+ {
+ dX = (float)(offset * Math.Cos(angleAxis));
+ rotationCenter.X -= dX;
+ }
+ else if (this.AxisPosition == AxisPosition.Right)
+ {
+ dX = (float)(offset * Math.Cos(angleAxis));
+ rotationCenter.X += dX;
+ }
+ else if (this.AxisPosition == AxisPosition.Top)
+ {
+ dY = (float)(offset * Math.Cos(angleAxis));
+ dX = (float)(offset * Math.Sin(angleAxis));
+ rotationCenter.Y -= dY;
+ if (dY > 0)
+ {
+ rotationCenter.X += dX;
+ }
+ else
+ {
+ rotationCenter.X -= dX;
+ }
+ }
+ else if (this.AxisPosition == AxisPosition.Bottom)
+ {
+ dY = (float)(offset * Math.Cos(angleAxis));
+ dX = (float)(offset * Math.Sin(angleAxis));
+ rotationCenter.Y += dY;
+ if (dY > 0)
+ {
+ rotationCenter.X -= dX;
+ }
+ else
+ {
+ rotationCenter.X += dX;
+ }
+ }
+
+
+ // Always align text in the center
+ format.LineAlignment = StringAlignment.Center;
+ format.Alignment = StringAlignment.Center;
+ // SQL VSTS Fix #259954, Dev10: 591135 Windows 7 crashes on empty transformation.
+ if (rotationCenter.IsEmpty || float.IsNaN(rotationCenter.X) || float.IsNaN(rotationCenter.Y))
+ {
+ return;
+ }
+
+ // Draw 3D title
+ using (Brush brush = new SolidBrush(this.TitleForeColor))
+ {
+ graph.DrawStringRel(
+ axisTitle.Replace("\\n", "\n"),
+ this.TitleFont,
+ brush,
+ rotationCenter,
+ format,
+ angle,
+ this.GetTextOrientation());
+ }
+
+ // Add hot region
+ if (Common.ProcessModeRegions)
+ {
+ using (GraphicsPath hotPath = graph.GetTranformedTextRectPath(rotationCenter, realTitleSize, angle))
+ {
+ this.Common.HotRegionsList.AddHotRegion(hotPath, false, ChartElementType.AxisTitle, this);
+ }
+ }
+ }
+
+ }
+
+ /// <summary>
+ /// Select Axis line
+ /// </summary>
+ /// <param name="graph">Reference to the Chart Graphics</param>
+ /// <param name="backElements">Back elements of the axis should be drawn in 3D scene.</param>
+ internal void DrawAxisLine(ChartGraphics graph, bool backElements)
+ {
+ Axis opositeAxis;
+ ArrowOrientation arrowOrientation = ArrowOrientation.Top;
+ PointF first = Point.Empty;
+ PointF second = Point.Empty;
+
+ // Set the position of axis
+ switch (AxisPosition)
+ {
+
+ case AxisPosition.Left:
+
+ first.X = (float)GetAxisPosition();
+ first.Y = PlotAreaPosition.Bottom;
+ second.X = (float)GetAxisPosition();
+ second.Y = PlotAreaPosition.Y;
+ if (isReversed)
+ arrowOrientation = ArrowOrientation.Bottom;
+ else
+ arrowOrientation = ArrowOrientation.Top;
+
+ break;
+
+ case AxisPosition.Right:
+
+ first.X = (float)GetAxisPosition();
+ first.Y = PlotAreaPosition.Bottom;
+ second.X = (float)GetAxisPosition();
+ second.Y = PlotAreaPosition.Y;
+ if (isReversed)
+ arrowOrientation = ArrowOrientation.Bottom;
+ else
+ arrowOrientation = ArrowOrientation.Top;
+
+ break;
+
+ case AxisPosition.Bottom:
+
+ first.X = PlotAreaPosition.X;
+ first.Y = (float)GetAxisPosition();
+ second.X = PlotAreaPosition.Right;
+ second.Y = (float)GetAxisPosition();
+ if (isReversed)
+ arrowOrientation = ArrowOrientation.Left;
+ else
+ arrowOrientation = ArrowOrientation.Right;
+
+ break;
+
+ case AxisPosition.Top:
+
+ first.X = PlotAreaPosition.X;
+ first.Y = (float)GetAxisPosition();
+ second.X = PlotAreaPosition.Right;
+ second.Y = (float)GetAxisPosition();
+ if (isReversed)
+ arrowOrientation = ArrowOrientation.Left;
+ else
+ arrowOrientation = ArrowOrientation.Right;
+
+ break;
+
+ }
+
+ // Update axis line position for circular area
+ if (ChartArea.chartAreaIsCurcular)
+ {
+ first.Y = PlotAreaPosition.Y + PlotAreaPosition.Height / 2f;
+ }
+
+
+ if (Common.ProcessModePaint)
+ {
+ if (!ChartArea.Area3DStyle.Enable3D || ChartArea.chartAreaIsCurcular)
+ {
+
+ // Start Svg/Flash Selection mode
+ graph.StartHotRegion( this._url, _toolTip );
+
+ // Draw the line
+ graph.DrawLineRel(_lineColor, _lineWidth, _lineDashStyle, first, second);
+
+ // End Svg/Flash Selection mode
+ graph.EndHotRegion( );
+
+ // Opposite axis. Arrow uses this axis to find
+ // a shift from Common.Chart area border. This shift
+ // depend on Tick mark size.
+ switch (arrowOrientation)
+ {
+ case ArrowOrientation.Left:
+ opositeAxis = ChartArea.AxisX;
+ break;
+ case ArrowOrientation.Right:
+ opositeAxis = ChartArea.AxisX2;
+ break;
+ case ArrowOrientation.Top:
+ opositeAxis = ChartArea.AxisY2;
+ break;
+ case ArrowOrientation.Bottom:
+ opositeAxis = ChartArea.AxisY;
+ break;
+ default:
+ opositeAxis = ChartArea.AxisX;
+ break;
+ }
+
+ // Draw arrow
+ PointF arrowPosition;
+ if (isReversed)
+ arrowPosition = first;
+ else
+ arrowPosition = second;
+
+ // Draw Arrow
+ graph.DrawArrowRel(arrowPosition, arrowOrientation, _arrowStyle, _lineColor, _lineWidth, _lineDashStyle, opositeAxis.majorTickMark.Size, _lineWidth);
+ }
+ else
+ {
+ Draw3DAxisLine(graph, first, second, (this.AxisPosition == AxisPosition.Top || this.AxisPosition == AxisPosition.Bottom), backElements);
+ }
+ }
+
+ }
+
+
+ /// <summary>
+ /// Draws the axis line hot region.
+ /// </summary>
+ /// <param name="graph">The graph.</param>
+ /// <param name="backElements">set to <c>true</c> if we draw back elements.</param>
+ private void DrawAxisLineHotRegion(ChartGraphics graph, bool backElements)
+ {
+ if (Common.ProcessModeRegions)
+ {
+ //VSTS #229835: During the 3D rendering the axis is drawn twice:
+ //1. In PrePaint() both axis and backelements (labels) are drawn.
+ //2. In Paint() the axis is redrawn without labels and as a result it creates a second hot region which covered the labels' hotregions.
+ //In order to avoid this we have to suppress the hotregion drawing in the Paint using the backElements flag (it's false during the Paint)
+ //The circular charts and 2D charts are drawn only once in Paint() so we draw the hot regions.
+ if (backElements || !ChartArea.Area3DStyle.Enable3D || ChartArea.chartAreaIsCurcular)
+ {
+ DrawAxisLineHotRegion(graph);
+ }
+ }
+
+ }
+
+ /// <summary>
+ /// Adds the axis hot region
+ /// </summary>
+ /// <param name="graph">The chart graphics instance.</param>
+ private void DrawAxisLineHotRegion(ChartGraphics graph)
+ {
+ using (GraphicsPath path = new GraphicsPath())
+ {
+ // Find the topLeft(first) and bottomRight(second) points of the hotregion rectangle
+ PointF first = PointF.Empty;
+ PointF second = PointF.Empty;
+ float axisPosition = (float)GetAxisPosition();
+
+ switch (this.AxisPosition)
+ {
+ case AxisPosition.Left:
+ first.X = axisPosition - (labelSize + markSize);
+ first.Y = PlotAreaPosition.Y;
+ second.X = axisPosition;
+ second.Y = PlotAreaPosition.Bottom;
+ break;
+
+ case AxisPosition.Right:
+ first.X = axisPosition;
+ first.Y = PlotAreaPosition.Y;
+ second.X = axisPosition + labelSize + markSize;
+ second.Y = PlotAreaPosition.Bottom;
+ break;
+
+ case AxisPosition.Bottom:
+ first.X = PlotAreaPosition.X;
+ first.Y = axisPosition;
+ second.X = PlotAreaPosition.Right;
+ second.Y = axisPosition + labelSize + markSize;
+ break;
+
+ case AxisPosition.Top:
+ first.X = PlotAreaPosition.X;
+ first.Y = axisPosition - (labelSize + markSize);
+ second.X = PlotAreaPosition.Right;
+ second.Y = axisPosition;
+ break;
+ }
+
+ // Update axis line position for circular area
+ if (ChartArea.chartAreaIsCurcular)
+ {
+ second.Y = PlotAreaPosition.Y + PlotAreaPosition.Height / 2f;
+ }
+
+ // Create rectangle and inflate it
+ RectangleF rect = new RectangleF(first.X, first.Y, second.X - first.X, second.Y - first.Y);
+ SizeF size = graph.GetRelativeSize(new SizeF(3, 3));
+
+ if (AxisPosition == AxisPosition.Top || AxisPosition == AxisPosition.Bottom)
+ {
+ rect.Inflate(2, size.Height);
+ }
+ else
+ {
+ rect.Inflate(size.Width, 2);
+ }
+
+ // Get the rectangle points
+ PointF[] points = new PointF[] {
+ new PointF(rect.Left, rect.Top),
+ new PointF(rect.Right, rect.Top),
+ new PointF(rect.Right, rect.Bottom),
+ new PointF(rect.Left, rect.Bottom)};
+
+ // If we are dealing with the 3D - transform the rectangle
+ if (ChartArea.Area3DStyle.Enable3D && !ChartArea.chartAreaIsCurcular)
+ {
+ Boolean axisOnEdge = false;
+ float zPositon = GetMarksZPosition(out axisOnEdge);
+
+ // Convert points to 3D
+ Point3D[] points3D = new Point3D[points.Length];
+ for (int i = 0; i < points.Length; i++)
+ {
+ points3D[i] = new Point3D(points[i].X, points[i].Y, zPositon);
+ }
+
+ // Transform
+ ChartArea.matrix3D.TransformPoints(points3D);
+
+ // Convert to 2D
+ for (int i = 0; i < points3D.Length; i++)
+ {
+ points[i] = points3D[i].PointF;
+ }
+ }
+
+ // Transform points to absolute cooordinates
+ for (int i = 0; i < points.Length; i++)
+ {
+ points[i] = graph.GetAbsolutePoint(points[i]);
+ }
+
+ // Add the points to the path
+ path.AddPolygon(points);
+
+
+#if Microsoft_CONTROL
+ Common.HotRegionsList.AddHotRegion(
+ graph,
+ path,
+ false,
+ this._toolTip,
+ string.Empty,
+ string.Empty,
+ string.Empty,
+ this,
+ ChartElementType.Axis);
+#else
+ Common.HotRegionsList.AddHotRegion(
+ graph,
+ path,
+ false,
+ this._toolTip,
+ this._url,
+ this._mapAreaAttributes,
+ this.PostBackValue,
+ this,
+ ChartElementType.Axis);
+#endif
+
+ }
+ }
+
+
+ /// <summary>
+ /// Draws axis line in 3D space.
+ /// </summary>
+ /// <param name="graph">Reference to the Chart Graphics object.</param>
+ /// <param name="point1">First line point.</param>
+ /// <param name="point2">Second line point.</param>
+ /// <param name="horizontal">Indicates that tick mark line is horizontal</param>
+ /// <param name="backElements">Only back elements of axis should be drawn.</param>
+ private void Draw3DAxisLine(
+ ChartGraphics graph,
+ PointF point1,
+ PointF point2,
+ bool horizontal,
+ bool backElements
+ )
+ {
+ // Check if axis is positioned on the plot area adge
+ bool onEdge = this.IsAxisOnAreaEdge;
+
+ // Check if axis tick marks are drawn inside plotting area
+ bool tickMarksOnEdge = onEdge;
+ if (tickMarksOnEdge &&
+ this.MajorTickMark.TickMarkStyle == TickMarkStyle.AcrossAxis ||
+ this.MajorTickMark.TickMarkStyle == TickMarkStyle.InsideArea ||
+ this.MinorTickMark.TickMarkStyle == TickMarkStyle.AcrossAxis ||
+ this.MinorTickMark.TickMarkStyle == TickMarkStyle.InsideArea)
+ {
+ tickMarksOnEdge = false;
+ }
+
+ // Make sure first point of axis coordinates has smaller values
+ if ((horizontal && point1.X > point2.X) ||
+ (!horizontal && point1.Y > point2.Y))
+ {
+ PointF tempPoint = new PointF(point1.X, point1.Y);
+ point1.X = point2.X;
+ point1.Y = point2.Y;
+ point2 = tempPoint;
+ }
+
+ // Check if the front/back wall is on the top drawing layer
+ float zPositon = ChartArea.IsMainSceneWallOnFront() ? ChartArea.areaSceneDepth : 0f;
+ SurfaceNames surfName = ChartArea.IsMainSceneWallOnFront() ? SurfaceNames.Front : SurfaceNames.Back;
+ if (ChartArea.ShouldDrawOnSurface(SurfaceNames.Back, backElements, tickMarksOnEdge))
+ {
+
+ // Start Svg Selection mode
+ graph.StartHotRegion( this._url, _toolTip );
+
+ // Draw axis line on the back/front wall
+ graph.Draw3DLine(
+ ChartArea.matrix3D,
+ _lineColor, _lineWidth, _lineDashStyle,
+ new Point3D(point1.X, point1.Y, zPositon),
+ new Point3D(point2.X, point2.Y, zPositon),
+ Common,
+ this,
+ ChartElementType.Nothing
+ );
+
+ // End Svg Selection mode
+ graph.EndHotRegion();
+
+ }
+
+ // Check if the back wall is on the top drawing layer
+ zPositon = ChartArea.IsMainSceneWallOnFront() ? 0f : ChartArea.areaSceneDepth;
+ surfName = ChartArea.IsMainSceneWallOnFront() ? SurfaceNames.Back : SurfaceNames.Front;
+ if (ChartArea.ShouldDrawOnSurface(surfName, backElements, tickMarksOnEdge))
+ {
+ // Draw axis line on the front wall
+ if (!onEdge ||
+ (this.AxisPosition == AxisPosition.Bottom && ChartArea.IsBottomSceneWallVisible()) ||
+ (this.AxisPosition == AxisPosition.Left && ChartArea.IsSideSceneWallOnLeft()) ||
+ (this.AxisPosition == AxisPosition.Right && !ChartArea.IsSideSceneWallOnLeft()))
+ {
+
+ // Start Svg Selection mode
+ graph.StartHotRegion( this._url, _toolTip );
+
+ graph.Draw3DLine(
+ ChartArea.matrix3D,
+ _lineColor, _lineWidth, _lineDashStyle,
+ new Point3D(point1.X, point1.Y, zPositon),
+ new Point3D(point2.X, point2.Y, zPositon),
+ Common,
+ this,
+ ChartElementType.Nothing
+ );
+
+ // End Svg Selection mode
+ graph.EndHotRegion();
+
+ }
+ }
+
+ // Check if the left/top wall is on the top drawing layer
+ SurfaceNames surfaceName = (this.AxisPosition == AxisPosition.Left || this.AxisPosition == AxisPosition.Right) ? SurfaceNames.Top : SurfaceNames.Left;
+ if (ChartArea.ShouldDrawOnSurface(surfaceName, backElements, tickMarksOnEdge))
+ {
+ // Draw axis line on the left/top side walls
+ if (!onEdge ||
+ (this.AxisPosition == AxisPosition.Bottom && (ChartArea.IsBottomSceneWallVisible() || ChartArea.IsSideSceneWallOnLeft())) ||
+ (this.AxisPosition == AxisPosition.Left && ChartArea.IsSideSceneWallOnLeft()) ||
+ (this.AxisPosition == AxisPosition.Right && !ChartArea.IsSideSceneWallOnLeft()) ||
+ (this.AxisPosition == AxisPosition.Top && ChartArea.IsSideSceneWallOnLeft()))
+ {
+
+ // Start Svg Selection mode
+ graph.StartHotRegion( this._url, _toolTip );
+
+ graph.Draw3DLine(
+ ChartArea.matrix3D,
+ _lineColor, _lineWidth, _lineDashStyle,
+ new Point3D(point1.X, point1.Y, ChartArea.areaSceneDepth),
+ new Point3D(point1.X, point1.Y, 0f),
+ Common,
+ this,
+ ChartElementType.Nothing
+ );
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+
+ }
+ }
+
+ // Check if the right/bottom wall is on the top drawing layer
+ surfaceName = (this.AxisPosition == AxisPosition.Left || this.AxisPosition == AxisPosition.Right) ? SurfaceNames.Bottom : SurfaceNames.Right;
+ if (ChartArea.ShouldDrawOnSurface(surfaceName, backElements, tickMarksOnEdge))
+ {
+ // Draw axis line on the bottom/right side walls
+ if (!onEdge ||
+ (this.AxisPosition == AxisPosition.Bottom && (ChartArea.IsBottomSceneWallVisible() || !ChartArea.IsSideSceneWallOnLeft())) ||
+ (this.AxisPosition == AxisPosition.Left && (ChartArea.IsSideSceneWallOnLeft() || ChartArea.IsBottomSceneWallVisible())) ||
+ (this.AxisPosition == AxisPosition.Right && (!ChartArea.IsSideSceneWallOnLeft() || ChartArea.IsBottomSceneWallVisible())) ||
+ (this.AxisPosition == AxisPosition.Top && !ChartArea.IsSideSceneWallOnLeft())
+ )
+ {
+
+ // Start Svg Selection mode
+ graph.StartHotRegion( this._url, _toolTip );
+
+ graph.Draw3DLine(
+ ChartArea.matrix3D,
+ _lineColor, _lineWidth, _lineDashStyle,
+ new Point3D(point2.X, point2.Y, ChartArea.areaSceneDepth),
+ new Point3D(point2.X, point2.Y, 0f),
+ Common,
+ this,
+ ChartElementType.Nothing
+ );
+
+ // End Svg Selection mode
+ graph.EndHotRegion();
+
+ }
+ }
+
+ }
+
+ /// <summary>
+ /// Gets Z position of axis tick marks and labels.
+ /// </summary>
+ /// <param name="axisOnEdge">Returns true if axis is on the edge.</param>
+ /// <returns>Marks Z position.</returns>
+ internal float GetMarksZPosition(out bool axisOnEdge)
+ {
+ axisOnEdge = this.IsAxisOnAreaEdge;
+ if (!this.GetIsMarksNextToAxis())
+ {
+ // Marks are forced to be on the area edge
+ axisOnEdge = true;
+ }
+ float wallZPosition = 0f;
+ if (this.AxisPosition == AxisPosition.Bottom && (ChartArea.IsBottomSceneWallVisible() || !axisOnEdge))
+ {
+ wallZPosition = ChartArea.areaSceneDepth;
+ }
+ if (this.AxisPosition == AxisPosition.Left && (ChartArea.IsSideSceneWallOnLeft() || !axisOnEdge))
+ {
+ wallZPosition = ChartArea.areaSceneDepth;
+ }
+ if (this.AxisPosition == AxisPosition.Right && (!ChartArea.IsSideSceneWallOnLeft() || !axisOnEdge))
+ {
+ wallZPosition = ChartArea.areaSceneDepth;
+ }
+ if (this.AxisPosition == AxisPosition.Top && !axisOnEdge)
+ {
+ wallZPosition = ChartArea.areaSceneDepth;
+ }
+
+ // Check if front wall is shown
+ if (ChartArea.IsMainSceneWallOnFront())
+ {
+ // Switch Z position of tick mark
+ wallZPosition = (wallZPosition == 0f) ? ChartArea.areaSceneDepth : 0f;
+ }
+
+ return wallZPosition;
+ }
+
+ /// <summary>
+ /// Paint Axis Grid lines
+ /// </summary>
+ /// <param name="graph">Reference to the Chart Graphics object</param>
+ internal void PaintGrids(ChartGraphics graph)
+ {
+ object obj;
+
+ PaintGrids(graph, out obj);
+
+ }
+
+ /// <summary>
+ /// Paint Axis Grid lines or
+ /// hit test function for grid lines
+ /// </summary>
+ /// <param name="graph">Reference to the Chart Graphics object</param>
+ /// <param name="obj">Returns selected grid object</param>
+ internal void PaintGrids(ChartGraphics graph, out object obj)
+ {
+ obj = null;
+
+#if SUBAXES
+ // Paint grids of sub-axis
+ if(!ChartArea.Area3DStyle.Enable3D &&
+ !ChartArea.chartAreaIsCurcular)
+ {
+ foreach(SubAxis subAxis in this.SubAxes)
+ {
+ subAxis.PaintGrids( graph, out obj);
+ }
+ }
+#endif // SUBAXES
+
+ // Axis is disabled
+ if (enabled == false)
+ return;
+
+ // Paint Minor grid lines
+ minorGrid.Paint(graph);
+
+ // Paint Major grid lines
+ majorGrid.Paint(graph);
+ }
+
+ /// <summary>
+ /// Paint Axis Strip lines
+ /// </summary>
+ /// <param name="graph">Reference to the Chart Graphics object</param>
+ /// <param name="drawLinesOnly">Indicates if Lines or Stripes should be drawn.</param>
+ internal void PaintStrips(ChartGraphics graph, bool drawLinesOnly)
+ {
+ object obj;
+ PaintStrips(graph, false, 0, 0, out obj, drawLinesOnly);
+ }
+
+ /// <summary>
+ /// Paint Axis Strip lines or
+ /// hit test function for Strip lines
+ /// </summary>
+ /// <param name="graph">Reference to the Chart Graphics object</param>
+ /// <param name="selectionMode">The selection mode is active</param>
+ /// <param name="x">X coordinate</param>
+ /// <param name="y">Y coordinate</param>
+ /// <param name="obj">Returns selected grid object</param>
+ /// <param name="drawLinesOnly">Indicates if Lines or Stripes should be drawn.</param>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "y"),
+ System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "x"),
+ System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "selectionMode")]
+ internal void PaintStrips(ChartGraphics graph, bool selectionMode, int x, int y, out object obj, bool drawLinesOnly)
+ {
+ obj = null;
+
+#if SUBAXES
+ // Paint strips of sub-axis
+ if(ChartArea.IsSubAxesSupported)
+ {
+ foreach(SubAxis subAxis in this.SubAxes)
+ {
+ subAxis.PaintStrips( graph, selectionMode, x, y, out obj, drawLinesOnly);
+ }
+ }
+#endif // SUBAXES
+
+ // Axis is disabled
+ if (enabled == false)
+ return;
+
+ // Add axis isInterlaced strip lines into the collection
+ bool interlacedStripAdded = AddInterlacedStrip();
+
+ // Draw axis strips and lines
+ foreach (StripLine strip in this.StripLines)
+ {
+ strip.Paint(graph, this.Common, drawLinesOnly);
+ }
+
+ // Remove axis isInterlaced strip line from the collection after drawing
+ if (interlacedStripAdded)
+ {
+ // Remove isInterlaced strips which always is the first strip line
+ this.StripLines.RemoveAt(0);
+ }
+
+ }
+
+ /// <summary>
+ /// Helper function which adds temp. strip lines into the collection
+ /// to display isInterlaced lines in axis.
+ /// </summary>
+ private bool AddInterlacedStrip()
+ {
+ bool addStrip = false;
+ if (this.IsInterlaced)
+ {
+ StripLine stripLine = new StripLine();
+ stripLine.interlaced = true;
+ // VSTS fix of 164115 IsInterlaced StripLines with no border are rendered with black border, regression of VSTS 136763
+ stripLine.BorderColor = Color.Empty;
+
+ // Get interval from grid lines, tick marks or labels
+ if (this.MajorGrid.Enabled && this.MajorGrid.GetInterval() != 0.0)
+ {
+ addStrip = true;
+ stripLine.Interval = this.MajorGrid.GetInterval() * 2.0;
+ stripLine.IntervalType = this.MajorGrid.GetIntervalType();
+ stripLine.IntervalOffset = this.MajorGrid.GetIntervalOffset();
+ stripLine.IntervalOffsetType = this.MajorGrid.GetIntervalOffsetType();
+ stripLine.StripWidth = this.MajorGrid.GetInterval();
+ stripLine.StripWidthType = this.MajorGrid.GetIntervalType();
+ }
+ else if (this.MajorTickMark.Enabled && this.MajorTickMark.GetInterval() != 0.0)
+ {
+ addStrip = true;
+ stripLine.Interval = this.MajorTickMark.GetInterval() * 2.0;
+ stripLine.IntervalType = this.MajorTickMark.GetIntervalType();
+ stripLine.IntervalOffset = this.MajorTickMark.GetIntervalOffset();
+ stripLine.IntervalOffsetType = this.MajorTickMark.GetIntervalOffsetType();
+ stripLine.StripWidth = this.MajorTickMark.GetInterval();
+ stripLine.StripWidthType = this.MajorTickMark.GetIntervalType();
+ }
+ else if (this.LabelStyle.Enabled && this.LabelStyle.GetInterval() != 0.0)
+ {
+ addStrip = true;
+ stripLine.Interval = this.LabelStyle.GetInterval() * 2.0;
+ stripLine.IntervalType = this.LabelStyle.GetIntervalType();
+ stripLine.IntervalOffset = this.LabelStyle.GetIntervalOffset();
+ stripLine.IntervalOffsetType = this.LabelStyle.GetIntervalOffsetType();
+ stripLine.StripWidth = this.LabelStyle.GetInterval();
+ stripLine.StripWidthType = this.LabelStyle.GetIntervalType();
+ }
+
+ // Insert item into the strips collection
+ if (addStrip)
+ {
+ // Define stip color
+ if (this.InterlacedColor != Color.Empty)
+ {
+ stripLine.BackColor = this.InterlacedColor;
+ }
+ else
+ {
+ // If isInterlaced strips color is not set - use darker color of the area
+ if (ChartArea.BackColor == Color.Empty)
+ {
+ stripLine.BackColor = (ChartArea.Area3DStyle.Enable3D) ? Color.DarkGray : Color.LightGray;
+ }
+ else if (ChartArea.BackColor == Color.Transparent)
+ {
+ if (Common.Chart.BackColor != Color.Transparent && Common.Chart.BackColor != Color.Black)
+ {
+ stripLine.BackColor = ChartGraphics.GetGradientColor(Common.Chart.BackColor, Color.Black, 0.2);
+ }
+ else
+ {
+ stripLine.BackColor = Color.LightGray;
+ }
+ }
+ else
+ {
+ stripLine.BackColor = ChartGraphics.GetGradientColor(ChartArea.BackColor, Color.Black, 0.2);
+ }
+ }
+
+ // Insert strip
+ this.StripLines.Insert(0, stripLine);
+ }
+ }
+
+ return addStrip;
+ }
+
+ #endregion
+
+ #region Axis parameters recalculation and resizing methods
+
+ /// <summary>
+ /// This method will calculate the maximum and minimum values
+ /// using interval on the X axis automatically. It will make a gap between
+ /// data points and border of the Common.Chart area.
+ /// Note that this method can only be called for primary or secondary X axes.
+ /// </summary>
+ public void RoundAxisValues()
+ {
+ this.roundedXValues = true;
+ }
+
+ /// <summary>
+ /// RecalculateAxesScale axis.
+ /// </summary>
+ /// <param name="position">Plotting area position.</param>
+ internal void ReCalc(ElementPosition position)
+ {
+ PlotAreaPosition = position;
+
+#if SUBAXES
+
+ // Recalculate all sub-axis
+ foreach(SubAxis subAxis in this.SubAxes)
+ {
+ subAxis.ReCalc( position );
+ }
+#endif // SUBAXES
+ }
+
+ /// <summary>
+ /// This method store Axis values as minimum, maximum,
+ /// crossing, etc. Axis auto algorithm changes these
+ /// values and they have to be set to default values
+ /// after painting.
+ /// </summary>
+ internal void StoreAxisValues()
+ {
+ tempLabels = new CustomLabelsCollection(this);
+ foreach (CustomLabel label in CustomLabels)
+ {
+ tempLabels.Add(label.Clone());
+ }
+
+ paintMode = true;
+
+ // This field synchronies the Storing and
+ // resetting of temporary values
+ if (_storeValuesEnabled)
+ {
+
+ tempMaximum = maximum;
+ tempMinimum = minimum;
+ tempCrossing = crossing;
+ tempAutoMinimum = _autoMinimum;
+ tempAutoMaximum = _autoMaximum;
+
+ tempMajorGridInterval = majorGrid.interval;
+ tempMajorTickMarkInterval = majorTickMark.interval;
+
+ tempMinorGridInterval = minorGrid.interval;
+ tempMinorTickMarkInterval = minorTickMark.interval;
+
+
+ tempGridIntervalType = majorGrid.intervalType;
+ tempTickMarkIntervalType = majorTickMark.intervalType;
+
+
+ tempLabelInterval = labelStyle.interval;
+ tempLabelIntervalType = labelStyle.intervalType;
+
+ // Remember original ScaleView Position
+ this._originalViewPosition = this.ScaleView.Position;
+
+ // This field synchronies the Storing and
+ // resetting of temporary values
+ _storeValuesEnabled = false;
+ }
+
+#if SUBAXES
+
+ // Store values of all sub-axis
+ if(ChartArea.IsSubAxesSupported)
+ {
+ foreach(SubAxis subAxis in this.SubAxes)
+ {
+ subAxis.StoreAxisValues( );
+ }
+ }
+#endif // SUBAXES
+
+ }
+
+
+ /// <summary>
+ /// This method reset Axis values as minimum, maximum,
+ /// crossing, etc. Axis auto algorithm changes these
+ /// values and they have to be set to default values
+ /// after painting.
+ /// </summary>
+ internal void ResetAxisValues()
+ {
+ // Paint mode is finished
+ paintMode = false;
+
+#if Microsoft_CONTROL
+ if(Common.Chart == null)
+ {
+#if SUBAXES
+ else if(this is SubAxis)
+ {
+ if( ((SubAxis)this).parentAxis != null)
+ {
+ this.Common = ((SubAxis)this).parentAxis.Common;
+ Common.Chart = ((SubAxis)this).parentAxis.Common.Chart;
+ }
+ }
+#endif // SUBAXES
+ }
+ if(Common.Chart != null && Common.Chart.Site != null && Common.Chart.Site.DesignMode)
+ {
+ ResetAutoValues();
+ }
+#else
+ ResetAutoValues();
+#endif
+
+ // Reset back original custom labels
+ if (tempLabels != null)
+ {
+ CustomLabels.Clear();
+ foreach (CustomLabel label in tempLabels)
+ {
+ CustomLabels.Add(label.Clone());
+ }
+
+ tempLabels = null;
+ }
+
+#if SUBAXES
+
+ // Reset values of all sub-axis
+ if(ChartArea.IsSubAxesSupported)
+ {
+ foreach(SubAxis subAxis in this.SubAxes)
+ {
+ subAxis.ResetAxisValues( );
+ }
+ }
+#endif // SUBAXES
+ }
+
+
+ /// <summary>
+ /// Reset auto calculated axis values
+ /// </summary>
+ internal void ResetAutoValues()
+ {
+ refreshMinMaxFromData = true;
+ maximum = tempMaximum;
+ minimum = tempMinimum;
+ crossing = tempCrossing;
+ _autoMinimum = tempAutoMinimum;
+ _autoMaximum = tempAutoMaximum;
+
+ majorGrid.interval = tempMajorGridInterval;
+ majorTickMark.interval = tempMajorTickMarkInterval;
+
+ minorGrid.interval = tempMinorGridInterval;
+ minorTickMark.interval = tempMinorTickMarkInterval;
+
+
+ labelStyle.interval = tempLabelInterval;
+ majorGrid.intervalType = tempGridIntervalType;
+ majorTickMark.intervalType = tempTickMarkIntervalType;
+ labelStyle.intervalType = tempLabelIntervalType;
+
+ // Restore original ScaleView Position
+ if (Common.Chart != null)
+ {
+ if (!Common.Chart.serializing)
+ {
+ this.ScaleView.Position = this._originalViewPosition;
+ }
+ }
+
+ // This field synchronies the Storing and
+ // resetting of temporary values
+ _storeValuesEnabled = true;
+
+#if SUBAXES
+
+ // Reset auto values of all sub-axis
+ if(ChartArea.IsSubAxesSupported)
+ {
+ foreach(SubAxis subAxis in this.SubAxes)
+ {
+ subAxis.ResetAutoValues( );
+ }
+ }
+#endif // SUBAXES
+
+ }
+
+ /// <summary>
+ /// Calculate size of the axis elements like title, labels and marks.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics object.</param>
+ /// <param name="chartAreaPosition">The Chart area position.</param>
+ /// <param name="plotArea">Plotting area size.</param>
+ /// <param name="axesNumber">Number of axis of the same orientation.</param>
+ /// <param name="autoPlotPosition">Indicates that inner plot position is automatic.</param>
+ virtual internal void Resize(
+ ChartGraphics chartGraph,
+ ElementPosition chartAreaPosition,
+ RectangleF plotArea,
+ float axesNumber,
+ bool autoPlotPosition)
+ {
+#if SUBAXES
+ // Resize all sub-axis
+ if(ChartArea.IsSubAxesSupported)
+ {
+ foreach(SubAxis subAxis in this.SubAxes)
+ {
+ subAxis.Resize(chartGraph, chartAreaPosition, plotArea, axesNumber, autoPlotPosition);
+ }
+ }
+#endif // SUBAXES
+
+
+#if Microsoft_CONTROL
+ // Disable Common.Chart invalidation
+ bool oldDisableInvalidates = Common.Chart.disableInvalidates;
+ Common.Chart.disableInvalidates = true;
+#endif //Microsoft_CONTROL
+
+ // Set Common.Chart area position
+ PlotAreaPosition = chartAreaPosition;
+
+ // Initialize plot area size
+ PlotAreaPosition.FromRectangleF(plotArea);
+
+ //******************************************************
+ //** Calculate axis title size
+ //******************************************************
+ this.titleSize = 0F;
+ if (this.Title.Length > 0)
+ {
+ // Measure axis title
+ SizeF titleStringSize = chartGraph.MeasureStringRel(this.Title.Replace("\\n", "\n"), this.TitleFont, new SizeF(10000f, 10000f), StringFormat.GenericTypographic, this.GetTextOrientation());
+
+ // Switch Width & Heigth for vertical axes
+ // If axis is horizontal
+ float maxTitlesize = 0;
+ if (this.AxisPosition == AxisPosition.Bottom || this.AxisPosition == AxisPosition.Top)
+ {
+ maxTitlesize = (plotArea.Height / 100F) * (Axis.maxAxisTitleSize / axesNumber);
+ if (this.IsTextVertical)
+ {
+ this.titleSize = Math.Min(titleStringSize.Width, maxTitlesize);
+ }
+ else
+ {
+ this.titleSize = Math.Min(titleStringSize.Height, maxTitlesize);
+ }
+ }
+ // If axis is vertical
+ else
+ {
+ titleStringSize = chartGraph.GetAbsoluteSize(titleStringSize);
+ titleStringSize = chartGraph.GetRelativeSize(new SizeF(titleStringSize.Height, titleStringSize.Width));
+ maxTitlesize = (plotArea.Width / 100F) * (Axis.maxAxisTitleSize / axesNumber);
+ if (this.IsTextVertical)
+ {
+ this.titleSize = Math.Min(titleStringSize.Width, maxTitlesize);
+ }
+ else
+ {
+ this.titleSize = Math.Min(titleStringSize.Height, maxTitlesize);
+ }
+ }
+ }
+ if (this.titleSize > 0)
+ {
+ this.titleSize += elementSpacing;
+ }
+
+ //*********************************************************
+ //** Get arrow size of the opposite axis
+ //*********************************************************
+ float arrowSize = 0F;
+ SizeF arrowSizePrimary = SizeF.Empty;
+ SizeF arrowSizeSecondary = SizeF.Empty;
+ ArrowOrientation arrowOrientation = ArrowOrientation.Bottom;
+ if (this.axisType == AxisName.X || this.axisType == AxisName.X2)
+ {
+ if (ChartArea.AxisY.ArrowStyle != AxisArrowStyle.None)
+ {
+ arrowSizePrimary = ChartArea.AxisY.GetArrowSize(out arrowOrientation);
+ if (!IsArrowInAxis(arrowOrientation, this.AxisPosition))
+ {
+ arrowSizePrimary = SizeF.Empty;
+ }
+ }
+
+ if (ChartArea.AxisY2.ArrowStyle != AxisArrowStyle.None)
+ {
+ arrowSizeSecondary = ChartArea.AxisY2.GetArrowSize(out arrowOrientation);
+ if (!IsArrowInAxis(arrowOrientation, this.AxisPosition))
+ {
+ arrowSizeSecondary = SizeF.Empty;
+ }
+ }
+ }
+ else
+ {
+ if (ChartArea.AxisX.ArrowStyle != AxisArrowStyle.None)
+ {
+ arrowSizePrimary = ChartArea.AxisX.GetArrowSize(out arrowOrientation);
+ if (!IsArrowInAxis(arrowOrientation, this.AxisPosition))
+ {
+ arrowSizePrimary = SizeF.Empty;
+ }
+ }
+
+ if (ChartArea.AxisX2.ArrowStyle != AxisArrowStyle.None)
+ {
+ arrowSizeSecondary = ChartArea.AxisX2.GetArrowSize(out arrowOrientation);
+ if (!IsArrowInAxis(arrowOrientation, this.AxisPosition))
+ {
+ arrowSizeSecondary = SizeF.Empty;
+ }
+ }
+ }
+
+ // If axis is horizontal
+ if (this.AxisPosition == AxisPosition.Bottom || this.AxisPosition == AxisPosition.Top)
+ {
+ arrowSize = Math.Max(arrowSizePrimary.Height, arrowSizeSecondary.Height);
+ }
+ // If axis is vertical
+ else
+ {
+ arrowSize = Math.Max(arrowSizePrimary.Width, arrowSizeSecondary.Width);
+ }
+
+ //*********************************************************
+ //** Calculate axis tick marks, axis thickness, arrow size
+ //** and scroll bar size
+ //*********************************************************
+ this.markSize = 0F;
+
+ // Get major and minor tick marks sizes
+ float majorTickSize = 0;
+ if (this.MajorTickMark.Enabled && this.MajorTickMark.TickMarkStyle != TickMarkStyle.None)
+ {
+ if (this.MajorTickMark.TickMarkStyle == TickMarkStyle.InsideArea)
+ {
+ majorTickSize = 0F;
+ }
+ else if (this.MajorTickMark.TickMarkStyle == TickMarkStyle.AcrossAxis)
+ {
+ majorTickSize = this.MajorTickMark.Size / 2F;
+ }
+ else if (this.MajorTickMark.TickMarkStyle == TickMarkStyle.OutsideArea)
+ {
+ majorTickSize = this.MajorTickMark.Size;
+ }
+ }
+
+ float minorTickSize = 0;
+ if (this.MinorTickMark.Enabled && this.MinorTickMark.TickMarkStyle != TickMarkStyle.None && this.MinorTickMark.GetInterval() != 0)
+ {
+ if (this.MinorTickMark.TickMarkStyle == TickMarkStyle.InsideArea)
+ {
+ minorTickSize = 0F;
+ }
+ else if (this.MinorTickMark.TickMarkStyle == TickMarkStyle.AcrossAxis)
+ {
+ minorTickSize = this.MinorTickMark.Size / 2F;
+ }
+ else if (this.MinorTickMark.TickMarkStyle == TickMarkStyle.OutsideArea)
+ {
+ minorTickSize = this.MinorTickMark.Size;
+ }
+ }
+
+ this.markSize += (float)Math.Max(majorTickSize, minorTickSize);
+
+
+ // Add axis line size
+ SizeF borderSize = chartGraph.GetRelativeSize(new SizeF(this.LineWidth, this.LineWidth));
+
+ // If axis is horizontal
+ if (this.AxisPosition == AxisPosition.Bottom || this.AxisPosition == AxisPosition.Top)
+ {
+ this.markSize += borderSize.Height / 2f;
+ this.markSize = Math.Min(this.markSize, (plotArea.Height / 100F) * (Axis.maxAxisMarkSize / axesNumber));
+ }
+ // If axis is vertical
+ else
+ {
+ this.markSize += borderSize.Width / 2f;
+ this.markSize = Math.Min(this.markSize, (plotArea.Width / 100F) * (Axis.maxAxisMarkSize / axesNumber));
+ }
+
+ // Add axis scroll bar size (if it's visible)
+ this.scrollBarSize = 0f;
+
+#if Microsoft_CONTROL
+
+ if (this.ScrollBar.IsVisible &&
+ (this.IsAxisOnAreaEdge || !this.IsMarksNextToAxis))
+ {
+ if (this.ScrollBar.IsPositionedInside)
+ {
+ this.markSize += (float)this.ScrollBar.GetScrollBarRelativeSize();
+ }
+ else
+ {
+ this.scrollBarSize = (float)this.ScrollBar.GetScrollBarRelativeSize();
+ }
+ }
+
+#endif // Microsoft_CONTROL
+
+
+ //*********************************************************
+ //** Adjust mark size using area scene wall width
+ //*********************************************************
+ if (ChartArea.Area3DStyle.Enable3D &&
+ !ChartArea.chartAreaIsCurcular &&
+ ChartArea.BackColor != Color.Transparent &&
+ ChartArea.Area3DStyle.WallWidth > 0)
+ {
+ SizeF areaWallSize = chartGraph.GetRelativeSize(new SizeF(ChartArea.Area3DStyle.WallWidth, ChartArea.Area3DStyle.WallWidth));
+ if (this.AxisPosition == AxisPosition.Bottom || this.AxisPosition == AxisPosition.Top)
+ {
+ this.markSize += areaWallSize.Height;
+ }
+ else
+ {
+ this.markSize += areaWallSize.Width;
+ }
+
+ // Ignore Max marks size for the 3D wall size.
+ //this.markSize = Math.Min(this.markSize, (plotArea.Width / 100F) * (Axis.maxAxisMarkSize / axesNumber));
+ }
+
+ //*********************************************************
+ //** Adjust title size and mark size using arrow size
+ //*********************************************************
+ if (arrowSize > (this.markSize + this.scrollBarSize + this.titleSize))
+ {
+ this.markSize = Math.Max(this.markSize, arrowSize - (this.markSize + this.scrollBarSize + this.titleSize));
+ this.markSize = Math.Min(this.markSize, (plotArea.Width / 100F) * (Axis.maxAxisMarkSize / axesNumber));
+ }
+
+ //*********************************************************
+ //** Calculate max label size
+ //*********************************************************
+ float maxLabelSize = 0;
+
+ if (!autoPlotPosition)
+ {
+ if (this.GetIsMarksNextToAxis())
+ {
+ if (this.AxisPosition == AxisPosition.Top)
+ maxLabelSize = (float)GetAxisPosition() - ChartArea.Position.Y;
+ else if (this.AxisPosition == AxisPosition.Bottom)
+ maxLabelSize = ChartArea.Position.Bottom - (float)GetAxisPosition();
+ if (this.AxisPosition == AxisPosition.Left)
+ maxLabelSize = (float)GetAxisPosition() - ChartArea.Position.X;
+ else if (this.AxisPosition == AxisPosition.Right)
+ maxLabelSize = ChartArea.Position.Right - (float)GetAxisPosition();
+ }
+ else
+ {
+ if (this.AxisPosition == AxisPosition.Top)
+ maxLabelSize = plotArea.Y - ChartArea.Position.Y;
+ else if (this.AxisPosition == AxisPosition.Bottom)
+ maxLabelSize = ChartArea.Position.Bottom - plotArea.Bottom;
+ if (this.AxisPosition == AxisPosition.Left)
+ maxLabelSize = plotArea.X - ChartArea.Position.X;
+ else if (this.AxisPosition == AxisPosition.Right)
+ maxLabelSize = ChartArea.Position.Right - plotArea.Right;
+ }
+
+ maxLabelSize *= 2F;
+ }
+ else
+ {
+ if (this.AxisPosition == AxisPosition.Bottom || this.AxisPosition == AxisPosition.Top)
+ maxLabelSize = plotArea.Height * (_maximumAutoSize / 100f);
+ else
+ maxLabelSize = plotArea.Width * (_maximumAutoSize / 100f);
+ }
+
+
+
+ //******************************************************
+ //** First try to select the interval that will
+ //** generate best fit labels.
+ //******************************************************
+
+
+
+ // Make sure the variable interval mode is enabled and
+ // no custom label interval used.
+ if( this.Enabled != AxisEnabled.False &&
+ this.LabelStyle.Enabled &&
+ this.IsVariableLabelCountModeEnabled() )
+ {
+ // Increase font by several points when height of the font is the most important
+ // dimension. Use original size whenwidth is the most important size.
+ float extraSize = 3f;
+ if( (this.AxisPosition == AxisPosition.Left || this.AxisPosition == AxisPosition.Right) &&
+ (this.LabelStyle.Angle == 90 || this.LabelStyle.Angle == -90) )
+ {
+ extraSize = 0f;
+ }
+ if( (this.AxisPosition == AxisPosition.Top || this.AxisPosition == AxisPosition.Bottom) &&
+ (this.LabelStyle.Angle == 180 || this.LabelStyle.Angle == 0) )
+ {
+ extraSize = 0f;
+ }
+
+ // If 3D Common.Chart is used make the measurements with font several point larger
+ if(ChartArea.Area3DStyle.Enable3D)
+ {
+ extraSize += 1f;
+ }
+
+ this.autoLabelFont = Common.Chart.chartPicture.FontCache.GetFont(this.LabelStyle.Font.FontFamily,
+ this.LabelStyle.Font.Size + extraSize,
+ this.LabelStyle.Font.Style,
+ GraphicsUnit.Point);
+
+ // Reset angle and stagged flag used in the auto-fitting algorithm
+ this.autoLabelAngle = this.LabelStyle.Angle;
+ this.autoLabelOffset = (this.LabelStyle.IsStaggered) ? 1 : 0;
+
+ // Adjust interval
+ this.AdjustIntervalToFitLabels(chartGraph, autoPlotPosition, false);
+ }
+
+
+
+ //******************************************************
+ //** Automatically calculate the best font size, angle
+ //** and try to use offset labels.
+ //******************************************************
+ // Reset all automatic label properties
+ autoLabelFont = null;
+ autoLabelAngle = -1000;
+ autoLabelOffset = -1;
+
+ // For circular Common.Chart area process auto-fitting for Y Axis only
+ if (this.IsLabelAutoFit &&
+ this.LabelAutoFitStyle != LabelAutoFitStyles.None &&
+ !ChartArea.chartAreaIsCurcular)
+ {
+ bool fitDone = false;
+ bool noWordWrap = false;
+
+ // Set default font angle and labels offset flag
+ autoLabelAngle = 0;
+ autoLabelOffset = 0;
+
+ // Original labels collection
+ CustomLabelsCollection originalLabels = null;
+
+ // Pick up maximum font size
+ float size = 8f;
+ size = (float)Math.Max(this.LabelAutoFitMaxFontSize, this.LabelAutoFitMinFontSize);
+ _minLabelFontSize = Math.Min(this.LabelAutoFitMinFontSize, this.LabelAutoFitMaxFontSize);
+ _aveLabelFontSize = _minLabelFontSize + Math.Abs(size - _minLabelFontSize)/2f;
+
+
+ // Check if common font size should be used
+ if (ChartArea.IsSameFontSizeForAllAxes)
+ {
+ size = (float)Math.Min(size, ChartArea.axesAutoFontSize);
+ }
+
+ //Set new font
+ autoLabelFont = Common.Chart.chartPicture.FontCache.GetFont(this.LabelStyle.Font.FontFamily,
+ size,
+ this.LabelStyle.Font.Style,
+ GraphicsUnit.Point
+ );
+
+ // Check if we allowed to increase font size while auto-fitting
+ if ((this.LabelAutoFitStyle & LabelAutoFitStyles.IncreaseFont) != LabelAutoFitStyles.IncreaseFont)
+ {
+ // Use axis labels font as starting point
+ autoLabelFont = this.LabelStyle.Font;
+ }
+
+ // Loop while labels do not fit
+ float spacer = 0f;
+ while (!fitDone)
+ {
+ //******************************************************
+ //** Check if labels fit
+ //******************************************************
+
+ // Check if grouping labels fit should be checked
+ bool checkLabelsFirstRowOnly = true;
+ if ((this.LabelAutoFitStyle & LabelAutoFitStyles.DecreaseFont) == LabelAutoFitStyles.DecreaseFont)
+ {
+ // Only check grouping labels if we can reduce fonts size
+ checkLabelsFirstRowOnly = false;
+ }
+
+ // Check labels fit
+ fitDone = CheckLabelsFit(
+ chartGraph,
+ this.markSize + this.scrollBarSize + this.titleSize + spacer,
+ autoPlotPosition,
+ checkLabelsFirstRowOnly,
+ false);
+
+ //******************************************************
+ //** Adjust labels text properties to fit
+ //******************************************************
+ if (!fitDone)
+ {
+ // If font is bigger than average try to make it smaller
+ if (autoLabelFont.SizeInPoints >= _aveLabelFontSize &&
+ (this.LabelAutoFitStyle & LabelAutoFitStyles.DecreaseFont) == LabelAutoFitStyles.DecreaseFont)
+ {
+ //Clean up the old font
+ autoLabelFont = Common.Chart.chartPicture.FontCache.GetFont(
+ autoLabelFont.FontFamily,
+ autoLabelFont.SizeInPoints - 0.5f,
+ autoLabelFont.Style,
+ GraphicsUnit.Point);
+ }
+
+ // Try to use offset labels (2D charts and non-circular arae only!!!)
+ else if (!ChartArea.Area3DStyle.Enable3D &&
+ !ChartArea.chartAreaIsCurcular &&
+ originalLabels == null &&
+ autoLabelAngle == 0 &&
+ autoLabelOffset == 0 &&
+ (this.LabelAutoFitStyle & LabelAutoFitStyles.StaggeredLabels) == LabelAutoFitStyles.StaggeredLabels)
+ {
+ autoLabelOffset = 1;
+ }
+
+ // Try to insert new line characters in labels text
+ else if (!noWordWrap &&
+ (this.LabelAutoFitStyle & LabelAutoFitStyles.WordWrap) == LabelAutoFitStyles.WordWrap)
+ {
+ bool changed = false;
+ autoLabelOffset = 0;
+
+ // Check if backup copy of the original lables was made
+ if (originalLabels == null)
+ {
+ // Copy current labels collection
+ originalLabels = new CustomLabelsCollection(this);
+ foreach (CustomLabel label in this.CustomLabels)
+ {
+ originalLabels.Add(label.Clone());
+ }
+ }
+
+ // Try to insert new line character into the longest label
+ changed = WordWrapLongestLabel(this.CustomLabels);
+
+ // Word wrapping do not solve the labels overlapping issue
+ if (!changed)
+ {
+ noWordWrap = true;
+
+ // Restore original labels
+ if (originalLabels != null)
+ {
+ this.CustomLabels.Clear();
+ foreach (CustomLabel label in originalLabels)
+ {
+ this.CustomLabels.Add(label.Clone());
+ }
+
+ originalLabels = null;
+ }
+
+ if (this.AxisPosition == AxisPosition.Bottom || this.AxisPosition == AxisPosition.Top)
+ {
+ if ((spacer == 0 ||
+ spacer == 30f ||
+ spacer == 20f) &&
+ ((this.LabelAutoFitStyle & LabelAutoFitStyles.LabelsAngleStep30) == LabelAutoFitStyles.LabelsAngleStep30 ||
+ (this.LabelAutoFitStyle & LabelAutoFitStyles.LabelsAngleStep45) == LabelAutoFitStyles.LabelsAngleStep45 ||
+ (this.LabelAutoFitStyle & LabelAutoFitStyles.LabelsAngleStep90) == LabelAutoFitStyles.LabelsAngleStep90))
+ {
+ // Try to use 90 degrees angle
+ autoLabelAngle = 90;
+ noWordWrap = false;
+
+ // Usually 55% of Common.Chart area size is allowed for labels
+ // Reduce that space.
+ if (spacer == 0f)
+ {
+ // 30
+ spacer = 30f;
+ }
+ else if (spacer == 30f)
+ {
+ // 20
+ spacer = 20f;
+ }
+ else if (spacer == 20f)
+ {
+ // 5
+ spacer = 5f;
+ }
+ else
+ {
+ autoLabelAngle = 0;
+ noWordWrap = true;
+ }
+
+ }
+ else
+ {
+ spacer = 0f;
+ }
+ }
+ }
+ }
+
+ // Try to change font angle
+ else if (autoLabelAngle != 90 &&
+ ((this.LabelAutoFitStyle & LabelAutoFitStyles.LabelsAngleStep30) == LabelAutoFitStyles.LabelsAngleStep30 ||
+ (this.LabelAutoFitStyle & LabelAutoFitStyles.LabelsAngleStep45) == LabelAutoFitStyles.LabelsAngleStep45 ||
+ (this.LabelAutoFitStyle & LabelAutoFitStyles.LabelsAngleStep90) == LabelAutoFitStyles.LabelsAngleStep90))
+ {
+ spacer = 0f;
+ autoLabelOffset = 0;
+
+ if ((this.LabelAutoFitStyle & LabelAutoFitStyles.LabelsAngleStep30) == LabelAutoFitStyles.LabelsAngleStep30)
+ {
+ // Increase angle by 45 degrees in 2D and 45 in 3D
+ autoLabelAngle += (ChartArea.Area3DStyle.Enable3D) ? 45 : 30;
+ }
+ else if ((this.LabelAutoFitStyle & LabelAutoFitStyles.LabelsAngleStep45) == LabelAutoFitStyles.LabelsAngleStep45)
+ {
+ // Increase angle by 45 degrees
+ autoLabelAngle += 45;
+ }
+ else if ((this.LabelAutoFitStyle & LabelAutoFitStyles.LabelsAngleStep90) == LabelAutoFitStyles.LabelsAngleStep90)
+ {
+ // Increase angle by 90 degrees
+ autoLabelAngle += 90;
+ }
+ }
+
+ // Try to reduce font again
+ else if (autoLabelFont.SizeInPoints > _minLabelFontSize &&
+ (this.LabelAutoFitStyle & LabelAutoFitStyles.DecreaseFont) == LabelAutoFitStyles.DecreaseFont)
+ {
+ //Clean up the old font
+ autoLabelAngle = 0;
+ autoLabelFont = Common.Chart.chartPicture.FontCache.GetFont(
+ autoLabelFont.FontFamily,
+ autoLabelFont.SizeInPoints - 0.5f,
+ autoLabelFont.Style,
+ GraphicsUnit.Point);
+ }
+
+ // Failed to fit
+ else
+ {
+ // Use last font
+ if ((this.LabelAutoFitStyle & LabelAutoFitStyles.LabelsAngleStep30) == LabelAutoFitStyles.LabelsAngleStep30 ||
+ (this.LabelAutoFitStyle & LabelAutoFitStyles.LabelsAngleStep45) == LabelAutoFitStyles.LabelsAngleStep45 ||
+ (this.LabelAutoFitStyle & LabelAutoFitStyles.LabelsAngleStep90) == LabelAutoFitStyles.LabelsAngleStep90)
+ {
+ // Reset angle
+ if (this.AxisPosition == AxisPosition.Top || this.AxisPosition == AxisPosition.Bottom)
+ {
+ autoLabelAngle = 90;
+ }
+ else
+ {
+ autoLabelAngle = 0;
+ }
+ }
+ if ((this.LabelAutoFitStyle & LabelAutoFitStyles.StaggeredLabels) == LabelAutoFitStyles.StaggeredLabels)
+ {
+ // Reset offset labels
+ autoLabelOffset = 0;
+ }
+ fitDone = true;
+ }
+ }
+ else if (ChartArea.Area3DStyle.Enable3D &&
+ !ChartArea.chartAreaIsCurcular &&
+ autoLabelFont.SizeInPoints > _minLabelFontSize)
+ {
+ // Reduce auto-fit font by 1 for the 3D charts
+ autoLabelFont = Common.Chart.chartPicture.FontCache.GetFont(
+ autoLabelFont.FontFamily,
+ autoLabelFont.SizeInPoints - 0.5f,
+ autoLabelFont.Style,
+ GraphicsUnit.Point);
+ }
+ }
+
+ // Change the auto-fit angle for top and bottom axes from 90 to -90
+ if(this.AxisPosition == AxisPosition.Bottom || this.AxisPosition == AxisPosition.Top)
+ {
+ if(autoLabelAngle == 90)
+ {
+ autoLabelAngle = -90;
+ }
+ }
+ }
+
+ //*********************************************************
+ //** Calculate overall labels size
+ //*********************************************************
+ this.labelSize = 0;
+
+ // if labels are not enabled their size needs to remain zero
+ if (this.LabelStyle.Enabled)
+ {
+ //******************************************************
+ //** Calculate axis second labels row size
+ //******************************************************
+ this.labelSize = (maxAxisElementsSize) - this.markSize - this.scrollBarSize - this.titleSize;
+ if (this.labelSize > 0)
+ {
+ this.groupingLabelSizes = GetRequiredGroupLabelSize(chartGraph, (maxLabelSize / 100F) * maxAxisLabelRow2Size);
+ this.totlaGroupingLabelsSize = GetGroupLablesToatalSize();
+ }
+
+ //******************************************************
+ //** Calculate axis labels size
+ //******************************************************
+ this.labelSize -= this.totlaGroupingLabelsSize;
+ if (this.labelSize > 0)
+ {
+ // If axis is horizontal
+ if (this.AxisPosition == AxisPosition.Bottom || this.AxisPosition == AxisPosition.Top)
+ {
+ this.labelSize = elementSpacing + GetRequiredLabelSize(chartGraph,
+ (maxLabelSize / 100F) * (maxAxisElementsSize - this.markSize - this.scrollBarSize - this.titleSize), out this.unRotatedLabelSize);
+ }
+ // If axis is horizontal
+ else
+ {
+ this.labelSize = elementSpacing + GetRequiredLabelSize(chartGraph,
+ (maxLabelSize / 100F) * (maxAxisElementsSize - this.markSize - this.scrollBarSize - this.titleSize), out this.unRotatedLabelSize);
+ }
+
+ if (!this.LabelStyle.Enabled)
+ {
+ this.labelSize -= elementSpacing;
+ }
+ }
+ else
+ {
+ this.labelSize = 0;
+ }
+
+ this.labelSize += this.totlaGroupingLabelsSize;
+ }
+
+#if SUBAXES
+ // Calculate offsets for all sub axes
+ if(!ChartArea.Area3DStyle.Enable3D &&
+ !ChartArea.chartAreaIsCurcular)
+ {
+ float currentOffset = this.markSize + this.labelSize + this.titleSize + this.scrollBarSize;
+ foreach(SubAxis subAxis in this.SubAxes)
+ {
+ if(subAxis.Enabled != AxisEnabled.False)
+ {
+ currentOffset += (float)subAxis.LocationOffset;
+ subAxis.offsetFromParent = currentOffset;
+ currentOffset += subAxis.markSize + subAxis.labelSize + subAxis.titleSize;
+ }
+ }
+ }
+#endif // SUBAXES
+
+
+#if Microsoft_CONTROL
+ // Restore previous invalidation flag
+ Common.Chart.disableInvalidates = oldDisableInvalidates;
+#endif //Microsoft_CONTROL
+ }
+
+ /// <summary>
+ /// Calculates axis interval so that labels will fit most efficiently.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics.</param>
+ /// <param name="autoPlotPosition">True if plot position is auto calculated.</param>
+ /// <param name="onlyIncreaseInterval">True if interval should only be increased.</param>
+ private void AdjustIntervalToFitLabels(ChartGraphics chartGraph, bool autoPlotPosition, bool onlyIncreaseInterval)
+ {
+ // Calculates axis interval so that labels will fit most efficiently.
+ if(this.ScaleSegments.Count == 0)
+ {
+ this.AdjustIntervalToFitLabels(chartGraph, autoPlotPosition, null, onlyIncreaseInterval);
+ }
+ else
+ {
+ // Allow values to go outside the segment boundary
+ this.ScaleSegments.AllowOutOfScaleValues = true;
+
+ // Adjust interval of each segment first
+ foreach(AxisScaleSegment axisScaleSegment in this.ScaleSegments)
+ {
+ this.AdjustIntervalToFitLabels(chartGraph, autoPlotPosition, axisScaleSegment, onlyIncreaseInterval);
+ }
+
+ // Fill labels using new segment intervals
+ bool removeLabels = true;
+ int segmentIndex = 0;
+ ArrayList removedLabels = new ArrayList();
+ ArrayList removedLabelsIndexes = new ArrayList();
+ foreach(AxisScaleSegment scaleSegment in this.ScaleSegments)
+ {
+ scaleSegment.SetTempAxisScaleAndInterval();
+ this.FillLabels(removeLabels);
+ removeLabels = false;
+ scaleSegment.RestoreAxisScaleAndInterval();
+
+ // Remove last label of all segmenst except of the last
+ if(segmentIndex < this.ScaleSegments.Count - 1 &&
+ this.CustomLabels.Count > 0)
+ {
+ // Remove label and save it in the list
+ removedLabels.Add(this.CustomLabels[this.CustomLabels.Count - 1]);
+ removedLabelsIndexes.Add(this.CustomLabels.Count - 1);
+ this.CustomLabels.RemoveAt(this.CustomLabels.Count - 1);
+ }
+
+ ++segmentIndex;
+ }
+
+ // Check all previously removed last labels of each segment if there
+ // is enough space to fit them
+ int reInsertedLabelsCount = 0;
+ int labelIndex = 0;
+ foreach(CustomLabel label in removedLabels)
+ {
+ // Re-insert the label
+ int labelInsertIndex = (int)removedLabelsIndexes[labelIndex] + reInsertedLabelsCount;
+ if(labelIndex < this.CustomLabels.Count)
+ {
+ this.CustomLabels.Insert(labelInsertIndex, label);
+ }
+ else
+ {
+ this.CustomLabels.Add(label);
+ }
+
+ // Check labels fit. Only horizontal or vertical fit is checked depending
+ // on the axis orientation.
+ ArrayList labelPositions = new ArrayList();
+ bool fitDone = CheckLabelsFit(
+ chartGraph,
+ this.markSize + this.scrollBarSize + this.titleSize,
+ autoPlotPosition,
+ true,
+ false,
+ (this.AxisPosition == AxisPosition.Left || this.AxisPosition == AxisPosition.Right) ? false : true,
+ (this.AxisPosition == AxisPosition.Left || this.AxisPosition == AxisPosition.Right) ? true : false,
+ labelPositions);
+
+ // If labels fit check if any of the label positions overlap
+ if(fitDone)
+ {
+ for(int index = 0; fitDone && index < labelPositions.Count; index++)
+ {
+ RectangleF rect1 = (RectangleF)labelPositions[index];
+ for(int index2 = index + 1; fitDone && index2 < labelPositions.Count; index2++)
+ {
+ RectangleF rect2 = (RectangleF)labelPositions[index2];
+ if(rect1.IntersectsWith(rect2))
+ {
+ fitDone = false;
+ }
+ }
+ }
+ }
+
+ // If labels do not fit or overlapp - remove completly
+ if(!fitDone)
+ {
+ this.CustomLabels.RemoveAt(labelInsertIndex);
+ }
+ else
+ {
+ ++reInsertedLabelsCount;
+ }
+
+ ++labelIndex;
+ }
+
+ // Make sure now values are rounded on segment boundary
+ this.ScaleSegments.AllowOutOfScaleValues = false;
+ }
+ }
+
+ /// <summary>
+ /// Checks if variable count labels mode is enabled.
+ /// </summary>
+ /// <returns>True if variable count labels mode is enabled.</returns>
+ private bool IsVariableLabelCountModeEnabled()
+ {
+ // Make sure the variable interval mode is enabled and
+ // no custom label interval used.
+ if( (this.IntervalAutoMode == IntervalAutoMode.VariableCount || this.ScaleSegments.Count > 0) &&
+ !this.IsLogarithmic &&
+ (this.tempLabelInterval <= 0.0 || (double.IsNaN(this.tempLabelInterval) && this.Interval <= 0.0)) )
+ {
+ // This feature is not supported for charts that do not
+ // require X and Y axes (Pie, Radar, ...)
+ if(!ChartArea.requireAxes)
+ {
+ return false;
+ }
+ // This feature is not supported if the axis doesn't have data range
+ if (Double.IsNaN(this.minimum) || Double.IsNaN(this.maximum))
+ {
+ return false;
+ }
+ // Check if custom labels are used in the first row
+ bool customLabels = false;
+ foreach(CustomLabel label in this.CustomLabels)
+ {
+ if(label.customLabel && label.RowIndex == 0)
+ {
+ customLabels = true;
+ break;
+ }
+ }
+
+ // Proceed only if no custom labels are used in the first row
+ if(!customLabels)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /// <summary>
+ /// Calculates axis interval so that labels will fit most efficiently.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics.</param>
+ /// <param name="autoPlotPosition">True if plot position is auto calculated.</param>
+ /// <param name="axisScaleSegment">Axis scale segment to process.</param>
+ /// <param name="onlyIncreaseInterval">True if interval should only be increased.</param>
+ private void AdjustIntervalToFitLabels(
+ ChartGraphics chartGraph,
+ bool autoPlotPosition,
+ AxisScaleSegment axisScaleSegment,
+ bool onlyIncreaseInterval)
+ {
+ // Re-fill the labels just for the scale segment provided
+ if(axisScaleSegment != null)
+ {
+ // Re-fill new axis labels
+ if(this.tempLabels != null)
+ {
+ this.CustomLabels.Clear();
+ foreach( CustomLabel label in this.tempLabels )
+ {
+ this.CustomLabels.Add(label.Clone());
+ }
+ }
+
+ // Fill labels just for the segment
+ axisScaleSegment.SetTempAxisScaleAndInterval();
+ this.FillLabels( true );
+ axisScaleSegment.RestoreAxisScaleAndInterval();
+ }
+
+ // Calculate minimum interval size
+ double minIntervalSzie = double.NaN;
+ ArrayList axisSeries = AxisScaleBreakStyle.GetAxisSeries(this);
+ foreach(Series series in axisSeries)
+ {
+ if(this.axisType == AxisName.X || this.axisType == AxisName.X2)
+ {
+ if(ChartHelper.IndexedSeries(series))
+ {
+ minIntervalSzie = 1.0;
+ }
+ else if(series.XValueType == ChartValueType.String ||
+ series.XValueType == ChartValueType.Int32 ||
+ series.XValueType == ChartValueType.UInt32 ||
+ series.XValueType == ChartValueType.UInt64 ||
+ series.XValueType == ChartValueType.Int64 )
+ {
+ minIntervalSzie = 1.0;
+ }
+ }
+ else
+ {
+ if(series.YValueType == ChartValueType.String ||
+ series.YValueType == ChartValueType.Int32 ||
+ series.YValueType == ChartValueType.UInt32 ||
+ series.YValueType == ChartValueType.UInt64 ||
+ series.YValueType == ChartValueType.Int64 )
+ {
+ minIntervalSzie = 1.0;
+ }
+ }
+ }
+
+
+ // Iterate while interval is not found
+ bool firstIteration = true;
+ bool increaseNumberOfLabels = true;
+ double currentInterval = (axisScaleSegment == null) ? this.labelStyle.GetInterval() : axisScaleSegment.Interval;
+ DateTimeIntervalType currentIntervalType = (axisScaleSegment == null) ? this.labelStyle.GetIntervalType() : axisScaleSegment.IntervalType;
+ DateTimeIntervalType lastFitIntervalType = currentIntervalType;
+ double lastFitInterval = currentInterval;
+ ArrayList lastFitLabels = new ArrayList();
+ bool intervalFound = false;
+ int iterationNumber = 0;
+ while(!intervalFound && iterationNumber <= 1000)
+ {
+ bool fillNewLabels = true;
+#if DEBUG
+ if(iterationNumber >= 999)
+ {
+ throw (new InvalidOperationException(SR.ExceptionAxisDynamicIntervalCalculationFailed));
+ }
+#endif // DEBUG
+
+ // Check labels fit. Only horizontal or vertical fit is checked depending
+ // on the axis orientation.
+ bool fitDone = CheckLabelsFit(
+ chartGraph,
+ this.markSize + this.scrollBarSize + this.titleSize,
+ autoPlotPosition,
+ true,
+ false,
+ (this.AxisPosition == AxisPosition.Left || this.AxisPosition == AxisPosition.Right) ? false : true,
+ (this.AxisPosition == AxisPosition.Left || this.AxisPosition == AxisPosition.Right) ? true : false,
+ null);
+
+ // Check if we need to increase or reduce number of labels
+ if(firstIteration)
+ {
+ firstIteration = false;
+ increaseNumberOfLabels = (fitDone) ? true : false;
+
+ // Check if we can decrease the interva;
+ if(onlyIncreaseInterval && increaseNumberOfLabels)
+ {
+ intervalFound = true;
+ continue;
+ }
+ }
+
+ // Find new interval. Value 0.0 means that interval cannot be
+ // reduced/increased any more and current interval should be used
+ double newInterval = 0.0;
+ DateTimeIntervalType newIntervalType = DateTimeIntervalType.Number;
+ if(increaseNumberOfLabels)
+ {
+ if(fitDone)
+ {
+ // Make a copy of last interval and labels collection that previously fit
+ lastFitInterval = currentInterval;
+ lastFitIntervalType = currentIntervalType;
+ lastFitLabels.Clear();
+ foreach(CustomLabel label in this.CustomLabels)
+ {
+ lastFitLabels.Add(label);
+ }
+
+ newIntervalType = currentIntervalType;
+ newInterval = this.ReduceLabelInterval(
+ currentInterval,
+ minIntervalSzie,
+ ref newIntervalType);
+ }
+ else
+ {
+ newInterval = lastFitInterval;
+ newIntervalType = lastFitIntervalType;
+ intervalFound = true;
+
+ // Reuse previously saved labels
+ fillNewLabels = false;
+ this.CustomLabels.Clear();
+ foreach(CustomLabel label in lastFitLabels)
+ {
+ this.CustomLabels.Add(label);
+ }
+
+ }
+ }
+ else
+ {
+ if(!fitDone && this.CustomLabels.Count > 1)
+ {
+ newIntervalType = currentIntervalType;
+ newInterval = this.IncreaseLabelInterval(
+ currentInterval,
+ ref newIntervalType);
+ }
+ else
+ {
+ intervalFound = true;
+ }
+ }
+
+ // Set new interval
+ if(newInterval != 0.0)
+ {
+ currentInterval = newInterval;
+ currentIntervalType = newIntervalType;
+
+ if(axisScaleSegment == null)
+ {
+ this.SetIntervalAndType(newInterval, newIntervalType);
+ }
+ else
+ {
+ axisScaleSegment.Interval = newInterval;
+ axisScaleSegment.IntervalType = newIntervalType;
+ }
+
+ // Re-fill new axis labels
+ if(fillNewLabels)
+ {
+ if(this.tempLabels != null)
+ {
+ this.CustomLabels.Clear();
+ foreach( CustomLabel label in this.tempLabels )
+ {
+ CustomLabels.Add(label.Clone());
+ }
+ }
+
+ if(axisScaleSegment == null)
+ {
+ this.FillLabels(true);
+ }
+ else
+ {
+ axisScaleSegment.SetTempAxisScaleAndInterval();
+ this.FillLabels( true );
+ axisScaleSegment.RestoreAxisScaleAndInterval();
+ }
+ }
+ }
+ else
+ {
+ intervalFound = true;
+ }
+
+ ++iterationNumber;
+ }
+ }
+
+ /// <summary>
+ /// Reduces current label interval, so that more labels can fit.
+ /// </summary>
+ /// <param name="oldInterval">An interval to reduce.</param>
+ /// <param name="minInterval">Minimum interval size.</param>
+ /// <param name="axisIntervalType">Interval type.</param>
+ /// <returns>New interval or 0.0 if interval cannot be reduced.</returns>
+ private double ReduceLabelInterval(
+ double oldInterval,
+ double minInterval,
+ ref DateTimeIntervalType axisIntervalType)
+ {
+ double newInterval = oldInterval;
+
+ // Calculate rounded interval value
+ double range = this.maximum - this.minimum;
+ int iterationIndex = 0;
+ if( axisIntervalType == DateTimeIntervalType.Auto ||
+ axisIntervalType == DateTimeIntervalType.NotSet ||
+ axisIntervalType == DateTimeIntervalType.Number)
+ {
+ // Process numeric scale
+ double devider = 2.0;
+ do
+ {
+#if DEBUG
+ if(iterationIndex >= 99)
+ {
+ throw (new InvalidOperationException(SR.ExceptionAxisIntervalDecreasingFailed));
+ }
+#endif // DEBUG
+
+ newInterval = CalcInterval( range / (range / (newInterval / devider)) );
+ if(newInterval == oldInterval)
+ {
+ devider *= 2.0;
+ }
+
+ ++iterationIndex;
+ } while(newInterval == oldInterval && iterationIndex <= 100);
+ }
+ else
+ {
+ // Process date scale
+ if(oldInterval > 1.0 || oldInterval < 1.0)
+ {
+ if( axisIntervalType == DateTimeIntervalType.Minutes ||
+ axisIntervalType == DateTimeIntervalType.Seconds)
+ {
+ if(oldInterval >= 60)
+ {
+ newInterval = Math.Round(oldInterval / 2.0);
+ }
+ else if(oldInterval >= 30.0)
+ {
+ newInterval = 15.0;
+ }
+ else if(oldInterval >= 15.0)
+ {
+ newInterval = 5.0;
+ }
+ else if(oldInterval >= 5.0)
+ {
+ newInterval = 1.0;
+ }
+ }
+ else
+ {
+ newInterval = Math.Round(oldInterval / 2.0);
+ }
+ if(newInterval < 1.0)
+ {
+ newInterval = 1.0;
+ }
+ }
+ if(oldInterval == 1.0)
+ {
+ if(axisIntervalType == DateTimeIntervalType.Years)
+ {
+ newInterval = 6.0;
+ axisIntervalType = DateTimeIntervalType.Months;
+ }
+ else if(axisIntervalType == DateTimeIntervalType.Months)
+ {
+ newInterval = 2.0;
+ axisIntervalType = DateTimeIntervalType.Weeks;
+ }
+ else if(axisIntervalType == DateTimeIntervalType.Weeks)
+ {
+ newInterval = 2.0;
+ axisIntervalType = DateTimeIntervalType.Days;
+ }
+ else if(axisIntervalType == DateTimeIntervalType.Days)
+ {
+ newInterval = 12.0;
+ axisIntervalType = DateTimeIntervalType.Hours;
+ }
+ else if(axisIntervalType == DateTimeIntervalType.Hours)
+ {
+ newInterval = 30.0;
+ axisIntervalType = DateTimeIntervalType.Minutes;
+ }
+ else if(axisIntervalType == DateTimeIntervalType.Minutes)
+ {
+ newInterval = 30.0;
+ axisIntervalType = DateTimeIntervalType.Seconds;
+ }
+ else if(axisIntervalType == DateTimeIntervalType.Seconds)
+ {
+ newInterval = 100.0;
+ axisIntervalType = DateTimeIntervalType.Milliseconds;
+ }
+ }
+ }
+
+
+ // Make sure interal is not less than min interval specified
+ if(!double.IsNaN(minInterval) && newInterval < minInterval)
+ {
+ newInterval = 0.0;
+ }
+
+ return newInterval;
+ }
+
+ /// <summary>
+ /// Increases current label interval, so that less labels fit.
+ /// </summary>
+ /// <param name="oldInterval">An interval to increase.</param>
+ /// <param name="axisIntervalType">Interval type.</param>
+ /// <returns>New interval or 0.0 if interval cannot be increased.</returns>
+ private double IncreaseLabelInterval(
+ double oldInterval,
+ ref DateTimeIntervalType axisIntervalType)
+ {
+ double newInterval = oldInterval;
+
+ // Calculate rounded interval value
+ double range = this.maximum - this.minimum;
+ int iterationIndex = 0;
+ if( axisIntervalType == DateTimeIntervalType.Auto ||
+ axisIntervalType == DateTimeIntervalType.NotSet ||
+ axisIntervalType == DateTimeIntervalType.Number)
+ {
+ // Process numeric scale
+ double devider = 2.0;
+ do
+ {
+#if DEBUG
+ if(iterationIndex >= 99)
+ {
+ throw (new InvalidOperationException(SR.ExceptionAxisIntervalIncreasingFailed));
+ }
+#endif // DEBUG
+
+ newInterval = CalcInterval( range / (range / (newInterval * devider)) );
+ if(newInterval == oldInterval)
+ {
+ devider *= 2.0;
+ }
+ ++iterationIndex;
+ } while(newInterval == oldInterval && iterationIndex <= 100);
+ }
+ else
+ {
+ // Process date scale
+ newInterval = oldInterval * 2.0;
+ if(axisIntervalType == DateTimeIntervalType.Years)
+ {
+ // Do nothing for years
+ }
+ else if(axisIntervalType == DateTimeIntervalType.Months)
+ {
+ if(newInterval >= 12.0)
+ {
+ newInterval = 1.0;
+ axisIntervalType = DateTimeIntervalType.Years;
+ }
+ }
+ else if(axisIntervalType == DateTimeIntervalType.Weeks)
+ {
+ if(newInterval >= 4.0)
+ {
+ newInterval = 1.0;
+ axisIntervalType = DateTimeIntervalType.Months;
+ }
+ }
+ else if(axisIntervalType == DateTimeIntervalType.Days)
+ {
+ if(newInterval >= 7.0)
+ {
+ newInterval = 1.0;
+ axisIntervalType = DateTimeIntervalType.Weeks;
+ }
+ }
+ else if(axisIntervalType == DateTimeIntervalType.Hours)
+ {
+ if(newInterval >= 60.0)
+ {
+ newInterval = 1.0;
+ axisIntervalType = DateTimeIntervalType.Days;
+ }
+ }
+ else if(axisIntervalType == DateTimeIntervalType.Minutes)
+ {
+ if(newInterval >= 60.0)
+ {
+ newInterval = 1.0;
+ axisIntervalType = DateTimeIntervalType.Hours;
+ }
+ }
+ else if(axisIntervalType == DateTimeIntervalType.Seconds)
+ {
+ if(newInterval >= 60.0)
+ {
+ newInterval = 1.0;
+ axisIntervalType = DateTimeIntervalType.Minutes;
+ }
+ }
+ else if(axisIntervalType == DateTimeIntervalType.Milliseconds)
+ {
+ if(newInterval >= 1000.0)
+ {
+ newInterval = 1.0;
+ axisIntervalType = DateTimeIntervalType.Seconds;
+ }
+ }
+ }
+
+ return newInterval;
+ }
+
+ /// <summary>
+ /// Finds the longest labels with the space and inserts the new line character.
+ /// </summary>
+ /// <param name="labels">Labels collection.</param>
+ /// <returns>True if collection was modified.</returns>
+ private bool WordWrapLongestLabel(CustomLabelsCollection labels)
+ {
+ bool changed = false;
+
+ // Each label may contain several lines of text.
+ // Create a list that contains an array of text for each label.
+ ArrayList labelTextRows = new ArrayList(labels.Count);
+ foreach (CustomLabel label in labels)
+ {
+ labelTextRows.Add(label.Text.Split('\n'));
+ }
+
+ // Find the longest label with a space
+ int longestLabelSize = 5;
+ int longestLabelIndex = -1;
+ int longestLabelRowIndex = -1;
+ int index = 0;
+ foreach (string[] textRows in labelTextRows)
+ {
+ for (int rowIndex = 0; rowIndex < textRows.Length; rowIndex++)
+ {
+ if (textRows[rowIndex].Length > longestLabelSize && textRows[rowIndex].Trim().IndexOf(' ') > 0)
+ {
+ longestLabelSize = textRows[rowIndex].Length;
+ longestLabelIndex = index;
+ longestLabelRowIndex = rowIndex;
+ }
+ }
+ ++index;
+ }
+
+ // Longest label with a space was found
+ if (longestLabelIndex >= 0 && longestLabelRowIndex >= 0)
+ {
+ // Try to find a space and replace it with a new line
+ string newText = ((string[])labelTextRows[longestLabelIndex])[longestLabelRowIndex];
+ for (index = 0; index < (newText.Length) / 2 - 1; index++)
+ {
+ if (newText[(newText.Length) / 2 - index] == ' ')
+ {
+ newText =
+ newText.Substring(0, (newText.Length) / 2 - index) +
+ "\n" +
+ newText.Substring((newText.Length) / 2 - index + 1);
+ changed = true;
+ }
+ else if (newText[(newText.Length) / 2 + index] == ' ')
+ {
+ newText =
+ newText.Substring(0, (newText.Length) / 2 + index) +
+ "\n" +
+ newText.Substring((newText.Length) / 2 + index + 1);
+ changed = true;
+ }
+
+ if (changed)
+ {
+ ((string[])labelTextRows[longestLabelIndex])[longestLabelRowIndex] = newText;
+ break;
+ }
+ }
+
+ // Update label text
+ if (changed)
+ {
+ // Construct label text from multiple rows separated by "\n"
+ CustomLabel label = labels[longestLabelIndex];
+ label.Text = string.Empty;
+ for (int rowIndex = 0; rowIndex < ((string[])labelTextRows[longestLabelIndex]).Length; rowIndex++)
+ {
+ if (rowIndex > 0)
+ {
+ label.Text += "\n";
+ }
+ label.Text += ((string[])labelTextRows[longestLabelIndex])[rowIndex];
+ }
+ }
+ }
+
+ return changed;
+ }
+
+ /// <summary>
+ /// Calculates the auto-fit font for the circular Common.Chart area axis labels.
+ /// </summary>
+ /// <param name="graph">Chart graphics object.</param>
+ /// <param name="axisList">List of sector labels.</param>
+ /// <param name="labelsStyle">Circular labels style.</param>
+ /// <param name="plotAreaRectAbs">Plotting area position.</param>
+ /// <param name="areaRectAbs">Chart area position.</param>
+ /// <param name="labelsSizeEstimate">Estimated size of labels.</param>
+ internal void GetCircularAxisLabelsAutoFitFont(
+ ChartGraphics graph,
+ ArrayList axisList,
+ CircularAxisLabelsStyle labelsStyle,
+ RectangleF plotAreaRectAbs,
+ RectangleF areaRectAbs,
+ float labelsSizeEstimate)
+ {
+ // X axis settings defines if auto-fit font should be calculated
+ if (!this.IsLabelAutoFit ||
+ this.LabelAutoFitStyle == LabelAutoFitStyles.None ||
+ !this.LabelStyle.Enabled)
+ {
+ return;
+ }
+
+ // Set minimum font size
+ _minLabelFontSize = Math.Min(this.LabelAutoFitMinFontSize, this.LabelAutoFitMaxFontSize);
+
+ // Create new auto-fit font
+ this.autoLabelFont = Common.Chart.chartPicture.FontCache.GetFont(
+ this.LabelStyle.Font.FontFamily,
+ Math.Max(this.LabelAutoFitMaxFontSize, this.LabelAutoFitMinFontSize),
+ this.LabelStyle.Font.Style,
+ GraphicsUnit.Point);
+
+ // Check if we allowed to increase font size while auto-fitting
+ if ((this.LabelAutoFitStyle & LabelAutoFitStyles.IncreaseFont) != LabelAutoFitStyles.IncreaseFont)
+ {
+ // Use axis labels font as starting point
+ this.autoLabelFont = this.LabelStyle.Font;
+ }
+
+ // Loop while labels do not fit
+ bool fitDone = false;
+ while (!fitDone)
+ {
+ //******************************************************
+ //** Check if labels fit
+ //******************************************************
+ fitDone = CheckCircularLabelsFit(
+ graph,
+ axisList,
+ labelsStyle,
+ plotAreaRectAbs,
+ areaRectAbs,
+ labelsSizeEstimate);
+
+ //******************************************************
+ //** Adjust labels text properties to fit
+ //******************************************************
+ if (!fitDone)
+ {
+ // Try to reduce font size
+ if (autoLabelFont.SizeInPoints > _minLabelFontSize &&
+ (this.LabelAutoFitStyle & LabelAutoFitStyles.DecreaseFont) == LabelAutoFitStyles.DecreaseFont)
+ {
+ autoLabelFont = Common.Chart.chartPicture.FontCache.GetFont(
+ autoLabelFont.FontFamily,
+ autoLabelFont.SizeInPoints - 1,
+ autoLabelFont.Style,
+ GraphicsUnit.Point);
+
+ }
+
+ // Failed to fit
+ else
+ {
+ // Use last font with no angles
+ autoLabelAngle = 0;
+ autoLabelOffset = 0;
+ fitDone = true;
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Checks id circular axis labels fits using current auto-fit font.
+ /// </summary>
+ /// <param name="graph">Chart graphics object.</param>
+ /// <param name="axisList">List of sector labels.</param>
+ /// <param name="labelsStyle">Circular labels style.</param>
+ /// <param name="plotAreaRectAbs">Plotting area position.</param>
+ /// <param name="areaRectAbs">Chart area position.</param>
+ /// <param name="labelsSizeEstimate">Estimated size of labels.</param>
+ /// <returns>True if labels fit.</returns>
+ internal bool CheckCircularLabelsFit(
+ ChartGraphics graph,
+ ArrayList axisList,
+ CircularAxisLabelsStyle labelsStyle,
+ RectangleF plotAreaRectAbs,
+ RectangleF areaRectAbs,
+ float labelsSizeEstimate)
+ {
+ bool labelsFit = true;
+
+ // Get absolute center of the area
+ PointF areaCenterAbs = graph.GetAbsolutePoint(ChartArea.circularCenter);
+
+ // Get absolute markers size and spacing
+ float spacing = graph.GetAbsolutePoint(new PointF(0, this.markSize + Axis.elementSpacing)).Y;
+
+ //*****************************************************************
+ //** Loop through all axis labels
+ //*****************************************************************
+ RectangleF prevLabelPosition = RectangleF.Empty;
+ float prevLabelSideAngle = float.NaN;
+ foreach (CircularChartAreaAxis axis in axisList)
+ {
+ //*****************************************************************
+ //** Measure label text
+ //*****************************************************************
+ SizeF textSize = graph.MeasureString(
+ axis.Title.Replace("\\n", "\n"),
+ this.autoLabelFont);
+
+ //*****************************************************************
+ //** Get circular style label position.
+ //*****************************************************************
+ if (labelsStyle == CircularAxisLabelsStyle.Circular ||
+ labelsStyle == CircularAxisLabelsStyle.Radial)
+ {
+ // Swith text size for the radial style
+ if (labelsStyle == CircularAxisLabelsStyle.Radial)
+ {
+ float tempValue = textSize.Width;
+ textSize.Width = textSize.Height;
+ textSize.Height = tempValue;
+ }
+
+ //*****************************************************************
+ //** Check overlapping with previous label
+ //*****************************************************************
+
+ // Get radius of plot area
+ float plotAreaRadius = areaCenterAbs.Y - plotAreaRectAbs.Y;
+ plotAreaRadius -= labelsSizeEstimate;
+ plotAreaRadius += spacing;
+
+ // Calculate angle on the side of the label
+ float leftSideAngle = (float)(Math.Atan((textSize.Width / 2f) / plotAreaRadius) * 180f / Math.PI);
+ float rightSideAngle = axis.AxisPosition + leftSideAngle;
+ leftSideAngle = axis.AxisPosition - leftSideAngle;
+
+ // Check if label overlap the previous label
+ if (!float.IsNaN(prevLabelSideAngle))
+ {
+ if (prevLabelSideAngle > leftSideAngle)
+ {
+ // Labels overlap
+ labelsFit = false;
+ break;
+ }
+ }
+
+ // Remember label side angle
+ prevLabelSideAngle = rightSideAngle - 1;
+
+
+ //*****************************************************************
+ //** Check if label is inside the Common.Chart area
+ //*****************************************************************
+
+ // Find the most outside point of the label
+ PointF outsidePoint = new PointF(areaCenterAbs.X, plotAreaRectAbs.Y);
+ outsidePoint.Y += labelsSizeEstimate;
+ outsidePoint.Y -= textSize.Height;
+ outsidePoint.Y -= spacing;
+
+ PointF[] rotatedPoint = new PointF[] { outsidePoint };
+ Matrix newMatrix = new Matrix();
+ newMatrix.RotateAt(axis.AxisPosition, areaCenterAbs);
+ newMatrix.TransformPoints(rotatedPoint);
+
+ // Check if rotated point is inside Common.Chart area
+ if (!areaRectAbs.Contains(rotatedPoint[0]))
+ {
+ // Label is not inside Common.Chart area
+ labelsFit = false;
+ break;
+ }
+
+ }
+
+ //*****************************************************************
+ //** Get horizontal style label position.
+ //*****************************************************************
+ else if (labelsStyle == CircularAxisLabelsStyle.Horizontal)
+ {
+ // Get text angle
+ float textAngle = axis.AxisPosition;
+ if (textAngle > 180f)
+ {
+ textAngle -= 180f;
+ }
+
+ // Get label rotated position
+ PointF[] labelPosition = new PointF[] { new PointF(areaCenterAbs.X, plotAreaRectAbs.Y) };
+ labelPosition[0].Y += labelsSizeEstimate;
+ labelPosition[0].Y -= spacing;
+ Matrix newMatrix = new Matrix();
+ newMatrix.RotateAt(textAngle, areaCenterAbs);
+ newMatrix.TransformPoints(labelPosition);
+
+ // Calculate label position
+ RectangleF curLabelPosition = new RectangleF(
+ labelPosition[0].X,
+ labelPosition[0].Y - textSize.Height / 2f,
+ textSize.Width,
+ textSize.Height);
+ if (textAngle < 5f)
+ {
+ curLabelPosition.X = labelPosition[0].X - textSize.Width / 2f;
+ curLabelPosition.Y = labelPosition[0].Y - textSize.Height;
+ }
+ if (textAngle > 175f)
+ {
+ curLabelPosition.X = labelPosition[0].X - textSize.Width / 2f;
+ curLabelPosition.Y = labelPosition[0].Y;
+ }
+
+ // Decrease label rectangle
+ curLabelPosition.Inflate(0f, -curLabelPosition.Height * 0.15f);
+
+ // Check if label position goes outside of the Common.Chart area.
+ if (!areaRectAbs.Contains(curLabelPosition))
+ {
+ // Label is not inside Common.Chart area
+ labelsFit = false;
+ break;
+ }
+
+ // Check if label position overlap previous label position.
+ if (!prevLabelPosition.IsEmpty && curLabelPosition.IntersectsWith(prevLabelPosition))
+ {
+ // Label intersects with previous label
+ labelsFit = false;
+ break;
+ }
+
+ // Set previous point position
+ prevLabelPosition = curLabelPosition;
+ }
+ }
+
+ return labelsFit;
+ }
+
+ #endregion
+
+ #region Axis labels auto-fitting methods
+
+ /// <summary>
+ /// Adjust labels font size at second pass of auto fitting.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics object.</param>
+ /// <param name="autoPlotPosition">Indicates that inner plot position is automatic.</param>
+ internal void AdjustLabelFontAtSecondPass(ChartGraphics chartGraph, bool autoPlotPosition)
+ {
+#if SUBAXES
+ // Process all sub-axis
+ if(!ChartArea.Area3DStyle.Enable3D &&
+ !ChartArea.chartAreaIsCurcular)
+ {
+ foreach(SubAxis subAxis in this.SubAxes)
+ {
+ subAxis.AdjustLabelFontAtSecondPass(chartGraph, autoPlotPosition);
+ }
+ }
+#endif //SUBAXES
+
+
+ //******************************************************
+ //** First try to select the interval that will
+ //** generate best fit labels.
+ //******************************************************
+
+
+
+ // Make sure the variable interval mode is enabled
+ if( this.Enabled != AxisEnabled.False &&
+ this.LabelStyle.Enabled &&
+ this.IsVariableLabelCountModeEnabled() )
+ {
+ // Set font for labels fitting
+ if(this.autoLabelFont == null)
+ {
+ this.autoLabelFont = this.LabelStyle.Font;
+ }
+
+ // Reset angle and stagged flag used in the auto-fitting algorithm
+ if(this.autoLabelAngle < 0)
+ {
+ this.autoLabelAngle = this.LabelStyle.Angle;
+ }
+ if(this.autoLabelOffset < 0)
+ {
+ this.autoLabelOffset = (this.LabelStyle.IsStaggered) ? 1 : 0;
+ }
+
+ // Check labels fit
+ bool fitDone = CheckLabelsFit(
+ chartGraph,
+ this.markSize + this.scrollBarSize + this.titleSize,
+ autoPlotPosition,
+ true,
+ true,
+ (this.AxisPosition == AxisPosition.Left || this.AxisPosition == AxisPosition.Right) ? false : true,
+ (this.AxisPosition == AxisPosition.Left || this.AxisPosition == AxisPosition.Right) ? true : false,
+ null);
+
+ // If there is a problem fitting labels try to reduce number of labels by
+ // increasing of the interval.
+ if(!fitDone)
+ {
+ // Adjust interval
+ this.AdjustIntervalToFitLabels(chartGraph, autoPlotPosition, true);
+ }
+ }
+
+
+
+
+ //******************************************************
+ //** If labels auto-fit is on try reducing font size.
+ //******************************************************
+
+ totlaGroupingLabelsSizeAdjustment = 0f;
+ if (this.IsLabelAutoFit &&
+ this.LabelAutoFitStyle != LabelAutoFitStyles.None &&
+ this.Enabled != AxisEnabled.False)
+ {
+ bool fitDone = false;
+
+ if (autoLabelFont == null)
+ {
+ autoLabelFont = this.LabelStyle.Font;
+ }
+
+ // Loop while labels do not fit
+ float oldLabelSecondRowSize = totlaGroupingLabelsSize;
+ while (!fitDone)
+ {
+ //******************************************************
+ //** Check if labels fit
+ //******************************************************
+ fitDone = CheckLabelsFit(
+ chartGraph,
+ this.markSize + this.scrollBarSize + this.titleSize,
+ autoPlotPosition,
+ true,
+ true);
+
+ //******************************************************
+ //** Adjust labels text properties to fit
+ //******************************************************
+ if (!fitDone)
+ {
+ // Try to reduce font
+ if (autoLabelFont.SizeInPoints > _minLabelFontSize)
+ {
+ // Reduce auto fit font
+ if (ChartArea != null && ChartArea.IsSameFontSizeForAllAxes)
+ {
+ // Same font for all axes
+ foreach (Axis currentAxis in ChartArea.Axes)
+ {
+ if (currentAxis.enabled && currentAxis.IsLabelAutoFit && currentAxis.autoLabelFont != null)
+ {
+ currentAxis.autoLabelFont = Common.Chart.chartPicture.FontCache.GetFont(
+ currentAxis.autoLabelFont.FontFamily,
+ autoLabelFont.SizeInPoints - 1,
+ currentAxis.autoLabelFont.Style,
+ GraphicsUnit.Point);
+ }
+ }
+ }
+ else if ((this.LabelAutoFitStyle & LabelAutoFitStyles.DecreaseFont) == LabelAutoFitStyles.DecreaseFont)
+ {
+ autoLabelFont = Common.Chart.chartPicture.FontCache.GetFont(
+ autoLabelFont.FontFamily,
+ autoLabelFont.SizeInPoints - 1,
+ autoLabelFont.Style,
+ GraphicsUnit.Point);
+ }
+ else
+ {
+ // Failed to fit
+ fitDone = true;
+ }
+ }
+ else
+ {
+ // Failed to fit
+ fitDone = true;
+ }
+ }
+ }
+
+ this.totlaGroupingLabelsSizeAdjustment = oldLabelSecondRowSize - totlaGroupingLabelsSize;
+ }
+ }
+
+ /// <summary>
+ /// Check if axis is logarithmic
+ /// </summary>
+ /// <param name="yValue">Y value from data</param>
+ /// <returns>Corected Y value if axis is logarithmic</returns>
+ internal double GetLogValue(double yValue)
+ {
+ // Check if axis is logarithmic
+ if (this.IsLogarithmic)
+ {
+ yValue = Math.Log(yValue, this.logarithmBase);
+ }
+
+ return yValue;
+ }
+
+ /// <summary>
+ /// Checks if labels fit using current auto fit properties
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics object.</param>
+ /// <param name="otherElementsSize">Axis title and marks size.</param>
+ /// <param name="autoPlotPosition">Indicates auto calculation of plotting area.</param>
+ /// <param name="checkLabelsFirstRowOnly">Labels fit is checked during the second pass.</param>
+ /// <param name="secondPass">Indicates second pass of labels fitting.</param>
+ /// <returns>True if labels fit.</returns>
+ private bool CheckLabelsFit(
+ ChartGraphics chartGraph,
+ float otherElementsSize,
+ bool autoPlotPosition,
+ bool checkLabelsFirstRowOnly,
+ bool secondPass)
+ {
+ return this.CheckLabelsFit(
+ chartGraph,
+ otherElementsSize,
+ autoPlotPosition,
+ checkLabelsFirstRowOnly,
+ secondPass,
+ true,
+ true,
+ null);
+ }
+
+ /// <summary>
+ /// Checks if labels fit using current auto fit properties
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics object.</param>
+ /// <param name="otherElementsSize">Axis title and marks size.</param>
+ /// <param name="autoPlotPosition">Indicates auto calculation of plotting area.</param>
+ /// <param name="checkLabelsFirstRowOnly">Labels fit is checked during the second pass.</param>
+ /// <param name="secondPass">Indicates second pass of labels fitting.</param>
+ /// <param name="checkWidth">True if width should be checked.</param>
+ /// <param name="checkHeight">True if height should be checked.</param>
+ /// <param name="labelPositions">Returns an array of label positions.</param>
+ /// <returns>True if labels fit.</returns>
+ private bool CheckLabelsFit(
+ ChartGraphics chartGraph,
+ float otherElementsSize,
+ bool autoPlotPosition,
+ bool checkLabelsFirstRowOnly,
+ bool secondPass,
+ bool checkWidth,
+ bool checkHeight,
+ ArrayList labelPositions)
+ {
+ // Reset list of label positions
+ if (labelPositions != null)
+ {
+ labelPositions.Clear();
+ }
+
+ // Label string drawing format
+ using (StringFormat format = new StringFormat())
+ {
+ format.FormatFlags |= StringFormatFlags.LineLimit;
+ format.Trimming = StringTrimming.EllipsisCharacter;
+
+ // Initialize all labels position rectangle
+ RectangleF rect = RectangleF.Empty;
+
+ // Calculate max label size
+ float maxLabelSize = 0;
+ if (!autoPlotPosition)
+ {
+ if (this.GetIsMarksNextToAxis())
+ {
+ if (this.AxisPosition == AxisPosition.Top)
+ maxLabelSize = (float)GetAxisPosition() - ChartArea.Position.Y;
+ else if (this.AxisPosition == AxisPosition.Bottom)
+ maxLabelSize = ChartArea.Position.Bottom - (float)GetAxisPosition();
+ if (this.AxisPosition == AxisPosition.Left)
+ maxLabelSize = (float)GetAxisPosition() - ChartArea.Position.X;
+ else if (this.AxisPosition == AxisPosition.Right)
+ maxLabelSize = ChartArea.Position.Right - (float)GetAxisPosition();
+ }
+ else
+ {
+ if (this.AxisPosition == AxisPosition.Top)
+ maxLabelSize = this.PlotAreaPosition.Y - ChartArea.Position.Y;
+ else if (this.AxisPosition == AxisPosition.Bottom)
+ maxLabelSize = ChartArea.Position.Bottom - this.PlotAreaPosition.Bottom;
+ if (this.AxisPosition == AxisPosition.Left)
+ maxLabelSize = this.PlotAreaPosition.X - ChartArea.Position.X;
+ else if (this.AxisPosition == AxisPosition.Right)
+ maxLabelSize = ChartArea.Position.Right - this.PlotAreaPosition.Right;
+ }
+ maxLabelSize *= 2F;
+ }
+ else
+ {
+ if (this.AxisPosition == AxisPosition.Bottom || this.AxisPosition == AxisPosition.Top)
+ maxLabelSize = ChartArea.Position.Height;
+ else
+ maxLabelSize = ChartArea.Position.Width;
+ }
+
+ // Loop through all grouping labels (all except first row)
+ this.totlaGroupingLabelsSize = 0;
+
+
+ // Get number of groups
+ int groupLabelLevelCount = GetGroupLabelLevelCount();
+
+ // Check ig grouping labels exist
+ if (groupLabelLevelCount > 0)
+ {
+ groupingLabelSizes = new float[groupLabelLevelCount];
+
+ // Loop through each level of grouping labels
+ bool fitResult = true;
+ for (int groupLevelIndex = 1; groupLevelIndex <= groupLabelLevelCount; groupLevelIndex++)
+ {
+ groupingLabelSizes[groupLevelIndex - 1] = 0f;
+
+ // Loop through all labels in the level
+ foreach (CustomLabel label in this.CustomLabels)
+ {
+ // Skip if label middle point is outside current scaleView
+ if (label.RowIndex == 0)
+ {
+ double middlePoint = (label.FromPosition + label.ToPosition) / 2.0;
+ if (middlePoint < this.ViewMinimum || middlePoint > this.ViewMaximum)
+ {
+ continue;
+ }
+ }
+
+ if (label.RowIndex == groupLevelIndex)
+ {
+ // Calculate label rect
+ double fromPosition = this.GetLinearPosition(label.FromPosition);
+ double toPosition = this.GetLinearPosition(label.ToPosition);
+ if (this.AxisPosition == AxisPosition.Bottom || this.AxisPosition == AxisPosition.Top)
+ {
+ rect.Height = (maxLabelSize / 100F) * maxAxisLabelRow2Size / groupLabelLevelCount;
+ rect.X = (float)Math.Min(fromPosition, toPosition);
+ rect.Width = (float)Math.Max(fromPosition, toPosition) - rect.X;
+ }
+ else
+ {
+ rect.Width = (maxLabelSize / 100F) * maxAxisLabelRow2Size / groupLabelLevelCount;
+ rect.Y = (float)Math.Min(fromPosition, toPosition);
+ rect.Height = (float)Math.Max(fromPosition, toPosition) - rect.Y;
+ }
+
+ // Measure string
+ SizeF axisLabelSize = chartGraph.MeasureStringRel(label.Text.Replace("\\n", "\n"), autoLabelFont);
+
+ // Add image size
+ if (label.Image.Length > 0)
+ {
+ SizeF imageAbsSize = new SizeF();
+
+ if (this.Common.ImageLoader.GetAdjustedImageSize(label.Image, chartGraph.Graphics, ref imageAbsSize))
+ {
+ SizeF imageRelSize = chartGraph.GetRelativeSize(imageAbsSize);
+ axisLabelSize.Width += imageRelSize.Width;
+ axisLabelSize.Height = Math.Max(axisLabelSize.Height, imageRelSize.Height);
+ }
+ }
+
+ // Add extra spacing for the box marking of the label
+ if (label.LabelMark == LabelMarkStyle.Box)
+ {
+ // Get relative size from pixels and add it to the label size
+ SizeF spacerSize = chartGraph.GetRelativeSize(new SizeF(4, 4));
+ axisLabelSize.Width += spacerSize.Width;
+ axisLabelSize.Height += spacerSize.Height;
+ }
+
+ // Calculate max height of the second row of labels
+ if (this.AxisPosition == AxisPosition.Bottom || this.AxisPosition == AxisPosition.Top)
+ {
+ groupingLabelSizes[groupLevelIndex - 1] = (float)Math.Max(groupingLabelSizes[groupLevelIndex - 1], axisLabelSize.Height);
+ }
+ else
+ {
+ axisLabelSize.Width = chartGraph.GetAbsoluteSize(new SizeF(axisLabelSize.Height, axisLabelSize.Height)).Height;
+ axisLabelSize.Width = chartGraph.GetRelativeSize(new SizeF(axisLabelSize.Width, axisLabelSize.Width)).Width;
+ groupingLabelSizes[groupLevelIndex - 1] = (float)Math.Max(groupingLabelSizes[groupLevelIndex - 1], axisLabelSize.Width);
+ }
+
+ // Check if string fits
+ if (Math.Round(axisLabelSize.Width) >= Math.Round(rect.Width) &&
+ checkWidth)
+ {
+ fitResult = false;
+ }
+ if (Math.Round(axisLabelSize.Height) >= Math.Round(rect.Height) &&
+ checkHeight)
+ {
+ fitResult = false;
+ }
+ }
+ }
+ }
+
+ this.totlaGroupingLabelsSize = this.GetGroupLablesToatalSize();
+ if (!fitResult && !checkLabelsFirstRowOnly)
+ {
+ return false;
+ }
+
+ }
+
+ // Loop through all labels in the first row
+ float angle = autoLabelAngle;
+ int labelIndex = 0;
+ foreach (CustomLabel label in this.CustomLabels)
+ {
+ // Skip if label middle point is outside current scaleView
+ if (label.RowIndex == 0)
+ {
+ double middlePoint = (label.FromPosition + label.ToPosition) / 2.0;
+ if (middlePoint < this.ViewMinimum || middlePoint > this.ViewMaximum)
+ {
+ continue;
+ }
+ }
+
+ if (label.RowIndex == 0)
+ {
+
+ // Force which scale segment to use when calculating label position
+ if (labelPositions != null)
+ {
+ this.ScaleSegments.EnforceSegment(this.ScaleSegments.FindScaleSegmentForAxisValue((label.FromPosition + label.ToPosition) / 2.0));
+ }
+
+
+ // Set label From and To coordinates
+ double fromPosition = this.GetLinearPosition(label.FromPosition);
+ double toPosition = this.GetLinearPosition(label.ToPosition);
+
+
+ // Reset scale segment to use when calculating label position
+ if (labelPositions != null)
+ {
+ this.ScaleSegments.EnforceSegment(null);
+ }
+
+
+ // Calculate single label position
+ rect.X = this.PlotAreaPosition.X;
+ rect.Y = (float)Math.Min(fromPosition, toPosition);
+ rect.Height = (float)Math.Max(fromPosition, toPosition) - rect.Y;
+
+ float maxElementSize = maxAxisElementsSize;
+ if (maxAxisElementsSize - this.totlaGroupingLabelsSize > 55)
+ {
+ maxElementSize = 55 + this.totlaGroupingLabelsSize;
+ }
+ if (this.AxisPosition == AxisPosition.Bottom || this.AxisPosition == AxisPosition.Top)
+ {
+ rect.Width = (maxLabelSize / 100F) *
+ (maxElementSize - this.totlaGroupingLabelsSize - otherElementsSize - elementSpacing);
+ }
+ else
+ {
+ rect.Width = (maxLabelSize / 100F) *
+ (maxElementSize - this.totlaGroupingLabelsSize - otherElementsSize - elementSpacing);
+ }
+
+ // Adjust label From/To position if labels are displayed with offset
+ if (autoLabelOffset == 1)
+ {
+ rect.Y -= rect.Height / 2F;
+ rect.Height *= 2F;
+ rect.Width /= 2F;
+ }
+
+ // If horizontal axis
+ if (this.AxisPosition == AxisPosition.Bottom || this.AxisPosition == AxisPosition.Top)
+ {
+ // Switch rectangle sizes
+ float val = rect.Height;
+ rect.Height = rect.Width;
+ rect.Width = val;
+
+ // Set vertical font for measuring
+ if (angle != 0)
+ {
+ format.FormatFlags |= StringFormatFlags.DirectionVertical;
+ }
+ }
+ else
+ {
+ // Set vertical font for measuring
+ if (angle == 90 || angle == -90)
+ {
+ angle = 0;
+ format.FormatFlags |= StringFormatFlags.DirectionVertical;
+ }
+ }
+
+ // Measure label text size. Add the 'I' character to allow a little bit of spacing between labels.
+ SizeF axisLabelSize = chartGraph.MeasureStringRel(
+ label.Text.Replace("\\n", "\n") + "W",
+ autoLabelFont,
+ (secondPass) ? rect.Size : ChartArea.Position.ToRectangleF().Size,
+ format);
+
+ // Width and height maybe zeros if rect is too small to fit the text and
+ // the LineLimit format flag is set.
+ if (label.Text.Length > 0 &&
+ (axisLabelSize.Width == 0f ||
+ axisLabelSize.Height == 0f))
+ {
+ // Measure string without the LineLimit flag
+ format.FormatFlags ^= StringFormatFlags.LineLimit;
+ axisLabelSize = chartGraph.MeasureStringRel(
+ label.Text.Replace("\\n", "\n"),
+ autoLabelFont,
+ (secondPass) ? rect.Size : ChartArea.Position.ToRectangleF().Size,
+ format);
+ format.FormatFlags |= StringFormatFlags.LineLimit;
+ }
+
+
+ // Add image size
+ if (label.Image.Length > 0)
+ {
+ SizeF imageAbsSize = new SizeF();
+
+ if(this.Common.ImageLoader.GetAdjustedImageSize(label.Image, chartGraph.Graphics, ref imageAbsSize))
+ {
+ SizeF imageRelSize = chartGraph.GetRelativeSize(imageAbsSize);
+ if ((format.FormatFlags & StringFormatFlags.DirectionVertical) == StringFormatFlags.DirectionVertical)
+ {
+ axisLabelSize.Height += imageRelSize.Height;
+ axisLabelSize.Width = Math.Max(axisLabelSize.Width, imageRelSize.Width);
+ }
+ else
+ {
+ axisLabelSize.Width += imageRelSize.Width;
+ axisLabelSize.Height = Math.Max(axisLabelSize.Height, imageRelSize.Height);
+ }
+ }
+ }
+
+ // Add extra spacing for the box marking of the label
+ if (label.LabelMark == LabelMarkStyle.Box)
+ {
+ // Get relative size from pixels and add it to the label size
+ SizeF spacerSize = chartGraph.GetRelativeSize(new SizeF(4, 4));
+ axisLabelSize.Width += spacerSize.Width;
+ axisLabelSize.Height += spacerSize.Height;
+ }
+
+
+ // Calculate size using label angle
+ float width = axisLabelSize.Width;
+ float height = axisLabelSize.Height;
+ if (angle != 0)
+ {
+ // Decrease label rectangle width by 3%
+ rect.Width *= 0.97f;
+
+ if (this.AxisPosition == AxisPosition.Bottom || this.AxisPosition == AxisPosition.Top)
+ {
+ width = (float)Math.Cos((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Height;
+ width += (float)Math.Sin((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Width;
+
+ height = (float)Math.Sin((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Height;
+ height += (float)Math.Cos((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Width;
+ }
+ else
+ {
+ width = (float)Math.Cos((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Width;
+ width += (float)Math.Sin((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Height;
+
+ height = (float)Math.Sin((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Width;
+ height += (float)Math.Cos((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Height;
+ }
+ }
+
+ // Save label position
+ if (labelPositions != null)
+ {
+ RectangleF labelPosition = rect;
+ if (angle == 0F || angle == 90F || angle == -90F)
+ {
+ if (this.AxisPosition == AxisPosition.Bottom || this.AxisPosition == AxisPosition.Top)
+ {
+ labelPosition.X = labelPosition.X + labelPosition.Width / 2f - width / 2f;
+ labelPosition.Width = width;
+ }
+ else
+ {
+ labelPosition.Y = labelPosition.Y + labelPosition.Height / 2f - height / 2f;
+ labelPosition.Height = height;
+ }
+ }
+ labelPositions.Add(labelPosition);
+ }
+
+ // Check if string fits
+ if (angle == 0F)
+ {
+ if (width >= rect.Width && checkWidth)
+ {
+ return false;
+ }
+ if (height >= rect.Height && checkHeight)
+ {
+ return false;
+ }
+ }
+ if (angle == 90F || angle == -90F)
+ {
+ if (width >= rect.Width && checkWidth)
+ {
+ return false;
+ }
+ if (height >= rect.Height && checkHeight)
+ {
+ return false;
+ }
+ }
+ else
+ {
+ if (this.AxisPosition == AxisPosition.Bottom || this.AxisPosition == AxisPosition.Top)
+ {
+ if (width >= rect.Width * 2F && checkWidth)
+ {
+ return false;
+ }
+ if (height >= rect.Height * 2F && checkHeight)
+ {
+ return false;
+ }
+ }
+ else
+ {
+ if (width >= rect.Width * 2F && checkWidth)
+ {
+ return false;
+ }
+ if (height >= rect.Height * 2F && checkHeight)
+ {
+ return false;
+ }
+ }
+ }
+
+ ++labelIndex;
+ }
+ }
+ }
+
+ return true;
+ }
+
+ /// <summary>
+ /// Calculates the best size for labels area.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics object.</param>
+ /// <param name="maxLabelSize">Maximum labels area size.</param>
+ /// <param name="resultSize">Label size without angle = 0.</param>
+ private float GetRequiredLabelSize(ChartGraphics chartGraph, float maxLabelSize, out float resultSize)
+ {
+ float resultRotatedSize = 0F;
+ resultSize = 0F;
+ float angle = (autoLabelAngle < -90) ? this.LabelStyle.Angle : autoLabelAngle;
+ labelNearOffset = float.MaxValue;
+ labelFarOffset = float.MinValue;
+
+ // Label string drawing format
+ using (StringFormat format = new StringFormat())
+ {
+ format.FormatFlags |= StringFormatFlags.LineLimit;
+ format.Trimming = StringTrimming.EllipsisCharacter;
+
+ // Initialize all labels position rectangle
+ RectangleF rectLabels = ChartArea.Position.ToRectangleF();
+
+ // Loop through all labels in the first row
+ foreach (CustomLabel label in this.CustomLabels)
+ {
+ // Skip if label middle point is outside current scaleView
+ if (label.RowIndex == 0)
+ {
+ decimal middlePoint = (decimal)(label.FromPosition + label.ToPosition) / (decimal)2.0;
+ if (middlePoint < (decimal)this.ViewMinimum || middlePoint > (decimal)this.ViewMaximum)
+ {
+ continue;
+ }
+ }
+ if (label.RowIndex == 0)
+ {
+ // Calculate single label position
+ RectangleF rect = rectLabels;
+ rect.Width = maxLabelSize;
+
+ // Set label From and To coordinates
+ double fromPosition = this.GetLinearPosition(label.FromPosition);
+ double toPosition = this.GetLinearPosition(label.ToPosition);
+ rect.Y = (float)Math.Min(fromPosition, toPosition);
+ rect.Height = (float)Math.Max(fromPosition, toPosition) - rect.Y;
+
+ // Adjust label From/To position if labels are displayed with offset
+ if ((autoLabelOffset == -1) ? this.LabelStyle.IsStaggered : (autoLabelOffset == 1))
+ {
+ rect.Y -= rect.Height / 2F;
+ rect.Height *= 2F;
+ }
+
+ // If horizontal axis
+ if (this.AxisPosition == AxisPosition.Bottom || this.AxisPosition == AxisPosition.Top)
+ {
+ // Switch rectangle sizes
+ float val = rect.Height;
+ rect.Height = rect.Width;
+ rect.Width = val;
+
+ // Set vertical font for measuring
+ if (angle != 0)
+ {
+ format.FormatFlags |= StringFormatFlags.DirectionVertical;
+ }
+ }
+ else
+ {
+ // Set vertical font for measuring
+ if (angle == 90 || angle == -90)
+ {
+ angle = 0;
+ format.FormatFlags |= StringFormatFlags.DirectionVertical;
+ }
+ }
+
+ // Measure label text size
+ rect.Width = (float)Math.Ceiling(rect.Width);
+ rect.Height = (float)Math.Ceiling(rect.Height);
+ SizeF axisLabelSize = chartGraph.MeasureStringRel(label.Text.Replace("\\n", "\n"),
+ (autoLabelFont != null) ? autoLabelFont : this.LabelStyle.Font,
+ rect.Size,
+ format);
+
+ // Width and height maybe zeros if rect is too small to fit the text and
+ // the LineLimit format flag is set.
+ if (axisLabelSize.Width == 0f || axisLabelSize.Height == 0f)
+ {
+ // Measure string without the LineLimit flag
+ format.FormatFlags ^= StringFormatFlags.LineLimit;
+ axisLabelSize = chartGraph.MeasureStringRel(label.Text.Replace("\\n", "\n"),
+ (autoLabelFont != null) ? autoLabelFont : this.LabelStyle.Font,
+ rect.Size,
+ format);
+ format.FormatFlags |= StringFormatFlags.LineLimit;
+ }
+
+
+ // Add image size
+ if (label.Image.Length > 0)
+ {
+ SizeF imageAbsSize = new SizeF();
+
+ if (this.Common.ImageLoader.GetAdjustedImageSize(label.Image, chartGraph.Graphics, ref imageAbsSize))
+ {
+ SizeF imageRelSize = chartGraph.GetRelativeSize(imageAbsSize);
+
+ if ((format.FormatFlags & StringFormatFlags.DirectionVertical) == StringFormatFlags.DirectionVertical)
+ {
+ axisLabelSize.Height += imageRelSize.Height;
+ axisLabelSize.Width = Math.Max(axisLabelSize.Width, imageRelSize.Width);
+ }
+ else
+ {
+ axisLabelSize.Width += imageRelSize.Width;
+ axisLabelSize.Height = Math.Max(axisLabelSize.Height, imageRelSize.Height);
+ }
+ }
+ }
+
+ // Add extra spacing for the box marking of the label
+ if (label.LabelMark == LabelMarkStyle.Box)
+ {
+ // Get relative size from pixels and add it to the label size
+ SizeF spacerSize = chartGraph.GetRelativeSize(new SizeF(4, 4));
+ axisLabelSize.Width += spacerSize.Width;
+ axisLabelSize.Height += spacerSize.Height;
+ }
+
+
+ // Calculate size using label angle
+ float width = axisLabelSize.Width;
+ float height = axisLabelSize.Height;
+ if (angle != 0)
+ {
+ width = (float)Math.Cos((90 - Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Width;
+ width += (float)Math.Cos((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Height;
+
+ height = (float)Math.Sin((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Height;
+ height += (float)Math.Sin((90 - Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Width;
+ }
+
+ width = (float)Math.Ceiling(width) * 1.05f;
+ height = (float)Math.Ceiling(height) * 1.05f;
+ axisLabelSize.Width = (float)Math.Ceiling(axisLabelSize.Width) * 1.05f;
+ axisLabelSize.Height = (float)Math.Ceiling(axisLabelSize.Height) * 1.05f;
+
+
+ // If axis is horizontal
+ if (this.AxisPosition == AxisPosition.Bottom || this.AxisPosition == AxisPosition.Top)
+ {
+ if (angle == 90 || angle == -90 || angle == 0)
+ {
+ resultSize = Math.Max(resultSize, axisLabelSize.Height);
+ resultRotatedSize = Math.Max(resultRotatedSize, axisLabelSize.Height);
+
+ // Calculate the over hang of labels on the side
+ labelNearOffset = (float)Math.Min(labelNearOffset, (fromPosition + toPosition) / 2f - axisLabelSize.Width / 2f);
+ labelFarOffset = (float)Math.Max(labelFarOffset, (fromPosition + toPosition) / 2f + axisLabelSize.Width / 2f);
+
+ }
+ else
+ {
+ resultSize = Math.Max(resultSize, axisLabelSize.Height);
+ resultRotatedSize = Math.Max(resultRotatedSize, height);
+
+ // Calculate the over hang of labels on the side
+ if (angle > 0)
+ {
+ labelFarOffset = (float)Math.Max(labelFarOffset, (fromPosition + toPosition) / 2f + width * 1.1f);
+ }
+ else
+ {
+ labelNearOffset = (float)Math.Min(labelNearOffset, (fromPosition + toPosition) / 2f - width * 1.1f);
+ }
+ }
+ }
+ // If axis is vertical
+ else
+ {
+ if (angle == 90 || angle == -90 || angle == 0)
+ {
+ resultSize = Math.Max(resultSize, axisLabelSize.Width);
+ resultRotatedSize = Math.Max(resultRotatedSize, axisLabelSize.Width);
+
+ // Calculate the over hang of labels on the side
+ labelNearOffset = (float)Math.Min(labelNearOffset, (fromPosition + toPosition) / 2f - axisLabelSize.Height / 2f);
+ labelFarOffset = (float)Math.Max(labelFarOffset, (fromPosition + toPosition) / 2f + axisLabelSize.Height / 2f);
+ }
+ else
+ {
+ resultSize = Math.Max(resultSize, axisLabelSize.Width);
+ resultRotatedSize = Math.Max(resultRotatedSize, width);
+
+ // Calculate the over hang of labels on the side
+ if (angle > 0)
+ {
+ labelFarOffset = (float)Math.Max(labelFarOffset, (fromPosition + toPosition) / 2f + height * 1.1f);
+ }
+ else
+ {
+ labelNearOffset = (float)Math.Min(labelNearOffset, (fromPosition + toPosition) / 2f - height * 1.1f);
+ }
+ }
+ }
+
+ // Check if we exceed the maximum value
+ if (resultSize > maxLabelSize)
+ {
+ resultSize = maxLabelSize;
+ }
+ }
+ }
+ }
+
+ // Adjust results if labels are displayed with offset
+ if ((autoLabelOffset == -1) ? this.LabelStyle.IsStaggered : (autoLabelOffset == 1))
+ {
+ resultSize *= 2F;
+ resultRotatedSize *= 2F;
+
+ // Check if we exceed the maximum value
+ if (resultSize > maxLabelSize)
+ {
+ resultSize = maxLabelSize;
+ resultRotatedSize = maxLabelSize;
+ }
+ }
+
+ // Adjust labels size for the 3D Common.Chart
+ if (ChartArea.Area3DStyle.Enable3D && !ChartArea.chartAreaIsCurcular)
+ {
+ // Increase labels size
+ resultSize *= 1.1f;
+ resultRotatedSize *= 1.1f;
+ }
+
+ return resultRotatedSize;
+ }
+
+ /// <summary>
+ /// Gets total size of all grouping labels.
+ /// </summary>
+ /// <returns>Total size of all grouping labels.</returns>
+ internal float GetGroupLablesToatalSize()
+ {
+ float size = 0f;
+ if (this.groupingLabelSizes != null && this.groupingLabelSizes.Length > 0)
+ {
+ foreach (float val in this.groupingLabelSizes)
+ {
+ size += val;
+ }
+ }
+
+ return size;
+ }
+
+ /// <summary>
+ /// Gets number of levels of the grouping labels.
+ /// </summary>
+ /// <returns>Number of levels of the grouping labels.</returns>
+ internal int GetGroupLabelLevelCount()
+ {
+ int groupLabelLevel = 0;
+ foreach (CustomLabel label in this.CustomLabels)
+ {
+ if (label.RowIndex > 0)
+ {
+ groupLabelLevel = Math.Max(groupLabelLevel, label.RowIndex);
+ }
+ }
+
+ return groupLabelLevel;
+ }
+
+ /// <summary>
+ /// Calculates the best size for axis labels for all rows except first one (grouping labels).
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics object.</param>
+ /// <param name="maxLabelSize">Maximum labels area size.</param>
+ /// <returns>Array of grouping label sizes for each level.</returns>
+ private float[] GetRequiredGroupLabelSize(ChartGraphics chartGraph, float maxLabelSize)
+ {
+ float[] resultSize = null;
+
+ // Get number of groups
+ int groupLabelLevelCount = GetGroupLabelLevelCount();
+
+ // Check ig grouping labels exist
+ if (groupLabelLevelCount > 0)
+ {
+ // Create result array
+ resultSize = new float[groupLabelLevelCount];
+
+ // Loop through each level of grouping labels
+ for (int groupLevelIndex = 1; groupLevelIndex <= groupLabelLevelCount; groupLevelIndex++)
+ {
+ resultSize[groupLevelIndex - 1] = 0f;
+
+ // Loop through all labels in the level
+ foreach (CustomLabel label in this.CustomLabels)
+ {
+ // Skip if label middle point is outside current scaleView
+ if (label.RowIndex == 0)
+ {
+ double middlePoint = (label.FromPosition + label.ToPosition) / 2.0;
+ if (middlePoint < this.ViewMinimum || middlePoint > this.ViewMaximum)
+ {
+ continue;
+ }
+ }
+
+ if (label.RowIndex == groupLevelIndex)
+ {
+ // Measure label text size
+ SizeF axisLabelSize = chartGraph.MeasureStringRel(label.Text.Replace("\\n", "\n"), (autoLabelFont != null) ? autoLabelFont : this.LabelStyle.Font);
+ axisLabelSize.Width = (float)Math.Ceiling(axisLabelSize.Width);
+ axisLabelSize.Height = (float)Math.Ceiling(axisLabelSize.Height);
+
+
+ // Add image size
+ if(label.Image.Length > 0)
+ {
+ SizeF imageAbsSize = new SizeF();
+
+ if(this.Common.ImageLoader.GetAdjustedImageSize(label.Image, chartGraph.Graphics, ref imageAbsSize))
+ {
+ SizeF imageRelSize = chartGraph.GetRelativeSize(imageAbsSize);
+ axisLabelSize.Width += imageRelSize.Width;
+ axisLabelSize.Height = Math.Max(axisLabelSize.Height, imageRelSize.Height);
+ }
+ }
+
+ // Add extra spacing for the box marking of the label
+ if(label.LabelMark == LabelMarkStyle.Box)
+ {
+ // Get relative size from pixels and add it to the label size
+ SizeF spacerSize = chartGraph.GetRelativeSize(new SizeF(4, 4));
+ axisLabelSize.Width += spacerSize.Width;
+ axisLabelSize.Height += spacerSize.Height;
+ }
+
+
+
+ // If axis is horizontal
+ if (this.AxisPosition == AxisPosition.Bottom || this.AxisPosition == AxisPosition.Top)
+ {
+ resultSize[groupLevelIndex - 1] = Math.Max(resultSize[groupLevelIndex - 1], axisLabelSize.Height);
+ }
+ // If axis is vertical
+ else
+ {
+ axisLabelSize.Width = chartGraph.GetAbsoluteSize(new SizeF(axisLabelSize.Height, axisLabelSize.Height)).Height;
+ axisLabelSize.Width = chartGraph.GetRelativeSize(new SizeF(axisLabelSize.Width, axisLabelSize.Width)).Width;
+ resultSize[groupLevelIndex - 1] = Math.Max(resultSize[groupLevelIndex - 1], axisLabelSize.Width);
+ }
+
+ // Check if we exceed the maximum value
+ if (resultSize[groupLevelIndex - 1] > maxLabelSize / groupLabelLevelCount)
+ {
+ // NOTE: Group Labels size limitations are removed !!!
+ // resultSize[groupLevelIndex - 1] = maxLabelSize / groupLabelLevelCount;
+ // break;
+ }
+ }
+ }
+ }
+ }
+
+ return resultSize;
+ }
+
+ #endregion
+
+ #region Axis helper methods
+
+
+ /// <summary>
+ /// Gets main or sub axis associated with this axis.
+ /// </summary>
+ /// <param name="subAxisName">Sub axis name or empty string to get the main axis.</param>
+ /// <returns>Main or sub axis of the main axis.</returns>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "subAxisName")]
+ internal Axis GetSubAxis(string subAxisName)
+ {
+#if SUBAXES
+ if(!this.IsSubAxis && subAxisName.Length > 0)
+ {
+ SubAxis subAxis = this.SubAxes.FindByName(subAxisName);
+ if(subAxis == null)
+ {
+ throw(new InvalidOperationException( SR.ExceptionSubAxisNameNotFoundShort( subAxisName )));
+ }
+ return subAxis;
+ }
+#endif // SUBAXES
+ return this;
+ }
+
+ /// <summary>
+ /// Checks if axis marks should be next to the axis
+ /// </summary>
+ /// <returns>true if marks are next to axis.</returns>
+ internal bool GetIsMarksNextToAxis()
+ {
+ if (ChartArea != null && ChartArea.chartAreaIsCurcular)
+ {
+ return true;
+ }
+ return this.IsMarksNextToAxis;
+ }
+
+ /// <summary>
+ /// Gets axis auto interval type.
+ /// </summary>
+ /// <returns>Axis interval type.</returns>
+ internal DateTimeIntervalType GetAxisIntervalType()
+ {
+ if(InternalIntervalType == DateTimeIntervalType.Auto)
+ {
+ if(GetAxisValuesType() == ChartValueType.DateTime ||
+ GetAxisValuesType() == ChartValueType.Date ||
+ GetAxisValuesType() == ChartValueType.Time ||
+ GetAxisValuesType() == ChartValueType.DateTimeOffset)
+ {
+ return DateTimeIntervalType.Years;
+ }
+
+ return DateTimeIntervalType.Number;
+ }
+
+ return InternalIntervalType;
+ }
+
+ /// <summary>
+ /// Gets axis values type depending on the series attached
+ /// </summary>
+ /// <returns>Axis values type.</returns>
+ internal ChartValueType GetAxisValuesType()
+ {
+ ChartValueType type = ChartValueType.Double;
+
+ // Check all series in this Common.Chart area attached to this axis
+ if (this.Common != null && this.Common.DataManager.Series != null && ChartArea != null)
+ {
+ foreach (Series series in this.Common.DataManager.Series)
+ {
+ bool seriesAttached = false;
+
+ // Check series name
+ if (series.ChartArea == ChartArea.Name && series.IsVisible())
+ {
+ // Check if axis type of series match
+ if (this.axisType == AxisName.X && series.XAxisType == AxisType.Primary)
+ {
+#if SUBAXES
+ if(((Axis)this).SubAxisName == series.XSubAxisName)
+#endif // SUBAXES
+ {
+ seriesAttached = true;
+ }
+ }
+ else if (this.axisType == AxisName.X2 && series.XAxisType == AxisType.Secondary)
+ {
+#if SUBAXES
+ if(((Axis)this).SubAxisName == series.XSubAxisName)
+#endif // SUBAXES
+ {
+ seriesAttached = true;
+ }
+ }
+ else if (this.axisType == AxisName.Y && series.YAxisType == AxisType.Primary)
+ {
+#if SUBAXES
+ if(((Axis)this).SubAxisName == series.YSubAxisName)
+#endif // SUBAXES
+ {
+ seriesAttached = true;
+ }
+ }
+ else if (this.axisType == AxisName.Y2 && series.YAxisType == AxisType.Secondary)
+ {
+#if SUBAXES
+ if(((Axis)this).SubAxisName == series.YSubAxisName)
+#endif // SUBAXES
+ {
+ seriesAttached = true;
+ }
+ }
+ }
+
+ // If series attached to this axes
+ if (seriesAttached)
+ {
+ if (this.axisType == AxisName.X || this.axisType == AxisName.X2)
+ {
+ type = series.XValueType;
+ }
+ else if (this.axisType == AxisName.Y || this.axisType == AxisName.Y2)
+ {
+ type = series.YValueType;
+ }
+ break;
+ }
+ }
+ }
+ return type;
+ }
+
+ /// <summary>
+ /// Returns Arrow size
+ /// </summary>
+ /// <param name="arrowOrientation">Return arrow orientation.</param>
+ /// <returns>Size of arrow</returns>
+ internal SizeF GetArrowSize(out ArrowOrientation arrowOrientation)
+ {
+ Axis opositeAxis;
+ double size;
+ double sizeOpposite;
+ arrowOrientation = ArrowOrientation.Top;
+
+ // Set the position of axis
+ switch (AxisPosition)
+ {
+ case AxisPosition.Left:
+
+ if (isReversed)
+ arrowOrientation = ArrowOrientation.Bottom;
+ else
+ arrowOrientation = ArrowOrientation.Top;
+
+ break;
+ case AxisPosition.Right:
+
+ if (isReversed)
+ arrowOrientation = ArrowOrientation.Bottom;
+ else
+ arrowOrientation = ArrowOrientation.Top;
+
+ break;
+ case AxisPosition.Bottom:
+
+ if (isReversed)
+ arrowOrientation = ArrowOrientation.Left;
+ else
+ arrowOrientation = ArrowOrientation.Right;
+
+ break;
+ case AxisPosition.Top:
+
+ if (isReversed)
+ arrowOrientation = ArrowOrientation.Left;
+ else
+ arrowOrientation = ArrowOrientation.Right;
+
+ break;
+ }
+
+ // Opposite axis. Arrow uses this axis to find
+ // a shift from Common.Chart area border. This shift
+ // depend on Tick mark size.
+ switch (arrowOrientation)
+ {
+ case ArrowOrientation.Left:
+ opositeAxis = ChartArea.AxisX;
+ break;
+ case ArrowOrientation.Right:
+ opositeAxis = ChartArea.AxisX2;
+ break;
+ case ArrowOrientation.Top:
+ opositeAxis = ChartArea.AxisY2;
+ break;
+ case ArrowOrientation.Bottom:
+ opositeAxis = ChartArea.AxisY;
+ break;
+ default:
+ opositeAxis = ChartArea.AxisX;
+ break;
+ }
+
+ // Arrow size has to have the same shape when width and height
+ // are changed. When the picture is resized, width of the Common.Chart
+ // picture is used only for arrow size.
+ if (arrowOrientation == ArrowOrientation.Top || arrowOrientation == ArrowOrientation.Bottom)
+ {
+ size = _lineWidth;
+ sizeOpposite = (double)(_lineWidth) * Common.Width / Common.Height;
+ }
+ else
+ {
+ size = (double)(_lineWidth) * Common.Width / Common.Height;
+ sizeOpposite = _lineWidth;
+ }
+
+ // Arrow is sharp triangle
+ if (_arrowStyle == AxisArrowStyle.SharpTriangle)
+ {
+ // Arrow direction is vertical
+ if (arrowOrientation == ArrowOrientation.Top || arrowOrientation == ArrowOrientation.Bottom)
+ return new SizeF((float)(size * 2), (float)(opositeAxis.MajorTickMark.Size + sizeOpposite * 4));
+ else
+ // Arrow direction is horizontal
+ return new SizeF((float)(opositeAxis.MajorTickMark.Size + sizeOpposite * 4), (float)(size * 2));
+ }
+ // There is no arrow
+ else if (_arrowStyle == AxisArrowStyle.None)
+ return new SizeF(0, 0);
+ else// Arrow is triangle or line type
+ {
+ // Arrow direction is vertical
+ if (arrowOrientation == ArrowOrientation.Top || arrowOrientation == ArrowOrientation.Bottom)
+ return new SizeF((float)(size * 2), (float)(opositeAxis.MajorTickMark.Size + sizeOpposite * 2));
+ else
+ // Arrow direction is horizontal
+ return new SizeF((float)(opositeAxis.MajorTickMark.Size + sizeOpposite * 2), (float)(size * 2));
+ }
+ }
+
+
+ /// <summary>
+ /// Checks if arrow with specified orientation will require space
+ /// in axis with specified position
+ /// </summary>
+ /// <param name="arrowOrientation">Arrow orientation.</param>
+ /// <param name="axisPosition">Axis position.</param>
+ /// <returns>True if arrow will be drawn in axis space</returns>
+ private bool IsArrowInAxis(ArrowOrientation arrowOrientation, AxisPosition axisPosition)
+ {
+ if (axisPosition == AxisPosition.Top && arrowOrientation == ArrowOrientation.Top)
+ return true;
+ else if (axisPosition == AxisPosition.Bottom && arrowOrientation == ArrowOrientation.Bottom)
+ return true;
+ if (axisPosition == AxisPosition.Left && arrowOrientation == ArrowOrientation.Left)
+ return true;
+ else if (axisPosition == AxisPosition.Right && arrowOrientation == ArrowOrientation.Right)
+ return true;
+
+ return false;
+ }
+
+
+ /// <summary>
+ /// This function converts real Interval to
+ /// absolute Interval
+ /// </summary>
+ /// <param name="realInterval">A interval represented as double value</param>
+ /// <returns>A interval represented in pixels</returns>
+ internal float GetPixelInterval(double realInterval)
+ {
+ double chartAreaSize;
+
+ // The Chart area pixel size as double
+ if (AxisPosition == AxisPosition.Top || AxisPosition == AxisPosition.Bottom)
+ {
+ chartAreaSize = PlotAreaPosition.Right - PlotAreaPosition.X;
+ }
+ else
+ {
+ chartAreaSize = PlotAreaPosition.Bottom - PlotAreaPosition.Y;
+ }
+
+ // Avoid division by zero.
+ if (ViewMaximum - ViewMinimum == 0)
+ {
+ return (float)(chartAreaSize / realInterval);
+ }
+
+ // The interval integer
+ return (float)(chartAreaSize / (ViewMaximum - ViewMinimum) * realInterval);
+ }
+
+ /// <summary>
+ /// Find if axis is on the edge of the Common.Chart plot area
+ /// </summary>
+ internal bool IsAxisOnAreaEdge
+ {
+ get
+ {
+ double edgePosition = 0;
+ if (this.AxisPosition == AxisPosition.Bottom)
+ {
+ edgePosition = PlotAreaPosition.Bottom;
+ }
+ else if (this.AxisPosition == AxisPosition.Left)
+ {
+ edgePosition = PlotAreaPosition.X;
+ }
+ else if (this.AxisPosition == AxisPosition.Right)
+ {
+ edgePosition = PlotAreaPosition.Right;
+ }
+ else if (this.AxisPosition == AxisPosition.Top)
+ {
+ edgePosition = PlotAreaPosition.Y;
+ }
+
+ // DT Fix : problems with values on edge ~0.0005
+ if (Math.Abs(GetAxisPosition() - edgePosition) < 0.0015)
+ {
+ return true;
+ }
+
+ return false;
+ }
+ }
+
+ /// <summary>
+ /// Find axis position using crossing value.
+ /// </summary>
+ /// <returns>Relative position</returns>
+ internal double GetAxisPosition()
+ {
+ return GetAxisPosition(false);
+ }
+
+ /// <summary>
+ /// Find axis position using crossing value.
+ /// </summary>
+ /// <param name="ignoreCrossing">Axis crossing should be ignored.</param>
+ /// <returns>Relative position</returns>
+ virtual internal double GetAxisPosition(bool ignoreCrossing)
+ {
+ Axis axisOpposite = GetOppositeAxis();
+
+ // Get axis position for circular Common.Chart area
+ if (ChartArea != null && ChartArea.chartAreaIsCurcular)
+ {
+ return PlotAreaPosition.X + PlotAreaPosition.Width / 2f;
+ }
+
+ // Axis is not connected with any series. There is no maximum and minimum
+ if (axisOpposite.maximum == axisOpposite.minimum ||
+ double.IsNaN(axisOpposite.maximum) ||
+ double.IsNaN(axisOpposite.minimum) ||
+ maximum == minimum ||
+ double.IsNaN(maximum) ||
+ double.IsNaN(minimum))
+ {
+ switch (AxisPosition)
+ {
+ case AxisPosition.Top:
+ return PlotAreaPosition.Y;
+ case AxisPosition.Bottom:
+ return PlotAreaPosition.Bottom;
+ case AxisPosition.Right:
+ return PlotAreaPosition.Right;
+ case AxisPosition.Left:
+ return PlotAreaPosition.X;
+ }
+ }
+
+ // Auto crossing enabled
+ if (Double.IsNaN(axisOpposite.crossing) || ignoreCrossing)
+ {
+ // Primary
+ if (axisType == AxisName.X || axisType == AxisName.Y)
+ return axisOpposite.GetLinearPosition(axisOpposite.ViewMinimum);
+ else // Secondary
+ return axisOpposite.GetLinearPosition(axisOpposite.ViewMaximum);
+ }
+ else // Auto crossing disabled
+ {
+ axisOpposite.crossing = axisOpposite.tempCrossing;
+
+ if (axisOpposite.crossing < axisOpposite.ViewMinimum)
+ {
+ axisOpposite.crossing = axisOpposite.ViewMinimum;
+ }
+ else if (axisOpposite.crossing > axisOpposite.ViewMaximum)
+ {
+ axisOpposite.crossing = axisOpposite.ViewMaximum;
+ }
+ }
+
+ return axisOpposite.GetLinearPosition(axisOpposite.crossing);
+ }
+
+ #endregion
+
+ #region Axis 3D helper methods
+
+ /// <summary>
+ /// Returns angle between 2D axis line and it's 3D transformed projection.
+ /// </summary>
+ /// <returns>Axis projection angle.</returns>
+ internal double GetAxisProjectionAngle()
+ {
+ // Get Z position
+ bool axisOnEdge;
+ float zPosition = GetMarksZPosition(out axisOnEdge);
+
+ // Get axis position
+ float axisPosition = (float)GetAxisPosition();
+
+ // Create two points on the sides of the axis
+ Point3D[] axisPoints = new Point3D[2];
+ if (this.AxisPosition == AxisPosition.Top || this.AxisPosition == AxisPosition.Bottom)
+ {
+ axisPoints[0] = new Point3D(0f, axisPosition, zPosition);
+ axisPoints[1] = new Point3D(100f, axisPosition, zPosition);
+ }
+ else
+ {
+ axisPoints[0] = new Point3D(axisPosition, 0f, zPosition);
+ axisPoints[1] = new Point3D(axisPosition, 100f, zPosition);
+ }
+
+ // Transform coordinates
+ ChartArea.matrix3D.TransformPoints(axisPoints);
+
+ // Round result
+ axisPoints[0].X = (float)Math.Round(axisPoints[0].X, 4);
+ axisPoints[0].Y = (float)Math.Round(axisPoints[0].Y, 4);
+ axisPoints[1].X = (float)Math.Round(axisPoints[1].X, 4);
+ axisPoints[1].Y = (float)Math.Round(axisPoints[1].Y, 4);
+
+ // Calculate angle
+ double angle = 0.0;
+ if (this.AxisPosition == AxisPosition.Top || this.AxisPosition == AxisPosition.Bottom)
+ {
+ angle = Math.Atan((axisPoints[1].Y - axisPoints[0].Y) / (axisPoints[1].X - axisPoints[0].X));
+ }
+ else
+ {
+ angle = Math.Atan((axisPoints[1].X - axisPoints[0].X) / (axisPoints[1].Y - axisPoints[0].Y));
+ }
+
+ // Conver to degrees
+ return (angle * 180.0) / Math.PI;
+ }
+
+ #endregion
+
+ #region IDisposable Members
+
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ if (_fontCache != null)
+ {
+ _fontCache.Dispose();
+ _fontCache = null;
+ }
+
+ if (labelStyle != null)
+ {
+ labelStyle.Dispose();
+ labelStyle = null;
+ }
+
+ if (_stripLines != null)
+ {
+ _stripLines.Dispose();
+ _stripLines = null;
+ }
+ if (_customLabels != null)
+ {
+ _customLabels.Dispose();
+ _customLabels = null;
+ }
+ if (tempLabels != null)
+ {
+ tempLabels.Dispose();
+ tempLabels = null;
+ }
+#if Microsoft_CONTROL
+ if (this.scrollBar != null)
+ {
+ this.scrollBar.Dispose();
+ this.scrollBar = null;
+ }
+#endif // Microsoft_CONTROL
+ }
+ base.Dispose(disposing);
+ }
+
+
+ #endregion
+
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/AxisLabels.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/AxisLabels.cs
new file mode 100644
index 00000000000..859de283dbe
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/AxisLabels.cs
@@ -0,0 +1,941 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: AxisLabels.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: AxisLabels
+//
+// Purpose: Base class for the Axis class which defines axis
+// labels related properties and methods.
+//
+// Reviewed: GS - August 8, 2002
+// AG - August 8, 2002
+//
+//===================================================================
+
+#region Used namespaces
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Drawing2D;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+ using System.Windows.Forms.DataVisualization.Charting;
+#else
+ using System.Web;
+ using System.Web.UI;
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ /// <summary>
+ /// The Axis class provides functionality for
+ /// drawing axis labels.
+ /// </summary>
+ public partial class Axis
+ {
+ #region Fields
+
+ // Custom Labels collection
+ private CustomLabelsCollection _customLabels = null;
+
+ #endregion
+
+ #region Axis labels properties
+
+ /// <summary>
+ /// Gets or sets the style of the label.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeLabels"),
+ Bindable(true),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeLabelStyle"),
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ TypeConverter(typeof(NoNameExpandableObjectConverter))
+ ]
+ public LabelStyle LabelStyle
+ {
+ get
+ {
+ return labelStyle;
+ }
+ set
+ {
+ labelStyle = value;
+ labelStyle.Axis = (Axis)this;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets a collection of custom labels.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeLabels"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeCustomLabels"),
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ Editor(Editors.ChartCollectionEditor.Editor, Editors.ChartCollectionEditor.Base)
+ ]
+ public CustomLabelsCollection CustomLabels
+ {
+ get
+ {
+ return _customLabels;
+ }
+ }
+
+ #endregion
+
+ #region Axis labels methods
+
+ /// <summary>
+ /// Indicates that custom grid lines should be painted.
+ /// </summary>
+ /// <returns>Indicates that custom grid lines should be painted.</returns>
+ internal bool IsCustomGridLines()
+ {
+ if(this.CustomLabels.Count > 0)
+ {
+ // Check if at least one custom label has a flag set
+ foreach(CustomLabel label in this.CustomLabels)
+ {
+ if((label.GridTicks & GridTickTypes.Gridline) == GridTickTypes.Gridline)
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /// <summary>
+ /// Indicates that custom tick marks should be painted.
+ /// </summary>
+ /// <returns>Indicates that custom tick marks should be painted.</returns>
+ internal bool IsCustomTickMarks()
+ {
+ if(this.CustomLabels.Count > 0)
+ {
+ // Check if at least one custom label has a flag set
+ foreach(CustomLabel label in this.CustomLabels)
+ {
+ if((label.GridTicks & GridTickTypes.TickMark) == GridTickTypes.TickMark)
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /// <summary>
+ /// Gets the type of the axis.
+ /// </summary>
+ /// <value>The type of the axis.</value>
+ internal AxisType GetAxisType()
+ {
+ if (this.axisType == AxisName.X || this.axisType == AxisName.Y)
+ {
+ return AxisType.Primary;
+ }
+ else
+ {
+ return AxisType.Secondary;
+ }
+ }
+
+ /// <summary>
+ /// Gets the axis series.
+ /// </summary>
+ /// <returns></returns>
+ internal ArrayList GetAxisSeries()
+ {
+ ArrayList dataSeries = new ArrayList();
+
+ // check for attached series.
+ foreach (string seriesName in this.ChartArea.Series)
+ {
+ Series series = this.Common.DataManager.Series[seriesName];
+ if (this.axisType == AxisName.X || this.axisType == AxisName.X2)
+ {
+ if (series.XAxisType == this.GetAxisType())
+ {
+ dataSeries.Add(series);
+ }
+ }
+ else
+ {
+ if (series.YAxisType == this.GetAxisType())
+ {
+ dataSeries.Add(series);
+ }
+ }
+ }
+ return dataSeries;
+ }
+
+ /// <summary>
+ /// Gets the other (primary/secondary) axis.
+ /// </summary>
+ /// <returns></returns>
+ internal Axis GetOtherTypeAxis()
+ {
+ return ChartArea.GetAxis(
+ this.axisType,
+ this.GetAxisType() == AxisType.Primary ? AxisType.Secondary : AxisType.Primary,
+ String.Empty
+ );
+ }
+
+ /// <summary>
+ /// Checks if the other (primary/secondary) axis has custom labels labels.
+ /// These labels will be added if this axis has no series attached and no custom labels.
+ /// This works only on category axes.
+ /// </summary>
+ internal void PostFillLabels()
+ {
+ foreach (CustomLabel label in this.CustomLabels)
+ {
+ if (label.customLabel)
+ {
+ return;
+ }
+ }
+
+ // Labels are disabled for this axis
+ if (
+ !this.LabelStyle.Enabled ||
+ !this.enabled ||
+ !String.IsNullOrEmpty(((Axis)this).SubAxisName) ||
+ this.axisType == AxisName.Y ||
+ this.axisType == AxisName.Y2
+ )
+ {
+ return;
+ }
+
+ // check if no series attached.
+ if (this.GetAxisSeries().Count > 0)
+ {
+ return;
+ }
+ this.CustomLabels.Clear();
+ foreach (CustomLabel label in this.GetOtherTypeAxis().CustomLabels)
+ {
+ this.CustomLabels.Add(label.Clone());
+ }
+ }
+
+ /// <summary>
+ /// Fill labels from data from data manager or
+ /// from axis scale.
+ /// </summary>
+ /// <param name="removeFirstRow">True if first row of auto generated labels must be removed.</param>
+ internal void FillLabels(bool removeFirstRow)
+ {
+#if SUBAXES
+ // Process all sub-axis
+ foreach(SubAxis subAxis in ((Axis)this).SubAxes)
+ {
+ subAxis.FillLabels(true);
+ }
+#endif // SUBAXES
+
+ // Labels are disabled for this axis
+ if( !this.LabelStyle.Enabled || !this.enabled )
+ {
+ return;
+ }
+
+ // For circular chart area fill only Y axis labels
+ if(this.ChartArea != null && this.ChartArea.chartAreaIsCurcular)
+ {
+ if(this.axisType != AxisName.Y)
+ {
+ ICircularChartType type = this.ChartArea.GetCircularChartType();
+ if(type == null || !type.XAxisLabelsSupported())
+ {
+ return;
+ }
+ }
+ }
+
+ // Check if the custom labels exist
+ bool customLabelsFlag = false;
+ foreach( CustomLabel lab in CustomLabels )
+ {
+ if( lab.customLabel )
+ {
+ if( lab.RowIndex == 0 ||
+ this.ChartArea.chartAreaIsCurcular)
+ {
+ customLabelsFlag = true;
+ }
+ }
+ }
+
+
+ // Remove the first row of labels if custom labels not exist
+ if(removeFirstRow)
+ {
+ if( customLabelsFlag == false )
+ {
+ for( int index = 0; index < CustomLabels.Count; index++ )
+ {
+ if( CustomLabels[index].RowIndex == 0 )
+ {
+ CustomLabels.RemoveAt( index );
+ index = -1;
+ }
+ }
+ }
+ else
+ {
+ return;
+ }
+ }
+
+ // Get data series for this axis.
+ List<string> dataSeries = null;
+ switch( axisType )
+ {
+ case AxisName.X:
+ dataSeries = ChartArea.GetXAxesSeries( AxisType.Primary, ((Axis)this).SubAxisName );
+ break;
+ case AxisName.Y:
+ dataSeries = ChartArea.GetYAxesSeries( AxisType.Primary, ((Axis)this).SubAxisName );
+ break;
+ case AxisName.X2:
+ dataSeries = ChartArea.GetXAxesSeries( AxisType.Secondary, ((Axis)this).SubAxisName );
+ break;
+ case AxisName.Y2:
+ dataSeries = ChartArea.GetYAxesSeries( AxisType.Secondary, ((Axis)this).SubAxisName );
+ break;
+ }
+
+ // There aren't data series connected with this axis.
+ if( dataSeries.Count == 0 )
+ {
+ return;
+ }
+
+ //Let's convert the ArrayList of the series names into to string[]
+ string[] dataSeriesNames = new string[dataSeries.Count];
+ for (int i = 0; i < dataSeries.Count; i++)
+ dataSeriesNames[i] = (string)dataSeries[i];
+
+ // Check if series X values all set to zeros
+ bool seriesXValuesZeros = ChartHelper.SeriesXValuesZeros(this.Common, dataSeriesNames);
+
+ // Check if series is indexed (All X values zeros or IsXValueIndexed flag set)
+ bool indexedSeries = true;
+ if (!seriesXValuesZeros)
+ {
+ indexedSeries = ChartHelper.IndexedSeries(this.Common, dataSeriesNames);
+ }
+
+ // Show End Labels
+ int endLabels = 0;
+ if( labelStyle.IsEndLabelVisible )
+ {
+ endLabels = 1;
+ }
+
+ // Get chart type of the first series
+ IChartType chartType = Common.ChartTypeRegistry.GetChartType( ChartArea.GetFirstSeries().ChartTypeName );
+ bool fromSeries = false;
+ if( !chartType.RequireAxes )
+ {
+ return;
+ }
+ else if( axisType == AxisName.Y || axisType == AxisName.Y2 )
+ {
+ fromSeries = false;
+ }
+ else
+ {
+ fromSeries = true;
+ }
+
+ // X values from data points are not 0.
+ if (fromSeries && !ChartHelper.SeriesXValuesZeros(this.Common, dataSeries.ToArray()))
+ {
+ fromSeries = false;
+ }
+
+ // X values from data points are not 0.
+ if( fromSeries && ( labelStyle.GetIntervalOffset() != 0 || labelStyle.GetInterval() != 0 ) )
+ {
+ fromSeries = false;
+ }
+
+ // Get value type
+ ChartValueType valueType;
+ if( axisType == AxisName.X || axisType == AxisName.X2 )
+ {
+ // If X value is indexed the type is always String. So we use indexed type instead
+ valueType = Common.DataManager.Series[dataSeries[0]].indexedXValueType;
+ }
+ else
+ {
+ valueType = Common.DataManager.Series[dataSeries[0]].YValueType;
+ }
+
+ if( labelStyle.GetIntervalType() != DateTimeIntervalType.Auto &&
+ labelStyle.GetIntervalType() != DateTimeIntervalType.Number )
+ {
+ if (valueType != ChartValueType.Time &&
+ valueType != ChartValueType.Date &&
+ valueType != ChartValueType.DateTimeOffset)
+ {
+ valueType = ChartValueType.DateTime;
+ }
+ }
+
+ // ***********************************
+ // Pre calculate some values
+ // ***********************************
+ double viewMaximum = this.ViewMaximum;
+ double viewMinimum = this.ViewMinimum;
+
+ // ***********************************
+ // Labels are filled from data series.
+ // ***********************************
+ if( fromSeries )
+ {
+ int numOfPoints;
+ numOfPoints = Common.DataManager.GetNumberOfPoints( dataSeries.ToArray() );
+
+ // Show end labels
+ if( endLabels == 1 )
+ {
+ // min position
+ CustomLabels.Add( - 0.5, 0.5, ValueConverter.FormatValue(
+ this.Common.Chart,
+ this,
+ null,
+ 0.0,
+ this.LabelStyle.Format,
+ valueType,
+ ChartElementType.AxisLabels),
+ false);
+ }
+
+ // Labels from point position
+ for( int point = 0; point < numOfPoints; point++ )
+ {
+ CustomLabels.Add( ((double)point)+ 0.5, ((double)point)+ 1.5,
+ ValueConverter.FormatValue(
+ this.Common.Chart,
+ this,
+ null,
+ point + 1,
+ this.LabelStyle.Format,
+ valueType,
+ ChartElementType.AxisLabels),
+ false);
+ }
+
+ // Show end labels
+ if( endLabels == 1 )
+ {
+ // max position
+ CustomLabels.Add( ((double)numOfPoints)+ 0.5, ((double)numOfPoints)+ 1.5,
+ ValueConverter.FormatValue(
+ this.Common.Chart,
+ this,
+ null,
+ numOfPoints + 1,
+ this.LabelStyle.Format,
+ valueType,
+ ChartElementType.AxisLabels),
+ false);
+ }
+
+ int pointIndx;
+ foreach( string seriesIndx in dataSeries )
+ {
+ // End labels enabled
+ if( endLabels == 1 )
+ pointIndx = 1;
+ else
+ pointIndx = 0;
+
+ // Set labels from data points labels
+ foreach( DataPoint dataPoint in Common.DataManager.Series[ seriesIndx ].Points )
+ {
+ // Find first row of labels
+ while( CustomLabels[pointIndx].RowIndex > 0 )
+ {
+ pointIndx++;
+ }
+
+ // Add X labels
+ if( axisType == AxisName.X || axisType == AxisName.X2 )
+ {
+ if( dataPoint.AxisLabel.Length > 0 )
+ {
+ CustomLabels[pointIndx].Text = dataPoint.AxisLabel;
+ }
+ }
+
+ pointIndx++;
+ }
+ }
+ }
+ // ***********************************
+ // Labels are filled from axis scale.
+ // ***********************************
+ else
+ {
+ if( viewMinimum == viewMaximum )
+ return;
+
+ double labValue; // Value, which will be converted to text and used for, labels.
+ double beginPosition; // Begin position for a label
+ double endPosition; // End position for a label
+ double start; // Start position for all labels
+
+ // Get first series attached to this axis
+ Series axisSeries = null;
+ if(axisType == AxisName.X || axisType == AxisName.X2)
+ {
+ List<string> seriesArray = ChartArea.GetXAxesSeries((axisType == AxisName.X) ? AxisType.Primary : AxisType.Secondary, ((Axis)this).SubAxisName);
+ if(seriesArray.Count > 0)
+ {
+ axisSeries = Common.DataManager.Series[seriesArray[0]];
+ if(axisSeries != null && !axisSeries.IsXValueIndexed)
+ {
+ axisSeries = null;
+ }
+ }
+ }
+
+ // ***********************************
+ // Check if the AJAX zooming and scrolling mode is enabled.
+ // Labels are filled slightly different in this case.
+ // ***********************************
+ DateTimeIntervalType offsetType = (labelStyle.GetIntervalOffsetType() == DateTimeIntervalType.Auto) ? labelStyle.GetIntervalType() : labelStyle.GetIntervalOffsetType();
+
+ // By default start is equal to minimum
+ start = viewMinimum;
+
+ // Adjust start position depending on the interval type
+ if(!this.ChartArea.chartAreaIsCurcular ||
+ this.axisType == AxisName.Y ||
+ this.axisType == AxisName.Y2 )
+ {
+ start = ChartHelper.AlignIntervalStart(start, labelStyle.GetInterval(), labelStyle.GetIntervalType(), axisSeries);
+ }
+
+ // Move start if there is start position
+ if( labelStyle.GetIntervalOffset() != 0 && axisSeries == null)
+ {
+ start += ChartHelper.GetIntervalSize(start, labelStyle.GetIntervalOffset(),
+ offsetType, axisSeries, 0, DateTimeIntervalType.Number, true, false);
+ }
+
+ // ***************************************
+ // Date type
+ // ***************************************
+ if( valueType == ChartValueType.DateTime ||
+ valueType == ChartValueType.Date ||
+ valueType == ChartValueType.Time ||
+ valueType == ChartValueType.DateTimeOffset ||
+ axisSeries != null)
+ {
+ double position = start;
+ double dateInterval;
+
+ // Too many labels
+ if ((viewMaximum - start) / ChartHelper.GetIntervalSize(start, labelStyle.GetInterval(), labelStyle.GetIntervalType(), axisSeries, 0, DateTimeIntervalType.Number, true) > ChartHelper.MaxNumOfGridlines)
+ return;
+
+ int counter = 0;
+ double endLabelMaxPosition = viewMaximum - ChartHelper.GetIntervalSize(viewMaximum, labelStyle.GetInterval(), labelStyle.GetIntervalType(), axisSeries, labelStyle.GetIntervalOffset(), offsetType, true) / 2f;
+ double endLabelMinPosition = viewMinimum + ChartHelper.GetIntervalSize(viewMinimum, labelStyle.GetInterval(), labelStyle.GetIntervalType(), axisSeries, labelStyle.GetIntervalOffset(), offsetType, true) / 2f;
+ while( (decimal)position <= (decimal)viewMaximum )
+ {
+ dateInterval = ChartHelper.GetIntervalSize(position, labelStyle.GetInterval(), labelStyle.GetIntervalType(), axisSeries, labelStyle.GetIntervalOffset(), offsetType, true);
+ labValue = position;
+
+ // For IsLogarithmic axes
+ if( this.IsLogarithmic )
+ {
+ labValue = Math.Pow( this.logarithmBase, labValue );
+ }
+
+ // Check if we do not exceed max number of elements
+ if (counter++ > ChartHelper.MaxNumOfGridlines)
+ {
+ break;
+ }
+
+ if (endLabels == 0 && position >= endLabelMaxPosition)
+ {
+ break;
+ }
+
+ beginPosition = position - dateInterval * 0.5;
+ endPosition = position + dateInterval * 0.5;
+
+ if(endLabels == 0 && position <= endLabelMinPosition)
+ {
+ position += dateInterval;
+ continue;
+ }
+
+ if( (decimal)beginPosition > (decimal)viewMaximum )
+ {
+ position += dateInterval;
+ continue;
+ }
+
+ // NOTE: Fixes issue #6466
+ // Following code is removed due to the issues caused by the rounding error
+
+ //if( (((decimal)beginPosition + (decimal)endPosition) / 2.0m) < (decimal)viewMinimum )
+ //{
+ // position += dateInterval;
+ // continue;
+ //}
+ //if ((decimal)viewMaximum < (((decimal)beginPosition + (decimal)endPosition) / 2m))
+ //{
+ // position += dateInterval;
+ // continue;
+ //}
+
+ string pointLabel = GetPointLabel( dataSeries, labValue, !seriesXValuesZeros, indexedSeries );
+ if( pointLabel.Length == 0 )
+ {
+ // Do not draw last label for indexed series
+ if( position <= this.maximum )
+ {
+ // Add a label to the collection
+ if( position != this.maximum || !Common.DataManager.Series[ dataSeries[0] ].IsXValueIndexed )
+ {
+ CustomLabels.Add( beginPosition,
+ endPosition,
+ ValueConverter.FormatValue(
+ this.Common.Chart,
+ this,
+ null,
+ labValue,
+ this.LabelStyle.Format,
+ valueType,
+ ChartElementType.AxisLabels),
+ false);
+ }
+ }
+ }
+ else
+ {
+ // Add a label to the collection
+ CustomLabels.Add( beginPosition,
+ endPosition,
+ pointLabel,
+ false);
+ }
+ position += dateInterval;
+ }
+ }
+ else
+ {
+ // ***************************************
+ // Scale value type
+ // ***************************************
+
+ // Show First label if Start Label position is used
+ if( start != viewMinimum )
+ endLabels = 1;
+
+ // Set labels
+ int labelCounter = 0;
+ for (double position = start - endLabels * labelStyle.GetInterval(); position < viewMaximum - 1.5 * labelStyle.GetInterval() * (1 - endLabels); position = (double)((decimal)position + (decimal)labelStyle.GetInterval()))
+ {
+ // Prevent endless loop that may be caused by very small interval
+ // and double/decimal rounding errors
+ ++labelCounter;
+ if(labelCounter > ChartHelper.MaxNumOfGridlines)
+ {
+ break;
+ }
+
+ labValue = (double)((decimal)position + (decimal)labelStyle.GetInterval());
+
+ // This line is introduce because sometimes 0 value will appear as
+ // very small value close to zero.
+ double inter = Math.Log(labelStyle.GetInterval());
+ double valu = Math.Log(Math.Abs(labValue));
+ int digits = (int)Math.Abs(inter)+5;
+
+ if( digits > 15 )
+ {
+ digits = 15;
+ }
+
+ if( Math.Abs(inter) < Math.Abs(valu)-5 )
+ {
+ labValue = Math.Round(labValue,digits);
+ }
+
+ // Too many labels
+ if( ( viewMaximum - start ) / labelStyle.GetInterval() > ChartHelper.MaxNumOfGridlines )
+ {
+ return;
+ }
+
+ // For IsLogarithmic axes
+ if( this.IsLogarithmic )
+ labValue = Math.Pow( this.logarithmBase, labValue );
+
+ beginPosition = (double)((decimal)position + (decimal)labelStyle.GetInterval() * 0.5m);
+ endPosition = (double)((decimal)position + (decimal)labelStyle.GetInterval() * 1.5m);
+
+ if( (decimal)beginPosition > (decimal)viewMaximum )
+ {
+ continue;
+ }
+
+ // Show End label if Start Label position is used
+ // Use decimal type to solve rounding issues
+ if( (decimal)(( beginPosition + endPosition )/2.0) > (decimal)viewMaximum )
+ {
+ continue;
+ }
+
+ string pointLabel = GetPointLabel( dataSeries, labValue, !seriesXValuesZeros, indexedSeries );
+ if( pointLabel.Length > 15 && labValue < 0.000001)
+ {
+ labValue = 0.0;
+ }
+
+ if( pointLabel.Length == 0 )
+ {
+ // Do not draw last label for indexed series
+ if( !(Common.DataManager.Series[ dataSeries[0] ].IsXValueIndexed && position > this.maximum) )
+ {
+ // Add a label to the collection
+ CustomLabels.Add( beginPosition,
+ endPosition,
+ ValueConverter.FormatValue(
+ this.Common.Chart,
+ this,
+ null,
+ labValue,
+ this.LabelStyle.Format,
+ valueType,
+ ChartElementType.AxisLabels),
+ false);
+ }
+ }
+ else
+ {
+ // Add a label to the collection
+ CustomLabels.Add( beginPosition,
+ endPosition,
+ pointLabel,
+ false);
+ }
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// This method checks if there is a data point which has value X equal
+ /// to valuePosition, and returns label from data point if such value exist.
+ /// If data point with this value not exists empty string will be returned.
+ /// If all data points have X value zero, index is used instead of X value.
+ /// </summary>
+ /// <param name="series">Data series</param>
+ /// <param name="valuePosition">A value which should be found in data points x values</param>
+ /// <param name="nonZeroXValues">Series X values are not zeros.</param>
+ /// <param name="indexedSeries">Series is indexed. All X values are zeros or IsXValueIndexed flag set.</param>
+ /// <returns>LabelStyle</returns>
+ private string GetPointLabel(
+ List<string> series,
+ double valuePosition,
+ bool nonZeroXValues,
+ bool indexedSeries
+ )
+ {
+ // Get max number of data points in the series
+ int maxPointCount = 0;
+ foreach (string seriesName in series)
+ {
+ Series ser = Common.DataManager.Series[seriesName];
+ maxPointCount = Math.Max(maxPointCount, ser.Points.Count);
+ }
+
+ // Check if axis only contains axis abels
+ bool allEmpty = true;
+ foreach( string seriesName in series )
+ {
+ // Get series by name
+ Series ser = Common.DataManager.Series[ seriesName ];
+
+ // Check if series has axis labels set
+ if ((axisType == AxisName.X || axisType == AxisName.X2) && (margin != 0 || maxPointCount == 1 || !this._autoMinimum) && !ser.IsXValueIndexed)
+ {
+ if( ser.Points[ 0 ].AxisLabel.Length > 0 && ser.Points[ ser.Points.Count - 1 ].AxisLabel.Length > 0 )
+ {
+ allEmpty = false;
+ }
+ }
+
+ // Try getting label from the point
+ if(!ser.noLabelsInPoints || (nonZeroXValues && indexedSeries))
+ {
+ string result = GetPointLabel( ser, valuePosition, nonZeroXValues, indexedSeries );
+ if(!String.IsNullOrEmpty(result))
+ {
+ return result;
+ }
+ }
+
+ // VSTS 140676: Serach for IndexedSeriesLabelsSourceAttr attribute
+ // to find if we have indexed series as source of formula generated nonindexed series.
+ String labelSeriesName = ser[DataFormula.IndexedSeriesLabelsSourceAttr];
+ if (!String.IsNullOrEmpty(labelSeriesName))
+ {
+ Series labelsSeries = Common.DataManager.Series[labelSeriesName];
+ if (labelsSeries != null)
+ {
+ string result = GetPointLabel(labelsSeries, valuePosition, nonZeroXValues, true);
+ if (!String.IsNullOrEmpty(result))
+ {
+ return result;
+ }
+ }
+ }
+
+ }
+
+ if( !allEmpty )
+ {
+ return " ";
+ }
+ else
+ {
+ return "";
+ }
+ }
+
+ /// <summary>
+ /// This method checks if there is a data point which has value X equal
+ /// to valuePosition, and returns label from data point if such value exist.
+ /// If data point with this value not exists empty string will be returned.
+ /// If all data points have X value zero, index is used instead of X value.
+ /// </summary>
+ /// <param name="series">Data series</param>
+ /// <param name="valuePosition">A value which should be found in data points x values</param>
+ /// <param name="nonZeroXValues">Series X values are not zeros.</param>
+ /// <param name="indexedSeries">Series is indexed. All X values are zeros or IsXValueIndexed flag set.</param>
+ /// <returns>LabelStyle</returns>
+ private string GetPointLabel(
+ Series series,
+ double valuePosition,
+ bool nonZeroXValues,
+ bool indexedSeries)
+ {
+ int pointIndx = 1;
+
+ if( axisType == AxisName.Y || axisType == AxisName.Y2 )
+ {
+ return "";
+ }
+
+ if( !(( axisType == AxisName.X && series.XAxisType == AxisType.Primary ) || ( axisType == AxisName.X2 && series.XAxisType == AxisType.Secondary )) )
+ {
+#if SUBAXES
+ if(series.XSubAxisName != ((Axis)this).SubAxisName)
+ {
+ return "";
+ }
+#endif // SUBAXES
+ return "";
+ }
+
+ // Loop through all series data points
+ foreach( DataPoint point in series.Points )
+ {
+ // If series is indexed (all X values are zeros or IsXValueIndexed flag set)
+ if( indexedSeries )
+ {
+ // If axis label position matches point index
+ if( valuePosition == pointIndx )
+ {
+ // Use X value if axis label is not set and X values in series are not zeros
+ if(point.AxisLabel.Length == 0 && nonZeroXValues)
+ {
+ return ValueConverter.FormatValue(
+ this.Common.Chart,
+ this,
+ null,
+ point.XValue,
+ this.LabelStyle.Format,
+ series.XValueType,
+ ChartElementType.AxisLabels);
+ }
+
+ // Return axis label from data point
+ return point.ReplaceKeywords(point.AxisLabel);
+ }
+ }
+ else
+ {
+ // Find x value using Data point X values
+ if( point.XValue == valuePosition )
+ {
+ // Return label
+ return point.ReplaceKeywords(point.AxisLabel);
+ }
+ }
+ pointIndx++;
+ }
+ return "";
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/AxisScale.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/AxisScale.cs
new file mode 100644
index 00000000000..7e7de600034
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/AxisScale.cs
@@ -0,0 +1,2369 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: AxisScale.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: AxisScale
+//
+// Purpose: Base class for the Axis class which defines axis
+// csale related properties and methods.
+//
+// Reviewed: GS Aug 8, 2002
+// AG Aug 8, 2002
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Drawing2D;
+using System.Collections.Generic;
+#if Microsoft_CONTROL
+
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+ using System.Windows.Forms.DataVisualization.Charting;
+
+#else
+ using System.Web;
+ using System.Web.UI;
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ #region Axis enumerations
+
+ /// <summary>
+ /// An enumeration of the mode of automatically calculating intervals.
+ /// </summary>
+ public enum IntervalAutoMode
+ {
+ /// <summary>
+ /// Fixed number of intervals always created on the axis.
+ /// </summary>
+ FixedCount,
+
+ /// <summary>
+ /// Number of axis intervals depends on the axis length.
+ /// </summary>
+ VariableCount
+ }
+
+
+
+ /// <summary>
+ /// An enumeration of axis position.
+ /// </summary>
+ internal enum AxisPosition
+ {
+ /// <summary>
+ /// Left position
+ /// </summary>
+ Left,
+
+ /// <summary>
+ /// Right position
+ /// </summary>
+ Right,
+
+ /// <summary>
+ /// Top position
+ /// </summary>
+ Top,
+
+ /// <summary>
+ /// Bottom position
+ /// </summary>
+ Bottom
+ }
+
+ /// <summary>
+ /// An enumeration of axis arrow styles.
+ /// </summary>
+ public enum AxisArrowStyle
+ {
+ /// <summary>
+ /// No arrow
+ /// </summary>
+ None,
+ /// <summary>
+ /// Triangle type
+ /// </summary>
+ Triangle,
+ /// <summary>
+ /// Sharp triangle type
+ /// </summary>
+ SharpTriangle,
+ /// <summary>
+ /// Lines type
+ /// </summary>
+ Lines
+ }
+
+ #endregion
+
+ /// <summary>
+ /// The Axis class keeps information about minimum, maximum
+ /// and interval values and it is responsible for setting
+ /// these values automatically. It also handles
+ /// logarithmic and reversed axis.
+ /// </summary>
+ public partial class Axis
+ {
+ #region Axis scale fields
+
+ // Represents the distance between the data points and its
+ // chart area margin, Measured as a percentage of default
+ // margin size.
+ internal double margin = 100.0;
+ internal double marginView = 0.0;
+ internal bool offsetTempSet = false;
+
+ // Used for column chart margin
+ internal double marginTemp = 0.0;
+ private ArrayList _stripLineOffsets = new ArrayList();
+
+
+ // Data members, which store properties values
+ private bool _isLogarithmic = false;
+ internal double logarithmBase = 10.0;
+ internal bool isReversed = false;
+ internal bool isStartedFromZero = true;
+ internal TickMark minorTickMark = null;
+ internal TickMark majorTickMark = null;
+ internal Grid minorGrid = null;
+ internal Grid majorGrid = null;
+ internal bool enabled = false;
+ internal bool autoEnabled = true;
+ internal LabelStyle labelStyle = null;
+ private DateTimeIntervalType _internalIntervalType = DateTimeIntervalType.Auto;
+ internal double maximum = Double.NaN;
+ internal double crossing = Double.NaN;
+ internal double minimum = Double.NaN;
+
+ // Temporary Minimum and maximum values.
+ internal double tempMaximum = Double.NaN;
+ internal double tempMinimum = Double.NaN;
+ internal double tempCrossing = Double.NaN;
+ internal CustomLabelsCollection tempLabels;
+ internal bool tempAutoMaximum = true;
+ internal bool tempAutoMinimum = true;
+ internal double tempMajorGridInterval = Double.NaN;
+ internal double tempMinorGridInterval = 0.0;
+ internal double tempMajorTickMarkInterval = Double.NaN;
+ internal double tempMinorTickMarkInterval = 0.0;
+ internal double tempLabelInterval = Double.NaN;
+ internal DateTimeIntervalType tempGridIntervalType = DateTimeIntervalType.NotSet;
+ internal DateTimeIntervalType tempTickMarkIntervalType = DateTimeIntervalType.NotSet;
+ internal DateTimeIntervalType tempLabelIntervalType = DateTimeIntervalType.NotSet;
+
+ // Paint mode
+ internal bool paintMode = false;
+
+ // Axis type (X, Y, X2, Y2)
+ internal AxisName axisType = AxisName.X;
+
+ // Automatic maximum value (from data point values).
+ private bool _autoMaximum = true;
+
+ // Automatic minimum value (from data point values).
+ private bool _autoMinimum = true;
+
+ /// <summary>
+ /// Axis position: Left, Right, Top Bottom
+ /// </summary>
+ private AxisPosition _axisPosition = AxisPosition.Left;
+
+ /// <summary>
+ /// Opposite Axis for this Axis. Necessary for Crossing.
+ /// </summary>
+ internal Axis oppositeAxis = null;
+
+ // Axis data scaleView
+ private AxisScaleView _scaleView = null;
+
+#if Microsoft_CONTROL
+
+ // Axis scroll bar class
+ internal AxisScrollBar scrollBar = null;
+
+#endif // Microsoft_CONTROL
+
+ // For scater chart X values could be rounded.
+ internal bool roundedXValues = false;
+
+ // If Axis is logarithmic value shoud be converted to
+ // linear only once.
+ internal bool logarithmicConvertedToLinear = false;
+
+ // IsLogarithmic minimum value
+ internal double logarithmicMinimum;
+
+ // IsLogarithmic maximum value
+ internal double logarithmicMaximum;
+
+ // Correction of interval because of
+ // 3D Rotation and perspective
+ internal double interval3DCorrection = Double.NaN;
+
+ // Axis coordinate convertion optimization fields
+ internal bool optimizedGetPosition = false;
+ internal double paintViewMax = 0.0;
+ internal double paintViewMin = 0.0;
+ internal double paintRange = 0.0;
+ internal double valueMultiplier = 0.0;
+ internal RectangleF paintAreaPosition = RectangleF.Empty;
+ internal double paintAreaPositionBottom = 0.0;
+ internal double paintAreaPositionRight = 0.0;
+ internal double paintChartAreaSize = 0.0;
+
+
+
+ // Determines how number of intervals automatically calculated
+ private IntervalAutoMode _intervalAutoMode = IntervalAutoMode.FixedCount;
+
+ // True if scale segments are used
+ internal bool scaleSegmentsUsed = false;
+
+
+
+ // Preffered number of intervals on the axis
+ internal int prefferedNumberofIntervals = 5;
+
+ private Stack<Double> _intervalsStore = new Stack<Double>();
+
+ #endregion
+
+ #region Axis scale properties
+
+ /// <summary>
+ /// Axis position
+ /// </summary>
+ [
+ Bindable(true),
+ DefaultValue(AxisPosition.Left),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeReverse"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden)
+ ]
+ virtual internal AxisPosition AxisPosition
+ {
+ get
+ {
+ return this._axisPosition;
+ }
+ set
+ {
+ this._axisPosition = value;
+#if SUBAXES
+ // Update axis position of the sub axis
+ if( !((Axis)this).IsSubAxis )
+ {
+ foreach(SubAxis subAxis in ((Axis)this).SubAxes)
+ {
+ subAxis._axisPosition = value;
+ }
+ }
+
+#endif // SUBAXES
+ this.Invalidate();
+ }
+ }
+
+
+
+ /// <summary>
+ /// Gets or sets a flag which indicates whether the number of intervals
+ /// on the axis is fixed or varies with the axis size.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeInterval"),
+ DefaultValue(IntervalAutoMode.FixedCount),
+ SRDescription("DescriptionAttributeIntervalAutoMode"),
+ ]
+ public IntervalAutoMode IntervalAutoMode
+ {
+ get
+ {
+ return this._intervalAutoMode;
+ }
+ set
+ {
+ this._intervalAutoMode = value;
+ this.Invalidate();
+ }
+ }
+
+
+
+ /// <summary>
+ /// Gets or sets a flag which indicates whether the axis is reversed.
+ /// If set to reversed, the values on the axis are in reversed sort order
+ /// and the direction of values on the axis is flipped.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeScale"),
+ Bindable(true),
+ DefaultValue(false),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeReverse"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public bool IsReversed
+ {
+ get
+ {
+ return isReversed;
+ }
+ set
+ {
+ isReversed = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag which indicates whether the minimum value
+ /// of the axis will be automatically set to zero if all data point
+ /// values are positive. If there are negative data point values,
+ /// the minimum value of the data points will be used.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeScale"),
+ Bindable(true),
+ DefaultValue(true),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeStartFromZero3"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public bool IsStartedFromZero
+ {
+ get
+ {
+ return isStartedFromZero;
+ }
+ set
+ {
+ isStartedFromZero = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag to add a margin to the axis.
+ /// If true, a space is added between the first/last data
+ /// point and the border of chart area.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeScale"),
+ Bindable(true),
+ DefaultValue(true),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeMargin"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public bool IsMarginVisible
+ {
+ get
+ {
+ if( margin > 0 )
+ return true;
+ else
+ return false;
+ }
+ set
+ {
+ if( value == true )
+ margin = 100;
+ else
+ margin = 0;
+
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Date and time interval type.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeScale"),
+ Bindable(true),
+ DefaultValue(DateTimeIntervalType.Auto),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeInternalIntervalType"),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ internal DateTimeIntervalType InternalIntervalType
+ {
+ get
+ {
+ return _internalIntervalType;
+ }
+ set
+ {
+ // Set intervals for labels, grids and tick marks. ( Auto interval type )
+ if( tempMajorGridInterval <= 0.0 ||
+ (double.IsNaN(tempMajorGridInterval) && ((Axis)this).Interval <= 0.0) )
+ {
+ majorGrid.intervalType = value;
+ }
+
+ if( this.tempMajorTickMarkInterval <= 0.0 ||
+ (double.IsNaN(tempMajorTickMarkInterval) && ((Axis)this).Interval <= 0.0) )
+ {
+ majorTickMark.intervalType = value;
+ }
+
+ if( this.tempLabelInterval <= 0.0 ||
+ (double.IsNaN(tempLabelInterval) && ((Axis)this).Interval <= 0.0) )
+ {
+ labelStyle.intervalType = value;
+ }
+
+ _internalIntervalType = value;
+
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Sets auto interval values to grids, tick marks
+ /// and labels
+ /// </summary>
+ internal double SetInterval
+ {
+ set
+ {
+ if( tempMajorGridInterval <= 0.0 ||
+ (double.IsNaN(tempMajorGridInterval) && ((Axis)this).Interval <= 0.0) )
+ {
+ majorGrid.interval = value;
+ }
+
+ if( tempMajorTickMarkInterval <= 0.0 ||
+ (double.IsNaN(tempMajorTickMarkInterval) && ((Axis)this).Interval <= 0.0) )
+ {
+ majorTickMark.interval = value;
+ }
+
+ if( tempLabelInterval <= 0.0 ||
+ (double.IsNaN(tempLabelInterval) && ((Axis)this).Interval <= 0.0) )
+ {
+ labelStyle.interval = value;
+ }
+
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Sets auto interval values to grids, tick marks
+ /// and labels
+ /// </summary>
+ internal void SetIntervalAndType(double newInterval, DateTimeIntervalType newIntervalType)
+ {
+ if( tempMajorGridInterval <= 0.0 ||
+ (double.IsNaN(tempMajorGridInterval) && ((Axis)this).Interval <= 0.0) )
+ {
+ majorGrid.interval = newInterval;
+ majorGrid.intervalType = newIntervalType;
+ }
+
+ if( tempMajorTickMarkInterval <= 0.0 ||
+ (double.IsNaN(tempMajorTickMarkInterval) && ((Axis)this).Interval <= 0.0) )
+ {
+ majorTickMark.interval = newInterval;
+ majorTickMark.intervalType = newIntervalType;
+ }
+
+ if( tempLabelInterval <= 0.0 ||
+ (double.IsNaN(tempLabelInterval) && ((Axis)this).Interval <= 0.0) )
+ {
+ labelStyle.interval = newInterval;
+ labelStyle.intervalType = newIntervalType;
+ }
+
+ this.Invalidate();
+ }
+
+
+ /// <summary>
+ /// Gets or sets the maximum axis value.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeScale"),
+ Bindable(true),
+ DefaultValue(Double.NaN),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeMaximum"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ TypeConverter(typeof(AxisMinMaxAutoValueConverter))
+ ]
+ public double Maximum
+ {
+ get
+ {
+ // Get maximum
+ if (_isLogarithmic && logarithmicConvertedToLinear && !Double.IsNaN(maximum))
+ return logarithmicMaximum;
+ else
+ return maximum;
+ }
+ set
+ {
+ // Split a value to maximum and auto maximum
+ if( Double.IsNaN(value) )
+ {
+ _autoMaximum = true;
+ maximum = Double.NaN;
+ }
+ else
+ {
+ // Set maximum
+ maximum = value;
+
+ // Set non linearized Maximum for logarithmic scale
+ logarithmicMaximum = value;
+
+ _autoMaximum = false;
+ }
+
+ // Reset original property value fields
+ ((Axis)this).tempMaximum = maximum;
+
+ // This line is added because of Save ScaleView State August 29, 2003
+ // in Web Forms. This place could cause problems with Reset Auto Values.
+ ((Axis)this).tempAutoMaximum = _autoMaximum;
+
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the minimum axis value
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeScale"),
+ Bindable(true),
+ DefaultValue(Double.NaN),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeMinimum"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ TypeConverter(typeof(AxisMinMaxAutoValueConverter))
+ ]
+ public double Minimum
+ {
+ get
+ {
+ // Get minimum
+ if (_isLogarithmic && logarithmicConvertedToLinear && !Double.IsNaN(maximum))
+ return logarithmicMinimum;
+ else
+ return minimum;
+ }
+ set
+ {
+ // Split a value to minimum and auto minimum
+ if( Double.IsNaN(value) )
+ {
+ _autoMinimum = true;
+ minimum = Double.NaN;
+ }
+ else
+ {
+ // Set maximum
+ minimum = value;
+ _autoMinimum = false;
+
+ // Set non linearized Minimum for logarithmic scale
+ logarithmicMinimum = value;
+ }
+
+ // Reset original property value fields
+ ((Axis)this).tempMinimum = minimum;
+
+ // This line is added because of Save ScaleView State August 29, 2003
+ // in Web Forms. This place could cause problems with Reset Auto Values.
+ ((Axis)this).tempAutoMinimum = _autoMinimum;
+
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the point where axis is crossed by another axis.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeScale"),
+ Bindable(true),
+ DefaultValue(Double.NaN),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeCrossing"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ TypeConverter(typeof(AxisCrossingValueConverter))
+ ]
+ virtual public double Crossing
+ {
+ get
+ {
+ if( paintMode )
+ if (_isLogarithmic)
+ return Math.Pow( this.logarithmBase, GetCrossing() );
+ else
+ return GetCrossing();
+ else
+ return crossing;
+ }
+ set
+ {
+ crossing = value;
+
+ // Reset original property value fields
+ ((Axis)this).tempCrossing = crossing;
+
+ this.Invalidate();
+ }
+ }
+
+
+ /// <summary>
+ /// Enables or disables the axis.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ DefaultValue(typeof(AxisEnabled), "Auto"),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeEnabled7"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public AxisEnabled Enabled
+ {
+ get
+ {
+ // Take Enabled from two fields: enabled and auto enabled
+ if( autoEnabled )
+ {
+ return AxisEnabled.Auto;
+ }
+ else if( enabled )
+ {
+ return AxisEnabled.True;
+ }
+ else
+ {
+ return AxisEnabled.False;
+ }
+ }
+ set
+ { // Split Enabled to two fields: enabled and auto enabled
+ if( value == AxisEnabled.Auto )
+ {
+ autoEnabled = true;
+ }
+ else if( value == AxisEnabled.True )
+ {
+ enabled = true;
+ autoEnabled = false;
+ }
+ else
+ {
+ enabled = false;
+ autoEnabled = false;
+ }
+
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag which indicates whether the axis is logarithmic.
+ /// Zeros or negative data values are not allowed on logarithmic charts.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeScale"),
+ Bindable(true),
+ DefaultValue(false),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeLogarithmic"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public bool IsLogarithmic
+ {
+ get
+ {
+ return _isLogarithmic;
+ }
+ set
+ {
+ _isLogarithmic = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Base of the logarithm used in logarithmic scale.
+ /// By default, this value is 10.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeScale"),
+ Bindable(true),
+ DefaultValue(10.0),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeLogarithmBase"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public double LogarithmBase
+ {
+ get
+ {
+ return logarithmBase;
+ }
+ set
+ {
+ if( value < 2.0 )
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionAxisScaleLogarithmBaseInvalid));
+ }
+
+ logarithmBase = value;
+
+ this.Invalidate();
+ }
+ }
+
+ #endregion
+
+ #region Axis Segments and Scale Breaks Properties
+
+
+
+ // Field that stores Axis automatic scale breaks style.
+ internal AxisScaleBreakStyle axisScaleBreakStyle = null;
+
+ /// <summary>
+ /// Gets or sets the style of scale breaks.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeScale"),
+ SRDescription("DescriptionAttributeScaleBreakStyle"),
+ TypeConverter(typeof(NoNameExpandableObjectConverter)),
+ NotifyParentPropertyAttribute(true),
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ ]
+ virtual public AxisScaleBreakStyle ScaleBreakStyle
+ {
+ get
+ {
+ return this.axisScaleBreakStyle;
+ }
+ set
+ {
+ this.axisScaleBreakStyle = value;
+ this.axisScaleBreakStyle.axis = (Axis)this;
+ //this.Invalidate();
+ }
+ }
+
+ // Field that stores axis scale segments
+ internal AxisScaleSegmentCollection scaleSegments = null;
+
+ /// <summary>
+ /// Axis scale segment collection.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeScale"),
+ Browsable(false),
+ EditorBrowsable(EditorBrowsableState.Never),
+ SRDescription("DescriptionAttributeAxisScaleSegmentCollection_AxisScaleSegmentCollection"),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
+ Editor(Editors.ChartCollectionEditor.Editor, Editors.ChartCollectionEditor.Base)
+ ]
+ internal AxisScaleSegmentCollection ScaleSegments
+ {
+ get
+ {
+ return this.scaleSegments;
+ }
+ }
+
+ #endregion // Axis Segments and Scale Breaks Properties
+
+ #region Axis data scaleView properies and methods
+
+ /// <summary>
+ /// Gets or sets the scale view settings of the axis.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeDataView"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeView"),
+
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ TypeConverter(typeof(NoNameExpandableObjectConverter))
+ ]
+ public AxisScaleView ScaleView
+ {
+ get
+ {
+ return _scaleView;
+ }
+ set
+ {
+ _scaleView = value;
+ _scaleView.axis = (Axis)this;
+ this.Invalidate();
+ }
+ }
+
+#if Microsoft_CONTROL
+
+ /// <summary>
+ /// Gets or sets the scroll bar settings of the axis.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeDataView"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeScrollBar"),
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+ TypeConverter(typeof(NoNameExpandableObjectConverter))
+ ]
+ public AxisScrollBar ScrollBar
+ {
+ get
+ {
+ return scrollBar;
+ }
+ set
+ {
+ scrollBar = value;
+ scrollBar.axis = (Axis)this;
+ this.Invalidate();
+ }
+ }
+
+#endif // Microsoft_CONTROL
+
+ /// <summary>
+ /// Gets axis data scaleView minimum position.
+ /// </summary>
+ /// <returns>Axis data scaleView minimum position.</returns>
+ internal double ViewMinimum
+ {
+ get { return _scaleView.ViewMinimum; }
+ }
+
+ /// <summary>
+ /// Gets axis data scaleView minimum position.
+ /// </summary>
+ /// <returns>Axis data scaleView minimum position.</returns>
+ internal double ViewMaximum
+ {
+ get { return _scaleView.ViewMaximum; }
+ }
+
+ /// <summary>
+ /// Gets automatic maximum value (from data point values).
+ /// </summary>
+ internal bool AutoMaximum
+ {
+ get { return _autoMaximum; }
+ }
+
+ /// <summary>
+ /// Gets automatic minimum value (from data point values).
+ /// </summary>
+ internal bool AutoMinimum
+ {
+ get { return _autoMinimum; }
+ }
+
+ #endregion
+
+ #region Axis position converters methos
+
+ /// <summary>
+ /// This function converts axis value to relative position (0-100%).
+ /// If an axis has a logarithmic scale, the value is converted to a linear scale.
+ /// </summary>
+ /// <param name="axisValue">Value from axis.</param>
+ /// <returns>Relative position (0-100%).</returns>
+ public double GetPosition( double axisValue )
+ {
+ // Adjust for the IsLogarithmic axis
+ if (_isLogarithmic && axisValue != 0.0)
+ {
+ axisValue = Math.Log( axisValue, this.logarithmBase );
+ }
+
+ // Get linear position
+ return GetLinearPosition(axisValue);
+ }
+
+ /// <summary>
+ /// This function converts an axis value to relative position (0-100%).
+ /// If an axis has a logarithmic scale, the value is converted to a linear scale.
+ /// </summary>
+ /// <param name="axisValue">Axis value.</param>
+ /// <returns>Relative position (0-100%).</returns>
+ public double ValueToPosition( double axisValue )
+ {
+ return GetPosition( axisValue );
+ }
+
+ /// <summary>
+ /// This function converts an axis value to a pixel position.
+ /// If an axis has a logarithmic scale, the value is converted to a linear scale.
+ /// </summary>
+ /// <param name="axisValue">Value from axis.</param>
+ /// <returns>Pixel position.</returns>
+ public double ValueToPixelPosition( double axisValue )
+ {
+ // Get relative value
+ double val = ValueToPosition(axisValue);
+
+ // Convert it to pixels
+ if( AxisPosition == AxisPosition.Top || AxisPosition == AxisPosition.Bottom )
+ {
+ val *= (this.Common.ChartPicture.Width - 1) / 100F;
+ }
+ else
+ {
+ val *= (this.Common.ChartPicture.Height - 1) / 100F;
+ }
+
+ return val;
+ }
+
+ /// <summary>
+ /// This function converts a relative position to an axis value.
+ /// If an axis has a logarithmic scale, the value is converted to a linear scale.
+ /// </summary>
+ /// <param name="position">Relative position (0-100%).</param>
+ /// <returns>Axis value.</returns>
+ public double PositionToValue( double position )
+ {
+ return PositionToValue(position, true);
+ }
+
+ /// <summary>
+ /// This function converts a relative position to an axis value.
+ /// If an axis has a logarithmic scale, the value is converted to a linear scale.
+ /// </summary>
+ /// <param name="position">Relative position (0-100%).</param>
+ /// <param name="validateInput">Indicates if input value range should be checked.</param>
+ /// <returns>Axis value.</returns>
+ internal double PositionToValue( double position, bool validateInput)
+ {
+ // Check parameters
+ if(validateInput &&
+ (position < 0 || position > 100) )
+ {
+ throw (new ArgumentException(SR.ExceptionAxisScalePositionInvalid, "position"));
+ }
+
+ // Check if plot area position was already calculated
+ if(PlotAreaPosition == null)
+ {
+ throw (new InvalidOperationException(SR.ExceptionAxisScalePositionToValueCallFailed));
+ }
+
+ // Convert chart picture position to plotting position
+ if( AxisPosition == AxisPosition.Top || AxisPosition == AxisPosition.Bottom )
+ position = position - PlotAreaPosition.X;
+ else
+ position = PlotAreaPosition.Bottom - position;
+
+
+ // The Chart area size
+ double ChartArea;
+ if( AxisPosition == AxisPosition.Top || AxisPosition == AxisPosition.Bottom )
+ ChartArea = PlotAreaPosition.Width;
+ else
+ ChartArea = PlotAreaPosition.Height;
+
+
+ // The Real range as double
+ double viewMax = ViewMaximum;
+ double viewMin = ViewMinimum;
+ double range = viewMax - viewMin;
+
+ // Avoid division by zero
+ double axisValue = 0;
+ if( range != 0 )
+ {
+ // Find axis value from position
+ axisValue = range / ChartArea * position;
+ }
+
+ // Corrected axis value for reversed
+ if( isReversed )
+ axisValue = viewMax - axisValue;
+ else
+ axisValue = viewMin + axisValue;
+
+ return axisValue;
+ }
+
+ /// <summary>
+ /// This function converts a pixel position to an axis value.
+ /// If an axis has a logarithmic scale, the value is converted to a linear scale.
+ /// </summary>
+ /// <param name="position">Pixel position.</param>
+ /// <returns>Axis value.</returns>
+ public double PixelPositionToValue( double position )
+ {
+ // Convert it to pixels
+ double val = position;
+ if( AxisPosition == AxisPosition.Top || AxisPosition == AxisPosition.Bottom )
+ {
+ val *= 100F / ((float)(this.Common.ChartPicture.Width - 1));
+ }
+ else
+ {
+ val *= 100F / ((float)(this.Common.ChartPicture.Height - 1));
+ }
+
+ // Get from relative position
+ return PositionToValue(val);
+ }
+
+ #endregion
+
+ #region Axis scale methods
+
+ /// <summary>
+ /// Sets axis position. Axis position depends
+ /// on crossing and reversed value.
+ /// </summary>
+ internal void SetAxisPosition()
+ {
+ // Change position of the axis
+ if( GetOppositeAxis().isReversed )
+ {
+ if( AxisPosition == AxisPosition.Left )
+ AxisPosition = AxisPosition.Right;
+ else if( AxisPosition == AxisPosition.Right )
+ AxisPosition = AxisPosition.Left;
+ else if( AxisPosition == AxisPosition.Top )
+ AxisPosition = AxisPosition.Bottom;
+ else if( AxisPosition == AxisPosition.Bottom )
+ AxisPosition = AxisPosition.Top;
+ }
+ }
+
+ /// <summary>
+ /// Sets temporary offset value.
+ /// </summary>
+ internal void SetTempAxisOffset( )
+ {
+ if (ChartArea.Series.Count == 0)
+ {
+ return;
+ }
+ // Conditions when this code changes margin size: Column chart,
+ // margin is turned off, Interval offset is not used for
+ // gridlines, tick marks and labels.
+ Series ser = ChartArea.GetFirstSeries();
+ if( ( ser.ChartType == SeriesChartType.Column ||
+ ser.ChartType == SeriesChartType.StackedColumn ||
+ ser.ChartType == SeriesChartType.StackedColumn100 ||
+ ser.ChartType == SeriesChartType.Bar ||
+
+ ser.ChartType == SeriesChartType.RangeBar ||
+ ser.ChartType == SeriesChartType.RangeColumn ||
+
+ ser.ChartType == SeriesChartType.StackedBar ||
+ ser.ChartType == SeriesChartType.StackedBar100 ) &&
+ margin != 100.0 && !offsetTempSet &&
+ this._autoMinimum)
+ {
+
+ // Find offset correction for Column chart margin.
+ double offset;
+ marginTemp = margin;
+
+ // Find point width
+ // Check if series provide custom value for point width
+ double pointWidthSize;
+ string strWidth = ser[CustomPropertyName.PointWidth];
+ if(strWidth != null)
+ {
+ pointWidthSize = CommonElements.ParseDouble(strWidth);
+ }
+ else
+ {
+ pointWidthSize = 0.8;
+ }
+
+ margin = ( pointWidthSize / 2 ) * 100;
+ offset = ( margin ) / 100;
+ double contraOffset = ( 100 - margin ) / 100;
+
+ if (this._intervalsStore.Count == 0)
+ {
+ this._intervalsStore.Push(this.labelStyle.intervalOffset);
+ this._intervalsStore.Push(this.majorGrid.intervalOffset);
+ this._intervalsStore.Push(this.majorTickMark.intervalOffset);
+ this._intervalsStore.Push(this.minorGrid.intervalOffset);
+ this._intervalsStore.Push(this.minorTickMark.intervalOffset);
+ }
+
+ this.labelStyle.intervalOffset = Double.IsNaN(this.labelStyle.intervalOffset) ? offset : this.labelStyle.intervalOffset + offset;
+ this.majorGrid.intervalOffset = Double.IsNaN(this.majorGrid.intervalOffset) ? offset : this.majorGrid.intervalOffset + offset;
+ this.majorTickMark.intervalOffset = Double.IsNaN(this.majorTickMark.intervalOffset) ? offset : this.majorTickMark.intervalOffset + offset;
+ this.minorGrid.intervalOffset = Double.IsNaN(this.minorGrid.intervalOffset) ? offset : this.minorGrid.intervalOffset + offset;
+ this.minorTickMark.intervalOffset = Double.IsNaN(this.minorTickMark.intervalOffset) ? offset : this.minorTickMark.intervalOffset + offset;
+
+ foreach( StripLine strip in ((Axis)(this)).StripLines )
+ {
+ _stripLineOffsets.Add( strip.IntervalOffset );
+ strip.IntervalOffset -= contraOffset;
+ }
+ offsetTempSet = true;
+ }
+ }
+
+ /// <summary>
+ /// Resets temporary offset value.
+ /// </summary>
+ internal void ResetTempAxisOffset( )
+ {
+ if( this.offsetTempSet )
+ {
+ System.Diagnostics.Debug.Assert(this._intervalsStore.Count == 5, "Fail in interval store count");
+
+ this.minorTickMark.intervalOffset = this._intervalsStore.Pop();
+ this.minorGrid.intervalOffset = this._intervalsStore.Pop();
+ this.majorTickMark.intervalOffset = this._intervalsStore.Pop();
+ this.majorGrid.intervalOffset = this._intervalsStore.Pop();
+ this.labelStyle.intervalOffset = this._intervalsStore.Pop();
+ int index = 0;
+ foreach( StripLine strip in ((Axis)(this)).StripLines )
+ {
+ if( _stripLineOffsets.Count > index )
+ {
+ strip.IntervalOffset = (double)_stripLineOffsets[index];
+ }
+ index++;
+ }
+ _stripLineOffsets.Clear();
+ offsetTempSet = false;
+ margin = marginTemp;
+ }
+ }
+
+ /// <summary>
+ /// This function will create auto maximum and minimum values
+ /// using the interval. This function will make a gap between
+ /// data points and border of the chart area.
+ /// </summary>
+ /// <param name="inter">Interval</param>
+ /// <param name="shouldStartFromZero">True if minimum scale value should start from zero.</param>
+ /// <param name="autoMax">Maximum is auto</param>
+ /// <param name="autoMin">Minimum is auto</param>
+ /// <param name="min">Minimum value</param>
+ /// <param name="max">Maximum value</param>
+ /// <returns>Interval</returns>
+ internal double RoundedValues(
+ double inter,
+ bool shouldStartFromZero,
+ bool autoMax,
+ bool autoMin,
+ ref double min,
+ ref double max )
+ {
+ // For X Axes
+ if( axisType == AxisName.X || axisType == AxisName.X2 )
+ {
+ if( margin == 0.0 && !this.roundedXValues )
+ {
+ return inter;
+ }
+ }
+ else // For Y Axes
+ {
+ // Avoid dividing with 0. There is no gap.
+ if( margin == 0.0 )
+ {
+ return inter;
+ }
+ }
+
+ if( autoMin )
+ { // Set minimum value
+ if( min < 0.0 || ( !shouldStartFromZero && !ChartArea.stacked ) )
+ {
+ min = (double)( ((decimal)Math.Ceiling( min / inter ) - 1m ) * (decimal)inter );
+ }
+ else
+ {
+ min = 0.0;
+ }
+ }
+ if( autoMax )
+ {// Set maximum value
+ if( max <= 0.0 && shouldStartFromZero )
+ {
+ max = 0.0;
+ }
+ else
+ {
+ max = (double)( ((decimal)Math.Floor( max / inter ) + 1m ) * (decimal)inter );
+ }
+ }
+ return inter;
+ }
+
+
+ /// <summary>
+ /// Recalculates an intelligent interval from real interval.
+ /// </summary>
+ /// <param name="diff">Real interval.</param>
+ /// <returns>Inteligent interval.</returns>
+ internal double CalcInterval( double diff )
+ {
+ // If the interval is zero return error
+ if( diff == 0.0 )
+ {
+ throw (new ArgumentOutOfRangeException("diff", SR.ExceptionAxisScaleIntervalIsZero));
+ }
+
+ // If the real interval is > 1.0
+ double step = -1;
+ double temp = diff;
+ while( temp > 1.0 )
+ {
+ step ++;
+ temp = temp / 10.0;
+ if( step > 1000 )
+ {
+ throw (new InvalidOperationException(SR.ExceptionAxisScaleMinimumMaximumInvalid));
+ }
+ }
+
+
+ // If the real interval is < 1.0
+ temp = diff;
+ if( temp < 1.0 )
+ {
+ step = 0;
+ }
+
+ while( temp < 1.0 )
+ {
+ step --;
+ temp = temp * 10.0;
+ if( step < -1000 )
+ {
+ throw (new InvalidOperationException(SR.ExceptionAxisScaleMinimumMaximumInvalid));
+ }
+ }
+
+ double power = (this.IsLogarithmic) ? this.logarithmBase : 10.0;
+ double tempDiff = diff / Math.Pow( power, step );
+
+ if( tempDiff < 3 )
+ tempDiff = 2;
+ else if( tempDiff < 7 )
+ tempDiff = 5;
+ else
+ tempDiff = 10;
+
+ // Make a correction of the real interval
+ return tempDiff * Math.Pow( power, step );
+ }
+
+ /// <summary>
+ /// Recalculates a intelligent interval from real interval
+ /// obtained from maximum and minimum values
+ /// </summary>
+ /// <param name="min">Minimum</param>
+ /// <param name="max">Maximum</param>
+ /// <returns>Auto Interval</returns>
+ private double CalcInterval( double min, double max )
+ {
+ // Approximated interval value
+ return CalcInterval( ( max - min ) / 5 );
+ }
+
+
+ /// <summary>
+ /// Recalculates a intelligent interval from real interval
+ /// obtained from maximum, minimum and date type if
+ /// the values is date-time value.
+ /// </summary>
+ /// <param name="min">Minimum value.</param>
+ /// <param name="max">Maximum value.</param>
+ /// <param name="date">True if date.</param>
+ /// <param name="type">Date time interval type.</param>
+ /// <param name="valuesType">AxisName of date-time values.</param>
+ /// <returns>Auto Interval.</returns>
+ internal double CalcInterval(
+ double min,
+ double max,
+ bool date,
+ out DateTimeIntervalType type,
+ ChartValueType valuesType)
+ {
+ // AxisName is date time
+ if( date )
+ {
+ DateTime dateTimeMin = DateTime.FromOADate( min );
+ DateTime dateTimeMax = DateTime.FromOADate( max );
+ TimeSpan timeSpan = dateTimeMax.Subtract( dateTimeMin );
+
+ // Minutes
+ double inter = timeSpan.TotalMinutes;
+
+ // For Range less than 60 seconds interval is 5 sec
+ if( inter <= 1.0 && valuesType != ChartValueType.Date)
+ {
+ // Milli Seconds
+ double mlSeconds = timeSpan.TotalMilliseconds;
+ if(mlSeconds <= 10)
+ {
+ type = DateTimeIntervalType.Milliseconds;
+ return 1;
+ }
+ if(mlSeconds <= 50)
+ {
+ type = DateTimeIntervalType.Milliseconds;
+ return 4;
+ }
+ if(mlSeconds <= 200)
+ {
+ type = DateTimeIntervalType.Milliseconds;
+ return 20;
+ }
+ if(mlSeconds <= 500)
+ {
+ type = DateTimeIntervalType.Milliseconds;
+ return 50;
+ }
+
+ // Seconds
+ double seconds = timeSpan.TotalSeconds;
+
+ if(seconds <= 7)
+ {
+ type = DateTimeIntervalType.Seconds;
+ return 1;
+ }
+ else if(seconds <= 15)
+ {
+ type = DateTimeIntervalType.Seconds;
+ return 2;
+ }
+ else if(seconds <= 30)
+ {
+ type = DateTimeIntervalType.Seconds;
+ return 5;
+ }
+ else if(seconds <= 60)
+ {
+ type = DateTimeIntervalType.Seconds;
+ return 10;
+ }
+
+ }// For Range less than 120 seconds interval is 10 sec
+ else if( inter <= 2.0 && valuesType != ChartValueType.Date)
+ {
+ type = DateTimeIntervalType.Seconds;
+ return 20;
+ }// For Range less than 180 seconds interval is 30 sec
+ else if( inter <= 3.0 && valuesType != ChartValueType.Date)
+ {
+ type = DateTimeIntervalType.Seconds;
+ return 30;
+ }
+
+ // For Range less than 10 minutes interval is 1 min
+ else if( inter <= 10 && valuesType != ChartValueType.Date)
+ {
+ type = DateTimeIntervalType.Minutes;
+ return 1;
+ }
+ // For Range less than 20 minutes interval is 1 min
+ else if( inter <= 20 && valuesType != ChartValueType.Date)
+ {
+ type = DateTimeIntervalType.Minutes;
+ return 2;
+ }// For Range less than 60 minutes interval is 5 min
+ else if( inter <= 60 && valuesType != ChartValueType.Date)
+ {
+ type = DateTimeIntervalType.Minutes;
+ return 5;
+ }// For Range less than 120 minutes interval is 10 min
+ else if( inter <= 120 && valuesType != ChartValueType.Date)
+ {
+ type = DateTimeIntervalType.Minutes;
+ return 10;
+ }// For Range less than 180 minutes interval is 30 min
+ else if( inter <= 180 && valuesType != ChartValueType.Date)
+ {
+ type = DateTimeIntervalType.Minutes;
+ return 30;
+ }
+ // For Range less than 12 hours interval is 1 hour
+ else if( inter <= 60*12 && valuesType != ChartValueType.Date)
+ {
+ type = DateTimeIntervalType.Hours;
+ return 1;
+ }
+ // For Range less than 24 hours interval is 4 hour
+ else if( inter <= 60*24 && valuesType != ChartValueType.Date)
+ {
+ type = DateTimeIntervalType.Hours;
+ return 4;
+ }
+ // For Range less than 2 days interval is 6 hour
+ else if( inter <= 60*24*2 && valuesType != ChartValueType.Date)
+ {
+ type = DateTimeIntervalType.Hours;
+ return 6;
+ }
+ // For Range less than 3 days interval is 12 hour
+ else if( inter <= 60*24*3 && valuesType != ChartValueType.Date)
+ {
+ type = DateTimeIntervalType.Hours;
+ return 12;
+ }
+
+ // For Range less than 10 days interval is 1 day
+ else if( inter <= 60*24*10 )
+ {
+ type = DateTimeIntervalType.Days;
+ return 1;
+ }
+ // For Range less than 20 days interval is 2 day
+ else if( inter <= 60*24*20 )
+ {
+ type = DateTimeIntervalType.Days;
+ return 2;
+ }
+ // For Range less than 30 days interval is 3 day
+ else if( inter <= 60*24*30 )
+ {
+ type = DateTimeIntervalType.Days;
+ return 3;
+ }
+ // For Range less than 2 months interval is 1 week
+ else if( inter <= 60*24*30.5*2 )
+ {
+ type = DateTimeIntervalType.Weeks;
+ return 1;
+ }
+ // For Range less than 5 months interval is 2weeks
+ else if( inter <= 60*24*30.5*5 )
+ {
+ type = DateTimeIntervalType.Weeks;
+ return 2;
+ }
+ // For Range less than 12 months interval is 1 month
+ else if( inter <= 60*24*30.5*12 )
+ {
+ type = DateTimeIntervalType.Months;
+ return 1;
+ }
+ // For Range less than 24 months interval is 3 month
+ else if( inter <= 60*24*30.5*24 )
+ {
+ type = DateTimeIntervalType.Months;
+ return 3;
+ }
+ // For Range less than 48 months interval is 6 months
+ else if( inter <= 60*24*30.5*48 )
+ {
+ type = DateTimeIntervalType.Months;
+ return 6;
+ }
+ // For Range more than 48 months interval is year
+ else if( inter >= 60*24*30.5*48 )
+ {
+ type = DateTimeIntervalType.Years;
+ return CalcYearInterval( inter / 60 / 24 / 365 );
+ }
+ }
+
+ // Else numbers
+ type = DateTimeIntervalType.Number;
+ return CalcInterval( min, max );
+
+ }
+
+ /// <summary>
+ /// Recalculates a intelligent interval for years
+ /// </summary>
+ /// <param name="years">Number of years</param>
+ /// <returns>Interval in years</returns>
+ private double CalcYearInterval( double years )
+ {
+ // If the interval is zero return error
+ if( years <= 1.0 )
+ {
+ throw (new ArgumentOutOfRangeException("years", SR.ExceptionAxisScaleIntervalIsLessThen1Year));
+ }
+
+ if( years < 5 )
+ return 1;
+ else if( years < 10 )
+ return 2;
+
+ // Make a correction of the interval
+ return Math.Floor( years / 5 );
+ }
+
+ /// <summary>
+ /// This method returns the number of units
+ /// between min and max.
+ /// </summary>
+ /// <param name="min">Minimum.</param>
+ /// <param name="max">Maximum.</param>
+ /// <param name="type">Date type.</param>
+ /// <returns>Number of units.</returns>
+ private int GetNumOfUnits( double min, double max, DateTimeIntervalType type )
+ {
+ double current = ChartHelper.GetIntervalSize(min, 1, type);
+ return (int)Math.Round((max - min) / current);
+ }
+
+ /// <summary>
+ /// This method checks if value type is date-time.
+ /// </summary>
+ /// <returns>Date-time type or Auto.</returns>
+ internal ChartValueType GetDateTimeType()
+ {
+ List<string> list = null;
+
+ ChartValueType dateType = ChartValueType.Auto;
+
+ // Check if Value type is date from first series in the axis
+ if( axisType == AxisName.X )
+ {
+ // Check X axes type
+ list = ChartArea.GetXAxesSeries( AxisType.Primary, ((Axis)this).SubAxisName );
+ if( list.Count == 0 )
+ {
+ return ChartValueType.Auto;
+ }
+
+ if( Common.DataManager.Series[list[0]].IsXValueDateTime() )
+ {
+ dateType = Common.DataManager.Series[list[0]].XValueType;
+ }
+ }
+ else if( axisType == AxisName.X2 )
+ {
+ // Check X2 axes type
+ list = ChartArea.GetXAxesSeries( AxisType.Secondary, ((Axis)this).SubAxisName );
+ if( list.Count == 0 )
+ {
+ return ChartValueType.Auto;
+ }
+
+ if( Common.DataManager.Series[list[0]].IsXValueDateTime() )
+ {
+ dateType = Common.DataManager.Series[list[0]].XValueType;
+ }
+ }
+ else if( axisType == AxisName.Y )
+ {
+ // Check Y axes type
+ list = ChartArea.GetYAxesSeries( AxisType.Primary, ((Axis)this).SubAxisName );
+ if( list.Count == 0 )
+ {
+ return ChartValueType.Auto;
+ }
+
+ if( Common.DataManager.Series[list[0]].IsYValueDateTime() )
+ {
+ dateType = Common.DataManager.Series[list[0]].YValueType;
+ }
+ }
+ else if( axisType == AxisName.Y2 )
+ {
+ // Check Y2 axes type
+ list = ChartArea.GetYAxesSeries( AxisType.Secondary, ((Axis)this).SubAxisName );
+ if( list.Count == 0 )
+ {
+ return ChartValueType.Auto;
+ }
+
+ if( Common.DataManager.Series[list[0]].IsYValueDateTime() )
+ {
+ dateType = Common.DataManager.Series[list[0]].YValueType;
+ }
+ }
+
+ return dateType;
+ }
+
+ /// <summary>
+ /// This method removes "Auto", "min", "max" from crossing
+ /// value and creates a double value.
+ /// </summary>
+ /// <returns>Crossing value</returns>
+ private double GetCrossing()
+ {
+ if( Double.IsNaN(crossing) )
+ {
+ if( Common.ChartTypeRegistry.GetChartType( (string)ChartArea.ChartTypes[0] ).ZeroCrossing )
+ {
+ if( ViewMinimum > 0.0 )
+ {
+ return ViewMinimum;
+ }
+ else if( ViewMaximum < 0.0 )
+ {
+ return ViewMaximum;
+ }
+ else
+ {
+ return 0.0;
+ }
+ }
+ else
+ {
+ return ViewMinimum;
+ }
+ }
+ else if( crossing == Double.MaxValue )
+ {
+ return ViewMaximum;
+ }
+ else if( crossing == Double.MinValue )
+ {
+ return ViewMinimum;
+ }
+
+ return crossing;
+ }
+
+ /// <summary>
+ /// Set auto minimum number. The minimum number
+ /// which was sent to this function will be used to
+ /// estimate a rounded minimum.
+ /// </summary>
+ /// <param name="min"> This value is a recommendation for the minimum value. </param>
+ internal void SetAutoMinimum(double min)
+ {
+ // Set the minimum
+ if( _autoMinimum )
+ {
+ minimum = min;
+ }
+ }
+
+ /// <summary>
+ /// Set auto maximum number. The maximum number
+ /// which was sent to this function will be used to
+ /// estimate a rounded maximum.
+ /// </summary>
+ /// <param name="max">This value is a recommendation for the maximum value.</param>
+ internal void SetAutoMaximum(double max)
+ {
+ // Set the maximum
+ if( _autoMaximum )
+ {
+ maximum = max;
+ }
+ }
+
+ /// <summary>
+ /// Find opposite axis of this axis. What is opposite
+ /// axis depend on first series in chart area and primary
+ /// and secondary X and Y axes for the first series.
+ /// </summary>
+ /// <returns>Opposite axis</returns>
+ internal Axis GetOppositeAxis()
+ {
+ // Oppoiste axis found
+ if (oppositeAxis != null)
+ {
+ return oppositeAxis;
+ }
+
+ List<string> list;
+
+ switch( axisType )
+ {
+ // X Axis
+ case AxisName.X:
+ list = ChartArea.GetXAxesSeries( AxisType.Primary, ((Axis)this).SubAxisName );
+ // There aren't data series
+ if( list.Count == 0 )
+ oppositeAxis = ChartArea.AxisY;
+ // Take opposite axis from the first series from chart area
+ else if( Common.DataManager.Series[list[0]].YAxisType == AxisType.Primary )
+ oppositeAxis = ChartArea.AxisY.GetSubAxis(Common.DataManager.Series[list[0]].YSubAxisName);
+ else
+ oppositeAxis = ChartArea.AxisY2.GetSubAxis(Common.DataManager.Series[list[0]].YSubAxisName);
+ break;
+ // X2 Axis
+ case AxisName.X2:
+ list = ChartArea.GetXAxesSeries( AxisType.Secondary, ((Axis)this).SubAxisName );
+ // There aren't data series
+ if( list.Count == 0 )
+ oppositeAxis = ChartArea.AxisY2;
+ // Take opposite axis from the first series from chart area
+ else if( Common.DataManager.Series[list[0]].YAxisType == AxisType.Primary)
+ oppositeAxis = ChartArea.AxisY.GetSubAxis(Common.DataManager.Series[list[0]].YSubAxisName);
+ else
+ oppositeAxis = ChartArea.AxisY2.GetSubAxis(Common.DataManager.Series[list[0]].YSubAxisName);
+ break;
+ // Y Axis
+ case AxisName.Y:
+ list = ChartArea.GetYAxesSeries( AxisType.Primary, ((Axis)this).SubAxisName );
+ // There aren't data series
+ if( list.Count == 0 )
+ oppositeAxis = ChartArea.AxisX;
+ // Take opposite axis from the first series from chart area
+ else if( Common.DataManager.Series[list[0]].XAxisType == AxisType.Primary )
+ oppositeAxis = ChartArea.AxisX.GetSubAxis(Common.DataManager.Series[list[0]].XSubAxisName);
+ else
+ oppositeAxis = ChartArea.AxisX2.GetSubAxis(Common.DataManager.Series[list[0]].XSubAxisName);
+ break;
+ // Y2 Axis
+ case AxisName.Y2:
+ list = ChartArea.GetYAxesSeries( AxisType.Secondary, ((Axis)this).SubAxisName );
+ // There aren't data series
+ if( list.Count == 0 )
+ oppositeAxis = ChartArea.AxisX2;
+ // Take opposite axis from the first series from chart area
+ else if( Common.DataManager.Series[list[0]].XAxisType == AxisType.Primary )
+ oppositeAxis = ChartArea.AxisX.GetSubAxis(Common.DataManager.Series[list[0]].XSubAxisName);
+ else
+ oppositeAxis = ChartArea.AxisX2.GetSubAxis(Common.DataManager.Series[list[0]].XSubAxisName);
+ break;
+ }
+ return oppositeAxis;
+ }
+
+ /// <summary>
+ /// This function converts Values from Axes to
+ /// linear relative positions.
+ /// </summary>
+ /// <param name="axisValue">Value from axis.</param>
+ /// <returns>Relative position.</returns>
+ internal double GetLinearPosition( double axisValue )
+ {
+ bool circularArea = (ChartArea == null || !ChartArea.chartAreaIsCurcular) ?
+ false : true;
+
+ // Check if some value calculation is optimized
+ if(!this.optimizedGetPosition)
+ {
+ paintViewMax = ViewMaximum;
+ paintViewMin = ViewMinimum;
+ paintRange = paintViewMax - paintViewMin;
+ paintAreaPosition = PlotAreaPosition.ToRectangleF();
+
+ // Update position for circular chart area
+ if(circularArea)
+ {
+ paintAreaPosition.Width /= 2.0f;
+ paintAreaPosition.Height /= 2.0f;
+ }
+
+ paintAreaPositionBottom = paintAreaPosition.Y + paintAreaPosition.Height;
+ paintAreaPositionRight = paintAreaPosition.X + paintAreaPosition.Width;
+
+ // The Chart area size
+ if( AxisPosition == AxisPosition.Top || AxisPosition == AxisPosition.Bottom )
+ paintChartAreaSize = paintAreaPosition.Width;
+ else
+ paintChartAreaSize = paintAreaPosition.Height;
+
+ valueMultiplier = 0.0;
+ if( paintRange != 0 )
+ {
+ valueMultiplier = paintChartAreaSize / paintRange;
+ }
+ }
+
+ // The Chart area pixel size
+ double position = valueMultiplier * ( axisValue - paintViewMin);
+
+
+
+ // Check if axis scale segments are enabled
+ if(this.scaleSegmentsUsed)
+ {
+ AxisScaleSegment scaleSegment = this.ScaleSegments.FindScaleSegmentForAxisValue(axisValue);
+ if(scaleSegment != null)
+ {
+ double segmentSize = 0.0;
+ double segmentPosition = 0.0;
+ scaleSegment.GetScalePositionAndSize(paintChartAreaSize, out segmentPosition, out segmentSize);
+
+ // Make sure value do not exceed max possible
+ if(!this.ScaleSegments.AllowOutOfScaleValues)
+ {
+ if(axisValue > scaleSegment.ScaleMaximum)
+ {
+ axisValue = scaleSegment.ScaleMaximum;
+ }
+ else if(axisValue < scaleSegment.ScaleMinimum)
+ {
+ axisValue = scaleSegment.ScaleMinimum;
+ }
+ }
+
+ double segmentScaleRange = scaleSegment.ScaleMaximum - scaleSegment.ScaleMinimum;
+
+ position = (segmentSize / segmentScaleRange) * (axisValue - scaleSegment.ScaleMinimum);
+ position += segmentPosition;
+ }
+ }
+
+
+ // Window position
+ // (Do Not use .Right or .Bottom methods below) - rounding issue!
+ if( isReversed )
+ {
+ if( AxisPosition == AxisPosition.Top || AxisPosition == AxisPosition.Bottom )
+ position = paintAreaPositionRight - position;
+ else
+ position = paintAreaPosition.Y + position;
+ }
+ else
+ {
+ if( AxisPosition == AxisPosition.Top || AxisPosition == AxisPosition.Bottom )
+ position = paintAreaPosition.X + position;
+ else
+ position = paintAreaPositionBottom - position;
+ }
+
+ return position;
+ }
+
+
+ #endregion
+
+ #region Axis estimate axis methods
+
+ /// <summary>
+ /// This function recalculates minimum maximum and interval.
+ /// The function uses current values for minimum and maximum to
+ /// find rounding values. If the value from the data source for the
+ /// maximum value is 376.5 this function will return 380. This function
+ /// also set interval type for date
+ /// </summary>
+ internal void EstimateAxis()
+ {
+ double axisInterval;
+
+ // Check if veiw size specified without scaleView position
+ if(!Double.IsNaN(this.ScaleView.Size))
+ {
+ // If size set only use axis minimum for scaleView position
+ if(Double.IsNaN(this.ScaleView.Position))
+ {
+ this.ScaleView.Position = this.Minimum;
+ }
+ }
+
+ // Zooming Mode
+ if( !Double.IsNaN(_scaleView.Position) && !Double.IsNaN(_scaleView.Size) )
+ {
+ double viewMaximum = ViewMaximum;
+ double viewMinimum = ViewMinimum;
+
+ // IsLogarithmic axes
+ if (this._isLogarithmic)
+ {
+ viewMaximum = Math.Pow( this.logarithmBase, viewMaximum );
+ viewMinimum = Math.Pow( this.logarithmBase, viewMinimum );
+ }
+ else
+ {
+ // Add rounding and gap for maximum and minimum
+ EstimateAxis( ref this.minimum, ref this.maximum, _autoMaximum, _autoMinimum );
+ }
+
+ // Find Interval for Zoom
+ axisInterval = EstimateAxis( ref viewMinimum, ref viewMaximum, true, true );
+ }
+ else // No Zooming mode
+ {
+ // Estimate axis shoud be always called for non logarithmic axis
+ axisInterval = EstimateAxis( ref this.minimum, ref this.maximum, _autoMaximum, _autoMinimum );
+ }
+
+ // Set intervals for grids, tick marks and labels
+ if( axisInterval <= 0.0 )
+ {
+ throw (new InvalidOperationException(SR.ExceptionAxisScaleAutoIntervalInvalid));
+ }
+ else
+ {
+ // This code checks if all series in the chart area have “integer type”
+ // for specified axes, which means int, uint, long and ulong and rounds interval.
+#if SUBAXES
+ if( ChartArea.SeriesIntegerType( this.axisType, ((Axis)this).SubAxisName ) )
+#else // SUBAXES
+ if ( ChartArea.SeriesIntegerType( this.axisType, string.Empty ))
+#endif // SUBAXES
+ {
+ axisInterval = Math.Round( axisInterval );
+ if( axisInterval == 0.0 )
+ {
+ axisInterval = 1.0;
+ }
+
+ // Round Minimum to floor value if type is integer
+ minimum = Math.Floor( minimum );
+ }
+
+ SetInterval = axisInterval;
+ }
+ }
+
+ /// <summary>
+ /// This function recalculates minimum maximum and interval.
+ /// The function uses current values for minimum and maximum to
+ /// find rounding values. If the value from the data source for the
+ /// maximum value is 376.5 this function will return 380. This function
+ /// also set interval type for date
+ /// </summary>
+ /// <param name="minimumValue">Minimum</param>
+ /// <param name="maximumValue">Maximum</param>
+ /// <param name="autoMaximum">Maximum value is Auto</param>
+ /// <param name="autoMinimum">Minimum value is Auto</param>
+ /// <returns>Interval</returns>
+ internal double EstimateAxis( ref double minimumValue, ref double maximumValue, bool autoMaximum, bool autoMinimum )
+ {
+ double axisInterval;
+
+ // The axis minimum value is greater than the maximum value.
+ if( maximumValue < minimumValue )
+ {
+ if(!this.Common.ChartPicture.SuppressExceptions)
+ {
+ throw (new InvalidOperationException(SR.ExceptionAxisScaleMinimumValueIsGreaterThenMaximumDataPoint));
+ }
+ else
+ {
+ // Max axis scale should be always bigger
+ double tempValue = maximumValue;
+ maximumValue = minimumValue;
+ minimumValue = tempValue;
+ }
+ }
+
+ // Take Value type
+ ChartValueType dateType = GetDateTimeType();
+
+ // Axis type is logarithmic
+ if (_isLogarithmic)
+ {
+ axisInterval = EstimateLogarithmicAxis( ref minimumValue, ref maximumValue, crossing, autoMaximum, autoMinimum );
+ }
+
+ // Axis type is date
+ else if( dateType != ChartValueType.Auto)
+ {
+ axisInterval = EstimateDateAxis( ref minimumValue, ref maximumValue, autoMaximum, autoMinimum, dateType );
+ }
+
+ // Axis type is number
+ else
+ {
+ axisInterval = EstimateNumberAxis( ref minimumValue, ref maximumValue, this.IsStartedFromZero, this.prefferedNumberofIntervals, autoMaximum, autoMinimum );
+ }
+
+ // Set intervals for grids, tick marks and labels
+ if( axisInterval <= 0.0 )
+ {
+ throw (new InvalidOperationException(SR.ExceptionAxisScaleAutoIntervalInvalid));
+ }
+ else
+ {
+ // Set interval for Grid lines Tick Marks and labels
+ SetInterval = axisInterval;
+ }
+
+ return axisInterval;
+
+ }
+
+ /// <summary>
+ /// This function recalculates minimum maximum and interval for
+ /// logarithmic axis. The function uses current values for minimum and
+ /// maximum to find new rounding values.
+ /// </summary>
+ /// <param name="minimumValue">Current Minimum value</param>
+ /// <param name="maximumValue">Current Maximum value</param>
+ /// <param name="crossingValue">Crossing value</param>
+ /// <param name="autoMaximum">Maximum value is Auto</param>
+ /// <param name="autoMinimum">Minimum value is Auto</param>
+ /// <returns>Interval</returns>
+ private double EstimateLogarithmicAxis( ref double minimumValue, ref double maximumValue, double crossingValue, bool autoMaximum, bool autoMinimum )
+ {
+ double axisInterval;
+
+ if( !logarithmicConvertedToLinear )
+ {
+ // Remember values. Do not use POW function because of rounding.
+ this.logarithmicMinimum = this.minimum;
+ this.logarithmicMaximum = this.maximum;
+ }
+
+ // For log axis margin always turn on.
+ margin = 100;
+
+ // Supress zero and negative values with logarithmic axis exceptions
+ if(this.Common != null && this.Common.Chart != null && this.Common.Chart.chartPicture.SuppressExceptions)
+ {
+ if (minimumValue <= 0.0 )
+ {
+ minimumValue = 1.0;
+ }
+ if (maximumValue <= 0.0 )
+ {
+ maximumValue = 1.0;
+ }
+ if (crossingValue <= 0.0 && crossingValue != Double.MinValue )
+ {
+ crossingValue = 1.0;
+ }
+ }
+
+ // The logarithmic axes can not show negative values.
+ if( minimumValue <= 0.0 || maximumValue <= 0.0 || crossingValue <= 0.0 )
+ {
+ if (minimumValue <= 0.0 )
+ throw (new ArgumentOutOfRangeException("minimumValue", SR.ExceptionAxisScaleLogarithmicNegativeValues));
+ if (maximumValue <= 0.0 )
+ throw (new ArgumentOutOfRangeException("maximumValue", SR.ExceptionAxisScaleLogarithmicNegativeValues));
+ }
+
+ // Change crossing to linear scale
+ crossingValue = Math.Log( crossingValue, this.logarithmBase );
+
+ // Change minimum and maximum to linear scale
+ minimumValue = Math.Log( minimumValue, this.logarithmBase );
+ maximumValue = Math.Log( maximumValue, this.logarithmBase );
+
+ logarithmicConvertedToLinear = true;
+
+ // Find interval - Make approximately 5 grid lines and labels.
+ double diff = ( maximumValue - minimumValue ) / 5;
+
+ // Make good interval for logarithmic scale
+ axisInterval = Math.Floor( diff );
+ if( axisInterval == 0 ) axisInterval = 1;
+
+ if( autoMinimum && autoMaximum )
+ {
+ // The maximum and minimum rounding with interval
+ RoundedValues( axisInterval, this.IsStartedFromZero, autoMaximum, autoMinimum, ref minimumValue, ref maximumValue );
+ }
+
+ // Do not allow min/max values more than a hundred
+ if(ChartArea.hundredPercent)
+ {
+ if(autoMinimum)
+ {
+ if(minimumValue < 0)
+ minimumValue = 0;
+ }
+
+ if(autoMaximum)
+ {
+ if(maximumValue > 2)
+ maximumValue = 2;
+ }
+ }
+
+ // Set interval for Grid lines Tick Marks and labels
+ return axisInterval;
+ }
+
+ /// <summary>
+ /// This function recalculates minimum maximum and interval for
+ /// Date axis. The function uses current values for minimum and
+ /// maximum to find new rounding values.
+ /// </summary>
+ /// <param name="minimumValue">Current Minimum value</param>
+ /// <param name="maximumValue">Current Maximum value</param>
+ /// <param name="autoMaximum">Maximum value is Auto</param>
+ /// <param name="autoMinimum">Minimum value is Auto</param>
+ /// <param name="valuesType">AxisName of date-time values.</param>
+ /// <returns>Interval</returns>
+ private double EstimateDateAxis(
+ ref double minimumValue,
+ ref double maximumValue,
+ bool autoMaximum,
+ bool autoMinimum,
+ ChartValueType valuesType)
+ {
+ double axisInterval;
+
+ double min = minimumValue;
+ double max = maximumValue;
+
+ // Find interval for this date type
+ axisInterval = CalcInterval(min, max, true, out _internalIntervalType, valuesType);
+
+
+ // For 3D Charts interval could be changed. After rotation
+ // projection of axis could be very small.
+ if( !double.IsNaN( this.interval3DCorrection ) &&
+ ChartArea.Area3DStyle.Enable3D &&
+ !ChartArea.chartAreaIsCurcular)
+ {
+ axisInterval = Math.Floor( axisInterval / this.interval3DCorrection );
+
+ this.interval3DCorrection = double.NaN;
+ }
+
+ // Find number of units between minimum and maximum
+ int numberOfUnits = GetNumOfUnits( min, max, _internalIntervalType );
+
+ // Make a gap between max point and axis for Y axes
+ if( axisType == AxisName.Y || axisType == AxisName.Y2 )
+ {
+ if (autoMinimum && minimumValue > ChartHelper.GetIntervalSize(min, axisInterval, _internalIntervalType))
+ {
+ // Add gap to the minimum value from the series
+ // equal half of the interval
+ minimumValue += ChartHelper.GetIntervalSize(
+ min,
+ - (axisInterval / 2.0) * margin / 100,
+ _internalIntervalType,
+ null,
+ 0.0,
+ DateTimeIntervalType.Number,
+ false,
+ false);
+
+ // Align minimum sacale value on the interval
+ minimumValue = ChartHelper.AlignIntervalStart(
+ minimumValue,
+ axisInterval * margin / 100,
+ _internalIntervalType);
+ }
+
+ // Increase maximum if not zero. Make a space between chart type
+ // and the end of the chart area.
+ if( autoMaximum && max > 0 && margin != 0.0 )
+ {
+ maximumValue = minimumValue + ChartHelper.GetIntervalSize(
+ minimumValue,
+ (double)((Math.Floor(numberOfUnits / axisInterval / margin * 100)+2) * axisInterval * margin / 100),
+ _internalIntervalType);
+ }
+ }
+
+ InternalIntervalType = _internalIntervalType;
+
+ // Set interval for Grid lines Tick Marks and labels
+ return axisInterval;
+ }
+
+ /// <summary>
+ /// This function recalculates minimum maximum and interval for
+ /// number type axis. The function uses current values for minimum and
+ /// maximum to find new rounding values.
+ /// </summary>
+ /// <param name="minimumValue">Current Minimum value</param>
+ /// <param name="maximumValue">Current Maximum value</param>
+ /// <param name="shouldStartFromZero">Should start from zero flag.</param>
+ /// <param name="preferredNumberOfIntervals">Preferred number of intervals. Can be set to zero for dynamic mode.</param>
+ /// <param name="autoMaximum">Maximum value is Auto</param>
+ /// <param name="autoMinimum">Minimum value is Auto</param>
+ /// <returns>Interval</returns>
+ internal double EstimateNumberAxis(
+ ref double minimumValue,
+ ref double maximumValue,
+ bool shouldStartFromZero,
+ int preferredNumberOfIntervals,
+ bool autoMaximum,
+ bool autoMinimum )
+ {
+ double axisInterval;
+ double min = minimumValue;
+ double max = maximumValue;
+ double diff;
+
+ if( !roundedXValues && ( axisType == AxisName.X || axisType == AxisName.X2 ) )
+ {
+ diff = ChartArea.GetPointsInterval( false, 10 );
+ if( diff == 0 || ( max - min ) / diff > 20 )
+ {
+ diff = ( max - min ) / preferredNumberOfIntervals;
+ }
+
+ }
+ else
+ {
+ diff = ( max - min ) / preferredNumberOfIntervals;
+ }
+
+ // For 3D Charts interval could be changed. After rotation
+ // projection of axis could be very small.
+ if( !double.IsNaN( this.interval3DCorrection ) &&
+ ChartArea.Area3DStyle.Enable3D &&
+ !ChartArea.chartAreaIsCurcular)
+ {
+ diff = diff / this.interval3DCorrection;
+
+ // Do not change minimum and maximum with 3D correction.
+ if( max - min < diff )
+ {
+ diff = max - min;
+ }
+
+ this.interval3DCorrection = double.NaN;
+
+ if( diff != 0.0 )
+ {
+ diff = CalcInterval( diff );
+ }
+ }
+
+
+ if( autoMaximum || autoMinimum )
+ {
+ if( diff == 0 )
+ {
+ // Can not find interval. Minimum and maximum are same
+
+ max = min + 1;
+ diff = 0.2;
+ axisInterval = 0.2;
+ }
+ else
+ {
+ axisInterval = CalcInterval( diff );
+ }
+ }
+ else
+ {
+ axisInterval = diff;
+ }
+
+ // Case when minimum or maximum is set and interval is > maximum.
+ // Reasons overflow exception.
+ if( ((Axis)this).interval != 0 && ((Axis)this).interval > axisInterval && minimumValue + ((Axis)this).interval > maximumValue )
+ {
+ axisInterval = ((Axis)this).interval;
+ if( autoMaximum )
+ {
+ maximumValue = minimumValue + axisInterval;
+ }
+
+ if( autoMinimum )
+ {
+ minimumValue = maximumValue - axisInterval;
+ }
+ }
+
+ // The maximum and minimum rounding for Y Axes
+ if( axisType == AxisName.Y || axisType == AxisName.Y2 || ( roundedXValues && ( axisType == AxisName.X || axisType == AxisName.X2 )))
+ {
+ // Start from zero for the 100% chart types
+ bool minIsZero = false;
+ bool maxIsZero = false;
+ if(ChartArea.hundredPercent)
+ {
+ minIsZero = (minimumValue == 0.0);
+ maxIsZero = (maximumValue == 0.0);
+ }
+
+ // Round min/max values
+ RoundedValues( axisInterval, shouldStartFromZero, autoMaximum, autoMinimum, ref minimumValue, ref maximumValue );
+
+ // Do not allow min/max values more than a hundred
+ if(ChartArea.hundredPercent)
+ {
+ if(autoMinimum)
+ {
+ if(minimumValue < -100)
+ minimumValue = -100;
+ if(minIsZero)
+ minimumValue = 0;
+ }
+
+ if(autoMaximum)
+ {
+ if(maximumValue > 100)
+ maximumValue = 100;
+ if(maxIsZero)
+ maximumValue = 0;
+ }
+ }
+ }
+
+ // Set interval for Grid lines Tick Marks and labels
+ return axisInterval;
+ }
+
+ #endregion
+ }
+}
+
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/AxisScaleBreaks.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/AxisScaleBreaks.cs
new file mode 100644
index 00000000000..20306ff0618
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/AxisScaleBreaks.cs
@@ -0,0 +1,1108 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: AxisScaleBreaks.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: AxisScaleBreakStyle
+//
+// Purpose: Automatic scale breaks feature related classes.
+//
+// Reviewed:
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Drawing2D;
+using System.Globalization;
+
+#if Microsoft_CONTROL
+
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+ using System.Windows.Forms.DataVisualization.Charting;
+
+#else
+ using System.Web;
+ using System.Web.UI;
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ #region Enumerations
+
+ /// <summary>
+ /// An enumeration of line styles for axis scale breaks.
+ /// </summary>
+ public enum BreakLineStyle
+ {
+ /// <summary>
+ /// No scale break line visible.
+ /// </summary>
+ None,
+
+ /// <summary>
+ /// Straight scale break.
+ /// </summary>
+ Straight,
+
+ /// <summary>
+ /// Wave scale break.
+ /// </summary>
+ Wave,
+
+ /// <summary>
+ /// Ragged scale break.
+ /// </summary>
+ Ragged,
+ }
+
+ /// <summary>
+ /// An enumeration which indicates whether an axis segment should start
+ /// from zero when scale break is used.
+ /// </summary>
+ public enum StartFromZero
+ {
+ /// <summary>
+ /// Auto mode
+ /// </summary>
+ Auto,
+
+ /// <summary>
+ /// Start the axis segment scale from zero.
+ /// </summary>
+ Yes,
+
+ /// <summary>
+ /// Do not start the axis segment scale from zero.
+ /// </summary>
+ No
+
+ };
+
+ #endregion // Enumerations
+
+ /// <summary>
+ /// <b>AxisScaleBreakStyle</b> class represents the settings that control the scale break.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeAxisScaleBreakStyle_AxisScaleBreakStyle"),
+ DefaultProperty("Enabled"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class AxisScaleBreakStyle
+ {
+ #region Fields
+
+ // Associated axis
+ internal Axis axis = null;
+
+ // True if scale breaks are enabled
+ private bool _enabled = false;
+
+ // AxisName of the break line
+ private BreakLineStyle _breakLineStyle = BreakLineStyle.Ragged;
+
+ // Spacing between scale segments created by scale breaks
+ private double _segmentSpacing = 1.5;
+
+ // Break line color
+ private Color _breakLineColor = Color.Black;
+
+ // Break line width
+ private int _breakLineWidth = 1;
+
+ // Break line style
+ private ChartDashStyle _breakLineDashStyle = ChartDashStyle.Solid;
+
+ // Minimum segment size in axis length percentage
+ private double _minSegmentSize = 10.0;
+
+ // Number of segments the axis is devided into to perform statistical analysis
+ private int _totalNumberOfSegments = 100;
+
+ // Minimum "empty" size to be replace by the scale break
+ private int _minimumNumberOfEmptySegments = 25;
+
+ // Maximum number of breaks
+ private int _maximumNumberOfBreaks = 2;
+
+ // Indicates if scale segment should start from zero.
+ private StartFromZero _startFromZero = StartFromZero.Auto;
+
+ #endregion // Fields
+
+ #region Constructor
+
+ /// <summary>
+ /// AxisScaleBreakStyle constructor.
+ /// </summary>
+ public AxisScaleBreakStyle()
+ {
+ }
+
+ /// <summary>
+ /// AxisScaleBreakStyle constructor.
+ /// </summary>
+ /// <param name="axis">Chart axis this class belongs to.</param>
+ internal AxisScaleBreakStyle(Axis axis)
+ {
+ this.axis = axis;
+ }
+
+ #endregion // Constructor
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets a flag which indicates whether one of the axis segments should start its scale from zero
+ /// when scale break is used.
+ /// </summary>
+ /// <remarks>
+ /// When property is set to <b>StartFromZero.Auto</b>, the range of the scale determines
+ /// if zero value should be included in the scale.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(StartFromZero.Auto),
+ SRDescription("DescriptionAttributeAxisScaleBreakStyle_StartFromZero"),
+ ]
+ public StartFromZero StartFromZero
+ {
+ get
+ {
+ return this._startFromZero;
+ }
+ set
+ {
+ this._startFromZero = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Maximum number of scale breaks that can be used.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(2),
+ SRDescription("DescriptionAttributeAxisScaleBreakStyle_MaxNumberOfBreaks"),
+ ]
+ public int MaxNumberOfBreaks
+ {
+ get
+ {
+ return this._maximumNumberOfBreaks;
+ }
+ set
+ {
+ if(value < 1 || value > 5)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionAxisScaleBreaksNumberInvalid));
+ }
+ this._maximumNumberOfBreaks = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Minimum axis scale region size, in percentage of the total axis length,
+ /// that can be collapsed with the scale break.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(25),
+ SRDescription("DescriptionAttributeAxisScaleBreakStyle_CollapsibleSpaceThreshold"),
+ ]
+ public int CollapsibleSpaceThreshold
+ {
+ get
+ {
+ return this._minimumNumberOfEmptySegments;
+ }
+ set
+ {
+ if(value < 10 || value > 90)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionAxisScaleBreaksCollapsibleSpaceInvalid));
+ }
+ this._minimumNumberOfEmptySegments = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag which determines if axis automatic scale breaks are enabled.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeAxisScaleBreakStyle_Enabled"),
+ ParenthesizePropertyNameAttribute(true),
+ ]
+ public bool Enabled
+ {
+ get
+ {
+ return this._enabled;
+ }
+ set
+ {
+ this._enabled = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the style of the scale break line.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(BreakLineStyle.Ragged),
+ SRDescription("DescriptionAttributeAxisScaleBreakStyle_BreakLineType"),
+ ]
+ public BreakLineStyle BreakLineStyle
+ {
+ get
+ {
+ return this._breakLineStyle;
+ }
+ set
+ {
+ this._breakLineStyle = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the spacing of the scale break.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(1.5),
+ SRDescription("DescriptionAttributeAxisScaleBreakStyle_Spacing"),
+ ]
+ public double Spacing
+ {
+ get
+ {
+ return this._segmentSpacing;
+ }
+ set
+ {
+ if(value < 0.0 || value > 10)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionAxisScaleBreaksSpacingInvalid));
+ }
+ this._segmentSpacing = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the color of the scale break line.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeLineColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ public Color LineColor
+ {
+ get
+ {
+ return this._breakLineColor;
+ }
+ set
+ {
+ this._breakLineColor = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the width of the scale break line.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(1),
+ SRDescription("DescriptionAttributeLineWidth"),
+ ]
+ public int LineWidth
+ {
+ get
+ {
+ return this._breakLineWidth;
+ }
+ set
+ {
+ if(value < 1.0 || value > 10)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionAxisScaleBreaksLineWidthInvalid));
+ }
+ this._breakLineWidth = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the line style of the scale break line.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(ChartDashStyle.Solid),
+ SRDescription("DescriptionAttributeLineDashStyle"),
+ ]
+ public ChartDashStyle LineDashStyle
+ {
+ get
+ {
+ return this._breakLineDashStyle;
+ }
+ set
+ {
+ this._breakLineDashStyle = value;
+ this.Invalidate();
+ }
+ }
+
+ #endregion // Properties
+
+ #region Helper Methods
+
+ /// <summary>
+ /// Checks if automatic scale breaks are currently enabled.
+ /// </summary>
+ /// <returns>True if scale breaks are currently enabled.</returns>
+ internal bool IsEnabled()
+ {
+ // Axis scale breaks must be enabled AND supported by the axis.
+ if(this.Enabled &&
+ this.CanUseAxisScaleBreaks())
+ {
+ return true;
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// Checks if scale breaks can be used on specified axis.
+ /// </summary>
+ /// <returns>True if scale breaks can be used on this axis</returns>
+ internal bool CanUseAxisScaleBreaks()
+ {
+ // Check input parameters
+ if(this.axis == null || this.axis.ChartArea == null || this.axis.ChartArea.Common.Chart == null)
+ {
+ return false;
+ }
+
+ // No scale breaks in 3D charts
+ if(this.axis.ChartArea.Area3DStyle.Enable3D)
+ {
+ return false;
+ }
+
+ // Axis scale break can only be applied to the Y and Y 2 axis
+ if(this.axis.axisType == AxisName.X || this.axis.axisType == AxisName.X2)
+ {
+ return false;
+ }
+
+ // No scale breaks for logarithmic axis
+ if(this.axis.IsLogarithmic)
+ {
+ return false;
+ }
+
+ // No scale breaks if axis zooming is enabled
+ if(this.axis.ScaleView.IsZoomed)
+ {
+ return false;
+ }
+
+ // Check series associated with this axis
+ ArrayList axisSeries = AxisScaleBreakStyle.GetAxisSeries(this.axis);
+ foreach(Series series in axisSeries)
+ {
+
+ // Some special chart type are not supported
+ if(series.ChartType == SeriesChartType.Renko ||
+ series.ChartType == SeriesChartType.PointAndFigure)
+ {
+ return false;
+ }
+
+
+ // Get chart type interface
+ IChartType chartType = this.axis.ChartArea.Common.ChartTypeRegistry.GetChartType(series.ChartTypeName);
+ if(chartType == null)
+ {
+ return false;
+ }
+
+ // Circular and stacked chart types can not use scale breaks
+ if(chartType.CircularChartArea ||
+ chartType.Stacked ||
+ !chartType.RequireAxes)
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /// <summary>
+ /// Gets a list of series objects attached to the specified axis.
+ /// </summary>
+ /// <param name="axis">Axis to get the series for.</param>
+ /// <returns>A list of series that are attached to the specified axis.</returns>
+ static internal ArrayList GetAxisSeries(Axis axis)
+ {
+ ArrayList seriesList = new ArrayList();
+ if(axis != null && axis.ChartArea != null && axis.ChartArea.Common.Chart != null)
+ {
+ // Iterate through series in the chart
+ foreach(Series series in axis.ChartArea.Common.Chart.Series)
+ {
+ // Series should be on the same chart area and visible
+ if(series.ChartArea == axis.ChartArea.Name &&
+ series.Enabled)
+ {
+ // Check primary/secondary axis
+ if( (axis.axisType == AxisName.Y && series.YAxisType == AxisType.Secondary) ||
+ (axis.axisType == AxisName.Y2 && series.YAxisType == AxisType.Primary))
+ {
+ continue;
+ }
+
+ // Add series into the list
+ seriesList.Add(series);
+ }
+ }
+ }
+ return seriesList;
+ }
+
+ /// <summary>
+ /// Invalidate chart control.
+ /// </summary>
+ private void Invalidate()
+ {
+ if(this.axis != null)
+ {
+ this.axis.Invalidate();
+ }
+ }
+
+ #endregion // Helper Methods
+
+ #region Series StatisticFormula Methods
+
+ /// <summary>
+ /// Get collection of axis segments to present scale breaks.
+ /// </summary>
+ /// <param name="axisSegments">Collection of axis scale segments.</param>
+ internal void GetAxisSegmentForScaleBreaks(AxisScaleSegmentCollection axisSegments)
+ {
+ // Clear segment collection
+ axisSegments.Clear();
+
+ // Check if scale breaks are enabled
+ if(this.IsEnabled())
+ {
+ // Fill collection of segments
+ this.FillAxisSegmentCollection(axisSegments);
+
+ // Check if more than 1 segments were defined
+ if(axisSegments.Count >= 1)
+ {
+ // Get index of segment which scale should start from zero
+ int startFromZeroSegmentIndex = this.GetStartScaleFromZeroSegmentIndex(axisSegments);
+
+ // Calculate segment interaval and round the scale
+ int index = 0;
+ foreach(AxisScaleSegment axisScaleSegment in axisSegments)
+ {
+ // Check if segment scale should start from zero
+ bool startFromZero = (index == startFromZeroSegmentIndex) ? true : false;
+
+ // Calculate interval and round scale
+ double minimum = axisScaleSegment.ScaleMinimum;
+ double maximum = axisScaleSegment.ScaleMaximum;
+ axisScaleSegment.Interval = this.axis.EstimateNumberAxis(
+ ref minimum, ref maximum, startFromZero, this.axis.prefferedNumberofIntervals, true, true);
+ axisScaleSegment.ScaleMinimum = minimum;
+ axisScaleSegment.ScaleMaximum = maximum;
+
+ // Make sure new scale break value range do not exceed axis current scale
+ if (axisScaleSegment.ScaleMinimum < this.axis.Minimum)
+ {
+ axisScaleSegment.ScaleMinimum = this.axis.Minimum;
+ }
+ if (axisScaleSegment.ScaleMaximum > this.axis.Maximum)
+ {
+ axisScaleSegment.ScaleMaximum = this.axis.Maximum;
+ }
+
+ // Increase segment index
+ ++index;
+ }
+
+ // Defined axis scale segments cannot overlap.
+ // Check for overlapping and join segments or readjust min/max.
+ bool adjustPosition = false;
+ AxisScaleSegment prevSegment = axisSegments[0];
+ for (int segmentIndex = 1; segmentIndex < axisSegments.Count; segmentIndex++)
+ {
+ AxisScaleSegment currentSegment = axisSegments[segmentIndex];
+ if (currentSegment.ScaleMinimum <= prevSegment.ScaleMaximum)
+ {
+ if (currentSegment.ScaleMaximum > prevSegment.ScaleMaximum)
+ {
+ // If segments are partially overlapping make sure the previous
+ // segment scale is extended
+ prevSegment.ScaleMaximum = currentSegment.ScaleMaximum;
+ }
+
+ // Remove the overlapped segment
+ adjustPosition = true;
+ axisSegments.RemoveAt(segmentIndex);
+ --segmentIndex;
+ }
+ else
+ {
+ prevSegment = currentSegment;
+ }
+ }
+
+ // Calculate the position of each segment
+ if (adjustPosition)
+ {
+ this.SetAxisSegmentPosition(axisSegments);
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets index of segment that should be started from zero.
+ /// </summary>
+ /// <param name="axisSegments">Axis scale segment collection.</param>
+ /// <returns>Index axis segment or -1.</returns>
+ private int GetStartScaleFromZeroSegmentIndex(AxisScaleSegmentCollection axisSegments)
+ {
+ if (this.StartFromZero == StartFromZero.Auto ||
+ this.StartFromZero == StartFromZero.Yes)
+ {
+ int index = 0;
+ foreach(AxisScaleSegment axisScaleSegment in axisSegments)
+ {
+ // Check if zero value is already part of the scale
+ if(axisScaleSegment.ScaleMinimum < 0.0 && axisScaleSegment.ScaleMaximum > 0.0)
+ {
+ return -1;
+ }
+
+ // As soon as we get first segment with positive minimum value or
+ // we reached last segment adjust scale to start from zero.
+ if(axisScaleSegment.ScaleMinimum > 0.0 ||
+ index == (axisSegments.Count - 1) )
+ {
+ // Check if setting minimum scale to zero will make the
+ // data points in the segment hard to read. This may hapen
+ // when the distance from zero to current minimum is
+ // significantly larger than current scale size.
+ if (this.StartFromZero == StartFromZero.Auto &&
+ axisScaleSegment.ScaleMinimum > 2.0 * (axisScaleSegment.ScaleMaximum - axisScaleSegment.ScaleMinimum) )
+ {
+ return -1;
+ }
+
+ return index;
+ }
+
+ // Increase segment index
+ ++index;
+ }
+ }
+ return -1;
+ }
+
+ /// <summary>
+ /// Sets position of all scale segments in the axis.
+ /// </summary>
+ /// <param name="axisSegments">Collection of axis scale segments.</param>
+ private void SetAxisSegmentPosition(AxisScaleSegmentCollection axisSegments)
+ {
+ // Calculate total number of points
+ int totalPointNumber = 0;
+ foreach(AxisScaleSegment axisScaleSegment in axisSegments)
+ {
+ if(axisScaleSegment.Tag is int)
+ {
+ totalPointNumber += (int)axisScaleSegment.Tag;
+ }
+ }
+
+ // Calculate segment minimum size
+ double minSize = Math.Min(this._minSegmentSize, Math.Floor(100.0 / axisSegments.Count));
+
+ // Set segment position
+ double currentPosition = 0.0;
+ for(int index = 0; index < axisSegments.Count; index++)
+ {
+ axisSegments[index].Position = (currentPosition > 100.0) ? 100.0 : currentPosition;
+ axisSegments[index].Size = Math.Round(((int)axisSegments[index].Tag) / (totalPointNumber / 100.0),5);
+ if(axisSegments[index].Size < minSize)
+ {
+ axisSegments[index].Size = minSize;
+ }
+
+ // Set spacing for all segments except the last one
+ if(index < (axisSegments.Count - 1) )
+ {
+ axisSegments[index].Spacing = this._segmentSpacing;
+ }
+
+ // Advance current position
+ currentPosition += axisSegments[index].Size;
+ }
+
+ // Make sure we do not exceed the 100% axis length
+ double totalHeight = 0.0;
+ do
+ {
+ // Calculate total height
+ totalHeight = 0.0;
+ double maxSize = double.MinValue;
+ int maxSizeIndex = -1;
+ for(int index = 0; index < axisSegments.Count; index++)
+ {
+ totalHeight += axisSegments[index].Size;
+ if(axisSegments[index].Size > maxSize)
+ {
+ maxSize = axisSegments[index].Size;
+ maxSizeIndex = index;
+ }
+ }
+
+ // If height is too large find largest segment
+ if(totalHeight > 100.0)
+ {
+ // Adjust segment size
+ axisSegments[maxSizeIndex].Size -= totalHeight - 100.0;
+ if(axisSegments[maxSizeIndex].Size < minSize)
+ {
+ axisSegments[maxSizeIndex].Size = minSize;
+ }
+
+ // Adjust position of the next segment
+ double curentPosition = axisSegments[maxSizeIndex].Position + axisSegments[maxSizeIndex].Size;
+ for(int index = maxSizeIndex + 1; index < axisSegments.Count; index++)
+ {
+ axisSegments[index].Position = curentPosition;
+ curentPosition += axisSegments[index].Size;
+ }
+ }
+
+ } while(totalHeight > 100.0);
+
+ }
+
+ /// <summary>
+ /// Fill collection of axis scale segments.
+ /// </summary>
+ /// <param name="axisSegments">Collection of axis segments.</param>
+ private void FillAxisSegmentCollection(AxisScaleSegmentCollection axisSegments)
+ {
+ // Clear axis segments collection
+ axisSegments.Clear();
+
+ // Get statistics for the series attached to the axis
+ double minYValue = 0.0;
+ double maxYValue = 0.0;
+ double segmentSize = 0.0;
+ double[] segmentMaxValue = null;
+ double[] segmentMinValue = null;
+ int[] segmentPointNumber = GetSeriesDataStatistics(
+ this._totalNumberOfSegments,
+ out minYValue,
+ out maxYValue,
+ out segmentSize,
+ out segmentMaxValue,
+ out segmentMinValue);
+ if (segmentPointNumber == null)
+ {
+ return;
+ }
+
+ // Calculate scale maximum and minimum
+ double minimum = minYValue;
+ double maximum = maxYValue;
+ this.axis.EstimateNumberAxis(
+ ref minimum,
+ ref maximum,
+ this.axis.IsStartedFromZero,
+ this.axis.prefferedNumberofIntervals,
+ true,
+ true);
+
+ // Make sure max/min Y values are not the same
+ if (maxYValue == minYValue)
+ {
+ return;
+ }
+
+ // Calculate the percentage of the scale range covered by the data range.
+ double dataRangePercent = (maxYValue - minYValue) / ((maximum - minimum) / 100.0);
+
+ // Get sequences of empty segments
+ ArrayList emptySequences = new ArrayList();
+ bool doneFlag = false;
+ while(!doneFlag)
+ {
+ doneFlag = true;
+
+ // Get longest sequence of segments with no points
+ int startSegment = 0;
+ int numberOfSegments = 0;
+ this.GetLargestSequenseOfSegmentsWithNoPoints(
+ segmentPointNumber,
+ out startSegment,
+ out numberOfSegments);
+
+ // Adjust minimum empty segments number depending on current segments
+ int minEmptySegments = (int)(this._minimumNumberOfEmptySegments * (100.0 / dataRangePercent));
+ if(axisSegments.Count > 0 && numberOfSegments > 0)
+ {
+ // Find the segment which contain newly found empty segments sequence
+ foreach(AxisScaleSegment axisScaleSegment in axisSegments)
+ {
+ if(startSegment > 0 && (startSegment + numberOfSegments) <= segmentMaxValue.Length - 1)
+ {
+ if(segmentMaxValue[startSegment - 1] >= axisScaleSegment.ScaleMinimum &&
+ segmentMinValue[startSegment + numberOfSegments] <= axisScaleSegment.ScaleMaximum)
+ {
+ // Get percentage of segment scale that is empty and suggested for collapsing
+ double segmentScaleRange = axisScaleSegment.ScaleMaximum - axisScaleSegment.ScaleMinimum;
+ double emptySpaceRange = segmentMinValue[startSegment + numberOfSegments] - segmentMaxValue[startSegment - 1];
+ double emptySpacePercent = emptySpaceRange / (segmentScaleRange / 100.0);
+ emptySpacePercent = emptySpacePercent / 100 * axisScaleSegment.Size;
+
+ if(emptySpacePercent > minEmptySegments &&
+ numberOfSegments > this._minSegmentSize)
+ {
+ minEmptySegments = numberOfSegments;
+ }
+ }
+ }
+ }
+ }
+
+ // Check if found sequence is long enough
+ if(numberOfSegments >= minEmptySegments)
+ {
+ doneFlag = false;
+
+ // Store start segment and number of segments in the list
+ emptySequences.Add(startSegment);
+ emptySequences.Add(numberOfSegments);
+
+ // Check if there are any emty segments sequence found
+ axisSegments.Clear();
+ if(emptySequences.Count > 0)
+ {
+ double segmentFrom = double.NaN;
+ double segmentTo = double.NaN;
+
+ // Based on the segments that need to be excluded create axis segments that
+ // will present on the axis scale.
+ int numberOfPoints = 0;
+ for(int index = 0; index < segmentPointNumber.Length; index++)
+ {
+ // Check if current segment is excluded
+ bool excludedSegment = this.IsExcludedSegment(emptySequences, index);
+
+ // If not excluded segment - update from/to range if they were set
+ if(!excludedSegment &&
+ !double.IsNaN(segmentMinValue[index]) &&
+ !double.IsNaN(segmentMaxValue[index]))
+ {
+ // Calculate total number of points
+ numberOfPoints += segmentPointNumber[index];
+
+ // Set From/To of the visible segment
+ if(double.IsNaN(segmentFrom))
+ {
+ segmentFrom = segmentMinValue[index];
+ segmentTo = segmentMaxValue[index];
+ }
+ else
+ {
+ segmentTo = segmentMaxValue[index];
+ }
+ }
+
+ // If excluded or last segment - add current visible segment range
+ if(!double.IsNaN(segmentFrom) &&
+ (excludedSegment || index == (segmentPointNumber.Length - 1) ))
+ {
+ // Make sure To and From do not match
+ if(segmentTo == segmentFrom)
+ {
+ segmentFrom -= segmentSize;
+ segmentTo += segmentSize;
+ }
+
+ // Add axis scale segment
+ AxisScaleSegment axisScaleSegment = new AxisScaleSegment();
+ axisScaleSegment.ScaleMaximum = segmentTo;
+ axisScaleSegment.ScaleMinimum = segmentFrom;
+ axisScaleSegment.Tag = numberOfPoints;
+ axisSegments.Add(axisScaleSegment);
+
+ // Reset segment range
+ segmentFrom = double.NaN;
+ segmentTo = double.NaN;
+ numberOfPoints = 0;
+ }
+ }
+ }
+
+ // Calculate the position of each segment
+ this.SetAxisSegmentPosition(axisSegments);
+ }
+
+ // Make sure we do not exceed specified number of breaks
+ if( (axisSegments.Count - 1) >= this._maximumNumberOfBreaks)
+ {
+ doneFlag = true;
+ }
+ }
+
+ }
+
+ /// <summary>
+ /// Check if segment was excluded.
+ /// </summary>
+ /// <param name="excludedSegments">Array of segment indexes.</param>
+ /// <param name="segmentIndex">Index of the segment to check.</param>
+ /// <returns>True if segment with specified index is marked as excluded.</returns>
+ private bool IsExcludedSegment(ArrayList excludedSegments, int segmentIndex)
+ {
+ for(int index = 0; index < excludedSegments.Count; index += 2)
+ {
+ if(segmentIndex >= (int)excludedSegments[index] &&
+ segmentIndex < (int)excludedSegments[index] + (int)excludedSegments[index + 1])
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// Collect statistical information about the series.
+ /// </summary>
+ /// <param name="segmentCount">Segment count.</param>
+ /// <param name="minYValue">Minimum Y value.</param>
+ /// <param name="maxYValue">Maximum Y value.</param>
+ /// <param name="segmentSize">Segment size.</param>
+ /// <param name="segmentMaxValue">Array of segment scale maximum values.</param>
+ /// <param name="segmentMinValue">Array of segment scale minimum values.</param>
+ /// <returns></returns>
+ internal int[] GetSeriesDataStatistics(
+ int segmentCount,
+ out double minYValue,
+ out double maxYValue,
+ out double segmentSize,
+ out double[] segmentMaxValue,
+ out double[] segmentMinValue)
+ {
+ // Get all series associated with the axis
+ ArrayList axisSeries = AxisScaleBreakStyle.GetAxisSeries(this.axis);
+
+ // Get range of Y values from axis series
+ minYValue = 0.0;
+ maxYValue = 0.0;
+ axis.Common.DataManager.GetMinMaxYValue(axisSeries, out minYValue, out maxYValue);
+
+ int numberOfPoints = 0;
+ foreach (Series series in axisSeries)
+ {
+ numberOfPoints = Math.Max(numberOfPoints, series.Points.Count);
+ }
+
+ if (axisSeries.Count == 0 || numberOfPoints == 0)
+ {
+ segmentSize = 0.0;
+ segmentMaxValue = null;
+ segmentMinValue = null;
+ return null;
+ }
+
+ // Split range of values into predefined number of segments and calculate
+ // how many points will be in each segment.
+ segmentSize = (maxYValue - minYValue) / segmentCount;
+ int[] segmentPointNumber = new int[segmentCount];
+ segmentMaxValue = new double[segmentCount];
+ segmentMinValue = new double[segmentCount];
+ for(int index = 0; index < segmentCount; index++)
+ {
+ segmentMaxValue[index] = double.NaN;
+ segmentMinValue[index] = double.NaN;
+ }
+ foreach(Series series in axisSeries)
+ {
+ // Get number of Y values to process
+ int maxYValueCount = 1;
+ IChartType chartType = this.axis.ChartArea.Common.ChartTypeRegistry.GetChartType(series.ChartTypeName);
+ if(chartType != null)
+ {
+ if(chartType.ExtraYValuesConnectedToYAxis && chartType.YValuesPerPoint > 1)
+ {
+ maxYValueCount = chartType.YValuesPerPoint;
+ }
+ }
+
+ // Iterate throug all data points
+ foreach(DataPoint dataPoint in series.Points)
+ {
+ if(!dataPoint.IsEmpty)
+ {
+ // Iterate through all yValues
+ for(int yValueIndex = 0; yValueIndex < maxYValueCount; yValueIndex++)
+ {
+ // Calculate index of the scale segment
+ int segmentIndex = (int)Math.Floor((dataPoint.YValues[yValueIndex] - minYValue) / segmentSize);
+ if(segmentIndex < 0)
+ {
+ segmentIndex = 0;
+ }
+ if(segmentIndex > segmentCount - 1)
+ {
+ segmentIndex = segmentCount - 1;
+ }
+
+ // Increase number points in that segment
+ ++segmentPointNumber[segmentIndex];
+
+ // Store Min/Max values for the segment
+ if(segmentPointNumber[segmentIndex] == 1)
+ {
+ segmentMaxValue[segmentIndex] = dataPoint.YValues[yValueIndex];
+ segmentMinValue[segmentIndex] = dataPoint.YValues[yValueIndex];
+ }
+ else
+ {
+ segmentMaxValue[segmentIndex] = Math.Max(segmentMaxValue[segmentIndex], dataPoint.YValues[yValueIndex]);
+ segmentMinValue[segmentIndex] = Math.Min(segmentMinValue[segmentIndex], dataPoint.YValues[yValueIndex]);
+ }
+ }
+ }
+ }
+ }
+
+ return segmentPointNumber;
+ }
+
+ /// <summary>
+ /// Gets largest segment with no points.
+ /// </summary>
+ /// <param name="segmentPointNumber">Array that stores number of points for each segment.</param>
+ /// <param name="startSegment">Returns largest empty segment sequence starting index.</param>
+ /// <param name="numberOfSegments">Returns largest empty segment sequence length.</param>
+ /// <returns>True if long empty segment sequence was found.</returns>
+ internal bool GetLargestSequenseOfSegmentsWithNoPoints(
+ int[] segmentPointNumber,
+ out int startSegment,
+ out int numberOfSegments)
+ {
+ // Find the longest sequence of empty segments
+ startSegment = -1;
+ numberOfSegments = 0;
+ int currentSegmentStart = -1;
+ int currentNumberOfSegments = -1;
+ for(int index = 0; index < segmentPointNumber.Length; index++)
+ {
+ // Check for the segment with no points
+ if(segmentPointNumber[index] == 0)
+ {
+ if(currentSegmentStart == -1)
+ {
+ currentSegmentStart = index;
+ currentNumberOfSegments = 1;
+ }
+ else
+ {
+ ++currentNumberOfSegments;
+ }
+ }
+
+ // Check if longest sequence found
+ if(currentNumberOfSegments > 0 &&
+ (segmentPointNumber[index] != 0 || index == segmentPointNumber.Length - 1))
+ {
+ if(currentNumberOfSegments > numberOfSegments)
+ {
+ startSegment = currentSegmentStart;
+ numberOfSegments = currentNumberOfSegments;
+ }
+ currentSegmentStart = -1;
+ currentNumberOfSegments = 0;
+ }
+ }
+
+ // Store value of "-1" in found sequence
+ if(numberOfSegments != 0)
+ {
+ for(int index = startSegment; index < (startSegment + numberOfSegments); index++)
+ {
+ segmentPointNumber[index] = -1;
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ #endregion // Series StatisticFormula Methods
+ }
+}
+
+
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/AxisScaleSegments.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/AxisScaleSegments.cs
new file mode 100644
index 00000000000..4a64ab83694
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/AxisScaleSegments.cs
@@ -0,0 +1,1014 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: AxisScaleSegments.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: AxisScaleSegment, AxisScaleSegmentCollection
+//
+// Purpose:
+//
+// Reviewed:
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Drawing2D;
+using System.Globalization;
+#if Microsoft_CONTROL
+
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+ using System.Windows.Forms.DataVisualization.Charting;
+
+#else
+ using System.Web;
+ using System.Web.UI;
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ /// <summary>
+ /// <b>AxisScaleSegment</b> class represents a single segment of the axis with
+ /// it's own scale and intervals.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeAxisScaleSegment_AxisScaleSegment"),
+ ]
+ internal class AxisScaleSegment
+ {
+ #region Fields
+
+ // Associated axis
+ internal Axis axis = null;
+
+ // Axis segment position in percent of the axis size
+ private double _position = 0.0;
+
+ // Axis segment size in percent of the axis size
+ private double _size = 0.0;
+
+ // Axis segment spacing in percent of the axis size
+ private double _spacing = 0.0;
+
+ // Axis segment scale minimum value
+ private double _scaleMinimum = 0.0;
+
+ // Axis segment scale maximum value
+ private double _scaleMaximum = 0.0;
+
+ // Axis segment interval offset.
+ private double _intervalOffset = 0;
+
+ // Axis segment interval.
+ private double _interval = 0;
+
+ // Axis segment interval units type.
+ private DateTimeIntervalType _intervalType = DateTimeIntervalType.Auto;
+
+ // Axis segment interval offset units type.
+ private DateTimeIntervalType _intervalOffsetType = DateTimeIntervalType.Auto;
+
+ // Object associated with the segment
+ private object _tag = null;
+
+ // Stack used to save/load axis settings
+ private Stack _oldAxisSettings = new Stack();
+
+ #endregion // Fields
+
+ #region Constructor
+
+ /// <summary>
+ /// Default object constructor.
+ /// </summary>
+ public AxisScaleSegment()
+ {
+ }
+
+ #endregion // Constructor
+
+ #region Properties
+
+ /// <summary>
+ /// Axis segment position in axis size percentage.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(0.0),
+ SRDescription("DescriptionAttributeAxisScaleSegment_Position"),
+ ]
+ public double Position
+ {
+ get
+ {
+ return this._position;
+ }
+ set
+ {
+ if(value < 0.0 || value > 100.0)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionAxisScaleSegmentsPositionInvalid));
+ }
+ this._position = value;
+ }
+ }
+
+ /// <summary>
+ /// Axis segment size in axis size percentage.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(0.0),
+ SRDescription("DescriptionAttributeAxisScaleSegment_Size"),
+ ]
+ public double Size
+ {
+ get
+ {
+ return this._size;
+ }
+ set
+ {
+ if(value < 0.0 || value > 100.0)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionAxisScaleSegmentsSizeInvalid));
+ }
+ this._size = value;
+ }
+ }
+
+ /// <summary>
+ /// Axis segment spacing in axis size percentage.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(0.0),
+ SRDescription("DescriptionAttributeAxisScaleSegment_Spacing"),
+ ]
+ public double Spacing
+ {
+ get
+ {
+ return this._spacing;
+ }
+ set
+ {
+ if(value < 0.0 || value > 100.0)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionAxisScaleSegmentsSpacingInvalid));
+ }
+ this._spacing = value;
+ }
+ }
+
+ /// <summary>
+ /// Axis segment scale maximum value.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(0.0),
+ SRDescription("DescriptionAttributeAxisScaleSegment_ScaleMaximum"),
+ ]
+ public double ScaleMaximum
+ {
+ get
+ {
+ return this._scaleMaximum;
+ }
+ set
+ {
+ this._scaleMaximum = value;
+ }
+ }
+
+ /// <summary>
+ /// Axis segment scale minimum value.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(0.0),
+ SRDescription("DescriptionAttributeAxisScaleSegment_ScaleMinimum"),
+ ]
+ public double ScaleMinimum
+ {
+ get
+ {
+ return this._scaleMinimum;
+ }
+ set
+ {
+ this._scaleMinimum = value;
+ }
+ }
+
+
+ /// <summary>
+ /// Axis segment interval size.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeInterval"),
+ DefaultValue(0.0),
+ SRDescription("DescriptionAttributeAxisScaleSegment_Interval"),
+ TypeConverter(typeof(AxisIntervalValueConverter)),
+ ]
+ public double Interval
+ {
+ get
+ {
+ return this._interval;
+ }
+ set
+ {
+ // Axis interval properties must be set
+ if(double.IsNaN(value))
+ {
+ this._interval = 0;
+ }
+ else
+ {
+ this._interval = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Axis segment interval offset.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeInterval"),
+ DefaultValue(0.0),
+ SRDescription("DescriptionAttributeAxisScaleSegment_IntervalOffset"),
+ TypeConverter(typeof(AxisIntervalValueConverter))
+ ]
+ public double IntervalOffset
+ {
+ get
+ {
+ return _intervalOffset;
+ }
+ }
+
+ /// <summary>
+ /// Axis segment interval type.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeInterval"),
+ DefaultValue(DateTimeIntervalType.Auto),
+ SRDescription("DescriptionAttributeAxisScaleSegment_IntervalType"),
+ ]
+ public DateTimeIntervalType IntervalType
+ {
+ get
+ {
+ return this._intervalType;
+ }
+ set
+ {
+ // Axis interval properties must be set
+ if(value == DateTimeIntervalType.NotSet)
+ {
+ this._intervalType = DateTimeIntervalType.Auto;
+ }
+ else
+ {
+ _intervalType = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Axis segment interval offset type.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeInterval"),
+ DefaultValue(DateTimeIntervalType.Auto),
+ SRDescription("DescriptionAttributeAxisScaleSegment_IntervalOffsetType"),
+ ]
+ public DateTimeIntervalType IntervalOffsetType
+ {
+ get
+ {
+ return this._intervalOffsetType;
+ }
+ }
+
+ /// <summary>
+ /// Object associated with axis scale segment.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Browsable(false),
+ DefaultValue(null),
+ SRDescription("DescriptionAttributeAxisScaleSegment_Tag"),
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
+ SerializationVisibility(SerializationVisibility.Hidden),
+ ]
+ public object Tag
+ {
+ get
+ {
+ return this._tag;
+ }
+ set
+ {
+ this._tag = value;
+ }
+ }
+
+ #endregion // Properties
+
+ #region Break Line Painting Methods
+
+ /// <summary>
+ /// Paints the axis break line.
+ /// </summary>
+ /// <param name="graph">Chart graphics to use.</param>
+ /// <param name="nextSegment">Axis scale segment next to current.</param>
+ internal void PaintBreakLine(ChartGraphics graph, AxisScaleSegment nextSegment)
+ {
+ // Get break line position
+ RectangleF breakPosition = this.GetBreakLinePosition(graph, nextSegment);
+
+ // Get top line graphics path
+ GraphicsPath breakLinePathTop = this.GetBreakLinePath(breakPosition, true);
+ GraphicsPath breakLinePathBottom = null;
+
+ // Clear break line space using chart color behind the area
+ if(breakPosition.Width > 0f && breakPosition.Height > 0f)
+ {
+ // Get bottom line graphics path
+ breakLinePathBottom = this.GetBreakLinePath(breakPosition, false);
+
+ // Clear plotting area background
+ using(GraphicsPath fillPath = new GraphicsPath())
+ {
+ // Create fill path out of top and bottom break lines
+ fillPath.AddPath(breakLinePathTop, true);
+ fillPath.Reverse();
+ fillPath.AddPath(breakLinePathBottom, true);
+ fillPath.CloseAllFigures();
+
+ // Use chart back color to fill the area
+ using(Brush fillBrush = this.GetChartFillBrush(graph))
+ {
+ graph.FillPath(fillBrush, fillPath);
+
+ // Check if shadow exsits in chart area
+ if( this.axis.ChartArea.ShadowOffset != 0 && !this.axis.ChartArea.ShadowColor.IsEmpty)
+ {
+ // Clear shadow
+ RectangleF shadowPartRect = breakPosition;
+ if( this.axis.AxisPosition == AxisPosition.Right || this.axis.AxisPosition == AxisPosition.Left )
+ {
+ shadowPartRect.Y += this.axis.ChartArea.ShadowOffset;
+ shadowPartRect.Height -= this.axis.ChartArea.ShadowOffset;
+ shadowPartRect.X = shadowPartRect.Right - 1;
+ shadowPartRect.Width = this.axis.ChartArea.ShadowOffset + 2;
+ }
+ else
+ {
+ shadowPartRect.X += this.axis.ChartArea.ShadowOffset;
+ shadowPartRect.Width -= this.axis.ChartArea.ShadowOffset;
+ shadowPartRect.Y = shadowPartRect.Bottom - 1;
+ shadowPartRect.Height = this.axis.ChartArea.ShadowOffset + 2;
+ }
+ graph.FillRectangle(fillBrush, shadowPartRect);
+
+ // Draw new shadow
+ using(GraphicsPath shadowPath = new GraphicsPath())
+ {
+ shadowPath.AddPath(breakLinePathTop, false);
+
+ // Define maximum size
+ float size = this.axis.ChartArea.ShadowOffset;
+ if( this.axis.AxisPosition == AxisPosition.Right || this.axis.AxisPosition == AxisPosition.Left )
+ {
+ size = Math.Min(size, breakPosition.Height);
+ }
+ else
+ {
+ size = Math.Min(size, breakPosition.Width);
+ }
+
+ // Define step to increase transperancy
+ int transparencyStep = (int)(this.axis.ChartArea.ShadowColor.A / size);
+
+ // Set clip region to achieve spacing of the shadow
+ // Start with the plotting rectangle position
+ RectangleF clipRegion = graph.GetAbsoluteRectangle(this.axis.PlotAreaPosition.ToRectangleF());
+ if( this.axis.AxisPosition == AxisPosition.Right || this.axis.AxisPosition == AxisPosition.Left )
+ {
+ clipRegion.X += this.axis.ChartArea.ShadowOffset;
+ clipRegion.Width += this.axis.ChartArea.ShadowOffset;
+ }
+ else
+ {
+ clipRegion.Y += this.axis.ChartArea.ShadowOffset;
+ clipRegion.Height += this.axis.ChartArea.ShadowOffset;
+ }
+ graph.SetClip(graph.GetRelativeRectangle(clipRegion));
+
+ // Draw several lines to form shadow
+ for(int index = 0; index < size; index ++)
+ {
+ using(Matrix newMatrix = new Matrix())
+ {
+ // Shift top break line by 1 pixel
+ if( this.axis.AxisPosition == AxisPosition.Right || this.axis.AxisPosition == AxisPosition.Left )
+ {
+ newMatrix.Translate(0f, 1f);
+ }
+ else
+ {
+ newMatrix.Translate(1f, 0f);
+ }
+ shadowPath.Transform(newMatrix);
+ }
+
+ // Get line color
+ Color color = Color.FromArgb(
+ this.axis.ChartArea.ShadowColor.A - transparencyStep * index,
+ this.axis.ChartArea.ShadowColor);
+
+ using(Pen shadowPen = new Pen(color, 1))
+ {
+ // Draw shadow
+ graph.DrawPath(shadowPen, shadowPath);
+ }
+ }
+
+ graph.ResetClip();
+ }
+ }
+ }
+ }
+ }
+
+ // Draw Separator Line(s)
+ if(this.axis.ScaleBreakStyle.BreakLineStyle != BreakLineStyle.None)
+ {
+ using(Pen pen = new Pen(this.axis.ScaleBreakStyle.LineColor, this.axis.ScaleBreakStyle.LineWidth))
+ {
+ // Set line style
+ pen.DashStyle = graph.GetPenStyle(this.axis.ScaleBreakStyle.LineDashStyle);
+
+ // Draw break lines
+ graph.DrawPath(pen, breakLinePathTop);
+ if(breakPosition.Width > 0f && breakPosition.Height > 0f)
+ {
+ graph.DrawPath(pen, breakLinePathBottom);
+ }
+ }
+ }
+
+ // Dispose break line paths
+ breakLinePathTop.Dispose();
+ breakLinePathTop = null;
+ if(breakLinePathBottom != null)
+ {
+ breakLinePathBottom.Dispose();
+ breakLinePathBottom = null;
+ }
+
+ }
+
+ /// <summary>
+ /// Get fill brush used to fill axis break lines spacing.
+ /// </summary>
+ /// <param name="graph">chart graphics.</param>
+ /// <returns>Fill brush.</returns>
+ private Brush GetChartFillBrush(ChartGraphics graph)
+ {
+ Chart chart = this.axis.ChartArea.Common.Chart;
+ Brush brush = null;
+
+ if( chart.BackGradientStyle == GradientStyle.None )
+ {
+ brush = new SolidBrush(chart.BackColor);
+ }
+ else
+ {
+ // If a gradient type is set create a brush with gradient
+ brush = graph.GetGradientBrush(new RectangleF(0, 0, chart.chartPicture.Width - 1, chart.chartPicture.Height - 1), chart.BackColor, chart.BackSecondaryColor, chart.BackGradientStyle);
+ }
+
+ if( chart.BackHatchStyle != ChartHatchStyle.None )
+ {
+ brush = graph.GetHatchBrush( chart.BackHatchStyle, chart.BackColor, chart.BackSecondaryColor );
+ }
+
+ if( chart.BackImage.Length > 0 &&
+ chart.BackImageWrapMode != ChartImageWrapMode.Unscaled &&
+ chart.BackImageWrapMode != ChartImageWrapMode.Scaled)
+ {
+ brush = graph.GetTextureBrush(chart.BackImage, chart.BackImageTransparentColor, chart.BackImageWrapMode, chart.BackColor );
+ }
+
+ return brush;
+ }
+
+ /// <summary>
+ /// Gets a path of the break line for specified position.
+ /// </summary>
+ /// <param name="breakLinePosition">Break line position.</param>
+ /// <param name="top">Indicates if top or bottom break line path should be retrieved.</param>
+ /// <returns>Graphics path with break line path.</returns>
+ private GraphicsPath GetBreakLinePath(RectangleF breakLinePosition, bool top)
+ {
+ GraphicsPath path = new GraphicsPath();
+
+ if(this.axis.ScaleBreakStyle.BreakLineStyle == BreakLineStyle.Wave)
+ {
+ PointF[] points = null;
+ int pointNumber = 0;
+ if( this.axis.AxisPosition == AxisPosition.Right || this.axis.AxisPosition == AxisPosition.Left )
+ {
+ float startX = breakLinePosition.X;
+ float endX = breakLinePosition.Right;
+ float y = (top) ? breakLinePosition.Y : breakLinePosition.Bottom;
+ pointNumber = ((int)(endX - startX) / 40) * 2 ;
+ if(pointNumber < 2)
+ {
+ pointNumber = 2;
+ }
+ float step = (endX - startX) / pointNumber;
+ points = new PointF[pointNumber + 1];
+ for(int pointIndex = 1; pointIndex < pointNumber + 1; pointIndex++)
+ {
+ points[pointIndex] = new PointF(
+ startX + pointIndex * step,
+ y + ((pointIndex%2 == 0) ? -2f : 2f) );
+ }
+
+ points[0] = new PointF(startX, y);
+ points[points.Length - 1] = new PointF(endX, y);
+ }
+ else
+ {
+ float startY = breakLinePosition.Y;
+ float endY = breakLinePosition.Bottom;
+ float x = (top) ? breakLinePosition.X : breakLinePosition.Right;
+ pointNumber = ((int)(endY - startY) / 40) * 2 ;
+ if(pointNumber < 2)
+ {
+ pointNumber = 2;
+ }
+ float step = (endY - startY) / pointNumber;
+ points = new PointF[pointNumber + 1];
+ for(int pointIndex = 1; pointIndex < pointNumber + 1; pointIndex++)
+ {
+ points[pointIndex] = new PointF(
+ x + ((pointIndex%2 == 0) ? -2f : 2f),
+ startY + pointIndex * step);
+ }
+
+ points[0] = new PointF(x, startY);
+ points[points.Length - 1] = new PointF(x, endY);
+ }
+
+ path.AddCurve(points, 0, pointNumber, 0.8f);
+ }
+ else if(this.axis.ScaleBreakStyle.BreakLineStyle == BreakLineStyle.Ragged)
+ {
+ PointF[] points = null;
+ Random rand = new Random(435657);
+ if( this.axis.AxisPosition == AxisPosition.Right || this.axis.AxisPosition == AxisPosition.Left )
+ {
+ float startX = breakLinePosition.X;
+ float endX = breakLinePosition.Right;
+ float y = (top) ? breakLinePosition.Y : breakLinePosition.Bottom;
+ float step = 10f;
+ int pointNumber = (int)((endX - startX) / step);
+ if(pointNumber < 2)
+ {
+ pointNumber = 2;
+ }
+ points = new PointF[pointNumber];
+
+ for(int pointIndex = 1; pointIndex < pointNumber - 1; pointIndex++)
+ {
+ points[pointIndex] = new PointF(
+ startX + pointIndex * step,
+ y + rand.Next(-3, 3) );
+ }
+
+ points[0] = new PointF(startX, y);
+ points[points.Length - 1] = new PointF(endX, y);
+ }
+ else
+ {
+ float startY = breakLinePosition.Y;
+ float endY = breakLinePosition.Bottom;
+ float x = (top) ? breakLinePosition.X : breakLinePosition.Right;
+ float step = 10f;
+ int pointNumber = (int)((endY - startY) / step);
+ if(pointNumber < 2)
+ {
+ pointNumber = 2;
+ }
+ points = new PointF[pointNumber];
+
+ for(int pointIndex = 1; pointIndex < pointNumber - 1; pointIndex++)
+ {
+ points[pointIndex] = new PointF(
+ x + rand.Next(-3, 3),
+ startY + pointIndex * step );
+ }
+
+ points[0] = new PointF(x, startY);
+ points[points.Length - 1] = new PointF(x, endY);
+ }
+
+ path.AddLines(points);
+ }
+ else
+ {
+ if( this.axis.AxisPosition == AxisPosition.Right || this.axis.AxisPosition == AxisPosition.Left )
+ {
+ if(top)
+ {
+ path.AddLine(breakLinePosition.X, breakLinePosition.Y, breakLinePosition.Right, breakLinePosition.Y);
+ }
+ else
+ {
+ path.AddLine(breakLinePosition.X, breakLinePosition.Bottom, breakLinePosition.Right, breakLinePosition.Bottom);
+ }
+ }
+ else
+ {
+ if(top)
+ {
+ path.AddLine(breakLinePosition.X, breakLinePosition.Y, breakLinePosition.X, breakLinePosition.Bottom);
+ }
+ else
+ {
+ path.AddLine(breakLinePosition.Right, breakLinePosition.Y, breakLinePosition.Right, breakLinePosition.Bottom);
+ }
+ }
+ }
+ return path;
+ }
+
+ /// <summary>
+ /// Gets position of the axis break line. Break line may be shown as a single
+ /// line or two lines separated with a spacing.
+ /// </summary>
+ /// <param name="graph">Chart graphics.</param>
+ /// <param name="nextSegment">Next segment reference.</param>
+ /// <returns>Position of the axis break line in pixel coordinates.</returns>
+ internal RectangleF GetBreakLinePosition(ChartGraphics graph, AxisScaleSegment nextSegment)
+ {
+ // Start with the plotting rectangle position
+ RectangleF breakPosition = this.axis.PlotAreaPosition.ToRectangleF();
+
+ // Find maximum scale value of the current segment and minimuj of the next
+ double from = this.axis.GetLinearPosition(nextSegment.ScaleMinimum);
+ double to = this.axis.GetLinearPosition(this.ScaleMaximum);
+ if( this.axis.AxisPosition == AxisPosition.Right || this.axis.AxisPosition == AxisPosition.Left )
+ {
+ breakPosition.Y = (float)Math.Min(from, to);
+ breakPosition.Height = (float)Math.Max(from, to);
+ }
+ else
+ {
+ breakPosition.X = (float)Math.Min(from, to);
+ breakPosition.Width = (float)Math.Max(from, to);;
+ }
+
+ // Convert to pixels
+ breakPosition = Rectangle.Round(graph.GetAbsoluteRectangle(breakPosition));
+
+ // Add border width
+ if( this.axis.AxisPosition == AxisPosition.Right || this.axis.AxisPosition == AxisPosition.Left )
+ {
+ breakPosition.Height = (float)Math.Abs(breakPosition.Y - breakPosition.Height);
+ breakPosition.X -= this.axis.ChartArea.BorderWidth;
+ breakPosition.Width += 2 * this.axis.ChartArea.BorderWidth;
+ }
+ else
+ {
+ breakPosition.Width = (float)Math.Abs(breakPosition.X - breakPosition.Width);
+ breakPosition.Y -= this.axis.ChartArea.BorderWidth;
+ breakPosition.Height += 2 * this.axis.ChartArea.BorderWidth;
+ }
+
+ return breakPosition;
+ }
+
+ #endregion // Break Line Painting Methods
+
+ #region Helper Methods
+
+ /// <summary>
+ /// Gets segment scale position and size in relative coordinates.
+ /// Method takes in consideration segment spacing and space required fro separatorType.
+ /// </summary>
+ /// <param name="plotAreaSize">Plotting area size in relative coordinates.</param>
+ /// <param name="scalePosition">Returns scale position.</param>
+ /// <param name="scaleSize">Returns scale size.</param>
+ internal void GetScalePositionAndSize(double plotAreaSize, out double scalePosition, out double scaleSize)
+ {
+ scaleSize = (this.Size - this.Spacing) * (plotAreaSize / 100.0);
+ scalePosition = this.Position * (plotAreaSize / 100.0);
+ }
+
+ /// <summary>
+ /// Saves axis settings and set them from the current segment.
+ /// </summary>
+ internal void SetTempAxisScaleAndInterval()
+ {
+ // Save current axis settings
+ if(_oldAxisSettings.Count == 0)
+ {
+ _oldAxisSettings.Push(this.axis.maximum);
+ _oldAxisSettings.Push(this.axis.minimum);
+
+ _oldAxisSettings.Push(this.axis.majorGrid.interval);
+ _oldAxisSettings.Push(this.axis.majorGrid.intervalType);
+ _oldAxisSettings.Push(this.axis.majorGrid.intervalOffset);
+ _oldAxisSettings.Push(this.axis.majorGrid.intervalOffsetType);
+
+ _oldAxisSettings.Push(this.axis.majorTickMark.interval);
+ _oldAxisSettings.Push(this.axis.majorTickMark.intervalType);
+ _oldAxisSettings.Push(this.axis.majorTickMark.intervalOffset);
+ _oldAxisSettings.Push(this.axis.majorTickMark.intervalOffsetType);
+
+ _oldAxisSettings.Push(this.axis.LabelStyle.interval);
+ _oldAxisSettings.Push(this.axis.LabelStyle.intervalType);
+ _oldAxisSettings.Push(this.axis.LabelStyle.intervalOffset);
+ _oldAxisSettings.Push(this.axis.LabelStyle.intervalOffsetType);
+ }
+
+ // Copy settings from the segment into the axis
+ this.axis.maximum = this.ScaleMaximum;
+ this.axis.minimum = this.ScaleMinimum;
+
+ this.axis.majorGrid.interval = this.Interval;
+ this.axis.majorGrid.intervalType = this.IntervalType;
+ this.axis.majorGrid.intervalOffset = this.IntervalOffset;
+ this.axis.majorGrid.intervalOffsetType = this.IntervalOffsetType;
+
+ this.axis.majorTickMark.interval = this.Interval;
+ this.axis.majorTickMark.intervalType = this.IntervalType;
+ this.axis.majorTickMark.intervalOffset = this.IntervalOffset;
+ this.axis.majorTickMark.intervalOffsetType = this.IntervalOffsetType;
+
+ this.axis.LabelStyle.interval = this.Interval;
+ this.axis.LabelStyle.intervalType = this.IntervalType;
+ this.axis.LabelStyle.intervalOffset = this.IntervalOffset;
+ this.axis.LabelStyle.intervalOffsetType = this.IntervalOffsetType;
+ }
+
+ /// <summary>
+ /// Restore previously saved axis settings.
+ /// </summary>
+ internal void RestoreAxisScaleAndInterval()
+ {
+ if(_oldAxisSettings.Count > 0)
+ {
+ this.axis.LabelStyle.intervalOffsetType = (DateTimeIntervalType)_oldAxisSettings.Pop();
+ this.axis.LabelStyle.intervalOffset = (double)_oldAxisSettings.Pop();
+ this.axis.LabelStyle.intervalType = (DateTimeIntervalType)_oldAxisSettings.Pop();
+ this.axis.LabelStyle.interval = (double)_oldAxisSettings.Pop();
+
+ this.axis.majorTickMark.intervalOffsetType = (DateTimeIntervalType)_oldAxisSettings.Pop();
+ this.axis.majorTickMark.intervalOffset = (double)_oldAxisSettings.Pop();
+ this.axis.majorTickMark.intervalType = (DateTimeIntervalType)_oldAxisSettings.Pop();
+ this.axis.majorTickMark.interval = (double)_oldAxisSettings.Pop();
+
+ this.axis.majorGrid.intervalOffsetType = (DateTimeIntervalType)_oldAxisSettings.Pop();
+ this.axis.majorGrid.intervalOffset = (double)_oldAxisSettings.Pop();
+ this.axis.majorGrid.intervalType = (DateTimeIntervalType)_oldAxisSettings.Pop();
+ this.axis.majorGrid.interval = (double)_oldAxisSettings.Pop();
+
+ this.axis.minimum = (double)_oldAxisSettings.Pop();
+ this.axis.maximum = (double)_oldAxisSettings.Pop();
+ }
+ }
+
+ #endregion // Helper Methods
+
+ }
+
+ /// <summary>
+ /// <b>AxisScaleSegmentCollection</b> is a class that stores collection of axis segments.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeAxisScaleSegmentCollection_AxisScaleSegmentCollection"),
+ ]
+ internal class AxisScaleSegmentCollection : CollectionBase
+ {
+ #region Fields
+
+ // Axis this segment collection belongs to.
+ private Axis _axis = null;
+
+ // Segment which is always used to convert scale values.
+ // This value is set tmporarly when only one segment has
+ // to handle all the values.
+ private AxisScaleSegment _enforcedSegment = null;
+
+ // Indicates that values allowed to be outside of the scale segment.
+ // Otherwise they will be rounded to Min and Max values.
+ internal bool AllowOutOfScaleValues = false;
+
+ #endregion // Fields
+
+ #region Construction and Initialization
+
+ /// <summary>
+ /// Default public constructor.
+ /// </summary>
+ /// <remarks>
+ /// This constructor is for internal use and should not be part of documentation.
+ /// </remarks>
+ public AxisScaleSegmentCollection()
+ {
+ }
+
+ /// <summary>
+ /// Default public constructor.
+ /// </summary>
+ /// <remarks>
+ /// This constructor is for internal use and should not be part of documentation.
+ /// </remarks>
+ /// <param name="axis">
+ /// Chart axis this collection belongs to
+ /// </param>
+ internal AxisScaleSegmentCollection(Axis axis)
+ {
+ this._axis = axis;
+ }
+
+ #endregion // Construction and Initialization
+
+ #region Indexer
+
+ /// <summary>
+ /// Axis scale segment collection indexer.
+ /// </summary>
+ /// <remarks>
+ /// The <b>AxisScaleSegment</b> object index can be provided as a parameter. Returns the <see cref="AxisScaleSegment"/> object.
+ /// </remarks>
+ [
+ SRDescription("DescriptionAttributeAxisScaleSegmentCollection_Item"),
+ ]
+ public AxisScaleSegment this[int index]
+ {
+ get
+ {
+ return (AxisScaleSegment)this.List[(int)index];
+ }
+ }
+
+ #endregion // Indexer
+
+ #region Collection Add and Insert methods
+
+ /// <summary>
+ /// Adds a segment to the end of the collection.
+ /// </summary>
+ /// <param name="segment">
+ /// <see cref="AxisScaleSegment"/> object to add.
+ /// </param>
+ /// <returns>
+ /// Index of the newly added object.
+ /// </returns>
+ public int Add(AxisScaleSegment segment)
+ {
+ return this.List.Add(segment);
+ }
+
+
+ #endregion // Collection Add and Insert methods
+
+ #region Items Inserting and Removing Notification methods
+
+ /// <summary>
+ /// After new item inserted.
+ /// </summary>
+ /// <param name="index">Item index.</param>
+ /// <param name="value">Item object.</param>
+ /// <remarks>
+ /// This is an internal method and should not be part of the documentation.
+ /// </remarks>
+ protected override void OnInsertComplete(int index, object value)
+ {
+ ((AxisScaleSegment)value).axis = this._axis;
+ }
+
+ /// <summary>
+ /// After items is set.
+ /// </summary>
+ /// <param name="index">The zero-based index at which oldValue can be found.</param>
+ /// <param name="oldValue">The value to replace with newValue.</param>
+ /// <param name="newValue">The new value of the element at index.</param>
+ /// <remarks>
+ /// This is an internal method and should not be part of the documentation.
+ /// </remarks>
+ protected override void OnSetComplete(int index, object oldValue, object newValue)
+ {
+ ((AxisScaleSegment)newValue).axis = this._axis;
+ }
+
+ #endregion
+
+ #region Helper Methods
+
+ /// <summary>
+ /// Ensures that specified axis scale segment is used for all coordinate transformations.
+ /// Set tot NULL to reset.
+ /// </summary>
+ /// <param name="segment"></param>
+ internal void EnforceSegment(AxisScaleSegment segment)
+ {
+ this._enforcedSegment = segment;
+ }
+
+ /// <summary>
+ /// Find axis scale segment that should be used to translate axis value to relative coordinates.
+ /// </summary>
+ /// <param name="axisValue">Axis value to convert.</param>
+ /// <returns>Scale segment to use for the convertion.</returns>
+ public AxisScaleSegment FindScaleSegmentForAxisValue(double axisValue)
+ {
+ // Check if no segments defined
+ if(this.List.Count == 0)
+ {
+ return null;
+ }
+
+ // Check if segment enforcment is enabled
+ if(_enforcedSegment != null)
+ {
+ return _enforcedSegment;
+ }
+
+ // Iterate through all segments
+ for(int index = 0; index < this.Count; index++)
+ {
+ if(axisValue < this[index].ScaleMinimum)
+ {
+ if(index == 0)
+ {
+ return this[index];
+ }
+ else
+ {
+ // Find the segment which is "closer" to the value
+ if( Math.Abs(this[index].ScaleMinimum - axisValue) < Math.Abs(axisValue - this[index - 1].ScaleMaximum))
+ {
+ return this[index];
+ }
+ else
+ {
+ return this[index - 1];
+ }
+ }
+ }
+
+ if(axisValue <= this[index].ScaleMaximum)
+ {
+ return this[index];
+ }
+ else if(index == this.Count - 1)
+ {
+ return this[index];
+ }
+ }
+
+ return null;
+ }
+
+ #endregion // Helper Methods
+ }
+}
+
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/AxisScrollBar.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/AxisScrollBar.cs
new file mode 100644
index 00000000000..cbb389e99a2
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/AxisScrollBar.cs
@@ -0,0 +1,1952 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: AxisScrollBar.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: AxisScrollBar, ScrollBarEventArgs
+//
+// Purpose: AxisScrollBar class represent axis scroolbar. There
+// is a big difference how this UI functionality
+// implemented for Windows Forms and ASP.NET. For
+// Windows Forms a custom drawn scrollbar control is
+// drawn in the chart which reacts to the mouse input and
+// changes current axis data scaleView.
+//
+// ASP.NET version uses client-side scripting and partial
+// loading of data segment by segment. Due to the fact
+// that scrollbar operates on the client side not all
+// functionality of WindowsForms scrollbar is supported.
+//
+// Reviewed: AG - March 16, 2007
+//
+//===================================================================
+
+#if WINFORMS_CONTROL
+
+#region Used namespaces
+
+using System;
+using System.ComponentModel;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Drawing2D;
+using System.Windows.Forms;
+using System.Windows.Forms.DataVisualization.Charting;
+using System.Windows.Forms.DataVisualization.Charting.Data;
+using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+using System.Windows.Forms.DataVisualization.Charting.Utilities;
+using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+using System.Diagnostics.CodeAnalysis;
+
+#endregion
+
+namespace System.Windows.Forms.DataVisualization.Charting
+{
+ #region Scroll bar enumerations
+
+ /// <summary>
+ /// An enumeration of scrollbar button types.
+ /// </summary>
+ public enum ScrollBarButtonType
+ {
+ /// <summary>
+ /// Thumb tracker button.
+ /// </summary>
+ ThumbTracker,
+
+ /// <summary>
+ /// Scroll by substracting small distance.
+ /// </summary>
+ SmallDecrement,
+
+ /// <summary>
+ /// Scroll by adding small distance.
+ /// </summary>
+ SmallIncrement,
+
+ /// <summary>
+ /// Scroll by substracting large distance.
+ /// </summary>
+ LargeDecrement,
+
+ /// <summary>
+ /// Scroll by adding large distance.
+ /// </summary>
+ LargeIncrement,
+
+ /// <summary>
+ /// Zoom reset button.
+ /// </summary>
+ ZoomReset
+ }
+
+ /// <summary>
+ /// An enumeration of scrollbar button style flags.
+ /// </summary>
+ [Flags]
+ public enum ScrollBarButtonStyles
+ {
+ /// <summary>
+ /// No buttons are shown.
+ /// </summary>
+ None = 0,
+
+ /// <summary>
+ /// Small increment or decrement buttons are shown.
+ /// </summary>
+ SmallScroll = 1,
+
+ /// <summary>
+ /// Reset zoom buttons are shown.
+ /// </summary>
+ ResetZoom = 2,
+
+ /// <summary>
+ /// All buttons are shown.
+ /// </summary>
+ All = SmallScroll | ResetZoom
+ }
+
+ #endregion
+
+ /// <summary>
+ /// AxisScrollBar class represents the axis scrollbar. It is exposed as the
+ /// ScrollBar property of the Axis class. It contains scrollbar appearance
+ /// properties and drawing methods.
+ /// </summary>
+ public class AxisScrollBar : IDisposable
+ {
+ #region Scroll bar fields
+
+ // Reference to the axis data scaleView class
+ internal Axis axis = null;
+
+ // Indicates that scollbra will be drawn
+ private bool _enabled = true;
+
+ // Axis data scaleView scroll bar style
+ private ScrollBarButtonStyles _scrollBarButtonStyle = ScrollBarButtonStyles.All;
+
+ // Axis data scaleView scroll bar size
+ private double _scrollBarSize = 14.0;
+
+ // Index of the pressed butoon in the scroll bar
+ private int _pressedButtonType = int.MaxValue;
+
+ // Axis data scaleView scroll bar buttons color
+ private Color _buttonColor = Color.Empty;
+
+ // Axis data scaleView scroll bar back color
+ private Color _backColor = Color.Empty;
+
+ // Axis data scaleView scroll bar lines color
+ private Color _lineColor = Color.Empty;
+
+ // Current scroll bar drawing colors
+ private Color _buttonCurrentColor = Color.Empty;
+ private Color _backCurrentColor = Color.Empty;
+ private Color _lineCurrentColor = Color.Empty;
+
+ // Last mouse click mouse and scaleView position
+ private PointF _lastClickMousePosition = PointF.Empty;
+ private double _lastClickViewPosition = double.NaN;
+
+ // Timer used to scroll the data while selecting
+ private System.Windows.Forms.Timer _scrollTimer = new System.Windows.Forms.Timer();
+
+ // Scroll size and direction when AutoScroll is set
+ private MouseEventArgs _mouseArguments = null;
+
+ // Position of the scrollbar (true - edge of PlotArea, false - edge of chart area)
+ private bool _isPositionedInside = true;
+
+ #endregion
+
+ #region Scroll bar constructors and initialization
+
+ /// <summary>
+ /// AxisScrollBar constructor.
+ /// </summary>
+ public AxisScrollBar()
+ {
+ }
+
+ /// <summary>
+ /// Axis scroll bar constructor.
+ /// </summary>
+ /// <param name="axis">Reference to the axis class.</param>
+ internal AxisScrollBar(Axis axis)
+ {
+ // Save reference to the axis data scaleView
+ this.axis = axis;
+ }
+
+ /// <summary>
+ /// Initialize axis scroll bar class.
+ /// </summary>
+ internal void Initialize()
+ {
+ }
+
+ #endregion
+
+#region Scroll bar properties
+
+ /// <summary>
+ /// Gets or sets a flag which indicates whether scroll bar is positioned inside or outside of chart area.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxisView"),
+ Bindable(true),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeAxisScrollBar_PositionInside")
+ ]
+ public bool IsPositionedInside
+ {
+ get
+ {
+ return _isPositionedInside;
+ }
+ set
+ {
+ if(_isPositionedInside != value)
+ {
+ _isPositionedInside = value;
+ if(axis != null)
+ {
+ axis.ChartArea.Invalidate();
+ }
+ }
+ }
+ }
+
+
+ /// <summary>
+ /// Gets or sets a flag which indicates whether the scroll bar is enabled.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxisView"),
+ Bindable(true),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeAxisScrollBar_Enabled")
+ ]
+ public bool Enabled
+ {
+ get
+ {
+ return _enabled;
+ }
+ set
+ {
+ if(_enabled != value)
+ {
+ _enabled = value;
+ if(axis != null)
+ {
+ axis.ChartArea.Invalidate();
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets the ChartArea that contains this scrollbar.
+ /// </summary>
+ [
+ Browsable(false),
+ Bindable(false),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden)
+ ]
+ public ChartArea ChartArea
+ {
+ get
+ {
+ return this.axis.ChartArea;
+ }
+ }
+
+ /// <summary>
+ /// Gets the Axis that contains this scrollbar.
+ /// </summary>
+ [
+ Browsable(false),
+ Bindable(false),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden)
+ ]
+ public Axis Axis
+ {
+ get
+ {
+ return this.axis;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the style of the scrollbar button.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxisView"),
+ Bindable(true),
+#if WEB_OLAP
+ DefaultValue(ScrollBarButtonStyle.SmallScroll),
+#else
+ DefaultValue(ScrollBarButtonStyles.All),
+#endif
+ SRDescription("DescriptionAttributeAxisScrollBar_Buttons"),
+ Editor(Editors.FlagsEnumUITypeEditor.Editor, Editors.FlagsEnumUITypeEditor.Base)
+ ]
+ public ScrollBarButtonStyles ButtonStyle
+ {
+ get
+ {
+ return _scrollBarButtonStyle;
+ }
+ set
+ {
+ if(_scrollBarButtonStyle != value)
+ {
+ _scrollBarButtonStyle = value;
+ if(axis != null)
+ {
+ axis.ChartArea.Invalidate();
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the size of the scrollbar.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxisView"),
+ Bindable(true),
+ DefaultValue(14.0),
+ SRDescription("DescriptionAttributeAxisScrollBar_Size"),
+ ]
+ public double Size
+ {
+ get
+ {
+ return _scrollBarSize;
+ }
+ set
+ {
+ if(_scrollBarSize != value)
+ {
+ // Check values range
+ if(value < 5.0 || value > 20.0)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionScrollBarSizeInvalid));
+ }
+ _scrollBarSize = value;
+ if(axis != null)
+ {
+ axis.ChartArea.Invalidate();
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the button color of the scrollbar.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxisView"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeAxisScrollBar_ButtonColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ public Color ButtonColor
+ {
+ get
+ {
+ return _buttonColor;
+ }
+ set
+ {
+ if(_buttonColor != value)
+ {
+ _buttonColor = value;
+ if(axis != null)
+ {
+ axis.ChartArea.Invalidate();
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the line color of the scrollbar.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxisView"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeLineColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ public Color LineColor
+ {
+ get
+ {
+ return _lineColor;
+ }
+ set
+ {
+ if(_lineColor != value)
+ {
+ _lineColor = value;
+ if(axis != null)
+ {
+ axis.ChartArea.Invalidate();
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background color of the scrollbar.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxisView"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeBackColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base)
+ ]
+ public Color BackColor
+ {
+ get
+ {
+ return _backColor;
+ }
+ set
+ {
+ if(_backColor != value)
+ {
+ _backColor = value;
+ if(axis != null)
+ {
+ axis.ChartArea.Invalidate();
+ }
+ }
+ }
+ }
+
+#endregion
+
+#region Scroll bar public methods
+
+ /// <summary>
+ /// This method returns true if the scrollbar is visible.
+ /// </summary>
+ [Browsable(false)]
+ [Utilities.SerializationVisibility(Utilities.SerializationVisibility.Hidden)]
+ public bool IsVisible
+ {
+ get
+ {
+ // Check scroll bar enabled flag
+ if (!this.Enabled)
+ {
+ return false;
+ }
+
+ // Do not show scroll bars while printing
+ if (this.axis == null ||
+ this.axis.ChartArea == null ||
+ this.axis.ChartArea.Common == null ||
+ this.axis.ChartArea.Common.ChartPicture == null ||
+ this.axis.ChartArea.Common.ChartPicture.isPrinting)
+ {
+ return false;
+ }
+
+#if SUBAXES
+ // Scrollbar is not supported on the sub axis
+ if(this.axis.IsSubAxis)
+ {
+ return false;
+ }
+#endif // SUBAXES
+
+ // Check if data scaleView size in percentage is less than 100%
+ return (GetDataViewPercentage() < 100.0) ? true : false;
+ }
+ }
+
+#endregion
+
+#region Scroll bar painting methods
+
+ /// <summary>
+ /// Draws axis scroll bar.
+ /// </summary>
+ /// <param name="graph">Reference to the Chart Graphics object.</param>
+ internal void Paint( ChartGraphics graph )
+ {
+ // Scroll bar border width
+ int borderWidth = 1;
+
+ // Scroll bar should not be visible
+ if(!this.IsVisible)
+ {
+ return;
+ }
+
+#if SUBAXES
+ // Scrollbar not supported on sub axis
+ if( this.axis != null && this.axis.IsSubAxis)
+ {
+ return;
+ }
+#endif //SUBAXES
+
+ // Set current scroll bar colors
+ _buttonCurrentColor = this._buttonColor;
+ _backCurrentColor = this._backColor;
+ _lineCurrentColor = this._lineColor;
+
+ // Make sure the current colors are not empty
+ if(_buttonCurrentColor == Color.Empty)
+ {
+ _buttonCurrentColor = this.axis.ChartArea.BackColor;
+ if(_buttonCurrentColor == Color.Empty)
+ {
+ _buttonCurrentColor = Color.DarkGray;
+ }
+ }
+ if(_backCurrentColor == Color.Empty)
+ {
+ _backCurrentColor = this.axis.ChartArea.BackColor;
+ if(_backCurrentColor == Color.Empty)
+ {
+ _backCurrentColor = Color.LightGray;
+ }
+ }
+ if(_lineCurrentColor == Color.Empty)
+ {
+ _lineCurrentColor = this.axis.LineColor;
+ if(_lineCurrentColor == Color.Empty)
+ {
+ _lineCurrentColor = Color.Black;
+ }
+ }
+
+ // Get scroll bar rectangle
+ RectangleF scrollBarRect = this.GetScrollBarRect();
+
+ // Fill scroll bar background
+ graph.FillRectangleRel(
+ scrollBarRect,
+ _backCurrentColor,
+ ChartHatchStyle.None,
+ "",
+ ChartImageWrapMode.Tile,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ GradientStyle.None,
+ Color.Empty,
+ _lineCurrentColor,
+ borderWidth,
+ ChartDashStyle.Solid,
+ Color.Empty,
+ 0,
+ PenAlignment.Outset );
+
+ // Fill rectangle between to neighbour scroll bars
+ PaintScrollBarConnectionRect(graph, scrollBarRect, borderWidth);
+
+ // Get scroll bar client rectangle
+ SizeF borderRelativeSize = new SizeF(borderWidth, borderWidth);
+ borderRelativeSize = graph.GetRelativeSize(borderRelativeSize);
+ RectangleF scrollBarClientRect = new RectangleF(scrollBarRect.Location, scrollBarRect.Size);
+ scrollBarClientRect.Inflate(-borderRelativeSize.Width, -borderRelativeSize.Height);
+
+ // Draw all button types
+ foreach (ScrollBarButtonType buttonType in Enum.GetValues(typeof(ScrollBarButtonType)))
+ {
+ // Get button rectangle
+ RectangleF buttonRect = this.GetScrollBarButtonRect(scrollBarClientRect, (ScrollBarButtonType)buttonType);
+
+ // Paint button
+ if(!buttonRect.IsEmpty)
+ {
+ PaintScrollBar3DButton(
+ graph,
+ buttonRect,
+ ((ScrollBarButtonType)this._pressedButtonType) == (ScrollBarButtonType)buttonType,
+ (ScrollBarButtonType)buttonType);
+ }
+ }
+
+ if( this.ChartArea.Common.ProcessModeRegions )
+ {
+ SetHotRegionElement( this.ChartArea.Common );
+ }
+ }
+
+ /// <summary>
+ /// Fills a connection rectangle between two scoll bars.
+ /// </summary>
+ /// <param name="graph">Chart graphics.</param>
+ /// <param name="scrollBarRect">Scroll bar position.</param>
+ /// <param name="borderWidth">Border width.</param>
+ private void PaintScrollBarConnectionRect(
+ ChartGraphics graph,
+ RectangleF scrollBarRect,
+ int borderWidth)
+ {
+ // Do not draw anything if scroll bar is vertical
+ if(this.axis.AxisPosition == AxisPosition.Left ||
+ this.axis.AxisPosition == AxisPosition.Right)
+ {
+ return;
+ }
+
+ // Check if scoll bar is shown on the left/right sides of
+ // the plotting area and get their sizes in relative coordinates
+ float leftSize = 0f;
+ float rightSize = 0f;
+
+ foreach(Axis a in this.axis.ChartArea.Axes)
+ {
+ if(a.AxisPosition == AxisPosition.Left && a.ScrollBar.IsVisible && a.ScrollBar.IsPositionedInside == this.axis.ScrollBar.IsPositionedInside)
+ {
+ leftSize = (float)a.ScrollBar.GetScrollBarRelativeSize();
+ }
+ if(a.AxisPosition == AxisPosition.Right && a.ScrollBar.IsVisible && a.ScrollBar.IsPositionedInside == this.axis.ScrollBar.IsPositionedInside)
+ {
+ rightSize = (float)a.ScrollBar.GetScrollBarRelativeSize();
+ }
+ }
+
+ // Prepare generic rectangle coordinates
+ RectangleF connectorRect = new RectangleF(scrollBarRect.Location, scrollBarRect.Size);
+
+ // Prepare coordinates and fill area to the left
+ if(leftSize > 0f)
+ {
+ connectorRect.X = scrollBarRect.X - leftSize;
+ connectorRect.Width = leftSize;
+
+ // Fill background
+ graph.FillRectangleRel(
+ connectorRect,
+ _backCurrentColor,
+ ChartHatchStyle.None,
+ "",
+ ChartImageWrapMode.Tile,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ GradientStyle.None,
+ Color.Empty,
+ _lineCurrentColor,
+ borderWidth,
+ ChartDashStyle.Solid,
+ Color.Empty,
+ 0,
+ PenAlignment.Outset );
+ }
+
+ // Prepare coordinates and fill area to the right
+ if(rightSize > 0f)
+ {
+ connectorRect.X = scrollBarRect.Right;
+ connectorRect.Width = rightSize;
+
+ // Fill background
+ graph.FillRectangleRel(
+ connectorRect,
+ _backCurrentColor,
+ ChartHatchStyle.None,
+ "",
+ ChartImageWrapMode.Tile,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ GradientStyle.None,
+ Color.Empty,
+ _lineCurrentColor,
+ borderWidth,
+ ChartDashStyle.Solid,
+ Color.Empty,
+ 0,
+ PenAlignment.Outset );
+ }
+
+ }
+
+ /// <summary>
+ /// Draws 3D button in the scroll bar
+ /// </summary>
+ /// <param name="graph">Chart graphics.</param>
+ /// <param name="buttonRect">Button position.</param>
+ /// <param name="pressedState">Indicates that button is pressed.</param>
+ /// <param name="buttonType">Button type to draw.</param>
+ internal void PaintScrollBar3DButton(
+ ChartGraphics graph,
+ RectangleF buttonRect,
+ bool pressedState,
+ ScrollBarButtonType buttonType)
+ {
+ // Page Up/Down buttons do not require drawing
+ if(buttonType == ScrollBarButtonType.LargeIncrement || buttonType == ScrollBarButtonType.LargeDecrement)
+ {
+ return;
+ }
+
+ // Get 3 levels of colors for button drawing
+ Color darkerColor = ChartGraphics.GetGradientColor(_buttonCurrentColor, Color.Black, 0.5);
+ Color darkestColor = ChartGraphics.GetGradientColor(_buttonCurrentColor, Color.Black, 0.8);
+ Color lighterColor = ChartGraphics.GetGradientColor(_buttonCurrentColor, Color.White, 0.5);
+
+ // Fill button rectangle background
+ graph.FillRectangleRel(
+ buttonRect,
+ _buttonCurrentColor,
+ ChartHatchStyle.None,
+ "",
+ ChartImageWrapMode.Tile,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ GradientStyle.None,
+ Color.Empty,
+ darkerColor,
+ (pressedState) ? 1 : 0,
+ ChartDashStyle.Solid,
+ Color.Empty,
+ 0,
+ PenAlignment.Outset );
+
+ // Check if 2 or 1 pixel border will be drawn (if size too small)
+ bool singlePixelBorder = this.Size <= 12;
+
+ // Draw 3D effect around the button when not pressed
+ if(!pressedState)
+ {
+ // Get relative size of 1 pixel
+ SizeF pixelRelativeSize = new SizeF(1, 1);
+ pixelRelativeSize = graph.GetRelativeSize(pixelRelativeSize);
+
+ // Draw top/left border with button color
+ graph.DrawLineRel(
+ (singlePixelBorder) ? lighterColor : _buttonCurrentColor, 1, ChartDashStyle.Solid,
+ new PointF(buttonRect.X, buttonRect.Bottom),
+ new PointF(buttonRect.X, buttonRect.Top));
+ graph.DrawLineRel(
+ (singlePixelBorder) ? lighterColor : _buttonCurrentColor, 1, ChartDashStyle.Solid,
+ new PointF(buttonRect.Left, buttonRect.Y),
+ new PointF(buttonRect.Right, buttonRect.Y));
+
+ // Draw right/bottom border with the darkest color
+ graph.DrawLineRel(
+ (singlePixelBorder) ? darkerColor : darkestColor, 1, ChartDashStyle.Solid,
+ new PointF(buttonRect.Right, buttonRect.Bottom),
+ new PointF(buttonRect.Right, buttonRect.Top));
+ graph.DrawLineRel(
+ (singlePixelBorder) ? darkerColor : darkestColor, 1, ChartDashStyle.Solid,
+ new PointF(buttonRect.Left, buttonRect.Bottom),
+ new PointF(buttonRect.Right, buttonRect.Bottom));
+
+ if(!singlePixelBorder)
+ {
+ // Draw right/bottom border (offset 1) with the dark color
+ graph.DrawLineRel(
+ darkerColor, 1, ChartDashStyle.Solid,
+ new PointF(buttonRect.Right-pixelRelativeSize.Width, buttonRect.Bottom-pixelRelativeSize.Height),
+ new PointF(buttonRect.Right-pixelRelativeSize.Width, buttonRect.Top+pixelRelativeSize.Height));
+ graph.DrawLineRel(
+ darkerColor, 1, ChartDashStyle.Solid,
+ new PointF(buttonRect.Left+pixelRelativeSize.Width, buttonRect.Bottom-pixelRelativeSize.Height),
+ new PointF(buttonRect.Right-pixelRelativeSize.Width, buttonRect.Bottom-pixelRelativeSize.Height));
+
+ // Draw top/left border (offset 1) with lighter color
+ graph.DrawLineRel(
+ lighterColor, 1, ChartDashStyle.Solid,
+ new PointF(buttonRect.X+pixelRelativeSize.Width, buttonRect.Bottom-pixelRelativeSize.Height),
+ new PointF(buttonRect.X+pixelRelativeSize.Width, buttonRect.Top+pixelRelativeSize.Height));
+ graph.DrawLineRel(
+ lighterColor, 1, ChartDashStyle.Solid,
+ new PointF(buttonRect.Left+pixelRelativeSize.Width, buttonRect.Y+pixelRelativeSize.Height),
+ new PointF(buttonRect.Right-pixelRelativeSize.Width, buttonRect.Y+pixelRelativeSize.Height));
+ }
+ }
+
+ // Check axis orientation
+ bool verticalAxis = (this.axis.AxisPosition == AxisPosition.Left ||
+ this.axis.AxisPosition == AxisPosition.Right) ? true : false;
+
+ // Set graphics transformation for button pressed mode
+ float pressedShifting = (singlePixelBorder) ? 0.5f : 1f;
+ if(pressedState)
+ {
+ graph.TranslateTransform(pressedShifting, pressedShifting);
+ }
+
+ // Draw button image
+ RectangleF buttonAbsRect = graph.GetAbsoluteRectangle(buttonRect);
+ float imageOffset = (singlePixelBorder) ? 2 : 3;
+ switch(buttonType)
+ {
+ case(ScrollBarButtonType.SmallDecrement):
+ {
+ // Calculate triangal points position
+ PointF[] points = new PointF[3];
+ if(verticalAxis)
+ {
+ points[0].X = buttonAbsRect.X + imageOffset;
+ points[0].Y = buttonAbsRect.Y + (imageOffset + 1f);
+ points[1].X = buttonAbsRect.X + buttonAbsRect.Width/2f;
+ points[1].Y = buttonAbsRect.Bottom - imageOffset;
+ points[2].X = buttonAbsRect.Right - imageOffset;
+ points[2].Y = buttonAbsRect.Y + (imageOffset + 1f);
+ }
+ else
+ {
+ points[0].X = buttonAbsRect.X + imageOffset;
+ points[0].Y = buttonAbsRect.Y + buttonAbsRect.Height/2f;
+ points[1].X = buttonAbsRect.Right - (imageOffset + 1f);
+ points[1].Y = buttonAbsRect.Y + imageOffset;
+ points[2].X = buttonAbsRect.Right - (imageOffset + 1f);
+ points[2].Y = buttonAbsRect.Bottom - imageOffset;
+ }
+
+ using (Brush brush = new SolidBrush(this._lineCurrentColor))
+ {
+ graph.FillPolygon(brush, points);
+ }
+ break;
+ }
+ case(ScrollBarButtonType.SmallIncrement):
+ {
+ // Calculate triangal points position
+ PointF[] points = new PointF[3];
+ if(verticalAxis)
+ {
+ points[0].X = buttonAbsRect.X + imageOffset;
+ points[0].Y = buttonAbsRect.Bottom - (imageOffset + 1f);
+ points[1].X = buttonAbsRect.X + buttonAbsRect.Width/2f;
+ points[1].Y = buttonAbsRect.Y + imageOffset;
+ points[2].X = buttonAbsRect.Right - imageOffset;
+ points[2].Y = buttonAbsRect.Bottom - (imageOffset + 1f);
+ }
+ else
+ {
+ points[0].X = buttonAbsRect.Right - imageOffset;
+ points[0].Y = buttonAbsRect.Y + buttonAbsRect.Height/2f;
+ points[1].X = buttonAbsRect.X + (imageOffset + 1f);
+ points[1].Y = buttonAbsRect.Y + imageOffset;
+ points[2].X = buttonAbsRect.X + (imageOffset + 1f);
+ points[2].Y = buttonAbsRect.Bottom - imageOffset;
+ }
+
+ using (Brush brush = new SolidBrush(this._lineCurrentColor))
+ {
+ graph.FillPolygon(brush, points);
+ }
+ break;
+ }
+ case(ScrollBarButtonType.ZoomReset):
+ {
+ // Draw circule with a minus sign
+ using (Pen pen = new Pen(this._lineCurrentColor, 1))
+ {
+ graph.DrawEllipse(pen, buttonAbsRect.X + imageOffset - 0.5f, buttonAbsRect.Y + imageOffset - 0.5f, buttonAbsRect.Width - 2f * imageOffset, buttonAbsRect.Height - 2f * imageOffset);
+ graph.DrawLine(pen, buttonAbsRect.X + imageOffset + 1.5f, buttonAbsRect.Y + buttonAbsRect.Height / 2f - 0.5f, buttonAbsRect.Right - imageOffset - 2.5f, buttonAbsRect.Y + buttonAbsRect.Height / 2f - 0.5f);
+ }
+ break;
+ }
+ }
+
+ // Reset graphics transformation for button pressed mode
+ if(pressedState)
+ {
+ graph.TranslateTransform(-pressedShifting, -pressedShifting);
+ }
+ }
+
+#endregion
+
+#region Mouse events handling for the Scroll Bar
+
+ /// <summary>
+ /// Mouse down event handler.
+ /// </summary>
+ internal void ScrollBar_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
+ {
+ // Process left mouse button
+ if(e.Button == MouseButtons.Left && this.IsVisible)
+ {
+ // Remember position where mouse was clicked
+ _lastClickMousePosition = new PointF(e.X, e.Y);
+ _lastClickViewPosition = this.axis.ScaleView.Position;
+
+ // Check if button was pressed inside the scroll bar
+ ScrollBarButtonType buttonType;
+ if(GetElementByPixelPosition(e.X, e.Y, out buttonType))
+ {
+ this.ButtonClicked(buttonType, e.X, e.Y);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Mouse up event handler.
+ /// </summary>
+ internal void ScrollBar_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
+ {
+ // If scroll bar button was pressed
+ if(this._pressedButtonType != int.MaxValue)
+ {
+ // Check if button was unpressed inside the reset zoom button
+ ScrollBarButtonType buttonType;
+ if(GetElementByPixelPosition(e.X, e.Y, out buttonType))
+ {
+ if(buttonType == ScrollBarButtonType.ZoomReset)
+ {
+ this.ButtonClicked(buttonType, e.X, e.Y);
+ }
+ }
+
+ // Stop scrolling timer
+ _scrollTimer.Stop();
+ _mouseArguments = null;
+
+ // Clear pressed button state
+ this._pressedButtonType = int.MaxValue;
+
+ // Invalidate chart
+ this.axis.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Mouse move event handler.
+ /// </summary>
+ internal void ScrollBar_MouseMove(System.Windows.Forms.MouseEventArgs e, ref bool handled)
+ {
+ // If scroll bar button was pressed
+ if(this._pressedButtonType != int.MaxValue)
+ {
+ // Mouse move event should not be handled by any other chart elements
+ handled = true;
+
+ // Check if tracking buton was pressed
+ if((ScrollBarButtonType)this._pressedButtonType == ScrollBarButtonType.ThumbTracker)
+ {
+ // Proceed if last clicked position is known
+ if(!_lastClickMousePosition.IsEmpty)
+ {
+ this.ButtonClicked(ScrollBarButtonType.ThumbTracker, e.X, e.Y);
+ }
+ }
+
+ // Non tracking scroll bar button
+ else
+ {
+ // Check if mouse cursor is still in the pressed button's rectangle
+ bool inPressedButton = false;
+ ScrollBarButtonType buttonType;
+ if(GetElementByPixelPosition(e.X, e.Y, out buttonType))
+ {
+ if(buttonType == (ScrollBarButtonType)this._pressedButtonType)
+ {
+ inPressedButton = true;
+ }
+ }
+
+ // Clear pressed button state
+ if(!inPressedButton)
+ {
+ // Stop scrolling timer
+ _scrollTimer.Stop();
+ _mouseArguments = null;
+
+ // Clear pressed button state
+ this._pressedButtonType = int.MaxValue;
+
+ // Invalidate chart
+ this.axis.Invalidate();
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Scroll bar button was clicked by the user.
+ /// </summary>
+ /// <param name="buttonType">Button type.</param>
+ /// <param name="x">X click position in pixels.</param>
+ /// <param name="y">Y click position in pixels.</param>
+ [SuppressMessage("Microsoft.Mobility", "CA1601:DoNotUseTimersThatPreventPowerStateChanges", Justification = "The timer is used for simulating scrolling behavior")]
+ private void ButtonClicked(ScrollBarButtonType buttonType, int x, int y)
+ {
+ // Call zoom reset on the second pass when button is released
+ if(buttonType != ScrollBarButtonType.ZoomReset ||
+ (ScrollBarButtonType)this._pressedButtonType == buttonType)
+ {
+
+ //**************************************************
+ //** Fire scroll bar button clicked event
+ //**************************************************
+ ScrollBarEventArgs eventArg = new ScrollBarEventArgs(this.axis, x, y, buttonType);
+ this.axis.ScaleView.GetChartObject().OnAxisScrollBarClicked(eventArg);
+
+ // Check if event was handled by user
+ if(eventArg.IsHandled)
+ {
+ // Save type of the button pressed
+ this._pressedButtonType = (int)buttonType;
+
+ return;
+ }
+
+ //**************************************************
+ //** Scroll data scaleView
+ //**************************************************
+ switch(buttonType)
+ {
+ case(ScrollBarButtonType.SmallIncrement):
+ this.axis.ScaleView.Scroll(ScrollType.SmallIncrement, true);
+ break;
+ case(ScrollBarButtonType.SmallDecrement):
+ this.axis.ScaleView.Scroll(ScrollType.SmallDecrement, true);
+ break;
+ case(ScrollBarButtonType.LargeIncrement):
+ this.axis.ScaleView.Scroll(ScrollType.LargeIncrement, true);
+ break;
+ case(ScrollBarButtonType.LargeDecrement):
+ this.axis.ScaleView.Scroll(ScrollType.LargeDecrement, true);
+ break;
+ case(ScrollBarButtonType.ZoomReset):
+ this.axis.ScaleView.ZoomReset(1, true);
+ break;
+ case(ScrollBarButtonType.ThumbTracker):
+ {
+ if(!_lastClickMousePosition.IsEmpty &&
+ !double.IsNaN(this._lastClickViewPosition) &&
+ (_lastClickMousePosition.X != x || _lastClickMousePosition.Y != y))
+ {
+ // Get scroll bar client rectangle
+ RectangleF scrollBarRect = this.GetScrollBarRect();
+ SizeF borderRelativeSize = new SizeF(1, 1);
+ borderRelativeSize = this.GetRelativeSize(borderRelativeSize);
+ RectangleF scrollBarClientRect = new RectangleF(scrollBarRect.Location, scrollBarRect.Size);
+ scrollBarClientRect.Inflate(-borderRelativeSize.Width, -borderRelativeSize.Height);
+
+ // Check axis orientation
+ bool verticalAxis = (this.axis.AxisPosition == AxisPosition.Left ||
+ this.axis.AxisPosition == AxisPosition.Right) ? true : false;
+
+ // Get button relative size
+ SizeF buttonSize = new SizeF(scrollBarClientRect.Width, scrollBarClientRect.Height);
+ buttonSize = this.GetAbsoluteSize(buttonSize);
+ if(verticalAxis)
+ {
+ buttonSize.Height = buttonSize.Width;
+ }
+ else
+ {
+ buttonSize.Width = buttonSize.Height;
+ }
+ buttonSize = this.GetRelativeSize(buttonSize);
+
+ // Calculate the distance in percentages the mouse was moved
+ // from it's original (clicked) position.
+ float distance = 0f;
+ double trackingAreaSize = 0f;
+ if(verticalAxis)
+ {
+ // Calculate max tracking size
+ trackingAreaSize = scrollBarClientRect.Height - this.GetButtonsNumberAll() * buttonSize.Height;
+ distance = _lastClickMousePosition.Y - y;
+
+ // Convert to relative coordinates
+ distance = distance * 100F / ((float)(this.axis.Common.Height - 1));
+ }
+ else
+ {
+ trackingAreaSize = scrollBarClientRect.Width - this.GetButtonsNumberAll() * buttonSize.Width;
+ distance = x - _lastClickMousePosition.X;
+
+ // Convert to relative coordinates
+ distance = distance * 100F / ((float)(this.axis.Common.Width - 1));
+ }
+
+ // Convert to percentages from total tracking area
+ distance = (float)(distance / (trackingAreaSize / 100f));
+
+ // Get axis scale size without margins
+ double axisScaleSize = Math.Abs(
+ (this.axis.maximum - this.axis.marginView) -
+ (this.axis.minimum + this.axis.marginView));
+
+ // Calculate the same percentage using axis scale
+ distance = (float)(distance * (axisScaleSize/100f));
+
+ // Round the distance to the minimum scroll line size
+ if(!double.IsNaN(axis.ScaleView.SmallScrollMinSize) && axis.ScaleView.SmallScrollMinSize != 0.0)
+ {
+ double minSize = ChartHelper.GetIntervalSize(0, axis.ScaleView.SmallScrollMinSize, axis.ScaleView.SmallScrollMinSizeType);
+
+ double rounder = (Math.Round(distance / minSize));
+ distance = (float)(rounder * minSize);
+ }
+
+ // Scroll scaleView into the new position
+ this.axis.ScaleView.Scroll(this._lastClickViewPosition + ((this.axis.IsReversed) ? -1 : 1) * distance, true);
+ }
+ break;
+ }
+ }
+
+ //************************************************************
+ //** Initialize timer for repeating scroll (if mouse is hold)
+ //************************************************************
+
+ // Reset mouse arguments
+ _mouseArguments = null;
+
+ if(buttonType != ScrollBarButtonType.ThumbTracker && buttonType != ScrollBarButtonType.ZoomReset)
+ {
+ // Remember last mouse position
+ _mouseArguments = new MouseEventArgs(MouseButtons.Left, 1, x, y, 0);
+
+ // Enable timer
+ if(!_scrollTimer.Enabled)
+ {
+ _scrollTimer.Tick += new EventHandler(ScrollingTimerEventProcessor);
+ _scrollTimer.Interval = 400;
+ _scrollTimer.Start();
+ }
+ }
+ }
+
+ //************************************************************
+ //** Invalidate chart
+ //************************************************************
+
+ // Save type of the button pressed
+ this._pressedButtonType = (int)buttonType;
+
+ // Invalidate
+ this.axis.Invalidate();
+ }
+
+ /// <summary>
+ /// This is the method to run when the timer is raised.
+ /// Used to repetedly scroll data scaleView while mouse button is pressed.
+ /// </summary>
+ /// <param name="myObject">Object.</param>
+ /// <param name="myEventArgs">Event arguments.</param>
+ [SuppressMessage("Microsoft.Mobility", "CA1601:DoNotUseTimersThatPreventPowerStateChanges", Justification = "The timer is used for simulating scrolling behavior")]
+ private void ScrollingTimerEventProcessor(Object myObject, EventArgs myEventArgs)
+ {
+ // Simulate mouse move events
+ if(_mouseArguments != null)
+ {
+ _scrollTimer.Interval = 200;
+ this.ScrollBar_MouseDown(null, _mouseArguments);
+ }
+ }
+
+ /// <summary>
+ /// This method fills hot region collection with scroll bar elements.
+ /// Possible elements are all scroll bar buttons and scroll bar background
+ /// which performs PgUp/PgDn action.
+ /// </summary>
+ /// <param name="common">Common Elements</param>
+ private void SetHotRegionElement( CommonElements common )
+ {
+ // Check if mouse button was clicked in the scroll bar
+ RectangleF scrollBarRect = this.GetScrollBarRect();
+
+ // Get scroll bar client rectangle
+ SizeF borderRelativeSize = new SizeF(1, 1);
+ borderRelativeSize = this.GetRelativeSize(borderRelativeSize);
+ RectangleF scrollBarClientRect = new RectangleF(scrollBarRect.Location, scrollBarRect.Size);
+ scrollBarClientRect.Inflate(-borderRelativeSize.Width, -borderRelativeSize.Height);
+
+ ChartElementType buttonType = ChartElementType.Nothing;
+
+ // Fill collection with scroll buttons rectangles.
+ foreach(object type in Enum.GetValues(typeof(ScrollBarButtonType)))
+ {
+
+ // Convert Scroll Bar Button type enum to Chart Element AxisName enum.
+ switch( (ScrollBarButtonType)type )
+ {
+ case ScrollBarButtonType.SmallIncrement:
+ buttonType = ChartElementType.ScrollBarSmallIncrement;
+ break;
+ case ScrollBarButtonType.LargeIncrement:
+ buttonType = ChartElementType.ScrollBarLargeIncrement;
+ break;
+ case ScrollBarButtonType.LargeDecrement:
+ buttonType = ChartElementType.ScrollBarLargeDecrement;
+ break;
+ case ScrollBarButtonType.ThumbTracker:
+ buttonType = ChartElementType.ScrollBarThumbTracker;
+ break;
+ case ScrollBarButtonType.SmallDecrement:
+ buttonType = ChartElementType.ScrollBarSmallDecrement;
+ break;
+ case ScrollBarButtonType.ZoomReset:
+ buttonType = ChartElementType.ScrollBarZoomReset;
+ break;
+ }
+
+ // Get button rectangle
+ RectangleF buttonRect = this.GetScrollBarButtonRect(scrollBarClientRect, (ScrollBarButtonType)type);
+
+ common.HotRegionsList.AddHotRegion( buttonRect, this, buttonType, true );
+
+ }
+ }
+
+ /// <summary>
+ /// Detects the scroll bar elements by pixel position.
+ /// Possible elements are all scroll bar buttons and scroll bar background
+ /// which performs PgUp/PgDn action.
+ /// </summary>
+ /// <param name="x">X coordinate in pixels.</param>
+ /// <param name="y">Y coordinate in pixels.</param>
+ /// <param name="buttonType">Return button type.</param>
+ /// <returns>True if position is in the scroll bar.</returns>
+ private bool GetElementByPixelPosition(float x, float y, out ScrollBarButtonType buttonType)
+ {
+ // Set initial values
+ buttonType = ScrollBarButtonType.ThumbTracker;
+
+ // Convert mouse click coordinates to relative
+ PointF position = new PointF(x, y);
+ position.X = x * 100F / ((float)(this.axis.Common.Width - 1));
+ position.Y = y * 100F / ((float)(this.axis.Common.Height - 1));
+
+ // Check if mouse button was clicked in the scroll bar
+ RectangleF scrollBarRect = this.GetScrollBarRect();
+ if(scrollBarRect.Contains(position))
+ {
+ // Get scroll bar client rectangle
+ SizeF borderRelativeSize = new SizeF(1, 1);
+ borderRelativeSize = this.GetRelativeSize(borderRelativeSize);
+ RectangleF scrollBarClientRect = new RectangleF(scrollBarRect.Location, scrollBarRect.Size);
+ scrollBarClientRect.Inflate(-borderRelativeSize.Width, -borderRelativeSize.Height);
+
+ //******************************************************************
+ //** Check if scroll bar button was clicked
+ //******************************************************************
+ foreach(object type in Enum.GetValues(typeof(ScrollBarButtonType)))
+ {
+ // Get button rectangle
+ RectangleF buttonRect = this.GetScrollBarButtonRect(scrollBarClientRect, (ScrollBarButtonType)type);
+
+ // Check if position is inside the button
+ if(buttonRect.Contains(position))
+ {
+ buttonType = (ScrollBarButtonType)type;
+ return true;
+ }
+ }
+ }
+
+ // Pixel position is outside scroll bar area
+ return false;
+ }
+
+#endregion
+
+#region Scroll bar helper methods
+
+ /// <summary>
+ /// Returns scroll bar button rectangle position in relative coordinates.
+ /// </summary>
+ /// <param name="scrollBarClientRect">Scroll bar client rectangle.</param>
+ /// <param name="buttonType">Scroll bar button type.</param>
+ /// <returns>Scroll bar position.</returns>
+ internal RectangleF GetScrollBarButtonRect(RectangleF scrollBarClientRect, ScrollBarButtonType buttonType)
+ {
+ // Initialize button rectangle
+ RectangleF buttonRect = new RectangleF(scrollBarClientRect.Location, scrollBarClientRect.Size);
+
+ // Check axis orientation
+ bool verticalAxis = (this.axis.AxisPosition == AxisPosition.Left ||
+ this.axis.AxisPosition == AxisPosition.Right) ? true : false;
+
+ // Get relative size of 1 pixel
+ SizeF pixelRelativeSize = new SizeF(1, 1);
+ pixelRelativeSize = this.GetRelativeSize(pixelRelativeSize);
+
+ // Get button relative size
+ SizeF buttonSize = new SizeF(scrollBarClientRect.Width, scrollBarClientRect.Height);
+ buttonSize = this.GetAbsoluteSize(buttonSize);
+ if(verticalAxis)
+ {
+ buttonSize.Height = buttonSize.Width;
+ }
+ else
+ {
+ buttonSize.Width = buttonSize.Height;
+ }
+ buttonSize = this.GetRelativeSize(buttonSize);
+
+ // Set common position sizes
+ buttonRect.Width = buttonSize.Width;
+ buttonRect.Height = buttonSize.Height;
+ if(verticalAxis)
+ {
+ buttonRect.X = scrollBarClientRect.X;
+ }
+ else
+ {
+ buttonRect.Y = scrollBarClientRect.Y;
+ }
+
+ // Calculate scroll bar buttons position
+ switch(buttonType)
+ {
+ case(ScrollBarButtonType.LargeDecrement):
+ case(ScrollBarButtonType.LargeIncrement):
+ case(ScrollBarButtonType.ThumbTracker):
+ {
+ // Get tracker button position and size first
+ if(verticalAxis)
+ {
+ // Calculate tracker size
+ double trackingAreaSize = scrollBarClientRect.Height - this.GetButtonsNumberAll() * buttonSize.Height;
+ buttonRect.Height = (float)(this.GetDataViewPercentage() * (trackingAreaSize / 100f));
+
+ // Check if tracker size is too small
+ if(buttonRect.Height < pixelRelativeSize.Height * 6f)
+ {
+ buttonRect.Height = pixelRelativeSize.Height * 6f;
+ }
+
+ // Calculate tracker position
+ if(!this.axis.IsReversed)
+ {
+ buttonRect.Y = scrollBarClientRect.Bottom - this.GetButtonsNumberBottom()*buttonSize.Height - buttonRect.Height;
+ buttonRect.Y -= (float)(this.GetDataViewPositionPercentage() * (trackingAreaSize / 100f));
+ if(buttonRect.Y < scrollBarClientRect.Y + this.GetButtonsNumberTop()*buttonSize.Height + ((this.GetButtonsNumberTop() == 0) ? 0 : pixelRelativeSize.Height))
+ {
+ buttonRect.Y = scrollBarClientRect.Y + this.GetButtonsNumberTop()*buttonSize.Height + ((this.GetButtonsNumberTop() == 0) ? 0 : pixelRelativeSize.Height);
+ }
+ }
+ else
+ {
+ buttonRect.Y = scrollBarClientRect.Top + this.GetButtonsNumberTop()*buttonSize.Height;
+ buttonRect.Y += (float)(this.GetDataViewPositionPercentage() * (trackingAreaSize / 100f));
+ if((buttonRect.Y + buttonRect.Height) > scrollBarClientRect.Bottom - this.GetButtonsNumberBottom()*buttonSize.Height - ((this.GetButtonsNumberBottom() == 0) ? 0 : pixelRelativeSize.Height))
+ {
+ buttonRect.Y = (scrollBarClientRect.Bottom - this.GetButtonsNumberBottom()*buttonSize.Height) - buttonRect.Height - ((this.GetButtonsNumberBottom() == 0) ? 0 : pixelRelativeSize.Height);
+ }
+ }
+ }
+ else
+ {
+ // Calculate tracker size
+ double trackingAreaSize = scrollBarClientRect.Width - this.GetButtonsNumberAll() * buttonSize.Width;
+ buttonRect.Width = (float)(this.GetDataViewPercentage() * (trackingAreaSize / 100f));
+
+ // Check if tracker size is too small
+ if(buttonRect.Width < pixelRelativeSize.Width * 6f)
+ {
+ buttonRect.Width = pixelRelativeSize.Width * 6f;
+ }
+
+ // Calculate tracker position
+ if(!this.axis.IsReversed)
+ {
+ buttonRect.X = scrollBarClientRect.X + this.GetButtonsNumberTop() * buttonSize.Width;
+ buttonRect.X += (float)(this.GetDataViewPositionPercentage() * (trackingAreaSize / 100f));
+ if((buttonRect.X + buttonRect.Width) > scrollBarClientRect.Right - this.GetButtonsNumberBottom()*buttonSize.Width - ((this.GetButtonsNumberBottom() == 0) ? 0 : pixelRelativeSize.Width))
+ {
+ buttonRect.X = (scrollBarClientRect.Right - buttonRect.Width) - this.GetButtonsNumberBottom()*buttonSize.Width - ((this.GetButtonsNumberBottom() == 0) ? 0 : pixelRelativeSize.Width);
+ }
+ }
+ else
+ {
+ buttonRect.X = scrollBarClientRect.Right - this.GetButtonsNumberBottom()*buttonSize.Width - ((this.GetButtonsNumberBottom() == 0) ? 0 : pixelRelativeSize.Width) - buttonRect.Width;
+ buttonRect.X -= (float)(this.GetDataViewPositionPercentage() * (trackingAreaSize / 100f));
+ if(buttonRect.X < scrollBarClientRect.X + this.GetButtonsNumberTop()*buttonSize.Width)
+ {
+ buttonRect.X = scrollBarClientRect.X + this.GetButtonsNumberTop()*buttonSize.Width;
+ }
+ }
+
+ }
+
+ // Get page up region rectangle depending on the tracker position
+ if(buttonType == ScrollBarButtonType.LargeDecrement)
+ {
+ if(verticalAxis)
+ {
+ buttonRect.Y = buttonRect.Bottom + pixelRelativeSize.Height;
+ buttonRect.Height = (scrollBarClientRect.Bottom - this.GetButtonsNumberBottom()*buttonSize.Height - pixelRelativeSize.Height) - buttonRect.Y;
+ }
+ else
+ {
+ float x = scrollBarClientRect.X +
+ this.GetButtonsNumberTop() * buttonSize.Width +
+ pixelRelativeSize.Width;
+
+ buttonRect.Width = buttonRect.X - x;
+ buttonRect.X = x;
+ }
+ }
+
+ // Get page down region rectangle depending on the tracker position
+ else if(buttonType == ScrollBarButtonType.LargeIncrement)
+ {
+ if(verticalAxis)
+ {
+ float y = scrollBarClientRect.Y +
+ this.GetButtonsNumberTop() * buttonSize.Height +
+ pixelRelativeSize.Height;
+
+ buttonRect.Height = buttonRect.Y - y;
+ buttonRect.Y = y;
+ }
+ else
+ {
+ buttonRect.X = buttonRect.Right + pixelRelativeSize.Width;
+ buttonRect.Width = (scrollBarClientRect.Right - this.GetButtonsNumberBottom()*buttonSize.Width - pixelRelativeSize.Height) - buttonRect.X;
+ }
+ }
+
+ break;
+ }
+
+ case(ScrollBarButtonType.SmallDecrement):
+ if(this._scrollBarButtonStyle == ScrollBarButtonStyles.All ||
+ this._scrollBarButtonStyle == ScrollBarButtonStyles.SmallScroll)
+ {
+ if(verticalAxis)
+ {
+ buttonRect.Y = scrollBarClientRect.Bottom - buttonRect.Height;
+ }
+ else
+ {
+ buttonRect.X = scrollBarClientRect.X + (this.GetButtonsNumberTop()-1f)*buttonSize.Width;
+ buttonRect.X += (this.GetButtonsNumberTop() == 1) ? 0 : pixelRelativeSize.Width;
+ }
+ }
+ else
+ {
+ buttonRect = RectangleF.Empty;
+ }
+ break;
+
+ case(ScrollBarButtonType.SmallIncrement):
+ if(this._scrollBarButtonStyle == ScrollBarButtonStyles.All ||
+ this._scrollBarButtonStyle == ScrollBarButtonStyles.SmallScroll)
+ {
+ if(verticalAxis)
+ {
+ buttonRect.Y = scrollBarClientRect.Y + (this.GetButtonsNumberTop()-1f) * buttonSize.Height;
+ buttonRect.Y += (this.GetButtonsNumberTop() == 1) ? 0 : pixelRelativeSize.Height;
+ }
+ else
+ {
+ buttonRect.X = scrollBarClientRect.Right - buttonRect.Width;
+ }
+ }
+ else
+ {
+ buttonRect = RectangleF.Empty;
+ }
+ break;
+
+ case(ScrollBarButtonType.ZoomReset):
+ if(this._scrollBarButtonStyle == ScrollBarButtonStyles.All ||
+ this._scrollBarButtonStyle == ScrollBarButtonStyles.ResetZoom)
+ {
+ if(verticalAxis)
+ {
+ buttonRect.Y = scrollBarClientRect.Y;
+ }
+ else
+ {
+ buttonRect.X = scrollBarClientRect.X;
+ }
+ }
+ else
+ {
+ buttonRect = RectangleF.Empty;
+ }
+ break;
+ }
+
+ return buttonRect;
+ }
+
+ /// <summary>
+ /// Returns scroll bar rectangle position in relative coordinates.
+ /// </summary>
+ /// <returns>Scroll bar position.</returns>
+ internal RectangleF GetScrollBarRect()
+ {
+ // Get scroll bar relative size
+ float scrollBarSize = (float)this.GetScrollBarRelativeSize();
+
+ // Get relative size of the axis line (Note: Code removed for now. -- AG)
+ //SizeF axisLineSize = new SizeF(axis.LineWidth, axis.LineWidth);
+ //axisLineSize.Width = axisLineSize.Width * 100F / ((float)(this.axis.Common.Width - 1));
+ //axisLineSize.Height = axisLineSize.Height * 100F / ((float)(this.axis.Common.Height - 1));
+
+ // Check if scroll bar is positioned next to PlotArea or ChartArea
+ RectangleF areaPosition = axis.PlotAreaPosition.ToRectangleF();
+ if(!this.IsPositionedInside)
+ {
+ areaPosition = axis.ChartArea.Position.ToRectangleF();
+
+ // Reduce rectangle size by scroll bar size
+ foreach(Axis a in this.ChartArea.Axes)
+ {
+ if(a.ScrollBar.IsVisible && !a.ScrollBar.IsPositionedInside)
+ {
+ float size = (float)a.ScrollBar.GetScrollBarRelativeSize();
+ switch( a.AxisPosition )
+ {
+ case AxisPosition.Left:
+ areaPosition.X += size;
+ areaPosition.Width -= size;
+ break;
+ case AxisPosition.Right:
+ areaPosition.Width -= size;
+ break;
+ case AxisPosition.Bottom:
+ areaPosition.Height -= size;
+ break;
+ case AxisPosition.Top:
+ areaPosition.Y += size;
+ areaPosition.Height -= size;
+ break;
+ }
+ }
+ }
+ }
+
+ // Get bar position depending on the axis type
+ RectangleF barPosition = RectangleF.Empty;
+ if(this.axis.PlotAreaPosition != null)
+ {
+ switch( axis.AxisPosition )
+ {
+ case AxisPosition.Left:
+ barPosition.Y = areaPosition.Y;
+ barPosition.Height = areaPosition.Height;
+ barPosition.X =
+ ( (this.IsPositionedInside) ? (float)(axis.GetAxisPosition(true)) : areaPosition.X) - scrollBarSize;// - axisLineSize.Width / 2f;
+ barPosition.Width = scrollBarSize;
+ break;
+ case AxisPosition.Right:
+ barPosition.Y = areaPosition.Y;
+ barPosition.Height = areaPosition.Height;
+ barPosition.X =
+ (this.IsPositionedInside) ? (float)axis.GetAxisPosition(true) : areaPosition.Right;// + axisLineSize.Width / 2f;
+ barPosition.Width = scrollBarSize;
+ break;
+ case AxisPosition.Bottom:
+ barPosition.X = areaPosition.X;
+ barPosition.Width = areaPosition.Width;
+ barPosition.Y =
+ (this.IsPositionedInside) ? (float)axis.GetAxisPosition(true) : areaPosition.Bottom;// + axisLineSize.Height / 2f;
+ barPosition.Height = scrollBarSize;
+ break;
+ case AxisPosition.Top:
+ barPosition.X = areaPosition.X;
+ barPosition.Width = areaPosition.Width;
+ barPosition.Y =
+ ( (this.IsPositionedInside) ? (float)axis.GetAxisPosition(true) : areaPosition.Y) - scrollBarSize;// - axisLineSize.Height / 2f;
+ barPosition.Height = scrollBarSize;
+ break;
+ }
+ }
+
+ return barPosition;
+ }
+
+ /// <summary>
+ /// Internal helper method which returns the relative scroll bar size.
+ /// </summary>
+ /// <returns>Relative scroll bar size.</returns>
+ internal double GetScrollBarRelativeSize()
+ {
+ // Scroll bar is not shown in 3D
+ if(this.axis.ChartArea.Area3DStyle.Enable3D || this.axis.ChartArea.chartAreaIsCurcular)
+ {
+ return 0.0;
+ }
+
+#if SUBAXES
+ // Scrollbar not supported on sub axis
+ if( this.axis != null && this.axis.IsSubAxis)
+ {
+ return 0.0;
+ }
+#endif //SUBAXES
+
+
+ // Get scroll bar relative size depending on the axis location
+ if(this.axis.AxisPosition == AxisPosition.Left || this.axis.AxisPosition == AxisPosition.Right)
+ {
+ return this._scrollBarSize * 100F / ((float)(this.axis.Common.Width - 1));
+ }
+ else
+ {
+ return this._scrollBarSize * 100F / ((float)(this.axis.Common.Height - 1));
+ }
+ }
+
+ /// <summary>
+ /// Returns the percentage size (0-100%) of the data scaleView comparing to
+ /// the axis scale minimum and maximum values.
+ /// </summary>
+ /// <returns>Size of the data scaleView in percentage.</returns>
+ private double GetDataViewPercentage()
+ {
+ double viewPercentage = 100.0;
+
+ // Check if axis data scaleView properties are set
+ if(this.axis != null &&
+ !double.IsNaN(this.axis.ScaleView.Position) &&
+ !double.IsNaN(this.axis.ScaleView.Size))
+ {
+ // Get data scaleView size
+ double dataViewSize = ChartHelper.GetIntervalSize(
+ this.axis.ScaleView.Position,
+ this.axis.ScaleView.Size,
+ this.axis.ScaleView.SizeType);
+
+ // Get axis scale size without margins
+ double minimum = this.axis.minimum + this.axis.marginView;
+ double maximum = this.axis.maximum - this.axis.marginView;
+ if(this.axis.ScaleView.Position < minimum)
+ {
+ minimum = this.axis.ScaleView.Position;
+ }
+ if((this.axis.ScaleView.Position + dataViewSize) > maximum)
+ {
+ maximum = this.axis.ScaleView.Position + dataViewSize;
+ }
+ double axisScaleSize = Math.Abs(minimum - maximum);
+
+ // Check if data scaleView is smaller than axis scale and if it is find the pecentage
+ if(dataViewSize < axisScaleSize)
+ {
+ viewPercentage = dataViewSize / (axisScaleSize / 100.0);
+ }
+ }
+
+ return viewPercentage;
+ }
+
+ /// <summary>
+ /// Returns the the data scaleView position in percentage (0-100%) using
+ /// the axis scale minimum and maximum values.
+ /// </summary>
+ /// <returns>Data scaleView position in percentage.</returns>
+ private double GetDataViewPositionPercentage()
+ {
+ double viewPosition = 0.0;
+
+ // Check if axis data scaleView properties are set
+ if(this.axis != null &&
+ !double.IsNaN(this.axis.ScaleView.Position) &&
+ !double.IsNaN(this.axis.ScaleView.Size))
+ {
+ // Get data scaleView size
+ double dataViewSize = ChartHelper.GetIntervalSize(
+ this.axis.ScaleView.Position,
+ this.axis.ScaleView.Size,
+ this.axis.ScaleView.SizeType);
+
+ // Get axis scale size without margins
+ double minimum = this.axis.minimum + this.axis.marginView;
+ double maximum = this.axis.maximum - this.axis.marginView;
+ if(this.axis.ScaleView.Position < minimum)
+ {
+ minimum = this.axis.ScaleView.Position;
+ }
+ if((this.axis.ScaleView.Position + dataViewSize) > maximum)
+ {
+ maximum = this.axis.ScaleView.Position + dataViewSize;
+ }
+ double axisScaleSize = Math.Abs(minimum - maximum);
+
+ // Calculate data scaleView position in percentage
+ viewPosition = (this.axis.ScaleView.Position - (minimum)) / (axisScaleSize / 100.0);
+ }
+
+ return viewPosition;
+ }
+
+ /// <summary>
+ /// Get total number of buttons in the scroll bar (except tracker).
+ /// </summary>
+ /// <returns>Number of buttons.</returns>
+ private int GetButtonsNumberAll()
+ {
+ int buttonNumber = 0;
+ if((this._scrollBarButtonStyle & ScrollBarButtonStyles.ResetZoom) == ScrollBarButtonStyles.ResetZoom)
+ {
+ buttonNumber += 1;
+ }
+ if((this._scrollBarButtonStyle & ScrollBarButtonStyles.SmallScroll) == ScrollBarButtonStyles.SmallScroll)
+ {
+ buttonNumber += 2;
+ }
+
+ return buttonNumber;
+ }
+
+ /// <summary>
+ /// Get number of buttons in the top (left) part of the scroll bar.
+ /// </summary>
+ /// <returns>Number of buttons.</returns>
+ private int GetButtonsNumberTop()
+ {
+ int buttonNumber = 0;
+ if((this._scrollBarButtonStyle & ScrollBarButtonStyles.ResetZoom) == ScrollBarButtonStyles.ResetZoom)
+ {
+ buttonNumber += 1;
+ }
+ if((this._scrollBarButtonStyle & ScrollBarButtonStyles.SmallScroll) == ScrollBarButtonStyles.SmallScroll)
+ {
+ buttonNumber += 1;
+ }
+
+ return buttonNumber;
+ }
+
+ /// <summary>
+ /// Get number of buttons in the bottom (right) part of the scroll bar.
+ /// </summary>
+ /// <returns>Number of buttons.</returns>
+ private int GetButtonsNumberBottom()
+ {
+ int buttonNumber = 0;
+ if((this._scrollBarButtonStyle & ScrollBarButtonStyles.SmallScroll) == ScrollBarButtonStyles.SmallScroll)
+ {
+ buttonNumber += 1;
+ }
+
+ return buttonNumber;
+ }
+
+#endregion
+
+#region Coordinate convertion methods
+
+ /// <summary>
+ /// Converts Relative size to Absolute size
+ /// </summary>
+ /// <param name="relative">Relative size in %</param>
+ /// <returns>Absolute size</returns>
+ internal SizeF GetAbsoluteSize( SizeF relative )
+ {
+ SizeF absolute = SizeF.Empty;
+
+ // Convert relative coordinates to absolute coordinates
+ absolute.Width = relative.Width * (this.axis.Common.Width - 1) / 100F;
+ absolute.Height = relative.Height * (this.axis.Common.Height - 1) / 100F;
+
+ // Return Absolute coordinates
+ return absolute;
+ }
+
+ /// <summary>
+ /// Converts Absolute size to Relative size
+ /// </summary>
+ /// <param name="size">Absolute size</param>
+ /// <returns>Relative size</returns>
+ internal SizeF GetRelativeSize( SizeF size )
+ {
+ SizeF relative = SizeF.Empty;
+
+ // Convert absolute coordinates to relative coordinates
+ relative.Width = size.Width * 100F / ((float)(this.axis.Common.Width - 1));
+ relative.Height = size.Height * 100F / ((float)(this.axis.Common.Height - 1));
+
+ // Return relative coordinates
+ return relative;
+ }
+
+#endregion
+
+#region IDisposable Members
+
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected virtual void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ // Dispose managed resources
+ if (this._scrollTimer != null)
+ {
+ this._scrollTimer.Dispose();
+ this._scrollTimer = null;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// </summary>
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// The arguments for a scrollbar event.
+ /// </summary>
+ public class ScrollBarEventArgs : EventArgs
+ {
+#region Private fields
+
+ // Private fields for properties values storage
+ private Axis _axis = null;
+ private bool _isHandled = false;
+ private int _mousePositionX = 0;
+ private int _mousePositionY = 0;
+ private ScrollBarButtonType _buttonType = ScrollBarButtonType.ThumbTracker;
+
+#endregion
+
+#region Constructors
+
+ /// <summary>
+ /// ScrollBarEventArgs constructor.
+ /// </summary>
+ /// <param name="axis">Axis containing the scrollbar.</param>
+ /// <param name="x">X position of mouse cursor.</param>
+ /// <param name="y">Y position of mouse cursor.</param>
+ /// <param name="buttonType">Button type of the button clicked.</param>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X and Y are cartesian coordinates and well understood")]
+ public ScrollBarEventArgs(Axis axis, int x, int y, ScrollBarButtonType buttonType)
+ {
+ this._axis = axis;
+ this._mousePositionX = x;
+ this._mousePositionY = y;
+ this._buttonType = buttonType;
+ }
+
+#endregion
+
+#region Properties
+
+ /// <summary>
+ /// Axis containing the scrollbar of the event.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeAxis"),
+ ]
+ public Axis Axis
+ {
+ get
+ {
+ return _axis;
+ }
+ }
+
+ /// <summary>
+ /// ChartArea containing the scrollbar of the event.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeChartArea"),
+ ]
+ public ChartArea ChartArea
+ {
+ get
+ {
+ return _axis.ChartArea;
+ }
+ }
+
+ /// <summary>
+ /// Button type of the scrollbar button clicked.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeScrollBarEventArgs_ButtonType"),
+ ]
+ public ScrollBarButtonType ButtonType
+ {
+ get
+ {
+ return _buttonType;
+ }
+ }
+
+ /// <summary>
+ /// Indicates if the event is handled by the user and no further processing is required.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeScrollBarEventArgs_Handled"),
+ ]
+ public bool IsHandled
+ {
+ get
+ {
+ return _isHandled;
+ }
+ set
+ {
+ _isHandled = value;
+ }
+ }
+
+ /// <summary>
+ /// X position of mouse cursor.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeScrollBarEventArgs_MousePositionX"),
+ ]
+ public int MousePositionX
+ {
+ get
+ {
+ return _mousePositionX;
+ }
+ }
+
+ /// <summary>
+ /// Y position of mouse cursor.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeScrollBarEventArgs_MousePositionY"),
+ ]
+ public int MousePositionY
+ {
+ get
+ {
+ return _mousePositionY;
+ }
+ }
+
+#endregion
+ }
+}
+
+#endif // #if WINFORMS_CONTROL \ No newline at end of file
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/AxisScrollZoom.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/AxisScrollZoom.cs
new file mode 100644
index 00000000000..981fd8127da
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/AxisScrollZoom.cs
@@ -0,0 +1,1770 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: AxisScrollZoom.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: AxisScaleView, ViewEventArgs, DoubleNanValueConverter
+//
+// Purpose: AxisScaleView class represents a data scaleView, and is
+// exposed using the Axis.ScaleView property. A data scaleView is
+// a "scaleView" of data that has a start position (represented
+// by the Position property) and a size (represented by
+// the Size property).
+//
+// Axis data scaleView is used in zooming and scrolling when
+// only part of the data must be visible. Views always
+// belong to an axis, and a scaleView can result from either
+// user interaction or by calling the Zoom or Scroll
+// methods. User interaction, accomplished using range
+// selection along an axis using the mouse, is possible
+// if the IsUserSelectionEnabled property of the chart area'
+// s cursor property is set to true. The end-user selects
+// a range by left-clicking the mouse and dragging the
+// mouse, and when the mouse button is released the
+// selected range is then displayed as a scaleView.
+//
+// Reviewed: AG - Microsoft 16, 2007
+//
+//===================================================================
+
+#region Used namespace
+
+using System;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.ComponentModel;
+using System.Collections;
+using System.Globalization;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+using System.Diagnostics.CodeAnalysis;
+
+
+#else
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+
+#endregion
+
+#if Microsoft_CONTROL
+namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+#endif
+{
+
+ #region Scrolling enumerations
+
+#if Microsoft_CONTROL
+
+ /// <summary>
+ /// Scrolling type enumeration.
+ /// </summary>
+ public enum ScrollType
+ {
+ /// <summary>
+ /// Scrolls by substracting one small size.
+ /// </summary>
+ SmallDecrement,
+ /// <summary>
+ /// Scrolls by adding one small size.
+ /// </summary>
+ SmallIncrement,
+ /// <summary>
+ /// Scrolls by substracting one scaleView size.
+ /// </summary>
+ LargeDecrement,
+ /// <summary>
+ /// Scrolls by adding one scaleView size.
+ /// </summary>
+ LargeIncrement,
+ /// <summary>
+ /// Scrolls to the first scaleView.
+ /// </summary>
+ First,
+ /// <summary>
+ /// Scrolls to the last scaleView.
+ /// </summary>
+ Last
+ }
+
+#endif // Microsoft_CONTROL
+
+ #endregion
+
+ /// <summary>
+ /// AxisScaleView class represents a scale view which allows to display
+ /// only part of the available data.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeAxisDataView_AxisDataView"),
+ DefaultProperty("Position"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class AxisScaleView
+ {
+ #region Fields
+
+ // Reference to the axis object
+ internal Axis axis = null;
+
+ // Axis data scaleView position
+ private double _position = double.NaN;
+
+ // Axis data scaleView size
+ private double _size = double.NaN;
+
+ // Axis data scaleView size units type
+ private DateTimeIntervalType _sizeType = DateTimeIntervalType.Auto;
+
+#if Microsoft_CONTROL
+
+ // Axis data scaleView minimum scaleView/scrolling size
+ private double _minSize = double.NaN;
+
+ // Axis data scaleView minimum scaleView/scrolling size units type
+ private DateTimeIntervalType _minSizeType = DateTimeIntervalType.Auto;
+
+ // Axis data scaleView zooming UI interface enabled flag
+ private bool _zoomable = true;
+
+ // Axis data scaleView scroll line size
+ private double _smallScrollSize = double.NaN;
+
+ // Axis data scaleView scroll line size units type
+ private DateTimeIntervalType _smallScrollSizeType = DateTimeIntervalType.Auto;
+
+ // Axis data scaleView scroll line minimum size
+ private double _smallScrollMinSize = 1.0;
+
+ // Axis data scaleView scroll line minimum size units type
+ private DateTimeIntervalType _smallScrollMinSizeType = DateTimeIntervalType.Auto;
+
+ // Axis data scaleView scroll line minimum size
+ private double _currentSmallScrollSize = double.NaN;
+
+ // Axis data scaleView scroll line minimum size units type
+ private DateTimeIntervalType _currentSmallScrollSizeType = DateTimeIntervalType.Auto;
+
+ // Storage for the saved data scaleView states (position/size/sizetype)
+ internal ArrayList dataViewStates = null;
+
+#endif
+
+ // Ignore validation flag
+ private bool _ignoreValidation = false;
+
+ #endregion
+
+ #region Constructor
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public AxisScaleView()
+ {
+ this.axis = null;
+ }
+
+ /// <summary>
+ /// Internal constructor.
+ /// </summary>
+ /// <param name="axis">Data scaleView axis.</param>
+ internal AxisScaleView(Axis axis)
+ {
+ this.axis = axis;
+ }
+
+ #endregion
+
+ #region Axis data scaleView properties
+
+ /// <summary>
+ /// Gets or sets the position of the AxisScaleView.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxisView"),
+ Bindable(true),
+ DefaultValue(Double.NaN),
+ SRDescription("DescriptionAttributeAxisDataView_Position"),
+ TypeConverter(typeof(DoubleDateNanValueConverter)),
+ ParenthesizePropertyNameAttribute(true)
+ ]
+ public double Position
+ {
+ get
+ {
+ // Axis scaleView is not supported in circular chrt areas
+ if(this.axis != null && this.axis.ChartArea != null && this.axis.ChartArea.chartAreaIsCurcular)
+ {
+ return Double.NaN;
+ }
+ return _position;
+ }
+ set
+ {
+ // Axis scaleView is not supported in circular chrt areas
+ if(this.axis != null && this.axis.ChartArea != null && this.axis.ChartArea.chartAreaIsCurcular)
+ {
+ return;
+ }
+
+ if(_position != value)
+ {
+ // Set new position
+ _position = value;
+
+ // Align scaleView in connected areas
+ if(this.axis != null && this.axis.ChartArea != null && this.axis.Common != null && this.axis.Common.ChartPicture != null)
+ {
+ if(!this.axis.ChartArea.alignmentInProcess)
+ {
+ AreaAlignmentOrientations orientation = (this.axis.axisType == AxisName.X || this.axis.axisType== AxisName.X2) ?
+ AreaAlignmentOrientations.Vertical : AreaAlignmentOrientations.Horizontal;
+ this.axis.Common.ChartPicture.AlignChartAreasAxesView(this.axis.ChartArea, orientation);
+ }
+ }
+
+ // Validate chart
+ if(!_ignoreValidation && axis != null)
+ {
+ axis.Invalidate();
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the size of the AxisScaleView
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxisView"),
+ Bindable(true),
+ DefaultValue(Double.NaN),
+ SRDescription("DescriptionAttributeAxisDataView_Size"),
+ TypeConverter(typeof(DoubleNanValueConverter)),
+ ParenthesizePropertyNameAttribute(true)
+ ]
+ public double Size
+ {
+ get
+ {
+ // Axis scaleView is not supported in circular chrt areas
+ if(this.axis != null && this.axis.ChartArea != null && this.axis.ChartArea.chartAreaIsCurcular)
+ {
+ return Double.NaN;
+ }
+
+ return _size;
+ }
+ set
+ {
+ // Axis scaleView is not supported in circular chrt areas
+ if(this.axis != null && this.axis.ChartArea != null && this.axis.ChartArea.chartAreaIsCurcular)
+ {
+ return;
+ }
+
+ if(_size != value)
+ {
+ // Set size value
+ _size = value;
+
+
+ // Align scaleView in connected areas
+ if(this.axis != null && this.axis.ChartArea != null && this.axis.Common != null && this.axis.Common.ChartPicture != null)
+ {
+ if(!this.axis.ChartArea.alignmentInProcess)
+ {
+ AreaAlignmentOrientations orientation = (this.axis.axisType == AxisName.X || this.axis.axisType== AxisName.X2) ?
+ AreaAlignmentOrientations.Vertical : AreaAlignmentOrientations.Horizontal;
+ this.axis.Common.ChartPicture.AlignChartAreasAxesView(this.axis.ChartArea, orientation);
+ }
+ }
+#if Microsoft_CONTROL
+ // Reset current scrolling line size
+ this._currentSmallScrollSize = double.NaN;
+#endif //Microsoft_CONTROL
+ // Validate chart
+ if(!_ignoreValidation && axis != null)
+ {
+ axis.Invalidate();
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the unit of measurement of the Size property.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxisView"),
+ Bindable(true),
+ DefaultValue(DateTimeIntervalType.Auto),
+ SRDescription("DescriptionAttributeAxisDataView_SizeType"),
+ ParenthesizePropertyNameAttribute(true)
+ ]
+ public DateTimeIntervalType SizeType
+ {
+ get
+ {
+ return _sizeType;
+ }
+ set
+ {
+ if(_sizeType != value)
+ {
+ // Set size type
+ _sizeType = (value != DateTimeIntervalType.NotSet) ? value : DateTimeIntervalType.Auto;
+
+ // Align scaleView in connected areas
+ if(this.axis != null && this.axis.ChartArea != null && this.axis.Common != null && this.axis.Common.ChartPicture != null)
+ {
+ if(!this.axis.ChartArea.alignmentInProcess)
+ {
+ AreaAlignmentOrientations orientation = (this.axis.axisType == AxisName.X || this.axis.axisType== AxisName.X2) ?
+ AreaAlignmentOrientations.Vertical : AreaAlignmentOrientations.Horizontal;
+ this.axis.Common.ChartPicture.AlignChartAreasAxesView(this.axis.ChartArea, orientation);
+ }
+ }
+
+ // Validate chart
+ if(!_ignoreValidation && axis != null)
+ {
+ axis.Invalidate();
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Indicates if axis is zoomed-in.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxisView"),
+ Bindable(false),
+ Browsable(false),
+ SRDescription("DescriptionAttributeAxisDataView_IsZoomed"),
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
+ SerializationVisibility(SerializationVisibility.Hidden),
+ ]
+ public bool IsZoomed
+ {
+ get
+ {
+ return (
+ !double.IsNaN(this.Size) &&
+ this.Size != 0.0 &&
+ !double.IsNaN(this.Position));
+ }
+ }
+
+#if Microsoft_CONTROL
+
+ /// <summary>
+ /// Gets or sets the minimum size of the AxisScaleView.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxisView"),
+ Bindable(true),
+ DefaultValue(Double.NaN),
+ SRDescription("DescriptionAttributeAxisDataView_MinSize"),
+ TypeConverter(typeof(DoubleNanValueConverter))
+ ]
+ public double MinSize
+ {
+ get
+ {
+ return _minSize;
+ }
+ set
+ {
+ _minSize = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the unit of measurement of the MinSize property.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxisView"),
+ Bindable(true),
+ DefaultValue(DateTimeIntervalType.Auto),
+ SRDescription("DescriptionAttributeAxisDataView_MinSizeType"),
+ ]
+ public DateTimeIntervalType MinSizeType
+ {
+ get
+ {
+ return _minSizeType;
+ }
+ set
+ {
+ _minSizeType = (value != DateTimeIntervalType.NotSet) ? value : DateTimeIntervalType.Auto;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag which indicates whether the zooming user interface is enabled.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxisView"),
+ Bindable(true),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeAxisDataView_Zoomable"),
+ SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification="'Zoomable' is a commonly used term and generally well understood"),
+ ]
+ public bool Zoomable
+ {
+ get
+ {
+ return _zoomable;
+ }
+ set
+ {
+ _zoomable = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the small scrolling size.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxisView"),
+ Bindable(true),
+ DefaultValue(Double.NaN),
+ SRDescription("DescriptionAttributeAxisDataView_SmallScrollSize"),
+ TypeConverter(typeof(AxisMinMaxAutoValueConverter))
+ ]
+ public double SmallScrollSize
+ {
+ get
+ {
+ return _smallScrollSize;
+ }
+ set
+ {
+ if(_smallScrollSize != value)
+ {
+ // Set size value
+ _smallScrollSize = value;
+
+ // Validate chart
+ if(!_ignoreValidation && axis != null)
+ {
+ axis.Invalidate();
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the unit of measurement for the SmallScrollMinSize property
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxisView"),
+ Bindable(true),
+ DefaultValue(DateTimeIntervalType.Auto),
+ SRDescription("DescriptionAttributeAxisDataView_SmallScrollSizeType"),
+ ]
+ public DateTimeIntervalType SmallScrollSizeType
+ {
+ get
+ {
+ return _smallScrollSizeType;
+ }
+ set
+ {
+ if(_smallScrollSizeType != value)
+ {
+ // Set size type
+ _smallScrollSizeType = (value != DateTimeIntervalType.NotSet) ? value : DateTimeIntervalType.Auto;
+
+ // Validate chart
+ if(!_ignoreValidation && axis != null)
+ {
+ axis.Invalidate();
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the minimum small scrolling size.
+ /// Only used if the small scrolling size is not set.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxisView"),
+ Bindable(true),
+ DefaultValue(1.0),
+ SRDescription("DescriptionAttributeAxisDataView_SmallScrollMinSize")
+ ]
+ public double SmallScrollMinSize
+ {
+ get
+ {
+ return _smallScrollMinSize;
+ }
+ set
+ {
+ if(_smallScrollMinSize != value)
+ {
+ // Set size value
+ _smallScrollMinSize = value;
+
+ _currentSmallScrollSize = double.NaN;
+
+ // Validate chart
+ if(!_ignoreValidation && axis != null)
+ {
+ axis.Invalidate();
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the unit of measurement for the SmallScrollMinSize property.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxisView"),
+ Bindable(true),
+ DefaultValue(DateTimeIntervalType.Auto),
+ SRDescription("DescriptionAttributeAxisDataView_SmallScrollMinSizeType"),
+ ]
+ public DateTimeIntervalType SmallScrollMinSizeType
+ {
+ get
+ {
+ return _smallScrollMinSizeType;
+ }
+ set
+ {
+ if(_smallScrollMinSizeType != value)
+ {
+ // Set size type
+ _smallScrollMinSizeType = (value != DateTimeIntervalType.NotSet) ? value : DateTimeIntervalType.Auto;
+
+ _currentSmallScrollSize = double.NaN;
+
+ // Validate chart
+ if(!_ignoreValidation && axis != null)
+ {
+ axis.Invalidate();
+ }
+ }
+ }
+ }
+
+#endif // Microsoft_CONTROL
+
+ #endregion
+
+ #region ScaleView position internal methods
+
+ /// <summary>
+ /// Call this method to get the minimum axis value of a data view.
+ /// </summary>
+ /// <returns>The minimum axis value for the data view.</returns>
+ [Browsable(false)]
+ [Utilities.SerializationVisibility(Utilities.SerializationVisibility.Hidden)]
+ public double ViewMinimum
+ {
+ get
+ {
+ // If zooming is enabled
+ if (!Double.IsNaN(this.Size))
+ {
+ // If size set only use axis minimum for scaleView position
+ if (Double.IsNaN(this.Position))
+ {
+ this.Position = this.axis.Minimum;
+ }
+ // Check if scaleView position and size are set
+ else
+ {
+ // Calculate and add axis side margin
+ if (this.Position <= axis.minimum)
+ {
+ return this.Position;
+ }
+ else // Add a margin only if scaleView is inside data point scaleView
+ {
+ return this.Position - axis.marginView;
+ }
+ }
+ }
+
+ // Return axis scale minimum value if scaleView position is not set
+ return axis.minimum;
+ }
+ }
+
+ /// <summary>
+ /// Maximum axis value of a data view.
+ /// </summary>
+ /// <returns>The maximum axis value for the data view.</returns>
+ [Browsable(false)]
+ [Utilities.SerializationVisibility(Utilities.SerializationVisibility.Hidden)]
+ public double ViewMaximum
+ {
+ get
+ {
+ // If zooming is enabled
+ if (!Double.IsNaN(this.Size))
+ {
+ // If size set only use axis minimum for scaleView position
+ if (Double.IsNaN(this.Position))
+ {
+ this.Position = this.axis.Minimum;
+ }
+
+ // Check if scaleView position and size are set
+ else
+ {
+ // Get axis interval
+ double viewSize = ChartHelper.GetIntervalSize(this.Position, this.Size, this.SizeType);
+
+ // Calculate and add axis side margin
+ if (this.Position + viewSize >= axis.maximum)
+ {
+ return this.Position + viewSize;
+ }
+ else // Add a margin only if scaleView is inside data point scaleView
+ {
+ return this.Position + viewSize + axis.marginView;
+ }
+ }
+ }
+
+ // Return axis scale maximum value if scaleView position is not set
+ return axis.maximum;
+ }
+ }
+
+ #endregion
+
+ #region Scrolling methods
+
+#if Microsoft_CONTROL
+
+ /// <summary>
+ /// Call this method to scroll to a specified position along an axis.
+ /// </summary>
+ /// <param name="scrollType">Direction and size to scroll.</param>
+ public void Scroll(ScrollType scrollType)
+ {
+ this.Scroll(scrollType, false);
+ }
+
+ /// <summary>
+ /// Scrolls axis data scaleView from current position.
+ /// </summary>
+ /// <param name="scrollType">Direction and size to scroll.</param>
+ /// <param name="fireChangeEvents">Fire scaleView position events from this method.</param>
+ internal void Scroll(ScrollType scrollType, bool fireChangeEvents)
+ {
+ // Adjust current position depending on the scroll type
+ double newPosition = this._position;
+ switch(scrollType)
+ {
+ case(ScrollType.SmallIncrement):
+ newPosition += ((axis.IsReversed) ? -1 : 1) * ChartHelper.GetIntervalSize(this._position, this.GetScrollingLineSize(), this.GetScrollingLineSizeType());
+ break;
+ case(ScrollType.SmallDecrement):
+ newPosition -= ((axis.IsReversed) ? -1 : 1) * ChartHelper.GetIntervalSize(this._position, this.GetScrollingLineSize(), this.GetScrollingLineSizeType());
+ break;
+ case(ScrollType.LargeIncrement):
+ newPosition += ((axis.IsReversed) ? -1 : 1) * ChartHelper.GetIntervalSize(this._position, this.Size, this.SizeType);
+ break;
+ case(ScrollType.LargeDecrement):
+ newPosition -= ((axis.IsReversed) ? -1 : 1) * ChartHelper.GetIntervalSize(this._position, this.Size, this.SizeType);
+ break;
+ case(ScrollType.First):
+ if(!axis.IsReversed)
+ {
+ newPosition = (axis.minimum + axis.marginView);
+ }
+ else
+ {
+ newPosition = (axis.maximum - axis.marginView);
+ }
+ break;
+ case(ScrollType.Last):
+ {
+ double viewSize = ChartHelper.GetIntervalSize(newPosition, this.Size, this.SizeType);
+ if(!axis.IsReversed)
+ {
+ newPosition = (axis.maximum - axis.marginView - viewSize);
+ }
+ else
+ {
+ newPosition = (axis.minimum + axis.marginView + viewSize);
+ }
+ break;
+ }
+ }
+
+ // Scroll to the new position
+ this.Scroll(newPosition, fireChangeEvents);
+ }
+
+ /// <summary>
+ /// Call this method to scroll to a specified position along an axis.
+ /// </summary>
+ /// <param name="newPosition">New position.</param>
+ public void Scroll(double newPosition)
+ {
+ this.Scroll(newPosition, false);
+ }
+
+ /// <summary>
+ /// Call this method to scroll to a specified position along an axis.
+ /// </summary>
+ /// <param name="newPosition">New position.</param>
+ public void Scroll(DateTime newPosition)
+ {
+ this.Scroll(newPosition.ToOADate(), false);
+ }
+
+ /// <summary>
+ /// Internal helper method for scrolling into specified position.
+ /// </summary>
+ /// <param name="newPosition">New data scaleView position.</param>
+ /// <param name="fireChangeEvents">Fire scaleView position events from this method.</param>
+ internal void Scroll(double newPosition, bool fireChangeEvents)
+ {
+ // Get current scaleView size
+ double viewSize = ChartHelper.GetIntervalSize(newPosition, this.Size, this.SizeType);
+
+ // Validate new scaleView position
+ if(newPosition < (axis.minimum + axis.marginView))
+ {
+ newPosition = (axis.minimum + axis.marginView);
+ }
+ else if(newPosition > (axis.maximum - axis.marginView - viewSize))
+ {
+ newPosition = (axis.maximum - axis.marginView - viewSize);
+ }
+
+ // Fire scaleView position changing events
+ ViewEventArgs arguments = new ViewEventArgs(this.axis, newPosition, this.Size, this.SizeType);
+ if(fireChangeEvents && GetChartObject() != null)
+ {
+ GetChartObject().OnAxisViewChanging(arguments);
+ newPosition = arguments.NewPosition;
+ }
+
+ // Check if data scaleView position and size is different from current
+ if(newPosition == this.Position)
+ {
+ return;
+ }
+
+ // Change scaleView position
+ this.Position = newPosition;
+
+ // Fire scaleView position changed events
+ if(fireChangeEvents && GetChartObject() != null)
+ {
+ GetChartObject().OnAxisViewChanged(arguments);
+ }
+ }
+
+#endif
+ #endregion
+
+ #region Zooming and ZoomResetting methods
+
+#if Microsoft_CONTROL
+
+ /// <summary>
+ /// Sets a new axis data view/position based on the start and end dates specified.
+ /// </summary>
+ /// <param name="viewPosition">New start position for the axis scale view.</param>
+ /// <param name="viewSize">New size for the axis scale view.</param>
+ /// <param name="viewSizeType">New unit of measurement of the size.</param>
+ /// <param name="saveState">Indicates whether the current size/position needs to be saved.</param>
+ public void Zoom(double viewPosition, double viewSize, DateTimeIntervalType viewSizeType, bool saveState)
+ {
+ this.Zoom(viewPosition, viewSize, viewSizeType, false, saveState);
+ }
+
+ /// <summary>
+ /// Sets a new axis data view/position based on the specified start and end values.
+ /// </summary>
+ /// <param name="viewStart">New start position for the axis scale view.</param>
+ /// <param name="viewEnd">New end position for the axis scale view.</param>
+ public void Zoom(double viewStart, double viewEnd)
+ {
+ this.Zoom(viewStart, viewEnd - viewStart, DateTimeIntervalType.Number, false, false);
+ }
+
+ /// <summary>
+ /// Sets a new axis data view/position based on the start and end dates specified.
+ /// </summary>
+ /// <param name="viewPosition">New start position for the axis scale view.</param>
+ /// <param name="viewSize">New size for the axis scale view.</param>
+ /// <param name="viewSizeType">New unit of measurement of the size.</param>
+ public void Zoom(double viewPosition, double viewSize, DateTimeIntervalType viewSizeType)
+ {
+ this.Zoom(viewPosition, viewSize, viewSizeType, false, false);
+ }
+
+ /// <summary>
+ /// Reset the specified number of zooming operations by restoring axis data view.
+ /// </summary>
+ /// <param name="numberOfViews">Number of zoom operations to reset. Zero for all.</param>
+ public void ZoomReset(int numberOfViews)
+ {
+ this.LoadDataViewState(numberOfViews, false);
+ }
+
+ /// <summary>
+ /// Reset one zooming operation by restoring axis data view.
+ /// </summary>
+ public void ZoomReset()
+ {
+ this.LoadDataViewState(1, false);
+ }
+
+ /// <summary>
+ /// Reset several zooming operation by restoring data scaleView size/position.
+ /// </summary>
+ /// <param name="numberOfViews">How many scaleView zoom operations to reset. Zero for all.</param>
+ /// <param name="fireChangeEvents">Fire scaleView position events from this method.</param>
+ internal void ZoomReset(int numberOfViews, bool fireChangeEvents)
+ {
+ this.LoadDataViewState(numberOfViews, fireChangeEvents);
+ }
+
+ /// <summary>
+ /// Internal helper zooming method.
+ /// </summary>
+ /// <param name="viewPosition">New data scaleView start posiion.</param>
+ /// <param name="viewSize">New data scaleView size.</param>
+ /// <param name="viewSizeType">New data scaleView size units type.</param>
+ /// <param name="fireChangeEvents">Fire scaleView position events from this method.</param>
+ /// <param name="saveState">Indicates that current scaleView size/position must be save, so it can be restored later.</param>
+ /// <returns>True if zoom operation was made.</returns>
+ internal bool Zoom(
+ double viewPosition,
+ double viewSize,
+ DateTimeIntervalType viewSizeType,
+ bool fireChangeEvents,
+ bool saveState)
+ {
+ // Validate new scaleView position and size
+ ValidateViewPositionSize(ref viewPosition, ref viewSize, ref viewSizeType);
+
+ // Fire scaleView position/size changing events
+ ViewEventArgs arguments = new ViewEventArgs(this.axis, viewPosition, viewSize, viewSizeType);
+ if(fireChangeEvents && GetChartObject() != null)
+ {
+ GetChartObject().OnAxisViewChanging(arguments);
+ viewPosition = arguments.NewPosition;
+ viewSize = arguments.NewSize;
+ viewSizeType = arguments.NewSizeType;
+ }
+
+ // Check if data scaleView position and size is different from current
+ if(viewPosition == this.Position &&
+ viewSize == this.Size &&
+ viewSizeType == this.SizeType)
+ {
+ return false;
+ }
+
+ // Save current data scaleView state, so it can be restored
+ if(saveState)
+ {
+ SaveDataViewState();
+ }
+
+ // Change scaleView position/size
+ this._ignoreValidation = true;
+ this.Position = viewPosition;
+ this.Size = viewSize;
+ this.SizeType = viewSizeType;
+ this._ignoreValidation = false;
+
+ // Reset current scrolling line size
+ this._currentSmallScrollSize = double.NaN;
+
+ // Invalidate chart
+ axis.Invalidate();
+
+ // Fire scaleView position/size changed events
+ if(fireChangeEvents && GetChartObject() != null)
+ {
+ GetChartObject().OnAxisViewChanged(arguments);
+ }
+
+ return true;
+ }
+
+#endif
+
+ #endregion
+
+ #region Data scaleView state saving/restoring methods
+
+#if Microsoft_CONTROL
+
+ /// <summary>
+ /// Saves current data scaleView position/size/sizetype, so
+ /// it can be restored later.
+ /// </summary>
+ /// <param name="numberOfViews">Number of time to reset zoom. Zero for all.</param>
+ /// <param name="fireChangeEvents">Fire scaleView position events from this method.</param>
+ private void LoadDataViewState(int numberOfViews, bool fireChangeEvents)
+ {
+ // Check parameters
+ if(numberOfViews < 0)
+ {
+ throw (new ArgumentOutOfRangeException("numberOfViews", SR.ExceptionScrollBarZoomResetsNumberInvalid));
+ }
+ // Check if storage was created
+ if(dataViewStates != null && dataViewStates.Count >= 3)
+ {
+ // Find starting index of restoring state
+ int dataStartIndex = 0;
+ if(numberOfViews > 0)
+ {
+ dataStartIndex = dataViewStates.Count - numberOfViews * 3;
+ if(dataStartIndex < 0)
+ {
+ dataStartIndex = 0;
+ }
+ }
+
+
+ // Fire scaleView position/size changing events
+ ViewEventArgs arguments = new ViewEventArgs(
+ this.axis,
+ (double)dataViewStates[dataStartIndex],
+ (double)dataViewStates[dataStartIndex + 1],
+ (DateTimeIntervalType)dataViewStates[dataStartIndex + 2]);
+ if(fireChangeEvents && GetChartObject() != null)
+ {
+ GetChartObject().OnAxisViewChanging(arguments);
+ }
+
+ // Restore data
+ this.Position = arguments.NewPosition;
+ this.Size = arguments.NewSize;
+ this.SizeType = arguments.NewSizeType;
+
+ // Fire scaleView position/size changed events
+ if(fireChangeEvents && GetChartObject() != null)
+ {
+ GetChartObject().OnAxisViewChanged(arguments);
+ }
+
+ // Clear data
+ int itemsToRemove = numberOfViews * 3;
+ if (itemsToRemove > (dataViewStates.Count - dataStartIndex))
+ {
+ itemsToRemove = dataViewStates.Count - dataStartIndex;
+ }
+ dataViewStates.RemoveRange(dataStartIndex, itemsToRemove);
+
+
+ // clean up the history state when the numberOfViews == 0 (reset all by docs)
+ if ( numberOfViews == 0 )
+ {
+ dataViewStates.Clear();
+ }
+ if (Double.IsNaN(this.Position) || Double.IsNaN(this.Size))
+ {
+ this.Position = Double.NaN;
+ this.Size = Double.NaN;
+ }
+
+ }
+
+ // Nothing to restore - just disable the data scaleView
+ else
+ {
+ // Fire scaleView position/size changing events
+ ViewEventArgs arguments = new ViewEventArgs(
+ this.axis,
+ double.NaN,
+ double.NaN,
+ DateTimeIntervalType.Auto);
+
+ if(fireChangeEvents && GetChartObject() != null)
+ {
+ GetChartObject().OnAxisViewChanging(arguments);
+ }
+
+ // Restore data
+ this.Position = arguments.NewPosition;
+ this.Size = arguments.NewSize;
+ this.SizeType = arguments.NewSizeType;
+
+ // Fire scaleView position/size changed events
+ if(fireChangeEvents && GetChartObject() != null)
+ {
+ GetChartObject().OnAxisViewChanged(arguments);
+ }
+ }
+ // clear cached chart areas and bitmap buffers
+ GetChartObject().Refresh();
+ }
+
+ /// <summary>
+ /// Saves current data scaleView position/size/sizetype, so
+ /// it can be restored later.
+ /// </summary>
+ private void SaveDataViewState()
+ {
+ // Create storage array
+ if(dataViewStates == null)
+ {
+ dataViewStates = new ArrayList();
+ }
+
+ // Save data scaleView state
+ dataViewStates.Add(this.Position);
+ dataViewStates.Add(this.Size);
+ dataViewStates.Add(this.SizeType);
+ }
+#endif
+
+ #endregion
+
+ #region Helper methods
+
+#if Microsoft_CONTROL
+ /// <summary>
+ /// Initialize internal scrolling line size variables for later use.
+ /// This size is used in to scroll chart one line up or down.
+ /// </summary>
+ private void GetCurrentViewSmallScrollSize()
+ {
+ //**************************************************************************
+ //** Check if current scrolling line size was not already calculated
+ //**************************************************************************
+ if(double.IsNaN(_currentSmallScrollSize))
+ {
+ //**************************************************************************
+ //** Calculate line size depending on the current scaleView size
+ //**************************************************************************
+ if(this.SizeType == DateTimeIntervalType.Auto || this.SizeType == DateTimeIntervalType.Number)
+ {
+ // Set line size type
+ _currentSmallScrollSizeType = DateTimeIntervalType.Number;
+
+ // Devide scaleView by 20 to find the scrolling line size
+ double newSize = this.Size / 20.0;
+
+ // Make sure that current line size is even with minimum value
+ if(!double.IsNaN(this.SmallScrollMinSize) && this.SmallScrollMinSize != 0.0)
+ {
+ double rounder = (Math.Round(newSize / this.SmallScrollMinSize));
+ if(rounder < 0)
+ {
+ rounder = 1;
+ }
+ newSize = rounder * this.SmallScrollMinSize;
+ }
+
+ // Set new current line size
+ this._currentSmallScrollSize = newSize;
+ }
+ else
+ {
+ // Calculate line size for date/time
+ double viewEndPosition = this.Position + ChartHelper.GetIntervalSize(this.Position, this.Size, this.SizeType);
+ _currentSmallScrollSize = axis.CalcInterval(
+ this.Position,
+ viewEndPosition,
+ true,
+ out _currentSmallScrollSizeType,
+ ChartValueType.Auto);
+ }
+
+ //**************************************************************************
+ //** Make sure calculated scroll line size is not smaller than the minimum
+ //**************************************************************************
+ if(!double.IsNaN(this.SmallScrollMinSize) && this.SmallScrollMinSize != 0.0)
+ {
+ double newLineSize = ChartHelper.GetIntervalSize(this.Position, _currentSmallScrollSize, _currentSmallScrollSizeType);
+ double minLineSize = ChartHelper.GetIntervalSize(this.Position, this.SmallScrollMinSize, this.SmallScrollMinSizeType);
+ if(newLineSize < minLineSize)
+ {
+ _currentSmallScrollSize = SmallScrollMinSize;
+ _currentSmallScrollSizeType = SmallScrollMinSizeType;
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Returns the scroll line size.
+ /// </summary>
+ /// <returns>Scroll line size.</returns>
+ internal double GetScrollingLineSize()
+ {
+ // Scroll line size/type is specificly set by user
+ if(!double.IsNaN(this.SmallScrollSize))
+ {
+ return this.SmallScrollSize;
+ }
+
+ // Calcualte scroll line size depending on the current scaleView size
+ GetCurrentViewSmallScrollSize();
+
+ // Return line size
+ return _currentSmallScrollSize;
+ }
+
+ /// <summary>
+ /// Returns the scroll line size units type.
+ /// </summary>
+ /// <returns>Scroll line size units type.</returns>
+ internal DateTimeIntervalType GetScrollingLineSizeType()
+ {
+ // Scroll line size/type is specificly set by user
+ if(!double.IsNaN(this.SmallScrollSize))
+ {
+ return this.SmallScrollSizeType;
+ }
+
+ // Calcualte scroll line size depending on the current scaleView size
+ GetCurrentViewSmallScrollSize();
+
+ // Return line size units type
+ return _currentSmallScrollSizeType;
+ }
+
+ /// <summary>
+ /// Helper method, which validates the axis data scaleView position and size.
+ /// Returns adjusted scaleView position and size.
+ /// </summary>
+ /// <param name="viewPosition">ScaleView position.</param>
+ /// <param name="viewSize">ScaleView size.</param>
+ /// <param name="viewSizeType">ScaleView size units type.</param>
+ private void ValidateViewPositionSize(ref double viewPosition, ref double viewSize, ref DateTimeIntervalType viewSizeType)
+ {
+ //****************************************************************
+ //** Check if new scaleView position is inside axis scale
+ //** minimum/maximum without margin.
+ //****************************************************************
+ if(viewPosition < (axis.minimum + axis.marginView))
+ {
+ if(viewSizeType == DateTimeIntervalType.Auto || viewSizeType == DateTimeIntervalType.Number)
+ {
+ viewSize -= (axis.minimum + axis.marginView) - viewPosition;
+ }
+ viewPosition = (axis.minimum + axis.marginView);
+ }
+ else if(viewPosition > (axis.maximum - axis.marginView))
+ {
+ if(viewSizeType == DateTimeIntervalType.Auto || viewSizeType == DateTimeIntervalType.Number)
+ {
+ viewSize -= viewPosition - (axis.maximum - axis.marginView);
+ }
+ viewPosition = (axis.maximum - axis.marginView);
+ }
+
+ //****************************************************************
+ //** Check if new scaleView size is not smaller than minimum size
+ //** set by the user
+ //****************************************************************
+ double newViewSize = ChartHelper.GetIntervalSize(viewPosition, viewSize, viewSizeType);
+ double minViewSize = ChartHelper.GetIntervalSize(viewPosition, 1, this.MinSizeType);
+ if(!double.IsNaN(this.MinSize))
+ {
+ minViewSize = ChartHelper.GetIntervalSize(viewPosition, this.MinSize, this.MinSizeType);
+ if(newViewSize < minViewSize)
+ {
+ viewSize = (double.IsNaN(this.MinSize)) ? 1 : this.MinSize;
+ viewSizeType = this.MinSizeType;
+ newViewSize = ChartHelper.GetIntervalSize(viewPosition, viewSize, viewSizeType);
+ }
+ }
+
+ //****************************************************************
+ //** Check if new scaleView size is smaller than (0.000000001)
+ //****************************************************************
+ if(newViewSize < 0.000000001)
+ {
+ viewSize = 0.000000001;
+ viewSizeType = DateTimeIntervalType.Number;
+ newViewSize = ChartHelper.GetIntervalSize(viewPosition, viewSize, viewSizeType);
+ }
+
+ //****************************************************************
+ //** Check if new scaleView end position (position + size) is inside
+ //** axis scale minimum/maximum without margin.
+ //****************************************************************
+ while( (viewPosition + newViewSize) > (axis.maximum - axis.marginView) )
+ {
+ double currentSize = viewSize;
+ DateTimeIntervalType currentSizeType = viewSizeType;
+
+ // Try to reduce the scaleView size
+ if(newViewSize > minViewSize)
+ {
+ // Try to adjust the scaleView size
+ if(viewSize > 1)
+ {
+ --viewSize;
+ }
+ else if(viewSizeType == DateTimeIntervalType.Years)
+ {
+ viewSize = 11;
+ viewSizeType = DateTimeIntervalType.Months;
+ }
+ else if(viewSizeType == DateTimeIntervalType.Months)
+ {
+ viewSize = 4;
+ viewSizeType = DateTimeIntervalType.Weeks;
+ }
+ else if(viewSizeType == DateTimeIntervalType.Weeks)
+ {
+ viewSize = 6;
+ viewSizeType = DateTimeIntervalType.Days;
+ }
+ else if(viewSizeType == DateTimeIntervalType.Days)
+ {
+ viewSize = 23;
+ viewSizeType = DateTimeIntervalType.Hours;
+ }
+ else if(viewSizeType == DateTimeIntervalType.Hours)
+ {
+ viewSize = 59;
+ viewSizeType = DateTimeIntervalType.Minutes;
+ }
+ else if(viewSizeType == DateTimeIntervalType.Minutes)
+ {
+ viewSize = 59;
+ viewSizeType = DateTimeIntervalType.Seconds;
+ }
+ else if(viewSizeType == DateTimeIntervalType.Seconds)
+ {
+ viewSize = 999;
+ viewSizeType = DateTimeIntervalType.Milliseconds;
+ }
+ else
+ {
+ viewPosition = (axis.maximum - axis.marginView) - minViewSize;
+ break;
+ }
+
+ // Double check that scaleView size is not smaller than min size
+ newViewSize = ChartHelper.GetIntervalSize(viewPosition, viewSize, viewSizeType);
+ if(newViewSize < minViewSize)
+ {
+ // Can't adjust size no more (restore prev. value)
+ viewSize = currentSize;
+ viewSizeType = currentSizeType;
+
+ // Adjust the start position
+ viewPosition = (axis.maximum - axis.marginView) - minViewSize;
+ break;
+ }
+ }
+ else
+ {
+ // Adjust the start position
+ viewPosition = (axis.maximum - axis.marginView) - newViewSize;
+ break;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Helper function which returns a reference to the chart object.
+ /// </summary>
+ /// <returns>Chart object reference.</returns>
+ internal Chart GetChartObject()
+ {
+ if(this.axis != null && this.axis.Common!=null)
+ {
+ return this.axis.Common.Chart;
+ }
+
+ return null;
+ }
+#endif //Microsoft_CONTROL
+
+ #endregion
+ }
+
+#if Microsoft_CONTROL
+
+ /// <summary>
+ /// This class is used as a parameter object in the AxisViewChanged and AxisViewChanging events of the root Chart object.
+ /// </summary>
+ public class ViewEventArgs : EventArgs
+ {
+ #region Private fields
+
+ // Private fields for properties values storage
+ private Axis _axis = null;
+ private double _newPosition = double.NaN;
+ private double _newSize = double.NaN;
+ private DateTimeIntervalType _newSizeType = DateTimeIntervalType.Auto;
+
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// ViewEventArgs constructor.
+ /// </summary>
+ /// <param name="axis">Axis of the scale view.</param>
+ /// <param name="newPosition">New scale view start position.</param>
+ public ViewEventArgs(Axis axis, double newPosition)
+ {
+ this._axis = axis;
+ this._newPosition = newPosition;
+ }
+
+ /// <summary>
+ /// ViewEventArgs constructor.
+ /// </summary>
+ /// <param name="axis">Axis of the scale view.</param>
+ /// <param name="newPosition">New scale view start position.</param>
+ /// <param name="newSize">New scale view size.</param>
+ /// <param name="newSizeType">New unit of measurement of the size.</param>
+ public ViewEventArgs(Axis axis, double newPosition, double newSize, DateTimeIntervalType newSizeType)
+ {
+ this._axis = axis;
+ this._newPosition = newPosition;
+ this._newSize = newSize;
+ this._newSizeType = newSizeType;
+ }
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Axis of the event.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeAxis"),
+ ]
+ public Axis Axis
+ {
+ get
+ {
+ return _axis;
+ }
+ }
+
+ /// <summary>
+ /// ChartArea of the event.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeChartArea"),
+ ]
+ public ChartArea ChartArea
+ {
+ get
+ {
+ return _axis.ChartArea;
+ }
+ }
+
+ /// <summary>
+ /// New scale view start position.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeViewEventArgs_NewPosition"),
+ ]
+ public double NewPosition
+ {
+ get
+ {
+ return _newPosition;
+ }
+ set
+ {
+ _newPosition = value;
+ }
+ }
+
+ /// <summary>
+ /// New scale view size.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeViewEventArgs_NewSize"),
+ ]
+ public double NewSize
+ {
+ get
+ {
+ return _newSize;
+ }
+ set
+ {
+ _newSize = value;
+ }
+ }
+
+ /// <summary>
+ /// New unit of measurement of the scale view.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeViewEventArgs_NewSizeType"),
+ ]
+ public DateTimeIntervalType NewSizeType
+ {
+ get
+ {
+ return _newSizeType;
+ }
+ set
+ {
+ _newSizeType = (value != DateTimeIntervalType.NotSet) ? value : DateTimeIntervalType.Auto;
+ }
+ }
+
+ #endregion
+ }
+
+#endif // #if Microsoft_CONTROL
+}
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+ namespace System.Web.UI.DataVisualization.Charting
+#endif
+{
+ /// <summary>
+ /// Designer converter class
+ /// Converts Double.NaN values to/from "Not set".
+ /// </summary>
+ internal class DoubleNanValueConverter : DoubleConverter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// Standard values supported. This method always return true.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>True.</returns>
+ public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Standard values are not exclusive. This method always return false.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>False.</returns>
+ public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// Get in the collection of standard values.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
+ {
+ ArrayList values = new ArrayList();
+ values.Add(Double.NaN);
+
+ return new StandardValuesCollection(values);
+ }
+
+ /// <summary>
+ /// Convert double.NaN to string "Not set"
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert.</param>
+ /// <param name="destinationType">Conversion destination type.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+ {
+ double doubleValue = (double)value;
+ if (destinationType == typeof(string))
+ {
+ if(Double.IsNaN(doubleValue))
+ {
+ return Constants.NotSetValue;
+ }
+ }
+
+ // Call base class
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
+
+ /// <summary>
+ /// Convert minimum or maximum values from string.
+ /// </summary>
+ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
+ {
+ // If converting from string value
+ string crossingValue = value as string;
+ if (crossingValue != null)
+ {
+ if (String.Compare(crossingValue, Constants.NotSetValue, StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ return Double.NaN;
+ }
+ }
+
+ // Call base converter
+ return base.ConvertFrom(context, culture, value);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Designer converter class
+ /// Converts Double.NaN values to/from "Not set".
+ /// Converts value to/from date strings.
+ /// </summary>
+ internal class DoubleDateNanValueConverter : DoubleConverter
+ {
+ #region Converter methods
+
+ /// <summary>
+ /// Standard values supported - return true
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Standard values supported.</returns>
+ public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Standard values are not exclusive - return false
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <returns>Non exclusive standard values.</returns>
+ public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// Fill in the list of predefined values.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
+ {
+ ArrayList values = new ArrayList();
+ values.Add(Double.NaN);
+
+ return new StandardValuesCollection(values);
+ }
+
+ /// <summary>
+ /// Convert values to string if step type is set to one of the DateTime type
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert.</param>
+ /// <param name="destinationType">Conversion destination type.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+ {
+ // Check for NaN
+ if (destinationType == typeof(string))
+ {
+ if(Double.IsNaN((double)value))
+ {
+ return Constants.NotSetValue;
+ }
+ }
+
+ if (context != null && context.Instance != null)
+ {
+ // Get access to the Axis object
+ Axis axis = null;
+ if(context.Instance is AxisScaleView)
+ {
+ axis = ((AxisScaleView)context.Instance).axis;
+ }
+
+#if Microsoft_CONTROL
+
+ else if(context.Instance is Cursor)
+ {
+ axis = ((Cursor)context.Instance).GetAxis();
+ }
+#endif // Microsoft_CONTROL
+
+ if (axis != null && destinationType == typeof(string))
+ {
+ string strValue = ConvertDateTimeToString(
+ (double)value,
+ axis.GetAxisValuesType(),
+ axis.InternalIntervalType);
+
+ if (strValue != null)
+ return strValue;
+ }
+
+ }
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
+
+ public static string ConvertDateTimeToString(
+ double dtValue,
+ ChartValueType axisValuesType,
+ DateTimeIntervalType dtIntervalType)
+ {
+ string strValue = null;
+ // Use axis values types if interval is automatic
+ if (dtIntervalType == DateTimeIntervalType.Auto)
+ {
+ if (axisValuesType == ChartValueType.DateTime ||
+ axisValuesType == ChartValueType.Time ||
+ axisValuesType == ChartValueType.Date ||
+ axisValuesType == ChartValueType.DateTimeOffset)
+ {
+ strValue = DateTime.FromOADate(dtValue).ToString("g", System.Globalization.CultureInfo.CurrentCulture);
+ }
+ }
+ else
+ {
+ if (dtIntervalType != DateTimeIntervalType.Number)
+ {
+ // Covert value to date/time
+ if (dtIntervalType < DateTimeIntervalType.Hours)
+ {
+ strValue = DateTime.FromOADate(dtValue).ToShortDateString();
+ }
+ else
+ {
+ strValue = DateTime.FromOADate(dtValue).ToString("g", System.Globalization.CultureInfo.CurrentCulture);
+ }
+ }
+ }
+
+ if (axisValuesType == ChartValueType.DateTimeOffset && strValue != null)
+ strValue += " +0";
+
+ return strValue;
+ }
+
+ /// <summary>
+ /// Convert Min and Max values from string if step type is set to one of the DateTime type
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert from.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
+ {
+ object result = null;
+ bool convertFromDate = false;
+
+ // If converting from string value
+ string crossingValue = value as string;
+ if (crossingValue != null)
+ {
+ if (String.Compare(crossingValue, Constants.NotSetValue, StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ return Double.NaN;
+ }
+ }
+
+ // If context interface provided check if we are dealing with DateTime values
+ if (context != null && context.Instance != null && context.Instance is Axis)
+ {
+
+ // Get axis object
+ Axis axis = null;
+ if(context.Instance is AxisScaleView)
+ {
+ axis = ((AxisScaleView)context.Instance).axis;
+ }
+
+#if Microsoft_CONTROL
+ else if(context.Instance is Cursor)
+ {
+ axis = ((Cursor)context.Instance).GetAxis();
+ }
+#endif // Microsoft_CONTROL
+
+ if (axis != null && crossingValue != null)
+ {
+ if(axis.InternalIntervalType == DateTimeIntervalType.Auto)
+ {
+ if(axis.GetAxisValuesType() == ChartValueType.DateTime ||
+ axis.GetAxisValuesType() == ChartValueType.Date ||
+ axis.GetAxisValuesType() == ChartValueType.Time ||
+ axis.GetAxisValuesType() == ChartValueType.DateTimeOffset)
+ {
+ convertFromDate = true;
+ }
+ }
+ else
+ {
+ if(axis.InternalIntervalType != DateTimeIntervalType.Number)
+ {
+ convertFromDate = true;
+ }
+ }
+ }
+ }
+
+ // Try to convert from double string
+ try
+ {
+ result = base.ConvertFrom(context, culture, value);
+ }
+ catch (ArgumentException)
+ {
+ result = null;
+ }
+ catch (NotSupportedException)
+ {
+ result = null;
+ }
+
+ // Try to convert from date/time string
+ if (crossingValue != null && (convertFromDate || result == null))
+ {
+ DateTime valueAsDate;
+ bool parseSucceed = DateTime.TryParse(crossingValue, CultureInfo.InvariantCulture, DateTimeStyles.None, out valueAsDate);
+
+ if (parseSucceed)
+ {
+ return valueAsDate.ToOADate();
+ }
+ }
+
+ // Call base converter
+ return base.ConvertFrom(context, culture, value);
+ }
+
+ #endregion
+ }
+
+}
+
+
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/BaseClasses.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/BaseClasses.cs
new file mode 100644
index 00000000000..610b0e74e0e
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/BaseClasses.cs
@@ -0,0 +1,403 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant, victark
+
+using System;
+using System.Text;
+using System.Globalization;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Diagnostics.CodeAnalysis;
+
+#if Microsoft_CONTROL
+namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+#endif
+{
+
+ /// <summary>
+ /// ChartElement is the most basic element of the chart element hierarchy.
+ /// </summary>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public abstract class ChartElement : IChartElement, IDisposable
+ {
+ #region Member variables
+
+ private IChartElement _parent = null;
+ private CommonElements _common = null;
+ private object _tag = null;
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets an object associated with this chart element.
+ /// </summary>
+ /// <value>
+ /// An <see cref="Object"/> associated with this chart element.
+ /// </value>
+ /// <remarks>
+ /// This property may be used to store additional data with this chart element.
+ /// </remarks>
+ [
+ Browsable(false),
+ DefaultValue(null),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ Utilities.SerializationVisibilityAttribute(Utilities.SerializationVisibility.Hidden)
+ ]
+ public object Tag
+ {
+ get { return _tag; }
+ set { _tag = value; }
+ }
+
+ /// <summary>
+ /// Gets or sets the parent chart element or collection.
+ /// </summary>
+ /// <value>The parent chart element or collection.</value>
+ internal virtual IChartElement Parent
+ {
+ get { return _parent; }
+ set { _parent = value; }
+ }
+
+ /// <summary>
+ /// Gets a shortcut to Common intance providing access to the various chart related services.
+ /// </summary>
+ /// <value>The Common instance.</value>
+ internal CommonElements Common
+ {
+ get
+ {
+ if (_common == null && _parent != null)
+ {
+ _common = _parent.Common;
+ }
+ return _common;
+ }
+ set
+ {
+ _common = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets the chart.
+ /// </summary>
+ /// <value>The chart.</value>
+ internal Chart Chart
+ {
+ get
+ {
+ if (Common != null)
+ return Common.Chart;
+ else
+ return null;
+ }
+ }
+
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ChartElement"/> class.
+ /// </summary>
+ protected ChartElement()
+ {
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ChartElement"/> class.
+ /// </summary>
+ /// <param name="parent">The parent chart element or collection.</param>
+ internal ChartElement(IChartElement parent)
+ {
+ _parent = parent;
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Invalidates this chart element.
+ /// </summary>
+ internal virtual void Invalidate()
+ {
+ if (_parent != null)
+ _parent.Invalidate();
+ }
+
+ #endregion
+
+ #region IChartElement Members
+
+
+ IChartElement IChartElement.Parent
+ {
+ get { return _parent; }
+ set { this.Parent = value; }
+ }
+
+ void IChartElement.Invalidate()
+ {
+ this.Invalidate();
+ }
+
+ CommonElements IChartElement.Common
+ {
+ get{ return this.Common; }
+ }
+
+ #endregion
+
+ #region IDisposable Members
+
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected virtual void Dispose(bool disposing)
+ {
+ }
+
+ /// <summary>
+ /// Performs freeing, releasing, or resetting managed resources.
+ /// </summary>
+ [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
+ public void Dispose()
+ {
+ this.Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
+ /// </summary>
+ /// <returns>
+ /// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
+ /// </returns>
+ /// <remarks>For internal use.</remarks>
+ internal virtual string ToStringInternal()
+ {
+ return GetType().Name;
+ }
+
+ /// <summary>
+ /// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
+ /// </summary>
+ /// <returns>
+ /// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
+ /// </returns>
+ [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
+ public override string ToString()
+ {
+ return this.ToStringInternal();
+ }
+
+ /// <summary>
+ /// Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>.
+ /// </summary>
+ /// <param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:System.Object"/>.</param>
+ /// <returns>
+ /// true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false.
+ /// </returns>
+ /// <exception cref="T:System.NullReferenceException">The <paramref name="obj"/> parameter is null.</exception>
+ /// <remarks>For internal use.</remarks>
+ internal virtual bool EqualsInternal(object obj)
+ {
+ return base.Equals(obj);
+ }
+
+ /// <summary>
+ /// Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>.
+ /// </summary>
+ /// <param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:System.Object"/>.</param>
+ /// <returns>
+ /// true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false.
+ /// </returns>
+ /// <exception cref="T:System.NullReferenceException">The <paramref name="obj"/> parameter is null.</exception>
+ [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
+ public override bool Equals(object obj)
+ {
+ return this.EqualsInternal(obj);
+ }
+
+ /// <summary>
+ /// Serves as a hash function for a particular type.
+ /// </summary>
+ /// <returns>
+ /// A hash code for the current <see cref="T:System.Object"/>.
+ /// </returns>
+ [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
+ public override int GetHashCode()
+ {
+ return base.GetHashCode();
+ }
+
+ #endregion
+
+ }
+
+ /// <summary>
+ /// ChartNamedElement is a base class for most chart elements. Series, ChartAreas, Legends and other chart elements have a Name and reuse the unique name generation and validation logic provided by the ChartNamedElementCollection.
+ /// </summary>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public abstract class ChartNamedElement : ChartElement
+ {
+ #region Member variables
+
+ private string _name = String.Empty;
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets the name of the chart element.
+ /// </summary>
+ /// <value>The name.</value>
+ [DefaultValue("")]
+ public virtual string Name
+ {
+ get { return _name; }
+ set
+ {
+ if (_name != value)
+ {
+ if (Parent is INameController)
+ {
+ INameController nameController = Parent as INameController;
+
+ if (!nameController.IsUniqueName(value))
+ throw new ArgumentException(SR.ExceptionNameAlreadyExistsInCollection(value, nameController.GetType().Name));
+
+ // Fire the name change events in case when the old name is not empty
+ NameReferenceChangedEventArgs args = new NameReferenceChangedEventArgs(this, _name, value);
+ nameController.OnNameReferenceChanging(args);
+ _name = value;
+ nameController.OnNameReferenceChanged(args);
+ }
+ else
+ {
+ _name = value;
+ }
+ Invalidate();
+ }
+ }
+ }
+
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ChartNamedElement"/> class.
+ /// </summary>
+ protected ChartNamedElement()
+ : base()
+ {
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ChartNamedElement"/> class.
+ /// </summary>
+ /// <param name="name">The name of the new chart element.</param>
+ protected ChartNamedElement(string name)
+ : base()
+ {
+ _name = name;
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ChartNamedElement"/> class.
+ /// </summary>
+ /// <param name="parent">The parent chart element.</param>
+ /// <param name="name">The name of the new chart element.</param>
+ internal ChartNamedElement(IChartElement parent, string name) : base(parent)
+ {
+ _name = name;
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
+ /// </summary>
+ /// <returns>
+ /// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
+ /// </returns>
+ internal override string ToStringInternal()
+ {
+ string typeName = GetType().Name;
+ return (string.IsNullOrEmpty(_name)) ? typeName : typeName + '-' + _name;
+ }
+
+ #endregion
+
+ }
+
+
+ /// <summary>
+ /// NameReferenceChanged events help chart maintain referencial integrity.
+ /// </summary>
+ internal class NameReferenceChangedEventArgs : EventArgs
+ {
+ #region MemberValiables
+
+ ChartNamedElement _oldElement;
+ string _oldName;
+ string _newName;
+
+ #endregion
+
+ #region Properties
+ public ChartNamedElement OldElement
+ {
+ get { return _oldElement; }
+ }
+ public string OldName
+ {
+ get { return _oldName; }
+ }
+ public string NewName
+ {
+ get { return _newName; }
+ }
+ #endregion
+
+ #region Constructor
+ public NameReferenceChangedEventArgs(ChartNamedElement oldElement, ChartNamedElement newElement)
+ {
+ _oldElement = oldElement;
+ _oldName = oldElement!=null ? oldElement.Name : string.Empty;
+ _newName = newElement!=null ? newElement.Name : string.Empty;
+ }
+ public NameReferenceChangedEventArgs(ChartNamedElement oldElement, string oldName, string newName)
+ {
+ _oldElement = oldElement;
+ _oldName = oldName;
+ _newName = newName;
+ }
+ #endregion
+ }
+
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/BaseCollections.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/BaseCollections.cs
new file mode 100644
index 00000000000..7fae321d4d1
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/BaseCollections.cs
@@ -0,0 +1,619 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant, victark
+
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Text;
+using System.Globalization;
+using System.Diagnostics.CodeAnalysis;
+using System.Collections;
+
+#if Microsoft_CONTROL
+namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+#endif
+{
+
+ /// <summary>
+ /// Base class for all chart element collections
+ /// </summary>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public abstract class ChartElementCollection<T> : Collection<T>, IChartElement, IDisposable
+ where T : ChartElement
+ {
+ #region Member variables
+
+ private IChartElement _parent = null;
+ private CommonElements _common = null;
+ internal int _suspendUpdates = 0;
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets the parent.
+ /// </summary>
+ internal IChartElement Parent
+ {
+ get { return _parent; }
+ set
+ {
+ _parent = value;
+ Invalidate();
+ }
+ }
+ /// <summary>
+ /// Gets the CommonElements of the chart.
+ /// </summary>
+ internal CommonElements Common
+ {
+ get
+ {
+ if (_common == null && _parent != null)
+ {
+ _common = _parent.Common;
+ }
+ return _common;
+ }
+ }
+
+ /// <summary>
+ /// Gets the chart.
+ /// </summary>
+ internal Chart Chart
+ {
+ get
+ {
+ if (Common != null)
+ return Common.Chart;
+ else
+ return null;
+ }
+ }
+
+ /// <summary>
+ /// Gets the items as List&lt;T&gt;. Use this property to perform advanced List specific operations (Sorting, etc)
+ /// </summary>
+ internal List<T> ItemList
+ {
+ get { return Items as List<T>; }
+ }
+
+ internal bool IsSuspended
+ {
+ get { return _suspendUpdates > 0; }
+ }
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ChartElementCollection&lt;T&gt;"/> class.
+ /// </summary>
+ /// <param name="parent">The parent chart element.</param>
+ internal ChartElementCollection(IChartElement parent)
+ {
+ _parent = parent;
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Forces the invalidation of the parent chart element
+ /// </summary>
+ public virtual void Invalidate()
+ {
+ if (_parent != null && !IsSuspended)
+ _parent.Invalidate();
+ }
+
+ /// <summary>
+ /// Suspends invalidation
+ /// </summary>
+ public virtual void SuspendUpdates()
+ {
+ _suspendUpdates++;
+ }
+
+ /// <summary>
+ /// Resumes invalidation.
+ /// </summary>
+ public virtual void ResumeUpdates()
+ {
+ if (_suspendUpdates>0)
+ _suspendUpdates--;
+
+ if (_suspendUpdates==0)
+ this.Invalidate();
+ }
+
+ /// <summary>
+ /// Removes all elements from the <see cref="T:System.Collections.ObjectModel.Collection`1"/>.
+ /// </summary>
+ [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
+ protected override void ClearItems()
+ {
+ SuspendUpdates();
+ while (this.Count > 0)
+ {
+ this.RemoveItem(0);
+ }
+ ResumeUpdates();
+ }
+
+ /// <summary>
+ /// Deinitializes the specified item.
+ /// </summary>
+ /// <param name="item">The item.</param>
+ internal virtual void Deinitialize( T item)
+ {
+
+ }
+
+ /// <summary>
+ /// Initializes the specified item.
+ /// </summary>
+ /// <param name="item">The item.</param>
+ internal virtual void Initialize(T item)
+ {
+
+ }
+
+ /// <summary>
+ /// Removes the element at the specified index of the <see cref="T:System.Collections.ObjectModel.Collection`1"/>.
+ /// </summary>
+ /// <param name="index">The zero-based index of the element to remove.</param>
+ [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
+ protected override void RemoveItem(int index)
+ {
+ this.Deinitialize(this[index]);
+ this[index].Parent = null;
+ base.RemoveItem(index);
+ Invalidate();
+ }
+
+ /// <summary>
+ /// Inserts an element into the <see cref="T:System.Collections.ObjectModel.Collection`1"/> at the specified index.
+ /// </summary>
+ /// <param name="index">The zero-based index at which <paramref name="item"/> should be inserted.</param>
+ /// <param name="item">The object to insert. The value can be null for reference types.</param>
+ [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
+ protected override void InsertItem(int index, T item)
+ {
+ this.Initialize(item);
+ item.Parent = this;
+ base.InsertItem(index, item);
+ Invalidate();
+ }
+
+ /// <summary>
+ /// Replaces the element at the specified index.
+ /// </summary>
+ /// <param name="index">The zero-based index of the element to replace.</param>
+ /// <param name="item">The new value for the element at the specified index. The value can be null for reference types.</param>
+ [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
+ protected override void SetItem(int index, T item)
+ {
+ this.Initialize(item);
+ item.Parent = this;
+ base.SetItem(index, item);
+ Invalidate();
+ }
+
+ #endregion
+
+ #region IChartElement Members
+
+ IChartElement IChartElement.Parent
+ {
+ get { return this.Parent; }
+ set { this.Parent = value; }
+ }
+
+ void IChartElement.Invalidate()
+ {
+ this.Invalidate();
+ }
+
+ CommonElements IChartElement.Common
+ {
+ get{ return this.Common; }
+ }
+
+ #endregion
+
+ #region IDisposable Members
+
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected virtual void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ // Dispose managed resources
+ foreach (T element in this)
+ {
+ element.Dispose();
+ }
+ }
+ }
+
+ /// <summary>
+ /// Performs freeing, releasing, or resetting managed resources.
+ /// </summary>
+ [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
+ public void Dispose()
+ {
+ this.Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+ #endregion
+
+ }
+
+ /// <summary>
+ /// Base class for all collections of named chart elements. Performs the name management and enforces the uniquness of the names
+ /// </summary>
+ /// <typeparam name="T"></typeparam>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public abstract class ChartNamedElementCollection<T> : ChartElementCollection<T>, INameController
+ where T : ChartNamedElement
+ {
+
+ #region Fields
+ private List<T> _cachedState = null;
+ private int _disableDeleteCount = 0;
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Gets the name prefix that is used to create unique chart element names.
+ /// </summary>
+ /// <value>The default name prefix of the chart elements stored in the collection.</value>
+ protected virtual string NamePrefix
+ {
+ get { return typeof(T).Name; }
+ }
+
+ /// <summary>
+ /// Gets or sets the chart element with the specified name.
+ /// </summary>
+ /// <value></value>
+ public T this[string name]
+ {
+ get
+ {
+ int index = this.IndexOf(name);
+ if (index != -1)
+ {
+ return this[index];
+ }
+ throw new ArgumentException(SR.ExceptionNameNotFound(name, this.GetType().Name));
+ }
+ set
+ {
+ int nameIndex = this.IndexOf(name);
+ int itemIndex = this.IndexOf(value);
+ bool nameFound = nameIndex > -1;
+ bool itemFound = itemIndex > -1;
+
+ if (!nameFound && !itemFound)
+ this.Add(value);
+
+ else if (nameFound && !itemFound)
+ this[nameIndex] = value;
+
+ else if (!nameFound && itemFound)
+ throw new ArgumentException(SR.ExceptionNameAlreadyExistsInCollection(name, this.GetType().Name));
+
+ else if (nameFound && itemFound && nameIndex != itemIndex)
+ throw new ArgumentException(SR.ExceptionNameAlreadyExistsInCollection(name, this.GetType().Name));
+
+ }
+ }
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ChartNamedElementCollection&lt;T&gt;"/> class.
+ /// </summary>
+ /// <param name="parent">The parent chart element.</param>
+ internal ChartNamedElementCollection(IChartElement parent)
+ : base(parent)
+ {
+ }
+
+ #endregion
+
+ #region Events
+
+ internal event EventHandler<NameReferenceChangedEventArgs> NameReferenceChanged;
+ internal event EventHandler<NameReferenceChangedEventArgs> NameReferenceChanging;
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Determines whether the chart element with the specified name already exists in the collection.
+ /// </summary>
+ /// <param name="name">The new chart element name.</param>
+ /// <returns>
+ /// <c>true</c> if new chart element name is unique; otherwise, <c>false</c>.
+ /// </returns>
+ public virtual bool IsUniqueName(string name)
+ {
+ return FindByName(name)==null;
+ }
+
+ /// <summary>
+ /// Finds the unique name for a new element being added to the collection
+ /// </summary>
+ /// <returns>Next unique chart element name</returns>
+ public virtual string NextUniqueName()
+ {
+ // Find unique name
+ string result = string.Empty;
+ string prefix = this.NamePrefix;
+ for (int i = 1; i < System.Int32.MaxValue; i++)
+ {
+ result = prefix + i.ToString(CultureInfo.InvariantCulture);
+ // Check whether the name is unique
+ if (IsUniqueName(result))
+ {
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// Indexes the of chart element with the specified name.
+ /// </summary>
+ /// <param name="name">The name.</param>
+ /// <returns></returns>
+ public int IndexOf(string name)
+ {
+ int i = 0;
+ foreach (T namedObj in this)
+ {
+ if (namedObj.Name == name)
+ return i;
+ i++;
+ }
+ return -1;
+ }
+
+ /// <summary>
+ /// Verifies the name reference to a chart named element stored in this collection and throws the argument exception if its not valid.
+ /// </summary>
+ /// <param name="name">Chart element name.</param>
+ internal void VerifyNameReference(string name)
+ {
+ if (Chart!=null && !Chart.serializing && !IsNameReferenceValid(name))
+ throw new ArgumentException(SR.ExceptionNameNotFound(name, this.GetType().Name));
+ }
+
+ /// <summary>
+ /// Verifies the name reference to a chart named element stored in this collection.
+ /// </summary>
+ /// <param name="name">Chart element name.</param>
+ internal bool IsNameReferenceValid(string name)
+ {
+ return String.IsNullOrEmpty(name) ||
+ name == Constants.NotSetValue ||
+ IndexOf(name) >= 0;
+ }
+
+ /// <summary>
+ /// Finds the chart element by the name.
+ /// </summary>
+ /// <param name="name">The name.</param>
+ /// <returns></returns>
+ public virtual T FindByName(string name)
+ {
+ foreach (T namedObj in this)
+ {
+ if (namedObj.Name == name)
+ return namedObj;
+ }
+ return null;
+ }
+
+ /// <summary>
+ /// Inserts the specified item in the collection at the specified index.
+ /// </summary>
+ /// <param name="index">The zero-based index where the item is to be inserted.</param>
+ /// <param name="item">The object to insert.</param>
+ protected override void InsertItem(int index, T item)
+ {
+ if (String.IsNullOrEmpty(item.Name))
+ item.Name = this.NextUniqueName();
+ else if (!IsUniqueName(item.Name))
+ throw new ArgumentException(SR.ExceptionNameAlreadyExistsInCollection(item.Name, this.GetType().Name));
+
+ //If the item references other named references we might need to fix the references
+ FixNameReferences(item);
+
+ base.InsertItem(index, item);
+
+ if (this.Count == 1 && item != null)
+ {
+ // First element is added to the list -> fire the NameReferenceChanged event to update all the dependent elements
+ ((INameController)this).OnNameReferenceChanged(new NameReferenceChangedEventArgs(null, item));
+ }
+ }
+
+ /// <summary>
+ /// Replaces the element at the specified index.
+ /// </summary>
+ /// <param name="index">The zero-based index of the element to replace.</param>
+ /// <param name="item">The new value for the element at the specified index.</param>
+ protected override void SetItem(int index, T item)
+ {
+ if (String.IsNullOrEmpty(item.Name))
+ item.Name = this.NextUniqueName();
+ else if (!IsUniqueName(item.Name) && IndexOf(item.Name) != index)
+ throw new ArgumentException(SR.ExceptionNameAlreadyExistsInCollection(item.Name, this.GetType().Name));
+
+ //If the item references other named references we might need to fix the references
+ FixNameReferences(item);
+
+ // Remember the removedElement
+ ChartNamedElement removedElement = index<Count ? this[index] : null;
+
+ ((INameController)this).OnNameReferenceChanging(new NameReferenceChangedEventArgs(removedElement, item));
+ base.SetItem(index, item);
+ // Fire the NameReferenceChanged event to update all the dependent elements
+ ((INameController)this).OnNameReferenceChanged(new NameReferenceChangedEventArgs(removedElement, item));
+ }
+
+ /// <summary>
+ /// Removes the element at the specified index of the collection.
+ /// </summary>
+ /// <param name="index">The zero-based index of the element to remove.</param>
+ protected override void RemoveItem(int index)
+ {
+ // Remember the removedElement
+ ChartNamedElement removedElement = index < Count ? this[index] : null;
+ if (_disableDeleteCount == 0)
+ {
+ ((INameController)this).OnNameReferenceChanged(new NameReferenceChangedEventArgs(removedElement, null));
+ }
+ base.RemoveItem(index);
+ if (_disableDeleteCount == 0)
+ {
+ // All elements referencing the removed element will be redirected to the first element in collection
+ // Fire the NameReferenceChanged event to update all the dependent elements
+ ChartNamedElement defaultElement = this.Count > 0 ? this[0] : null;
+ ((INameController)this).OnNameReferenceChanged(new NameReferenceChangedEventArgs(removedElement, defaultElement));
+ }
+ }
+
+ /// <summary>
+ /// Fixes the name references of the item.
+ /// </summary>
+ internal virtual void FixNameReferences(T item)
+ {
+ //Nothing to fix at the base class...
+ }
+
+ #endregion
+
+ #region INameController Members
+
+ /// <summary>
+ /// Determines whether is the name us unique.
+ /// </summary>
+ /// <param name="name">The name.</param>
+ /// <returns>
+ /// <c>true</c> if is the name us unique; otherwise, <c>false</c>.
+ /// </returns>
+ bool INameController.IsUniqueName(string name)
+ {
+ return this.IsUniqueName(name);
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is in edit mode by collecrtion editor.
+ /// </summary>
+ /// <value>
+ /// <c>true</c> if this instance the colection is editing; otherwise, <c>false</c>.
+ /// </value>
+ bool INameController.IsColectionEditing
+ {
+ get
+ {
+ return _disableDeleteCount == 0;
+ }
+ set
+ {
+ _disableDeleteCount += value ? 1 : -1;
+ }
+ }
+
+ /// <summary>
+ /// Raises the <see cref="E:NameReferenceChanging"/> event.
+ /// </summary>
+ /// <param name="e">The <see cref="NameReferenceChangedEventArgs"/> instance containing the event data.</param>
+ void INameController.OnNameReferenceChanging(NameReferenceChangedEventArgs e)
+ {
+ if (!IsSuspended)
+ {
+ if (this.NameReferenceChanging != null)
+ this.NameReferenceChanging(this, e);
+ }
+ }
+
+ /// <summary>
+ /// Raises the <see cref="E:NameReferenceChanged"/> event.
+ /// </summary>
+ /// <param name="e">The <see cref="NameReferenceChangedEventArgs"/> instance containing the event data.</param>
+ void INameController.OnNameReferenceChanged(NameReferenceChangedEventArgs e)
+ {
+ if (!IsSuspended)
+ {
+ if (this.NameReferenceChanged != null)
+ this.NameReferenceChanged(this, e);
+ }
+ }
+
+ /// <summary>
+ /// Does the snapshot of collection items.
+ /// </summary>
+ /// <param name="save">if set to <c>true</c> collection items will be saved.</param>
+ /// <param name="changingCallback">The changing callback.</param>
+ /// <param name="changedCallback">The changed callback.</param>
+ void INameController.DoSnapshot(bool save,
+ EventHandler<NameReferenceChangedEventArgs> changingCallback,
+ EventHandler<NameReferenceChangedEventArgs> changedCallback)
+ {
+ if (save)
+ {
+ _cachedState = new List<T>(this);
+ if (changingCallback != null) this.NameReferenceChanging += changingCallback;
+ if (changedCallback != null) this.NameReferenceChanged += changedCallback;
+ }
+ else
+ {
+ if (changingCallback != null) this.NameReferenceChanging -= changingCallback;
+ if (changedCallback != null) this.NameReferenceChanged -= changedCallback;
+ _cachedState.Clear();
+ _cachedState = null;
+ }
+ }
+
+ /// <summary>
+ /// Gets the snapshot of saved collection items.
+ /// </summary>
+ /// <value>The snapshot.</value>
+ IList INameController.Snapshot
+ {
+ get { return _cachedState; }
+ }
+
+
+ #endregion
+
+
+ }
+
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/BaseInterfaces.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/BaseInterfaces.cs
new file mode 100644
index 00000000000..db61a2899f3
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/BaseInterfaces.cs
@@ -0,0 +1,80 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant, victark
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Collections;
+
+#if WINFORMS_CONTROL
+namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+#endif
+{
+ /// <summary>
+ /// IChartElement is implemented by both ChartElements and ChartElementCollection to provide a unified access to Parent/Common elements.
+ /// </summary>
+ internal interface IChartElement
+ {
+ //Properties
+ IChartElement Parent { get; set; }
+ CommonElements Common { get; }
+
+ //Methods
+ void Invalidate();
+ }
+
+
+ /// <summary>
+ /// Named controller interface allows ChartNamedElements to check the uniqueness of their names
+ /// </summary>
+ internal interface INameController
+ {
+
+ /// <summary>
+ /// Determines whether is the name us unique.
+ /// </summary>
+ /// <param name="name">The name.</param>
+ /// <returns>
+ /// <c>true</c> if is the name us unique; otherwise, <c>false</c>.
+ /// </returns>
+ bool IsUniqueName(string name);
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is in edit mode by collecrtion editor.
+ /// </summary>
+ /// <value>
+ /// <c>true</c> if this instance the colection is editing; otherwise, <c>false</c>.
+ /// </value>
+ bool IsColectionEditing { get; set; }
+ /// <summary>
+ /// Does the snapshot of collection items.
+ /// </summary>
+ /// <param name="save">if set to <c>true</c> collection items will be saved.</param>
+ /// <param name="changingCallback">The changing callback.</param>
+ /// <param name="changedCallback">The changed callback.</param>
+ void DoSnapshot(bool save,
+ EventHandler<NameReferenceChangedEventArgs> changingCallback,
+ EventHandler<NameReferenceChangedEventArgs> changedCallback);
+ /// <summary>
+ /// Gets the snapshot of saved collection items.
+ /// </summary>
+ /// <value>The snapshot.</value>
+ IList Snapshot {get;}
+ /// <summary>
+ /// Raises the <see cref="E:NameReferenceChanged"/> event.
+ /// </summary>
+ /// <param name="e">The <see cref="NameReferenceChangedEventArgs"/> instance containing the event data.</param>
+ void OnNameReferenceChanged(NameReferenceChangedEventArgs e);
+ /// <summary>
+ /// Raises the <see cref="E:NameReferenceChanging"/> event.
+ /// </summary>
+ /// <param name="e">The <see cref="NameReferenceChangedEventArgs"/> instance containing the event data.</param>
+ void OnNameReferenceChanging(NameReferenceChangedEventArgs e);
+ }
+
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Chart.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Chart.cs
new file mode 100644
index 00000000000..a83a2fb7137
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Chart.cs
@@ -0,0 +1,4361 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: Chart.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: ChartImage, ChartPicture, ChartPaintEventArgs
+//
+// Purpose: This file contains classes, which are used for Image
+// creation and chart painting. This file has also a
+// class, which is used for Paint events arguments.
+//
+// Reviewed: GS - August 2, 2002
+// AG - August 8, 2002
+// AG - Microsoft 16, 2007
+//
+//===================================================================
+
+#region Used Namespaces
+
+using System;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Drawing.Design;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Resources;
+using System.Reflection;
+using System.IO;
+using System.Data;
+using System.Collections;
+using System.Drawing.Imaging;
+using System.Drawing.Text;
+using System.Xml;
+using System.Globalization;
+using System.Diagnostics.CodeAnalysis;
+using System.Diagnostics;
+using System.Security;
+using System.Runtime.InteropServices;
+using System.Collections.Generic;
+
+#if Microsoft_CONTROL
+
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+ using System.Windows.Forms.DataVisualization.Charting;
+#else
+ using System.Web;
+ using System.Web.UI;
+ using System.Net;
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+ using System.Web.UI.DataVisualization.Charting.Borders3D;
+#endif
+
+
+#endregion
+
+#if Microsoft_CONTROL
+namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ #region Enumerations
+
+#if !Microsoft_CONTROL
+
+ /// <summary>
+ /// An enumeration of supported image types
+ /// </summary>
+ public enum ChartImageType
+ {
+ /// <summary>
+ /// BMP image format
+ /// </summary>
+ Bmp,
+ /// <summary>
+ /// Jpeg image format
+ /// </summary>
+ Jpeg,
+
+ /// <summary>
+ /// Png image format
+ /// </summary>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Png")]
+ Png,
+
+ /// <summary>
+ /// Enhanced Meta File (Emf) image format.
+ /// </summary>
+ Emf,
+
+ };
+#endif
+
+
+ #endregion
+
+ /// <summary>
+ /// ChartImage class adds image type and data binding functionality to
+ /// the base ChartPicture class.
+ /// </summary>
+ internal class ChartImage : ChartPicture
+ {
+ #region Fields
+
+ // Private data members, which store properties values
+ private int _compression = 0;
+
+ // Chart data source object
+ private object _dataSource = null;
+
+ // Indicates that control was bound to the data source
+ internal bool boundToDataSource = false;
+
+#if !Microsoft_CONTROL
+ private ChartImageType imageType = ChartImageType.Png;
+#endif
+
+ #endregion
+
+ #region Constructor
+
+ /// <summary>
+ /// Chart internal constructor.
+ /// </summary>
+ /// <param name="container">Service container</param>
+ internal ChartImage(IServiceContainer container)
+ : base(container)
+ {
+ }
+
+ #endregion // Constructor
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets the data source for the Chart object.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeDataSource"),
+ DefaultValue(null),
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden)
+ ]
+ public object DataSource
+ {
+ get
+ {
+ return _dataSource;
+ }
+ set
+ {
+ if(_dataSource != value)
+ {
+ _dataSource = value;
+ this.boundToDataSource = false;
+ }
+ }
+ }
+
+#if !Microsoft_CONTROL
+
+ /// <summary>
+ /// Image type (Jpeg, BMP, Png)
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeImage"),
+ Bindable(true),
+ DefaultValue(ChartImageType.Png),
+ SRDescription("DescriptionAttributeImageType"),
+ PersistenceMode(PersistenceMode.Attribute)
+ ]
+ public ChartImageType ImageType
+ {
+ get
+ {
+ return imageType;
+ }
+ set
+ {
+ imageType = value;
+ }
+ }
+
+#endif
+
+ /// <summary>
+ /// Image compression value
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeImage"),
+ Bindable(true),
+ DefaultValue(0),
+ SRDescription("DescriptionAttributeChartImage_Compression"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public int Compression
+ {
+ get
+ {
+ return _compression;
+ }
+ set
+ {
+ if(value < 0 || value > 100)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionChartCompressionInvalid));
+ }
+ _compression = value;
+ }
+ }
+
+ #endregion
+
+ #region Methods
+
+ #region Image Manipulation
+
+
+ /// <summary>
+ /// Saves image into the metafile stream.
+ /// </summary>
+ /// <param name="imageStream">Image stream.</param>
+ /// <param name="emfType">Image stream.</param>
+ [SecuritySafeCritical]
+ public void SaveIntoMetafile(Stream imageStream, EmfType emfType)
+ {
+ // Check arguments
+ if (imageStream == null)
+ throw new ArgumentNullException("imageStream");
+
+ // Create temporary Graphics object for metafile
+ using (Bitmap bitmap = new Bitmap(this.Width, this.Height))
+ {
+ using (Graphics newGraphics = Graphics.FromImage(bitmap))
+ {
+ IntPtr hdc = IntPtr.Zero;
+ try
+ {
+ System.Security.Permissions.SecurityPermission securityPermission = new System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode);
+ securityPermission.Demand();
+
+ hdc = newGraphics.GetHdc();
+
+
+ // Create metafile object to record.
+ using (Metafile metaFile = new Metafile(
+ imageStream,
+ hdc,
+ new Rectangle(0, 0, this.Width, this.Height),
+ MetafileFrameUnit.Pixel,
+ emfType))
+ {
+
+ // Create graphics object to record metaFile.
+ using (Graphics metaGraphics = Graphics.FromImage(metaFile))
+ {
+
+ // Note: Fix for issue #3674. Some 3D borders shadows may be drawn outside
+ // of image boundaries. This causes issues when generated EMF file
+ // is placed in IE. Image looks shifted down and hot areas do not align.
+ if (this.BorderSkin.SkinStyle != BorderSkinStyle.None)
+ {
+ metaGraphics.Clip = new Region(new Rectangle(0, 0, this.Width, this.Height));
+ }
+
+ // Draw chart in the metafile
+ this.ChartGraph.IsMetafile = true;
+ this.Paint(metaGraphics, false);
+ this.ChartGraph.IsMetafile = false;
+
+ }
+ }
+ }
+ finally
+ {
+ if (hdc != IntPtr.Zero)
+ {
+ newGraphics.ReleaseHdc(hdc);
+ }
+ }
+ }
+ }
+ }
+
+ public Bitmap GetImage()
+ {
+ return this.GetImage(96);
+ }
+ /// <summary>
+ /// Create Image and draw chart picture
+ /// </summary>
+ public Bitmap GetImage(float resolution)
+ {
+ // Create a new bitmap
+
+ Bitmap image = null;
+
+ while (image == null)
+ {
+ bool failed = true;
+ try
+ {
+ image = new Bitmap(Math.Max(1,Width), Math.Max(1,Height));
+ image.SetResolution(resolution, resolution);
+ failed = false;
+ }
+ catch (ArgumentException)
+ {
+ failed = true;
+ }
+ catch (OverflowException)
+ {
+ failed = true;
+ }
+ catch (InvalidOperationException)
+ {
+ failed = true;
+ }
+ catch (ExternalException)
+ {
+ failed = true;
+ }
+
+ if (failed)
+ {
+ // if failed to create the image, decrease the size and the resolution of the chart
+ image = null;
+ float newResolution = Math.Max(resolution / 2, 96);
+ Width = (int)Math.Ceiling(Width * newResolution / resolution);
+ Height = (int)Math.Ceiling(Height * newResolution / resolution);
+ resolution = newResolution;
+ }
+ }
+
+ // Creates a new Graphics object from the
+ // specified Image object.
+ Graphics offScreen = Graphics.FromImage( image );
+
+
+
+ Color backGroundColor;
+
+ if (this.BackColor != Color.Empty)
+ backGroundColor = this.BackColor;
+ else
+ backGroundColor = Color.White;
+
+ // Get the page color if border skin is visible.
+ if (GetBorderSkinVisibility() &&
+ this.BorderSkin.PageColor != Color.Empty)
+ {
+ backGroundColor = this.BorderSkin.PageColor;
+ }
+
+ // draw a rctangle first with the size of the control, this prevent strange behavior when printing in the reporting services,
+ // without this rectangle, the printed picture is blurry
+ Pen pen = new Pen(backGroundColor);
+ offScreen.DrawRectangle(pen, 0, 0, Width, Height);
+ pen.Dispose();
+
+ // Paint the chart
+ Paint( offScreen , false);
+
+ // Dispose Graphic object
+ offScreen.Dispose();
+
+ // Return reference to the image
+ return image;
+ }
+
+ #endregion // Image Manipulation
+
+ #region Data Binding
+
+ /// <summary>
+ /// Checks if the type of the data source is valid.
+ /// </summary>
+ /// <param name="dataSource">Data source object to test.</param>
+ /// <returns>True if valid data source object.</returns>
+ static internal bool IsValidDataSource(object dataSource)
+ {
+ if( null != dataSource &&
+ (
+ dataSource is IEnumerable ||
+ dataSource is DataSet ||
+ dataSource is DataView ||
+ dataSource is DataTable ||
+ dataSource is System.Data.OleDb.OleDbCommand ||
+ dataSource is System.Data.SqlClient.SqlCommand ||
+ dataSource is System.Data.OleDb.OleDbDataAdapter ||
+ dataSource is System.Data.SqlClient.SqlDataAdapter ||
+ // ADDED: for VS2005 compatibility, DT Nov 25, 2005
+ dataSource.GetType().GetInterface("IDataSource") != null
+ // END ADDED
+ )
+ )
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+
+
+ /// <summary>
+ /// Gets an list of the data source member names.
+ /// </summary>
+ /// <param name="dataSource">Data source object to get the members for.</param>
+ /// <param name="usedForYValue">Indicates that member will be used for Y values.</param>
+ /// <returns>List of member names.</returns>
+ [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily",
+ Justification = "Too large of a code change to justify making this change")]
+ static internal ArrayList GetDataSourceMemberNames(object dataSource, bool usedForYValue)
+ {
+ ArrayList names = new ArrayList();
+ if (dataSource != null)
+ {
+ // ADDED: for VS2005 compatibility, DT Nov 25, 2004
+ if (dataSource.GetType().GetInterface("IDataSource") != null)
+ {
+ try
+ {
+ MethodInfo m = dataSource.GetType().GetMethod("Select");
+ if (m != null)
+ {
+ if (m.GetParameters().Length == 1)
+ {
+ // SQL derived datasource
+ Type selectArgsType = dataSource.GetType().Assembly.GetType("System.Web.UI.DataSourceSelectArguments", true);
+ ConstructorInfo ci = selectArgsType.GetConstructor(new Type[] { });
+ dataSource = m.Invoke(dataSource, new object[] { ci.Invoke(new object[] { }) });
+ }
+ else
+ {
+ // object data source
+ dataSource = m.Invoke(dataSource, new object[] { });
+ }
+ }
+ }
+ catch (TargetException)
+ {
+ }
+ catch (TargetInvocationException)
+ {
+ }
+ }
+ // END ADDED
+
+ // Check all DataTable based data souces
+ DataTable dataTable = null;
+
+ if (dataSource is DataTable)
+ {
+ dataTable = (DataTable)dataSource;
+ }
+ else if (dataSource is DataView)
+ {
+ dataTable = ((DataView)dataSource).Table;
+ }
+ else if (dataSource is DataSet && ((DataSet)dataSource).Tables.Count > 0)
+ {
+ dataTable = ((DataSet)dataSource).Tables[0];
+ }
+ else if (dataSource is System.Data.OleDb.OleDbDataAdapter)
+ {
+ dataTable = new DataTable();
+ dataTable.Locale = CultureInfo.CurrentCulture;
+ dataTable = ((System.Data.OleDb.OleDbDataAdapter)dataSource).FillSchema(dataTable, SchemaType.Mapped);
+ }
+ else if (dataSource is System.Data.SqlClient.SqlDataAdapter)
+ {
+ dataTable = new DataTable();
+ dataTable.Locale = CultureInfo.CurrentCulture;
+ dataTable = ((System.Data.SqlClient.SqlDataAdapter)dataSource).FillSchema(dataTable, SchemaType.Mapped);
+ }
+ else if (dataSource is System.Data.OleDb.OleDbDataReader)
+ {
+ // Add table columns names
+ for (int fieldIndex = 0; fieldIndex < ((System.Data.OleDb.OleDbDataReader)dataSource).FieldCount; fieldIndex++)
+ {
+ if (!usedForYValue || ((System.Data.OleDb.OleDbDataReader)dataSource).GetFieldType(fieldIndex) != typeof(string))
+ {
+ names.Add(((System.Data.OleDb.OleDbDataReader)dataSource).GetName(fieldIndex));
+ }
+ }
+ }
+ else if (dataSource is System.Data.SqlClient.SqlDataReader)
+ {
+ // Add table columns names
+ for (int fieldIndex = 0; fieldIndex < ((System.Data.SqlClient.SqlDataReader)dataSource).FieldCount; fieldIndex++)
+ {
+ if (!usedForYValue || ((System.Data.SqlClient.SqlDataReader)dataSource).GetFieldType(fieldIndex) != typeof(string))
+ {
+ names.Add(((System.Data.SqlClient.SqlDataReader)dataSource).GetName(fieldIndex));
+ }
+ }
+ }
+ else if (dataSource is System.Data.OleDb.OleDbCommand)
+ {
+ System.Data.OleDb.OleDbCommand command = (System.Data.OleDb.OleDbCommand)dataSource;
+ if (command.Connection != null)
+ {
+ command.Connection.Open();
+ System.Data.OleDb.OleDbDataReader dataReader = command.ExecuteReader();
+ if (dataReader.Read())
+ {
+ for (int fieldIndex = 0; fieldIndex < dataReader.FieldCount; fieldIndex++)
+ {
+ if (!usedForYValue || dataReader.GetFieldType(fieldIndex) != typeof(string))
+ {
+ names.Add(dataReader.GetName(fieldIndex));
+ }
+ }
+ }
+
+ dataReader.Close();
+ command.Connection.Close();
+ }
+ }
+ else if (dataSource is System.Data.SqlClient.SqlCommand)
+ {
+ System.Data.SqlClient.SqlCommand command = (System.Data.SqlClient.SqlCommand)dataSource;
+ if (command.Connection != null)
+ {
+ command.Connection.Open();
+ System.Data.SqlClient.SqlDataReader dataReader = command.ExecuteReader();
+ if (dataReader.Read())
+ {
+ for (int fieldIndex = 0; fieldIndex < dataReader.FieldCount; fieldIndex++)
+ {
+ if (!usedForYValue || dataReader.GetFieldType(fieldIndex) != typeof(string))
+ {
+ names.Add(dataReader.GetName(fieldIndex));
+ }
+ }
+ }
+
+ dataReader.Close();
+ command.Connection.Close();
+ }
+ }
+
+
+ // Check if DataTable was set
+ if (dataTable != null)
+ {
+ // Add table columns names
+ foreach (DataColumn column in dataTable.Columns)
+ {
+ if (!usedForYValue || column.DataType != typeof(string))
+ {
+ names.Add(column.ColumnName);
+ }
+ }
+ }
+
+ else if (names.Count == 0 && dataSource is ITypedList)
+ {
+ foreach (PropertyDescriptor pd in ((ITypedList)dataSource).GetItemProperties(null))
+ {
+ if (!usedForYValue || pd.PropertyType != typeof(string))
+ {
+ names.Add(pd.Name);
+ }
+ }
+ }
+ else if (names.Count == 0 && dataSource is IEnumerable)
+ {
+ // .Net 2.0 ObjectDataSource processing
+ IEnumerator e = ((IEnumerable)dataSource).GetEnumerator();
+ e.Reset();
+ e.MoveNext();
+ foreach (PropertyDescriptor pd in TypeDescriptor.GetProperties(e.Current))
+ {
+ if (!usedForYValue || pd.PropertyType != typeof(string))
+ {
+ names.Add(pd.Name);
+ }
+
+ }
+ }
+
+
+
+ // Check if list still empty
+ if (names.Count == 0)
+ {
+ // Add first column or any data member name
+ names.Add("0");
+ }
+
+ }
+
+ return names;
+ }
+
+ /// <summary>
+ /// Data binds control to the data source
+ /// </summary>
+ [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily",
+ Justification="Too large of a code change to justify making this change")]
+ internal void DataBind()
+ {
+ // Set bound flag
+ this.boundToDataSource = true;
+
+ object dataSource = this.DataSource;
+ if (dataSource != null)
+ {
+
+ // Convert data adapters to command object
+ if (dataSource is System.Data.OleDb.OleDbDataAdapter)
+ {
+ dataSource = ((System.Data.OleDb.OleDbDataAdapter)dataSource).SelectCommand;
+ }
+ else if (dataSource is System.Data.SqlClient.SqlDataAdapter)
+ {
+ dataSource = ((System.Data.SqlClient.SqlDataAdapter)dataSource).SelectCommand;
+ }
+
+ // Convert data source to recognizable source for the series
+ if (dataSource is DataSet && ((DataSet)dataSource).Tables.Count > 0)
+ {
+ dataSource = ((DataSet)dataSource).DefaultViewManager.CreateDataView(((DataSet)dataSource).Tables[0]);
+
+ }
+ else if (dataSource is DataTable)
+ {
+ dataSource = new DataView((DataTable)dataSource);
+ }
+ else if (dataSource is System.Data.OleDb.OleDbCommand)
+ {
+ System.Data.OleDb.OleDbCommand command = (System.Data.OleDb.OleDbCommand)dataSource;
+ command.Connection.Open();
+ System.Data.OleDb.OleDbDataReader dataReader = command.ExecuteReader();
+
+ this.DataBind(dataReader, null);
+
+ dataReader.Close();
+ command.Connection.Close();
+ return;
+ }
+ else if (dataSource is System.Data.SqlClient.SqlCommand)
+ {
+ System.Data.SqlClient.SqlCommand command = (System.Data.SqlClient.SqlCommand)dataSource;
+ command.Connection.Open();
+ System.Data.SqlClient.SqlDataReader dataReader = command.ExecuteReader();
+
+ this.DataBind(dataReader, null);
+
+ dataReader.Close();
+ command.Connection.Close();
+ return;
+ }
+ else if (dataSource is IList)
+ {
+ dataSource = dataSource as IList;
+ }
+ else if (dataSource is IListSource )
+ {
+ if (((IListSource)dataSource).ContainsListCollection && ((IListSource)dataSource).GetList().Count > 0)
+ {
+ dataSource = ((IListSource)dataSource).GetList()[0] as IEnumerable;
+ }
+ else
+ {
+ dataSource = ((IListSource)dataSource).GetList();
+ }
+ }
+ else
+ {
+ dataSource = dataSource as IEnumerable;
+ }
+
+ // Data bind
+ DataBind(dataSource as IEnumerable, null);
+ }
+ }
+
+ /// <summary>
+ /// Data binds control to the data source
+ /// </summary>
+ /// <param name="dataSource">Data source to bind to.</param>
+ /// <param name="seriesList">List of series to bind.</param>
+ internal void DataBind(IEnumerable dataSource, ArrayList seriesList)
+ {
+ // Data bind series
+ if(dataSource != null && this.Common != null)
+ {
+ //************************************************************
+ //** If list of series is not provided - bind all of them.
+ //************************************************************
+ if(seriesList == null)
+ {
+ seriesList = new ArrayList();
+ foreach(Series series in this.Common.Chart.Series)
+ {
+ // note: added for design time data binding
+ if (this.Common.Chart.IsDesignMode())
+ {
+ if (series.YValueMembers.Length > 0)
+ {
+ seriesList.Add(series);
+ }
+ }
+ else
+ {
+ seriesList.Add(series);
+ }
+ }
+ }
+
+ //************************************************************
+ //** Clear all data points in data bound series
+ //************************************************************
+ foreach(Series series in seriesList)
+ {
+ if(series.XValueMember.Length > 0 || series.YValueMembers.Length > 0)
+ {
+ series.Points.Clear();
+ }
+ }
+
+ //************************************************************
+ //** Get and reset data enumerator.
+ //************************************************************
+ IEnumerator enumerator = dataSource.GetEnumerator();
+ if(enumerator.GetType() != typeof(System.Data.Common.DbEnumerator) )
+ {
+ try
+ {
+ enumerator.Reset();
+ }
+ // Some enumerators may not support Resetting
+ catch (InvalidOperationException)
+ {
+ }
+ catch (NotImplementedException)
+ {
+ }
+ catch (NotSupportedException)
+ {
+ }
+ }
+
+
+ //************************************************************
+ //** Loop through the enumerator.
+ //************************************************************
+ bool valueExsists = true;
+ bool autoDetectType = true;
+ do
+ {
+ // Move to the next item
+ valueExsists = enumerator.MoveNext();
+
+ // Loop through all series
+ foreach(Series series in seriesList)
+ {
+ if(series.XValueMember.Length > 0 || series.YValueMembers.Length > 0)
+ {
+ //************************************************************
+ //** Check and convert fields names.
+ //************************************************************
+
+ // Convert comma separated field names string to array of names
+ string[] yFieldNames = null;
+ if(series.YValueMembers.Length > 0)
+ {
+ yFieldNames = series.YValueMembers.Replace(",,", "\n").Split(',');
+ for(int index = 0; index < yFieldNames.Length; index++)
+ {
+ yFieldNames[index] = yFieldNames[index].Replace("\n", ",").Trim();
+ }
+ }
+
+ // Double check that a string object is not provided for data binding
+ if(dataSource is string)
+ {
+ throw (new ArgumentException(SR.ExceptionDataBindYValuesToString, "dataSource"));
+ }
+
+ // Check number of fields
+ if(yFieldNames == null || yFieldNames.GetLength(0) > series.YValuesPerPoint)
+ {
+ throw(new ArgumentOutOfRangeException("dataSource", SR.ExceptionDataPointYValuesCountMismatch(series.YValuesPerPoint.ToString(System.Globalization.CultureInfo.InvariantCulture) ) ) );
+ }
+
+ //************************************************************
+ //** Create new data point.
+ //************************************************************
+ if(valueExsists)
+ {
+ // Auto detect values type
+ if(autoDetectType)
+ {
+ autoDetectType = false;
+
+ // Make sure Y field is not empty
+ string yField = yFieldNames[0];
+ int fieldIndex = 1;
+ while(yField.Length == 0 && fieldIndex < yFieldNames.Length)
+ {
+ yField = yFieldNames[fieldIndex++];
+ }
+
+ DataPointCollection.AutoDetectValuesType(series, enumerator, series.XValueMember.Trim(), enumerator, yField);
+ }
+
+
+ // Create new point
+ DataPoint newDataPoint = new DataPoint(series);
+ bool emptyValues = false;
+ bool xValueIsNull = false;
+
+ //************************************************************
+ //** Get new point X and Y values.
+ //************************************************************
+ object[] yValuesObj = new object[yFieldNames.Length];
+ object xValueObj = null;
+
+ // Set X to the value provided or use sequence numbers starting with 1
+ if(series.XValueMember.Length > 0)
+ {
+ xValueObj = DataPointCollection.ConvertEnumerationItem(enumerator.Current, series.XValueMember.Trim());
+ if(xValueObj is System.DBNull || xValueObj == null)
+ {
+ xValueIsNull = true;
+ emptyValues = true;
+ xValueObj = 0.0;
+ }
+ }
+
+ if(yFieldNames.Length == 0)
+ {
+ yValuesObj[0] = DataPointCollection.ConvertEnumerationItem(enumerator.Current, null);
+ if(yValuesObj[0] is System.DBNull || yValuesObj[0] == null)
+ {
+ emptyValues = true;
+ yValuesObj[0] = 0.0;
+ }
+ }
+ else
+ {
+ for(int i = 0; i < yFieldNames.Length; i++)
+ {
+ if(yFieldNames[i].Length > 0)
+ {
+ yValuesObj[i] = DataPointCollection.ConvertEnumerationItem(enumerator.Current, yFieldNames[i]);
+ if(yValuesObj[i] is System.DBNull || yValuesObj[i] == null)
+ {
+ emptyValues = true;
+ yValuesObj[i] = 0.0;
+ }
+ }
+ else
+ {
+ yValuesObj[i] = (((Series)seriesList[0]).IsYValueDateTime()) ? DateTime.Now.Date.ToOADate() : 0.0;
+ }
+ }
+ }
+
+
+ // Add data point if X value is not Null
+ if(!xValueIsNull)
+ {
+ if(emptyValues)
+ {
+ if(xValueObj != null)
+ {
+ newDataPoint.SetValueXY(xValueObj, yValuesObj);
+ }
+ else
+ {
+ newDataPoint.SetValueXY(0, yValuesObj);
+ }
+ series.Points.DataPointInit(ref newDataPoint);
+ newDataPoint.IsEmpty = true;
+ series.Points.Add(newDataPoint);
+ }
+ else
+ {
+ if(xValueObj != null)
+ {
+ newDataPoint.SetValueXY(xValueObj, yValuesObj);
+ }
+ else
+ {
+ newDataPoint.SetValueXY(0, yValuesObj);
+ }
+ series.Points.DataPointInit(ref newDataPoint);
+ series.Points.Add(newDataPoint);
+ }
+ }
+ if (this.Common.Chart.IsDesignMode())
+ {
+ series["TempDesignData"] = "true";
+ }
+ }
+ }
+ }
+
+ } while(valueExsists);
+
+ }
+ }
+
+
+ /// <summary>
+ /// Aligns data points using their axis labels.
+ /// </summary>
+ /// <param name="sortAxisLabels">Indicates if points should be sorted by axis labels.</param>
+ /// <param name="sortingOrder">Sorting pointSortOrder.</param>
+ internal void AlignDataPointsByAxisLabel(bool sortAxisLabels, PointSortOrder sortingOrder)
+ {
+ // Find series which are attached to the same X axis in the same chart area
+ foreach(ChartArea chartArea in this.ChartAreas)
+ {
+
+ // Check if chart area is visible
+ if(chartArea.Visible)
+
+ {
+ // Create series list for primary and secondary X axis
+ ArrayList chartAreaSeriesPrimary = new ArrayList();
+ ArrayList chartAreaSeriesSecondary = new ArrayList();
+ foreach(Series series in this.Common.Chart.Series)
+ {
+ // Check if series belongs to the chart area
+ if (series.ChartArea == chartArea.Name)
+ {
+ if(series.XSubAxisName.Length == 0)
+ {
+ if(series.XAxisType == AxisType.Primary)
+ {
+ chartAreaSeriesPrimary.Add(series);
+ }
+ else
+ {
+ chartAreaSeriesSecondary.Add(series);
+ }
+ }
+ }
+ }
+
+ // Align series
+ AlignDataPointsByAxisLabel(chartAreaSeriesPrimary, sortAxisLabels, sortingOrder);
+ AlignDataPointsByAxisLabel(chartAreaSeriesSecondary, sortAxisLabels, sortingOrder);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Aligns data points using their axis labels.
+ /// </summary>
+ /// <param name="seriesList">List of series to align.</param>
+ /// <param name="sortAxisLabels">Indicates if points should be sorted by axis labels.</param>
+ /// <param name="sortingOrder">Sorting order.</param>
+ internal void AlignDataPointsByAxisLabel(
+ ArrayList seriesList,
+ bool sortAxisLabels,
+ PointSortOrder sortingOrder)
+ {
+ // List is empty
+ if(seriesList.Count == 0)
+ {
+ return;
+ }
+
+ // Collect information about all points in all series
+ bool indexedX = true;
+ bool uniqueAxisLabels = true;
+ ArrayList axisLabels = new ArrayList();
+ foreach(Series series in seriesList)
+ {
+ ArrayList seriesAxisLabels = new ArrayList();
+ foreach(DataPoint point in series.Points)
+ {
+ // Check if series has indexed X values
+ if(!series.IsXValueIndexed && point.XValue != 0.0)
+ {
+ indexedX = false;
+ break;
+ }
+
+ // Add axis label to the list and make sure it's non-empty and unique
+ if(point.AxisLabel.Length == 0)
+ {
+ uniqueAxisLabels = false;
+ break;
+ }
+ else if(seriesAxisLabels.Contains(point.AxisLabel))
+ {
+ uniqueAxisLabels = false;
+ break;
+ }
+ else if(!axisLabels.Contains(point.AxisLabel))
+ {
+ axisLabels.Add(point.AxisLabel);
+ }
+
+ seriesAxisLabels.Add(point.AxisLabel);
+ }
+ }
+
+ // Sort axis labels
+ if(sortAxisLabels)
+ {
+ axisLabels.Sort();
+ if(sortingOrder == PointSortOrder.Descending)
+ {
+ axisLabels.Reverse();
+ }
+ }
+
+ // All series must be indexed
+ if(!indexedX)
+ {
+ throw (new InvalidOperationException(SR.ExceptionChartDataPointsAlignmentFaild));
+ }
+
+ // AxisLabel can't be empty or duplicated
+ if(!uniqueAxisLabels)
+ {
+ throw (new InvalidOperationException(SR.ExceptionChartDataPointsAlignmentFaildAxisLabelsInvalid));
+ }
+
+ // Assign unique X values for data points in all series with same axis LabelStyle
+ if(indexedX && uniqueAxisLabels)
+ {
+ foreach(Series series in seriesList)
+ {
+ foreach(DataPoint point in series.Points)
+ {
+ point.XValue = axisLabels.IndexOf(point.AxisLabel) + 1;
+ }
+
+ // Sort points by X value
+ series.Sort(PointSortOrder.Ascending, "X");
+ }
+
+ // Make sure ther are no missing points
+ foreach(Series series in seriesList)
+ {
+ series.IsXValueIndexed = true;
+ for(int index = 0; index < axisLabels.Count; index++)
+ {
+ if(index >= series.Points.Count ||
+ series.Points[index].XValue != index + 1)
+ {
+ DataPoint newPoint = new DataPoint(series);
+ newPoint.AxisLabel = (string)axisLabels[index];
+ newPoint.XValue = index + 1;
+ newPoint.YValues[0] = 0.0;
+ newPoint.IsEmpty = true;
+ series.Points.Insert(index, newPoint);
+ }
+ }
+ }
+
+ }
+
+ }
+
+ /// <summary>
+ /// Data bind chart to the table. Series will be automatically added to the chart depending on
+ /// the number of unique values in the seriesGroupByField column of the data source.
+ /// Data source can be the Ole(SQL)DataReader, DataView, DataSet, DataTable or DataRow.
+ /// </summary>
+ /// <param name="dataSource">Data source.</param>
+ /// <param name="seriesGroupByField">Name of the field used to group data into series.</param>
+ /// <param name="xField">Name of the field for X values.</param>
+ /// <param name="yFields">Comma separated name(s) of the field(s) for Y value(s).</param>
+ /// <param name="otherFields">Other point properties binding rule in format: PointProperty=Field[{Format}] [,PointProperty=Field[{Format}]]. For example: "Tooltip=Price{C1},Url=WebSiteName".</param>
+ /// <param name="sort">Indicates that series should be sorted by group field.</param>
+ /// <param name="sortingOrder">Series sorting order by group field.</param>
+ internal void DataBindCrossTab(
+ IEnumerable dataSource,
+ string seriesGroupByField,
+ string xField,
+ string yFields,
+ string otherFields,
+ bool sort,
+ PointSortOrder sortingOrder)
+ {
+ // Check arguments
+ if (dataSource == null)
+ throw (new ArgumentNullException("dataSource", SR.ExceptionDataPointInsertionNoDataSource));
+
+ if (dataSource is string)
+ throw (new ArgumentException(SR.ExceptionDataBindSeriesToString, "dataSource"));
+
+ if (String.IsNullOrEmpty(yFields))
+ throw (new ArgumentException(SR.ExceptionChartDataPointsInsertionFailedYValuesEmpty, "yFields"));
+
+ if (String.IsNullOrEmpty(seriesGroupByField))
+ throw (new ArgumentException(SR.ExceptionDataBindSeriesGroupByParameterIsEmpty, "seriesGroupByField"));
+
+
+ // List of series and group by field values
+ ArrayList seriesList = new ArrayList();
+ ArrayList groupByValueList = new ArrayList();
+
+ // Convert comma separated Y values field names string to array of names
+ string[] yFieldNames = null;
+ if(yFields != null)
+ {
+ yFieldNames = yFields.Replace(",,", "\n").Split(',');
+ for(int index = 0; index < yFieldNames.Length; index++)
+ {
+ yFieldNames[index] = yFieldNames[index].Replace("\n", ",");
+ }
+ }
+
+ // Convert other fields/properties names to two arrays of names
+ string[] otherAttributeNames = null;
+ string[] otherFieldNames = null;
+ string[] otherValueFormat = null;
+ DataPointCollection.ParsePointFieldsParameter(
+ otherFields,
+ ref otherAttributeNames,
+ ref otherFieldNames,
+ ref otherValueFormat);
+
+
+ // Get and reset enumerator
+ IEnumerator enumerator = DataPointCollection.GetDataSourceEnumerator(dataSource);
+ if(enumerator.GetType() != typeof(System.Data.Common.DbEnumerator))
+ {
+ try
+ {
+ enumerator.Reset();
+ }
+ // Some enumerators may not support Resetting
+ catch (NotSupportedException)
+ {
+ }
+ catch (NotImplementedException)
+ {
+ }
+ catch (InvalidOperationException)
+ {
+ }
+
+ }
+
+ // Add data points
+ bool valueExsist = true;
+ object[] yValuesObj = new object[yFieldNames.Length];
+ object xValueObj = null;
+ bool autoDetectType = true;
+
+ do
+ {
+ // Move to the next objects in the enumerations
+ if(valueExsist)
+ {
+ valueExsist = enumerator.MoveNext();
+ }
+
+ // Create and initialize data point
+ if(valueExsist)
+ {
+ // Get value of the group by field
+ object groupObj = DataPointCollection.ConvertEnumerationItem(
+ enumerator.Current,
+ seriesGroupByField);
+
+ // Check series group by field and create new series if required
+ Series series = null;
+ int seriesIndex = groupByValueList.IndexOf(groupObj);
+ if(seriesIndex >= 0)
+ {
+ // Select existing series from the list
+ series = (Series)seriesList[seriesIndex];
+ }
+ else
+ {
+ // Create new series
+ series = new Series();
+ series.YValuesPerPoint = yFieldNames.GetLength(0);
+
+ // If not the first series in the list copy some properties
+ if(seriesList.Count > 0)
+ {
+ series.XValueType = ((Series)seriesList[0]).XValueType;
+ series.autoXValueType = ((Series)seriesList[0]).autoXValueType;
+ series.YValueType = ((Series)seriesList[0]).YValueType;
+ series.autoYValueType = ((Series)seriesList[0]).autoYValueType;
+ }
+
+ // Try to set series name based on grouping vlaue
+ string groupObjStr = groupObj as string;
+ if(groupObjStr != null)
+ {
+ series.Name = groupObjStr;
+ }
+ else
+ {
+ series.Name = seriesGroupByField + " - " + groupObj.ToString();
+ }
+
+
+ // Add series and group value into the lists
+ groupByValueList.Add(groupObj);
+ seriesList.Add(series);
+ }
+
+
+ // Auto detect valu(s) type
+ if(autoDetectType)
+ {
+ autoDetectType = false;
+ DataPointCollection.AutoDetectValuesType(series, enumerator, xField, enumerator, yFieldNames[0]);
+ }
+
+ // Create new data point
+ DataPoint newDataPoint = new DataPoint(series);
+ bool emptyValues = false;
+
+ // Set X to the value provided
+ if(xField.Length > 0)
+ {
+ xValueObj = DataPointCollection.ConvertEnumerationItem(enumerator.Current, xField);
+ if( DataPointCollection.IsEmptyValue(xValueObj) )
+ {
+ emptyValues = true;
+ xValueObj = 0.0;
+ }
+ }
+
+ // Set Y values
+ if(yFieldNames.Length == 0)
+ {
+ yValuesObj[0] = DataPointCollection.ConvertEnumerationItem(enumerator.Current, null);
+ if( DataPointCollection.IsEmptyValue(yValuesObj[0]) )
+ {
+ emptyValues = true;
+ yValuesObj[0] = 0.0;
+ }
+ }
+ else
+ {
+ for(int i = 0; i < yFieldNames.Length; i++)
+ {
+ yValuesObj[i] = DataPointCollection.ConvertEnumerationItem(enumerator.Current, yFieldNames[i]);
+ if( DataPointCollection.IsEmptyValue(yValuesObj[i] ) )
+ {
+ emptyValues = true;
+ yValuesObj[i] = 0.0;
+ }
+ }
+ }
+
+ // Set other values
+ if(otherAttributeNames != null &&
+ otherAttributeNames.Length > 0)
+ {
+ for(int i = 0; i < otherFieldNames.Length; i++)
+ {
+ // Get object by field name
+ object obj = DataPointCollection.ConvertEnumerationItem(enumerator.Current, otherFieldNames[i]);
+ if( !DataPointCollection.IsEmptyValue( obj ) )
+ {
+ newDataPoint.SetPointCustomProperty(
+ obj,
+ otherAttributeNames[i],
+ otherValueFormat[i]);
+ }
+ }
+ }
+
+ // IsEmpty value was detected
+ if(emptyValues)
+ {
+ if(xValueObj != null)
+ {
+ newDataPoint.SetValueXY(xValueObj, yValuesObj);
+ }
+ else
+ {
+ newDataPoint.SetValueXY(0, yValuesObj);
+ }
+ DataPointCollection.DataPointInit(series, ref newDataPoint);
+ newDataPoint.IsEmpty = true;
+ series.Points.Add(newDataPoint);
+ }
+ else
+ {
+ if(xValueObj != null)
+ {
+ newDataPoint.SetValueXY(xValueObj, yValuesObj);
+ }
+ else
+ {
+ newDataPoint.SetValueXY(0, yValuesObj);
+ }
+ DataPointCollection.DataPointInit(series, ref newDataPoint);
+ series.Points.Add(newDataPoint);
+ }
+ }
+
+ } while(valueExsist);
+
+ // Sort series usig values of group by field
+ if(sort)
+ {
+ // Duplicate current list
+ ArrayList oldList = (ArrayList)groupByValueList.Clone();
+
+ // Sort list
+ groupByValueList.Sort();
+ if(sortingOrder == PointSortOrder.Descending)
+ {
+ groupByValueList.Reverse();
+ }
+
+ // Change order of series in collection
+ ArrayList sortedSeriesList = new ArrayList();
+ foreach(object obj in groupByValueList)
+ {
+ sortedSeriesList.Add(seriesList[oldList.IndexOf(obj)]);
+ }
+ seriesList = sortedSeriesList;
+ }
+
+ // Add all series from the list into the series collection
+ foreach(Series series in seriesList)
+ {
+ this.Common.Chart.Series.Add(series);
+ }
+ }
+
+ /// <summary>
+ /// Automatically creates and binds series to specified data table.
+ /// Each column of the table becomes a Y value in a separate series.
+ /// Series X value field may also be provided.
+ /// </summary>
+ /// <param name="dataSource">Data source.</param>
+ /// <param name="xField">Name of the field for series X values.</param>
+ internal void DataBindTable(
+ IEnumerable dataSource,
+ string xField)
+ {
+ // Check arguments
+ if (dataSource == null)
+ throw new ArgumentNullException("dataSource");
+
+ // Get list of member names from the data source
+ ArrayList dataSourceFields = GetDataSourceMemberNames(dataSource, true);
+
+ // Remove X value field if it's there
+ if (xField != null && xField.Length > 0)
+ {
+ int index = -1;
+ for (int i = 0; i < dataSourceFields.Count; i++)
+ {
+ if ( String.Equals((string)dataSourceFields[i], xField, StringComparison.OrdinalIgnoreCase ) )
+ {
+ index = i;
+ break;
+ }
+ }
+ if (index >= 0)
+ {
+ dataSourceFields.RemoveAt(index);
+ }
+ else
+ {
+ // Check if field name passed as index
+ bool parseSucceed = int.TryParse(xField, NumberStyles.Any, CultureInfo.InvariantCulture, out index);
+ if (parseSucceed && index >= 0 && index < dataSourceFields.Count)
+ {
+ dataSourceFields.RemoveAt(index);
+ }
+ }
+ }
+
+ // Get number of series
+ int seriesNumber = dataSourceFields.Count;
+ if (seriesNumber > 0)
+ {
+ // Create as many series as fields in the data source
+ ArrayList seriesList = new ArrayList();
+ int index = 0;
+ foreach (string fieldName in dataSourceFields)
+ {
+ Series series = new Series(fieldName);
+
+ // Set binding properties
+ series.YValueMembers = fieldName;
+ series.XValueMember = xField;
+
+ // Add to list
+ seriesList.Add(series);
+ ++index;
+ }
+
+
+ // Data bind series
+ this.DataBind(dataSource, seriesList);
+
+ // Add all series from the list into the series collection
+ foreach (Series series in seriesList)
+ {
+ // Clear binding properties
+ series.YValueMembers = String.Empty;
+ series.XValueMember = String.Empty;
+
+ // Add series into the list
+ this.Common.Chart.Series.Add(series);
+ }
+ }
+ }
+
+ #endregion // Data Binding
+
+ #endregion
+
+ }
+
+ /// <summary>
+ /// ChartPicture class represents chart content like legends, titles,
+ /// chart areas and series. It provides methods for positioning and
+ /// drawing all chart elements.
+ /// </summary>
+ internal class ChartPicture : ChartElement, IServiceProvider
+ {
+ #region Fields
+
+ /// <summary>
+ /// Indicates that chart exceptions should be suppressed.
+ /// </summary>
+ private bool _suppressExceptions = false;
+
+ // Chart Graphic object
+ internal ChartGraphics ChartGraph { get; set; }
+
+ // Private data members, which store properties values
+ private GradientStyle _backGradientStyle = GradientStyle.None;
+ private Color _backSecondaryColor = Color.Empty;
+ private Color _backColor = Color.White;
+ private string _backImage = "";
+ private ChartImageWrapMode _backImageWrapMode = ChartImageWrapMode.Tile;
+ private Color _backImageTransparentColor = Color.Empty;
+ private ChartImageAlignmentStyle _backImageAlign = ChartImageAlignmentStyle.TopLeft;
+ private Color _borderColor = Color.White;
+ private int _borderWidth = 1;
+ private ChartDashStyle _borderDashStyle = ChartDashStyle.NotSet;
+ private ChartHatchStyle _backHatchStyle = ChartHatchStyle.None;
+ private AntiAliasingStyles _antiAliasing = AntiAliasingStyles.All;
+ private TextAntiAliasingQuality _textAntiAliasingQuality = TextAntiAliasingQuality.High;
+ private bool _isSoftShadows = true;
+ private int _width = 300;
+ private int _height = 300;
+ private DataManipulator _dataManipulator = new DataManipulator();
+ internal HotRegionsList hotRegionsList = null;
+ private BorderSkin _borderSkin = null;
+#if !Microsoft_CONTROL
+ private bool _isMapEnabled = true;
+ private MapAreasCollection _mapAreas = null;
+#endif
+ // Chart areas collection
+ private ChartAreaCollection _chartAreas = null;
+
+ // Chart legend collection
+ private LegendCollection _legends = null;
+
+ // Chart title collection
+ private TitleCollection _titles = null;
+
+ // Chart annotation collection
+ private AnnotationCollection _annotations = null;
+
+ // Annotation smart labels class
+ internal AnnotationSmartLabel annotationSmartLabel = new AnnotationSmartLabel();
+
+ // Chart picture events
+ internal event EventHandler<ChartPaintEventArgs> BeforePaint;
+ internal event EventHandler<ChartPaintEventArgs> AfterPaint;
+
+ // Chart title position rectangle
+ private RectangleF _titlePosition = RectangleF.Empty;
+
+ // Element spacing size
+ internal const float elementSpacing = 3F;
+
+ // Maximum size of the font in percentage
+ internal const float maxTitleSize = 15F;
+
+ // Printing indicator
+ internal bool isPrinting = false;
+
+ // Indicates chart selection mode
+ internal bool isSelectionMode = false;
+
+ private FontCache _fontCache = new FontCache();
+
+ // Position of the chart 3D border
+ private RectangleF _chartBorderPosition = RectangleF.Empty;
+
+#if Microsoft_CONTROL
+
+ // Saving As Image indicator
+ internal bool isSavingAsImage = false;
+
+ // Indicates that chart background is restored from the double buffer
+ // prior to drawing top level objects like annotations, cursors and selection.
+ internal bool backgroundRestored = false;
+
+ // Buffered image of non-top level chart elements
+ internal Bitmap nonTopLevelChartBuffer = null;
+
+#endif // Microsoft_CONTROL
+
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// Constructor.
+ /// </summary>
+ /// <param name="container">Service container</param>
+ public ChartPicture(IServiceContainer container)
+ {
+ if(container == null)
+ {
+ throw(new ArgumentNullException(SR.ExceptionInvalidServiceContainer));
+ }
+
+ // Create and set Common Elements
+ Common = new CommonElements(container);
+ ChartGraph= new ChartGraphics(Common);
+ hotRegionsList = new HotRegionsList(Common);
+
+ // Create border properties class
+ _borderSkin = new BorderSkin(this);
+
+ // Create a collection of chart areas
+ _chartAreas = new ChartAreaCollection(this);
+
+ // Create a collection of legends
+ _legends = new LegendCollection(this);
+
+ // Create a collection of titles
+ _titles = new TitleCollection(this);
+
+ // Create a collection of annotations
+ _annotations = new AnnotationCollection(this);
+
+ // Set Common elements for data manipulator
+ _dataManipulator.Common = Common;
+
+#if !Microsoft_CONTROL
+ // Create map areas collection
+ _mapAreas = new MapAreasCollection();
+#endif
+ }
+
+ /// <summary>
+ /// Returns Chart service object
+ /// </summary>
+ /// <param name="serviceType">Service AxisName</param>
+ /// <returns>Chart picture</returns>
+ [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+ object IServiceProvider.GetService(Type serviceType)
+ {
+ if(serviceType == typeof(ChartPicture))
+ {
+ return this;
+ }
+ throw (new ArgumentException( SR.ExceptionChartPictureUnsupportedType( serviceType.ToString() ) ) );
+ }
+
+ #endregion
+
+ #region Painting and selection methods
+
+ /// <summary>
+ /// Performs empty painting.
+ /// </summary>
+ internal void PaintOffScreen()
+ {
+ // Check chart size
+ // NOTE: Fixes issue #4733
+ if (this.Width <= 0 || this.Height <= 0)
+ {
+ return;
+ }
+
+ // Set process Mode to hot regions
+ this.Common.HotRegionsList.ProcessChartMode |= ProcessMode.HotRegions;
+#if Microsoft_CONTROL
+ this.Common.HotRegionsList.hitTestCalled = true;
+#endif // Microsoft_CONTROL
+
+ // Enable selection mode
+ this.isSelectionMode = true;
+
+ // Hot Region list does not exist. Create the list.
+ //this.common.HotRegionsList.List = new ArrayList();
+ this.Common.HotRegionsList.Clear();
+
+ // Create a new bitmap
+ Bitmap image = new Bitmap(Math.Max(1,Width), Math.Max(1,Height));
+
+ // Creates a new Graphics object from the
+ // specified Image object.
+ Graphics offScreen = Graphics.FromImage(image);
+
+ // Connect Graphics object with Chart Graphics object
+ ChartGraph.Graphics = offScreen;
+
+ // Remember the previous dirty flag
+#if Microsoft_CONTROL
+ bool oldDirtyFlag = this.Common.Chart.dirtyFlag;
+#endif //Microsoft_CONTROL
+
+
+ Paint(ChartGraph.Graphics, false);
+
+ image.Dispose();
+
+ // Restore the previous dirty flag
+#if Microsoft_CONTROL
+ this.Common.Chart.dirtyFlag = oldDirtyFlag;
+#endif //Microsoft_CONTROL
+
+ // Disable selection mode
+ this.isSelectionMode = false;
+
+ // Set process Mode to hot regions
+ this.Common.HotRegionsList.ProcessChartMode |= ProcessMode.HotRegions;
+
+ }
+
+ /// <summary>
+ /// Gets text rendering quality.
+ /// </summary>
+ /// <returns>Text rendering quality.</returns>
+ internal TextRenderingHint GetTextRenderingHint()
+ {
+ TextRenderingHint result = TextRenderingHint.SingleBitPerPixelGridFit;
+ if( (this.AntiAliasing & AntiAliasingStyles.Text) == AntiAliasingStyles.Text )
+ {
+ result = TextRenderingHint.ClearTypeGridFit;
+ if(this.TextAntiAliasingQuality == TextAntiAliasingQuality.Normal)
+ {
+ result = TextRenderingHint.AntiAlias;
+ }
+ else if(this.TextAntiAliasingQuality == TextAntiAliasingQuality.SystemDefault)
+ {
+ result = TextRenderingHint.SystemDefault;
+ }
+ }
+ else
+ {
+ result = TextRenderingHint.SingleBitPerPixelGridFit;
+ }
+
+ return result;
+ }
+
+ internal bool GetBorderSkinVisibility()
+ {
+ return _borderSkin.SkinStyle != BorderSkinStyle.None && this.Width > 20 && this.Height > 20;
+ }
+
+ /// <summary>
+ /// This function paints a chart.
+ /// </summary>
+ /// <param name="graph">The graph provides drawing object to the display device. A Graphics object is associated with a specific device context.</param>
+ /// <param name="paintTopLevelElementOnly">Indicates that only chart top level elements like cursors, selection or annotation objects must be redrawn.</param>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "3#svg")]
+ internal void Paint(
+ Graphics graph,
+ bool paintTopLevelElementOnly )
+ {
+
+#if Microsoft_CONTROL
+
+ // Reset restored and saved backgound flags
+ this.backgroundRestored = false;
+
+#endif // Microsoft_CONTROL
+
+ // Reset Annotation Smart Labels
+ this.annotationSmartLabel.Reset();
+
+ // Do not draw the control if size is less than 5 pixel
+ if (this.Width < 5 || this.Height < 5)
+ {
+ return;
+ }
+
+#if Microsoft_CONTROL
+
+ bool resetHotRegionList = false;
+
+ if(
+ this.Common.HotRegionsList.hitTestCalled
+ || IsToolTipsEnabled()
+ )
+ {
+ Common.HotRegionsList.ProcessChartMode = ProcessMode.HotRegions | ProcessMode.Paint;
+
+ this.Common.HotRegionsList.hitTestCalled = false;
+
+ // Clear list of hot regions
+ if(paintTopLevelElementOnly)
+ {
+ // If repainting only top level elements (annotations) -
+ // clear top level objects hot regions only
+ for(int index = 0; index < this.Common.HotRegionsList.List.Count; index++)
+ {
+ HotRegion region = (HotRegion)this.Common.HotRegionsList.List[index];
+ if(region.Type == ChartElementType.Annotation)
+ {
+ this.Common.HotRegionsList.List.RemoveAt(index);
+ --index;
+ }
+ }
+ }
+ else
+ {
+ // If repainting whole chart - clear all hot regions
+ resetHotRegionList = true;
+ }
+ }
+ else
+ {
+ Common.HotRegionsList.ProcessChartMode = ProcessMode.Paint;
+
+ // If repainting whole chart - clear all hot regions
+ resetHotRegionList = true;
+ }
+
+ // Reset hot region list
+ if(resetHotRegionList)
+ {
+ this.Common.HotRegionsList.Clear();
+ }
+
+#else
+ if( this.IsMapEnabled )
+ {
+ Common.HotRegionsList.ProcessChartMode |= ProcessMode.ImageMaps | ProcessMode.Paint;
+
+ // Clear any existing non-custom image map areas
+ for(int index = 0; index < this.MapAreas.Count; index++)
+ {
+ MapArea mapArea = this.MapAreas[index];
+ if(!mapArea.IsCustom)
+ {
+ this.MapAreas.RemoveAt(index);
+ --index;
+ }
+ }
+ }
+
+
+#endif //#if Microsoft_CONTROL
+
+ // Check if control was data bound
+ ChartImage chartImage = this as ChartImage;
+ if(chartImage != null && !chartImage.boundToDataSource)
+ {
+ if(this.Common != null && this.Common.Chart != null && !this.Common.Chart.IsDesignMode())
+ {
+ this.Common.Chart.DataBind();
+ }
+ }
+
+ // Connect Graphics object with Chart Graphics object
+ ChartGraph.Graphics = graph;
+
+ Common.graph = ChartGraph;
+
+ // Set anti alias mode
+ ChartGraph.AntiAliasing = _antiAliasing;
+ ChartGraph.softShadows = _isSoftShadows;
+ ChartGraph.TextRenderingHint = GetTextRenderingHint();
+
+ try
+ {
+ // Check if only chart area cursors and annotations must be redrawn
+ if(!paintTopLevelElementOnly)
+ {
+ // Fire Before Paint event
+ OnBeforePaint(new ChartPaintEventArgs(this.Chart, this.ChartGraph, this.Common, new ElementPosition(0, 0, 100, 100)));
+
+ // Flag indicates that resize method should be called
+ // after adjusting the intervals in 3D charts
+ bool resizeAfterIntervalAdjusting = false;
+
+ // RecalculateAxesScale paint chart areas
+ foreach (ChartArea area in _chartAreas )
+ {
+
+ // Check if area is visible
+ if(area.Visible)
+
+ {
+ area.Set3DAnglesAndReverseMode();
+ area.SetTempValues();
+ area.ReCalcInternal();
+
+ // Resize should be called the second time
+ if( area.Area3DStyle.Enable3D && !area.chartAreaIsCurcular)
+ {
+ resizeAfterIntervalAdjusting = true;
+ }
+ }
+ }
+
+ // Call Customize event
+ this.Common.Chart.CallOnCustomize();
+
+ // Resize picture
+ Resize(ChartGraph, resizeAfterIntervalAdjusting);
+
+
+ // This code is introduce because labels has to
+ // be changed when scene is rotated.
+ bool intervalReCalculated = false;
+ foreach (ChartArea area in _chartAreas )
+ {
+ if( area.Area3DStyle.Enable3D &&
+ !area.chartAreaIsCurcular
+
+ && area.Visible
+
+ )
+
+ {
+ // Make correction for interval in 3D space
+ intervalReCalculated = true;
+ area.Estimate3DInterval( ChartGraph );
+ area.ReCalcInternal();
+ }
+ }
+
+ // Resize chart areas after updating 3D interval
+ if(resizeAfterIntervalAdjusting)
+ {
+ // NOTE: Fixes issue #6808.
+ // In 3D chart area interval will be changed to compenstae for the axis rotation angle.
+ // This will cause all standard labels to be changed. We need to call the customize event
+ // the second time to give user a chance to modify those labels.
+ if (intervalReCalculated)
+ {
+ // Call Customize event
+ this.Common.Chart.CallOnCustomize();
+ }
+
+ // Resize chart elements
+ Resize(ChartGraph);
+ }
+
+
+ //***********************************************************************
+ //** Draw chart 3D border
+ //***********************************************************************
+ if (GetBorderSkinVisibility())
+ {
+ // Fill rectangle with page color
+ ChartGraph.FillRectangleAbs( new RectangleF( 0, 0, Width-1 , Height-1 ),
+ _borderSkin.PageColor,
+ ChartHatchStyle.None,
+ "",
+ ChartImageWrapMode.Tile,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ GradientStyle.None,
+ Color.Empty,
+ _borderSkin.PageColor,
+ 1,
+ ChartDashStyle.Solid,
+ PenAlignment.Inset );
+
+ // Draw 3D border
+ ChartGraph.Draw3DBorderAbs(
+ _borderSkin,
+ this._chartBorderPosition,
+ BackColor,
+ BackHatchStyle,
+ BackImage,
+ BackImageWrapMode,
+ BackImageTransparentColor,
+ BackImageAlignment,
+ BackGradientStyle,
+ BackSecondaryColor,
+ BorderColor,
+ BorderWidth,
+ BorderDashStyle);
+ }
+
+ // Paint Background
+ else
+ {
+ ChartGraph.FillRectangleAbs( new RectangleF( 0, 0, Width-1 , Height-1 ),
+ BackColor,
+ BackHatchStyle,
+ BackImage,
+ BackImageWrapMode,
+ BackImageTransparentColor,
+ BackImageAlignment,
+ BackGradientStyle,
+ BackSecondaryColor,
+ BorderColor,
+ BorderWidth,
+ BorderDashStyle,
+ PenAlignment.Inset );
+ }
+
+ // Call BackPaint event
+ this.Chart.CallOnPrePaint(new ChartPaintEventArgs(this.Chart, this.ChartGraph, this.Common, new ElementPosition(0, 0, 100, 100)));
+
+ // Call paint function for each chart area.
+ foreach (ChartArea area in _chartAreas )
+ {
+
+ // Check if area is visible
+ if(area.Visible)
+
+ {
+ area.Paint(ChartGraph);
+ }
+ }
+
+ // This code is introduced because of GetPointsInterval method,
+ // which is very time consuming. There is no reason to calculate
+ // interval after painting.
+ foreach (ChartArea area in _chartAreas )
+ {
+ // Reset interval data
+ area.intervalData = double.NaN;
+ }
+
+ // Draw Legends
+ foreach(Legend legendCurrent in this.Legends)
+ {
+ legendCurrent.Paint(ChartGraph);
+ }
+
+ // Draw chart titles from the collection
+ foreach(Title titleCurrent in this.Titles)
+ {
+ titleCurrent.Paint(ChartGraph);
+ }
+
+ // Call Paint event
+ this.Chart.CallOnPostPaint(new ChartPaintEventArgs(this.Chart, this.ChartGraph, this.Common, new ElementPosition(0, 0, 100, 100)));
+ }
+
+ // Draw annotation objects
+ this.Annotations.Paint(ChartGraph, paintTopLevelElementOnly);
+
+ // Draw chart areas cursors in all areas.
+ // Only if not in selection
+ if(!this.isSelectionMode)
+ {
+ foreach (ChartArea area in _chartAreas )
+ {
+
+ // Check if area is visible
+ if(area.Visible)
+
+ {
+ area.PaintCursors(ChartGraph, paintTopLevelElementOnly);
+ }
+ }
+ }
+
+ // Return default values
+ foreach (ChartArea area in _chartAreas )
+ {
+
+ // Check if area is visible
+ if(area.Visible)
+
+ {
+ area.Restore3DAnglesAndReverseMode();
+ area.GetTempValues();
+ }
+ }
+ }
+ catch(System.Exception)
+ {
+ throw;
+ }
+ finally
+ {
+ // Fire After Paint event
+ OnAfterPaint(new ChartPaintEventArgs(this.Chart, this.ChartGraph, this.Common, new ElementPosition(0, 0, 100, 100)));
+
+ // Restore temp values for each chart area
+ foreach (ChartArea area in _chartAreas )
+ {
+
+ // Check if area is visible
+ if(area.Visible)
+
+ {
+ area.Restore3DAnglesAndReverseMode();
+ area.GetTempValues();
+ }
+ }
+
+#if !Microsoft_CONTROL
+ if (this.Chart.IsDesignMode())
+ {
+ this.Chart.MapAreas.RemoveNonCustom();
+ }
+#endif //!Microsoft_CONTROL
+ }
+ }
+
+ /// <summary>
+ /// Invoke before paint delegates.
+ /// </summary>
+ /// <param name="e">Event arguments.</param>
+ protected virtual void OnBeforePaint(ChartPaintEventArgs e)
+ {
+ if (BeforePaint != null)
+ {
+ //Invokes the delegates.
+ BeforePaint(this, e);
+ }
+ }
+
+ /// <summary>
+ /// Invoke after paint delegates.
+ /// </summary>
+ /// <param name="e">Event arguments.</param>
+ protected virtual void OnAfterPaint(ChartPaintEventArgs e)
+ {
+ if (AfterPaint != null)
+ {
+ //Invokes the delegates.
+ AfterPaint(this, e);
+ }
+ }
+
+ internal override void Invalidate()
+ {
+ base.Invalidate();
+
+#if Microsoft_CONTROL
+ if (Chart!=null)
+ Chart.Invalidate();
+#endif
+ }
+ #endregion
+
+ #region Resizing methods
+
+ /// <summary>
+ /// Resize the chart picture.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics.</param>
+ public void Resize(ChartGraphics chartGraph)
+ {
+ Resize(chartGraph, false);
+ }
+
+ /// <summary>
+ /// Resize the chart picture.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics.</param>
+ /// <param name="calcAreaPositionOnly">Indicates that only chart area position is calculated.</param>
+ public void Resize(ChartGraphics chartGraph, bool calcAreaPositionOnly)
+ {
+ // Set the chart size for Common elements
+ Common.Width = _width;
+ Common.Height = _height;
+
+ // Set the chart size for Chart graphics
+ chartGraph.SetPictureSize( _width, _height );
+
+ // Initialize chart area(s) rectangle
+ RectangleF chartAreasRectangle = new RectangleF(0, 0, _width - 1, _height - 1);
+ chartAreasRectangle = chartGraph.GetRelativeRectangle(chartAreasRectangle);
+
+ //******************************************************
+ //** Get the 3D border interface
+ //******************************************************
+ _titlePosition = RectangleF.Empty;
+ IBorderType border3D = null;
+ bool titleInBorder = false;
+
+ if(_borderSkin.SkinStyle != BorderSkinStyle.None)
+ {
+ // Set border size
+ this._chartBorderPosition = chartGraph.GetAbsoluteRectangle(chartAreasRectangle);
+
+ // Get border interface
+ border3D = Common.BorderTypeRegistry.GetBorderType(_borderSkin.SkinStyle.ToString());
+ if(border3D != null)
+ {
+ border3D.Resolution = chartGraph.Graphics.DpiX;
+ // Check if title should be displayed in the border
+ titleInBorder = border3D.GetTitlePositionInBorder() != RectangleF.Empty;
+ _titlePosition = chartGraph.GetRelativeRectangle(border3D.GetTitlePositionInBorder());
+ _titlePosition.Width = chartAreasRectangle.Width - _titlePosition.Width;
+
+ // Adjust are position to the border size
+ border3D.AdjustAreasPosition(chartGraph, ref chartAreasRectangle);
+ }
+ }
+
+ //******************************************************
+ //** Calculate position of all titles in the collection
+ //******************************************************
+ RectangleF frameTitlePosition = RectangleF.Empty;
+ if(titleInBorder)
+ {
+ frameTitlePosition = new RectangleF(_titlePosition.Location, _titlePosition.Size);
+ }
+ foreach(Title title in this.Titles)
+ {
+ if (title.DockedToChartArea == Constants.NotSetValue &&
+ title.Position.Auto &&
+ title.Visible)
+ {
+ title.CalcTitlePosition(chartGraph, ref chartAreasRectangle, ref frameTitlePosition, elementSpacing);
+ }
+ }
+
+ //******************************************************
+ //** Calculate position of all legends in the collection
+ //******************************************************
+ this.Legends.CalcLegendPosition(chartGraph, ref chartAreasRectangle, elementSpacing);
+
+ //******************************************************
+ //** Calculate position of the chart area(s)
+ //******************************************************
+ chartAreasRectangle.Width -= elementSpacing;
+ chartAreasRectangle.Height -= elementSpacing;
+ RectangleF areaPosition = new RectangleF();
+
+
+ // Get number of chart areas that requeres automatic positioning
+ int areaNumber = 0;
+ foreach (ChartArea area in _chartAreas )
+ {
+
+ // Check if area is visible
+ if(area.Visible)
+
+ {
+ if(area.Position.Auto)
+ {
+ ++areaNumber;
+ }
+ }
+ }
+
+ // Calculate how many columns & rows of areas we going to have
+ int areaColumns = (int)Math.Floor(Math.Sqrt(areaNumber));
+ if(areaColumns < 1)
+ {
+ areaColumns = 1;
+ }
+ int areaRows = (int)Math.Ceiling(((float)areaNumber) / ((float)areaColumns));
+
+ // Set position for all areas
+ int column = 0;
+ int row = 0;
+ foreach (ChartArea area in _chartAreas )
+ {
+
+ // Check if area is visible
+ if(area.Visible)
+
+ {
+ if(area.Position.Auto)
+ {
+ // Calculate area position
+ areaPosition.Width = chartAreasRectangle.Width / areaColumns - elementSpacing;
+ areaPosition.Height = chartAreasRectangle.Height / areaRows - elementSpacing;
+ areaPosition.X = chartAreasRectangle.X + column * (chartAreasRectangle.Width / areaColumns) + elementSpacing;
+ areaPosition.Y = chartAreasRectangle.Y + row * (chartAreasRectangle.Height / areaRows) + elementSpacing;
+
+ // Calculate position of all titles in the collection docked outside of the chart area
+ TitleCollection.CalcOutsideTitlePosition(this, chartGraph, area, ref areaPosition, elementSpacing);
+
+ // Calculate position of the legend if it's docked outside of the chart area
+ this.Legends.CalcOutsideLegendPosition(chartGraph, area, ref areaPosition, elementSpacing);
+
+ // Set area position without changing the Auto flag
+ area.Position.SetPositionNoAuto(areaPosition.X, areaPosition.Y, areaPosition.Width, areaPosition.Height);
+
+ // Go to next area
+ ++row;
+ if(row >= areaRows)
+ {
+ row = 0;
+ ++column;
+ }
+ }
+ else
+ {
+ RectangleF rect = area.Position.ToRectangleF();
+
+ // Calculate position of all titles in the collection docked outside of the chart area
+ TitleCollection.CalcOutsideTitlePosition(this, chartGraph, area, ref rect, elementSpacing);
+
+ // Calculate position of the legend if it's docked outside of the chart area
+ this.Legends.CalcOutsideLegendPosition(chartGraph, area, ref rect, elementSpacing);
+ }
+ }
+ }
+
+ //******************************************************
+ //** Align chart areas Position if required
+ //******************************************************
+ AlignChartAreasPosition();
+
+ //********************************************************
+ //** Check if only chart area position must be calculated.
+ //********************************************************
+ if(!calcAreaPositionOnly)
+ {
+
+ //******************************************************
+ //** Call Resize function for each chart area.
+ //******************************************************
+ foreach (ChartArea area in _chartAreas )
+ {
+
+ // Check if area is visible
+ if(area.Visible)
+
+ {
+ area.Resize(chartGraph);
+ }
+ }
+
+ //******************************************************
+ //** Align chart areas InnerPlotPosition if required
+ //******************************************************
+ AlignChartAreas(AreaAlignmentStyles.PlotPosition);
+
+ //******************************************************
+ //** Calculate position of the legend if it's inside
+ //** chart plotting area
+ //******************************************************
+
+ // Calculate position of all titles in the collection docked outside of the chart area
+ TitleCollection.CalcInsideTitlePosition(this, chartGraph, elementSpacing);
+
+ this.Legends.CalcInsideLegendPosition(chartGraph, elementSpacing);
+ }
+ }
+
+ /// <summary>
+ /// Minimum and maximum do not have to be calculated
+ /// from data series every time. It is very time
+ /// consuming. Minimum and maximum are buffered
+ /// and only when this flags are set Minimum and
+ /// Maximum are refreshed from data.
+ /// </summary>
+ internal void ResetMinMaxFromData()
+ {
+ if (_chartAreas != null)
+ {
+ // Call ResetMinMaxFromData function for each chart area.
+ foreach (ChartArea area in _chartAreas)
+ {
+
+ // Check if area is visible
+ if (area.Visible)
+ {
+ area.ResetMinMaxFromData();
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// RecalculateAxesScale the chart picture.
+ /// </summary>
+ public void Recalculate()
+ {
+ // Call ReCalc function for each chart area.
+ foreach (ChartArea area in _chartAreas )
+ {
+
+ // Check if area is visible
+ if(area.Visible)
+
+ {
+ area.ReCalcInternal();
+ }
+ }
+ }
+
+ #endregion
+
+ #region Chart picture properties
+
+ // VSTS 96787-Text Direction (RTL/LTR)
+#if !Microsoft_CONTROL
+ private RightToLeft rightToLeft = RightToLeft.No;
+#endif //!Microsoft_CONTROL
+ /// <summary>
+ /// Gets or sets the RightToLeft type.
+ /// </summary>
+ [
+ DefaultValue(RightToLeft.No)
+ ]
+ public RightToLeft RightToLeft
+ {
+ get
+ {
+#if Microsoft_CONTROL
+ return this.Common.Chart.RightToLeft;
+#else // !WIN_CONTROL
+ return this.rightToLeft;
+#endif // WIN_CONTROL
+ }
+ set
+ {
+#if Microsoft_CONTROL
+ this.Common.Chart.RightToLeft = value;
+#else // !Microsoft_CONTROL
+ this.rightToLeft = value;
+#endif // Microsoft_CONTROL
+ }
+ }
+
+ /// <summary>
+ /// Indicates that non-critical chart exceptions will be suppressed.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeSuppressExceptions"),
+ ]
+ internal bool SuppressExceptions
+ {
+ set
+ {
+ _suppressExceptions = value;
+ }
+ get
+ {
+ return _suppressExceptions;
+ }
+ }
+
+ /// <summary>
+ /// Chart border skin style.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(BorderSkinStyle.None),
+ SRDescription("DescriptionAttributeBorderSkin"),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ ]
+ public BorderSkin BorderSkin
+ {
+ get
+ {
+ return _borderSkin;
+ }
+ set
+ {
+ _borderSkin = value;
+ }
+ }
+
+#if ! Microsoft_CONTROL
+
+ /// <summary>
+ /// Indicates that chart image map is enabled.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMap"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeMapEnabled"),
+ PersistenceMode(PersistenceMode.InnerProperty),
+ DefaultValue(true)
+ ]
+ public bool IsMapEnabled
+ {
+ get
+ {
+ return _isMapEnabled;
+ }
+ set
+ {
+ _isMapEnabled = value;
+ }
+ }
+
+ /// <summary>
+ /// Chart map areas collection.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMap"),
+ SRDescription("DescriptionAttributeMapAreas"),
+ PersistenceMode(PersistenceMode.InnerProperty),
+ Editor(Editors.ChartCollectionEditor.Editor, Editors.ChartCollectionEditor.Base)
+ ]
+ public MapAreasCollection MapAreas
+ {
+ get
+ {
+ return _mapAreas;
+ }
+ }
+#endif
+
+ /// <summary>
+ /// Reference to chart area collection
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeChartAreas"),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ Editor(Editors.ChartCollectionEditor.Editor, Editors.ChartCollectionEditor.Base)
+ ]
+ public ChartAreaCollection ChartAreas
+ {
+ get
+ {
+ return _chartAreas;
+ }
+ }
+
+ /// <summary>
+ /// Chart legend collection.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeChart"),
+ SRDescription("DescriptionAttributeLegends"),
+ Editor(Editors.LegendCollectionEditor.Editor, Editors.LegendCollectionEditor.Base),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ ]
+ public LegendCollection Legends
+ {
+ get
+ {
+ return _legends;
+ }
+ }
+
+ /// <summary>
+ /// Chart title collection.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeCharttitle"),
+ SRDescription("DescriptionAttributeTitles"),
+ Editor(Editors.ChartCollectionEditor.Editor, Editors.ChartCollectionEditor.Base),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ ]
+ public TitleCollection Titles
+ {
+ get
+ {
+ return _titles;
+ }
+ }
+
+
+
+ /// <summary>
+ /// Chart annotation collection.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeChart"),
+ SRDescription("DescriptionAttributeAnnotations3"),
+ Editor(Editors.AnnotationCollectionEditor.Editor, Editors.AnnotationCollectionEditor.Base),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ ]
+ public AnnotationCollection Annotations
+ {
+ get
+ {
+ return _annotations;
+ }
+ }
+
+
+
+ /// <summary>
+ /// Background color for the Chart
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), "White"),
+ SRDescription("DescriptionAttributeBackColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BackColor
+ {
+ get
+ {
+ return _backColor;
+ }
+ set
+ {
+#if !Microsoft_CONTROL
+ if(value == Color.Empty || value.A != 255 || value == Color.Transparent)
+ {
+ // NOTE: Transparent colors are valid
+ }
+#endif
+ _backColor = value;
+ }
+ }
+
+ /// <summary>
+ /// Border color for the Chart
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), "White"),
+ SRDescription("DescriptionAttributeBorderColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BorderColor
+ {
+ get
+ {
+ return _borderColor;
+ }
+ set
+ {
+ _borderColor = value;
+ }
+ }
+
+ /// <summary>
+ /// Chart width
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(300),
+ SRDescription("DescriptionAttributeWidth"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public int Width
+ {
+ get
+ {
+ return _width;
+ }
+ set
+ {
+ this.InspectChartDimensions(value, this.Height);
+ _width = value;
+ Common.Width = _width;
+ }
+ }
+
+ /// <summary>
+ /// Series Data Manipulator
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ SRDescription("DescriptionAttributeDataManipulator"),
+ Browsable(false),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden)
+ ]
+ public DataManipulator DataManipulator
+ {
+ get
+ {
+ return _dataManipulator;
+ }
+ }
+
+
+
+
+ /// <summary>
+ /// Chart height
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(300),
+ SRDescription("DescriptionAttributeHeight3"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public int Height
+ {
+ get
+ {
+ return _height;
+ }
+ set
+ {
+ this.InspectChartDimensions(this.Width, value);
+ _height = value;
+ Common.Height = value;
+ }
+ }
+
+ /// <summary>
+ /// Back Hatch style
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartHatchStyle.None),
+ SRDescription("DescriptionAttributeBackHatchStyle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ Editor(Editors.HatchStyleEditor.Editor, Editors.HatchStyleEditor.Base)
+ ]
+ public ChartHatchStyle BackHatchStyle
+ {
+ get
+ {
+ return _backHatchStyle;
+ }
+ set
+ {
+ _backHatchStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Chart area background image
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeBackImage"),
+ Editor(Editors.ImageValueEditor.Editor, Editors.ImageValueEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ NotifyParentPropertyAttribute(true)
+ ]
+ public string BackImage
+ {
+ get
+ {
+ return _backImage;
+ }
+ set
+ {
+ _backImage = value;
+ }
+ }
+
+ /// <summary>
+ /// Chart area background image drawing mode.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartImageWrapMode.Tile),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeImageWrapMode"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public ChartImageWrapMode BackImageWrapMode
+ {
+ get
+ {
+ return _backImageWrapMode;
+ }
+ set
+ {
+ _backImageWrapMode = value;
+ }
+ }
+
+ /// <summary>
+ /// Background image transparent color.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeImageTransparentColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BackImageTransparentColor
+ {
+ get
+ {
+ return _backImageTransparentColor;
+ }
+ set
+ {
+ _backImageTransparentColor = value;
+ }
+ }
+
+ /// <summary>
+ /// Background image alignment used by ClampUnscale drawing mode.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartImageAlignmentStyle.TopLeft),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackImageAlign"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public ChartImageAlignmentStyle BackImageAlignment
+ {
+ get
+ {
+ return _backImageAlign;
+ }
+ set
+ {
+ _backImageAlign = value;
+ }
+ }
+
+ /// <summary>
+ /// Indicates that smoothing is applied while drawing shadows.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeImage"),
+ Bindable(true),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeSoftShadows3"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public bool IsSoftShadows
+ {
+ get
+ {
+ return _isSoftShadows;
+ }
+ set
+ {
+ _isSoftShadows = value;
+ }
+ }
+
+ /// <summary>
+ /// Specifies whether smoothing (antialiasing) is applied while drawing chart.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeImage"),
+ Bindable(true),
+ DefaultValue(typeof(AntiAliasingStyles), "All"),
+ SRDescription("DescriptionAttributeAntiAlias"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public AntiAliasingStyles AntiAliasing
+ {
+ get
+ {
+ return _antiAliasing;
+ }
+ set
+ {
+ _antiAliasing = value;
+ }
+ }
+
+ /// <summary>
+ /// Specifies the quality of text antialiasing.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeImage"),
+ Bindable(true),
+ DefaultValue(typeof(TextAntiAliasingQuality), "High"),
+ SRDescription("DescriptionAttributeTextAntiAliasingQuality"),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+#endif
+ ]
+ public TextAntiAliasingQuality TextAntiAliasingQuality
+ {
+ get
+ {
+ return _textAntiAliasingQuality;
+ }
+ set
+ {
+ _textAntiAliasingQuality = value;
+ }
+ }
+
+ /// <summary>
+ /// A type for the background gradient
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(GradientStyle.None),
+ SRDescription("DescriptionAttributeBackGradientStyle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ Editor(Editors.GradientEditor.Editor, Editors.GradientEditor.Base)
+ ]
+ public GradientStyle BackGradientStyle
+ {
+ get
+ {
+ return _backGradientStyle;
+ }
+ set
+ {
+ _backGradientStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// The second color which is used for a gradient
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeBackSecondaryColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BackSecondaryColor
+ {
+ get
+ {
+ return _backSecondaryColor;
+ }
+ set
+ {
+#if !Microsoft_CONTROL
+ if(value != Color.Empty && (value.A != 255 || value == Color.Transparent))
+ {
+ throw (new ArgumentException( SR.ExceptionBackSecondaryColorIsTransparent));
+ }
+#endif
+ _backSecondaryColor = value;
+ }
+ }
+
+ /// <summary>
+ /// The width of the border line
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(1),
+ SRDescription("DescriptionAttributeChart_BorderlineWidth"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public int BorderWidth
+ {
+ get
+ {
+ return _borderWidth;
+ }
+ set
+ {
+ if(value < 0)
+ {
+ throw(new ArgumentOutOfRangeException("value", SR.ExceptionChartBorderIsNegative));
+ }
+ _borderWidth = value;
+ }
+ }
+
+ /// <summary>
+ /// The style of the border line
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartDashStyle.NotSet),
+ SRDescription("DescriptionAttributeBorderDashStyle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public ChartDashStyle BorderDashStyle
+ {
+ get
+ {
+ return _borderDashStyle;
+ }
+ set
+ {
+ _borderDashStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets the font cache.
+ /// </summary>
+ /// <value>The font cache.</value>
+ internal FontCache FontCache
+ {
+ get { return _fontCache; }
+ }
+
+ #endregion
+
+ #region Chart areas alignment methods
+
+ /// <summary>
+ /// Checks if any of the chart areas are aligned.
+ /// Also checks if the chart ares name in AlignWithChartArea property is valid.
+ /// </summary>
+ /// <returns>True if at least one area requires alignment.</returns>
+ private bool IsAreasAlignmentRequired()
+ {
+ bool alignmentRequired = false;
+
+ // Loop through all chart areas
+ foreach(ChartArea area in this.ChartAreas)
+ {
+
+ // Check if chart area is visible
+ if(area.Visible)
+
+ {
+ // Check if area is aligned
+ if (area.AlignWithChartArea != Constants.NotSetValue)
+ {
+ alignmentRequired = true;
+
+ // Check the chart area used for alignment
+ if (this._chartAreas.IndexOf(area.AlignWithChartArea)<0)
+ {
+ throw (new InvalidOperationException(SR.ExceptionChartAreaNameReferenceInvalid(area.Name, area.AlignWithChartArea)));
+ }
+ }
+ }
+ }
+
+ return alignmentRequired;
+ }
+
+ /// <summary>
+ /// Creates a list of the aligned chart areas.
+ /// </summary>
+ /// <param name="masterArea">Master chart area.</param>
+ /// <param name="type">Alignment type.</param>
+ /// <param name="orientation">Vertical or Horizontal orientation.</param>
+ /// <returns>List of areas that area aligned to the master area.</returns>
+ private ArrayList GetAlignedAreasGroup(ChartArea masterArea, AreaAlignmentStyles type, AreaAlignmentOrientations orientation)
+ {
+ ArrayList areaList = new ArrayList();
+
+ // Loop throught the chart areas and get the ones aligned with specified master area
+ foreach(ChartArea area in this.ChartAreas)
+ {
+
+ // Check if chart area is visible
+ if(area.Visible)
+
+ {
+ if(area.Name != masterArea.Name &&
+ area.AlignWithChartArea == masterArea.Name &&
+ (area.AlignmentStyle & type) == type &&
+ (area.AlignmentOrientation & orientation) == orientation )
+ {
+ // Add "slave" area into the list
+ areaList.Add(area);
+ }
+ }
+ }
+
+ // If list is not empty insert "master" area in the beginning
+ if(areaList.Count > 0)
+ {
+ areaList.Insert(0, masterArea);
+ }
+
+ return areaList;
+ }
+
+ /// <summary>
+ /// Performs specified type of alignment for the chart areas.
+ /// </summary>
+ /// <param name="type">Alignment type required.</param>
+ internal void AlignChartAreas(AreaAlignmentStyles type)
+ {
+ // Check if alignment required
+ if(IsAreasAlignmentRequired())
+ {
+ // Loop through all chart areas
+ foreach(ChartArea area in this.ChartAreas)
+ {
+
+ // Check if chart area is visible
+ if(area.Visible)
+
+ {
+ // Get vertical areas alignment group using current area as a master
+ ArrayList alignGroup = GetAlignedAreasGroup(
+ area,
+ type,
+ AreaAlignmentOrientations.Vertical);
+
+ // Align each area in the group
+ if(alignGroup.Count > 0)
+ {
+ AlignChartAreasPlotPosition(alignGroup, AreaAlignmentOrientations.Vertical);
+ }
+
+ // Get horizontal areas alignment group using current area as a master
+ alignGroup = GetAlignedAreasGroup(
+ area,
+ type,
+ AreaAlignmentOrientations.Horizontal);
+
+ // Align each area in the group
+ if(alignGroup.Count > 0)
+ {
+ AlignChartAreasPlotPosition(alignGroup, AreaAlignmentOrientations.Horizontal);
+ }
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Align inner plot position of the chart areas in the group.
+ /// </summary>
+ /// <param name="areasGroup">List of areas in the group.</param>
+ /// <param name="orientation">Group orientation.</param>
+ private void AlignChartAreasPlotPosition(ArrayList areasGroup, AreaAlignmentOrientations orientation)
+ {
+ //****************************************************************
+ //** Find the smalles size of the inner plot
+ //****************************************************************
+ RectangleF areaPlotPosition = ((ChartArea)areasGroup[0]).PlotAreaPosition.ToRectangleF();
+ foreach(ChartArea area in areasGroup)
+ {
+ if(area.PlotAreaPosition.X > areaPlotPosition.X)
+ {
+ areaPlotPosition.X += area.PlotAreaPosition.X - areaPlotPosition.X;
+ areaPlotPosition.Width -= area.PlotAreaPosition.X - areaPlotPosition.X;
+ }
+ if(area.PlotAreaPosition.Y > areaPlotPosition.Y)
+ {
+ areaPlotPosition.Y += area.PlotAreaPosition.Y - areaPlotPosition.Y;
+ areaPlotPosition.Height -= area.PlotAreaPosition.Y - areaPlotPosition.Y;
+ }
+ if(area.PlotAreaPosition.Right < areaPlotPosition.Right)
+ {
+ areaPlotPosition.Width -= areaPlotPosition.Right - area.PlotAreaPosition.Right;
+ if(areaPlotPosition.Width < 5)
+ {
+ areaPlotPosition.Width = 5;
+ }
+ }
+ if(area.PlotAreaPosition.Bottom < areaPlotPosition.Bottom)
+ {
+ areaPlotPosition.Height -= areaPlotPosition.Bottom - area.PlotAreaPosition.Bottom;
+ if(areaPlotPosition.Height < 5)
+ {
+ areaPlotPosition.Height = 5;
+ }
+ }
+ }
+
+ //****************************************************************
+ //** Align inner plot position for all areas
+ //****************************************************************
+ foreach(ChartArea area in areasGroup)
+ {
+ // Get curretn plot position of the area
+ RectangleF rect = area.PlotAreaPosition.ToRectangleF();
+
+ // Adjust area position
+ if( (orientation & AreaAlignmentOrientations.Vertical) == AreaAlignmentOrientations.Vertical)
+ {
+ rect.X = areaPlotPosition.X;
+ rect.Width = areaPlotPosition.Width;
+ }
+ if( (orientation & AreaAlignmentOrientations.Horizontal) == AreaAlignmentOrientations.Horizontal)
+ {
+ rect.Y = areaPlotPosition.Y;
+ rect.Height = areaPlotPosition.Height;
+ }
+
+ // Set new plot position in coordinates relative to chart picture
+ area.PlotAreaPosition.SetPositionNoAuto(rect.X, rect.Y, rect.Width, rect.Height);
+
+ // Set new plot position in coordinates relative to chart area position
+ rect.X = (rect.X - area.Position.X) / area.Position.Width * 100f;
+ rect.Y = (rect.Y - area.Position.Y) / area.Position.Height * 100f;
+ rect.Width = rect.Width / area.Position.Width * 100f;
+ rect.Height = rect.Height / area.Position.Height * 100f;
+ area.InnerPlotPosition.SetPositionNoAuto(rect.X, rect.Y, rect.Width, rect.Height);
+
+ if( (orientation & AreaAlignmentOrientations.Vertical) == AreaAlignmentOrientations.Vertical)
+ {
+ area.AxisX2.AdjustLabelFontAtSecondPass(ChartGraph, area.InnerPlotPosition.Auto);
+ area.AxisX.AdjustLabelFontAtSecondPass(ChartGraph, area.InnerPlotPosition.Auto);
+ }
+ if( (orientation & AreaAlignmentOrientations.Horizontal) == AreaAlignmentOrientations.Horizontal)
+ {
+ area.AxisY2.AdjustLabelFontAtSecondPass(ChartGraph, area.InnerPlotPosition.Auto);
+ area.AxisY.AdjustLabelFontAtSecondPass(ChartGraph, area.InnerPlotPosition.Auto);
+ }
+ }
+
+ }
+
+ /// <summary>
+ /// Aligns positions of the chart areas.
+ /// </summary>
+ private void AlignChartAreasPosition()
+ {
+ // Check if alignment required
+ if(IsAreasAlignmentRequired())
+ {
+ // Loop through all chart areas
+ foreach(ChartArea area in this.ChartAreas)
+ {
+
+ // Check if chart area is visible
+ if(area.Visible)
+
+ {
+ // Check if area is alignd by Position to any other area
+ if (area.AlignWithChartArea != Constants.NotSetValue && (area.AlignmentStyle & AreaAlignmentStyles.Position) == AreaAlignmentStyles.Position)
+ {
+ // Get current area position
+ RectangleF areaPosition = area.Position.ToRectangleF();
+
+ // Get master chart area
+ ChartArea masterArea = this.ChartAreas[area.AlignWithChartArea];
+
+ // Vertical alignment
+ if((area.AlignmentOrientation & AreaAlignmentOrientations.Vertical) == AreaAlignmentOrientations.Vertical)
+ {
+ // Align area position
+ areaPosition.X = masterArea.Position.X;
+ areaPosition.Width = masterArea.Position.Width;
+ }
+
+ // Horizontal alignment
+ if((area.AlignmentOrientation & AreaAlignmentOrientations.Horizontal) == AreaAlignmentOrientations.Horizontal)
+ {
+ // Align area position
+ areaPosition.Y = masterArea.Position.Y;
+ areaPosition.Height = masterArea.Position.Height;
+ }
+
+ // Set new position
+ area.Position.SetPositionNoAuto(areaPosition.X, areaPosition.Y, areaPosition.Width, areaPosition.Height);
+ }
+ }
+ }
+ }
+ }
+
+#if Microsoft_CONTROL
+
+ /// <summary>
+ /// Align chart areas cursor.
+ /// </summary>
+ /// <param name="changedArea">Changed chart area.</param>
+ /// <param name="orientation">Orientation of the changed cursor.</param>
+ /// <param name="selectionChanged">AxisName of change cursor or selection.</param>
+ internal void AlignChartAreasCursor(ChartArea changedArea, AreaAlignmentOrientations orientation, bool selectionChanged)
+ {
+ // Check if alignment required
+ if(IsAreasAlignmentRequired())
+ {
+ // Loop through all chart areas
+ foreach(ChartArea area in this.ChartAreas)
+ {
+
+ // Check if chart area is visible
+ if(area.Visible)
+
+ {
+ // Get vertical areas alignment group using current area as a master
+ ArrayList alignGroup = GetAlignedAreasGroup(
+ area,
+ AreaAlignmentStyles.Cursor,
+ orientation);
+
+ // Align each area in the group if it contains changed area
+ if(alignGroup.Contains(changedArea))
+ {
+ // Set cursor position for all areas in the group
+ foreach(ChartArea groupArea in alignGroup)
+ {
+ groupArea.alignmentInProcess = true;
+
+ if(orientation == AreaAlignmentOrientations.Vertical)
+ {
+ if(selectionChanged)
+ {
+ groupArea.CursorX.SelectionStart = changedArea.CursorX.SelectionStart;
+ groupArea.CursorX.SelectionEnd = changedArea.CursorX.SelectionEnd;
+ }
+ else
+ {
+ groupArea.CursorX.Position = changedArea.CursorX.Position;
+ }
+ }
+ if(orientation == AreaAlignmentOrientations.Horizontal)
+ {
+ if(selectionChanged)
+ {
+ groupArea.CursorY.SelectionStart = changedArea.CursorY.SelectionStart;
+ groupArea.CursorY.SelectionEnd = changedArea.CursorY.SelectionEnd;
+ }
+ else
+ {
+ groupArea.CursorY.Position = changedArea.CursorY.Position;
+ }
+ }
+
+ groupArea.alignmentInProcess = false;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// One of the chart areas was zoomed by the user.
+ /// </summary>
+ /// <param name="changedArea">Changed chart area.</param>
+ /// <param name="orientation">Orientation of the changed scaleView.</param>
+ /// <param name="disposeBufferBitmap">Area double fuffer image must be disposed.</param>
+ internal void AlignChartAreasZoomed(ChartArea changedArea, AreaAlignmentOrientations orientation, bool disposeBufferBitmap)
+ {
+ // Check if alignment required
+ if(IsAreasAlignmentRequired())
+ {
+ // Loop through all chart areas
+ foreach(ChartArea area in this.ChartAreas)
+ {
+
+ // Check if chart area is visible
+ if(area.Visible)
+
+ {
+ // Get vertical areas alignment group using current area as a master
+ ArrayList alignGroup = GetAlignedAreasGroup(
+ area,
+ AreaAlignmentStyles.AxesView,
+ orientation);
+
+ // Align each area in the group if it contains changed area
+ if(alignGroup.Contains(changedArea))
+ {
+ // Set cursor position for all areas in the group
+ foreach(ChartArea groupArea in alignGroup)
+ {
+ // Clear image buffer
+ if(groupArea.areaBufferBitmap != null && disposeBufferBitmap)
+ {
+ groupArea.areaBufferBitmap.Dispose();
+ groupArea.areaBufferBitmap = null;
+ }
+
+ if(orientation == AreaAlignmentOrientations.Vertical)
+ {
+ groupArea.CursorX.SelectionStart = double.NaN;
+ groupArea.CursorX.SelectionEnd = double.NaN;
+ }
+ if(orientation == AreaAlignmentOrientations.Horizontal)
+ {
+ groupArea.CursorY.SelectionStart = double.NaN;
+ groupArea.CursorY.SelectionEnd = double.NaN;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+#endif //Microsoft_CONTROL
+
+ /// <summary>
+ /// Align chart areas axes views.
+ /// </summary>
+ /// <param name="changedArea">Changed chart area.</param>
+ /// <param name="orientation">Orientation of the changed scaleView.</param>
+ internal void AlignChartAreasAxesView(ChartArea changedArea, AreaAlignmentOrientations orientation)
+ {
+ // Check if alignment required
+ if(IsAreasAlignmentRequired())
+ {
+ // Loop through all chart areas
+ foreach(ChartArea area in this.ChartAreas)
+ {
+
+ // Check if chart area is visible
+ if(area.Visible)
+
+ {
+ // Get vertical areas alignment group using current area as a master
+ ArrayList alignGroup = GetAlignedAreasGroup(
+ area,
+ AreaAlignmentStyles.AxesView,
+ orientation);
+
+ // Align each area in the group if it contains changed area
+ if(alignGroup.Contains(changedArea))
+ {
+ // Set cursor position for all areas in the group
+ foreach(ChartArea groupArea in alignGroup)
+ {
+ groupArea.alignmentInProcess = true;
+
+ if(orientation == AreaAlignmentOrientations.Vertical)
+ {
+ groupArea.AxisX.ScaleView.Position = changedArea.AxisX.ScaleView.Position;
+ groupArea.AxisX.ScaleView.Size = changedArea.AxisX.ScaleView.Size;
+ groupArea.AxisX.ScaleView.SizeType = changedArea.AxisX.ScaleView.SizeType;
+
+ groupArea.AxisX2.ScaleView.Position = changedArea.AxisX2.ScaleView.Position;
+ groupArea.AxisX2.ScaleView.Size = changedArea.AxisX2.ScaleView.Size;
+ groupArea.AxisX2.ScaleView.SizeType = changedArea.AxisX2.ScaleView.SizeType;
+ }
+ if(orientation == AreaAlignmentOrientations.Horizontal)
+ {
+ groupArea.AxisY.ScaleView.Position = changedArea.AxisY.ScaleView.Position;
+ groupArea.AxisY.ScaleView.Size = changedArea.AxisY.ScaleView.Size;
+ groupArea.AxisY.ScaleView.SizeType = changedArea.AxisY.ScaleView.SizeType;
+
+ groupArea.AxisY2.ScaleView.Position = changedArea.AxisY2.ScaleView.Position;
+ groupArea.AxisY2.ScaleView.Size = changedArea.AxisY2.ScaleView.Size;
+ groupArea.AxisY2.ScaleView.SizeType = changedArea.AxisY2.ScaleView.SizeType;
+ }
+
+ groupArea.alignmentInProcess = false;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ #endregion
+
+ #region Helper methods
+
+ /// <summary>
+ /// Inspects the chart dimensions.
+ /// </summary>
+ /// <param name="width">The width.</param>
+ /// <param name="height">The height.</param>
+ internal void InspectChartDimensions(int width, int height)
+ {
+ if (this.Chart.IsDesignMode() && ((width * height) > (100 * 1024 *1024)))
+ {
+ throw new ArgumentException(SR.ExceptionChartOutOfLimits);
+ }
+ if (width < 0)
+ {
+ throw new ArgumentException(SR.ExceptionValueMustBeGreaterThan("Width", "0px"));
+ }
+ if (height < 0)
+ {
+ throw new ArgumentException(SR.ExceptionValueMustBeGreaterThan("Height", "0px"));
+ }
+ }
+
+ /// <summary>
+ /// Loads chart appearance template from file.
+ /// </summary>
+ /// <param name="name">Template file name to load from.</param>
+ public void LoadTemplate(string name)
+ {
+ // Check arguments
+ if (name == null)
+ throw new ArgumentNullException("name");
+
+ // Load template data into the stream
+#if Microsoft_CONTROL
+ Stream stream = new FileStream(name, FileMode.Open, FileAccess.Read);
+#else // Microsoft_CONTROL
+ Stream stream = LoadTemplateData(name);
+#endif // Microsoft_CONTROL
+
+ // Load template from stream
+ LoadTemplate(stream);
+
+ // Close tempate stream
+ stream.Close();
+ }
+
+ /// <summary>
+ /// Loads chart appearance template from stream.
+ /// </summary>
+ /// <param name="stream">Template stream to load from.</param>
+ public void LoadTemplate(Stream stream)
+ {
+ // Check arguments
+ if (stream == null)
+ throw new ArgumentNullException("stream");
+
+ ChartSerializer serializer = (ChartSerializer)this.Common.container.GetService(typeof(ChartSerializer));
+ if (serializer != null)
+ {
+ // Save previous serializer properties
+ string oldSerializableContent = serializer.SerializableContent;
+ string oldNonSerializableContent = serializer.NonSerializableContent;
+ SerializationFormat oldFormat = serializer.Format;
+ bool oldIgnoreUnknownXmlAttributes = serializer.IsUnknownAttributeIgnored;
+ bool oldTemplateMode = serializer.IsTemplateMode;
+
+ // Set serializer properties
+ serializer.Content = SerializationContents.Appearance;
+ serializer.SerializableContent += ",Chart.Titles,Chart.Annotations," +
+ "Chart.Legends,Legend.CellColumns,Legend.CustomItems,LegendItem.Cells," +
+ "Chart.Series,Series.*Style," +
+ "Chart.ChartAreas,ChartArea.Axis*," +
+ "Axis.*Grid,Axis.*TickMark, Axis.*Style," +
+ "Axis.StripLines, Axis.CustomLabels";
+ serializer.Format = SerializationFormat.Xml;
+ serializer.IsUnknownAttributeIgnored = true;
+ serializer.IsTemplateMode = true;
+
+ try
+ {
+ // Load template
+ serializer.Load(stream);
+ }
+ catch (Exception ex)
+ {
+ throw (new InvalidOperationException(ex.Message));
+ }
+ finally
+ {
+ // Restore previous serializer properties
+ serializer.SerializableContent = oldSerializableContent;
+ serializer.NonSerializableContent = oldNonSerializableContent;
+ serializer.Format = oldFormat;
+ serializer.IsUnknownAttributeIgnored = oldIgnoreUnknownXmlAttributes;
+ serializer.IsTemplateMode = oldTemplateMode;
+ }
+ }
+ }
+
+#if !Microsoft_CONTROL
+
+ /// <summary>
+ /// Loads template data from the URL.
+ /// </summary>
+ /// <param name="url">Template URL.</param>
+ /// <returns>Stream with template data or null if error.</returns>
+ private Stream LoadTemplateData(string url)
+ {
+ Debug.Assert(url != null, "LoadTemplateData: handed a null url string");
+
+ Stream dataStream = null;
+
+ // Try to load as relative URL using the Control object
+ if(dataStream == null)
+ {
+ if (this.Common != null &&
+ this.Common.Chart != null &&
+ this.Common.Chart.Page != null)
+ {
+ try
+ {
+ dataStream = new FileStream(
+ this.Common.Chart.Page.MapPath(url),
+ FileMode.Open);
+ }
+ catch (NotSupportedException)
+ {
+ dataStream = null;
+ }
+ catch (SecurityException)
+ {
+ dataStream = null;
+ }
+ catch (FileNotFoundException)
+ {
+ dataStream = null;
+ }
+ catch (DirectoryNotFoundException)
+ {
+ dataStream = null;
+ }
+ catch (PathTooLongException)
+ {
+ dataStream = null;
+ }
+ }
+ }
+
+ // Try to load image using the Web Request
+ if(dataStream == null)
+ {
+ Uri templateUri = null;
+ try
+ {
+ // Try to create URI directly from template URL (will work in case of absolute URL)
+ templateUri = new Uri(url);
+ }
+ catch (UriFormatException)
+ {
+ templateUri = null;
+ }
+
+ // Make absolute URL using web form document URL
+ if(templateUri == null)
+ {
+ if (this.Common != null && this.Common.Chart != null)
+ {
+ string webFormUrl = this.Common.Chart.webFormDocumentURL;
+ int slashIndex = webFormUrl.LastIndexOf('/');
+ if(slashIndex != -1)
+ {
+ webFormUrl = webFormUrl.Substring(0, slashIndex + 1);
+ }
+
+ try
+ {
+ templateUri = new Uri(new Uri(webFormUrl), url);
+ }
+ catch (UriFormatException)
+ {
+ templateUri = null;
+ }
+ }
+ }
+
+ // Load image from file or web resource
+ if(templateUri != null)
+ {
+ try
+ {
+ WebRequest request = WebRequest.Create(templateUri);
+ dataStream = request.GetResponse().GetResponseStream();
+ }
+ catch (NotSupportedException)
+ {
+ dataStream = null;
+ }
+ catch (NotImplementedException)
+ {
+ dataStream = null;
+ }
+ catch (SecurityException)
+ {
+ dataStream = null;
+ }
+ }
+ }
+
+ // Try to load as file
+ if(dataStream == null)
+ {
+ dataStream = new FileStream(url, FileMode.Open);
+ }
+
+ return dataStream;
+ }
+
+#endif // Microsoft_CONTROL
+
+
+
+#if !Microsoft_CONTROL
+
+
+ /// <summary>
+ /// Writes chart map tag into the stream.
+ /// </summary>
+ /// <param name="output">Html writer to output the data to.</param>
+ /// <param name="mapName">Chart map name.</param>
+ internal void WriteChartMapTag(HtmlTextWriter output, string mapName)
+ {
+ output.WriteLine();
+ output.AddAttribute(HtmlTextWriterAttribute.Name, mapName);
+ output.AddAttribute(HtmlTextWriterAttribute.Id, mapName);
+ output.RenderBeginTag(HtmlTextWriterTag.Map);
+
+ //****************************************************
+ //** Fire map areas customize event
+ //****************************************************
+
+ // Make sure only non-custom items are passed into the event handler
+ MapAreasCollection custCollection = new MapAreasCollection();
+
+ // Move all non-custom items
+ for (int index = 0; index < _mapAreas.Count; index++)
+ {
+ if (!_mapAreas[index].IsCustom)
+ {
+ custCollection.Add(_mapAreas[index]);
+ _mapAreas.RemoveAt(index);
+ --index;
+ }
+ }
+
+ // Call a notification event, so that area items collection can be modified by user
+ Common.Chart.CallOnCustomizeMapAreas(custCollection);
+
+ // Add customized items
+ foreach(MapArea area in custCollection)
+ {
+ area.IsCustom = false;
+ _mapAreas.Add(area);
+ }
+
+ //****************************************************
+ //** Add all map areas
+ //****************************************************
+ foreach (MapArea area in _mapAreas)
+ {
+ area.RenderTag(output, this.Common.Chart);
+ }
+ // if this procedure is enforced to run the image maps have to have at least one map area.
+ if (_mapAreas.Count == 0)
+ {
+ output.Write("<area shape=\"rect\" coords=\"0,0,0,0\" alt=\"\" />");
+ }
+
+ //****************************************************
+ //** End of the map
+ //****************************************************
+ output.RenderEndTag();
+
+ return;
+ }
+
+#endif
+
+ /// <summary>
+ /// Returns the default title from Titles collection.
+ /// </summary>
+ /// <param name="create">Create title if it doesn't exists.</param>
+ /// <returns>Default title.</returns>
+ internal Title GetDefaultTitle(bool create)
+ {
+ // Check if default title exists
+ Title defaultTitle = null;
+ foreach(Title title in this.Titles)
+ {
+ if(title.Name == "Default Title")
+ {
+ defaultTitle = title;
+ }
+ }
+
+ // Create new default title
+ if(defaultTitle == null && create)
+ {
+ defaultTitle = new Title();
+ defaultTitle.Name = "Default Title";
+ this.Titles.Insert(0, defaultTitle);
+ }
+
+ return defaultTitle;
+ }
+
+ /// <summary>
+ /// Checks if tooltips are enabled
+ /// </summary>
+ /// <returns>true if tooltips enabled</returns>
+ private bool IsToolTipsEnabled()
+ {
+
+ // Data series loop
+ foreach( Series series in Common.DataManager.Series )
+ {
+ // Check series tooltips
+ if( series.ToolTip.Length > 0)
+ {
+ // ToolTips enabled
+ return true;
+ }
+
+ // Check series tooltips
+ if( series.LegendToolTip.Length > 0 ||
+ series.LabelToolTip.Length > 0)
+ {
+ // ToolTips enabled
+ return true;
+ }
+
+ // Check point tooltips only for "non-Fast" chart types
+ if( !series.IsFastChartType() )
+ {
+ // Data point loop
+ foreach( DataPoint point in series.Points )
+ {
+ // ToolTip empty
+ if( point.ToolTip.Length > 0)
+ {
+ // ToolTips enabled
+ return true;
+ }
+ // ToolTip empty
+ if( point.LegendToolTip.Length > 0 ||
+ point.LabelToolTip.Length > 0)
+ {
+ // ToolTips enabled
+ return true;
+ }
+ }
+ }
+ }
+
+ // Legend items loop
+ foreach( Legend legend in Legends )
+ {
+ foreach( LegendItem legendItem in legend.CustomItems )
+ {
+ // ToolTip empty
+ if( legendItem.ToolTip.Length > 0 )
+ {
+ return true;
+ }
+ }
+ }
+
+ // Title items loop
+ foreach( Title title in Titles )
+ {
+ // ToolTip empty
+ if( title.ToolTip.Length > 0 )
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ #endregion
+
+ #region IDisposable Members
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ // Dispose managed resources
+ if (ChartGraph != null)
+ {
+ ChartGraph.Dispose();
+ ChartGraph = null;
+ }
+ if (_legends != null)
+ {
+ _legends.Dispose();
+ _legends = null;
+ }
+ if (_titles != null)
+ {
+ _titles.Dispose();
+ _titles = null;
+ }
+ if (_chartAreas != null)
+ {
+ _chartAreas.Dispose();
+ _chartAreas = null;
+ }
+ if (_annotations != null)
+ {
+ _annotations.Dispose();
+ _annotations = null;
+ }
+ if (hotRegionsList != null)
+ {
+ hotRegionsList.Dispose();
+ hotRegionsList = null;
+ }
+ if (_fontCache != null)
+ {
+ _fontCache.Dispose();
+ _fontCache = null;
+ }
+ if (_borderSkin != null)
+ {
+ _borderSkin.Dispose();
+ _borderSkin = null;
+ }
+#if ! Microsoft_CONTROL
+ if (_mapAreas != null)
+ {
+ _mapAreas.Dispose();
+ _mapAreas = null;
+ }
+#endif
+
+#if Microsoft_CONTROL
+ if (nonTopLevelChartBuffer != null)
+ {
+ nonTopLevelChartBuffer.Dispose();
+ nonTopLevelChartBuffer = null;
+ }
+#endif
+ }
+ base.Dispose(disposing);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Event arguments of Chart paint event.
+ /// </summary>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class ChartPaintEventArgs : EventArgs
+ {
+ #region Fields
+
+ // Private fields
+ private object _chartElement = null;
+ private ChartGraphics _chartGraph = null;
+ private CommonElements _common = null;
+ private Chart _chart = null;
+ private ElementPosition _position = null;
+
+ #endregion
+
+ #region Properties
+
+
+ /// <summary>
+ /// Gets the chart element of the event.
+ /// </summary>
+ /// <value>The chart element.</value>
+ public object ChartElement
+ {
+ get
+ {
+ return _chartElement;
+ }
+ }
+
+
+ /// <summary>
+ /// Gets the ChartGraphics object of the event.
+ /// </summary>
+ public ChartGraphics ChartGraphics
+ {
+ get
+ {
+ return _chartGraph;
+ }
+ }
+
+ /// <summary>
+ /// Chart Common elements.
+ /// </summary>
+ internal CommonElements CommonElements
+ {
+ get
+ {
+ return _common;
+ }
+ }
+
+ /// <summary>
+ /// Chart element position in relative coordinates of the event.
+ /// </summary>
+ public ElementPosition Position
+ {
+ get
+ {
+ return _position;
+ }
+ }
+
+ /// <summary>
+ /// Chart object of the event.
+ /// </summary>
+ public Chart Chart
+ {
+ get
+ {
+ if (_chart == null && _common != null)
+ {
+ _chart = _common.Chart;
+ }
+
+ return _chart;
+ }
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Default constructor is not accessible
+ /// </summary>
+ private ChartPaintEventArgs()
+ {
+ }
+
+ /// <summary>
+ /// Paint event arguments constructor.
+ /// </summary>
+ /// <param name="chartElement">Chart element.</param>
+ /// <param name="chartGraph">Chart graphics.</param>
+ /// <param name="common">Common elements.</param>
+ /// <param name="position">Position.</param>
+ internal ChartPaintEventArgs(object chartElement, ChartGraphics chartGraph, CommonElements common, ElementPosition position)
+ {
+ this._chartElement = chartElement;
+ this._chartGraph = chartGraph;
+ this._common = common;
+ this._position = position;
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Event arguments of localized numbers formatting event.
+ /// </summary>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class FormatNumberEventArgs : EventArgs
+ {
+ #region Fields
+
+ // Private fields
+ private double _value;
+ private string _format;
+ private string _localizedValue;
+ private ChartValueType _valueType = ChartValueType.Auto;
+ private object _senderTag;
+ private ChartElementType _elementType = ChartElementType.Nothing;
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Value to be formatted.
+ /// </summary>
+ public double Value
+ {
+ get { return this._value; }
+ }
+
+ /// <summary>
+ /// Localized text.
+ /// </summary>
+ public string LocalizedValue
+ {
+ get { return _localizedValue; }
+ set { _localizedValue = value; }
+ }
+
+ /// <summary>
+ /// Format string.
+ /// </summary>
+ public string Format
+ {
+ get { return _format; }
+ }
+
+ /// <summary>
+ /// Value type.
+ /// </summary>
+ public ChartValueType ValueType
+ {
+ get { return _valueType; }
+ }
+
+ /// <summary>
+ /// The sender object of the event.
+ /// </summary>
+ public object SenderTag
+ {
+ get { return _senderTag; }
+ }
+
+ /// <summary>
+ /// Chart element type.
+ /// </summary>
+ public ChartElementType ElementType
+ {
+ get { return _elementType; }
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Default constructor is not accessible
+ /// </summary>
+ private FormatNumberEventArgs()
+ {
+ }
+
+ /// <summary>
+ /// Object constructor.
+ /// </summary>
+ /// <param name="value">Value to be formatted.</param>
+ /// <param name="format">Format string.</param>
+ /// <param name="valueType">Value type..</param>
+ /// <param name="localizedValue">Localized value.</param>
+ /// <param name="senderTag">Chart element object tag.</param>
+ /// <param name="elementType">Chart element type.</param>
+ internal FormatNumberEventArgs(double value, string format, ChartValueType valueType, string localizedValue, object senderTag, ChartElementType elementType)
+ {
+ this._value = value;
+ this._format = format;
+ this._valueType = valueType;
+ this._localizedValue = localizedValue;
+ this._senderTag = senderTag;
+ this._elementType = elementType;
+ }
+
+ #endregion
+ }
+
+ #region FontCache
+ /// <summary>
+ /// Font cache class helps ChartElements to reuse the Font instances
+ /// </summary>
+ internal class FontCache : IDisposable
+ {
+ #region Static
+
+ // Default font family name
+ private static string _defaultFamilyName;
+
+ /// <summary>
+ /// Gets the default font family name.
+ /// </summary>
+ /// <value>The default font family name.</value>
+ public static string DefaultFamilyName
+ {
+ get
+ {
+ if (_defaultFamilyName == null)
+ {
+ // Find the "Microsoft Sans Serif" font
+ foreach (FontFamily fontFamily in FontFamily.Families)
+ {
+ if (fontFamily.Name == "Microsoft Sans Serif")
+ {
+ _defaultFamilyName = fontFamily.Name;
+ break;
+ }
+ }
+ // Not found - use the default Sans Serif font
+ if (_defaultFamilyName == null)
+ {
+ _defaultFamilyName = FontFamily.GenericSansSerif.Name;
+ }
+ }
+ return _defaultFamilyName;
+ }
+ }
+ #endregion
+
+ #region Fields
+
+ // Cached fonts dictionary
+ private Dictionary<KeyInfo, Font> _fontCache = new Dictionary<KeyInfo, Font>(new KeyInfo.EqualityComparer());
+
+ #endregion // Fields
+
+ #region Properties
+ /// <summary>
+ /// Gets the default font.
+ /// </summary>
+ /// <value>The default font.</value>
+ public Font DefaultFont
+ {
+ get { return this.GetFont(DefaultFamilyName, 8); }
+ }
+
+ /// <summary>
+ /// Gets the default font.
+ /// </summary>
+ /// <value>The default font.</value>
+ public Font DefaultBoldFont
+ {
+ get { return this.GetFont(DefaultFamilyName, 8, FontStyle.Bold); }
+ }
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Gets the font.
+ /// </summary>
+ /// <param name="familyName">Name of the family.</param>
+ /// <param name="size">The size.</param>
+ /// <returns>Font instance</returns>
+ public Font GetFont(string familyName, int size)
+ {
+ KeyInfo key = new KeyInfo(familyName, size);
+ if (!this._fontCache.ContainsKey(key))
+ {
+ this._fontCache.Add(key, new Font(familyName, size));
+ }
+ return this._fontCache[key];
+ }
+
+ /// <summary>
+ /// Gets the font.
+ /// </summary>
+ /// <param name="familyName">Name of the family.</param>
+ /// <param name="size">The size.</param>
+ /// <param name="style">The style.</param>
+ /// <returns>Font instance</returns>
+ public Font GetFont(string familyName, float size, FontStyle style)
+ {
+ KeyInfo key = new KeyInfo(familyName, size, style);
+ if (!this._fontCache.ContainsKey(key))
+ {
+ this._fontCache.Add(key, new Font(familyName, size, style));
+ }
+ return this._fontCache[key];
+ }
+
+ /// <summary>
+ /// Gets the font.
+ /// </summary>
+ /// <param name="family">The family.</param>
+ /// <param name="size">The size.</param>
+ /// <param name="style">The style.</param>
+ /// <returns>Font instance</returns>
+ public Font GetFont(FontFamily family, float size, FontStyle style)
+ {
+ KeyInfo key = new KeyInfo(family, size, style);
+ if (!this._fontCache.ContainsKey(key))
+ {
+ this._fontCache.Add(key, new Font(family, size, style));
+ }
+ return this._fontCache[key];
+ }
+
+ /// <summary>
+ /// Gets the font.
+ /// </summary>
+ /// <param name="family">The family.</param>
+ /// <param name="size">The size.</param>
+ /// <param name="style">The style.</param>
+ /// <param name="unit">The unit.</param>
+ /// <returns>Font instance</returns>
+ public Font GetFont(FontFamily family, float size, FontStyle style, GraphicsUnit unit)
+ {
+ KeyInfo key = new KeyInfo(family, size, style, unit);
+ if (!this._fontCache.ContainsKey(key))
+ {
+ this._fontCache.Add(key, new Font(family, size, style, unit));
+ }
+ return this._fontCache[key];
+ }
+
+ #endregion
+
+ #region IDisposable Members
+
+ /// <summary>
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// </summary>
+ public void Dispose()
+ {
+ foreach (Font font in _fontCache.Values)
+ {
+ font.Dispose();
+ }
+ _fontCache.Clear();
+ GC.SuppressFinalize(this);
+ }
+
+ #endregion
+
+ #region FontKeyInfo struct
+ /// <summary>
+ /// Font key info
+ /// </summary>
+ private class KeyInfo
+ {
+ string _familyName;
+ float _size = 8;
+ GraphicsUnit _unit = GraphicsUnit.Point;
+ FontStyle _style = FontStyle.Regular;
+ int _gdiCharSet = 1;
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="KeyInfo"/> class.
+ /// </summary>
+ /// <param name="familyName">Name of the family.</param>
+ /// <param name="size">The size.</param>
+ public KeyInfo(string familyName, float size)
+ {
+ this._familyName = familyName;
+ this._size = size;
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="KeyInfo"/> class.
+ /// </summary>
+ /// <param name="familyName">Name of the family.</param>
+ /// <param name="size">The size.</param>
+ /// <param name="style">The style.</param>
+ public KeyInfo(string familyName, float size, FontStyle style)
+ {
+ this._familyName = familyName;
+ this._size = size;
+ this._style = style;
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="KeyInfo"/> class.
+ /// </summary>
+ /// <param name="family">The family.</param>
+ /// <param name="size">The size.</param>
+ /// <param name="style">The style.</param>
+ public KeyInfo(FontFamily family, float size, FontStyle style)
+ {
+ this._familyName = family.ToString();
+ this._size = size;
+ this._style = style;
+ }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="KeyInfo"/> class.
+ /// </summary>
+ /// <param name="family">The family.</param>
+ /// <param name="size">The size.</param>
+ /// <param name="style">The style.</param>
+ /// <param name="unit">The unit.</param>
+ public KeyInfo(FontFamily family, float size, FontStyle style, GraphicsUnit unit)
+ {
+ this._familyName = family.ToString();
+ this._size = size;
+ this._style = style;
+ this._unit = unit;
+ }
+
+ #region IEquatable<FontKeyInfo> Members
+ /// <summary>
+ /// KeyInfo equality comparer
+ /// </summary>
+ internal class EqualityComparer : IEqualityComparer<KeyInfo>
+ {
+ /// <summary>
+ /// Determines whether the specified objects are equal.
+ /// </summary>
+ /// <param name="x">The first object of type <paramref name="x"/> to compare.</param>
+ /// <param name="y">The second object of type <paramref name="y"/> to compare.</param>
+ /// <returns>
+ /// true if the specified objects are equal; otherwise, false.
+ /// </returns>
+ public bool Equals(KeyInfo x, KeyInfo y)
+ {
+ return
+ x._size == y._size &&
+ x._familyName == y._familyName &&
+ x._unit == y._unit &&
+ x._style == y._style &&
+ x._gdiCharSet == y._gdiCharSet;
+ }
+
+ /// <summary>
+ /// Returns a hash code for the specified object.
+ /// </summary>
+ /// <param name="obj">The <see cref="T:System.Object"/> for which a hash code is to be returned.</param>
+ /// <returns>A hash code for the specified object.</returns>
+ /// <exception cref="T:System.ArgumentNullException">The type of <paramref name="obj"/> is a reference type and <paramref name="obj"/> is null.</exception>
+ public int GetHashCode(KeyInfo obj)
+ {
+ return obj._familyName.GetHashCode() ^ obj._size.GetHashCode();
+ }
+ }
+ #endregion
+ }
+ #endregion
+ }
+ #endregion
+
+
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartArea.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartArea.cs
new file mode 100644
index 00000000000..86b909780d4
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartArea.cs
@@ -0,0 +1,3157 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: ChartArea.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: ChartArea
+//
+// Purpose: The ChartArea class represents one chart area within
+// a chart image, and is used to plot one or more chart
+// series. The number of chart series that can be plotted
+// in a chart area is unlimited.
+//
+// Reviewed: GS - August 6, 2002
+// AG - August 7, 2002
+// AG - Microsoft 16, 2007
+//
+//===================================================================
+
+#region Used namespaces
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Drawing2D;
+using System.Globalization;
+using System.Diagnostics.CodeAnalysis;
+
+#if Microsoft_CONTROL
+
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.ComponentModel.Design.Serialization;
+ using System.Reflection;
+ using System.Windows.Forms.Design;
+#else
+ using System.Web;
+ using System.Web.UI;
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+ using System.Web.UI.DataVisualization.Charting.Borders3D;
+#endif
+
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+#endif
+{
+ #region Chart area aligment enumerations
+
+ /// <summary>
+ /// An enumeration of the alignment orientations of a ChartArea
+ /// </summary>
+ [Flags]
+ public enum AreaAlignmentOrientations
+ {
+ /// <summary>
+ /// Chart areas are not automatically aligned.
+ /// </summary>
+ None = 0,
+
+ /// <summary>
+ /// Chart areas are aligned vertically.
+ /// </summary>
+ Vertical = 1,
+
+ /// <summary>
+ /// Chart areas are aligned horizontally.
+ /// </summary>
+ Horizontal = 2,
+
+ /// <summary>
+ /// Chart areas are aligned using all values (horizontally and vertically).
+ /// </summary>
+ All = Vertical | Horizontal
+ }
+
+ /// <summary>
+ /// An enumeration of the alignment styles of a ChartArea
+ /// </summary>
+ [Flags]
+ public enum AreaAlignmentStyles
+ {
+ /// <summary>
+ /// Chart areas are not automatically aligned.
+ /// </summary>
+ None = 0,
+
+ /// <summary>
+ /// Chart areas are aligned by positions.
+ /// </summary>
+ Position = 1,
+
+ /// <summary>
+ /// Chart areas are aligned by inner plot positions.
+ /// </summary>
+ PlotPosition = 2,
+
+ /// <summary>
+ /// Chart areas are aligned by axes views.
+ /// </summary>
+ AxesView = 4,
+
+#if Microsoft_CONTROL
+
+ /// <summary>
+ /// Cursor and Selection alignment.
+ /// </summary>
+ Cursor = 8,
+
+ /// <summary>
+ /// Complete alignment.
+ /// </summary>
+ All = Position | PlotPosition | Cursor | AxesView
+#else // Microsoft_CONTROL
+
+ /// <summary>
+ /// Complete alignment.
+ /// </summary>
+ All = Position | PlotPosition | AxesView
+
+#endif // Microsoft_CONTROL
+ }
+
+ #endregion
+
+ /// <summary>
+ /// The ChartArea class is used to create and display a chart
+ /// area within a chart image. The chart area is a rectangular
+ /// area on a chart image. It has 4 axes, horizontal and vertical grids.
+ /// A chart area can contain more than one different chart type.
+ /// The number of chart series that can be plotted in a chart area
+ /// is unlimited.
+ ///
+ /// ChartArea class exposes all the properties and methods
+ /// of its base ChartArea3D class.
+ /// </summary>
+ [
+ DefaultProperty("Axes"),
+ SRDescription("DescriptionAttributeChartArea_ChartArea"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public partial class ChartArea : ChartNamedElement
+ {
+ #region Chart Area Fields
+
+ /// <summary>
+ /// Plot area position
+ /// </summary>
+ internal ElementPosition PlotAreaPosition;
+
+ // Private data members, which store properties values
+ private Axis[] _axisArray = new Axis[4];
+ private Color _backColor = Color.Empty;
+ private ChartHatchStyle _backHatchStyle = ChartHatchStyle.None;
+ private string _backImage = "";
+ private ChartImageWrapMode _backImageWrapMode = ChartImageWrapMode.Tile;
+ private Color _backImageTransparentColor = Color.Empty;
+ private ChartImageAlignmentStyle _backImageAlignment = ChartImageAlignmentStyle.TopLeft;
+ private GradientStyle _backGradientStyle = GradientStyle.None;
+ private Color _backSecondaryColor = Color.Empty;
+ private Color _borderColor = Color.Black;
+ private int _borderWidth = 1;
+ private ChartDashStyle _borderDashStyle = ChartDashStyle.NotSet;
+ private int _shadowOffset = 0;
+ private Color _shadowColor = Color.FromArgb(128, 0, 0, 0);
+ private ElementPosition _areaPosition = null;
+ private ElementPosition _innerPlotPosition = null;
+ internal int IterationCounter = 0;
+
+ private bool _isSameFontSizeForAllAxes = false;
+ internal float axesAutoFontSize = 8f;
+
+ private string _alignWithChartArea = Constants.NotSetValue;
+ private AreaAlignmentOrientations _alignmentOrientation = AreaAlignmentOrientations.Vertical;
+ private AreaAlignmentStyles _alignmentStyle = AreaAlignmentStyles.All;
+ private int _circularSectorNumber = int.MinValue;
+ private int _circularUsePolygons = int.MinValue;
+
+ // Flag indicates that chart area is acurrently aligned
+ internal bool alignmentInProcess = false;
+
+ // Chart area position before adjustments
+ internal RectangleF originalAreaPosition = RectangleF.Empty;
+
+ // Chart area inner plot position before adjustments
+ internal RectangleF originalInnerPlotPosition = RectangleF.Empty;
+
+ // Chart area position before adjustments
+ internal RectangleF lastAreaPosition = RectangleF.Empty;
+
+
+ // Center of the circulat chart area
+ internal PointF circularCenter = PointF.Empty;
+
+ private ArrayList _circularAxisList = null;
+
+#if Microsoft_CONTROL
+ // Buffered plotting area image
+ internal Bitmap areaBufferBitmap = null;
+
+ private Cursor _cursorX = new Cursor();
+ private Cursor _cursorY = new Cursor();
+#endif
+
+ // Area SmartLabel class
+ internal SmartLabel smartLabels = new SmartLabel();
+
+ // Gets or sets a flag that specifies whether the chart area is visible.
+ private bool _visible = true;
+
+ #endregion
+
+ #region Chart Area Cursor properties
+
+#if Microsoft_CONTROL
+
+ /// <summary>
+ /// Gets or sets a Cursor object that is used for cursors and selected ranges along the X-axis.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeCursor"),
+ Bindable(true),
+ DefaultValue(null),
+ SRDescription("DescriptionAttributeChartArea_CursorX"),
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+ TypeConverter(typeof(NoNameExpandableObjectConverter)),
+ ]
+ public Cursor CursorX
+ {
+ get
+ {
+ return _cursorX;
+ }
+ set
+ {
+ _cursorX = value;
+
+ // Initialize chart object
+ _cursorX.Initialize(this, AxisName.X);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a Cursor object that is used for cursors and selected ranges along the Y-axis.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeCursor"),
+ Bindable(true),
+ DefaultValue(null),
+ SRDescription("DescriptionAttributeChartArea_CursorY"),
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+ TypeConverter(typeof(NoNameExpandableObjectConverter)),
+ ]
+ public Cursor CursorY
+ {
+ get
+ {
+ return _cursorY;
+ }
+ set
+ {
+ _cursorY = value;
+
+ // Initialize chart object
+ _cursorY.Initialize(this, AxisName.Y);
+ }
+ }
+
+#endif // Microsoft_CONTROL
+
+ #endregion
+
+ #region Chart Area properties
+
+ /// <summary>
+ /// Gets or sets a flag that specifies whether the chart area is visible.
+ /// </summary>
+ /// <remarks>
+ /// When this flag is set to false, all series, legends, titles and annotation objects
+ /// associated with the chart area will also be hidden.
+ /// </remarks>
+ /// <value>
+ /// <b>True</b> if the chart area is visible; <b>false</b> otherwise.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeChartArea_Visible"),
+ ParenthesizePropertyNameAttribute(true),
+ ]
+ virtual public bool Visible
+ {
+ get
+ {
+ return _visible;
+ }
+ set
+ {
+ _visible = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the name of the ChartArea object to which this chart area should be aligned.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAlignment"),
+ Bindable(true),
+ DefaultValue(Constants.NotSetValue),
+ SRDescription("DescriptionAttributeChartArea_AlignWithChartArea"),
+ TypeConverter(typeof(LegendAreaNameConverter)),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public string AlignWithChartArea
+ {
+ get
+ {
+ return _alignWithChartArea;
+ }
+ set
+ {
+ if (value != _alignWithChartArea)
+ {
+ if (String.IsNullOrEmpty(value))
+ {
+ _alignWithChartArea = Constants.NotSetValue;
+ }
+ else
+ {
+ if (Chart != null && Chart.ChartAreas != null)
+ {
+ Chart.ChartAreas.VerifyNameReference(value);
+ }
+ _alignWithChartArea = value;
+ }
+ Invalidate();
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the alignment orientation of a chart area.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAlignment"),
+ Bindable(true),
+ DefaultValue(AreaAlignmentOrientations.Vertical),
+ SRDescription("DescriptionAttributeChartArea_AlignOrientation"),
+ Editor(Editors.FlagsEnumUITypeEditor.Editor, Editors.FlagsEnumUITypeEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public AreaAlignmentOrientations AlignmentOrientation
+ {
+ get
+ {
+ return _alignmentOrientation;
+ }
+ set
+ {
+ _alignmentOrientation = value;
+ Invalidate();
+ }
+ }
+
+
+ /// <summary>
+ /// Gets or sets the alignment style of the ChartArea.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAlignment"),
+ Bindable(true),
+ DefaultValue(AreaAlignmentStyles.All),
+ SRDescription("DescriptionAttributeChartArea_AlignType"),
+ Editor(Editors.FlagsEnumUITypeEditor.Editor, Editors.FlagsEnumUITypeEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public AreaAlignmentStyles AlignmentStyle
+ {
+ get
+ {
+ return _alignmentStyle;
+ }
+ set
+ {
+ _alignmentStyle = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an array that represents all axes for a chart area.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxes"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeChartArea_Axes"),
+ TypeConverter(typeof(AxesArrayConverter)),
+ Editor(Editors.AxesArrayEditor.Editor, Editors.AxesArrayEditor.Base),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden)
+ ]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
+ public Axis[] Axes
+ {
+ get
+ {
+ return _axisArray;
+ }
+ set
+ {
+ AxisX = value[0];
+ AxisY = value[1];
+ AxisX2 = value[2];
+ AxisY2 = value[3];
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Avoid serialization of the axes array
+ /// </summary>
+ [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+ internal bool ShouldSerializeAxes()
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// Gets or sets an Axis object that represents the primary Y-axis.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxis"),
+ Bindable(true),
+ Browsable(false),
+ SRDescription("DescriptionAttributeChartArea_AxisY"),
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ TypeConverter(typeof(NoNameExpandableObjectConverter))
+ ]
+ public Axis AxisY
+ {
+ get
+ {
+ return axisY;
+ }
+ set
+ {
+ axisY = value;
+ axisY.Initialize(this, AxisName.Y);
+ _axisArray[1] = axisY;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an Axis object that represents the primary X-axis.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxis"),
+ Bindable(true),
+ Browsable(false),
+ SRDescription("DescriptionAttributeChartArea_AxisX"),
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ TypeConverter(typeof(NoNameExpandableObjectConverter))
+ ]
+ public Axis AxisX
+ {
+ get
+ {
+ return axisX;
+ }
+ set
+ {
+ axisX = value;
+ axisX.Initialize(this, AxisName.X);
+ _axisArray[0] = axisX;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an Axis object that represents the secondary X-axis.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxis"),
+ Bindable(true),
+ Browsable(false),
+ SRDescription("DescriptionAttributeChartArea_AxisX2"),
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ TypeConverter(typeof(NoNameExpandableObjectConverter))
+ ]
+ public Axis AxisX2
+ {
+ get
+ {
+ return axisX2;
+ }
+ set
+ {
+ axisX2 = value;
+ axisX2.Initialize(this, AxisName.X2);
+ _axisArray[2] = axisX2;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an Axis object that represents the secondary Y-axis.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxis"),
+ Bindable(true),
+ Browsable(false),
+ SRDescription("DescriptionAttributeChartArea_AxisY2"),
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ TypeConverter(typeof(NoNameExpandableObjectConverter))
+ ]
+ public Axis AxisY2
+ {
+ get
+ {
+ return axisY2;
+ }
+ set
+ {
+ axisY2 = value;
+ axisY2.Initialize(this, AxisName.Y2);
+ _axisArray[3] = axisY2;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets an ElementPosition object, which defines the position of a chart area object within the chart image.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeChartArea_Position"),
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ElementPositionConverter)),
+ SerializationVisibilityAttribute(SerializationVisibility.Element)
+ ]
+ public ElementPosition Position
+ {
+ get
+ {
+ // Serialize only position values if Auto set to false
+ if(this.Chart != null && this.Chart.serializationStatus == SerializationStatus.Saving )
+ {
+ if(_areaPosition.Auto)
+ {
+ return new ElementPosition();
+ }
+ else
+ {
+ ElementPosition newPosition = new ElementPosition();
+#if Microsoft_CONTROL
+ newPosition.Auto = false;
+#else
+ newPosition.Auto = true;
+#endif
+ newPosition.SetPositionNoAuto(_areaPosition.X, _areaPosition.Y, _areaPosition.Width, _areaPosition.Height);
+ return newPosition;
+ }
+ }
+ return _areaPosition;
+ }
+ set
+ {
+ _areaPosition = value;
+ _areaPosition.Parent = this;
+ _areaPosition.resetAreaAutoPosition = true;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Determoines if this position should be serialized.
+ /// </summary>
+ /// <returns></returns>
+ internal bool ShouldSerializePosition()
+ {
+ return !this.Position.Auto;
+ }
+
+ /// <summary>
+ /// Gets or sets an ElementPosition object, which defines the inner plot position of a chart area object.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeChartArea_InnerPlotPosition"),
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ElementPositionConverter)),
+ SerializationVisibilityAttribute(SerializationVisibility.Element)
+ ]
+ public ElementPosition InnerPlotPosition
+ {
+ get
+ {
+ // Serialize only position values if Auto set to false
+ if (this.Common != null && this.Common.Chart != null && this.Common.Chart.serializationStatus == SerializationStatus.Saving)
+ {
+ if(_innerPlotPosition.Auto)
+ {
+ return new ElementPosition();
+ }
+ else
+ {
+ ElementPosition newPosition = new ElementPosition();
+#if Microsoft_CONTROL
+ newPosition.Auto = false;
+#else
+ newPosition.Auto = true;
+#endif
+ newPosition.SetPositionNoAuto(_innerPlotPosition.X, _innerPlotPosition.Y, _innerPlotPosition.Width, _innerPlotPosition.Height);
+ return newPosition;
+ }
+ }
+ return _innerPlotPosition;
+ }
+ set
+ {
+ _innerPlotPosition = value;
+ _innerPlotPosition.Parent = this;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Determoines if this position should be serialized.
+ /// </summary>
+ /// <returns></returns>
+ internal bool ShouldSerializeInnerPlotPosition()
+ {
+ return !this.InnerPlotPosition.Auto;
+ }
+
+ /// <summary>
+ /// Gets or sets the background color of a ChartArea object.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeBackColor"),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BackColor
+ {
+ get
+ {
+ return _backColor;
+ }
+ set
+ {
+ _backColor = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the hatching style of a ChartArea object.
+ /// </summary>
+ [
+
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartHatchStyle.None),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackHatchStyle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ Editor(Editors.HatchStyleEditor.Editor, Editors.HatchStyleEditor.Base)
+
+ ]
+ public ChartHatchStyle BackHatchStyle
+ {
+ get
+ {
+ return _backHatchStyle;
+ }
+ set
+ {
+ _backHatchStyle = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background image of a ChartArea object.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeBackImage"),
+ Editor(Editors.ImageValueEditor.Editor, Editors.ImageValueEditor.Base),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+#endif
+ NotifyParentPropertyAttribute(true)
+ ]
+ public string BackImage
+ {
+ get
+ {
+ return _backImage;
+ }
+ set
+ {
+ _backImage = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the drawing mode of the background image of a ChartArea object.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartImageWrapMode.Tile),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeImageWrapMode"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public ChartImageWrapMode BackImageWrapMode
+ {
+ get
+ {
+ return _backImageWrapMode;
+ }
+ set
+ {
+ _backImageWrapMode = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the color of a ChartArea object's background image that will be drawn as transparent.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeImageTransparentColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BackImageTransparentColor
+ {
+ get
+ {
+ return _backImageTransparentColor;
+ }
+ set
+ {
+ _backImageTransparentColor = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the alignment of a ChartArea object.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartImageAlignmentStyle.TopLeft),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackImageAlign"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public ChartImageAlignmentStyle BackImageAlignment
+ {
+ get
+ {
+ return _backImageAlignment;
+ }
+ set
+ {
+ _backImageAlignment = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the orientation of a chart element's gradient,
+ /// and also determines whether or not a gradient is used.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(GradientStyle.None),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackGradientStyle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ Editor(Editors.GradientEditor.Editor, Editors.GradientEditor.Base)
+ ]
+ public GradientStyle BackGradientStyle
+ {
+ get
+ {
+ return _backGradientStyle;
+ }
+ set
+ {
+ _backGradientStyle = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the secondary color of a ChartArea object.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackSecondaryColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BackSecondaryColor
+ {
+ get
+ {
+ return _backSecondaryColor;
+ }
+ set
+ {
+ _backSecondaryColor = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the shadow color of a ChartArea object.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), "128,0,0,0"),
+ SRDescription("DescriptionAttributeShadowColor"),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color ShadowColor
+ {
+ get
+ {
+ return _shadowColor;
+ }
+ set
+ {
+ _shadowColor = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the shadow offset (in pixels) of a ChartArea object.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(0),
+ SRDescription("DescriptionAttributeShadowOffset"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public int ShadowOffset
+ {
+ get
+ {
+ return _shadowOffset;
+ }
+ set
+ {
+ _shadowOffset = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the border color of a ChartArea object.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeBorderColor"),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BorderColor
+ {
+ get
+ {
+ return _borderColor;
+ }
+ set
+ {
+ _borderColor = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the border width of a ChartArea object.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(1),
+ SRDescription("DescriptionAttributeBorderWidth"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public int BorderWidth
+ {
+ get
+ {
+ return _borderWidth;
+ }
+ set
+ {
+ if(value < 0)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionBorderWidthIsNegative));
+ }
+ _borderWidth = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the style of the border line of a ChartArea object.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartDashStyle.NotSet),
+ SRDescription("DescriptionAttributeBorderDashStyle"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public ChartDashStyle BorderDashStyle
+ {
+ get
+ {
+ return _borderDashStyle;
+ }
+ set
+ {
+ _borderDashStyle = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the unique name of a ChartArea object.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeChartArea_Name"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public override string Name
+ {
+ get
+ {
+ return base.Name;
+ }
+ set
+ {
+ base.Name = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a Boolean that determines if the labels of the axes for all chart area
+ /// , which have LabelsAutoFit property set to true, are of equal size.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeChartArea_EquallySizedAxesFont"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public bool IsSameFontSizeForAllAxes
+ {
+ get
+ {
+ return _isSameFontSizeForAllAxes;
+ }
+ set
+ {
+ _isSameFontSizeForAllAxes = value;
+ Invalidate();
+ }
+ }
+
+
+ #endregion
+
+ #region Constructors
+ /// <summary>
+ /// ChartArea constructor.
+ /// </summary>
+ public ChartArea()
+ {
+ Initialize();
+ }
+
+ /// <summary>
+ /// ChartArea constructor.
+ /// </summary>
+ /// <param name="name">The name.</param>
+ public ChartArea(string name) : base(name)
+ {
+ Initialize();
+ }
+ #endregion
+
+ #region Chart Area Methods
+ /// <summary>
+ /// Restores series order and X axis reversed mode for the 3D charts.
+ /// </summary>
+ internal void Restore3DAnglesAndReverseMode()
+ {
+ if(this.Area3DStyle.Enable3D && !this.chartAreaIsCurcular)
+ {
+ // Restore axis "IsReversed" property and old Y angle
+ this.AxisX.IsReversed = oldReverseX;
+ this.AxisX2.IsReversed = oldReverseX;
+ this.AxisY.IsReversed = oldReverseY;
+ this.AxisY2.IsReversed = oldReverseY;
+ this.Area3DStyle.Rotation = oldYAngle;
+ }
+ }
+
+ /// <summary>
+ /// Sets series order and X axis reversed mode for the 3D charts.
+ /// </summary>
+ internal void Set3DAnglesAndReverseMode()
+ {
+ // Clear series reversed flag
+ _reverseSeriesOrder = false;
+
+ // If 3D charting is enabled
+ if(this.Area3DStyle.Enable3D)
+ {
+ // Make sure primary & secondary axis has the same IsReversed settings
+ // This is a limitation for the 3D chart required for labels drawing.
+ this.AxisX2.IsReversed = this.AxisX.IsReversed;
+ this.AxisY2.IsReversed = this.AxisY.IsReversed;
+
+ // Remember reversed order of X & Y axis and Angles
+ oldReverseX = this.AxisX.IsReversed;
+ oldReverseY = this.AxisY.IsReversed;
+ oldYAngle = this.Area3DStyle.Rotation;
+
+ // Check if Y angle
+ if(this.Area3DStyle.Rotation > 90 || this.Area3DStyle.Rotation < -90)
+ {
+ // This method depends on the 'switchValueAxes' field which is calculated based on the chart types
+ // of the series associated with the chart area. We need to call SetData method to make sure this field
+ // is correctly initialized. Because we only need to collect information about the series, we pass 'false'
+ // as parameters to limit the amount of work this function does.
+ this.SetData(false, false);
+
+ // Reversed series order
+ _reverseSeriesOrder = true;
+
+ // Reversed primary and secondary X axis
+ if(!this.switchValueAxes)
+ {
+ this.AxisX.IsReversed = !this.AxisX.IsReversed;
+ this.AxisX2.IsReversed = !this.AxisX2.IsReversed;
+ }
+
+ // Reversed primary and secondary Y axis for chart types like Bar
+ else
+ {
+ this.AxisY.IsReversed = !this.AxisY.IsReversed;
+ this.AxisY2.IsReversed = !this.AxisY2.IsReversed;
+ }
+
+ // Adjust Y angle
+ if(this.Area3DStyle.Rotation > 90)
+ {
+ this.Area3DStyle.Rotation = (this.Area3DStyle.Rotation - 90) - 90;
+ }
+ else if(this.Area3DStyle.Rotation < -90)
+ {
+ this.Area3DStyle.Rotation = (this.Area3DStyle.Rotation + 90) + 90;
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Save all automatic values like Minimum and Maximum.
+ /// </summary>
+ internal void SetTempValues()
+ {
+ // Save non automatic area position
+ if(!this.Position.Auto)
+ {
+ this.originalAreaPosition = this.Position.ToRectangleF();
+ }
+
+ // Save non automatic area inner plot position
+ if(!this.InnerPlotPosition.Auto)
+ {
+ this.originalInnerPlotPosition = this.InnerPlotPosition.ToRectangleF();
+ }
+
+ this._circularSectorNumber = int.MinValue;
+ this._circularUsePolygons = int.MinValue;
+ this._circularAxisList = null;
+
+ // Save Minimum and maximum values for all axes
+ axisX.StoreAxisValues();
+ axisX2.StoreAxisValues();
+ axisY.StoreAxisValues();
+ axisY2.StoreAxisValues();
+ }
+
+ /// <summary>
+ /// Load all automatic values like Minimum and Maximum with original values.
+ /// </summary>
+ internal void GetTempValues()
+ {
+ // Take Minimum and maximum values for all axes
+ axisX.ResetAxisValues();
+ axisX2.ResetAxisValues();
+ axisY.ResetAxisValues();
+ axisY2.ResetAxisValues();
+
+ // Restore non automatic area position
+ if(!this.originalAreaPosition.IsEmpty)
+ {
+ this.lastAreaPosition = this.Position.ToRectangleF();
+ this.Position.SetPositionNoAuto(this.originalAreaPosition.X, this.originalAreaPosition.Y, this.originalAreaPosition.Width, this.originalAreaPosition.Height);
+ this.originalAreaPosition = RectangleF.Empty;
+ }
+
+ // Save non automatic area inner plot position
+ if(!this.originalInnerPlotPosition.IsEmpty)
+ {
+ this.InnerPlotPosition.SetPositionNoAuto(this.originalInnerPlotPosition.X, this.originalInnerPlotPosition.Y, this.originalInnerPlotPosition.Width, this.originalInnerPlotPosition.Height);
+ this.originalInnerPlotPosition = RectangleF.Empty;
+ }
+ }
+
+ /// <summary>
+ /// Initialize Chart area and axes
+ /// </summary>
+ internal void Initialize()
+ {
+ // Initialize 3D style class
+ _area3DStyle = new ChartArea3DStyle(this);
+
+ // Create axes for this chart area.
+ axisY = new Axis( );
+ axisX = new Axis( );
+ axisX2 = new Axis( );
+ axisY2 = new Axis( );
+
+ // Initialize axes;
+ axisX.Initialize(this, AxisName.X);
+ axisY.Initialize(this, AxisName.Y);
+ axisX2.Initialize(this, AxisName.X2);
+ axisY2.Initialize(this, AxisName.Y2);
+
+ // Initialize axes array
+ _axisArray[0] = axisX;
+ _axisArray[1] = axisY;
+ _axisArray[2] = axisX2;
+ _axisArray[3] = axisY2;
+
+ // Set flag to reset auto values for all areas
+ _areaPosition = new ElementPosition(this);
+ _areaPosition.resetAreaAutoPosition = true;
+
+ _innerPlotPosition = new ElementPosition(this);
+
+ // Set the position of the new chart area
+ if( PlotAreaPosition == null )
+ {
+ PlotAreaPosition = new ElementPosition(this);
+ }
+
+#if Microsoft_CONTROL
+
+ // Initialize cursor class
+ this._cursorX.Initialize(this, AxisName.X);
+ this._cursorY.Initialize(this, AxisName.Y);
+
+#endif // Microsoft_CONTROL
+ }
+
+ /// <summary>
+ /// Minimum and maximum do not have to be calculated
+ /// from data series every time. It is very time
+ /// consuming. Minimum and maximum are buffered
+ /// and only when this flags are set Minimum and
+ /// Maximum are refreshed from data.
+ /// </summary>
+ internal void ResetMinMaxFromData()
+ {
+ _axisArray[0].refreshMinMaxFromData = true;
+ _axisArray[1].refreshMinMaxFromData = true;
+ _axisArray[2].refreshMinMaxFromData = true;
+ _axisArray[3].refreshMinMaxFromData = true;
+ }
+
+ /// <summary>
+ /// Recalculates the axes scale of a chart area.
+ /// </summary>
+ public void RecalculateAxesScale()
+ {
+ // Read axis Max/Min from data
+ ResetMinMaxFromData();
+
+#if Microsoft_CONTROL
+ Set3DAnglesAndReverseMode();
+ SetTempValues();
+#endif
+
+ // Initialize area position
+ _axisArray[0].ReCalc( PlotAreaPosition );
+ _axisArray[1].ReCalc( PlotAreaPosition );
+ _axisArray[2].ReCalc( PlotAreaPosition );
+ _axisArray[3].ReCalc( PlotAreaPosition );
+
+ // Find all Data and chart types which belong
+ // to this chart area an set default values
+ SetData();
+
+#if Microsoft_CONTROL
+ Restore3DAnglesAndReverseMode();
+ GetTempValues();
+#endif
+ }
+
+ /// <summary>
+ /// RecalculateAxesScale the chart area
+ /// </summary>
+ internal void ReCalcInternal()
+ {
+ // Initialize area position
+ _axisArray[0].ReCalc( PlotAreaPosition );
+ _axisArray[1].ReCalc( PlotAreaPosition );
+ _axisArray[2].ReCalc( PlotAreaPosition );
+ _axisArray[3].ReCalc( PlotAreaPosition );
+
+ // Find all Data and chart types which belong
+ // to this chart area an set default values
+ SetData();
+ }
+
+
+ /// <summary>
+ /// Reset auto calculated chart area values.
+ /// </summary>
+ internal void ResetAutoValues()
+ {
+ _axisArray[0].ResetAutoValues();
+ _axisArray[1].ResetAutoValues();
+ _axisArray[2].ResetAutoValues();
+ _axisArray[3].ResetAutoValues();
+ }
+
+ /// <summary>
+ /// Calculates Position for the background.
+ /// </summary>
+ /// <param name="withScrollBars">Calculate with scroll bars</param>
+ /// <returns>Background rectangle</returns>
+ internal RectangleF GetBackgroundPosition( bool withScrollBars )
+ {
+ // For pie and doughnut, which do not have axes, the position
+ // for the background is Chart area position not plotting
+ // area position.
+ RectangleF backgroundPosition = PlotAreaPosition.ToRectangleF();
+ if( !requireAxes )
+ {
+ backgroundPosition = Position.ToRectangleF();
+ }
+
+ // Without scroll bars
+ if( !withScrollBars )
+ {
+ return backgroundPosition;
+ }
+
+ // Add scroll bar rectangles to the area background
+ RectangleF backgroundPositionWithScrollBars = new RectangleF(backgroundPosition.Location, backgroundPosition.Size);
+
+#if Microsoft_CONTROL
+
+ if( requireAxes )
+ {
+ // Loop through all axis
+ foreach(Axis axis in this.Axes)
+ {
+ // Find axis with visible scroll bars
+ if(axis.ScrollBar.IsVisible && axis.ScrollBar.IsPositionedInside)
+ {
+ // Change size of the background rectangle depending on the axis position
+ if(axis.AxisPosition == AxisPosition.Bottom)
+ {
+ backgroundPositionWithScrollBars.Height += (float)axis.ScrollBar.GetScrollBarRelativeSize();
+ }
+ else if(axis.AxisPosition == AxisPosition.Top)
+ {
+ backgroundPositionWithScrollBars.Y -= (float)axis.ScrollBar.GetScrollBarRelativeSize();
+ backgroundPositionWithScrollBars.Height += (float)axis.ScrollBar.GetScrollBarRelativeSize();
+ }
+ else if(axis.AxisPosition == AxisPosition.Left)
+ {
+ backgroundPositionWithScrollBars.X -= (float)axis.ScrollBar.GetScrollBarRelativeSize();
+ backgroundPositionWithScrollBars.Width += (float)axis.ScrollBar.GetScrollBarRelativeSize();
+ }
+ else if(axis.AxisPosition == AxisPosition.Left)
+ {
+ backgroundPositionWithScrollBars.Width += (float)axis.ScrollBar.GetScrollBarRelativeSize();
+ }
+ }
+ }
+ }
+
+#endif // Microsoft_CONTROL
+ return backgroundPositionWithScrollBars;
+ }
+
+ /// <summary>
+ /// Call when the chart area is resized.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics object.</param>
+ internal void Resize(ChartGraphics chartGraph)
+ {
+ // Initialize plotting area position
+ RectangleF plottingRect = Position.ToRectangleF();
+ if(!InnerPlotPosition.Auto)
+ {
+ plottingRect.X += (Position.Width / 100F) * InnerPlotPosition.X;
+ plottingRect.Y += (Position.Height / 100F) * InnerPlotPosition.Y;
+ plottingRect.Width = (Position.Width / 100F) * InnerPlotPosition.Width;
+ plottingRect.Height = (Position.Height / 100F) * InnerPlotPosition.Height;
+ }
+
+ //******************************************************
+ //** Calculate number of vertical and horizontal axis
+ //******************************************************
+ int verticalAxes = 0;
+ int horizontalAxes = 0;
+ foreach(Axis axis in this.Axes)
+ {
+ if(axis.enabled)
+ {
+ if(axis.AxisPosition == AxisPosition.Bottom)
+ {
+ ++horizontalAxes;
+ }
+ else if(axis.AxisPosition == AxisPosition.Top)
+ {
+ ++horizontalAxes;
+ }
+ else if(axis.AxisPosition == AxisPosition.Left)
+ {
+ ++verticalAxes;
+ }
+ else if(axis.AxisPosition == AxisPosition.Right)
+ {
+ ++verticalAxes;
+ }
+ }
+ }
+ if(horizontalAxes <= 0 )
+ {
+ horizontalAxes = 1;
+ }
+ if(verticalAxes <= 0 )
+ {
+ verticalAxes = 1;
+ }
+
+
+ //******************************************************
+ //** Find same auto-fit font size
+ //******************************************************
+ Axis[] axisArray = (this.switchValueAxes) ?
+ new Axis[] {this.AxisX, this.AxisX2, this.AxisY, this.AxisY2} :
+ new Axis[] {this.AxisY, this.AxisY2, this.AxisX, this.AxisX2};
+ if(this.IsSameFontSizeForAllAxes)
+ {
+ axesAutoFontSize = 20;
+ foreach(Axis axis in axisArray)
+ {
+ // Process only enabled axis
+ if(axis.enabled)
+ {
+ // Resize axis
+ if(axis.AxisPosition == AxisPosition.Bottom || axis.AxisPosition == AxisPosition.Top)
+ {
+ axis.Resize(chartGraph, this.PlotAreaPosition, plottingRect, horizontalAxes, InnerPlotPosition.Auto);
+ }
+ else
+ {
+ axis.Resize(chartGraph, this.PlotAreaPosition, plottingRect, verticalAxes, InnerPlotPosition.Auto);
+ }
+
+ // Calculate smallest font size
+ if(axis.IsLabelAutoFit && axis.autoLabelFont != null)
+ {
+ axesAutoFontSize = Math.Min(axesAutoFontSize, axis.autoLabelFont.Size);
+ }
+ }
+ }
+ }
+
+ //******************************************************
+ //** Adjust plotting area position according to the axes
+ //** elements (title, labels, tick marks) size.
+ //******************************************************
+ RectangleF rectLabelSideSpacing = RectangleF.Empty;
+ foreach(Axis axis in axisArray)
+ {
+ // Process only enabled axis
+ if( ! axis.enabled )
+ {
+ //******************************************************
+ //** Adjust for the 3D Wall Width for disabled axis
+ //******************************************************
+ if(InnerPlotPosition.Auto && this.Area3DStyle.Enable3D && !this.chartAreaIsCurcular)
+ {
+ SizeF areaWallSize = chartGraph.GetRelativeSize(new SizeF(this.Area3DStyle.WallWidth, this.Area3DStyle.WallWidth));
+ if(axis.AxisPosition == AxisPosition.Bottom)
+ {
+ plottingRect.Height -= areaWallSize.Height;
+ }
+ else if(axis.AxisPosition == AxisPosition.Top)
+ {
+ plottingRect.Y += areaWallSize.Height;
+ plottingRect.Height -= areaWallSize.Height;
+ }
+ else if(axis.AxisPosition == AxisPosition.Right)
+ {
+ plottingRect.Width -= areaWallSize.Width;
+ }
+ else if(axis.AxisPosition == AxisPosition.Left)
+ {
+ plottingRect.X += areaWallSize.Width;
+ plottingRect.Width -= areaWallSize.Width;
+ }
+ }
+
+ continue;
+ }
+
+ //******************************************************
+ //** Calculate axes elements position
+ //******************************************************
+ if(axis.AxisPosition == AxisPosition.Bottom || axis.AxisPosition == AxisPosition.Top)
+ {
+ axis.Resize(chartGraph, this.PlotAreaPosition, plottingRect, horizontalAxes, InnerPlotPosition.Auto);
+ }
+ else
+ {
+ axis.Resize(chartGraph, this.PlotAreaPosition, plottingRect, verticalAxes, InnerPlotPosition.Auto);
+ }
+
+ // Shift top/bottom labels so they will not overlap with left/right labels
+ PreventTopBottomAxesLabelsOverlapping(axis);
+
+ //******************************************************
+ //** Check axis position
+ //******************************************************
+ float axisPosition = (float)axis.GetAxisPosition();
+ if(axis.AxisPosition == AxisPosition.Bottom)
+ {
+ if(!axis.GetIsMarksNextToAxis())
+ {
+ axisPosition = plottingRect.Bottom;
+ }
+ axisPosition = plottingRect.Bottom - axisPosition;
+ }
+ else if(axis.AxisPosition == AxisPosition.Top)
+ {
+ if(!axis.GetIsMarksNextToAxis())
+ {
+ axisPosition = plottingRect.Y;
+ }
+ axisPosition = axisPosition - plottingRect.Top;
+ }
+ else if(axis.AxisPosition == AxisPosition.Right)
+ {
+ if(!axis.GetIsMarksNextToAxis())
+ {
+ axisPosition = plottingRect.Right;
+ }
+ axisPosition = plottingRect.Right - axisPosition;
+ }
+ else if(axis.AxisPosition == AxisPosition.Left)
+ {
+ if(!axis.GetIsMarksNextToAxis())
+ {
+ axisPosition = plottingRect.X;
+ }
+ axisPosition = axisPosition - plottingRect.Left;
+ }
+
+ //******************************************************
+ //** Adjust axis elements size with axis position
+ //******************************************************
+ // Calculate total size of axis elements
+ float axisSize = axis.markSize + axis.labelSize;
+
+#if SUBAXES
+ // Add sub-axis size
+ if(!this.chartAreaIsCurcular && !this.Area3DStyle.Enable3D)
+ {
+ foreach(SubAxis subAxis in axis.SubAxes)
+ {
+ axisSize += subAxis.markSize + subAxis.labelSize + subAxis.titleSize;
+ }
+ }
+#endif // SUBAXES
+
+ // Adjust depending on the axis position
+ axisSize -= axisPosition;
+ if(axisSize < 0)
+ {
+ axisSize = 0;
+ }
+
+
+ // Add axis title and scroll bar size (always outside of plotting area)
+ axisSize += axis.titleSize + axis.scrollBarSize;
+
+
+ // Calculate horizontal axes size for circualar area
+ if(this.chartAreaIsCurcular &&
+ (axis.AxisPosition == AxisPosition.Top || axis.AxisPosition == AxisPosition.Bottom) )
+ {
+ axisSize = axis.titleSize + axis.markSize + axis.scrollBarSize;
+ }
+
+ //******************************************************
+ //** Adjust plotting area
+ //******************************************************
+ if(InnerPlotPosition.Auto)
+ {
+ if(axis.AxisPosition == AxisPosition.Bottom)
+ {
+ plottingRect.Height -= axisSize;
+ }
+ else if(axis.AxisPosition == AxisPosition.Top)
+ {
+ plottingRect.Y += axisSize;
+ plottingRect.Height -= axisSize;
+ }
+ else if(axis.AxisPosition == AxisPosition.Left)
+ {
+ plottingRect.X += axisSize;
+ plottingRect.Width -= axisSize;
+ }
+ else if(axis.AxisPosition == AxisPosition.Right)
+ {
+ plottingRect.Width -= axisSize;
+ }
+
+ // Check if labels side offset should be processed
+ bool addLabelsSideOffsets = true;
+
+ // Update the plotting area depending on the size required for labels on the sides
+ if (addLabelsSideOffsets)
+ {
+ if (axis.AxisPosition == AxisPosition.Bottom || axis.AxisPosition == AxisPosition.Top)
+ {
+ if (axis.labelNearOffset != 0 && axis.labelNearOffset < Position.X)
+ {
+ float offset = Position.X - axis.labelNearOffset;
+ if (Math.Abs(offset) > plottingRect.Width * 0.3f)
+ {
+ offset = plottingRect.Width * 0.3f;
+ }
+
+ // NOTE: Code was removed to solve an issue with extra space when labels angle = 45
+ //rectLabelSideSpacing.Width = (float)Math.Max(offset, rectLabelSideSpacing.Width);
+ rectLabelSideSpacing.X = (float)Math.Max(offset, rectLabelSideSpacing.X);
+ }
+
+ if (axis.labelFarOffset > Position.Right)
+ {
+ if ((axis.labelFarOffset - Position.Right) < plottingRect.Width * 0.3f)
+ {
+ rectLabelSideSpacing.Width = (float)Math.Max(axis.labelFarOffset - Position.Right, rectLabelSideSpacing.Width);
+ }
+ else
+ {
+ rectLabelSideSpacing.Width = (float)Math.Max(plottingRect.Width * 0.3f, rectLabelSideSpacing.Width);
+ }
+ }
+ }
+
+ else
+ {
+ if (axis.labelNearOffset != 0 && axis.labelNearOffset < Position.Y)
+ {
+ float offset = Position.Y - axis.labelNearOffset;
+ if (Math.Abs(offset) > plottingRect.Height * 0.3f)
+ {
+ offset = plottingRect.Height * 0.3f;
+ }
+
+ // NOTE: Code was removed to solve an issue with extra space when labels angle = 45
+ //rectLabelSideSpacing.Height = (float)Math.Max(offset, rectLabelSideSpacing.Height);
+ rectLabelSideSpacing.Y = (float)Math.Max(offset, rectLabelSideSpacing.Y);
+ }
+
+ if (axis.labelFarOffset > Position.Bottom)
+ {
+ if ((axis.labelFarOffset - Position.Bottom) < plottingRect.Height * 0.3f)
+ {
+ rectLabelSideSpacing.Height = (float)Math.Max(axis.labelFarOffset - Position.Bottom, rectLabelSideSpacing.Height);
+ }
+ else
+ {
+ rectLabelSideSpacing.Height = (float)Math.Max(plottingRect.Height * 0.3f, rectLabelSideSpacing.Height);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ //******************************************************
+ //** Make sure there is enough space
+ //** for labels on the chart sides
+ //******************************************************
+ if (!this.chartAreaIsCurcular)
+ {
+ if (rectLabelSideSpacing.Y > 0 && rectLabelSideSpacing.Y > plottingRect.Y - Position.Y)
+ {
+ float delta = (plottingRect.Y - Position.Y) - rectLabelSideSpacing.Y;
+ plottingRect.Y -= delta;
+ plottingRect.Height += delta;
+ }
+ if (rectLabelSideSpacing.X > 0 && rectLabelSideSpacing.X > plottingRect.X - Position.X)
+ {
+ float delta = (plottingRect.X - Position.X) - rectLabelSideSpacing.X;
+ plottingRect.X -= delta;
+ plottingRect.Width += delta;
+ }
+ if (rectLabelSideSpacing.Height > 0 && rectLabelSideSpacing.Height > Position.Bottom - plottingRect.Bottom)
+ {
+ plottingRect.Height += (Position.Bottom - plottingRect.Bottom) - rectLabelSideSpacing.Height;
+ }
+ if (rectLabelSideSpacing.Width > 0 && rectLabelSideSpacing.Width > Position.Right - plottingRect.Right)
+ {
+ plottingRect.Width += (Position.Right - plottingRect.Right) - rectLabelSideSpacing.Width;
+ }
+ }
+
+ //******************************************************
+ //** Plotting area must be square for the circular
+ //** chart area (in pixels).
+ //******************************************************
+ if(this.chartAreaIsCurcular)
+ {
+ // Adjust area to fit the axis title
+ float xTitleSize = (float)Math.Max(this.AxisY.titleSize, this.AxisY2.titleSize);
+ if(xTitleSize > 0)
+ {
+ plottingRect.X += xTitleSize;
+ plottingRect.Width -= 2f * xTitleSize;
+ }
+ float yTitleSize = (float)Math.Max(this.AxisX.titleSize, this.AxisX2.titleSize);
+ if(yTitleSize > 0)
+ {
+ plottingRect.Y += yTitleSize;
+ plottingRect.Height -= 2f * yTitleSize;
+ }
+
+ // Make a square plotting rect
+ RectangleF rect = chartGraph.GetAbsoluteRectangle( plottingRect );
+ if(rect.Width > rect.Height)
+ {
+ rect.X += (rect.Width - rect.Height) / 2f;
+ rect.Width = rect.Height;
+ }
+ else
+ {
+ rect.Y += (rect.Height - rect.Width) / 2f;
+ rect.Height = rect.Width;
+ }
+ plottingRect = chartGraph.GetRelativeRectangle( rect );
+
+ // Remember circular chart area center
+ this.circularCenter = new PointF(plottingRect.X + plottingRect.Width/2f, plottingRect.Y + plottingRect.Height/2f);
+
+ // Calculate auto-fit font of the circular axis labels and update area position
+ FitCircularLabels(chartGraph, this.PlotAreaPosition, ref plottingRect, xTitleSize, yTitleSize);
+ }
+
+ //******************************************************
+ //** Set plotting area position
+ //******************************************************
+ if(plottingRect.Width < 0f)
+ {
+ plottingRect.Width = 0f;
+ }
+ if(plottingRect.Height < 0f)
+ {
+ plottingRect.Height = 0f;
+ }
+ PlotAreaPosition.FromRectangleF(plottingRect);
+ InnerPlotPosition.SetPositionNoAuto(
+ (float)Math.Round((plottingRect.X - Position.X) / (Position.Width / 100F), 5),
+ (float)Math.Round((plottingRect.Y - Position.Y) / (Position.Height / 100F), 5),
+ (float)Math.Round(plottingRect.Width / (Position.Width / 100F), 5),
+ (float)Math.Round(plottingRect.Height / (Position.Height / 100F), 5));
+
+
+ //******************************************************
+ //** Adjust label font size for axis, which were
+ //** automatically calculated after the opposite axis
+ //** change the size of plotting area.
+ //******************************************************
+ this.AxisY2.AdjustLabelFontAtSecondPass(chartGraph, InnerPlotPosition.Auto);
+ this.AxisY.AdjustLabelFontAtSecondPass(chartGraph, InnerPlotPosition.Auto);
+ if(InnerPlotPosition.Auto)
+ {
+ this.AxisX2.AdjustLabelFontAtSecondPass(chartGraph, InnerPlotPosition.Auto);
+ this.AxisX.AdjustLabelFontAtSecondPass(chartGraph, InnerPlotPosition.Auto);
+ }
+
+ }
+
+ /// <summary>
+ /// Finds axis by it's position. Can be Null.
+ /// </summary>
+ /// <param name="axisPosition">Axis position to find</param>
+ /// <returns>Found axis.</returns>
+ private Axis FindAxis(AxisPosition axisPosition)
+ {
+ foreach(Axis axis in this.Axes)
+ {
+ if(axis.AxisPosition == axisPosition)
+ {
+ return axis;
+ }
+ }
+ return null;
+ }
+
+ /// <summary>
+ /// Shift top/bottom labels so they will not overlap with left/right labels.
+ /// </summary>
+ /// <param name="axis">Axis to shift up/down.</param>
+ private void PreventTopBottomAxesLabelsOverlapping(Axis axis)
+ {
+ // If axis is not on the edge of the chart area do not
+ // try to adjust it's position when axis labels overlap
+ // labels of the oppositie axis.
+ if( !axis.IsAxisOnAreaEdge )
+ {
+ return;
+ }
+
+ // Shift bottom axis labels down
+ if(axis.AxisPosition == AxisPosition.Bottom)
+ {
+ // Get labels position
+ float labelsPosition = (float)axis.GetAxisPosition();
+ if( !axis.GetIsMarksNextToAxis() )
+ {
+ labelsPosition = axis.PlotAreaPosition.Bottom;
+ }
+
+ // Only adjust labels outside plotting area
+ if(Math.Round(labelsPosition, 2) < Math.Round(axis.PlotAreaPosition.Bottom, 2))
+ {
+ return;
+ }
+
+ // Check if labels may overlap with Left axis
+ Axis leftAxis = FindAxis(AxisPosition.Left);
+ if(leftAxis != null &&
+ leftAxis.enabled &&
+ leftAxis.labelFarOffset != 0 &&
+ leftAxis.labelFarOffset > labelsPosition &&
+ axis.labelNearOffset != 0 &&
+ axis.labelNearOffset < PlotAreaPosition.X)
+ {
+ float overlap = (float)(leftAxis.labelFarOffset - labelsPosition) * 0.75f;
+ if(overlap > axis.markSize)
+ {
+ axis.markSize += overlap - axis.markSize;
+ }
+ }
+
+ // Check if labels may overlap with Right axis
+ Axis rightAxis = FindAxis(AxisPosition.Right);
+ if(rightAxis != null &&
+ rightAxis.enabled &&
+ rightAxis.labelFarOffset != 0 &&
+ rightAxis.labelFarOffset > labelsPosition &&
+ axis.labelFarOffset != 0 &&
+ axis.labelFarOffset > PlotAreaPosition.Right)
+ {
+ float overlap = (float)(rightAxis.labelFarOffset - labelsPosition) * 0.75f;
+ if(overlap > axis.markSize)
+ {
+ axis.markSize += overlap - axis.markSize;
+ }
+ }
+ }
+
+ // Shift top axis labels up
+ else if(axis.AxisPosition == AxisPosition.Top)
+ {
+ // Get labels position
+ float labelsPosition = (float)axis.GetAxisPosition();
+ if( !axis.GetIsMarksNextToAxis() )
+ {
+ labelsPosition = axis.PlotAreaPosition.Y;
+ }
+
+ // Only adjust labels outside plotting area
+ if(Math.Round(labelsPosition, 2) < Math.Round(axis.PlotAreaPosition.Y, 2))
+ {
+ return;
+ }
+
+ // Check if labels may overlap with Left axis
+ Axis leftAxis = FindAxis(AxisPosition.Left);
+ if(leftAxis != null &&
+ leftAxis.enabled &&
+ leftAxis.labelNearOffset != 0 &&
+ leftAxis.labelNearOffset < labelsPosition &&
+ axis.labelNearOffset != 0 &&
+ axis.labelNearOffset < PlotAreaPosition.X)
+ {
+ float overlap = (float)(labelsPosition - leftAxis.labelNearOffset) * 0.75f;
+ if(overlap > axis.markSize)
+ {
+ axis.markSize += overlap - axis.markSize;
+ }
+ }
+
+ // Check if labels may overlap with Right axis
+ Axis rightAxis = FindAxis(AxisPosition.Right);
+ if(rightAxis != null &&
+ rightAxis.enabled &&
+ rightAxis.labelNearOffset != 0 &&
+ rightAxis.labelNearOffset < labelsPosition &&
+ axis.labelFarOffset != 0 &&
+ axis.labelFarOffset > PlotAreaPosition.Right)
+ {
+ float overlap = (float)(labelsPosition - rightAxis.labelNearOffset) * 0.75f;
+ if(overlap > axis.markSize)
+ {
+ axis.markSize += overlap - axis.markSize;
+ }
+ }
+ }
+
+ }
+
+ #endregion
+
+ #region Painting and Selection Methods
+
+ /// <summary>
+ /// Draws chart area background and/or border.
+ /// </summary>
+ /// <param name="graph">Chart graphics.</param>
+ /// <param name="position">Background position.</param>
+ /// <param name="borderOnly">Draws chart area border only.</param>
+ private void PaintAreaBack(ChartGraphics graph, RectangleF position, bool borderOnly)
+ {
+ if(!borderOnly)
+ {
+ // Draw background
+ if(!this.Area3DStyle.Enable3D || !requireAxes || chartAreaIsCurcular)
+ {
+ // 3D Pie Chart doesn't need scene
+ // Draw 2D background
+ graph.FillRectangleRel(
+ position,
+ BackColor,
+ BackHatchStyle,
+ BackImage,
+ BackImageWrapMode,
+ BackImageTransparentColor,
+ BackImageAlignment,
+ BackGradientStyle,
+ BackSecondaryColor,
+ (requireAxes) ? Color.Empty : BorderColor,
+ (requireAxes) ? 0 : BorderWidth,
+ BorderDashStyle,
+ ShadowColor,
+ ShadowOffset,
+ PenAlignment.Outset,
+ chartAreaIsCurcular,
+ (chartAreaIsCurcular && this.CircularUsePolygons) ? this.CircularSectorsNumber : 0,
+ this.Area3DStyle.Enable3D);
+ }
+ else
+ {
+ // Draw chart area 3D scene
+ this.DrawArea3DScene(graph, position);
+ }
+ }
+ else
+ {
+ if(!this.Area3DStyle.Enable3D || !requireAxes || chartAreaIsCurcular)
+ {
+ // Draw chart area border
+ if(BorderColor != Color.Empty && BorderWidth > 0)
+ {
+ graph.FillRectangleRel( position,
+ Color.Transparent,
+ ChartHatchStyle.None,
+ "",
+ ChartImageWrapMode.Tile,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ GradientStyle.None,
+ Color.Empty,
+ BorderColor,
+ BorderWidth,
+ BorderDashStyle,
+ Color.Empty,
+ 0,
+ PenAlignment.Outset,
+ chartAreaIsCurcular,
+ (chartAreaIsCurcular && this.CircularUsePolygons) ? this.CircularSectorsNumber : 0,
+ this.Area3DStyle.Enable3D);
+ }
+ }
+
+ }
+ }
+
+ /// <summary>
+ /// Paint the chart area.
+ /// </summary>
+ /// <param name="graph">Chart graphics.</param>
+ internal void Paint( ChartGraphics graph )
+ {
+ // Check if plot area position was recalculated.
+ // If not and non-auto InnerPlotPosition & Position were
+ // specified - do all needed calculations
+ if (PlotAreaPosition.Width == 0 &&
+ PlotAreaPosition.Height == 0 &&
+ !InnerPlotPosition.Auto
+ && !Position.Auto)
+ {
+ // Initialize plotting area position
+ RectangleF plottingRect = Position.ToRectangleF();
+ if (!InnerPlotPosition.Auto)
+ {
+ plottingRect.X += (Position.Width / 100F) * InnerPlotPosition.X;
+ plottingRect.Y += (Position.Height / 100F) * InnerPlotPosition.Y;
+ plottingRect.Width = (Position.Width / 100F) * InnerPlotPosition.Width;
+ plottingRect.Height = (Position.Height / 100F) * InnerPlotPosition.Height;
+ }
+
+ PlotAreaPosition.FromRectangleF(plottingRect);
+ }
+
+ // Get background position rectangle.
+ RectangleF backgroundPositionWithScrollBars = GetBackgroundPosition(true);
+ RectangleF backgroundPosition = GetBackgroundPosition(false);
+
+ // Add hot region for plotting area.
+ if (Common.ProcessModeRegions)
+ {
+ Common.HotRegionsList.AddHotRegion(backgroundPosition, this, ChartElementType.PlottingArea, true);
+ }
+ // Draw background
+ PaintAreaBack(graph, backgroundPositionWithScrollBars, false);
+
+ // Call BackPaint event
+ Common.Chart.CallOnPrePaint(new ChartPaintEventArgs(this, graph, Common, PlotAreaPosition));
+
+ // Draw chart types without axes - Pie.
+ if (!requireAxes && ChartTypes.Count != 0)
+ {
+ // Find first chart type that do not require axis (like Pie) and draw it.
+ // Chart types that do not require axes (circular charts) cannot be combined with
+ // any other chart types.
+ // NOTE: Fixes issues #4672 and #4692
+ for (int chartTypeIndex = 0; chartTypeIndex < ChartTypes.Count; chartTypeIndex++)
+ {
+ IChartType chartType = Common.ChartTypeRegistry.GetChartType((string)ChartTypes[chartTypeIndex]);
+ if (!chartType.RequireAxes)
+ {
+ chartType.Paint(graph, Common, this, null);
+ break;
+ }
+ }
+
+ // Call Paint event
+ Common.Chart.CallOnPostPaint(new ChartPaintEventArgs(this, graph, Common, PlotAreaPosition));
+ return;
+ }
+
+
+
+ // Reset Smart Labels
+ this.smartLabels.Reset();
+
+
+
+ // Set values for optimized drawing
+ foreach (Axis currentAxis in this._axisArray)
+ {
+ currentAxis.optimizedGetPosition = true;
+ currentAxis.paintViewMax = currentAxis.ViewMaximum;
+ currentAxis.paintViewMin = currentAxis.ViewMinimum;
+ currentAxis.paintRange = currentAxis.paintViewMax - currentAxis.paintViewMin;
+ currentAxis.paintAreaPosition = PlotAreaPosition.ToRectangleF();
+ if (currentAxis.ChartArea != null && currentAxis.ChartArea.chartAreaIsCurcular)
+ {
+ // Update position for circular chart area
+ currentAxis.paintAreaPosition.Width /= 2.0f;
+ currentAxis.paintAreaPosition.Height /= 2.0f;
+ }
+ currentAxis.paintAreaPositionBottom = currentAxis.paintAreaPosition.Y + currentAxis.paintAreaPosition.Height;
+ currentAxis.paintAreaPositionRight = currentAxis.paintAreaPosition.X + currentAxis.paintAreaPosition.Width;
+ if (currentAxis.AxisPosition == AxisPosition.Top || currentAxis.AxisPosition == AxisPosition.Bottom)
+ currentAxis.paintChartAreaSize = currentAxis.paintAreaPosition.Width;
+ else
+ currentAxis.paintChartAreaSize = currentAxis.paintAreaPosition.Height;
+
+ currentAxis.valueMultiplier = 0.0;
+ if (currentAxis.paintRange != 0)
+ {
+ currentAxis.valueMultiplier = currentAxis.paintChartAreaSize / currentAxis.paintRange;
+ }
+ }
+
+ // Draw Axis Striplines (only when StripWidth > 0)
+ bool useScaleSegments = false;
+ Axis[] axesArray = new Axis[] { axisY, axisY2, axisX, axisX2 };
+ foreach (Axis currentAxis in axesArray)
+ {
+
+ useScaleSegments = (currentAxis.ScaleSegments.Count > 0);
+
+ if (!useScaleSegments)
+ {
+ currentAxis.PaintStrips(graph, false);
+ }
+
+ else
+ {
+ foreach (AxisScaleSegment scaleSegment in currentAxis.ScaleSegments)
+ {
+ scaleSegment.SetTempAxisScaleAndInterval();
+
+ currentAxis.PaintStrips(graph, false);
+
+ scaleSegment.RestoreAxisScaleAndInterval();
+ }
+ }
+ }
+
+ // Draw Axis Grids
+ axesArray = new Axis[] { axisY, axisX2, axisY2, axisX };
+ foreach (Axis currentAxis in axesArray)
+ {
+
+ useScaleSegments = (currentAxis.ScaleSegments.Count > 0);
+
+ if (!useScaleSegments)
+ {
+ currentAxis.PaintGrids(graph);
+ }
+
+ else
+ {
+ foreach (AxisScaleSegment scaleSegment in currentAxis.ScaleSegments)
+ {
+ scaleSegment.SetTempAxisScaleAndInterval();
+
+ currentAxis.PaintGrids(graph);
+
+ scaleSegment.RestoreAxisScaleAndInterval();
+ }
+ }
+
+ }
+
+ // Draw Axis Striplines (only when StripWidth == 0)
+ foreach (Axis currentAxis in axesArray)
+ {
+
+ useScaleSegments = (currentAxis.ScaleSegments.Count > 0);
+
+ if (!useScaleSegments)
+ {
+ currentAxis.PaintStrips(graph, true);
+ }
+
+ else
+ {
+ foreach (AxisScaleSegment scaleSegment in currentAxis.ScaleSegments)
+ {
+ scaleSegment.SetTempAxisScaleAndInterval();
+
+ currentAxis.PaintStrips(graph, true);
+
+ scaleSegment.RestoreAxisScaleAndInterval();
+ }
+ }
+
+ }
+
+ // Draw Axis elements on the back of the 3D scene
+ if (this.Area3DStyle.Enable3D && !this.chartAreaIsCurcular)
+ {
+ foreach (Axis currentAxis in axesArray)
+ {
+
+ useScaleSegments = (currentAxis.ScaleSegments.Count > 0);
+
+ if (!useScaleSegments)
+ {
+ currentAxis.PrePaint(graph);
+ }
+
+ else
+ {
+ foreach (AxisScaleSegment scaleSegment in currentAxis.ScaleSegments)
+ {
+ scaleSegment.SetTempAxisScaleAndInterval();
+
+ currentAxis.PrePaint(graph);
+
+ scaleSegment.RestoreAxisScaleAndInterval();
+ }
+
+ }
+
+ }
+ }
+
+ // Draws chart area border
+ bool borderDrawn = false;
+ if (this.Area3DStyle.Enable3D || !IsBorderOnTopSeries())
+ {
+ borderDrawn = true;
+ PaintAreaBack(graph, backgroundPosition, true);
+ }
+
+ // Draw chart types
+ if (!this.Area3DStyle.Enable3D || this.chartAreaIsCurcular)
+ {
+ // Drawing in 2D space
+
+ // NOTE: Fixes issue #6443 and #5385
+ // If two chart series of the same type (for example Line) are separated
+ // by other series (for example Area) the order is not correct.
+ // Old implementation draws ALL series that belongs to the chart type.
+ ArrayList typeAndSeries = this.GetChartTypesAndSeriesToDraw();
+
+ // Draw series by chart type or by series
+ foreach (ChartTypeAndSeriesInfo chartTypeInfo in typeAndSeries)
+ {
+ this.IterationCounter = 0;
+ IChartType type = Common.ChartTypeRegistry.GetChartType(chartTypeInfo.ChartType);
+
+ // If 'chartTypeInfo.Series' set to NULL all series of that chart type are drawn at once
+ type.Paint(graph, Common, this, chartTypeInfo.Series);
+ }
+ }
+ else
+ {
+ // Drawing in 3D space
+ PaintChartSeries3D(graph);
+ }
+
+ // Draw area border if it wasn't drawn prior to the series
+ if (!borderDrawn)
+ {
+ PaintAreaBack(graph, backgroundPosition, true);
+ }
+
+ // Draw Axis
+ foreach (Axis currentAxis in axesArray)
+ {
+
+ useScaleSegments = (currentAxis.ScaleSegments.Count > 0);
+
+ if (!useScaleSegments)
+ {
+ // Paint axis and Reset temp axis offset for side-by-side charts like column
+ currentAxis.Paint(graph);
+ }
+
+ else
+ {
+ // Some of the axis elements like grid lines and tickmarks
+ // are drawn for each segment
+ foreach (AxisScaleSegment scaleSegment in currentAxis.ScaleSegments)
+ {
+ scaleSegment.SetTempAxisScaleAndInterval();
+
+ currentAxis.PaintOnSegmentedScalePassOne(graph);
+
+ scaleSegment.RestoreAxisScaleAndInterval();
+ }
+
+ // Other elements like labels, title, axis line are drawn once
+ currentAxis.PaintOnSegmentedScalePassTwo(graph);
+ }
+
+ }
+
+ // Call Paint event
+ Common.Chart.CallOnPostPaint(new ChartPaintEventArgs(this, graph, Common, PlotAreaPosition));
+
+ // Draw axis scale break lines
+ axesArray = new Axis[] { axisY, axisY2 };
+ foreach (Axis currentAxis in axesArray)
+ {
+ for (int segmentIndex = 0; segmentIndex < (currentAxis.ScaleSegments.Count - 1); segmentIndex++)
+ {
+ currentAxis.ScaleSegments[segmentIndex].PaintBreakLine(graph, currentAxis.ScaleSegments[segmentIndex + 1]);
+
+ }
+ }
+
+ // Reset values for optimized drawing
+ foreach (Axis curentAxis in this._axisArray)
+ {
+ curentAxis.optimizedGetPosition = false;
+
+
+ // Reset preffered number of intervals on the axis
+ curentAxis.prefferedNumberofIntervals = 5;
+
+ // Reset flag that scale segments are used
+ curentAxis.scaleSegmentsUsed = false;
+
+
+ }
+ }
+
+ /// <summary>
+ /// Checks if chart area border should be drawn on top of series.
+ /// </summary>
+ /// <returns>True if border should be darwn on top.</returns>
+ private bool IsBorderOnTopSeries()
+ {
+ // For most of the chart types chart area border is drawn on top.
+ bool result = true;
+ foreach( Series series in this.Common.Chart.Series )
+ {
+ if(series.ChartArea == this.Name)
+ {
+ // It is common for the Bubble and Point chart types to draw markers
+ // partially outside of the chart area. By drawing the border before
+ // series we avoiding the possibility of drawing the border line on
+ // top of the marker.
+ if(series.ChartType == SeriesChartType.Bubble ||
+ series.ChartType == SeriesChartType.Point)
+ {
+ return false;
+ }
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// Paint the chart area cursors.
+ /// </summary>
+ /// <param name="graph">Chart graphics.</param>
+ /// <param name="cursorOnly">Indicates that only cursors are redrawn.</param>
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Justification = "These parameters are used when compiling for the Microsoft version of Chart")]
+ internal void PaintCursors( ChartGraphics graph, bool cursorOnly )
+ {
+ // Cursors and selection are supoorted only in 2D charts
+ if(this.Area3DStyle.Enable3D == true)
+ {
+ return;
+ }
+
+ // Do not draw cursor/selection for chart types that do not require axis (like Pie)
+ if(!this.requireAxes)
+ {
+ return;
+ }
+
+ // Cursors and selection are not supoorted in circular areas
+ if(this.chartAreaIsCurcular)
+ {
+ return;
+ }
+
+ // Do not draw cursor/selection while printing
+ if(this.Common != null &&
+ this.Common.ChartPicture != null &&
+ this.Common.ChartPicture.isPrinting)
+ {
+ return;
+ }
+
+ // Do not draw cursor/selection when chart area is not visible
+ // because either width or height is set to zero
+ if(this.Position.Width == 0f ||
+ this.Position.Height == 0f)
+ {
+ return;
+ }
+
+#if Microsoft_CONTROL
+
+ Chart chart = this.Common.Chart;
+ ChartPicture chartPicture = Common.ChartPicture;
+
+ // Check if cursor should be drawn
+ if(!double.IsNaN(_cursorX.SelectionStart) ||
+ !double.IsNaN(_cursorX.SelectionEnd) ||
+ !double.IsNaN(_cursorX.Position) ||
+ !double.IsNaN(_cursorY.SelectionStart) ||
+ !double.IsNaN(_cursorY.SelectionEnd) ||
+ !double.IsNaN(_cursorY.Position))
+ {
+
+ if(!chartPicture.backgroundRestored &&
+ !chartPicture.isSelectionMode )
+ {
+ chartPicture.backgroundRestored = true;
+
+ Rectangle chartPosition = new Rectangle(0, 0, chartPicture.Width, chartPicture.Height);
+
+ // Get chart area position
+ Rectangle absAreaPlotPosition = Rectangle.Round(graph.GetAbsoluteRectangle(PlotAreaPosition.ToRectangleF()));
+ int maxCursorWidth = (CursorY.LineWidth > CursorX.LineWidth) ? CursorY.LineWidth + 1 : CursorX.LineWidth + 1;
+ absAreaPlotPosition.Inflate(maxCursorWidth, maxCursorWidth);
+ absAreaPlotPosition.Intersect(new Rectangle(0, 0, chart.Width, chart.Height));
+
+ // Create area buffer bitmap
+ if(areaBufferBitmap == null ||
+ chartPicture.nonTopLevelChartBuffer == null ||
+ !cursorOnly)
+ {
+ // Dispose previous bitmap
+ if(areaBufferBitmap != null)
+ {
+ areaBufferBitmap.Dispose();
+ areaBufferBitmap = null;
+ }
+ if(chartPicture.nonTopLevelChartBuffer != null)
+ {
+ chartPicture.nonTopLevelChartBuffer.Dispose();
+ chartPicture.nonTopLevelChartBuffer = null;
+ }
+
+
+ // Copy chart area plotting rectangle from the chart's dubble buffer image into area dubble buffer image
+ if(chart.paintBufferBitmap != null)
+ {
+ areaBufferBitmap = chart.paintBufferBitmap.Clone(absAreaPlotPosition, chart.paintBufferBitmap.PixelFormat);
+ }
+
+ // Copy whole chart from the chart's dubble buffer image into area dubble buffer image
+ if(chart.paintBufferBitmap != null &&
+ chart.paintBufferBitmap.Size.Width >= chartPosition.Size.Width &&
+ chart.paintBufferBitmap.Size.Height >= chartPosition.Size.Height)
+ {
+ chartPicture.nonTopLevelChartBuffer = chart.paintBufferBitmap.Clone(
+ chartPosition, chart.paintBufferBitmap.PixelFormat);
+ }
+
+ }
+ else if(cursorOnly && chartPicture.nonTopLevelChartBuffer != null)
+ {
+ // Restore previous background
+ chart.paintBufferBitmapGraphics.DrawImageUnscaled(
+ chartPicture.nonTopLevelChartBuffer,
+ chartPosition);
+ }
+ }
+
+ // Draw chart area cursors and range selection
+
+ _cursorY.Paint(graph);
+ _cursorX.Paint(graph);
+
+ }
+#endif // Microsoft_CONTROL
+
+ }
+
+ #endregion
+
+ #region Circular chart area methods
+
+ /// <summary>
+ /// Gets a circular chart type interface that belongs to this chart area.
+ /// </summary>
+ /// <returns>ICircularChartType interface or null.</returns>
+ internal ICircularChartType GetCircularChartType()
+ {
+ // Get number of sectors in circular chart area
+ foreach(Series series in this.Common.DataManager.Series)
+ {
+ if(series.IsVisible() && series.ChartArea == this.Name)
+ {
+ ICircularChartType type = Common.ChartTypeRegistry.GetChartType(series.ChartTypeName) as ICircularChartType;;
+ if(type != null)
+ {
+ return type;
+ }
+ }
+ }
+ return null;
+ }
+
+ /// <summary>
+ /// Calculate size of the circular axis labels and sets auto-fit font.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics object.</param>
+ /// <param name="chartAreaPosition">The Chart area position.</param>
+ /// <param name="plotArea">Plotting area size.</param>
+ /// <param name="xTitleSize">Size of title on the axis.</param>
+ /// <param name="yTitleSize">Size of title on the axis.</param>
+ internal void FitCircularLabels(
+ ChartGraphics chartGraph,
+ ElementPosition chartAreaPosition,
+ ref RectangleF plotArea,
+ float xTitleSize,
+ float yTitleSize)
+ {
+ // Check if axis labels are enabled
+ if(!this.AxisX.LabelStyle.Enabled)
+ {
+ return;
+ }
+
+ // Get absolute titles size
+ SizeF titleSize = chartGraph.GetAbsoluteSize(new SizeF(xTitleSize, yTitleSize));
+
+ // Get absolute position of area
+ RectangleF plotAreaRectAbs = chartGraph.GetAbsoluteRectangle( plotArea );
+ RectangleF areaRectAbs = chartGraph.GetAbsoluteRectangle( chartAreaPosition.ToRectangleF());
+
+ // Get absolute markers size and spacing
+ float spacing = chartGraph.GetAbsolutePoint(new PointF(0, this.AxisX.markSize + Axis.elementSpacing)).Y;
+
+ // Get circular axis list
+ ArrayList axisList = GetCircularAxisList();
+
+ // Get circular axis labels style
+ CircularAxisLabelsStyle labelsStyle = GetCircularAxisLabelsStyle();
+
+ //*****************************************************************
+ //** Calculate the auto-fit font if required
+ //*****************************************************************
+ if(this.AxisX.LabelStyle.Enabled && this.AxisX.IsLabelAutoFit)
+ {
+ // Set max auto fit font
+ this.AxisX.autoLabelFont = Common.ChartPicture.FontCache.GetFont(
+ this.AxisX.LabelStyle.Font.FontFamily,
+ 14,
+ this.AxisX.LabelStyle.Font.Style,
+ GraphicsUnit.Point);
+
+ // Get estimated labels size
+ float labelsSizeEstimate = GetCircularLabelsSize(chartGraph, areaRectAbs, plotAreaRectAbs, titleSize);
+ labelsSizeEstimate = (float)Math.Min(labelsSizeEstimate * 1.1f, plotAreaRectAbs.Width / 5f);
+ labelsSizeEstimate += spacing;
+
+ // Calculate auto-fit font
+ this.AxisX.GetCircularAxisLabelsAutoFitFont(chartGraph, axisList, labelsStyle, plotAreaRectAbs, areaRectAbs, labelsSizeEstimate);
+ }
+
+ //*****************************************************************
+ //** Shrink plot area size proportionally
+ //*****************************************************************
+
+ // Get labels size
+ float labelsSize = GetCircularLabelsSize(chartGraph, areaRectAbs, plotAreaRectAbs, titleSize);
+
+ // Check if change size is smaller than radius
+ labelsSize = (float)Math.Min(labelsSize, plotAreaRectAbs.Width / 2.5f);
+ labelsSize += spacing;
+
+ plotAreaRectAbs.X += labelsSize;
+ plotAreaRectAbs.Width -= 2f * labelsSize;
+ plotAreaRectAbs.Y += labelsSize;
+ plotAreaRectAbs.Height -= 2f * labelsSize;
+
+ // Restrict minimum plot area size
+ if(plotAreaRectAbs.Width < 1.0f)
+ {
+ plotAreaRectAbs.Width = 1.0f;
+ }
+ if(plotAreaRectAbs.Height < 1.0f)
+ {
+ plotAreaRectAbs.Height = 1.0f;
+ }
+
+ plotArea = chartGraph.GetRelativeRectangle( plotAreaRectAbs );
+
+
+ //*****************************************************************
+ //** Set axes labels size
+ //*****************************************************************
+ SizeF relativeLabelSize = chartGraph.GetRelativeSize(new SizeF(labelsSize, labelsSize));
+ this.AxisX.labelSize = relativeLabelSize.Height;
+ this.AxisX2.labelSize = relativeLabelSize.Height;
+ this.AxisY.labelSize = relativeLabelSize.Width;
+ this.AxisY2.labelSize = relativeLabelSize.Width;
+
+ }
+
+ /// <summary>
+ /// Calculate size of the circular axis labels.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics object.</param>
+ /// <param name="areaRectAbs">The Chart area position.</param>
+ /// <param name="plotAreaRectAbs">Plotting area size.</param>
+ /// <param name="titleSize">Size of title on the axes.</param>
+ /// <returns>Circulat labels style.</returns>
+ internal float GetCircularLabelsSize(
+ ChartGraphics chartGraph,
+ RectangleF areaRectAbs,
+ RectangleF plotAreaRectAbs,
+ SizeF titleSize)
+ {
+ // Find current horiz. and vert. spacing between plotting and chart areas
+ SizeF areaDiff = new SizeF(plotAreaRectAbs.X - areaRectAbs.X, plotAreaRectAbs.Y - areaRectAbs.Y);
+ areaDiff.Width -= titleSize.Width;
+ areaDiff.Height -= titleSize.Height;
+
+ // Get absolute center of the area
+ PointF areaCenterAbs = chartGraph.GetAbsolutePoint(this.circularCenter);
+
+ // Get circular axis list
+ ArrayList axisList = GetCircularAxisList();
+
+ // Get circular axis labels style
+ CircularAxisLabelsStyle labelsStyle = GetCircularAxisLabelsStyle();
+
+ // Defines on how much (pixels) the circular chart area radius should be reduced
+ float labelsSize = 0f;
+
+ //*****************************************************************
+ //** Loop through all axis labels
+ //*****************************************************************
+ foreach(CircularChartAreaAxis axis in axisList)
+ {
+ //*****************************************************************
+ //** Measure label text
+ //*****************************************************************
+ SizeF textSize = chartGraph.MeasureString(
+ axis.Title.Replace("\\n", "\n"),
+ (this.AxisX.autoLabelFont == null) ? this.AxisX.LabelStyle.Font : this.AxisX.autoLabelFont);
+ textSize.Width = (float)Math.Ceiling(textSize.Width * 1.1f);
+ textSize.Height = (float)Math.Ceiling(textSize.Height * 1.1f);
+
+
+ //*****************************************************************
+ //** Calculate area size change depending on labels style
+ //*****************************************************************
+ if(labelsStyle == CircularAxisLabelsStyle.Circular)
+ {
+ labelsSize = (float)Math.Max(
+ labelsSize,
+ textSize.Height);
+ }
+ else if(labelsStyle == CircularAxisLabelsStyle.Radial)
+ {
+ float textAngle = axis.AxisPosition + 90;
+
+ // For angled text find it's X and Y components
+ float width = (float)Math.Cos(textAngle/180F*Math.PI) * textSize.Width;
+ float height = (float)Math.Sin(textAngle/180F*Math.PI) * textSize.Width;
+ width = (float)Math.Abs(Math.Ceiling(width));
+ height = (float)Math.Abs(Math.Ceiling(height));
+
+ // Reduce text size by current spacing between plotting area and chart area
+ width -= areaDiff.Width;
+ height -= areaDiff.Height;
+ if(width < 0)
+ width = 0;
+ if(height < 0)
+ height = 0;
+
+
+ labelsSize = (float)Math.Max(
+ labelsSize,
+ Math.Max(width, height));
+ }
+ else if(labelsStyle == CircularAxisLabelsStyle.Horizontal)
+ {
+ // Get text angle
+ float textAngle = axis.AxisPosition;
+ if(textAngle > 180f)
+ {
+ textAngle -= 180f;
+ }
+
+ // Get label rotated position
+ PointF[] labelPosition = new PointF[] { new PointF(areaCenterAbs.X, plotAreaRectAbs.Y) };
+ Matrix newMatrix = new Matrix();
+ newMatrix.RotateAt(textAngle, areaCenterAbs);
+ newMatrix.TransformPoints(labelPosition);
+
+ // Calculate width
+ float width = textSize.Width;
+ width -= areaRectAbs.Right - labelPosition[0].X;
+ if(width < 0f)
+ {
+ width = 0f;
+ }
+
+ labelsSize = (float)Math.Max(
+ labelsSize,
+ Math.Max(width, textSize.Height));
+ }
+ }
+
+ return labelsSize;
+ }
+
+ /// <summary>
+ /// True if polygons should be used instead of the circles for the chart area.
+ /// </summary>
+ internal bool CircularUsePolygons
+ {
+ get
+ {
+ // Check if value was precalculated
+ if(this._circularUsePolygons == int.MinValue)
+ {
+ _circularUsePolygons = 0;
+
+ // Look for custom properties in series
+ foreach(Series series in this.Common.DataManager.Series)
+ {
+ if(series.ChartArea == this.Name && series.IsVisible())
+ {
+ // Get custom attribute
+ if (series.IsCustomPropertySet(CustomPropertyName.AreaDrawingStyle))
+ {
+ if(String.Compare(series[CustomPropertyName.AreaDrawingStyle], "Polygon", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ _circularUsePolygons = 1;
+ }
+ else if (String.Compare(series[CustomPropertyName.AreaDrawingStyle], "Circle", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ _circularUsePolygons = 0;
+ }
+ else
+ {
+ throw(new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid( series[CustomPropertyName.AreaDrawingStyle], "AreaDrawingStyle")));
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ return (this._circularUsePolygons == 1);
+ }
+ }
+
+ /// <summary>
+ /// Gets circular area axis labels style.
+ /// </summary>
+ /// <returns>Axis labels style.</returns>
+ internal CircularAxisLabelsStyle GetCircularAxisLabelsStyle()
+ {
+ CircularAxisLabelsStyle style = CircularAxisLabelsStyle.Auto;
+
+ // Get maximum number of points in all series
+ foreach(Series series in this.Common.DataManager.Series)
+ {
+ if(series.IsVisible() && series.ChartArea == this.Name && series.IsCustomPropertySet(CustomPropertyName.CircularLabelsStyle))
+ {
+ string styleName = series[CustomPropertyName.CircularLabelsStyle];
+ if(String.Compare( styleName, "Auto", StringComparison.OrdinalIgnoreCase) == 0 )
+ {
+ style = CircularAxisLabelsStyle.Auto;
+ }
+ else if(String.Compare( styleName,"Circular", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ style = CircularAxisLabelsStyle.Circular;
+ }
+ else if(String.Compare( styleName,"Radial", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ style = CircularAxisLabelsStyle.Radial;
+ }
+ else if (String.Compare(styleName, "Horizontal", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ style = CircularAxisLabelsStyle.Horizontal;
+ }
+ else
+ {
+ throw(new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid( styleName, "CircularLabelsStyle")));
+ }
+
+ }
+ }
+
+ // Get auto style
+ if(style == CircularAxisLabelsStyle.Auto)
+ {
+ int sectorNumber = CircularSectorsNumber;
+ style = CircularAxisLabelsStyle.Horizontal;
+ if(sectorNumber > 30)
+ {
+ style = CircularAxisLabelsStyle.Radial;
+ }
+ }
+
+ return style;
+ }
+
+ /// <summary>
+ /// Number of sectors in the circular area.
+ /// </summary>
+ internal int CircularSectorsNumber
+ {
+ get
+ {
+ // Check if value was precalculated
+ if(this._circularSectorNumber == int.MinValue)
+ {
+ this._circularSectorNumber = GetCircularSectorNumber();
+ }
+
+ return this._circularSectorNumber;
+ }
+ }
+
+ /// <summary>
+ /// Gets number of sectors in the circular chart area.
+ /// </summary>
+ /// <returns>Number of sectors.</returns>
+ private int GetCircularSectorNumber()
+ {
+ ICircularChartType type = this.GetCircularChartType();
+ if(type != null)
+ {
+ return type.GetNumerOfSectors(this, this.Common.DataManager.Series);
+ }
+ return 0;
+ }
+
+ /// <summary>
+ /// Fills a list of circular axis.
+ /// </summary>
+ /// <returns>Axes list.</returns>
+ internal ArrayList GetCircularAxisList()
+ {
+ // Check if list was already created
+ if(_circularAxisList == null)
+ {
+ _circularAxisList = new ArrayList();
+
+ // Loop through all sectors
+ int sectorNumber = GetCircularSectorNumber();
+ for(int sectorIndex = 0; sectorIndex < sectorNumber; sectorIndex++)
+ {
+ // Create new axis object
+ CircularChartAreaAxis axis = new CircularChartAreaAxis(sectorIndex * 360f/sectorNumber);
+
+ // Check if custom X axis labels will be used
+ if(this.AxisX.CustomLabels.Count > 0)
+ {
+ if(sectorIndex < this.AxisX.CustomLabels.Count)
+ {
+ axis.Title = this.AxisX.CustomLabels[sectorIndex].Text;
+ axis.TitleForeColor = this.AxisX.CustomLabels[sectorIndex].ForeColor;
+ }
+ }
+ else
+ {
+ // Get axis title from all series
+ foreach(Series series in this.Common.DataManager.Series)
+ {
+ if(series.IsVisible() && series.ChartArea == this.Name && sectorIndex < series.Points.Count)
+ {
+ if(series.Points[sectorIndex].AxisLabel.Length > 0)
+ {
+ axis.Title = series.Points[sectorIndex].AxisLabel;
+ break;
+ }
+ }
+ }
+ }
+
+ // Add axis into the list
+ _circularAxisList.Add(axis);
+ }
+
+ }
+ return _circularAxisList;
+ }
+
+ /// <summary>
+ /// Converts circular position of the X axis to angle in degrees.
+ /// </summary>
+ /// <param name="position">X axis position.</param>
+ /// <returns>Angle in degrees.</returns>
+ internal float CircularPositionToAngle(double position)
+ {
+ // Get X axis scale size
+ double scaleRatio = 360.0 / Math.Abs(this.AxisX.Maximum - this.AxisX.Minimum);
+
+ return (float)(position * scaleRatio + this.AxisX.Crossing);
+ }
+
+ #endregion
+
+ #region 2D Series drawing order methods
+
+ /// <summary>
+ /// Helper method that returns a list of 'ChartTypeAndSeriesInfo' objects.
+ /// This list is used for chart area series drawing in 2D mode. Each
+ /// object may represent an individual series or all series that belong
+ /// to one chart type.
+ ///
+ /// This method is intended to fix issues #6443 and #5385 when area chart
+ /// type incorrectly overlaps point or line chart type.
+ /// </summary>
+ /// <returns>List of 'ChartTypeAndSeriesInfo' objects.</returns>
+ private ArrayList GetChartTypesAndSeriesToDraw()
+ {
+ ArrayList resultList = new ArrayList();
+
+ // Build chart type or series position based lists
+ if (this.ChartTypes.Count > 1 &&
+ (this.ChartTypes.Contains(ChartTypeNames.Area)
+ || this.ChartTypes.Contains(ChartTypeNames.SplineArea)
+ )
+ )
+ {
+ // Array of chart type names that do not require furher processing
+ ArrayList processedChartType = new ArrayList();
+ ArrayList splitChartType = new ArrayList();
+
+ // Draw using the exact order in the series collection
+ int seriesIndex = 0;
+ foreach (Series series in this.Common.DataManager.Series)
+ {
+ // Check if series is visible and belongs to the chart area
+ if (series.ChartArea==this.Name && series.IsVisible() && series.Points.Count > 0)
+ {
+ // Check if this chart type was already processed
+ if (!processedChartType.Contains(series.ChartTypeName))
+ {
+ // Check if curent chart type can be individually processed
+ bool canBeIndividuallyProcessed = false;
+ if (series.ChartType == SeriesChartType.Point ||
+ series.ChartType == SeriesChartType.Line ||
+ series.ChartType == SeriesChartType.Spline ||
+ series.ChartType == SeriesChartType.StepLine)
+ {
+ canBeIndividuallyProcessed = true;
+ }
+
+ if (!canBeIndividuallyProcessed)
+ {
+ // Add a record to process all series of that chart type at once
+ resultList.Add(new ChartTypeAndSeriesInfo(series.ChartTypeName));
+ processedChartType.Add(series.ChartTypeName);
+ }
+ else
+ {
+ // Check if curent chart type has more that 1 series and they are split
+ // by other series
+ bool chartTypeIsSplit = false;
+
+ if (splitChartType.Contains(series.ChartTypeName))
+ {
+ chartTypeIsSplit = true;
+ }
+ else
+ {
+ bool otherChartTypeFound = false;
+ for (int curentSeriesIndex = seriesIndex + 1; curentSeriesIndex < this.Common.DataManager.Series.Count; curentSeriesIndex++)
+ {
+ if (series.ChartTypeName == this.Common.DataManager.Series[curentSeriesIndex].ChartTypeName)
+ {
+ if (otherChartTypeFound)
+ {
+ chartTypeIsSplit = true;
+ splitChartType.Add(series.ChartTypeName);
+ }
+ }
+ else
+ {
+ if (this.Common.DataManager.Series[curentSeriesIndex].ChartType == SeriesChartType.Area ||
+ this.Common.DataManager.Series[curentSeriesIndex].ChartType == SeriesChartType.SplineArea)
+ {
+ otherChartTypeFound = true;
+ }
+ }
+ }
+ }
+
+ if (chartTypeIsSplit)
+ {
+ // Add a record to process this series individually
+ resultList.Add(new ChartTypeAndSeriesInfo(series));
+ }
+ else
+ {
+ // Add a record to process all series of that chart type at once
+ resultList.Add(new ChartTypeAndSeriesInfo(series.ChartTypeName));
+ processedChartType.Add(series.ChartTypeName);
+ }
+ }
+ }
+ }
+
+ ++seriesIndex;
+ }
+ }
+ else
+ {
+ foreach (string chartType in this.ChartTypes)
+ {
+ resultList.Add(new ChartTypeAndSeriesInfo(chartType));
+ }
+ }
+
+ return resultList;
+ }
+
+ /// <summary>
+ /// Internal data structure that stores chart type name and optionally series object.
+ /// </summary>
+ internal class ChartTypeAndSeriesInfo
+ {
+ /// <summary>
+ /// Object constructor.
+ /// </summary>
+ public ChartTypeAndSeriesInfo()
+ {
+ }
+
+ /// <summary>
+ /// Object constructor.
+ /// </summary>
+ /// <param name="chartType">Chart type name to initialize with.</param>
+ public ChartTypeAndSeriesInfo(string chartType)
+ {
+ this.ChartType = chartType;
+ }
+
+ /// <summary>
+ /// Object constructor.
+ /// </summary>
+ /// <param name="series">Series to initialize with.</param>
+ public ChartTypeAndSeriesInfo(Series series)
+ {
+ this.ChartType = series.ChartTypeName;
+ this.Series = series;
+ }
+
+ // Chart type name
+ internal string ChartType = string.Empty;
+
+ // Series object. Can be set to NULL!
+ internal Series Series = null;
+
+ }
+
+ #endregion // 2D Series drawing order methods
+
+ #region IDisposable Members
+
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2213:DisposableFieldsShouldBeDisposed", MessageId = "axisX")]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2213:DisposableFieldsShouldBeDisposed", MessageId = "axisX2")]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2213:DisposableFieldsShouldBeDisposed", MessageId = "axisY")]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2213:DisposableFieldsShouldBeDisposed", MessageId = "axisY2")]
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ // Dispose managed resources
+ if (this._axisArray != null)
+ {
+ foreach (Axis axis in this._axisArray)
+ {
+ axis.Dispose();
+ }
+ this._axisArray = null;
+ }
+ if ( this._areaPosition != null)
+ {
+ this._areaPosition.Dispose();
+ this._areaPosition = null;
+ }
+ if (this._innerPlotPosition != null)
+ {
+ this._innerPlotPosition.Dispose();
+ this._innerPlotPosition = null;
+ }
+ if (this.PlotAreaPosition != null)
+ {
+ this.PlotAreaPosition.Dispose();
+ this.PlotAreaPosition = null;
+ }
+#if Microsoft_CONTROL
+ if (this.areaBufferBitmap != null)
+ {
+ this.areaBufferBitmap.Dispose();
+ this.areaBufferBitmap = null;
+ }
+ if (this._cursorX != null)
+ {
+ this._cursorX.Dispose();
+ this._cursorX = null;
+ }
+ if (this._cursorY != null)
+ {
+ this._cursorY.Dispose();
+ this._cursorY = null;
+ }
+#endif
+ }
+ base.Dispose(disposing);
+ }
+
+
+ #endregion
+
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartArea3D.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartArea3D.cs
new file mode 100644
index 00000000000..f05891df6a9
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartArea3D.cs
@@ -0,0 +1,2239 @@
+//-------------------------------------------------------------
+// <copyright company=�Microsoft Corporation�>
+// Copyright � Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: ChartArea3D.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: ChartArea3DStyle, ChartArea3D
+//
+// Purpose: ChartArea3D class represents 3D chart area. It contains
+// methods for coordinates transformation, drawing the 3D
+// scene and many 3D related helper methods.
+//
+// Reviewed: AG - Microsoft 16, 2007
+//
+//===================================================================
+
+#region Used namespaces
+using System;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Collections;
+using System.Globalization;
+using System.Collections.Generic;
+
+#if WINFORMS_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+#else
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+ using System.Web.UI;
+#endif
+
+
+#endregion
+
+#if WINFORMS_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ #region 3D lightStyle style enumerations
+
+ /// <summary>
+ /// A lighting style for a 3D chart area.
+ /// </summary>
+ public enum LightStyle
+ {
+ /// <summary>
+ /// No lighting.
+ /// </summary>
+ None,
+ /// <summary>
+ /// Simplistic lighting.
+ /// </summary>
+ Simplistic,
+ /// <summary>
+ /// Realistic lighting.
+ /// </summary>
+ Realistic
+ }
+
+ #endregion
+
+ #region 3D Center of Projetion coordinates enumeration
+
+ /// <summary>
+ /// Coordinates of the Center Of Projection
+ /// </summary>
+ [Flags]
+ internal enum COPCoordinates
+ {
+ /// <summary>
+ /// Check X coordinate.
+ /// </summary>
+ X = 1,
+ /// <summary>
+ /// Check Y coordinate.
+ /// </summary>
+ Y = 2,
+ /// <summary>
+ /// Check Z coordinate.
+ /// </summary>
+ Z = 4
+ }
+
+ #endregion
+
+ /// <summary>
+ /// The ChartArea3DStyleClass class provides the functionality for 3D attributes of chart areas,
+ /// such as rotation angles and perspective.
+ /// </summary>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class ChartArea3DStyle
+ {
+ #region Constructor and Initialization
+
+ /// <summary>
+ /// ChartArea3DStyle constructor.
+ /// </summary>
+ public ChartArea3DStyle()
+ {
+ }
+
+ /// <summary>
+ /// ChartArea3DStyle constructor.
+ /// </summary>
+ public ChartArea3DStyle(ChartArea chartArea)
+ {
+ this._chartArea = chartArea;
+ }
+
+ /// <summary>
+ /// Initialize Chart area and axes
+ /// </summary>
+ /// <param name="chartArea">Chart area object.</param>
+ internal void Initialize(ChartArea chartArea)
+ {
+ this._chartArea = chartArea;
+ }
+
+ #endregion
+
+ #region Fields
+
+ // Reference to the chart area object
+ private ChartArea _chartArea = null;
+
+ // Enables/disables 3D chart types in the area.
+ private bool _enable3D = false;
+
+ // Indicates that axes are set at the right angle independent of the rotation.
+ private bool _isRightAngleAxes = true;
+
+ // Indicates that series should be drawn as isClustered.
+ private bool _isClustered = false;
+
+ // 3D area lightStyle style.
+ private LightStyle _lightStyle = LightStyle.Simplistic;
+
+ // 3D area perspective which controls the scaleView of the chart depth.
+ private int _perspective = 0;
+
+ // Chart area rotation angle around the X axis.
+ private int _inclination = 30;
+
+ // Chart area rotation angle around the Y axis.
+ private int _rotation = 30;
+
+ // Chart area walls width.
+ private int _wallWidth = 7;
+
+ // Series points depth in percentages
+ private int _pointDepth = 100;
+
+ // Series points gap depth in percentages
+ private int _pointGapDepth = 100;
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets a Boolean value that toggles 3D for a chart area on and off.
+ /// </summary>
+ [
+ SRCategory("CategoryAttribute3D"),
+ Bindable(true),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeChartArea3DStyle_Enable3D"),
+ ParenthesizePropertyNameAttribute(true)
+ ]
+ public bool Enable3D
+ {
+ get
+ {
+ return this._enable3D;
+ }
+ set
+ {
+ if (this._enable3D != value)
+ {
+ this._enable3D = value;
+
+ if (this._chartArea != null)
+ {
+#if SUBAXES
+ // If one of the axes has sub axis the scales has to be recalculated
+ foreach(Axis axis in this._chartArea.Axes)
+ {
+ if(axis.SubAxes.Count > 0)
+ {
+ this._chartArea.ResetAutoValues();
+ break;
+ }
+ }
+#endif // SUBAXES
+
+ this._chartArea.Invalidate();
+ }
+ }
+ }
+ }
+
+
+ /// <summary>
+ /// Gets or sets a Boolean that determines if a chart area is displayed using an isometric projection.
+ /// </summary>
+ [
+ SRCategory("CategoryAttribute3D"),
+ Bindable(true),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeChartArea3DStyle_RightAngleAxes"),
+ RefreshPropertiesAttribute(RefreshProperties.All)
+ ]
+ public bool IsRightAngleAxes
+ {
+ get
+ {
+ return _isRightAngleAxes;
+ }
+ set
+ {
+ _isRightAngleAxes = value;
+
+ // Adjust 3D properties values
+ if (_isRightAngleAxes)
+ {
+ // Disable perspective if right angle axis are used
+ this._perspective = 0;
+ }
+
+ if (this._chartArea != null)
+ {
+ this._chartArea.Invalidate();
+ }
+ }
+ }
+
+
+ /// <summary>
+ /// Gets or sets a Boolean value that determines if bar chart or column
+ /// chart data series are clustered (displayed along distinct rows).
+ /// </summary>
+ [
+ SRCategory("CategoryAttribute3D"),
+ Bindable(true),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeChartArea3DStyle_Clustered"),
+ ]
+ public bool IsClustered
+ {
+ get
+ {
+ return _isClustered;
+ }
+ set
+ {
+ _isClustered = value;
+ if (this._chartArea != null)
+ {
+ this._chartArea.Invalidate();
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the style of lighting for a 3D chart area.
+ /// </summary>
+ [
+ SRCategory("CategoryAttribute3D"),
+ Bindable(true),
+ DefaultValue(typeof(LightStyle), "Simplistic"),
+ SRDescription("DescriptionAttributeChartArea3DStyle_Light"),
+ ]
+ public LightStyle LightStyle
+ {
+ get
+ {
+ return _lightStyle;
+ }
+ set
+ {
+ _lightStyle = value;
+ if (this._chartArea != null)
+ {
+ this._chartArea.Invalidate();
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the percent of perspective for a 3D chart area.
+ /// </summary>
+ [
+ SRCategory("CategoryAttribute3D"),
+ Bindable(true),
+ DefaultValue(0),
+ SRDescription("DescriptionAttributeChartArea3DStyle_Perspective"),
+ RefreshPropertiesAttribute(RefreshProperties.All)
+ ]
+ public int Perspective
+ {
+ get
+ {
+ return _perspective;
+ }
+ set
+ {
+ if(value < 0 || value > 100)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionChartArea3DPerspectiveInvalid));
+ }
+
+ _perspective = value;
+
+ // Adjust 3D properties values
+ if (_perspective != 0)
+ {
+ // Disable right angle axes
+ this._isRightAngleAxes = false;
+ }
+
+ if (this._chartArea != null)
+ {
+ this._chartArea.Invalidate();
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the inclination for a 3D chart area.
+ /// </summary>
+ [
+ SRCategory("CategoryAttribute3D"),
+ Bindable(true),
+ DefaultValue(30),
+ SRDescription("DescriptionAttributeChartArea3DStyle_Inclination"),
+ RefreshPropertiesAttribute(RefreshProperties.All)
+ ]
+ public int Inclination
+ {
+ get
+ {
+ return _inclination;
+ }
+ set
+ {
+ if(value < -90 || value > 90)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionChartArea3DInclinationInvalid));
+ }
+ _inclination = value;
+
+ if (this._chartArea != null)
+ {
+ this._chartArea.Invalidate();
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the rotation angle for a 3D chart area.
+ /// </summary>
+ [
+ SRCategory("CategoryAttribute3D"),
+ Bindable(true),
+ DefaultValue(30),
+ SRDescription("DescriptionAttributeChartArea3DStyle_Rotation"),
+ RefreshPropertiesAttribute(RefreshProperties.All)
+ ]
+ public int Rotation
+ {
+ get
+ {
+ return _rotation;
+ }
+ set
+ {
+ if(value < -180 || value > 180)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionChartArea3DRotationInvalid));
+ }
+ _rotation = value;
+
+ if (this._chartArea != null)
+ {
+ this._chartArea.Invalidate();
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the width of the walls displayed in 3D chart areas.
+ /// </summary>
+ [
+ SRCategory("CategoryAttribute3D"),
+ Bindable(true),
+ DefaultValue(7),
+ SRDescription("DescriptionAttributeChartArea3DStyle_WallWidth"),
+ RefreshPropertiesAttribute(RefreshProperties.All)
+ ]
+ public int WallWidth
+ {
+ get
+ {
+ return _wallWidth;
+ }
+ set
+ {
+ if(value < 0 || value > 30)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionChartArea3DWallWidthInvalid));
+ }
+
+ _wallWidth = value;
+ if (this._chartArea != null)
+ {
+ this._chartArea.Invalidate();
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the depth of data points displayed in 3D chart areas (0-1000%).
+ /// </summary>
+ [
+ SRCategory("CategoryAttribute3D"),
+ Bindable(true),
+ DefaultValue(100),
+ SRDescription("DescriptionAttributeChartArea3DStyle_PointDepth"),
+ RefreshPropertiesAttribute(RefreshProperties.All)
+ ]
+ public int PointDepth
+ {
+ get
+ {
+ return _pointDepth;
+ }
+ set
+ {
+ if(value < 0 || value > 1000)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionChartArea3DPointsDepthInvalid));
+ }
+
+ _pointDepth = value;
+ if (this._chartArea != null)
+ {
+ this._chartArea.Invalidate();
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the distance between series rows in 3D chart areas (0-1000%).
+ /// </summary>
+ [
+ SRCategory("CategoryAttribute3D"),
+ Bindable(true),
+ DefaultValue(100),
+ SRDescription("DescriptionAttributeChartArea3DStyle_PointGapDepth"),
+ RefreshPropertiesAttribute(RefreshProperties.All)
+ ]
+ public int PointGapDepth
+ {
+ get
+ {
+ return _pointGapDepth;
+ }
+ set
+ {
+ if(value < 0 || value > 1000)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionChartArea3DPointsGapInvalid));
+ }
+
+ _pointGapDepth = value;
+ if (this._chartArea != null)
+ {
+ this._chartArea.Invalidate();
+ }
+ }
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// ChartArea3D class represents 3D chart area. It contains all the 3D
+ /// scene settings and methods for drawing the 3D plotting area, and calculating
+ /// the depth of chart elements.
+ /// </summary>
+ public partial class ChartArea
+ {
+ #region Fields
+
+ // Chart area 3D style attribuytes
+ private ChartArea3DStyle _area3DStyle = new ChartArea3DStyle();
+
+ // Coordinate convertion matrix
+ internal Matrix3D matrix3D = new Matrix3D();
+
+ // Chart area scene wall width in relative coordinates
+ internal SizeF areaSceneWallWidth = SizeF.Empty;
+
+ // Chart area scene depth
+ internal float areaSceneDepth = 0;
+
+ // Visible surfaces in plotting area
+ private SurfaceNames _visibleSurfaces;
+
+ // Z axis depth of series points
+ private double _pointsDepth = 0;
+
+ // Z axis depth of the gap between isClustered series
+ private double _pointsGapDepth = 0;
+
+ /// <summary>
+ /// Indicates that series order should be reversed to simulate Y axis rotation.
+ /// </summary>
+ private bool _reverseSeriesOrder = false;
+
+ /// <summary>
+ /// Old X axis reversed flag
+ /// </summary>
+ internal bool oldReverseX = false;
+
+ /// <summary>
+ /// Old Y axis reversed flag
+ /// </summary>
+ internal bool oldReverseY = false;
+
+ /// <summary>
+ /// Old Y axis rotation angle
+ /// </summary>
+ internal int oldYAngle = 30;
+
+ /// <summary>
+ /// List of all stack group names
+ /// </summary>
+ private ArrayList _stackGroupNames = null;
+
+ /// <summary>
+ /// This list contains an array of series names for each 3D cluster
+ /// </summary>
+ internal List<List<string>> seriesClusters = null;
+
+ #endregion
+
+ #region 3D Style properties
+
+ /// <summary>
+ /// Gets or sets a ChartArea3DStyle object, used to draw all series in a chart area in 3D.
+ /// </summary>
+ [
+ SRCategory("CategoryAttribute3D"),
+ Bindable(true),
+ DefaultValue(null),
+ SRDescription("DescriptionAttributeArea3DStyle"),
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+ TypeConverter(typeof(NoNameExpandableObjectConverter)),
+#if !WINFORMS_CONTROL
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ ]
+ public ChartArea3DStyle Area3DStyle
+ {
+ get
+ {
+ return _area3DStyle;
+ }
+ set
+ {
+ _area3DStyle = value;
+
+ // Initialize style object
+ _area3DStyle.Initialize((ChartArea)this);
+ }
+ }
+
+ /// <summary>
+ /// Indicates that series order should be reversed to simulate Y axis rotation.
+ /// </summary>
+ internal bool ReverseSeriesOrder
+ {
+ get { return _reverseSeriesOrder; }
+ }
+
+ /// <summary>
+ /// Gets the list of all stack group names
+ /// </summary>
+ internal ArrayList StackGroupNames
+ {
+ get { return _stackGroupNames; }
+ }
+
+ #endregion
+
+ #region 3D Coordinates transfotmation methods
+
+ /// <summary>
+ /// Call this method to apply 3D transformations on an array of 3D points (must be done before calling GDI+ drawing methods).
+ /// </summary>
+ /// <param name="points">3D Points array.</param>
+ public void TransformPoints( Point3D[] points )
+ {
+ // Convert Z coordinates from 0-100% to axis values
+ foreach(Point3D pt in points)
+ {
+ pt.Z = (pt.Z / 100f) * this.areaSceneDepth;
+ }
+
+ // Transform points
+ this.matrix3D.TransformPoints( points );
+ }
+
+ #endregion
+
+ #region 3D Scene drawing methods
+
+ /// <summary>
+ /// Draws chart area 3D scene, which consists of 3 or 2 walls.
+ /// </summary>
+ /// <param name="graph">Chart graphics object.</param>
+ /// <param name="position">Chart area 2D position.</param>
+ internal void DrawArea3DScene(ChartGraphics graph, RectangleF position)
+ {
+ // Reference to the chart area class
+ ChartArea chartArea = (ChartArea)this;
+
+ // Calculate relative size of the wall
+ areaSceneWallWidth = graph.GetRelativeSize( new SizeF(this.Area3DStyle.WallWidth, this.Area3DStyle.WallWidth));
+
+ //***********************************************************
+ //** Calculate the depth of the chart area scene
+ //***********************************************************
+ areaSceneDepth = GetArea3DSceneDepth();
+
+ //***********************************************************
+ //** Initialize coordinate transformation matrix
+ //***********************************************************
+ this.matrix3D.Initialize(
+ position,
+ areaSceneDepth,
+ this.Area3DStyle.Inclination,
+ this.Area3DStyle.Rotation,
+ this.Area3DStyle.Perspective,
+ this.Area3DStyle.IsRightAngleAxes);
+
+ //***********************************************************
+ //** Initialize Lighting
+ //***********************************************************
+ this.matrix3D.InitLight(
+ this.Area3DStyle.LightStyle
+ );
+
+ //***********************************************************
+ //** Find chart area visible surfaces
+ //***********************************************************
+ _visibleSurfaces = graph.GetVisibleSurfaces(
+ position,
+ 0,
+ areaSceneDepth,
+ this.matrix3D);
+
+ //***********************************************************
+ //** Chech if area scene should be drawn
+ //***********************************************************
+ Color sceneBackColor = chartArea.BackColor;
+
+ // Do not draw the transparent walls
+ if(sceneBackColor == Color.Transparent)
+ {
+ // Area wall is not visible
+ areaSceneWallWidth = SizeF.Empty;
+ return;
+ }
+
+ // If color is not set (default) - use LightGray
+ if(sceneBackColor == Color.Empty)
+ {
+ sceneBackColor = Color.LightGray;
+ }
+
+ //***********************************************************
+ //** Adjust scene 2D rectangle so that wall are drawn
+ //** outside plotting area.
+ //***********************************************************
+ // If bottom wall is visible
+ if(IsBottomSceneWallVisible())
+ {
+ position.Height += areaSceneWallWidth.Height;
+ }
+
+ // Adjust for the left/right wall
+ position.Width += areaSceneWallWidth.Width;
+ if(this.Area3DStyle.Rotation > 0)
+ {
+ position.X -= areaSceneWallWidth.Width;
+ }
+
+ //***********************************************************
+ //** Draw scene walls
+ //***********************************************************
+
+ // Draw back wall
+ RectangleF wallRect2D = new RectangleF(position.Location, position.Size);
+ float wallDepth = areaSceneWallWidth.Width;
+ float wallZPosition = -wallDepth;
+
+ // For isometric projection Front wall should be visible sometimes
+ if( IsMainSceneWallOnFront())
+ {
+ wallZPosition = areaSceneDepth;
+ }
+
+ graph.Fill3DRectangle(
+ wallRect2D,
+ wallZPosition,
+ wallDepth,
+ this.matrix3D,
+ chartArea.Area3DStyle.LightStyle,
+ sceneBackColor,
+ chartArea.BorderColor,
+ chartArea.BorderWidth,
+ chartArea.BorderDashStyle,
+ DrawingOperationTypes.DrawElement );
+
+ // Draw side wall on the left or right side
+ wallRect2D = new RectangleF(position.Location, position.Size);
+ wallRect2D.Width = areaSceneWallWidth.Width;
+ if(!IsSideSceneWallOnLeft())
+ {
+ // Wall is on the right side
+ wallRect2D.X = position.Right - areaSceneWallWidth.Width;
+ }
+ graph.Fill3DRectangle(
+ wallRect2D,
+ 0f,
+ areaSceneDepth,
+ this.matrix3D,
+ chartArea.Area3DStyle.LightStyle,
+ sceneBackColor,
+ chartArea.BorderColor,
+ chartArea.BorderWidth,
+ chartArea.BorderDashStyle,
+ DrawingOperationTypes.DrawElement);
+
+ // Draw bottom wall
+ if(IsBottomSceneWallVisible())
+ {
+ wallRect2D = new RectangleF(position.Location, position.Size);
+ wallRect2D.Height = areaSceneWallWidth.Height;
+ wallRect2D.Y = position.Bottom - areaSceneWallWidth.Height;
+ wallRect2D.Width -= areaSceneWallWidth.Width;
+ if(IsSideSceneWallOnLeft())
+ {
+ wallRect2D.X += areaSceneWallWidth.Width;
+ }
+
+ wallZPosition = 0;
+ graph.Fill3DRectangle(
+ wallRect2D,
+ 0f,
+ areaSceneDepth,
+ this.matrix3D,
+ chartArea.Area3DStyle.LightStyle,
+ sceneBackColor,
+ chartArea.BorderColor,
+ chartArea.BorderWidth,
+ chartArea.BorderDashStyle,
+ DrawingOperationTypes.DrawElement );
+ }
+
+ }
+
+ /// <summary>
+ /// Helper method which return True if bottom wall of the
+ /// chart area scene is visible.
+ /// </summary>
+ /// <returns>True if bottom wall is visible.</returns>
+ internal bool IsBottomSceneWallVisible()
+ {
+ return (this.Area3DStyle.Inclination >= 0);
+ }
+
+ /// <summary>
+ /// Helper method which return True if main wall of the
+ /// chart area scene is displayed on the front side.
+ /// </summary>
+ /// <returns>True if front wall is visible.</returns>
+ internal bool IsMainSceneWallOnFront()
+ {
+ // Note: Not used in this version!
+ return false;
+ }
+
+ /// <summary>
+ /// Helper method which return True if side wall of the
+ /// chart area scene is displayed on the left side.
+ /// </summary>
+ /// <returns>True if bottom wall is visible.</returns>
+ internal bool IsSideSceneWallOnLeft()
+ {
+ return (this.Area3DStyle.Rotation > 0);
+ }
+
+ #endregion
+
+ #region 3D Scene depth claculation methods
+
+ /// <summary>
+ /// Call this method to get the Z position of a series (useful for custom drawing).
+ /// </summary>
+ /// <param name="series">The series to retrieve the Z position for.</param>
+ /// <returns>The Z position of the specified series. Measured as a percentage of the chart area's depth.</returns>
+ public float GetSeriesZPosition(Series series)
+ {
+ float positionZ, depth;
+ GetSeriesZPositionAndDepth(series, out depth, out positionZ);
+ return ((positionZ + depth/2f) / this.areaSceneDepth) * 100f;
+ }
+
+ /// <summary>
+ /// Call this method to get the depth of a series in a chart area.
+ /// </summary>
+ /// <param name="series">The series to retrieve the depth for.</param>
+ /// <returns>The depth of the specified series. Measured as a percentage of the chart area's depth.</returns>
+ public float GetSeriesDepth(Series series)
+ {
+ float positionZ, depth;
+ GetSeriesZPositionAndDepth(series, out depth, out positionZ);
+ return (depth / this.areaSceneDepth) * 100f;
+ }
+
+ /// <summary>
+ /// Calculates area 3D scene depth depending on the number of isClustered
+ /// series and interval between points.
+ /// </summary>
+ /// <returns>Returns the depth of the chart area scene.</returns>
+ private float GetArea3DSceneDepth()
+ {
+ //***********************************************************
+ //** Calculate the smallest interval between points
+ //***********************************************************
+
+ // Check if any series attached to the area is indexed
+ bool indexedSeries = ChartHelper.IndexedSeries(this.Common, this._series.ToArray());
+
+ // Smallest interval series
+ Series smallestIntervalSeries = null;
+ if(this._series.Count > 0)
+ {
+ smallestIntervalSeries = this.Common.DataManager.Series[(string)this._series[0]];
+ }
+
+ // Get X axis
+ Axis xAxis = ((ChartArea)this).AxisX;
+ if(this._series.Count > 0)
+ {
+ Series firstSeries = this.Common.DataManager.Series[this._series[0]];
+ if(firstSeries != null && firstSeries.XAxisType == AxisType.Secondary)
+ {
+ xAxis = ((ChartArea)this).AxisX2;
+ }
+ }
+
+ // Get smallest interval between points (use interval 1 for indexed series)
+ double clusteredInterval = 1;
+ if(!indexedSeries)
+ {
+ bool sameInterval;
+ clusteredInterval = this.GetPointsInterval(this._series, xAxis.IsLogarithmic, xAxis.logarithmBase, false, out sameInterval, out smallestIntervalSeries);
+ }
+
+ //***********************************************************
+ //** Check if "DrawSideBySide" attribute is set.
+ //***********************************************************
+ bool drawSideBySide = false;
+ if(smallestIntervalSeries != null)
+ {
+ drawSideBySide = Common.ChartTypeRegistry.GetChartType(smallestIntervalSeries.ChartTypeName).SideBySideSeries;
+ foreach(string seriesName in this._series)
+ {
+ if(this.Common.DataManager.Series[seriesName].IsCustomPropertySet(CustomPropertyName.DrawSideBySide))
+ {
+ string attribValue = this.Common.DataManager.Series[seriesName][CustomPropertyName.DrawSideBySide];
+ if(String.Compare(attribValue, "False", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ drawSideBySide = false;
+ }
+ else if(String.Compare(attribValue, "True", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ drawSideBySide = true;
+ }
+ else if (String.Compare(attribValue, "Auto", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ // Do nothing
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionAttributeDrawSideBySideInvalid));
+ }
+ }
+ }
+ }
+
+ // Get smallest interval cate----cal axis
+ Axis categoricalAxis = ((ChartArea)this).AxisX;
+ if(smallestIntervalSeries != null && smallestIntervalSeries.XAxisType == AxisType.Secondary)
+ {
+ categoricalAxis = ((ChartArea)this).AxisX2;
+ }
+
+ //***********************************************************
+ //** If series with the smallest interval is displayed
+ //** side-by-side - devide the interval by number of series
+ //** of the same chart type.
+ //***********************************************************
+ double pointWidthSize = 0.8;
+ int seriesNumber = 1;
+ if(smallestIntervalSeries != null)
+ {
+ // Check if series is side-by-side
+ if(this.Area3DStyle.IsClustered && drawSideBySide)
+ {
+ // Count number of side-by-side series
+ seriesNumber = 0;
+ foreach(string seriesName in this._series)
+ {
+ // Get series object from name
+ Series curSeries = this.Common.DataManager.Series[seriesName];
+ if(String.Compare(curSeries.ChartTypeName, smallestIntervalSeries.ChartTypeName, StringComparison.OrdinalIgnoreCase) == 0 )
+ {
+ ++seriesNumber;
+ }
+ }
+ }
+ }
+
+
+
+ //***********************************************************
+ //** Stacked column and bar charts can be drawn side-by-side
+ //** using the StackGroupName custom properties. The code
+ //** checks if multiple groups are used how many of these
+ //** groups exsist.
+ //**
+ //** If isClustered mode enabled each stack group is drawn
+ //** using it's own cluster.
+ //***********************************************************
+ if(smallestIntervalSeries != null && this.Area3DStyle.IsClustered)
+ {
+ // Check series support stack groups
+ if(Common.ChartTypeRegistry.GetChartType(smallestIntervalSeries.ChartTypeName).SupportStackedGroups)
+ {
+ // Calculate how many stack groups exsist
+ seriesNumber = 0;
+ ArrayList stackGroupNames = new ArrayList();
+ foreach(string seriesName in this._series)
+ {
+ // Get series object from name
+ Series curSeries = this.Common.DataManager.Series[seriesName];
+ if(String.Compare(curSeries.ChartTypeName, smallestIntervalSeries.ChartTypeName, StringComparison.OrdinalIgnoreCase) == 0 )
+ {
+ string seriesStackGroupName = string.Empty;
+ if(curSeries.IsCustomPropertySet(CustomPropertyName.StackedGroupName))
+ {
+ seriesStackGroupName = curSeries[CustomPropertyName.StackedGroupName];
+ }
+
+ // Add group name if it do not already exsist
+ if(!stackGroupNames.Contains(seriesStackGroupName))
+ {
+ stackGroupNames.Add(seriesStackGroupName);
+ }
+ }
+ }
+ seriesNumber = stackGroupNames.Count;
+ }
+ }
+
+
+
+ //***********************************************************
+ //** Check if series provide custom value for point\gap depth
+ //***********************************************************
+ _pointsDepth = clusteredInterval * pointWidthSize * this.Area3DStyle.PointDepth / 100.0;
+ _pointsDepth = categoricalAxis.GetPixelInterval(_pointsDepth);
+ if(smallestIntervalSeries != null)
+ {
+ _pointsDepth = smallestIntervalSeries.GetPointWidth(
+ this.Common.graph,
+ categoricalAxis,
+ clusteredInterval,
+ 0.8) / seriesNumber;
+ _pointsDepth *= this.Area3DStyle.PointDepth / 100.0;
+ }
+ _pointsGapDepth = (_pointsDepth * 0.8) * this.Area3DStyle.PointGapDepth / 100.0;
+
+ // Get point depth and gap from series
+ if(smallestIntervalSeries != null)
+ {
+ smallestIntervalSeries.GetPointDepthAndGap(
+ this.Common.graph,
+ categoricalAxis,
+ ref _pointsDepth,
+ ref _pointsGapDepth);
+ }
+
+
+ //***********************************************************
+ //** Calculate scene depth
+ //***********************************************************
+ return (float)((_pointsGapDepth + _pointsDepth) * GetNumberOfClusters());
+ }
+
+ /// <summary>
+ /// Calculates the depth and Z position for specified series.
+ /// </summary>
+ /// <param name="series">Series object.</param>
+ /// <param name="depth">Returns series depth.</param>
+ /// <param name="positionZ">Returns series Z position.</param>
+ internal void GetSeriesZPositionAndDepth(Series series, out float depth, out float positionZ)
+ {
+ // Check arguments
+ if (series == null)
+ throw new ArgumentNullException("series");
+
+ // Get series cluster index
+ int seriesIndex = GetSeriesClusterIndex(series);
+
+ // Initialize the output parameters
+ depth = (float)_pointsDepth;
+ positionZ = (float)(_pointsGapDepth / 2.0 + (_pointsDepth + _pointsGapDepth) * seriesIndex);
+ }
+
+
+
+ /// <summary>
+ /// Returns number of clusters on the Z axis.
+ /// </summary>
+ /// <returns>Number of clusters on the Z axis.</returns>
+ internal int GetNumberOfClusters()
+ {
+ if(this.seriesClusters == null)
+ {
+ // Lists that hold processed chart types and stacked groups
+ ArrayList processedChartTypes = new ArrayList();
+ ArrayList processedStackedGroups = new ArrayList();
+
+ // Reset series cluster list
+ this.seriesClusters = new List<List<string>>();
+
+ // Iterate through all series that belong to this chart area
+ int clusterIndex = -1;
+ foreach(string seriesName in this._series)
+ {
+ // Get series object by name
+ Series curSeries = this.Common.DataManager.Series[seriesName];
+
+ // Check if stacked chart type is using multiple groups that
+ // can be displayed in individual clusters
+ if(!this.Area3DStyle.IsClustered &&
+ Common.ChartTypeRegistry.GetChartType(curSeries.ChartTypeName).SupportStackedGroups)
+ {
+ // Get group name
+ string stackGroupName = StackedColumnChart.GetSeriesStackGroupName(curSeries);
+
+ // Check if group was already counted
+ if(processedStackedGroups.Contains(stackGroupName))
+ {
+ // Find in which cluster this stacked group is located
+ bool found = false;
+ for(int index = 0; !found && index < this.seriesClusters.Count; index++)
+ {
+ foreach(string name in this.seriesClusters[index])
+ {
+ // Get series object by name
+ Series ser = this.Common.DataManager.Series[name];
+ if(stackGroupName == StackedColumnChart.GetSeriesStackGroupName(ser))
+ {
+ clusterIndex = index;
+ found = true;
+ }
+ }
+ }
+ }
+ else
+ {
+ // Increase cluster index
+ clusterIndex = this.seriesClusters.Count;
+
+ // Add processed group name
+ processedStackedGroups.Add(stackGroupName);
+ }
+ }
+
+
+ // Chech if series is displayed in the same cluster than other series
+ else if( Common.ChartTypeRegistry.GetChartType(curSeries.ChartTypeName).Stacked ||
+ (this.Area3DStyle.IsClustered && Common.ChartTypeRegistry.GetChartType(curSeries.ChartTypeName).SideBySideSeries) )
+ {
+ // Check if this chart type is already in the list
+ if(processedChartTypes.Contains(curSeries.ChartTypeName.ToUpper(System.Globalization.CultureInfo.InvariantCulture)))
+ {
+ // Find in which cluster this chart type is located
+ bool found = false;
+ for(int index = 0; !found && index < this.seriesClusters.Count; index++)
+ {
+ foreach(string name in this.seriesClusters[index])
+ {
+ // Get series object by name
+ Series ser = this.Common.DataManager.Series[name];
+ if(ser.ChartTypeName.ToUpper(System.Globalization.CultureInfo.InvariantCulture) ==
+ curSeries.ChartTypeName.ToUpper(System.Globalization.CultureInfo.InvariantCulture))
+ {
+ clusterIndex = index;
+ found = true;
+ }
+ }
+ }
+ }
+ else
+ {
+ // Increase cluster index
+ clusterIndex = this.seriesClusters.Count;
+
+ // Add new chart type into the collection
+ processedChartTypes.Add(curSeries.ChartTypeName.ToUpper(System.Globalization.CultureInfo.InvariantCulture));
+ }
+ }
+ else
+ {
+ // Create New cluster
+ clusterIndex = this.seriesClusters.Count;
+ }
+
+ // Create an item in the cluster list that will hold all series names
+ if(this.seriesClusters.Count <= clusterIndex)
+ {
+ this.seriesClusters.Add(new List<string>());
+ }
+
+ // Add series name into the current cluster
+ this.seriesClusters[clusterIndex].Add(seriesName);
+ }
+ }
+
+ return this.seriesClusters.Count;
+ }
+
+ /// <summary>
+ /// Get series cluster index.
+ /// </summary>
+ /// <param name="series">Series object.</param>
+ /// <returns>Series cluster index.</returns>
+ internal int GetSeriesClusterIndex(Series series)
+ {
+ // Fill list of clusters
+ if(this.seriesClusters == null)
+ {
+ this.GetNumberOfClusters();
+ }
+
+ // Iterate through all clusters
+ for(int clusterIndex = 0; clusterIndex < this.seriesClusters.Count; clusterIndex++)
+ {
+ List<string> seriesNames = this.seriesClusters[clusterIndex];
+
+ // Iterate through all series names
+ foreach(string seriesName in seriesNames)
+ {
+ if(seriesName == series.Name)
+ {
+ // Check if series are drawn in reversed order
+ if(this._reverseSeriesOrder)
+ {
+ clusterIndex = (this.seriesClusters.Count - 1) - clusterIndex;
+ }
+ return clusterIndex;
+ }
+ }
+ }
+ return 0;
+ }
+
+
+
+ #endregion
+
+ #region 3D Scene helper methods
+
+ /// <summary>
+ /// This method is used to calculate estimated scene
+ /// depth. Regular scene depth method can not be used
+ /// because Plot area position is zero. Instead, Chart
+ /// area position is used to find depth of the scene.
+ /// Algorithm which draws axis labels will decide what
+ /// should be size and position of plotting area.
+ /// </summary>
+ /// <returns>Returns estimated scene depth</returns>
+ private float GetEstimatedSceneDepth()
+ {
+ float sceneDepth;
+
+ ChartArea area = (ChartArea) this;
+
+
+ // Reset current list of clusters
+ this.seriesClusters = null;
+
+
+ ElementPosition plottingAreaRect = area.InnerPlotPosition;
+
+ area.AxisX.PlotAreaPosition = area.Position;
+ area.AxisY.PlotAreaPosition = area.Position;
+ area.AxisX2.PlotAreaPosition = area.Position;
+ area.AxisY2.PlotAreaPosition = area.Position;
+
+ sceneDepth = GetArea3DSceneDepth();
+
+ area.AxisX.PlotAreaPosition = plottingAreaRect;
+ area.AxisY.PlotAreaPosition = plottingAreaRect;
+ area.AxisX2.PlotAreaPosition = plottingAreaRect;
+ area.AxisY2.PlotAreaPosition = plottingAreaRect;
+
+ return sceneDepth;
+ }
+
+ /// <summary>
+ /// Estimate Interval for 3D Charts. When scene is rotated the
+ /// number of labels should be changed.
+ /// </summary>
+ /// <param name="graph">Chart graphics object.</param>
+ internal void Estimate3DInterval(ChartGraphics graph )
+ {
+ // Reference to the chart area class
+ ChartArea area = (ChartArea)this;
+
+ // Calculate relative size of the wall
+ areaSceneWallWidth = graph.GetRelativeSize( new SizeF(this.Area3DStyle.WallWidth, this.Area3DStyle.WallWidth));
+
+ //***********************************************************
+ //** Calculate the depth of the chart area scene
+ //***********************************************************
+ areaSceneDepth = GetEstimatedSceneDepth();
+
+ RectangleF plottingRect = area.Position.ToRectangleF();
+
+ // Check if plot area position was recalculated.
+ // If not and non-auto InnerPlotPosition & Position were
+ // specified - do all needed calculations
+ if(PlotAreaPosition.Width == 0 &&
+ PlotAreaPosition.Height == 0 &&
+ !area.InnerPlotPosition.Auto
+ && !area.Position.Auto)
+ {
+ // Initialize plotting area position
+
+ if(!area.InnerPlotPosition.Auto)
+ {
+ plottingRect.X += (area.Position.Width / 100F) * area.InnerPlotPosition.X;
+ plottingRect.Y += (area.Position.Height / 100F) * area.InnerPlotPosition.Y;
+ plottingRect.Width = (area.Position.Width / 100F) * area.InnerPlotPosition.Width;
+ plottingRect.Height = (area.Position.Height / 100F) * area.InnerPlotPosition.Height;
+ }
+
+ }
+
+ int yAngle = GetRealYAngle( );
+
+ //***********************************************************
+ //** Initialize coordinate transformation matrix
+ //***********************************************************
+ Matrix3D intervalMatrix3D = new Matrix3D();
+ intervalMatrix3D.Initialize(
+ plottingRect,
+ areaSceneDepth,
+ this.Area3DStyle.Inclination,
+ yAngle,
+ this.Area3DStyle.Perspective,
+ this.Area3DStyle.IsRightAngleAxes);
+ bool notUsed;
+ float zPosition;
+ double size;
+
+ Point3D [] points = new Point3D[8];
+
+ if( area.switchValueAxes )
+ {
+
+ // X Axis
+ zPosition = axisX.GetMarksZPosition( out notUsed );
+
+ points[0] = new Point3D( plottingRect.X, plottingRect.Y, zPosition );
+ points[1] = new Point3D( plottingRect.X, plottingRect.Bottom, zPosition );
+
+ // Y Axis
+ zPosition = axisY.GetMarksZPosition( out notUsed );
+
+ points[2] = new Point3D( plottingRect.X, plottingRect.Bottom, zPosition );
+ points[3] = new Point3D( plottingRect.Right, plottingRect.Bottom, zPosition );
+
+ // X2 Axis
+ zPosition = axisX2.GetMarksZPosition( out notUsed );
+
+ points[4] = new Point3D( plottingRect.X, plottingRect.Y, zPosition );
+ points[5] = new Point3D( plottingRect.X, plottingRect.Bottom, zPosition );
+
+ // Y2 Axis
+ zPosition = axisY2.GetMarksZPosition( out notUsed );
+
+ points[6] = new Point3D( plottingRect.X, plottingRect.Y, zPosition );
+ points[7] = new Point3D( plottingRect.Right, plottingRect.Y, zPosition );
+ }
+ else
+ {
+ // X Axis
+ zPosition = axisX.GetMarksZPosition( out notUsed );
+
+ points[0] = new Point3D( plottingRect.X, plottingRect.Bottom, zPosition );
+ points[1] = new Point3D( plottingRect.Right, plottingRect.Bottom, zPosition );
+
+ // Y Axis
+ zPosition = axisY.GetMarksZPosition( out notUsed );
+
+ points[2] = new Point3D( plottingRect.X, plottingRect.Y, zPosition );
+ points[3] = new Point3D( plottingRect.X, plottingRect.Bottom, zPosition );
+
+ // X2 Axis
+ zPosition = axisX2.GetMarksZPosition( out notUsed );
+
+ points[4] = new Point3D( plottingRect.X, plottingRect.Y, zPosition );
+ points[5] = new Point3D( plottingRect.Right, plottingRect.Y, zPosition );
+
+ // Y2 Axis
+ zPosition = axisY2.GetMarksZPosition( out notUsed );
+
+ points[6] = new Point3D( plottingRect.X, plottingRect.Y, zPosition );
+ points[7] = new Point3D( plottingRect.X, plottingRect.Bottom, zPosition );
+ }
+
+ // Crossing has to be reset because interval and
+ // sometimes minimum and maximum are changed.
+ foreach( Axis axis in area.Axes )
+ {
+ axis.crossing = axis.tempCrossing;
+ }
+
+ // Transform all points
+ intervalMatrix3D.TransformPoints( points );
+
+ int axisIndx = 0;
+ foreach( Axis axis in area.Axes )
+ {
+ // Find size of projected axis
+ size = Math.Sqrt(
+ ( points[axisIndx].X - points[axisIndx+1].X ) * ( points[axisIndx].X - points[axisIndx+1].X ) +
+ ( points[axisIndx].Y - points[axisIndx+1].Y ) * ( points[axisIndx].Y - points[axisIndx+1].Y ) );
+
+ // At the beginning plotting area chart is not calculated because
+ // algorithm for labels calculates plotting area position. To
+ // calculate labels position we need interval and interval
+ // need this correction. Because of that Chart area is used
+ // instead of plotting area position. If secondary label is
+ // enabled error for using chart area position instead of
+ // plotting area position is much bigger. This value
+ // corrects this error.
+ float plottingChartAreaCorrection = 1;
+ if( !area.switchValueAxes )
+ {
+ plottingChartAreaCorrection = 0.5F;
+ }
+
+ // Set correction for axis size
+ if( axis.AxisName == AxisName.X || axis.AxisName == AxisName.X2 )
+ {
+ if( area.switchValueAxes )
+ axis.interval3DCorrection = size / plottingRect.Height;
+ else
+ axis.interval3DCorrection = size / plottingRect.Width;
+ }
+ else
+ {
+ if( area.switchValueAxes )
+ axis.interval3DCorrection = size / plottingRect.Width;
+ else
+ axis.interval3DCorrection = size / plottingRect.Height * plottingChartAreaCorrection;
+ }
+
+ // There is a limit for correction
+ if( axis.interval3DCorrection < 0.15 )
+ axis.interval3DCorrection = 0.15;
+
+ // There is a limit for correction
+ if( axis.interval3DCorrection > 0.8 )
+ axis.interval3DCorrection = 1.0;
+
+ axisIndx += 2;
+
+ }
+ }
+
+
+ /// <summary>
+ /// Calculates real Y angle from Y angle and reverseSeriesOrder field
+ /// </summary>
+ /// <returns>Real Y angle</returns>
+ internal int GetRealYAngle( )
+ {
+ int yAngle;
+
+ // Case from -90 to 90
+ yAngle = this.Area3DStyle.Rotation;
+
+ // Case from 90 to 180
+ if( this._reverseSeriesOrder && this.Area3DStyle.Rotation >= 0 )
+ yAngle = this.Area3DStyle.Rotation - 180;
+
+ // Case from -90 to -180
+ if( this._reverseSeriesOrder && this.Area3DStyle.Rotation <= 0 )
+ yAngle = this.Area3DStyle.Rotation + 180;
+
+ return yAngle;
+ }
+
+ /// <summary>
+ /// Check if surface element should be drawn on the Back or Front layer.
+ /// </summary>
+ /// <param name="surfaceName">Surface name.</param>
+ /// <param name="backLayer">Back/front layer.</param>
+ /// <param name="onEdge">Indicates that element is on the edge (drawn on the back layer).</param>
+ /// <returns>True if element should be drawn.</returns>
+ internal bool ShouldDrawOnSurface(SurfaceNames surfaceName, bool backLayer, bool onEdge)
+ {
+ // Check if surface element should be drawn on the Back or Front layer.
+ bool isVisible = ((this._visibleSurfaces & surfaceName) == surfaceName);
+
+ // Elements on the edge are drawn on the back layer
+ if(onEdge)
+ {
+ return backLayer;
+ }
+
+ return (backLayer == (!isVisible) );
+ }
+
+ /// <summary>
+ /// Indicates that data points in all series of this
+ /// chart area should be drawn in reversed order.
+ /// </summary>
+ /// <returns>True if series points should be drawn in reversed order.</returns>
+ internal bool DrawPointsInReverseOrder()
+ {
+ return (this.Area3DStyle.Rotation <= 0);
+ }
+
+ /// <summary>
+ /// Checks if points should be drawn from sides to center.
+ /// </summary>
+ /// <param name="coord">Which coordinate of COP (X, Y or Z) to test for surface overlapping</param>
+ /// <returns>True if points should be drawn from sides to center.</returns>
+ internal bool DrawPointsToCenter(ref COPCoordinates coord)
+ {
+ bool result = false;
+ COPCoordinates resultCoordinates = 0;
+
+ // Check only if perspective is set
+ if(this.Area3DStyle.Perspective != 0)
+ {
+ if( (coord & COPCoordinates.X) == COPCoordinates.X )
+ {
+ // Only when Left & Right sides of plotting area are invisible
+ if ((this._visibleSurfaces & SurfaceNames.Left) == 0 &&
+ (this._visibleSurfaces & SurfaceNames.Right) == 0)
+ {
+ result = true;
+ }
+ resultCoordinates = resultCoordinates | COPCoordinates.X;
+ }
+ if( (coord & COPCoordinates.Y) == COPCoordinates.Y )
+ {
+ // Only when Top & Bottom sides of plotting area are invisible
+ if ((this._visibleSurfaces & SurfaceNames.Top) == 0 &&
+ (this._visibleSurfaces & SurfaceNames.Bottom) == 0)
+ {
+ result = true;
+ }
+ resultCoordinates = resultCoordinates | COPCoordinates.Y;
+ }
+ if( (coord & COPCoordinates.Z) == COPCoordinates.Z )
+ {
+ // Only when Front & Back sides of plotting area are invisible
+ if ((this._visibleSurfaces & SurfaceNames.Front) == 0 &&
+ (this._visibleSurfaces & SurfaceNames.Back) == 0)
+ {
+ result = true;
+ }
+ resultCoordinates = resultCoordinates | COPCoordinates.Z;
+ }
+ }
+
+ return result;
+ }
+
+ /// <summary>
+ /// Checks if series should be drawn from sides to center.
+ /// </summary>
+ /// <returns>True if series should be drawn from sides to center.</returns>
+ internal bool DrawSeriesToCenter()
+ {
+ // Check only if perspective is set
+ if(this.Area3DStyle.Perspective != 0)
+ {
+ // Only when Left & Right sides of plotting area are invisible
+ if ((this._visibleSurfaces & SurfaceNames.Front) == 0 &&
+ (this._visibleSurfaces & SurfaceNames.Back) == 0)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ #endregion
+
+ #region 3D Series drawing and selection methods
+
+ /// <summary>
+ /// Draws 3D series in the chart area.
+ /// </summary>
+ /// <param name="graph">Chart graphics object.</param>
+ internal void PaintChartSeries3D( ChartGraphics graph )
+ {
+ // Reference to the chart area object
+ ChartArea area = (ChartArea)this;
+
+ // Get order of series drawing
+ List<Series> seriesDrawingOrder = GetSeriesDrawingOrder(_reverseSeriesOrder);
+
+ // Loop through all series in the order of drawing
+ IChartType type;
+ foreach( object seriesObj in seriesDrawingOrder)
+ {
+ Series series = (Series)seriesObj;
+ type = Common.ChartTypeRegistry.GetChartType(series.ChartTypeName);
+ type.Paint( graph, Common, area, series );
+ }
+ }
+
+ #endregion
+
+ #region 3D Series & Points drawing order methods
+
+ /// <summary>
+ /// Gets a list of series names that belong to the same 3D cluster.
+ /// </summary>
+ /// <param name="seriesName">One of the series names that belongs to the cluster.</param>
+ /// <returns>List of all series names that belong to the same cluster as specified series.</returns>
+ internal List<string> GetClusterSeriesNames(string seriesName)
+ {
+ // Iterate through all clusters
+ foreach(List<string> seriesNames in this.seriesClusters)
+ {
+ if(seriesNames.Contains(seriesName))
+ {
+ return seriesNames;
+ }
+ }
+ return new List<string>();
+ }
+
+ /// <summary>
+ /// Gets the series list in drawing order.
+ /// </summary>
+ /// <param name="reverseSeriesOrder">Series order should be reversed because of the Y axis angle.</param>
+ /// <returns>Gets the series list in drawing order.</returns>
+ private List<Series> GetSeriesDrawingOrder(bool reverseSeriesOrder)
+ {
+ // Create list of series
+ List<Series> seriesList = new List<Series>();
+
+ // Iterate through all clusters
+ foreach(List<string> seriesNames in this.seriesClusters)
+ {
+ // Make sure there is at least one series
+ if(seriesNames.Count > 0)
+ {
+ // Get first series object in the current cluster
+ Series series = Common.DataManager.Series[seriesNames[0]];
+
+ // Add series into the drawing list
+ seriesList.Add(series);
+ }
+ }
+
+ // Reversed series list
+ if(reverseSeriesOrder)
+ {
+ seriesList.Reverse();
+ }
+
+ // Check if series should be drawn from sides into the center
+ if(DrawSeriesToCenter() &&
+ this.matrix3D.IsInitialized())
+ {
+ // Get Z coordinate of Center Of Projection
+ Point3D areaProjectionCenter = new Point3D(float.NaN, float.NaN, float.NaN);
+ areaProjectionCenter = this.GetCenterOfProjection(COPCoordinates.Z);
+ if(!float.IsNaN(areaProjectionCenter.Z))
+ {
+ // Loop through all series
+ for(int seriesIndex = 0; seriesIndex < seriesList.Count; seriesIndex++)
+ {
+ // Check if series is not empty
+ if(((Series)seriesList[seriesIndex]).Points.Count == 0)
+ {
+ continue;
+ }
+
+ // Get series Z position
+ float seriesDepth, seriesZPosition;
+ this.GetSeriesZPositionAndDepth((Series)seriesList[seriesIndex], out seriesDepth, out seriesZPosition);
+
+ // Check if series passes the Z coordinate of Center of Projection
+ if(seriesZPosition >= areaProjectionCenter.Z)
+ {
+ // Reversed all series order staring from previous series
+ --seriesIndex;
+ if(seriesIndex < 0)
+ seriesIndex = 0;
+ seriesList.Reverse(seriesIndex, seriesList.Count - seriesIndex);
+ break;
+ }
+ }
+ }
+ }
+
+ return seriesList;
+ }
+
+
+ /// <summary>
+ /// Gets number of stack groups in specified array of series names.
+ /// </summary>
+ /// <param name="seriesNamesList">Array of series names.</param>
+ /// <returns>Number of stack groups. One by default.</returns>
+ private int GetNumberOfStackGroups(IList<string> seriesNamesList)
+ {
+ this._stackGroupNames = new ArrayList();
+ foreach( object seriesName in seriesNamesList )
+ {
+ // Get series object
+ Series ser = this.Common.DataManager.Series[(string)seriesName];
+
+ // Get stack group name from the series
+ string stackGroupName = string.Empty;
+ if(ser.IsCustomPropertySet(CustomPropertyName.StackedGroupName))
+ {
+ stackGroupName = ser[CustomPropertyName.StackedGroupName];
+ }
+
+ // Add group name if it do not already exsist
+ if(!this._stackGroupNames.Contains(stackGroupName))
+ {
+ this._stackGroupNames.Add(stackGroupName);
+ }
+ }
+
+ return this._stackGroupNames.Count;
+ }
+
+ /// <summary>
+ /// Gets index of the series stack group.
+ /// </summary>
+ /// <param name="series">Series to get the index for.</param>
+ /// <param name="stackGroupName">Group name this series belongs to.</param>
+ /// <returns>Index of series stack group.</returns>
+ internal int GetSeriesStackGroupIndex(Series series, ref string stackGroupName)
+ {
+ stackGroupName = string.Empty;
+ if(this._stackGroupNames != null)
+ {
+ // Get stack group name from the series
+ if(series.IsCustomPropertySet(CustomPropertyName.StackedGroupName))
+ {
+ stackGroupName = series[CustomPropertyName.StackedGroupName];
+ }
+ return this._stackGroupNames.IndexOf(stackGroupName);
+ }
+ return 0;
+ }
+
+
+
+ /// <summary>
+ /// Determine the order of points drawing from one or several series of the same type.
+ /// </summary>
+ /// <param name="seriesNamesList">List of series names.</param>
+ /// <param name="chartType">Chart type.</param>
+ /// <param name="selection">If True selection mode is active (points order should be reversed).</param>
+ /// <param name="coord">Which coordinate of COP (X, Y or Z) to test for surface overlapping</param>
+ /// <param name="comparer">Points comparer class. Can be Null.</param>
+ /// <param name="mainYValueIndex">Index of the main Y value.</param>
+ /// <param name="sideBySide">Series should be drawn side by side.</param>
+ /// <returns>Array list of points in drawing order.</returns>
+ internal ArrayList GetDataPointDrawingOrder(
+ List<string> seriesNamesList,
+ IChartType chartType,
+ bool selection,
+ COPCoordinates coord,
+ IComparer comparer,
+ int mainYValueIndex,
+ bool sideBySide)
+ {
+ ChartArea area = (ChartArea)this;
+
+ // Array of points in all series
+ ArrayList pointsList = new ArrayList();
+
+ //************************************************************
+ //** Analyse input series
+ //************************************************************
+
+ // Find the number of data series for side-by-side drawing
+ double numOfSeries = 1;
+ if(area.Area3DStyle.IsClustered && !chartType.Stacked && sideBySide)
+ {
+ numOfSeries = seriesNamesList.Count;
+ }
+
+
+ // Check stacked series group names
+ if(chartType.SupportStackedGroups)
+ {
+ // Fill the list of group names and get the number of unique groups
+ int numberOfGroups = this.GetNumberOfStackGroups(seriesNamesList);
+
+ // If series are not isClustered set series number to the stacked group number
+ if(this.Area3DStyle.IsClustered &&
+ seriesNamesList.Count > 0)
+ {
+ numOfSeries = numberOfGroups;
+ }
+ }
+
+
+ // Check if chart series are indexed
+ bool indexedSeries = ChartHelper.IndexedSeries(this.Common, seriesNamesList.ToArray());
+
+ //************************************************************
+ //** Loop through all series and fill array of points
+ //************************************************************
+ int seriesIndx = 0;
+ foreach( object seriesName in seriesNamesList )
+ {
+ // Get series object
+ Series ser = this.Common.DataManager.Series[(string)seriesName];
+
+
+ // Check if stacked groups present
+ if(chartType.SupportStackedGroups &&
+ this._stackGroupNames != null)
+ {
+ // Get index of the series using stacked group
+ string groupName = string.Empty;
+ seriesIndx = this.GetSeriesStackGroupIndex(ser, ref groupName);
+
+ // Set current group name
+ StackedColumnChart stackedColumnChart = chartType as StackedColumnChart;
+ if (stackedColumnChart != null)
+ {
+ stackedColumnChart.currentStackGroup = groupName;
+ }
+ else
+ {
+ StackedBarChart stackedBarChart = chartType as StackedBarChart;
+ if (stackedBarChart != null)
+ {
+ stackedBarChart.currentStackGroup = groupName;
+ }
+ }
+ }
+
+
+ // Set active vertical/horizontal axis and their max/min values
+ Axis vAxis = (ser.YAxisType == AxisType.Primary) ? area.AxisY : area.AxisY2;
+ Axis hAxis = (ser.XAxisType == AxisType.Primary) ? area.AxisX : area.AxisX2;
+
+ // Get points interval:
+ // - set interval to 1 for indexed series
+ // - if points are not equaly spaced, the minimum interval between points is selected.
+ // - if points have same interval bars do not overlap each other.
+ bool sameInterval = true;
+ double interval = 1;
+ if(!indexedSeries)
+ {
+ interval = area.GetPointsInterval( seriesNamesList, hAxis.IsLogarithmic, hAxis.logarithmBase, true, out sameInterval );
+ }
+
+ // Get column width
+ double width = ser.GetPointWidth(area.Common.graph, hAxis, interval, 0.8) / numOfSeries;
+
+ // Get series depth and Z position
+ float seriesDepth, seriesZPosition;
+ this.GetSeriesZPositionAndDepth(ser, out seriesDepth, out seriesZPosition);
+
+ //************************************************************
+ //** Loop through all points in series
+ //************************************************************
+ int index = 0;
+ foreach( DataPoint point in ser.Points )
+ {
+ // Increase point index
+ index++;
+
+ // Set x position
+ double xCenterVal;
+ double xPosition;
+ if( indexedSeries )
+ {
+ // The formula for position is based on a distance
+ //from the grid line or nPoints position.
+ xPosition = hAxis.GetPosition( (double)index ) - width * ((double) numOfSeries) / 2.0 + width/2 + seriesIndx * width;
+ xCenterVal = hAxis.GetPosition( (double)index );
+
+ }
+ else if( sameInterval )
+ {
+ xPosition = hAxis.GetPosition( point.XValue ) - width * ((double) numOfSeries) / 2.0 + width/2 + seriesIndx * width;
+ xCenterVal = hAxis.GetPosition( point.XValue );
+ }
+ else
+ {
+ xPosition = hAxis.GetPosition( point.XValue );
+ xCenterVal = hAxis.GetPosition( point.XValue );
+ }
+
+
+ //************************************************************
+ //** Create and add new DataPoint3D object
+ //************************************************************
+ DataPoint3D pointEx = new DataPoint3D();
+ pointEx.indexedSeries = indexedSeries;
+ pointEx.dataPoint = point;
+ pointEx.index = index;
+ pointEx.xPosition = xPosition;
+ pointEx.xCenterVal = xCenterVal;
+ pointEx.width = ser.GetPointWidth(area.Common.graph, hAxis, interval, 0.8) / numOfSeries;
+ pointEx.depth = seriesDepth;
+ pointEx.zPosition = seriesZPosition;
+
+ // Set Y value and height
+ double yValue = chartType.GetYValue(Common, area, ser, point, index - 1, mainYValueIndex);
+ if (point.IsEmpty && Double.IsNaN(yValue))
+ {
+ yValue = 0.0;
+ }
+ pointEx.yPosition = vAxis.GetPosition(yValue);
+ pointEx.height = vAxis.GetPosition(yValue - chartType.GetYValue(Common, area, ser, point, index - 1, -1));
+
+
+ pointsList.Add(pointEx);
+ }
+
+ // Data series index
+ if(numOfSeries > 1 && sideBySide)
+ {
+ seriesIndx++;
+ }
+ }
+
+ //************************************************************
+ //** Sort points in drawing order
+ //************************************************************
+ if(comparer == null)
+ {
+ comparer = new PointsDrawingOrderComparer((ChartArea)this, selection, coord);
+ }
+ pointsList.Sort(comparer);
+
+ return pointsList;
+ }
+
+ #endregion
+
+ #region Points drawing order comparer class
+
+ /// <summary>
+ /// Used to compare points in array and sort them by drawing order.
+ /// </summary>
+ internal class PointsDrawingOrderComparer : IComparer
+ {
+ /// <summary>
+ /// Chart area object reference.
+ /// </summary>
+ private ChartArea _area = null;
+
+ /// <summary>
+ /// Area X position where visible sides are switched.
+ /// </summary>
+ private Point3D _areaProjectionCenter = new Point3D(float.NaN, float.NaN, float.NaN);
+
+ /// <summary>
+ /// Selection mode. Points order should be reversed.
+ /// </summary>
+ private bool _selection = false;
+
+ /// <summary>
+ /// Public constructor.
+ /// </summary>
+ /// <param name="area">Chart area.</param>
+ /// <param name="selection">Selection indicator.</param>
+ /// <param name="coord">Which coordinate of COP (X, Y or Z) to test for surface overlapping</param>
+ public PointsDrawingOrderComparer(ChartArea area, bool selection, COPCoordinates coord)
+ {
+ this._area = area;
+ this._selection = selection;
+
+ // Get center of projection
+ if(area.DrawPointsToCenter(ref coord))
+ {
+ _areaProjectionCenter = area.GetCenterOfProjection(coord);
+ }
+ }
+
+ /// <summary>
+ /// Comparer method.
+ /// </summary>
+ /// <param name="o1">First object.</param>
+ /// <param name="o2">Second object.</param>
+ /// <returns>Comparison result.</returns>
+ public int Compare(object o1, object o2)
+ {
+ DataPoint3D point1 = (DataPoint3D) o1;
+ DataPoint3D point2 = (DataPoint3D) o2;
+
+ int result = 0;
+ if(point1.xPosition < point2.xPosition)
+ {
+ result = -1;
+ }
+ else if(point1.xPosition > point2.xPosition)
+ {
+ result = 1;
+ }
+ else
+ {
+
+ // If X coordinate is the same - filter by Y coordinate
+ if(point1.yPosition < point2.yPosition)
+ {
+ result = 1;
+ }
+ else if(point1.yPosition > point2.yPosition)
+ {
+ result = -1;
+ }
+
+ // Order points from sides to center
+ if(!float.IsNaN(_areaProjectionCenter.Y))
+ {
+ double yMin1 = Math.Min(point1.yPosition, point1.height);
+ double yMax1 = Math.Max(point1.yPosition, point1.height);
+ double yMin2 = Math.Min(point2.yPosition, point2.height);
+ double yMax2 = Math.Max(point2.yPosition, point2.height);
+
+ if(_area.IsBottomSceneWallVisible())
+ {
+ if( yMin1 <= _areaProjectionCenter.Y && yMin2 <= _areaProjectionCenter.Y )
+ {
+ result *= -1;
+ }
+ else if( yMin1 <= _areaProjectionCenter.Y)
+ {
+ result = 1;
+ }
+
+ }
+ else
+ {
+
+ if( yMax1 >= _areaProjectionCenter.Y && yMax2 >= _areaProjectionCenter.Y )
+ {
+ result *= 1;
+ }
+ else if( yMax1 >= _areaProjectionCenter.Y)
+ {
+ result = 1;
+ }
+ else
+ {
+ result *= -1;
+ }
+ }
+ }
+
+ // Reversed order if looking from the bottom
+ else if(!_area.IsBottomSceneWallVisible())
+ {
+ result *= -1;
+ }
+
+ }
+
+ if(point1.xPosition != point2.xPosition)
+ {
+ // Order points from sides to center
+ if (!float.IsNaN(_areaProjectionCenter.X))
+ {
+ if ((point1.xPosition + point1.width / 2f) >= _areaProjectionCenter.X &&
+ (point2.xPosition + point2.width / 2f) >= _areaProjectionCenter.X)
+ {
+ result *= -1;
+ }
+ }
+
+ // Reversed order of points by X value
+ else if (_area.DrawPointsInReverseOrder())
+ {
+ result *= -1;
+ }
+ }
+
+ return (_selection) ? -result : result;
+ }
+ }
+
+#endregion
+
+ #region Center of Projection calculation methods
+
+ /// <summary>
+ /// Returns one or many (X, Y, Z) coordinates of the center of projection.
+ /// </summary>
+ /// <param name="coord">Defines coordinates to return.</param>
+ /// <returns>Center of projection. Value can be set to float.NaN if not defined or outside plotting area.</returns>
+ internal Point3D GetCenterOfProjection(COPCoordinates coord)
+ {
+ // Define 2 points in the opposite corners of the plotting area
+ Point3D[] points = new Point3D[2];
+ points[0] = new Point3D(this.PlotAreaPosition.X, this.PlotAreaPosition.Bottom, 0f);
+ points[1] = new Point3D(this.PlotAreaPosition.Right, this.PlotAreaPosition.Y, this.areaSceneDepth);
+
+ // Check if surfaces (points 1 & 2) has same orientation
+ bool xSameOrientation, ySameOrientation, zSameOrientation;
+ CheckSurfaceOrientation(
+ coord,
+ points[0],
+ points[1],
+ out xSameOrientation,
+ out ySameOrientation,
+ out zSameOrientation);
+
+ // If orientation of all surfaces is the same - no futher processing is required (COP is outside of plotting area)
+ Point3D resultPoint = new Point3D(
+ (xSameOrientation) ? float.NaN : 0f,
+ (ySameOrientation) ? float.NaN : 0f,
+ (zSameOrientation) ? float.NaN : 0f);
+ if( ( ((coord & COPCoordinates.X) != COPCoordinates.X) || xSameOrientation ) &&
+ ( ((coord & COPCoordinates.Y) != COPCoordinates.Y) || ySameOrientation ) &&
+ ( ((coord & COPCoordinates.Z) != COPCoordinates.Z) || zSameOrientation ) )
+ {
+ return resultPoint;
+ }
+
+ // Calculate the smallest interval (0.5 pixels) in relative coordinates
+ SizeF interval = new SizeF(0.5f, 0.5f);
+#if WINFORMS_CONTROL
+ interval.Width = interval.Width * 100F / ((float)(this.Common.Chart.Width - 1));
+ interval.Height = interval.Height * 100F / ((float)(this.Common.Chart.Height - 1));
+#else
+ interval.Width = interval.Width * 100F / ((float)(this.Common.Chart.Width.Value - 1));
+ interval.Height = interval.Height * 100F / ((float)(this.Common.Chart.Height.Value - 1));
+#endif //#if WINFORMS_CONTROL
+
+ // Find middle point and check it's surface orientation
+ bool doneFlag = false;
+ while(!doneFlag)
+ {
+ // Find middle point
+ Point3D middlePoint = new Point3D(
+ (points[0].X + points[1].X) / 2f,
+ (points[0].Y + points[1].Y) / 2f,
+ (points[0].Z + points[1].Z) / 2f);
+
+ // Check if surfaces (points 1 & middle) has same orientation
+ CheckSurfaceOrientation(
+ coord,
+ points[0],
+ middlePoint,
+ out xSameOrientation,
+ out ySameOrientation,
+ out zSameOrientation);
+
+ // Calculate points 1 & 2 depending on surface orientation of the middle point
+ points[(xSameOrientation) ? 0 : 1].X = middlePoint.X;
+ points[(ySameOrientation) ? 0 : 1].Y = middlePoint.Y;
+ points[(zSameOrientation) ? 0 : 1].Z = middlePoint.Z;
+
+ // Check if no more calculations required
+ doneFlag = true;
+ if( (coord & COPCoordinates.X) == COPCoordinates.X &&
+ Math.Abs(points[1].X - points[0].X) >= interval.Width)
+ {
+ doneFlag = false;
+ }
+ if( (coord & COPCoordinates.Y) == COPCoordinates.Y &&
+ Math.Abs(points[1].Y - points[0].Y) >= interval.Height)
+ {
+ doneFlag = false;
+ }
+ if( (coord & COPCoordinates.Z) == COPCoordinates.Z &&
+ Math.Abs(points[1].Z - points[0].Z) >= interval.Width)
+ {
+ doneFlag = false;
+ }
+ }
+
+ // Calculate result point
+ if(!float.IsNaN(resultPoint.X))
+ resultPoint.X = (points[0].X + points[1].X) / 2f;
+ if(!float.IsNaN(resultPoint.Y))
+ resultPoint.Y = (points[0].Y + points[1].Y) / 2f;
+ if(!float.IsNaN(resultPoint.Z))
+ resultPoint.Z = (points[0].Z + points[1].Z) / 2f;
+ return resultPoint;
+ }
+
+ /// <summary>
+ /// Checks orientations of two normal surfaces for each coordinate X, Y and Z.
+ /// </summary>
+ /// <param name="coord">Defines coordinates to return.</param>
+ /// <param name="point1">First point.</param>
+ /// <param name="point2">Second point.</param>
+ /// <param name="xSameOrientation">X surfaces orientation is the same.</param>
+ /// <param name="ySameOrientation">Y surfaces orientation is the same.</param>
+ /// <param name="zSameOrientation">Z surfaces orientation is the same.</param>
+ private void CheckSurfaceOrientation(
+ COPCoordinates coord,
+ Point3D point1,
+ Point3D point2,
+ out bool xSameOrientation,
+ out bool ySameOrientation,
+ out bool zSameOrientation)
+ {
+ Point3D[] pointsSurface = new Point3D[3];
+ bool surf1, surf2;
+
+ // Initialize returned values
+ xSameOrientation = true;
+ ySameOrientation = true;
+ zSameOrientation = true;
+
+ // Check X axis coordinates (ledt & right surfaces)
+ if( (coord & COPCoordinates.X) == COPCoordinates.X )
+ {
+ // Define Left surface coordinates, transform them and check visibility
+ pointsSurface[0] = new Point3D(point1.X, this.PlotAreaPosition.Y, 0f);
+ pointsSurface[1] = new Point3D(point1.X, this.PlotAreaPosition.Bottom, 0f);
+ pointsSurface[2] = new Point3D(point1.X, this.PlotAreaPosition.Bottom, this.areaSceneDepth);
+ this.matrix3D.TransformPoints( pointsSurface );
+ surf1 = ChartGraphics.IsSurfaceVisible(pointsSurface[0], pointsSurface[1], pointsSurface[2]);
+
+ // Define Right surface coordinates, transform them and check visibility
+ pointsSurface[0] = new Point3D(point2.X, this.PlotAreaPosition.Y, 0f);
+ pointsSurface[1] = new Point3D(point2.X, this.PlotAreaPosition.Bottom, 0f);
+ pointsSurface[2] = new Point3D(point2.X, this.PlotAreaPosition.Bottom, this.areaSceneDepth);
+ this.matrix3D.TransformPoints( pointsSurface );
+ surf2 = ChartGraphics.IsSurfaceVisible(pointsSurface[0], pointsSurface[1], pointsSurface[2]);
+
+ // Check if surfaces have same visibility
+ xSameOrientation = (surf1 == surf2);
+ }
+
+ // Check Y axis coordinates (top & bottom surfaces)
+ if( (coord & COPCoordinates.Y) == COPCoordinates.Y )
+ {
+ // Define Bottom surface coordinates, transform them and check visibility
+ pointsSurface[0] = new Point3D(this.PlotAreaPosition.X, point1.Y, this.areaSceneDepth);
+ pointsSurface[1] = new Point3D(this.PlotAreaPosition.X, point1.Y, 0f);
+ pointsSurface[2] = new Point3D(this.PlotAreaPosition.Right, point1.Y, 0f);
+ this.matrix3D.TransformPoints( pointsSurface );
+ surf1 = ChartGraphics.IsSurfaceVisible(pointsSurface[0], pointsSurface[1], pointsSurface[2]);
+
+ // Define Top surface coordinates, transform them and check visibility
+ pointsSurface[0] = new Point3D(this.PlotAreaPosition.X, point2.Y, this.areaSceneDepth);
+ pointsSurface[1] = new Point3D(this.PlotAreaPosition.X, point2.Y, 0f);
+ pointsSurface[2] = new Point3D(this.PlotAreaPosition.Right, point2.Y, 0f);
+ this.matrix3D.TransformPoints( pointsSurface );
+ surf2 = ChartGraphics.IsSurfaceVisible(pointsSurface[0], pointsSurface[1], pointsSurface[2]);
+
+ // Check if surfaces have same visibility
+ ySameOrientation = (surf1 == surf2);
+ }
+
+ // Check Y axis coordinates (front & back surfaces)
+ if( (coord & COPCoordinates.Z) == COPCoordinates.Z )
+ {
+ // Define Front surface coordinates, transform them and check visibility
+ pointsSurface[0] = new Point3D(this.PlotAreaPosition.X, this.PlotAreaPosition.Y, point1.Z);
+ pointsSurface[1] = new Point3D(this.PlotAreaPosition.X, this.PlotAreaPosition.Bottom, point1.Z);
+ pointsSurface[2] = new Point3D(this.PlotAreaPosition.Right, this.PlotAreaPosition.Bottom, point1.Z);
+ this.matrix3D.TransformPoints( pointsSurface );
+ surf1 = ChartGraphics.IsSurfaceVisible(pointsSurface[0], pointsSurface[1], pointsSurface[2]);
+
+ // Define Back surface coordinates, transform them and check visibility
+ pointsSurface[0] = new Point3D(this.PlotAreaPosition.X, this.PlotAreaPosition.Y, point2.Z);
+ pointsSurface[1] = new Point3D(this.PlotAreaPosition.X, this.PlotAreaPosition.Bottom, point2.Z);
+ pointsSurface[2] = new Point3D(this.PlotAreaPosition.Right, this.PlotAreaPosition.Bottom, point2.Z);
+ this.matrix3D.TransformPoints( pointsSurface );
+ surf2 = ChartGraphics.IsSurfaceVisible(pointsSurface[0], pointsSurface[1], pointsSurface[2]);
+
+ // Check if surfaces have same visibility
+ zSameOrientation = (surf1 == surf2);
+ }
+ }
+#endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartAreaAxes.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartAreaAxes.cs
new file mode 100644
index 00000000000..66f15e50cd5
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartAreaAxes.cs
@@ -0,0 +1,1986 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: ChartAreaAxes.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: ChartAreaAxes
+//
+// Purpose: ChartAreaAxes is base class of Chart Area class.
+// This class searches for all series, which belongs
+// to this chart area and sets axes minimum and
+// maximum values using data. This class also checks
+// for chart types, which belong to this chart area
+// and prepare axis scale according to them (Stacked
+// chart types have different max and min values).
+// This class recognizes indexed values and prepares
+// axes for them.
+//
+// Reviewed: GS - Jul 31, 2002
+// AG - August 7, 2002
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+#else
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+#endif
+{
+ /// <summary>
+ /// ChartAreaAxes class represents axes (X, Y, X2 and Y2) in the chart area.
+ /// It contains methods that collect statistical information on the series data and
+ /// other axes related methods.
+ /// </summary>
+ public partial class ChartArea
+ {
+ #region Fields
+
+ // Axes which belong to this Chart Area
+ internal Axis axisY = null;
+ internal Axis axisX = null;
+ internal Axis axisX2 = null;
+ internal Axis axisY2 = null;
+
+ // Array of series which belong to this chart area
+ private List<string> _series = new List<string>();
+
+ // Array of chart types which belong to this chart area
+ internal ArrayList chartTypes = new ArrayList();
+
+ /// <summary>
+ /// List of series names that last interval numbers where cashed for
+ /// </summary>
+ private string _intervalSeriesList = "";
+
+ // Minimum interval between two data points for all
+ // series which belong to this chart area.
+ internal double intervalData = double.NaN;
+
+ // Minimum interval between two data points for all
+ // series which belong to this chart area.
+ // IsLogarithmic version of the interval.
+ internal double intervalLogData = double.NaN;
+
+ // Series with minimum interval between two data points for all
+ // series which belong to this chart area.
+ private Series _intervalSeries = null;
+
+ // Indicates that points are located through equal X intervals
+ internal bool intervalSameSize = false;
+
+ // Indicates that points alignment checked
+ internal bool diffIntervalAlignmentChecked = false;
+
+ // Chart Area contains stacked chart types
+ internal bool stacked = false;
+
+ // Chart type with two y values used for scale ( bubble chart type )
+ internal bool secondYScale = false;
+
+ // The X and Y axes are switched
+ internal bool switchValueAxes = false;
+
+ // True for all chart types, which have axes. False for doughnut and pie chart.
+ internal bool requireAxes = true;
+
+ // Indicates that chart area has circular shape (like in radar or polar chart)
+ internal bool chartAreaIsCurcular = false;
+
+ // Chart Area contains 100 % stacked chart types
+ internal bool hundredPercent = false;
+
+ // Chart Area contains 100 % stacked chart types
+ internal bool hundredPercentNegative = false;
+
+ #endregion
+
+ #region Internal properties
+
+ /// <summary>
+ /// True if sub axis supported on this chart area
+ /// </summary>
+ internal bool IsSubAxesSupported
+ {
+ get
+ {
+ if(((ChartArea)this).Area3DStyle.Enable3D ||
+ ((ChartArea)this).chartAreaIsCurcular)
+ {
+ return false;
+ }
+ return true;
+ }
+ }
+
+ /// <summary>
+ /// Data series which belongs to this chart area.
+ /// </summary>
+ internal List<string> Series
+ {
+ get
+ {
+ return _series;
+ }
+ }
+
+ /// <summary>
+ /// Chart types which belongs to this chart area.
+ /// </summary>
+ internal ArrayList ChartTypes
+ {
+ get
+ {
+ return chartTypes;
+ }
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Gets main or sub axis from the chart area.
+ /// </summary>
+ /// <param name="axisName">Axis name. NOTE: This parameter only defines X or Y axis.
+ /// Second axisType parameter is used to select primary or secondary axis. </param>
+ /// <param name="axisType">Axis type.</param>
+ /// <param name="subAxisName">Sub-axis name or empty string.</param>
+ /// <returns>Main or sub axis of the chart area.</returns>
+ internal Axis GetAxis(AxisName axisName, AxisType axisType, string subAxisName)
+ {
+ // Ignore sub axis in 3D
+ if( ((ChartArea)this).Area3DStyle.Enable3D)
+ {
+ subAxisName = string.Empty;
+ }
+
+ if(axisName == AxisName.X || axisName == AxisName.X2)
+ {
+ if(axisType == AxisType.Primary)
+ {
+ return ((ChartArea)this).AxisX.GetSubAxis(subAxisName);
+ }
+ return ((ChartArea)this).AxisX2.GetSubAxis(subAxisName);
+ }
+ else
+ {
+ if(axisType == AxisType.Primary)
+ {
+ return ((ChartArea)this).AxisY.GetSubAxis(subAxisName);
+ }
+ return ((ChartArea)this).AxisY2.GetSubAxis(subAxisName);
+ }
+ }
+
+ /// <summary>
+ /// Sets default axis values for all different chart type
+ /// groups. Chart type groups are sets of chart types.
+ /// </summary>
+ internal void SetDefaultAxesValues( )
+ {
+ // The X and Y axes are switched ( Bar chart, stacked bar ... )
+ if( switchValueAxes )
+ {
+ // Set axis positions
+ axisY.AxisPosition = AxisPosition.Bottom;
+ axisX.AxisPosition = AxisPosition.Left;
+ axisX2.AxisPosition = AxisPosition.Right;
+ axisY2.AxisPosition = AxisPosition.Top;
+ }
+ else
+ {
+ // Set axis positions
+ axisY.AxisPosition = AxisPosition.Left;
+ axisX.AxisPosition = AxisPosition.Bottom;
+ axisX2.AxisPosition = AxisPosition.Top;
+ axisY2.AxisPosition = AxisPosition.Right;
+ }
+
+ // Reset opposite Axes field. This cashing
+ // value is used for optimization.
+ foreach( Axis axisItem in ((ChartArea)this).Axes )
+ {
+ axisItem.oppositeAxis = null;
+#if SUBAXES
+ foreach( SubAxis subAxisItem in axisItem.SubAxes )
+ {
+ subAxisItem.m_oppositeAxis = null;
+ }
+#endif // SUBAXES
+ }
+
+ // ***********************
+ // Primary X Axes
+ // ***********************
+ // Find the number of series which belong to this axis
+ if (this.chartAreaIsCurcular)
+ {
+ // Set axis Maximum/Minimum and Interval for circular chart
+ axisX.SetAutoMaximum(360.0);
+ axisX.SetAutoMinimum(0.0);
+ axisX.SetInterval = Math.Abs(axisX.maximum - axisX.minimum) / 12.0;
+ }
+ else
+ {
+ SetDefaultFromIndexesOrData(axisX, AxisType.Primary);
+ }
+
+#if SUBAXES
+ // ***********************
+ // Primary X Sub-Axes
+ // ***********************
+ foreach(SubAxis subAxis in axisX.SubAxes)
+ {
+ SetDefaultFromIndexesOrData(subAxis, AxisType.Primary);
+ }
+#endif // SUBAXES
+
+ // ***********************
+ // Secondary X Axes
+ // ***********************
+ SetDefaultFromIndexesOrData(axisX2, AxisType.Secondary);
+
+#if SUBAXES
+ // ***********************
+ // Secondary X Sub-Axes
+ // ***********************
+ foreach(SubAxis subAxis in axisX2.SubAxes)
+ {
+ SetDefaultFromIndexesOrData(subAxis, AxisType.Secondary);
+ }
+#endif // SUBAXES
+
+ // ***********************
+ // Primary Y axis
+ // ***********************
+ if( GetYAxesSeries( AxisType.Primary, string.Empty ).Count != 0 )
+ {
+ // Find minimum and maximum from Y values.
+ SetDefaultFromData( axisY );
+ axisY.EstimateAxis();
+ }
+
+#if SUBAXES
+ // ***********************
+ // Primary Y Sub-Axes
+ // ***********************
+ foreach(SubAxis subAxis in axisY.SubAxes)
+ {
+ // Find the number of series which belong to this axis
+ if( GetYAxesSeries( AxisType.Primary, subAxis.SubAxisName ).Count != 0 )
+ {
+ // Find minimum and maximum from Y values.
+ SetDefaultFromData( subAxis );
+ subAxis.EstimateAxis();
+ }
+ }
+#endif // SUBAXES
+
+ // ***********************
+ // Secondary Y axis
+ // ***********************
+ if( GetYAxesSeries( AxisType.Secondary, string.Empty ).Count != 0 )
+ {
+ // Find minimum and maximum from Y values.
+ SetDefaultFromData( axisY2 );
+ axisY2.EstimateAxis();
+ }
+
+#if SUBAXES
+ // ***********************
+ // Secondary Y Sub-Axes
+ // ***********************
+ foreach(SubAxis subAxis in axisY2.SubAxes)
+ {
+ // Find the number of series which belong to this axis
+ if( GetYAxesSeries( AxisType.Secondary, subAxis.SubAxisName ).Count != 0 )
+ {
+ // Find minimum and maximum from Y values.
+ SetDefaultFromData( subAxis );
+ subAxis.EstimateAxis();
+ }
+ }
+#endif // SUBAXES
+
+ // Sets axis position. Axis position depends
+ // on crossing and reversed value.
+ axisX.SetAxisPosition();
+ axisX2.SetAxisPosition();
+ axisY.SetAxisPosition();
+ axisY2.SetAxisPosition();
+
+ // Enable axes, which are
+ // used in data series.
+ this.EnableAxes();
+
+
+
+
+ // Get scale break segments
+ Axis[] axesYArray = new Axis[] { axisY, axisY2 };
+ foreach(Axis currentAxis in axesYArray)
+ {
+ // Get automatic scale break segments
+ currentAxis.ScaleBreakStyle.GetAxisSegmentForScaleBreaks(currentAxis.ScaleSegments);
+
+ // Make sure axis scale do not exceed segments scale
+ if(currentAxis.ScaleSegments.Count > 0)
+ {
+ // Save flag that scale segments are used
+ currentAxis.scaleSegmentsUsed = true;
+
+ if(currentAxis.minimum < currentAxis.ScaleSegments[0].ScaleMinimum)
+ {
+ currentAxis.minimum = currentAxis.ScaleSegments[0].ScaleMinimum;
+ }
+ if(currentAxis.minimum > currentAxis.ScaleSegments[currentAxis.ScaleSegments.Count - 1].ScaleMaximum)
+ {
+ currentAxis.minimum = currentAxis.ScaleSegments[currentAxis.ScaleSegments.Count - 1].ScaleMaximum;
+ }
+ }
+ }
+
+
+
+ bool useScaleSegments = false;
+
+ // Fill Labels
+ Axis[] axesArray = new Axis[] { axisX, axisX2, axisY, axisY2 };
+ foreach(Axis currentAxis in axesArray)
+ {
+
+ useScaleSegments = (currentAxis.ScaleSegments.Count > 0);
+
+ if(!useScaleSegments)
+ {
+ currentAxis.FillLabels(true);
+ }
+
+ else
+ {
+ bool removeLabels = true;
+ int segmentIndex = 0;
+ foreach(AxisScaleSegment scaleSegment in currentAxis.ScaleSegments)
+ {
+ scaleSegment.SetTempAxisScaleAndInterval();
+
+ currentAxis.FillLabels(removeLabels);
+ removeLabels = false;
+
+ scaleSegment.RestoreAxisScaleAndInterval();
+
+ // Remove last label for all segments except of the last
+ if(segmentIndex < (currentAxis.ScaleSegments.Count - 1) &&
+ currentAxis.CustomLabels.Count > 0)
+ {
+ currentAxis.CustomLabels.RemoveAt(currentAxis.CustomLabels.Count - 1);
+ }
+
+ ++segmentIndex;
+ }
+ }
+
+ }
+ foreach (Axis currentAxis in axesArray)
+ {
+ currentAxis.PostFillLabels();
+ }
+ }
+
+ /// <summary>
+ /// Sets the axis defaults.
+ /// If the at least one of the series bound to this axis is Indexed then the defaults are set using the SetDefaultsFromIndexes().
+ /// Otherwise the SetDefaultFromData() is used.
+ /// </summary>
+ /// <param name="axis">Axis to process</param>
+ /// <param name="axisType">Axis type</param>
+ private void SetDefaultFromIndexesOrData(Axis axis, AxisType axisType)
+ {
+ //Get array of the series that are linked to this axis
+ List<string> axisSeriesNames = GetXAxesSeries(axisType, axis.SubAxisName);
+ // VSTS: 196381
+ // before this change: If we find one indexed series we will treat all series as indexed.
+ // after this change : We will assume that all series are indexed.
+ // If we find one non indexed series we will treat all series as non indexed.
+ bool indexedSeries = true;
+ // DT comments 1:
+ // If we have mix of indexed with non-indexed series
+ // enforce all indexed series as non-indexed;
+ // The result of mixed type of series will be more natural
+ // and easy to detect the problem - all datapoints of indexed
+ // series will be displayed on zero position.
+ //=====================================
+ // bool nonIndexedSeries = false;
+ //=======================================
+ //Loop through the series looking for a indexed one
+ foreach(string seriesName in axisSeriesNames)
+ {
+ // Get series
+ Series series = Common.DataManager.Series[seriesName];
+ // Check if series is indexed
+ if (!ChartHelper.IndexedSeries(series))
+ {
+ // found one nonindexed series - we will treat all series as non indexed.
+ indexedSeries = false;
+ break;
+ }
+ // DT comments 2
+ //else
+ //{
+ // nonIndexedSeries = true;
+ //}
+ }
+
+ //DT comments 3
+ //if (!indexedSeries && nonIndexedSeries)
+ //{
+ // foreach (string seriesName in axisSeriesNames)
+ // {
+ // // Get series
+ // Series series = Common.DataManager.Series[seriesName];
+ // series.xValuesZeros = false;
+ // }
+ //}
+
+ if (indexedSeries)
+ {
+ if (axis.IsLogarithmic)
+ {
+ throw (new InvalidOperationException(SR.ExceptionChartAreaAxisScaleLogarithmicUnsuitable));
+ }
+ //Set axis defaults from the indexed series
+ SetDefaultFromIndexes(axis);
+ //We are done...
+ return;
+ }
+
+ // If haven't found any indexed series -> Set axis defaults from the series data
+ SetDefaultFromData(axis);
+ axis.EstimateAxis();
+ }
+
+ /// <summary>
+ /// Enable axes, which are
+ /// used in chart area data series.
+ /// </summary>
+ private void EnableAxes()
+ {
+ if( _series == null )
+ {
+ return;
+ }
+
+ bool activeX = false;
+ bool activeY = false;
+ bool activeX2 = false;
+ bool activeY2 = false;
+
+ // Data series from this chart area
+ foreach( string ser in _series )
+ {
+ Series dataSeries = Common.DataManager.Series[ ser ];
+
+ // X axes
+ if( dataSeries.XAxisType == AxisType.Primary )
+ {
+ activeX = true;
+#if SUBAXES
+ this.Activate( axisX, true, dataSeries.XSubAxisName );
+#else
+ this.Activate( axisX, true );
+#endif // SUBAXES
+
+ }
+ else
+ {
+ activeX2 = true;
+#if SUBAXES
+ this.Activate( axisX2, true, dataSeries.XSubAxisName );
+#else
+ this.Activate( axisX2, true );
+#endif // SUBAXES
+ }
+ // Y axes
+ if( dataSeries.YAxisType == AxisType.Primary )
+ {
+ activeY = true;
+#if SUBAXES
+ this.Activate( axisY, true, dataSeries.YSubAxisName );
+#else
+ this.Activate( axisY, true );
+#endif // SUBAXES
+ }
+ else
+ {
+ activeY2 = true;
+#if SUBAXES
+ this.Activate( axisY2, true, dataSeries.YSubAxisName );
+#else
+ this.Activate( axisY2, true );
+#endif // SUBAXES
+ }
+ }
+
+#if SUBAXES
+ // Enable Axes
+ if(!activeX)
+ this.Activate( axisX, false, string.Empty );
+ if(!activeY)
+ this.Activate( axisY, false, string.Empty );
+ if(!activeX2)
+ this.Activate( axisX2, false, string.Empty );
+ if(!activeY2)
+ this.Activate( axisY2, false, string.Empty );
+#else // SUBAXES
+ // Enable Axes
+ if(!activeX)
+ this.Activate( axisX, false);
+ if(!activeY)
+ this.Activate( axisY, false);
+ if(!activeX2)
+ this.Activate( axisX2, false);
+ if(!activeY2)
+ this.Activate( axisY2, false);
+#endif // SUBAXES
+ }
+
+#if SUBAXES
+
+ /// <summary>
+ /// Enable axis.
+ /// </summary>
+ /// <param name="axis">Axis.</param>
+ /// <param name="active">True if axis is active.</param>
+ /// <param name="subAxisName">Sub axis name to activate.</param>
+ private void Activate( Axis axis, bool active, string subAxisName )
+ {
+ // Auto-Enable axis
+ if( axis.autoEnabled == true )
+ {
+ axis.enabled = active;
+ }
+
+ // Auto-Enable sub axes
+ if(subAxisName.Length > 0)
+ {
+ SubAxis subAxis = axis.SubAxes.FindByName(subAxisName);
+ if(subAxis != null)
+ {
+ if( subAxis.autoEnabled == true )
+ {
+ subAxis.enabled = active;
+ }
+ }
+ }
+ }
+#else
+ /// <summary>
+ /// Enable axis.
+ /// </summary>
+ /// <param name="axis">Axis.</param>
+ /// <param name="active">True if axis is active.</param>
+ private void Activate( Axis axis, bool active )
+ {
+ if( axis.autoEnabled == true )
+ {
+ axis.enabled = active;
+ }
+ }
+#endif // SUBAXES
+
+ /// <summary>
+ /// Check if all data points from series in
+ /// this chart area are empty.
+ /// </summary>
+ /// <returns>True if all points are empty</returns>
+ bool AllEmptyPoints()
+ {
+ // Data series from this chart area
+ foreach( string seriesName in this._series )
+ {
+ Series dataSeries = Common.DataManager.Series[ seriesName ];
+
+ // Data point loop
+ foreach( DataPoint point in dataSeries.Points )
+ {
+ if( !point.IsEmpty )
+ {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ /// <summary>
+ /// This method sets default minimum and maximum
+ /// values from values in the data manager. This
+ /// case is used if X values are not equal to 0 or IsXValueIndexed flag is set.
+ /// </summary>
+ /// <param name="axis">Axis</param>
+ private void SetDefaultFromData( Axis axis )
+ {
+#if SUBAXES
+ // Process all sub-axes
+ if(!axis.IsSubAxis)
+ {
+ foreach(SubAxis subAxis in axis.SubAxes)
+ {
+ this.SetDefaultFromData( subAxis );
+ }
+ }
+#endif // SUBAXES
+
+
+ // Used for scrolling with logarithmic axes.
+ if( !Double.IsNaN(axis.ScaleView.Position) &&
+ !Double.IsNaN(axis.ScaleView.Size) &&
+ !axis.refreshMinMaxFromData &&
+ axis.IsLogarithmic )
+ {
+ return;
+ }
+
+ // Get minimum and maximum from data source
+ double autoMaximum;
+ double autoMinimum;
+ this.GetValuesFromData( axis, out autoMinimum, out autoMaximum );
+
+ // ***************************************************
+ // This part of code is used to add a margin to the
+ // axis and to set minimum value to zero if
+ // IsStartedFromZero property is used. There is special
+ // code for logarithmic scale, which will set minimum
+ // to one instead of zero.
+ // ***************************************************
+ // The minimum and maximum values from data manager don’t exist.
+
+ if( axis.enabled &&
+ ( (axis.AutoMaximum || double.IsNaN( axis.Maximum )) && (autoMaximum == Double.MaxValue || autoMaximum == Double.MinValue)) ||
+ ( (axis.AutoMinimum || double.IsNaN( axis.Minimum )) && (autoMinimum == Double.MaxValue || autoMinimum == Double.MinValue )) )
+ {
+ if( this.AllEmptyPoints() )
+ {
+ // Supress exception and use predefined min & max
+ autoMaximum = 8.0;
+ autoMinimum = 1.0;
+ }
+ else
+ {
+ if(!this.Common.ChartPicture.SuppressExceptions)
+ {
+ throw (new InvalidOperationException(SR.ExceptionAxisMinimumMaximumInvalid));
+ }
+ }
+ }
+
+ // Axis margin used for zooming
+ axis.marginView = 0.0;
+ if( axis.margin == 100 && (axis.axisType == AxisName.X || axis.axisType == AxisName.X2) )
+ {
+ axis.marginView = this.GetPointsInterval( false, 10 );
+ }
+
+ // If minimum and maximum are same margin always exist.
+ if( autoMaximum == autoMinimum &&
+ axis.Maximum == axis.Minimum )
+ {
+ axis.marginView = 1;
+ }
+
+ // Do not make axis margine for logarithmic axes
+ if( axis.IsLogarithmic )
+ {
+ axis.marginView = 0.0;
+ }
+
+ // Adjust Maximum - Add a gap
+ if( axis.AutoMaximum )
+ {
+ // Add a Gap for X axis
+ if( !axis.roundedXValues && ( axis.axisType == AxisName.X || axis.axisType == AxisName.X2 ) )
+ {
+ axis.SetAutoMaximum( autoMaximum + axis.marginView );
+ }
+ else
+ {
+ if( axis.isStartedFromZero && autoMaximum < 0 )
+ {
+ axis.SetAutoMaximum( 0.0 );
+ }
+ else
+ {
+ axis.SetAutoMaximum( autoMaximum );
+ }
+ }
+ }
+
+ // Adjust Minimum - make rounded values and add a gap
+ if( axis.AutoMinimum )
+ {
+ // IsLogarithmic axis
+ if( axis.IsLogarithmic )
+ {
+ if( autoMinimum < 1.0 )
+ {
+ axis.SetAutoMinimum( autoMinimum );
+ }
+ else if( axis.isStartedFromZero )
+ {
+ axis.SetAutoMinimum( 1.0 );
+ }
+ else
+ {
+ axis.SetAutoMinimum( autoMinimum );
+ }
+ }
+ else
+ {
+ if( autoMinimum > 0.0 ) // If Auto calculated Minimum value is positive
+ {
+ // Adjust Minimum
+ if( !axis.roundedXValues && ( axis.axisType == AxisName.X || axis.axisType == AxisName.X2 ) )
+ {
+ axis.SetAutoMinimum( autoMinimum - axis.marginView );
+ }
+ // If start From Zero property is true 0 is always on the axis.
+ // NOTE: Not applicable if date-time values are drawn. Fixes issue #5644
+ else if( axis.isStartedFromZero &&
+ !this.SeriesDateTimeType( axis.axisType, axis.SubAxisName ) )
+ {
+ axis.SetAutoMinimum( 0.0 );
+ }
+ else
+ {
+ axis.SetAutoMinimum( autoMinimum );
+ }
+ }
+ else // If Auto calculated Minimum value is non positive
+ {
+ if( axis.axisType == AxisName.X || axis.axisType == AxisName.X2 )
+ {
+ axis.SetAutoMinimum( autoMinimum - axis.marginView );
+ }
+ else
+ {
+ // If start From Zero property is true 0 is always on the axis.
+ axis.SetAutoMinimum( autoMinimum );
+ }
+ }
+ }
+ }
+
+ // If maximum or minimum are not auto set value to non logarithmic
+ if( axis.IsLogarithmic && axis.logarithmicConvertedToLinear )
+ {
+ if( !axis.AutoMinimum )
+ {
+ axis.minimum = axis.logarithmicMinimum;
+ }
+
+ if( !axis.AutoMaximum )
+ {
+ axis.maximum = axis.logarithmicMaximum;
+ }
+ // Min and max will take real values again if scale is logarithmic.
+ axis.logarithmicConvertedToLinear = false;
+ }
+
+ // Check if Minimum == Maximum
+ if(this.Common.ChartPicture.SuppressExceptions &&
+ axis.maximum == axis.minimum)
+ {
+ axis.minimum = axis.maximum;
+ axis.maximum = axis.minimum + 1.0;
+ }
+ }
+
+ /// <summary>
+ /// This method checks if all series in the chart area have “integer type”
+ /// for specified axes, which means int, uint, long and ulong.
+ /// </summary>
+ /// <param name="axisName">Name of the axis</param>
+ /// <param name="subAxisName">Sub axis name.</param>
+ /// <returns>True if all series are integer</returns>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "subAxisName")]
+ internal bool SeriesIntegerType( AxisName axisName, string subAxisName )
+ {
+ // Series which belong to this chart area
+ foreach( string seriesName in this._series )
+ {
+ Series ser = Common.DataManager.Series[ seriesName ];
+ // X axes type
+ if( axisName == AxisName.X )
+ {
+#if SUBAXES
+ if( ser.XAxisType == AxisType.Primary && ser.XSubAxisName == subAxisName)
+#else //SUBAXES
+ if ( ser.XAxisType == AxisType.Primary)
+#endif //SUBAXES
+ {
+ if(ser.XValueType != ChartValueType.Int32 &&
+ ser.XValueType != ChartValueType.UInt32 &&
+ ser.XValueType != ChartValueType.UInt64 &&
+ ser.XValueType != ChartValueType.Int64 )
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ }
+ // X axes type
+ else if( axisName == AxisName.X2 )
+ {
+#if SUBAXES
+ if( ser.XAxisType == AxisType.Secondary && ser.XSubAxisName == subAxisName)
+#else //SUBAXES
+ if ( ser.XAxisType == AxisType.Secondary)
+#endif //SUBAXES
+
+ {
+ if(ser.XValueType != ChartValueType.Int32 &&
+ ser.XValueType != ChartValueType.UInt32 &&
+ ser.XValueType != ChartValueType.UInt64 &&
+ ser.XValueType != ChartValueType.Int64 )
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ }
+ // Y axes type
+ else if( axisName == AxisName.Y )
+ {
+#if SUBAXES
+ if( ser.YAxisType == AxisType.Primary && ser.YSubAxisName == subAxisName)
+#else //SUBAXES
+ if ( ser.YAxisType == AxisType.Primary)
+#endif //SUBAXES
+
+ {
+ if(ser.YValueType != ChartValueType.Int32 &&
+ ser.YValueType != ChartValueType.UInt32 &&
+ ser.YValueType != ChartValueType.UInt64 &&
+ ser.YValueType != ChartValueType.Int64 )
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ }
+ else if( axisName == AxisName.Y2 )
+ {
+#if SUBAXES
+ if( ser.YAxisType == AxisType.Secondary && ser.YSubAxisName == subAxisName)
+#else //SUBAXES
+ if ( ser.YAxisType == AxisType.Secondary)
+#endif //SUBAXES
+
+ {
+ if(ser.YValueType != ChartValueType.Int32 &&
+ ser.YValueType != ChartValueType.UInt32 &&
+ ser.YValueType != ChartValueType.UInt64 &&
+ ser.YValueType != ChartValueType.Int64 )
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// This method checks if all series in the chart area have “date-time type”
+ /// for specified axes.
+ /// </summary>
+ /// <param name="axisName">Name of the axis</param>
+ /// <param name="subAxisName">Sub axis name.</param>
+ /// <returns>True if all series are date-time.</returns>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "subAxisName")]
+ internal bool SeriesDateTimeType( AxisName axisName, string subAxisName )
+ {
+ // Series which belong to this chart area
+ foreach( string seriesName in this._series )
+ {
+ Series ser = Common.DataManager.Series[ seriesName ];
+ // X axes type
+ if( axisName == AxisName.X )
+ {
+#if SUBAXES
+ if( ser.XAxisType == AxisType.Primary && ser.XSubAxisName == subAxisName)
+#else //SUBAXES
+ if ( ser.XAxisType == AxisType.Primary)
+#endif //SUBAXES
+ {
+ if(ser.XValueType != ChartValueType.Date &&
+ ser.XValueType != ChartValueType.DateTime &&
+ ser.XValueType != ChartValueType.Time &&
+ ser.XValueType != ChartValueType.DateTimeOffset)
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ }
+ // X axes type
+ else if( axisName == AxisName.X2 )
+ {
+#if SUBAXES
+ if( ser.XAxisType == AxisType.Secondary && ser.XSubAxisName == subAxisName)
+#else //SUBAXES
+ if ( ser.XAxisType == AxisType.Secondary)
+#endif //SUBAXES
+ {
+ if(ser.XValueType != ChartValueType.Date &&
+ ser.XValueType != ChartValueType.DateTime &&
+ ser.XValueType != ChartValueType.Time &&
+ ser.XValueType != ChartValueType.DateTimeOffset)
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ }
+ // Y axes type
+ else if( axisName == AxisName.Y )
+ {
+#if SUBAXES
+ if( ser.YAxisType == AxisType.Primary && ser.YSubAxisName == subAxisName)
+#else //SUBAXES
+ if ( ser.YAxisType == AxisType.Primary)
+#endif //SUBAXES
+ {
+ if(ser.YValueType != ChartValueType.Date &&
+ ser.YValueType != ChartValueType.DateTime &&
+ ser.YValueType != ChartValueType.Time &&
+ ser.YValueType != ChartValueType.DateTimeOffset)
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ }
+ else if( axisName == AxisName.Y2 )
+ {
+#if SUBAXES
+ if( ser.YAxisType == AxisType.Secondary && ser.YSubAxisName == subAxisName)
+#else //SUBAXES
+ if ( ser.YAxisType == AxisType.Secondary)
+#endif //SUBAXES
+ {
+ if(ser.YValueType != ChartValueType.Date &&
+ ser.YValueType != ChartValueType.DateTime &&
+ ser.YValueType != ChartValueType.Time &&
+ ser.YValueType != ChartValueType.DateTimeOffset)
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// This method calculates minimum and maximum from data series.
+ /// </summary>
+ /// <param name="axis">Axis which is used to find minimum and maximum</param>
+ /// <param name="autoMinimum">Minimum value from data.</param>
+ /// <param name="autoMaximum">Maximum value from data.</param>
+ private void GetValuesFromData( Axis axis, out double autoMinimum, out double autoMaximum )
+ {
+ // Get number of points in series
+ int currentPointsNumber = this.GetNumberOfAllPoints();
+
+ if( !axis.refreshMinMaxFromData &&
+ !double.IsNaN(axis.minimumFromData) &&
+ !double.IsNaN(axis.maximumFromData) &&
+ axis.numberOfPointsInAllSeries == currentPointsNumber )
+ {
+ autoMinimum = axis.minimumFromData;
+ autoMaximum = axis.maximumFromData;
+ return;
+ }
+
+ // Set Axis type
+ AxisType type = AxisType.Primary;
+ if( axis.axisType == AxisName.X2 || axis.axisType == AxisName.Y2 )
+ {
+ type = AxisType.Secondary;
+ }
+
+ // Creates a list of series, which have same X axis type.
+ string [] xAxesSeries = GetXAxesSeries(type, axis.SubAxisName).ToArray();
+
+ // Creates a list of series, which have same Y axis type.
+ string [] yAxesSeries = GetYAxesSeries( type, axis.SubAxisName ).ToArray();
+
+ // Get auto maximum and auto minimum value
+ if( axis.axisType == AxisName.X2 || axis.axisType == AxisName.X ) // X axis type is used (X or X2)
+ {
+ if( stacked ) // Chart area has a stacked chart types
+ {
+ try
+ {
+ Common.DataManager.GetMinMaxXValue(out autoMinimum, out autoMaximum, xAxesSeries );
+ }
+ catch(System.Exception)
+ {
+ throw (new InvalidOperationException(SR.ExceptionAxisStackedChartsDataPointsNumberMismatch));
+ }
+ }
+
+ // Chart type with two y values used for scale ( bubble chart type )
+ else if( secondYScale )
+ {
+ autoMaximum = Common.DataManager.GetMaxXWithRadiusValue( (ChartArea)this, xAxesSeries );
+ autoMinimum = Common.DataManager.GetMinXWithRadiusValue( (ChartArea)this, xAxesSeries );
+ ChartValueType valueTypes = Common.DataManager.Series[xAxesSeries[0]].XValueType;
+ if( valueTypes != ChartValueType.Date &&
+ valueTypes != ChartValueType.DateTime &&
+ valueTypes != ChartValueType.Time &&
+ valueTypes != ChartValueType.DateTimeOffset )
+ {
+ axis.roundedXValues = true;
+ }
+ }
+ else
+ {
+ Common.DataManager.GetMinMaxXValue(out autoMinimum, out autoMaximum, xAxesSeries );
+ }
+ }
+ else // Y axis type is used (Y or Y2)
+ {
+
+ // *****************************
+ // Stacked Chart AxisName
+ // *****************************
+ if( stacked ) // Chart area has a stacked chart types
+ {
+ try
+ {
+ if(hundredPercent) // It's a hundred percent stacked chart
+ {
+ autoMaximum = Common.DataManager.GetMaxHundredPercentStackedYValue(hundredPercentNegative, yAxesSeries );
+ autoMinimum = Common.DataManager.GetMinHundredPercentStackedYValue(hundredPercentNegative, yAxesSeries );
+ }
+ else
+ {
+ // If stacked groupes are used Min/Max range must calculated
+ // for each group seperatly.
+ double stackMaxBarColumn = double.MinValue;
+ double stackMinBarColumn = double.MaxValue;
+ double stackMaxArea = double.MinValue;
+ double stackMinArea = double.MaxValue;
+
+ // Split series by group names
+ ArrayList stackedGroups = this.SplitSeriesInStackedGroups(yAxesSeries);
+ foreach(string[] groupSeriesNames in stackedGroups)
+ {
+ // For stacked bar and column
+ double stackMaxBarColumnForGroup = Common.DataManager.GetMaxStackedYValue(0, groupSeriesNames );
+ double stackMinBarColumnForGroup = Common.DataManager.GetMinStackedYValue(0, groupSeriesNames );
+
+ // For stacked area
+ double stackMaxAreaForGroup = Common.DataManager.GetMaxUnsignedStackedYValue(0, groupSeriesNames );
+ double stackMinAreaForGroup = Common.DataManager.GetMinUnsignedStackedYValue(0, groupSeriesNames );
+
+ // Select minimum/maximum
+ stackMaxBarColumn = Math.Max(stackMaxBarColumn, stackMaxBarColumnForGroup);
+ stackMinBarColumn = Math.Min(stackMinBarColumn, stackMinBarColumnForGroup);
+ stackMaxArea = Math.Max(stackMaxArea, stackMaxAreaForGroup);
+ stackMinArea = Math.Min(stackMinArea, stackMinAreaForGroup);
+ }
+
+
+ autoMaximum = Math.Max(stackMaxBarColumn,stackMaxArea);
+ autoMinimum = Math.Min(stackMinBarColumn,stackMinArea);
+ }
+ // IsLogarithmic axis
+ if( axis.IsLogarithmic && autoMinimum < 1.0 )
+ autoMinimum = 1.0;
+ }
+ catch(System.Exception)
+ {
+ throw (new InvalidOperationException(SR.ExceptionAxisStackedChartsDataPointsNumberMismatch));
+ }
+ }
+ // Chart type with two y values used for scale ( bubble chart type )
+ else if( secondYScale )
+ {
+ autoMaximum = Common.DataManager.GetMaxYWithRadiusValue( (ChartArea)this, yAxesSeries );
+ autoMinimum = Common.DataManager.GetMinYWithRadiusValue( (ChartArea)this, yAxesSeries );
+ }
+
+ // *****************************
+ // Non Stacked Chart Types
+ // *****************************
+ else
+ {
+ // Check if any series in the area has ExtraYValuesConnectedToYAxis flag set
+ bool extraYValuesConnectedToYAxis = false;
+ if(this.Common != null && this.Common.Chart != null)
+ {
+ foreach(Series series in this.Common.Chart.Series)
+ {
+ if(series.ChartArea == ((ChartArea)this).Name)
+ {
+ IChartType charType = Common.ChartTypeRegistry.GetChartType( series.ChartTypeName );
+ if(charType != null && charType.ExtraYValuesConnectedToYAxis)
+ {
+ extraYValuesConnectedToYAxis = true;
+ break;
+ }
+ }
+ }
+ }
+
+ // The first Chart type can have many Y values (Stock Chart, Range Chart)
+ if( extraYValuesConnectedToYAxis )
+ {
+ Common.DataManager.GetMinMaxYValue(out autoMinimum, out autoMaximum, yAxesSeries );
+ }
+ else
+ { // The first Chart type can have only one Y value
+ Common.DataManager.GetMinMaxYValue(0, out autoMinimum, out autoMaximum, yAxesSeries );
+ }
+ }
+ }
+
+ // Store Minimum and maximum from data. There is no
+ // reason to calculate this values every time.
+ axis.maximumFromData = autoMaximum;
+ axis.minimumFromData = autoMinimum;
+ axis.refreshMinMaxFromData = false;
+
+ // Make extra test for stored minimum and maximum values
+ // from data. If Number of points is different then data
+ // source is changed. That means that we should read
+ // data again.
+ axis.numberOfPointsInAllSeries = currentPointsNumber;
+ }
+
+
+ /// <summary>
+ /// Splits a single array of series names into multiple arrays
+ /// based on the stacked group name.
+ /// </summary>
+ /// <param name="seriesNames">Array of series name to split.</param>
+ /// <returns>An array list that contains sub-arrays of series names split by group name.</returns>
+ private ArrayList SplitSeriesInStackedGroups(string[] seriesNames)
+ {
+ Hashtable groupsHashTable = new Hashtable();
+ foreach(string seriesName in seriesNames)
+ {
+ // Get series object
+ Series series = this.Common.Chart.Series[seriesName];
+
+ // NOTE: Fix for issue #6716
+ // Double check that series supports stacked group feature
+ string groupName = string.Empty;
+ if(StackedColumnChart.IsSeriesStackGroupNameSupported(series))
+ {
+ // Get stacked group name (empty string by default)
+ groupName = StackedColumnChart.GetSeriesStackGroupName(series);
+ }
+
+ // Check if this group was alreday added in to the hashtable
+ if (groupsHashTable.ContainsKey(groupName))
+ {
+ ArrayList list = (ArrayList)groupsHashTable[groupName];
+ list.Add(seriesName);
+ }
+ else
+ {
+ ArrayList list = new ArrayList();
+ list.Add(seriesName);
+ groupsHashTable.Add(groupName, list);
+ }
+ }
+
+ // Convert results to a list that contains array of strings
+ ArrayList result = new ArrayList();
+ foreach(DictionaryEntry entry in groupsHashTable)
+ {
+ ArrayList list = (ArrayList)entry.Value;
+ if(list.Count > 0)
+ {
+ int index = 0;
+ string[] stringArray = new String[list.Count];
+ foreach(string str in list)
+ {
+ stringArray[index++] = str;
+ }
+ result.Add(stringArray);
+ }
+ }
+
+ return result;
+ }
+
+
+
+ /// <summary>
+ /// Find number of points for all series
+ /// </summary>
+ /// <returns>Number of points</returns>
+ private int GetNumberOfAllPoints()
+ {
+ int numOfPoints = 0;
+ foreach( Series series in Common.DataManager.Series )
+ {
+ numOfPoints += series.Points.Count;
+ }
+
+ return numOfPoints;
+ }
+
+ /// <summary>
+ /// This method sets default minimum and maximum values from
+ /// indexes. This case is used if all X values in a series
+ /// have 0 value or IsXValueIndexed flag is set.
+ /// </summary>
+ /// <param name="axis">Axis</param>
+ private void SetDefaultFromIndexes( Axis axis )
+ {
+ // Adjust margin for side-by-side charts like column
+ axis.SetTempAxisOffset( );
+
+ // Set Axis type
+ AxisType type = AxisType.Primary;
+ if( axis.axisType == AxisName.X2 || axis.axisType == AxisName.Y2 )
+ {
+ type = AxisType.Secondary;
+ }
+
+ // The maximum is equal to the number of data points.
+ double autoMaximum = Common.DataManager.GetNumberOfPoints( GetXAxesSeries( type, axis.SubAxisName ).ToArray() );
+ double autoMinimum = 0.0;
+
+ // Axis margin used only for zooming
+ axis.marginView = 0.0;
+ if( axis.margin == 100 )
+ axis.marginView = 1.0;
+
+ // If minimum and maximum are same margin always exist.
+ if( autoMaximum + axis.margin/100 == autoMinimum - axis.margin/100 + 1 )
+ {
+ // Set Maximum Number.
+ axis.SetAutoMaximum( autoMaximum + 1 );
+ axis.SetAutoMinimum( autoMinimum );
+ }
+ else // Nomal case
+ {
+ // Set Maximum Number.
+ axis.SetAutoMaximum( autoMaximum + axis.margin/100 );
+ axis.SetAutoMinimum( autoMinimum - axis.margin/100 + 1 );
+ }
+
+ // Find the interval. If the nuber of points
+ // is less then 10 interval is 1.
+ double axisInterval;
+
+ if( axis.ViewMaximum - axis.ViewMinimum <= 10 )
+ {
+ axisInterval = 1.0;
+ }
+ else
+ {
+ axisInterval = axis.CalcInterval( ( axis.ViewMaximum - axis.ViewMinimum ) / 5 );
+ }
+
+ ChartArea area = (ChartArea)this;
+ if( area.Area3DStyle.Enable3D && !double.IsNaN(axis.interval3DCorrection) )
+ {
+ axisInterval = Math.Ceiling( axisInterval / axis.interval3DCorrection );
+
+ axis.interval3DCorrection = double.NaN;
+
+ // Use interval
+ if( axisInterval > 1.0 &&
+ axisInterval < 4.0 &&
+ axis.ViewMaximum - axis.ViewMinimum <= 4 )
+ {
+ axisInterval = 1.0;
+ }
+
+ }
+
+ axis.SetInterval = axisInterval;
+
+ // If temporary offsets were defined for the margin,
+ // adjust offset for minor ticks and grids.
+ if(axis.offsetTempSet)
+ {
+ axis.minorGrid.intervalOffset -= axis.MajorGrid.GetInterval();
+ axis.minorTickMark.intervalOffset -= axis.MajorTickMark.GetInterval();
+ }
+ }
+
+ /// <summary>
+ /// Sets the names of all data series which belong to
+ /// this chart area to collection and sets a list of all
+ /// different chart types.
+ /// </summary>
+ internal void SetData()
+ {
+ this.SetData(true, true);
+ }
+
+ /// <summary>
+ /// Sets the names of all data series which belong to
+ /// this chart area to collection and sets a list of all
+ /// different chart types.
+ /// </summary>
+ /// <param name="initializeAxes">If set to <c>true</c> the method will initialize axes default values.</param>
+ /// <param name="checkIndexedAligned">If set to <c>true</c> the method will check that all primary X axis series are aligned if use the IsXValueIndexed flag.</param>
+ internal void SetData( bool initializeAxes, bool checkIndexedAligned)
+ {
+ // Initialize chart type properties
+ stacked = false;
+ switchValueAxes = false;
+ requireAxes = true;
+ hundredPercent = false;
+ hundredPercentNegative = false;
+ chartAreaIsCurcular = false;
+ secondYScale = false;
+
+ // AxisName of the chart area already set.
+ bool typeSet = false;
+
+ // Remove all elements from the collection
+ this._series.Clear();
+
+ // Add series to the collection
+ foreach( Series series in Common.DataManager.Series )
+ {
+ if (series.ChartArea == this.Name && series.IsVisible() && series.Points.Count > 0)
+ {
+ this._series.Add(series.Name);
+ }
+ }
+
+ // Remove all elements from the collection
+ this.chartTypes.Clear();
+
+ // Add series to the collection
+ foreach( Series series in Common.DataManager.Series )
+ {
+ // A item already exist.
+ bool foundItem = false;
+ if (series.IsVisible() && series.ChartArea==this.Name)
+ {
+ foreach( string type in chartTypes )
+ {
+ // AxisName already exist in the chart area
+ if( type == series.ChartTypeName )
+ {
+ foundItem = true;
+ }
+ }
+ // Add chart type to the collection of
+ // Chart area's chart types
+ if( !foundItem )
+ {
+ // Set stacked type
+ if( Common.ChartTypeRegistry.GetChartType(series.ChartTypeName).Stacked )
+ {
+ stacked = true;
+ }
+
+ if( !typeSet )
+ {
+ if( Common.ChartTypeRegistry.GetChartType(series.ChartTypeName).SwitchValueAxes )
+ switchValueAxes = true;
+ if( !Common.ChartTypeRegistry.GetChartType(series.ChartTypeName).RequireAxes )
+ requireAxes = false;
+ if( Common.ChartTypeRegistry.GetChartType(series.ChartTypeName).CircularChartArea )
+ chartAreaIsCurcular = true;
+ if( Common.ChartTypeRegistry.GetChartType(series.ChartTypeName).HundredPercent )
+ hundredPercent = true;
+ if( Common.ChartTypeRegistry.GetChartType(series.ChartTypeName).HundredPercentSupportNegative )
+ hundredPercentNegative = true;
+ if( Common.ChartTypeRegistry.GetChartType(series.ChartTypeName).SecondYScale )
+ secondYScale = true;
+
+ typeSet = true;
+ }
+ else
+ {
+ if( Common.ChartTypeRegistry.GetChartType(series.ChartTypeName).SwitchValueAxes != switchValueAxes )
+ {
+ throw (new InvalidOperationException(SR.ExceptionChartAreaChartTypesCanNotCombine));
+ }
+ }
+
+ // Series is not empty
+ if( Common.DataManager.GetNumberOfPoints( series.Name ) != 0 )
+ {
+ this.chartTypes.Add( series.ChartTypeName );
+ }
+ }
+ }
+ }
+
+ // Check that all primary X axis series are aligned if use the IsXValueIndexed flag
+ if (checkIndexedAligned)
+ {
+ for (int axisIndex = 0; axisIndex <= 1; axisIndex++)
+ {
+ List<string> seriesArray = this.GetXAxesSeries((axisIndex == 0) ? AxisType.Primary : AxisType.Secondary, string.Empty);
+ if (seriesArray.Count > 0)
+ {
+ bool indexed = false;
+ string seriesNamesStr = "";
+ foreach (string seriesName in seriesArray)
+ {
+ seriesNamesStr = seriesNamesStr + seriesName.Replace(",", "\\,") + ",";
+ if (Common.DataManager.Series[seriesName].IsXValueIndexed)
+ {
+ indexed = true;
+ }
+ }
+
+ if (indexed)
+ {
+ try
+ {
+ Common.DataManipulator.CheckXValuesAlignment(
+ Common.DataManipulator.ConvertToSeriesArray(seriesNamesStr.TrimEnd(','), false));
+ }
+ catch (Exception e)
+ {
+ throw (new ArgumentException(SR.ExceptionAxisSeriesNotAligned + e.Message));
+ }
+ }
+ }
+ }
+ }
+ if (initializeAxes)
+ {
+ // Set default min, max etc.
+ SetDefaultAxesValues();
+ }
+ }
+
+ /// <summary>
+ /// Returns names of all series, which belong to this chart area
+ /// and have same chart type.
+ /// </summary>
+ /// <param name="chartType">Chart type</param>
+ /// <returns>Collection with series names</returns>
+ internal List<string> GetSeriesFromChartType( string chartType )
+ {
+ // New collection
+ List<string> list = new List<string>();
+
+ foreach( string seriesName in _series )
+ {
+ if( String.Compare( chartType, Common.DataManager.Series[seriesName].ChartTypeName, StringComparison.OrdinalIgnoreCase ) == 0 )
+ {
+ // Add a series name to the collection
+ list.Add( seriesName );
+ }
+ }
+
+ return list;
+ }
+
+ /// <summary>
+ /// Returns all series which belong to this chart area.
+ /// </summary>
+ /// <returns>Collection with series</returns>
+ internal List<Series> GetSeries( )
+ {
+ // New collection
+ List<Series> list = new List<Series>();
+
+ foreach( string seriesName in _series )
+ {
+ list.Add(Common.DataManager.Series[seriesName]);
+ }
+
+ return list;
+ }
+
+ /// <summary>
+ /// Creates a list of series, which have same X axis type.
+ /// </summary>
+ /// <param name="type">Axis type</param>
+ /// <param name="subAxisName">Sub Axis name</param>
+ /// <returns>A list of series</returns>
+ internal List<string> GetXAxesSeries( AxisType type, string subAxisName )
+ {
+ // Create a new collection of series
+ List<string> list = new List<string>();
+ if (_series.Count == 0)
+ {
+ return list;
+ }
+ // Ignore sub axis in 3D
+ if( !this.IsSubAxesSupported )
+ {
+ if(subAxisName.Length > 0)
+ {
+ return list;
+ }
+ }
+
+ // Find series which have same axis type
+ foreach( string ser in _series )
+ {
+#if SUBAXES
+ if( Common.DataManager.Series[ser].XAxisType == type &&
+ (Common.DataManager.Series[ser].XSubAxisName == subAxisName || !this.IsSubAxesSupported) )
+#else // SUBAXES
+ if ( Common.DataManager.Series[ser].XAxisType == type)
+#endif // SUBAXES
+ {
+ // Add a series to the collection
+ list.Add( ser );
+ }
+ }
+
+#if SUBAXES
+ // If series list is empty for the sub-axis then
+ // try using the main axis.
+ if ( list.Count == 0 && subAxisName.Length > 0 )
+ {
+ return GetXAxesSeries( type, string.Empty );
+ }
+#endif // SUBAXES
+
+ // If primary series do not exist return secondary series
+ // Axis should always be connected with any series.
+ if ( list.Count == 0 )
+ {
+ if (type == AxisType.Secondary)
+ {
+ return GetXAxesSeries(AxisType.Primary, string.Empty);
+ }
+ return GetXAxesSeries(AxisType.Secondary, string.Empty);
+ }
+
+ return list;
+ }
+
+ /// <summary>
+ /// Creates a list of series, which have same Y axis type.
+ /// </summary>
+ /// <param name="type">Axis type</param>
+ /// <param name="subAxisName">Sub Axis name</param>
+ /// <returns>A list of series</returns>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "subAxisName")]
+ internal List<string> GetYAxesSeries( AxisType type, string subAxisName )
+ {
+ // Create a new collection of series
+ List<string> list = new List<string>();
+
+ // Find series which have same axis type
+ foreach( string ser in _series )
+ {
+ // Get series Y axis type
+ AxisType seriesYAxisType = Common.DataManager.Series[ser].YAxisType;
+#if SUBAXES
+ string seriesYSubAxisName = subAxisName;
+#endif // SUBAXES
+
+ // NOTE: Fixes issue #6969
+ // Ignore series settings if only Primary Y axis supported by the chart type
+ if (Common.DataManager.Series[ser].ChartType == SeriesChartType.Radar ||
+ Common.DataManager.Series[ser].ChartType == SeriesChartType.Polar)
+ {
+ seriesYAxisType = AxisType.Primary;
+#if SUBAXES
+ seriesYSubAxisName = string.Empty;
+#endif // SUBAXES
+ }
+
+
+#if SUBAXES
+ if( seriesYAxisType == type &&
+ (Common.DataManager.Series[ser].YSubAxisName == seriesYSubAxisName || !this.IsSubAxesSupported) )
+#else // SUBAXES
+ if (seriesYAxisType == type)
+#endif // SUBAXES
+ {
+ // Add a series to the collection
+ list.Add( ser );
+ }
+ }
+
+#if SUBAXES
+ // If series list is empty for the sub-axis then
+ // try using the main axis.
+ if ( list.Count == 0 && subAxisName.Length > 0 )
+ {
+ return GetYAxesSeries( type, string.Empty );
+ }
+#endif // SUBAXES
+
+ // If primary series do not exist return secondary series
+ // Axis should always be connected with any series.
+ if ( list.Count == 0 && type == AxisType.Secondary )
+ {
+ return GetYAxesSeries( AxisType.Primary, string.Empty );
+ }
+
+ return list;
+ }
+
+ /// <summary>
+ /// Get first series from the chart area
+ /// </summary>
+ /// <returns>Data series</returns>
+ internal Series GetFirstSeries()
+ {
+ if( _series.Count == 0 )
+ {
+ throw (new InvalidOperationException(SR.ExceptionChartAreaSeriesNotFound));
+ }
+
+ return Common.DataManager.Series[_series[0]];
+ }
+
+ /// <summary>
+ /// This method returns minimum interval between
+ /// any two data points from series which belong
+ /// to this chart area.
+ /// </summary>
+ /// <param name="isLogarithmic">Indicates logarithmic scale.</param>
+ /// <param name="logarithmBase">Logarithm Base</param>
+ /// <returns>Minimum Interval</returns>
+ internal double GetPointsInterval(bool isLogarithmic, double logarithmBase)
+ {
+ bool sameInterval;
+ return GetPointsInterval( _series, isLogarithmic, logarithmBase, false, out sameInterval );
+ }
+
+ /// <summary>
+ /// This method returns minimum interval between
+ /// any two data points from specified series.
+ /// </summary>
+ /// <param name="seriesList">List of series.</param>
+ /// <param name="isLogarithmic">Indicates logarithmic scale.</param>
+ /// <param name="logarithmBase">Base for logarithmic base</param>
+ /// <param name="checkSameInterval">True if check for the same interval should be performed.</param>
+ /// <param name="sameInterval">Return true if interval is the same.</param>
+ /// <returns>Minimum Interval</returns>
+ internal double GetPointsInterval( List<string> seriesList, bool isLogarithmic, double logarithmBase, bool checkSameInterval, out bool sameInterval )
+ {
+ Series nullSeries = null;
+ return GetPointsInterval(seriesList, isLogarithmic, logarithmBase, checkSameInterval, out sameInterval, out nullSeries);
+ }
+
+ /// <summary>
+ /// This method returns minimum interval between
+ /// any two data points from specified series.
+ /// </summary>
+ /// <param name="seriesList">List of series.</param>
+ /// <param name="isLogarithmic">Indicates logarithmic scale.</param>
+ /// <param name="logarithmicBase">Logarithm Base</param>
+ /// <param name="checkSameInterval">True if check for the same interval should be performed.</param>
+ /// <param name="sameInterval">Return true if interval is the same.</param>
+ /// <param name="series">Series with the smallest interval between points.</param>
+ /// <returns>Minimum Interval</returns>
+ internal double GetPointsInterval( List<string> seriesList, bool isLogarithmic, double logarithmicBase, bool checkSameInterval, out bool sameInterval, out Series series )
+ {
+ long ticksInterval = long.MaxValue;
+ int monthsInteval = 0;
+ double previousInterval = double.MinValue;
+ double oldInterval = Double.MaxValue;
+
+ // Initialize return value
+ sameInterval = true;
+ series = null;
+
+ // Create comma separate string of series names
+ string seriesNames = "";
+ if(seriesList != null)
+ {
+ foreach( string serName in seriesList )
+ {
+ seriesNames += serName + ",";
+ }
+ }
+
+ // Do not calculate interval every time;
+ if( checkSameInterval == false || diffIntervalAlignmentChecked == true)
+ {
+ if (!isLogarithmic)
+ {
+ if( !double.IsNaN(intervalData) && _intervalSeriesList == seriesNames)
+ {
+ sameInterval = intervalSameSize;
+ series = _intervalSeries;
+ return intervalData;
+ }
+ }
+ else
+ {
+ if( !double.IsNaN(intervalLogData) && _intervalSeriesList == seriesNames)
+ {
+ sameInterval = intervalSameSize;
+ series = _intervalSeries;
+ return intervalLogData;
+ }
+ }
+ }
+
+ // Data series loop
+ int seriesIndex = 0;
+ Series currentSmallestSeries = null;
+ ArrayList[] seriesXValues = new ArrayList[seriesList.Count];
+ foreach( string ser in seriesList )
+ {
+ Series dataSeries = Common.DataManager.Series[ ser ];
+ bool isXValueDateTime = dataSeries.IsXValueDateTime();
+
+ // Copy X values to array and prepare for sorting Sort X values.
+ seriesXValues[seriesIndex] = new ArrayList();
+ bool sortPoints = false;
+ double prevXValue = double.MinValue;
+ double curentXValue = 0.0;
+ if(dataSeries.Points.Count > 0)
+ {
+ if (isLogarithmic)
+ {
+ prevXValue = Math.Log(dataSeries.Points[0].XValue, logarithmicBase);
+ }
+ else
+ {
+ prevXValue = dataSeries.Points[0].XValue;
+ }
+ }
+ foreach( DataPoint point in dataSeries.Points )
+ {
+ if (isLogarithmic)
+ {
+ curentXValue = Math.Log(point.XValue, logarithmicBase);
+ }
+ else
+ {
+ curentXValue = point.XValue;
+ }
+
+ if(prevXValue > curentXValue)
+ {
+ sortPoints = true;
+ }
+
+ seriesXValues[seriesIndex].Add(curentXValue);
+ prevXValue = curentXValue;
+ }
+
+ // Sort X values
+ if(sortPoints)
+ {
+ seriesXValues[seriesIndex].Sort();
+ }
+
+ // Data point loop
+ for( int point = 1; point < seriesXValues[seriesIndex].Count; point++ )
+ {
+ // Interval between two sorted data points.
+ double interval = Math.Abs( (double)seriesXValues[seriesIndex][ point - 1 ] - (double)seriesXValues[seriesIndex][ point ] );
+
+ // Check if all intervals are same
+ if(sameInterval)
+ {
+ if(isXValueDateTime)
+ {
+ if(ticksInterval == long.MaxValue)
+ {
+ // Calculate first interval
+ GetDateInterval(
+ (double)seriesXValues[seriesIndex][ point - 1 ],
+ (double)seriesXValues[seriesIndex][ point ],
+ out monthsInteval,
+ out ticksInterval);
+ }
+ else
+ {
+ // Calculate current interval
+ long curentTicksInterval = long.MaxValue;
+ int curentMonthsInteval = 0;
+ GetDateInterval(
+ (double)seriesXValues[seriesIndex][ point - 1 ],
+ (double)seriesXValues[seriesIndex][ point ],
+ out curentMonthsInteval,
+ out curentTicksInterval);
+
+ // Compare current interval with previous
+ if(curentMonthsInteval != monthsInteval || curentTicksInterval != ticksInterval)
+ {
+ sameInterval = false;
+ }
+
+ }
+ }
+ else
+ {
+ if( previousInterval != interval && previousInterval != double.MinValue )
+ {
+ sameInterval = false;
+ }
+ }
+ }
+
+ previousInterval = interval;
+
+ // If not minimum interval keep the old one
+ if( oldInterval > interval && interval != 0)
+ {
+ oldInterval = interval;
+ currentSmallestSeries = dataSeries;
+ }
+ }
+
+ ++seriesIndex;
+ }
+
+ // If interval is not the same check if points from all series are aligned
+ this.diffIntervalAlignmentChecked = false;
+ if( checkSameInterval && !sameInterval && seriesXValues.Length > 1)
+ {
+ bool sameXValue = false;
+ this.diffIntervalAlignmentChecked = true;
+
+ // All X values must be same
+ int listIndex = 0;
+ foreach(ArrayList xList in seriesXValues)
+ {
+ for(int pointIndex = 0; pointIndex < xList.Count && !sameXValue; pointIndex++)
+ {
+ double xValue = (double)xList[pointIndex];
+
+ // Loop through all other lists and see if point is there
+ for(int index = listIndex + 1; index < seriesXValues.Length && !sameXValue; index++)
+ {
+ if( (pointIndex < seriesXValues[index].Count && (double)seriesXValues[index][pointIndex] == xValue) ||
+ seriesXValues[index].Contains(xValue))
+ {
+ sameXValue = true;
+ break;
+ }
+ }
+ }
+
+ ++listIndex;
+ }
+
+
+ // Use side-by-side if at least one xommon X value between eries found
+ if(sameXValue)
+ {
+ sameInterval = true;
+ }
+ }
+
+
+ // Interval not found. Interval is 1.
+ if( oldInterval == Double.MaxValue)
+ {
+ oldInterval = 1;
+ }
+
+ intervalSameSize = sameInterval;
+ if (!isLogarithmic)
+ {
+ intervalData = oldInterval;
+ _intervalSeries = currentSmallestSeries;
+ series = _intervalSeries;
+ _intervalSeriesList = seriesNames;
+ return intervalData;
+ }
+ else
+ {
+ intervalLogData = oldInterval;
+ _intervalSeries = currentSmallestSeries;
+ series = _intervalSeries;
+ _intervalSeriesList = seriesNames;
+ return intervalLogData;
+ }
+ }
+
+ /// <summary>
+ /// Calculates the difference between two values in years, months, days, ...
+ /// </summary>
+ /// <param name="value1">First value.</param>
+ /// <param name="value2">Second value.</param>
+ /// <param name="monthsInteval">Interval in months.</param>
+ /// <param name="ticksInterval">Interval in ticks.</param>
+ private void GetDateInterval(double value1, double value2, out int monthsInteval, out long ticksInterval)
+ {
+ // Convert values to dates
+ DateTime date1 = DateTime.FromOADate(value1);
+ DateTime date2 = DateTime.FromOADate(value2);
+
+ // Calculate months difference
+ monthsInteval = date2.Month - date1.Month;
+ monthsInteval += (date2.Year - date1.Year) * 12;
+
+ // Calculate interval in ticks for days, hours, ...
+ ticksInterval = 0;
+ ticksInterval += (date2.Day - date1.Day) * TimeSpan.TicksPerDay;
+ ticksInterval += (date2.Hour - date1.Hour) * TimeSpan.TicksPerHour;
+ ticksInterval += (date2.Minute - date1.Minute) * TimeSpan.TicksPerMinute;
+ ticksInterval += (date2.Second - date1.Second) * TimeSpan.TicksPerSecond;
+ ticksInterval += (date2.Millisecond - date1.Millisecond) * TimeSpan.TicksPerMillisecond;
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartAreaCircular.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartAreaCircular.cs
new file mode 100644
index 00000000000..a8df57ebb84
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartAreaCircular.cs
@@ -0,0 +1,109 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: ChartAreaCircular.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: CircularChartAreaAxis
+//
+// Purpose: CircularChartAreaAxis is a helper class which is used
+// in circular chart areas for charts like Polar and
+// Radar.
+//
+// Reviewed: AG - Microsoft 16, 2007
+//
+//===================================================================
+
+
+#region Used namespaces
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Drawing2D;
+#if Microsoft_CONTROL
+
+using System.Windows.Forms.DataVisualization.Charting.Data;
+using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+using System.Windows.Forms.DataVisualization.Charting.Utilities;
+using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+using System.Windows.Forms.DataVisualization.Charting;
+
+using System.Globalization;
+using System.ComponentModel.Design.Serialization;
+using System.Reflection;
+using System.Windows.Forms.Design;
+#else
+ using System.Web;
+ using System.Web.UI;
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+ using System.Web.UI.DataVisualization.Charting.Borders3D;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ /// <summary>
+ /// CircularChartAreaAxis class represents a single axis in the circular
+ /// chart area chart like radar or polar. It contains axis angular
+ /// position, size and title properties.
+ /// </summary>
+ internal class CircularChartAreaAxis
+ {
+ #region Fields
+
+ /// <summary>
+ /// Angle where axis is located.
+ /// </summary>
+ internal float AxisPosition = 0f;
+
+ /// <summary>
+ /// Axis title.
+ /// </summary>
+ internal string Title = string.Empty;
+
+ /// <summary>
+ /// Axis title color.
+ /// </summary>
+ internal Color TitleForeColor = Color.Empty;
+
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// Constructor.
+ /// </summary>
+ public CircularChartAreaAxis()
+ {
+ }
+
+ /// <summary>
+ /// Constructor.
+ /// </summary>
+ internal CircularChartAreaAxis(float axisPosition)
+ {
+ this.AxisPosition = axisPosition;
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartAreaCollection.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartAreaCollection.cs
new file mode 100644
index 00000000000..c9620a2f03e
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartAreaCollection.cs
@@ -0,0 +1,107 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: ChartAreaCollection.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: ChartAreaCollection
+//
+// Purpose: ChartAreaCollection class represents a strongly
+// typed collection of ChartArea objects.
+//
+// Reviewed: GS - Aug 8, 2002
+// AG - Aug 8, 2002
+// AG - Microsoft 16, 2007
+//
+//===================================================================
+
+
+#region Used namespaces
+
+using System;
+using System.Collections;
+using System.Drawing;
+using System.ComponentModel;
+
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ /// <summary>
+ /// The ChartAreaCollection class represents a strongly typed collection of
+ /// ChartArea objects. Each chart area has a unique name in the collection
+ /// and can be retrieved by name or by index.
+ /// </summary>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class ChartAreaCollection : ChartNamedElementCollection<ChartArea>
+ {
+
+ #region Constructors
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ChartAreaCollection"/> class.
+ /// </summary>
+ /// <param name="chartPicture">Parent chart picture.</param>
+ internal ChartAreaCollection(ChartPicture chartPicture) : base(chartPicture)
+ {
+ }
+
+ #endregion
+
+ #region Properties
+ /// <summary>
+ /// Gets the default chart area name.
+ /// </summary>
+ internal string DefaultNameReference
+ {
+ get { return this.Count > 0 ? this[0].Name : String.Empty; }
+ }
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Creates a new ChartArea with the specified name and adds it to the collection.
+ /// </summary>
+ /// <param name="name">The new chart area name.</param>
+ /// <returns></returns>
+ public ChartArea Add(string name)
+ {
+ ChartArea area = new ChartArea(name);
+ this.Add(area);
+ return area;
+ }
+
+ #endregion
+
+ #region Event handlers
+ /// <summary>
+ /// Updates the ChartArea alignment references to another chart areas.
+ /// </summary>
+ /// <param name="sender">The sender.</param>
+ /// <param name="e">The <see cref="Charting.NameReferenceChangedEventArgs"/> instance containing the event data.</param>
+ internal void ChartAreaNameReferenceChanged(object sender, NameReferenceChangedEventArgs e)
+ {
+ foreach (ChartArea chartArea in this)
+ if (chartArea.AlignWithChartArea == e.OldName)
+ chartArea.AlignWithChartArea = e.NewName;
+ }
+
+ #endregion
+
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartAreaCursor.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartAreaCursor.cs
new file mode 100644
index 00000000000..72c06e7bae8
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartAreaCursor.cs
@@ -0,0 +1,1682 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: ChartAreaCursor.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: Cursor, CursorEventArgs
+//
+// Purpose: A cursor is a horizontal or vertical line that
+// defines a position along an axis. A range selection
+// is a range along an axis that is defined by a beginning
+// and end position, and is displayed using a semi-transparent
+// color.
+//
+// Both cursors and range selections are implemented by the
+// Cursor class, which is exposed as the CursorX and CursorY
+// properties of the ChartArea object. The CursorX object is
+// for the X axis of a chart area, and the CursorY object is
+// for the Y axis. The AxisType property of these objects
+// determines if the associated axis is primary or secondary.
+//
+// Cursors and range selections can be set via end-user
+// interaction and programmatically.
+//
+// NOTE: ASP.NET version of the chart uses this class only
+// for appearance and position properties. Drawing of the
+// selection and cursor is implemented through client side
+// java script.
+//
+// Reviewed: AG - August 8, 2002
+// AG - March 16, 2007
+//
+//===================================================================
+
+#if WINFORMS_CONTROL
+
+#region Used Namespaces
+
+using System;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.ComponentModel;
+using System.Collections;
+using System.Windows.Forms.DataVisualization.Charting;
+using System.Windows.Forms.DataVisualization.Charting.Data;
+using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+using System.Windows.Forms.DataVisualization.Charting.Utilities;
+using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+using System.Drawing.Design;
+using System.Collections.Generic;
+
+#endregion
+
+namespace System.Windows.Forms.DataVisualization.Charting
+{
+ /// <summary>
+ /// The Cursor class is responsible for chart axes cursor and selection
+ /// functionality. It contains properties which define visual appearance,
+ /// position and behavior settings. It also contains methods for
+ /// drawing cursor and selection in the plotting area.
+ /// </summary>
+ [
+ DefaultProperty("Enabled"),
+ SRDescription("DescriptionAttributeCursor_Cursor"),
+ ]
+ public class Cursor : IDisposable
+ {
+ #region Cursor constructors and initialization
+
+ /// <summary>
+ /// Public constructor
+ /// </summary>
+ public Cursor()
+ {
+ }
+
+ /// <summary>
+ /// Initialize cursor class.
+ /// </summary>
+ /// <param name="chartArea">Chart area the cursor belongs to.</param>
+ /// <param name="attachedToXAxis">Indicates which axes should be used X or Y.</param>
+ internal void Initialize(ChartArea chartArea, AxisName attachedToXAxis)
+ {
+ // Set chart are reference
+ this._chartArea = chartArea;
+
+ // Attach cursor to specified axis
+ this._attachedToXAxis = attachedToXAxis;
+ }
+
+ #endregion
+
+ #region Cursor fields
+
+ // Reference to the chart area object the cursor belongs to
+ private ChartArea _chartArea = null;
+
+ // Defines which axis the cursor attached to X or Y
+ private AxisName _attachedToXAxis = AxisName.X;
+
+ // Enables/Disables chart area cursor.
+ private bool _isUserEnabled = false;
+
+ // Enables/Disables chart area selection.
+ private bool _isUserSelectionEnabled = false;
+
+ // Indicates that cursor will automatically scroll the area scaleView if necessary.
+ private bool _autoScroll = true;
+
+ // Cursor line color
+ private Color _lineColor = Color.Red;
+
+ // Cursor line width
+ private int _lineWidth = 1;
+
+ // Cursor line style
+ private ChartDashStyle _lineDashStyle = ChartDashStyle.Solid;
+
+ // Chart area selection color
+ private Color _selectionColor = Color.LightGray;
+
+ // AxisName of the axes (primary/secondary) the cursor is attached to
+ private AxisType _axisType = AxisType.Primary;
+
+ // Cursor position
+ private double _position = Double.NaN;
+
+ // Range selection start position.
+ private double _selectionStart = Double.NaN;
+
+ // Range selection end position.
+ private double _selectionEnd = Double.NaN;
+
+ // Cursor movement interval current & original values
+ private double _interval = 1;
+
+ // Cursor movement interval type
+ private DateTimeIntervalType _intervalType = DateTimeIntervalType.Auto;
+
+ // Cursor movement interval offset current & original values
+ private double _intervalOffset = 0;
+
+ // Cursor movement interval offset type
+ private DateTimeIntervalType _intervalOffsetType = DateTimeIntervalType.Auto;
+
+ // Reference to the axis obhect
+ private Axis _axis = null;
+
+ // User selection start point
+ private PointF _userSelectionStart = PointF.Empty;
+
+ // Indicates that selection must be drawn
+ private bool _drawSelection = true;
+
+ // Indicates that events must be fired when position/selection is changed
+ private bool _fireUserChangingEvent = false;
+
+ // Indicates that XXXChanged events must be fired when position/selection is changed
+ private bool _fireUserChangedEvent = false;
+
+ // Scroll size and direction when AutoScroll is set
+ private MouseEventArgs _mouseMoveArguments = null;
+
+ // Timer used to scroll the data while selecting
+ private System.Windows.Forms.Timer _scrollTimer = new System.Windows.Forms.Timer();
+
+ // Indicates that axis data scaleView was scrolled as a result of the mouse move event
+ private bool _viewScrolledOnMouseMove = false;
+
+ #endregion
+
+ #region Cursor "Behavior" public properties.
+
+ /// <summary>
+ /// Gets or sets the position of a cursor.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeBehavior"),
+ Bindable(true),
+ DefaultValue(Double.NaN),
+ SRDescription("DescriptionAttributeCursor_Position"),
+ ParenthesizePropertyNameAttribute(true),
+ TypeConverter(typeof(DoubleDateNanValueConverter)),
+ ]
+ public double Position
+ {
+ get
+ {
+ return _position;
+ }
+ set
+ {
+ if(_position != value)
+ {
+ _position = value;
+
+ // Align cursor in connected areas
+ if(this._chartArea != null && this._chartArea.Common != null && this._chartArea.Common.ChartPicture != null)
+ {
+ if(!this._chartArea.alignmentInProcess)
+ {
+ AreaAlignmentOrientations orientation = (this._attachedToXAxis == AxisName.X || this._attachedToXAxis == AxisName.X2) ?
+ AreaAlignmentOrientations.Vertical : AreaAlignmentOrientations.Horizontal;
+ this._chartArea.Common.ChartPicture.AlignChartAreasCursor(this._chartArea, orientation, false);
+ }
+ }
+
+ if(this._chartArea != null && !this._chartArea.alignmentInProcess)
+ {
+ this.Invalidate(false);
+ }
+
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the starting position of a cursor's selected range.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeBehavior"),
+ Bindable(true),
+ DefaultValue(Double.NaN),
+ SRDescription("DescriptionAttributeCursor_SelectionStart"),
+ TypeConverter(typeof(DoubleDateNanValueConverter)),
+ ]
+ public double SelectionStart
+ {
+ get
+ {
+ return _selectionStart;
+ }
+ set
+ {
+ if(_selectionStart != value)
+ {
+ _selectionStart = value;
+
+ // Align cursor in connected areas
+ if(this._chartArea != null && this._chartArea.Common != null && this._chartArea.Common.ChartPicture != null)
+ {
+ if(!this._chartArea.alignmentInProcess)
+ {
+ AreaAlignmentOrientations orientation = (this._attachedToXAxis == AxisName.X || this._attachedToXAxis == AxisName.X2) ?
+ AreaAlignmentOrientations.Vertical : AreaAlignmentOrientations.Horizontal;
+ this._chartArea.Common.ChartPicture.AlignChartAreasCursor(this._chartArea, orientation, false);
+ }
+ }
+
+ if(this._chartArea != null && !this._chartArea.alignmentInProcess)
+ {
+ this.Invalidate(false);
+ }
+
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the ending position of a range selection.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeBehavior"),
+ Bindable(true),
+ DefaultValue(Double.NaN),
+ SRDescription("DescriptionAttributeCursor_SelectionEnd"),
+ TypeConverter(typeof(DoubleDateNanValueConverter)),
+ ]
+ public double SelectionEnd
+ {
+ get
+ {
+ return _selectionEnd;
+ }
+ set
+ {
+ if(_selectionEnd != value)
+ {
+ _selectionEnd = value;
+
+ // Align cursor in connected areas
+ if(this._chartArea != null && this._chartArea.Common != null && this._chartArea.Common.ChartPicture != null)
+ {
+ if(!this._chartArea.alignmentInProcess)
+ {
+ AreaAlignmentOrientations orientation = (this._attachedToXAxis == AxisName.X || this._attachedToXAxis == AxisName.X2) ?
+ AreaAlignmentOrientations.Vertical : AreaAlignmentOrientations.Horizontal;
+ this._chartArea.Common.ChartPicture.AlignChartAreasCursor(this._chartArea, orientation, false);
+ }
+ }
+
+ if(this._chartArea != null && !this._chartArea.alignmentInProcess)
+ {
+ this.Invalidate(false);
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a property that enables or disables the cursor interface.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeBehavior"),
+ Bindable(true),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeCursor_UserEnabled"),
+ ]
+ public bool IsUserEnabled
+ {
+ get
+ {
+ return _isUserEnabled;
+ }
+ set
+ {
+ _isUserEnabled = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a property that enables or disables the range selection interface.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeBehavior"),
+ Bindable(true),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeCursor_UserSelection"),
+ ]
+ public bool IsUserSelectionEnabled
+ {
+ get
+ {
+ return _isUserSelectionEnabled;
+ }
+ set
+ {
+ _isUserSelectionEnabled = value;
+ }
+ }
+
+ /// <summary>
+ /// Determines if scrolling will occur if a range selection operation
+ /// extends beyond a boundary of the chart area.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeBehavior"),
+ Bindable(true),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeCursor_AutoScroll"),
+ ]
+ public bool AutoScroll
+ {
+ get
+ {
+ return _autoScroll;
+ }
+ set
+ {
+ _autoScroll = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the type of axis that the cursor is attached to.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeBehavior"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeCursor_AxisType"),
+ DefaultValue(AxisType.Primary)
+ ]
+ public AxisType AxisType
+ {
+ get
+ {
+ return _axisType;
+ }
+ set
+ {
+ _axisType = value;
+
+ // Reset reference to the axis object
+ _axis = null;
+
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the cursor movement interval.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeBehavior"),
+ Bindable(true),
+ DefaultValue(1.0),
+ SRDescription("DescriptionAttributeCursor_Interval"),
+ ]
+ public double Interval
+ {
+ get
+ {
+ return _interval;
+ }
+ set
+ {
+ _interval = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the unit of measurement of the Interval property.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeBehavior"),
+ Bindable(true),
+ DefaultValue(DateTimeIntervalType.Auto),
+ SRDescription("DescriptionAttributeCursor_IntervalType")
+ ]
+ public DateTimeIntervalType IntervalType
+ {
+ get
+ {
+ return _intervalType;
+ }
+ set
+ {
+ _intervalType = (value != DateTimeIntervalType.NotSet) ? value : DateTimeIntervalType.Auto;
+ }
+ }
+
+
+ /// <summary>
+ /// Gets or sets the interval offset, which determines
+ /// where to draw the cursor and range selection.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeBehavior"),
+ Bindable(true),
+ DefaultValue(0.0),
+ SRDescription("DescriptionAttributeCursor_IntervalOffset"),
+ ]
+ public double IntervalOffset
+ {
+ get
+ {
+ return _intervalOffset;
+ }
+ set
+ {
+ // Validation
+ if( value < 0.0 )
+ {
+ throw (new ArgumentException(SR.ExceptionCursorIntervalOffsetIsNegative, "value"));
+ }
+
+ _intervalOffset = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the unit of measurement of the IntervalOffset property.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeBehavior"),
+ Bindable(true),
+ DefaultValue(DateTimeIntervalType.Auto),
+ SRDescription("DescriptionAttributeCursor_IntervalOffsetType"),
+ ]
+ public DateTimeIntervalType IntervalOffsetType
+ {
+ get
+ {
+ return _intervalOffsetType;
+ }
+ set
+ {
+ _intervalOffsetType = (value != DateTimeIntervalType.NotSet) ? value : DateTimeIntervalType.Auto;
+ }
+ }
+ #endregion
+
+ #region Cursor "Appearance" public properties
+
+ /// <summary>
+ /// Gets or sets the color the cursor line.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), "Red"),
+ SRDescription("DescriptionAttributeLineColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ ]
+ public Color LineColor
+ {
+ get
+ {
+ return _lineColor;
+ }
+ set
+ {
+ _lineColor = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the style of the cursor line.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartDashStyle.Solid),
+ SRDescription("DescriptionAttributeLineDashStyle"),
+ ]
+ public ChartDashStyle LineDashStyle
+ {
+ get
+ {
+ return _lineDashStyle;
+ }
+ set
+ {
+ _lineDashStyle = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the width of the cursor line.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(1),
+ SRDescription("DescriptionAttributeLineWidth"),
+ ]
+ public int LineWidth
+ {
+ get
+ {
+ return _lineWidth;
+ }
+ set
+ {
+ if(value < 0)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionCursorLineWidthIsNegative));
+ }
+ _lineWidth = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a semi-transparent color that highlights a range of data.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), "LightGray"),
+ SRDescription("DescriptionAttributeCursor_SelectionColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ ]
+ public Color SelectionColor
+ {
+ get
+ {
+ return _selectionColor;
+ }
+ set
+ {
+ _selectionColor = value;
+ this.Invalidate(false);
+ }
+ }
+
+ #endregion
+
+ #region Cursor painting methods
+
+ /// <summary>
+ /// Draws chart area cursor and selection.
+ /// </summary>
+ /// <param name="graph">Reference to the ChartGraphics object.</param>
+ internal void Paint( ChartGraphics graph )
+ {
+ //***************************************************
+ //** Prepare for drawing
+ //***************************************************
+
+ // Do not proceed with painting if cursor is not attached to the axis
+ if(this.GetAxis() == null ||
+ this._chartArea == null ||
+ this._chartArea.Common == null ||
+ this._chartArea.Common.ChartPicture == null ||
+ this._chartArea.Common.ChartPicture.isPrinting)
+ {
+ return;
+ }
+
+ // Get plot area position
+ RectangleF plotAreaPosition = this._chartArea.PlotAreaPosition.ToRectangleF();
+
+ // Detect if cursor is horizontal or vertical
+ bool horizontal = true;
+ if(this.GetAxis().AxisPosition == AxisPosition.Bottom || this.GetAxis().AxisPosition == AxisPosition.Top)
+ {
+ horizontal = false;
+ }
+
+ //***************************************************
+ //** Draw selection
+ //***************************************************
+
+ // Check if selection need to be drawn
+ if(this._drawSelection &&
+ !double.IsNaN(this.SelectionStart) &&
+ !double.IsNaN(this.SelectionEnd) &&
+ this.SelectionColor != Color.Empty)
+ {
+ // Calculate selection rectangle
+ RectangleF rectSelection = GetSelectionRect(plotAreaPosition);
+ rectSelection.Intersect(plotAreaPosition);
+
+ // Get opposite axis selection rectangle
+ RectangleF rectOppositeSelection = GetOppositeSelectionRect(plotAreaPosition);
+
+ // Draw selection if rectangle is not empty
+ if(!rectSelection.IsEmpty && rectSelection.Width > 0 && rectSelection.Height > 0)
+ {
+ // Limit selection rectangle to the area of the opposite selection
+ if(!rectOppositeSelection.IsEmpty && rectOppositeSelection.Width > 0 && rectOppositeSelection.Height > 0)
+ {
+ rectSelection.Intersect(rectOppositeSelection);
+
+ // We do not need to draw selection in the opposite axis
+ Cursor oppositeCursor =
+ (_attachedToXAxis == AxisName.X || _attachedToXAxis == AxisName.X2) ?
+ _chartArea.CursorY : _chartArea.CursorX;
+ oppositeCursor._drawSelection = false;
+ }
+
+ // Make sure selection is inside plotting area
+ rectSelection.Intersect(plotAreaPosition);
+
+ // If selection rectangle is not empty
+ if(rectSelection.Width > 0 && rectSelection.Height > 0)
+ {
+ // Add transparency to solid colors
+ Color rangeSelectionColor = this.SelectionColor;
+ if(rangeSelectionColor.A == 255)
+ {
+ rangeSelectionColor = Color.FromArgb(120, rangeSelectionColor);
+ }
+
+ // Draw selection
+ graph.FillRectangleRel( rectSelection,
+ rangeSelectionColor,
+ ChartHatchStyle.None,
+ "",
+ ChartImageWrapMode.Tile,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ GradientStyle.None,
+ Color.Empty,
+ Color.Empty,
+ 0,
+ ChartDashStyle.NotSet,
+ Color.Empty,
+ 0,
+ PenAlignment.Inset );
+ }
+ }
+ }
+
+ //***************************************************
+ //** Draw cursor
+ //***************************************************
+
+ // Check if cursor need to be drawn
+ if(!double.IsNaN(this.Position) &&
+ this.LineColor != Color.Empty &&
+ this.LineWidth > 0 &&
+ this.LineDashStyle != ChartDashStyle.NotSet)
+ {
+ // Calculate line position
+ bool insideArea = false;
+ PointF point1 = PointF.Empty;
+ PointF point2 = PointF.Empty;
+ if(horizontal)
+ {
+ // Set cursor coordinates
+ point1.X = plotAreaPosition.X;
+ point1.Y = (float)this.GetAxis().GetLinearPosition(this.Position);
+ point2.X = plotAreaPosition.Right;
+ point2.Y = point1.Y;
+
+ // Check if cursor is inside plotting rect
+ if(point1.Y >= plotAreaPosition.Y && point1.Y <= plotAreaPosition.Bottom)
+ {
+ insideArea = true;
+ }
+ }
+ else
+ {
+ // Set cursor coordinates
+ point1.X = (float)this.GetAxis().GetLinearPosition(this.Position);
+ point1.Y = plotAreaPosition.Y;
+ point2.X = point1.X;
+ point2.Y = plotAreaPosition.Bottom;
+
+ // Check if cursor is inside plotting rect
+ if(point1.X >= plotAreaPosition.X && point1.X <= plotAreaPosition.Right)
+ {
+ insideArea = true;
+ }
+ }
+
+ // Draw cursor if it's inside the chart area plotting rectangle
+ if(insideArea)
+ {
+ graph.DrawLineRel(this.LineColor, this.LineWidth, this.LineDashStyle, point1, point2);
+ }
+ }
+ // Reset draw selection flag
+ this._drawSelection = true;
+ }
+
+ #endregion
+
+ #region Cursor position setting methods
+
+ /// <summary>
+ /// This method sets the position of a cursor within a chart area at a given axis value.
+ /// </summary>
+ /// <param name="newPosition">The new position of the cursor. Measured as a value along the relevant axis.</param>
+ public void SetCursorPosition(double newPosition)
+ {
+ // Check if we are setting different value
+ if(this.Position != newPosition)
+ {
+ double newRoundedPosition = RoundPosition(newPosition);
+ // Send PositionChanging event
+ if(_fireUserChangingEvent && GetChartObject() != null)
+ {
+ CursorEventArgs arguments = new CursorEventArgs(this._chartArea, this.GetAxis(), newRoundedPosition);
+ GetChartObject().OnCursorPositionChanging(arguments);
+
+ // Check if position values were changed in the event
+ newRoundedPosition = arguments.NewPosition;
+ }
+
+ // Change position
+ this.Position = newRoundedPosition;
+
+ // Send PositionChanged event
+ if(_fireUserChangedEvent && GetChartObject() != null)
+ {
+ CursorEventArgs arguments = new CursorEventArgs(this._chartArea, this.GetAxis(), this.Position);
+ GetChartObject().OnCursorPositionChanged(arguments);
+ }
+ }
+ }
+
+
+ /// <summary>
+ /// This method displays a cursor at the specified position. Measured in pixels.
+ /// </summary>
+ /// <param name="point">A PointF structure that specifies where the cursor will be drawn.</param>
+ /// <param name="roundToBoundary">If true, the cursor will be drawn along the nearest chart area boundary
+ /// when the specified position does not fall within a ChartArea object.</param>
+ public void SetCursorPixelPosition(PointF point, bool roundToBoundary)
+ {
+ if(this._chartArea != null && this._chartArea.Common != null && this.GetAxis() != null)
+ {
+ PointF relativeCoord = GetPositionInPlotArea(point, roundToBoundary);
+ if(!relativeCoord.IsEmpty)
+ {
+ // Get new cursor position
+ double newCursorPosition = PositionToCursorPosition(relativeCoord);
+
+ // Set new cursor & selection position
+ this.SetCursorPosition(newCursorPosition);
+ }
+ }
+ }
+
+ /// <summary>
+ /// This method sets the position of a selected range within a chart area at given axis values.
+ /// </summary>
+ /// <param name="newStart">The new starting position of the range selection. Measured as a value along the relevant axis..</param>
+ /// <param name="newEnd">The new ending position of the range selection. Measured as a value along the relevant axis.</param>
+ public void SetSelectionPosition(double newStart, double newEnd)
+ {
+ // Check if we are setting different value
+ if(this.SelectionStart != newStart || this.SelectionEnd != newEnd)
+ {
+ // Send PositionChanging event
+ double newRoundedSelectionStart = RoundPosition(newStart);
+ double newRoundedSelectionEnd = RoundPosition(newEnd);
+
+ // Send SelectionRangeChanging event
+ if(_fireUserChangingEvent && GetChartObject() != null)
+ {
+ CursorEventArgs arguments = new CursorEventArgs(this._chartArea, this.GetAxis(), newRoundedSelectionStart, newRoundedSelectionEnd);
+ GetChartObject().OnSelectionRangeChanging(arguments);
+
+ // Check if position values were changed in the event
+ newRoundedSelectionStart = arguments.NewSelectionStart;
+ newRoundedSelectionEnd = arguments.NewSelectionEnd;
+ }
+
+ // Change selection position
+ this._selectionStart = newRoundedSelectionStart;
+ this._selectionEnd = newRoundedSelectionEnd;
+
+ // Align cursor in connected areas
+ if(this._chartArea != null && this._chartArea.Common != null && this._chartArea.Common.ChartPicture != null)
+ {
+ if(!this._chartArea.alignmentInProcess)
+ {
+ AreaAlignmentOrientations orientation = (this._attachedToXAxis == AxisName.X || this._attachedToXAxis == AxisName.X2) ?
+ AreaAlignmentOrientations.Vertical : AreaAlignmentOrientations.Horizontal;
+ this._chartArea.Common.ChartPicture.AlignChartAreasCursor(this._chartArea, orientation, true);
+ }
+ }
+
+ if(this._chartArea != null && !this._chartArea.alignmentInProcess)
+ {
+ this.Invalidate(false);
+ }
+
+ // Send SelectionRangeChanged event
+ if(_fireUserChangedEvent && GetChartObject() != null)
+ {
+ CursorEventArgs arguments = new CursorEventArgs(this._chartArea, this.GetAxis(), this.SelectionStart, this.SelectionEnd);
+ GetChartObject().OnSelectionRangeChanged(arguments);
+ }
+ }
+ }
+
+
+ /// <summary>
+ /// This method sets the starting and ending positions of a range selection.
+ /// </summary>
+ /// <param name="startPoint">A PointF structure that specifies where the range selection begins.</param>
+ /// <param name="endPoint">A PointF structure that specifies where the range selection ends</param>
+ /// <param name="roundToBoundary">If true, the starting and ending points will be rounded to the nearest chart area boundary
+ /// when the specified positions do not fall within a ChartArea object.</param>
+ public void SetSelectionPixelPosition(PointF startPoint, PointF endPoint, bool roundToBoundary)
+ {
+ if(this._chartArea != null && this._chartArea.Common != null && this.GetAxis() != null)
+ {
+ // Calculating the start position
+ double newStart = this.SelectionStart;
+ if(!startPoint.IsEmpty)
+ {
+ PointF relativeCoord = GetPositionInPlotArea(startPoint, roundToBoundary);
+ if(!relativeCoord.IsEmpty)
+ {
+ // Get new selection start position
+ newStart = PositionToCursorPosition(relativeCoord);
+ }
+ }
+
+ // Setting the end position
+ double newEnd = newStart;
+ if(!endPoint.IsEmpty)
+ {
+ PointF relativeCoord = GetPositionInPlotArea(endPoint, roundToBoundary);
+ if(!relativeCoord.IsEmpty)
+ {
+ // Get new selection position
+ newEnd = PositionToCursorPosition(relativeCoord);
+ }
+ }
+
+ // Set new selection start & end position
+ this.SetSelectionPosition(newStart, newEnd);
+ }
+ }
+
+ #endregion
+
+ #region Position rounding methods
+
+ /// <summary>
+ /// Rounds new position of the cursor or range selection
+ /// </summary>
+ /// <param name="cursorPosition"></param>
+ /// <returns></returns>
+ internal double RoundPosition(double cursorPosition)
+ {
+ double roundedPosition = cursorPosition;
+
+ if(!double.IsNaN(roundedPosition))
+ {
+ // Check if position rounding is required
+ if(this.GetAxis() != null &&
+ this.Interval != 0 &&
+ !double.IsNaN(this.Interval))
+ {
+ // Get first series attached to this axis
+ Series axisSeries = null;
+ if(_axis.axisType == AxisName.X || _axis.axisType == AxisName.X2)
+ {
+ List<string> seriesArray = _axis.ChartArea.GetXAxesSeries((_axis.axisType == AxisName.X) ? AxisType.Primary : AxisType.Secondary, _axis.SubAxisName);
+ if(seriesArray.Count > 0)
+ {
+ string seriesName = seriesArray[0] as string;
+ axisSeries = _axis.Common.DataManager.Series[seriesName];
+ if(axisSeries != null && !axisSeries.IsXValueIndexed)
+ {
+ axisSeries = null;
+ }
+ }
+ }
+
+ // If interval type is not set - use number
+ DateTimeIntervalType intervalType =
+ (this.IntervalType == DateTimeIntervalType.Auto) ?
+ DateTimeIntervalType.Number : this.IntervalType;
+
+ // If interval offset type is not set - use interval type
+ DateTimeIntervalType offsetType =
+ (this.IntervalOffsetType == DateTimeIntervalType.Auto) ?
+ intervalType : this.IntervalOffsetType;
+
+ // Round numbers
+ if(intervalType == DateTimeIntervalType.Number)
+ {
+ double newRoundedPosition = Math.Round(roundedPosition / this.Interval) * this.Interval;
+
+ // Add offset number
+ if(this.IntervalOffset != 0 &&
+ !double.IsNaN(IntervalOffset) &&
+ offsetType != DateTimeIntervalType.Auto)
+ {
+ if(this.IntervalOffset > 0)
+ {
+ newRoundedPosition += ChartHelper.GetIntervalSize(newRoundedPosition, this.IntervalOffset, offsetType);
+ }
+ else
+ {
+ newRoundedPosition -= ChartHelper.GetIntervalSize(newRoundedPosition, this.IntervalOffset, offsetType);
+ }
+ }
+
+ // Find rounded position after/before the current
+ double nextPosition = newRoundedPosition;
+ if(newRoundedPosition <= cursorPosition)
+ {
+ nextPosition += ChartHelper.GetIntervalSize(newRoundedPosition, this.Interval, intervalType, axisSeries, 0, DateTimeIntervalType.Number, true);
+ }
+ else
+ {
+ nextPosition -= ChartHelper.GetIntervalSize(newRoundedPosition, this.Interval, intervalType, axisSeries, 0, DateTimeIntervalType.Number, true);
+ }
+
+ // Choose closest rounded position
+ if(Math.Abs(nextPosition - cursorPosition) > Math.Abs(cursorPosition - newRoundedPosition))
+ {
+ roundedPosition = newRoundedPosition;
+ }
+ else
+ {
+ roundedPosition = nextPosition;
+ }
+
+ }
+
+ // Round date/time
+ else
+ {
+ // Find one rounded position prior and one after current position
+ // Adjust start position depending on the interval and type
+ double prevPosition = ChartHelper.AlignIntervalStart(cursorPosition, this.Interval, intervalType, axisSeries);
+
+ // Adjust start position depending on the interval offset and offset type
+ if( IntervalOffset != 0 && axisSeries == null)
+ {
+ if(this.IntervalOffset > 0)
+ {
+ prevPosition += ChartHelper.GetIntervalSize(
+ prevPosition,
+ this.IntervalOffset,
+ offsetType,
+ axisSeries,
+ 0,
+ DateTimeIntervalType.Number,
+ true);
+ }
+ else
+ {
+ prevPosition += ChartHelper.GetIntervalSize(
+ prevPosition,
+ -this.IntervalOffset,
+ offsetType,
+ axisSeries,
+ 0,
+ DateTimeIntervalType.Number,
+ true);
+ }
+ }
+
+ // Find rounded position after/before the current
+ double nextPosition = prevPosition;
+ if(prevPosition <= cursorPosition)
+ {
+ nextPosition += ChartHelper.GetIntervalSize(prevPosition, this.Interval, intervalType, axisSeries, 0, DateTimeIntervalType.Number, true);
+ }
+ else
+ {
+ nextPosition -= ChartHelper.GetIntervalSize(prevPosition, this.Interval, intervalType, axisSeries, 0, DateTimeIntervalType.Number, true);
+ }
+
+ // Choose closest rounded position
+ if(Math.Abs(nextPosition - cursorPosition) > Math.Abs(cursorPosition - prevPosition))
+ {
+ roundedPosition = prevPosition;
+ }
+ else
+ {
+ roundedPosition = nextPosition;
+ }
+ }
+ }
+ }
+
+ return roundedPosition;
+ }
+ #endregion
+
+ #region Mouse events handling for the Cursor
+
+ /// <summary>
+ /// Mouse down event handler.
+ /// </summary>
+ internal void Cursor_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
+ {
+ // Set flag to fire position changing events
+ _fireUserChangingEvent = true;
+ _fireUserChangedEvent = false;
+
+ // Check if left mouse button was clicked in chart area
+ if(e.Button == MouseButtons.Left && !GetPositionInPlotArea(new PointF(e.X, e.Y), false).IsEmpty)
+ {
+ // Change cursor position and selection start position when mouse down
+ if(this.IsUserEnabled)
+ {
+ SetCursorPixelPosition(new PointF(e.X, e.Y), false);
+ }
+ if(this.IsUserSelectionEnabled)
+ {
+ this._userSelectionStart = new PointF(e.X, e.Y);
+ SetSelectionPixelPosition(this._userSelectionStart, PointF.Empty, false);
+ }
+ }
+
+ // Clear flag to fire position changing events
+ _fireUserChangingEvent = false;
+ _fireUserChangedEvent = false;
+ }
+
+ /// <summary>
+ /// Mouse up event handler.
+ /// </summary>
+ internal void Cursor_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
+ {
+ // If in range selection mode
+ if(!this._userSelectionStart.IsEmpty)
+ {
+ // Stop timer
+ _scrollTimer.Stop();
+ _mouseMoveArguments = null;
+
+ // Check if axis data scaleView zooming UI is enabled
+ if(this._axis != null &&
+ this._axis.ScaleView.Zoomable &&
+ !double.IsNaN(this.SelectionStart) &&
+ !double.IsNaN(this.SelectionEnd) &&
+ this.SelectionStart != this.SelectionEnd)
+ {
+ // Zoom data scaleView
+ double start = Math.Min(this.SelectionStart, this.SelectionEnd);
+ double size = (double)Math.Max(this.SelectionStart, this.SelectionEnd) - start;
+ bool zoomed = this._axis.ScaleView.Zoom(start, size, DateTimeIntervalType.Number, true, true);
+
+ // Clear image buffer
+ if(this._chartArea.areaBufferBitmap != null && zoomed)
+ {
+ this._chartArea.areaBufferBitmap.Dispose();
+ this._chartArea.areaBufferBitmap = null;
+ }
+
+ // Clear range selection
+ this.SelectionStart = double.NaN;
+ this.SelectionEnd = double.NaN;
+
+ // NOTE: Fixes issue #6823
+ // Clear cursor position after the zoom in operation
+ this.Position = double.NaN;
+
+ // Align cursor in connected areas
+ if(this._chartArea != null && this._chartArea.Common != null && this._chartArea.Common.ChartPicture != null)
+ {
+ if(!this._chartArea.alignmentInProcess)
+ {
+ AreaAlignmentOrientations orientation = (this._attachedToXAxis == AxisName.X || this._attachedToXAxis == AxisName.X2) ?
+ AreaAlignmentOrientations.Vertical : AreaAlignmentOrientations.Horizontal;
+ this._chartArea.Common.ChartPicture.AlignChartAreasZoomed(this._chartArea, orientation, zoomed);
+ }
+ }
+ }
+
+ // Fire XXXChanged events
+ if(GetChartObject() != null)
+ {
+ CursorEventArgs arguments = new CursorEventArgs(this._chartArea, this.GetAxis(), this.SelectionStart, this.SelectionEnd);
+ GetChartObject().OnSelectionRangeChanged(arguments);
+
+ arguments = new CursorEventArgs(this._chartArea, this.GetAxis(), this.Position);
+ GetChartObject().OnCursorPositionChanged(arguments);
+ }
+
+ // Stop range selection mode
+ this._userSelectionStart = PointF.Empty;
+ }
+ }
+
+ /// <summary>
+ /// Mouse move event handler.
+ /// </summary>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Mobility", "CA1601:DoNotUseTimersThatPreventPowerStateChanges", Justification = "The timer is used for simulating scrolling behavior")]
+ internal void Cursor_MouseMove(System.Windows.Forms.MouseEventArgs e, ref bool handled)
+ {
+ // Process range selection
+ if(this._userSelectionStart != PointF.Empty)
+ {
+ // Mouse move event should not be handled by any other chart elements
+ handled = true;
+
+ // Set flag to fire position changing events
+ _fireUserChangingEvent = true;
+ _fireUserChangedEvent = false;
+
+ // Check if mouse position is outside of the chart area and if not - try scrolling
+ if(this.AutoScroll)
+ {
+ if(this._chartArea != null && this._chartArea.Common != null && this.GetAxis()!= null)
+ {
+ // Check if axis data scaleView is enabled
+ if(!double.IsNaN(this._axis.ScaleView.Position) && !double.IsNaN(this._axis.ScaleView.Size))
+ {
+ ScrollType scrollType = ScrollType.SmallIncrement;
+ bool insideChartArea = true;
+ double offsetFromBoundary = 0.0;
+
+ // Translate mouse pixel coordinates into the relative chart area coordinates
+ float mouseX = e.X * 100F / ((float)(this._chartArea.Common.Width - 1));
+ float mouseY = e.Y * 100F / ((float)(this._chartArea.Common.Height - 1));
+
+ // Check if coordinate is inside chart plotting area
+ if(this._axis.AxisPosition == AxisPosition.Bottom || this._axis.AxisPosition == AxisPosition.Top)
+ {
+ if(mouseX < this._chartArea.PlotAreaPosition.X)
+ {
+ scrollType = ScrollType.SmallDecrement;
+ insideChartArea = false;
+ offsetFromBoundary = this._chartArea.PlotAreaPosition.X - mouseX;
+ }
+ else if(mouseX > this._chartArea.PlotAreaPosition.Right)
+ {
+ scrollType = ScrollType.SmallIncrement;
+ insideChartArea = false;
+ offsetFromBoundary = mouseX - this._chartArea.PlotAreaPosition.Right;
+ }
+ }
+ else
+ {
+ if(mouseY < this._chartArea.PlotAreaPosition.Y)
+ {
+ scrollType = ScrollType.SmallIncrement;
+ insideChartArea = false;
+ offsetFromBoundary = this._chartArea.PlotAreaPosition.Y - mouseY;
+ }
+ else if(mouseY > this._chartArea.PlotAreaPosition.Bottom)
+ {
+ scrollType = ScrollType.SmallDecrement;
+ insideChartArea = false;
+ offsetFromBoundary = mouseY - this._chartArea.PlotAreaPosition.Bottom;
+ }
+ }
+
+ // Try scrolling scaleView position
+ if(!insideChartArea)
+ {
+ // Set flag that data scaleView was scrolled
+ _viewScrolledOnMouseMove = true;
+
+ // Get minimum scroll interval
+ double scrollInterval = ChartHelper.GetIntervalSize(
+ this._axis.ScaleView.Position,
+ this._axis.ScaleView.GetScrollingLineSize(),
+ this._axis.ScaleView.GetScrollingLineSizeType());
+ offsetFromBoundary *= 2;
+ if(offsetFromBoundary > scrollInterval)
+ {
+ scrollInterval = ((int)(offsetFromBoundary / scrollInterval)) * scrollInterval;
+ }
+
+ // Scroll axis data scaleView
+ double newDataViewPosition = this._axis.ScaleView.Position;
+ if(scrollType == ScrollType.SmallIncrement)
+ {
+ newDataViewPosition += scrollInterval;
+ }
+ else
+ {
+ newDataViewPosition -= scrollInterval;
+ }
+
+ // Scroll axis data scaleView
+ this._axis.ScaleView.Scroll(newDataViewPosition);
+
+ // Save last mouse move arguments
+ _mouseMoveArguments = new MouseEventArgs(e.Button, e.Clicks, e.X, e.Y, e.Delta);
+
+ // Start selection scrolling timer
+ if(!_scrollTimer.Enabled)
+ {
+ // Start timer
+ _scrollTimer.Tick += new EventHandler(SelectionScrollingTimerEventProcessor);
+ _scrollTimer.Interval = 200;
+ _scrollTimer.Start();
+ }
+ }
+ else
+ {
+ // Stop timer
+ _scrollTimer.Stop();
+ _mouseMoveArguments = null;
+ }
+ }
+ }
+ }
+
+ // Change cursor position and selection end position when mouse moving
+ if(this.IsUserEnabled)
+ {
+ SetCursorPixelPosition(new PointF(e.X, e.Y), true);
+ }
+ if(this.IsUserSelectionEnabled)
+ {
+ // Set selection
+ SetSelectionPixelPosition(PointF.Empty, new PointF(e.X, e.Y), true);
+ }
+
+ // Clear flag to fire position changing events
+ _fireUserChangingEvent = false;
+ _fireUserChangedEvent = false;
+
+ // Clear flag that data scaleView was scrolled
+ _viewScrolledOnMouseMove = false;
+
+ }
+ }
+
+ /// <summary>
+ /// This is the method to run when the timer is raised.
+ /// Used to scroll axis data scaleView while mouse is outside of the chart area.
+ /// </summary>
+ /// <param name="myObject"></param>
+ /// <param name="myEventArgs"></param>
+ private void SelectionScrollingTimerEventProcessor(Object myObject, EventArgs myEventArgs)
+ {
+ // Simulate mouse move events
+ if(_mouseMoveArguments != null)
+ {
+ bool handled = false;
+ this.Cursor_MouseMove(_mouseMoveArguments, ref handled);
+ }
+ }
+
+ #endregion
+
+#region Cursor helper methods
+
+ /// <summary>
+ /// Helper function which returns a reference to the chart object
+ /// </summary>
+ /// <returns>Chart object reference.</returns>
+ private Chart GetChartObject()
+ {
+ if(this._chartArea != null )
+ {
+ return this._chartArea.Chart;
+ }
+
+ return null;
+ }
+
+ /// <summary>
+ /// Get rectangle of the axis range selection.
+ /// </summary>
+ /// <returns>Selection rectangle.</returns>
+ /// <param name="plotAreaPosition">Plot area rectangle.</param>
+ /// <returns></returns>
+ private RectangleF GetSelectionRect(RectangleF plotAreaPosition)
+ {
+ RectangleF rect = RectangleF.Empty;
+
+ if(this._axis != null &&
+ this.SelectionStart != this.SelectionEnd)
+ {
+ double start = (float)this._axis.GetLinearPosition(this.SelectionStart);
+ double end = (float)this._axis.GetLinearPosition(this.SelectionEnd);
+
+ // Detect if cursor is horizontal or vertical
+ bool horizontal = true;
+ if(this.GetAxis().AxisPosition == AxisPosition.Bottom || this.GetAxis().AxisPosition == AxisPosition.Top)
+ {
+ horizontal = false;
+ }
+
+ if(horizontal)
+ {
+ rect.X = plotAreaPosition.X;
+ rect.Width = plotAreaPosition.Width;
+ rect.Y = (float)Math.Min(start, end);
+ rect.Height = (float)Math.Max(start, end) - rect.Y;
+ }
+ else
+ {
+ rect.Y = plotAreaPosition.Y;
+ rect.Height = plotAreaPosition.Height;
+ rect.X = (float)Math.Min(start, end);
+ rect.Width = (float)Math.Max(start, end) - rect.X;
+ }
+ }
+
+ return rect;
+ }
+
+ /// <summary>
+ /// Get rectangle of the opposite axis selection
+ /// </summary>
+ /// <param name="plotAreaPosition">Plot area rectangle.</param>
+ /// <returns>Opposite selection rectangle.</returns>
+ private RectangleF GetOppositeSelectionRect(RectangleF plotAreaPosition)
+ {
+ if(_chartArea != null)
+ {
+ // Get opposite cursor
+ Cursor oppositeCursor =
+ (_attachedToXAxis == AxisName.X || _attachedToXAxis == AxisName.X2) ?
+ _chartArea.CursorY : _chartArea.CursorX;
+ return oppositeCursor.GetSelectionRect(plotAreaPosition);
+ }
+
+ return RectangleF.Empty;
+ }
+
+ /// <summary>
+ /// Converts X or Y position value to the cursor axis value
+ /// </summary>
+ /// <param name="position">Position in relative coordinates.</param>
+ /// <returns>Cursor position as axis value.</returns>
+ private double PositionToCursorPosition(PointF position)
+ {
+ // Detect if cursor is horizontal or vertical
+ bool horizontal = true;
+ if(this.GetAxis().AxisPosition == AxisPosition.Bottom || this.GetAxis().AxisPosition == AxisPosition.Top)
+ {
+ horizontal = false;
+ }
+
+ // Convert relative coordinates into axis values
+ double newCursorPosition = double.NaN;
+ if(horizontal)
+ {
+ newCursorPosition = this.GetAxis().PositionToValue(position.Y);
+ }
+ else
+ {
+ newCursorPosition = this.GetAxis().PositionToValue(position.X);
+ }
+
+ // Round new position using Step & StepType properties
+ newCursorPosition = RoundPosition(newCursorPosition);
+
+ return newCursorPosition;
+ }
+
+
+ /// <summary>
+ /// Checks if specified point is located inside the plotting area.
+ /// Converts pixel coordinates to relative.
+ /// </summary>
+ /// <param name="point">Point coordinates to test.</param>
+ /// <param name="roundToBoundary">Indicates that coordinates must be rounded to area boundary.</param>
+ /// <returns>PointF.IsEmpty or relative coordinates in plotting area.</returns>
+ private PointF GetPositionInPlotArea(PointF point, bool roundToBoundary)
+ {
+ PointF result = PointF.Empty;
+
+ if(this._chartArea != null && this._chartArea.Common != null && this.GetAxis()!= null)
+ {
+ // Translate mouse pixel coordinates into the relative chart area coordinates
+ result.X = point.X * 100F / ((float)(this._chartArea.Common.Width - 1));
+ result.Y = point.Y * 100F / ((float)(this._chartArea.Common.Height - 1));
+
+ // Round coordinate if it' outside chart plotting area
+ RectangleF plotAreaPosition = this._chartArea.PlotAreaPosition.ToRectangleF();
+ if(roundToBoundary)
+ {
+ if(result.X < plotAreaPosition.X)
+ {
+ result.X = plotAreaPosition.X;
+ }
+ if(result.X > plotAreaPosition.Right)
+ {
+ result.X = plotAreaPosition.Right;
+ }
+ if(result.Y < plotAreaPosition.Y)
+ {
+ result.Y = plotAreaPosition.Y;
+ }
+ if(result.Y > plotAreaPosition.Bottom)
+ {
+ result.Y = plotAreaPosition.Bottom;
+ }
+ }
+ else
+ {
+ // Check if coordinate is inside chart plotting area
+ if(result.X < plotAreaPosition.X ||
+ result.X > plotAreaPosition.Right ||
+ result.Y < plotAreaPosition.Y ||
+ result.Y > plotAreaPosition.Bottom)
+ {
+ result = PointF.Empty;
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /// <summary>
+ /// Invalidate chart are with the cursor.
+ /// </summary>
+ /// <param name="invalidateArea">Chart area must be invalidated.</param>
+ private void Invalidate(bool invalidateArea)
+ {
+ if(this.GetChartObject() != null && this._chartArea != null && !this.GetChartObject().disableInvalidates)
+ {
+ // If data scaleView was scrolled - just invalidate the chart area
+ if(_viewScrolledOnMouseMove || invalidateArea || this.GetChartObject().dirtyFlag)
+ {
+ this._chartArea.Invalidate();
+ }
+
+ // If only cursor/selection position was changed - use optimized drawing algorithm
+ else
+ {
+ // Set flag to redraw cursor/selection only
+ this.GetChartObject().paintTopLevelElementOnly = true;
+
+ // Invalidate and update the chart
+ this._chartArea.Invalidate();
+ this.GetChartObject().Update();
+
+ // Clear flag to redraw cursor/selection only
+ this.GetChartObject().paintTopLevelElementOnly = false;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets axis objects the cursor is attached to.
+ /// </summary>
+ /// <returns>Axis object.</returns>
+ internal Axis GetAxis()
+ {
+ if(_axis == null && _chartArea != null)
+ {
+ if(_attachedToXAxis == AxisName.X)
+ {
+ _axis = (_axisType == AxisType.Primary) ? _chartArea.AxisX : _chartArea.AxisX2;
+ }
+ else
+ {
+ _axis = (_axisType == AxisType.Primary) ? _chartArea.AxisY : _chartArea.AxisY2;
+ }
+ }
+
+ return _axis;
+ }
+
+ #endregion
+
+#region IDisposable Members
+
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected virtual void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ // Dispose managed resources
+ if (this._scrollTimer != null)
+ {
+ this._scrollTimer.Dispose();
+ this._scrollTimer = null;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// </summary>
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// The CursorEventArgs class stores the event arguments for cursor and selection events.
+ /// </summary>
+ public class CursorEventArgs : EventArgs
+ {
+#region Private fields
+
+ // Private fields for properties values storage
+ private ChartArea _chartArea = null;
+ private Axis _axis = null;
+ private double _newPosition = double.NaN;
+ private double _newSelectionStart = double.NaN;
+ private double _newSelectionEnd = double.NaN;
+
+ #endregion
+
+#region Constructors
+
+ /// <summary>
+ /// CursorEventArgs constructor.
+ /// </summary>
+ /// <param name="chartArea">ChartArea of the cursor.</param>
+ /// <param name="axis">Axis of the cursor.</param>
+ /// <param name="newPosition">New cursor position.</param>
+ public CursorEventArgs(ChartArea chartArea, Axis axis, double newPosition)
+ {
+ this._chartArea = chartArea;
+ this._axis = axis;
+ this._newPosition = newPosition;
+ this._newSelectionStart = double.NaN;
+ this._newSelectionEnd = double.NaN;
+ }
+
+ /// <summary>
+ /// CursorEventArgs constructor.
+ /// </summary>
+ /// <param name="chartArea">ChartArea of the cursor.</param>
+ /// <param name="axis">Axis of the cursor.</param>
+ /// <param name="newSelectionStart">New range selection starting position.</param>
+ /// <param name="newSelectionEnd">New range selection ending position.</param>
+ public CursorEventArgs(ChartArea chartArea, Axis axis, double newSelectionStart, double newSelectionEnd)
+ {
+ this._chartArea = chartArea;
+ this._axis = axis;
+ this._newPosition = double.NaN;
+ this._newSelectionStart = newSelectionStart;
+ this._newSelectionEnd = newSelectionEnd;
+ }
+
+ #endregion
+
+#region Properties
+
+ /// <summary>
+ /// ChartArea of the event.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeChartArea"),
+ ]
+ public ChartArea ChartArea
+ {
+ get
+ {
+ return _chartArea;
+ }
+ }
+
+ /// <summary>
+ /// Axis of the event.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeAxis"),
+ ]
+ public Axis Axis
+ {
+ get
+ {
+ return _axis;
+ }
+ }
+
+ /// <summary>
+ /// New cursor position.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeCursorEventArgs_NewPosition"),
+ ]
+ public double NewPosition
+ {
+ get
+ {
+ return _newPosition;
+ }
+ set
+ {
+ _newPosition = value;
+ }
+ }
+
+ /// <summary>
+ /// New range selection starting position.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeCursorEventArgs_NewSelectionStart"),
+ ]
+ public double NewSelectionStart
+ {
+ get
+ {
+ return _newSelectionStart;
+ }
+ set
+ {
+ _newSelectionStart = value;
+ }
+ }
+
+ /// <summary>
+ /// New range selection ending position.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeCursorEventArgs_NewSelectionEnd"),
+ ]
+ public double NewSelectionEnd
+ {
+ get
+ {
+ return _newSelectionEnd;
+ }
+ set
+ {
+ _newSelectionEnd = value;
+ }
+ }
+
+ #endregion
+ }
+}
+
+#endif // #if WINFORMS_CONTROL \ No newline at end of file
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartElement.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartElement.cs
new file mode 100644
index 00000000000..7e36ac624a3
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartElement.cs
@@ -0,0 +1,1458 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: ChartElement.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: ChartHelper
+//
+// Purpose: The chart element is base class for the big number
+// of classes. It stores common methods and data.
+//
+// Reviewed: GS - August 2, 2002
+// AG - August 8, 2002
+// AG - Microsoft 16, 2007
+//
+//===================================================================
+
+
+#region Used namespaces
+
+using System;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Collections;
+using System.Diagnostics.CodeAnalysis;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ #region Enumerations
+
+ /// <summary>
+ /// An enumeration that specifies a label alignment.
+ /// </summary>
+ [
+ Flags
+ ]
+ public enum LabelAlignmentStyles
+ {
+ /// <summary>
+ /// Label is aligned to the top of the data point.
+ /// </summary>
+ Top = 1,
+ /// <summary>
+ /// Label is aligned to the bottom of the data point.
+ /// </summary>
+ Bottom = 2,
+ /// <summary>
+ /// Label is aligned to the right of the data point.
+ /// </summary>
+ Right = 4,
+ /// <summary>
+ /// Label is aligned to the left of the data point.
+ /// </summary>
+ Left = 8,
+ /// <summary>
+ /// Label is aligned to the top-left corner of the data point.
+ /// </summary>
+ TopLeft = 16,
+ /// <summary>
+ /// Label is aligned to the top-right corner of the data point.
+ /// </summary>
+ TopRight = 32,
+ /// <summary>
+ /// Label is aligned to the bottom-left of the data point.
+ /// </summary>
+ BottomLeft = 64,
+ /// <summary>
+ /// Label is aligned to the bottom-right of the data point.
+ /// </summary>
+ BottomRight = 128,
+ /// <summary>
+ /// Label is aligned to the center of the data point.
+ /// </summary>
+ Center = 256,
+ }
+
+ /// <summary>
+ /// An enumeration of chart types.
+ /// </summary>
+ public enum SeriesChartType
+ {
+ /// <summary>
+ /// Point chart type.
+ /// </summary>
+ Point,
+
+ /// <summary>
+ /// FastPoint chart type.
+ /// </summary>
+ FastPoint,
+
+ /// <summary>
+ /// Bubble chart type.
+ /// </summary>
+ Bubble,
+ /// <summary>
+ /// Line chart type.
+ /// </summary>
+ Line,
+ /// <summary>
+ /// Spline chart type.
+ /// </summary>
+ Spline,
+ /// <summary>
+ /// StepLine chart type.
+ /// </summary>
+ StepLine,
+
+ /// <summary>
+ /// FastLine chart type.
+ /// </summary>
+ FastLine,
+
+ /// <summary>
+ /// Bar chart type.
+ /// </summary>
+ Bar,
+ /// <summary>
+ /// Stacked bar chart type.
+ /// </summary>
+ StackedBar,
+ /// <summary>
+ /// Hundred percent stacked bar chart type.
+ /// </summary>
+ StackedBar100,
+ /// <summary>
+ /// Column chart type.
+ /// </summary>
+ Column,
+ /// <summary>
+ /// Stacked column chart type.
+ /// </summary>
+ StackedColumn,
+ /// <summary>
+ /// Hundred percent stacked column chart type.
+ /// </summary>
+ StackedColumn100,
+ /// <summary>
+ /// Area chart type.
+ /// </summary>
+ Area,
+ /// <summary>
+ /// Spline area chart type.
+ /// </summary>
+ SplineArea,
+ /// <summary>
+ /// Stacked area chart type.
+ /// </summary>
+ StackedArea,
+ /// <summary>
+ /// Hundred percent stacked area chart type.
+ /// </summary>
+ StackedArea100,
+ /// <summary>
+ /// Pie chart type.
+ /// </summary>
+ Pie,
+ /// <summary>
+ /// Doughnut chart type.
+ /// </summary>
+ Doughnut,
+ /// <summary>
+ /// Stock chart type.
+ /// </summary>
+ Stock,
+ /// <summary>
+ /// CandleStick chart type.
+ /// </summary>
+ Candlestick,
+ /// <summary>
+ /// Range chart type.
+ /// </summary>
+ Range,
+ /// <summary>
+ /// Spline range chart type.
+ /// </summary>
+ SplineRange,
+ /// <summary>
+ /// RangeBar chart type.
+ /// </summary>
+ RangeBar,
+ /// <summary>
+ /// Range column chart type.
+ /// </summary>
+ RangeColumn,
+ /// <summary>
+ /// Radar chart type.
+ /// </summary>
+ Radar,
+ /// <summary>
+ /// Polar chart type.
+ /// </summary>
+ Polar,
+ /// <summary>
+ /// Error bar chart type.
+ /// </summary>
+ ErrorBar,
+ /// <summary>
+ /// Box plot chart type.
+ /// </summary>
+ BoxPlot,
+ /// <summary>
+ /// Renko chart type.
+ /// </summary>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Renko")]
+ Renko,
+ /// <summary>
+ /// ThreeLineBreak chart type.
+ /// </summary>
+ ThreeLineBreak,
+ /// <summary>
+ /// Kagi chart type.
+ /// </summary>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Kagi")]
+ Kagi,
+ /// <summary>
+ /// PointAndFigure chart type.
+ /// </summary>
+ PointAndFigure,
+ /// <summary>
+ /// Funnel chart type.
+ /// </summary>
+ Funnel,
+ /// <summary>
+ /// Pyramid chart type.
+ /// </summary>
+ Pyramid,
+ }
+
+ /// <summary>
+ /// Axis Arrow orientation
+ /// </summary>
+ internal enum ArrowOrientation
+ {
+ /// <summary>
+ /// Arrow direction is Right - Left
+ /// </summary>
+ Left,
+ /// <summary>
+ /// Arrow direction is Left - Right
+ /// </summary>
+ Right,
+ /// <summary>
+ /// Arrow direction is Bottom - Top
+ /// </summary>
+ Top,
+ /// <summary>
+ /// Arrow direction is Top - Bottom
+ /// </summary>
+ Bottom
+ }
+
+ /// <summary>
+ /// An enumeration of image alignment.
+ /// </summary>
+ public enum ChartImageAlignmentStyle
+ {
+ /// <summary>
+ /// The mage is aligned to the top left corner of the chart element.
+ /// </summary>
+ TopLeft,
+ /// <summary>
+ /// The image is aligned to the top boundary of the chart element.
+ /// </summary>
+ Top,
+ /// <summary>
+ /// The image is aligned to the top right corner of the chart element.
+ /// </summary>
+ TopRight,
+ /// <summary>
+ /// The image is aligned to the right boundary of the chart element.
+ /// </summary>
+ Right,
+ /// <summary>
+ /// The image is aligned to the bottom right corner of the chart element.
+ /// </summary>
+ BottomRight,
+ /// <summary>
+ /// The image is aligned to the bottom boundary of the chart element.
+ /// </summary>
+ Bottom,
+ /// <summary>
+ /// The image is aligned to the bottom left corner of the chart element.
+ /// </summary>
+ BottomLeft,
+ /// <summary>
+ /// The image is aligned to the left boundary of the chart element.
+ /// </summary>
+ Left,
+ /// <summary>
+ /// The image is aligned in the center of the chart element.
+ /// </summary>
+ Center
+ };
+
+ /// <summary>
+ /// An enumeration that specifies a background image drawing mode.
+ /// </summary>
+ public enum ChartImageWrapMode
+ {
+ /// <summary>
+ /// Background image is scaled to fit the entire chart element.
+ /// </summary>
+ Scaled = WrapMode.Clamp,
+
+ /// <summary>
+ /// Background image is tiled to fit the entire chart element.
+ /// </summary>
+ Tile = WrapMode.Tile,
+
+ /// <summary>
+ /// Every other tiled image is reversed around the X-axis.
+ /// </summary>
+ TileFlipX = WrapMode.TileFlipX,
+
+ /// <summary>
+ /// Every other tiled image is reversed around the X-axis and Y-axis.
+ /// </summary>
+ TileFlipXY = WrapMode.TileFlipXY,
+
+ /// <summary>
+ /// Every other tiled image is reversed around the Y-axis.
+ /// </summary>
+ TileFlipY = WrapMode.TileFlipY,
+
+ /// <summary>
+ /// Background image is not scaled.
+ /// </summary>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Unscaled")]
+ Unscaled = 100
+ };
+
+ /// <summary>
+ /// An enumeration that specifies the state of an axis.
+ /// </summary>
+ public enum AxisEnabled
+ {
+ /// <summary>
+ /// The axis is only enabled if it used to plot a Series.
+ /// </summary>
+ Auto,
+
+ /// <summary>
+ /// The axis is always enabled.
+ /// </summary>
+ True,
+
+ /// <summary>
+ /// The axis is never enabled.
+ /// </summary>
+ False
+
+ };
+
+ /// <summary>
+ /// An enumeration of units of measurement of an interval.
+ /// </summary>
+ public enum DateTimeIntervalType
+ {
+ /// <summary>
+ /// Automatically determined by the Chart control.
+ /// </summary>
+ Auto,
+
+ /// <summary>
+ /// The interval is numerical.
+ /// </summary>
+ Number,
+
+ /// <summary>
+ /// The interval is years.
+ /// </summary>
+ Years,
+
+ /// <summary>
+ /// The interval is months.
+ /// </summary>
+ Months,
+
+ /// <summary>
+ /// The interval is weeks.
+ /// </summary>
+ Weeks,
+
+ /// <summary>
+ /// The interval is days.
+ /// </summary>
+ Days,
+
+ /// <summary>
+ /// The interval is hours.
+ /// </summary>
+ Hours,
+
+ /// <summary>
+ /// The interval is minutes.
+ /// </summary>
+ Minutes,
+
+ /// <summary>
+ /// The interval is seconds.
+ /// </summary>
+ Seconds,
+
+ /// <summary>
+ /// The interval is milliseconds.
+ /// </summary>
+ Milliseconds,
+
+ /// <summary>
+ /// The interval type is not defined.
+ /// </summary>
+ NotSet,
+ }
+
+ /// <summary>
+ /// An enumeration that specifies value types for various chart properties
+ /// </summary>
+ public enum ChartValueType
+ {
+ /// <summary>
+ /// Property type is set automatically by the Chart control.
+ /// </summary>
+ Auto,
+
+ /// <summary>
+ /// Double value.
+ /// </summary>
+ Double,
+
+ /// <summary>
+ /// Single value.
+ /// </summary>
+ Single,
+
+ /// <summary>
+ /// Int32 value.
+ /// </summary>
+ Int32,
+
+ /// <summary>
+ /// Int64 value.
+ /// </summary>
+ Int64,
+
+ /// <summary>
+ /// UInt32 value.
+ /// </summary>
+ [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly",
+ Justification = "These names are patterned after the standard CLR types for consistency")]
+ UInt32,
+
+ /// <summary>
+ /// UInt64 value.
+ /// </summary>
+ [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly",
+ Justification = "These names are patterned after the standard CLR types for consistency")]
+ UInt64,
+
+ /// <summary>
+ /// String value.
+ /// </summary>
+ String,
+
+ /// <summary>
+ /// DateTime value.
+ /// </summary>
+ DateTime,
+
+ /// <summary>
+ /// Date portion of the DateTime value.
+ /// </summary>
+ Date,
+
+ /// <summary>
+ /// Time portion of the DateTime value.
+ /// </summary>
+ Time,
+
+ /// <summary>
+ /// DateTime with offset
+ /// </summary>
+ DateTimeOffset
+ };
+
+ /// <summary>
+ /// An enumeration that specifies a hatching style.
+ /// </summary>
+ public enum ChartHatchStyle
+ {
+ /// <summary>
+ /// No hatching style.
+ /// </summary>
+ None,
+ /// <summary>
+ /// Backward diagonal style.
+ /// </summary>
+ BackwardDiagonal,
+ /// <summary>
+ /// Cross style.
+ /// </summary>
+ Cross,
+ /// <summary>
+ /// Dark downward diagonal style.
+ /// </summary>
+ DarkDownwardDiagonal,
+ /// <summary>
+ /// Dark horizontal style.
+ /// </summary>
+ DarkHorizontal,
+ /// <summary>
+ /// Dark upward diagonal style.
+ /// </summary>
+ DarkUpwardDiagonal,
+ /// <summary>
+ /// Dark vertical style.
+ /// </summary>
+ DarkVertical,
+ /// <summary>
+ /// Dashed downward diagonal style.
+ /// </summary>
+ DashedDownwardDiagonal,
+ /// <summary>
+ /// Dashed horizontal style.
+ /// </summary>
+ DashedHorizontal,
+ /// <summary>
+ /// Dashed upward diagonal style.
+ /// </summary>
+ DashedUpwardDiagonal,
+ /// <summary>
+ /// Dashed vertical style.
+ /// </summary>
+ DashedVertical,
+ /// <summary>
+ /// Diagonal brick style.
+ /// </summary>
+ DiagonalBrick,
+ /// <summary>
+ /// Diagonal cross style.
+ /// </summary>
+ DiagonalCross,
+ /// <summary>
+ /// Divot style.
+ /// </summary>
+ Divot,
+ /// <summary>
+ /// Dotted diamond style.
+ /// </summary>
+ DottedDiamond,
+ /// <summary>
+ /// Dotted grid style.
+ /// </summary>
+ DottedGrid,
+ /// <summary>
+ /// Forward diagonal style.
+ /// </summary>
+ ForwardDiagonal,
+ /// <summary>
+ /// Horizontal style.
+ /// </summary>
+ Horizontal,
+ /// <summary>
+ /// Horizontal brick style.
+ /// </summary>
+ HorizontalBrick,
+ /// <summary>
+ /// Large checker board style.
+ /// </summary>
+ [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "CheckerBoard")]
+ LargeCheckerBoard,
+ /// <summary>
+ /// Large confetti style.
+ /// </summary>
+ LargeConfetti,
+ /// <summary>
+ /// Large grid style.
+ /// </summary>
+ LargeGrid,
+ /// <summary>
+ /// Light downward diagonal style.
+ /// </summary>
+ LightDownwardDiagonal,
+ /// <summary>
+ /// Light horizontal style.
+ /// </summary>
+ LightHorizontal,
+ /// <summary>
+ /// Light upward diagonal style.
+ /// </summary>
+ LightUpwardDiagonal,
+ /// <summary>
+ /// Light vertical style.
+ /// </summary>
+ LightVertical,
+ /// <summary>
+ /// Narrow horizontal style.
+ /// </summary>
+ NarrowHorizontal,
+ /// <summary>
+ /// Narrow vertical style.
+ /// </summary>
+ NarrowVertical,
+ /// <summary>
+ /// Outlined diamond style.
+ /// </summary>
+ OutlinedDiamond,
+ /// <summary>
+ /// Percent05 style.
+ /// </summary>
+ Percent05,
+ /// <summary>
+ /// Percent10 style.
+ /// </summary>
+ Percent10,
+ /// <summary>
+ /// Percent20 style.
+ /// </summary>
+ Percent20,
+ /// <summary>
+ /// Percent25 style.
+ /// </summary>
+ Percent25,
+ /// <summary>
+ /// Percent30 style.
+ /// </summary>
+ Percent30,
+ /// <summary>
+ /// Percent40 style.
+ /// </summary>
+ Percent40,
+ /// <summary>
+ /// Percent50 style.
+ /// </summary>
+ Percent50,
+ /// <summary>
+ /// Percent60 style.
+ /// </summary>
+ Percent60,
+ /// <summary>
+ /// Percent70 style.
+ /// </summary>
+ Percent70,
+ /// <summary>
+ /// Percent75 style.
+ /// </summary>
+ Percent75,
+ /// <summary>
+ /// Percent80 style.
+ /// </summary>
+ Percent80,
+ /// <summary>
+ /// Percent90 style.
+ /// </summary>
+ Percent90,
+ /// <summary>
+ /// Plaid style.
+ /// </summary>
+ Plaid,
+ /// <summary>
+ /// Shingle style.
+ /// </summary>
+ Shingle,
+ /// <summary>
+ /// Small checker board style.
+ /// </summary>
+ [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "CheckerBoard")]
+ SmallCheckerBoard,
+ /// <summary>
+ /// Small confetti style.
+ /// </summary>
+ SmallConfetti,
+ /// <summary>
+ /// Small grid style.
+ /// </summary>
+ SmallGrid,
+ /// <summary>
+ /// Solid diamond style.
+ /// </summary>
+ SolidDiamond,
+ /// <summary>
+ /// Sphere style.
+ /// </summary>
+ Sphere,
+ /// <summary>
+ /// Trellis style.
+ /// </summary>
+ Trellis,
+ /// <summary>
+ /// Vertical style.
+ /// </summary>
+ Vertical,
+ /// <summary>
+ /// Wave style.
+ /// </summary>
+ Wave,
+ /// <summary>
+ /// Weave style.
+ /// </summary>
+ Weave,
+ /// <summary>
+ /// Wide downward diagonal style.
+ /// </summary>
+ WideDownwardDiagonal,
+ /// <summary>
+ /// Wide upward diagonal style.
+ /// </summary>
+ WideUpwardDiagonal,
+ /// <summary>
+ /// ZigZag style.
+ /// </summary>
+ [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "ZigZag")]
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Zig")]
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Zag")]
+ ZigZag
+ };
+
+ /// <summary>
+ /// An enumeration that specifies the level of anti-aliasing quality.
+ /// </summary>
+ public enum TextAntiAliasingQuality
+ {
+ /// <summary>
+ /// Normal anti-aliasing quality.
+ /// </summary>
+ Normal,
+ /// <summary>
+ /// High anti-aliasing quality.
+ /// </summary>
+ High,
+ /// <summary>
+ /// System default anti-aliasing quality.
+ /// </summary>
+ SystemDefault
+ }
+
+ /// <summary>
+ /// An enumeration of anti-aliasing flags.
+ /// </summary>
+ [Flags]
+ public enum AntiAliasingStyles
+ {
+ /// <summary>
+ /// No anti-aliasing.
+ /// </summary>
+ None = 0,
+
+ /// <summary>
+ /// Use anti-aliasing when drawing text.
+ /// </summary>
+ Text = 1,
+
+ /// <summary>
+ /// Use anti-aliasing when drawing grahics primitives (e.g. lines, rectangle)
+ /// </summary>
+ Graphics = 2,
+
+ /// <summary>
+ /// Use anti-alias for everything.
+ /// </summary>
+ All = Text | Graphics
+
+ };
+
+ /// <summary>
+ /// An enumeration of marker styles.
+ /// </summary>
+ public enum MarkerStyle
+ {
+ /// <summary>
+ /// No marker is displayed for the series/data point.
+ /// </summary>
+ None = 0,
+
+ /// <summary>
+ /// A square marker is displayed.
+ /// </summary>
+ Square = 1,
+
+ /// <summary>
+ /// A circle marker is displayed.
+ /// </summary>
+ Circle = 2,
+
+ /// <summary>
+ /// A diamond-shaped marker is displayed.
+ /// </summary>
+ Diamond = 3,
+
+ /// <summary>
+ /// A triangular marker is displayed.
+ /// </summary>
+ Triangle = 4,
+
+ /// <summary>
+ /// A cross-shaped marker is displayed.
+ /// </summary>
+ Cross = 5,
+
+ /// <summary>
+ /// A 4-point star-shaped marker is displayed.
+ /// </summary>
+ Star4 = 6,
+
+ /// <summary>
+ /// A 5-point star-shaped marker is displayed.
+ /// </summary>
+ Star5 = 7,
+
+ /// <summary>
+ /// A 6-point star-shaped marker is displayed.
+ /// </summary>
+ Star6 = 8,
+
+ /// <summary>
+ /// A 10-point star-shaped marker is displayed.
+ /// </summary>
+ Star10 = 9
+
+ };
+
+ /// <summary>
+ /// An enumeration of gradient styles.
+ /// </summary>
+ public enum GradientStyle
+ {
+ /// <summary>
+ /// No gradient is used.
+ /// </summary>
+ None,
+
+ /// <summary>
+ /// Gradient is applied from left to right.
+ /// </summary>
+ LeftRight,
+
+ /// <summary>
+ /// Gradient is applied from top to bottom.
+ /// </summary>
+ TopBottom,
+
+ /// <summary>
+ /// Gradient is applied from the center outwards.
+ /// </summary>
+ Center,
+
+ /// <summary>
+ /// Gradient is applied diagonally from left to right.
+ /// </summary>
+ DiagonalLeft,
+
+ /// <summary>
+ /// Gradient is applied diagonally from right to left.
+ /// </summary>
+ DiagonalRight,
+
+ /// <summary>
+ /// Gradient is applied horizontally from the center outwards.
+ /// </summary>
+ HorizontalCenter,
+
+ /// <summary>
+ /// Gradient is applied vertically from the center outwards.
+ /// </summary>
+ VerticalCenter
+ };
+
+ #endregion
+
+ #region ChartElement
+
+ /// <summary>
+ /// Common chart helper methods used across different chart elements.
+ /// </summary>
+ internal class ChartHelper
+ {
+ #region Fields
+
+ /// <summary>
+ /// Maximum number of grid lines per Axis
+ /// </summary>
+ internal const int MaxNumOfGridlines = 10000;
+
+ #endregion // Fields
+
+ #region Constructor
+
+ /// <summary>
+ /// Private constructor to avoid instantiating the class
+ /// </summary>
+ private ChartHelper() { }
+
+ #endregion // Constructor
+
+ #region Methods
+
+ /// <summary>
+ /// Adjust the beginnin of the first interval depending on the type and size.
+ /// </summary>
+ /// <param name="start">Original start point.</param>
+ /// <param name="intervalSize">Interval size.</param>
+ /// <param name="type">AxisName of the interval (Month, Year, ...).</param>
+ /// <returns>Adjusted interval start position as double.</returns>
+ internal static double AlignIntervalStart(double start, double intervalSize, DateTimeIntervalType type)
+ {
+ return AlignIntervalStart(start, intervalSize, type, null);
+ }
+
+ /// <summary>
+ /// Adjust the beginnin of the first interval depending on the type and size.
+ /// </summary>
+ /// <param name="start">Original start point.</param>
+ /// <param name="intervalSize">Interval size.</param>
+ /// <param name="type">AxisName of the interval (Month, Year, ...).</param>
+ /// <param name="series">First series connected to the axis.</param>
+ /// <returns>Adjusted interval start position as double.</returns>
+ internal static double AlignIntervalStart(double start, double intervalSize, DateTimeIntervalType type, Series series)
+ {
+ return AlignIntervalStart( start, intervalSize, type, series, true );
+ }
+
+ /// <summary>
+ /// Adjust the beginnin of the first interval depending on the type and size.
+ /// </summary>
+ /// <param name="start">Original start point.</param>
+ /// <param name="intervalSize">Interval size.</param>
+ /// <param name="type">AxisName of the interval (Month, Year, ...).</param>
+ /// <param name="series">First series connected to the axis.</param>
+ /// <param name="majorInterval">Interval is used for major gridlines or tickmarks.</param>
+ /// <returns>Adjusted interval start position as double.</returns>
+ internal static double AlignIntervalStart(double start, double intervalSize, DateTimeIntervalType type, Series series, bool majorInterval)
+ {
+ // Special case for indexed series
+ if(series != null && series.IsXValueIndexed)
+ {
+ if(type == DateTimeIntervalType.Auto ||
+ type == DateTimeIntervalType.Number)
+ {
+ if( majorInterval )
+ {
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+ return -(series.Points.Count + 1);
+ }
+
+ // Non indexed series
+ else
+ {
+ // Do not adjust start position for these interval type
+ if(type == DateTimeIntervalType.Auto ||
+ type == DateTimeIntervalType.Number)
+ {
+ return start;
+ }
+
+ // Get the beginning of the interval depending on type
+ DateTime newStartDate = DateTime.FromOADate(start);
+
+ // Adjust the months interval depending on size
+ if(intervalSize > 0.0 && intervalSize != 1.0)
+ {
+ if(type == DateTimeIntervalType.Months && intervalSize <= 12.0 && intervalSize > 1)
+ {
+ // Make sure that the beginning is aligned correctly for cases
+ // like quarters and half years
+ DateTime resultDate = newStartDate;
+ DateTime sizeAdjustedDate = new DateTime(newStartDate.Year, 1, 1, 0, 0, 0);
+ while(sizeAdjustedDate < newStartDate)
+ {
+ resultDate = sizeAdjustedDate;
+ sizeAdjustedDate = sizeAdjustedDate.AddMonths((int)intervalSize);
+ }
+
+ newStartDate = resultDate;
+ return newStartDate.ToOADate();
+ }
+ }
+
+ // Check interval type
+ switch(type)
+ {
+ case(DateTimeIntervalType.Years):
+ int year = (int)((int)(newStartDate.Year / intervalSize) * intervalSize);
+ if(year <= 0)
+ {
+ year = 1;
+ }
+ newStartDate = new DateTime(year,
+ 1, 1, 0, 0, 0);
+ break;
+
+ case(DateTimeIntervalType.Months):
+ int month = (int)((int)(newStartDate.Month / intervalSize) * intervalSize);
+ if(month <= 0)
+ {
+ month = 1;
+ }
+ newStartDate = new DateTime(newStartDate.Year,
+ month, 1, 0, 0, 0);
+ break;
+
+ case(DateTimeIntervalType.Days):
+ int day = (int)((int)(newStartDate.Day / intervalSize) * intervalSize);
+ if(day <= 0)
+ {
+ day = 1;
+ }
+ newStartDate = new DateTime(newStartDate.Year,
+ newStartDate.Month, day, 0, 0, 0);
+ break;
+
+ case(DateTimeIntervalType.Hours):
+ int hour = (int)((int)(newStartDate.Hour / intervalSize) * intervalSize);
+ newStartDate = new DateTime(newStartDate.Year,
+ newStartDate.Month, newStartDate.Day, hour, 0, 0);
+ break;
+
+ case(DateTimeIntervalType.Minutes):
+ int minute = (int)((int)(newStartDate.Minute / intervalSize) * intervalSize);
+ newStartDate = new DateTime(newStartDate.Year,
+ newStartDate.Month,
+ newStartDate.Day,
+ newStartDate.Hour,
+ minute,
+ 0);
+ break;
+
+ case(DateTimeIntervalType.Seconds):
+ int second = (int)((int)(newStartDate.Second / intervalSize) * intervalSize);
+ newStartDate = new DateTime(newStartDate.Year,
+ newStartDate.Month,
+ newStartDate.Day,
+ newStartDate.Hour,
+ newStartDate.Minute,
+ second,
+ 0);
+ break;
+
+ case(DateTimeIntervalType.Milliseconds):
+ int milliseconds = (int)((int)(newStartDate.Millisecond / intervalSize) * intervalSize);
+ newStartDate = new DateTime(newStartDate.Year,
+ newStartDate.Month,
+ newStartDate.Day,
+ newStartDate.Hour,
+ newStartDate.Minute,
+ newStartDate.Second,
+ milliseconds);
+ break;
+
+ case(DateTimeIntervalType.Weeks):
+
+ // NOTE: Code below was changed to fix issue #5962
+ // Elements that have interval set to weeks should be aligned to the
+ // nearest Monday no matter how many weeks is the interval.
+ //newStartDate = newStartDate.AddDays(-((int)newStartDate.DayOfWeek * intervalSize));
+ newStartDate = newStartDate.AddDays(-((int)newStartDate.DayOfWeek));
+ newStartDate = new DateTime(newStartDate.Year,
+ newStartDate.Month, newStartDate.Day, 0, 0, 0);
+ break;
+ }
+
+ return newStartDate.ToOADate();
+ }
+ }
+
+
+ /// <summary>
+ /// Gets interval size as double number.
+ /// </summary>
+ /// <param name="current">Current value.</param>
+ /// <param name="interval">Interval size.</param>
+ /// <param name="type">AxisName of the interval (Month, Year, ...).</param>
+ /// <returns>Interval size as double.</returns>
+ internal static double GetIntervalSize(double current, double interval, DateTimeIntervalType type)
+ {
+ return GetIntervalSize(
+ current,
+ interval,
+ type,
+ null,
+ 0,
+ DateTimeIntervalType.Number,
+ true,
+ true);
+ }
+
+ /// <summary>
+ /// Gets interval size as double number.
+ /// </summary>
+ /// <param name="current">Current value.</param>
+ /// <param name="interval">Interval size.</param>
+ /// <param name="type">AxisName of the interval (Month, Year, ...).</param>
+ /// <param name="series">First series connected to the axis.</param>
+ /// <param name="intervalOffset">Offset size.</param>
+ /// <param name="intervalOffsetType">Offset type(Month, Year, ...).</param>
+ /// <param name="forceIntIndex">Force Integer indexed</param>
+ /// <returns>Interval size as double.</returns>
+ internal static double GetIntervalSize(
+ double current,
+ double interval,
+ DateTimeIntervalType type,
+ Series series,
+ double intervalOffset,
+ DateTimeIntervalType intervalOffsetType,
+ bool forceIntIndex)
+ {
+ return GetIntervalSize(
+ current,
+ interval,
+ type,
+ series,
+ intervalOffset,
+ intervalOffsetType,
+ forceIntIndex,
+ true);
+ }
+
+ /// <summary>
+ /// Gets interval size as double number.
+ /// </summary>
+ /// <param name="current">Current value.</param>
+ /// <param name="interval">Interval size.</param>
+ /// <param name="type">AxisName of the interval (Month, Year, ...).</param>
+ /// <param name="series">First series connected to the axis.</param>
+ /// <param name="intervalOffset">Offset size.</param>
+ /// <param name="intervalOffsetType">Offset type(Month, Year, ...).</param>
+ /// <param name="forceIntIndex">Force Integer indexed</param>
+ /// <param name="forceAbsInterval">Force Integer indexed</param>
+ /// <returns>Interval size as double.</returns>
+ internal static double GetIntervalSize(
+ double current,
+ double interval,
+ DateTimeIntervalType type,
+ Series series,
+ double intervalOffset,
+ DateTimeIntervalType intervalOffsetType,
+ bool forceIntIndex,
+ bool forceAbsInterval)
+ {
+ // AxisName is not date.
+ if( type == DateTimeIntervalType.Number || type == DateTimeIntervalType.Auto )
+ {
+ return interval;
+ }
+
+ // Special case for indexed series
+ if(series != null && series.IsXValueIndexed)
+ {
+ // Check point index
+ int pointIndex = (int)Math.Ceiling(current - 1);
+ if(pointIndex < 0)
+ {
+ pointIndex = 0;
+ }
+ if(pointIndex >= series.Points.Count || series.Points.Count <= 1)
+ {
+ return interval;
+ }
+
+ // Get starting and ending values of the closest interval
+ double adjuster = 0;
+ double xValue = series.Points[pointIndex].XValue;
+ xValue = AlignIntervalStart(xValue, 1, type, null);
+ double xEndValue = xValue + GetIntervalSize(xValue, interval, type);
+ xEndValue += GetIntervalSize(xEndValue, intervalOffset, intervalOffsetType);
+ xValue += GetIntervalSize(xValue, intervalOffset, intervalOffsetType);
+ if(intervalOffset < 0)
+ {
+ xValue = xValue + GetIntervalSize(xValue, interval, type);
+ xEndValue = xEndValue + GetIntervalSize(xEndValue, interval, type);
+ }
+
+ // The first point in the series
+ if(pointIndex == 0 && current < 0)
+ {
+ // Round the first point value depending on the interval type
+ DateTime dateValue = DateTime.FromOADate(series.Points[pointIndex].XValue);
+ DateTime roundedDateValue = dateValue;
+ switch(type)
+ {
+ case(DateTimeIntervalType.Years): // Ignore hours,...
+ roundedDateValue = new DateTime(dateValue.Year,
+ dateValue.Month, dateValue.Day, 0, 0, 0);
+ break;
+
+ case(DateTimeIntervalType.Months): // Ignore hours,...
+ roundedDateValue = new DateTime(dateValue.Year,
+ dateValue.Month, dateValue.Day, 0, 0, 0);
+ break;
+
+ case(DateTimeIntervalType.Days): // Ignore hours,...
+ roundedDateValue = new DateTime(dateValue.Year,
+ dateValue.Month, dateValue.Day, 0, 0, 0);
+ break;
+
+ case(DateTimeIntervalType.Hours): //
+ roundedDateValue = new DateTime(dateValue.Year,
+ dateValue.Month, dateValue.Day, dateValue.Hour,
+ dateValue.Minute, 0);
+ break;
+
+ case(DateTimeIntervalType.Minutes):
+ roundedDateValue = new DateTime(dateValue.Year,
+ dateValue.Month,
+ dateValue.Day,
+ dateValue.Hour,
+ dateValue.Minute,
+ dateValue.Second);
+ break;
+
+ case(DateTimeIntervalType.Seconds):
+ roundedDateValue = new DateTime(dateValue.Year,
+ dateValue.Month,
+ dateValue.Day,
+ dateValue.Hour,
+ dateValue.Minute,
+ dateValue.Second,
+ 0);
+ break;
+
+ case(DateTimeIntervalType.Weeks):
+ roundedDateValue = new DateTime(dateValue.Year,
+ dateValue.Month, dateValue.Day, 0, 0, 0);
+ break;
+ }
+
+ // The first point value is exactly on the interval boundaries
+ if(roundedDateValue.ToOADate() == xValue || roundedDateValue.ToOADate() == xEndValue)
+ {
+ return - current + 1;
+ }
+ }
+
+ // Adjuster of 0.5 means that position should be between points
+ ++pointIndex;
+ while(pointIndex < series.Points.Count)
+ {
+ if(series.Points[pointIndex].XValue >= xEndValue)
+ {
+ if(series.Points[pointIndex].XValue > xEndValue && !forceIntIndex)
+ {
+ adjuster = -0.5;
+ }
+ break;
+ }
+
+ ++pointIndex;
+ }
+
+ // If last point outside of the max series index
+ if(pointIndex == series.Points.Count)
+ {
+ pointIndex += series.Points.Count/5 + 1;
+ }
+
+ double size = (pointIndex + 1) - current + adjuster;
+
+ return (size != 0) ? size : interval;
+ }
+
+ // Non indexed series
+ else
+ {
+ DateTime date = DateTime.FromOADate(current);
+ TimeSpan span = new TimeSpan(0);
+
+ if(type == DateTimeIntervalType.Days)
+ {
+ span = TimeSpan.FromDays(interval);
+ }
+ else if(type == DateTimeIntervalType.Hours)
+ {
+ span = TimeSpan.FromHours(interval);
+ }
+ else if(type == DateTimeIntervalType.Milliseconds)
+ {
+ span = TimeSpan.FromMilliseconds(interval);
+ }
+ else if(type == DateTimeIntervalType.Seconds)
+ {
+ span = TimeSpan.FromSeconds(interval);
+ }
+ else if(type == DateTimeIntervalType.Minutes)
+ {
+ span = TimeSpan.FromMinutes(interval);
+ }
+ else if(type == DateTimeIntervalType.Weeks)
+ {
+ span = TimeSpan.FromDays(7.0 * interval);
+ }
+ else if(type == DateTimeIntervalType.Months)
+ {
+ // Special case handling when current date points
+ // to the last day of the month
+ bool lastMonthDay = false;
+ if(date.Day == DateTime.DaysInMonth(date.Year, date.Month))
+ {
+ lastMonthDay = true;
+ }
+
+ // Add specified amount of months
+ date = date.AddMonths((int)Math.Floor(interval));
+ span = TimeSpan.FromDays(30.0 * ( interval - Math.Floor(interval) ));
+
+ // Check if last month of the day was used
+ if(lastMonthDay && span.Ticks == 0)
+ {
+ // Make sure the last day of the month is selected
+ int daysInMobth = DateTime.DaysInMonth(date.Year, date.Month);
+ date = date.AddDays(daysInMobth - date.Day);
+ }
+ }
+ else if(type == DateTimeIntervalType.Years)
+ {
+ date = date.AddYears((int)Math.Floor(interval));
+ span = TimeSpan.FromDays(365.0 * ( interval - Math.Floor(interval) ));
+ }
+
+ // Check if an absolute interval size must be returned
+ double result = date.Add(span).ToOADate() - current;
+ if(forceAbsInterval)
+ {
+ result = Math.Abs(result);
+ }
+ return result;
+ }
+ }
+
+ /// <summary>
+ /// Check if series is indexed. IsXValueIndexed flag is set or all X values are zeros.
+ /// </summary>
+ /// <param name="series">Data series to test.</param>
+ /// <returns>True if series is indexed.</returns>
+ static internal bool IndexedSeries( Series series)
+ {
+ // X value indexed flag set
+ if (series.IsXValueIndexed)
+ {
+ return true;
+ }
+
+ if (Utilities.CustomPropertyRegistry.IsXAxisQuantitativeChartTypes.Contains(series.ChartType) &&
+ series.IsCustomPropertySet(Utilities.CustomPropertyName.IsXAxisQuantitative))
+ {
+ string attribValue = series[Utilities.CustomPropertyName.IsXAxisQuantitative];
+ if (String.Compare(attribValue, "True", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ return false;
+ }
+ }
+
+ // Check if series has all X values set to zero
+ return SeriesXValuesZeros(series);
+ }
+
+ /// <summary>
+ /// Check if all data points in the series have X value set to 0.
+ /// </summary>
+ /// <param name="series">Data series to check.</param>
+ static private bool SeriesXValuesZeros( Series series )
+ {
+ // Check if X value zeros check was already done
+ if(series.xValuesZerosChecked)
+ {
+ return series.xValuesZeros;
+ }
+
+ // Data point loop
+ series.xValuesZerosChecked = true;
+ series.xValuesZeros = true;
+ foreach( DataPoint point in series.Points )
+ {
+ if( point.XValue != 0.0 )
+ {
+ // If any data point has value different than 0 return false
+ series.xValuesZeros = false;
+ break;
+ }
+ }
+ return series.xValuesZeros;
+ }
+
+ /// <summary>
+ /// Check if any series is indexed. IsXValueIndexed flag is set or all X values are zeros.
+ /// </summary>
+ /// <param name="common">Reference to common chart classes.</param>
+ /// <param name="series">Data series names.</param>
+ /// <returns>True if any series is indexed.</returns>
+ static internal bool IndexedSeries(CommonElements common, params string[] series)
+ {
+ // Data series loop
+ bool zeroXValues = true;
+ foreach (string ser in series)
+ {
+ Series localSeries = common.DataManager.Series[ser];
+
+ // Check series indexed flag
+ if (localSeries.IsXValueIndexed)
+ {
+ // If flag set in at least one series - all series are indexed
+ return true;
+ }
+
+ // Check if series has all X values set to zero
+ if (zeroXValues && !IndexedSeries(localSeries))
+ {
+ zeroXValues = false;
+ }
+ }
+
+ return zeroXValues;
+ }
+
+ /// <summary>
+ /// Check if all data points in many series have X value set to 0.
+ /// </summary>
+ /// <param name="common">Reference to common chart classes.</param>
+ /// <param name="series">Data series.</param>
+ /// <returns>True if all data points have value 0.</returns>
+ static internal bool SeriesXValuesZeros(CommonElements common, params string[] series)
+ {
+ // Data series loop
+ foreach( string ser in series )
+ {
+ // Check one series X values
+ if(!SeriesXValuesZeros(common.DataManager.Series[ ser ]))
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ #endregion
+ }
+
+ #endregion //ChartElement
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartGraphics.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartGraphics.cs
new file mode 100644
index 00000000000..ac6545a25ee
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartGraphics.cs
@@ -0,0 +1,5779 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: ChartGraphics.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: ChartGraphics
+//
+// Purpose: Chart graphic class is used for drawing Chart
+// elements as Rectangles, Pie slices, lines, areas
+// etc. This class is used in all classes where
+// drawing is necessary. The GDI+ graphic class is
+// used throw this class. Encapsulates a GDI+ chart
+// drawing functionality
+//
+// Reviewed: GS - Jul 31, 2002
+// AG - August 7, 2002
+// AG - Microsoft 16, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Drawing.Text;
+using System.Drawing.Imaging;
+using System.Diagnostics.CodeAnalysis;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+#else
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+ using System.Web.UI.DataVisualization.Charting.Borders3D;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ #region Enumerations
+
+ /// <summary>
+ /// Defines the style how the bars/columns are drawn.
+ /// </summary>
+ internal enum BarDrawingStyle
+ {
+ /// <summary>
+ /// Default bar/column style.
+ /// </summary>
+ Default,
+
+ /// <summary>
+ /// Cylinder bar/column style.
+ /// </summary>
+ Cylinder,
+
+ /// <summary>
+ /// Emboss bar/column style.
+ /// </summary>
+ Emboss,
+
+ /// <summary>
+ /// LightToDark bar/column style.
+ /// </summary>
+ LightToDark,
+
+ /// <summary>
+ /// Wedge bar/column style.
+ /// </summary>
+ Wedge,
+ }
+
+ /// <summary>
+ /// Defines the style how the pie and doughnut charts are drawn.
+ /// </summary>
+ internal enum PieDrawingStyle
+ {
+ /// <summary>
+ /// Default pie/doughnut drawing style.
+ /// </summary>
+ Default,
+
+ /// <summary>
+ /// Soft edge shadow is drawn on the edges of the pie/doughnut slices.
+ /// </summary>
+ SoftEdge,
+
+ /// <summary>
+ /// A shadow is drawn from the top to the bottom of the pie/doughnut chart.
+ /// </summary>
+ Concave,
+ }
+
+ /// <summary>
+ /// An enumeration of line styles.
+ /// </summary>
+ public enum ChartDashStyle
+ {
+ /// <summary>
+ /// Line style not set
+ /// </summary>
+ NotSet,
+ /// <summary>
+ /// Specifies a line consisting of dashes.
+ /// </summary>
+ Dash,
+ /// <summary>
+ /// Specifies a line consisting of a repeating pattern of dash-dot.
+ /// </summary>
+ DashDot,
+ /// <summary>
+ /// Specifies a line consisting of a repeating pattern of dash-dot-dot.
+ /// </summary>
+ DashDotDot,
+ /// <summary>
+ /// Specifies a line consisting of dots.
+ /// </summary>
+ Dot,
+ /// <summary>
+ /// Specifies a solid line.
+ /// </summary>
+ Solid,
+ }
+
+ #endregion
+
+ /// <summary>
+ /// The ChartGraphics class provides all chart drawing capabilities.
+ /// It contains methods for drawing 2D primitives and also exposes
+ /// all ChartGraphics3D class methods for 3D shapes. Only this
+ /// class should be used for any drawing in the chart.
+ /// </summary>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public partial class ChartGraphics : ChartElement
+ {
+ #region Fields
+
+ // Common Elements
+ private CommonElements _common;
+
+ // Reusable objects
+ private Pen _pen;
+ private SolidBrush _solidBrush;
+ private Matrix _myMatrix;
+
+ // Private fields which represents picture size
+ private int _width;
+ private int _height;
+
+ // Indicates that smoothing is applied while drawing shadows
+ internal bool softShadows = true;
+
+ // Anti aliasing flags
+ private AntiAliasingStyles _antiAliasing = AntiAliasingStyles.All;
+
+ // True if rendering into the metafile
+ internal bool IsMetafile = false;
+
+ #endregion
+
+ #region Lines Methods
+
+ /// <summary>
+ /// Draws a line connecting the two specified points.
+ /// </summary>
+ /// <param name="color">Line color.</param>
+ /// <param name="width">Line width.</param>
+ /// <param name="style">Line style.</param>
+ /// <param name="firstPointF">A Point that represents the first point to connect.</param>
+ /// <param name="secondPointF">A Point that represents the second point to connect.</param>
+ internal void DrawLineRel(
+ Color color,
+ int width,
+ ChartDashStyle style,
+ PointF firstPointF,
+ PointF secondPointF
+ )
+ {
+ DrawLineAbs(
+ color,
+ width,
+ style,
+ GetAbsolutePoint(firstPointF),
+ GetAbsolutePoint(secondPointF) );
+ }
+
+ /// <summary>
+ /// Draws a line connecting the two specified points using absolute coordinates.
+ /// </summary>
+ /// <param name="color">Line color.</param>
+ /// <param name="width">Line width.</param>
+ /// <param name="style">Line style.</param>
+ /// <param name="firstPoint">A Point that represents the first point to connect.</param>
+ /// <param name="secondPoint">A Point that represents the second point to connect.</param>
+ internal void DrawLineAbs(
+ Color color,
+ int width,
+ ChartDashStyle style,
+ PointF firstPoint,
+ PointF secondPoint
+ )
+ {
+ // Do not draw line if width is 0 or style not set
+ if( width == 0 || style == ChartDashStyle.NotSet )
+ {
+ return;
+ }
+
+ // Set a line color
+ if(_pen.Color != color)
+ {
+ _pen.Color = color;
+ }
+
+ // Set a line width
+ if(_pen.Width != width)
+ {
+ _pen.Width = width;
+ }
+
+ // Set a line style
+ if(_pen.DashStyle != GetPenStyle( style ))
+ {
+ _pen.DashStyle = GetPenStyle( style );
+ }
+
+ // Remember SmoothingMode and turn off anti aliasing for
+ // vertical or horizontal lines usinig 1 pixel dashed pen.
+ // This prevents anialiasing from completly smoothing the
+ // dashed line.
+ SmoothingMode oldSmoothingMode = this.SmoothingMode;
+ if(width <= 1 && style != ChartDashStyle.Solid)
+ {
+ if(firstPoint.X == secondPoint.X ||
+ firstPoint.Y == secondPoint.Y)
+ {
+ this.SmoothingMode = SmoothingMode.Default;
+ }
+ }
+
+ // Draw a line
+ this.DrawLine(_pen,
+ (float)Math.Round(firstPoint.X),
+ (float)Math.Round(firstPoint.Y),
+ (float)Math.Round(secondPoint.X),
+ (float)Math.Round(secondPoint.Y) );
+
+ // Return old smoothing mode
+ this.SmoothingMode = oldSmoothingMode;
+ }
+
+ /// <summary>
+ /// Draws a line with shadow connecting the two specified points.
+ /// </summary>
+ /// <param name="color">Line color.</param>
+ /// <param name="width">Line width.</param>
+ /// <param name="style">Line style.</param>
+ /// <param name="firstPoint">A Point that represents the first point to connect.</param>
+ /// <param name="secondPoint">A Point that represents the second point to connect.</param>
+ /// <param name="shadowColor">Shadow Color.</param>
+ /// <param name="shadowOffset">Shadow Offset.</param>
+ internal void DrawLineRel(
+ Color color,
+ int width,
+ ChartDashStyle style,
+ PointF firstPoint,
+ PointF secondPoint,
+ Color shadowColor,
+ int shadowOffset
+ )
+ {
+ DrawLineAbs(
+ color,
+ width,
+ style,
+ GetAbsolutePoint(firstPoint),
+ GetAbsolutePoint(secondPoint),
+ shadowColor,
+ shadowOffset );
+ }
+
+ /// <summary>
+ /// Draws a line with shadow connecting the two specified points.
+ /// </summary>
+ /// <param name="color">Line color.</param>
+ /// <param name="width">Line width.</param>
+ /// <param name="style">Line style.</param>
+ /// <param name="firstPoint">A Point that represents the first point to connect.</param>
+ /// <param name="secondPoint">A Point that represents the second point to connect.</param>
+ /// <param name="shadowColor">Shadow Color.</param>
+ /// <param name="shadowOffset">Shadow Offset.</param>
+ internal void DrawLineAbs(
+ Color color,
+ int width,
+ ChartDashStyle style,
+ PointF firstPoint,
+ PointF secondPoint,
+ Color shadowColor,
+ int shadowOffset
+ )
+ {
+ if(shadowOffset != 0)
+ {
+ // Shadow color
+ Color shColor;
+
+ // Make shadow semi transparent
+ // if alpha value not used
+ if( shadowColor.A != 255 )
+ shColor = shadowColor;
+ else
+ shColor = Color.FromArgb(color.A/2, shadowColor);
+
+ // Set shadow line position
+ PointF firstShadow = new PointF( firstPoint.X + shadowOffset, firstPoint.Y + shadowOffset);
+ PointF secondShadow = new PointF( secondPoint.X + shadowOffset, secondPoint.Y + shadowOffset );
+
+ // Draw Shadow of Line
+ DrawLineAbs( shColor, width, style, firstShadow, secondShadow );
+ }
+
+ // Draw Line
+ DrawLineAbs( color, width, style, firstPoint, secondPoint );
+ }
+
+ #endregion
+
+ #region Pen and Brush Methods
+
+ /// <summary>
+ /// Creates a Hatch Brush.
+ /// </summary>
+ /// <param name="hatchStyle">Chart Hatch style.</param>
+ /// <param name="backColor">Back Color.</param>
+ /// <param name="foreColor">Fore Color.</param>
+ /// <returns>Brush</returns>
+ internal Brush GetHatchBrush(
+ ChartHatchStyle hatchStyle,
+ Color backColor,
+ Color foreColor
+ )
+ {
+ // Convert Chart Hatch Style enum
+ // to Hatch Style enum.
+ HatchStyle hatch;
+ hatch = (HatchStyle)Enum.Parse(typeof(HatchStyle),hatchStyle.ToString());
+
+ // Create Hatch Brush
+ return new HatchBrush( hatch, foreColor, backColor );
+ }
+
+ /// <summary>
+ /// Creates a textured brush.
+ /// </summary>
+ /// <param name="name">Image file name or URL.</param>
+ /// <param name="backImageTransparentColor">Image transparent color.</param>
+ /// <param name="mode">Wrap mode.</param>
+ /// <param name="backColor">Image background color.</param>
+ /// <returns>Textured brush.</returns>
+ internal Brush GetTextureBrush(
+ string name,
+ Color backImageTransparentColor,
+ ChartImageWrapMode mode,
+ Color backColor
+ )
+ {
+ // Load a image
+ System.Drawing.Image image = _common.ImageLoader.LoadImage( name );
+
+ // Create a brush
+ ImageAttributes attrib = new ImageAttributes();
+ attrib.SetWrapMode((mode == ChartImageWrapMode.Unscaled) ? WrapMode.Clamp : ((WrapMode)mode));
+ if(backImageTransparentColor != Color.Empty)
+ {
+ attrib.SetColorKey(backImageTransparentColor, backImageTransparentColor, ColorAdjustType.Default);
+ }
+
+ // If image is a metafile background must be filled first
+ // Solves issue that background is not cleared correctly
+ if(backImageTransparentColor == Color.Empty &&
+ image is Metafile &&
+ backColor != Color.Transparent)
+ {
+ TextureBrush backFilledBrush = null;
+ Bitmap bitmap = new Bitmap(image.Width, image.Height);
+ using(Graphics graphics = Graphics.FromImage(bitmap))
+ {
+ using(SolidBrush backBrush = new SolidBrush(backColor))
+ {
+ graphics.FillRectangle(backBrush, 0, 0, image.Width, image.Height);
+ graphics.DrawImageUnscaled(image, 0, 0);
+ backFilledBrush= new TextureBrush( bitmap, new RectangleF(0,0,image.Width,image.Height), attrib);
+ }
+ }
+
+ return backFilledBrush;
+ }
+
+
+ TextureBrush textureBrush;
+
+ if (ImageLoader.DoDpisMatch(image, this.Graphics))
+ textureBrush = new TextureBrush(image, new RectangleF(0, 0, image.Width, image.Height), attrib);
+ else // if the image dpi does not match the graphics dpi we have to scale the image
+ {
+ Image scaledImage = ImageLoader.GetScaledImage(image, this.Graphics);
+ textureBrush = new TextureBrush(scaledImage, new RectangleF(0, 0, scaledImage.Width, scaledImage.Height), attrib);
+ scaledImage.Dispose();
+ }
+
+ return textureBrush;
+
+ }
+
+ /// <summary>
+ /// This method creates a gradient brush.
+ /// </summary>
+ /// <param name="rectangle">A rectangle which has to be filled with a gradient color.</param>
+ /// <param name="firstColor">First color.</param>
+ /// <param name="secondColor">Second color.</param>
+ /// <param name="type ">Gradient type .</param>
+ /// <returns>Gradient Brush</returns>
+ internal Brush GetGradientBrush(
+ RectangleF rectangle,
+ Color firstColor,
+ Color secondColor,
+ GradientStyle type
+ )
+ {
+ // Increse the brush rectangle by 1 pixel to ensure the fit
+ rectangle.Inflate(1f, 1f);
+
+ Brush gradientBrush = null;
+ float angle = 0;
+
+ // Function which create gradient brush fires exception if
+ // rectangle size is zero.
+ if( rectangle.Height == 0 || rectangle.Width == 0 )
+ {
+ gradientBrush = new SolidBrush( Color.Black );
+ return gradientBrush;
+ }
+
+ // *******************************************
+ // Linear Gradient
+ // *******************************************
+ // Check linear type .
+ if( type == GradientStyle.LeftRight || type == GradientStyle.VerticalCenter )
+ {
+ angle = 0;
+ }
+ else if( type == GradientStyle.TopBottom || type == GradientStyle.HorizontalCenter )
+ {
+ angle = 90;
+ }
+ else if( type == GradientStyle.DiagonalLeft )
+ {
+ angle = (float)(Math.Atan(rectangle.Width / rectangle.Height)* 180 / Math.PI);
+ }
+ else if( type == GradientStyle.DiagonalRight )
+ {
+ angle = (float)(180 - Math.Atan(rectangle.Width / rectangle.Height)* 180 / Math.PI);
+ }
+
+ // Create a linear gradient brush
+ if( type == GradientStyle.TopBottom || type == GradientStyle.LeftRight
+ || type == GradientStyle.DiagonalLeft || type == GradientStyle.DiagonalRight
+ || type == GradientStyle.HorizontalCenter || type == GradientStyle.VerticalCenter )
+ {
+ RectangleF tempRect = new RectangleF(rectangle.X,rectangle.Y,rectangle.Width,rectangle.Height);
+ // For Horizontal and vertical center gradient types
+ if( type == GradientStyle.HorizontalCenter )
+ {
+ // Resize and wrap gradient
+ tempRect.Height = tempRect.Height / 2F;
+ LinearGradientBrush linearGradientBrush = new LinearGradientBrush(tempRect, firstColor, secondColor, angle);
+ gradientBrush = linearGradientBrush;
+ linearGradientBrush.WrapMode = WrapMode.TileFlipX;
+ }
+ else if( type == GradientStyle.VerticalCenter )
+ {
+ // Resize and wrap gradient
+ tempRect.Width = tempRect.Width / 2F;
+ LinearGradientBrush linearGradientBrush = new LinearGradientBrush(tempRect, firstColor, secondColor, angle);
+ gradientBrush = linearGradientBrush;
+ linearGradientBrush.WrapMode = WrapMode.TileFlipX;
+ }
+ else
+ {
+ gradientBrush = new LinearGradientBrush( rectangle, firstColor, secondColor, angle );
+ }
+ return gradientBrush;
+ }
+
+ // *******************************************
+ // Gradient is not linear : From Center.
+ // *******************************************
+
+ // Create a path
+ GraphicsPath path = new GraphicsPath();
+
+ // Add a rectangle to the path
+ path.AddRectangle( rectangle );
+
+ // Create a gradient brush
+ PathGradientBrush pathGradientBrush = new PathGradientBrush(path);
+ gradientBrush = pathGradientBrush;
+
+ // Set the center color
+ pathGradientBrush.CenterColor = firstColor;
+
+ // Set the Surround color
+ Color[] colors = {secondColor};
+ pathGradientBrush.SurroundColors = colors;
+
+ if( path != null )
+ {
+ path.Dispose();
+ }
+
+ return gradientBrush;
+ }
+
+ /// <summary>
+ /// This method creates a gradient brush for pie. This gradient is one
+ /// of the types used only with pie and doughnut.
+ /// </summary>
+ /// <param name="rectangle">A rectangle which has to be filled with a gradient color</param>
+ /// <param name="firstColor">First color</param>
+ /// <param name="secondColor">Second color</param>
+ /// <returns>Gradient Brush</returns>
+ internal Brush GetPieGradientBrush(
+ RectangleF rectangle,
+ Color firstColor,
+ Color secondColor
+ )
+ {
+ // Create a path that consists of a single ellipse.
+ GraphicsPath path = new GraphicsPath();
+ path.AddEllipse( rectangle );
+
+ // Use the path to construct a brush.
+ PathGradientBrush gradientBrush = new PathGradientBrush(path);
+
+ // Set the color at the center of the path.
+ gradientBrush.CenterColor = firstColor;
+
+ // Set the color along the entire boundary
+ // of the path to aqua.
+ Color[] colors = {secondColor};
+
+ gradientBrush.SurroundColors = colors;
+
+ if( path != null )
+ {
+ path.Dispose();
+ }
+
+ return gradientBrush;
+
+ }
+
+ /// <summary>
+ /// Converts GDI+ line style to Chart Graph line style.
+ /// </summary>
+ /// <param name="style">Chart Line style.</param>
+ /// <returns>GDI+ line style.</returns>
+ internal DashStyle GetPenStyle( ChartDashStyle style )
+ {
+ // Convert to chart line styles. The custom style doesn’t exist.
+ switch( style )
+ {
+ case ChartDashStyle.Dash:
+ return DashStyle.Dash;
+ case ChartDashStyle.DashDot:
+ return DashStyle.DashDot;
+ case ChartDashStyle.DashDotDot:
+ return DashStyle.DashDotDot;
+ case ChartDashStyle.Dot:
+ return DashStyle.Dot;
+ }
+
+ return DashStyle.Solid;
+ }
+
+ #endregion
+
+ #region Markers
+
+ /// <summary>
+ /// Creates polygon for multi-corner star marker.
+ /// </summary>
+ /// <param name="rect">Marker rectangle.</param>
+ /// <param name="numberOfCorners">Number of corners (4 and up).</param>
+ /// <returns>Array of points.</returns>
+ internal PointF[] CreateStarPolygon(RectangleF rect, int numberOfCorners)
+ {
+ int numberOfCornersX2;
+ checked
+ {
+ numberOfCornersX2 = numberOfCorners * 2;
+ }
+
+ bool outside = true;
+ PointF[] points = new PointF[numberOfCornersX2];
+ PointF[] tempPoints = new PointF[1];
+ // overflow check
+ for (int pointIndex = 0; pointIndex < numberOfCornersX2; pointIndex++)
+ {
+ tempPoints[0] = new PointF(rect.X + rect.Width/2f, (outside == true) ? rect.Y : rect.Y + rect.Height/4f);
+ Matrix matrix = new Matrix();
+ matrix.RotateAt(pointIndex*(360f/(numberOfCorners*2f)), new PointF(rect.X + rect.Width/2f, rect.Y + rect.Height/2f));
+ matrix.TransformPoints(tempPoints);
+ points[pointIndex] = tempPoints[0];
+ outside = !outside;
+ }
+
+ return points;
+ }
+
+ /// <summary>
+ /// Draw marker using relative coordinates of the center.
+ /// </summary>
+ /// <param name="point">Coordinates of the center.</param>
+ /// <param name="markerStyle">Marker style.</param>
+ /// <param name="markerSize">Marker size.</param>
+ /// <param name="markerColor">Marker color.</param>
+ /// <param name="markerBorderColor">Marker border color.</param>
+ /// <param name="markerBorderSize">Marker border size.</param>
+ /// <param name="markerImage">Marker image name.</param>
+ /// <param name="markerImageTransparentColor">Marker image transparent color.</param>
+ /// <param name="shadowSize">Marker shadow size.</param>
+ /// <param name="shadowColor">Marker shadow color.</param>
+ /// <param name="imageScaleRect">Rectangle to which marker image should be scaled.</param>
+ internal void DrawMarkerRel(
+ PointF point,
+ MarkerStyle markerStyle,
+ int markerSize,
+ Color markerColor,
+ Color markerBorderColor,
+ int markerBorderSize,
+ string markerImage,
+ Color markerImageTransparentColor,
+ int shadowSize,
+ Color shadowColor,
+ RectangleF imageScaleRect
+ )
+ {
+ DrawMarkerAbs(this.GetAbsolutePoint(point), markerStyle, markerSize, markerColor, markerBorderColor, markerBorderSize, markerImage, markerImageTransparentColor, shadowSize, shadowColor, imageScaleRect, false);
+ }
+
+ /// <summary>
+ /// Draw marker using absolute coordinates of the center.
+ /// </summary>
+ /// <param name="point">Coordinates of the center.</param>
+ /// <param name="markerStyle">Marker style.</param>
+ /// <param name="markerSize">Marker size.</param>
+ /// <param name="markerColor">Marker color.</param>
+ /// <param name="markerBorderColor">Marker border color.</param>
+ /// <param name="markerBorderSize">Marker border size.</param>
+ /// <param name="markerImage">Marker image name.</param>
+ /// <param name="markerImageTransparentColor">Marker image transparent color.</param>
+ /// <param name="shadowSize">Marker shadow size.</param>
+ /// <param name="shadowColor">Marker shadow color.</param>
+ /// <param name="imageScaleRect">Rectangle to which marker image should be scaled.</param>
+ /// <param name="forceAntiAlias">Always use anti aliasing when drawing the marker.</param>
+ internal void DrawMarkerAbs(
+ PointF point,
+ MarkerStyle markerStyle,
+ int markerSize,
+ Color markerColor,
+ Color markerBorderColor,
+ int markerBorderSize,
+ string markerImage,
+ Color markerImageTransparentColor,
+ int shadowSize,
+ Color shadowColor,
+ RectangleF imageScaleRect,
+ bool forceAntiAlias
+ )
+ {
+ // Hide border when zero width specified
+ if(markerBorderSize <= 0)
+ {
+ markerBorderColor = Color.Transparent;
+ }
+
+ // Draw image instead of standart markers
+ if(markerImage.Length > 0)
+ {
+ // Get image
+ System.Drawing.Image image = _common.ImageLoader.LoadImage( markerImage );
+
+ if (image != null)
+ {
+ // Calculate image rectangle
+ RectangleF rect = RectangleF.Empty;
+ if (imageScaleRect == RectangleF.Empty)
+ {
+ SizeF size = new SizeF();
+ ImageLoader.GetAdjustedImageSize(image, this.Graphics, ref size);
+ imageScaleRect.Width = size.Width;
+ imageScaleRect.Height = size.Height;
+ }
+
+ rect.X = point.X - imageScaleRect.Width / 2F;
+ rect.Y = point.Y - imageScaleRect.Height / 2F;
+ rect.Width = imageScaleRect.Width;
+ rect.Height = imageScaleRect.Height;
+
+ // Prepare image properties (transparent color)
+ ImageAttributes attrib = new ImageAttributes();
+ if (markerImageTransparentColor != Color.Empty)
+ {
+ attrib.SetColorKey(markerImageTransparentColor, markerImageTransparentColor, ColorAdjustType.Default);
+ }
+
+ // Draw image shadow
+ if (shadowSize != 0 && shadowColor != Color.Empty)
+ {
+ ImageAttributes attribShadow = new ImageAttributes();
+ attribShadow.SetColorKey(markerImageTransparentColor, markerImageTransparentColor, ColorAdjustType.Default);
+ ColorMatrix colorMatrix = new ColorMatrix();
+ colorMatrix.Matrix00 = 0.25f; // Red
+ colorMatrix.Matrix11 = 0.25f; // Green
+ colorMatrix.Matrix22 = 0.25f; // Blue
+ colorMatrix.Matrix33 = 0.5f; // alpha
+ colorMatrix.Matrix44 = 1.0f; // w
+ attribShadow.SetColorMatrix(colorMatrix);
+
+ this.DrawImage(image,
+ new Rectangle((int)rect.X + shadowSize, (int)rect.Y + shadowSize, (int)rect.Width, (int)rect.Height),
+ 0, 0, image.Width, image.Height,
+ GraphicsUnit.Pixel,
+ attribShadow);
+ }
+
+ // Draw image
+ this.DrawImage(image,
+ new Rectangle((int)rect.X, (int)rect.Y, (int)rect.Width, (int)rect.Height),
+ 0, 0, image.Width, image.Height,
+ GraphicsUnit.Pixel,
+ attrib);
+ }
+ }
+
+ // Draw standart marker using style, size and color
+ else if(markerStyle != MarkerStyle.None && markerSize > 0 && markerColor != Color.Empty)
+ {
+ // Enable antialising
+ SmoothingMode oldSmoothingMode = this.SmoothingMode;
+ if(forceAntiAlias)
+ {
+ this.SmoothingMode = SmoothingMode.AntiAlias;
+ }
+
+ // Create solid color brush
+ using (SolidBrush brush = new SolidBrush(markerColor))
+ {
+ // Calculate marker rectangle
+ RectangleF rect = RectangleF.Empty;
+ rect.X = point.X - ((float)markerSize) / 2F;
+ rect.Y = point.Y - ((float)markerSize) / 2F;
+ rect.Width = markerSize;
+ rect.Height = markerSize;
+
+ // Draw marker depending on style
+ switch (markerStyle)
+ {
+ case (MarkerStyle.Star4):
+ case (MarkerStyle.Star5):
+ case (MarkerStyle.Star6):
+ case (MarkerStyle.Star10):
+ {
+ // Set number of corners
+ int cornerNumber = 4;
+ if (markerStyle == MarkerStyle.Star5)
+ {
+ cornerNumber = 5;
+ }
+ else if (markerStyle == MarkerStyle.Star6)
+ {
+ cornerNumber = 6;
+ }
+ else if (markerStyle == MarkerStyle.Star10)
+ {
+ cornerNumber = 10;
+ }
+
+ // Get star polygon
+ PointF[] points = CreateStarPolygon(rect, cornerNumber);
+
+ // Draw shadow
+ if (shadowSize != 0 && shadowColor != Color.Empty)
+ {
+ Matrix translateMatrix = this.Transform.Clone();
+ translateMatrix.Translate(shadowSize, shadowSize);
+ Matrix oldMatrix = this.Transform;
+ this.Transform = translateMatrix;
+
+ this.FillPolygon(new SolidBrush((shadowColor.A != 255) ? shadowColor : Color.FromArgb(markerColor.A / 2, shadowColor)), points);
+
+ this.Transform = oldMatrix;
+ }
+
+ // Draw star
+ this.FillPolygon(brush, points);
+ this.DrawPolygon(new Pen(markerBorderColor, markerBorderSize), points);
+ break;
+ }
+ case (MarkerStyle.Circle):
+ {
+ // Draw marker shadow
+ if (shadowSize != 0 && shadowColor != Color.Empty)
+ {
+ if (!softShadows)
+ {
+ using (SolidBrush shadowBrush = new SolidBrush((shadowColor.A != 255) ? shadowColor : Color.FromArgb(markerColor.A / 2, shadowColor)))
+ {
+ RectangleF shadowRect = rect;
+ shadowRect.X += shadowSize;
+ shadowRect.Y += shadowSize;
+ this.FillEllipse(shadowBrush, shadowRect);
+ }
+ }
+ else
+ {
+ // Add circle to the graphics path
+ using (GraphicsPath path = new GraphicsPath())
+ {
+ path.AddEllipse(rect.X + shadowSize - 1, rect.Y + shadowSize - 1, rect.Width + 2, rect.Height + 2);
+
+ // Create path brush
+ using (PathGradientBrush shadowBrush = new PathGradientBrush(path))
+ {
+ shadowBrush.CenterColor = shadowColor;
+
+ // Set the color along the entire boundary of the path
+ Color[] colors = { Color.Transparent };
+ shadowBrush.SurroundColors = colors;
+ shadowBrush.CenterPoint = new PointF(point.X, point.Y);
+
+ // Define brush focus scale
+ PointF focusScale = new PointF(1 - 2f * shadowSize / rect.Width, 1 - 2f * shadowSize / rect.Height);
+ if (focusScale.X < 0)
+ {
+ focusScale.X = 0;
+ }
+ if (focusScale.Y < 0)
+ {
+ focusScale.Y = 0;
+ }
+ shadowBrush.FocusScales = focusScale;
+
+ // Draw shadow
+ this.FillPath(shadowBrush, path);
+ }
+ }
+ }
+ }
+
+ this.FillEllipse(brush, rect);
+ this.DrawEllipse(new Pen(markerBorderColor, markerBorderSize), rect);
+ break;
+ }
+ case (MarkerStyle.Square):
+ {
+ // Draw marker shadow
+ if (shadowSize != 0 && shadowColor != Color.Empty)
+ {
+ FillRectangleShadowAbs(rect, shadowColor, shadowSize, shadowColor);
+ }
+
+ this.FillRectangle(brush, rect);
+ this.DrawRectangle(new Pen(markerBorderColor, markerBorderSize), (int)Math.Round(rect.X, 0), (int)Math.Round(rect.Y, 0), (int)Math.Round(rect.Width, 0), (int)Math.Round(rect.Height, 0));
+ break;
+ }
+ case (MarkerStyle.Cross):
+ {
+ // Calculate cross line width and size
+ float crossLineWidth = (float)Math.Ceiling(markerSize / 4F);
+ float crossSize = markerSize;// * (float)Math.Sin(45f/180f*Math.PI);
+
+ // Calculate cross coordinates
+ PointF[] points = new PointF[12];
+ points[0].X = point.X - crossSize / 2F;
+ points[0].Y = point.Y + crossLineWidth / 2F;
+ points[1].X = point.X - crossSize / 2F;
+ points[1].Y = point.Y - crossLineWidth / 2F;
+
+ points[2].X = point.X - crossLineWidth / 2F;
+ points[2].Y = point.Y - crossLineWidth / 2F;
+ points[3].X = point.X - crossLineWidth / 2F;
+ points[3].Y = point.Y - crossSize / 2F;
+ points[4].X = point.X + crossLineWidth / 2F;
+ points[4].Y = point.Y - crossSize / 2F;
+
+ points[5].X = point.X + crossLineWidth / 2F;
+ points[5].Y = point.Y - crossLineWidth / 2F;
+ points[6].X = point.X + crossSize / 2F;
+ points[6].Y = point.Y - crossLineWidth / 2F;
+ points[7].X = point.X + crossSize / 2F;
+ points[7].Y = point.Y + crossLineWidth / 2F;
+
+ points[8].X = point.X + crossLineWidth / 2F;
+ points[8].Y = point.Y + crossLineWidth / 2F;
+ points[9].X = point.X + crossLineWidth / 2F;
+ points[9].Y = point.Y + crossSize / 2F;
+ points[10].X = point.X - crossLineWidth / 2F;
+ points[10].Y = point.Y + crossSize / 2F;
+ points[11].X = point.X - crossLineWidth / 2F;
+ points[11].Y = point.Y + crossLineWidth / 2F;
+
+ // Rotate cross coordinates 45 degrees
+ Matrix rotationMatrix = new Matrix();
+ rotationMatrix.RotateAt(45, point);
+ rotationMatrix.TransformPoints(points);
+
+ // Draw shadow
+ if (shadowSize != 0 && shadowColor != Color.Empty)
+ {
+ // Create translation matrix
+ Matrix translateMatrix = this.Transform.Clone();
+ translateMatrix.Translate(
+ (softShadows) ? shadowSize + 1 : shadowSize,
+ (softShadows) ? shadowSize + 1 : shadowSize);
+ Matrix oldMatrix = this.Transform;
+ this.Transform = translateMatrix;
+
+ if (!softShadows)
+ {
+ using (Brush softShadowBrush = new SolidBrush((shadowColor.A != 255) ? shadowColor : Color.FromArgb(markerColor.A / 2, shadowColor)))
+ {
+ this.FillPolygon(softShadowBrush, points);
+ }
+ }
+ else
+ {
+ // Add polygon to the graphics path
+ using (GraphicsPath path = new GraphicsPath())
+ {
+ path.AddPolygon(points);
+
+ // Create path brush
+ using (PathGradientBrush shadowBrush = new PathGradientBrush(path))
+ {
+ shadowBrush.CenterColor = shadowColor;
+
+ // Set the color along the entire boundary of the path
+ Color[] colors = { Color.Transparent };
+ shadowBrush.SurroundColors = colors;
+ shadowBrush.CenterPoint = new PointF(point.X, point.Y);
+
+ // Define brush focus scale
+ PointF focusScale = new PointF(1 - 2f * shadowSize / rect.Width, 1 - 2f * shadowSize / rect.Height);
+ if (focusScale.X < 0)
+ {
+ focusScale.X = 0;
+ }
+ if (focusScale.Y < 0)
+ {
+ focusScale.Y = 0;
+ }
+ shadowBrush.FocusScales = focusScale;
+
+ // Draw shadow
+ this.FillPath(shadowBrush, path);
+ }
+ }
+ }
+
+ this.Transform = oldMatrix;
+ }
+
+ // Create translation matrix
+ Matrix translateMatrixShape = this.Transform.Clone();
+ Matrix oldMatrixShape = this.Transform;
+ this.Transform = translateMatrixShape;
+
+ this.FillPolygon(brush, points);
+ this.DrawPolygon(new Pen(markerBorderColor, markerBorderSize), points);
+
+ this.Transform = oldMatrixShape;
+
+ break;
+ }
+ case (MarkerStyle.Diamond):
+ {
+ PointF[] points = new PointF[4];
+ points[0].X = rect.X;
+ points[0].Y = rect.Y + rect.Height / 2F;
+ points[1].X = rect.X + rect.Width / 2F;
+ points[1].Y = rect.Top;
+ points[2].X = rect.Right;
+ points[2].Y = rect.Y + rect.Height / 2F;
+ points[3].X = rect.X + rect.Width / 2F;
+ points[3].Y = rect.Bottom;
+
+ // Draw shadow
+ if (shadowSize != 0 && shadowColor != Color.Empty)
+ {
+ Matrix translateMatrix = this.Transform.Clone();
+ translateMatrix.Translate((softShadows) ? 0 : shadowSize,
+ (softShadows) ? 0 : shadowSize);
+ Matrix oldMatrix = this.Transform;
+ this.Transform = translateMatrix;
+
+ if (!softShadows)
+ {
+ using (Brush softShadowBrush = new SolidBrush((shadowColor.A != 255) ? shadowColor : Color.FromArgb(markerColor.A / 2, shadowColor)))
+ {
+ this.FillPolygon(softShadowBrush, points);
+ }
+ }
+ else
+ {
+ // Calculate diamond size
+ float diamondSize = markerSize * (float)Math.Sin(45f / 180f * Math.PI);
+
+ // Calculate diamond rectangle position
+ RectangleF diamondRect = RectangleF.Empty;
+ diamondRect.X = point.X - ((float)diamondSize) / 2F;
+ diamondRect.Y = point.Y - ((float)diamondSize) / 2F - shadowSize;
+ diamondRect.Width = diamondSize;
+ diamondRect.Height = diamondSize;
+
+ // Set rotation matrix to 45
+ translateMatrix.RotateAt(45, point);
+ this.Transform = translateMatrix;
+
+ FillRectangleShadowAbs(diamondRect, shadowColor, shadowSize, shadowColor);
+ }
+
+
+ this.Transform = oldMatrix;
+ }
+
+ this.FillPolygon(brush, points);
+ this.DrawPolygon(new Pen(markerBorderColor, markerBorderSize), points);
+ break;
+ }
+ case (MarkerStyle.Triangle):
+ {
+ PointF[] points = new PointF[3];
+ points[0].X = rect.X;
+ points[0].Y = rect.Bottom;
+ points[1].X = rect.X + rect.Width / 2F;
+ points[1].Y = rect.Top;
+ points[2].X = rect.Right;
+ points[2].Y = rect.Bottom;
+
+ // Draw image shadow
+ if (shadowSize != 0 && shadowColor != Color.Empty)
+ {
+ Matrix translateMatrix = this.Transform.Clone();
+ translateMatrix.Translate((softShadows) ? shadowSize - 1 : shadowSize,
+ (softShadows) ? shadowSize + 1 : shadowSize);
+ Matrix oldMatrix = this.Transform;
+ this.Transform = translateMatrix;
+
+ if (!softShadows)
+ {
+ using (Brush softShadowBrush = new SolidBrush((shadowColor.A != 255) ? shadowColor : Color.FromArgb(markerColor.A / 2, shadowColor)))
+ {
+ this.FillPolygon(softShadowBrush, points);
+ }
+ }
+ else
+ {
+ // Add polygon to the graphics path
+ GraphicsPath path = new GraphicsPath();
+ path.AddPolygon(points);
+
+ // Create path brush
+ PathGradientBrush shadowBrush = new PathGradientBrush(path);
+ shadowBrush.CenterColor = shadowColor;
+
+ // Set the color along the entire boundary of the path
+ Color[] colors = { Color.Transparent };
+ shadowBrush.SurroundColors = colors;
+ shadowBrush.CenterPoint = new PointF(point.X, point.Y);
+
+ // Define brush focus scale
+ PointF focusScale = new PointF(1 - 2f * shadowSize / rect.Width, 1 - 2f * shadowSize / rect.Height);
+ if (focusScale.X < 0)
+ {
+ focusScale.X = 0;
+ }
+ if (focusScale.Y < 0)
+ {
+ focusScale.Y = 0;
+ }
+ shadowBrush.FocusScales = focusScale;
+
+ // Draw shadow
+ this.FillPath(shadowBrush, path);
+ }
+
+ this.Transform = oldMatrix;
+ }
+
+ this.FillPolygon(brush, points);
+ this.DrawPolygon(new Pen(markerBorderColor, markerBorderSize), points);
+ break;
+ }
+ default:
+ {
+ throw (new InvalidOperationException(SR.ExceptionGraphicsMarkerStyleUnknown));
+ }
+ }
+ }
+
+ // Restore SmoothingMode
+ if(forceAntiAlias)
+ {
+ this.SmoothingMode = oldSmoothingMode;
+ }
+ }
+ }
+
+ #endregion
+
+ #region String Methods
+
+ /// <summary>
+ /// Measures the specified string when drawn with the specified
+ /// Font object and formatted with the specified StringFormat object.
+ /// </summary>
+ /// <param name="text">String to measure.</param>
+ /// <param name="font">Font object defines the text format of the string.</param>
+ /// <param name="layoutArea">SizeF structure that specifies the maximum layout area for the text.</param>
+ /// <param name="stringFormat">StringFormat object that represents formatting information, such as line spacing, for the string.</param>
+ /// <param name="textOrientation">Text orientation.</param>
+ /// <returns>This method returns a SizeF structure that represents the size, in pixels, of the string specified in the text parameter as drawn with the font parameter and the stringFormat parameter.</returns>
+ internal SizeF MeasureString(
+ string text,
+ Font font,
+ SizeF layoutArea,
+ StringFormat stringFormat,
+ TextOrientation textOrientation
+ )
+ {
+ // Current implementation of the stacked text will simply insert a new
+ // line character between all characters in the original string. This
+ // apporach will not allow to show multiple lines of stacked text or
+ // correctly handle text wrapping.
+ if (textOrientation == TextOrientation.Stacked)
+ {
+ text = GetStackedText(text);
+ }
+ return this.MeasureString(text, font, layoutArea, stringFormat);
+ }
+
+ /// <summary>
+ /// Measures the specified text string when drawn with
+ /// the specified Font object and formatted with the
+ /// specified StringFormat object.
+ /// </summary>
+ /// <param name="text">The string to measure</param>
+ /// <param name="font">The Font object used to determine the size of the text string. </param>
+ /// <param name="layoutArea">A SizeF structure that specifies the layout rectangle for the text. </param>
+ /// <param name="stringFormat">A StringFormat object that represents formatting information, such as line spacing, for the text string. </param>
+ /// <param name="textOrientation">Text orientation.</param>
+ /// <returns>A SizeF structure that represents the size of text as drawn with font.</returns>
+ internal SizeF MeasureStringRel(
+ string text,
+ Font font,
+ SizeF layoutArea,
+ StringFormat stringFormat,
+ TextOrientation textOrientation)
+ {
+ // Current implementation of the stacked text will simply insert a new
+ // line character between all characters in the original string. This
+ // apporach will not allow to show multiple lines of stacked text or
+ // correctly handle text wrapping.
+ if (textOrientation == TextOrientation.Stacked)
+ {
+ text = GetStackedText(text);
+ }
+ return this.MeasureStringRel(text, font, layoutArea, stringFormat);
+ }
+
+ /// <summary>
+ /// Draws the specified text string at the specified location with the specified Brush and Font objects using the formatting properties of the specified StringFormat object.
+ /// </summary>
+ /// <param name="text">String to draw.</param>
+ /// <param name="font">Font object that defines the text format of the string.</param>
+ /// <param name="brush">Brush object that determines the color and texture of the drawn text.</param>
+ /// <param name="rect">Position of the drawn text in pixels.</param>
+ /// <param name="format">StringFormat object that specifies formatting properties, such as line spacing and alignment, that are applied to the drawn text.</param>
+ /// <param name="textOrientation">Text orientation.</param>
+ internal void DrawString(
+ string text,
+ Font font,
+ Brush brush,
+ RectangleF rect,
+ StringFormat format,
+ TextOrientation textOrientation
+ )
+ {
+ // Current implementation of the stacked text will simply insert a new
+ // line character between all characters in the original string. This
+ // apporach will not allow to show multiple lines of stacked text or
+ // correctly handle text wrapping.
+ if (textOrientation == TextOrientation.Stacked)
+ {
+ text = GetStackedText(text);
+ }
+ this.DrawString(text, font, brush, rect, format);
+ }
+
+ /// <summary>
+ /// Draw a string.
+ /// </summary>
+ /// <param name="text">Text.</param>
+ /// <param name="font">Text Font.</param>
+ /// <param name="brush">Text Brush.</param>
+ /// <param name="position">Text Position.</param>
+ /// <param name="format">Format and text alignment.</param>
+ /// <param name="angle">Text angle.</param>
+ /// <param name="textOrientation">Text orientation.</param>
+ internal void DrawStringRel(
+ string text,
+ System.Drawing.Font font,
+ System.Drawing.Brush brush,
+ PointF position,
+ System.Drawing.StringFormat format,
+ int angle,
+ TextOrientation textOrientation
+ )
+ {
+ // Current implementation of the stacked text will simply insert a new
+ // line character between all characters in the original string. This
+ // apporach will not allow to show multiple lines of stacked text or
+ // correctly handle text wrapping.
+ if (textOrientation == TextOrientation.Stacked)
+ {
+ text = GetStackedText(text);
+ }
+
+ this.DrawStringRel(text, font, brush, position, format, angle);
+ }
+
+ /// <summary>
+ /// Draw a string.
+ /// </summary>
+ /// <param name="text">Text.</param>
+ /// <param name="font">Text Font.</param>
+ /// <param name="brush">Text Brush.</param>
+ /// <param name="position">Text Position.</param>
+ /// <param name="format">Format and text alignment.</param>
+ /// <param name="textOrientation">Text orientation.</param>
+ internal void DrawStringRel(
+ string text,
+ System.Drawing.Font font,
+ System.Drawing.Brush brush,
+ RectangleF position,
+ System.Drawing.StringFormat format,
+ TextOrientation textOrientation
+ )
+ {
+ // Current implementation of the stacked text will simply insert a new
+ // line character between all characters in the original string. This
+ // apporach will not allow to show multiple lines of stacked text or
+ // correctly handle text wrapping.
+ if (textOrientation == TextOrientation.Stacked)
+ {
+ text = GetStackedText(text);
+ }
+
+ this.DrawStringRel(text, font, brush, position, format);
+ }
+
+ /// <summary>
+ /// Function returned stacked text by inserting new line characters between
+ /// all characters in the original string.
+ /// </summary>
+ /// <param name="text">Original text.</param>
+ /// <returns>Stacked text.</returns>
+ internal static string GetStackedText(string text)
+ {
+ string result = string.Empty;
+ foreach (char ch in text)
+ {
+ result += ch;
+ if (ch != '\n')
+ {
+ result += '\n';
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// Draw a string and fills it's background
+ /// </summary>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="text">Text.</param>
+ /// <param name="font">Text Font.</param>
+ /// <param name="brush">Text Brush.</param>
+ /// <param name="position">Text Position.</param>
+ /// <param name="format">Format and text alignment.</param>
+ /// <param name="angle">Text angle.</param>
+ /// <param name="backPosition">Text background position.</param>
+ /// <param name="backColor">Back Color</param>
+ /// <param name="borderColor">Border Color</param>
+ /// <param name="borderWidth">Border Width</param>
+ /// <param name="borderDashStyle">Border Style</param>
+ /// <param name="series">Series</param>
+ /// <param name="point">Point</param>
+ /// <param name="pointIndex">Point index in series</param>
+ internal void DrawPointLabelStringRel(
+ CommonElements common,
+ string text,
+ System.Drawing.Font font,
+ System.Drawing.Brush brush,
+ RectangleF position,
+ System.Drawing.StringFormat format,
+ int angle,
+ RectangleF backPosition,
+ Color backColor,
+ Color borderColor,
+ int borderWidth,
+ ChartDashStyle borderDashStyle,
+ Series series,
+ DataPoint point,
+ int pointIndex)
+ {
+ // Start Svg/Flash Selection mode
+ this.StartHotRegion( point, true );
+
+ // Draw background
+ DrawPointLabelBackground(
+ common,
+ angle,
+ PointF.Empty,
+ backPosition,
+ backColor,
+ borderColor,
+ borderWidth,
+ borderDashStyle,
+ series,
+ point,
+ pointIndex);
+
+ // End Svg/Flash Selection mode
+ this.EndHotRegion( );
+
+ point._lastLabelText = text;
+ // Draw text
+ if (IsRightToLeft)
+ {
+ // datapoint label alignments should appear as not RTL.
+ using (StringFormat fmt = (StringFormat)format.Clone())
+ {
+ if (fmt.Alignment == StringAlignment.Far)
+ {
+ fmt.Alignment = StringAlignment.Near;
+ }
+ else if (fmt.Alignment == StringAlignment.Near)
+ {
+ fmt.Alignment = StringAlignment.Far;
+ }
+ DrawStringRel(text,font,brush,position,fmt,angle);
+ }
+ }
+ else
+ DrawStringRel(text, font, brush, position, format, angle);
+ }
+
+ /// <summary>
+ /// Draw a string and fills it's background
+ /// </summary>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="text">Text.</param>
+ /// <param name="font">Text Font.</param>
+ /// <param name="brush">Text Brush.</param>
+ /// <param name="position">Text Position.</param>
+ /// <param name="format">Format and text alignment.</param>
+ /// <param name="angle">Text angle.</param>
+ /// <param name="backPosition">Text background position.</param>
+ /// <param name="backColor">Back Color</param>
+ /// <param name="borderColor">Border Color</param>
+ /// <param name="borderWidth">Border Width</param>
+ /// <param name="borderDashStyle">Border Style</param>
+ /// <param name="series">Series</param>
+ /// <param name="point">Point</param>
+ /// <param name="pointIndex">Point index in series</param>
+ internal void DrawPointLabelStringRel(
+ CommonElements common,
+ string text,
+ System.Drawing.Font font,
+ System.Drawing.Brush brush,
+ PointF position,
+ System.Drawing.StringFormat format,
+ int angle,
+ RectangleF backPosition,
+ Color backColor,
+ Color borderColor,
+ int borderWidth,
+ ChartDashStyle borderDashStyle,
+ Series series,
+ DataPoint point,
+ int pointIndex)
+ {
+ // Start Svg/Flash Selection mode
+ this.StartHotRegion( point, true );
+
+ // Draw background
+ DrawPointLabelBackground(
+ common,
+ angle,
+ position,
+ backPosition,
+ backColor,
+ borderColor,
+ borderWidth,
+ borderDashStyle,
+ series,
+ point,
+ pointIndex);
+
+ // End Svg/Flash Selection mode
+ this.EndHotRegion( );
+
+ point._lastLabelText = text;
+ // Draw text
+ if (IsRightToLeft)
+ {
+ // datapoint label alignments should appear as not RTL
+ using (StringFormat fmt = (StringFormat)format.Clone())
+ {
+ if (fmt.Alignment == StringAlignment.Far)
+ {
+ fmt.Alignment = StringAlignment.Near;
+ }
+ else if (fmt.Alignment == StringAlignment.Near)
+ {
+ fmt.Alignment = StringAlignment.Far;
+ }
+ DrawStringRel(text,font,brush,position,fmt,angle);
+ }
+ }
+ else
+ DrawStringRel(text,font,brush,position,format,angle);
+ }
+
+ /// <summary>
+ /// Draw a string and fills it's background
+ /// </summary>
+ /// <param name="common">The Common elements object.</param>
+ /// <param name="angle">Text angle.</param>
+ /// <param name="textPosition">Text position.</param>
+ /// <param name="backPosition">Text background position.</param>
+ /// <param name="backColor">Back Color</param>
+ /// <param name="borderColor">Border Color</param>
+ /// <param name="borderWidth">Border Width</param>
+ /// <param name="borderDashStyle">Border Style</param>
+ /// <param name="series">Series</param>
+ /// <param name="point">Point</param>
+ /// <param name="pointIndex">Point index in series</param>
+ private void DrawPointLabelBackground(
+ CommonElements common,
+ int angle,
+ PointF textPosition,
+ RectangleF backPosition,
+ Color backColor,
+ Color borderColor,
+ int borderWidth,
+ ChartDashStyle borderDashStyle,
+ Series series,
+ DataPoint point,
+ int pointIndex)
+ {
+ // Draw background
+ if(!backPosition.IsEmpty)
+ {
+ RectangleF backPositionAbs = this.Round(this.GetAbsoluteRectangle(backPosition));
+
+ // Get rotation point
+ PointF rotationPoint = PointF.Empty;
+ if(textPosition.IsEmpty)
+ {
+ rotationPoint = new PointF(backPositionAbs.X + backPositionAbs.Width/2f, backPositionAbs.Y + backPositionAbs.Height/2f);
+ }
+ else
+ {
+ rotationPoint = this.GetAbsolutePoint(textPosition);
+ }
+
+ // Create a matrix and rotate it.
+ _myMatrix = this.Transform.Clone();
+ _myMatrix.RotateAt( angle, rotationPoint );
+
+ // Save old state
+ GraphicsState graphicsState = this.Save();
+
+ // Set transformatino
+ this.Transform = _myMatrix;
+
+ // Check for empty colors
+ if( !backColor.IsEmpty ||
+ !borderColor.IsEmpty)
+ {
+ // Fill box around the label
+ using(Brush brush = new SolidBrush(backColor))
+ {
+ this.FillRectangle(brush, backPositionAbs);
+ }
+
+ // deliant: Fix VSTS #156433 (2) Data Label Border in core always shows when the style is set to NotSet
+ // Draw box border
+ if( borderWidth > 0 &&
+ !borderColor.IsEmpty && borderDashStyle != ChartDashStyle.NotSet)
+ {
+ AntiAliasingStyles saveAntiAliasing = this.AntiAliasing;
+ try
+ {
+ this.AntiAliasing = AntiAliasingStyles.None;
+ using(Pen pen = new Pen(borderColor, borderWidth))
+ {
+ pen.DashStyle = GetPenStyle( borderDashStyle );
+ this.DrawRectangle(
+ pen,
+ backPositionAbs.X,
+ backPositionAbs.Y,
+ backPositionAbs.Width,
+ backPositionAbs.Height);
+ }
+ }
+ finally
+ {
+ this.AntiAliasing = saveAntiAliasing;
+ }
+ }
+ }
+ else
+ {
+ // Draw invisible rectangle to handle tooltips
+ using(Brush brush = new SolidBrush(Color.Transparent))
+ {
+ this.FillRectangle(brush, backPositionAbs);
+ }
+ }
+
+
+ // Restore old state
+ this.Restore(graphicsState);
+
+ // Add point label hot region
+ if( common != null &&
+ common.ProcessModeRegions)
+ {
+#if !Microsoft_CONTROL
+ // Remember all point attributes
+ string oldToolTip = point.IsCustomPropertySet( CommonCustomProperties.ToolTip) ? point.ToolTip : null;
+ string oldUrl = point.IsCustomPropertySet( CommonCustomProperties.Url) ? point.Url : null;
+ string oldMapAreaAttributes = point.IsCustomPropertySet( CommonCustomProperties.MapAreaAttributes) ? point.MapAreaAttributes : null;
+ string oldPostback = point.IsCustomPropertySet( CommonCustomProperties.PostBackValue) ? point.PostBackValue : null;
+ object oldTag = point.Tag;
+ // Set label attributes into the point attribute.
+ // Workaround for the AddHotRegion method limitation.
+ point.ToolTip = point.LabelToolTip;
+ point.Url = point.LabelUrl;
+ point.MapAreaAttributes = point.LabelMapAreaAttributes;
+ point.PostBackValue = point.PostBackValue;
+#endif // !Microsoft_CONTROL
+
+ // Insert area
+ if(angle == 0)
+ {
+ common.HotRegionsList.AddHotRegion(
+ backPosition,
+ point,
+ series.Name,
+ pointIndex );
+ }
+ else
+ {
+ // Convert rectangle to the graphics path and apply rotation transformation
+ using (GraphicsPath path = new GraphicsPath())
+ {
+ path.AddRectangle(backPositionAbs);
+ path.Transform(_myMatrix);
+
+ // Add hot region
+ common.HotRegionsList.AddHotRegion(
+ path,
+ false,
+ this,
+ point,
+ series.Name,
+ pointIndex);
+ }
+ }
+
+#if !Microsoft_CONTROL
+ // Restore all point attributes
+ if (oldToolTip != null) point.ToolTip = oldToolTip; else point.ResetToolTip();
+ if (oldUrl != null) point.Url = oldUrl; else point.ResetUrl();
+ if (oldMapAreaAttributes != null) point.MapAreaAttributes = oldMapAreaAttributes; else point.ResetMapAreaAttributes();
+ if (oldPostback != null) point.PostBackValue = oldPostback; else point.ResetPostBackValue();
+ point.Tag = oldTag;
+#endif // !Microsoft_CONTROL
+
+ // Set new hot region element type
+ if (common.HotRegionsList.List != null && common.HotRegionsList.List.Count > 0)
+ {
+ ((HotRegion)common.HotRegionsList.List[common.HotRegionsList.List.Count - 1]).Type =
+ ChartElementType.DataPointLabel;
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Draw a string.
+ /// </summary>
+ /// <param name="text">Text.</param>
+ /// <param name="font">Text Font.</param>
+ /// <param name="brush">Text Brush.</param>
+ /// <param name="position">Text Position.</param>
+ /// <param name="format">Format and text alignment.</param>
+ /// <param name="angle">Text angle.</param>
+ internal void DrawStringRel(
+ string text,
+ System.Drawing.Font font,
+ System.Drawing.Brush brush,
+ PointF position,
+ System.Drawing.StringFormat format,
+ int angle
+ )
+ {
+ DrawStringAbs(
+ text,
+ font,
+ brush,
+ GetAbsolutePoint(position),
+ format,
+ angle);
+ }
+
+ /// <summary>
+ /// Draw a string.
+ /// </summary>
+ /// <param name="text">Text.</param>
+ /// <param name="font">Text Font.</param>
+ /// <param name="brush">Text Brush.</param>
+ /// <param name="absPosition">Text Position.</param>
+ /// <param name="format">Format and text alignment.</param>
+ /// <param name="angle">Text angle.</param>
+ internal void DrawStringAbs(
+ string text,
+ System.Drawing.Font font,
+ System.Drawing.Brush brush,
+ PointF absPosition,
+ System.Drawing.StringFormat format,
+ int angle
+ )
+ {
+ // Create a matrix and rotate it.
+ _myMatrix = this.Transform.Clone();
+ _myMatrix.RotateAt(angle, absPosition);
+
+ // Save aold state
+ GraphicsState graphicsState = this.Save();
+
+ // Set Angle
+ this.Transform = _myMatrix;
+
+ // Draw text with anti-aliasing
+ /*
+ if( (AntiAliasing & AntiAliasing.Text) == AntiAliasing.Text )
+ this.TextRenderingHint = TextRenderingHint.AntiAlias;
+ else
+ this.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit;
+ */
+
+ // Draw a string
+ this.DrawString( text, font, brush, absPosition , format );
+
+ // Restore old state
+ this.Restore(graphicsState);
+ }
+
+ /// <summary>
+ /// This method is used by the axis title hot region generation code.
+ /// It transforms the centered rectangle the same way as the Axis title text.
+ /// </summary>
+ /// <param name="center">Title center</param>
+ /// <param name="size">Title text size</param>
+ /// <param name="angle">Title rotation angle</param>
+ /// <returns></returns>
+ internal GraphicsPath GetTranformedTextRectPath(PointF center, SizeF size, int angle)
+ {
+ // Text hot area is 10px greater than the size of text
+ size.Width += 10;
+ size.Height += 10;
+
+ // Get the absolute center and create the centered rectangle points
+ PointF absCenter = GetAbsolutePoint(center);
+ PointF[] points = new PointF[] {
+ new PointF(absCenter.X - size.Width / 2f, absCenter.Y - size.Height / 2f),
+ new PointF(absCenter.X + size.Width / 2f, absCenter.Y - size.Height / 2f),
+ new PointF(absCenter.X + size.Width / 2f, absCenter.Y + size.Height / 2f),
+ new PointF(absCenter.X - size.Width / 2f, absCenter.Y + size.Height / 2f)};
+
+ //Prepare the same tranformation matrix as used for the axis title
+ Matrix matrix = this.Transform.Clone();
+ matrix.RotateAt(angle, absCenter);
+ //Tranform the rectangle points
+ matrix.TransformPoints(points);
+
+ //Return the path consisting of the rect points
+ GraphicsPath path = new GraphicsPath();
+ path.AddLines(points);
+ path.CloseAllFigures();
+ return path;
+ }
+
+
+
+
+ /// <summary>
+ /// Draw label string.
+ /// </summary>
+ /// <param name="axis">Label axis.</param>
+ /// <param name="labelRowIndex">Label text row index (0-10).</param>
+ /// <param name="labelMark">Second row labels mark style.</param>
+ /// <param name="markColor">Label mark line color.</param>
+ /// <param name="text">Label text.</param>
+ /// <param name="image">Label image name.</param>
+ /// <param name="imageTransparentColor">Label image transparent color.</param>
+ /// <param name="font">Text bont.</param>
+ /// <param name="brush">Text brush.</param>
+ /// <param name="position">Text position rectangle.</param>
+ /// <param name="format">Label text format.</param>
+ /// <param name="angle">Label text angle.</param>
+ /// <param name="boundaryRect">Specifies the rectangle where the label text MUST be fitted.</param>
+ /// <param name="label">Custom Label Item</param>
+ /// <param name="truncatedLeft">Label is truncated on the left.</param>
+ /// <param name="truncatedRight">Label is truncated on the right.</param>
+ internal void DrawLabelStringRel(
+ Axis axis,
+ int labelRowIndex,
+ LabelMarkStyle labelMark,
+ Color markColor,
+ string text,
+ string image,
+ Color imageTransparentColor,
+ System.Drawing.Font font,
+ System.Drawing.Brush brush,
+ RectangleF position,
+ System.Drawing.StringFormat format,
+ int angle,
+ RectangleF boundaryRect,
+ CustomLabel label,
+ bool truncatedLeft,
+ bool truncatedRight)
+ {
+ Matrix oldTransform;
+ using (StringFormat drawingFormat = (StringFormat)format.Clone())
+ {
+ SizeF labelSize = SizeF.Empty;
+
+ // Check that rectangle is not empty
+ if (position.Width == 0 || position.Height == 0)
+ {
+ return;
+ }
+
+ // Find absolute position
+ RectangleF absPosition = this.GetAbsoluteRectangle(position);
+
+ // Make sure the rectangle is not empty
+ if (absPosition.Width < 1f)
+ {
+ absPosition.Width = 1f;
+ }
+ if (absPosition.Height < 1f)
+ {
+ absPosition.Height = 1f;
+ }
+
+#if DEBUG
+ // TESTING CODE: Shows labels rectangle position.
+ // Rectangle rr = Rectangle.Round(absPosition);
+ // rr.Width = (int)Math.Round(absPosition.Right) - rr.X;
+ // rr.Height = (int)Math.Round(absPosition.Bottom) - rr.Y;
+ // this.DrawRectangle(Pens.Red,rr.X, rr.Y, rr.Width, rr.Height);
+#endif // DEBUG
+
+ CommonElements common = axis.Common;
+ if (common.ProcessModeRegions)
+ {
+ common.HotRegionsList.AddHotRegion(Rectangle.Round(absPosition), label, ChartElementType.AxisLabels, false, true);
+ }
+
+ //********************************************************************
+ //** Draw labels in the second row
+ //********************************************************************
+ if (labelRowIndex > 0)
+ {
+ drawingFormat.LineAlignment = StringAlignment.Center;
+ drawingFormat.Alignment = StringAlignment.Center;
+ angle = 0;
+
+ if (axis.AxisPosition == AxisPosition.Left)
+ {
+ angle = -90;
+ }
+ else if (axis.AxisPosition == AxisPosition.Right)
+ {
+ angle = 90;
+ }
+ else if (axis.AxisPosition == AxisPosition.Top)
+ {
+ }
+ else if (axis.AxisPosition == AxisPosition.Bottom)
+ {
+ }
+ }
+
+ //********************************************************************
+ //** Calculate rotation point
+ //********************************************************************
+ PointF rotationPoint = PointF.Empty;
+ if (axis.AxisPosition == AxisPosition.Left)
+ {
+ rotationPoint.X = absPosition.Right;
+ rotationPoint.Y = absPosition.Y + absPosition.Height / 2F;
+ }
+ else if (axis.AxisPosition == AxisPosition.Right)
+ {
+ rotationPoint.X = absPosition.Left;
+ rotationPoint.Y = absPosition.Y + absPosition.Height / 2F;
+ }
+ else if (axis.AxisPosition == AxisPosition.Top)
+ {
+ rotationPoint.X = absPosition.X + absPosition.Width / 2F;
+ rotationPoint.Y = absPosition.Bottom;
+ }
+ else if (axis.AxisPosition == AxisPosition.Bottom)
+ {
+ rotationPoint.X = absPosition.X + absPosition.Width / 2F;
+ rotationPoint.Y = absPosition.Top;
+ }
+
+ //********************************************************************
+ //** Adjust rectangle for horisontal axis
+ //********************************************************************
+ if ((axis.AxisPosition == AxisPosition.Top || axis.AxisPosition == AxisPosition.Bottom) &&
+ angle != 0)
+ {
+ // Get rectangle center
+ rotationPoint.X = absPosition.X + absPosition.Width / 2F;
+ rotationPoint.Y = (axis.AxisPosition == AxisPosition.Top) ? absPosition.Bottom : absPosition.Y;
+
+ // Rotate rectangle 90 degrees
+ RectangleF newRect = RectangleF.Empty;
+ newRect.X = absPosition.X + absPosition.Width / 2F;
+ newRect.Y = absPosition.Y - absPosition.Width / 2F;
+ newRect.Height = absPosition.Width;
+ newRect.Width = absPosition.Height;
+
+ // Adjust values for bottom axis
+ if (axis.AxisPosition == AxisPosition.Bottom)
+ {
+ if (angle < 0)
+ {
+ newRect.X -= newRect.Width;
+ }
+
+ // Replace string alignment
+ drawingFormat.Alignment = StringAlignment.Near;
+ if (angle < 0)
+ {
+ drawingFormat.Alignment = StringAlignment.Far;
+ }
+ drawingFormat.LineAlignment = StringAlignment.Center;
+ }
+
+ // Adjust values for bottom axis
+ if (axis.AxisPosition == AxisPosition.Top)
+ {
+ newRect.Y += absPosition.Height;
+ if (angle > 0)
+ {
+ newRect.X -= newRect.Width;
+ }
+
+ // Replace string alignment
+ drawingFormat.Alignment = StringAlignment.Far;
+ if (angle < 0)
+ {
+ drawingFormat.Alignment = StringAlignment.Near;
+ }
+ drawingFormat.LineAlignment = StringAlignment.Center;
+ }
+
+ // Set new label rect
+ absPosition = newRect;
+ }
+
+ //********************************************************************
+ //** 90 degrees is a special case for vertical axes
+ //********************************************************************
+ if ((axis.AxisPosition == AxisPosition.Left || axis.AxisPosition == AxisPosition.Right) &&
+ (angle == 90 || angle == -90))
+ {
+ // Get rectangle center
+ rotationPoint.X = absPosition.X + absPosition.Width / 2F;
+ rotationPoint.Y = absPosition.Y + absPosition.Height / 2F;
+
+ // Rotate rectangle 90 degrees
+ RectangleF newRect = RectangleF.Empty;
+ newRect.X = rotationPoint.X - absPosition.Height / 2F;
+ newRect.Y = rotationPoint.Y - absPosition.Width / 2F;
+ newRect.Height = absPosition.Width;
+ newRect.Width = absPosition.Height;
+ absPosition = newRect;
+
+ // Replace string alignment
+ StringAlignment align = drawingFormat.Alignment;
+ drawingFormat.Alignment = drawingFormat.LineAlignment;
+ drawingFormat.LineAlignment = align;
+ if (angle == 90)
+ {
+ if (drawingFormat.LineAlignment == StringAlignment.Far)
+ drawingFormat.LineAlignment = StringAlignment.Near;
+ else if (drawingFormat.LineAlignment == StringAlignment.Near)
+ drawingFormat.LineAlignment = StringAlignment.Far;
+ }
+ if (angle == -90)
+ {
+ if (drawingFormat.Alignment == StringAlignment.Far)
+ drawingFormat.Alignment = StringAlignment.Near;
+ else if (drawingFormat.Alignment == StringAlignment.Near)
+ drawingFormat.Alignment = StringAlignment.Far;
+ }
+ }
+
+ //********************************************************************
+ //** Create a matrix and rotate it.
+ //********************************************************************
+ oldTransform = null;
+ if (angle != 0)
+ {
+ _myMatrix = this.Transform.Clone();
+ _myMatrix.RotateAt(angle, rotationPoint);
+
+ // Old angle
+ oldTransform = this.Transform;
+
+ // Set Angle
+ this.Transform = _myMatrix;
+ }
+
+ //********************************************************************
+ //** Measure string exact rectangle and adjust label bounding rectangle
+ //********************************************************************
+ RectangleF labelRect = Rectangle.Empty;
+ float offsetY = 0f;
+ float offsetX = 0f;
+
+ // Measure text size
+ labelSize = this.MeasureString(text.Replace("\\n", "\n"), font, absPosition.Size, drawingFormat);
+
+ // Calculate text rectangle
+ labelRect.Width = labelSize.Width;
+ labelRect.Height = labelSize.Height;
+ if (drawingFormat.Alignment == StringAlignment.Far)
+ {
+ labelRect.X = absPosition.Right - labelSize.Width;
+ }
+ else if (drawingFormat.Alignment == StringAlignment.Near)
+ {
+ labelRect.X = absPosition.X;
+ }
+ else if (drawingFormat.Alignment == StringAlignment.Center)
+ {
+ labelRect.X = absPosition.X + absPosition.Width / 2F - labelSize.Width / 2F;
+ }
+
+ if (drawingFormat.LineAlignment == StringAlignment.Far)
+ {
+ labelRect.Y = absPosition.Bottom - labelSize.Height;
+ }
+ else if (drawingFormat.LineAlignment == StringAlignment.Near)
+ {
+ labelRect.Y = absPosition.Y;
+ }
+ else if (drawingFormat.LineAlignment == StringAlignment.Center)
+ {
+ labelRect.Y = absPosition.Y + absPosition.Height / 2F - labelSize.Height / 2F;
+ }
+
+ //If the angle is not vertical or horizontal
+ if (angle != 0 && angle != 90 && angle != -90)
+ {
+ // Adjust label rectangle so it will not overlap the plotting area
+ offsetY = (float)Math.Sin((90 - angle) / 180F * Math.PI) * labelRect.Height / 2F;
+ offsetX = (float)Math.Sin((Math.Abs(angle)) / 180F * Math.PI) * labelRect.Height / 2F;
+
+ if (axis.AxisPosition == AxisPosition.Left)
+ {
+ _myMatrix.Translate(-offsetX, 0);
+ }
+ else if (axis.AxisPosition == AxisPosition.Right)
+ {
+ _myMatrix.Translate(offsetX, 0);
+ }
+ else if (axis.AxisPosition == AxisPosition.Top)
+ {
+ _myMatrix.Translate(0, -offsetY);
+ }
+ else if (axis.AxisPosition == AxisPosition.Bottom)
+ {
+ _myMatrix.Translate(0, offsetY);
+ }
+
+ // Adjust label rectangle so it will be inside boundary
+ if (boundaryRect != RectangleF.Empty)
+ {
+ Region region = new Region(labelRect);
+ region.Transform(_myMatrix);
+
+ // Extend boundary rectangle to the chart picture border
+ if (axis.AxisPosition == AxisPosition.Left)
+ {
+ boundaryRect.Width += boundaryRect.X;
+ boundaryRect.X = 0;
+ }
+ else if (axis.AxisPosition == AxisPosition.Right)
+ {
+ boundaryRect.Width = this._common.Width - boundaryRect.X;
+ }
+ else if (axis.AxisPosition == AxisPosition.Top)
+ {
+ boundaryRect.Height += boundaryRect.Y;
+ boundaryRect.Y = 0;
+ }
+ else if (axis.AxisPosition == AxisPosition.Bottom)
+ {
+ boundaryRect.Height = this._common.Height - boundaryRect.Y;
+ }
+
+ // Exclude boundary rectangle from the label rectangle
+ region.Exclude(this.GetAbsoluteRectangle(boundaryRect));
+
+ // If any part of the label was outside bounding rectangle
+ if (!region.IsEmpty(Graphics))
+ {
+ this.Transform = oldTransform;
+ RectangleF truncateRect = region.GetBounds(Graphics);
+
+ float sizeChange = truncateRect.Width / (float)Math.Cos(Math.Abs(angle) / 180F * Math.PI);
+ if (axis.AxisPosition == AxisPosition.Left)
+ {
+ sizeChange -= labelRect.Height * (float)Math.Tan(Math.Abs(angle) / 180F * Math.PI);
+ absPosition.Y = labelRect.Y;
+ absPosition.X = labelRect.X + sizeChange;
+ absPosition.Width = labelRect.Width - sizeChange;
+ absPosition.Height = labelRect.Height;
+ }
+ else if (axis.AxisPosition == AxisPosition.Right)
+ {
+ sizeChange -= labelRect.Height * (float)Math.Tan(Math.Abs(angle) / 180F * Math.PI);
+ absPosition.Y = labelRect.Y;
+ absPosition.X = labelRect.X;
+ absPosition.Width = labelRect.Width - sizeChange;
+ absPosition.Height = labelRect.Height;
+ }
+ else if (axis.AxisPosition == AxisPosition.Top)
+ {
+ absPosition.Y = labelRect.Y;
+ absPosition.X = labelRect.X;
+ absPosition.Width = labelRect.Width - sizeChange;
+ absPosition.Height = labelRect.Height;
+ if (angle > 0)
+ {
+ absPosition.X += sizeChange;
+ }
+ }
+ else if (axis.AxisPosition == AxisPosition.Bottom)
+ {
+ absPosition.Y = labelRect.Y;
+ absPosition.X = labelRect.X;
+ absPosition.Width = labelRect.Width - sizeChange;
+ absPosition.Height = labelRect.Height;
+ if (angle < 0)
+ {
+ absPosition.X += sizeChange;
+ }
+ }
+ }
+ }
+
+ // Update transformation matrix
+ this.Transform = _myMatrix;
+ }
+
+ //********************************************************************
+ //** Reserve space on the left for the label iamge
+ //********************************************************************
+ RectangleF absPositionWithoutImage = new RectangleF(absPosition.Location, absPosition.Size);
+
+ System.Drawing.Image labelImage = null;
+ SizeF imageAbsSize = new SizeF();
+
+ if (image.Length > 0)
+ {
+ labelImage = axis.Common.ImageLoader.LoadImage(label.Image);
+
+ if (labelImage != null)
+ {
+ ImageLoader.GetAdjustedImageSize(labelImage, this.Graphics, ref imageAbsSize);
+
+ // Adjust label position using image size
+ absPositionWithoutImage.Width -= imageAbsSize.Width;
+ absPositionWithoutImage.X += imageAbsSize.Width;
+ }
+
+ if (absPositionWithoutImage.Width < 1f)
+ {
+ absPositionWithoutImage.Width = 1f;
+ }
+
+ }
+
+ //********************************************************************
+ //** Draw tick marks for labels in second row
+ //********************************************************************
+ if (labelRowIndex > 0 && labelMark != LabelMarkStyle.None)
+ {
+ // Make sure that me know the exact size of the text
+ labelSize = this.MeasureString(
+ text.Replace("\\n", "\n"),
+ font,
+ absPositionWithoutImage.Size,
+ drawingFormat);
+
+ // Adjust for label image
+ SizeF labelSizeWithImage = new SizeF(labelSize.Width, labelSize.Height);
+ if (labelImage != null)
+ {
+ labelSizeWithImage.Width += imageAbsSize.Width;
+ }
+
+ // Draw mark
+ DrawSecondRowLabelMark(
+ axis,
+ markColor,
+ absPosition,
+ labelSizeWithImage,
+ labelMark,
+ truncatedLeft,
+ truncatedRight,
+ oldTransform);
+ }
+
+ //********************************************************************
+ //** Make sure that one line label will not disapear with LineLimit
+ //** flag on.
+ //********************************************************************
+ if ((drawingFormat.FormatFlags & StringFormatFlags.LineLimit) != 0)
+ {
+ // Measure string height out of one character
+ drawingFormat.FormatFlags ^= StringFormatFlags.LineLimit;
+ SizeF size = this.MeasureString("I", font, absPosition.Size, drawingFormat);
+
+ // If height of one characte is more than rectangle heigjt - remove LineLimit flag
+ if (size.Height < absPosition.Height)
+ {
+ drawingFormat.FormatFlags |= StringFormatFlags.LineLimit;
+ }
+ }
+ else
+ {
+ // Set NoClip flag
+ if ((drawingFormat.FormatFlags & StringFormatFlags.NoClip) != 0)
+ {
+ drawingFormat.FormatFlags ^= StringFormatFlags.NoClip;
+ }
+
+ // Measure string height out of one character without clipping
+ SizeF size = this.MeasureString("I", font, absPosition.Size, drawingFormat);
+
+ // Clear NoClip flag
+ drawingFormat.FormatFlags ^= StringFormatFlags.NoClip;
+
+ // If height of one characte is more than rectangle heigt - set NoClip flag
+ if (size.Height > absPosition.Height)
+ {
+ float delta = size.Height - absPosition.Height;
+ absPosition.Y -= delta / 2f;
+ absPosition.Height += delta;
+ }
+ }
+
+ //********************************************************************
+ //** Draw a string
+ //********************************************************************
+ if (IsRightToLeft)
+ {
+ // label alignment on the axis should appear as not RTL.
+ using (StringFormat fmt = (StringFormat)drawingFormat.Clone())
+ {
+
+ if (fmt.Alignment == StringAlignment.Far)
+ {
+ fmt.Alignment = StringAlignment.Near;
+ }
+ else if (fmt.Alignment == StringAlignment.Near)
+ {
+ fmt.Alignment = StringAlignment.Far;
+ }
+ this.DrawString(text.Replace("\\n", "\n"), font, brush,
+ absPositionWithoutImage,
+ fmt);
+
+ }
+ }
+ else
+ this.DrawString(text.Replace("\\n", "\n"), font, brush,
+ absPositionWithoutImage,
+ drawingFormat);
+
+ // Add separate hot region for the label
+ if (common.ProcessModeRegions)
+ {
+ using (GraphicsPath path = new GraphicsPath())
+ {
+ path.AddRectangle(labelRect);
+ path.Transform(this.Transform);
+ string url = string.Empty;
+ string mapAreaAttributes = string.Empty;
+ string postbackValue = string.Empty;
+#if !Microsoft_CONTROL
+ url = label.Url;
+ mapAreaAttributes = label.MapAreaAttributes;
+ postbackValue = label.PostBackValue;
+#endif // !Microsoft_CONTROL
+ common.HotRegionsList.AddHotRegion(
+ this,
+ path,
+ false,
+ label.ToolTip,
+ url,
+ mapAreaAttributes,
+ postbackValue,
+ label,
+ ChartElementType.AxisLabels);
+ }
+ }
+
+ //********************************************************************
+ //** Draw an image
+ //********************************************************************
+ if (labelImage != null)
+ {
+ // Make sure we no the text size
+ if (labelSize.IsEmpty)
+ {
+ labelSize = this.MeasureString(
+ text.Replace("\\n", "\n"),
+ font,
+ absPositionWithoutImage.Size,
+ drawingFormat);
+ }
+
+ // Calculate image rectangle
+ RectangleF imageRect = new RectangleF(
+ absPosition.X + (absPosition.Width - imageAbsSize.Width - labelSize.Width) / 2,
+ absPosition.Y + (absPosition.Height - imageAbsSize.Height) / 2,
+ imageAbsSize.Width,
+ imageAbsSize.Height);
+
+ if (drawingFormat.LineAlignment == StringAlignment.Center)
+ {
+ imageRect.Y = absPosition.Y + (absPosition.Height - imageAbsSize.Height) / 2;
+ }
+ else if (drawingFormat.LineAlignment == StringAlignment.Far)
+ {
+ imageRect.Y = absPosition.Bottom - (labelSize.Height + imageAbsSize.Height) / 2;
+ }
+ else if (drawingFormat.LineAlignment == StringAlignment.Near)
+ {
+ imageRect.Y = absPosition.Top + (labelSize.Height - imageAbsSize.Height) / 2;
+ }
+
+ if (drawingFormat.Alignment == StringAlignment.Center)
+ {
+ imageRect.X = absPosition.X + (absPosition.Width - imageAbsSize.Width - labelSize.Width) / 2;
+ }
+ else if (drawingFormat.Alignment == StringAlignment.Far)
+ {
+ imageRect.X = absPosition.Right - imageAbsSize.Width - labelSize.Width;
+ }
+ else if (drawingFormat.Alignment == StringAlignment.Near)
+ {
+ imageRect.X = absPosition.X;
+ }
+
+ // Create image attribute
+ ImageAttributes attrib = new ImageAttributes();
+ if (imageTransparentColor != Color.Empty)
+ {
+ attrib.SetColorKey(imageTransparentColor, imageTransparentColor, ColorAdjustType.Default);
+ }
+
+ // Draw image
+ this.DrawImage(
+ labelImage,
+ Rectangle.Round(imageRect),
+ 0, 0, labelImage.Width, labelImage.Height,
+ GraphicsUnit.Pixel,
+ attrib);
+
+ // Add separate hot region for the label image
+ if (common.ProcessModeRegions)
+ {
+ using (GraphicsPath path = new GraphicsPath())
+ {
+ path.AddRectangle(imageRect);
+ path.Transform(this.Transform);
+ string imageUrl = string.Empty;
+ string imageMapAreaAttributes = string.Empty;
+ string postbackValue = string.Empty;
+#if !Microsoft_CONTROL
+ imageUrl = label.ImageUrl;
+ imageMapAreaAttributes = label.ImageMapAreaAttributes;
+ postbackValue = label.PostBackValue;
+#endif // !Microsoft_CONTROL
+ common.HotRegionsList.AddHotRegion(
+ this,
+ path,
+ false,
+ string.Empty,
+ imageUrl,
+ imageMapAreaAttributes,
+ postbackValue,
+ label,
+ ChartElementType.AxisLabelImage);
+ }
+ }
+ }
+ }
+
+ // Set Old Angle
+ if(oldTransform != null)
+ {
+ this.Transform = oldTransform;
+ }
+ }
+
+ /// <summary>
+ /// Draw box marks for the labels in second row
+ /// </summary>
+ /// <param name="axis">Axis object.</param>
+ /// <param name="markColor">Label mark color.</param>
+ /// <param name="absPosition">Absolute position of the text.</param>
+ /// <param name="truncatedLeft">Label is truncated on the left.</param>
+ /// <param name="truncatedRight">Label is truncated on the right.</param>
+ /// <param name="originalTransform">Original transformation matrix.</param>
+ private void DrawSecondRowLabelBoxMark(
+ Axis axis,
+ Color markColor,
+ RectangleF absPosition,
+ bool truncatedLeft,
+ bool truncatedRight,
+ Matrix originalTransform)
+ {
+ // Remeber current and then reset original matrix
+ Matrix curentMatrix = this.Transform;
+ if(originalTransform != null)
+ {
+ this.Transform = originalTransform;
+ }
+
+ // Calculate center of the text rectangle
+ PointF centerNotRound = new PointF(absPosition.X + absPosition.Width/2F, absPosition.Y + absPosition.Height/2F);
+
+ // Rotate rectangle 90 degrees
+ if( axis.AxisPosition == AxisPosition.Left || axis.AxisPosition == AxisPosition.Right)
+ {
+ RectangleF newRect = RectangleF.Empty;
+ newRect.X = centerNotRound.X - absPosition.Height / 2F;
+ newRect.Y = centerNotRound.Y - absPosition.Width / 2F;
+ newRect.Height = absPosition.Width;
+ newRect.Width = absPosition.Height;
+ absPosition = newRect;
+ }
+
+ // Get axis position
+ float axisPosRelative = (float)axis.GetAxisPosition(true);
+ PointF axisPositionAbs = new PointF(axisPosRelative, axisPosRelative);
+ axisPositionAbs = this.GetAbsolutePoint(axisPositionAbs);
+
+ // Round position to achieve crisp lines with antialiasing
+ Rectangle absPositionRounded = Rectangle.Round(absPosition);
+
+ // Make sure the right and bottom position is not shifted during rounding
+ absPositionRounded.Width = (int)Math.Round(absPosition.Right) - absPositionRounded.X;
+ absPositionRounded.Height = (int)Math.Round(absPosition.Bottom) - absPositionRounded.Y;
+
+ // Create pen
+ Pen markPen = new Pen(
+ (markColor.IsEmpty) ? axis.MajorTickMark.LineColor : markColor,
+ axis.MajorTickMark.LineWidth);
+
+ // Set pen style
+ markPen.DashStyle = GetPenStyle( axis.MajorTickMark.LineDashStyle );
+
+ // Draw top/bottom lines
+ if( axis.AxisPosition == AxisPosition.Left || axis.AxisPosition == AxisPosition.Right)
+ {
+ this.DrawLine(markPen, absPositionRounded.Left, absPositionRounded.Top, absPositionRounded.Left, absPositionRounded.Bottom);
+ this.DrawLine(markPen, absPositionRounded.Right, absPositionRounded.Top, absPositionRounded.Right, absPositionRounded.Bottom);
+ }
+ else
+ {
+ this.DrawLine(markPen, absPositionRounded.Left, absPositionRounded.Top, absPositionRounded.Right, absPositionRounded.Top);
+ this.DrawLine(markPen, absPositionRounded.Left, absPositionRounded.Bottom, absPositionRounded.Right, absPositionRounded.Bottom);
+ }
+
+ // Draw left line
+ if(!truncatedLeft)
+ {
+ if( axis.AxisPosition == AxisPosition.Left || axis.AxisPosition == AxisPosition.Right)
+ {
+ this.DrawLine(
+ markPen,
+ (axis.AxisPosition == AxisPosition.Left) ? absPositionRounded.Left : absPositionRounded.Right,
+ absPositionRounded.Bottom,
+ axisPositionAbs.X,
+ absPositionRounded.Bottom);
+ }
+ else
+ {
+ this.DrawLine(
+ markPen,
+ absPositionRounded.Left,
+ (axis.AxisPosition == AxisPosition.Top) ? absPositionRounded.Top : absPositionRounded.Bottom,
+ absPositionRounded.Left,
+ axisPositionAbs.Y);
+ }
+ }
+
+ // Draw right line
+ if(!truncatedRight)
+ {
+ if( axis.AxisPosition == AxisPosition.Left || axis.AxisPosition == AxisPosition.Right)
+ {
+ this.DrawLine(
+ markPen,
+ (axis.AxisPosition == AxisPosition.Left) ? absPositionRounded.Left : absPositionRounded.Right,
+ absPositionRounded.Top,
+ axisPositionAbs.X,
+ absPositionRounded.Top);
+ }
+ else
+ {
+ this.DrawLine(
+ markPen,
+ absPositionRounded.Right,
+ (axis.AxisPosition == AxisPosition.Top) ? absPositionRounded.Top : absPositionRounded.Bottom,
+ absPositionRounded.Right,
+ axisPositionAbs.Y);
+ }
+ }
+
+ // Dispose Pen
+ if( markPen != null )
+ {
+ markPen.Dispose();
+ }
+
+ // Restore currentmatrix
+ if(originalTransform != null)
+ {
+ this.Transform = curentMatrix;
+ }
+ }
+
+
+ /// <summary>
+ /// Draw marks for the labels in second row
+ /// </summary>
+ /// <param name="axis">Axis object.</param>
+ /// <param name="markColor">Label mark color.</param>
+ /// <param name="absPosition">Absolute position of the text.</param>
+ /// <param name="labelSize">Exact mesured size of the text.</param>
+ /// <param name="labelMark">Label mark style to draw.</param>
+ /// <param name="truncatedLeft">Label is truncated on the left.</param>
+ /// <param name="truncatedRight">Label is truncated on the right.</param>
+ /// <param name="oldTransform">Original transformation matrix.</param>
+ private void DrawSecondRowLabelMark(
+ Axis axis,
+ Color markColor,
+ RectangleF absPosition,
+ SizeF labelSize,
+ LabelMarkStyle labelMark,
+ bool truncatedLeft,
+ bool truncatedRight,
+ Matrix oldTransform)
+ {
+ // Do not draw marking line if width is 0 and style or color are not set
+ if( axis.MajorTickMark.LineWidth == 0 ||
+ axis.MajorTickMark.LineDashStyle == ChartDashStyle.NotSet ||
+ axis.MajorTickMark.LineColor == Color.Empty)
+ {
+ return;
+ }
+
+ // Remember SmoothingMode and turn off anti aliasing for
+ // vertical or horizontal lines of the label markers.
+ SmoothingMode oldSmoothingMode = this.SmoothingMode;
+ this.SmoothingMode = SmoothingMode.None;
+
+
+ // Draw box marker
+ if(labelMark == LabelMarkStyle.Box)
+ {
+ DrawSecondRowLabelBoxMark(
+ axis,
+ markColor,
+ absPosition,
+ truncatedLeft,
+ truncatedRight,
+ oldTransform);
+ }
+ else
+
+ {
+ // Calculate center of the text rectangle
+ Point center = Point.Round(new PointF(absPosition.X + absPosition.Width/2F, absPosition.Y + absPosition.Height/2F));
+
+ // Round position to achieve crisp lines with antialiasing
+ Rectangle absPositionRounded = Rectangle.Round(absPosition);
+
+ // Make sure the right and bottom position is not shifted during rounding
+ absPositionRounded.Width = (int)Math.Round(absPosition.Right) - absPositionRounded.X;
+ absPositionRounded.Height = (int)Math.Round(absPosition.Bottom) - absPositionRounded.Y;
+
+
+ // Arrays of points for the left and right marking lines
+ PointF[] leftLine = new PointF[3];
+ PointF[] rightLine = new PointF[3];
+
+ // Calculate marking lines coordinates
+ leftLine[0].X = absPositionRounded.Left;
+ leftLine[0].Y = absPositionRounded.Bottom;
+ leftLine[1].X = absPositionRounded.Left;
+ leftLine[1].Y = center.Y;
+ leftLine[2].X = (float)Math.Round((double)center.X - labelSize.Width/2F - 1F);
+ leftLine[2].Y = center.Y;
+
+ rightLine[0].X = absPositionRounded.Right;
+ rightLine[0].Y = absPositionRounded.Bottom;
+ rightLine[1].X = absPositionRounded.Right;
+ rightLine[1].Y = center.Y;
+ rightLine[2].X = (float)Math.Round((double)center.X + labelSize.Width/2F - 1F);
+ rightLine[2].Y = center.Y;
+
+ if(axis.AxisPosition == AxisPosition.Bottom)
+ {
+ leftLine[0].Y = absPositionRounded.Top;
+ rightLine[0].Y = absPositionRounded.Top;
+ }
+
+ // Remove third point to draw only side marks
+ if(labelMark == LabelMarkStyle.SideMark)
+ {
+ leftLine[2] = leftLine[1];
+ rightLine[2] = rightLine[1];
+ }
+
+ if(truncatedLeft)
+ {
+ leftLine[0] = leftLine[1];
+ }
+ if(truncatedRight)
+ {
+ rightLine[0] = rightLine[1];
+ }
+
+ // Create pen
+ Pen markPen = new Pen(
+ (markColor.IsEmpty) ? axis.MajorTickMark.LineColor : markColor,
+ axis.MajorTickMark.LineWidth);
+
+ // Set pen style
+ markPen.DashStyle = GetPenStyle( axis.MajorTickMark.LineDashStyle );
+
+ // Draw marking lines
+ this.DrawLines(markPen, leftLine);
+ this.DrawLines(markPen, rightLine);
+
+ // Dispose Pen
+ if( markPen != null )
+ {
+ markPen.Dispose();
+ }
+ }
+
+ // Restore previous SmoothingMode
+ this.SmoothingMode = oldSmoothingMode;
+ }
+
+ /// <summary>
+ /// Measures the specified text string when drawn with
+ /// the specified Font object and formatted with the
+ /// specified StringFormat object.
+ /// </summary>
+ /// <param name="text">The string to measure</param>
+ /// <param name="font">The Font object used to determine the size of the text string. </param>
+ /// <returns>A SizeF structure that represents the size of text as drawn with font.</returns>
+ internal SizeF MeasureStringRel( string text, Font font )
+ {
+ SizeF newSize;
+
+ // Measure string
+ newSize = this.MeasureString( text, font );
+
+ // Convert to relative Coordinates
+ return GetRelativeSize( newSize );
+ }
+
+ /// <summary>
+ /// Measures the specified text string when drawn with
+ /// the specified Font object and formatted with the
+ /// specified StringFormat object.
+ /// </summary>
+ /// <param name="text">The string to measure</param>
+ /// <param name="font">The Font object used to determine the size of the text string. </param>
+ /// <param name="layoutArea">A SizeF structure that specifies the layout rectangle for the text. </param>
+ /// <param name="stringFormat">A StringFormat object that represents formatting information, such as line spacing, for the text string. </param>
+ /// <returns>A SizeF structure that represents the size of text as drawn with font.</returns>
+ internal SizeF MeasureStringRel( string text, Font font, SizeF layoutArea, StringFormat stringFormat )
+ {
+ SizeF size, newSize;
+
+ // Get absolute coordinates
+ size = GetAbsoluteSize( layoutArea );
+
+ newSize = this.MeasureString( text, font, size, stringFormat );
+
+ // Convert to relative Coordinates
+ return GetRelativeSize( newSize );
+ }
+
+ /// <summary>
+ /// Measures the specified text string when drawn with
+ /// the specified Font object and formatted with the
+ /// specified StringFormat object.
+ /// </summary>
+ /// <param name="text">The string to measure</param>
+ /// <param name="font">The Font object used to determine the size of the text string. </param>
+ /// <returns>A SizeF structure that represents the size of text as drawn with font.</returns>
+ internal Size MeasureStringAbs( string text, Font font )
+ {
+ // Measure string
+ SizeF size = this.MeasureString( text, font );
+ return new Size( (int)Math.Ceiling(size.Width), (int)Math.Ceiling(size.Height));
+ }
+
+ /// <summary>
+ /// Measures the specified text string when drawn with
+ /// the specified Font object and formatted with the
+ /// specified StringFormat object.
+ /// </summary>
+ /// <param name="text">The string to measure</param>
+ /// <param name="font">The Font object used to determine the size of the text string. </param>
+ /// <param name="layoutArea">A SizeF structure that specifies the layout rectangle for the text. </param>
+ /// <param name="stringFormat">A StringFormat object that represents formatting information, such as line spacing, for the text string. </param>
+ /// <returns>A SizeF structure that represents the size of text as drawn with font.</returns>
+ internal Size MeasureStringAbs( string text, Font font, SizeF layoutArea, StringFormat stringFormat )
+ {
+ SizeF size = this.MeasureString( text, font, layoutArea, stringFormat );
+ return new Size( (int)Math.Ceiling(size.Width), (int)Math.Ceiling(size.Height));
+ }
+
+ /// <summary>
+ /// Draws the specified text string at the specified location
+ /// with the specified Brush object and font. The formatting
+ /// properties in the specified StringFormat object are applied
+ /// to the text.
+ /// </summary>
+ /// <param name="text">A string object that specifies the text to draw.</param>
+ /// <param name="font">A Font object that specifies the font face and size with which to draw the text.</param>
+ /// <param name="brush">A Brush object that determines the color and/or texture of the drawn text.</param>
+ /// <param name="layoutRectangle">A RectangleF structure that specifies the location of the drawn text.</param>
+ /// <param name="format">A StringFormat object that specifies formatting properties, such as line spacing and alignment, that are applied to the drawn text.</param>
+ internal void DrawStringRel( string text, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format )
+ {
+ RectangleF rect;
+
+ // Check that rectangle is not empty
+ if(layoutRectangle.Width == 0 || layoutRectangle.Height == 0)
+ {
+ return;
+ }
+
+ // Get absolute coordinates
+ rect = GetAbsoluteRectangle( layoutRectangle );
+
+ // Draw text with anti-aliasing
+ /*
+ if( (this.AntiAliasing & AntiAliasing.Text) == AntiAliasing.Text )
+ {
+ this.TextRenderingHint = TextRenderingHint.AntiAlias;
+ }
+ else
+ {
+ this.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit;
+ }
+ */
+
+ this.DrawString( text, font, brush, rect, format );
+ }
+
+
+ /// <summary>
+ /// Draws the specified text string at the specified location
+ /// with the specified angle and with the specified Brush object and font. The
+ /// formatting properties in the specified StringFormat object are applied
+ /// to the text.
+ /// </summary>
+ /// <param name="text">A string object that specifies the text to draw.</param>
+ /// <param name="font">A Font object that specifies the font face and size with which to draw the text.</param>
+ /// <param name="brush">A Brush object that determines the color and/or texture of the drawn text.</param>
+ /// <param name="layoutRectangle">A RectangleF structure that specifies the location of the drawn text.</param>
+ /// <param name="format">A StringFormat object that specifies formatting properties, such as line spacing and alignment, that are applied to the drawn text.</param>
+ /// <param name="angle">A angle of the text</param>
+ internal void DrawStringRel(
+ string text,
+ Font font,
+ Brush brush,
+ RectangleF layoutRectangle,
+ StringFormat format,
+ int angle
+ )
+ {
+ RectangleF rect;
+ SizeF size;
+ Matrix oldTransform;
+ PointF rotationCenter = PointF.Empty;
+
+ // Check that rectangle is not empty
+ if(layoutRectangle.Width == 0 || layoutRectangle.Height == 0)
+ {
+ return;
+ }
+
+ // Get absolute coordinates
+ rect = GetAbsoluteRectangle( layoutRectangle );
+
+ size = this.MeasureString( text, font, rect.Size, format );
+
+
+ // Find the center of rotation
+ if( format.Alignment == StringAlignment.Near )
+ { // Near
+ rotationCenter.X = rect.X + size.Width / 2;
+ rotationCenter.Y = ( rect.Bottom + rect.Top ) / 2;
+ }
+ else if( format.Alignment == StringAlignment.Far )
+ { // Far
+ rotationCenter.X = rect.Right - size.Width / 2;
+ rotationCenter.Y = ( rect.Bottom + rect.Top ) / 2;
+ }
+ else
+ { // Center
+ rotationCenter.X = ( rect.Left + rect.Right ) / 2;
+ rotationCenter.Y = ( rect.Bottom + rect.Top ) / 2;
+ }
+ // Create a matrix and rotate it.
+ _myMatrix = this.Transform.Clone();
+ _myMatrix.RotateAt( angle, rotationCenter);
+
+ // Old angle
+ oldTransform = this.Transform;
+
+ // Set Angle
+ this.Transform = _myMatrix;
+
+ // Draw text with anti-aliasing
+ /*
+ if( (AntiAliasing & AntiAliasing.Text) == AntiAliasing.Text )
+ {
+ this.TextRenderingHint = TextRenderingHint.AntiAlias;
+ }
+ else
+ {
+ this.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit;
+ }
+ */
+
+ this.DrawString( text, font, brush, rect, format );
+
+ // Set Old Angle
+ this.Transform = oldTransform;
+ }
+
+ #endregion
+
+ #region Rectangle Methods
+
+ /// <summary>
+ /// Draws different shadows to create bar styles.
+ /// </summary>
+ /// <param name="barDrawingStyle">Bar drawing style.</param>
+ /// <param name="isVertical">True if a vertical bar.</param>
+ /// <param name="rect">Rectangle position.</param>
+ internal void DrawRectangleBarStyle(BarDrawingStyle barDrawingStyle, bool isVertical, RectangleF rect)
+ {
+ // Check if non-default bar drawing style is specified
+ if(barDrawingStyle != BarDrawingStyle.Default)
+ {
+ // Check column/bar size
+ if(rect.Width > 0 && rect.Height > 0)
+ {
+ // Draw gradient(s)
+ if(barDrawingStyle == BarDrawingStyle.Cylinder)
+ {
+ // Calculate gradient position
+ RectangleF gradientRect = rect;
+ if(isVertical)
+ {
+ gradientRect.Width *= 0.3f;
+ }
+ else
+ {
+ gradientRect.Height *= 0.3f;
+ }
+ if(gradientRect.Width > 0 && gradientRect.Height > 0)
+ {
+ this.FillRectangleAbs(
+ gradientRect,
+ Color.Transparent,
+ ChartHatchStyle.None,
+ string.Empty,
+ ChartImageWrapMode.Scaled,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ (isVertical) ? GradientStyle.LeftRight : GradientStyle.TopBottom,
+ Color.FromArgb(120, Color.White),
+ Color.Empty,
+ 0,
+ ChartDashStyle.NotSet,
+ PenAlignment.Inset );
+
+
+ if(isVertical)
+ {
+ gradientRect.X += gradientRect.Width + 1f;
+ gradientRect.Width = rect.Right - gradientRect.X;
+ }
+ else
+ {
+ gradientRect.Y += gradientRect.Height + 1f;
+ gradientRect.Height = rect.Bottom - gradientRect.Y;
+ }
+
+ this.FillRectangleAbs(
+ gradientRect,
+ Color.FromArgb(120, Color.White),
+ ChartHatchStyle.None,
+ string.Empty,
+ ChartImageWrapMode.Scaled,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ (isVertical) ? GradientStyle.LeftRight : GradientStyle.TopBottom,
+ Color.FromArgb(150, Color.Black),
+ Color.Empty,
+ 0,
+ ChartDashStyle.NotSet,
+ PenAlignment.Inset );
+
+ }
+ }
+ else if(barDrawingStyle == BarDrawingStyle.Emboss)
+ {
+ // Calculate width of shadows used to create the effect
+ float shadowSize = 3f;
+ if(rect.Width < 6f || rect.Height < 6f)
+ {
+ shadowSize = 1f;
+ }
+ else if(rect.Width < 15f || rect.Height < 15f)
+ {
+ shadowSize = 2f;
+ }
+
+ // Create and draw left/top path
+ using(GraphicsPath path = new GraphicsPath())
+ {
+ // Add shadow polygon to the path
+ PointF[] points = new PointF[] {
+ new PointF(rect.Left, rect.Bottom),
+ new PointF(rect.Left, rect.Top),
+ new PointF(rect.Right, rect.Top),
+ new PointF(rect.Right - shadowSize, rect.Top + shadowSize),
+ new PointF(rect.Left + shadowSize, rect.Top + shadowSize),
+ new PointF(rect.Left + shadowSize, rect.Bottom - shadowSize) };
+ path.AddPolygon(points);
+
+ // Create brush
+ using(SolidBrush leftTopBrush = new SolidBrush(Color.FromArgb(100, Color.White)))
+ {
+ // Fill shadow path on the left-bottom side of the bar
+ this.FillPath(leftTopBrush, path);
+ }
+ }
+
+ // Create and draw top/right path
+ using(GraphicsPath path = new GraphicsPath())
+ {
+ // Add shadow polygon to the path
+ PointF[] points = new PointF[] {
+ new PointF(rect.Right, rect.Top),
+ new PointF(rect.Right, rect.Bottom),
+ new PointF(rect.Left, rect.Bottom),
+ new PointF(rect.Left + shadowSize, rect.Bottom - shadowSize),
+ new PointF(rect.Right - shadowSize, rect.Bottom - shadowSize),
+ new PointF(rect.Right - shadowSize, rect.Top + shadowSize) };
+ path.AddPolygon(points);
+
+ // Create brush
+ using(SolidBrush bottomRightBrush = new SolidBrush(Color.FromArgb(80, Color.Black)))
+ {
+ // Fill shadow path on the left-bottom side of the bar
+ this.FillPath(bottomRightBrush, path);
+ }
+ }
+ }
+ else if(barDrawingStyle == BarDrawingStyle.LightToDark)
+ {
+ // Calculate width of shadows used to create the effect
+ float shadowSize = 4f;
+ if(rect.Width < 6f || rect.Height < 6f)
+ {
+ shadowSize = 2f;
+ }
+ else if(rect.Width < 15f || rect.Height < 15f)
+ {
+ shadowSize = 3f;
+ }
+
+ // Calculate gradient position
+ RectangleF gradientRect = rect;
+ gradientRect.Inflate(-shadowSize, -shadowSize);
+ if(isVertical)
+ {
+ gradientRect.Height = (float)Math.Floor(gradientRect.Height / 3f);
+ }
+ else
+ {
+ gradientRect.X = gradientRect.Right - (float)Math.Floor(gradientRect.Width / 3f);
+ gradientRect.Width = (float)Math.Floor(gradientRect.Width / 3f);
+ }
+ if(gradientRect.Width > 0 && gradientRect.Height > 0)
+ {
+ this.FillRectangleAbs(
+ gradientRect,
+ (isVertical) ? Color.FromArgb(120, Color.White) : Color.Transparent,
+ ChartHatchStyle.None,
+ string.Empty,
+ ChartImageWrapMode.Scaled,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ (isVertical) ? GradientStyle.TopBottom : GradientStyle.LeftRight,
+ (isVertical) ? Color.Transparent : Color.FromArgb(120, Color.White),
+ Color.Empty,
+ 0,
+ ChartDashStyle.NotSet,
+ PenAlignment.Inset );
+
+ gradientRect = rect;
+ gradientRect.Inflate(-shadowSize, -shadowSize);
+ if(isVertical)
+ {
+ gradientRect.Y = gradientRect.Bottom - (float)Math.Floor(gradientRect.Height / 3f);
+ gradientRect.Height = (float)Math.Floor(gradientRect.Height / 3f);
+ }
+ else
+ {
+ gradientRect.Width = (float)Math.Floor(gradientRect.Width / 3f);
+ }
+
+
+ this.FillRectangleAbs(
+ gradientRect,
+ (!isVertical) ? Color.FromArgb(80, Color.Black) : Color.Transparent,
+ ChartHatchStyle.None,
+ string.Empty,
+ ChartImageWrapMode.Scaled,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ (isVertical) ? GradientStyle.TopBottom : GradientStyle.LeftRight,
+ (!isVertical) ? Color.Transparent : Color.FromArgb(80, Color.Black),
+ Color.Empty,
+ 0,
+ ChartDashStyle.NotSet,
+ PenAlignment.Inset );
+
+ }
+ }
+ else if(barDrawingStyle == BarDrawingStyle.Wedge)
+ {
+ // Calculate wedge size to fit the rectangle
+ float size = (isVertical) ? rect.Width / 2f : rect.Height / 2f;
+ if(isVertical && 2f * size > rect.Height)
+ {
+ size = rect.Height/2f;
+ }
+ if(!isVertical && 2f * size > rect.Width)
+ {
+ size = rect.Width/2f;
+ }
+
+ // Draw left/bottom shadow
+ RectangleF gradientRect = rect;
+ using(GraphicsPath path = new GraphicsPath())
+ {
+ if(isVertical)
+ {
+ path.AddLine(gradientRect.X + gradientRect.Width/2f, gradientRect.Y + size, gradientRect.X + gradientRect.Width/2f, gradientRect.Bottom - size);
+ path.AddLine(gradientRect.X + gradientRect.Width/2f, gradientRect.Bottom - size, gradientRect.Right, gradientRect.Bottom);
+ path.AddLine(gradientRect.Right, gradientRect.Bottom, gradientRect.Right, gradientRect.Y);
+ }
+ else
+ {
+ path.AddLine(gradientRect.X + size, gradientRect.Y + gradientRect.Height/2f, gradientRect.Right - size, gradientRect.Y + gradientRect.Height/2f);
+ path.AddLine(gradientRect.Right - size, gradientRect.Y + gradientRect.Height/2f, gradientRect.Right, gradientRect.Bottom);
+ path.AddLine(gradientRect.Right, gradientRect.Bottom, gradientRect.Left, gradientRect.Bottom);
+ }
+ path.CloseAllFigures();
+
+ // Create brush and fill path
+ using(SolidBrush brush = new SolidBrush(Color.FromArgb(90, Color.Black)))
+ {
+ this.FillPath(brush, path);
+ }
+ }
+
+ // Draw top/right triangle
+ using(GraphicsPath path = new GraphicsPath())
+ {
+ if(isVertical)
+ {
+ path.AddLine(gradientRect.X, gradientRect.Y, gradientRect.X + gradientRect.Width/2f, gradientRect.Y + size);
+ path.AddLine(gradientRect.X + gradientRect.Width/2f, gradientRect.Y + size, gradientRect.Right, gradientRect.Y);
+ }
+ else
+ {
+ path.AddLine(gradientRect.Right, gradientRect.Y, gradientRect.Right - size, gradientRect.Y + gradientRect.Height / 2f);
+ path.AddLine(gradientRect.Right - size, gradientRect.Y + gradientRect.Height / 2f, gradientRect.Right, gradientRect.Bottom);
+ }
+
+ // Create brush and fill path
+ using(SolidBrush brush = new SolidBrush(Color.FromArgb(50, Color.Black)))
+ {
+ // Fill shadow path on the left-bottom side of the bar
+ this.FillPath(brush, path);
+
+ // Draw Lines
+ using(Pen penDark = new Pen(Color.FromArgb(20, Color.Black), 1))
+ {
+ this.DrawPath(penDark, path);
+ if(isVertical)
+ {
+ this.DrawLine(
+ penDark,
+ rect.X + rect.Width/2f,
+ rect.Y + size,
+ rect.X + rect.Width/2f,
+ rect.Bottom - size);
+ }
+ else
+ {
+ this.DrawLine(
+ penDark,
+ rect.X + size,
+ rect.Y + rect.Height/2f,
+ rect.X + size,
+ rect.Bottom - rect.Height/2f);
+ }
+ }
+
+ // Draw Lines
+ using(Pen pen = new Pen(Color.FromArgb(40, Color.White), 1))
+ {
+ this.DrawPath(pen, path);
+ if(isVertical)
+ {
+ this.DrawLine(
+ pen,
+ rect.X + rect.Width/2f,
+ rect.Y + size,
+ rect.X + rect.Width/2f,
+ rect.Bottom - size);
+ }
+ else
+ {
+ this.DrawLine(
+ pen,
+ rect.X + size,
+ rect.Y + rect.Height/2f,
+ rect.X + size,
+ rect.Bottom - rect.Height/2f);
+ }
+ }
+ }
+ }
+
+ // Draw bottom/left triangle
+ using(GraphicsPath path = new GraphicsPath())
+ {
+ if(isVertical)
+ {
+ path.AddLine(gradientRect.X, gradientRect.Bottom, gradientRect.X + gradientRect.Width/2f, gradientRect.Bottom - size);
+ path.AddLine(gradientRect.X + gradientRect.Width/2f, gradientRect.Bottom - size, gradientRect.Right, gradientRect.Bottom);
+ }
+ else
+ {
+ path.AddLine(gradientRect.X, gradientRect.Y, gradientRect.X + size, gradientRect.Y + gradientRect.Height / 2f);
+ path.AddLine(gradientRect.X + size, gradientRect.Y + gradientRect.Height / 2f, gradientRect.X, gradientRect.Bottom);
+ }
+
+ // Create brush
+ using(SolidBrush brush = new SolidBrush(Color.FromArgb(50, Color.Black)))
+ {
+ // Fill shadow path on the left-bottom side of the bar
+ this.FillPath(brush, path);
+
+ // Draw edges
+ using(Pen penDark = new Pen(Color.FromArgb(20, Color.Black), 1))
+ {
+ this.DrawPath(penDark, path);
+ }
+ using(Pen pen = new Pen(Color.FromArgb(40, Color.White), 1))
+ {
+ this.DrawPath(pen, path);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Draw a bar with shadow.
+ /// </summary>
+ /// <param name="rectF">Size of rectangle</param>
+ /// <param name="backColor">Color of rectangle</param>
+ /// <param name="backHatchStyle">Hatch style</param>
+ /// <param name="backImage">Back Image</param>
+ /// <param name="backImageWrapMode">Image mode</param>
+ /// <param name="backImageTransparentColor">Image transparent color.</param>
+ /// <param name="backImageAlign">Image alignment</param>
+ /// <param name="backGradientStyle">Gradient type </param>
+ /// <param name="backSecondaryColor">Gradient End Color</param>
+ /// <param name="borderColor">Border Color</param>
+ /// <param name="borderWidth">Border Width</param>
+ /// <param name="borderDashStyle">Border Style</param>
+ /// <param name="shadowColor">Shadow Color</param>
+ /// <param name="shadowOffset">Shadow Offset</param>
+ /// <param name="penAlignment">Pen Alignment</param>
+ /// <param name="barDrawingStyle">Bar drawing style.</param>
+ /// <param name="isVertical">True if a vertical bar.</param>
+ internal void FillRectangleRel( RectangleF rectF,
+ Color backColor,
+ ChartHatchStyle backHatchStyle,
+ string backImage,
+ ChartImageWrapMode backImageWrapMode,
+ Color backImageTransparentColor,
+ ChartImageAlignmentStyle backImageAlign,
+ GradientStyle backGradientStyle,
+ Color backSecondaryColor,
+ Color borderColor,
+ int borderWidth,
+ ChartDashStyle borderDashStyle,
+ Color shadowColor,
+ int shadowOffset,
+ PenAlignment penAlignment,
+ BarDrawingStyle barDrawingStyle,
+ bool isVertical)
+ {
+ this.FillRectangleRel(
+ rectF,
+ backColor,
+ backHatchStyle,
+ backImage,
+ backImageWrapMode,
+ backImageTransparentColor,
+ backImageAlign,
+ backGradientStyle,
+ backSecondaryColor,
+ borderColor,
+ borderWidth,
+ borderDashStyle,
+ shadowColor,
+ shadowOffset,
+ penAlignment,
+ false,
+ 0,
+ false,
+ barDrawingStyle,
+ isVertical);
+ }
+
+ /// <summary>
+ /// Draw a bar with shadow.
+ /// </summary>
+ /// <param name="rectF">Size of rectangle</param>
+ /// <param name="backColor">Color of rectangle</param>
+ /// <param name="backHatchStyle">Hatch style</param>
+ /// <param name="backImage">Back Image</param>
+ /// <param name="backImageWrapMode">Image mode</param>
+ /// <param name="backImageTransparentColor">Image transparent color.</param>
+ /// <param name="backImageAlign">Image alignment</param>
+ /// <param name="backGradientStyle">Gradient type </param>
+ /// <param name="backSecondaryColor">Gradient End Color</param>
+ /// <param name="borderColor">Border Color</param>
+ /// <param name="borderWidth">Border Width</param>
+ /// <param name="borderDashStyle">Border Style</param>
+ /// <param name="shadowColor">Shadow Color</param>
+ /// <param name="shadowOffset">Shadow Offset</param>
+ /// <param name="penAlignment">Pen Alignment</param>
+ internal void FillRectangleRel( RectangleF rectF,
+ Color backColor,
+ ChartHatchStyle backHatchStyle,
+ string backImage,
+ ChartImageWrapMode backImageWrapMode,
+ Color backImageTransparentColor,
+ ChartImageAlignmentStyle backImageAlign,
+ GradientStyle backGradientStyle,
+ Color backSecondaryColor,
+ Color borderColor,
+ int borderWidth,
+ ChartDashStyle borderDashStyle,
+ Color shadowColor,
+ int shadowOffset,
+ PenAlignment penAlignment )
+ {
+ this.FillRectangleRel(
+ rectF,
+ backColor,
+ backHatchStyle,
+ backImage,
+ backImageWrapMode,
+ backImageTransparentColor,
+ backImageAlign,
+ backGradientStyle,
+ backSecondaryColor,
+ borderColor,
+ borderWidth,
+ borderDashStyle,
+ shadowColor,
+ shadowOffset,
+ penAlignment,
+ false,
+ 0,
+ false,
+ BarDrawingStyle.Default,
+ true);
+ }
+
+ /// <summary>
+ /// Draws rectangle or circle (inside rectangle) with shadow.
+ /// </summary>
+ /// <param name="rectF">Size of rectangle</param>
+ /// <param name="backColor">Color of rectangle</param>
+ /// <param name="backHatchStyle">Hatch style</param>
+ /// <param name="backImage">Back Image</param>
+ /// <param name="backImageWrapMode">Image mode</param>
+ /// <param name="backImageTransparentColor">Image transparent color.</param>
+ /// <param name="backImageAlign">Image alignment</param>
+ /// <param name="backGradientStyle">Gradient type </param>
+ /// <param name="backSecondaryColor">Gradient End Color</param>
+ /// <param name="borderColor">Border Color</param>
+ /// <param name="borderWidth">Border Width</param>
+ /// <param name="borderDashStyle">Border Style</param>
+ /// <param name="shadowColor">Shadow Color</param>
+ /// <param name="shadowOffset">Shadow Offset</param>
+ /// <param name="penAlignment">Pen Alignment</param>
+ /// <param name="circular">Draw circular shape inside the rectangle.</param>
+ /// <param name="circularSectorsCount">Number of sectors in circle when drawing the polygon.</param>
+ /// <param name="circle3D">3D Circle must be drawn.</param>
+ internal void FillRectangleRel( RectangleF rectF,
+ Color backColor,
+ ChartHatchStyle backHatchStyle,
+ string backImage,
+ ChartImageWrapMode backImageWrapMode,
+ Color backImageTransparentColor,
+ ChartImageAlignmentStyle backImageAlign,
+ GradientStyle backGradientStyle,
+ Color backSecondaryColor,
+ Color borderColor,
+ int borderWidth,
+ ChartDashStyle borderDashStyle,
+ Color shadowColor,
+ int shadowOffset,
+ PenAlignment penAlignment,
+ bool circular,
+ int circularSectorsCount,
+ bool circle3D)
+ {
+ this.FillRectangleRel(
+ rectF,
+ backColor,
+ backHatchStyle,
+ backImage,
+ backImageWrapMode,
+ backImageTransparentColor,
+ backImageAlign,
+ backGradientStyle,
+ backSecondaryColor,
+ borderColor,
+ borderWidth,
+ borderDashStyle,
+ shadowColor,
+ shadowOffset,
+ penAlignment,
+ circular,
+ circularSectorsCount,
+ circle3D,
+ BarDrawingStyle.Default,
+ true);
+ }
+
+
+ /// <summary>
+ /// Draws rectangle or circle (inside rectangle) with shadow.
+ /// </summary>
+ /// <param name="rectF">Size of rectangle</param>
+ /// <param name="backColor">Color of rectangle</param>
+ /// <param name="backHatchStyle">Hatch style</param>
+ /// <param name="backImage">Back Image</param>
+ /// <param name="backImageWrapMode">Image mode</param>
+ /// <param name="backImageTransparentColor">Image transparent color.</param>
+ /// <param name="backImageAlign">Image alignment</param>
+ /// <param name="backGradientStyle">Gradient type </param>
+ /// <param name="backSecondaryColor">Gradient End Color</param>
+ /// <param name="borderColor">Border Color</param>
+ /// <param name="borderWidth">Border Width</param>
+ /// <param name="borderDashStyle">Border Style</param>
+ /// <param name="shadowColor">Shadow Color</param>
+ /// <param name="shadowOffset">Shadow Offset</param>
+ /// <param name="penAlignment">Pen Alignment</param>
+ /// <param name="circular">Draw circular shape inside the rectangle.</param>
+ /// <param name="circularSectorsCount">Number of sectors in circle when drawing the polygon.</param>
+ /// <param name="circle3D">3D Circle must be drawn.</param>
+ /// <param name="barDrawingStyle">Bar drawing style.</param>
+ /// <param name="isVertical">True if a vertical bar.</param>
+ internal void FillRectangleRel( RectangleF rectF,
+ Color backColor,
+ ChartHatchStyle backHatchStyle,
+ string backImage,
+ ChartImageWrapMode backImageWrapMode,
+ Color backImageTransparentColor,
+ ChartImageAlignmentStyle backImageAlign,
+ GradientStyle backGradientStyle,
+ Color backSecondaryColor,
+ Color borderColor,
+ int borderWidth,
+ ChartDashStyle borderDashStyle,
+ Color shadowColor,
+ int shadowOffset,
+ PenAlignment penAlignment,
+ bool circular,
+ int circularSectorsCount,
+ bool circle3D,
+ BarDrawingStyle barDrawingStyle,
+ bool isVertical)
+ {
+ Brush brush = null;
+ Brush backBrush = null;
+
+ // Remember SmoothingMode and turn off anti aliasing
+ SmoothingMode oldSmoothingMode = this.SmoothingMode;
+ if(!circular)
+ {
+ this.SmoothingMode = SmoothingMode.Default;
+ }
+
+ // Color is empty
+ if( backColor.IsEmpty )
+ {
+ backColor = Color.White;
+ }
+
+ if( backSecondaryColor.IsEmpty )
+ {
+ backSecondaryColor = Color.White;
+ }
+
+ if( borderColor.IsEmpty || borderDashStyle == ChartDashStyle.NotSet)
+ {
+ borderWidth = 0;
+ }
+
+ // Get absolute coordinates
+ RectangleF rect = GetAbsoluteRectangle( rectF );
+
+ // Rectangle width and height can not be very small value
+ if( rect.Width < 1.0F && rect.Width > 0.0F )
+ {
+ rect.Width = 1.0F;
+ }
+
+ if( rect.Height < 1.0F && rect.Height > 0.0F )
+ {
+ rect.Height = 1.0F;
+ }
+
+ // Round the values
+ rect = Round( rect );
+
+ // For inset alignment resize fill rectangle
+ RectangleF fillRect;
+ if( penAlignment == PenAlignment.Inset &&
+ borderWidth > 0)
+ {
+ // SVG and Metafiles do not support inset pen styles - use same rectangle
+ if( this.ActiveRenderingType == RenderingType.Svg ||
+ this.IsMetafile)
+ {
+ fillRect = new RectangleF( rect.X, rect.Y, rect.Width, rect.Height);
+ }
+ else if (this.Graphics.Transform.Elements[0] != 1f ||
+ this.Graphics.Transform.Elements[3] != 1f)
+ {
+ // Do not reduce filling rectangle if scaling is used in the graphics
+ // transformations. Rounding may cause a 1 pixel gap between the border
+ // and the filling.
+ fillRect = new RectangleF( rect.X, rect.Y, rect.Width, rect.Height);
+ }
+ else
+ {
+ // The fill rectangle is resized because of border size.
+ fillRect = new RectangleF(
+ rect.X + borderWidth,
+ rect.Y + borderWidth,
+ rect.Width - borderWidth * 2f + 1,
+ rect.Height - borderWidth * 2f + 1);
+ }
+ }
+ else
+ {
+ // The fill rectangle is same
+ fillRect = rect;
+ }
+
+ // Fix for issue #6714:
+ // Make sure the rectangle coordinates fit the control. In same cases rectangle width or
+ // hight ca be extremly large. Drawing such a rectangle may cause an overflow exception.
+ // The code below restricts the maximum size to double the chart size. See issue
+ // description for more information. -AG.
+ if(fillRect.Width > 2f * this._width)
+ {
+ fillRect.Width = 2f * this._width;
+ }
+ if(fillRect.Height > 2f * this._height)
+ {
+ fillRect.Height = 2f * this._height;
+ }
+
+
+ if( backImage.Length > 0 && backImageWrapMode != ChartImageWrapMode.Unscaled && backImageWrapMode != ChartImageWrapMode.Scaled)
+ {
+ backBrush = brush;
+ brush = GetTextureBrush(backImage, backImageTransparentColor, backImageWrapMode, backColor);
+ }
+ else if( backHatchStyle != ChartHatchStyle.None )
+ {
+ brush = GetHatchBrush( backHatchStyle, backColor, backSecondaryColor );
+ }
+ else if( backGradientStyle != GradientStyle.None )
+ {
+ // If a gradient type is set create a brush with gradient
+ brush = GetGradientBrush( rect, backColor, backSecondaryColor, backGradientStyle );
+ }
+ else
+ {
+ // Set a bar color.
+ if(backColor == Color.Empty || backColor == Color.Transparent)
+ {
+ brush = null;
+ }
+ else
+ {
+ brush = new SolidBrush(backColor);
+ }
+ }
+
+ // Draw shadow
+ FillRectangleShadowAbs( rect, shadowColor, shadowOffset, backColor, circular, circularSectorsCount );
+
+ // Draw rectangle image
+ if( backImage.Length > 0 && (backImageWrapMode == ChartImageWrapMode.Unscaled || backImageWrapMode == ChartImageWrapMode.Scaled))
+ {
+ // Load image
+ System.Drawing.Image image = _common.ImageLoader.LoadImage( backImage );
+
+ // Prepare image properties (transparent color)
+ ImageAttributes attrib = new ImageAttributes();
+ if(backImageTransparentColor != Color.Empty)
+ {
+ attrib.SetColorKey(backImageTransparentColor, backImageTransparentColor, ColorAdjustType.Default);
+ }
+
+ // Draw scaled image
+ RectangleF imageRect = new RectangleF();
+ imageRect.X = fillRect.X;
+ imageRect.Y = fillRect.Y;
+ imageRect.Width = fillRect.Width;
+ imageRect.Height = fillRect.Height;
+
+ SizeF imageAbsSize = new SizeF();
+
+ // Calculate unscaled image position
+ if(backImageWrapMode == ChartImageWrapMode.Unscaled)
+ {
+ ImageLoader.GetAdjustedImageSize(image, this.Graphics, ref imageAbsSize);
+
+ // Calculate image position
+ imageRect.Width = Math.Min(fillRect.Width, imageAbsSize.Width);
+ imageRect.Height = Math.Min(fillRect.Height, imageAbsSize.Height);
+
+ // Adjust position with alignment property
+ if(imageRect.Width < fillRect.Width)
+ {
+ if(backImageAlign == ChartImageAlignmentStyle.BottomRight ||
+ backImageAlign == ChartImageAlignmentStyle.Right ||
+ backImageAlign == ChartImageAlignmentStyle.TopRight)
+ {
+ imageRect.X = fillRect.Right - imageRect.Width;
+ }
+ else if(backImageAlign == ChartImageAlignmentStyle.Bottom ||
+ backImageAlign == ChartImageAlignmentStyle.Center ||
+ backImageAlign == ChartImageAlignmentStyle.Top)
+ {
+ imageRect.X = fillRect.X + (fillRect.Width - imageRect.Width)/2;
+ }
+ }
+ if(imageRect.Height < fillRect.Height)
+ {
+ if(backImageAlign == ChartImageAlignmentStyle.BottomRight ||
+ backImageAlign == ChartImageAlignmentStyle.Bottom ||
+ backImageAlign == ChartImageAlignmentStyle.BottomLeft)
+ {
+ imageRect.Y = fillRect.Bottom - imageRect.Height;
+ }
+ else if(backImageAlign == ChartImageAlignmentStyle.Left ||
+ backImageAlign == ChartImageAlignmentStyle.Center ||
+ backImageAlign == ChartImageAlignmentStyle.Right)
+ {
+ imageRect.Y = fillRect.Y + (fillRect.Height - imageRect.Height)/2;
+ }
+ }
+
+ }
+
+ // Fill background with brush
+ if(brush != null)
+ {
+ if(circular)
+ this.DrawCircleAbs( null, brush, fillRect, circularSectorsCount, circle3D );
+ else
+ this.FillRectangle( brush, fillRect );
+ }
+
+ // Draw image
+ this.DrawImage(image,
+ new Rectangle((int)Math.Round(imageRect.X),(int)Math.Round(imageRect.Y), (int)Math.Round(imageRect.Width), (int)Math.Round(imageRect.Height)),
+ 0, 0,
+ (backImageWrapMode == ChartImageWrapMode.Unscaled) ? imageRect.Width * image.Width / imageAbsSize.Width : image.Width,
+ (backImageWrapMode == ChartImageWrapMode.Unscaled) ? imageRect.Height * image.Height / imageAbsSize.Height : image.Height,
+ GraphicsUnit.Pixel,
+ attrib);
+ }
+ // Draw rectangle
+ else
+ {
+ if(backBrush != null && backImageTransparentColor != Color.Empty)
+ {
+ // Fill background with brush
+ if(circular)
+ this.DrawCircleAbs( null, backBrush, fillRect, circularSectorsCount, circle3D );
+ else
+ this.FillRectangle( backBrush, fillRect );
+ }
+
+ if(brush != null)
+ {
+ if(circular)
+ this.DrawCircleAbs( null, brush, fillRect, circularSectorsCount, circle3D );
+ else
+ this.FillRectangle( brush, fillRect );
+ }
+ }
+
+ // Draw different bar style
+ this.DrawRectangleBarStyle(barDrawingStyle, isVertical, fillRect);
+
+ // Draw border
+ if( borderWidth > 0 && borderDashStyle != ChartDashStyle.NotSet)
+ {
+ // Set a border line color
+ if(_pen.Color != borderColor)
+ {
+ _pen.Color = borderColor;
+ }
+
+ // Set a border line width
+ if(_pen.Width != borderWidth)
+ {
+ _pen.Width = borderWidth;
+ }
+
+ // Set pen alignment
+ if(_pen.Alignment != penAlignment)
+ {
+ _pen.Alignment = penAlignment;
+ }
+
+ // Set a border line style
+ if(_pen.DashStyle != GetPenStyle( borderDashStyle ))
+ {
+ _pen.DashStyle = GetPenStyle( borderDashStyle );
+ }
+
+ // Draw border
+ if(circular)
+ {
+ this.DrawCircleAbs( _pen, null, rect, circularSectorsCount, false );
+ }
+ else
+ {
+ // NOTE: Rectangle with single pixel inset border is drawn 1 pixel larger
+ // in the .Net Framework. Increase size by 1 pixel to solve the issue.
+ if(_pen.Alignment == PenAlignment.Inset && _pen.Width > 1f)
+ {
+ rect.Width += 1;
+ rect.Height += 1;
+ }
+
+ // Draw rectangle
+ this.DrawRectangle( _pen, rect.X, rect.Y, rect.Width, rect.Height );
+ }
+ }
+
+ // Dispose Image and Gradient
+ if(brush != null)
+ {
+ brush.Dispose();
+ }
+
+ // Return old smoothing mode
+ this.SmoothingMode = oldSmoothingMode;
+ }
+
+ /// <summary>
+ /// Draw Shadow for a bar
+ /// </summary>
+ /// <param name="rect">Bar rectangle</param>
+ /// <param name="shadowColor">Shadow Color</param>
+ /// <param name="shadowOffset">Shadow Offset</param>
+ /// <param name="backColor">Back Color</param>
+ internal void FillRectangleShadowAbs(
+ RectangleF rect,
+ Color shadowColor,
+ float shadowOffset,
+ Color backColor)
+ {
+ FillRectangleShadowAbs(
+ rect,
+ shadowColor,
+ shadowOffset,
+ backColor,
+ false,
+ 0);
+ }
+
+ /// <summary>
+ /// Draw Shadow for a bar
+ /// </summary>
+ /// <param name="rect">Bar rectangle</param>
+ /// <param name="shadowColor">Shadow Color</param>
+ /// <param name="shadowOffset">Shadow Offset</param>
+ /// <param name="backColor">Back Color</param>
+ /// <param name="circular">Draw circular shape inside the rectangle.</param>
+ /// <param name="circularSectorsCount">Number of sectors in circle when drawing the polygon.</param>
+ internal void FillRectangleShadowAbs(
+ RectangleF rect,
+ Color shadowColor,
+ float shadowOffset,
+ Color backColor,
+ bool circular,
+ int circularSectorsCount)
+ {
+ // Do not draw shadoe for empty rectangle
+ if(rect.Height == 0 || rect.Width == 0 || shadowOffset == 0)
+ {
+ return;
+ }
+
+ // Do not draw shadow if color is IsEmpty or offset is 0
+ if (shadowOffset == 0 || shadowColor == Color.Empty)
+ {
+ return;
+ }
+
+ // For non-circualr shadow with transparent background - use clipping
+ bool clippingUsed = false;
+ Region oldClipRegion = null;
+ if (!circular && backColor == Color.Transparent)
+ {
+ clippingUsed = true;
+ oldClipRegion = this.Clip;
+ Region region = new Region();
+ region.MakeInfinite();
+ region.Xor(rect);
+ this.Clip = region;
+ }
+
+ // Draw usual or "soft" shadows
+ if(!softShadows || circularSectorsCount > 2)
+ {
+ RectangleF absolute;
+ RectangleF offset = RectangleF.Empty;
+
+ absolute = Round( rect );
+
+ // Change shadow color
+ using (SolidBrush shadowBrush = new SolidBrush((shadowColor.A != 255) ? shadowColor : Color.FromArgb(backColor.A / 2, shadowColor)))
+ {
+ // Shadow Position
+ offset.X = absolute.X + shadowOffset;
+ offset.Y = absolute.Y + shadowOffset;
+ offset.Width = absolute.Width;
+ offset.Height = absolute.Height;
+
+ // Draw rectangle
+ if (circular)
+ this.DrawCircleAbs(null, shadowBrush, offset, circularSectorsCount, false);
+ else
+ this.FillRectangle(shadowBrush, offset);
+ }
+ }
+ else
+ {
+
+ RectangleF absolute;
+ RectangleF offset = RectangleF.Empty;
+
+ absolute = Round( rect );
+
+
+ // Shadow Position
+ offset.X = absolute.X + shadowOffset - 1;
+ offset.Y = absolute.Y + shadowOffset - 1;
+ offset.Width = absolute.Width + 2;
+ offset.Height = absolute.Height + 2;
+
+ // Calculate rounded rect radius
+ float radius = shadowOffset * 0.7f;
+ radius = (float)Math.Max(radius, 2f);
+ radius = (float)Math.Min(radius, offset.Width/4f);
+ radius = (float)Math.Min(radius, offset.Height/4f);
+ radius = (float)Math.Ceiling(radius);
+ if(circular)
+ {
+ radius = offset.Width/2f;
+ }
+
+ // Create rounded rectangle path
+ GraphicsPath path = new GraphicsPath();
+ if(circular && offset.Width != offset.Height)
+ {
+ float radiusX = offset.Width/2f;
+ float radiusY = offset.Height/2f;
+ path.AddLine(offset.X+radiusX, offset.Y, offset.Right-radiusX, offset.Y);
+ path.AddArc(offset.Right-2f*radiusX, offset.Y, 2f*radiusX, 2f*radiusY, 270, 90);
+ path.AddLine(offset.Right, offset.Y + radiusY, offset.Right, offset.Bottom - radiusY);
+ path.AddArc(offset.Right-2f*radiusX, offset.Bottom-2f*radiusY, 2f*radiusX, 2f*radiusY, 0, 90);
+ path.AddLine(offset.Right-radiusX, offset.Bottom, offset.X + radiusX, offset.Bottom);
+ path.AddArc(offset.X, offset.Bottom-2f*radiusY, 2f*radiusX, 2f*radiusY, 90, 90);
+ path.AddLine(offset.X, offset.Bottom-radiusY, offset.X, offset.Y+radiusY);
+ path.AddArc(offset.X, offset.Y, 2f*radiusX, 2f*radiusY, 180, 90);
+ }
+ else
+ {
+ path.AddLine(offset.X+radius, offset.Y, offset.Right-radius, offset.Y);
+ path.AddArc(offset.Right-2f*radius, offset.Y, 2f*radius, 2f*radius, 270, 90);
+ path.AddLine(offset.Right, offset.Y + radius, offset.Right, offset.Bottom - radius);
+ path.AddArc(offset.Right-2f*radius, offset.Bottom-2f*radius, 2f*radius, 2f*radius, 0, 90);
+ path.AddLine(offset.Right-radius, offset.Bottom, offset.X + radius, offset.Bottom);
+ path.AddArc(offset.X, offset.Bottom-2f*radius, 2f*radius, 2f*radius, 90, 90);
+ path.AddLine(offset.X, offset.Bottom-radius, offset.X, offset.Y+radius);
+ path.AddArc(offset.X, offset.Y, 2f*radius, 2f*radius, 180, 90);
+ }
+
+ PathGradientBrush shadowBrush = new PathGradientBrush(path);
+ shadowBrush.CenterColor = shadowColor;
+
+ // Set the color along the entire boundary of the path
+ Color[] colors = {Color.Transparent};
+ shadowBrush.SurroundColors = colors;
+ shadowBrush.CenterPoint = new PointF(offset.X + offset.Width/2f, offset.Y + offset.Height/2f);
+
+ // Define brush focus scale
+ PointF focusScale = new PointF(1-2f*shadowOffset/offset.Width, 1-2f*shadowOffset/offset.Height);
+ if(focusScale.X < 0)
+ focusScale.X = 0;
+ if(focusScale.Y < 0)
+ focusScale.Y = 0;
+ shadowBrush.FocusScales = focusScale;
+
+ // Draw rectangle
+ this.FillPath(shadowBrush, path);
+ }
+
+ // Reset clip region
+ if (clippingUsed)
+ {
+ Region region = this.Clip;
+ this.Clip = oldClipRegion;
+ region.Dispose();
+ }
+ }
+
+ /// <summary>
+ /// Gets the path of the polygon which represent the circular area.
+ /// </summary>
+ /// <param name="position">Circle position.</param>
+ /// <param name="polygonSectorsNumber">Number of sectors for the polygon.</param>
+ /// <returns>Graphics path of the polygon circle.</returns>
+ internal GraphicsPath GetPolygonCirclePath(RectangleF position, int polygonSectorsNumber)
+ {
+ PointF firstPoint = new PointF(position.X + position.Width/2f, position.Y);
+ PointF centerPoint = new PointF(position.X + position.Width/2f, position.Y + position.Height/2f);
+ float sectorSize = 0f;
+ GraphicsPath path = new GraphicsPath();
+ PointF prevPoint = PointF.Empty;
+ float curentSector = 0f;
+
+ // Get sector size
+ if(polygonSectorsNumber <= 2)
+ {
+ // Circle sector size
+ sectorSize = 1f;
+ }
+ else
+ {
+ // Polygon sector size
+ sectorSize = 360f / ((float)polygonSectorsNumber);
+ }
+
+ // Loop throug all sectors
+ for(curentSector = 0f; curentSector < 360f; curentSector += sectorSize)
+ {
+ // Create matrix
+ Matrix matrix = new Matrix();
+ matrix.RotateAt(curentSector, centerPoint);
+
+ // Get point and rotate it
+ PointF[] points = new PointF[] { firstPoint };
+ matrix.TransformPoints(points);
+
+ // Add point into the path
+ if(!prevPoint.IsEmpty)
+ {
+ path.AddLine(prevPoint, points[0]);
+ }
+
+ // Remember last point
+ prevPoint = points[0];
+ }
+
+ path.CloseAllFigures();
+
+ return path;
+ }
+
+ /// <summary>
+ /// Fills and/or draws border as circle or polygon.
+ /// </summary>
+ /// <param name="pen">Border pen.</param>
+ /// <param name="brush">Border brush.</param>
+ /// <param name="position">Circle position.</param>
+ /// <param name="polygonSectorsNumber">Number of sectors for the polygon.</param>
+ /// <param name="circle3D">Indicates that circle should be 3D..</param>
+ internal void DrawCircleAbs(Pen pen, Brush brush, RectangleF position, int polygonSectorsNumber, bool circle3D)
+ {
+ bool fill3DCircle = (circle3D && brush != null);
+
+ // Draw 2D circle
+ if(polygonSectorsNumber <= 2 && !fill3DCircle)
+ {
+ if(brush != null)
+ {
+ this.FillEllipse(brush, position);
+ }
+ if(pen != null)
+ {
+ this.DrawEllipse(pen, position);
+ }
+ }
+
+ // Draw circle as polygon with specified number of sectors
+ else
+ {
+ PointF firstPoint = new PointF(position.X + position.Width/2f, position.Y);
+ PointF centerPoint = new PointF(position.X + position.Width/2f, position.Y + position.Height/2f);
+ float sectorSize = 0f;
+ PointF prevPoint = PointF.Empty;
+ float curentSector = 0f;
+
+ using (GraphicsPath path = new GraphicsPath())
+ {
+ // Remember current smoothing mode
+ SmoothingMode oldMode = this.SmoothingMode;
+ if (fill3DCircle)
+ {
+ this.SmoothingMode = SmoothingMode.None;
+ }
+
+ // Get sector size
+ if (polygonSectorsNumber <= 2)
+ {
+ // Circle sector size
+ sectorSize = 1f;
+ }
+ else
+ {
+ // Polygon sector size
+ sectorSize = 360f / ((float)polygonSectorsNumber);
+ }
+
+ // Loop throug all sectors
+ for (curentSector = 0f; curentSector < 360f; curentSector += sectorSize)
+ {
+ // Create matrix
+ Matrix matrix = new Matrix();
+ matrix.RotateAt(curentSector, centerPoint);
+
+ // Get point and rotate it
+ PointF[] points = new PointF[] { firstPoint };
+ matrix.TransformPoints(points);
+
+ // Add point into the path
+ if (!prevPoint.IsEmpty)
+ {
+ path.AddLine(prevPoint, points[0]);
+
+ // Fill each segment separatly for the 3D look
+ if (fill3DCircle)
+ {
+ path.AddLine(points[0], centerPoint);
+ path.AddLine(centerPoint, prevPoint);
+ using (Brush sectorBrush = GetSector3DBrush(brush, curentSector, sectorSize))
+ {
+ this.FillPath(sectorBrush, path);
+ }
+ path.Reset();
+ }
+ }
+
+ // Remember last point
+ prevPoint = points[0];
+ }
+
+ path.CloseAllFigures();
+
+ // Fill last segment for the 3D look
+ if (!prevPoint.IsEmpty && fill3DCircle)
+ {
+ path.AddLine(prevPoint, firstPoint);
+ path.AddLine(firstPoint, centerPoint);
+ path.AddLine(centerPoint, prevPoint);
+ using (Brush sectorBrush = GetSector3DBrush(brush, curentSector, sectorSize))
+ {
+ this.FillPath(sectorBrush, path);
+ }
+ path.Reset();
+ }
+
+ // Restore old mode
+ if (fill3DCircle)
+ {
+ this.SmoothingMode = oldMode;
+ }
+
+ if (brush != null && !circle3D)
+ {
+ this.FillPath(brush, path);
+ }
+ if (pen != null)
+ {
+ this.DrawPath(pen, path);
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Creates 3D sector brush.
+ /// </summary>
+ /// <param name="brush">Original brush.</param>
+ /// <param name="curentSector">Sector position.</param>
+ /// <param name="sectorSize">Sector size.</param>
+ /// <returns>3D brush.</returns>
+ [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily",
+ Justification = "Too large of a code change to justify making this change")]
+ internal Brush GetSector3DBrush(Brush brush, float curentSector, float sectorSize)
+ {
+ // Get color from the brush
+ Color brushColor = Color.Gray;
+ if(brush is HatchBrush)
+ {
+ brushColor = ((HatchBrush)brush).BackgroundColor;
+ }
+ else if(brush is LinearGradientBrush)
+ {
+ brushColor = ((LinearGradientBrush)brush).LinearColors[0];
+ }
+ else if(brush is PathGradientBrush)
+ {
+ brushColor = ((PathGradientBrush)brush).CenterColor;
+ }
+ else if(brush is SolidBrush)
+ {
+ brushColor = ((SolidBrush)brush).Color;
+ }
+
+ // Adjust sector angle
+ curentSector -= sectorSize / 2f;
+
+ // Make adjustment for polygon circle with 5 segments
+ // to avoid the issue that bottom segment is too dark
+ if(sectorSize == 72f && curentSector == 180f)
+ {
+ curentSector *= 0.8f;
+ }
+
+ // No angles more than 180
+ if(curentSector > 180)
+ {
+ curentSector = 360f - curentSector;
+ }
+ curentSector = curentSector / 180F;
+
+ // Get brush
+ brushColor = GetBrightGradientColor( brushColor, curentSector);
+
+ // Get brush
+ return new SolidBrush(brushColor);
+ }
+
+ /// <summary>
+ /// This method creates gradient color with brightness
+ /// </summary>
+ /// <param name="beginColor">Start color for gradient.</param>
+ /// <param name="position">Position used between Start and end color.</param>
+ /// <returns>Calculated Gradient color from gradient position</returns>
+ internal Color GetBrightGradientColor( Color beginColor, double position )
+ {
+ double brightness = 0.5;
+ if( position < brightness )
+ {
+ return GetGradientColor( Color.FromArgb(beginColor.A,255,255,255), beginColor, 1 - brightness + position );
+ }
+ else if( -brightness + position < 1 )
+ {
+ return GetGradientColor( beginColor, Color.Black, -brightness + position);
+ }
+ else
+ {
+ return Color.FromArgb( beginColor.A, 0, 0, 0 );
+ }
+ }
+
+ /// <summary>
+ /// Draw Rectangle using absolute coordinates.
+ /// </summary>
+ /// <param name="rect">Size of rectangle</param>
+ /// <param name="backColor">Color of rectangle</param>
+ /// <param name="backHatchStyle">Hatch Style</param>
+ /// <param name="backImage">Image URL</param>
+ /// <param name="backImageWrapMode">Image Mode</param>
+ /// <param name="backImageTransparentColor">Image transparent color.</param>
+ /// <param name="backImageAlign">Image alignment.</param>
+ /// <param name="backGradientStyle">Gradient AxisName</param>
+ /// <param name="backSecondaryColor">End Gradient color</param>
+ /// <param name="borderColor">Border Color</param>
+ /// <param name="borderWidth">Border Width</param>
+ /// <param name="borderDashStyle">Border Style</param>
+ /// <param name="penAlignment">Border is outside or inside rectangle</param>
+ internal void FillRectangleAbs( RectangleF rect,
+ Color backColor,
+ ChartHatchStyle backHatchStyle,
+ string backImage,
+ ChartImageWrapMode backImageWrapMode,
+ Color backImageTransparentColor,
+ ChartImageAlignmentStyle backImageAlign,
+ GradientStyle backGradientStyle,
+ Color backSecondaryColor,
+ Color borderColor,
+ int borderWidth,
+ ChartDashStyle borderDashStyle,
+ PenAlignment penAlignment )
+ {
+ Brush brush = null;
+ Brush backBrush = null;
+
+ // Turn off Antialias
+ SmoothingMode oldMode = this.SmoothingMode;
+ this.SmoothingMode = SmoothingMode.None;
+
+ // Color is empty
+ if( backColor.IsEmpty )
+ backColor = Color.White;
+
+ if( backSecondaryColor.IsEmpty )
+ backSecondaryColor = Color.White;
+
+ if( borderColor.IsEmpty )
+ {
+ borderColor = Color.White;
+ borderWidth = 0;
+ }
+
+ // Set a border line color
+ _pen.Color = borderColor;
+
+ // Set a border line width
+ _pen.Width = borderWidth;
+
+ // Set pen alignment
+ _pen.Alignment = penAlignment;
+
+ // Set a border line style
+ _pen.DashStyle = GetPenStyle( borderDashStyle );
+
+ if( backGradientStyle == GradientStyle.None )
+ {
+ // Set a bar color.
+ _solidBrush.Color = backColor;
+ brush = _solidBrush;
+ }
+ else
+ {
+ // If a gradient type is set create a brush with gradient
+ brush = GetGradientBrush( rect, backColor, backSecondaryColor, backGradientStyle );
+ }
+
+ if( backHatchStyle != ChartHatchStyle.None )
+ {
+ brush = GetHatchBrush( backHatchStyle, backColor, backSecondaryColor );
+ }
+
+ if( backImage.Length > 0 && backImageWrapMode != ChartImageWrapMode.Unscaled && backImageWrapMode != ChartImageWrapMode.Scaled)
+ {
+ backBrush = brush;
+ brush = GetTextureBrush(backImage, backImageTransparentColor, backImageWrapMode, backColor );
+ }
+
+ // For inset alignment resize fill rectangle
+ RectangleF fillRect;
+
+ // The fill rectangle is same
+ fillRect = new RectangleF( rect.X + borderWidth, rect.Y + borderWidth, rect.Width - borderWidth * 2, rect.Height - borderWidth * 2 );
+
+ // FillRectangle and DrawRectangle works differently with RectangleF.
+ fillRect.Width += 1;
+ fillRect.Height += 1;
+
+ // Draw rectangle image
+ if( backImage.Length > 0 && (backImageWrapMode == ChartImageWrapMode.Unscaled || backImageWrapMode == ChartImageWrapMode.Scaled))
+ {
+ // Load image
+ System.Drawing.Image image = _common.ImageLoader.LoadImage( backImage );
+
+
+ // Prepare image properties (transparent color)
+ ImageAttributes attrib = new ImageAttributes();
+ if(backImageTransparentColor != Color.Empty)
+ {
+ attrib.SetColorKey(backImageTransparentColor, backImageTransparentColor, ColorAdjustType.Default);
+ }
+
+ // Draw scaled image
+ RectangleF imageRect = new RectangleF();
+ imageRect.X = fillRect.X;
+ imageRect.Y = fillRect.Y;
+ imageRect.Width = fillRect.Width;
+ imageRect.Height = fillRect.Height;
+
+ // Draw unscaled image using align property
+ if(backImageWrapMode == ChartImageWrapMode.Unscaled)
+ {
+ SizeF imageAbsSize = new SizeF();
+
+ ImageLoader.GetAdjustedImageSize(image, this.Graphics, ref imageAbsSize);
+
+ // Calculate image position
+ imageRect.Width = imageAbsSize.Width;
+ imageRect.Height = imageAbsSize.Height;
+
+ // Adjust position with alignment property
+ if(imageRect.Width < fillRect.Width)
+ {
+ if(backImageAlign == ChartImageAlignmentStyle.BottomRight ||
+ backImageAlign == ChartImageAlignmentStyle.Right ||
+ backImageAlign == ChartImageAlignmentStyle.TopRight)
+ {
+ imageRect.X = fillRect.Right - imageRect.Width;
+ }
+ else if(backImageAlign == ChartImageAlignmentStyle.Bottom ||
+ backImageAlign == ChartImageAlignmentStyle.Center ||
+ backImageAlign == ChartImageAlignmentStyle.Top)
+ {
+ imageRect.X = fillRect.X + (fillRect.Width - imageRect.Width)/2;
+ }
+ }
+ if(imageRect.Height < fillRect.Height)
+ {
+ if(backImageAlign == ChartImageAlignmentStyle.BottomRight ||
+ backImageAlign == ChartImageAlignmentStyle.Bottom ||
+ backImageAlign == ChartImageAlignmentStyle.BottomLeft)
+ {
+ imageRect.Y = fillRect.Bottom - imageRect.Height;
+ }
+ else if(backImageAlign == ChartImageAlignmentStyle.Left ||
+ backImageAlign == ChartImageAlignmentStyle.Center ||
+ backImageAlign == ChartImageAlignmentStyle.Right)
+ {
+ imageRect.Y = fillRect.Y + (fillRect.Height - imageRect.Height)/2;
+ }
+ }
+
+ }
+
+ // Fill background with brush
+ this.FillRectangle( brush, rect.X, rect.Y, rect.Width + 1, rect.Height + 1);
+
+ // Draw image
+ this.DrawImage(image,
+ new Rectangle((int)Math.Round(imageRect.X),(int)Math.Round(imageRect.Y), (int)Math.Round(imageRect.Width), (int)Math.Round(imageRect.Height)),
+ 0, 0, image.Width, image.Height,
+ GraphicsUnit.Pixel,
+ attrib);
+ }
+ // Draw rectangle
+ else
+ {
+ if(backBrush != null && backImageTransparentColor != Color.Empty)
+ {
+ // Fill background with brush
+ this.FillRectangle( backBrush, rect.X, rect.Y, rect.Width + 1, rect.Height + 1 );
+ }
+ this.FillRectangle( brush, rect.X, rect.Y, rect.Width + 1, rect.Height + 1 );
+ }
+
+ // Set pen alignment
+ if(borderDashStyle != ChartDashStyle.NotSet)
+ {
+ if( borderWidth > 1 )
+ this.DrawRectangle( _pen, rect.X, rect.Y, rect.Width + 1, rect.Height + 1 );
+ else if( borderWidth == 1 )
+ this.DrawRectangle( _pen, rect.X, rect.Y, rect.Width, rect.Height );
+ }
+
+ // Dispose Image and Gradient
+ if( backGradientStyle != GradientStyle.None )
+ {
+ brush.Dispose();
+ }
+ if( backImage.Length > 0 && backImageWrapMode != ChartImageWrapMode.Unscaled && backImageWrapMode != ChartImageWrapMode.Scaled)
+ {
+ brush.Dispose();
+ }
+ if( backHatchStyle != ChartHatchStyle.None )
+ {
+ brush.Dispose();
+ }
+
+ // Set Old Smoothing Mode
+ this.SmoothingMode = oldMode;
+ }
+
+ /// <summary>
+ /// Fills graphics path with shadow using absolute coordinates.
+ /// </summary>
+ /// <param name="path">Graphics path to fill.</param>
+ /// <param name="backColor">Color of rectangle</param>
+ /// <param name="backHatchStyle">Hatch Style</param>
+ /// <param name="backImage">Image URL</param>
+ /// <param name="backImageWrapMode">Image Mode</param>
+ /// <param name="backImageTransparentColor">Image transparent color.</param>
+ /// <param name="backImageAlign">Image alignment.</param>
+ /// <param name="backGradientStyle">Gradient AxisName</param>
+ /// <param name="backSecondaryColor">End Gradient color</param>
+ /// <param name="borderColor">Border Color</param>
+ /// <param name="borderWidth">Border Width</param>
+ /// <param name="borderDashStyle">Border Style</param>
+ /// <param name="penAlignment">Border is outside or inside rectangle</param>
+ /// <param name="shadowOffset">Shadow offset.</param>
+ /// <param name="shadowColor">Shadow color.</param>
+ internal void DrawPathAbs(
+ GraphicsPath path,
+ Color backColor,
+ ChartHatchStyle backHatchStyle,
+ string backImage,
+ ChartImageWrapMode backImageWrapMode,
+ Color backImageTransparentColor,
+ ChartImageAlignmentStyle backImageAlign,
+ GradientStyle backGradientStyle,
+ Color backSecondaryColor,
+ Color borderColor,
+ int borderWidth,
+ ChartDashStyle borderDashStyle,
+ PenAlignment penAlignment,
+ int shadowOffset,
+ Color shadowColor)
+ {
+ // Draw patj shadow
+ if(shadowOffset != 0 && shadowColor != Color.Transparent)
+ {
+ // Save graphics state and apply translate transformation
+ GraphicsState graphicsState = this.Save();
+ this.TranslateTransform(shadowOffset, shadowOffset);
+
+ if(backColor == Color.Transparent &&
+ backSecondaryColor.IsEmpty )
+ {
+ this.DrawPathAbs(
+ path,
+ Color.Transparent,
+ ChartHatchStyle.None,
+ String.Empty,
+ ChartImageWrapMode.Scaled,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ GradientStyle.None,
+ Color.Empty,
+ shadowColor,
+ borderWidth,
+ borderDashStyle,
+ PenAlignment.Center);
+ }
+ else
+ {
+ this.DrawPathAbs(
+ path,
+ shadowColor,
+ ChartHatchStyle.None,
+ String.Empty,
+ ChartImageWrapMode.Scaled,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ GradientStyle.None,
+ Color.Empty,
+ Color.Transparent,
+ 0,
+ ChartDashStyle.NotSet,
+ PenAlignment.Center);
+ }
+
+ // Restore graphics state
+ this.Restore(graphicsState);
+ }
+
+ // Draw path
+ this.DrawPathAbs(
+ path,
+ backColor,
+ backHatchStyle,
+ backImage,
+ backImageWrapMode,
+ backImageTransparentColor,
+ backImageAlign,
+ backGradientStyle,
+ backSecondaryColor,
+ borderColor,
+ borderWidth,
+ borderDashStyle,
+ penAlignment);
+ }
+
+ /// <summary>
+ /// Fills graphics path using absolute coordinates.
+ /// </summary>
+ /// <param name="path">Graphics path to fill.</param>
+ /// <param name="backColor">Color of rectangle</param>
+ /// <param name="backHatchStyle">Hatch Style</param>
+ /// <param name="backImage">Image URL</param>
+ /// <param name="backImageWrapMode">Image Mode</param>
+ /// <param name="backImageTransparentColor">Image transparent color.</param>
+ /// <param name="backImageAlign">Image alignment.</param>
+ /// <param name="backGradientStyle">Gradient AxisName</param>
+ /// <param name="backSecondaryColor">End Gradient color</param>
+ /// <param name="borderColor">Border Color</param>
+ /// <param name="borderWidth">Border Width</param>
+ /// <param name="borderDashStyle">Border Style</param>
+ /// <param name="penAlignment">Border is outside or inside rectangle</param>
+ internal void DrawPathAbs( GraphicsPath path,
+ Color backColor,
+ ChartHatchStyle backHatchStyle,
+ string backImage,
+ ChartImageWrapMode backImageWrapMode,
+ Color backImageTransparentColor,
+ ChartImageAlignmentStyle backImageAlign,
+ GradientStyle backGradientStyle,
+ Color backSecondaryColor,
+ Color borderColor,
+ int borderWidth,
+ ChartDashStyle borderDashStyle,
+ PenAlignment penAlignment )
+ {
+ Brush brush = null;
+ Brush backBrush = null;
+
+ // Color is empty
+ if( backColor.IsEmpty )
+ backColor = Color.White;
+
+ if( backSecondaryColor.IsEmpty )
+ backSecondaryColor = Color.White;
+
+ if( borderColor.IsEmpty )
+ {
+ borderColor = Color.White;
+ borderWidth = 0;
+ }
+
+ // Set pen properties
+ _pen.Color = borderColor;
+ _pen.Width = borderWidth;
+ _pen.Alignment = penAlignment;
+ _pen.DashStyle = GetPenStyle( borderDashStyle );
+
+ if( backGradientStyle == GradientStyle.None )
+ {
+ // Set solid brush color.
+ _solidBrush.Color = backColor;
+ brush = _solidBrush;
+ }
+ else
+ {
+ // If a gradient type is set create a brush with gradient
+ RectangleF pathRect = path.GetBounds();
+ pathRect.Inflate(new SizeF(2,2));
+ brush = GetGradientBrush(
+ pathRect,
+ backColor,
+ backSecondaryColor,
+ backGradientStyle );
+ }
+
+ if( backHatchStyle != ChartHatchStyle.None )
+ {
+ brush = GetHatchBrush( backHatchStyle, backColor, backSecondaryColor );
+ }
+
+ if( backImage.Length > 0 && backImageWrapMode != ChartImageWrapMode.Unscaled && backImageWrapMode != ChartImageWrapMode.Scaled)
+ {
+ backBrush = brush;
+ brush = GetTextureBrush(backImage, backImageTransparentColor, backImageWrapMode, backColor );
+ }
+
+ // For inset alignment resize fill rectangle
+ RectangleF fillRect = path.GetBounds();
+
+ // Draw rectangle image
+ if( backImage.Length > 0 && (backImageWrapMode == ChartImageWrapMode.Unscaled || backImageWrapMode == ChartImageWrapMode.Scaled))
+ {
+ // Load image
+System.Drawing.Image image = _common.ImageLoader.LoadImage( backImage );
+
+ // Prepare image properties (transparent color)
+ ImageAttributes attrib = new ImageAttributes();
+ if(backImageTransparentColor != Color.Empty)
+ {
+ attrib.SetColorKey(backImageTransparentColor, backImageTransparentColor, ColorAdjustType.Default);
+ }
+
+ // Draw scaled image
+ RectangleF imageRect = new RectangleF();
+ imageRect.X = fillRect.X;
+ imageRect.Y = fillRect.Y;
+ imageRect.Width = fillRect.Width;
+ imageRect.Height = fillRect.Height;
+
+ // Draw unscaled image using align property
+ if(backImageWrapMode == ChartImageWrapMode.Unscaled)
+ {
+ SizeF imageSize = new SizeF();
+
+ ImageLoader.GetAdjustedImageSize(image, this.Graphics, ref imageSize);
+
+ // Calculate image position
+ imageRect.Width = imageSize.Width;
+ imageRect.Height = imageSize.Height;
+
+ // Adjust position with alignment property
+ if(imageRect.Width < fillRect.Width)
+ {
+ if(backImageAlign == ChartImageAlignmentStyle.BottomRight ||
+ backImageAlign == ChartImageAlignmentStyle.Right ||
+ backImageAlign == ChartImageAlignmentStyle.TopRight)
+ {
+ imageRect.X = fillRect.Right - imageRect.Width;
+ }
+ else if(backImageAlign == ChartImageAlignmentStyle.Bottom ||
+ backImageAlign == ChartImageAlignmentStyle.Center ||
+ backImageAlign == ChartImageAlignmentStyle.Top)
+ {
+ imageRect.X = fillRect.X + (fillRect.Width - imageRect.Width)/2;
+ }
+ }
+ if(imageRect.Height < fillRect.Height)
+ {
+ if(backImageAlign == ChartImageAlignmentStyle.BottomRight ||
+ backImageAlign == ChartImageAlignmentStyle.Bottom ||
+ backImageAlign == ChartImageAlignmentStyle.BottomLeft)
+ {
+ imageRect.Y = fillRect.Bottom - imageRect.Height;
+ }
+ else if(backImageAlign == ChartImageAlignmentStyle.Left ||
+ backImageAlign == ChartImageAlignmentStyle.Center ||
+ backImageAlign == ChartImageAlignmentStyle.Right)
+ {
+ imageRect.Y = fillRect.Y + (fillRect.Height - imageRect.Height)/2;
+ }
+ }
+
+ }
+
+ // Fill background with brush
+ this.FillPath( brush, path );
+
+ // Draw image
+ Region oldClipRegion = this.Clip;
+ this.Clip = new Region(path);
+ this.DrawImage(image,
+ new Rectangle((int)Math.Round(imageRect.X),(int)Math.Round(imageRect.Y), (int)Math.Round(imageRect.Width), (int)Math.Round(imageRect.Height)),
+ 0, 0, image.Width, image.Height,
+ GraphicsUnit.Pixel,
+ attrib);
+ this.Clip = oldClipRegion;
+ }
+
+ // Draw rectangle
+ else
+ {
+ if(backBrush != null && backImageTransparentColor != Color.Empty)
+ {
+ // Fill background with brush
+ this.FillPath( backBrush, path);
+ }
+ this.FillPath( brush, path);
+ }
+
+ // Draw border
+ if(borderColor != Color.Empty && borderWidth > 0 && borderDashStyle != ChartDashStyle.NotSet)
+ {
+ this.DrawPath( _pen, path );
+ }
+ }
+
+ /// <summary>
+ /// Creates brush with specified properties.
+ /// </summary>
+ /// <param name="rect">Gradient rectangle</param>
+ /// <param name="backColor">Color of rectangle</param>
+ /// <param name="backHatchStyle">Hatch style</param>
+ /// <param name="backImage">Back Image</param>
+ /// <param name="backImageWrapMode">Image mode</param>
+ /// <param name="backImageTransparentColor">Image transparent color.</param>
+ /// <param name="backGradientStyle">Gradient type </param>
+ /// <param name="backSecondaryColor">Gradient End Color</param>
+ /// <returns>New brush object.</returns>
+ internal Brush CreateBrush(
+ RectangleF rect,
+ Color backColor,
+ ChartHatchStyle backHatchStyle,
+ string backImage,
+ ChartImageWrapMode backImageWrapMode,
+ Color backImageTransparentColor,
+ GradientStyle backGradientStyle,
+ Color backSecondaryColor
+ )
+ {
+ Brush brush = new SolidBrush(backColor);
+
+ if( backImage.Length > 0 && backImageWrapMode != ChartImageWrapMode.Unscaled && backImageWrapMode != ChartImageWrapMode.Scaled)
+ {
+ brush = GetTextureBrush(backImage, backImageTransparentColor, backImageWrapMode, backColor );
+ }
+ else if( backHatchStyle != ChartHatchStyle.None )
+ {
+ brush = GetHatchBrush( backHatchStyle, backColor, backSecondaryColor );
+ }
+ else if( backGradientStyle != GradientStyle.None )
+ {
+ // If a gradient type is set create a brush with gradient
+ brush = GetGradientBrush( rect, backColor, backSecondaryColor, backGradientStyle );
+ }
+
+ return brush;
+ }
+
+ #endregion
+
+ #region Coordinates converter
+
+ /// <summary>
+ /// This method takes a RectangleF structure that is using absolute coordinates
+ /// and returns a RectangleF object that uses relative coordinates.
+ /// </summary>
+ /// <param name="rectangle">RectangleF structure in absolute coordinates.</param>
+ /// <returns>RectangleF structure in relative coordinates.</returns>
+ public RectangleF GetRelativeRectangle( RectangleF rectangle )
+ {
+ // Check arguments
+ if (rectangle == null)
+ throw new ArgumentNullException("rectangle");
+
+ RectangleF relative = RectangleF.Empty;
+
+ // Convert absolute coordinates to relative coordinates
+ relative.X = rectangle.X * 100F / ((float)(_width - 1));
+ relative.Y = rectangle.Y * 100F / ((float)(_height - 1));
+ relative.Width = rectangle.Width * 100F / ((float)(_width - 1));
+ relative.Height = rectangle.Height * 100F / ((float)(_height - 1));
+
+ // Return Relative coordinates
+ return relative;
+ }
+
+ /// <summary>
+ /// This method takes a PointF object that is using absolute coordinates
+ /// and returns a PointF object that uses relative coordinates.
+ /// </summary>
+ /// <param name="point">PointF object in absolute coordinates.</param>
+ /// <returns>PointF object in relative coordinates.</returns>
+ public PointF GetRelativePoint( PointF point )
+ {
+ // Check arguments
+ if (point == null)
+ throw new ArgumentNullException("point");
+
+ PointF relative = PointF.Empty;
+
+ // Convert absolute coordinates to relative coordinates
+ relative.X = point.X * 100F / ((float)(_width - 1));
+ relative.Y = point.Y * 100F / ((float)(_height - 1));
+
+ // Return Relative coordinates
+ return relative;
+ }
+
+
+ /// <summary>
+ /// This method takes a SizeF object that uses absolute coordinates
+ /// and returns a SizeF object that uses relative coordinates.
+ /// </summary>
+ /// <param name="size">SizeF object in absolute coordinates.</param>
+ /// <returns>SizeF object in relative coordinates.</returns>
+ public SizeF GetRelativeSize( SizeF size )
+ {
+ // Check arguments
+ if (size == null)
+ throw new ArgumentNullException("size");
+
+ SizeF relative = SizeF.Empty;
+
+ // Convert absolute coordinates to relative coordinates
+ relative.Width = size.Width * 100F / ((float)(_width - 1));
+ relative.Height = size.Height * 100F / ((float)(_height - 1));
+
+ // Return relative coordinates
+ return relative;
+ }
+
+ /// <summary>
+ /// This method takes a PointF object and converts its relative coordinates
+ /// to absolute coordinates.
+ /// </summary>
+ /// <param name="point">PointF object in relative coordinates.</param>
+ /// <returns>PointF object in absolute coordinates.</returns>
+ public PointF GetAbsolutePoint( PointF point )
+ {
+ // Check arguments
+ if (point == null)
+ throw new ArgumentNullException("point");
+
+ PointF absolute = PointF.Empty;
+
+ // Convert relative coordinates to absolute coordinates
+ absolute.X = point.X * (_width - 1) / 100F;
+ absolute.Y = point.Y * (_height - 1) / 100F;
+
+ // Return Absolute coordinates
+ return absolute;
+ }
+
+ /// <summary>
+ /// This method takes a RectangleF structure and converts its relative coordinates
+ /// to absolute coordinates.
+ /// </summary>
+ /// <param name="rectangle">RectangleF object in relative coordinates.</param>
+ /// <returns>RectangleF object in absolute coordinates.</returns>
+ public RectangleF GetAbsoluteRectangle( RectangleF rectangle )
+ {
+ // Check arguments
+ if (rectangle == null)
+ throw new ArgumentNullException("rectangle");
+
+ RectangleF absolute = RectangleF.Empty;
+
+ // Convert relative coordinates to absolute coordinates
+ absolute.X = rectangle.X * (_width - 1) / 100F;
+ absolute.Y = rectangle.Y * (_height - 1) / 100F;
+ absolute.Width = rectangle.Width * (_width - 1) / 100F;
+ absolute.Height = rectangle.Height * (_height - 1) / 100F;
+
+ // Return Absolute coordinates
+ return absolute;
+ }
+
+ /// <summary>
+ /// This method takes a SizeF object that uses relative coordinates
+ /// and returns a SizeF object that uses absolute coordinates.
+ /// </summary>
+ /// <param name="size">SizeF object in relative coordinates.</param>
+ /// <returns>SizeF object in absolute coordinates.</returns>
+ public SizeF GetAbsoluteSize( SizeF size )
+ {
+ // Check arguments
+ if (size == null)
+ throw new ArgumentNullException("size");
+
+ SizeF absolute = SizeF.Empty;
+
+ // Convert relative coordinates to absolute coordinates
+ absolute.Width = size.Width * (_width - 1) / 100F;
+ absolute.Height = size.Height * (_height - 1) / 100F;
+
+ // Return Absolute coordinates
+ return absolute;
+ }
+
+
+ #endregion
+
+ #region Border drawing helper methods
+
+ /// <summary>
+ /// Helper function which creates a rounded rectangle path.
+ /// </summary>
+ /// <param name="rect">Rectangle coordinates.</param>
+ /// <param name="cornerRadius">Array of 4 corners radius.</param>
+ /// <returns>Graphics path object.</returns>
+ internal GraphicsPath CreateRoundedRectPath(RectangleF rect, float[] cornerRadius)
+ {
+ // Create rounded rectangle path
+ GraphicsPath path = new GraphicsPath();
+ path.AddLine(rect.X+cornerRadius[0], rect.Y, rect.Right-cornerRadius[1], rect.Y);
+ path.AddArc(rect.Right-2f*cornerRadius[1], rect.Y, 2f*cornerRadius[1], 2f*cornerRadius[2], 270, 90);
+ path.AddLine(rect.Right, rect.Y + cornerRadius[2], rect.Right, rect.Bottom - cornerRadius[3]);
+ path.AddArc(rect.Right-2f*cornerRadius[4], rect.Bottom-2f*cornerRadius[3], 2f*cornerRadius[4], 2f*cornerRadius[3], 0, 90);
+ path.AddLine(rect.Right-cornerRadius[4], rect.Bottom, rect.X + cornerRadius[5], rect.Bottom);
+ path.AddArc(rect.X, rect.Bottom-2f*cornerRadius[6], 2f*cornerRadius[5], 2f*cornerRadius[6], 90, 90);
+ path.AddLine(rect.X, rect.Bottom-cornerRadius[6], rect.X, rect.Y+cornerRadius[7]);
+ path.AddArc(rect.X, rect.Y, 2f*cornerRadius[0], 2f*cornerRadius[7], 180, 90);
+
+ return path;
+ }
+
+ /// <summary>
+ /// Helper function which draws a shadow of the rounded rect.
+ /// </summary>
+ /// <param name="rect">Rectangle coordinates.</param>
+ /// <param name="cornerRadius">Array of 4 corners radius.</param>
+ /// <param name="radius">Rounding radius.</param>
+ /// <param name="centerColor">Center color.</param>
+ /// <param name="surroundColor">Surrounding color.</param>
+ /// <param name="shadowScale">Shadow scale value.</param>
+ internal void DrawRoundedRectShadowAbs(RectangleF rect, float[] cornerRadius, float radius, Color centerColor, Color surroundColor, float shadowScale)
+ {
+ // Create rounded rectangle path
+ GraphicsPath path = CreateRoundedRectPath(rect, cornerRadius);
+
+ // Create gradient brush
+ PathGradientBrush shadowBrush = new PathGradientBrush(path);
+ shadowBrush.CenterColor = centerColor;
+
+ // Set the color along the entire boundary of the path
+ Color[] colors = {surroundColor};
+ shadowBrush.SurroundColors = colors;
+ shadowBrush.CenterPoint = new PointF(rect.X + rect.Width/2f, rect.Y + rect.Height/2f);
+
+ // Define brush focus scale
+ PointF focusScale = new PointF(1-shadowScale*radius/rect.Width, 1-shadowScale*radius/rect.Height);
+ shadowBrush.FocusScales = focusScale;
+
+ // Draw rounded rectangle
+ this.FillPath(shadowBrush, path);
+
+ if( path != null )
+ {
+ path.Dispose();
+ }
+ }
+
+ /// <summary>
+ /// Draws 3D border in absolute coordinates.
+ /// </summary>
+ /// <param name="borderSkin">Border skin object.</param>
+ /// <param name="rect">Rectangle of the border (pixel coordinates).</param>
+ /// <param name="backColor">Color of rectangle</param>
+ /// <param name="backHatchStyle">Hatch style</param>
+ /// <param name="backImage">Back Image</param>
+ /// <param name="backImageWrapMode">Image mode</param>
+ /// <param name="backImageTransparentColor">Image transparent color.</param>
+ /// <param name="backImageAlign">Image alignment</param>
+ /// <param name="backGradientStyle">Gradient type </param>
+ /// <param name="backSecondaryColor">Gradient End Color</param>
+ /// <param name="borderColor">Border Color</param>
+ /// <param name="borderWidth">Border Width</param>
+ /// <param name="borderDashStyle">Border Style</param>
+ internal void Draw3DBorderRel(
+ BorderSkin borderSkin,
+ RectangleF rect,
+ Color backColor,
+ ChartHatchStyle backHatchStyle,
+ string backImage,
+ ChartImageWrapMode backImageWrapMode,
+ Color backImageTransparentColor,
+ ChartImageAlignmentStyle backImageAlign,
+ GradientStyle backGradientStyle,
+ Color backSecondaryColor,
+ Color borderColor,
+ int borderWidth,
+ ChartDashStyle borderDashStyle)
+ {
+ Draw3DBorderAbs(borderSkin, GetAbsoluteRectangle(rect), backColor, backHatchStyle,
+ backImage, backImageWrapMode, backImageTransparentColor, backImageAlign, backGradientStyle,
+ backSecondaryColor, borderColor, borderWidth, borderDashStyle);
+ }
+
+
+ /// <summary>
+ /// Draws 3D border in absolute coordinates.
+ /// </summary>
+ /// <param name="borderSkin">Border skin object.</param>
+ /// <param name="absRect">Rectangle of the border (pixel coordinates).</param>
+ /// <param name="backColor">Color of rectangle</param>
+ /// <param name="backHatchStyle">Hatch style</param>
+ /// <param name="backImage">Back Image</param>
+ /// <param name="backImageWrapMode">Image mode</param>
+ /// <param name="backImageTransparentColor">Image transparent color.</param>
+ /// <param name="backImageAlign">Image alignment</param>
+ /// <param name="backGradientStyle">Gradient type </param>
+ /// <param name="backSecondaryColor">Gradient End Color</param>
+ /// <param name="borderColor">Border Color</param>
+ /// <param name="borderWidth">Border Width</param>
+ /// <param name="borderDashStyle">Border Style</param>
+ internal void Draw3DBorderAbs(
+ BorderSkin borderSkin,
+ RectangleF absRect,
+ Color backColor,
+ ChartHatchStyle backHatchStyle,
+ string backImage,
+ ChartImageWrapMode backImageWrapMode,
+ Color backImageTransparentColor,
+ ChartImageAlignmentStyle backImageAlign,
+ GradientStyle backGradientStyle,
+ Color backSecondaryColor,
+ Color borderColor,
+ int borderWidth,
+ ChartDashStyle borderDashStyle)
+ {
+ // Check input parameters
+ if(_common == null || borderSkin.SkinStyle == BorderSkinStyle.None || absRect.Width == 0 || absRect.Height == 0)
+ {
+ return;
+ }
+
+ // Find required border interface
+ IBorderType borderTypeInterface = _common.BorderTypeRegistry.GetBorderType(borderSkin.SkinStyle.ToString());
+ if(borderTypeInterface != null)
+ {
+ borderTypeInterface.Resolution = this.Graphics.DpiX;
+ // Draw border
+ borderTypeInterface.DrawBorder(this, borderSkin, absRect, backColor, backHatchStyle, backImage, backImageWrapMode,
+ backImageTransparentColor, backImageAlign, backGradientStyle, backSecondaryColor,
+ borderColor, borderWidth, borderDashStyle);
+ }
+ }
+
+ #endregion
+
+ #region Pie Method
+
+ /// <summary>
+ /// Helper function that retrieves pie drawing style.
+ /// </summary>
+ /// <param name="point">Data point to get the drawing style for.</param>
+ /// <returns>pie drawing style.</returns>
+ internal static PieDrawingStyle GetPieDrawingStyle(DataPoint point)
+ {
+ // Get column drawing style
+ PieDrawingStyle pieDrawingStyle = PieDrawingStyle.Default;
+ string styleName = point[CustomPropertyName.PieDrawingStyle];
+ if(styleName != null)
+ {
+ if(String.Compare(styleName, "Default", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ pieDrawingStyle = PieDrawingStyle.Default;
+ }
+ else if (String.Compare(styleName, "SoftEdge", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ pieDrawingStyle = PieDrawingStyle.SoftEdge;
+ }
+ else if (String.Compare(styleName, "Concave", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ pieDrawingStyle = PieDrawingStyle.Concave;
+ }
+ else
+ {
+ throw( new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid( styleName, "PieDrawingStyle")));
+ }
+ }
+ return pieDrawingStyle;
+ }
+
+ /// <summary>
+ /// Draws a pie defined by an ellipse specified by a Rectangle structure and two radial lines.
+ /// </summary>
+ /// <param name="rect">Rectangle structure that represents the bounding rectangle that defines the ellipse from which the pie shape comes.</param>
+ /// <param name="startAngle">Angle measured in degrees clockwise from the x-axis to the first side of the pie shape.</param>
+ /// <param name="sweepAngle">Angle measured in degrees clockwise from the startAngle parameter to the second side of the pie shape.</param>
+ /// <param name="backColor">Fill color</param>
+ /// <param name="backHatchStyle">Fill Hatch Style</param>
+ /// <param name="backImage">Fill texture</param>
+ /// <param name="backImageWrapMode">Texture image mode</param>
+ /// <param name="backImageTransparentColor">Texture transparent color</param>
+ /// <param name="backGradientStyle">Fill Gradient type </param>
+ /// <param name="backSecondaryColor">Fill Gradient Second Color</param>
+ /// <param name="borderColor">Border Color</param>
+ /// <param name="borderWidth">Border Width</param>
+ /// <param name="borderDashStyle">Border Style</param>
+ /// <param name="shadow">True if shadow is active</param>
+ /// <param name="doughnut">True if Doughnut is drawn instead of pie</param>
+ /// <param name="doughnutRadius">Internal radius of the doughnut</param>
+ /// <param name="pieDrawingStyle">Pie drawing style.</param>
+ internal void DrawPieRel(
+ RectangleF rect,
+ float startAngle,
+ float sweepAngle,
+ Color backColor,
+ ChartHatchStyle backHatchStyle,
+ string backImage,
+ ChartImageWrapMode backImageWrapMode,
+ Color backImageTransparentColor,
+ GradientStyle backGradientStyle,
+ Color backSecondaryColor,
+ Color borderColor,
+ int borderWidth,
+ ChartDashStyle borderDashStyle,
+ bool shadow,
+ bool doughnut,
+ float doughnutRadius,
+ PieDrawingStyle pieDrawingStyle
+ )
+ {
+ Pen borderPen = null; // Pen
+ Brush fillBrush; // Brush
+
+ // Get absolute rectangle
+ RectangleF absRect = GetAbsoluteRectangle( rect );
+
+ if( doughnutRadius == 100.0 )
+ {
+ doughnut = false;
+ }
+
+ if( doughnutRadius == 0.0 )
+ {
+ return;
+ }
+
+ // Create Brush
+ if( backHatchStyle != ChartHatchStyle.None )
+ {
+ // Create Hatch Brush
+ fillBrush = GetHatchBrush( backHatchStyle, backColor, backSecondaryColor );
+ }
+ else if( backGradientStyle != GradientStyle.None )
+ {
+ // Create gradient brush
+ if( backGradientStyle == GradientStyle.Center )
+ {
+ fillBrush = GetPieGradientBrush( absRect, backColor, backSecondaryColor );
+ }
+ else
+ {
+ using (GraphicsPath path = new GraphicsPath())
+ {
+ path.AddPie(absRect.X, absRect.Y, absRect.Width, absRect.Height, startAngle, sweepAngle);
+ fillBrush = GetGradientBrush(path.GetBounds(), backColor, backSecondaryColor, backGradientStyle);
+ }
+ }
+ }
+ else if( backImage.Length > 0 && backImageWrapMode != ChartImageWrapMode.Unscaled && backImageWrapMode != ChartImageWrapMode.Scaled )
+ {
+ // Create textured brush
+ fillBrush = GetTextureBrush(backImage, backImageTransparentColor, backImageWrapMode, backColor );
+ }
+ else
+ {
+ // Create solid brush
+ fillBrush = new SolidBrush( backColor );
+ }
+
+ // Create border Pen
+ borderPen = new Pen( borderColor, borderWidth );
+
+ // Set a border line style
+ borderPen.DashStyle = GetPenStyle( borderDashStyle );
+
+ // Use rounded line joins
+ borderPen.LineJoin = LineJoin.Round;
+
+ // Draw Doughnut
+ if( doughnut )
+ {
+ using (GraphicsPath path = new GraphicsPath())
+ {
+
+ path.AddArc(absRect.X + absRect.Width * doughnutRadius / 200 - 1, absRect.Y + absRect.Height * doughnutRadius / 200 - 1, absRect.Width - absRect.Width * doughnutRadius / 100 + 2, absRect.Height - absRect.Height * doughnutRadius / 100 + 2, startAngle, sweepAngle);
+ path.AddArc(absRect.X, absRect.Y, absRect.Width, absRect.Height, startAngle + sweepAngle, -sweepAngle);
+
+ path.CloseFigure();
+
+ this.FillPath(fillBrush, path);
+
+
+ // Draw Pie gradien effects
+ this.DrawPieGradientEffects(pieDrawingStyle, absRect, startAngle, sweepAngle, doughnutRadius);
+
+ // Draw Doughnut Border
+ if (!shadow &&
+ borderWidth > 0 &&
+ borderDashStyle != ChartDashStyle.NotSet)
+ {
+ this.DrawPath(borderPen, path);
+ }
+ }
+ }
+ else // Draw Pie
+ {
+
+ // Draw Soft shadow for pie slice
+ if( shadow && softShadows )
+ {
+ DrawPieSoftShadow( startAngle, sweepAngle, absRect, backColor );
+ }
+ else
+ {
+ // Fill Pie for normal shadow or colored pie slice
+ this.FillPie( fillBrush, absRect.X, absRect.Y, absRect.Width, absRect.Height, startAngle, sweepAngle );
+
+ // Draw Pie gradien effects
+ this.DrawPieGradientEffects( pieDrawingStyle, absRect, startAngle, sweepAngle, -1f);
+ }
+
+
+ // Draw Pie Border
+ if( !shadow &&
+ borderWidth > 0 &&
+ borderDashStyle != ChartDashStyle.NotSet)
+ {
+ this.DrawPie( borderPen, absRect.X, absRect.Y, absRect.Width, absRect.Height, startAngle, sweepAngle );
+ }
+ }
+
+ // Dispose graphics objects
+ if( borderPen != null )
+ {
+ borderPen.Dispose();
+ }
+
+ if( fillBrush != null )
+ {
+ fillBrush.Dispose();
+ }
+ }
+
+ private void DrawPieGradientEffects(
+ PieDrawingStyle pieDrawingStyle,
+ RectangleF position,
+ float startAngle,
+ float sweepAngle,
+ float doughnutRadius)
+ {
+ if(pieDrawingStyle == PieDrawingStyle.Concave)
+ {
+ // Calculate the size of the shadow. Note: For Doughnut chart shadow is drawn
+ // twice on the outside and inside radius.
+ float minSize = (float)Math.Min(position.Width, position.Height);
+ float shadowSize = minSize * 0.05f;
+
+ // Create brush path
+ RectangleF gradientPath = position;
+ gradientPath.Inflate(-shadowSize, -shadowSize);
+ using(GraphicsPath brushPath = new GraphicsPath())
+ {
+ brushPath.AddEllipse(gradientPath);
+
+ // Create shadow path
+ using(GraphicsPath path = new GraphicsPath())
+ {
+ if(doughnutRadius < 0f)
+ {
+ path.AddPie(Rectangle.Round(gradientPath), startAngle, sweepAngle);
+ }
+ else
+ {
+ path.AddArc(
+ gradientPath.X + position.Width * doughnutRadius /200 - 1 - shadowSize,
+ gradientPath.Y + position.Height * doughnutRadius /200 - 1 - shadowSize,
+ gradientPath.Width - position.Width * doughnutRadius / 100 + 2 + 2f * shadowSize,
+ gradientPath.Height - position.Height * doughnutRadius / 100 + 2 + 2f * shadowSize,
+ startAngle,
+ sweepAngle );
+ path.AddArc( gradientPath.X, gradientPath.Y, gradientPath.Width, gradientPath.Height, startAngle + sweepAngle, -sweepAngle );
+ }
+
+ // Create linear gradient brush
+ gradientPath.Inflate(1f, 1f);
+ using(LinearGradientBrush brush = new LinearGradientBrush(
+ gradientPath,
+ Color.Red,
+ Color.Green,
+ LinearGradientMode.Vertical) )
+ {
+ ColorBlend colorBlend = new ColorBlend(3);
+ colorBlend.Colors[0] = Color.FromArgb(100, Color.Black);
+ colorBlend.Colors[1] = Color.Transparent;
+ colorBlend.Colors[2] = Color.FromArgb(140, Color.White);
+ colorBlend.Positions[0] = 0f;
+ colorBlend.Positions[1] = 0.5f;
+ colorBlend.Positions[2] = 1f;
+ brush.InterpolationColors = colorBlend;
+
+ // Fill shadow
+ this.FillPath( brush, path );
+
+ }
+ }
+ }
+ }
+ else if(pieDrawingStyle == PieDrawingStyle.SoftEdge)
+ {
+ // Calculate the size of the shadow. Note: For Doughnut chart shadow is drawn
+ // twice on the outside and inside radius.
+ float minSize = (float)Math.Min(position.Width, position.Height);
+ float shadowSize = minSize/10f;
+ if(doughnutRadius > 0f)
+ {
+ shadowSize = (minSize * doughnutRadius / 100f) / 8f;
+ }
+
+ // Create brush path
+ using(GraphicsPath brushPath = new GraphicsPath())
+ {
+ brushPath.AddEllipse(position);
+
+ // Create shadow path
+ using(GraphicsPath path = new GraphicsPath())
+ {
+ path.AddArc( position.X + shadowSize, position.Y + shadowSize, position.Width - shadowSize * 2f, position.Height - shadowSize * 2f, startAngle, sweepAngle );
+ path.AddArc( position.X, position.Y, position.Width, position.Height, startAngle + sweepAngle, -sweepAngle );
+ path.CloseFigure();
+
+ // Create shadow brush
+ using( PathGradientBrush brush = new PathGradientBrush(brushPath) )
+ {
+ brush.CenterColor = Color.Transparent;
+ brush.SurroundColors = new Color[] { Color.FromArgb(100, Color.Black) };
+
+ Blend blend = new Blend(3);
+ blend.Positions[0] = 0f;
+ blend.Factors[0] = 0f;
+ blend.Positions[1] = shadowSize / (minSize / 2f);
+ blend.Factors[1] = 1f;
+ blend.Positions[2] = 1f;
+ blend.Factors[2] = 1f;
+ brush.Blend = blend;
+
+ // Fill shadow
+ this.FillPath( brush, path );
+ }
+ }
+
+ // Draw inner shadow for the doughnut chart
+ if(doughnutRadius > 0f)
+ {
+ // Create brush path
+ using(GraphicsPath brushInsidePath = new GraphicsPath())
+ {
+ RectangleF innerPosition = position;
+ innerPosition.Inflate(- position.Width * doughnutRadius / 200f + shadowSize, -position.Height * doughnutRadius / 200f + shadowSize);
+ brushInsidePath.AddEllipse(innerPosition);
+
+ // Create shadow path
+ using(GraphicsPath path = new GraphicsPath())
+ {
+ path.AddArc( innerPosition.X + shadowSize, innerPosition.Y + shadowSize, innerPosition.Width - 2f * shadowSize, innerPosition.Height - 2f * shadowSize, startAngle, sweepAngle );
+ path.AddArc( innerPosition.X, innerPosition.Y, innerPosition.Width, innerPosition.Height, startAngle + sweepAngle, -sweepAngle );
+ path.CloseFigure();
+
+ // Create shadow brush
+ using( PathGradientBrush brushInner = new PathGradientBrush(brushInsidePath) )
+ {
+ brushInner.CenterColor = Color.FromArgb(100, Color.Black);
+ brushInner.SurroundColors = new Color[] { Color.Transparent };
+
+ Blend blend = new Blend(3);
+ blend.Positions[0] = 0f;
+ blend.Factors[0] = 0f;
+ blend.Positions[1] = shadowSize / (innerPosition.Width / 2f);
+ blend.Factors[1] = 1f;
+ blend.Positions[2] = 1f;
+ blend.Factors[2] = 1f;
+ brushInner.Blend = blend;
+
+ // Fill shadow
+ this.FillPath( brushInner, path );
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// The soft shadow of the pie
+ /// </summary>
+ /// <param name="startAngle">Angle measured in degrees clockwise from the x-axis to the first side of the pie shape.</param>
+ /// <param name="sweepAngle">Angle measured in degrees clockwise from the startAngle parameter to the second side of the pie shape.</param>
+ /// <param name="absRect">Rectangle of the pie in absolute coordinates</param>
+ /// <param name="backColor">Fill color</param>
+ private void DrawPieSoftShadow( float startAngle, float sweepAngle, RectangleF absRect, Color backColor )
+ {
+ GraphicsPath path = new GraphicsPath();
+
+ path.AddEllipse( absRect.X, absRect.Y, absRect.Width, absRect.Height );
+
+ PathGradientBrush brush = new PathGradientBrush( path );
+
+ Color[] colors = {
+ Color.FromArgb( 0, backColor ),
+ Color.FromArgb( backColor.A, backColor ),
+ Color.FromArgb( backColor.A, backColor )};
+
+ float[] relativePositions = {
+ 0f,
+ 0.05f,
+ 1.0f}; // at the center point.
+
+ ColorBlend colorBlend = new ColorBlend();
+ colorBlend.Colors = colors;
+ colorBlend.Positions = relativePositions;
+ brush.InterpolationColors = colorBlend;
+
+ this.FillPie( brush, absRect.X, absRect.Y, absRect.Width, absRect.Height, startAngle, sweepAngle );
+ }
+
+ #endregion
+
+ #region Arrow Methods
+
+ /// <summary>
+ /// Draw Arrow.
+ /// </summary>
+ /// <param name="position">Position of the arrow</param>
+ /// <param name="orientation">Orientation of the arrow - left, right, top, bottom </param>
+ /// <param name="type">Arrow style: Triangle, Sharp Triangle, Lines</param>
+ /// <param name="color">Color of the arrow</param>
+ /// <param name="lineWidth">Line width</param>
+ /// <param name="lineDashStyle">Line Dash style</param>
+ /// <param name="shift">Distance from the chart area</param>
+ /// <param name="size">Arrow size</param>
+ internal void DrawArrowRel( PointF position, ArrowOrientation orientation, AxisArrowStyle type, Color color, int lineWidth, ChartDashStyle lineDashStyle, double shift, double size )
+ {
+ // Check if arrow should be drawn
+ if(type == AxisArrowStyle.None)
+ {
+ return;
+ }
+
+ // Set a color
+ using (SolidBrush brush = new SolidBrush(color))
+ {
+ PointF endPoint = PointF.Empty; // End point of axis line
+ PointF[] points; // arrow points
+ PointF absolutePosition; // Absolute position of axis
+
+ absolutePosition = GetAbsolutePoint(position);
+
+ // Arrow type is triangle
+ if (type == AxisArrowStyle.Triangle)
+ {
+ points = GetArrowShape(absolutePosition, orientation, shift, size, type, ref endPoint);
+
+ endPoint = GetRelativePoint(endPoint);
+
+ // Draw center line
+ DrawLineRel(color, lineWidth, lineDashStyle, position, endPoint);
+
+ // Draw arrow
+ this.FillPolygon(brush, points);
+
+ }
+ // Arrow type is sharp triangle
+ else if (type == AxisArrowStyle.SharpTriangle)
+ {
+ points = GetArrowShape(absolutePosition, orientation, shift, size, type, ref endPoint);
+
+ endPoint = GetRelativePoint(endPoint);
+
+ // Draw center line
+ DrawLineRel(color, lineWidth, lineDashStyle, position, endPoint);
+
+ // Draw arrow
+ this.FillPolygon(brush, points);
+
+ }
+ // Arrow type is 'Lines'
+ else if (type == AxisArrowStyle.Lines)
+ {
+ points = GetArrowShape(absolutePosition, orientation, shift, size, type, ref endPoint);
+
+ points[0] = GetRelativePoint(points[0]);
+ points[1] = GetRelativePoint(points[1]);
+ points[2] = GetRelativePoint(points[2]);
+
+ endPoint = GetRelativePoint(endPoint);
+
+ // Draw arrow
+ DrawLineRel(color, lineWidth, lineDashStyle, position, endPoint);
+ DrawLineRel(color, lineWidth, lineDashStyle, points[0], points[2]);
+ DrawLineRel(color, lineWidth, lineDashStyle, points[1], points[2]);
+
+ }
+ }
+ }
+
+ /// <summary>
+ /// This function calculates points for polygon, which represents
+ /// shape of an arrow. There are four different orientations
+ /// of arrow and three arrow types.
+ /// </summary>
+ /// <param name="position">Arrow position</param>
+ /// <param name="orientation">Arrow orientation ( Left, Right, Top, Bottom )</param>
+ /// <param name="shift">Distance from chart area to the arrow</param>
+ /// <param name="size">Arrow size</param>
+ /// <param name="type">Arrow style.</param>
+ /// <param name="endPoint">End point of the axis and the beginning of arrow</param>
+ /// <returns>Polygon points</returns>
+ private PointF[] GetArrowShape( PointF position, ArrowOrientation orientation, double shift, double size, AxisArrowStyle type, ref PointF endPoint )
+ {
+ PointF[] points = new PointF[3]; // Polygon points
+ double sharp; // Size for sharp triangle
+
+ // Four different orientations for AxisArrowStyle
+ switch( orientation )
+ {
+ // Top orientation
+ case ArrowOrientation.Top:
+ // Get absolute size for arrow
+ // Arrow size has to have the same shape when width and height
+ // are changed. When the picture is resized, width of the chart
+ // picture is used only for arrow size.
+ size = GetAbsoluteSize( new SizeF((float)size, (float)size) ).Width;
+ shift = GetAbsoluteSize( new SizeF((float)shift,(float)shift) ).Height;
+
+ // Size for sharp and regular triangle
+ if( type == AxisArrowStyle.SharpTriangle )
+ sharp = size * 4;
+ else
+ sharp = size * 2;
+
+ points[0].X = position.X - (float)size;
+ points[0].Y = position.Y - (float)shift;
+ points[1].X = position.X + (float)size;
+ points[1].Y = position.Y - (float)shift;
+ points[2].X = position.X;
+ points[2].Y = position.Y - (float)shift - (float)sharp;
+ // End of the axis line
+ endPoint.X = position.X;
+ if( type == AxisArrowStyle.SharpTriangle || type == AxisArrowStyle.Triangle )
+ endPoint.Y = points[1].Y;
+ else
+ endPoint.Y = points[2].Y;
+
+ break;
+ // Bottom orientation
+ case ArrowOrientation.Bottom:
+ // Get absolute size for arrow
+ // Arrow size has to have the same shape when width and height
+ // are changed. When the picture is resized, width of the chart
+ // picture is used only for arrow size.
+ size = GetAbsoluteSize( new SizeF((float)size, (float)size) ).Width;
+ shift = GetAbsoluteSize( new SizeF((float)shift,(float)shift) ).Height;
+
+ // Size for sharp and regular triangle
+ if( type == AxisArrowStyle.SharpTriangle )
+ sharp = size * 4;
+ else
+ sharp = size * 2;
+
+ points[0].X = position.X - (float)size;
+ points[0].Y = position.Y + (float)shift;
+ points[1].X = position.X + (float)size;
+ points[1].Y = position.Y + (float)shift;
+ points[2].X = position.X;
+ points[2].Y = position.Y + (float)shift + (float)sharp;
+ // End of the axis line
+ endPoint.X = position.X;
+ if( type == AxisArrowStyle.SharpTriangle || type == AxisArrowStyle.Triangle )
+ endPoint.Y = points[1].Y;
+ else
+ endPoint.Y = points[2].Y;
+ break;
+ // Left orientation
+ case ArrowOrientation.Left:
+ // Get absolute size for arrow
+ size = GetAbsoluteSize( new SizeF((float)size, (float)size) ).Width;
+ shift = GetAbsoluteSize( new SizeF((float)shift,(float)shift) ).Width;
+
+ // Size for sharp and regular triangle
+ if( type == AxisArrowStyle.SharpTriangle )
+ sharp = size * 4;
+ else
+ sharp = size * 2;
+
+ points[0].Y = position.Y - (float)size;
+ points[0].X = position.X - (float)shift;
+ points[1].Y = position.Y + (float)size;
+ points[1].X = position.X - (float)shift;
+ points[2].Y = position.Y;
+ points[2].X = position.X - (float)shift - (float)sharp;
+ // End of the axis line
+ endPoint.Y = position.Y;
+ if( type == AxisArrowStyle.SharpTriangle || type == AxisArrowStyle.Triangle )
+ endPoint.X = points[1].X;
+ else
+ endPoint.X = points[2].X;
+ break;
+ // Right orientation
+ case ArrowOrientation.Right:
+ // Get absolute size for arrow
+ size = GetAbsoluteSize( new SizeF((float)size, (float)size) ).Width;
+ shift = GetAbsoluteSize( new SizeF((float)shift,(float)shift) ).Width;
+
+ // Size for sharp and regular triangle
+ if( type == AxisArrowStyle.SharpTriangle )
+ sharp = size * 4;
+ else
+ sharp = size * 2;
+
+ points[0].Y = position.Y - (float)size;
+ points[0].X = position.X + (float)shift;
+ points[1].Y = position.Y + (float)size;
+ points[1].X = position.X + (float)shift;
+ points[2].Y = position.Y;
+ points[2].X = position.X + (float)shift + (float)sharp;
+ // End of the axis line
+ endPoint.Y = position.Y;
+ if( type == AxisArrowStyle.SharpTriangle || type == AxisArrowStyle.Triangle )
+ endPoint.X = points[1].X;
+ else
+ endPoint.X = points[2].X;
+ break;
+ }
+
+ return points;
+ }
+
+ #endregion
+
+ #region Other methods and properties
+
+ /// <summary>
+ /// Helper function that retrieves bar drawing style.
+ /// </summary>
+ /// <param name="point">Data point to get the drawing style for.</param>
+ /// <returns>Bar drawing style.</returns>
+ internal static BarDrawingStyle GetBarDrawingStyle(DataPoint point)
+ {
+ // Get column drawing style
+ BarDrawingStyle barDrawingStyle = BarDrawingStyle.Default;
+ string styleName = point[CustomPropertyName.DrawingStyle];
+ if(styleName != null)
+ {
+ if(String.Compare(styleName, "Default", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ barDrawingStyle = BarDrawingStyle.Default;
+ }
+ else if (String.Compare(styleName, "Cylinder", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ barDrawingStyle = BarDrawingStyle.Cylinder;
+ }
+ else if (String.Compare(styleName, "Emboss", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ barDrawingStyle = BarDrawingStyle.Emboss;
+ }
+ else if (String.Compare(styleName, "LightToDark", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ barDrawingStyle = BarDrawingStyle.LightToDark;
+ }
+ else if (String.Compare(styleName, "Wedge", StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ barDrawingStyle = BarDrawingStyle.Wedge;
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid(styleName, "DrawingStyle")));
+ }
+ }
+ return barDrawingStyle;
+ }
+
+
+ /// <summary>
+ /// Find rounding coordinates for a rectangle
+ /// </summary>
+ /// <param name="rect">Rectangle which has to be rounded</param>
+ /// <returns>Rounded rectangle</returns>
+ internal RectangleF Round(RectangleF rect)
+ {
+ float left = (float)Math.Round( (double)rect.Left );
+ float right = (float)Math.Round( (double)rect.Right );
+ float top = (float)Math.Round( (double)rect.Top );
+ float bottom = (float)Math.Round( (double)rect.Bottom );
+
+ return new RectangleF( left, top, right - left, bottom - top );
+ }
+
+ /// <summary>
+ /// This method takes a given axis value for a specified axis and returns the relative pixel value.
+ /// </summary>
+ /// <param name="chartAreaName">Chart area name.</param>
+ /// <param name="axis">An AxisName enum value that identifies the relevant axis.</param>
+ /// <param name="axisValue">The axis value that needs to be converted to a relative pixel value.</param>
+ /// <returns>The converted axis value, in relative pixel coordinates.</returns>
+ public double GetPositionFromAxis( string chartAreaName, AxisName axis, double axisValue )
+ {
+ if( axis == AxisName.X )
+ return _common.ChartPicture.ChartAreas[chartAreaName].AxisX.GetLinearPosition( axisValue );
+
+ if( axis == AxisName.X2 )
+ return _common.ChartPicture.ChartAreas[chartAreaName].AxisX2.GetLinearPosition( axisValue );
+
+ if( axis == AxisName.Y )
+ return _common.ChartPicture.ChartAreas[chartAreaName].AxisY.GetLinearPosition( axisValue );
+
+ if( axis == AxisName.Y2 )
+ return _common.ChartPicture.ChartAreas[chartAreaName].AxisY2.GetLinearPosition( axisValue );
+
+ return 0;
+ }
+
+ /// <summary>
+ /// Set picture size
+ /// </summary>
+ /// <param name="width">Width</param>
+ /// <param name="height">Height</param>
+ internal void SetPictureSize( int width, int height )
+ {
+ this._width = width;
+ this._height = height;
+ }
+
+ /// <summary>
+ /// Constructor
+ /// </summary>
+ /// <param name="common">Common elements class</param>
+ internal ChartGraphics(CommonElements common)
+ {
+ // Set Common elements
+ this._common = common;
+ base.Common = common;
+ // Create a pen object
+ _pen = new Pen(Color.Black);
+
+ // Create a brush object
+ _solidBrush = new SolidBrush(Color.Black);
+ }
+
+ /// <summary>
+ /// Chart Graphics Anti alias mode
+ /// </summary>
+ internal AntiAliasingStyles AntiAliasing
+ {
+ get
+ {
+ return _antiAliasing;
+ }
+ set
+ {
+ _antiAliasing = value;
+
+ // Graphics mode not set
+ if( Graphics == null )
+ return;
+
+ // Convert Chart's anti alias enumeration to GDI+ SmoothingMode
+ if( (_antiAliasing & AntiAliasingStyles.Graphics) == AntiAliasingStyles.Graphics )
+ {
+ this.SmoothingMode = SmoothingMode.AntiAlias;
+ }
+ else
+ {
+ this.SmoothingMode = SmoothingMode.None;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets reusable pen.
+ /// </summary>
+ internal Pen Pen
+ {
+ get { return _pen; }
+ }
+
+ /// <summary>
+ /// Sets the clipping region of this Graphics object
+ /// to the rectangle specified by a RectangleF structure.
+ /// </summary>
+ /// <param name="region">Region rectangle</param>
+ internal void SetClip( RectangleF region )
+ {
+ this.SetClipAbs( GetAbsoluteRectangle( region ) );
+ }
+
+ #endregion
+
+ #region Color manipulation methods
+
+ /// <summary>
+ /// Returns the gradient color from a gradient position.
+ /// </summary>
+ /// <param name="beginColor">The color from the gradient beginning</param>
+ /// <param name="endColor">The color from the gradient end.</param>
+ /// <param name="relativePosition">The relative position.</param>
+ /// <returns>Result color.</returns>
+ static internal Color GetGradientColor(Color beginColor, Color endColor, double relativePosition)
+ {
+ // Check if position is valid
+ if(relativePosition < 0 || relativePosition > 1 || double.IsNaN(relativePosition))
+ {
+ return beginColor;
+ }
+
+ // Extracts Begin color
+ int nBRed = beginColor.R;
+ int nBGreen = beginColor.G;
+ int nBBlue = beginColor.B;
+
+ // Extracts End color
+ int nERed = endColor.R;
+ int nEGreen = endColor.G;
+ int nEBlue = endColor.B;
+
+ // Gradient positions for Red, Green and Blue colors
+ double dRRed = nBRed + (nERed - nBRed) * relativePosition;
+ double dRGreen = nBGreen + (nEGreen - nBGreen) * relativePosition;
+ double dRBlue = nBBlue + (nEBlue - nBBlue) * relativePosition;
+
+ // Make sure colors are in range from 0 to 255
+ if(dRRed > 255.0)
+ dRRed = 255.0;
+ if(dRRed < 0.0)
+ dRRed = 0.0;
+ if(dRGreen > 255.0)
+ dRGreen = 255.0;
+ if(dRGreen < 0.0)
+ dRGreen = 0.0;
+ if(dRBlue > 255.0)
+ dRBlue = 255.0;
+ if(dRBlue < 0.0)
+ dRBlue = 0.0;
+
+ // Return a gradient color position
+ return Color.FromArgb(beginColor.A, (int)dRRed, (int)dRGreen, (int)dRBlue);
+ }
+
+ #endregion
+
+ #region RightToLeft
+ /// <summary>
+ /// Returns chart right to left flag
+ /// </summary>
+ internal bool IsRightToLeft
+ {
+ get
+ {
+ if (Common == null)
+ {
+ return false;
+ }
+ return Common.ChartPicture.RightToLeft == RightToLeft.Yes;
+ }
+ }
+
+ #endregion //RightToLeft
+
+ #region IDisposable Members
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ // Free up managed resources
+ if (_pen != null)
+ {
+ _pen.Dispose();
+ _pen = null;
+ }
+ if (_solidBrush != null)
+ {
+ _solidBrush.Dispose();
+ _solidBrush = null;
+ }
+ if (_myMatrix != null)
+ {
+ _myMatrix.Dispose();
+ _myMatrix = null;
+ }
+ }
+ base.Dispose(disposing);
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartGraphics3D.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartGraphics3D.cs
new file mode 100644
index 00000000000..ea11fb0fa49
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartGraphics3D.cs
@@ -0,0 +1,4735 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: ChartGraphics3D.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: ChartGraphics3D, Point3D
+//
+// Purpose: ChartGraphics3D class is 3D chart rendering engine.
+// All chart 3D shapes are drawn in specific order so
+// that correct Z order of all shapes is achieved. 3D
+// graphics engine do not support shapes intersection.
+// 3D shapes are transformed into one or more 2D shapes
+// and then drawn with 2D chart graphics engine.
+//
+// Reviewed: AG - Microsoft 16, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Drawing.Text;
+using System.Drawing.Imaging;
+using System.ComponentModel;
+using System.Collections;
+using System.Diagnostics.CodeAnalysis;
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ #region 3D enumerations
+
+ /// <summary>
+ /// 3D cube surfaces names.
+ /// </summary>
+ [Flags]
+ internal enum SurfaceNames
+ {
+ /// <summary>
+ /// Front.
+ /// </summary>
+ Front = 1,
+ /// <summary>
+ /// Back.
+ /// </summary>
+ Back = 2,
+ /// <summary>
+ /// Left.
+ /// </summary>
+ Left = 4,
+ /// <summary>
+ /// Right.
+ /// </summary>
+ Right = 8,
+ /// <summary>
+ /// Top.
+ /// </summary>
+ Top = 16,
+ /// <summary>
+ /// Bottom.
+ /// </summary>
+ Bottom = 32
+ }
+
+ /// <summary>
+ /// This enumeration defines all significant points in a pie
+ /// slice. Only these points should be transformed for pie
+ /// chart using Matrix object.
+ /// </summary>
+ internal enum PiePoints
+ {
+ /// <summary>
+ /// Angle 180 Top point on the arc
+ /// </summary>
+ Top180,
+
+ /// <summary>
+ /// Angle 180 Bottom point on the arc
+ /// </summary>
+ Bottom180,
+
+ /// <summary>
+ /// Angle 0 Top point on the arc
+ /// </summary>
+ Top0,
+
+ /// <summary>
+ /// Angle 0 Bottom point on the arc
+ /// </summary>
+ Bottom0,
+
+ /// <summary>
+ /// Top Start Angle point on the arc
+ /// </summary>
+ TopStart,
+
+ /// <summary>
+ /// Top End Angle point on the arc
+ /// </summary>
+ TopEnd,
+
+ /// <summary>
+ /// Bottom Start Angle point on the arc
+ /// </summary>
+ BottomStart,
+
+ /// <summary>
+ /// Bottom End Angle point on the arc
+ /// </summary>
+ BottomEnd,
+
+ /// <summary>
+ /// Center Top
+ /// </summary>
+ TopCenter,
+
+ /// <summary>
+ /// Center Bottom
+ /// </summary>
+ BottomCenter,
+
+ /// <summary>
+ /// Top Label Line
+ /// </summary>
+ TopLabelLine,
+
+ /// <summary>
+ /// Top Label Line Out
+ /// </summary>
+ TopLabelLineout,
+
+ /// <summary>
+ /// Top Label Center
+ /// </summary>
+ TopLabelCenter,
+
+ /// <summary>
+ /// Top Rectangle Top Left Point
+ /// </summary>
+ TopRectTopLeftPoint,
+
+ /// <summary>
+ /// Top Rectangle Right Bottom Point
+ /// </summary>
+ TopRectBottomRightPoint,
+
+ /// <summary>
+ /// Bottom Rectangle Top Left Point
+ /// </summary>
+ BottomRectTopLeftPoint,
+
+ /// <summary>
+ /// Bottom Rectangle Right Bottom Point
+ /// </summary>
+ BottomRectBottomRightPoint,
+
+ /// <summary>
+ /// Angle 180 Top point on the Doughnut arc
+ /// </summary>
+ DoughnutTop180,
+
+ /// <summary>
+ /// Angle 180 Bottom point on the Doughnut arc
+ /// </summary>
+ DoughnutBottom180,
+
+ /// <summary>
+ /// Angle 0 Top point on the Doughnut arc
+ /// </summary>
+ DoughnutTop0,
+
+ /// <summary>
+ /// Angle 0 Bottom point on the Doughnut arc
+ /// </summary>
+ DoughnutBottom0,
+
+ /// <summary>
+ /// Top Start Angle point on the Doughnut arc
+ /// </summary>
+ DoughnutTopStart,
+
+ /// <summary>
+ /// Top End Angle point on the Doughnut arc
+ /// </summary>
+ DoughnutTopEnd,
+
+ /// <summary>
+ /// Bottom Start Angle point on the Doughnut arc
+ /// </summary>
+ DoughnutBottomStart,
+
+ /// <summary>
+ /// Bottom End Angle point on the Doughnut arc
+ /// </summary>
+ DoughnutBottomEnd,
+
+ /// <summary>
+ /// Doughnut Top Rectangle Top Left Point
+ /// </summary>
+ DoughnutTopRectTopLeftPoint,
+
+ /// <summary>
+ /// Doughnut Top Rectangle Right Bottom Point
+ /// </summary>
+ DoughnutTopRectBottomRightPoint,
+
+ /// <summary>
+ /// Doughnut Bottom Rectangle Top Left Point
+ /// </summary>
+ DoughnutBottomRectTopLeftPoint,
+
+ /// <summary>
+ /// Doughnut Bottom Rectangle Right Bottom Point
+ /// </summary>
+ DoughnutBottomRectBottomRightPoint,
+ }
+
+
+ /// <summary>
+ /// AxisName of drawing operation.
+ /// </summary>
+ [Flags]
+ internal enum DrawingOperationTypes
+ {
+ /// <summary>
+ /// Draw element.
+ /// </summary>
+ DrawElement = 1,
+
+ /// <summary>
+ /// Calculate element path. (for selection or tooltips)
+ /// </summary>
+ CalcElementPath = 2,
+ }
+
+ /// <summary>
+ /// AxisName of line segment.
+ /// </summary>
+ internal enum LineSegmentType
+ {
+ /// <summary>
+ /// Only one segment exists.
+ /// </summary>
+ Single,
+
+ /// <summary>
+ /// First segment.
+ /// </summary>
+ First,
+
+ /// <summary>
+ /// Middle segment.
+ /// </summary>
+ Middle,
+
+ /// <summary>
+ /// Last segment.
+ /// </summary>
+ Last
+ }
+
+ #endregion
+
+ /// <summary>
+ /// The ChartGraphics class is 3D chart rendering engine. All chart
+ /// 3D shapes are drawn in specific order so that correct Z order
+ /// of all shapes is achieved. 3D graphics engine do not support
+ /// shapes intersection. 3D shapes are transformed into one or
+ /// more 2D shapes and then drawn with 2D chart graphics engine.
+ /// </summary>
+ public partial class ChartGraphics
+ {
+ #region Fields
+
+ /// <summary>
+ /// Helper field used to store the index of cylinder left/bottom side coordinate.
+ /// </summary>
+ private int _oppLeftBottomPoint = -1;
+
+ /// <summary>
+ /// Helper field used to store the index of cylinder right/top side coordinate.
+ /// </summary>
+ private int _oppRigthTopPoint = -1;
+
+ /// <summary>
+ /// Point of the front line from the previous line segment.
+ /// </summary>
+ internal PointF frontLinePoint1 = PointF.Empty;
+
+ /// <summary>
+ /// Point of the front line from the previous line segment.
+ /// </summary>
+ internal PointF frontLinePoint2 = PointF.Empty;
+
+ /// <summary>
+ /// Previous line segment pen.
+ /// </summary>
+ internal Pen frontLinePen = null;
+
+ #endregion
+
+ #region 3D Line drawing methods
+
+ /// <summary>
+ /// Draws grid line in 3D space (on two area scene walls)
+ /// </summary>
+ /// <param name="area">Chart area.</param>
+ /// <param name="color">Line color.</param>
+ /// <param name="width">Line width.</param>
+ /// <param name="style">Line style.</param>
+ /// <param name="point1">First line point.</param>
+ /// <param name="point2">Second line point.</param>
+ /// <param name="horizontal">Indicates that grid line is horizontal</param>
+ /// <param name="common">Common Elements</param>
+ /// <param name="obj">Selected object</param>
+ internal void Draw3DGridLine(
+ ChartArea area,
+ Color color,
+ int width,
+ ChartDashStyle style,
+ PointF point1,
+ PointF point2,
+ bool horizontal,
+ CommonElements common,
+ object obj
+ )
+ {
+ float zPositon = area.IsMainSceneWallOnFront() ? area.areaSceneDepth : 0f;
+
+ ChartElementType chartElementType = obj is StripLine ? ChartElementType.StripLines : ChartElementType.Gridlines;
+
+ // Draw strip line on the back/front wall
+ ((ChartGraphics)this).Draw3DLine(
+ area.matrix3D,
+ color, width, style,
+ new Point3D(point1.X, point1.Y, zPositon),
+ new Point3D(point2.X, point2.Y, zPositon),
+ common,
+ obj,
+ chartElementType
+ );
+
+ if(horizontal)
+ {
+ // Draw strip line on the side wall (left or right)
+ if(area.IsSideSceneWallOnLeft())
+ {
+ point1.X = Math.Min(point1.X, point2.X);
+ }
+ else
+ {
+ point1.X = Math.Max(point1.X, point2.X);
+ }
+
+ ((ChartGraphics)this).Draw3DLine(
+ area.matrix3D,
+ color, width, style,
+ new Point3D(point1.X, point1.Y, 0f),
+ new Point3D(point1.X, point1.Y, area.areaSceneDepth),
+ common,
+ obj,
+ chartElementType
+ );
+
+ }
+ else if(area.IsBottomSceneWallVisible())
+ {
+ // Draw strip line on the bottom wall (if visible)
+ point1.Y = Math.Max(point1.Y, point2.Y);
+
+ ((ChartGraphics)this).Draw3DLine(
+ area.matrix3D,
+ color, width, style,
+ new Point3D(point1.X, point1.Y, 0f),
+ new Point3D(point1.X, point1.Y, area.areaSceneDepth),
+ common,
+ obj,
+ chartElementType
+ );
+ }
+ }
+
+ /// <summary>
+ /// Draws a line connecting the two specified points.
+ /// </summary>
+ /// <param name="matrix">Coordinates transformation matrix.</param>
+ /// <param name="color">Line color.</param>
+ /// <param name="width">Line width.</param>
+ /// <param name="style">Line style.</param>
+ /// <param name="firstPoint">A Point that represents the first point to connect.</param>
+ /// <param name="secondPoint">A Point that represents the second point to connect.</param>
+ /// <param name="common">Common elements</param>
+ /// <param name="obj">Selected object</param>
+ /// <param name="type">Selected chart element</param>
+ internal void Draw3DLine(
+ Matrix3D matrix,
+ Color color,
+ int width,
+ ChartDashStyle style,
+ Point3D firstPoint,
+ Point3D secondPoint,
+ CommonElements common,
+ object obj,
+ ChartElementType type
+ )
+ {
+
+ // Transform coordinates
+ Point3D [] points = new Point3D[] {firstPoint, secondPoint};
+ matrix.TransformPoints( points );
+
+ // Selection mode
+ if (common.ProcessModeRegions && type != ChartElementType.Nothing)
+ {
+ using (GraphicsPath path = new GraphicsPath())
+ {
+
+ if (Math.Abs(points[0].X - points[1].X) > Math.Abs(points[0].Y - points[1].Y))
+ {
+ path.AddLine(points[0].X, points[0].Y - 1, points[1].X, points[1].Y - 1);
+ path.AddLine(points[1].X, points[1].Y + 1, points[0].X, points[0].Y + 1);
+ path.CloseAllFigures();
+ }
+ else
+ {
+ path.AddLine(points[0].X - 1, points[0].Y, points[1].X - 1, points[1].Y);
+ path.AddLine(points[1].X + 1, points[1].Y, points[0].X + 1, points[0].Y);
+ path.CloseAllFigures();
+
+ }
+ common.HotRegionsList.AddHotRegion(path, true, type, obj);
+ }
+ }
+
+ if( common.ProcessModePaint )
+ {
+ // Draw 2D line in 3D space
+ ((ChartGraphics)this).DrawLineRel(color, width, style, points[0].PointF, points[1].PointF);
+ }
+
+ }
+
+ #endregion
+
+ #region 3D Pie Drawing methods and enumerations
+
+
+ /// <summary>
+ /// This method draw and fill four point polygons which
+ /// represents sides of a pie slice.
+ /// </summary>
+ /// <param name="area">Chart Area</param>
+ /// <param name="inclination">X angle rotation</param>
+ /// <param name="startAngle">Start Angle of a pie slice</param>
+ /// <param name="sweepAngle">Sweep angle of a pie slice</param>
+ /// <param name="points">Significant points of a pie slice</param>
+ /// <param name="brush">Brush used for fill</param>
+ /// <param name="pen">Pen used for drawing</param>
+ /// <param name="doughnut">Chart AxisName is Doughnut</param>
+ internal void FillPieSides(
+ ChartArea area,
+ float inclination,
+ float startAngle,
+ float sweepAngle,
+ PointF [] points,
+ SolidBrush brush,
+ Pen pen,
+ bool doughnut
+ )
+ {
+
+ // Create a graphics path
+ GraphicsPath path = new GraphicsPath();
+
+ // Significant Points for Side polygons
+ PointF topCenter = points[(int)PiePoints.TopCenter];
+ PointF bottomCenter = points[(int)PiePoints.BottomCenter];
+ PointF topStart = points[(int)PiePoints.TopStart];
+ PointF bottomStart = points[(int)PiePoints.BottomStart];
+ PointF topEnd = points[(int)PiePoints.TopEnd];
+ PointF bottomEnd = points[(int)PiePoints.BottomEnd];
+
+ // For Doughnut
+ PointF topDoughnutStart = PointF.Empty;
+ PointF bottomDoughnutStart = PointF.Empty;
+ PointF topDoughnutEnd = PointF.Empty;
+ PointF bottomDoughnutEnd = PointF.Empty;
+
+ if( doughnut )
+ {
+ // For Doughnut
+ topDoughnutStart = points[(int)PiePoints.DoughnutTopStart];
+ bottomDoughnutStart = points[(int)PiePoints.DoughnutBottomStart];
+ topDoughnutEnd = points[(int)PiePoints.DoughnutTopEnd];
+ bottomDoughnutEnd = points[(int)PiePoints.DoughnutBottomEnd];
+ }
+
+ bool startSide = false;
+ bool endSide = false;
+ float endAngle = startAngle + sweepAngle;
+
+ // If X angle is negative different side of pie slice is visible.
+ if (inclination > 0)
+ {
+ // Enable start or/and the end side
+ if( startAngle > -90 && startAngle < 90 || startAngle > 270 && startAngle < 450 )
+ {
+ startSide = true;
+ }
+ if( endAngle >= -180 && endAngle < -90 || endAngle > 90 && endAngle < 270 || endAngle > 450 && endAngle <= 540 )
+ {
+ endSide = true;
+ }
+ }
+ else
+ {
+ // Enable start or/and the end side
+ if( startAngle >= -180 && startAngle < -90 || startAngle > 90 && startAngle < 270 || startAngle > 450 && startAngle <= 540 )
+ {
+ startSide = true;
+
+ }
+ if( endAngle > -90 && endAngle < 90 || endAngle > 270 && endAngle < 450 )
+ {
+ endSide = true;
+ }
+ }
+
+ if( startSide )
+ {
+ // *****************************************
+ // Draw Start Angle side
+ // *****************************************
+ using (path = new GraphicsPath())
+ {
+
+ if (doughnut)
+ {
+ // Add Line between The Doughnut Arc and Arc
+ path.AddLine(topDoughnutStart, topStart);
+
+ // Add Line between The Top Start and Bottom Start
+ path.AddLine(topStart, bottomStart);
+
+ // Add Line between The Bottom Start and Doughnut Start
+ path.AddLine(bottomStart, bottomDoughnutStart);
+
+ // Add Line between The Bottom Doughnut Start and The Top Doughnut Start
+ path.AddLine(bottomDoughnutStart, topDoughnutStart);
+ }
+ else
+ {
+ // Add Line between The Center and Arc
+ path.AddLine(topCenter, topStart);
+
+ // Add Line between The Top Start and Bottom Start
+ path.AddLine(topStart, bottomStart);
+
+ // Add Line between The Bottom Start and The Center Bottom
+ path.AddLine(bottomStart, bottomCenter);
+
+ // Add Line between The Bottom Center and The Top Center
+ path.AddLine(bottomCenter, topCenter);
+ }
+ // Get surface colors
+ Color frontLightColor, leftLightColor, topLightColor, backLightColor, rightLightColor, bottomLightColor;
+ area.matrix3D.GetLight(brush.Color, out frontLightColor, out backLightColor, out leftLightColor, out rightLightColor, out topLightColor, out bottomLightColor);
+
+ Color lightColor;
+ if (area.Area3DStyle.Inclination < 0)
+ {
+ lightColor = bottomLightColor;
+ }
+ else
+ {
+ lightColor = topLightColor;
+ }
+
+ // Draw Path
+ using (Brush lightBrush = new SolidBrush(lightColor))
+ {
+ FillPath(lightBrush, path);
+ }
+
+ DrawGraphicsPath(pen, path);
+ }
+ }
+
+ if( endSide )
+ {
+ // *****************************************
+ // Draw End Angle side
+ // *****************************************
+ using (path = new GraphicsPath())
+ {
+ if (doughnut)
+ {
+ // Add Line between The Doughnut Arc and Arc
+ path.AddLine(topDoughnutEnd, topEnd);
+
+ // Add Line between The Top End and Bottom End
+ path.AddLine(topEnd, bottomEnd);
+
+ // Add Line between The Bottom End and Doughnut End
+ path.AddLine(bottomEnd, bottomDoughnutEnd);
+
+ // Add Line between The Bottom Doughnut End and The Top Doughnut End
+ path.AddLine(bottomDoughnutEnd, topDoughnutEnd);
+ }
+ else
+ {
+ // Add Line between The Center and Arc
+ path.AddLine(topCenter, topEnd);
+
+ // Add Line between The Top End and Bottom End
+ path.AddLine(topEnd, bottomEnd);
+
+ // Add Line between The Bottom End and The Center Bottom
+ path.AddLine(bottomEnd, bottomCenter);
+
+ // Add Line between The Bottom Center and The Top Center
+ path.AddLine(bottomCenter, topCenter);
+
+ }
+
+ // Get surface colors
+ Color frontLightColor, leftLightColor, topLightColor, backLightColor, rightLightColor, bottomLightColor;
+ area.matrix3D.GetLight(brush.Color, out frontLightColor, out backLightColor, out leftLightColor, out rightLightColor, out topLightColor, out bottomLightColor);
+
+ Color lightColor;
+ if (area.Area3DStyle.Inclination < 0)
+ {
+ lightColor = bottomLightColor;
+ }
+ else
+ {
+ lightColor = topLightColor;
+ }
+
+ // Draw Path
+ using (Brush lightBrush = new SolidBrush(lightColor))
+ {
+ FillPath(lightBrush, path);
+ }
+
+ DrawGraphicsPath(pen, path);
+ }
+ }
+ }
+
+ /// <summary>
+ /// This method Draw and fill pie curves.
+ /// </summary>
+ /// <param name="area">Chart area used for drawing</param>
+ /// <param name="point">Data Point</param>
+ /// <param name="brush">Graphic Brush used for drawing</param>
+ /// <param name="pen">Graphic Pen used for drawing</param>
+ /// <param name="topFirstRectPoint">Rotated bounded rectangle points</param>
+ /// <param name="topSecondRectPoint">Rotated bounded rectangle points</param>
+ /// <param name="bottomFirstRectPoint">Rotated bounded rectangle points</param>
+ /// <param name="bottomSecondRectPoint">Rotated bounded rectangle points</param>
+ /// <param name="topFirstPoint">Significant pie points</param>
+ /// <param name="topSecondPoint">Significant pie points</param>
+ /// <param name="bottomFirstPoint">Significant pie points</param>
+ /// <param name="bottomSecondPoint">Significant pie points</param>
+ /// <param name="startAngle">Start pie angle</param>
+ /// <param name="sweepAngle">End pie angle</param>
+ /// <param name="pointIndex">Data Point Index</param>
+ internal void FillPieCurve(
+ ChartArea area,
+ DataPoint point,
+ Brush brush,
+ Pen pen,
+ PointF topFirstRectPoint,
+ PointF topSecondRectPoint,
+ PointF bottomFirstRectPoint,
+ PointF bottomSecondRectPoint,
+ PointF topFirstPoint,
+ PointF topSecondPoint,
+ PointF bottomFirstPoint,
+ PointF bottomSecondPoint,
+ float startAngle,
+ float sweepAngle,
+ int pointIndex
+ )
+ {
+ // Common Elements
+ CommonElements common = area.Common;
+
+ // Create a graphics path
+ using (GraphicsPath path = new GraphicsPath())
+ {
+
+ // It is enough to transform only two points from
+ // rectangle. This code will create RectangleF from
+ // top left and bottom right points.
+ RectangleF pieTopRectangle = new RectangleF();
+ pieTopRectangle.X = topFirstRectPoint.X;
+ pieTopRectangle.Y = topFirstRectPoint.Y;
+ pieTopRectangle.Height = topSecondRectPoint.Y - topFirstRectPoint.Y;
+ pieTopRectangle.Width = topSecondRectPoint.X - topFirstRectPoint.X;
+
+ RectangleF pieBottomRectangle = new RectangleF();
+ pieBottomRectangle.X = bottomFirstRectPoint.X;
+ pieBottomRectangle.Y = bottomFirstRectPoint.Y;
+ pieBottomRectangle.Height = bottomSecondRectPoint.Y - bottomFirstRectPoint.Y;
+ pieBottomRectangle.Width = bottomSecondRectPoint.X - bottomFirstRectPoint.X;
+
+ // Angle correction algorithm. After rotation AddArc method should used
+ // different transformed angles. This method transforms angles.
+ double angleCorrection = pieTopRectangle.Height / pieTopRectangle.Width;
+
+ float endAngle;
+ endAngle = AngleCorrection(startAngle + sweepAngle, angleCorrection);
+ startAngle = AngleCorrection(startAngle, angleCorrection);
+
+ sweepAngle = endAngle - startAngle;
+
+ // Add Line between first points
+ path.AddLine(topFirstPoint, bottomFirstPoint);
+
+ if (pieBottomRectangle.Height <= 0)
+ {
+ // If x angle is 0 this arc will be line in projection.
+ path.AddLine(bottomFirstPoint.X, bottomFirstPoint.Y, bottomSecondPoint.X, bottomSecondPoint.Y);
+ }
+ else
+ {
+ // Add Arc
+ path.AddArc(pieBottomRectangle.X, pieBottomRectangle.Y, pieBottomRectangle.Width, pieBottomRectangle.Height, startAngle, sweepAngle);
+ }
+
+ // Add Line between second points
+ path.AddLine(bottomSecondPoint, topSecondPoint);
+
+ if (pieTopRectangle.Height <= 0)
+ {
+ // If x angle is 0 this arc will be line in projection.
+ path.AddLine(topFirstPoint.X, topFirstPoint.Y, topSecondPoint.X, topSecondPoint.Y);
+ }
+ else
+ {
+ path.AddArc(pieTopRectangle.X, pieTopRectangle.Y, pieTopRectangle.Width, pieTopRectangle.Height, startAngle + sweepAngle, -sweepAngle);
+ }
+
+ if (common.ProcessModePaint)
+ {
+ // Drawing Mode
+ FillPath(brush, path);
+
+ if (point.BorderColor != Color.Empty &&
+ point.BorderWidth > 0 &&
+ point.BorderDashStyle != ChartDashStyle.NotSet)
+ {
+ DrawGraphicsPath(pen, path);
+ }
+
+ }
+ if (common.ProcessModeRegions)
+ {
+
+
+ // Check if processing collected data point
+ if (point.IsCustomPropertySet("_COLLECTED_DATA_POINT"))
+ {
+ // Add point to the map area
+ common.HotRegionsList.AddHotRegion(
+ (ChartGraphics)this,
+ path,
+ false,
+ point.ReplaceKeywords(point.ToolTip),
+#if Microsoft_CONTROL
+ string.Empty,
+ string.Empty,
+ string.Empty,
+#else // Microsoft_CONTROL
+ point.ReplaceKeywords(point.Url),
+ point.ReplaceKeywords(point.MapAreaAttributes),
+ point.ReplaceKeywords(point.PostBackValue),
+#endif // Microsoft_CONTROL
+ point,
+ ChartElementType.DataPoint);
+
+ return;
+ }
+
+
+
+ common.HotRegionsList.AddHotRegion(
+ path,
+ false,
+ (ChartGraphics)this,
+ point,
+ point.series.Name,
+ pointIndex);
+ }
+ }
+ }
+
+ /// <summary>
+ /// This method draws projection of 3D pie slice.
+ /// </summary>
+ /// <param name="area">Chart area used for drawing</param>
+ /// <param name="point">Data point which creates this pie slice</param>
+ /// <param name="brush">Graphic Brush used for drawing</param>
+ /// <param name="pen">Graphic Pen used for drawing</param>
+ /// <param name="firstRectPoint">The first point of transformed bounding rectangle</param>
+ /// <param name="firstPoint">The first arc point of pie slice</param>
+ /// <param name="secondRectPoint">The second point of transformed bounding rectangle</param>
+ /// <param name="secondPoint">The second arc point of pie slice</param>
+ /// <param name="center">The center point of pie slice</param>
+ /// <param name="startAngle">Start angle of pie slice</param>
+ /// <param name="sweepAngle">The end angle of pie slice</param>
+ /// <param name="fill">Fill pie slice with brush</param>
+ /// <param name="pointIndex"></param>
+ internal void FillPieSlice( ChartArea area, DataPoint point, SolidBrush brush, Pen pen, PointF firstRectPoint, PointF firstPoint, PointF secondRectPoint, PointF secondPoint, PointF center, float startAngle, float sweepAngle, bool fill, int pointIndex )
+ {
+ // Common elements
+ CommonElements common = area.Common;
+
+ // Create a graphics path
+ using (GraphicsPath path = new GraphicsPath())
+ {
+
+ // It is enough to transform only two points from
+ // rectangle. This code will create RectangleF from
+ // top left and bottom right points.
+ RectangleF pieRectangle = new RectangleF();
+ pieRectangle.X = firstRectPoint.X;
+ pieRectangle.Y = firstRectPoint.Y;
+ pieRectangle.Height = secondRectPoint.Y - firstRectPoint.Y;
+ pieRectangle.Width = secondRectPoint.X - firstRectPoint.X;
+
+ // Angle correction algorithm. After rotation AddArc method should used
+ // different transformed angles. This method transforms angles.
+ double angleCorrection = pieRectangle.Height / pieRectangle.Width;
+
+ float endAngle;
+ endAngle = AngleCorrection(startAngle + sweepAngle, angleCorrection);
+ startAngle = AngleCorrection(startAngle, angleCorrection);
+
+ sweepAngle = endAngle - startAngle;
+
+ // Add Line between The Center and Arc
+ path.AddLine(center, firstPoint);
+
+ // Add Arc
+ if (pieRectangle.Height > 0)
+ {
+ // If x angle is 0 this arc will be line in projection.
+ path.AddArc(pieRectangle.X, pieRectangle.Y, pieRectangle.Width, pieRectangle.Height, startAngle, sweepAngle);
+ }
+
+ // Add Line between the end of the arc and the centre.
+ path.AddLine(secondPoint, center);
+
+ if (common.ProcessModePaint)
+ {
+ // Get surface colors
+ Color frontLightColor, leftLightColor, topLightColor, backLightColor, rightLightColor, bottomLightColor;
+ area.matrix3D.GetLight(brush.Color, out frontLightColor, out backLightColor, out leftLightColor, out rightLightColor, out topLightColor, out bottomLightColor);
+
+ Pen newPen = (Pen)pen.Clone();
+
+ if (area.Area3DStyle.LightStyle == LightStyle.Realistic && point.BorderColor == Color.Empty)
+ {
+ newPen.Color = frontLightColor;
+ }
+
+ // Drawing Mode
+ if (fill)
+ {
+ using (Brush lightBrush = new SolidBrush(frontLightColor))
+ {
+ FillPath(lightBrush, path);
+ }
+ }
+
+ if (point.BorderColor != Color.Empty &&
+ point.BorderWidth > 0 &&
+ point.BorderDashStyle != ChartDashStyle.NotSet)
+ {
+ DrawGraphicsPath(newPen, path);
+ }
+ }
+
+ if (common.ProcessModeRegions && fill)
+ {
+
+
+ // Check if processing collected data point
+ if (point.IsCustomPropertySet("_COLLECTED_DATA_POINT"))
+ {
+ // Add point to the map area
+ common.HotRegionsList.AddHotRegion(
+ (ChartGraphics)this,
+ path,
+ false,
+ point.ReplaceKeywords(point.ToolTip),
+#if Microsoft_CONTROL
+ string.Empty,
+ string.Empty,
+ string.Empty,
+#else // Microsoft_CONTROL
+ point.ReplaceKeywords(point.Url),
+ point.ReplaceKeywords(point.MapAreaAttributes),
+ point.ReplaceKeywords(point.PostBackValue),
+#endif // Microsoft_CONTROL
+ point,
+ ChartElementType.DataPoint);
+
+ return;
+ }
+
+
+
+ common.HotRegionsList.AddHotRegion(path, false, (ChartGraphics)this, point, point.series.Name, pointIndex);
+ }
+ }
+ }
+
+ /// <summary>
+ /// This method draws projection of 3D pie slice.
+ /// </summary>
+ /// <param name="area">Chart area used for drawing</param>
+ /// <param name="point">Data point which creates this Doughnut slice</param>
+ /// <param name="brush">Graphic Brush used for drawing</param>
+ /// <param name="pen">Graphic Pen used for drawing</param>
+ /// <param name="firstRectPoint">The first point of transformed bounding rectangle</param>
+ /// <param name="firstPoint">The first arc point of Doughnut slice</param>
+ /// <param name="secondRectPoint">The second point of transformed bounding rectangle</param>
+ /// <param name="secondPoint">The second arc point of Doughnut slice</param>
+ /// <param name="threePoint">The three point of Doughnut slice</param>
+ /// <param name="fourPoint">The four point of Doughnut slice</param>
+ /// <param name="startAngle">Start angle of Doughnut slice</param>
+ /// <param name="sweepAngle">The end angle of Doughnut slice</param>
+ /// <param name="fill">Fill Doughnut slice with brush</param>
+ /// <param name="doughnutRadius">Radius for doughnut chart</param>
+ /// <param name="pointIndex">Data Point Index</param>
+ internal void FillDoughnutSlice( ChartArea area, DataPoint point, SolidBrush brush, Pen pen, PointF firstRectPoint, PointF firstPoint, PointF secondRectPoint, PointF secondPoint, PointF threePoint, PointF fourPoint, float startAngle, float sweepAngle, bool fill, float doughnutRadius, int pointIndex )
+ {
+ // Common Elements
+ CommonElements common = area.Common;
+
+ doughnutRadius = 1F - doughnutRadius / 100F;
+
+ // Create a graphics path
+ using (GraphicsPath path = new GraphicsPath())
+ {
+
+ // It is enough to transform only two points from
+ // rectangle. This code will create RectangleF from
+ // top left and bottom right points.
+ RectangleF pieRectangle = new RectangleF();
+ pieRectangle.X = firstRectPoint.X;
+ pieRectangle.Y = firstRectPoint.Y;
+ pieRectangle.Height = secondRectPoint.Y - firstRectPoint.Y;
+ pieRectangle.Width = secondRectPoint.X - firstRectPoint.X;
+
+ RectangleF pieDoughnutRectangle = new RectangleF();
+ pieDoughnutRectangle.X = pieRectangle.X + pieRectangle.Width * (1F - doughnutRadius) / 2F;
+ pieDoughnutRectangle.Y = pieRectangle.Y + pieRectangle.Height * (1F - doughnutRadius) / 2F;
+ pieDoughnutRectangle.Height = pieRectangle.Height * doughnutRadius;
+ pieDoughnutRectangle.Width = pieRectangle.Width * doughnutRadius;
+
+ // Angle correction algorithm. After rotation AddArc method should used
+ // different transformed angles. This method transforms angles.
+ double angleCorrection = pieRectangle.Height / pieRectangle.Width;
+
+ float endAngle;
+ endAngle = AngleCorrection(startAngle + sweepAngle, angleCorrection);
+ startAngle = AngleCorrection(startAngle, angleCorrection);
+
+ sweepAngle = endAngle - startAngle;
+
+ // Add Line between The Doughnut Arc and Arc
+ path.AddLine(fourPoint, firstPoint);
+
+ // Add Arc
+ if (pieRectangle.Height > 0)
+ {
+ // If x angle is 0 this arc will be line in projection.
+ path.AddArc(pieRectangle.X, pieRectangle.Y, pieRectangle.Width, pieRectangle.Height, startAngle, sweepAngle);
+ }
+
+ // Add Line between the end of the arc and The Doughnut Arc.
+ path.AddLine(secondPoint, threePoint);
+
+ // Add Doughnut Arc
+ if (pieDoughnutRectangle.Height > 0)
+ {
+ path.AddArc(pieDoughnutRectangle.X, pieDoughnutRectangle.Y, pieDoughnutRectangle.Width, pieDoughnutRectangle.Height, startAngle + sweepAngle, -sweepAngle);
+ }
+
+ if (common.ProcessModePaint)
+ {
+ // Get surface colors
+ Color frontLightColor, leftLightColor, topLightColor, backLightColor, rightLightColor, bottomLightColor;
+ area.matrix3D.GetLight(brush.Color, out frontLightColor, out backLightColor, out leftLightColor, out rightLightColor, out topLightColor, out bottomLightColor);
+
+ Pen newPen = (Pen)pen.Clone();
+
+ if (area.Area3DStyle.LightStyle == LightStyle.Realistic && point.BorderColor == Color.Empty)
+ {
+ newPen.Color = frontLightColor;
+ }
+
+ // Drawing Mode
+ if (fill)
+ {
+ using (Brush lightBrush = new SolidBrush(frontLightColor))
+ {
+ FillPath(lightBrush, path);
+ }
+ }
+
+ if (point.BorderColor != Color.Empty &&
+ point.BorderWidth > 0 &&
+ point.BorderDashStyle != ChartDashStyle.NotSet)
+ {
+ DrawGraphicsPath(newPen, path);
+ }
+ }
+
+ if (common.ProcessModeRegions && fill)
+ {
+
+
+ // Check if processing collected data point
+ if (point.IsCustomPropertySet("_COLLECTED_DATA_POINT"))
+ {
+ // Add point to the map area
+ common.HotRegionsList.AddHotRegion(
+ (ChartGraphics)this,
+ path,
+ false,
+ point.ReplaceKeywords(point.ToolTip),
+#if Microsoft_CONTROL
+ string.Empty,
+ string.Empty,
+ string.Empty,
+#else // Microsoft_CONTROL
+ point.ReplaceKeywords(point.Url),
+ point.ReplaceKeywords(point.MapAreaAttributes),
+ point.ReplaceKeywords(point.PostBackValue),
+#endif // Microsoft_CONTROL
+ point,
+ ChartElementType.DataPoint);
+
+ return;
+ }
+
+
+
+ // Add points to the map area
+ common.HotRegionsList.AddHotRegion(
+ path,
+ false,
+ (ChartGraphics)this,
+ point,
+ point.series.Name,
+ pointIndex);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Draw Graphics Path. This method is introduced because of
+ /// bug in DrawPath method when Pen Width is bigger then 1.
+ /// </summary>
+ /// <param name="pen">Pen</param>
+ /// <param name="path">Graphics Path</param>
+ private void DrawGraphicsPath( Pen pen, GraphicsPath path )
+ {
+ // Normal case. Very fast Drawing.
+ if( pen.Width < 2 )
+ {
+ DrawPath( pen, path );
+ }
+ else
+ {
+
+ // Converts each curve in this path into a sequence
+ // of connected line segments. Slow Drawing.
+ path.Flatten();
+
+ // Set Pen cap
+ pen.EndCap = LineCap.Round;
+ pen.StartCap = LineCap.Round;
+
+ PointF [] pathPoints;
+
+ pathPoints = path.PathPoints;
+
+ // Draw any segment as a line.
+ for( int point = 0; point < path.PathPoints.Length - 1; point++ )
+ {
+ PointF [] points;
+
+ points = new PointF[2];
+ points[0] = pathPoints[point];
+ points[1] = pathPoints[point+1];
+
+ DrawLine( pen, points[0], points[1] );
+ }
+ }
+ }
+
+ /// <summary>
+ /// Angle correction algorithm. After rotation different
+ /// transformed angle should be used. This method transforms angles.
+ /// </summary>
+ /// <param name="angle">Not transformed angle</param>
+ /// <param name="correction">Correction of bounding rectangle (change between width and height)</param>
+ /// <returns>Transformed angle</returns>
+ private float AngleCorrection( float angle, double correction )
+ {
+ // Make all angles to be between -90 and 90.
+ if( angle > -90 && angle < 90 )
+ {
+ angle = (float)(Math.Atan( Math.Tan( ( angle ) * Math.PI / 180 ) * correction ) * 180 / Math.PI);
+ }
+ else if( angle > -270 && angle < -90 )
+ {
+ angle = angle + 180;
+ angle = (float)(Math.Atan( Math.Tan( ( angle ) * Math.PI / 180 ) * correction ) * 180 / Math.PI);
+ angle = angle - 180;
+ }
+ else if( angle > 90 && angle < 270 )
+ {
+ angle = angle - 180;
+ angle = (float)(Math.Atan( Math.Tan( ( angle ) * Math.PI / 180 ) * correction ) * 180 / Math.PI);
+ angle = angle + 180;
+ }
+ else if( angle > 270 && angle < 450 )
+ {
+ angle = angle - 360;
+ angle = (float)(Math.Atan( Math.Tan( ( angle ) * Math.PI / 180 ) * correction ) * 180 / Math.PI);
+ angle = angle + 360;
+ }
+ else if( angle > 450 )
+ {
+ angle = angle - 540;
+ angle = (float)(Math.Atan( Math.Tan( ( angle ) * Math.PI / 180 ) * correction ) * 180 / Math.PI);
+ angle = angle + 540;
+ }
+ return angle;
+ }
+
+ #endregion
+
+ #region 3D Surface drawing methods (used in Line charts)
+
+ /// <summary>
+ /// Draws a 3D polygon defined by 4 points in 2D space.
+ /// </summary>
+ /// <param name="area">Chart area reference.</param>
+ /// <param name="matrix">Coordinates transformation matrix.</param>
+ /// <param name="surfaceName">Name of the surface to draw.</param>
+ /// <param name="positionZ">Z position of the back side of the 3D surface.</param>
+ /// <param name="backColor">Color of rectangle</param>
+ /// <param name="borderColor">Border Color</param>
+ /// <param name="borderWidth">Border Width</param>
+ /// <param name="firstPoint">First point.</param>
+ /// <param name="secondPoint">Second point.</param>
+ /// <param name="thirdPoint">Third point.</param>
+ /// <param name="fourthPoint">Fourth point.</param>
+ /// <param name="operationType">AxisName of operation Drawing, Calculating Path or Both</param>
+ /// <param name="lineSegmentType">AxisName of line segment. Used for step lines and splines.</param>
+ /// <param name="thinBorders">Thin border will be drawn on specified sides.</param>
+ /// <returns>Returns elemnt shape path if operationType parameter is set to CalcElementPath, otherwise Null.</returns>
+ internal GraphicsPath Draw3DPolygon(
+ ChartArea area,
+ Matrix3D matrix,
+ SurfaceNames surfaceName,
+ float positionZ,
+ Color backColor,
+ Color borderColor,
+ int borderWidth,
+ DataPoint3D firstPoint,
+ DataPoint3D secondPoint,
+ DataPoint3D thirdPoint,
+ DataPoint3D fourthPoint,
+ DrawingOperationTypes operationType,
+ LineSegmentType lineSegmentType,
+ SurfaceNames thinBorders)
+ {
+ // Create graphics path for selection
+ bool drawElements = ((operationType & DrawingOperationTypes.DrawElement) == DrawingOperationTypes.DrawElement);
+ GraphicsPath resultPath = ((operationType & DrawingOperationTypes.CalcElementPath) == DrawingOperationTypes.CalcElementPath)
+ ? new GraphicsPath() : null;
+
+ //**********************************************************************
+ //** Prepare, transform polygon coordinates
+ //**********************************************************************
+
+ // Define 4 points polygon
+ Point3D [] points3D = new Point3D[4];
+ points3D[0] = new Point3D((float)firstPoint.xPosition, (float)firstPoint.yPosition, positionZ);
+ points3D[1] = new Point3D((float)secondPoint.xPosition, (float)secondPoint.yPosition, positionZ);
+ points3D[2] = new Point3D((float)thirdPoint.xPosition, (float)thirdPoint.yPosition, positionZ);
+ points3D[3] = new Point3D((float)fourthPoint.xPosition, (float)fourthPoint.yPosition, positionZ);
+
+ // Transform coordinates
+ matrix.TransformPoints( points3D );
+
+ // Get absolute coordinates and create array of PointF
+ PointF[] polygonPoints = new PointF[4];
+ polygonPoints[0] = GetAbsolutePoint(points3D[0].PointF);
+ polygonPoints[1] = GetAbsolutePoint(points3D[1].PointF);
+ polygonPoints[2] = GetAbsolutePoint(points3D[2].PointF);
+ polygonPoints[3] = GetAbsolutePoint(points3D[3].PointF);
+
+
+ //**********************************************************************
+ //** Define drawing colors
+ //**********************************************************************
+ bool topIsVisible = IsSurfaceVisible( points3D[0], points3D[1], points3D[2]);
+ Color polygonColor = matrix.GetPolygonLight( points3D, backColor, topIsVisible, area.Area3DStyle.Rotation, surfaceName, area.ReverseSeriesOrder );
+ Color surfaceBorderColor = borderColor;
+ if(surfaceBorderColor == Color.Empty)
+ {
+ // If border color is emty use color slightly darker than main back color
+ surfaceBorderColor = ChartGraphics.GetGradientColor( backColor, Color.Black, 0.2 );
+ }
+
+ //**********************************************************************
+ //** Draw elements if required.
+ //**********************************************************************
+ Pen thickBorderPen = null;
+ if(drawElements)
+ {
+ // Remember SmoothingMode and turn off anti aliasing
+ SmoothingMode oldSmoothingMode = SmoothingMode;
+ SmoothingMode = SmoothingMode.Default;
+
+ // Draw the polygon
+ using (Brush brush = new SolidBrush(polygonColor))
+ {
+ FillPolygon(brush, polygonPoints);
+ }
+
+ // Return old smoothing mode
+ SmoothingMode = oldSmoothingMode;
+
+ // Draw thin polygon border of darker color around the whole polygon
+ if(thinBorders != 0)
+ {
+ Pen thinLinePen = new Pen(surfaceBorderColor, 1);
+ if( (thinBorders & SurfaceNames.Left) != 0 )
+ DrawLine(thinLinePen, polygonPoints[3], polygonPoints[0]);
+ if( (thinBorders & SurfaceNames.Right) != 0 )
+ DrawLine(thinLinePen, polygonPoints[1], polygonPoints[2]);
+ if( (thinBorders & SurfaceNames.Top) != 0 )
+ DrawLine(thinLinePen, polygonPoints[0], polygonPoints[1]);
+ if( (thinBorders & SurfaceNames.Bottom) != 0 )
+ DrawLine(thinLinePen, polygonPoints[2], polygonPoints[3]);
+ }
+ else if(polygonColor.A == 255)
+ {
+ DrawPolygon(new Pen(polygonColor, 1), polygonPoints);
+ }
+
+ // Create thick border line pen
+ thickBorderPen = new Pen(surfaceBorderColor, borderWidth);
+ thickBorderPen.StartCap = LineCap.Round;
+ thickBorderPen.EndCap = LineCap.Round;
+
+ // Draw thick Top & Bottom lines
+ DrawLine(thickBorderPen, polygonPoints[0], polygonPoints[1]);
+ DrawLine(thickBorderPen, polygonPoints[2], polygonPoints[3]);
+
+ // Draw thick Right & Left lines on first & last segments of the line
+ if(lineSegmentType == LineSegmentType.First)
+ {
+ DrawLine(thickBorderPen, polygonPoints[3], polygonPoints[0]);
+ }
+ else if(lineSegmentType == LineSegmentType.Last)
+ {
+ DrawLine(thickBorderPen, polygonPoints[1], polygonPoints[2]);
+ }
+ }
+
+ //**********************************************************************
+ //** Redraw front line of the previuos line segment.
+ //**********************************************************************
+ if(area.Area3DStyle.Perspective == 0)
+ {
+ if(frontLinePoint1 != PointF.Empty && frontLinePen != null)
+ {
+ if( (frontLinePoint1.X == polygonPoints[0].X &&
+ frontLinePoint1.Y == polygonPoints[0].Y ||
+ frontLinePoint2.X == polygonPoints[1].X &&
+ frontLinePoint2.Y == polygonPoints[1].Y ) ||
+
+ (frontLinePoint1.X == polygonPoints[1].X &&
+ frontLinePoint1.Y == polygonPoints[1].Y ||
+ frontLinePoint2.X == polygonPoints[0].X &&
+ frontLinePoint2.Y == polygonPoints[0].Y ) ||
+
+ (frontLinePoint1.X == polygonPoints[3].X &&
+ frontLinePoint1.Y == polygonPoints[3].Y ||
+ frontLinePoint2.X == polygonPoints[2].X &&
+ frontLinePoint2.Y == polygonPoints[2].Y) ||
+
+ (frontLinePoint1.X == polygonPoints[2].X &&
+ frontLinePoint1.Y == polygonPoints[2].Y ||
+ frontLinePoint2.X == polygonPoints[3].X &&
+ frontLinePoint2.Y == polygonPoints[3].Y) )
+ {
+ // Do not draw the line if it will be overlapped with current
+ }
+ else
+ {
+ // Draw line !!!!
+ DrawLine(
+ frontLinePen,
+ (float)Math.Round(frontLinePoint1.X),
+ (float)Math.Round(frontLinePoint1.Y),
+ (float)Math.Round(frontLinePoint2.X),
+ (float)Math.Round(frontLinePoint2.Y) );
+ }
+
+ // Reset line properties
+ frontLinePen = null;
+ frontLinePoint1 = PointF.Empty;
+ frontLinePoint2 = PointF.Empty;
+ }
+
+ //**********************************************************************
+ //** Check if front line should be redrawn whith the next segment.
+ //**********************************************************************
+ if(drawElements)
+ {
+ // Add top line
+ frontLinePen = thickBorderPen;
+ frontLinePoint1 = polygonPoints[0];
+ frontLinePoint2 = polygonPoints[1];
+ }
+ }
+
+ // Calculate path for selection
+ if(resultPath != null)
+ {
+ // Add polygon to the path
+ resultPath.AddPolygon(polygonPoints);
+ }
+
+ return resultPath;
+ }
+
+ /// <summary>
+ /// Helper method which returns the splines flatten path.
+ /// </summary>
+ /// <param name="area">Chart area reference.</param>
+ /// <param name="positionZ">Z position of the back side of the 3D surface.</param>
+ /// <param name="firstPoint">First point.</param>
+ /// <param name="secondPoint">Second point.</param>
+ /// <param name="points">Array of points.</param>
+ /// <param name="tension">Line tension.</param>
+ /// <param name="flatten">Flatten result path.</param>
+ /// <param name="translateCoordinates">Indicates that points coordinates should be translated.</param>
+ /// <param name="yValueIndex">Index of the Y value to use.</param>
+ /// <returns>Spline path.</returns>
+ internal GraphicsPath GetSplineFlattenPath(
+ ChartArea area,
+ float positionZ,
+ DataPoint3D firstPoint,
+ DataPoint3D secondPoint,
+ ArrayList points,
+ float tension,
+ bool flatten,
+ bool translateCoordinates,
+ int yValueIndex)
+ {
+ // Find first spline point index
+ int firtsSplinePointIndex = (firstPoint.index < secondPoint.index) ? firstPoint.index : secondPoint.index;
+ --firtsSplinePointIndex;
+ if(firtsSplinePointIndex >= (points.Count - 2) )
+ {
+ --firtsSplinePointIndex;
+ }
+ if(firtsSplinePointIndex < 1)
+ {
+ firtsSplinePointIndex = 1;
+ }
+
+ // Find four points which are required to draw the spline
+ int pointArrayIndex = int.MinValue;
+ DataPoint3D [] splineDataPoints = new DataPoint3D[4];
+ splineDataPoints[0] = FindPointByIndex(points, firtsSplinePointIndex, null, ref pointArrayIndex);
+ splineDataPoints[1] = FindPointByIndex(points, firtsSplinePointIndex + 1, null, ref pointArrayIndex);
+ splineDataPoints[2] = FindPointByIndex(points, firtsSplinePointIndex + 2, null, ref pointArrayIndex);
+ splineDataPoints[3] = FindPointByIndex(points, firtsSplinePointIndex + 3, null, ref pointArrayIndex);
+
+ // Get offset of spline segment in array
+ int splineSegmentOffset = 0;
+ while(splineSegmentOffset < 4)
+ {
+ if(splineDataPoints[splineSegmentOffset].index == firstPoint.index ||
+ splineDataPoints[splineSegmentOffset].index == secondPoint.index)
+ {
+ break;
+ }
+ ++splineSegmentOffset;
+ }
+
+ // Get number of found points
+ int nonNullPoints = 2;
+ if(splineDataPoints[2] != null)
+ ++nonNullPoints;
+ if(splineDataPoints[3] != null)
+ ++nonNullPoints;
+
+
+ // Get coordinates and create array of PointF for the front spline
+ PointF[] polygonPointsFront = new PointF[nonNullPoints];
+ if(yValueIndex == 0)
+ {
+ polygonPointsFront[0] = new PointF((float)splineDataPoints[0].xPosition, (float)splineDataPoints[0].yPosition);
+ polygonPointsFront[1] = new PointF((float)splineDataPoints[1].xPosition, (float)splineDataPoints[1].yPosition);
+ if(nonNullPoints > 2)
+ polygonPointsFront[2] = new PointF((float)splineDataPoints[2].xPosition, (float)splineDataPoints[2].yPosition);
+ if(nonNullPoints > 3)
+ polygonPointsFront[3] = new PointF((float)splineDataPoints[3].xPosition, (float)splineDataPoints[3].yPosition);
+ }
+ else
+ {
+ // Set active vertical axis
+ Axis vAxis = (firstPoint.dataPoint.series.YAxisType == AxisType.Primary) ? area.AxisY : area.AxisY2;
+
+ float secondYValue = (float)vAxis.GetPosition(splineDataPoints[0].dataPoint.YValues[yValueIndex]);
+ polygonPointsFront[0] = new PointF((float)splineDataPoints[0].xPosition, secondYValue);
+ secondYValue = (float)vAxis.GetPosition(splineDataPoints[1].dataPoint.YValues[yValueIndex]);
+ polygonPointsFront[1] = new PointF((float)splineDataPoints[1].xPosition, secondYValue);
+ if(nonNullPoints > 2)
+ {
+ secondYValue = (float)vAxis.GetPosition(splineDataPoints[2].dataPoint.YValues[yValueIndex]);
+ polygonPointsFront[2] = new PointF((float)splineDataPoints[2].xPosition, secondYValue);
+ }
+ if(nonNullPoints > 3)
+ {
+ secondYValue = (float)vAxis.GetPosition(splineDataPoints[3].dataPoint.YValues[yValueIndex]);
+ polygonPointsFront[3] = new PointF((float)splineDataPoints[3].xPosition, secondYValue);
+ }
+ }
+
+ // Translate points coordinates in 3D space and get absolute coordinate
+ if(translateCoordinates)
+ {
+ // Prepare array of points
+ Point3D[] points3D = new Point3D[nonNullPoints];
+ for(int index = 0; index < nonNullPoints; index++)
+ {
+ points3D[index] = new Point3D(polygonPointsFront[index].X, polygonPointsFront[index].Y, positionZ);
+ }
+
+ // Make coordinates transformation
+ area.matrix3D.TransformPoints( points3D );
+
+ // Get absolute values
+ for(int index = 0; index < nonNullPoints; index++)
+ {
+ polygonPointsFront[index] = GetAbsolutePoint(points3D[index].PointF);
+ }
+
+ }
+
+ // Create graphics path for the front spline surface and flatten it.
+ GraphicsPath splineSurfacePath = new GraphicsPath();
+ splineSurfacePath.AddCurve(polygonPointsFront, splineSegmentOffset, 1, tension);
+ if(flatten)
+ {
+ splineSurfacePath.Flatten();
+ }
+
+ // IsReversed points order
+ if(firstPoint.index > secondPoint.index)
+ {
+ splineSurfacePath.Reverse();
+ }
+
+ return splineSurfacePath;
+ }
+
+ /// <summary>
+ /// Draws a 3D spline surface connecting the two specified points in 2D space.
+ /// Used to draw Spline based charts.
+ /// </summary>
+ /// <param name="area">Chart area reference.</param>
+ /// <param name="matrix">Coordinates transformation matrix.</param>
+ /// <param name="lightStyle">LightStyle style (None, Simplistic, Realistic).</param>
+ /// <param name="surfaceName">Name of the surface to draw.</param>
+ /// <param name="positionZ">Z position of the back side of the 3D surface.</param>
+ /// <param name="depth">Depth of the 3D surface.</param>
+ /// <param name="backColor">Color of rectangle</param>
+ /// <param name="borderColor">Border Color</param>
+ /// <param name="borderWidth">Border Width</param>
+ /// <param name="borderDashStyle">Border Style</param>
+ /// <param name="firstPoint">First point.</param>
+ /// <param name="secondPoint">Second point.</param>
+ /// <param name="points">Array of points.</param>
+ /// <param name="pointIndex">Index of point to draw.</param>
+ /// <param name="tension">Line tension.</param>
+ /// <param name="operationType">AxisName of operation Drawing, Calculating Path or Both</param>
+ /// <param name="forceThinBorder">Thin border will be drawn on all segments.</param>
+ /// <param name="forceThickBorder">Thick border will be drawn on all segments.</param>
+ /// <param name="reversedSeriesOrder">Series are drawn in reversed order.</param>
+ /// <param name="multiSeries">Multiple series are drawn at the same time.</param>
+ /// <param name="yValueIndex">Index of the Y value to use.</param>
+ /// <param name="clipInsideArea">Surface should be clipped inside plotting area.</param>
+ /// <returns>Returns elemnt shape path if operationType parameter is set to CalcElementPath, otherwise Null.</returns>
+ internal GraphicsPath Draw3DSplineSurface(
+ ChartArea area,
+ Matrix3D matrix,
+ LightStyle lightStyle,
+ SurfaceNames surfaceName,
+ float positionZ,
+ float depth,
+ Color backColor,
+ Color borderColor,
+ int borderWidth,
+ ChartDashStyle borderDashStyle,
+ DataPoint3D firstPoint,
+ DataPoint3D secondPoint,
+ ArrayList points,
+ int pointIndex,
+ float tension,
+ DrawingOperationTypes operationType,
+ bool forceThinBorder,
+ bool forceThickBorder,
+ bool reversedSeriesOrder,
+ bool multiSeries,
+ int yValueIndex,
+ bool clipInsideArea)
+ {
+ // If zero tension is specified - draw a Line Surface
+ if(tension == 0f)
+ {
+ return Draw3DSurface(
+ area,
+ matrix,
+ lightStyle,
+ surfaceName,
+ positionZ,
+ depth,
+ backColor,
+ borderColor,
+ borderWidth,
+ borderDashStyle,
+ firstPoint,
+ secondPoint,
+ points,
+ pointIndex,
+ tension,
+ operationType,
+ LineSegmentType.Single,
+ forceThinBorder,
+ forceThickBorder,
+ reversedSeriesOrder,
+ multiSeries,
+ yValueIndex,
+ clipInsideArea);
+ }
+
+ // Create graphics path for selection
+ GraphicsPath resultPath = ((operationType & DrawingOperationTypes.CalcElementPath) == DrawingOperationTypes.CalcElementPath)
+ ? new GraphicsPath() : null;
+
+ // Get spline flatten path
+ GraphicsPath splineSurfacePath = GetSplineFlattenPath(
+ area, positionZ,
+ firstPoint, secondPoint, points, tension, true, false, yValueIndex);
+
+ // Check if reversed drawing order required
+ bool reversed = false;
+ if((pointIndex + 1) < points.Count)
+ {
+ DataPoint3D p = (DataPoint3D)points[pointIndex + 1];
+ if(p.index == firstPoint.index)
+ {
+ reversed = true;
+ }
+ }
+
+ if(reversed)
+ {
+ splineSurfacePath.Reverse();
+ }
+
+ // Loop through all segment lines the spline consists off
+ PointF[] splinePathPoints = splineSurfacePath.PathPoints;
+ DataPoint3D dp1 = new DataPoint3D();
+ DataPoint3D dp2 = new DataPoint3D();
+ LineSegmentType lineSegmentType = LineSegmentType.Middle;
+ for(int pIndex = 1; pIndex < splinePathPoints.Length; pIndex++)
+ {
+ bool forceSegmentThinBorder = false;
+ bool forceSegmentThickBorder = false;
+
+ // Calculate surface coordinates
+ if(!reversed)
+ {
+ dp1.index = firstPoint.index;
+ dp1.dataPoint = firstPoint.dataPoint;
+ dp1.xPosition = splinePathPoints[pIndex - 1].X;
+ dp1.yPosition = splinePathPoints[pIndex - 1].Y;
+
+ dp2.index = secondPoint.index;
+ dp2.index = secondPoint.index;
+ dp2.xPosition = splinePathPoints[pIndex].X;
+ dp2.yPosition = splinePathPoints[pIndex].Y;
+ }
+ else
+ {
+ dp2.index = firstPoint.index;
+ dp2.dataPoint = firstPoint.dataPoint;
+ dp2.xPosition = splinePathPoints[pIndex - 1].X;
+ dp2.yPosition = splinePathPoints[pIndex - 1].Y;
+
+ dp1.index = secondPoint.index;
+ dp1.dataPoint = secondPoint.dataPoint;
+ dp1.xPosition = splinePathPoints[pIndex].X;
+ dp1.yPosition = splinePathPoints[pIndex].Y;
+ }
+
+ // Get sefment type
+ lineSegmentType = LineSegmentType.Middle;
+ if(pIndex == 1)
+ {
+ if(!reversed)
+ lineSegmentType = LineSegmentType.First;
+ else
+ lineSegmentType = LineSegmentType.Last;
+
+ forceSegmentThinBorder = forceThinBorder;
+ forceSegmentThickBorder = forceThickBorder;
+ }
+ else if(pIndex == splinePathPoints.Length - 1)
+ {
+ if(!reversed)
+ lineSegmentType = LineSegmentType.Last;
+ else
+ lineSegmentType = LineSegmentType.First;
+
+ forceSegmentThinBorder = forceThinBorder;
+ forceSegmentThickBorder = forceThickBorder;
+ }
+
+ // Draw flat surface
+ GraphicsPath segmentResultPath = Draw3DSurface(
+ area,
+ matrix,
+ lightStyle,
+ surfaceName,
+ positionZ,
+ depth,
+ backColor,
+ borderColor,
+ borderWidth,
+ borderDashStyle,
+ dp1,
+ dp2,
+ points,
+ pointIndex,
+ 0f,
+ operationType,
+ lineSegmentType,
+ forceSegmentThinBorder,
+ forceSegmentThickBorder,
+ reversedSeriesOrder,
+ multiSeries,
+ yValueIndex,
+ clipInsideArea);
+
+ // Add selection path
+ if(resultPath != null && segmentResultPath != null && segmentResultPath.PointCount > 0)
+ {
+ resultPath.AddPath(segmentResultPath, true);
+ }
+
+ }
+
+ return resultPath;
+ }
+
+
+ /// <summary>
+ /// Draws a 3D surface connecting the two specified points in 2D space.
+ /// Used to draw Line based charts.
+ /// </summary>
+ /// <param name="area">Chart area reference.</param>
+ /// <param name="matrix">Coordinates transformation matrix.</param>
+ /// <param name="lightStyle">LightStyle style (None, Simplistic, Realistic).</param>
+ /// <param name="surfaceName">Name of the surface to draw.</param>
+ /// <param name="positionZ">Z position of the back side of the 3D surface.</param>
+ /// <param name="depth">Depth of the 3D surface.</param>
+ /// <param name="backColor">Color of rectangle</param>
+ /// <param name="borderColor">Border Color</param>
+ /// <param name="borderWidth">Border Width</param>
+ /// <param name="borderDashStyle">Border Style</param>
+ /// <param name="firstPoint">First point.</param>
+ /// <param name="secondPoint">Second point.</param>
+ /// <param name="points">Array of points.</param>
+ /// <param name="pointIndex">Index of point to draw.</param>
+ /// <param name="tension">Line tension.</param>
+ /// <param name="operationType">AxisName of operation Drawing, Calculating Path or Both</param>
+ /// <param name="lineSegmentType">AxisName of line segment. Used for step lines and splines.</param>
+ /// <param name="forceThinBorder">Thin border will be drawn on all segments.</param>
+ /// <param name="forceThickBorder">Thick border will be drawn on all segments.</param>
+ /// <param name="reversedSeriesOrder">Series are drawn in reversed order.</param>
+ /// <param name="multiSeries">Multiple series are drawn at the same time.</param>
+ /// <param name="yValueIndex">Index of the Y value to use.</param>
+ /// <param name="clipInsideArea">Surface should be clipped inside plotting area.</param>
+ /// <returns>Returns elemnt shape path if operationType parameter is set to CalcElementPath, otherwise Null.</returns>
+ internal GraphicsPath Draw3DSurface(
+ ChartArea area,
+ Matrix3D matrix,
+ LightStyle lightStyle,
+ SurfaceNames surfaceName,
+ float positionZ,
+ float depth,
+ Color backColor,
+ Color borderColor,
+ int borderWidth,
+ ChartDashStyle borderDashStyle,
+ DataPoint3D firstPoint,
+ DataPoint3D secondPoint,
+ ArrayList points,
+ int pointIndex,
+ float tension,
+ DrawingOperationTypes operationType,
+ LineSegmentType lineSegmentType,
+ bool forceThinBorder,
+ bool forceThickBorder,
+ bool reversedSeriesOrder,
+ bool multiSeries,
+ int yValueIndex,
+ bool clipInsideArea)
+ {
+ // If non-zero tension is specified - draw a Spline Surface
+ if(tension != 0f)
+ {
+ return Draw3DSplineSurface(
+ area,
+ matrix,
+ lightStyle,
+ surfaceName,
+ positionZ,
+ depth,
+ backColor,
+ borderColor,
+ borderWidth,
+ borderDashStyle,
+ firstPoint,
+ secondPoint,
+ points,
+ pointIndex,
+ tension,
+ operationType,
+ forceThinBorder,
+ forceThickBorder,
+ reversedSeriesOrder,
+ multiSeries,
+ yValueIndex,
+ clipInsideArea);
+ }
+
+ //**********************************************************************
+ //** Create graphics path for selection
+ //**********************************************************************
+ bool drawElements = ((operationType & DrawingOperationTypes.DrawElement) == DrawingOperationTypes.DrawElement);
+ GraphicsPath resultPath = ((operationType & DrawingOperationTypes.CalcElementPath) == DrawingOperationTypes.CalcElementPath)
+ ? new GraphicsPath() : null;
+
+ //**********************************************************************
+ //** Check surface coordinates
+ //**********************************************************************
+ if((decimal)firstPoint.xPosition == (decimal)secondPoint.xPosition &&
+ (decimal)firstPoint.yPosition == (decimal)secondPoint.yPosition)
+ {
+ return resultPath;
+ }
+
+ //**********************************************************************
+ //** Clip surface
+ //**********************************************************************
+
+ // Check if line between the first and second points intersects with
+ // plotting area top or bottom boundary
+ if(clipInsideArea)
+ {
+ //****************************************************************
+ //** Round plot are position and point coordinates
+ //****************************************************************
+ int decimals = 3;
+ decimal plotAreaPositionX = Math.Round((decimal)area.PlotAreaPosition.X, decimals);
+ decimal plotAreaPositionY = Math.Round((decimal)area.PlotAreaPosition.Y, decimals);
+ decimal plotAreaPositionRight = Math.Round((decimal)area.PlotAreaPosition.Right, decimals);
+ decimal plotAreaPositionBottom = Math.Round((decimal)area.PlotAreaPosition.Bottom, decimals);
+
+ // Make area a little bit bigger
+ plotAreaPositionX -= 0.001M;
+ plotAreaPositionY -= 0.001M;
+ plotAreaPositionRight += 0.001M;
+ plotAreaPositionBottom += 0.001M;
+
+ // Chech data points X values
+ if((decimal)firstPoint.xPosition < plotAreaPositionX ||
+ (decimal)firstPoint.xPosition > plotAreaPositionRight ||
+ (decimal)secondPoint.xPosition < plotAreaPositionX ||
+ (decimal)secondPoint.xPosition > plotAreaPositionRight )
+ {
+ // Check if surface completly out of the plot area
+ if((decimal)firstPoint.xPosition < plotAreaPositionX &&
+ (decimal)secondPoint.xPosition < plotAreaPositionX)
+ {
+ return resultPath;
+ }
+ // Check if surface completly out of the plot area
+ if((decimal)firstPoint.xPosition > plotAreaPositionRight &&
+ (decimal)secondPoint.xPosition > plotAreaPositionRight)
+ {
+ return resultPath;
+ }
+
+ // Only part of the surface is outside - fix X value and adjust Y value
+ if((decimal)firstPoint.xPosition < plotAreaPositionX)
+ {
+ firstPoint.yPosition = ((double)plotAreaPositionX - secondPoint.xPosition) /
+ (firstPoint.xPosition - secondPoint.xPosition) *
+ (firstPoint.yPosition - secondPoint.yPosition) +
+ secondPoint.yPosition;
+ firstPoint.xPosition = (double)plotAreaPositionX;
+ }
+ else if((decimal)firstPoint.xPosition > plotAreaPositionRight)
+ {
+ firstPoint.yPosition = ((double)plotAreaPositionRight - secondPoint.xPosition) /
+ (firstPoint.xPosition - secondPoint.xPosition) *
+ (firstPoint.yPosition - secondPoint.yPosition) +
+ secondPoint.yPosition;
+ firstPoint.xPosition = (double)plotAreaPositionRight;
+ }
+ if((decimal)secondPoint.xPosition < plotAreaPositionX)
+ {
+ secondPoint.yPosition = ((double)plotAreaPositionX - secondPoint.xPosition) /
+ (firstPoint.xPosition - secondPoint.xPosition) *
+ (firstPoint.yPosition - secondPoint.yPosition) +
+ secondPoint.yPosition;
+ secondPoint.xPosition = (double)plotAreaPositionX;
+ }
+ else if((decimal)secondPoint.xPosition > plotAreaPositionRight)
+ {
+ secondPoint.yPosition = ((double)plotAreaPositionRight - secondPoint.xPosition) /
+ (firstPoint.xPosition - secondPoint.xPosition) *
+ (firstPoint.yPosition - secondPoint.yPosition) +
+ secondPoint.yPosition;
+ secondPoint.xPosition = (double)plotAreaPositionRight;
+ }
+ }
+
+ // Chech data points Y values
+ if((decimal)firstPoint.yPosition < plotAreaPositionY ||
+ (decimal)firstPoint.yPosition > plotAreaPositionBottom ||
+ (decimal)secondPoint.yPosition < plotAreaPositionY ||
+ (decimal)secondPoint.yPosition > plotAreaPositionBottom )
+ {
+ // Remember previous y positions
+ double prevFirstPointY = firstPoint.yPosition;
+ double prevSecondPointY = secondPoint.yPosition;
+
+ // Check if whole line is outside plotting region
+ bool surfaceCompletlyOutside = false;
+ if((decimal)firstPoint.yPosition < plotAreaPositionY &&
+ (decimal)secondPoint.yPosition < plotAreaPositionY)
+ {
+ surfaceCompletlyOutside = true;
+ firstPoint.yPosition = (double)plotAreaPositionY;
+ secondPoint.yPosition = (double)plotAreaPositionY;
+ }
+ if((decimal)firstPoint.yPosition > plotAreaPositionBottom &&
+ (decimal)secondPoint.yPosition > plotAreaPositionBottom)
+ {
+ surfaceCompletlyOutside = true;
+ firstPoint.yPosition = (double)plotAreaPositionBottom;
+ secondPoint.yPosition = (double)plotAreaPositionBottom;
+ }
+
+ // Calculate color used to draw "cut" surfaces
+ Color cutSurfaceBackColor = ChartGraphics.GetGradientColor(backColor, Color.Black, 0.5);
+ Color cutSurfaceBorderColor = ChartGraphics.GetGradientColor(borderColor, Color.Black, 0.5);
+
+ // Draw just one surface
+ if(surfaceCompletlyOutside)
+ {
+ resultPath = this.Draw3DSurface(
+ area, matrix, lightStyle, surfaceName, positionZ, depth,
+ cutSurfaceBackColor, cutSurfaceBorderColor, borderWidth, borderDashStyle,
+ firstPoint, secondPoint,
+ points, pointIndex, tension, operationType, lineSegmentType,
+ forceThinBorder, forceThickBorder, reversedSeriesOrder,
+ multiSeries, yValueIndex, clipInsideArea);
+
+ // Restore previous y positions
+ firstPoint.yPosition = prevFirstPointY;
+ secondPoint.yPosition = prevSecondPointY;
+
+ return resultPath;
+ }
+
+ // Get intersection point
+ DataPoint3D intersectionPoint = new DataPoint3D();
+ intersectionPoint.yPosition = (double)plotAreaPositionY;
+ if((decimal)firstPoint.yPosition > plotAreaPositionBottom ||
+ (decimal)secondPoint.yPosition > plotAreaPositionBottom )
+ {
+ intersectionPoint.yPosition = (double)plotAreaPositionBottom;
+ }
+ intersectionPoint.xPosition = (intersectionPoint.yPosition - secondPoint.yPosition) *
+ (firstPoint.xPosition - secondPoint.xPosition) /
+ (firstPoint.yPosition - secondPoint.yPosition) +
+ secondPoint.xPosition;
+
+ // Check if there are 2 intersection points (3 segments)
+ int segmentNumber = 2;
+ DataPoint3D intersectionPoint2 = null;
+ if( ((decimal)firstPoint.yPosition < plotAreaPositionY &&
+ (decimal)secondPoint.yPosition > plotAreaPositionBottom) ||
+ ((decimal)firstPoint.yPosition > plotAreaPositionBottom &&
+ (decimal)secondPoint.yPosition < plotAreaPositionY))
+ {
+ segmentNumber = 3;
+ intersectionPoint2 = new DataPoint3D();
+ if((decimal)intersectionPoint.yPosition == plotAreaPositionY)
+ {
+ intersectionPoint2.yPosition = (double)plotAreaPositionBottom;
+ }
+ else
+ {
+ intersectionPoint2.yPosition = (double)plotAreaPositionY;
+ }
+ intersectionPoint2.xPosition = (intersectionPoint2.yPosition - secondPoint.yPosition) *
+ (firstPoint.xPosition - secondPoint.xPosition) /
+ (firstPoint.yPosition - secondPoint.yPosition) +
+ secondPoint.xPosition;
+
+ // Switch intersection points
+ if((decimal)firstPoint.yPosition > plotAreaPositionBottom)
+ {
+ DataPoint3D tempPoint = new DataPoint3D();
+ tempPoint.xPosition = intersectionPoint.xPosition;
+ tempPoint.yPosition = intersectionPoint.yPosition;
+ intersectionPoint.xPosition = intersectionPoint2.xPosition;
+ intersectionPoint.yPosition = intersectionPoint2.yPosition;
+ intersectionPoint2.xPosition = tempPoint.xPosition;
+ intersectionPoint2.yPosition = tempPoint.yPosition;
+ }
+ }
+
+
+ // Adjust points Y values
+ bool firstSegmentVisible = true;
+ if((decimal)firstPoint.yPosition < plotAreaPositionY)
+ {
+ firstSegmentVisible = false;
+ firstPoint.yPosition = (double)plotAreaPositionY;
+ }
+ else if((decimal)firstPoint.yPosition > plotAreaPositionBottom)
+ {
+ firstSegmentVisible = false;
+ firstPoint.yPosition = (double)plotAreaPositionBottom;
+ }
+ if((decimal)secondPoint.yPosition < plotAreaPositionY)
+ {
+ secondPoint.yPosition = (double)plotAreaPositionY;
+ }
+ else if((decimal)secondPoint.yPosition > plotAreaPositionBottom)
+ {
+ secondPoint.yPosition = (double)plotAreaPositionBottom;
+ }
+
+ // Check if reversed drawing order required
+ bool reversed = false;
+ if((pointIndex + 1) < points.Count)
+ {
+ DataPoint3D p = (DataPoint3D)points[pointIndex + 1];
+ if(p.index == firstPoint.index)
+ {
+ reversed = true;
+ }
+ }
+
+ // Draw surfaces in 2 or 3 segments
+ for(int segmentIndex = 0; segmentIndex < 3; segmentIndex++)
+ {
+ GraphicsPath segmentPath = null;
+ if(segmentIndex == 0 && !reversed ||
+ segmentIndex == 2 && reversed)
+ {
+ // Draw first segment
+ if(intersectionPoint2 == null)
+ {
+ intersectionPoint2 = intersectionPoint;
+ }
+ intersectionPoint2.dataPoint = secondPoint.dataPoint;
+ intersectionPoint2.index = secondPoint.index;
+
+ segmentPath = this.Draw3DSurface(
+ area, matrix, lightStyle, surfaceName, positionZ, depth,
+ (firstSegmentVisible && segmentNumber != 3) ? backColor : cutSurfaceBackColor,
+ (firstSegmentVisible && segmentNumber != 3) ? borderColor : cutSurfaceBorderColor,
+ borderWidth, borderDashStyle,
+ firstPoint, intersectionPoint2,
+ points, pointIndex, tension, operationType, lineSegmentType,
+ forceThinBorder, forceThickBorder, reversedSeriesOrder,
+ multiSeries, yValueIndex, clipInsideArea);
+ }
+
+ if(segmentIndex == 1 && intersectionPoint2 != null && segmentNumber == 3)
+ {
+ // Draw middle segment
+ intersectionPoint2.dataPoint = secondPoint.dataPoint;
+ intersectionPoint2.index = secondPoint.index;
+
+ segmentPath = this.Draw3DSurface(
+ area, matrix, lightStyle, surfaceName, positionZ, depth,
+ backColor,
+ borderColor,
+ borderWidth, borderDashStyle,
+ intersectionPoint, intersectionPoint2,
+ points, pointIndex, tension, operationType, lineSegmentType,
+ forceThinBorder, forceThickBorder, reversedSeriesOrder,
+ multiSeries, yValueIndex, clipInsideArea);
+ }
+
+ if(segmentIndex == 2 && !reversed ||
+ segmentIndex == 0 && reversed)
+ {
+ // Draw second segment
+ intersectionPoint.dataPoint = firstPoint.dataPoint;
+ intersectionPoint.index = firstPoint.index;
+
+ segmentPath = this.Draw3DSurface(
+ area, matrix, lightStyle, surfaceName, positionZ, depth,
+ (!firstSegmentVisible && segmentNumber != 3) ? backColor : cutSurfaceBackColor,
+ (!firstSegmentVisible && segmentNumber != 3) ? borderColor : cutSurfaceBorderColor,
+ borderWidth, borderDashStyle,
+ intersectionPoint, secondPoint,
+ points, pointIndex, tension, operationType, lineSegmentType,
+ forceThinBorder, forceThickBorder, reversedSeriesOrder,
+ multiSeries, yValueIndex, clipInsideArea);
+ }
+
+ // Add segment path
+ if(resultPath != null && segmentPath != null && segmentPath.PointCount > 0)
+ {
+ resultPath.SetMarkers();
+ resultPath.AddPath(segmentPath, true);
+ }
+ }
+
+ // Restore previous y positions
+ firstPoint.yPosition = prevFirstPointY;
+ secondPoint.yPosition = prevSecondPointY;
+
+ return resultPath;
+ }
+ }
+
+ //**********************************************************************
+ //** Prepare, transform polygon coordinates
+ //**********************************************************************
+
+ // Define 4 points polygon
+ Point3D [] points3D = new Point3D[4];
+ points3D[0] = new Point3D((float)firstPoint.xPosition, (float)firstPoint.yPosition, positionZ + depth);
+ points3D[1] = new Point3D((float)secondPoint.xPosition, (float)secondPoint.yPosition, positionZ + depth);
+ points3D[2] = new Point3D((float)secondPoint.xPosition, (float)secondPoint.yPosition, positionZ);
+ points3D[3] = new Point3D((float)firstPoint.xPosition, (float)firstPoint.yPosition, positionZ);
+
+ // Transform coordinates
+ matrix.TransformPoints( points3D );
+
+ // Get absolute coordinates and create array of PointF
+ PointF[] polygonPoints = new PointF[4];
+ polygonPoints[0] = GetAbsolutePoint(points3D[0].PointF);
+ polygonPoints[1] = GetAbsolutePoint(points3D[1].PointF);
+ polygonPoints[2] = GetAbsolutePoint(points3D[2].PointF);
+ polygonPoints[3] = GetAbsolutePoint(points3D[3].PointF);
+
+ //**********************************************************************
+ //** Define drawing colors
+ //**********************************************************************
+ bool topIsVisible = IsSurfaceVisible( points3D[0], points3D[1], points3D[2]);
+ Color polygonColor = matrix.GetPolygonLight( points3D, backColor, topIsVisible, area.Area3DStyle.Rotation, surfaceName, area.ReverseSeriesOrder );
+ Color surfaceBorderColor = borderColor;
+ if(surfaceBorderColor == Color.Empty)
+ {
+ // If border color is emty use color slightly darker than main back color
+ surfaceBorderColor = ChartGraphics.GetGradientColor( backColor, Color.Black, 0.2 );
+ }
+
+ //**********************************************************************
+ //** Draw elements if required.
+ //**********************************************************************
+ Pen thinBorderPen = new Pen(surfaceBorderColor, 1);
+ if(drawElements)
+ {
+ // Draw the polygon
+ if(backColor != Color.Transparent)
+ {
+ // Remember SmoothingMode and turn off anti aliasing
+ SmoothingMode oldSmoothingMode = SmoothingMode;
+ SmoothingMode = SmoothingMode.Default;
+
+ // Draw the polygon
+ using (Brush brush = new SolidBrush(polygonColor))
+ {
+ FillPolygon(brush, polygonPoints);
+ }
+
+ // Return old smoothing mode
+ SmoothingMode = oldSmoothingMode;
+ }
+
+ // Draw thin polygon border of darker color
+ if(forceThinBorder || forceThickBorder)
+ {
+ if(forceThickBorder)
+ {
+ Pen linePen = new Pen(surfaceBorderColor, borderWidth);
+ linePen.StartCap = LineCap.Round;
+ linePen.EndCap = LineCap.Round;
+
+ DrawLine(linePen, polygonPoints[0], polygonPoints[1]);
+ DrawLine(linePen, polygonPoints[2], polygonPoints[3]);
+ DrawLine(linePen, polygonPoints[3], polygonPoints[0]);
+ DrawLine(linePen, polygonPoints[1], polygonPoints[2]);
+ }
+ else
+ {
+ // Front & Back lines
+ DrawLine(thinBorderPen, polygonPoints[0], polygonPoints[1]);
+ DrawLine(thinBorderPen, polygonPoints[2], polygonPoints[3]);
+ if(lineSegmentType == LineSegmentType.First)
+ {
+ // Left line
+ DrawLine(thinBorderPen, polygonPoints[3], polygonPoints[0]);
+ }
+ else if(lineSegmentType == LineSegmentType.Last)
+ {
+ // Right Line
+ DrawLine(thinBorderPen, polygonPoints[1], polygonPoints[2]);
+ }
+ else
+ {
+ // Left & Right lines
+ DrawLine(thinBorderPen, polygonPoints[3], polygonPoints[0]);
+ DrawLine(thinBorderPen, polygonPoints[1], polygonPoints[2]);
+ }
+ }
+
+ }
+ else
+ {
+ // Draw thin polygon border of same color (solves anti-aliasing issues)
+ if(polygonColor.A == 255)
+ {
+ DrawPolygon(new Pen(polygonColor, 1), polygonPoints);
+ }
+
+ // Draw thin Front & Back lines
+ DrawLine(thinBorderPen, polygonPoints[0], polygonPoints[1]);
+ DrawLine(thinBorderPen, polygonPoints[2], polygonPoints[3]);
+ }
+ }
+
+ //**********************************************************************
+ //** Draw thick border line on visible sides
+ //**********************************************************************
+ Pen thickBorderPen = null;
+ if(borderWidth > 1 && !forceThickBorder)
+ {
+ // Create thick border line pen
+ thickBorderPen = new Pen(surfaceBorderColor, borderWidth);
+ thickBorderPen.StartCap = LineCap.Round;
+ thickBorderPen.EndCap = LineCap.Round;
+
+ //****************************************************************
+ //** Switch first and second points.
+ //****************************************************************
+ if(firstPoint.index > secondPoint.index)
+ {
+ DataPoint3D tempPoint = firstPoint;
+ firstPoint = secondPoint;
+ secondPoint = tempPoint;
+ }
+
+ //**********************************************************************
+ //** Check if there are visible (non-empty) lines to the left & right
+ //** of the current line.
+ //**********************************************************************
+
+ // Get visibility of bounding rectangle
+ float minX = (float)Math.Min(points3D[0].X, points3D[1].X);
+ float minY = (float)Math.Min(points3D[0].Y, points3D[1].Y);
+ float maxX = (float)Math.Max(points3D[0].X, points3D[1].X);
+ float maxY = (float)Math.Max(points3D[0].Y, points3D[1].Y);
+ RectangleF position = new RectangleF(minX, minY, maxX - minX, maxY - minY);
+ SurfaceNames visibleSurfaces = GetVisibleSurfaces(position,positionZ,depth,matrix);
+
+ // Check left line visibility
+ bool thickBorderOnLeft = false;
+ bool thickBorderOnRight = false;
+
+ if(lineSegmentType != LineSegmentType.Middle)
+ {
+ LineSegmentType tempLineSegmentType = LineSegmentType.Single;
+
+ // Check left line visibility
+ thickBorderOnLeft = (ChartGraphics.ShouldDrawLineChartSurface(
+ area,
+ reversedSeriesOrder,
+ SurfaceNames.Left,
+ visibleSurfaces,
+ polygonColor,
+ points,
+ firstPoint,
+ secondPoint,
+ multiSeries,
+ ref tempLineSegmentType) == 2);
+
+
+ // Check right line visibility
+ thickBorderOnRight = (ChartGraphics.ShouldDrawLineChartSurface(
+ area,
+ reversedSeriesOrder,
+ SurfaceNames.Right,
+ visibleSurfaces,
+ polygonColor,
+ points,
+ firstPoint,
+ secondPoint,
+ multiSeries,
+ ref tempLineSegmentType) == 2);
+ }
+
+ // Switch left & right border if series is reversed
+ if(reversedSeriesOrder)
+ {
+ bool tempVal = thickBorderOnLeft;
+ thickBorderOnLeft = thickBorderOnRight;
+ thickBorderOnRight = tempVal;
+ }
+
+ // Draw thick border for single segment lines only
+ // or for the first & last segment
+ if(lineSegmentType != LineSegmentType.First && lineSegmentType != LineSegmentType.Single)
+ {
+ thickBorderOnLeft = false;
+ }
+ if(lineSegmentType != LineSegmentType.Last && lineSegmentType != LineSegmentType.Single)
+ {
+ thickBorderOnRight = false;
+ }
+
+ //**********************************************************************
+ //** Draw border on the front side of line surface (only when visible)
+ //**********************************************************************
+ if( matrix.Perspective != 0 ||
+ (matrix.AngleX != 90 && matrix.AngleX != -90 &&
+ matrix.AngleY != 90 && matrix.AngleY != -90 &&
+ matrix.AngleY != 180 && matrix.AngleY != -180))
+ {
+ // Draw thick line on the front side of the line surface
+ if(drawElements)
+ {
+ DrawLine(
+ thickBorderPen,
+ (float)Math.Round(polygonPoints[0].X),
+ (float)Math.Round(polygonPoints[0].Y),
+ (float)Math.Round(polygonPoints[1].X),
+ (float)Math.Round(polygonPoints[1].Y) );
+ }
+
+ // Calculate path for selection
+ if(resultPath != null)
+ {
+ // Add front line to the path
+ resultPath.AddLine(
+ (float)Math.Round(polygonPoints[0].X),
+ (float)Math.Round(polygonPoints[0].Y),
+ (float)Math.Round(polygonPoints[1].X),
+ (float)Math.Round(polygonPoints[1].Y));
+ }
+ }
+
+
+ //**********************************************************************
+ //** Draw border on the left side of line surface (only when visible)
+ //**********************************************************************
+
+ // Use flat end for Right & Left border
+ thickBorderPen.EndCap = LineCap.Flat;
+
+ // Draw border on the left side
+ if (matrix.Perspective != 0 || (matrix.AngleX != 90 && matrix.AngleX != -90))
+ {
+ if(thickBorderOnLeft)
+ {
+ if(drawElements)
+ {
+ DrawLine(
+ thickBorderPen,
+ (float)Math.Round(polygonPoints[3].X),
+ (float)Math.Round(polygonPoints[3].Y),
+ (float)Math.Round(polygonPoints[0].X),
+ (float)Math.Round(polygonPoints[0].Y) );
+ }
+
+ // Calculate path for selection
+ if(resultPath != null)
+ {
+ // Add left line to the path
+ resultPath.AddLine(
+ (float)Math.Round(polygonPoints[3].X),
+ (float)Math.Round(polygonPoints[3].Y),
+ (float)Math.Round(polygonPoints[0].X),
+ (float)Math.Round(polygonPoints[0].Y));
+ }
+ }
+ }
+
+ //**********************************************************************
+ //** Draw border on the right side of the line surface
+ //**********************************************************************
+ if (matrix.Perspective != 0 || (matrix.AngleX != 90 && matrix.AngleX != -90))
+ {
+ if(thickBorderOnRight)
+ {
+ if(drawElements)
+ {
+ DrawLine(
+ thickBorderPen,
+ (float)Math.Round(polygonPoints[1].X),
+ (float)Math.Round(polygonPoints[1].Y),
+ (float)Math.Round(polygonPoints[2].X),
+ (float)Math.Round(polygonPoints[2].Y) );
+ }
+
+ // Calculate path for selection
+ if(resultPath != null)
+ {
+ // Add right line to the path
+ resultPath.AddLine(
+ (float)Math.Round(polygonPoints[1].X),
+ (float)Math.Round(polygonPoints[1].Y),
+ (float)Math.Round(polygonPoints[2].X),
+ (float)Math.Round(polygonPoints[2].Y));
+ }
+ }
+ }
+ }
+
+ //**********************************************************************
+ // Redraw front line of the previuos line segment.
+ // Solves 3D visibility problem between wide border line and line surface.
+ //**********************************************************************
+ if( area.Area3DStyle.Perspective == 0 )
+ {
+ if(frontLinePoint1 != PointF.Empty && frontLinePen != null)
+ {
+ // Draw line
+ DrawLine(
+ frontLinePen,
+ (float)Math.Round(frontLinePoint1.X),
+ (float)Math.Round(frontLinePoint1.Y),
+ (float)Math.Round(frontLinePoint2.X),
+ (float)Math.Round(frontLinePoint2.Y) );
+
+ // Reset line properties
+ frontLinePen = null;
+ frontLinePoint1 = PointF.Empty;
+ frontLinePoint2 = PointF.Empty;
+ }
+
+ //**********************************************************************
+ //** Check if front line should be redrawn whith the next segment.
+ //**********************************************************************
+ if(drawElements)
+ {
+ frontLinePen = (borderWidth > 1) ? thickBorderPen : thinBorderPen;
+ frontLinePoint1 = polygonPoints[0];
+ frontLinePoint2 = polygonPoints[1];
+ }
+ }
+
+ //**********************************************************************
+ //** Calculate path for selection
+ //**********************************************************************
+ if(resultPath != null)
+ {
+ // Widen all the lines currently in the path
+ if(thickBorderPen != null)
+ {
+ try
+ {
+ resultPath.Widen(thickBorderPen);
+ }
+ catch (OutOfMemoryException)
+ {
+ // GraphicsPath.Widen incorrectly throws OutOfMemoryException
+ // catching here and reacting by not widening
+ }
+ catch (ArgumentException)
+ {
+ }
+ }
+
+ // Add polygon to the path
+ resultPath.AddPolygon(polygonPoints);
+ }
+
+ return resultPath;
+ }
+
+
+
+ /// <summary>
+ /// Helper method, which indicates if area chart surface should be drawn or not.
+ /// </summary>
+ /// <param name="area">Chart area object.</param>
+ /// <param name="reversedSeriesOrder">Series are drawn in reversed order.</param>
+ /// <param name="surfaceName">Surface name.</param>
+ /// <param name="boundaryRectVisibleSurfaces">Visible surfaces of the bounding rectangle.</param>
+ /// <param name="color">Point back color.</param>
+ /// <param name="points">Array of all points.</param>
+ /// <param name="firstPoint">First point.</param>
+ /// <param name="secondPoint">Second point.</param>
+ /// <param name="multiSeries">Indicates that multiple series are painted at the same time (stacked or side-by-side).</param>
+ /// <param name="lineSegmentType">Returns line segment type.</param>
+ /// <returns>Function retrns 0, 1 or 2. 0 - Do not draw surface, 1 - draw on the back, 2 - draw in front.</returns>
+ static internal int ShouldDrawLineChartSurface(
+ ChartArea area,
+ bool reversedSeriesOrder,
+ SurfaceNames surfaceName,
+ SurfaceNames boundaryRectVisibleSurfaces,
+ Color color,
+ ArrayList points,
+ DataPoint3D firstPoint,
+ DataPoint3D secondPoint,
+ bool multiSeries,
+ ref LineSegmentType lineSegmentType)
+ {
+ int result = 0;
+ Series series = firstPoint.dataPoint.series;
+
+ // Set active horizontal/vertical axis
+ Axis hAxis = (series.XAxisType == AxisType.Primary) ? area.AxisX : area.AxisX2;
+ double hAxisMin = hAxis.ViewMinimum;
+ double hAxisMax = hAxis.ViewMaximum;
+
+ //****************************************************************
+ //** Check if data point and it's neigbours have non-transparent
+ //** colors.
+ //****************************************************************
+
+ // Check if point main color has transparency
+ bool transparent = color.A != 255;
+
+ // Check if points on the left and right side exsit and are transparent
+ bool leftPointVisible = false;
+ bool rightPointVisible = false;
+ if( surfaceName == SurfaceNames.Left )
+ {
+ // Find Left point
+ DataPoint3D leftPoint = null, leftPointAttr = null;
+ int pointArrayIndex = int.MinValue;
+ if(!reversedSeriesOrder)
+ {
+ leftPoint = ChartGraphics.FindPointByIndex(points, Math.Min(firstPoint.index, secondPoint.index) - 1, (multiSeries) ? secondPoint : null, ref pointArrayIndex);
+ leftPointAttr = ChartGraphics.FindPointByIndex(points, Math.Min(firstPoint.index, secondPoint.index), (multiSeries) ? secondPoint : null, ref pointArrayIndex);
+ }
+ else
+ {
+ leftPoint = ChartGraphics.FindPointByIndex(points, Math.Max(firstPoint.index, secondPoint.index) + 1, (multiSeries) ? secondPoint : null, ref pointArrayIndex);
+ leftPointAttr = leftPoint;
+ }
+ if(leftPoint != null)
+ {
+ if(leftPointAttr.dataPoint.IsEmpty)
+ {
+ if(leftPointAttr.dataPoint.series.EmptyPointStyle.Color == color ||
+ leftPointAttr.dataPoint.series.EmptyPointStyle.Color.A == 255)
+ {
+ leftPointVisible = true;
+ }
+ }
+ else
+ {
+ if(leftPointAttr.dataPoint.Color == color ||
+ leftPointAttr.dataPoint.Color.A == 255)
+ {
+ leftPointVisible = true;
+ }
+ }
+
+ // Check if found point is outside the scaleView
+ double xValue = (leftPoint.indexedSeries) ? leftPoint.index : leftPoint.dataPoint.XValue;
+ if(xValue > hAxisMax || xValue < hAxisMin)
+ {
+ DataPoint3D currentPoint = null;
+ if(reversedSeriesOrder)
+ {
+ currentPoint = (firstPoint.index > secondPoint.index) ? firstPoint : secondPoint;
+ }
+ else
+ {
+ currentPoint = (firstPoint.index < secondPoint.index) ? firstPoint : secondPoint;
+ }
+ double currentXValue = (currentPoint.indexedSeries) ? currentPoint.index : currentPoint.dataPoint.XValue;
+ if(currentXValue > hAxisMax || currentXValue < hAxisMin)
+ {
+ leftPointVisible = false;
+ }
+ }
+ }
+ }
+
+ // Find Right point
+ if( surfaceName == SurfaceNames.Right )
+ {
+ DataPoint3D rightPoint = null, rightPointAttr = null;
+ int pointArrayIndex = int.MinValue;
+ if(!reversedSeriesOrder)
+ {
+ rightPoint = ChartGraphics.FindPointByIndex(points, Math.Max(firstPoint.index, secondPoint.index) + 1, (multiSeries) ? secondPoint : null, ref pointArrayIndex);
+ rightPointAttr = rightPoint;
+ }
+ else
+ {
+ rightPoint = ChartGraphics.FindPointByIndex(points, Math.Min(firstPoint.index, secondPoint.index) - 1, (multiSeries) ? secondPoint : null, ref pointArrayIndex);
+ rightPointAttr = ChartGraphics.FindPointByIndex(points, Math.Min(firstPoint.index, secondPoint.index), (multiSeries) ? secondPoint : null, ref pointArrayIndex);
+ }
+ if(rightPoint != null)
+ {
+ if(rightPointAttr.dataPoint.IsEmpty)
+ {
+ if(rightPointAttr.dataPoint.series.EmptyPointStyle.Color == color ||
+ rightPointAttr.dataPoint.series.EmptyPointStyle.Color.A == 255)
+ {
+ rightPointVisible = true;
+ }
+ }
+ else
+ {
+ if(rightPointAttr.dataPoint.Color == color ||
+ rightPointAttr.dataPoint.Color.A == 255)
+ {
+ rightPointVisible = true;
+ }
+ }
+
+ // Check if found point is outside the scaleView
+ double xValue = (rightPoint.indexedSeries) ? rightPoint.index : rightPoint.dataPoint.XValue;
+ if(xValue > hAxisMax || xValue < hAxisMin)
+ {
+ DataPoint3D currentPoint = null;
+ if(reversedSeriesOrder)
+ {
+ currentPoint = (firstPoint.index > secondPoint.index) ? firstPoint : secondPoint;
+ }
+ else
+ {
+ currentPoint = (firstPoint.index < secondPoint.index) ? firstPoint : secondPoint;
+ }
+ double currentXValue = (currentPoint.indexedSeries) ? currentPoint.index : currentPoint.dataPoint.XValue;
+ if(currentXValue > hAxisMax || currentXValue < hAxisMin)
+ {
+ rightPointVisible = false;
+ }
+ }
+ }
+ }
+
+ //****************************************************************
+ //** Get line segment
+ //****************************************************************
+ if( surfaceName == SurfaceNames.Left && !leftPointVisible)
+ {
+ if(lineSegmentType == LineSegmentType.Middle)
+ {
+ lineSegmentType = LineSegmentType.First;
+ }
+ else if(lineSegmentType == LineSegmentType.Last)
+ {
+ lineSegmentType = LineSegmentType.Single;
+ }
+ }
+ if( surfaceName == SurfaceNames.Right && !rightPointVisible)
+ {
+ if(lineSegmentType == LineSegmentType.Middle)
+ {
+ lineSegmentType = LineSegmentType.Last;
+ }
+ else if(lineSegmentType == LineSegmentType.First)
+ {
+ lineSegmentType = LineSegmentType.Single;
+ }
+ }
+
+
+ //****************************************************************
+ //** Check surfaces visibility
+ //****************************************************************
+ if( surfaceName == SurfaceNames.Top )
+ {
+ result = ((boundaryRectVisibleSurfaces & SurfaceNames.Top) == SurfaceNames.Top) ? 2 : 1;
+ }
+ if( surfaceName == SurfaceNames.Bottom )
+ {
+ result = ((boundaryRectVisibleSurfaces & SurfaceNames.Bottom) == SurfaceNames.Bottom) ? 2 : 1;
+ // Draw invisible bottom surface only if chart is transparent
+ if(result == 1 && !transparent)
+ {
+ result = 0;
+ }
+ }
+ if( surfaceName == SurfaceNames.Front )
+ {
+ result = ((boundaryRectVisibleSurfaces & SurfaceNames.Front) == SurfaceNames.Front) ? 2 : 1;
+ // Draw invisible front surface only if chart is transparent
+ if(result == 1 && !transparent)
+ {
+ result = 0;
+ }
+ }
+ if( surfaceName == SurfaceNames.Back )
+ {
+ result = ((boundaryRectVisibleSurfaces & SurfaceNames.Back) == SurfaceNames.Back) ? 2 : 1;
+ // Draw invisible back surface only if chart is transparent
+ if(result == 1 && !transparent)
+ {
+ result = 0;
+ }
+ }
+ if( surfaceName == SurfaceNames.Left )
+ {
+ result = ((boundaryRectVisibleSurfaces & SurfaceNames.Left) == SurfaceNames.Left) ? 2 : 1;
+ // Draw invisible left surface only if point to the left is transparent
+ if(leftPointVisible)
+ {
+ result = 0;
+ }
+ }
+ if( surfaceName == SurfaceNames.Right )
+ {
+ result = ((boundaryRectVisibleSurfaces & SurfaceNames.Right) == SurfaceNames.Right) ? 2 : 1;
+ // Draw invisible right surface only if point to the right is transparent
+ if(rightPointVisible)
+ {
+ result = 0;
+ }
+ }
+
+ return result;
+ }
+
+
+ /// <summary>
+ /// Helper method which finds point in the list by it's real index.
+ /// </summary>
+ /// <param name="points">List of points.</param>
+ /// <param name="index">Required index.</param>
+ /// <param name="neighborDataPoint">Neighbor point of the same series.</param>
+ /// <param name="neighborPointIndex">Neighbor point index in the array list.</param>
+ /// <returns>Data point found.</returns>
+ internal static DataPoint3D FindPointByIndex(ArrayList points, int index, DataPoint3D neighborDataPoint, ref int neighborPointIndex)
+ {
+ // Try to look around the neighbor point index
+ if(neighborPointIndex != int.MinValue)
+ {
+ // Try getting the next point
+ if(neighborPointIndex < (points.Count - 2))
+ {
+ DataPoint3D point = (DataPoint3D)points[neighborPointIndex + 1];
+
+ // Check required point index for the first point
+ if( point.index == index &&
+ (neighborDataPoint == null || String.Compare(neighborDataPoint.dataPoint.series.Name, point.dataPoint.series.Name, StringComparison.Ordinal) == 0))
+ {
+ ++neighborPointIndex;
+ return point;
+ }
+ }
+
+ // Try getting the prev point
+ if(neighborPointIndex > 0)
+ {
+ DataPoint3D point = (DataPoint3D)points[neighborPointIndex - 1];
+
+ // Check required point index for the first point
+ if( point.index == index &&
+ (neighborDataPoint == null || String.Compare(neighborDataPoint.dataPoint.series.Name, point.dataPoint.series.Name, StringComparison.Ordinal) == 0))
+ {
+ --neighborPointIndex;
+ return point;
+ }
+ }
+
+ }
+
+ // Loop through all points
+ neighborPointIndex = 0;
+ foreach(DataPoint3D point3D in points)
+ {
+ // Check required point index for the first point
+ if(point3D.index == index)
+ {
+ // Check if point belongs to the same series
+ if(neighborDataPoint != null)
+ {
+ if (String.Compare(neighborDataPoint.dataPoint.series.Name, point3D.dataPoint.series.Name, StringComparison.Ordinal) != 0)
+ {
+ ++neighborPointIndex;
+ continue;
+ }
+ }
+
+ // Point found
+ return (DataPoint3D)point3D;
+ }
+
+ ++neighborPointIndex;
+ }
+
+ // Data point was not found
+ return null;
+ }
+
+
+ #endregion
+
+ #region 3D Rectangle drawing methods
+
+ /// <summary>
+ /// Function is used to calculate the coordinates of the 2D rectangle in 3D space
+ /// and either draw it or/and calculate the bounding path for selection.
+ /// </summary>
+ /// <param name="position">Position of 2D rectangle.</param>
+ /// <param name="positionZ">Z position of the back side of the 3D rectangle.</param>
+ /// <param name="depth">Depth of the 3D rectangle.</param>
+ /// <param name="matrix">Coordinate transformation matrix.</param>
+ /// <param name="lightStyle">LightStyle style (None, Simplistic, Realistic).</param>
+ /// <param name="backColor">Color of rectangle</param>
+ /// <param name="borderColor">Border Color</param>
+ /// <param name="borderWidth">Border Width</param>
+ /// <param name="borderDashStyle">Border Style</param>
+ /// <param name="operationType">AxisName of operation Drawing, Calculating Path or Both</param>
+ /// <returns>Returns elemnt shape path if operationType parameter is set to CalcElementPath, otherwise Null.</returns>
+ internal GraphicsPath Fill3DRectangle(
+ RectangleF position,
+ float positionZ,
+ float depth,
+ Matrix3D matrix,
+ LightStyle lightStyle,
+ Color backColor,
+ Color borderColor,
+ int borderWidth,
+ ChartDashStyle borderDashStyle,
+ DrawingOperationTypes operationType)
+ {
+ return Fill3DRectangle(
+ position,
+ positionZ,
+ depth,
+ matrix,
+ lightStyle,
+ backColor,
+ 0f,
+ 0f,
+ borderColor,
+ borderWidth,
+ borderDashStyle,
+ BarDrawingStyle.Default,
+ false,
+ operationType);
+ }
+
+ /// <summary>
+ /// Function is used to calculate the coordinates of the 2D rectangle in 3D space
+ /// and either draw it or/and calculate the bounding path for selection.
+ /// </summary>
+ /// <param name="position">Position of 2D rectangle.</param>
+ /// <param name="positionZ">Z position of the back side of the 3D rectangle.</param>
+ /// <param name="depth">Depth of the 3D rectangle.</param>
+ /// <param name="matrix">Coordinate transformation matrix.</param>
+ /// <param name="lightStyle">LightStyle style (None, Simplistic, Realistic).</param>
+ /// <param name="backColor">Color of rectangle</param>
+ /// <param name="topRightDarkening">Top (or right in bar chart) darkening effect.</param>
+ /// <param name="bottomLeftDarkening">Bottom (or left in bar chart) darkening effect.</param>
+ /// <param name="borderColor">Border Color</param>
+ /// <param name="borderWidth">Border Width</param>
+ /// <param name="borderDashStyle">Border Style</param>
+ /// <param name="barDrawingStyle">Bar drawing style.</param>
+ /// <param name="veticalOrientation">Defines if bar is vertical or horizontal.</param>
+ /// <param name="operationType">AxisName of operation Drawing, Calculating Path or Both</param>
+ /// <returns>Returns elemnt shape path if operationType parameter is set to CalcElementPath, otherwise Null.</returns>
+ internal GraphicsPath Fill3DRectangle(
+ RectangleF position,
+ float positionZ,
+ float depth,
+ Matrix3D matrix,
+ LightStyle lightStyle,
+ Color backColor,
+ float topRightDarkening,
+ float bottomLeftDarkening,
+ Color borderColor,
+ int borderWidth,
+ ChartDashStyle borderDashStyle,
+ BarDrawingStyle barDrawingStyle,
+ bool veticalOrientation,
+ DrawingOperationTypes operationType)
+ {
+
+ // Check if special drawing is required
+ if(barDrawingStyle == BarDrawingStyle.Cylinder)
+ {
+ // Draw as 3D cylinder
+ return Fill3DRectangleAsCylinder(
+ position,
+ positionZ,
+ depth,
+ matrix,
+ lightStyle,
+ backColor,
+ topRightDarkening,
+ bottomLeftDarkening,
+ borderColor,
+ borderWidth,
+ borderDashStyle,
+ veticalOrientation,
+ operationType);
+ }
+
+ // Declare variables
+ Point3D[] cubePoints = new Point3D[8];
+ GraphicsPath resultPath = ((operationType & DrawingOperationTypes.CalcElementPath) == DrawingOperationTypes.CalcElementPath)
+ ? new GraphicsPath() : null;
+
+ // Front Side
+ cubePoints[0] = new Point3D( position.X, position.Y, positionZ + depth );
+ cubePoints[1] = new Point3D( position.X, position.Bottom, positionZ + depth );
+ cubePoints[2] = new Point3D( position.Right, position.Bottom, positionZ + depth );
+ cubePoints[3] = new Point3D( position.Right, position.Y, positionZ + depth );
+
+ // Back Side
+ cubePoints[4] = new Point3D( position.X, position.Y, positionZ );
+ cubePoints[5] = new Point3D( position.X, position.Bottom, positionZ );
+ cubePoints[6] = new Point3D( position.Right, position.Bottom, positionZ );
+ cubePoints[7] = new Point3D( position.Right, position.Y, positionZ );
+
+ // Tranform cube coordinates
+ matrix.TransformPoints( cubePoints );
+
+ // For lightStyle style Non, Border color always exist.
+ if( lightStyle == LightStyle.None &&
+ (borderWidth == 0 || borderDashStyle == ChartDashStyle.NotSet || borderColor == Color.Empty) )
+ {
+ borderColor = ChartGraphics.GetGradientColor( backColor, Color.Black, 0.5 );
+ }
+
+ // Get surface colors
+ Color frontLightColor, leftLightColor, topLightColor, backLightColor, rightLightColor, bottomLightColor;
+ matrix.GetLight( backColor, out frontLightColor, out backLightColor, out leftLightColor, out rightLightColor, out topLightColor, out bottomLightColor );
+
+ // Darken colors by specified values
+ if(topRightDarkening != 0f)
+ {
+ if(veticalOrientation)
+ {
+ topLightColor = ChartGraphics.GetGradientColor(topLightColor, Color.Black, topRightDarkening);
+ }
+ else
+ {
+ rightLightColor = ChartGraphics.GetGradientColor(rightLightColor, Color.Black, topRightDarkening);
+ }
+ }
+ if(bottomLeftDarkening != 0f)
+ {
+ if(veticalOrientation)
+ {
+ bottomLightColor = ChartGraphics.GetGradientColor(bottomLightColor, Color.Black, bottomLeftDarkening);
+ }
+ else
+ {
+ leftLightColor = ChartGraphics.GetGradientColor(leftLightColor, Color.Black, bottomLeftDarkening);
+ }
+ }
+
+
+ // Check visible surfaces
+ SurfaceNames visibleSurfaces = GetVisibleSurfacesWithPerspective(position,positionZ,depth,matrix);
+
+ // Draw all invisible surfaces first (if semi-transparent color is used)
+ for(int drawVisible = 0; drawVisible <= 1; drawVisible++)
+ {
+ // Do not draw invisible surfaces for solid colors
+ if(drawVisible == 0 && backColor.A == 255)
+ {
+ continue;
+ }
+
+ // Check visibility of all surfaces and draw them
+ for(int surfaceIndex = (int)SurfaceNames.Front; surfaceIndex <= (int)SurfaceNames.Bottom; surfaceIndex *= 2)
+ {
+ SurfaceNames currentSurface = (SurfaceNames)surfaceIndex;
+
+ // If width, height or depth of the cube (3DRectangle) is zero graphical path
+ // should contain only one surface with 4 points.
+ if(depth == 0.0 && currentSurface != SurfaceNames.Front)
+ {
+ continue;
+ }
+ if(position.Width == 0.0 && currentSurface != SurfaceNames.Left && currentSurface != SurfaceNames.Right)
+ {
+ continue;
+ }
+ if(position.Height == 0.0 && currentSurface != SurfaceNames.Top && currentSurface != SurfaceNames.Bottom)
+ {
+ continue;
+ }
+
+ // Check if surface is visible or semi-transparent color is used
+ bool isVisible = (visibleSurfaces & currentSurface) != 0;
+ if(isVisible && drawVisible == 1 ||
+ !isVisible && drawVisible == 0)
+ {
+ // Fill surface coordinates and color
+ PointF [] pointsSurface = new PointF[4];
+ Color surfaceColor = backColor;
+
+ switch(currentSurface)
+ {
+ case(SurfaceNames.Front):
+ surfaceColor = frontLightColor;
+ pointsSurface[0] = new PointF(cubePoints[0].X, cubePoints[0].Y);
+ pointsSurface[1] = new PointF(cubePoints[1].X, cubePoints[1].Y);
+ pointsSurface[2] = new PointF(cubePoints[2].X, cubePoints[2].Y);
+ pointsSurface[3] = new PointF(cubePoints[3].X, cubePoints[3].Y);
+ break;
+ case(SurfaceNames.Back):
+ surfaceColor = backLightColor;
+ pointsSurface[0] = new PointF(cubePoints[4].X, cubePoints[4].Y);
+ pointsSurface[1] = new PointF(cubePoints[5].X, cubePoints[5].Y);
+ pointsSurface[2] = new PointF(cubePoints[6].X, cubePoints[6].Y);
+ pointsSurface[3] = new PointF(cubePoints[7].X, cubePoints[7].Y);
+ break;
+ case(SurfaceNames.Left):
+ surfaceColor = leftLightColor;
+ pointsSurface[0] = new PointF(cubePoints[0].X, cubePoints[0].Y);
+ pointsSurface[1] = new PointF(cubePoints[1].X, cubePoints[1].Y);
+ pointsSurface[2] = new PointF(cubePoints[5].X, cubePoints[5].Y);
+ pointsSurface[3] = new PointF(cubePoints[4].X, cubePoints[4].Y);
+ break;
+ case(SurfaceNames.Right):
+ surfaceColor = rightLightColor;
+ pointsSurface[0] = new PointF(cubePoints[3].X, cubePoints[3].Y);
+ pointsSurface[1] = new PointF(cubePoints[2].X, cubePoints[2].Y);
+ pointsSurface[2] = new PointF(cubePoints[6].X, cubePoints[6].Y);
+ pointsSurface[3] = new PointF(cubePoints[7].X, cubePoints[7].Y);
+ break;
+ case(SurfaceNames.Top):
+ surfaceColor = topLightColor;
+ pointsSurface[0] = new PointF(cubePoints[0].X, cubePoints[0].Y);
+ pointsSurface[1] = new PointF(cubePoints[3].X, cubePoints[3].Y);
+ pointsSurface[2] = new PointF(cubePoints[7].X, cubePoints[7].Y);
+ pointsSurface[3] = new PointF(cubePoints[4].X, cubePoints[4].Y);
+ break;
+ case(SurfaceNames.Bottom):
+ surfaceColor = bottomLightColor;
+ pointsSurface[0] = new PointF(cubePoints[1].X, cubePoints[1].Y);
+ pointsSurface[1] = new PointF(cubePoints[2].X, cubePoints[2].Y);
+ pointsSurface[2] = new PointF(cubePoints[6].X, cubePoints[6].Y);
+ pointsSurface[3] = new PointF(cubePoints[5].X, cubePoints[5].Y);
+ break;
+ }
+
+ // Covert coordinates to absolute
+ for(int pointIndex = 0; pointIndex < pointsSurface.Length; pointIndex++)
+ {
+ pointsSurface[pointIndex] = GetAbsolutePoint(pointsSurface[pointIndex]);
+ }
+
+ // Draw surface
+ if( (operationType & DrawingOperationTypes.DrawElement) == DrawingOperationTypes.DrawElement)
+ {
+ // Draw only completly visible surfaces
+ if((visibleSurfaces & currentSurface) != 0)
+ {
+ using (Brush brush = new SolidBrush(surfaceColor))
+ {
+ FillPolygon(brush, pointsSurface);
+ }
+
+ // Check if any additional drawing should be done
+ if(currentSurface == SurfaceNames.Front &&
+ barDrawingStyle != BarDrawingStyle.Default &&
+ barDrawingStyle != BarDrawingStyle.Cylinder)
+ {
+ this.DrawBarStyleGradients(matrix, barDrawingStyle, position, positionZ, depth, veticalOrientation);
+ }
+ }
+
+ // Draw surface border
+ using (Pen pen = new Pen(borderColor, borderWidth))
+ {
+ pen.DashStyle = GetPenStyle(borderDashStyle);
+ if (lightStyle != LightStyle.None &&
+ (borderWidth == 0 || borderDashStyle == ChartDashStyle.NotSet || borderColor == Color.Empty))
+ {
+ // Draw line of the same color inside the bar
+ pen.Color = surfaceColor;
+ pen.Width = 1;
+ pen.Alignment = PenAlignment.Inset;
+ }
+
+ pen.StartCap = LineCap.Round;
+ pen.EndCap = LineCap.Round;
+ DrawLine(pen, pointsSurface[0], pointsSurface[1]);
+ DrawLine(pen, pointsSurface[1], pointsSurface[2]);
+ DrawLine(pen, pointsSurface[2], pointsSurface[3]);
+ DrawLine(pen, pointsSurface[3], pointsSurface[0]);
+ }
+ }
+
+ // Add surface coordinate to the path
+ if( (operationType & DrawingOperationTypes.CalcElementPath) == DrawingOperationTypes.CalcElementPath)
+ {
+ // Only if surface is completly visible
+ if((visibleSurfaces & currentSurface) != 0)
+ {
+ resultPath.SetMarkers();
+ resultPath.AddPolygon(pointsSurface);
+ }
+ }
+
+ }
+ }
+ }
+
+ return resultPath;
+ }
+
+ /// <summary>
+ /// Draws special bar style effect on the front surface of the bar.
+ /// </summary>
+ /// <param name="matrix">Drawing matrix.</param>
+ /// <param name="barDrawingStyle">Bar drawing style.</param>
+ /// <param name="position">Position in relative coordinates</param>
+ /// <param name="positionZ">Z position.</param>
+ /// <param name="depth">Depth.</param>
+ /// <param name="isVertical">Defines if bar is vertical or horizontal.</param>
+ private void DrawBarStyleGradients(
+ Matrix3D matrix,
+ BarDrawingStyle barDrawingStyle,
+ RectangleF position,
+ float positionZ,
+ float depth,
+ bool isVertical)
+ {
+ if(barDrawingStyle == BarDrawingStyle.Wedge)
+ {
+ // Calculate wedge size to fit the rectangle
+ RectangleF positionAbs = GetAbsoluteRectangle(position);
+ float size = (isVertical) ? positionAbs.Width / 2f : positionAbs.Height / 2f;
+ if(isVertical && 2f * size > positionAbs.Height)
+ {
+ size = positionAbs.Height/2f;
+ }
+ if(!isVertical && 2f * size > positionAbs.Width)
+ {
+ size = positionAbs.Width/2f;
+ }
+ SizeF sizeRel = GetRelativeSize(new SizeF(size, size));
+
+ // Make 3D convertion of the key points
+ Point3D[] gradientPoints = new Point3D[6];
+ gradientPoints[0] = new Point3D( position.Left, position.Top, positionZ + depth );
+ gradientPoints[1] = new Point3D( position.Left, position.Bottom, positionZ + depth );
+ gradientPoints[2] = new Point3D( position.Right, position.Bottom, positionZ + depth );
+ gradientPoints[3] = new Point3D( position.Right, position.Top, positionZ + depth );
+ if(isVertical)
+ {
+ gradientPoints[4] = new Point3D( position.X + position.Width / 2f, position.Top + sizeRel.Height, positionZ + depth );
+ gradientPoints[5] = new Point3D( position.X + position.Width / 2f, position.Bottom - sizeRel.Height, positionZ + depth );
+ }
+ else
+ {
+ gradientPoints[4] = new Point3D( position.X + sizeRel.Width, position.Top + position.Height / 2f, positionZ + depth );
+ gradientPoints[5] = new Point3D( position.Right - sizeRel.Width, position.Top + position.Height / 2f, positionZ + depth );
+ }
+
+ // Tranform cube coordinates
+ matrix.TransformPoints( gradientPoints );
+
+ // Convert points to absolute
+ PointF [] gradientPointsAbs = new PointF[6];
+ for(int index = 0; index < gradientPoints.Length; index++)
+ {
+ gradientPointsAbs[index] = GetAbsolutePoint(gradientPoints[index].PointF);
+ }
+
+
+ // Draw left/bottom shadow
+ using(GraphicsPath path = new GraphicsPath())
+ {
+ if(isVertical)
+ {
+ path.AddLine(gradientPointsAbs[4], gradientPointsAbs[5]);
+ path.AddLine(gradientPointsAbs[5], gradientPointsAbs[2]);
+ path.AddLine(gradientPointsAbs[2], gradientPointsAbs[3]);
+ }
+ else
+ {
+ path.AddLine(gradientPointsAbs[4], gradientPointsAbs[5]);
+ path.AddLine(gradientPointsAbs[5], gradientPointsAbs[2]);
+ path.AddLine(gradientPointsAbs[2], gradientPointsAbs[1]);
+ }
+ path.CloseAllFigures();
+
+ // Create brush and fill path
+ using(SolidBrush brush = new SolidBrush(Color.FromArgb(90, Color.Black)))
+ {
+ this.FillPath(brush, path);
+ }
+ }
+
+ // Draw top/right triangle
+ using(GraphicsPath path = new GraphicsPath())
+ {
+ if(isVertical)
+ {
+ path.AddLine(gradientPointsAbs[0], gradientPointsAbs[4]);
+ path.AddLine(gradientPointsAbs[4], gradientPointsAbs[3]);
+ }
+ else
+ {
+ path.AddLine(gradientPointsAbs[3], gradientPointsAbs[5]);
+ path.AddLine(gradientPointsAbs[5], gradientPointsAbs[2]);
+ }
+
+ // Create brush and fill path
+ using(SolidBrush brush = new SolidBrush(Color.FromArgb(50, Color.Black)))
+ {
+ // Fill shadow path on the left-bottom side of the bar
+ this.FillPath(brush, path);
+
+ // Draw Lines
+ using(Pen penDark = new Pen(Color.FromArgb(20, Color.Black), 1))
+ {
+ this.DrawPath(penDark, path);
+ this.DrawLine(
+ penDark,
+ gradientPointsAbs[4],
+ gradientPointsAbs[5]);
+ }
+
+ // Draw Lines
+ using(Pen pen = new Pen(Color.FromArgb(40, Color.White), 1))
+ {
+ this.DrawPath(pen, path);
+ this.DrawLine(
+ pen,
+ gradientPointsAbs[4],
+ gradientPointsAbs[5]);
+ }
+ }
+ }
+
+ // Draw bottom/left triangle
+ using(GraphicsPath path = new GraphicsPath())
+ {
+ if(isVertical)
+ {
+ path.AddLine(gradientPointsAbs[1], gradientPointsAbs[5]);
+ path.AddLine(gradientPointsAbs[5], gradientPointsAbs[2]);
+ }
+ else
+ {
+ path.AddLine(gradientPointsAbs[0], gradientPointsAbs[4]);
+ path.AddLine(gradientPointsAbs[4], gradientPointsAbs[1]);
+ }
+
+ // Create brush
+ using(SolidBrush brush = new SolidBrush(Color.FromArgb(50, Color.Black)))
+ {
+ // Fill shadow path on the left-bottom side of the bar
+ this.FillPath(brush, path);
+
+ // Draw edges
+ using(Pen penDark = new Pen(Color.FromArgb(20, Color.Black), 1))
+ {
+ this.DrawPath(penDark, path);
+ }
+ using(Pen pen = new Pen(Color.FromArgb(40, Color.White), 1))
+ {
+ this.DrawPath(pen, path);
+ }
+ }
+ }
+
+
+ }
+ else if(barDrawingStyle == BarDrawingStyle.LightToDark)
+ {
+ // Calculate width of shadows used to create the effect
+ RectangleF positionAbs = GetAbsoluteRectangle(position);
+ float shadowSizeAbs = 5f;
+ if(positionAbs.Width < 6f || positionAbs.Height < 6f)
+ {
+ shadowSizeAbs = 2f;
+ }
+ else if(positionAbs.Width < 15f || positionAbs.Height < 15f)
+ {
+ shadowSizeAbs = 3f;
+ }
+ SizeF shadowSizeRel = GetRelativeSize(new SizeF(shadowSizeAbs, shadowSizeAbs));
+
+ // Calculate gradient position
+ RectangleF gradientRect = position;
+ gradientRect.Inflate(-shadowSizeRel.Width, -shadowSizeRel.Height);
+ if(isVertical)
+ {
+ gradientRect.Height = (float)Math.Floor(gradientRect.Height / 3f);
+ }
+ else
+ {
+ gradientRect.X = gradientRect.Right - (float)Math.Floor(gradientRect.Width / 3f);
+ gradientRect.Width = (float)Math.Floor(gradientRect.Width / 3f);
+ }
+
+
+ // Top gradient
+ Point3D[] gradientPoints = new Point3D[4];
+ gradientPoints[0] = new Point3D( gradientRect.Left, gradientRect.Top, positionZ + depth );
+ gradientPoints[1] = new Point3D( gradientRect.Left, gradientRect.Bottom, positionZ + depth );
+ gradientPoints[2] = new Point3D( gradientRect.Right, gradientRect.Bottom, positionZ + depth );
+ gradientPoints[3] = new Point3D( gradientRect.Right, gradientRect.Top, positionZ + depth );
+
+ // Tranform cube coordinates
+ matrix.TransformPoints( gradientPoints );
+
+ // Convert points to absolute
+ PointF [] gradientPointsAbs = new PointF[4];
+ for(int index = 0; index < gradientPoints.Length; index++)
+ {
+ gradientPointsAbs[index] = GetAbsolutePoint(gradientPoints[index].PointF);
+ }
+
+ // Create and draw top path
+ using(GraphicsPath path = new GraphicsPath())
+ {
+ path.AddPolygon(gradientPointsAbs);
+ RectangleF bounds = path.GetBounds();
+ bounds.Width += 1f;
+ bounds.Height += 1f;
+
+ // Create brush
+ if(bounds.Width > 0f && bounds.Height > 0f)
+ {
+ using(LinearGradientBrush topBrush = new LinearGradientBrush(
+ bounds,
+ (!isVertical) ? Color.Transparent : Color.FromArgb(120, Color.White),
+ (!isVertical) ? Color.FromArgb(120, Color.White) : Color.Transparent,
+ (isVertical) ? LinearGradientMode.Vertical : LinearGradientMode.Horizontal))
+ {
+ // Fill shadow path on the top side of the bar
+ this.FillPath(topBrush, path);
+ }
+ }
+ }
+
+
+
+ // Calculate gradient position for the bottom gradient
+ gradientRect = position;
+ gradientRect.Inflate(-shadowSizeRel.Width, -shadowSizeRel.Height);
+ if(isVertical)
+ {
+ gradientRect.Y = gradientRect.Bottom - (float)Math.Floor(gradientRect.Height / 3f);
+ gradientRect.Height = (float)Math.Floor(gradientRect.Height / 3f);
+ }
+ else
+ {
+ gradientRect.Width = (float)Math.Floor(gradientRect.Width / 3f);
+ }
+
+
+ // Top gradient
+ gradientPoints = new Point3D[4];
+ gradientPoints[0] = new Point3D( gradientRect.Left, gradientRect.Top, positionZ + depth );
+ gradientPoints[1] = new Point3D( gradientRect.Left, gradientRect.Bottom, positionZ + depth );
+ gradientPoints[2] = new Point3D( gradientRect.Right, gradientRect.Bottom, positionZ + depth );
+ gradientPoints[3] = new Point3D( gradientRect.Right, gradientRect.Top, positionZ + depth );
+
+ // Tranform cube coordinates
+ matrix.TransformPoints( gradientPoints );
+
+ // Convert points to absolute
+ gradientPointsAbs = new PointF[4];
+ for(int index = 0; index < gradientPoints.Length; index++)
+ {
+ gradientPointsAbs[index] = GetAbsolutePoint(gradientPoints[index].PointF);
+ }
+
+ // Create and draw top path
+ using(GraphicsPath path = new GraphicsPath())
+ {
+ path.AddPolygon(gradientPointsAbs);
+ RectangleF bounds = path.GetBounds();
+ bounds.Width += 1f;
+ bounds.Height += 1f;
+
+ // Create brush
+ if(bounds.Width > 0f && bounds.Height > 0f)
+ {
+ using(LinearGradientBrush topBrush = new LinearGradientBrush(
+ bounds,
+ (isVertical) ? Color.Transparent : Color.FromArgb(80, Color.Black),
+ (isVertical) ? Color.FromArgb(80, Color.Black) : Color.Transparent,
+ (isVertical) ? LinearGradientMode.Vertical : LinearGradientMode.Horizontal))
+ {
+ // Fill shadow path on the top side of the bar
+ this.FillPath(topBrush, path);
+ }
+ }
+ }
+
+ }
+ else if(barDrawingStyle == BarDrawingStyle.Emboss)
+ {
+ // Calculate width of shadows used to create the effect
+ RectangleF positionAbs = GetAbsoluteRectangle(position);
+ float shadowSizeAbs = 4f;
+ if(positionAbs.Width < 6f || positionAbs.Height < 6f)
+ {
+ shadowSizeAbs = 2f;
+ }
+ else if(positionAbs.Width < 15f || positionAbs.Height < 15f)
+ {
+ shadowSizeAbs = 3f;
+ }
+ SizeF shadowSizeRel = GetRelativeSize(new SizeF(shadowSizeAbs, shadowSizeAbs));
+
+ // Left/top Side
+ Point3D[] gradientPoints = new Point3D[6];
+ gradientPoints[0] = new Point3D( position.Left, position.Bottom, positionZ + depth );
+ gradientPoints[1] = new Point3D( position.Left, position.Top, positionZ + depth );
+ gradientPoints[2] = new Point3D( position.Right, position.Top, positionZ + depth );
+ gradientPoints[3] = new Point3D( position.Right - shadowSizeRel.Width, position.Top + shadowSizeRel.Height, positionZ + depth );
+ gradientPoints[4] = new Point3D( position.Left + shadowSizeRel.Width, position.Top + shadowSizeRel.Height, positionZ + depth );
+ gradientPoints[5] = new Point3D( position.Left + shadowSizeRel.Width, position.Bottom - shadowSizeRel.Height, positionZ + depth );
+
+ // Tranform cube coordinates
+ matrix.TransformPoints( gradientPoints );
+
+ // Convert points to absolute
+ PointF [] gradientPointsAbs = new PointF[6];
+ for(int index = 0; index < gradientPoints.Length; index++)
+ {
+ gradientPointsAbs[index] = GetAbsolutePoint(gradientPoints[index].PointF);
+ }
+
+ // Create and draw left/top path
+ using(GraphicsPath path = new GraphicsPath())
+ {
+ path.AddPolygon(gradientPointsAbs);
+
+ // Create brush
+ using(SolidBrush leftTopBrush = new SolidBrush(Color.FromArgb(100, Color.White)))
+ {
+ // Fill shadow path on the left-bottom side of the bar
+ this.FillPath(leftTopBrush, path);
+ }
+ }
+
+ // Right/bottom Side
+ gradientPoints[0] = new Point3D( position.Right, position.Top, positionZ + depth );
+ gradientPoints[1] = new Point3D( position.Right, position.Bottom, positionZ + depth );
+ gradientPoints[2] = new Point3D( position.Left, position.Bottom, positionZ + depth );
+ gradientPoints[3] = new Point3D( position.Left + shadowSizeRel.Width, position.Bottom - shadowSizeRel.Height, positionZ + depth );
+ gradientPoints[4] = new Point3D( position.Right - shadowSizeRel.Width, position.Bottom - shadowSizeRel.Height, positionZ + depth );
+ gradientPoints[5] = new Point3D( position.Right - shadowSizeRel.Width, position.Top + shadowSizeRel.Height, positionZ + depth );
+
+ // Tranform cube coordinates
+ matrix.TransformPoints( gradientPoints );
+
+ // Convert points to absolute
+ for(int index = 0; index < gradientPoints.Length; index++)
+ {
+ gradientPointsAbs[index] = GetAbsolutePoint(gradientPoints[index].PointF);
+ }
+
+ // Create and draw left/top path
+ using(GraphicsPath path = new GraphicsPath())
+ {
+ path.AddPolygon(gradientPointsAbs);
+
+ // Create brush
+ using(SolidBrush bottomRightBrush = new SolidBrush(Color.FromArgb(80, Color.Black)))
+ {
+ // Fill shadow path on the left-bottom side of the bar
+ this.FillPath(bottomRightBrush, path);
+ }
+ }
+ }
+ }
+
+ #endregion
+
+ #region 3D markers drawing methods
+
+ /// <summary>
+ /// Draw marker using absolute coordinates of the center.
+ /// </summary>
+ /// <param name="matrix">Coordinates transformation matrix.</param>
+ /// <param name="lightStyle">LightStyle style (None, Simplistic, Realistic).</param>
+ /// <param name="positionZ">Z position of the 3D marker center.</param>
+ /// <param name="point">Coordinates of the center.</param>
+ /// <param name="markerStyle">Marker style.</param>
+ /// <param name="markerSize">Marker size.</param>
+ /// <param name="markerColor">Marker color.</param>
+ /// <param name="markerBorderColor">Marker border color.</param>
+ /// <param name="markerBorderSize">Marker border size.</param>
+ /// <param name="markerImage">Marker image name.</param>
+ /// <param name="markerImageTransparentColor">Marker image transparent color.</param>
+ /// <param name="shadowSize">Marker shadow size.</param>
+ /// <param name="shadowColor">Marker shadow color.</param>
+ /// <param name="imageScaleRect">Rectangle to which marker image should be scaled.</param>
+ /// <param name="operationType">AxisName of operation Drawing, Calculating Path or Both</param>
+ /// <returns>Returns elemnt shape path if operationType parameter is set to ElementPath, otherwise Null.</returns>
+ internal GraphicsPath DrawMarker3D(
+ Matrix3D matrix,
+ LightStyle lightStyle,
+ float positionZ,
+ PointF point,
+ MarkerStyle markerStyle,
+ int markerSize,
+ Color markerColor,
+ Color markerBorderColor,
+ int markerBorderSize,
+ string markerImage,
+ Color markerImageTransparentColor,
+ int shadowSize,
+ Color shadowColor,
+ RectangleF imageScaleRect,
+ DrawingOperationTypes operationType )
+ {
+ ChartGraphics graph = (ChartGraphics)this;
+ GraphicsPath resultPath = ((operationType & DrawingOperationTypes.CalcElementPath) == DrawingOperationTypes.CalcElementPath)
+ ? new GraphicsPath() : null;
+
+ //************************************************************
+ //** Transform marker position in 3D space
+ //************************************************************
+ // Get projection coordinates
+ Point3D[] marker3DPosition = new Point3D[1];
+ marker3DPosition[0] = new Point3D(point.X, point.Y, positionZ);
+
+ // Transform coordinates of the marker center
+ matrix.TransformPoints(marker3DPosition);
+ PointF markerRotatedPosition = marker3DPosition[0].PointF;
+
+ // Translate to absolute coordinates
+ markerRotatedPosition = graph.GetAbsolutePoint(markerRotatedPosition);
+
+ //************************************************************
+ //** For those markers that do not have a 3D version - draw the same as in 2D
+ //************************************************************
+ if(markerImage.Length > 0 ||
+ !(markerStyle == MarkerStyle.Circle ||
+ markerStyle == MarkerStyle.Square) )
+ {
+ // Call 2D version of the method
+ if( (operationType & DrawingOperationTypes.DrawElement) == DrawingOperationTypes.DrawElement)
+ {
+ graph.DrawMarkerAbs(markerRotatedPosition, markerStyle, markerSize, markerColor, markerBorderColor, markerBorderSize, markerImage, markerImageTransparentColor, shadowSize, shadowColor, imageScaleRect, false);
+ }
+
+ // Prepare marker path
+ if( (operationType & DrawingOperationTypes.CalcElementPath) == DrawingOperationTypes.CalcElementPath)
+ {
+ RectangleF rect = RectangleF.Empty;
+ rect.X = markerRotatedPosition.X - ((float)markerSize)/2F;
+ rect.Y = markerRotatedPosition.Y - ((float)markerSize)/2F;
+ rect.Width = markerSize;
+ rect.Height = markerSize;
+ resultPath.AddRectangle(rect);
+ }
+
+ return resultPath;
+ }
+
+ //************************************************************
+ //** Draw marker
+ //************************************************************
+ // Check if marker properties are set
+ if (markerStyle != MarkerStyle.None && markerSize > 0 && markerColor != Color.Empty)
+ {
+ // Create solid color brush
+ using (SolidBrush brush = new SolidBrush(markerColor))
+ {
+
+ // Calculate marker rectangle
+ RectangleF rect = RectangleF.Empty;
+ rect.X = markerRotatedPosition.X - ((float)markerSize) / 2F;
+ rect.Y = markerRotatedPosition.Y - ((float)markerSize) / 2F;
+ rect.Width = markerSize;
+ rect.Height = markerSize;
+
+ // Calculate relative marker size
+ SizeF markerRelativeSize = graph.GetRelativeSize(new SizeF(markerSize, markerSize));
+
+ // Draw marker depending on style
+ switch (markerStyle)
+ {
+ case (MarkerStyle.Circle):
+ {
+ if ((operationType & DrawingOperationTypes.DrawElement) == DrawingOperationTypes.DrawElement)
+ {
+ // Draw marker shadow
+ if (shadowSize != 0 && shadowColor != Color.Empty)
+ {
+ if (!graph.softShadows)
+ {
+ using (Brush shadowBrush = new SolidBrush((shadowColor.A != 255) ? shadowColor : Color.FromArgb(markerColor.A / 2, shadowColor)))
+ {
+ RectangleF shadowRect = rect;
+ shadowRect.X += shadowSize;
+ shadowRect.Y += shadowSize;
+ graph.FillEllipse(shadowBrush, shadowRect);
+ }
+ }
+ else
+ {
+ // Add circle to the graphics path
+ using (GraphicsPath path = new GraphicsPath())
+ {
+ path.AddEllipse(rect.X + shadowSize - 1, rect.Y + shadowSize - 1, rect.Width + 2, rect.Height + 2);
+
+ // Create path brush
+ using (PathGradientBrush shadowBrush = new PathGradientBrush(path))
+ {
+ shadowBrush.CenterColor = shadowColor;
+
+ // Set the color along the entire boundary of the path
+ Color[] colors = { Color.Transparent };
+ shadowBrush.SurroundColors = colors;
+ shadowBrush.CenterPoint = new PointF(markerRotatedPosition.X, markerRotatedPosition.Y);
+
+ // Define brush focus scale
+ PointF focusScale = new PointF(1 - 2f * shadowSize / rect.Width, 1 - 2f * shadowSize / rect.Height);
+ if (focusScale.X < 0)
+ {
+ focusScale.X = 0;
+ }
+ if (focusScale.Y < 0)
+ {
+ focusScale.Y = 0;
+ }
+ shadowBrush.FocusScales = focusScale;
+
+ // Draw shadow
+ graph.FillPath(shadowBrush, path);
+ }
+ }
+ }
+ }
+
+ // Create path gradient brush
+ using (GraphicsPath brushPath = new GraphicsPath())
+ {
+ RectangleF rectLightCenter = new RectangleF(rect.Location, rect.Size);
+ rectLightCenter.Inflate(rectLightCenter.Width / 4f, rectLightCenter.Height / 4f);
+ brushPath.AddEllipse(rectLightCenter);
+ using (PathGradientBrush circleBrush = new PathGradientBrush(brushPath))
+ {
+ circleBrush.CenterColor = ChartGraphics.GetGradientColor(markerColor, Color.White, 0.85);
+ circleBrush.SurroundColors = new Color[] { markerColor };
+
+ // Calculate the center point of the gradient
+ Point3D[] centerPoint = new Point3D[] { new Point3D(point.X, point.Y, positionZ + markerRelativeSize.Width) };
+ matrix.TransformPoints(centerPoint);
+ centerPoint[0].PointF = graph.GetAbsolutePoint(centerPoint[0].PointF);
+ circleBrush.CenterPoint = centerPoint[0].PointF;
+
+ // Draw circle (sphere)
+ graph.FillEllipse(circleBrush, rect);
+ graph.DrawEllipse(new Pen(markerBorderColor, markerBorderSize), rect);
+ }
+ }
+ }
+
+ // Prepare marker path
+ if ((operationType & DrawingOperationTypes.CalcElementPath) == DrawingOperationTypes.CalcElementPath)
+ {
+ resultPath.AddEllipse(rect);
+ }
+
+ break;
+ }
+ case (MarkerStyle.Square):
+ {
+
+ // Calculate marker non-rotated rectangle
+ RectangleF rectNonRotated = RectangleF.Empty;
+ rectNonRotated.X = point.X - ((float)markerRelativeSize.Width) / 2F;
+ rectNonRotated.Y = point.Y - ((float)markerRelativeSize.Height) / 2F;
+ rectNonRotated.Width = markerRelativeSize.Width;
+ rectNonRotated.Height = markerRelativeSize.Height;
+
+ // Draw 3D bar
+ resultPath = this.Fill3DRectangle(
+ rectNonRotated,
+ positionZ - markerRelativeSize.Width / 2f,
+ markerRelativeSize.Width,
+ matrix,
+ lightStyle,
+ markerColor,
+ markerBorderColor,
+ markerBorderSize,
+ ChartDashStyle.Solid,
+ operationType);
+
+ break;
+ }
+ default:
+ {
+ throw (new InvalidOperationException(SR.ExceptionGraphics3DMarkerStyleUnknown));
+ }
+ }
+ }
+ }
+
+ return resultPath;
+ }
+
+ #endregion
+
+ #region 3D cube surface visibility methods
+
+ /// <summary>
+ /// Returns visible surfaces of the 3D cube.
+ /// </summary>
+ /// <param name="position">2D rectangle coordinates.</param>
+ /// <param name="positionZ">Z coordinate of the back side of the cube.</param>
+ /// <param name="depth">Cube depth.</param>
+ /// <param name="matrix">Coordinate transformation matrix.</param>
+ /// <returns>Visible surfaces.</returns>
+ internal SurfaceNames GetVisibleSurfaces(
+ RectangleF position,
+ float positionZ,
+ float depth,
+ Matrix3D matrix
+ )
+ {
+ // Check if perspective is used
+ if(matrix.Perspective != 0)
+ {
+ // More sofisticated algorithm must be used for visibility detection.
+ return GetVisibleSurfacesWithPerspective(position, positionZ, depth, matrix);
+ }
+
+ // Front surface is always visible
+ SurfaceNames result = SurfaceNames.Front;
+
+ // Left and Right surfaces depend on the Y axis angle
+ if (matrix.AngleY > 0)
+ {
+ result |= SurfaceNames.Right;
+ }
+ else if (matrix.AngleY < 0)
+ {
+ result |= SurfaceNames.Left;
+ }
+
+ // Top and Bottom surfaces depend on the X axis angle
+ if (matrix.AngleX > 0)
+ {
+ result |= SurfaceNames.Top;
+ }
+ else if (matrix.AngleX < 0)
+ {
+ result |= SurfaceNames.Bottom;
+ }
+
+ return result;
+ }
+
+ /// <summary>
+ /// Returns visible surfaces of the 3D cube.
+ /// This method takes in consideration the perspective.
+ /// </summary>
+ /// <param name="position">2D rectangle coordinates.</param>
+ /// <param name="positionZ">Z coordinate of the back side of the cube.</param>
+ /// <param name="depth">Cube depth.</param>
+ /// <param name="matrix">Coordinate transformation matrix.</param>
+ /// <returns>Visible surfaces.</returns>
+ internal SurfaceNames GetVisibleSurfacesWithPerspective(
+ RectangleF position,
+ float positionZ,
+ float depth,
+ Matrix3D matrix)
+ {
+ // Create cube coordinates in 3D space
+ Point3D[] cubePoints = new Point3D[8];
+
+ // Front Side
+ cubePoints[0] = new Point3D( position.X, position.Y, positionZ + depth );
+ cubePoints[1] = new Point3D( position.X, position.Bottom, positionZ + depth );
+ cubePoints[2] = new Point3D( position.Right, position.Bottom, positionZ + depth );
+ cubePoints[3] = new Point3D( position.Right, position.Y, positionZ + depth );
+
+ // Back Side
+ cubePoints[4] = new Point3D( position.X, position.Y, positionZ );
+ cubePoints[5] = new Point3D( position.X, position.Bottom, positionZ );
+ cubePoints[6] = new Point3D( position.Right, position.Bottom, positionZ );
+ cubePoints[7] = new Point3D( position.Right, position.Y, positionZ );
+
+ // Tranform coordinates
+ matrix.TransformPoints( cubePoints );
+
+ // Detect surfaces visibility
+ return GetVisibleSurfacesWithPerspective(cubePoints);
+ }
+
+ /// <summary>
+ /// Returns visible surfaces of the 3D cube.
+ /// This method takes in consideration the perspective.
+ /// </summary>
+ /// <param name="cubePoints">Array of 8 points which define the cube.</param>
+ /// <returns>Visible surfaces.</returns>
+ internal SurfaceNames GetVisibleSurfacesWithPerspective(Point3D[] cubePoints)
+ {
+ // Check imput array size
+ if(cubePoints.Length != 8)
+ {
+ throw (new ArgumentException(SR.ExceptionGraphics3DCoordinatesInvalid, "cubePoints"));
+ }
+
+ // Detect surfaces visibility
+ SurfaceNames result = 0;
+
+ // Check the front side
+ if(IsSurfaceVisible(cubePoints[0],cubePoints[3],cubePoints[2]))
+ {
+ result |= SurfaceNames.Front;
+ }
+ // Check the back side
+ if(IsSurfaceVisible(cubePoints[4],cubePoints[5],cubePoints[6]))
+ {
+ result |= SurfaceNames.Back;
+ }
+
+ // Check the left side
+ if(IsSurfaceVisible(cubePoints[0],cubePoints[1],cubePoints[5]))
+ {
+ result |= SurfaceNames.Left;
+ }
+
+ // Check the right side
+ if(IsSurfaceVisible(cubePoints[3],cubePoints[7],cubePoints[6]))
+ {
+ result |= SurfaceNames.Right;
+ }
+
+ // Check the top side
+ if(IsSurfaceVisible(cubePoints[4],cubePoints[7],cubePoints[3]))
+ {
+ result |= SurfaceNames.Top;
+ }
+
+ // Check the bottom side
+ if(IsSurfaceVisible(cubePoints[1],cubePoints[2],cubePoints[6]))
+ {
+ result |= SurfaceNames.Bottom;
+ }
+
+ return result;
+ }
+
+ /// <summary>
+ /// Checks surface visibility using 3 points and clockwise points index rotation.
+ /// </summary>
+ /// <param name="first">First point.</param>
+ /// <param name="second">Second point.</param>
+ /// <param name="tree">Third point.</param>
+ /// <returns>True if surface is visible</returns>
+ internal static bool IsSurfaceVisible( Point3D first, Point3D second, Point3D tree )
+ {
+ // Check if points are oriented clocwise in 2D projection.
+ // If points are clockwise the surface is visible.
+ float a = ( first.Y - second.Y ) / ( first.X - second.X );
+ float b = first.Y - a * first.X;
+ if( first.X == second.X )
+ {
+ if( first.Y > second.Y )
+ {
+ if( tree.X > first.X )
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ else
+ {
+ if( tree.X > first.X )
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ }
+ else if ( first.X < second.X )
+ {
+ if( tree.Y < a * tree.X + b )
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ else
+ {
+ if( tree.Y <= a * tree.X + b )
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
+
+ #endregion
+
+ #region Line intersection helper method
+
+ /// <summary>
+ /// Gets intersection point of two lines
+ /// </summary>
+ /// <param name="x1">First X value of first line.</param>
+ /// <param name="y1">First Y value of first line.</param>
+ /// <param name="x2">Second X value of first line.</param>
+ /// <param name="y2">Second Y value of first line.</param>
+ /// <param name="x3">First X value of second line.</param>
+ /// <param name="y3">First Y value of second line.</param>
+ /// <param name="x4">Second X value of second line.</param>
+ /// <param name="y4">Second Y value of second line.</param>
+ /// <returns>Intersection coordinates.</returns>
+ internal static PointF GetLinesIntersection(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
+ {
+ PointF result = PointF.Empty;
+
+ // Special case for horizontal & vertical lines
+ if(x1 == x2 && y3 == y4)
+ {
+ result.X = x1;
+ result.Y = y3;
+ return result;
+ }
+ else if(y1 == y2 && x3 == x4)
+ {
+ result.X = x3;
+ result.Y = y1;
+ return result;
+ }
+ else if(x1 == x2)
+ {
+ result.X = x1;
+ result.Y = (result.X - x3) * (y4 - y3);
+ result.Y /= x4 - x3;
+ result.Y += y3;
+ return result;
+ }
+ else if(x3 == x4)
+ {
+ result.X = x3;
+ result.Y = (result.X - x1) * (y2 - y1);
+ result.Y /= x2 - x1;
+ result.Y += y1;
+ return result;
+ }
+
+ // Calculate line eqaution
+ float a1 = ( y1 - y2 ) / ( x1 - x2 );
+ float b1 = y1 - a1 * x1;
+ float a2 = ( y3 - y4 ) / ( x3 - x4 );
+ float b2 = y3 - a2 * x3;
+
+ // Calculate intersection point
+ result.X = (b2 - b1)/(a1 - a2);
+ result.Y = a1*result.X + b1;
+
+ return result;
+ }
+
+ #endregion
+
+ #region 3D Cylinder drawing methods
+
+
+ /// <summary>
+ /// Function is used to calculate the coordinates of the 2D rectangle in 3D space
+ /// and either draw it or/and calculate the bounding path for selection.
+ /// </summary>
+ /// <param name="position">Position of 2D rectangle.</param>
+ /// <param name="positionZ">Z position of the back side of the 3D rectangle.</param>
+ /// <param name="depth">Depth of the 3D rectangle.</param>
+ /// <param name="matrix">Coordinate transformation matrix.</param>
+ /// <param name="lightStyle">LightStyle style (None, Simplistic, Realistic).</param>
+ /// <param name="backColor">Color of rectangle</param>
+ /// <param name="topRightDarkening">Top (or right in bar chart) darkening effect.</param>
+ /// <param name="bottomLeftDarkening">Bottom (or left in bar chart) darkening effect.</param>
+ /// <param name="borderColor">Border Color</param>
+ /// <param name="borderWidth">Border Width</param>
+ /// <param name="borderDashStyle">Border Style</param>
+ /// <param name="veticalOrientation">Defines if bar is vertical or horizontal.</param>
+ /// <param name="operationType">AxisName of operation Drawing, Calculating Path or Both</param>
+ /// <returns>Returns elemnt shape path if operationType parameter is set to CalcElementPath, otherwise Null.</returns>
+ internal GraphicsPath Fill3DRectangleAsCylinder(
+ RectangleF position,
+ float positionZ,
+ float depth,
+ Matrix3D matrix,
+ LightStyle lightStyle,
+ Color backColor,
+ float topRightDarkening,
+ float bottomLeftDarkening,
+ Color borderColor,
+ int borderWidth,
+ ChartDashStyle borderDashStyle,
+ bool veticalOrientation,
+ DrawingOperationTypes operationType)
+ {
+ Point3D[] cubePoints = new Point3D[8];
+ GraphicsPath resultPath = ((operationType & DrawingOperationTypes.CalcElementPath) == DrawingOperationTypes.CalcElementPath)
+ ? new GraphicsPath() : null;
+
+ //*******************************************************
+ //** Define coordinates to draw the cylinder
+ //*******************************************************
+ if(veticalOrientation)
+ {
+ cubePoints[0] = new Point3D( position.X, position.Y, positionZ + depth / 2f );
+ cubePoints[1] = new Point3D( position.X, position.Bottom, positionZ + depth / 2f );
+ cubePoints[2] = new Point3D( position.Right, position.Bottom, positionZ + depth / 2f );
+ cubePoints[3] = new Point3D( position.Right, position.Y, positionZ + depth / 2f );
+
+ float middleXValue = position.X + position.Width / 2f;
+ cubePoints[4] = new Point3D( middleXValue, position.Y, positionZ + depth );
+ cubePoints[5] = new Point3D( middleXValue, position.Bottom, positionZ + depth );
+ cubePoints[6] = new Point3D( middleXValue, position.Bottom, positionZ );
+ cubePoints[7] = new Point3D( middleXValue, position.Y, positionZ );
+ }
+ else
+ {
+ cubePoints[0] = new Point3D( position.Right, position.Y, positionZ + depth / 2f );
+ cubePoints[1] = new Point3D( position.X, position.Y, positionZ + depth / 2f );
+ cubePoints[2] = new Point3D( position.X, position.Bottom, positionZ + depth / 2f );
+ cubePoints[3] = new Point3D( position.Right, position.Bottom, positionZ + depth / 2f );
+
+ float middleYValue = position.Y + position.Height / 2f;
+ cubePoints[4] = new Point3D( position.Right, middleYValue, positionZ + depth );
+ cubePoints[5] = new Point3D( position.X, middleYValue, positionZ + depth );
+ cubePoints[6] = new Point3D( position.X, middleYValue, positionZ );
+ cubePoints[7] = new Point3D( position.Right, middleYValue, positionZ );
+ }
+
+ // Tranform cylinder coordinates
+ matrix.TransformPoints( cubePoints );
+
+ // Covert coordinates to absolute
+ for(int pointIndex = 0; pointIndex < cubePoints.Length; pointIndex++)
+ {
+ cubePoints[pointIndex].PointF = GetAbsolutePoint(cubePoints[pointIndex].PointF);
+ }
+
+ //*******************************************************
+ //** Get cylinder colors.
+ //*******************************************************
+ if( lightStyle == LightStyle.None &&
+ (borderWidth == 0 || borderDashStyle == ChartDashStyle.NotSet || borderColor == Color.Empty) )
+ {
+ borderColor = ChartGraphics.GetGradientColor( backColor, Color.Black, 0.5 );
+ }
+
+ // Get surface colors
+ Color frontLightColor, leftLightColor, topLightColor, backLightColor, rightLightColor, bottomLightColor;
+ matrix.GetLight( backColor, out frontLightColor, out backLightColor, out leftLightColor, out rightLightColor, out topLightColor, out bottomLightColor );
+
+ // Darken colors by specified values
+ if(topRightDarkening != 0f)
+ {
+ if(veticalOrientation)
+ {
+ topLightColor = ChartGraphics.GetGradientColor(topLightColor, Color.Black, topRightDarkening);
+ }
+ else
+ {
+ rightLightColor = ChartGraphics.GetGradientColor(rightLightColor, Color.Black, topRightDarkening);
+ }
+ }
+ if(bottomLeftDarkening != 0f)
+ {
+ if(veticalOrientation)
+ {
+ bottomLightColor = ChartGraphics.GetGradientColor(bottomLightColor, Color.Black, bottomLeftDarkening);
+ }
+ else
+ {
+ leftLightColor = ChartGraphics.GetGradientColor(leftLightColor, Color.Black, bottomLeftDarkening);
+ }
+ }
+
+ //*******************************************************
+ //** Check visible surfaces
+ //*******************************************************
+ SurfaceNames visibleSurfaces = GetVisibleSurfacesWithPerspective(position,positionZ,depth,matrix);
+
+ // Front surface is always visible in cylinder
+ if( (visibleSurfaces & SurfaceNames.Front) != SurfaceNames.Front)
+ {
+ visibleSurfaces |= SurfaceNames.Front;
+ }
+
+ //*******************************************************
+ //** Create flattened paths for the sides of the
+ //** cylinder (top,bottom/left,rigth)
+ //*******************************************************
+ PointF[] sidePoints = new PointF[4];
+ sidePoints[0] = cubePoints[6].PointF;
+ sidePoints[1] = cubePoints[1].PointF;
+ sidePoints[2] = cubePoints[5].PointF;
+ sidePoints[3] = cubePoints[2].PointF;
+ GraphicsPath bottomLeftSide = new GraphicsPath();
+ bottomLeftSide.AddClosedCurve(sidePoints, 0.8f);
+ bottomLeftSide.Flatten();
+ sidePoints[0] = cubePoints[7].PointF;
+ sidePoints[1] = cubePoints[0].PointF;
+ sidePoints[2] = cubePoints[4].PointF;
+ sidePoints[3] = cubePoints[3].PointF;
+ GraphicsPath topRigthSide = new GraphicsPath();
+ topRigthSide.AddClosedCurve(sidePoints, 0.8f);
+ topRigthSide.Flatten();
+
+ //*******************************************************
+ //** Find cylinder angle
+ //*******************************************************
+ float cylinderAngle = 90f;
+ if(cubePoints[5].PointF.Y != cubePoints[4].PointF.Y)
+ {
+ cylinderAngle = (float)Math.Atan(
+ (cubePoints[4].PointF.X - cubePoints[5].PointF.X) /
+ (cubePoints[5].PointF.Y - cubePoints[4].PointF.Y) );
+ cylinderAngle = (float)Math.Round(cylinderAngle * 180f / (float)Math.PI);
+ }
+
+ //*******************************************************
+ //** Draw all invisible surfaces first (if semi-transparent color is used)
+ //*******************************************************
+ for(int drawVisible = 0; drawVisible <= 1; drawVisible++)
+ {
+ // Do not draw invisible surfaces for solid colors
+ if(drawVisible == 0 && backColor.A == 255)
+ {
+ continue;
+ }
+
+ // Check visibility of all surfaces and draw them
+ for(int surfaceIndex = (int)SurfaceNames.Front; surfaceIndex <= (int)SurfaceNames.Bottom; surfaceIndex *= 2)
+ {
+ SurfaceNames currentSurface = (SurfaceNames)surfaceIndex;
+
+ // Check if surface is visible or semi-transparent color is used
+ bool isVisible = (visibleSurfaces & currentSurface) != 0;
+ if(isVisible && drawVisible == 1 ||
+ !isVisible && drawVisible == 0)
+ {
+ // Fill surface coordinates and color
+ GraphicsPath pathToDraw = null;
+ Color surfaceColor = backColor;
+
+ // Declare a special brush for the front surface
+ Brush frontSurfaceBrush = null;
+
+ switch(currentSurface)
+ {
+ case(SurfaceNames.Front):
+ {
+ // Set front surface color
+ surfaceColor = backColor;
+
+ // Add ellipse segment of the cylinder on top/rigth (reversed)
+ pathToDraw = new GraphicsPath();
+ PointF leftSideLinePoint = PointF.Empty;
+ PointF rightSideLinePoint = PointF.Empty;
+ AddEllipseSegment(
+ pathToDraw,
+ topRigthSide,
+ bottomLeftSide,
+ (matrix.Perspective == 0) ? veticalOrientation : false,
+ cylinderAngle,
+ out leftSideLinePoint,
+ out rightSideLinePoint);
+ pathToDraw.Reverse();
+
+ // Add ellipse segment of the cylinder on bottom/left
+ PointF leftOppSideLinePoint = PointF.Empty;
+ PointF rightOppSideLinePoint = PointF.Empty;
+ AddEllipseSegment(
+ pathToDraw,
+ bottomLeftSide,
+ topRigthSide,
+ (matrix.Perspective == 0) ? veticalOrientation : false,
+ cylinderAngle,
+ out leftOppSideLinePoint,
+ out rightOppSideLinePoint);
+ pathToDraw.CloseAllFigures();
+
+ // Reset indexes of opposite side points
+ this._oppLeftBottomPoint = -1;
+ this._oppRigthTopPoint = -1;
+
+ // Create gradient brush for the front surface
+ if(lightStyle != LightStyle.None)
+ {
+ RectangleF boundsRect = pathToDraw.GetBounds();
+ if(boundsRect.Height > 0 && boundsRect.Width > 0)
+ {
+ Color lightColor = ChartGraphics.GetGradientColor( backColor, Color.White, 0.3 );
+ Color darkColor = ChartGraphics.GetGradientColor( backColor, Color.Black, 0.3 );
+
+ // Create gradient
+ if(!leftSideLinePoint.IsEmpty &&
+ !rightSideLinePoint.IsEmpty &&
+ !leftOppSideLinePoint.IsEmpty &&
+ !rightOppSideLinePoint.IsEmpty)
+ {
+ PointF boundsRectMiddlePoint = PointF.Empty;
+ boundsRectMiddlePoint.X = boundsRect.X + boundsRect.Width/2f;
+ boundsRectMiddlePoint.Y = boundsRect.Y + boundsRect.Height/2f;
+
+ PointF centralLinePoint = PointF.Empty;
+ double centralLineAngle = ((cylinderAngle) * Math.PI / 180f);
+ if(cylinderAngle == 0 || cylinderAngle == 180 || cylinderAngle == -180)
+ {
+ centralLinePoint.X = boundsRectMiddlePoint.X + 100f;
+ centralLinePoint.Y = boundsRectMiddlePoint.Y;
+ }
+ else if(cylinderAngle == 90 || cylinderAngle == -90)
+ {
+ centralLinePoint.X = boundsRectMiddlePoint.X;
+ centralLinePoint.Y = boundsRectMiddlePoint.Y + 100f;
+ }
+ else if(cylinderAngle > -45 && cylinderAngle < 45)
+ {
+ centralLinePoint.X = boundsRectMiddlePoint.X + 100f;
+ centralLinePoint.Y = (float)(Math.Tan(centralLineAngle) * centralLinePoint.X);
+ centralLinePoint.Y += (float)(boundsRectMiddlePoint.Y - Math.Tan(centralLineAngle) * boundsRectMiddlePoint.X);
+ }
+ else
+ {
+ centralLinePoint.Y = boundsRectMiddlePoint.Y + 100f;
+ centralLinePoint.X = (float)(centralLinePoint.Y - (boundsRectMiddlePoint.Y - Math.Tan(centralLineAngle) * boundsRectMiddlePoint.X));
+ centralLinePoint.X /= (float)(Math.Tan(centralLineAngle));
+ }
+
+
+ PointF middlePoint1 = ChartGraphics.GetLinesIntersection(
+ boundsRectMiddlePoint.X, boundsRectMiddlePoint.Y,
+ centralLinePoint.X, centralLinePoint.Y,
+ leftSideLinePoint.X, leftSideLinePoint.Y,
+ leftOppSideLinePoint.X, leftOppSideLinePoint.Y);
+
+ PointF middlePoint2 = ChartGraphics.GetLinesIntersection(
+ boundsRectMiddlePoint.X, boundsRectMiddlePoint.Y,
+ centralLinePoint.X, centralLinePoint.Y,
+ rightSideLinePoint.X, rightSideLinePoint.Y,
+ rightOppSideLinePoint.X, rightOppSideLinePoint.Y);
+
+ // Gradient points can not have same coordinates
+ if(middlePoint1.X != middlePoint2.X || middlePoint1.Y != middlePoint2.Y)
+ {
+ frontSurfaceBrush = new LinearGradientBrush(
+ middlePoint1,
+ middlePoint2,
+ lightColor,
+ darkColor);
+
+
+ ColorBlend colorBlend = new ColorBlend(5);
+ colorBlend.Colors[0] = darkColor;
+ colorBlend.Colors[1] = darkColor;
+ colorBlend.Colors[2] = lightColor;
+ colorBlend.Colors[3] = darkColor;
+ colorBlend.Colors[4] = darkColor;
+
+ colorBlend.Positions[0] = 0.0f;
+ colorBlend.Positions[1] = 0.0f;
+ colorBlend.Positions[2] = 0.5f;
+ colorBlend.Positions[3] = 1.0f;
+ colorBlend.Positions[4] = 1.0f;
+
+ ((LinearGradientBrush)frontSurfaceBrush).InterpolationColors = colorBlend;
+ }
+ }
+
+ }
+ }
+
+ break;
+ }
+ case(SurfaceNames.Top):
+ if(veticalOrientation)
+ {
+ surfaceColor = topLightColor;
+ pathToDraw = topRigthSide;
+ }
+ break;
+ case(SurfaceNames.Bottom):
+ if(veticalOrientation)
+ {
+ surfaceColor = bottomLightColor;
+ pathToDraw = bottomLeftSide;
+ }
+ break;
+ case(SurfaceNames.Right):
+ if(!veticalOrientation)
+ {
+ surfaceColor = rightLightColor;
+ pathToDraw = topRigthSide;
+ }
+ break;
+ case(SurfaceNames.Left):
+ if(!veticalOrientation)
+ {
+ surfaceColor = leftLightColor;
+ pathToDraw = bottomLeftSide;
+ }
+ break;
+ }
+
+
+ //*******************************************************
+ //** Draw surface
+ //*******************************************************
+ if(pathToDraw != null)
+ {
+ if( (operationType & DrawingOperationTypes.DrawElement) == DrawingOperationTypes.DrawElement)
+ {
+ // Draw only completly visible surfaces
+ if((visibleSurfaces & currentSurface) != 0)
+ {
+ using (Brush brush = new SolidBrush(surfaceColor))
+ {
+ FillPath( (frontSurfaceBrush == null) ? brush : frontSurfaceBrush, pathToDraw );
+ }
+ }
+
+ // Draw surface border
+ using (Pen pen = new Pen(borderColor, borderWidth))
+ {
+ pen.DashStyle = GetPenStyle(borderDashStyle);
+ if (lightStyle != LightStyle.None &&
+ (borderWidth == 0 || borderDashStyle == ChartDashStyle.NotSet || borderColor == Color.Empty))
+ {
+ // Draw line of the darker color inside the cylinder
+ pen.Color = frontSurfaceBrush == null ? surfaceColor : ChartGraphics.GetGradientColor(backColor, Color.Black, 0.3);
+ pen.Width = 1;
+ pen.Alignment = PenAlignment.Inset;
+ }
+
+ pen.StartCap = LineCap.Round;
+ pen.EndCap = LineCap.Round;
+ pen.LineJoin = LineJoin.Bevel;
+ DrawPath(pen, pathToDraw);
+ }
+ }
+
+ // Add surface coordinate to the path
+ if( (operationType & DrawingOperationTypes.CalcElementPath) == DrawingOperationTypes.CalcElementPath)
+ {
+ // Only if surface is completly visible
+ if((visibleSurfaces & currentSurface) != 0)
+ {
+ if(pathToDraw != null && pathToDraw.PointCount > 0)
+ {
+ resultPath.AddPath(pathToDraw, true);
+ resultPath.SetMarkers();
+ }
+ }
+ }
+ }
+
+ }
+ }
+ }
+
+ return resultPath;
+ }
+
+ /// <summary>
+ /// Adds segment of the ellipse to form the front surface of the cylinder
+ /// </summary>
+ internal void AddEllipseSegment(
+ GraphicsPath resultPath,
+ GraphicsPath ellipseFlattenPath,
+ GraphicsPath oppositeEllipseFlattenPath,
+ bool veticalOrientation,
+ float cylinderAngle,
+ out PointF leftSideLinePoint,
+ out PointF rightSideLinePoint)
+ {
+ // Initialize return values
+ leftSideLinePoint = PointF.Empty;
+ rightSideLinePoint = PointF.Empty;
+
+ // Check if input path is empty
+ if(ellipseFlattenPath.PointCount == 0)
+ {
+ return;
+ }
+
+ // Find the index the left/bottom most and right/top most point in flatten array of ellipse points
+ int leftBottomPoint = 0;
+ int rigthTopPoint = 0;
+ PointF[] ellipsePoints = ellipseFlattenPath.PathPoints;
+
+
+ if(veticalOrientation)
+ {
+ for(int pointIndex = 1; pointIndex < ellipsePoints.Length; pointIndex++)
+ {
+ if(ellipsePoints[leftBottomPoint].X > ellipsePoints[pointIndex].X)
+ {
+ leftBottomPoint = pointIndex;
+ }
+ if(ellipsePoints[rigthTopPoint].X < ellipsePoints[pointIndex].X)
+ {
+ rigthTopPoint = pointIndex;
+ }
+ }
+ }
+ else
+ {
+ bool doneFlag = false;
+ leftBottomPoint = -1;
+ rigthTopPoint = -1;
+
+ if(this._oppLeftBottomPoint != -1 && this._oppRigthTopPoint != -1)
+ {
+ // Get index from previously calculated values
+ leftBottomPoint = this._oppLeftBottomPoint;
+ rigthTopPoint = this._oppRigthTopPoint;
+ }
+ else
+ {
+ // Loop through first ellipse points
+ PointF[] oppositeEllipsePoints = oppositeEllipseFlattenPath.PathPoints;
+ for(int pointIndex = 0; !doneFlag && pointIndex < ellipsePoints.Length; pointIndex++)
+ {
+ // Loop through opposite ellipse points
+ for(int pointOppositeIndex = 0; !doneFlag && pointOppositeIndex < oppositeEllipsePoints.Length; pointOppositeIndex++)
+ {
+ bool closeToVertical = false;
+ bool pointsOnLeft = false;
+ bool pointsOnRight = false;
+
+ //if(cylinderAngle == 0 || cylinderAngle == 180 || cylinderAngle == -180)
+ if(cylinderAngle > -30 && cylinderAngle < 30)
+ {
+ closeToVertical = true;
+ }
+
+ if(closeToVertical)
+ {
+ if(oppositeEllipsePoints[pointOppositeIndex].Y == ellipsePoints[pointIndex].Y)
+ {
+ continue;
+ }
+
+ float linePointX = oppositeEllipsePoints[pointOppositeIndex].X - ellipsePoints[pointIndex].X;
+ linePointX /= oppositeEllipsePoints[pointOppositeIndex].Y - ellipsePoints[pointIndex].Y;
+
+ // Check if this line has any points to the right/left
+ for(int innerPointIndex = 0; innerPointIndex < ellipsePoints.Length; innerPointIndex++)
+ {
+ // Skip points used to define line function
+ if(innerPointIndex == pointIndex)
+ {
+ continue;
+ }
+
+ float x = linePointX;
+ x *= ellipsePoints[innerPointIndex].Y - ellipsePoints[pointIndex].Y;
+ x += ellipsePoints[pointIndex].X;
+
+ if(x > ellipsePoints[innerPointIndex].X)
+ {
+ pointsOnLeft = true;
+ }
+ if(x < ellipsePoints[innerPointIndex].X)
+ {
+ pointsOnRight = true;
+ }
+ if(pointsOnLeft && pointsOnRight)
+ {
+ break;
+ }
+ }
+
+ if(pointsOnLeft == false || pointsOnRight == false)
+ {
+ for(int innerPointIndex = 0; innerPointIndex < oppositeEllipsePoints.Length; innerPointIndex++)
+ {
+ // Skip points used to define line function
+ if(innerPointIndex == pointOppositeIndex)
+ {
+ continue;
+ }
+
+ float x = linePointX;
+ x *= oppositeEllipsePoints[innerPointIndex].Y - ellipsePoints[pointIndex].Y;
+ x += ellipsePoints[pointIndex].X;
+
+ if(x > oppositeEllipsePoints[innerPointIndex].X)
+ {
+ pointsOnLeft = true;
+ }
+ if(x < oppositeEllipsePoints[innerPointIndex].X)
+ {
+ pointsOnRight = true;
+ }
+ if(pointsOnLeft && pointsOnRight)
+ {
+ break;
+ }
+ }
+ }
+ }
+ else
+ {
+ if(oppositeEllipsePoints[pointOppositeIndex].X == ellipsePoints[pointIndex].X)
+ {
+ continue;
+ }
+
+ float linePointY = oppositeEllipsePoints[pointOppositeIndex].Y - ellipsePoints[pointIndex].Y;
+ linePointY /= oppositeEllipsePoints[pointOppositeIndex].X - ellipsePoints[pointIndex].X;
+
+ // Check if this line has any points to the right/left
+ for(int innerPointIndex = 0; innerPointIndex < ellipsePoints.Length; innerPointIndex++)
+ {
+ // Skip points used to define line function
+ if(innerPointIndex == pointIndex)
+ {
+ continue;
+ }
+
+ float y = linePointY;
+ y *= ellipsePoints[innerPointIndex].X - ellipsePoints[pointIndex].X;
+ y += ellipsePoints[pointIndex].Y;
+
+ if(y > ellipsePoints[innerPointIndex].Y)
+ {
+ pointsOnLeft = true;
+ }
+ if(y < ellipsePoints[innerPointIndex].Y)
+ {
+ pointsOnRight = true;
+ }
+ if(pointsOnLeft && pointsOnRight)
+ {
+ break;
+ }
+ }
+
+ if(pointsOnLeft == false || pointsOnRight == false)
+ {
+ for(int innerPointIndex = 0; innerPointIndex < oppositeEllipsePoints.Length; innerPointIndex++)
+ {
+ // Skip points used to define line function
+ if(innerPointIndex == pointOppositeIndex)
+ {
+ continue;
+ }
+
+ float y = linePointY;
+ y *= oppositeEllipsePoints[innerPointIndex].X - ellipsePoints[pointIndex].X;
+ y += ellipsePoints[pointIndex].Y;
+
+ if(y > oppositeEllipsePoints[innerPointIndex].Y)
+ {
+ pointsOnLeft = true;
+ }
+ if(y < oppositeEllipsePoints[innerPointIndex].Y)
+ {
+ pointsOnRight = true;
+ }
+ if(pointsOnLeft && pointsOnRight)
+ {
+ break;
+ }
+ }
+ }
+ }
+
+ if(!pointsOnLeft && leftBottomPoint == -1)
+ {
+ leftBottomPoint = pointIndex;
+ this._oppLeftBottomPoint = pointOppositeIndex;
+ }
+ if(!pointsOnRight && rigthTopPoint == -1)
+ {
+ rigthTopPoint = pointIndex;
+ this._oppRigthTopPoint = pointOppositeIndex;
+ }
+
+ if(leftBottomPoint >= 0 && rigthTopPoint >= 0)
+ {
+ doneFlag = true;
+
+ if(closeToVertical)
+ {
+ if(ellipsePoints[leftBottomPoint].Y > oppositeEllipsePoints[this._oppLeftBottomPoint].Y)
+ {
+ int temp = leftBottomPoint;
+ leftBottomPoint = rigthTopPoint;
+ rigthTopPoint = temp;
+
+ temp = this._oppLeftBottomPoint;
+ this._oppLeftBottomPoint = this._oppRigthTopPoint;
+ this._oppRigthTopPoint = temp;
+ }
+ }
+
+ }
+ }
+ }
+ }
+ }
+
+ // Point indexes were not found
+ if(leftBottomPoint == rigthTopPoint ||
+ rigthTopPoint == -1 ||
+ leftBottomPoint == -1)
+ {
+ return;
+ }
+
+ // Set left\right line coordinates
+ leftSideLinePoint = ellipsePoints[leftBottomPoint];
+ rightSideLinePoint = ellipsePoints[rigthTopPoint];
+
+ // Add required ellipse segment to the result path
+ for(int pointIndex = leftBottomPoint + 1; pointIndex != rigthTopPoint + 1; pointIndex++)
+ {
+ if(pointIndex > ellipsePoints.Length - 1)
+ {
+ resultPath.AddLine(ellipsePoints[ellipsePoints.Length - 1], ellipsePoints[0]);
+ pointIndex = 0;
+ continue;
+ }
+ resultPath.AddLine(ellipsePoints[pointIndex - 1], ellipsePoints[pointIndex]);
+ }
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// The Point3D class represents point coordinates in 3D space.
+ /// </summary>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class Point3D
+ {
+ #region Fields
+
+ // Point X and Y coordinates
+ private PointF _coordXY = new PointF(0f, 0f);
+
+ // Point Z coordinate (depth)
+ private float _coordZ = 0;
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets the X coordinate of the point.
+ /// </summary>
+ [
+ Bindable(true),
+ DefaultValue(0),
+ SRDescription("DescriptionAttributePoint3D_X")
+ ]
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "X")]
+ public float X
+ {
+ get
+ {
+ return this._coordXY.X;
+ }
+ set
+ {
+ this._coordXY.X = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the Y coordinate of the point.
+ /// </summary>
+ [
+ Bindable(true),
+ DefaultValue(0),
+ SRDescription("DescriptionAttributePoint3D_Y")
+ ]
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Y")]
+ public float Y
+ {
+ get
+ {
+ return this._coordXY.Y;
+ }
+ set
+ {
+ this._coordXY.Y = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the Z coordinate of the point.
+ /// </summary>
+ [
+ Bindable(true),
+ DefaultValue(0),
+ SRDescription("DescriptionAttributePoint3D_Z")
+ ]
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Z")]
+ public float Z
+ {
+ get
+ {
+ return this._coordZ;
+ }
+ set
+ {
+ this._coordZ = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a PointF structure, which stores the X and Y coordinates of a 3D point.
+ /// </summary>
+ [
+ Bindable(true),
+ DefaultValue(0),
+ SRDescription("DescriptionAttributePoint3D_PointF")
+ ]
+ public PointF PointF
+ {
+ get
+ {
+ return this._coordXY;
+ }
+ set
+ {
+ this._coordXY = new PointF(value.X, value.Y);
+ }
+ }
+
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// Public constructor.
+ /// </summary>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X, Y and Z are cartesian coordinates and well understood")]
+ public Point3D(float x, float y, float z)
+ {
+ this._coordXY = new PointF(x, y);
+ this._coordZ = z;
+ }
+
+ /// <summary>
+ /// Public constructor.
+ /// </summary>
+ public Point3D( )
+ {
+
+ }
+
+ #endregion // Constructor
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartRenderingEngine.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartRenderingEngine.cs
new file mode 100644
index 00000000000..37bbcf168a1
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartRenderingEngine.cs
@@ -0,0 +1,853 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: ChartRenderingEngine.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: ChartRenderingEngine, ValueA, PointA, RectangleA,
+// ColorA
+//
+// Purpose: ChartRenderingEngine class provides a common interface
+// to the graphics rendering and animation engines.
+// Internally it uses SvgChartGraphics, FlashGraphics or
+// GdiGraphics classes depending on the ActiveRenderingType
+// property settings.
+//
+// ValueA, PointA, RectangleA and ColorA classes are
+// used to store data about animated values like colors
+// position or rectangles. They store starting value/time,
+// end value/time, repeat flags and other settings. These
+// clases are used with animation engines.
+//
+// Reviwed: AG - Jul 15, 2003
+// AG - Microsoft 16, 2007
+//
+//===================================================================
+
+
+#region Used namespaces
+
+using System;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Drawing.Text;
+using System.Drawing.Imaging;
+using System.ComponentModel;
+using System.Collections;
+using System.Xml;
+using System.IO;
+using System.Diagnostics.CodeAnalysis;
+
+#if Microsoft_CONTROL
+
+using System.Windows.Forms.DataVisualization.Charting.Utilities;
+using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+#else
+using System.Web.UI.DataVisualization.Charting.Utilities;
+using System.Web.UI.DataVisualization.Charting.Borders3D;
+#endif
+
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ #region Enumerations
+
+ /// <summary>
+ /// Specify Rendering AxisName
+ /// </summary>
+ internal enum RenderingType
+ {
+ /// <summary>
+ /// GDI+ AxisName
+ /// </summary>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gdi")]
+ Gdi,
+
+ /// <summary>
+ /// SVG AxisName
+ /// </summary>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Svg")]
+ Svg,
+ }
+
+ #endregion // Enumerations
+
+ /// <summary>
+ /// The ChartGraphics class provides a common interface to the
+ /// graphics rendering.
+ /// </summary>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public partial class ChartGraphics
+ {
+ #region Fields
+
+ // Current rendering type
+ private RenderingType _activeRenderingType = RenderingType.Gdi;
+
+ // GDI+ rendering engine
+ private GdiGraphics _gdiGraphics = new GdiGraphics();
+
+ // Document title used for SVG rendering
+ //private string documentTitle = string.Empty;
+
+ // True if text should be clipped
+ internal bool IsTextClipped = false;
+
+ #endregion // Fields
+
+ #region Drawing Methods
+
+ /// <summary>
+ /// Draws a line connecting two PointF structures.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the line.</param>
+ /// <param name="pt1">PointF structure that represents the first point to connect.</param>
+ /// <param name="pt2">PointF structure that represents the second point to connect.</param>
+ internal void DrawLine(
+ Pen pen,
+ PointF pt1,
+ PointF pt2
+ )
+ {
+ RenderingObject.DrawLine( pen, pt1, pt2 );
+ }
+
+ /// <summary>
+ /// Draws a line connecting the two points specified by coordinate pairs.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the line.</param>
+ /// <param name="x1">x-coordinate of the first point.</param>
+ /// <param name="y1">y-coordinate of the first point.</param>
+ /// <param name="x2">x-coordinate of the second point.</param>
+ /// <param name="y2">y-coordinate of the second point.</param>
+ internal void DrawLine(
+ Pen pen,
+ float x1,
+ float y1,
+ float x2,
+ float y2
+ )
+ {
+ RenderingObject.DrawLine( pen, x1, y1, x2, y2 );
+ }
+
+ /// <summary>
+ /// Draws the specified portion of the specified Image object at the specified location and with the specified size.
+ /// </summary>
+ /// <param name="image">Image object to draw.</param>
+ /// <param name="destRect">Rectangle structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle.</param>
+ /// <param name="srcX">x-coordinate of the upper-left corner of the portion of the source image to draw.</param>
+ /// <param name="srcY">y-coordinate of the upper-left corner of the portion of the source image to draw.</param>
+ /// <param name="srcWidth">Width of the portion of the source image to draw.</param>
+ /// <param name="srcHeight">Height of the portion of the source image to draw.</param>
+ /// <param name="srcUnit">Member of the GraphicsUnit enumeration that specifies the units of measure used to determine the source rectangle.</param>
+ /// <param name="imageAttr">ImageAttributes object that specifies recoloring and gamma information for the image object.</param>
+ internal void DrawImage(
+ System.Drawing.Image image,
+ Rectangle destRect,
+ int srcX,
+ int srcY,
+ int srcWidth,
+ int srcHeight,
+ GraphicsUnit srcUnit,
+ ImageAttributes imageAttr
+ )
+ {
+ RenderingObject.DrawImage(
+ image,
+ destRect,
+ srcX,
+ srcY,
+ srcWidth,
+ srcHeight,
+ srcUnit,
+ imageAttr
+ );
+ }
+
+ /// <summary>
+ /// Draws an ellipse defined by a bounding rectangle specified by
+ /// a pair of coordinates, a height, and a width.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the ellipse.</param>
+ /// <param name="x">x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.</param>
+ /// <param name="y">y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.</param>
+ /// <param name="width">Width of the bounding rectangle that defines the ellipse.</param>
+ /// <param name="height">Height of the bounding rectangle that defines the ellipse.</param>
+ internal void DrawEllipse(
+ Pen pen,
+ float x,
+ float y,
+ float width,
+ float height
+ )
+ {
+ RenderingObject.DrawEllipse( pen, x, y, width, height );
+ }
+
+ /// <summary>
+ /// Draws a cardinal spline through a specified array of PointF structures
+ /// using a specified tension. The drawing begins offset from
+ /// the beginning of the array.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and height of the curve.</param>
+ /// <param name="points">Array of PointF structures that define the spline.</param>
+ /// <param name="offset">Offset from the first element in the array of the points parameter to the starting point in the curve.</param>
+ /// <param name="numberOfSegments">Number of segments after the starting point to include in the curve.</param>
+ /// <param name="tension">Value greater than or equal to 0.0F that specifies the tension of the curve.</param>
+ internal void DrawCurve(
+ Pen pen,
+ PointF[] points,
+ int offset,
+ int numberOfSegments,
+ float tension
+ )
+ {
+ ChartGraphics chartGraphics = this as ChartGraphics;
+ if (chartGraphics == null || !chartGraphics.IsMetafile)
+ {
+ RenderingObject.DrawCurve(pen, points, offset, numberOfSegments, tension);
+ }
+ else
+ {
+ // Special handling required for the metafiles. We cannot pass large array of
+ // points because they will be persisted inside EMF file and cause exponential
+ // increase in emf file size. Draw curve method uses additional 2, 3 or 4 points
+ // depending on which segement is drawn.
+ PointF[] pointsExact = null;
+ if (offset == 0 && numberOfSegments == points.Length - 1)
+ {
+ // In case the array contains the minimum required number of points
+ // to draw segments - just call the curve drawing method
+ RenderingObject.DrawCurve(pen, points, offset, numberOfSegments, tension);
+ }
+ else
+ {
+ if (offset == 0 && numberOfSegments < points.Length - 1)
+ {
+ // Segment is at the beginning of the array with more points following
+ pointsExact = new PointF[numberOfSegments + 2];
+ for (int index = 0; index < numberOfSegments + 2; index++)
+ {
+ pointsExact[index] = points[index];
+ }
+ }
+ else if (offset > 0 && (offset + numberOfSegments) == points.Length - 1)
+ {
+ // Segment is at the end of the array with more points prior to it
+ pointsExact = new PointF[numberOfSegments + 2];
+ for (int index = 0; index < numberOfSegments + 2; index++)
+ {
+ pointsExact[index] = points[offset + index - 1];
+ }
+ offset = 1;
+ }
+ else if (offset > 0 && (offset + numberOfSegments) < points.Length - 1)
+ {
+ // Segment in the middle of the array with points prior and following it
+ pointsExact = new PointF[numberOfSegments + 3];
+ for (int index = 0; index < numberOfSegments + 3; index++)
+ {
+ pointsExact[index] = points[offset + index - 1];
+ }
+ offset = 1;
+ }
+
+ // Render the curve using minimum number of required points in the array
+ RenderingObject.DrawCurve(pen, pointsExact, offset, numberOfSegments, tension);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Draws a rectangle specified by a coordinate pair, a width, and a height.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the rectangle.</param>
+ /// <param name="x">x-coordinate of the upper-left corner of the rectangle to draw.</param>
+ /// <param name="y">y-coordinate of the upper-left corner of the rectangle to draw.</param>
+ /// <param name="width">Width of the rectangle to draw.</param>
+ /// <param name="height">Height of the rectangle to draw.</param>
+ internal void DrawRectangle(
+ Pen pen,
+ int x,
+ int y,
+ int width,
+ int height
+ )
+ {
+ RenderingObject.DrawRectangle( pen, x, y, width, height );
+ }
+
+ /// <summary>
+ /// Draws a polygon defined by an array of PointF structures.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the polygon.</param>
+ /// <param name="points">Array of PointF structures that represent the vertices of the polygon.</param>
+ internal void DrawPolygon(
+ Pen pen,
+ PointF[] points
+ )
+ {
+ RenderingObject.DrawPolygon( pen, points );
+ }
+
+ /// <summary>
+ /// Draws the specified text string in the specified rectangle with the specified Brush and Font objects using the formatting properties of the specified StringFormat object.
+ /// </summary>
+ /// <param name="s">String to draw.</param>
+ /// <param name="font">Font object that defines the text format of the string.</param>
+ /// <param name="brush">Brush object that determines the color and texture of the drawn text.</param>
+ /// <param name="layoutRectangle">RectangleF structure that specifies the location of the drawn text.</param>
+ /// <param name="format">StringFormat object that specifies formatting properties, such as line spacing and alignment, that are applied to the drawn text.</param>
+ internal void DrawString(
+ string s,
+ Font font,
+ Brush brush,
+ RectangleF layoutRectangle,
+ StringFormat format
+ )
+ {
+ using (StringFormat fmt = (StringFormat)format.Clone())
+ {
+ if ( IsRightToLeft )
+ fmt.FormatFlags |= StringFormatFlags.DirectionRightToLeft;
+ if (!IsTextClipped && (fmt.FormatFlags & StringFormatFlags.NoClip) != StringFormatFlags.NoClip)
+ fmt.FormatFlags |= StringFormatFlags.NoClip;
+ RenderingObject.DrawString(s, font, brush, layoutRectangle, fmt);
+ }
+ }
+
+ /// <summary>
+ /// Draws the specified text string at the specified location with the specified Brush and Font objects using the formatting properties of the specified StringFormat object.
+ /// </summary>
+ /// <param name="s">String to draw.</param>
+ /// <param name="font">Font object that defines the text format of the string.</param>
+ /// <param name="brush">Brush object that determines the color and texture of the drawn text.</param>
+ /// <param name="point">PointF structure that specifies the upper-left corner of the drawn text.</param>
+ /// <param name="format">StringFormat object that specifies formatting properties, such as line spacing and alignment, that are applied to the drawn text.</param>
+ internal void DrawString(
+ string s,
+ Font font,
+ Brush brush,
+ PointF point,
+ StringFormat format
+ )
+ {
+ if (IsRightToLeft)
+ {
+ using (StringFormat fmt = (StringFormat)format.Clone())
+ {
+ fmt.FormatFlags |= StringFormatFlags.DirectionRightToLeft;
+ if (fmt.Alignment == StringAlignment.Far)
+ {
+ fmt.Alignment = StringAlignment.Near;
+ }
+ else if (fmt.Alignment == StringAlignment.Near)
+ {
+ fmt.Alignment = StringAlignment.Far;
+ }
+ RenderingObject.DrawString(s, font, brush, point, fmt);
+ }
+ }
+ else
+ RenderingObject.DrawString(s, font, brush, point, format);
+ }
+
+ /// <summary>
+ /// Draws the specified portion of the specified Image object at the specified location and with the specified size.
+ /// </summary>
+ /// <param name="image">Image object to draw.</param>
+ /// <param name="destRect">Rectangle structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle.</param>
+ /// <param name="srcX">x-coordinate of the upper-left corner of the portion of the source image to draw.</param>
+ /// <param name="srcY">y-coordinate of the upper-left corner of the portion of the source image to draw.</param>
+ /// <param name="srcWidth">Width of the portion of the source image to draw.</param>
+ /// <param name="srcHeight">Height of the portion of the source image to draw.</param>
+ /// <param name="srcUnit">Member of the GraphicsUnit enumeration that specifies the units of measure used to determine the source rectangle.</param>
+ /// <param name="imageAttrs">ImageAttributes object that specifies recoloring and gamma information for the image object.</param>
+ internal void DrawImage(
+ System.Drawing.Image image,
+ Rectangle destRect,
+ float srcX,
+ float srcY,
+ float srcWidth,
+ float srcHeight,
+ GraphicsUnit srcUnit,
+ ImageAttributes imageAttrs
+ )
+ {
+ RenderingObject.DrawImage( image, destRect, srcX, srcY, srcWidth, srcHeight, srcUnit, imageAttrs );
+ }
+
+ /// <summary>
+ /// Draws a rectangle specified by a coordinate pair, a width, and a height.
+ /// </summary>
+ /// <param name="pen">A Pen object that determines the color, width, and style of the rectangle.</param>
+ /// <param name="x">The x-coordinate of the upper-left corner of the rectangle to draw.</param>
+ /// <param name="y">The y-coordinate of the upper-left corner of the rectangle to draw.</param>
+ /// <param name="width">The width of the rectangle to draw.</param>
+ /// <param name="height">The height of the rectangle to draw.</param>
+ internal void DrawRectangle(
+ Pen pen,
+ float x,
+ float y,
+ float width,
+ float height
+ )
+ {
+ RenderingObject.DrawRectangle( pen, x, y, width, height );
+ }
+
+ /// <summary>
+ /// Draws a GraphicsPath object.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the path.</param>
+ /// <param name="path">GraphicsPath object to draw.</param>
+ internal void DrawPath(
+ Pen pen,
+ GraphicsPath path
+ )
+ {
+ // Check if path is empty
+ if(path == null ||
+ path.PointCount == 0)
+ {
+ return;
+ }
+
+ RenderingObject.DrawPath( pen, path );
+ }
+
+ /// <summary>
+ /// Draws a pie shape defined by an ellipse specified by a coordinate pair, a width, and a height and two radial lines.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the pie shape.</param>
+ /// <param name="x">x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie shape comes.</param>
+ /// <param name="y">y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie shape comes.</param>
+ /// <param name="width">Width of the bounding rectangle that defines the ellipse from which the pie shape comes.</param>
+ /// <param name="height">Height of the bounding rectangle that defines the ellipse from which the pie shape comes.</param>
+ /// <param name="startAngle">Angle measured in degrees clockwise from the x-axis to the first side of the pie shape.</param>
+ /// <param name="sweepAngle">Angle measured in degrees clockwise from the startAngle parameter to the second side of the pie shape.</param>
+ internal void DrawPie(
+ Pen pen,
+ float x,
+ float y,
+ float width,
+ float height,
+ float startAngle,
+ float sweepAngle
+ )
+ {
+ RenderingObject.DrawPie( pen, x, y, width, height, startAngle, sweepAngle );
+ }
+
+ /// <summary>
+ /// Draws an ellipse defined by a bounding RectangleF.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the ellipse.</param>
+ /// <param name="rect">RectangleF structure that defines the boundaries of the ellipse.</param>
+ internal void DrawEllipse(
+ Pen pen,
+ RectangleF rect
+ )
+ {
+ RenderingObject.DrawEllipse( pen, rect );
+ }
+
+ /// <summary>
+ /// Draws a series of line segments that connect an array of PointF structures.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the line segments.</param>
+ /// <param name="points">Array of PointF structures that represent the points to connect.</param>
+ internal void DrawLines(
+ Pen pen,
+ PointF[] points
+ )
+ {
+ RenderingObject.DrawLines( pen, points );
+ }
+
+ #endregion // Drawing Methods
+
+ #region Filling Methods
+
+ /// <summary>
+ /// Fills the interior of an ellipse defined by a bounding rectangle
+ /// specified by a RectangleF structure.
+ /// </summary>
+ /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
+ /// <param name="rect">RectangleF structure that represents the bounding rectangle that defines the ellipse.</param>
+ internal void FillEllipse(
+ Brush brush,
+ RectangleF rect
+ )
+ {
+ RenderingObject.FillEllipse( brush, rect );
+ }
+
+ /// <summary>
+ /// Fills the interior of a GraphicsPath object.
+ /// </summary>
+ /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
+ /// <param name="path">GraphicsPath object that represents the path to fill.</param>
+ internal void FillPath(
+ Brush brush,
+ GraphicsPath path
+ )
+ {
+ // Check if path is empty
+ if(path == null ||
+ path.PointCount == 0)
+ {
+ return;
+ }
+
+ RenderingObject.FillPath( brush, path );
+ }
+
+ /// <summary>
+ /// Fills the interior of a Region object.
+ /// </summary>
+ /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
+ /// <param name="region">Region object that represents the area to fill.</param>
+ internal void FillRegion(
+ Brush brush,
+ Region region
+ )
+ {
+ RenderingObject.FillRegion( brush, region );
+ }
+
+ /// <summary>
+ /// Fills the interior of a rectangle specified by a RectangleF structure.
+ /// </summary>
+ /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
+ /// <param name="rect">RectangleF structure that represents the rectangle to fill.</param>
+ internal void FillRectangle(
+ Brush brush,
+ RectangleF rect
+ )
+ {
+ RenderingObject.FillRectangle( brush, rect );
+ }
+
+ /// <summary>
+ /// Fills the interior of a rectangle specified by a pair of coordinates, a width, and a height.
+ /// </summary>
+ /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
+ /// <param name="x">x-coordinate of the upper-left corner of the rectangle to fill.</param>
+ /// <param name="y">y-coordinate of the upper-left corner of the rectangle to fill.</param>
+ /// <param name="width">Width of the rectangle to fill.</param>
+ /// <param name="height">Height of the rectangle to fill.</param>
+ internal void FillRectangle(
+ Brush brush,
+ float x,
+ float y,
+ float width,
+ float height
+ )
+ {
+ RenderingObject.FillRectangle( brush, x, y, width, height );
+ }
+
+ /// <summary>
+ /// Fills the interior of a polygon defined by an array of points specified by PointF structures .
+ /// </summary>
+ /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
+ /// <param name="points">Array of PointF structures that represent the vertices of the polygon to fill.</param>
+ internal void FillPolygon(
+ Brush brush,
+ PointF[] points
+ )
+ {
+ RenderingObject.FillPolygon( brush, points );
+ }
+
+ /// <summary>
+ /// Fills the interior of a pie section defined by an ellipse
+ /// specified by a pair of coordinates, a width, and a height
+ /// and two radial lines.
+ /// </summary>
+ /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
+ /// <param name="x">x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes.</param>
+ /// <param name="y">y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes.</param>
+ /// <param name="width">Width of the bounding rectangle that defines the ellipse from which the pie section comes.</param>
+ /// <param name="height">Height of the bounding rectangle that defines the ellipse from which the pie section comes.</param>
+ /// <param name="startAngle">Angle in degrees measured clockwise from the x-axis to the first side of the pie section.</param>
+ /// <param name="sweepAngle">Angle in degrees measured clockwise from the startAngle parameter to the second side of the pie section.</param>
+ internal void FillPie(
+ Brush brush,
+ float x,
+ float y,
+ float width,
+ float height,
+ float startAngle,
+ float sweepAngle
+ )
+ {
+ RenderingObject.FillPie( brush, x, y, width, height, startAngle, sweepAngle );
+ }
+
+ #endregion // Filling Methods
+
+ #region Other Methods
+
+ /// <summary>
+ /// This method starts SVG Selection mode
+ /// </summary>
+ /// <param name="url">The location of the referenced object, expressed as a URI reference.</param>
+ /// <param name="title">Title which could be used for tooltips.</param>
+ internal void StartHotRegion( string url, string title )
+ {
+ RenderingObject.BeginSelection( url, title );
+ }
+
+ /// <summary>
+ /// This method starts SVG Selection mode
+ /// </summary>
+ /// <param name="point">Data Point which properties are used for SVG selection</param>
+ internal void StartHotRegion(DataPoint point)
+ {
+ StartHotRegion( point, false );
+ }
+
+ /// <summary>
+ /// This method starts SVG Selection mode
+ /// </summary>
+ /// <param name="point">Data Point which properties are used for SVG selection</param>
+ /// <param name="labelRegion">Indicates if point label region is processed.</param>
+ internal void StartHotRegion(DataPoint point, bool labelRegion)
+ {
+ string hRef = string.Empty;
+ string tooltip = (labelRegion) ? point.LabelToolTip : point.ToolTip;
+#if !Microsoft_CONTROL
+ hRef = (labelRegion) ? point.LabelUrl : point.Url;
+#endif
+ if(hRef.Length > 0 || tooltip.Length > 0)
+ {
+ RenderingObject.BeginSelection(
+ point.ReplaceKeywords( hRef ),
+ point.ReplaceKeywords( tooltip ) );
+ }
+ }
+
+ /// <summary>
+ /// This method stops SVG Selection mode
+ /// </summary>
+ internal void EndHotRegion()
+ {
+ RenderingObject.EndSelection();
+ }
+
+ /// <summary>
+ /// Measures the specified string when drawn with the specified
+ /// Font object and formatted with the specified StringFormat object.
+ /// </summary>
+ /// <param name="text">String to measure.</param>
+ /// <param name="font">Font object defines the text format of the string.</param>
+ /// <param name="layoutArea">SizeF structure that specifies the maximum layout area for the text.</param>
+ /// <param name="stringFormat">StringFormat object that represents formatting information, such as line spacing, for the string.</param>
+ /// <returns>This method returns a SizeF structure that represents the size, in pixels, of the string specified in the text parameter as drawn with the font parameter and the stringFormat parameter.</returns>
+ internal SizeF MeasureString(
+ string text,
+ Font font,
+ SizeF layoutArea,
+ StringFormat stringFormat
+ )
+ {
+ return RenderingObject.MeasureString( text, font, layoutArea, stringFormat );
+ }
+
+ /// <summary>
+ /// Measures the specified string when drawn with the specified
+ /// Font object and formatted with the specified StringFormat object.
+ /// </summary>
+ /// <param name="text">String to measure.</param>
+ /// <param name="font">Font object defines the text format of the string.</param>
+ /// <returns>This method returns a SizeF structure that represents the size, in pixels, of the string specified in the text parameter as drawn with the font parameter and the stringFormat parameter.</returns>
+ internal SizeF MeasureString(
+ string text,
+ Font font
+ )
+ {
+ return RenderingObject.MeasureString( text, font );
+ }
+
+ /// <summary>
+ /// Saves the current state of this Graphics object and identifies the saved state with a GraphicsState object.
+ /// </summary>
+ /// <returns>This method returns a GraphicsState object that represents the saved state of this Graphics object.</returns>
+ internal GraphicsState Save()
+ {
+ return RenderingObject.Save();
+ }
+
+ /// <summary>
+ /// Restores the state of this Graphics object to the state represented by a GraphicsState object.
+ /// </summary>
+ /// <param name="gstate">GraphicsState object that represents the state to which to restore this Graphics object.</param>
+ internal void Restore(
+ GraphicsState gstate
+ )
+ {
+ RenderingObject.Restore( gstate );
+ }
+
+ /// <summary>
+ /// Resets the clip region of this Graphics object to an infinite region.
+ /// </summary>
+ internal void ResetClip()
+ {
+ RenderingObject.ResetClip();
+ }
+
+ /// <summary>
+ /// Sets the clipping region of this Graphics object to the rectangle specified by a RectangleF structure.
+ /// </summary>
+ /// <param name="rect">RectangleF structure that represents the new clip region.</param>
+ internal void SetClipAbs(RectangleF rect)
+ {
+ RenderingObject.SetClip( rect );
+ }
+
+ /// <summary>
+ /// Prepends the specified translation to the transformation matrix of this Graphics object.
+ /// </summary>
+ /// <param name="dx">x component of the translation.</param>
+ /// <param name="dy">y component of the translation.</param>
+ internal void TranslateTransform(
+ float dx,
+ float dy
+ )
+ {
+ RenderingObject.TranslateTransform( dx, dy );
+ }
+
+ #endregion // Other Methods
+
+ #region Properties
+
+ /// <summary>
+ /// Gets current rendering object.
+ /// </summary>
+ internal IChartRenderingEngine RenderingObject
+ {
+ get
+ {
+ return _gdiGraphics;
+ }
+ }
+
+ /// <summary>
+ /// Gets the active rendering type.
+ /// </summary>
+ internal RenderingType ActiveRenderingType
+ {
+ get
+ {
+ return _activeRenderingType;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the rendering mode for text associated with this Graphics object.
+ /// </summary>
+ internal TextRenderingHint TextRenderingHint
+ {
+ get
+ {
+ return RenderingObject.TextRenderingHint;
+ }
+ set
+ {
+ RenderingObject.TextRenderingHint = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the world transformation for this Graphics object.
+ /// </summary>
+ internal Matrix Transform
+ {
+ get
+ {
+ return RenderingObject.Transform;
+ }
+ set
+ {
+ RenderingObject.Transform = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the rendering quality for this Graphics object.
+ /// </summary>
+ internal SmoothingMode SmoothingMode
+ {
+ get
+ {
+ return RenderingObject.SmoothingMode;
+ }
+ set
+ {
+ RenderingObject.SmoothingMode = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a Region object that limits the drawing region of this Graphics object.
+ /// </summary>
+ internal Region Clip
+ {
+ get
+ {
+ return RenderingObject.Clip;
+ }
+ set
+ {
+ RenderingObject.Clip = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether the clipping region of this Graphics object is empty.
+ /// </summary>
+ internal bool IsClipEmpty {
+ get
+ {
+ return RenderingObject.IsClipEmpty;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the reference to the Graphics object.
+ /// </summary>
+ public Graphics Graphics
+ {
+ get
+ {
+ return RenderingObject.Graphics;
+ }
+ set
+ {
+ RenderingObject.Graphics = value;
+ }
+ }
+
+ #endregion // Properties
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartSerializer.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartSerializer.cs
new file mode 100644
index 00000000000..5e2626673f6
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ChartSerializer.cs
@@ -0,0 +1,789 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: ChartSerializer.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: ChartSerializer
+//
+// Purpose: Serialization saves the state of the chart and also
+// provides the ability to load the serialized data back
+// into the chart. All chart properties can be persisted,
+// including the chart's data.
+//
+// ChartSerializer class only provides serialization API
+// for the user and actual serialization is performed by
+// XmlFormatSerializer or BinaryFormatserializer classes
+// depending on the Format property.
+//
+// Reviewed: AG - Jul 31, 2002
+// GS - Aug 7, 2002
+// AG - Microsoft 15, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.IO;
+using System.Xml;
+using System.Collections;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting;
+#else
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ #region Serialization enumeration
+
+ /// <summary>
+ /// An enumeration of the formats of the chart serializer.
+ /// </summary>
+ public enum SerializationFormat
+ {
+ /// <summary>
+ /// XML serializer format.
+ /// </summary>
+ Xml,
+
+ /// <summary>
+ /// Binary serializer format.
+ /// </summary>
+ Binary
+ }
+
+
+ /// <summary>
+ /// An enumeration of chart serializable content definition flags
+ /// </summary>
+ [Flags]
+ public enum SerializationContents
+ {
+ /// <summary>
+ /// Default content.
+ /// </summary>
+ Default = 1,
+
+ /// <summary>
+ /// Serialize only series data.
+ /// </summary>
+ Data = 2,
+
+ /// <summary>
+ /// Serialize chart visual appearance (e.g. Colors, Line Styles).
+ /// </summary>
+ Appearance = 4,
+
+ /// <summary>
+ /// All content is serialized.
+ /// </summary>
+ All = Default | Data | Appearance
+
+ }
+
+ #endregion
+
+ /// <summary>
+ /// ChartSerializer class provides chart serialization.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeChartSerializer_ChartSerializer"),
+ DefaultProperty("Format"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class ChartSerializer
+ {
+ #region Private fields
+
+ // Reference to the service container
+ private IServiceContainer _serviceContainer = null;
+
+ // Reference to the chart object
+ private Chart _chart = null;
+
+ // Reference to the serializer object
+
+ private SerializerBase _serializer = new XmlFormatSerializer();
+
+ // Format of the serializer in use
+ private SerializationFormat _format = SerializationFormat.Xml;
+
+ // Serialization content
+ private SerializationContents _content = SerializationContents .Default;
+
+ #endregion
+
+ #region Constructors and Service Provider methods
+
+ /// <summary>
+ /// Default constructor is unavailable
+ /// </summary>
+ private ChartSerializer()
+ {
+ }
+
+ /// <summary>
+ /// Internal constructor
+ /// </summary>
+ /// <param name="container">Service container reference.</param>
+ internal ChartSerializer(IServiceContainer container)
+ {
+ if(container == null)
+ {
+ throw(new ArgumentNullException(SR.ExceptionInvalidServiceContainer));
+ }
+ _serviceContainer = container;
+ }
+
+ /// <summary>
+ /// Returns ChartSerializer service object
+ /// </summary>
+ /// <param name="serviceType">Requested service type.</param>
+ /// <returns>ChartSerializer service object.</returns>
+ internal object GetService(Type serviceType)
+ {
+ if(serviceType == typeof(ChartSerializer))
+ {
+ return this;
+ }
+ throw (new ArgumentException( SR.ExceptionChartSerializerUnsupportedType( serviceType.ToString())));
+ }
+
+ #endregion
+
+ #region Public properties
+
+ /// <summary>
+ /// Gets or sets the serializable content.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(typeof(SerializationContents ), "Default"),
+ SRDescription("DescriptionAttributeChartSerializer_Content")
+ ]
+ public SerializationContents Content
+ {
+ get
+ {
+ return _content;
+ }
+ set
+ {
+ // Set content value
+ _content = value;
+
+ // Automatically set SerializableContent and NonSerializableContent properties
+ SetSerializableContent();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the format used to serialize the chart data.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(typeof(SerializationFormat), "Xml"),
+ SRDescription("DescriptionAttributeChartSerializer_Format")
+ ]
+ public SerializationFormat Format
+ {
+ get
+ {
+ return _format;
+ }
+ set
+ {
+ if(_format != value)
+ {
+ _format = value;
+
+ // Create new serializer object
+ SerializerBase newSerializer = null;
+
+ if(_format == SerializationFormat.Binary)
+ {
+ newSerializer = new BinaryFormatSerializer();
+ }
+ else
+ {
+ newSerializer = new XmlFormatSerializer();
+ }
+ // Copy serializer settings
+ newSerializer.IsUnknownAttributeIgnored = _serializer.IsUnknownAttributeIgnored;
+ newSerializer.NonSerializableContent = _serializer.NonSerializableContent;
+ newSerializer.IsResetWhenLoading = _serializer.IsResetWhenLoading;
+ newSerializer.SerializableContent = _serializer.SerializableContent;
+ _serializer = newSerializer;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag which indicates whether object properties are reset to default
+ /// values before loading.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeChartSerializer_ResetWhenLoading")
+ ]
+ public bool IsResetWhenLoading
+ {
+ get
+ {
+ return _serializer.IsResetWhenLoading;
+ }
+ set
+ {
+ _serializer.IsResetWhenLoading = value;
+ }
+ }
+
+
+
+ /// <summary>
+ /// Gets or sets a flag which indicates whether unknown XML properties and elements will be
+ /// ignored without throwing an exception.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeChartSerializer_IgnoreUnknownXmlAttributes")
+ ]
+ public bool IsUnknownAttributeIgnored
+ {
+ get
+ {
+ return _serializer.IsUnknownAttributeIgnored;
+ }
+ set
+ {
+ _serializer.IsUnknownAttributeIgnored = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag which indicates whether chart
+ /// serializer is working in template creation mode.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeChartSerializer_TemplateMode")
+ ]
+ public bool IsTemplateMode
+ {
+ get
+ {
+ return _serializer.IsTemplateMode;
+ }
+ set
+ {
+ _serializer.IsTemplateMode = value;
+ }
+ }
+
+
+
+ /// <summary>
+ /// Gets or sets the chart properties that can be serialized.
+ /// Comma separated list of serializable (Save/Load/Reset) properties.
+ /// "ClassName.PropertyName,[ClassName.PropertyName]".
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeChartSerializer_SerializableContent")
+ ]
+ public string SerializableContent
+ {
+ get
+ {
+ return _serializer.SerializableContent;
+ }
+ set
+ {
+ _serializer.SerializableContent = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the chart properties that will not be serialized.
+ /// Comma separated list of non-serializable (Save/Load/Reset) properties.
+ /// "ClassName.PropertyName,[ClassName.PropertyName]".
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeChartSerializer_NonSerializableContent")
+ ]
+ public string NonSerializableContent
+ {
+ get
+ {
+ return _serializer.NonSerializableContent;
+ }
+ set
+ {
+ _serializer.NonSerializableContent = value;
+ }
+ }
+
+ #endregion
+
+ #region Public methods
+
+ /// <summary>
+ /// This method resets all properties of the chart to default values. By setting Content or
+ /// SerializableContent/NonSerializableContent properties, specific set of
+ /// properties can be reset.
+ /// </summary>
+ public void Reset()
+ {
+ // Set serializing flag
+ if(GetChartObject() != null)
+ {
+ GetChartObject().serializing = true;
+ GetChartObject().serializationStatus = SerializationStatus.Resetting;
+ }
+
+ // Reset properties
+ _serializer.ResetObjectProperties(GetChartObject());
+
+ // Clear serializing flag
+ if(GetChartObject() != null)
+ {
+ GetChartObject().serializing = false;
+ GetChartObject().serializationStatus = SerializationStatus.None;
+ }
+ }
+
+ /// <summary>
+ /// This method saves all properties of the chart into a file. By setting Content or
+ /// SerializableContent/NonSerializableContent properties, specific set of
+ /// properties can be saved.
+ /// </summary>
+ /// <param name="fileName">The file name used to write the data.</param>
+ public void Save(string fileName)
+ {
+ //Check arguments
+ if (fileName == null)
+ throw new ArgumentNullException("fileName");
+
+ // Set serializing flag
+ if(GetChartObject() != null)
+ {
+ GetChartObject().serializing = true;
+ GetChartObject().serializationStatus = SerializationStatus.Saving;
+ //GetChartObject().BeginInit();
+ }
+
+ // Reset all auto-detected properties values
+ GetChartObject().ResetAutoValues();
+
+ // Serialize chart data
+ _serializer.Serialize(GetChartObject(), fileName);
+
+ // Clear serializing flag
+ if(GetChartObject() != null)
+ {
+ GetChartObject().serializing = false;
+ GetChartObject().serializationStatus = SerializationStatus.None;
+ //GetChartObject().EndInit();
+ }
+ }
+
+ /// <summary>
+ /// This method saves all properties of the chart into a stream. By setting Content or
+ /// SerializableContent/NonSerializableContent properties, specific set of
+ /// properties can be saved.
+ /// </summary>
+ /// <param name="stream">The stream where to save the data.</param>
+ public void Save(Stream stream)
+ {
+ //Check arguments
+ if (stream == null)
+ throw new ArgumentNullException("stream");
+
+ // Set serializing flag
+ if(GetChartObject() != null)
+ {
+ GetChartObject().serializing = true;
+ GetChartObject().serializationStatus = SerializationStatus.Saving;
+ //GetChartObject().BeginInit();
+ }
+
+ // Reset all auto-detected properties values
+ GetChartObject().ResetAutoValues();
+
+ // Serialize chart data
+ _serializer.Serialize(GetChartObject(), stream);
+
+ // Clear serializing flag
+ if(GetChartObject() != null)
+ {
+ GetChartObject().serializing = false;
+ GetChartObject().serializationStatus = SerializationStatus.None;
+ //GetChartObject().EndInit();
+ }
+ }
+
+ /// <summary>
+ /// This method saves all properties of the chart into an XML writer. By setting Content or
+ /// SerializableContent/NonSerializableContent properties, specific set of
+ /// properties can be saved.
+ /// </summary>
+ /// <param name="writer">XML writer to save the data.</param>
+ public void Save(XmlWriter writer)
+ {
+ //Check arguments
+ if (writer == null)
+ throw new ArgumentNullException("writer");
+
+ // Set serializing flag
+ if(GetChartObject() != null)
+ {
+ GetChartObject().serializing = true;
+ GetChartObject().serializationStatus = SerializationStatus.Saving;
+ //GetChartObject().BeginInit();
+ }
+
+ // Reset all auto-detected properties values
+ GetChartObject().ResetAutoValues();
+
+ // Serialize chart data
+ _serializer.Serialize(GetChartObject(), writer);
+
+ // Clear serializing flag
+ if(GetChartObject() != null)
+ {
+ GetChartObject().serializing = false;
+ GetChartObject().serializationStatus = SerializationStatus.None;
+ //GetChartObject().EndInit();
+ }
+ }
+
+ /// <summary>
+ /// This method saves all properties of the chart into a text writer. By setting Content or
+ /// SerializableContent/NonSerializableContent properties, specific set of
+ /// properties can be saved.
+ /// </summary>
+ /// <param name="writer">Text writer to save the data.</param>
+ public void Save(TextWriter writer)
+ {
+ //Check arguments
+ if (writer == null)
+ throw new ArgumentNullException("writer");
+
+ // Set serializing flag
+ if(GetChartObject() != null)
+ {
+ GetChartObject().serializing = true;
+ GetChartObject().serializationStatus = SerializationStatus.Saving;
+ //GetChartObject().BeginInit();
+ }
+
+ // Reset all auto-detected properties values
+ GetChartObject().ResetAutoValues();
+
+ // Serialize chart data
+ _serializer.Serialize(GetChartObject(), writer);
+
+ // Clear serializing flag
+ if(GetChartObject() != null)
+ {
+ GetChartObject().serializing = false;
+ GetChartObject().serializationStatus = SerializationStatus.None;
+ //GetChartObject().EndInit();
+ }
+ }
+
+ /// <summary>
+ /// This method loads all properties of the chart from a file. By setting Content or
+ /// SerializableContent/NonSerializableContent properties, specific set of
+ /// properties can be loaded.
+ /// </summary>
+ /// <param name="fileName">The file to load the data from.</param>
+ public void Load(string fileName)
+ {
+ //Check arguments
+ if (fileName == null)
+ throw new ArgumentNullException("fileName");
+
+ // Set serializing flag
+ if(GetChartObject() != null)
+ {
+ GetChartObject().serializing = true;
+ GetChartObject().serializationStatus = SerializationStatus.Loading;
+ }
+
+ _serializer.Deserialize(GetChartObject(), fileName);
+
+ // Clear serializing flag
+ if(GetChartObject() != null)
+ {
+ GetChartObject().serializing = false;
+ GetChartObject().serializationStatus = SerializationStatus.None;
+ }
+ }
+
+
+ /// <summary>
+ /// This method loads all properties of the chart from a stream. By setting Content or
+ /// SerializableContent/NonSerializableContent properties, specific set of
+ /// properties can be loaded.
+ /// </summary>
+ /// <param name="stream">The stream to load the data from.</param>
+ public void Load(Stream stream)
+ {
+ //Check arguments
+ if (stream == null)
+ throw new ArgumentNullException("stream");
+
+ // Set serializing flag
+ if(GetChartObject() != null)
+ {
+ GetChartObject().serializing = true;
+ GetChartObject().serializationStatus = SerializationStatus.Loading;
+ }
+
+ _serializer.Deserialize(GetChartObject(), stream);
+
+ // Clear serializing flag
+ if(GetChartObject() != null)
+ {
+ GetChartObject().serializing = false;
+ GetChartObject().serializationStatus = SerializationStatus.None;
+ }
+ }
+
+ /// <summary>
+ /// This method loads all properties of the chart from an XML reader. By setting Content or
+ /// SerializableContent/NonSerializableContent properties, specific set of
+ /// properties can be loaded.
+ /// </summary>
+ /// <param name="reader">The XML reader to load the data from.</param>
+ public void Load(XmlReader reader)
+ {
+ //Check arguments
+ if (reader == null)
+ throw new ArgumentNullException("reader");
+
+ // Set serializing flag
+ if(GetChartObject() != null)
+ {
+ GetChartObject().serializing = true;
+ GetChartObject().serializationStatus = SerializationStatus.Loading;
+ }
+
+ _serializer.Deserialize(GetChartObject(), reader);
+
+ // Clear serializing flag
+ if(GetChartObject() != null)
+ {
+ GetChartObject().serializing = false;
+ GetChartObject().serializationStatus = SerializationStatus.None;
+ }
+ }
+
+ /// <summary>
+ /// This method loads all properties of the chart from the text reader. By setting Content or
+ /// SerializableContent/NonSerializableContent properties, specific set of
+ /// properties can be loaded.
+ /// </summary>
+ /// <param name="reader">The text reader to load the data from.</param>
+ public void Load(TextReader reader)
+ {
+ //Check arguments
+ if (reader == null)
+ throw new ArgumentNullException("reader");
+
+ // Set serializing flag
+ if(GetChartObject() != null)
+ {
+ GetChartObject().serializing = true;
+ GetChartObject().serializationStatus = SerializationStatus.Loading;
+ }
+
+ _serializer.Deserialize(GetChartObject(), reader);
+
+ // Clear serializing flag
+ if(GetChartObject() != null)
+ {
+ GetChartObject().serializing = false;
+ GetChartObject().serializationStatus = SerializationStatus.None;
+ }
+ }
+
+ #endregion
+
+ #region Protected helper methods
+
+ /// <summary>
+ /// Sets SerializableContent and NonSerializableContent properties
+ /// depending on the flags in the Content property.
+ /// </summary>
+ internal void SetSerializableContent()
+ {
+ // Reset content definition strings
+ this.SerializableContent = "";
+ this.NonSerializableContent = "";
+
+ // Loop through all enumeration flags
+ Array enumValues = Enum.GetValues(typeof(SerializationContents ));
+ foreach(object flagObject in enumValues)
+ {
+ if(flagObject is SerializationContents )
+ {
+ // Check if flag currently set
+ SerializationContents flag = (SerializationContents )flagObject;
+ if((this.Content & flag) == flag &&
+ flag != SerializationContents .All &&
+ this.Content != SerializationContents .All)
+ {
+ // Add comma at the end of existing string
+ if(this.NonSerializableContent.Length != 0)
+ {
+ this.NonSerializableContent += ", ";
+ }
+
+ // Add serializable class/properties names
+ this.NonSerializableContent += GetContentString(flag, false);
+ this.NonSerializableContent = this.NonSerializableContent.TrimStart(',');
+
+ // Add comma at the end of existing string
+ if(this.SerializableContent.Length != 0)
+ {
+ this.SerializableContent += ", ";
+ }
+
+ // Add serializable class/properties names
+ this.SerializableContent += GetContentString(flag, true);
+ this.SerializableContent = this.SerializableContent.TrimStart(',');
+ }
+ }
+ }
+ }
+
+
+ /// <summary>
+ /// Return a serializable or non serializable class/properties names
+ /// for the specific flag.
+ /// </summary>
+ /// <param name="content">Serializable content</param>
+ /// <param name="serializable">True - get serializable string, False - non serializable.</param>
+ /// <returns>Serializable or non serializable string with class/properties names.</returns>
+ protected string GetContentString(SerializationContents content, bool serializable)
+ {
+ switch(content)
+ {
+ case(SerializationContents .All):
+ return "";
+ case(SerializationContents .Default):
+ return "";
+ case(SerializationContents .Data):
+ if(serializable)
+ {
+ return
+ "Chart.BuildNumber, " +
+ "Chart.Series, " +
+ "Series.Points, " +
+ "Series.Name, " +
+ "DataPoint.XValue, " +
+ "DataPoint.YValues," +
+ "DataPoint.LabelStyle," +
+ "DataPoint.AxisLabel," +
+ "DataPoint.LabelFormat," +
+ "DataPoint.IsEmpty, " +
+ "Series.YValuesPerPoint, " +
+ "Series.IsXValueIndexed, " +
+ "Series.XValueType, " +
+ "Series.YValueType";
+ }
+ return "";
+ case(SerializationContents .Appearance):
+ if(serializable)
+ {
+ return
+ "Chart.BuildNumber, " +
+ "*.Name*, " +
+ "*.Fore*, " +
+ "*.Back*, " +
+ "*.Border*, " +
+ "*.Line*, " +
+ "*.Frame*, " +
+ "*.PageColor*, " +
+ "*.SkinStyle*, " +
+ "*.Palette, " +
+ "*.PaletteCustomColors, " +
+ "*.Font*, " +
+ "*.*Font, " +
+ "*.Color, " +
+ "*.Shadow*, " +
+ "*.MarkerColor, " +
+ "*.MarkerStyle, " +
+ "*.MarkerSize, " +
+ "*.MarkerBorderColor, " +
+ "*.MarkerImage, " +
+ "*.MarkerImageTransparentColor, " +
+ "*.LabelBackColor, " +
+ "*.LabelBorder*, " +
+ "*.Enable3D, " +
+ "*.IsRightAngleAxes, " +
+ "*.IsClustered, " +
+ "*.LightStyle, " +
+ "*.Perspective, " +
+ "*.Inclination, " +
+ "*.Rotation, " +
+ "*.PointDepth, " +
+ "*.PointGapDepth, " +
+ "*.WallWidth";
+ }
+ return "";
+
+ default:
+ throw (new InvalidOperationException(SR.ExceptionChartSerializerContentFlagUnsupported));
+ }
+ }
+
+ /// <summary>
+ /// Returns chart object for serialization.
+ /// </summary>
+ /// <returns>Chart object.</returns>
+ internal Chart GetChartObject()
+ {
+ if(_chart == null)
+ {
+ _chart = (Chart)_serviceContainer.GetService(typeof(Chart));
+ }
+ return _chart;
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/CommonElements.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/CommonElements.cs
new file mode 100644
index 00000000000..cdbb898c943
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/CommonElements.cs
@@ -0,0 +1,327 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: CommonElements.cs
+//
+// Namespace: DataVisualization.Charting
+//
+// Classes: CommonElements
+//
+// Purpose: CommonElements class provides references to common
+// chart classes like DataManager, ChartTypeRegistry,
+// ImageLoader and others. It is passed to different
+// chart elements to simplify access to those common
+// classes.
+//
+// Reviewed: GS - August 2, 2002
+// AG - August 8, 2002
+// AG - Microsoft 15, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.ComponentModel.Design;
+using System.Drawing.Drawing2D;
+using System.Drawing;
+using System.Globalization;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Formulas;
+#else
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+ using System.Web.UI.DataVisualization.Charting.Borders3D;
+ using System.Web.UI.DataVisualization.Charting.Formulas;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ /// <summary>
+ /// CommonElements class provides references to common chart classes like
+ /// DataManager, ChartTypeRegistry, ImageLoader and others. It is passed
+ /// to different chart elements to simplify access to those common classes.
+ /// </summary>
+ internal class CommonElements
+ {
+ #region Fields
+
+ private Chart _chart;
+ private ChartImage _chartPicture;
+
+ // Reference to Chart Graphics Object
+ internal ChartGraphics graph = null;
+
+ /// <summary>
+ /// Service Container
+ /// </summary>
+ internal IServiceContainer container = null;
+
+ /// <summary>
+ /// Indicates painting mode
+ /// </summary>
+ internal bool processModePaint = true;
+
+ /// <summary>
+ /// Indicates selection mode
+ /// </summary>
+ internal bool processModeRegions = false;
+
+ // Private Fields
+ private int _width = 0;
+ private int _height = 0;
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Reference to the Data Manager
+ /// </summary>
+ internal DataManager DataManager
+ {
+ get
+ {
+ return (DataManager)container.GetService(typeof(DataManager));
+ }
+ }
+
+ /// <summary>
+ /// True if painting mode is active
+ /// </summary>
+ public bool ProcessModePaint
+ {
+ get
+ {
+ return processModePaint;
+ }
+ }
+
+ /// <summary>
+ /// True if Hot region or image maps mode is active
+ /// </summary>
+ public bool ProcessModeRegions
+ {
+ get
+ {
+ return processModeRegions;
+ }
+ }
+
+ /// <summary>
+ /// Reference to the hot regions object
+ /// </summary>
+ public HotRegionsList HotRegionsList
+ {
+ get
+ {
+ return ChartPicture.hotRegionsList;
+ }
+ }
+
+ /// <summary>
+ /// Reference to the Data Manipulator
+ /// </summary>
+ public DataManipulator DataManipulator
+ {
+ get
+ {
+ return ChartPicture.DataManipulator;
+ }
+ }
+
+ /// <summary>
+ /// Reference to the ImageLoader
+ /// </summary>
+ internal ImageLoader ImageLoader
+ {
+ get
+ {
+ return (ImageLoader)container.GetService(typeof(ImageLoader));
+ }
+ }
+
+ /// <summary>
+ /// Reference to the Chart
+ /// </summary>
+ internal Chart Chart
+ {
+ get
+ {
+ if (_chart==null)
+ _chart = (Chart)container.GetService(typeof(Chart));
+ return _chart;
+ }
+ }
+
+ /// <summary>
+ /// Reference to the ChartTypeRegistry
+ /// </summary>
+ internal ChartTypeRegistry ChartTypeRegistry
+ {
+ get
+ {
+ return (ChartTypeRegistry)container.GetService(typeof(ChartTypeRegistry));
+ }
+ }
+
+ /// <summary>
+ /// Reference to the BorderTypeRegistry
+ /// </summary>
+ internal BorderTypeRegistry BorderTypeRegistry
+ {
+ get
+ {
+ return (BorderTypeRegistry)container.GetService(typeof(BorderTypeRegistry));
+ }
+ }
+
+ /// <summary>
+ /// Reference to the FormulaRegistry
+ /// </summary>
+ internal FormulaRegistry FormulaRegistry
+ {
+ get
+ {
+ return (FormulaRegistry)container.GetService(typeof(FormulaRegistry));
+ }
+ }
+
+
+
+ /// <summary>
+ /// Reference to the ChartPicture
+ /// </summary>
+ internal ChartImage ChartPicture
+ {
+ get
+ {
+ if (_chartPicture ==null)
+ _chartPicture = (ChartImage)container.GetService(typeof(ChartImage));
+ return _chartPicture;
+ }
+ }
+
+ /// <summary>
+ /// Width of the chart picture
+ /// </summary>
+ internal int Width
+ {
+ get
+ {
+ return _width;
+ }
+ set
+ {
+ _width = value;
+ }
+ }
+
+ /// <summary>
+ /// Height of the chart picture
+ /// </summary>
+ internal int Height
+ {
+ get
+ {
+ return _height;
+ }
+ set
+ {
+ _height = value;
+ }
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Constructor
+ /// </summary>
+ /// <param name="container">Service container.</param>
+ internal CommonElements(IServiceContainer container)
+ {
+ this.container = container;
+ }
+
+
+ #endregion
+
+ #region String convertion helper methods
+
+ /// <summary>
+ /// Converts string to double.
+ /// </summary>
+ /// <param name="stringToParse">String to convert.</param>
+ /// <returns>Double result.</returns>
+ internal static double ParseDouble(string stringToParse)
+ {
+ return ParseDouble(stringToParse, false);
+ }
+ /// <summary>
+ /// Converts string to double.
+ /// </summary>
+ /// <param name="stringToParse">String to convert.</param>
+ /// <param name="throwException">if set to <c>true</c> the exception thrown.</param>
+ /// <returns>Double result.</returns>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", MessageId = "System.Double.TryParse(System.String,System.Globalization.NumberStyles,System.IFormatProvider,System.Double@)")]
+ internal static double ParseDouble(string stringToParse, bool throwException)
+ {
+ Double result = 0.0;
+
+ if (throwException)
+ {
+ result = double.Parse(stringToParse, NumberStyles.Any, CultureInfo.InvariantCulture);
+ }
+ else
+ {
+ bool parseSucceed = double.TryParse(stringToParse, NumberStyles.Any, CultureInfo.InvariantCulture, out result);
+ if (!parseSucceed)
+ {
+ double.TryParse(stringToParse, NumberStyles.Any, CultureInfo.CurrentCulture, out result);
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// Converts string to double.
+ /// </summary>
+ /// <param name="stringToParse">String to convert.</param>
+ /// <returns>Double result.</returns>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", MessageId = "System.Single.TryParse(System.String,System.Globalization.NumberStyles,System.IFormatProvider,System.Single@)")]
+ internal static float ParseFloat(string stringToParse)
+ {
+ float result = 0f;
+ bool parseSucceed = float.TryParse(stringToParse, NumberStyles.Any, CultureInfo.InvariantCulture, out result);
+
+ if (!parseSucceed)
+ {
+ float.TryParse(stringToParse, NumberStyles.Any, CultureInfo.CurrentCulture, out result);
+ }
+
+ return result;
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Constants.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Constants.cs
new file mode 100644
index 00000000000..c28cff6be45
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Constants.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor,deliant
+
+#if WINFORMS_CONTROL
+namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+#endif
+{
+
+ internal static class Constants
+ {
+ public const string AutoValue = "Auto";
+ public const string NotSetValue = "NotSet";
+ public const string MinValue = "Min";
+ public const string MaxValue = "Max";
+ }
+
+}
+
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/DataManipulator.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/DataManipulator.cs
new file mode 100644
index 00000000000..bdd7033d6fd
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/DataManipulator.cs
@@ -0,0 +1,3495 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: DataManipulator.cs
+//
+// Namespace: DataVisualization.Charting
+//
+// Classes: DataManipulator, IDataPointFilter
+//
+// Purpose: DataManipulator class exposes to the user methods
+// to perform data filtering, grouping, inserting
+// empty points, sorting and exporting data.
+//
+// It also expose financial and statistical formulas
+// through the DataFormula base class.
+//
+// Reviewed: AG - Jul 31, 2002;
+// GS - Aug 7, 2002
+// AG - Microsoft 15, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Drawing;
+using System.Data;
+using System.Drawing.Drawing2D;
+using System.Drawing.Design;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+#else
+ using System.Web;
+ using System.Web.UI;
+ using System.Web.UI.DataVisualization.Charting;
+#endif
+
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+#endif
+{
+ #region Data manipulation enumerations
+
+ /// <summary>
+ /// Grouping functions types
+ /// </summary>
+ internal enum GroupingFunction
+ {
+ /// <summary>
+ /// Not defined
+ /// </summary>
+ None,
+ /// <summary>
+ /// Minimum value of the group
+ /// </summary>
+ Min,
+ /// <summary>
+ /// Maximum value of the group
+ /// </summary>
+ Max,
+ /// <summary>
+ /// Average value of the group
+ /// </summary>
+ Ave,
+ /// <summary>
+ /// Total of all values of the group
+ /// </summary>
+ Sum,
+ /// <summary>
+ /// Value of the first point in the group
+ /// </summary>
+ First,
+ /// <summary>
+ /// Value of the last point in the group
+ /// </summary>
+ Last,
+ /// <summary>
+ /// Value of the center point in the group
+ /// </summary>
+ Center,
+ /// <summary>
+ /// High, Low, Open, Close values in the group
+ /// </summary>
+ HiLoOpCl,
+ /// <summary>
+ /// High, Low values in the group
+ /// </summary>
+ HiLo,
+ /// <summary>
+ /// Number of points in the group
+ /// </summary>
+ Count,
+ /// <summary>
+ /// Number of unique points in the group
+ /// </summary>
+ DistinctCount,
+ /// <summary>
+ /// Variance of points in the group
+ /// </summary>
+ Variance,
+ /// <summary>
+ /// Deviation of points in the group
+ /// </summary>
+ Deviation
+ }
+
+ /// <summary>
+ /// An enumeration of units of measurement for intervals.
+ /// </summary>
+ public enum IntervalType
+ {
+ /// <summary>
+ /// Interval in numbers.
+ /// </summary>
+ Number,
+ /// <summary>
+ /// Interval in years.
+ /// </summary>
+ Years,
+ /// <summary>
+ /// Interval in months.
+ /// </summary>
+ Months,
+ /// <summary>
+ /// Interval in weeks.
+ /// </summary>
+ Weeks,
+ /// <summary>
+ /// Interval in days.
+ /// </summary>
+ Days,
+ /// <summary>
+ /// Interval in hours.
+ /// </summary>
+ Hours,
+ /// <summary>
+ /// Interval in minutes.
+ /// </summary>
+ Minutes,
+ /// <summary>
+ /// Interval in seconds.
+ /// </summary>
+ Seconds,
+ /// <summary>
+ /// Interval in milliseconds.
+ /// </summary>
+ Milliseconds
+ }
+
+ /// <summary>
+ /// An enumeration of units of measurement for date ranges.
+ /// </summary>
+ public enum DateRangeType
+ {
+ /// <summary>
+ /// Range defined in years.
+ /// </summary>
+ Year,
+ /// <summary>
+ /// Range defined in months.
+ /// </summary>
+ Month,
+ /// <summary>
+ /// Range defined in days of week.
+ /// </summary>
+ DayOfWeek,
+ /// <summary>
+ /// Range defined in days of month.
+ /// </summary>
+ DayOfMonth,
+ /// <summary>
+ /// Range defined in hours.
+ /// </summary>
+ Hour,
+ /// <summary>
+ /// Range defined in minutes.
+ /// </summary>
+ Minute
+ }
+
+ /// <summary>
+ /// An enumeration of methods of comparison.
+ /// </summary>
+ public enum CompareMethod
+ {
+ /// <summary>
+ /// One value is more than the other value.
+ /// </summary>
+ MoreThan,
+ /// <summary>
+ /// One value is less than the other value.
+ /// </summary>
+ LessThan,
+ /// <summary>
+ /// One value is equal the other value.
+ /// </summary>
+ EqualTo,
+ /// <summary>
+ /// One value is more or equal to the other value.
+ /// </summary>
+ MoreThanOrEqualTo,
+ /// <summary>
+ /// One value is less or equal to the other value.
+ /// </summary>
+ LessThanOrEqualTo,
+ /// <summary>
+ /// One value is not equal to the other value.
+ /// </summary>
+ NotEqualTo
+ }
+
+ #endregion
+
+ #region Data points filtering inteface
+
+ /// <summary>
+ /// The IDataPointFilter interface is used for filtering series data points.
+ /// </summary>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public interface IDataPointFilter
+ {
+ /// <summary>
+ /// Checks if the specified data point must be filtered.
+ /// </summary>
+ /// <param name="point">Data point object.</param>
+ /// <param name="series">Series of the point.</param>
+ /// <param name="pointIndex">Index of the point in the series.</param>
+ /// <returns>True if point must be removed</returns>
+ bool FilterDataPoint(DataPoint point, Series series, int pointIndex);
+ }
+
+ #endregion
+
+ /// <summary>
+ /// The DataManipulator class is used at runtime to perform data manipulation
+ /// operations, and is exposed via the DataManipulator property of the
+ /// root Chart object.
+ /// </summary>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class DataManipulator : DataFormula
+ {
+ #region Fields
+
+ // Indicates that filtering do not remove points, just mark them as empty
+ private bool _filterSetEmptyPoints = false;
+
+ // Indicates that points that match the criteria must be filtered out
+ private bool _filterMatchedPoints = true;
+
+ #endregion // Fields
+
+ #region Data manipulator helper functions
+
+ /// <summary>
+ /// Helper function that converts one series or a comma separated
+ /// list of series names into the Series array.
+ /// </summary>
+ /// <param name="obj">Series or string of series names.</param>
+ /// <param name="createNew">If series with this name do not exist - create new.</param>
+ /// <returns>Array of series.</returns>
+ internal Series[] ConvertToSeriesArray(object obj, bool createNew)
+ {
+ Series[] array = null;
+
+ if(obj == null)
+ {
+ return null;
+ }
+
+ // Parameter is one series
+ if(obj.GetType() == typeof(Series))
+ {
+ array = new Series[1];
+ array[0] = (Series)obj;
+ }
+
+ // Parameter is a string (comma separated series names)
+ else if(obj.GetType() == typeof(string))
+ {
+ string series = (string)obj;
+ int index = 0;
+
+ // "*" means process all series from the collection
+ if(series == "*")
+ {
+ // Create array of series
+ array = new Series[Common.DataManager.Series.Count];
+
+ // Add all series from the collection
+ foreach(Series s in Common.DataManager.Series)
+ {
+ array[index] = s;
+ ++index;
+ }
+ }
+
+ // Comma separated list
+ else if(series.Length > 0)
+ {
+ // Replace commas in value string
+ series = series.Replace("\\,", "\\x45");
+ series = series.Replace("\\=", "\\x46");
+
+ // Split string by comma
+ string[] seriesNames = series.Split(',');
+
+ // Create array of series
+ array = new Series[seriesNames.Length];
+
+ // Find series by name
+ foreach(string s in seriesNames)
+ {
+ // Put pack a comma character
+ string seriesName = s.Replace("\\x45", ",");
+ seriesName = seriesName.Replace("\\x46", "=");
+
+ try
+ {
+ array[index] = Common.DataManager.Series[seriesName.Trim()];
+ }
+ catch(System.Exception)
+ {
+ if(createNew)
+ {
+ Series newSeries = new Series(seriesName.Trim());
+ Common.DataManager.Series.Add(newSeries);
+ array[index] = newSeries;
+ }
+ else
+ {
+ throw;
+ }
+ }
+
+ ++index;
+ }
+ }
+ }
+
+ return array;
+ }
+
+ /// <summary>
+ /// Public constructor
+ /// </summary>
+ public DataManipulator()
+ {
+ }
+
+ #endregion
+
+ #region Series points sorting methods
+
+ /// <summary>
+ /// Sort series data points in specified order.
+ /// </summary>
+ /// <param name="pointSortOrder">Sorting order.</param>
+ /// <param name="sortBy">Value to sort by.</param>
+ /// <param name="series">Series array to sort.</param>
+ private void Sort(PointSortOrder pointSortOrder, string sortBy, Series[] series)
+ {
+ // Check arguments
+ if (sortBy == null)
+ throw new ArgumentNullException("sortBy");
+ if (series == null)
+ throw new ArgumentNullException("series");
+
+ // Check array of series
+ if(series.Length == 0)
+ {
+ return;
+ }
+
+ // Sort series
+ DataPointComparer comparer = new DataPointComparer(series[0], pointSortOrder, sortBy);
+ this.Sort(comparer, series);
+ }
+
+ /// <summary>
+ /// Sort series data points in specified order.
+ /// </summary>
+ /// <param name="comparer">Comparing interface.</param>
+ /// <param name="series">Series array to sort.</param>
+ private void Sort(IComparer<DataPoint> comparer, Series[] series)
+ {
+ // Check arguments
+ if (comparer == null)
+ throw new ArgumentNullException("comparer");
+ if (series == null)
+ throw new ArgumentNullException("series");
+
+ //**************************************************
+ //** Check array of series
+ //**************************************************
+ if(series.Length == 0)
+ {
+ return;
+ }
+
+ //**************************************************
+ //** If we sorting more than one series
+ //**************************************************
+ if(series.Length > 1)
+ {
+ // Check if series X values are aligned
+ this.CheckXValuesAlignment(series);
+
+ // Apply points indexes to the first series
+ int pointIndex = 0;
+ foreach(DataPoint point in series[0].Points)
+ {
+ point["_Index"] = pointIndex.ToString(System.Globalization.CultureInfo.InvariantCulture);
+ ++pointIndex;
+ }
+ }
+
+ //**************************************************
+ //** Sort first series
+ //**************************************************
+ series[0].Sort(comparer);
+
+ //**************************************************
+ //** If we sorting more than one series
+ //**************************************************
+ if(series.Length > 1)
+ {
+ // Sort other series (depending on the first)
+ int toIndex = 0;
+ int fromIndex = 0;
+ foreach(DataPoint point in series[0].Points)
+ {
+ // Move point from index is stored in point attribute (as index before sorting)
+ fromIndex = int.Parse(point["_Index"], System.Globalization.CultureInfo.InvariantCulture);
+
+ // Move points in series
+ for(int seriesIndex = 1; seriesIndex < series.Length; seriesIndex++)
+ {
+ series[seriesIndex].Points.Insert(toIndex, series[seriesIndex].Points[toIndex + fromIndex]);
+ }
+
+ // Increase move point to index
+ ++toIndex;
+ }
+
+ // Remove extra points from series
+ for(int seriesIndex = 1; seriesIndex < series.Length; seriesIndex++)
+ {
+ while(series[seriesIndex].Points.Count > series[0].Points.Count)
+ {
+ series[seriesIndex].Points.RemoveAt(series[seriesIndex].Points.Count - 1);
+ }
+ }
+
+ //**************************************************
+ //** Remove points index attribute
+ //**************************************************
+ foreach(DataPoint point in series[0].Points)
+ {
+ point.DeleteCustomProperty("_Index");
+ }
+ }
+ }
+
+ #endregion
+
+ #region Series points sorting overloaded methods
+
+ /// <summary>
+ /// Sort the series' data points in specified order.
+ /// </summary>
+ /// <param name="pointSortOrder">Sorting order.</param>
+ /// <param name="sortBy">Value to sort by.</param>
+ /// <param name="seriesName">Comma separated series names to sort.</param>
+ public void Sort(PointSortOrder pointSortOrder, string sortBy, string seriesName)
+ {
+ // Check arguments
+ if (seriesName == null)
+ throw new ArgumentNullException("seriesName");
+
+ Sort(pointSortOrder, sortBy, ConvertToSeriesArray(seriesName, false));
+ }
+
+ /// <summary>
+ /// Sort the series' data points in specified order.
+ /// </summary>
+ /// <param name="pointSortOrder">Sorting order.</param>
+ /// <param name="series">Series to sort.</param>
+ public void Sort(PointSortOrder pointSortOrder, Series series)
+ {
+ // Check arguments
+ if (series == null)
+ throw new ArgumentNullException("series");
+
+ Sort(pointSortOrder, "Y", ConvertToSeriesArray(series, false));
+ }
+
+ /// <summary>
+ /// Sort the series' data points in specified order.
+ /// </summary>
+ /// <param name="pointSortOrder">Sorting order.</param>
+ /// <param name="seriesName">Comma separated series names to sort.</param>
+ public void Sort(PointSortOrder pointSortOrder, string seriesName)
+ {
+ // Check arguments
+ if (seriesName == null)
+ throw new ArgumentNullException("seriesName");
+
+ Sort(pointSortOrder, "Y", ConvertToSeriesArray(seriesName, false));
+ }
+
+ /// <summary>
+ /// Sort the series' data points in specified order.
+ /// </summary>
+ /// <param name="pointSortOrder">Sorting order.</param>
+ /// <param name="sortBy">Value to sort by.</param>
+ /// <param name="series">Series to sort.</param>
+ public void Sort(PointSortOrder pointSortOrder, string sortBy, Series series)
+ {
+ // Check arguments
+ if (series == null)
+ throw new ArgumentNullException("series");
+
+ Sort(pointSortOrder, sortBy, ConvertToSeriesArray(series, false));
+ }
+
+ /// <summary>
+ /// Sort the series' data points in specified order.
+ /// </summary>
+ /// <param name="comparer">IComparer interface.</param>
+ /// <param name="series">Series to sort.</param>
+ public void Sort(IComparer<DataPoint> comparer, Series series)
+ {
+ // Check arguments - comparer is checked in the private override of Sort
+ if (series == null)
+ throw new ArgumentNullException("series");
+
+ Sort(comparer, ConvertToSeriesArray(series, false));
+ }
+
+ /// <summary>
+ /// Sort the series' data points in specified order.
+ /// </summary>
+ /// <param name="comparer">Comparing interface.</param>
+ /// <param name="seriesName">Comma separated series names to sort.</param>
+ public void Sort(IComparer<DataPoint> comparer, string seriesName)
+ {
+ // Check arguments - comparer is checked in the private override of Sort
+ if (seriesName == null)
+ throw new ArgumentNullException("seriesName");
+
+ Sort(comparer, ConvertToSeriesArray(seriesName, false));
+ }
+
+ #endregion
+
+ #region Insert empty data points method
+
+ /// <summary>
+ /// Insert empty data points using specified interval.
+ /// </summary>
+ /// <param name="interval">Interval size.</param>
+ /// <param name="intervalType">Interval type.</param>
+ /// <param name="intervalOffset">Interval offset size.</param>
+ /// <param name="intervalOffsetType">Interval offset type.</param>
+ /// <param name="fromXValue">Check intervals from this X value.</param>
+ /// <param name="toXValue">Check intervals until this X value.</param>
+ /// <param name="series">Series array.</param>
+ private void InsertEmptyPoints(
+ double interval,
+ IntervalType intervalType,
+ double intervalOffset,
+ IntervalType intervalOffsetType,
+ double fromXValue,
+ double toXValue,
+ Series[] series)
+ {
+ // Check the arguments
+ if (interval <= 0)
+ throw new ArgumentOutOfRangeException("interval");
+
+ //**************************************************
+ //** Automaticly detect minimum and maximum values
+ //**************************************************
+ double fromX = Math.Min(fromXValue, toXValue);
+ double toX = Math.Max(fromXValue, toXValue);
+ bool fromIsNaN = double.IsNaN(fromX);
+ bool toIsNaN = double.IsNaN(toX);
+ foreach(Series ser in series)
+ {
+ if(ser.Points.Count >= 1)
+ {
+ if(toIsNaN)
+ {
+ if(double.IsNaN(toX))
+ {
+ toX = ser.Points[ser.Points.Count - 1].XValue;
+ }
+ else
+ {
+ toX = Math.Max(toX, ser.Points[ser.Points.Count - 1].XValue);
+ }
+ }
+ if(fromIsNaN)
+ {
+ if(double.IsNaN(fromX))
+ {
+ fromX = ser.Points[0].XValue;
+ }
+ else
+ {
+ fromX = Math.Min(fromX, ser.Points[0].XValue);
+ }
+ }
+ if(fromX > toX)
+ {
+ double tempValue = fromX;
+ fromX = toX;
+ toX = tempValue;
+ }
+ }
+ }
+
+ //**************************************************
+ //** Automaticly adjust the beginning interval and
+ //** offset
+ //**************************************************
+ double nonAdjustedFromX = fromX;
+ fromX = ChartHelper.AlignIntervalStart(fromX, interval, ConvertIntervalType(intervalType));
+
+ // Add offset to the start position
+ if( intervalOffset != 0 )
+ {
+ fromX = fromX + ChartHelper.GetIntervalSize(fromX, intervalOffset, ConvertIntervalType(intervalOffsetType), null, 0, DateTimeIntervalType.Number, true, false);
+ }
+
+
+ //**************************************************
+ //** Loop through all series
+ //**************************************************
+ foreach(Series ser in series)
+ {
+ //**************************************************
+ //** Loop through all data points
+ //**************************************************
+ int numberOfPoints = 0;
+ int lastInsertPoint = 0;
+ double currentPointValue = fromX;
+ while(currentPointValue <= toX)
+ {
+ //**************************************************
+ //** Check that X value is in range
+ //**************************************************
+ bool outOfRange = false;
+ if(double.IsNaN(fromXValue) && currentPointValue < nonAdjustedFromX ||
+ !double.IsNaN(fromXValue) && currentPointValue < fromXValue)
+ {
+ outOfRange = true;
+ }
+ else if(currentPointValue > toXValue)
+ {
+ outOfRange = true;
+ }
+
+
+ // Current X value is in range of points values
+ if(!outOfRange)
+ {
+ //**************************************************
+ //** Find required X value
+ //**************************************************
+ int insertPosition = lastInsertPoint;
+ for(int pointIndex = lastInsertPoint; pointIndex < ser.Points.Count; pointIndex++)
+ {
+ // Value was found
+ if(ser.Points[pointIndex].XValue == currentPointValue)
+ {
+ insertPosition = -1;
+ break;
+ }
+
+ // Save point index where we should insert new empty point
+ if(ser.Points[pointIndex].XValue > currentPointValue)
+ {
+ insertPosition = pointIndex;
+ break;
+ }
+
+ // Insert as last point
+ if(pointIndex == (ser.Points.Count - 1))
+ {
+ insertPosition = ser.Points.Count;
+ }
+ }
+
+ //**************************************************
+ //** Required value was not found - insert empty data point
+ //**************************************************
+ if(insertPosition != -1)
+ {
+ lastInsertPoint = insertPosition;
+ ++numberOfPoints;
+ DataPoint dataPoint = new DataPoint(ser);
+ dataPoint.XValue = currentPointValue;
+ dataPoint.IsEmpty = true;
+ ser.Points.Insert(insertPosition, dataPoint);
+ }
+ }
+
+ //**************************************************
+ //** Determine next required data point
+ //**************************************************
+ currentPointValue += ChartHelper.GetIntervalSize(currentPointValue,
+ interval,
+ ConvertIntervalType(intervalType));
+
+
+ //**************************************************
+ //** Check if we exceed number of empty points
+ //** we can add.
+ //**************************************************
+ if(numberOfPoints > 1000)
+ {
+ currentPointValue = toX + 1;
+ continue;
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Helper function which converts IntervalType enumeration
+ /// into DateTimeIntervalType enumeration.
+ /// </summary>
+ /// <param name="type">Interval type value.</param>
+ /// <returns>Date time interval type value.</returns>
+ private DateTimeIntervalType ConvertIntervalType(IntervalType type)
+ {
+ switch(type)
+ {
+ case(IntervalType.Milliseconds):
+ return DateTimeIntervalType.Milliseconds;
+ case(IntervalType.Seconds):
+ return DateTimeIntervalType.Seconds;
+ case(IntervalType.Days):
+ return DateTimeIntervalType.Days;
+ case(IntervalType.Hours):
+ return DateTimeIntervalType.Hours;
+ case(IntervalType.Minutes):
+ return DateTimeIntervalType.Minutes;
+ case(IntervalType.Months):
+ return DateTimeIntervalType.Months;
+ case(IntervalType.Number):
+ return DateTimeIntervalType.Number;
+ case(IntervalType.Weeks):
+ return DateTimeIntervalType.Weeks;
+ case(IntervalType.Years):
+ return DateTimeIntervalType.Years;
+ }
+
+ return DateTimeIntervalType.Auto;
+ }
+
+ #endregion
+
+ #region Insert empty data points overloaded methods
+
+ /// <summary>
+ /// Insert empty data points using the specified interval.
+ /// </summary>
+ /// <param name="interval">Interval size.</param>
+ /// <param name="intervalType">Interval type.</param>
+ /// <param name="series">Series to insert the empty points.</param>
+ public void InsertEmptyPoints(
+ double interval,
+ IntervalType intervalType,
+ Series series)
+ {
+ InsertEmptyPoints(interval, intervalType, 0, IntervalType.Number, series);
+ }
+
+ /// <summary>
+ /// Insert empty data points using the specified interval.
+ /// </summary>
+ /// <param name="interval">Interval size.</param>
+ /// <param name="intervalType">Interval type.</param>
+ /// <param name="seriesName">Name of series to insert the empty points.</param>
+ public void InsertEmptyPoints(
+ double interval,
+ IntervalType intervalType,
+ string seriesName)
+ {
+ InsertEmptyPoints(interval, intervalType, 0, IntervalType.Number, seriesName);
+ }
+
+ /// <summary>
+ /// Insert empty data points using the specified interval.
+ /// </summary>
+ /// <param name="interval">Interval size.</param>
+ /// <param name="intervalType">Interval type.</param>
+ /// <param name="intervalOffset">Interval offset size.</param>
+ /// <param name="intervalOffsetType">Interval offset type.</param>
+ /// <param name="seriesName">Name of series to insert the empty points.</param>
+ public void InsertEmptyPoints(
+ double interval,
+ IntervalType intervalType,
+ double intervalOffset,
+ IntervalType intervalOffsetType,
+ string seriesName)
+ {
+ InsertEmptyPoints(interval, intervalType, intervalOffset, intervalOffsetType, double.NaN, double.NaN, seriesName);
+ }
+
+ /// <summary>
+ /// Insert empty data points using the specified interval.
+ /// </summary>
+ /// <param name="interval">Interval size.</param>
+ /// <param name="intervalType">Interval type.</param>
+ /// <param name="intervalOffset">Interval offset size.</param>
+ /// <param name="intervalOffsetType">Interval offset type.</param>
+ /// <param name="series">Series to insert the empty points.</param>
+ public void InsertEmptyPoints(
+ double interval,
+ IntervalType intervalType,
+ double intervalOffset,
+ IntervalType intervalOffsetType,
+ Series series)
+ {
+ InsertEmptyPoints(interval, intervalType, intervalOffset, intervalOffsetType, double.NaN, double.NaN, series);
+ }
+
+ /// <summary>
+ /// Insert empty data points using the specified interval.
+ /// </summary>
+ /// <param name="interval">Interval size.</param>
+ /// <param name="intervalType">Interval type.</param>
+ /// <param name="intervalOffset">Interval offset size.</param>
+ /// <param name="intervalOffsetType">Interval offset type.</param>
+ /// <param name="fromXValue">Check intervals from this X value.</param>
+ /// <param name="toXValue">Check intervals until this X value.</param>
+ /// <param name="seriesName">Name of series to insert the empty points.</param>
+ public void InsertEmptyPoints(
+ double interval,
+ IntervalType intervalType,
+ double intervalOffset,
+ IntervalType intervalOffsetType,
+ double fromXValue,
+ double toXValue,
+ string seriesName)
+ {
+ // Check arguments
+ if (seriesName == null)
+ throw new ArgumentNullException("seriesName");
+
+ InsertEmptyPoints(
+ interval,
+ intervalType,
+ intervalOffset,
+ intervalOffsetType,
+ fromXValue,
+ toXValue,
+ ConvertToSeriesArray(seriesName, false));
+ }
+
+
+ /// <summary>
+ /// Insert empty data points using the specified interval.
+ /// </summary>
+ /// <param name="interval">Interval size.</param>
+ /// <param name="intervalType">Interval type.</param>
+ /// <param name="intervalOffset">Interval offset size.</param>
+ /// <param name="intervalOffsetType">Interval offset type.</param>
+ /// <param name="fromXValue">Check intervals from this X value.</param>
+ /// <param name="toXValue">Check intervals until this X value.</param>
+ /// <param name="series">Series to insert the empty points.</param>
+ public void InsertEmptyPoints(
+ double interval,
+ IntervalType intervalType,
+ double intervalOffset,
+ IntervalType intervalOffsetType,
+ double fromXValue,
+ double toXValue,
+ Series series)
+ {
+ // Check arguments
+ if (series == null)
+ throw new ArgumentNullException("series");
+
+ InsertEmptyPoints(
+ interval,
+ intervalType,
+ intervalOffset,
+ intervalOffsetType,
+ fromXValue,
+ toXValue,
+ ConvertToSeriesArray(series, false));
+ }
+
+
+ #endregion
+
+ #region Series data exporting methods
+
+ /// <summary>
+ /// Export series data into the DataSet object.
+ /// </summary>
+ /// <param name="series">Array of series which should be exported.</param>
+ /// <returns>Data set object with series data.</returns>
+ internal DataSet ExportSeriesValues(Series[] series)
+ {
+ //*****************************************************
+ //** Create DataSet object
+ //*****************************************************
+ DataSet dataSet = new DataSet();
+ dataSet.Locale = System.Globalization.CultureInfo.CurrentCulture;
+ // If input series are specified
+ if(series != null)
+ {
+ // Export each series in the loop
+ foreach(Series ser in series)
+ {
+
+ //*****************************************************
+ //** Check if all X values are zeros
+ //*****************************************************
+ bool zeroXValues = true;
+ foreach( DataPoint point in ser.Points )
+ {
+ if( point.XValue != 0.0 )
+ {
+ zeroXValues = false;
+ break;
+ }
+ }
+
+ // Added 10 May 2005, DT - dataset after databinding
+ // to string x value returns X as indexes
+ if (zeroXValues && ser.XValueType == ChartValueType.String)
+ {
+ zeroXValues = false;
+ }
+
+ //*****************************************************
+ //** Create new table for the series
+ //*****************************************************
+ DataTable seriesTable = new DataTable(ser.Name);
+ seriesTable.Locale = System.Globalization.CultureInfo.CurrentCulture;
+
+ //*****************************************************
+ //** Add X column into data table schema
+ //*****************************************************
+ Type columnType = typeof(double);
+ if(ser.IsXValueDateTime())
+ {
+ columnType = typeof(DateTime);
+ }
+ else if(ser.XValueType == ChartValueType.String)
+ {
+ columnType = typeof(string);
+ }
+ seriesTable.Columns.Add("X", columnType);
+
+
+ //*****************************************************
+ //** Add Y column(s) into data table schema
+ //*****************************************************
+ columnType = typeof(double);
+ if(ser.IsYValueDateTime())
+ {
+ columnType = typeof(DateTime);
+ }
+ else if(ser.YValueType == ChartValueType.String)
+ {
+ columnType = typeof(string);
+ }
+ for(int yIndex = 0; yIndex < ser.YValuesPerPoint; yIndex++)
+ {
+ if(yIndex == 0)
+ {
+ seriesTable.Columns.Add("Y", columnType);
+ }
+ else
+ {
+ seriesTable.Columns.Add("Y" + (yIndex + 1).ToString(System.Globalization.CultureInfo.InvariantCulture), columnType);
+ }
+ }
+
+
+ //*****************************************************
+ //** Fill data table's rows
+ //*****************************************************
+ double pointIndex = 1.0;
+ foreach(DataPoint point in ser.Points)
+ {
+ if(!point.IsEmpty || !this.IsEmptyPointIgnored)
+ {
+ DataRow dataRow = seriesTable.NewRow();
+
+ // Set row X value
+ object xValue = point.XValue;
+ if(ser.IsXValueDateTime())
+ {
+ if (Double.IsNaN(point.XValue))
+ xValue = DBNull.Value;
+ else
+ xValue = DateTime.FromOADate(point.XValue);
+ }
+ else if(ser.XValueType == ChartValueType.String)
+ {
+ xValue = point.AxisLabel;
+ }
+ dataRow["X"] = (zeroXValues) ? pointIndex : xValue;
+
+ // Set row Y value(s)
+ for(int yIndex = 0; yIndex < ser.YValuesPerPoint; yIndex++)
+ {
+ object yValue = point.YValues[yIndex];
+ if(!point.IsEmpty)
+ {
+ if(ser.IsYValueDateTime())
+ {
+ if (Double.IsNaN(point.YValues[yIndex]))
+ xValue = DBNull.Value;
+ else
+ yValue = DateTime.FromOADate(point.YValues[yIndex]);
+ }
+ else if(ser.YValueType == ChartValueType.String)
+ {
+ yValue = point.AxisLabel;
+ }
+ }
+ else if(!this.IsEmptyPointIgnored)
+ {
+ // Special handling of empty points
+ yValue = DBNull.Value;
+ }
+
+ if(yIndex == 0)
+ {
+ dataRow["Y"] = yValue;
+ }
+ else
+ {
+ dataRow["Y" + (yIndex + 1).ToString(System.Globalization.CultureInfo.InvariantCulture)] = yValue;
+ }
+ }
+
+ // Add row to the table
+ seriesTable.Rows.Add(dataRow);
+
+ ++pointIndex;
+ }
+ }
+
+ // Accept changes
+ seriesTable.AcceptChanges();
+
+ //*****************************************************
+ //** Add data table into the data set
+ //*****************************************************
+ dataSet.Tables.Add(seriesTable);
+ }
+ }
+
+ return dataSet;
+ }
+
+ #endregion
+
+ #region Series data exporting overloaded methods
+
+ /// <summary>
+ /// Export all series from the collection into the DataSet object.
+ /// </summary>
+ /// <returns>Dataset object with series data.</returns>
+ public DataSet ExportSeriesValues()
+ {
+ return ExportSeriesValues("*");
+ }
+
+ /// <summary>
+ /// Export series data into the DataSet object.
+ /// </summary>
+ /// <param name="seriesNames">Comma separated list of series names to be exported.</param>
+ /// <returns>Dataset object with series data.</returns>
+ public DataSet ExportSeriesValues(string seriesNames)
+ {
+ // Check arguments
+ if (seriesNames == null)
+ throw new ArgumentNullException(seriesNames);
+
+ return ExportSeriesValues(ConvertToSeriesArray(seriesNames, false));
+ }
+
+ /// <summary>
+ /// Export series data into the DataSet object.
+ /// </summary>
+ /// <param name="series">Series to be exported.</param>
+ /// <returns>Dataset object with series data.</returns>
+ public DataSet ExportSeriesValues(Series series)
+ {
+ // Check arguments
+ if (series == null)
+ throw new ArgumentNullException("series");
+
+ return ExportSeriesValues(ConvertToSeriesArray(series, false));
+ }
+
+ #endregion
+
+ #region Filtering properties
+
+ /// <summary>
+ /// Gets or sets a flag which indicates whether points filtered by
+ /// the Filter or FilterTopN methods are removed or marked as empty.
+ /// If set to true, filtered points are marked as empty; otherwise they are removed.
+ /// This property defaults to be false.
+ /// </summary>
+ public bool FilterSetEmptyPoints
+ {
+ get
+ {
+ return _filterSetEmptyPoints;
+ }
+ set
+ {
+ _filterSetEmptyPoints = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value that determines if points are filtered
+ /// if they match criteria that is specified in Filter method calls.
+ /// If set to true, points that match specified criteria are filtered.
+ /// If set to false, points that do not match the criteria are filtered.
+ /// This property defaults to be true.
+ /// </summary>
+ public bool FilterMatchedPoints
+ {
+ get
+ {
+ return _filterMatchedPoints;
+ }
+ set
+ {
+ _filterMatchedPoints = value;
+ }
+ }
+
+ #endregion
+
+ #region Filtering methods
+
+ /// <summary>
+ /// Keeps only N top/bottom points of the series
+ /// </summary>
+ /// <param name="pointCount">Number of top/bottom points to return.</param>
+ /// <param name="inputSeries">Input series array.</param>
+ /// <param name="outputSeries">Output series array.</param>
+ /// <param name="usingValue">Defines which value of the point use in comparison (X, Y, Y2, ...).</param>
+ /// <param name="getTopValues">Indicate that N top values must be retrieved, otherwise N bottom values.</param>
+ private void FilterTopN(int pointCount,
+ Series[] inputSeries,
+ Series[] outputSeries,
+ string usingValue,
+ bool getTopValues)
+ {
+ // Check input/output series arrays
+ CheckSeriesArrays(inputSeries, outputSeries);
+
+ // Check input series alignment
+ CheckXValuesAlignment(inputSeries);
+
+ if(pointCount <= 0)
+ {
+ throw (new ArgumentOutOfRangeException("pointCount", SR.ExceptionDataManipulatorPointCountIsZero));
+ }
+
+ //**************************************************
+ //** Filter points in the first series and remove
+ //** in all
+ //**************************************************
+
+ // Define an output series array
+ Series[] output = new Series[inputSeries.Length];
+ for(int seriesIndex = 0; seriesIndex < inputSeries.Length; seriesIndex++)
+ {
+ output[seriesIndex] = inputSeries[seriesIndex];
+ if(outputSeries != null && outputSeries.Length > seriesIndex)
+ {
+ output[seriesIndex] = outputSeries[seriesIndex];
+ }
+
+ // Remove all points from the output series
+ if(output[seriesIndex] != inputSeries[seriesIndex])
+ {
+ output[seriesIndex].Points.Clear();
+
+ // Make sure there is enough Y values per point
+ output[seriesIndex].YValuesPerPoint = inputSeries[seriesIndex].YValuesPerPoint;
+
+ // Copy X values type
+ if(output[seriesIndex].XValueType == ChartValueType.Auto || output[seriesIndex].autoXValueType)
+ {
+ output[seriesIndex].XValueType = inputSeries[seriesIndex].XValueType;
+ output[seriesIndex].autoXValueType = true;
+ }
+ // Copy Y values type
+ if(output[seriesIndex].YValueType == ChartValueType.Auto || output[seriesIndex].autoYValueType)
+ {
+ output[seriesIndex].YValueType = inputSeries[seriesIndex].YValueType;
+ output[seriesIndex].autoYValueType = true;
+ }
+
+ // Copy input points into output
+ foreach(DataPoint point in inputSeries[seriesIndex].Points)
+ {
+ output[seriesIndex].Points.Add(point.Clone());
+ }
+ }
+
+ }
+
+ // No points to filter
+ if(inputSeries[0].Points.Count == 0)
+ {
+ return;
+ }
+
+ //**************************************************
+ //** Sort input data
+ //**************************************************
+ this.Sort((getTopValues) ? PointSortOrder.Descending : PointSortOrder.Ascending,
+ usingValue,
+ output);
+
+ //**************************************************
+ //** Get top/bottom points
+ //**************************************************
+ // Process all series
+ for(int seriesIndex = 0; seriesIndex < inputSeries.Length; seriesIndex++)
+ {
+ // Only keep N first points
+ while(output[seriesIndex].Points.Count > pointCount)
+ {
+ if(this.FilterSetEmptyPoints)
+ {
+ output[seriesIndex].Points[pointCount].IsEmpty = true;
+ ++pointCount;
+ }
+ else
+ {
+ output[seriesIndex].Points.RemoveAt(pointCount);
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Filter data points using IDataPointFilter interface
+ /// </summary>
+ /// <param name="filterInterface">Data points filtering interface.</param>
+ /// <param name="inputSeries">Input series array.</param>
+ /// <param name="outputSeries">Output series array.</param>
+ private void Filter(IDataPointFilter filterInterface,
+ Series[] inputSeries,
+ Series[] outputSeries)
+ {
+ //**************************************************
+ //** Check input/output series arrays
+ //**************************************************
+ CheckSeriesArrays(inputSeries, outputSeries);
+
+ CheckXValuesAlignment(inputSeries);
+
+ if(filterInterface == null)
+ {
+ throw(new ArgumentNullException("filterInterface"));
+ }
+
+ //**************************************************
+ //** Filter points in the first series and remove
+ //** in all
+ //**************************************************
+
+ // Define an output series array
+ Series[] output = new Series[inputSeries.Length];
+ for(int seriesIndex = 0; seriesIndex < inputSeries.Length; seriesIndex++)
+ {
+ output[seriesIndex] = inputSeries[seriesIndex];
+ if(outputSeries != null && outputSeries.Length > seriesIndex)
+ {
+ output[seriesIndex] = outputSeries[seriesIndex];
+ }
+
+ // Remove all points from the output series
+ if(output[seriesIndex] != inputSeries[seriesIndex])
+ {
+ output[seriesIndex].Points.Clear();
+
+ // Make sure there is enough Y values per point
+ output[seriesIndex].YValuesPerPoint = inputSeries[seriesIndex].YValuesPerPoint;
+
+ // Copy X values type
+ if(output[seriesIndex].XValueType == ChartValueType.Auto || output[seriesIndex].autoXValueType)
+ {
+ output[seriesIndex].XValueType = inputSeries[seriesIndex].XValueType;
+ output[seriesIndex].autoXValueType = true;
+ }
+ // Copy Y values type
+ if(output[seriesIndex].YValueType == ChartValueType.Auto || output[seriesIndex].autoYValueType)
+ {
+ output[seriesIndex].YValueType = inputSeries[seriesIndex].YValueType;
+ output[seriesIndex].autoYValueType = true;
+ }
+
+ }
+
+ }
+
+ // No points to filter
+ if(inputSeries[0].Points.Count == 0)
+ {
+ return;
+ }
+
+ //**************************************************
+ //** Loop through all points of the first input series
+ //**************************************************
+ int originalPointIndex = 0;
+ for(int pointIndex = 0; pointIndex < inputSeries[0].Points.Count; pointIndex++, originalPointIndex++)
+ {
+ bool pointRemoved = false;
+
+ // Check if point match the criteria
+ bool matchCriteria = filterInterface.FilterDataPoint(
+ inputSeries[0].Points[pointIndex],
+ inputSeries[0],
+ originalPointIndex) == this.FilterMatchedPoints;
+
+
+ // Process all series
+ for(int seriesIndex = 0; seriesIndex < inputSeries.Length; seriesIndex++)
+ {
+ bool seriesMatchCriteria = matchCriteria;
+ if(output[seriesIndex] != inputSeries[seriesIndex])
+ {
+ if(seriesMatchCriteria && !this.FilterSetEmptyPoints)
+ {
+ // Don't do anything...
+ seriesMatchCriteria = false;
+ }
+ else
+ {
+ // Copy point into the output series for all series
+ output[seriesIndex].Points.Add(inputSeries[seriesIndex].Points[pointIndex].Clone());
+ }
+ }
+
+
+ // If point match the criteria
+ if(seriesMatchCriteria)
+ {
+ // Set point's empty flag
+ if(this.FilterSetEmptyPoints)
+ {
+ output[seriesIndex].Points[pointIndex].IsEmpty = true;
+ for(int valueIndex = 0; valueIndex < output[seriesIndex].Points[pointIndex].YValues.Length; valueIndex++)
+ {
+ output[seriesIndex].Points[pointIndex].YValues[valueIndex] = 0.0;
+ }
+ }
+
+ // Remove point
+ else
+ {
+ output[seriesIndex].Points.RemoveAt(pointIndex);
+ pointRemoved = true;
+ }
+ }
+ }
+
+ // Adjust index because of the removed point
+ if(pointRemoved)
+ {
+ --pointIndex;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Data point filter.
+ /// Filters points using element type and index
+ /// </summary>
+ private class PointElementFilter : IDataPointFilter
+ {
+ // Private fields
+ private DataManipulator _dataManipulator = null;
+ private DateRangeType _dateRange;
+ private int[] _rangeElements = null;
+
+ // Default constructor is not accesiable
+ private PointElementFilter()
+ {
+ }
+
+ /// <summary>
+ /// Public constructor.
+ /// </summary>
+ /// <param name="dataManipulator">Data manipulator object.</param>
+ /// <param name="dateRange">Range type.</param>
+ /// <param name="rangeElements">Range elements to filter.</param>
+ public PointElementFilter(DataManipulator dataManipulator, DateRangeType dateRange, string rangeElements)
+ {
+ this._dataManipulator = dataManipulator;
+ this._dateRange = dateRange;
+ this._rangeElements = dataManipulator.ConvertElementIndexesToArray(rangeElements);
+ }
+
+ /// <summary>
+ /// Data points filtering method.
+ /// </summary>
+ /// <param name="point">Data point.</param>
+ /// <param name="series">Data point series.</param>
+ /// <param name="pointIndex">Data point index.</param>
+ /// <returns>Indicates that point should be filtered.</returns>
+ public bool FilterDataPoint(DataPoint point, Series series, int pointIndex)
+ {
+ return _dataManipulator.CheckFilterElementCriteria(
+ this._dateRange,
+ this._rangeElements,
+ point);
+ }
+ }
+
+ /// <summary>
+ /// Data point filter.
+ /// Filters points using point values
+ /// </summary>
+ private class PointValueFilter : IDataPointFilter
+ {
+ // Private fields
+ private CompareMethod _compareMethod;
+ private string _usingValue;
+ private double _compareValue;
+
+ /// <summary>
+ /// Default constructor is not accessible
+ /// </summary>
+ private PointValueFilter()
+ {
+ }
+
+ /// <summary>
+ /// Public constructor.
+ /// </summary>
+ /// <param name="compareMethod">Comparing method.</param>
+ /// <param name="compareValue">Comparing constant.</param>
+ /// <param name="usingValue">Value used in comparison.</param>
+ public PointValueFilter(CompareMethod compareMethod,
+ double compareValue,
+ string usingValue)
+ {
+ this._compareMethod = compareMethod;
+ this._usingValue = usingValue;
+ this._compareValue = compareValue;
+ }
+
+ /// <summary>
+ /// IDataPointFilter interface method implementation
+ /// </summary>
+ /// <param name="point">Data point.</param>
+ /// <param name="series">Data point series.</param>
+ /// <param name="pointIndex">Data point index.</param>
+ /// <returns>Indicates that point should be filtered.</returns>
+ public bool FilterDataPoint(DataPoint point, Series series, int pointIndex)
+ {
+ // Check if point match the criteria
+ bool matchCriteria = false;
+ switch(_compareMethod)
+ {
+ case(CompareMethod.EqualTo):
+ matchCriteria = point.GetValueByName(_usingValue)
+ == _compareValue;
+ break;
+ case(CompareMethod.LessThan):
+ matchCriteria = point.GetValueByName(_usingValue)
+ < _compareValue;
+ break;
+ case(CompareMethod.LessThanOrEqualTo):
+ matchCriteria = point.GetValueByName(_usingValue)
+ <= _compareValue;
+ break;
+ case(CompareMethod.MoreThan):
+ matchCriteria = point.GetValueByName(_usingValue)
+ > _compareValue;
+ break;
+ case(CompareMethod.MoreThanOrEqualTo):
+ matchCriteria = point.GetValueByName(_usingValue)
+ >= _compareValue;
+ break;
+ case(CompareMethod.NotEqualTo):
+ matchCriteria = point.GetValueByName(_usingValue)
+ != _compareValue;
+ break;
+ }
+
+ return matchCriteria;
+ }
+ }
+
+ /// <summary>
+ /// Helper function to convert elements indexes from a string
+ /// into an array of integers
+ /// </summary>
+ /// <param name="rangeElements">Element indexes string. Ex:"3,5,6-9,15"</param>
+ /// <returns>Array of integer indexes.</returns>
+ private int[] ConvertElementIndexesToArray(string rangeElements)
+ {
+ // Split input string by comma
+ string[] indexes = rangeElements.Split(',');
+
+ // Check if there are items in the array
+ if(indexes.Length == 0)
+ {
+ throw (new ArgumentException(SR.ExceptionDataManipulatorIndexUndefined, "rangeElements"));
+ }
+
+ // Allocate memory for the result array
+ int[] result = new int[indexes.Length * 2];
+
+ // Process each element index
+ int index = 0;
+ foreach(string str in indexes)
+ {
+ // Check if it's a simple index or a range
+ if(str.IndexOf('-') != -1)
+ {
+ string[] rangeIndex = str.Split('-');
+ if(rangeIndex.Length == 2)
+ {
+ // Convert to integer
+ try
+ {
+ result[index] = Int32.Parse(rangeIndex[0], System.Globalization.CultureInfo.InvariantCulture);
+ result[index + 1] = Int32.Parse(rangeIndex[1], System.Globalization.CultureInfo.InvariantCulture);
+
+ if(result[index + 1] < result[index])
+ {
+ int temp = result[index];
+ result[index] = result[index + 1];
+ result[index + 1] = temp;
+ }
+ }
+ catch(System.Exception)
+ {
+ throw (new ArgumentException(SR.ExceptionDataManipulatorIndexFormatInvalid, "rangeElements"));
+ }
+ }
+ else
+ {
+ throw (new ArgumentException(SR.ExceptionDataManipulatorIndexFormatInvalid, "rangeElements"));
+ }
+ }
+ else
+ {
+ // Convert to integer
+ try
+ {
+ result[index] = Int32.Parse(str, System.Globalization.CultureInfo.InvariantCulture);
+ result[index + 1] = result[index];
+ }
+ catch(System.Exception)
+ {
+ throw (new ArgumentException(SR.ExceptionDataManipulatorIndexFormatInvalid, "rangeElements"));
+ }
+ }
+
+ index += 2;
+ }
+
+ return result;
+ }
+
+ /// <summary>
+ /// Helper function, which checks if specified point matches the criteria
+ /// </summary>
+ /// <param name="dateRange">Element type.</param>
+ /// <param name="rangeElements">Array of element indexes ranges (pairs).</param>
+ /// <param name="point">Data point to check.</param>
+ /// <returns>True if point matches the criteria.</returns>
+ private bool CheckFilterElementCriteria(
+ DateRangeType dateRange,
+ int[] rangeElements,
+ DataPoint point)
+ {
+ // Conver X value to DateTime
+ DateTime dateTimeValue = DateTime.FromOADate(point.XValue);
+
+ for(int index = 0; index < rangeElements.Length; index += 2)
+ {
+ switch(dateRange)
+ {
+ case(DateRangeType.Year):
+ if(dateTimeValue.Year >= rangeElements[index] &&
+ dateTimeValue.Year <= rangeElements[index+1])
+ return true;
+ break;
+ case(DateRangeType.Month):
+ if(dateTimeValue.Month >= rangeElements[index] &&
+ dateTimeValue.Month <= rangeElements[index+1])
+ return true;
+ break;
+ case(DateRangeType.DayOfWeek):
+ if((int)dateTimeValue.DayOfWeek >= rangeElements[index] &&
+ (int)dateTimeValue.DayOfWeek <= rangeElements[index+1])
+ return true;
+ break;
+ case(DateRangeType.DayOfMonth):
+ if(dateTimeValue.Day >= rangeElements[index] &&
+ dateTimeValue.Day <= rangeElements[index+1])
+ return true;
+ break;
+ case(DateRangeType.Hour):
+ if(dateTimeValue.Hour >= rangeElements[index] &&
+ dateTimeValue.Hour <= rangeElements[index+1])
+ return true;
+ break;
+ case(DateRangeType.Minute):
+ if(dateTimeValue.Minute >= rangeElements[index] &&
+ dateTimeValue.Minute <= rangeElements[index+1])
+ return true;
+ break;
+ }
+ }
+
+ return false;
+ }
+
+ #endregion
+
+ #region Filtering overloaded methods
+
+ /// <summary>
+ /// Filters a series' data points, either removing the specified points
+ /// or marking them as empty for the given date/time ranges.
+ /// </summary>
+ /// <param name="dateRange">Element type.</param>
+ /// <param name="rangeElements">Specifies the elements within the date/time range
+ /// (specified by the dateRange parameter) that will be filtered. Can be a single value (e.g. "7"),
+ /// comma-separated values (e.g. "5,6"), a range of values (e.g. 9-11),
+ /// or any variation thereof (e.g. "5,6,9-11").</param>
+ /// <param name="inputSeriesNames">Comma separated list of input series names.</param>
+ /// <param name="outputSeriesNames">Comma separated list of output series names, to store the output.</param>
+ public void Filter(DateRangeType dateRange,
+ string rangeElements,
+ string inputSeriesNames,
+ string outputSeriesNames)
+ {
+ // Check arguments
+ if (rangeElements == null)
+ throw new ArgumentNullException("rangeElements");
+ if (inputSeriesNames == null)
+ throw new ArgumentNullException("inputSeriesNames");
+
+ // Filter points using filtering interface
+ Filter(new PointElementFilter(this, dateRange, rangeElements),
+ ConvertToSeriesArray(inputSeriesNames, false),
+ ConvertToSeriesArray(outputSeriesNames, true));
+ }
+
+ /// <summary>
+ /// Filters a series' data points, either removing the specified points
+ /// or marking them as empty for the given date/time ranges.
+ /// The Series object that is filtered is used to store the modified data.
+ /// </summary>
+ /// <param name="dateRange">Element type.</param>
+ /// <param name="rangeElements">Specifies the elements within the date/time range
+ /// (specified by the dateRange parameter) that will be filtered. Can be a single value (e.g. "7"),
+ /// comma-separated values (e.g. "5,6"), a range of values (e.g. 9-11),
+ /// or any variation thereof (e.g. "5,6,9-11").</param>
+ /// <param name="inputSeries">Input series.</param>
+ public void Filter(DateRangeType dateRange,
+ string rangeElements,
+ Series inputSeries)
+ {
+ // Check arguments
+ if (rangeElements == null)
+ throw new ArgumentNullException("rangeElements");
+ if (inputSeries == null)
+ throw new ArgumentNullException("inputSeries");
+
+ Filter(dateRange, rangeElements, inputSeries, null);
+ }
+
+ /// <summary>
+ /// Filters a series' data points, either removing the specified points
+ /// or marking them as empty for the given date/time ranges.
+ /// </summary>
+ /// <param name="dateRange">Element type.</param>
+ /// <param name="rangeElements">Specifies the elements within the date/time range
+ /// (specified by the dateRange parameter) that will be filtered. Can be a single value (e.g. "7"),
+ /// comma-separated values (e.g. "5,6"), a range of values (e.g. 9-11),
+ /// or any variation thereof (e.g. "5,6,9-11").</param>
+ /// <param name="inputSeries">Input series.</param>
+ /// <param name="outputSeries">Output series.</param>
+ public void Filter(DateRangeType dateRange,
+ string rangeElements,
+ Series inputSeries,
+ Series outputSeries)
+ {
+ // Check arguments
+ if (rangeElements == null)
+ throw new ArgumentNullException("rangeElements");
+ if (inputSeries == null)
+ throw new ArgumentNullException("inputSeries");
+
+ // Filter points using filtering interface
+ Filter(new PointElementFilter(this, dateRange, rangeElements),
+ ConvertToSeriesArray(inputSeries, false),
+ ConvertToSeriesArray(outputSeries, false));
+ }
+
+ /// <summary>
+ /// Filters a series' data points, either removing the specified points
+ /// or marking them as empty for the given date/time ranges.
+ /// The filtered Series objects are used to store the modified data.
+ /// </summary>
+ /// <param name="dateRange">Element type.</param>
+ /// <param name="rangeElements">Specifies the elements within the date/time range
+ /// (specified by the dateRange parameter) that will be filtered. Can be a single value (e.g. "7"),
+ /// comma-separated values (e.g. "5,6"), a range of values (e.g. 9-11),
+ /// or any variation thereof (e.g. "5,6,9-11").</param>
+ /// <param name="inputSeriesNames">Comma separated list of input series names.</param>
+ public void Filter(DateRangeType dateRange,
+ string rangeElements,
+ string inputSeriesNames)
+ {
+ // Check arguments
+ if (rangeElements == null)
+ throw new ArgumentNullException("rangeElements");
+ if (inputSeriesNames == null)
+ throw new ArgumentNullException("inputSeriesNames");
+
+ Filter(dateRange,
+ rangeElements,
+ inputSeriesNames,
+ "");
+ }
+
+ /// <summary>
+ /// Filters a series' data points by applying a filtering rule to the first Y-value of data points.
+ /// The Series object that is filtered is used to store the modified data.
+ /// </summary>
+ /// <param name="compareMethod">Value comparing method.</param>
+ /// <param name="compareValue">Value to compare with.</param>
+ /// <param name="inputSeries">Input series.</param>
+ public void Filter(CompareMethod compareMethod,
+ double compareValue,
+ Series inputSeries)
+ {
+ // Check arguments
+ if (inputSeries == null)
+ throw new ArgumentNullException("inputSeries");
+
+ Filter(compareMethod,
+ compareValue,
+ inputSeries,
+ null,
+ "Y");
+ }
+
+ /// <summary>
+ /// Filters a series' data points by applying a filtering rule to the first Y-value of data points.
+ /// </summary>
+ /// <param name="compareMethod">Value comparing method.</param>
+ /// <param name="compareValue">Value to compare with.</param>
+ /// <param name="inputSeries">Input series.</param>
+ /// <param name="outputSeries">Output series.</param>
+ public void Filter(CompareMethod compareMethod,
+ double compareValue,
+ Series inputSeries,
+ Series outputSeries)
+ {
+ // Check arguments
+ if (inputSeries == null)
+ throw new ArgumentNullException("inputSeries");
+
+ // Filter points using filtering interface
+ Filter(new PointValueFilter(compareMethod, compareValue, "Y"),
+ ConvertToSeriesArray(inputSeries, false),
+ ConvertToSeriesArray(outputSeries, false));
+ }
+
+ /// <summary>
+ /// Filters a series' data points by applying a filtering rule to the specified value for comparison.
+ /// </summary>
+ /// <param name="compareMethod">Value comparing method.</param>
+ /// <param name="compareValue">Value to compare with.</param>
+ /// <param name="inputSeries">Input series.</param>
+ /// <param name="outputSeries">Output series.</param>
+ /// <param name="usingValue">The data point value that the filtering rule is applied to. Can be X, Y, Y2, Y3, etc.</param>
+ public void Filter(CompareMethod compareMethod,
+ double compareValue,
+ Series inputSeries,
+ Series outputSeries,
+ string usingValue)
+ {
+ // Check arguments
+ if (inputSeries == null)
+ throw new ArgumentNullException("inputSeries");
+ if (usingValue == null)
+ throw new ArgumentNullException("usingValue");
+
+ // Filter points using filtering interface
+ Filter(new PointValueFilter(compareMethod, compareValue, usingValue),
+ ConvertToSeriesArray(inputSeries, false),
+ ConvertToSeriesArray(outputSeries, false));
+ }
+
+ /// <summary>
+ /// Filters one or more series by applying a filtering rule to the first Y-value of the first series' data points.
+ /// The filtered Series objects are used to store the modified data.
+ /// </summary>
+ /// <param name="compareMethod">Value comparing method.</param>
+ /// <param name="compareValue">Value to compare with.</param>
+ /// <param name="inputSeriesNames">Comma separated list of input series names.</param>
+ public void Filter(CompareMethod compareMethod,
+ double compareValue,
+ string inputSeriesNames)
+ {
+ // Check arguments
+ if (inputSeriesNames == null)
+ throw new ArgumentNullException("inputSeriesNames");
+
+ Filter(compareMethod,
+ compareValue,
+ inputSeriesNames,
+ "",
+ "Y");
+ }
+
+ /// <summary>
+ /// Filters one or more series by applying a filtering rule to the first Y-value of the first series' data points.
+ /// </summary>
+ /// <param name="compareMethod">Value comparing method.</param>
+ /// <param name="compareValue">Value to compare with.</param>
+ /// <param name="inputSeriesNames">Comma separated list of input series names.</param>
+ /// <param name="outputSeriesNames">Comma separated list of output series names.</param>
+ public void Filter(CompareMethod compareMethod,
+ double compareValue,
+ string inputSeriesNames,
+ string outputSeriesNames)
+ {
+ // Check arguments
+ if (inputSeriesNames == null)
+ throw new ArgumentNullException("inputSeriesNames");
+
+ // Filter points using filtering interface
+ Filter(new PointValueFilter(compareMethod, compareValue, "Y"),
+ ConvertToSeriesArray(inputSeriesNames, false),
+ ConvertToSeriesArray(outputSeriesNames, true));
+ }
+
+ /// <summary>
+ /// Filters one or more series by applying a filtering rule to the specified value of the first series' data points.
+ /// </summary>
+ /// <param name="compareMethod">Value comparing method.</param>
+ /// <param name="compareValue">Value to compare with.</param>
+ /// <param name="inputSeriesNames">Comma separated input series names.</param>
+ /// <param name="outputSeriesNames">Comma separated output series names.</param>
+ /// <param name="usingValue">The data point value that the filtering rule is applied to. Can be X, Y, Y2, Y3, etc.</param>
+ public void Filter(CompareMethod compareMethod,
+ double compareValue,
+ string inputSeriesNames,
+ string outputSeriesNames,
+ string usingValue)
+ {
+ // Check arguments
+ if (inputSeriesNames == null)
+ throw new ArgumentNullException("inputSeriesNames");
+ if (usingValue == null)
+ throw new ArgumentNullException("usingValue");
+
+ // Filter points using filtering interface
+ Filter(new PointValueFilter(compareMethod, compareValue, usingValue),
+ ConvertToSeriesArray(inputSeriesNames, false),
+ ConvertToSeriesArray(outputSeriesNames, true));
+ }
+
+ /// <summary>
+ /// Filters all data points in one or more series except for a specified number of points.
+ /// The points that are not filtered correspond to points in the first input series that have the largest or smallest values.
+ /// </summary>
+ /// <param name="pointCount">The number of data points that the filtering operation will not remove.</param>
+ /// <param name="inputSeriesNames">Comma separated list of input series names.</param>
+ /// <param name="outputSeriesNames">Comma separated list of output series names.</param>
+ /// <param name="usingValue">The data point value that the filtering rule is applied to. Can be X, Y, Y2, Y3, etc.</param>
+ /// <param name="getTopValues">The largest values are kept if set to true; otherwise the smallest values are kept.</param>
+ public void FilterTopN(int pointCount,
+ string inputSeriesNames,
+ string outputSeriesNames,
+ string usingValue,
+ bool getTopValues)
+ {
+ // Check arguments
+ if (inputSeriesNames == null)
+ throw new ArgumentNullException("inputSeriesNames");
+ if (usingValue == null)
+ throw new ArgumentNullException("usingValue");
+
+ FilterTopN(pointCount,
+ ConvertToSeriesArray(inputSeriesNames, false),
+ ConvertToSeriesArray(outputSeriesNames, true),
+ usingValue,
+ getTopValues);
+ }
+
+ /// <summary>
+ /// Filters out all data points in a series except for a specified number of points with the largest (first) Y-values.
+ /// The Series object that is filtered is used to store the modified data.
+ /// </summary>
+ /// <param name="pointCount">The number of data points that the filtering operation will not remove.</param>
+ /// <param name="inputSeries">Input series.</param>
+ public void FilterTopN(int pointCount,
+ Series inputSeries)
+ {
+ // Check arguments
+ if (inputSeries == null)
+ throw new ArgumentNullException("inputSeries");
+
+ FilterTopN(pointCount,
+ ConvertToSeriesArray(inputSeries, false),
+ null,
+ "Y",
+ true);
+ }
+
+ /// <summary>
+ /// Filters all data points in a series except for a specified number of points with the largest first Y-values.
+ /// </summary>
+ /// <param name="pointCount">The number of data points that the filtering operation will not remove.</param>
+ /// <param name="inputSeries">Input series.</param>
+ /// <param name="outputSeries">Output series.</param>
+ public void FilterTopN(int pointCount,
+ Series inputSeries,
+ Series outputSeries)
+ {
+ // Check arguments
+ if (inputSeries == null)
+ throw new ArgumentNullException("inputSeries");
+
+ FilterTopN(pointCount,
+ ConvertToSeriesArray(inputSeries, false),
+ ConvertToSeriesArray(outputSeries, false),
+ "Y",
+ true);
+ }
+
+ /// <summary>
+ /// Filters all data points in a series except for a specified number of points with the largest values.
+ /// </summary>
+ /// <param name="pointCount">The number of data points that the filtering operation will not remove.</param>
+ /// <param name="inputSeries">Input series.</param>
+ /// <param name="outputSeries">Output series.</param>
+ /// <param name="usingValue">The data point value that the filtering rule is applied to. Can be X, Y, Y2, Y3, etc.</param>
+ public void FilterTopN(int pointCount,
+ Series inputSeries,
+ Series outputSeries,
+ string usingValue)
+ {
+ // Check arguments
+ if (inputSeries == null)
+ throw new ArgumentNullException("inputSeries");
+ if (usingValue == null)
+ throw new ArgumentNullException("usingValue");
+
+ FilterTopN(pointCount,
+ ConvertToSeriesArray(inputSeries, false),
+ ConvertToSeriesArray(outputSeries, false),
+ usingValue,
+ true);
+ }
+
+ /// <summary>
+ /// Filters all data points in a series except for a specified number of points with the smallest or largest values.
+ /// </summary>
+ /// <param name="pointCount">The number of data points that the filtering operation will not remove.</param>
+ /// <param name="inputSeries">Input series.</param>
+ /// <param name="outputSeries">Output series.</param>
+ /// <param name="usingValue">The data point value that the filtering rule is applied to. Can be X, Y, Y2, Y3, etc.</param>
+ /// <param name="getTopValues">The largest values are kept if set to true; otherwise the smallest values are kept.</param>
+ public void FilterTopN(int pointCount,
+ Series inputSeries,
+ Series outputSeries,
+ string usingValue,
+ bool getTopValues)
+ {
+ // Check arguments
+ if (inputSeries == null)
+ throw new ArgumentNullException("inputSeries");
+ if (usingValue == null)
+ throw new ArgumentNullException("usingValue");
+
+ FilterTopN(pointCount,
+ ConvertToSeriesArray(inputSeries, false),
+ ConvertToSeriesArray(outputSeries, false),
+ usingValue,
+ getTopValues);
+ }
+
+ /// <summary>
+ /// Filters all data points in one or more series except for a specified number of points.
+ /// The points that are not filtered correspond to points in the first series that have the largest first Y-values.
+ /// The Series objects that are filtered are used to store the modified data.
+ /// </summary>
+ /// <param name="pointCount">The number of data points that the filtering operation will not remove.</param>
+ /// <param name="inputSeriesNames">Comma separated list of input series names.</param>
+ public void FilterTopN(int pointCount,
+ string inputSeriesNames)
+ {
+ // Check arguments
+ if (inputSeriesNames == null)
+ throw new ArgumentNullException("inputSeriesNames");
+
+ FilterTopN(pointCount,
+ ConvertToSeriesArray(inputSeriesNames, false),
+ null,
+ "Y",
+ true);
+ }
+
+ /// <summary>
+ /// Filters out data points in one or more series except for a specified number of points.
+ /// The points that aren't filtered correspond to points in the first series that have the largest first Y-values.
+ /// </summary>
+ /// <param name="pointCount">The number of data points that the filtering operation will not remove.</param>
+ /// <param name="inputSeriesNames">Comma separated list of input series names.</param>
+ /// <param name="outputSeriesNames">Comma separated list of output series names.</param>
+ public void FilterTopN(int pointCount,
+ string inputSeriesNames,
+ string outputSeriesNames)
+ {
+ // Check arguments
+ if (inputSeriesNames == null)
+ throw new ArgumentNullException("inputSeriesNames");
+
+ FilterTopN(pointCount,
+ ConvertToSeriesArray(inputSeriesNames, false),
+ ConvertToSeriesArray(outputSeriesNames, true),
+ "Y",
+ true);
+ }
+
+ /// <summary>
+ /// Filters all data points in one or more series except for a specified number of points.
+ /// The points that are not filtered correspond to points in the first series that have the largest values.
+ /// </summary>
+ /// <param name="pointCount">The number of data points that the filtering operation will not remove.</param>
+ /// <param name="inputSeriesNames">Comma separated list of input series names.</param>
+ /// <param name="outputSeriesNames">Comma separated list of output series names.</param>
+ /// <param name="usingValue">The data point value that the filtering rule is applied to. Can be X, Y, Y2, Y3, etc.</param>
+ public void FilterTopN(int pointCount,
+ string inputSeriesNames,
+ string outputSeriesNames,
+ string usingValue)
+ {
+ // Check arguments
+ if (inputSeriesNames == null)
+ throw new ArgumentNullException("inputSeriesNames");
+ if (usingValue == null)
+ throw new ArgumentNullException("usingValue");
+
+ FilterTopN(pointCount,
+ ConvertToSeriesArray(inputSeriesNames, false),
+ ConvertToSeriesArray(outputSeriesNames, true),
+ usingValue,
+ true);
+ }
+
+
+ /// <summary>
+ /// Performs custom filtering on a series' data points.
+ /// The Series object that is filtered is used to store the modified data.
+ /// </summary>
+ /// <param name="filterInterface">Filtering interface.</param>
+ /// <param name="inputSeries">Input series.</param>
+ public void Filter(IDataPointFilter filterInterface,
+ Series inputSeries)
+ {
+ // Check arguments
+ if (filterInterface == null)
+ throw new ArgumentNullException("filterInterface");
+ if (inputSeries == null)
+ throw new ArgumentNullException("inputSeries");
+
+ Filter(filterInterface,
+ ConvertToSeriesArray(inputSeries, false),
+ null);
+ }
+
+ /// <summary>
+ /// Performs custom filtering on a series' data points.
+ /// </summary>
+ /// <param name="filterInterface">Filtering interface.</param>
+ /// <param name="inputSeries">Input series.</param>
+ /// <param name="outputSeries">Output series.</param>
+ public void Filter(IDataPointFilter filterInterface,
+ Series inputSeries,
+ Series outputSeries)
+ {
+ // Check arguments
+ if (filterInterface == null)
+ throw new ArgumentNullException("filterInterface");
+ if (inputSeries == null)
+ throw new ArgumentNullException("inputSeries");
+
+ Filter(filterInterface,
+ ConvertToSeriesArray(inputSeries, false),
+ ConvertToSeriesArray(outputSeries, false));
+ }
+
+ /// <summary>
+ /// Performs custom filtering on one or more series' data points, based on the first series' points.
+ /// The filtered series are also used to store the modified data.
+ /// </summary>
+ /// <param name="filterInterface">Filtering interface.</param>
+ /// <param name="inputSeriesNames">Comma separated list of input series names.</param>
+ public void Filter(IDataPointFilter filterInterface,
+ string inputSeriesNames)
+ {
+ // Check arguments
+ if (filterInterface == null)
+ throw new ArgumentNullException("filterInterface");
+ if (inputSeriesNames == null)
+ throw new ArgumentNullException("inputSeriesNames");
+
+ Filter(filterInterface,
+ ConvertToSeriesArray(inputSeriesNames, false),
+ null);
+ }
+
+ /// <summary>
+ /// Performs custom filtering on one or more series' data points, based on the first series' points.
+ /// </summary>
+ /// <param name="filterInterface">Filtering interface.</param>
+ /// <param name="inputSeriesNames">Comma separated list of input series names.</param>
+ /// <param name="outputSeriesNames">Comma separated list of output series names.</param>
+ public void Filter(IDataPointFilter filterInterface,
+ string inputSeriesNames,
+ string outputSeriesNames)
+ {
+ // Check arguments
+ if (filterInterface == null)
+ throw new ArgumentNullException("filterInterface");
+ if (inputSeriesNames == null)
+ throw new ArgumentNullException("inputSeriesNames");
+
+ Filter(filterInterface,
+ ConvertToSeriesArray(inputSeriesNames, false),
+ ConvertToSeriesArray(outputSeriesNames, true));
+ }
+
+ #endregion
+
+ #region Grouping methods
+
+ /// <summary>
+ /// Class stores information about the grouping function type and
+ /// index of output value.
+ /// </summary>
+ private class GroupingFunctionInfo
+ {
+ // AxisName of the grouping function
+ internal GroupingFunction function = GroupingFunction.None;
+
+ // Index of the Y value for storing results
+ internal int outputIndex = 0;
+
+ /// <summary>
+ /// Constructor.
+ /// </summary>
+ internal GroupingFunctionInfo()
+ {
+ }
+ }
+
+ /// <summary>
+ /// Grouping by X value, when it’s a string (stored in AxisLabel property).
+ /// </summary>
+ /// <param name="formula">Grouping formula.</param>
+ /// <param name="inputSeries">Array of input series.</param>
+ /// <param name="outputSeries">Array of output series.</param>
+ private void GroupByAxisLabel(string formula, Series[] inputSeries, Series[] outputSeries)
+ {
+ // Check arguments
+ if (formula == null)
+ throw new ArgumentNullException("formula");
+
+ //**************************************************
+ //** Check input/output series arrays
+ //**************************************************
+ CheckSeriesArrays(inputSeries, outputSeries);
+
+ //**************************************************
+ //** Check and parse formula
+ //**************************************************
+ int outputValuesNumber = 1;
+ GroupingFunctionInfo[] functions = GetGroupingFunctions(inputSeries, formula, out outputValuesNumber);
+
+ //**************************************************
+ //** Loop through all input series
+ //**************************************************
+ for(int seriesIndex = 0; seriesIndex < inputSeries.Length; seriesIndex++)
+ {
+ // Define an input and output series
+ Series input = inputSeries[seriesIndex];
+ Series output = input;
+ if(outputSeries != null && seriesIndex < outputSeries.Length)
+ {
+ output = outputSeries[seriesIndex];
+
+ // Remove all points from the output series
+ if(output.Name != input.Name)
+ {
+ output.Points.Clear();
+
+ // Copy X values type
+ if(output.XValueType == ChartValueType.Auto || output.autoXValueType)
+ {
+ output.XValueType = input.XValueType;
+ output.autoXValueType = true;
+ }
+ // Copy Y values type
+ if(output.YValueType == ChartValueType.Auto || output.autoYValueType)
+ {
+ output.YValueType = input.YValueType;
+ output.autoYValueType = true;
+ }
+
+ }
+ }
+
+ // Copy input data into temp storage
+ if(input != output)
+ {
+ Series inputTemp = new Series("Temp", input.YValuesPerPoint);
+ foreach(DataPoint point in input.Points)
+ {
+ DataPoint dp = new DataPoint(inputTemp);
+ dp.AxisLabel = point.AxisLabel;
+ dp.XValue = point.XValue;
+ point.YValues.CopyTo(dp.YValues, 0);
+ dp.IsEmpty = point.IsEmpty;
+ inputTemp.Points.Add(dp);
+ }
+ input = inputTemp;
+ }
+
+ // No points to group
+ if(input.Points.Count == 0)
+ {
+ continue;
+ }
+
+ // Make sure there is enough Y values per point
+ output.YValuesPerPoint = outputValuesNumber - 1;
+
+ //**************************************************
+ //** Sort input data by axis label
+ //**************************************************
+ input.Sort(PointSortOrder.Ascending, "AxisLabel");
+
+ //**************************************************
+ //** Initialize interval & value tracking variables
+ //**************************************************
+ int intervalFirstIndex = 0;
+ int intervalLastIndex = 0;
+
+ //**************************************************
+ //** Allocate array for storing temp.
+ //** values of the point
+ //**************************************************
+ double[] pointTempValues = new double[outputValuesNumber];
+
+ //**************************************************
+ //** Loop through the series points
+ //**************************************************
+ string currentLabel = null;
+ bool lastPoint = false;
+ int emptyPointsSkipped = 0;
+ for(int pointIndex = 0; pointIndex <= input.Points.Count && !lastPoint; pointIndex++)
+ {
+ bool endOfInterval = false;
+
+ //**************************************************
+ //** Check if it's the last point
+ //**************************************************
+ if(pointIndex == input.Points.Count)
+ {
+ // End of the group interval detected
+ lastPoint = true;
+ intervalLastIndex = pointIndex - 1;
+ pointIndex = intervalLastIndex;
+ endOfInterval = true;
+ }
+
+ // Set current axis label
+ if(!endOfInterval && currentLabel == null)
+ {
+ currentLabel = input.Points[pointIndex].AxisLabel;
+ }
+
+ //**************************************************
+ //** Check if current point X value is inside current group
+ //**************************************************
+ if(!endOfInterval && input.Points[pointIndex].AxisLabel != currentLabel)
+ {
+ // End of the group interval detected
+ intervalLastIndex = pointIndex - 1;
+ endOfInterval = true;
+ }
+
+ //**************************************************
+ //** Process data at end of the interval
+ //**************************************************
+ if(endOfInterval)
+ {
+ // Finalize the calculation
+ ProcessPointValues(
+ functions,
+ pointTempValues,
+ inputSeries[seriesIndex],
+ input.Points[pointIndex],
+ pointIndex,
+ intervalFirstIndex,
+ intervalLastIndex,
+ true,
+ ref emptyPointsSkipped);
+
+ //**************************************************
+ //** Calculate the X values
+ //**************************************************
+ if(functions[0].function == GroupingFunction.Center)
+ {
+ pointTempValues[0] =
+ (inputSeries[seriesIndex].Points[intervalFirstIndex].XValue +
+ inputSeries[seriesIndex].Points[intervalLastIndex].XValue) / 2.0;
+ }
+ else if(functions[0].function == GroupingFunction.First)
+ {
+ pointTempValues[0] =
+ inputSeries[seriesIndex].Points[intervalFirstIndex].XValue;
+ }
+ if(functions[0].function == GroupingFunction.Last)
+ {
+ pointTempValues[0] =
+ inputSeries[seriesIndex].Points[intervalLastIndex].XValue;
+ }
+
+ //**************************************************
+ //** Create new point object
+ //**************************************************
+ DataPoint newPoint = new DataPoint();
+ newPoint.ResizeYValueArray(outputValuesNumber - 1);
+ newPoint.XValue = pointTempValues[0];
+ newPoint.AxisLabel = currentLabel;
+ for(int i = 1; i < pointTempValues.Length; i++)
+ {
+ newPoint.YValues[i - 1] = pointTempValues[i];
+ }
+
+ //**************************************************
+ //** Remove grouped points if output and input
+ //** series are the same
+ //**************************************************
+ int newPointIndex = output.Points.Count;
+ if(output == input)
+ {
+ newPointIndex = intervalFirstIndex;
+ pointIndex = newPointIndex + 1;
+
+ // Remove grouped points
+ for(int removedPoint = intervalFirstIndex; removedPoint <= intervalLastIndex; removedPoint++)
+ {
+ output.Points.RemoveAt(intervalFirstIndex);
+ }
+ }
+
+ //**************************************************
+ //** Add point to the output series
+ //**************************************************
+ output.Points.Insert(newPointIndex, newPoint);
+
+
+ // Set new group interval indexes
+ intervalFirstIndex = pointIndex;
+ intervalLastIndex = pointIndex;
+
+ // Reset number of skipped points
+ emptyPointsSkipped = 0;
+ currentLabel = null;
+
+ // Process point once again
+ --pointIndex;
+
+ continue;
+ }
+
+ //**************************************************
+ //** Use current point values in the formula
+ //**************************************************
+ ProcessPointValues(
+ functions,
+ pointTempValues,
+ inputSeries[seriesIndex],
+ input.Points[pointIndex],
+ pointIndex,
+ intervalFirstIndex,
+ intervalLastIndex,
+ false,
+ ref emptyPointsSkipped);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Groups series points in the interval with offset
+ /// </summary>
+ /// <param name="formula">Grouping formula.</param>
+ /// <param name="interval">Interval size.</param>
+ /// <param name="intervalType">Interval type.</param>
+ /// <param name="intervalOffset">Interval offset size.</param>
+ /// <param name="intervalOffsetType">Interval offset type.</param>
+ /// <param name="inputSeries">Array of input series.</param>
+ /// <param name="outputSeries">Array of output series.</param>
+ private void Group(string formula,
+ double interval,
+ IntervalType intervalType,
+ double intervalOffset,
+ IntervalType intervalOffsetType,
+ Series[] inputSeries,
+ Series[] outputSeries)
+ {
+ // Check arguments
+ if (formula == null)
+ throw new ArgumentNullException("formula");
+
+ //**************************************************
+ //** Check input/output series arrays
+ //**************************************************
+ CheckSeriesArrays(inputSeries, outputSeries);
+
+ //**************************************************
+ //** Check and parse formula
+ //**************************************************
+ int outputValuesNumber = 1;
+ GroupingFunctionInfo[] functions = GetGroupingFunctions(inputSeries, formula, out outputValuesNumber);
+
+ //**************************************************
+ //** Loop through all input series
+ //**************************************************
+ for(int seriesIndex = 0; seriesIndex < inputSeries.Length; seriesIndex++)
+ {
+ // Define an input and output series
+ Series input = inputSeries[seriesIndex];
+ Series output = input;
+ if(outputSeries != null && seriesIndex < outputSeries.Length)
+ {
+ output = outputSeries[seriesIndex];
+
+ // Remove all points from the output series
+ if(output.Name != input.Name)
+ {
+ output.Points.Clear();
+
+ // Copy X values type
+ if(output.XValueType == ChartValueType.Auto || output.autoXValueType)
+ {
+ output.XValueType = input.XValueType;
+ output.autoXValueType = true;
+ }
+ // Copy Y values type
+ if(output.YValueType == ChartValueType.Auto || output.autoYValueType)
+ {
+ output.YValueType = input.YValueType;
+ output.autoYValueType = true;
+ }
+
+ }
+ }
+
+ // No points to group
+ if(input.Points.Count == 0)
+ {
+ continue;
+ }
+
+ // Make sure there is enough Y values per point
+ output.YValuesPerPoint = outputValuesNumber - 1;
+
+ //**************************************************
+ //** Initialize interval & value tracking variables
+ //**************************************************
+ int intervalFirstIndex = 0;
+ int intervalLastIndex = 0;
+ double intervalFrom = 0;
+ double intervalTo = 0;
+
+ // Set interval start point
+ intervalFrom = input.Points[0].XValue;
+
+ // Adjust start point depending on the interval type
+ intervalFrom = ChartHelper.AlignIntervalStart(intervalFrom, interval, ConvertIntervalType(intervalType));
+
+ // Add offset to the start position
+ double offsetFrom = 0;
+ if( intervalOffset != 0 )
+ {
+ offsetFrom = intervalFrom + ChartHelper.GetIntervalSize(intervalFrom,
+ intervalOffset,
+ ConvertIntervalType(intervalOffsetType));
+
+ // Check if there are points left outside first group
+ if(input.Points[0].XValue < offsetFrom)
+ {
+ if(intervalType == IntervalType.Number)
+ {
+ intervalFrom = offsetFrom + ChartHelper.GetIntervalSize(offsetFrom,
+ -interval,
+ ConvertIntervalType(intervalType));
+ }
+ else
+ {
+ intervalFrom = offsetFrom - ChartHelper.GetIntervalSize(offsetFrom,
+ interval,
+ ConvertIntervalType(intervalType));
+ }
+ intervalTo = offsetFrom;
+
+ }
+ else
+ {
+ intervalFrom = offsetFrom;
+ intervalTo = intervalFrom + ChartHelper.GetIntervalSize(intervalFrom, interval, ConvertIntervalType(intervalType));
+ }
+ }
+ else
+ {
+ intervalTo = intervalFrom + ChartHelper.GetIntervalSize(intervalFrom, interval, ConvertIntervalType(intervalType));
+ }
+
+ //**************************************************
+ //** Allocate array for storing temp.
+ //** values of the point
+ //**************************************************
+ double[] pointTempValues = new double[outputValuesNumber];
+
+
+ //**************************************************
+ //** Loop through the series points
+ //**************************************************
+ bool lastPoint = false;
+ int emptyPointsSkipped = 0;
+ int pointsNumberInInterval = 0;
+ for(int pointIndex = 0; pointIndex <= input.Points.Count && !lastPoint; pointIndex++)
+ {
+ bool endOfInterval = false;
+
+ //**************************************************
+ //** Check if series is sorted by X value
+ //**************************************************
+ if(pointIndex > 0 && pointIndex < input.Points.Count)
+ {
+ if(input.Points[pointIndex].XValue < input.Points[pointIndex - 1].XValue)
+ {
+ throw (new InvalidOperationException(SR.ExceptionDataManipulatorGroupedSeriesNotSorted));
+ }
+ }
+
+ //**************************************************
+ //** Check if it's the last point
+ //**************************************************
+ if(pointIndex == input.Points.Count)
+ {
+ // End of the group interval detected
+ lastPoint = true;
+ intervalLastIndex = pointIndex - 1;
+ pointIndex = intervalLastIndex;
+ endOfInterval = true;
+ }
+
+ //**************************************************
+ //** Check if current point X value is inside current group
+ //**************************************************
+ if(!endOfInterval && input.Points[pointIndex].XValue >= intervalTo)
+ {
+ // End of the group interval detected
+ if(pointIndex == 0)
+ {
+ continue;
+ }
+ intervalLastIndex = pointIndex - 1;
+ endOfInterval = true;
+ }
+
+ //**************************************************
+ //** Process data at end of the interval
+ //**************************************************
+ if(endOfInterval)
+ {
+ // Add grouped point only if there are non empty points in the interval
+ if(pointsNumberInInterval > emptyPointsSkipped)
+ {
+ // Finalize the calculation
+ ProcessPointValues(
+ functions,
+ pointTempValues,
+ inputSeries[seriesIndex],
+ input.Points[pointIndex],
+ pointIndex,
+ intervalFirstIndex,
+ intervalLastIndex,
+ true,
+ ref emptyPointsSkipped);
+
+ //**************************************************
+ //** Calculate the X values
+ //**************************************************
+ if(functions[0].function == GroupingFunction.Center)
+ {
+ pointTempValues[0] = (intervalFrom + intervalTo) / 2.0;
+ }
+ else if(functions[0].function == GroupingFunction.First)
+ {
+ pointTempValues[0] = intervalFrom;
+ }
+ if(functions[0].function == GroupingFunction.Last)
+ {
+ pointTempValues[0] = intervalTo;
+ }
+
+ //**************************************************
+ //** Create new point object
+ //**************************************************
+ DataPoint newPoint = new DataPoint();
+ newPoint.ResizeYValueArray(outputValuesNumber - 1);
+ newPoint.XValue = pointTempValues[0];
+ for(int i = 1; i < pointTempValues.Length; i++)
+ {
+ newPoint.YValues[i - 1] = pointTempValues[i];
+ }
+
+ //**************************************************
+ //** Remove grouped points if output and input
+ //** series are the same
+ //**************************************************
+ int newPointIndex = output.Points.Count;
+ if(output == input)
+ {
+ newPointIndex = intervalFirstIndex;
+ pointIndex = newPointIndex + 1;
+
+ // Remove grouped points
+ for(int removedPoint = intervalFirstIndex; removedPoint <= intervalLastIndex; removedPoint++)
+ {
+ output.Points.RemoveAt(intervalFirstIndex);
+ }
+ }
+
+ //**************************************************
+ //** Add point to the output series
+ //**************************************************
+ output.Points.Insert(newPointIndex, newPoint);
+ }
+
+ // Set new From To values of the group interval
+ intervalFrom = intervalTo;
+ intervalTo = intervalFrom + ChartHelper.GetIntervalSize(intervalFrom, interval, ConvertIntervalType(intervalType));
+
+ // Set new group interval indexes
+ intervalFirstIndex = pointIndex;
+ intervalLastIndex = pointIndex;
+
+ // Reset number of points in the interval
+ pointsNumberInInterval = 0;
+
+ // Reset number of skipped points
+ emptyPointsSkipped = 0;
+
+ // Process point once again
+ --pointIndex;
+
+ continue;
+ }
+
+ //**************************************************
+ //** Use current point values in the formula
+ //**************************************************
+ ProcessPointValues(
+ functions,
+ pointTempValues,
+ inputSeries[seriesIndex],
+ input.Points[pointIndex],
+ pointIndex,
+ intervalFirstIndex,
+ intervalLastIndex,
+ false,
+ ref emptyPointsSkipped);
+
+ // Increase number of points in the group
+ ++pointsNumberInInterval;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Adds current point values to the temp. formula results.
+ /// </summary>
+ /// <param name="functions">Array of functions type.</param>
+ /// <param name="pointTempValues">Temp. point values.</param>
+ /// <param name="series">Point series.</param>
+ /// <param name="point">Current point.</param>
+ /// <param name="pointIndex">Current point index.</param>
+ /// <param name="intervalFirstIndex">Index of the first point in the interval.</param>
+ /// <param name="intervalLastIndex">Index of the last point in the interval.</param>
+ /// <param name="finalPass">Indicates that interval processing is finished.</param>
+ /// <param name="numberOfEmptyPoints">Number of skipped points in the interval.</param>
+ private void ProcessPointValues(
+ GroupingFunctionInfo[] functions,
+ double[] pointTempValues,
+ Series series,
+ DataPoint point,
+ int pointIndex,
+ int intervalFirstIndex,
+ int intervalLastIndex,
+ bool finalPass,
+ ref int numberOfEmptyPoints)
+ {
+ //*******************************************************************
+ //** Initialize temp data if it's the first point in the interval
+ //*******************************************************************
+ if(pointIndex == intervalFirstIndex && !finalPass)
+ {
+ // Initialize values depending on the function type
+ int funcIndex = 0;
+ foreach(GroupingFunctionInfo functionInfo in functions)
+ {
+ // Check that we do not exced number of input values
+ if(funcIndex > point.YValues.Length)
+ {
+ break;
+ }
+
+ // Initialize with zero
+ pointTempValues[functionInfo.outputIndex] = 0;
+
+ // Initialize with custom value depending on the formula
+ if(functionInfo.function == GroupingFunction.Min)
+ {
+ pointTempValues[functionInfo.outputIndex] = double.MaxValue;
+ }
+
+ else if(functionInfo.function == GroupingFunction.Max)
+ {
+ pointTempValues[functionInfo.outputIndex] = double.MinValue;
+ }
+
+ else if(functionInfo.function == GroupingFunction.First)
+ {
+ if(funcIndex == 0)
+ {
+ pointTempValues[0] = point.XValue;
+ }
+ else
+ {
+ pointTempValues[functionInfo.outputIndex] = point.YValues[funcIndex-1];
+ }
+ }
+
+ else if(functionInfo.function == GroupingFunction.HiLo ||
+ functionInfo.function == GroupingFunction.HiLoOpCl)
+ {
+ // Hi
+ pointTempValues[functionInfo.outputIndex] = double.MinValue;
+ //Lo
+ pointTempValues[functionInfo.outputIndex + 1] = double.MaxValue;
+ if(functionInfo.function == GroupingFunction.HiLoOpCl)
+ {
+ //Open
+ pointTempValues[functionInfo.outputIndex + 2] = point.YValues[funcIndex-1];
+ //Close
+ pointTempValues[functionInfo.outputIndex + 3] = 0;
+ }
+ }
+
+ // Increase current function index
+ ++funcIndex;
+ }
+ }
+
+ //*******************************************************************
+ //** Add points values using formula
+ //*******************************************************************
+ if(!finalPass)
+ {
+ //*******************************************************************
+ //** Ignore empty points
+ //*******************************************************************
+ if(point.IsEmpty && this.IsEmptyPointIgnored)
+ {
+ ++numberOfEmptyPoints;
+ return;
+ }
+
+ //*******************************************************************
+ //** Loop through each grouping function
+ //*******************************************************************
+ int funcIndex = 0;
+ foreach(GroupingFunctionInfo functionInfo in functions)
+ {
+ // Check that we do not exced number of input values
+ if(funcIndex > point.YValues.Length)
+ {
+ break;
+ }
+
+ // Process point values depending on the formula
+ if(functionInfo.function == GroupingFunction.Min &&
+ (!point.IsEmpty && this.IsEmptyPointIgnored))
+ {
+ pointTempValues[functionInfo.outputIndex] =
+ Math.Min(pointTempValues[functionInfo.outputIndex], point.YValues[funcIndex-1]);
+ }
+
+ else if(functionInfo.function == GroupingFunction.Max)
+ {
+ pointTempValues[functionInfo.outputIndex] =
+ Math.Max(pointTempValues[functionInfo.outputIndex], point.YValues[funcIndex-1]);
+ }
+
+ else if(functionInfo.function == GroupingFunction.Ave ||
+ functionInfo.function == GroupingFunction.Sum)
+ {
+ if(funcIndex == 0)
+ {
+ pointTempValues[0] += point.XValue;
+ }
+ else
+ {
+ pointTempValues[functionInfo.outputIndex] += point.YValues[funcIndex-1];
+ }
+ }
+
+ else if(functionInfo.function == GroupingFunction.Variance ||
+ functionInfo.function == GroupingFunction.Deviation)
+ {
+ pointTempValues[functionInfo.outputIndex] += point.YValues[funcIndex-1];
+ }
+
+ else if(functionInfo.function == GroupingFunction.Last)
+ {
+ if(funcIndex == 0)
+ {
+ pointTempValues[0] = point.XValue;
+ }
+ else
+ {
+ pointTempValues[functionInfo.outputIndex] = point.YValues[funcIndex-1];
+ }
+ }
+
+ else if(functionInfo.function == GroupingFunction.Count)
+ {
+ pointTempValues[functionInfo.outputIndex] += 1;
+ }
+
+ else if(functionInfo.function == GroupingFunction.HiLo ||
+ functionInfo.function == GroupingFunction.HiLoOpCl)
+ {
+ // Hi
+ pointTempValues[functionInfo.outputIndex] =
+ Math.Max(pointTempValues[functionInfo.outputIndex], point.YValues[funcIndex-1]);
+ // Lo
+ pointTempValues[functionInfo.outputIndex + 1] =
+ Math.Min(pointTempValues[functionInfo.outputIndex + 1], point.YValues[funcIndex-1]);
+ if(functionInfo.function == GroupingFunction.HiLoOpCl)
+ {
+ // Close
+ pointTempValues[functionInfo.outputIndex + 3] = point.YValues[funcIndex-1];
+ }
+ }
+
+ // Increase current function index
+ ++funcIndex;
+ }
+ }
+
+
+ //*******************************************************************
+ //** Adjust formula results at final pass
+ //*******************************************************************
+ if(finalPass)
+ {
+ int funcIndex = 0;
+ foreach(GroupingFunctionInfo functionInfo in functions)
+ {
+ // Check that we do not exceed number of input values
+ if(funcIndex > point.YValues.Length)
+ {
+ break;
+ }
+
+ if(functionInfo.function == GroupingFunction.Ave)
+ {
+ pointTempValues[functionInfo.outputIndex] /= intervalLastIndex - intervalFirstIndex - numberOfEmptyPoints + 1;
+ }
+
+ if(functionInfo.function == GroupingFunction.DistinctCount)
+ {
+ // Initialize value with zero
+ pointTempValues[functionInfo.outputIndex] = 0;
+
+ // Create a list of uniques values
+ ArrayList uniqueValues = new ArrayList(intervalLastIndex - intervalFirstIndex + 1);
+
+ // Second pass through inteval points required for calculations
+ for(int secondPassIndex = intervalFirstIndex; secondPassIndex <= intervalLastIndex; secondPassIndex++)
+ {
+ // Ignore empty points
+ if(series.Points[secondPassIndex].IsEmpty && this.IsEmptyPointIgnored)
+ {
+ continue;
+ }
+
+ // Check if current value is in the unique list
+ if(!uniqueValues.Contains(series.Points[secondPassIndex].YValues[funcIndex-1]))
+ {
+ uniqueValues.Add(series.Points[secondPassIndex].YValues[funcIndex-1]);
+ }
+ }
+
+ // Get count of unique values
+ pointTempValues[functionInfo.outputIndex] = uniqueValues.Count;
+ }
+
+ else if(functionInfo.function == GroupingFunction.Variance ||
+ functionInfo.function == GroupingFunction.Deviation)
+ {
+ // Calculate average first
+ double average = pointTempValues[functionInfo.outputIndex] / (intervalLastIndex - intervalFirstIndex - numberOfEmptyPoints + 1);
+
+ // Second pass through inteval points required for calculations
+ pointTempValues[functionInfo.outputIndex] = 0;
+ for(int secondPassIndex = intervalFirstIndex; secondPassIndex <= intervalLastIndex; secondPassIndex++)
+ {
+ // Ignore empty points
+ if(series.Points[secondPassIndex].IsEmpty && this.IsEmptyPointIgnored)
+ {
+ continue;
+ }
+
+ pointTempValues[functionInfo.outputIndex] +=
+ Math.Pow(series.Points[secondPassIndex].YValues[funcIndex-1] - average, 2);
+ }
+
+ // Divide by points number
+ pointTempValues[functionInfo.outputIndex] /=
+ intervalLastIndex - intervalFirstIndex - numberOfEmptyPoints + 1;
+
+ // If calculating the deviation - take a square root of variance
+ if(functionInfo.function == GroupingFunction.Deviation)
+ {
+ pointTempValues[functionInfo.outputIndex] =
+ Math.Sqrt(pointTempValues[functionInfo.outputIndex]);
+ }
+ }
+
+ // Increase current function index
+ ++funcIndex;
+ }
+ }
+
+ }
+
+ /// <summary>
+ /// Checks the formula format and returns an array of formula types
+ /// for each X and each Y value of the input series.
+ /// </summary>
+ /// <param name="inputSeries">Array of input series.</param>
+ /// <param name="formula">Formula string.</param>
+ /// <param name="outputValuesNumber">Number of values in output series.</param>
+ /// <returns>Array of functions for each Y value.</returns>
+ private GroupingFunctionInfo[] GetGroupingFunctions(Series[] inputSeries, string formula, out int outputValuesNumber)
+ {
+ // Get maximum number of Y values in all series
+ int numberOfYValues = 0;
+ foreach(Series series in inputSeries)
+ {
+ numberOfYValues = (int)Math.Max(numberOfYValues, series.YValuesPerPoint);
+ }
+
+ // Allocate memory for the result array for X and each Y values
+ GroupingFunctionInfo[] result = new GroupingFunctionInfo[numberOfYValues + 1];
+ for(int index = 0 ; index < result.Length; index++)
+ {
+ result[index] = new GroupingFunctionInfo();
+ }
+
+ // Split formula by comma
+ string[] valueFormulas = formula.Split(',');
+
+ // At least one formula must be specified
+ if(valueFormulas.Length == 0)
+ {
+ throw (new ArgumentException(SR.ExceptionDataManipulatorGroupingFormulaUndefined));
+ }
+
+ // Check each formula in the array
+ GroupingFunctionInfo defaultFormula = new GroupingFunctionInfo();
+ foreach(string s in valueFormulas)
+ {
+ // Trim white space and make upper case
+ string formulaString = s.Trim();
+ formulaString = formulaString.ToUpper(System.Globalization.CultureInfo.InvariantCulture);
+
+ // Get value index and formula type from the string
+ int valueIndex = 1;
+ GroupingFunction formulaType = ParseFormulaAndValueType(formulaString, out valueIndex);
+
+ // Save the default (first) formula
+ if(defaultFormula.function == GroupingFunction.None)
+ {
+ defaultFormula.function = formulaType;
+ }
+
+ // Check that value index do not exceed the max values number
+ if(valueIndex >= result.Length)
+ {
+ throw(new ArgumentException(SR.ExceptionDataManipulatorYValuesIndexExceeded( formulaString )));
+ }
+
+ // Check if formula for this value type was already set
+ if(result[valueIndex].function != GroupingFunction.None)
+ {
+ throw (new ArgumentException(SR.ExceptionDataManipulatorGroupingFormulaAlreadyDefined(formulaString)));
+ }
+
+ // Set formula type
+ result[valueIndex].function = formulaType;
+ }
+
+ // Apply default formula for non set X value
+ if(result[0].function == GroupingFunction.None)
+ {
+ result[0].function = GroupingFunction.First;
+ }
+
+ // Apply default formula for all non set Y values
+ for(int funcIndex = 1; funcIndex < result.Length; funcIndex++)
+ {
+ if(result[funcIndex].function == GroupingFunction.None)
+ {
+ result[funcIndex].function = defaultFormula.function;
+ }
+ }
+
+ // Specify output value index
+ outputValuesNumber = 0;
+ for(int funcIndex = 0; funcIndex < result.Length; funcIndex++)
+ {
+ result[funcIndex].outputIndex = outputValuesNumber;
+
+ if(result[funcIndex].function == GroupingFunction.HiLoOpCl)
+ {
+ outputValuesNumber += 3;
+ }
+ else if(result[funcIndex].function == GroupingFunction.HiLo)
+ {
+ outputValuesNumber += 1;
+ }
+
+ ++outputValuesNumber;
+ }
+
+ // X value formula can be FIRST, LAST and AVE
+ if(result[0].function != GroupingFunction.First &&
+ result[0].function != GroupingFunction.Last &&
+ result[0].function != GroupingFunction.Center)
+ {
+ throw (new ArgumentException(SR.ExceptionDataManipulatorGroupingFormulaUnsupported));
+ }
+
+ return result;
+ }
+
+ /// <summary>
+ /// Parse one formula with optional value prefix.
+ /// Example: "Y2:MAX"
+ /// </summary>
+ /// <param name="formulaString">One formula name with optional value prefix.</param>
+ /// <param name="valueIndex">Return value index.</param>
+ /// <returns>Formula type.</returns>
+ private GroupingFunction ParseFormulaAndValueType(string formulaString, out int valueIndex)
+ {
+ // Initialize value index as first Y value (default)
+ valueIndex = 1;
+
+ // Split formula by optional ':' character
+ string[] formulaParts = formulaString.Split(':');
+
+ // There must be at least one and no more than two result strings
+ if(formulaParts.Length < 1 && formulaParts.Length > 2)
+ {
+ throw(new ArgumentException(SR.ExceptionDataManipulatorGroupingFormulaFormatInvalid( formulaString )));
+ }
+
+ // Check specified value type
+ if(formulaParts.Length == 2)
+ {
+ if(formulaParts[0] == "X")
+ {
+ valueIndex = 0;
+ }
+ else if(formulaParts[0].StartsWith("Y", StringComparison.Ordinal))
+ {
+ formulaParts[0] = formulaParts[0].TrimStart('Y');
+
+ if(formulaParts[0].Length == 0)
+ {
+ valueIndex = 1;
+ }
+ else
+ {
+ // Try to convert the rest of the string to integer
+ try
+ {
+ valueIndex = Int32.Parse(formulaParts[0], System.Globalization.CultureInfo.InvariantCulture);
+ }
+ catch(System.Exception)
+ {
+ throw (new ArgumentException(SR.ExceptionDataManipulatorGroupingFormulaFormatInvalid( formulaString )));
+ }
+ }
+ }
+ else
+ {
+ throw (new ArgumentException(SR.ExceptionDataManipulatorGroupingFormulaFormatInvalid( formulaString )));
+ }
+ }
+
+ // Check formula name
+ if(formulaParts[formulaParts.Length - 1] == "MIN")
+ return GroupingFunction.Min;
+ else if(formulaParts[formulaParts.Length - 1] == "MAX")
+ return GroupingFunction.Max;
+ else if(formulaParts[formulaParts.Length - 1] == "AVE")
+ return GroupingFunction.Ave;
+ else if(formulaParts[formulaParts.Length - 1] == "SUM")
+ return GroupingFunction.Sum;
+ else if(formulaParts[formulaParts.Length - 1] == "FIRST")
+ return GroupingFunction.First;
+ else if(formulaParts[formulaParts.Length - 1] == "LAST")
+ return GroupingFunction.Last;
+ else if(formulaParts[formulaParts.Length - 1] == "HILOOPCL")
+ return GroupingFunction.HiLoOpCl;
+ else if(formulaParts[formulaParts.Length - 1] == "HILO")
+ return GroupingFunction.HiLo;
+ else if(formulaParts[formulaParts.Length - 1] == "COUNT")
+ return GroupingFunction.Count;
+ else if(formulaParts[formulaParts.Length - 1] == "DISTINCTCOUNT")
+ return GroupingFunction.DistinctCount;
+ else if(formulaParts[formulaParts.Length - 1] == "VARIANCE")
+ return GroupingFunction.Variance;
+ else if(formulaParts[formulaParts.Length - 1] == "DEVIATION")
+ return GroupingFunction.Deviation;
+ else if(formulaParts[formulaParts.Length - 1] == "CENTER")
+ return GroupingFunction.Center;
+
+ // Invalid formula name
+ throw (new ArgumentException(SR.ExceptionDataManipulatorGroupingFormulaNameInvalid(formulaString)));
+ }
+
+ /// <summary>
+ /// Checks if input/output series parameters are correct.
+ /// If not - fires an exception
+ /// </summary>
+ /// <param name="inputSeries">Input series array.</param>
+ /// <param name="outputSeries">Output series array.</param>
+ private void CheckSeriesArrays(Series[] inputSeries, Series[] outputSeries)
+ {
+ // At least one series must be in the input series
+ if(inputSeries == null || inputSeries.Length == 0)
+ {
+ throw (new ArgumentException(SR.ExceptionDataManipulatorGroupingInputSeriesUndefined));
+ }
+
+ // Output series must be empty or have the same number of items
+ if(outputSeries != null && outputSeries.Length != inputSeries.Length)
+ {
+ throw (new ArgumentException(SR.ExceptionDataManipulatorGroupingInputOutputSeriesNumberMismatch));
+ }
+ }
+
+ #endregion
+
+ #region Grouping overloaded methods
+
+ /// <summary>
+ /// Groups data using one or more formulas.
+ /// The series that is grouped is cleared of its original data, and used to store the new data points.
+ /// </summary>
+ /// <param name="formula">Grouping formula.</param>
+ /// <param name="interval">Interval size.</param>
+ /// <param name="intervalType">Interval type.</param>
+ /// <param name="inputSeries">Input series.</param>
+ public void Group(string formula,
+ double interval,
+ IntervalType intervalType,
+ Series inputSeries)
+ {
+ // Check arguments
+ if (inputSeries == null)
+ throw new ArgumentNullException("inputSeries");
+
+ Group(formula, interval, intervalType, inputSeries, null);
+ }
+
+ /// <summary>
+ /// Groups data using one or more formulas.
+ /// Series are cleared of their original data and used to store the new data points.
+ /// </summary>
+ /// <param name="formula">Grouping formula.</param>
+ /// <param name="interval">Interval size.</param>
+ /// <param name="intervalType">Interval type.</param>
+ /// <param name="inputSeriesName">Comma separated list of input series names.</param>
+ public void Group(string formula,
+ double interval,
+ IntervalType intervalType,
+ string inputSeriesName)
+ {
+ // Check arguments
+ if (inputSeriesName == null)
+ throw new ArgumentNullException("inputSeriesName");
+
+ Group(formula, interval, intervalType, inputSeriesName, "");
+ }
+
+ /// <summary>
+ /// Groups data using one or more formulas.
+ /// The series that is grouped is cleared of its original data, and used to store the new data points.
+ /// </summary>
+ /// <param name="formula">Grouping formula.</param>
+ /// <param name="interval">Interval size.</param>
+ /// <param name="intervalType">Interval type.</param>
+ /// <param name="intervalOffset">Interval offset size.</param>
+ /// <param name="intervalOffsetType">Interval offset type.</param>
+ /// <param name="inputSeries">Input series.</param>
+ public void Group(string formula,
+ double interval,
+ IntervalType intervalType,
+ double intervalOffset,
+ IntervalType intervalOffsetType,
+ Series inputSeries)
+ {
+ // Check arguments
+ if (inputSeries == null)
+ throw new ArgumentNullException("inputSeries");
+
+ Group(formula, interval, intervalType, intervalOffset, intervalOffsetType, inputSeries, null);
+ }
+
+ /// <summary>
+ /// Groups data using one or more formulas.
+ /// Series are cleared of their original data and used to store the new data points.
+ /// </summary>
+ /// <param name="formula">Grouping formula.</param>
+ /// <param name="interval">Interval size.</param>
+ /// <param name="intervalType">Interval type.</param>
+ /// <param name="intervalOffset">Interval offset size.</param>
+ /// <param name="intervalOffsetType">Interval offset type.</param>
+ /// <param name="inputSeriesName">Comma separated list of input series names.</param>
+ public void Group(string formula,
+ double interval,
+ IntervalType intervalType,
+ double intervalOffset,
+ IntervalType intervalOffsetType,
+ string inputSeriesName)
+ {
+ // Check arguments
+ if (inputSeriesName == null)
+ throw new ArgumentNullException("inputSeriesName");
+
+ Group(formula, interval, intervalType, intervalOffset, intervalOffsetType, inputSeriesName, "");
+ }
+
+ /// <summary>
+ /// Groups series data by axis labels using one or more formulas.
+ /// Output series are used to store the grouped data points.
+ /// </summary>
+ /// <param name="formula">Grouping formula.</param>
+ /// <param name="inputSeriesName">Comma separated list of input series names.</param>
+ /// <param name="outputSeriesName">Comma separated list of output series names.</param>
+ public void GroupByAxisLabel(string formula, string inputSeriesName, string outputSeriesName)
+ {
+ // Check arguments
+ if (inputSeriesName == null)
+ throw new ArgumentNullException("inputSeriesName");
+
+ GroupByAxisLabel(formula,
+ ConvertToSeriesArray(inputSeriesName, false),
+ ConvertToSeriesArray(outputSeriesName, true));
+ }
+
+ /// <summary>
+ /// Groups a series' data by axis labels using one or more formulas.
+ /// The series is cleared of its original data, and then used to store the new data points.
+ /// </summary>
+ /// <param name="formula">Grouping formula.</param>
+ /// <param name="inputSeries">Input data series.</param>
+ public void GroupByAxisLabel(string formula, Series inputSeries)
+ {
+ // Check arguments
+ if (inputSeries == null)
+ throw new ArgumentNullException("inputSeries");
+
+ GroupByAxisLabel(formula, inputSeries, null);
+ }
+
+ /// <summary>
+ /// Groups series data by axis labels using one or more formulas.
+ /// Each series that is grouped is cleared of its original data, and used to store the new data points.
+ /// </summary>
+ /// <param name="formula">Grouping formula.</param>
+ /// <param name="inputSeriesName">Comma separated list of input series names.</param>
+ public void GroupByAxisLabel(string formula, string inputSeriesName)
+ {
+ // Check arguments
+ if (inputSeriesName == null)
+ throw new ArgumentNullException("inputSeriesName");
+
+ GroupByAxisLabel(formula, inputSeriesName, null);
+ }
+
+
+ /// <summary>
+ /// Groups series using one or more formulas.
+ /// Output series are used to store the grouped data points, and an offset can be used for intervals.
+ /// </summary>
+ /// <param name="formula">Grouping formula.</param>
+ /// <param name="interval">Interval size.</param>
+ /// <param name="intervalType">Interval type.</param>
+ /// <param name="intervalOffset">Interval offset size.</param>
+ /// <param name="intervalOffsetType">Interval offset type.</param>
+ /// <param name="inputSeriesName">Comma separated list of input series names.</param>
+ /// <param name="outputSeriesName">Comma separated list of output series names.</param>
+ public void Group(string formula,
+ double interval,
+ IntervalType intervalType,
+ double intervalOffset,
+ IntervalType intervalOffsetType,
+ string inputSeriesName,
+ string outputSeriesName)
+ {
+ // Check arguments
+ if (inputSeriesName == null)
+ throw new ArgumentNullException("inputSeriesName");
+
+ Group(formula,
+ interval,
+ intervalType,
+ intervalOffset,
+ intervalOffsetType,
+ ConvertToSeriesArray(inputSeriesName, false),
+ ConvertToSeriesArray(outputSeriesName, true));
+ }
+
+ /// <summary>
+ /// Groups a series' data using one or more formulas.
+ /// An output series is used to store the grouped data points.
+ /// </summary>
+ /// <param name="formula">Grouping formula.</param>
+ /// <param name="interval">Interval size.</param>
+ /// <param name="intervalType">Interval type.</param>
+ /// <param name="inputSeries">Input data series.</param>
+ /// <param name="outputSeries">Output data series.</param>
+ public void Group(string formula,
+ double interval,
+ IntervalType intervalType,
+ Series inputSeries,
+ Series outputSeries)
+ {
+ // Check arguments
+ if (inputSeries == null)
+ throw new ArgumentNullException("inputSeries");
+
+ Group(formula, interval, intervalType, 0, IntervalType.Number, inputSeries, outputSeries);
+ }
+
+ /// <summary>
+ /// Groups data for series using one or more formulas.
+ /// Output series are used to store the grouped data points.
+ /// </summary>
+ /// <param name="formula">Grouping formula.</param>
+ /// <param name="interval">Interval size.</param>
+ /// <param name="intervalType">Interval type.</param>
+ /// <param name="inputSeriesName">Comma separated list of input series names.</param>
+ /// <param name="outputSeriesName">Comma separated list of output series names.</param>
+ public void Group(string formula,
+ double interval,
+ IntervalType intervalType,
+ string inputSeriesName,
+ string outputSeriesName)
+ {
+ // Check arguments
+ if (inputSeriesName == null)
+ throw new ArgumentNullException("inputSeriesName");
+
+ Group(formula, interval, intervalType, 0, IntervalType.Number, inputSeriesName, outputSeriesName);
+ }
+
+ /// <summary>
+ /// Groups a series using one or more formulas.
+ /// An output series is used to store the grouped data points, and an offset can be used for intervals.
+ /// </summary>
+ /// <param name="formula">Grouping formula.</param>
+ /// <param name="interval">Interval size.</param>
+ /// <param name="intervalType">Interval type.</param>
+ /// <param name="intervalOffset">Interval offset size.</param>
+ /// <param name="intervalOffsetType">Interval offset type.</param>
+ /// <param name="inputSeries">Input data series.</param>
+ /// <param name="outputSeries">Output data series.</param>
+ public void Group(string formula,
+ double interval,
+ IntervalType intervalType,
+ double intervalOffset,
+ IntervalType intervalOffsetType,
+ Series inputSeries,
+ Series outputSeries)
+ {
+ // Check arguments
+ if (inputSeries == null)
+ throw new ArgumentNullException("inputSeries");
+
+ Group(formula,
+ interval,
+ intervalType,
+ intervalOffset,
+ intervalOffsetType,
+ ConvertToSeriesArray(inputSeries, false),
+ ConvertToSeriesArray(outputSeries, false));
+ }
+
+ /// <summary>
+ /// Groups a series' data by axis labels using one or more formulas.
+ /// An output series is used to store the grouped data points.
+ /// </summary>
+ /// <param name="formula">Grouping formula.</param>
+ /// <param name="inputSeries">Input data series.</param>
+ /// <param name="outputSeries">Output data series.</param>
+ public void GroupByAxisLabel(string formula, Series inputSeries, Series outputSeries)
+ {
+ // Check arguments
+ if (inputSeries == null)
+ throw new ArgumentNullException("inputSeries");
+
+ GroupByAxisLabel(formula,
+ ConvertToSeriesArray(inputSeries, false),
+ ConvertToSeriesArray(outputSeries, false));
+ }
+
+ #endregion
+ }
+}
+
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/FormulaData.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/FormulaData.cs
new file mode 100644
index 00000000000..fbaf12bbcb6
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/FormulaData.cs
@@ -0,0 +1,1312 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: DataFormula.cs
+//
+// Namespace: DataVisualization.Charting
+//
+// Classes: DataFormula
+//
+// Purpose: DataFormula class provides properties and methods,
+// which prepare series data for technical analyses
+// and time series and forecasting formulas and prepare
+// output data to be displayed as a chart.
+//
+// Reviewed: GS - August 6, 2002
+// AG - August 7, 2002
+// AG - Microsoft 15, 2007
+//
+//===================================================================
+
+#region Used Namespace
+using System;
+using System.Drawing;
+using System.ComponentModel;
+using System.Diagnostics.CodeAnalysis;
+using System.Collections.Generic;
+#endregion
+
+#if Microsoft_CONTROL
+using System.Windows.Forms.DataVisualization.Charting.Formulas;
+
+namespace System.Windows.Forms.DataVisualization.Charting
+#else
+using System.Web.UI.DataVisualization.Charting.Formulas;
+
+namespace System.Web.UI.DataVisualization.Charting
+#endif
+{
+ #region Financial Formula Name enumeration
+
+ /// <summary>
+ /// An enumeration of financial formula names.
+ /// </summary>
+ public enum FinancialFormula
+ {
+ /// <summary>
+ /// Accumulation Distribution formula. This indicator uses a relationship
+ /// between volume and prices to estimate the strength of price movements,
+ /// and if volume is increased, there is a high probability that prices will go up.
+ /// </summary>
+ AccumulationDistribution,
+
+ /// <summary>
+ /// Average True Range indicator. It measures commitment and compares
+ /// the range between the High, Low and Close prices.
+ /// </summary>
+ AverageTrueRange,
+
+ /// <summary>
+ /// Bollinger Bands indicators. They are plotted at standard deviation levels
+ /// above and below a simple moving average.
+ /// </summary>
+ BollingerBands,
+
+ /// <summary>
+ /// Chaikin Oscillator indicator. It is the difference between a 3-day
+ /// exponential moving average and a 10-day exponential moving average
+ /// applied to the Accumulation Distribution.
+ /// </summary>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Chaikin")]
+ ChaikinOscillator,
+
+ /// <summary>
+ /// Commodity Channel Index. It compares prices with their moving averages.
+ /// </summary>
+ CommodityChannelIndex,
+
+ /// <summary>
+ /// Detrended Price Oscillator. It attempts to remove trend from prices.
+ /// </summary>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Detrended")]
+ DetrendedPriceOscillator,
+
+ /// <summary>
+ /// Ease of Movement deals with the relationship between volume and price change,
+ /// and uses volume to indicate how strong a trend is for prices.
+ /// </summary>
+ EaseOfMovement,
+
+ /// <summary>
+ /// Envelopes are plotted above and below a moving average using a specified percentage
+ /// as the shift.
+ /// </summary>
+ Envelopes,
+
+ /// <summary>
+ /// An Exponential Moving Average is an average of data calculated over a period of time
+ /// where the most recent days have more weight.
+ /// </summary>
+ ExponentialMovingAverage,
+
+ /// <summary>
+ /// Forecasting. It predicts future values using historical observations.
+ /// </summary>
+ Forecasting,
+
+ /// <summary>
+ /// Moving Average Convergence/Divergence indicator. It compares two
+ /// moving averages of prices and is used with a 9-day Exponential
+ /// Moving average as a signal, which indicates buying and selling moments.
+ /// </summary>
+ MovingAverageConvergenceDivergence,
+
+ /// <summary>
+ /// The Mass Index is used to predict trend reversal by comparing the
+ /// difference and range between High and Low prices.
+ /// </summary>
+ MassIndex,
+
+ /// <summary>
+ /// Median prices are mid-point values of daily prices and can be used
+ /// as a filter for trend indicators.
+ /// </summary>
+ MedianPrice,
+
+ /// <summary>
+ /// The Money Flow indicator compares upward changes and downward changes
+ /// of volume-weighted typical prices.
+ /// </summary>
+ MoneyFlow,
+
+ /// <summary>
+ /// The Negative Volume Index should be used together with the Positive Volume index,
+ /// and the Negative Volume Index only changes if the volume decreases from the previous day.
+ /// </summary>
+ NegativeVolumeIndex,
+
+ /// <summary>
+ /// The On Balance Volume indicator measures positive and negative volume flow.
+ /// </summary>
+ OnBalanceVolume,
+
+ /// <summary>
+ /// The Performance indicator compares a current closing price (or any other price) with
+ /// the first closing value (from the first time period).
+ /// </summary>
+ Performance,
+
+ /// <summary>
+ /// The Positive Volume Index should be used together with the Negative Volume index.
+ /// The Positive volume index only changes if the volume decreases from the previous day.
+ /// </summary>
+ PositiveVolumeIndex,
+
+ /// <summary>
+ /// The Price Volume Trend is a cumulative volume total that is calculated using
+ /// relative changes of the closing price, and should be used with other indicators.
+ /// </summary>
+ PriceVolumeTrend,
+
+ /// <summary>
+ /// The Rate of Change indicator compares a specified closing price with the current price.
+ /// </summary>
+ RateOfChange,
+
+ /// <summary>
+ /// The Relative Strength Index is a momentum oscillator that compares upward movements
+ /// of the closing price with downward movements, and results in values that range from 0 to 100.
+ /// </summary>
+ RelativeStrengthIndex,
+
+ /// <summary>
+ /// A Simple Moving Average is an average of data calculated over a period of time.
+ /// The moving average is the most popular price indicator used in technical analysis,
+ /// and can be used with any price (e.g. Hi, Low, Open and Close)
+ /// or it can be applied to other indicators.
+ /// </summary>
+ MovingAverage,
+
+ /// <summary>
+ /// Standard deviation is used to indicate volatility, and measures
+ /// the difference between values (e.g. closing price) and their moving average.
+ /// </summary>
+ StandardDeviation,
+
+ /// <summary>
+ /// The Stochastic Indicator helps to find trend reversal by searching in a period for
+ /// when the closing prices are close to low prices in an upward trending market
+ /// and for when the closing prices are close to high prices in a downward trending market.
+ /// </summary>
+ StochasticIndicator,
+
+ /// <summary>
+ /// A Triangular Moving Average is an average of data calculated over a period of time
+ /// where the middle portion of data has more weight.
+ /// </summary>
+ TriangularMovingAverage,
+
+ /// <summary>
+ /// The Triple Exponential Moving Average is based on a triple moving average of the closing Price.
+ /// Its purpose is to eliminate short cycles. This indicator keeps the closing price
+ /// in trends that are shorter than the specified period.
+ /// </summary>
+ TripleExponentialMovingAverage,
+
+ /// <summary>
+ /// Typical price is the average value of daily prices, and can be used as a filter for trend indicators.
+ /// </summary>
+ TypicalPrice,
+
+ /// <summary>
+ /// The Volatility Chaikins indicator measures the difference between High and Low prices,
+ /// and is used to indicate tops or bottoms of the market.
+ /// </summary>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Chaikins")]
+ VolatilityChaikins,
+
+ /// <summary>
+ /// The Volume oscillator attempts to identify trends in volume by comparing two moving averages:
+ /// one with a short period and another with a longer period.
+ /// </summary>
+ VolumeOscillator,
+
+ /// <summary>
+ /// The Weighted Close formula calculates the average value of daily prices.
+ /// The only difference between Typical Price and the Weighted Close is that the closing price
+ /// has extra weight, and is considered the most important price.
+ /// </summary>
+ WeightedClose,
+
+ /// <summary>
+ /// A Weighted Moving Average is an average of data calculated over a period of time,
+ /// where greater weight is attached to the most recent data.
+ /// </summary>
+ WeightedMovingAverage,
+
+ /// <summary>
+ /// William's %R is a momentum indicator, and is used to measure overbought and oversold levels.
+ /// </summary>
+ WilliamsR
+ }
+
+ #endregion // Financial Formula Name enumeration
+
+ /// <summary>
+ /// The DataFormula class provides properties and methods, which prepare series
+ /// data for technical analysis, apply formulas on the series data
+ /// and prepare output data to be displayed as a chart.
+ /// </summary>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class DataFormula
+ {
+ #region Data Formulas fields
+
+ internal const string IndexedSeriesLabelsSourceAttr = "__IndexedSeriesLabelsSource__";
+
+ //***********************************************************
+ //** Private data members, which store properties values
+ //***********************************************************
+ private bool _isEmptyPointIgnored = true;
+
+ private string[] _extraParameters;
+
+ /// <summary>
+ /// All X values are zero.
+ /// </summary>
+ private bool _zeroXValues = false;
+
+ /// <summary>
+ /// Utility class for Statistical formulas
+ /// </summary>
+ private StatisticFormula _statistics;
+
+ /// <summary>
+ /// Reference to the Common elements
+ /// </summary>
+ internal CommonElements Common;
+
+
+ #endregion
+
+ #region Data Formulas methods
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public DataFormula()
+ {
+ _statistics = new StatisticFormula(this);
+
+ _extraParameters = new string[1];
+ _extraParameters[0] = false.ToString(System.Globalization.CultureInfo.InvariantCulture);
+ }
+
+ /// <summary>
+ /// This method calls a method from a formula module with
+ /// specified name.
+ /// </summary>
+ /// <param name="formulaName">Formula Name</param>
+ /// <param name="parameters">Formula parameters</param>
+ /// <param name="inputSeries">Comma separated input data series names and optional X and Y values names.</param>
+ /// <param name="outputSeries">Comma separated output data series names and optional X and Y values names.</param>
+ internal void Formula(string formulaName, string parameters, string inputSeries, string outputSeries)
+ {
+ // Array of series
+ Series[] inSeries;
+ Series[] outSeries;
+
+ // Commented out as InsertEmptyDataPoints is currently commented out.
+ // This field is not used anywhere else, but we might need it if we uncomment all ---- code parts in this method. (krisztb 4/29/08)
+ // True if formulas are statistical
+ //bool statisticalFormulas = false;
+
+ // Array of Y value indexes
+ int[] inValueIndexes;
+ int[] outValueIndexes;
+
+ // Matrix with double values ( used in formula modules )
+ double[][] inValues;
+ double[][] inNoEmptyValues;
+ double[][] outValues = null;
+ string[][] outLabels = null;
+
+ // Array with parameters
+ string[] parameterList;
+
+ // Split comma separated parameter list in the array of strings.
+ SplitParameters(parameters, out parameterList);
+
+ // Split comma separated series and Y values list in the array of
+ // Series and indexes to Y values.
+ ConvertToArrays(inputSeries, out inSeries, out inValueIndexes, true);
+ ConvertToArrays(outputSeries, out outSeries, out outValueIndexes, false);
+
+ // Create indexes if all x values are 0
+ //ConvertZeroXToIndex( ref inSeries );
+
+ // Set X value AxisName for output series.
+ foreach (Series outSeriesItem in outSeries)
+ {
+ if (inSeries[0] != null)
+ {
+ outSeriesItem.XValueType = inSeries[0].XValueType;
+ }
+ }
+
+ // This method will convert array of Series and array of Y value
+ // indexes to matrix of double values.
+ GetDoubleArray(inSeries, inValueIndexes, out inValues);
+
+ // Remove columns with empty values from matrix
+ if (!DifferentNumberOfSeries(inValues))
+ {
+ RemoveEmptyValues(inValues, out inNoEmptyValues);
+ }
+ else
+ {
+ inNoEmptyValues = inValues;
+ }
+
+ // Call a formula from formula modules
+ string moduleName = null;
+ for (int module = 0; module < Common.FormulaRegistry.Count; module++)
+ {
+ moduleName = Common.FormulaRegistry.GetModuleName(module);
+ Common.FormulaRegistry.GetFormulaModule(moduleName).Formula(formulaName, inNoEmptyValues, out outValues, parameterList, _extraParameters, out outLabels);
+
+ // Commented out as InsertEmptyDataPoints is currently commented out (see next block).
+ // It set the statisticalFormulas field that was used to test whether to insert empty data points. (krisztb 4/29/08)
+ //if( outValues != null )
+ //{
+ // if (moduleName == SR.FormulaNameStatisticalAnalysis)
+ // {
+ // statisticalFormulas = true;
+ // }
+ // break;
+ //}
+
+ // Check if formula was found by detecting output
+ if (outValues != null)
+ {
+ // Exit the loop
+ break;
+ }
+ }
+
+ if (outValues == null)
+ throw new ArgumentException(SR.ExceptionFormulaNotFound(formulaName));
+
+ // Insert empty data points
+
+ //
+ // This has been commented out as InsertEmptyDataPoints is currently commented out.
+ // In its current implementation it didn't do anything other than assign the second
+ // parameter to the third, so ultimately it was a no op. --Microsoft 4/21/08
+ //
+ //if( !statisticalFormulas )
+ //{
+ // InsertEmptyDataPoints( inValues, outValues, out outValues );
+ //}
+
+ // Fill Series with results from matrix with double values using Y value indexes.
+ SetDoubleArray(outSeries, outValueIndexes, outValues, outLabels);
+
+ if (_zeroXValues)
+ {
+ // we have indexed series : proceed to align output series.
+ foreach (Series series in outSeries)
+ {
+ if (series.Points.Count > 0)
+ {
+ // get the last xValue: the formula processing is
+ double topXValue = series.Points[series.Points.Count - 1].XValue;
+ this.Common.Chart.DataManipulator.InsertEmptyPoints(1, IntervalType.Number, 0, IntervalType.Number, 1, topXValue, series);
+ foreach (DataPoint point in series.Points)
+ {
+ point.XValue = 0;
+ }
+ }
+ }
+ }
+ // Copy axis labels from the original series into the calculated series
+ CopyAxisLabels(inSeries, outSeries);
+ }
+
+ /// <summary>
+ /// Copy axis labels from the original series into the calculated series
+ /// </summary>
+ /// <param name="inSeries">array of input series</param>
+ /// <param name="outSeries">array of output series</param>
+ private void CopyAxisLabels(Series[] inSeries, Series[] outSeries)
+ {
+ //Loop through the pairs of input and output series
+ int seriesIndex = 0;
+ while (seriesIndex < inSeries.Length && seriesIndex < outSeries.Length)
+ {
+ Series inputSeries = inSeries[seriesIndex];
+ Series outputSeries = outSeries[seriesIndex];
+
+ //Depending on whether or not the source series has X Values we need to use two different search algorithms
+ if (_zeroXValues)
+ { //If we have the empty XValues then the source series should have all the AxisLabels
+ // -- set the indexed series labels source
+ outputSeries[DataFormula.IndexedSeriesLabelsSourceAttr] = inputSeries.Name;
+ }
+ else
+ { //If the source series has XValues - loop through the input series points looking for the points with AxisLabels set
+ int outIndex = 0;
+ foreach (DataPoint inputPoint in inputSeries.Points)
+ {
+ if (!String.IsNullOrEmpty(inputPoint.AxisLabel))
+ {
+ //If the Axis label is set we need to find the corresponding point by the X value
+ //Most probably the points are in the same order so lets first try the corresponding point in the output series
+ if (outIndex < outputSeries.Points.Count && inputPoint.XValue == outputSeries.Points[outIndex].XValue)
+ { // Yes, the corresponding point in the outputSeries has the same XValue as inputPoint -> copy axis label
+ outputSeries.Points[outIndex].AxisLabel = inputPoint.AxisLabel;
+ }
+ else
+ {
+ //The correspong point has a different x value -> lets go through output series and find the value with the same X
+ outIndex = 0;
+ foreach (DataPoint outputPoint in outputSeries.Points)
+ {
+ if (inputPoint.XValue == outputPoint.XValue)
+ { //Found the point with the same XValue - copy axis label and break
+ outputPoint.AxisLabel = inputPoint.AxisLabel;
+ break;
+ }
+ outIndex++;
+ }
+ }
+ }
+ outIndex++;
+ }
+ }
+ //Sync next pair of input and output series...
+ seriesIndex++;
+ }
+ }
+
+
+ /// <summary>
+ /// This method will set series X and Y values from matrix of
+ /// double values.
+ /// </summary>
+ /// <param name="outputSeries">Array of output series</param>
+ /// <param name="valueIndex">Array of Y value indexes</param>
+ /// <param name="outputValues">Array of doubles which will be used to fill series</param>
+ /// <param name="outputLabels">Array of labels</param>
+ internal void SetDoubleArray(Series[] outputSeries, int[] valueIndex, double[][] outputValues, string[][] outputLabels)
+ {
+ // Validation
+ if (outputSeries.Length != valueIndex.Length)
+ {
+ throw new ArgumentException(SR.ExceptionFormulaDataItemsNumberMismatch);
+ }
+
+ // Number of output series is not correct
+ if (outputSeries.Length < outputValues.Length - 1)
+ {
+ throw new ArgumentException(SR.ExceptionFormulaDataOutputSeriesNumberYValuesIncorrect);
+ }
+
+ int seriesIndex = 0;
+ foreach (Series series in outputSeries)
+ {
+ if (seriesIndex + 1 > outputValues.Length - 1)
+ {
+ break;
+ }
+
+ // If there is different number of data points.
+ if (series.Points.Count != outputValues[seriesIndex].Length)
+ {
+ // Delete all points
+ series.Points.Clear();
+ }
+
+ // Set the number of y values
+ if (series.YValuesPerPoint < valueIndex[seriesIndex])
+ {
+ series.YValuesPerPoint = valueIndex[seriesIndex];
+ }
+
+ for (int pointIndex = 0; pointIndex < outputValues[0].Length; pointIndex++)
+ {
+ // Create a new series and fill data
+ if (series.Points.Count != outputValues[seriesIndex].Length)
+ {
+ // Add data points to series.
+ series.Points.AddXY(outputValues[0][pointIndex], 0);
+
+ // Set Labels
+ if (outputLabels != null)
+ {
+ series.Points[pointIndex].Label = outputLabels[seriesIndex][pointIndex];
+ }
+
+ // Set empty data points or Y values
+ if (Double.IsNaN(outputValues[seriesIndex + 1][pointIndex]))
+ series.Points[pointIndex].IsEmpty = true;
+ else
+ series.Points[pointIndex].YValues[valueIndex[seriesIndex] - 1] = outputValues[seriesIndex + 1][pointIndex];
+ }
+ // Use existing series and set Y values.
+ else
+ {
+ if (series.Points[pointIndex].XValue != outputValues[0][pointIndex] && !_zeroXValues)
+ {
+ throw new InvalidOperationException(SR.ExceptionFormulaXValuesNotAligned);
+ }
+
+ // Set empty data points or Y values
+ if (Double.IsNaN(outputValues[seriesIndex + 1][pointIndex]))
+ series.Points[pointIndex].IsEmpty = true;
+ else
+ {
+ series.Points[pointIndex].YValues[valueIndex[seriesIndex] - 1] = outputValues[seriesIndex + 1][pointIndex];
+
+ // Set Labels
+ if (outputLabels != null)
+ {
+ series.Points[pointIndex].Label = outputLabels[seriesIndex][pointIndex];
+ }
+ }
+ }
+ }
+ seriesIndex++;
+ }
+ }
+
+ /// <summary>
+ /// This method will convert a string with information about
+ /// series and y values to two arrays. The first array will
+ /// contain series and the second array will contain
+ /// corresponding indexes to y values for every series.
+ /// The arrays have to have the same number of items.
+ /// </summary>
+ /// <param name="inputString">A string with information about series and Y values</param>
+ /// <param name="seiesArray">Array of Data Series</param>
+ /// <param name="valueArray">Array of Y value indexes</param>
+ /// <param name="inputSeries">Do not create new series if input series are used</param>
+ private void ConvertToArrays(string inputString, out Series[] seiesArray, out int[] valueArray, bool inputSeries)
+ {
+ // Split string by comma
+ string[] subStrings = inputString.Split(',');
+
+ // Create array of series
+ seiesArray = new Series[subStrings.Length];
+
+ // Create array of integers - values
+ valueArray = new int[subStrings.Length];
+
+ int index = 0;
+
+ foreach (string str in subStrings)
+ {
+ string[] parts = str.Split(':');
+
+
+ // There must be at least one and no more than two result strings
+ if (parts.Length < 1 && parts.Length > 2)
+ {
+ throw (new ArgumentException(SR.ExceptionFormulaDataFormatInvalid(str)));
+ }
+
+ // Initialize value index as first Y value (default)
+ int valueIndex = 1;
+
+ // Check specified value type
+ if (parts.Length == 2)
+ {
+ if (parts[1].StartsWith("Y", StringComparison.Ordinal))
+ {
+ parts[1] = parts[1].TrimStart('Y');
+
+ if (parts[1].Length == 0)
+ {
+ valueIndex = 1;
+ }
+ else
+ {
+ // Try to convert the rest of the string to integer
+ try
+ {
+ valueIndex = Int32.Parse(parts[1], System.Globalization.CultureInfo.InvariantCulture);
+ }
+ catch (System.Exception)
+ {
+ throw (new ArgumentException(SR.ExceptionFormulaDataFormatInvalid(str)));
+ }
+ }
+ }
+ else
+ {
+ throw (new ArgumentException(SR.ExceptionFormulaDataSeriesNameNotFound(str)));
+ }
+ }
+
+ // Set Y value indexes
+ valueArray[index] = valueIndex;
+
+ // Set series
+ try
+ {
+ seiesArray[index] = Common.DataManager.Series[parts[0].Trim()];
+ }
+ catch (System.Exception)
+ {
+ // Series doesn't exist.
+ if (!inputSeries)
+ {
+ // Create a new series if output series
+ Common.DataManager.Series.Add(new Series(parts[0]));
+ seiesArray[index] = Common.DataManager.Series[parts[0]];
+ }
+ else
+ throw (new ArgumentException(SR.ExceptionFormulaDataSeriesNameNotFoundInCollection(str)));
+ }
+ index++;
+ }
+ }
+
+
+ /// <summary>
+ /// Returns Jagged Arrays of doubles from array of series.
+ /// A jagged array is merely an array of arrays and
+ /// it doesn't have to be square. The first item is array of
+ /// X values from the first series
+ /// </summary>
+ /// <param name="inputSeries">Array of Data Series</param>
+ /// <param name="valueIndex">Array with indexes which represent value from data point: 0 = X, 1 = Y, 2 = Y2, 3 = Y3</param>
+ /// <param name="output">Jagged Arrays of doubles</param>
+ private void GetDoubleArray(Series[] inputSeries, int[] valueIndex, out double[][] output)
+ {
+ GetDoubleArray(inputSeries, valueIndex, out output, false);
+ }
+
+ /// <summary>
+ /// Returns Jagged Arrays of doubles from array of series.
+ /// A jagged array is merely an array of arrays and
+ /// it doesn't have to be square. The first item is array of
+ /// X values from the first series
+ /// </summary>
+ /// <param name="inputSeries">Array of Data Series</param>
+ /// <param name="valueIndex">Array with indexes which represent value from data point: 0 = X, 1 = Y, 2 = Y2, 3 = Y3</param>
+ /// <param name="output">Jagged Arrays of doubles</param>
+ /// <param name="ignoreZeroX">Ignore Zero X values</param>
+ private void GetDoubleArray(Series[] inputSeries, int[] valueIndex, out double[][] output, bool ignoreZeroX)
+ {
+ // Allocate a memory.
+ output = new double[inputSeries.Length + 1][];
+
+ // Check the length of the array of series and array of value indexes.
+ if (inputSeries.Length != valueIndex.Length)
+ {
+ throw new ArgumentException(SR.ExceptionFormulaDataItemsNumberMismatch2);
+ }
+
+ // Find Maximum number of data points
+ int maxNumOfPoints = int.MinValue;
+ Series seriesWidthMaxPoints = null;
+ foreach (Series series in inputSeries)
+ {
+ if (maxNumOfPoints < series.Points.Count)
+ {
+ maxNumOfPoints = series.Points.Count;
+ seriesWidthMaxPoints = series;
+ }
+ }
+
+ // *********************************************************
+ // Set X values
+ // *********************************************************
+
+ // Check if all X values are zero
+ foreach (DataPoint point in inputSeries[0].Points)
+ {
+ _zeroXValues = true;
+
+ if (point.XValue != 0.0)
+ {
+ _zeroXValues = false;
+ break;
+ }
+ }
+
+ if (_zeroXValues && !ignoreZeroX)
+ {
+ // Check X values input alignment
+ CheckXValuesAlignment(inputSeries);
+ }
+
+
+ // Data point index
+ int indexPoint = 0;
+
+ // Allocate memory for X values.
+ output[0] = new double[maxNumOfPoints];
+
+ // Data Points loop
+ foreach (DataPoint point in seriesWidthMaxPoints.Points)
+ {
+ // Set X value
+ if (_zeroXValues)
+ output[0][indexPoint] = (double)indexPoint + 1.0;
+ else
+ output[0][indexPoint] = point.XValue;
+
+ // Increase data point index.
+ indexPoint++;
+ }
+
+ // *********************************************************
+ // Set Y values
+ // *********************************************************
+ // Data Series Loop
+ int indexSeries = 1;
+ foreach (Series series in inputSeries)
+ {
+ output[indexSeries] = new double[series.Points.Count];
+ indexPoint = 0;
+
+ // Data Points loop
+ foreach (DataPoint point in series.Points)
+ {
+ // Set Y values
+ if (point.IsEmpty)
+ // IsEmpty data point
+ output[indexSeries][indexPoint] = double.NaN;
+ else
+ {
+ try
+ {
+ output[indexSeries][indexPoint] = point.YValues[valueIndex[indexSeries - 1] - 1];
+ }
+ catch (System.Exception)
+ {
+ throw new ArgumentException(SR.ExceptionFormulaYIndexInvalid);
+ }
+ }
+
+ // Increase data point index.
+ indexPoint++;
+ }
+ // Increase data series index.
+ indexSeries++;
+ }
+ }
+
+ /// <summary>
+ /// Merge, split or move Y values of the series.
+ /// </summary>
+ /// <param name="inputSeries">Comma separated list of input data series names and optional X and Y values names.</param>
+ /// <param name="outputSeries">Comma separated list of output data series names and optional X and Y values names.</param>
+ public void CopySeriesValues(string inputSeries, string outputSeries)
+ {
+ if (inputSeries == null)
+ throw new ArgumentNullException("inputSeries");
+ if (outputSeries == null)
+ throw new ArgumentNullException("outputSeries");
+
+ Series[] inSeries;
+ Series[] outSeries;
+ int[] inValueIndexes;
+ int[] outValueIndexes;
+ double[][] inValues;
+ double[][] outValues;
+
+ // Convert string with information about series and Y values
+ // to array of series and indexes to Y values.
+ ConvertToArrays(inputSeries, out inSeries, out inValueIndexes, true);
+ ConvertToArrays(outputSeries, out outSeries, out outValueIndexes, false);
+
+ // The number of input and output series are different.
+ if (inSeries.Length != outSeries.Length)
+ {
+ throw new ArgumentException(SR.ExceptionFormulaInputOutputSeriesMismatch);
+ }
+
+ // Check if output series points exist. If they do not exist
+ // create data points which are copy of Input series data points
+ for (int indexSeries = 0; indexSeries < inSeries.Length; indexSeries++)
+ {
+ Series[] series = new Series[2];
+ series[0] = inSeries[indexSeries];
+ series[1] = outSeries[indexSeries];
+ if (series[1].Points.Count == 0)
+ {
+ foreach (DataPoint point in series[0].Points)
+ {
+ DataPoint clonePoint = point.Clone();
+ clonePoint.series = series[1];
+ series[1].Points.Add(clonePoint);
+ }
+ }
+ }
+
+ // Check alignment of X values.
+ for (int indexSeries = 0; indexSeries < inSeries.Length; indexSeries++)
+ {
+ Series[] series = new Series[2];
+ series[0] = inSeries[indexSeries];
+ series[1] = outSeries[indexSeries];
+ CheckXValuesAlignment(series);
+ }
+
+ // Covert Series X and Y values to arrays of doubles
+ GetDoubleArray(inSeries, inValueIndexes, out inValues, true);
+
+ outValues = new double[inValues.Length][];
+
+ // Copy Series X and Y values.
+ for (int seriesIndex = 0; seriesIndex < inValues.Length; seriesIndex++)
+ {
+ outValues[seriesIndex] = new double[inValues[seriesIndex].Length];
+ for (int pointIndex = 0; pointIndex < inValues[seriesIndex].Length; pointIndex++)
+ {
+ outValues[seriesIndex][pointIndex] = inValues[seriesIndex][pointIndex];
+ }
+ }
+
+ // Copy Series X and Y value Types.
+ for (int seriesIndx = 0; seriesIndx < inSeries.Length; seriesIndx++)
+ {
+ // X value type
+ if (outSeries[seriesIndx].XValueType == ChartValueType.Auto)
+ {
+ outSeries[seriesIndx].XValueType = inSeries[seriesIndx].XValueType;
+ outSeries[seriesIndx].autoXValueType = inSeries[seriesIndx].autoXValueType;
+ }
+
+ // Y value type.
+ if (outSeries[seriesIndx].YValueType == ChartValueType.Auto)
+ {
+ outSeries[seriesIndx].YValueType = inSeries[seriesIndx].YValueType;
+ outSeries[seriesIndx].autoYValueType = inSeries[seriesIndx].autoYValueType;
+ }
+
+ seriesIndx++;
+ }
+
+ SetDoubleArray(outSeries, outValueIndexes, outValues, null);
+ }
+
+
+ /// <summary>
+ /// This method will first copy input matrix to output matrix
+ /// then will remove columns, which have
+ /// one or more empty values (NaN) from the output matrix. This
+ /// method will set all values from column of input matrix
+ /// to be empty (NaN) if one or more values of that column
+ /// are empty.
+ /// </summary>
+ /// <param name="input">Input matrix with empty values</param>
+ /// <param name="output">Output matrix without empty values</param>
+ private void RemoveEmptyValues(double[][] input, out double[][] output)
+ {
+ // Allocate memory
+ output = new double[input.Length][];
+ int seriesIndex = 0;
+
+ int numberOfRows = 0;
+
+ // Set Nan for all data points with same index in input array
+ // Data point loop
+ for (int pointIndex = 0; pointIndex < input[0].Length; pointIndex++)
+ {
+ bool isEmpty = false;
+ // Series loop
+ // Find empty data point with same point index
+ for (seriesIndex = 0; seriesIndex < input.Length; seriesIndex++)
+ {
+ if (seriesIndex >= input[seriesIndex].Length)
+ continue;
+ if (Double.IsNaN(input[seriesIndex][pointIndex]))
+ isEmpty = true;
+ }
+
+ if (!isEmpty)
+ {
+ numberOfRows++;
+ }
+
+ // There is empty data point
+ if (isEmpty)
+ {
+ // Set all points with same index to be empty
+ for (seriesIndex = 1; seriesIndex < input.Length; seriesIndex++)
+ {
+ input[seriesIndex][pointIndex] = Double.NaN;
+ }
+ }
+ }
+
+ // Copy input matrix to output matrix without empty columns.
+ for (seriesIndex = 0; seriesIndex < input.Length; seriesIndex++)
+ {
+ output[seriesIndex] = new double[numberOfRows];
+ int outPointIndex = 0;
+ for (int pointIndex = 0; pointIndex < input[0].Length; pointIndex++)
+ {
+ if (pointIndex >= input[seriesIndex].Length)
+ continue;
+ if (!double.IsNaN(input[1][pointIndex]))
+ {
+ output[seriesIndex][outPointIndex] = input[seriesIndex][pointIndex];
+ outPointIndex++;
+ }
+ }
+ }
+ }
+
+
+ /*
+ /// <summary>
+ /// This method will compare a input matrix with empty data
+ /// points and output matrix without empty data points and
+ /// add empty data points to output matrix according to
+ /// input matrix empty data point positions.
+ /// </summary>
+ /// <param name="input">Matrix With input data</param>
+ /// <param name="inputWithoutEmpty">Matrix without empty data points</param>
+ /// <param name="output">New Matrix with inserted data points</param>
+ */
+ //private void InsertEmptyDataPoints( double [][] input, double [][] inputWithoutEmpty, out double [][] output )
+ //{
+
+
+ // *** NOTE ***
+ //
+ //
+ // This method is only called in one location as of this writing.
+ // Therefore the entire method is being commented out for now. We wish
+ // to preserve the code itself as it may be re-implemented in the future.
+ // --Microsoft 4/21/08
+ //
+ // ************
+
+
+
+ //output = inputWithoutEmpty;
+ //return;
+
+ //
+ // NOTE: Inserting empty points in the result data after applying the formula
+ // causes issues. The algorithm below do not cover most of the common spzces
+ // and as a result the formula data is completly destroyed.
+ //
+ // By removing this code the result data set will have "missing" points instaed
+ // of empty.
+ // - AG
+ //
+
+ /*
+
+ // Input matrix can have only empty rows. If one value
+ // is empty all values from a row have to be empty.
+
+ // Find the number of empty rows
+ int NumberOfEmptyRows = 0;
+ foreach( double val in input[1] )
+ {
+ if( Double.IsNaN( val ) )
+ {
+ NumberOfEmptyRows++;
+ }
+ }
+
+ if( NumberOfEmptyRows == 0 ||
+ inputWithoutEmpty[0].Length > input[0].Length)
+ {
+ output = inputWithoutEmpty;
+ return;
+ }
+
+ output = new double[input.Length][];
+ // Series loop
+ for( int seriesIndex = 0; seriesIndex < input.Length; seriesIndex++ )
+ {
+ int inputPointIndex = 0;
+ int emptyPointIndex = 0;
+
+ // Skip input index if points are not aligned .
+ while( input[0][inputPointIndex] != inputWithoutEmpty[0][0] && inputPointIndex < input[0].Length )
+ {
+ inputPointIndex++;
+ }
+
+ output[seriesIndex] = new double[inputWithoutEmpty[0].Length + NumberOfEmptyRows - inputPointIndex];
+
+ // Data Point loop
+ for( int pointIndex = 0; pointIndex < output[seriesIndex].Length; pointIndex++ )
+ {
+ if( inputPointIndex < input[0].Length &&
+ inputPointIndex < input[1].Length )
+ {
+ // If the point Y value is empty (NaN) insert empty (NaN) for all values.
+ if( double.IsNaN( input[1][inputPointIndex] ) )
+ {
+ output[seriesIndex][pointIndex] = input[seriesIndex][inputPointIndex];
+ emptyPointIndex--;
+ }
+ else if( input[0][inputPointIndex] == inputWithoutEmpty[0][emptyPointIndex] )
+ {
+ output[seriesIndex][pointIndex] = inputWithoutEmpty[seriesIndex][emptyPointIndex];
+ }
+ else
+ {
+ output[0][pointIndex] = inputWithoutEmpty[0][emptyPointIndex];
+ output[seriesIndex][pointIndex] = inputWithoutEmpty[seriesIndex][emptyPointIndex];
+ }
+ }
+ else
+ {
+ output[seriesIndex][pointIndex] = inputWithoutEmpty[seriesIndex][emptyPointIndex];
+ }
+
+ inputPointIndex++;
+ emptyPointIndex++;
+ }
+ }
+ */
+ //}
+
+
+ /// <summary>
+ /// This method splits a string with comma separated
+ /// parameters to the array of strings with parameters.
+ /// </summary>
+ /// <param name="parameters">a string with comma separated parameters</param>
+ /// <param name="parameterList">the array of strings with parameters</param>
+ private void SplitParameters(string parameters, out string[] parameterList)
+ {
+ // Split string by comma
+ parameterList = parameters.Split(',');
+
+ for (Int32 i = 0; i < parameterList.Length; i++)
+ {
+ parameterList[i] = parameterList[i].Trim();
+ }
+
+ }
+
+ /// <summary>
+ /// Check if series have different number of series.
+ /// </summary>
+ /// <param name="input">Input series.</param>
+ /// <returns>true if there is different number of series.</returns>
+ private static bool DifferentNumberOfSeries(double[][] input)
+ {
+ for (int index = 0; index < input.Length - 1; index++)
+ {
+ if (input[index].Length != input[index + 1].Length)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// This method will check if X values from different series
+ /// are aligned.
+ /// </summary>
+ /// <param name="series">Array of series</param>
+ internal void CheckXValuesAlignment(Series[] series)
+ {
+ // Check aligment only if more than 1 series provided
+ if (series.Length > 1)
+ {
+ // Series loop
+ for (int seriesIndex = 0; seriesIndex < series.Length - 1; seriesIndex++)
+ {
+ // Check the number of data points
+ if (series[seriesIndex].Points.Count != series[seriesIndex + 1].Points.Count)
+ {
+ throw new ArgumentException(SR.ExceptionFormulaDataSeriesAreNotAlignedDifferentDataPoints(series[seriesIndex].Name, series[seriesIndex + 1].Name));
+ }
+
+ // Data points loop
+ for (int pointIndex = 0; pointIndex < series[seriesIndex].Points.Count; pointIndex++)
+ {
+ // Check X values.
+ if (series[seriesIndex].Points[pointIndex].XValue != series[seriesIndex + 1].Points[pointIndex].XValue)
+ throw new ArgumentException(SR.ExceptionFormulaDataSeriesAreNotAlignedDifferentXValues(series[seriesIndex].Name, series[seriesIndex + 1].Name));
+
+ }
+ }
+ }
+ }
+
+
+ #endregion
+
+ #region Data Formulas Financial methods
+ /// <summary>
+ /// This method calls a method from a formula module with
+ /// specified name.
+ /// </summary>
+ /// <param name="formulaName">Formula Name</param>
+ /// <param name="inputSeries">Input series</param>
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ public void FinancialFormula(FinancialFormula formulaName, Series inputSeries)
+ {
+ FinancialFormula(formulaName, inputSeries, inputSeries);
+ }
+
+ /// <summary>
+ /// This method calls a method from a formula module with
+ /// specified name.
+ /// </summary>
+ /// <param name="formulaName">Formula Name</param>
+ /// <param name="inputSeries">Input series</param>
+ /// <param name="outputSeries">Output series</param>
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ public void FinancialFormula(FinancialFormula formulaName, Series inputSeries, Series outputSeries)
+ {
+ FinancialFormula(formulaName, "", inputSeries, outputSeries);
+ }
+
+
+ /// <summary>
+ /// This method calls a method from a formula module with
+ /// specified name.
+ /// </summary>
+ /// <param name="formulaName">Formula Name</param>
+ /// <param name="parameters">Formula parameters</param>
+ /// <param name="inputSeries">Input series</param>
+ /// <param name="outputSeries">Output series</param>
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ public void FinancialFormula(FinancialFormula formulaName, string parameters, Series inputSeries, Series outputSeries)
+ {
+ if (inputSeries == null)
+ throw new ArgumentNullException("inputSeries");
+ if (outputSeries == null)
+ throw new ArgumentNullException("outputSeries");
+ FinancialFormula(formulaName, parameters, inputSeries.Name, outputSeries.Name);
+ }
+
+
+ /// <summary>
+ /// This method calls a method from a formula module with
+ /// specified name.
+ /// </summary>
+ /// <param name="formulaName">Formula Name</param>
+ /// <param name="inputSeries">Comma separated list of input series names and optional X and Y values names.</param>
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ public void FinancialFormula(FinancialFormula formulaName, string inputSeries)
+ {
+ FinancialFormula(formulaName, inputSeries, inputSeries);
+ }
+
+
+ /// <summary>
+ /// This method calls a method from a formula module with
+ /// specified name.
+ /// </summary>
+ /// <param name="formulaName">Formula Name</param>
+ /// <param name="inputSeries">Comma separated list of input series names and optional X and Y values names.</param>
+ /// <param name="outputSeries">Comma separated list of output series names and optional X and Y values names.</param>
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ public void FinancialFormula(FinancialFormula formulaName, string inputSeries, string outputSeries)
+ {
+ FinancialFormula(formulaName, "", inputSeries, outputSeries);
+ }
+
+ /// <summary>
+ /// This method calls a method from a formula module with
+ /// specified name.
+ /// </summary>
+ /// <param name="formulaName">Formula Name</param>
+ /// <param name="parameters">Formula parameters</param>
+ /// <param name="inputSeries">Comma separated list of input series names and optional X and Y values names.</param>
+ /// <param name="outputSeries">Comma separated list of output series names and optional X and Y values names.</param>
+ public void FinancialFormula(FinancialFormula formulaName, string parameters, string inputSeries, string outputSeries)
+ {
+ if (inputSeries == null)
+ throw new ArgumentNullException("inputSeries");
+ if (outputSeries == null)
+ throw new ArgumentNullException("outputSeries");
+
+ // Get formula info
+ FormulaInfo formulaInfo = FormulaHelper.GetFormulaInfo(formulaName);
+
+ // Provide default parameters if necessary
+ if (string.IsNullOrEmpty(parameters))
+ {
+ parameters = formulaInfo.SaveParametersToString();
+ }
+ else
+ {
+ formulaInfo.CheckParameterString(parameters);
+ }
+
+ // Fix the InputSeries and Outputseries for cases when the series field names are not provided
+ SeriesFieldList inputFields = SeriesFieldList.FromString(this.Common.Chart, inputSeries, formulaInfo.InputFields);
+ SeriesFieldList outputFields = SeriesFieldList.FromString(this.Common.Chart, outputSeries, formulaInfo.OutputFields);
+
+ if (inputFields != null) inputSeries = inputFields.ToString();
+ if (outputFields != null) outputSeries = outputFields.ToString();
+
+ Formula(formulaName.ToString(), parameters, inputSeries, outputSeries);
+ }
+ #endregion
+
+ #region Data Formulas properties
+
+ /// <summary>
+ /// Gets or sets a flag which indicates whether
+ /// empty points are ignored while performing calculations;
+ /// otherwise, empty points are treated as zeros.
+ /// </summary>
+ public bool IsEmptyPointIgnored
+ {
+ get
+ {
+ return _isEmptyPointIgnored;
+ }
+ set
+ {
+ _isEmptyPointIgnored = value;
+ }
+ }
+
+
+
+ /// <summary>
+ /// Gets or sets a flag which indicates whether
+ /// to start formulas like rolling average from zero.
+ /// </summary>
+ public bool IsStartFromFirst
+ {
+ get
+ {
+ return bool.Parse(_extraParameters[0]);
+ }
+ set
+ {
+ if (value)
+ _extraParameters[0] = true.ToString(System.Globalization.CultureInfo.InvariantCulture);
+ else
+ _extraParameters[0] = false.ToString(System.Globalization.CultureInfo.InvariantCulture);
+ }
+ }
+
+ /// <summary>
+ /// Returns a reference to the statistical utility class.
+ /// </summary>
+ public StatisticFormula Statistics
+ {
+ get
+ {
+ return _statistics;
+ }
+ }
+
+
+ #endregion
+ }
+
+
+
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/GdiGraphics.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/GdiGraphics.cs
new file mode 100644
index 00000000000..361b55cd30e
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/GdiGraphics.cs
@@ -0,0 +1,732 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: GdiGraphics.cs
+//
+// Namespace: DataVisualization.Charting
+//
+// Classes: GdiGraphics
+//
+// Purpose: GdiGraphics class is chart GDI+ rendering engine. It
+// implements IChartRenderingEngine interface by mapping
+// its methods to the drawing methods of GDI+. This
+// rendering engine do not support animation.
+//
+// Reviwed: AG - Jul 15, 2003
+// AG - Microsoft 14, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Drawing.Text;
+using System.Drawing.Imaging;
+using System.ComponentModel;
+using System.Collections;
+using System.Diagnostics.CodeAnalysis;
+
+#if Microsoft_CONTROL
+
+using System.Windows.Forms.DataVisualization.Charting.Utilities;
+using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+#else
+ //using System.Web.UI.DataVisualization.Charting.Utilities;
+ //using System.Web.UI.DataVisualization.Charting.Borders3D;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ /// <summary>
+ /// GdiGraphics class is chart GDI+ rendering engine.
+ /// </summary>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gdi")]
+ internal class GdiGraphics : IChartRenderingEngine
+ {
+ #region Constructors
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public GdiGraphics()
+ {
+ }
+
+ #endregion // Constructor
+
+ #region Drawing Methods
+
+ /// <summary>
+ /// Draws a line connecting two PointF structures.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the line.</param>
+ /// <param name="pt1">PointF structure that represents the first point to connect.</param>
+ /// <param name="pt2">PointF structure that represents the second point to connect.</param>
+ public void DrawLine(
+ Pen pen,
+ PointF pt1,
+ PointF pt2
+ )
+ {
+ _graphics.DrawLine( pen, pt1, pt2 );
+ }
+
+ /// <summary>
+ /// Draws a line connecting the two points specified by coordinate pairs.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the line.</param>
+ /// <param name="x1">x-coordinate of the first point.</param>
+ /// <param name="y1">y-coordinate of the first point.</param>
+ /// <param name="x2">x-coordinate of the second point.</param>
+ /// <param name="y2">y-coordinate of the second point.</param>
+ public void DrawLine(
+ Pen pen,
+ float x1,
+ float y1,
+ float x2,
+ float y2
+ )
+ {
+ _graphics.DrawLine( pen, x1, y1, x2, y2 );
+ }
+
+ /// <summary>
+ /// Draws the specified portion of the specified Image object at the specified location and with the specified size.
+ /// </summary>
+ /// <param name="image">Image object to draw.</param>
+ /// <param name="destRect">Rectangle structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle.</param>
+ /// <param name="srcX">x-coordinate of the upper-left corner of the portion of the source image to draw.</param>
+ /// <param name="srcY">y-coordinate of the upper-left corner of the portion of the source image to draw.</param>
+ /// <param name="srcWidth">Width of the portion of the source image to draw.</param>
+ /// <param name="srcHeight">Height of the portion of the source image to draw.</param>
+ /// <param name="srcUnit">Member of the GraphicsUnit enumeration that specifies the units of measure used to determine the source rectangle.</param>
+ /// <param name="imageAttr">ImageAttributes object that specifies recoloring and gamma information for the image object.</param>
+ public void DrawImage(
+ System.Drawing.Image image,
+ Rectangle destRect,
+ int srcX,
+ int srcY,
+ int srcWidth,
+ int srcHeight,
+ GraphicsUnit srcUnit,
+ ImageAttributes imageAttr
+ )
+ {
+ _graphics.DrawImage(
+ image,
+ destRect,
+ srcX,
+ srcY,
+ srcWidth,
+ srcHeight,
+ srcUnit,
+ imageAttr
+ );
+ }
+
+ /// <summary>
+ /// Draws an ellipse defined by a bounding rectangle specified by
+ /// a pair of coordinates: a height, and a width.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the ellipse.</param>
+ /// <param name="x">x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.</param>
+ /// <param name="y">y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.</param>
+ /// <param name="width">Width of the bounding rectangle that defines the ellipse.</param>
+ /// <param name="height">Height of the bounding rectangle that defines the ellipse.</param>
+ public void DrawEllipse(
+ Pen pen,
+ float x,
+ float y,
+ float width,
+ float height
+ )
+ {
+ _graphics.DrawEllipse( pen, x, y, width, height );
+ }
+
+ /// <summary>
+ /// Draws a cardinal spline through a specified array of PointF structures
+ /// using a specified tension. The drawing begins offset from
+ /// the beginning of the array.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and height of the curve.</param>
+ /// <param name="points">Array of PointF structures that define the spline.</param>
+ /// <param name="offset">Offset from the first element in the array of the points parameter to the starting point in the curve.</param>
+ /// <param name="numberOfSegments">Number of segments after the starting point to include in the curve.</param>
+ /// <param name="tension">Value greater than or equal to 0.0F that specifies the tension of the curve.</param>
+ public void DrawCurve(
+ Pen pen,
+ PointF[] points,
+ int offset,
+ int numberOfSegments,
+ float tension
+ )
+ {
+ _graphics.DrawCurve( pen, points, offset, numberOfSegments, tension );
+ }
+
+ /// <summary>
+ /// Draws a rectangle specified by a coordinate pair: a width, and a height.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the rectangle.</param>
+ /// <param name="x">x-coordinate of the upper-left corner of the rectangle to draw.</param>
+ /// <param name="y">y-coordinate of the upper-left corner of the rectangle to draw.</param>
+ /// <param name="width">Width of the rectangle to draw.</param>
+ /// <param name="height">Height of the rectangle to draw.</param>
+ public void DrawRectangle(
+ Pen pen,
+ int x,
+ int y,
+ int width,
+ int height
+ )
+ {
+ _graphics.DrawRectangle( pen, x, y, width, height );
+ }
+
+ /// <summary>
+ /// Draws a polygon defined by an array of PointF structures.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the polygon.</param>
+ /// <param name="points">Array of PointF structures that represent the vertices of the polygon.</param>
+ public void DrawPolygon(
+ Pen pen,
+ PointF[] points
+ )
+ {
+ _graphics.DrawPolygon( pen, points );
+ }
+
+ /// <summary>
+ /// Draws the specified text string in the specified rectangle with the specified Brush and Font objects using the formatting properties of the specified StringFormat object.
+ /// </summary>
+ /// <param name="s">String to draw.</param>
+ /// <param name="font">Font object that defines the text format of the string.</param>
+ /// <param name="brush">Brush object that determines the color and texture of the drawn text.</param>
+ /// <param name="layoutRectangle">RectangleF structure that specifies the location of the drawn text.</param>
+ /// <param name="format">StringFormat object that specifies formatting properties, such as line spacing and alignment, that are applied to the drawn text.</param>
+ public void DrawString(
+ string s,
+ Font font,
+ Brush brush,
+ RectangleF layoutRectangle,
+ StringFormat format
+ )
+ {
+ _graphics.DrawString( s, font, brush, layoutRectangle, format );
+ }
+
+ /// <summary>
+ /// Draws the specified text string at the specified location with the specified Brush and Font objects using the formatting properties of the specified StringFormat object.
+ /// </summary>
+ /// <param name="s">String to draw.</param>
+ /// <param name="font">Font object that defines the text format of the string.</param>
+ /// <param name="brush">Brush object that determines the color and texture of the drawn text.</param>
+ /// <param name="point">PointF structure that specifies the upper-left corner of the drawn text.</param>
+ /// <param name="format">StringFormat object that specifies formatting properties, such as line spacing and alignment, that are applied to the drawn text.</param>
+ public void DrawString(
+ string s,
+ Font font,
+ Brush brush,
+ PointF point,
+ StringFormat format
+ )
+ {
+ _graphics.DrawString( s, font, brush, point, format );
+ }
+
+ /// <summary>
+ /// Draws the specified portion of the specified Image object at the specified location and with the specified size.
+ /// </summary>
+ /// <param name="image">Image object to draw.</param>
+ /// <param name="destRect">Rectangle structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle.</param>
+ /// <param name="srcX">x-coordinate of the upper-left corner of the portion of the source image to draw.</param>
+ /// <param name="srcY">y-coordinate of the upper-left corner of the portion of the source image to draw.</param>
+ /// <param name="srcWidth">Width of the portion of the source image to draw.</param>
+ /// <param name="srcHeight">Height of the portion of the source image to draw.</param>
+ /// <param name="srcUnit">Member of the GraphicsUnit enumeration that specifies the units of measure used to determine the source rectangle.</param>
+ /// <param name="imageAttrs">ImageAttributes object that specifies recoloring and gamma information for the image object.</param>
+ public void DrawImage(
+ System.Drawing.Image image,
+ Rectangle destRect,
+ float srcX,
+ float srcY,
+ float srcWidth,
+ float srcHeight,
+ GraphicsUnit srcUnit,
+ ImageAttributes imageAttrs
+ )
+ {
+ _graphics.DrawImage( image, destRect, srcX, srcY, srcWidth, srcHeight, srcUnit, imageAttrs );
+ }
+
+ /// <summary>
+ /// Draws a rectangle specified by a coordinate pair: a width, and a height.
+ /// </summary>
+ /// <param name="pen">A Pen object that determines the color, width, and style of the rectangle.</param>
+ /// <param name="x">The x-coordinate of the upper-left corner of the rectangle to draw.</param>
+ /// <param name="y">The y-coordinate of the upper-left corner of the rectangle to draw.</param>
+ /// <param name="width">The width of the rectangle to draw.</param>
+ /// <param name="height">The height of the rectangle to draw.</param>
+ public void DrawRectangle(
+ Pen pen,
+ float x,
+ float y,
+ float width,
+ float height
+ )
+ {
+ _graphics.DrawRectangle( pen, x, y, width, height );
+ }
+
+ /// <summary>
+ /// Draws a GraphicsPath object.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the path.</param>
+ /// <param name="path">GraphicsPath object to draw.</param>
+ public void DrawPath(
+ Pen pen,
+ GraphicsPath path
+ )
+ {
+ _graphics.DrawPath( pen, path );
+ }
+
+ /// <summary>
+ /// Draws a pie shape defined by an ellipse specified by a coordinate pair: a width, a height and two radial lines.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the pie shape.</param>
+ /// <param name="x">x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie shape comes.</param>
+ /// <param name="y">y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie shape comes.</param>
+ /// <param name="width">Width of the bounding rectangle that defines the ellipse from which the pie shape comes.</param>
+ /// <param name="height">Height of the bounding rectangle that defines the ellipse from which the pie shape comes.</param>
+ /// <param name="startAngle">Angle measured in degrees clockwise from the x-axis to the first side of the pie shape.</param>
+ /// <param name="sweepAngle">Angle measured in degrees clockwise from the startAngle parameter to the second side of the pie shape.</param>
+ public void DrawPie(
+ Pen pen,
+ float x,
+ float y,
+ float width,
+ float height,
+ float startAngle,
+ float sweepAngle
+ )
+ {
+ _graphics.DrawPie( pen, x, y, width, height, startAngle, sweepAngle );
+ }
+
+ /// <summary>
+ /// Draws an arc representing a portion of an ellipse specified by a pair of coordinates: a width, and a height.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the arc.</param>
+ /// <param name="x">x-coordinate of the upper-left corner of the rectangle that defines the ellipse.</param>
+ /// <param name="y">y-coordinate of the upper-left corner of the rectangle that defines the ellipse.</param>
+ /// <param name="width">Width of the rectangle that defines the ellipse.</param>
+ /// <param name="height">Height of the rectangle that defines the ellipse.</param>
+ /// <param name="startAngle">Angle in degrees measured clockwise from the x-axis to the starting point of the arc.</param>
+ /// <param name="sweepAngle">Angle in degrees measured clockwise from the startAngle parameter to ending point of the arc.</param>
+ public void DrawArc(
+ Pen pen,
+ float x,
+ float y,
+ float width,
+ float height,
+ float startAngle,
+ float sweepAngle
+ )
+ {
+ _graphics.DrawArc( pen, x, y, width, height, startAngle, sweepAngle );
+ }
+
+ /// <summary>
+ /// Draws the specified Image object at the specified location and with the specified size.
+ /// </summary>
+ /// <param name="image">Image object to draw.</param>
+ /// <param name="rect">RectangleF structure that specifies the location and size of the drawn image.</param>
+ public void DrawImage(
+ System.Drawing.Image image,
+ RectangleF rect
+ )
+ {
+ _graphics.DrawImage( image, rect );
+ }
+
+ /// <summary>
+ /// Draws an ellipse defined by a bounding RectangleF.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the ellipse.</param>
+ /// <param name="rect">RectangleF structure that defines the boundaries of the ellipse.</param>
+ public void DrawEllipse(
+ Pen pen,
+ RectangleF rect
+ )
+ {
+ _graphics.DrawEllipse( pen, rect );
+ }
+
+ /// <summary>
+ /// Draws a series of line segments that connect an array of PointF structures.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the line segments.</param>
+ /// <param name="points">Array of PointF structures that represent the points to connect.</param>
+ public void DrawLines(
+ Pen pen,
+ PointF[] points
+ )
+ {
+ _graphics.DrawLines( pen, points );
+ }
+
+ #endregion // Drawing Methods
+
+ #region Filling Methods
+
+ /// <summary>
+ /// Fills the interior of an ellipse defined by a bounding rectangle
+ /// specified by a RectangleF structure.
+ /// </summary>
+ /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
+ /// <param name="rect">RectangleF structure that represents the bounding rectangle that defines the ellipse.</param>
+ public void FillEllipse(
+ Brush brush,
+ RectangleF rect
+ )
+ {
+ _graphics.FillEllipse( brush, rect );
+ }
+
+ /// <summary>
+ /// Fills the interior of a GraphicsPath object.
+ /// </summary>
+ /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
+ /// <param name="path">GraphicsPath object that represents the path to fill.</param>
+ public void FillPath(
+ Brush brush,
+ GraphicsPath path
+ )
+ {
+ _graphics.FillPath( brush, path );
+ }
+
+ /// <summary>
+ /// Fills the interior of a Region object.
+ /// </summary>
+ /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
+ /// <param name="region">Region object that represents the area to fill.</param>
+ public void FillRegion(
+ Brush brush,
+ Region region
+ )
+ {
+ _graphics.FillRegion( brush, region );
+ }
+
+ /// <summary>
+ /// Fills the interior of a rectangle specified by a RectangleF structure.
+ /// </summary>
+ /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
+ /// <param name="rect">RectangleF structure that represents the rectangle to fill.</param>
+ public void FillRectangle(
+ Brush brush,
+ RectangleF rect
+ )
+ {
+ _graphics.FillRectangle( brush, rect );
+ }
+
+ /// <summary>
+ /// Fills the interior of a rectangle specified by a pair of coordinates, a width, and a height.
+ /// </summary>
+ /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
+ /// <param name="x">x-coordinate of the upper-left corner of the rectangle to fill.</param>
+ /// <param name="y">y-coordinate of the upper-left corner of the rectangle to fill.</param>
+ /// <param name="width">Width of the rectangle to fill.</param>
+ /// <param name="height">Height of the rectangle to fill.</param>
+ public void FillRectangle(
+ Brush brush,
+ float x,
+ float y,
+ float width,
+ float height
+ )
+ {
+ _graphics.FillRectangle( brush, x, y, width, height );
+ }
+
+ /// <summary>
+ /// Fills the interior of a polygon defined by an array of points specified by PointF structures .
+ /// </summary>
+ /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
+ /// <param name="points">Array of PointF structures that represent the vertices of the polygon to fill.</param>
+ public void FillPolygon(
+ Brush brush,
+ PointF[] points
+ )
+ {
+ _graphics.FillPolygon( brush, points );
+ }
+
+ /// <summary>
+ /// Fills the interior of a pie section defined by an ellipse
+ /// specified by a pair of coordinates, a width, and a height
+ /// and two radial lines.
+ /// </summary>
+ /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
+ /// <param name="x">x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes.</param>
+ /// <param name="y">y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes.</param>
+ /// <param name="width">Width of the bounding rectangle that defines the ellipse from which the pie section comes.</param>
+ /// <param name="height">Height of the bounding rectangle that defines the ellipse from which the pie section comes.</param>
+ /// <param name="startAngle">Angle in degrees measured clockwise from the x-axis to the first side of the pie section.</param>
+ /// <param name="sweepAngle">Angle in degrees measured clockwise from the startAngle parameter to the second side of the pie section.</param>
+ public void FillPie(
+ Brush brush,
+ float x,
+ float y,
+ float width,
+ float height,
+ float startAngle,
+ float sweepAngle
+ )
+ {
+ _graphics.FillPie( brush, x, y, width, height, startAngle, sweepAngle );
+ }
+
+ #endregion // Filling Methods
+
+ #region Other Methods
+
+ /// <summary>
+ /// Measures the specified string when drawn with the specified
+ /// Font object and formatted with the specified StringFormat object.
+ /// </summary>
+ /// <param name="text">String to measure.</param>
+ /// <param name="font">Font object defines the text format of the string.</param>
+ /// <param name="layoutArea">SizeF structure that specifies the maximum layout area for the text.</param>
+ /// <param name="stringFormat">StringFormat object that represents formatting information, such as line spacing, for the string.</param>
+ /// <returns>This method returns a SizeF structure that represents the size, in pixels, of the string specified in the text parameter as drawn with the font parameter and the stringFormat parameter.</returns>
+ public SizeF MeasureString(
+ string text,
+ Font font,
+ SizeF layoutArea,
+ StringFormat stringFormat
+ )
+ {
+ return _graphics.MeasureString( text, font, layoutArea, stringFormat );
+ }
+
+ /// <summary>
+ /// Measures the specified string when drawn with the specified
+ /// Font object and formatted with the specified StringFormat object.
+ /// </summary>
+ /// <param name="text">String to measure.</param>
+ /// <param name="font">Font object defines the text format of the string.</param>
+ /// <returns>This method returns a SizeF structure that represents the size, in pixels, of the string specified in the text parameter as drawn with the font parameter and the stringFormat parameter.</returns>
+ public SizeF MeasureString(
+ string text,
+ Font font
+ )
+ {
+ return _graphics.MeasureString( text, font );
+ }
+
+ /// <summary>
+ /// Saves the current state of this Graphics object and identifies the saved state with a GraphicsState object.
+ /// </summary>
+ /// <returns>This method returns a GraphicsState object that represents the saved state of this Graphics object.</returns>
+ public GraphicsState Save()
+ {
+ return _graphics.Save();
+ }
+
+ /// <summary>
+ /// Restores the state of this Graphics object to the state represented by a GraphicsState object.
+ /// </summary>
+ /// <param name="gstate">GraphicsState object that represents the state to which to restore this Graphics object.</param>
+ public void Restore(
+ GraphicsState gstate
+ )
+ {
+ _graphics.Restore( gstate );
+ }
+
+ /// <summary>
+ /// Resets the clip region of this Graphics object to an infinite region.
+ /// </summary>
+ public void ResetClip()
+ {
+ _graphics.ResetClip();
+ }
+
+ /// <summary>
+ /// Sets the clipping region of this Graphics object to the rectangle specified by a RectangleF structure.
+ /// </summary>
+ /// <param name="rect">RectangleF structure that represents the new clip region.</param>
+ public void SetClip(
+ RectangleF rect
+ )
+ {
+ _graphics.SetClip( rect );
+ }
+
+ /// <summary>
+ /// Sets the clipping region of this Graphics object to the result of the
+ /// specified operation combining the current clip region and the
+ /// specified GraphicsPath object.
+ /// </summary>
+ /// <param name="path">GraphicsPath object to combine.</param>
+ /// <param name="combineMode">Member of the CombineMode enumeration that specifies the combining operation to use.</param>
+ public void SetClip(
+ GraphicsPath path,
+ CombineMode combineMode
+ )
+ {
+ _graphics.SetClip( path, combineMode );
+ }
+
+ /// <summary>
+ /// Prepends the specified translation to the transformation matrix of this Graphics object.
+ /// </summary>
+ /// <param name="dx">x component of the translation.</param>
+ /// <param name="dy">y component of the translation.</param>
+ public void TranslateTransform(
+ float dx,
+ float dy
+ )
+ {
+ _graphics.TranslateTransform( dx, dy );
+ }
+
+ /// <summary>
+ /// This method starts Selection mode
+ /// </summary>
+ /// <param name="hRef">The location of the referenced object, expressed as a URI reference.</param>
+ /// <param name="title">Title which could be used for tooltips.</param>
+ public void BeginSelection( string hRef, string title )
+ {
+ // Not supported for GDI+
+ }
+
+ /// <summary>
+ /// This method stops Selection mode
+ /// </summary>
+ public void EndSelection( )
+ {
+ // Not supported for GDI+
+ }
+
+
+ #endregion // Other Methods
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets the world transformation for this Graphics object.
+ /// </summary>
+ public Matrix Transform
+ {
+ get
+ {
+ return _graphics.Transform;
+ }
+ set
+ {
+ _graphics.Transform = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the rendering quality for this Graphics object.
+ /// </summary>
+ public SmoothingMode SmoothingMode
+ {
+ get
+ {
+ return _graphics.SmoothingMode;
+ }
+ set
+ {
+ _graphics.SmoothingMode = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the rendering mode for text associated with this Graphics object.
+ /// </summary>
+ public TextRenderingHint TextRenderingHint
+ {
+ get
+ {
+ return _graphics.TextRenderingHint;
+ }
+ set
+ {
+ _graphics.TextRenderingHint = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a Region object that limits the drawing region of this Graphics object.
+ /// </summary>
+ public Region Clip
+ {
+ get
+ {
+ return _graphics.Clip;
+ }
+ set
+ {
+ _graphics.Clip = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether the clipping region of this Graphics object is empty.
+ /// </summary>
+ public bool IsClipEmpty
+ {
+ get
+ {
+ return _graphics.IsClipEmpty;
+ }
+ }
+
+ /// <summary>
+ /// Reference to the Graphics object
+ /// </summary>
+ public Graphics Graphics
+ {
+ get
+ {
+ return _graphics;
+ }
+ set
+ {
+ _graphics = value;
+ }
+ }
+
+ #endregion // Properties
+
+ #region Fields
+
+ /// <summary>
+ /// Graphics object
+ /// </summary>
+ Graphics _graphics = null;
+
+ #endregion // Fields
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/GridTickMarks.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/GridTickMarks.cs
new file mode 100644
index 00000000000..69b78cbea9f
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/GridTickMarks.cs
@@ -0,0 +1,2046 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: GridTickMarks.cs
+//
+// Namespace: DataVisualization.Charting
+//
+// Classes: TickMark, Grid
+//
+// Purpose: Axis tick marks and grid lines a very similar chart
+// elements and most of the functionality is located
+// in the Grid class. TickMark class is derived from
+// the Grid class and provides tick mark specific
+// functionality.
+//
+// Reviewed: AG - Jul 31, 2002
+// AG - Microsoft 14, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Drawing2D;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+#else
+ using System.Web;
+ using System.Web.UI;
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+ namespace System.Web.UI.DataVisualization.Charting
+#endif
+
+{
+ #region Tick marks style enumeration
+
+ /// <summary>
+ /// An enumeration of tick mark styles.
+ /// </summary>
+ public enum TickMarkStyle
+ {
+ /// <summary>
+ /// Tickmarks are disabled.
+ /// </summary>
+ None,
+ /// <summary>
+ /// Tickmarks are located outside of the chart area.
+ /// </summary>
+ OutsideArea,
+ /// <summary>
+ /// Tickmarks are located inside of the chart area.
+ /// </summary>
+ InsideArea,
+ /// <summary>
+ /// Tickmarks are set across the axis line.
+ /// </summary>
+ AcrossAxis
+ };
+
+ #endregion
+
+ /// <summary>
+ /// The TickMark class represents axis tick marks which are drawn next to
+ /// the axis line. TickMark shares many common properties with the Grid
+ /// class. This class also contains methods for tick marks drawing.
+ /// </summary>
+ [
+ DefaultProperty("Enabled"),
+ SRDescription("DescriptionAttributeTickMark_TickMark"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class TickMark : Grid
+ {
+ #region Private fields and Constructors
+
+ // Tick marks style
+ private TickMarkStyle _style = TickMarkStyle.OutsideArea;
+
+ // Tick marks size
+ private float _size = 1;
+
+ /// <summary>
+ /// Public default constructor
+ /// </summary>
+ public TickMark() : base(null, true)
+ {
+ }
+
+ /// <summary>
+ /// Public constructor
+ /// </summary>
+ /// <param name="axis">Axis which owns the grid or tick mark.</param>
+ /// <param name="major">Major axis element.</param>
+ internal TickMark(Axis axis, bool major) : base(axis, major)
+ {
+ }
+
+ #endregion
+
+ #region Tick marks painting method
+
+ /// <summary>
+ /// Draws and hit test for TickMarks.
+ /// </summary>
+ /// <param name="graph">Reference to the Chart Graphics object.</param>
+ /// <param name="backElements">Back elements of the axis should be drawn in 3D scene.</param>
+ internal void Paint( ChartGraphics graph, bool backElements )
+ {
+ PointF first = PointF.Empty; // The First point of a tick mark
+ PointF second = PointF.Empty; // The Second point of a tick mark
+ float axisPosition; // Axis position.
+
+ // Tick Marks are disabled
+ if( !this.enabled )
+ {
+ return;
+ }
+
+ // ****************************************************************
+ // This code creates auto interval for auto tick marks and
+ // gridlines. If type is not date there are always four tickmarks
+ // or gridlines between major gridlines and tickmarks. For date
+ // type interval is calculated using CalcInterval function.
+ // ****************************************************************
+ double oldInterval = this.interval;
+ DateTimeIntervalType oldIntervalType = this.intervalType;
+ double oldIntervalOffset = this.intervalOffset;
+ DateTimeIntervalType oldIntervalOffsetType = this.intervalOffsetType;
+ if( !this.majorGridTick && ( this.interval == 0 || double.IsNaN(this.interval) ) )
+ {
+ // Number type
+ if (this.Axis.majorGrid.GetIntervalType() == DateTimeIntervalType.Auto)
+ {
+ this.interval = this.Axis.majorGrid.GetInterval() / Grid.NumberOfIntervals;
+ }
+ // Date type
+ else
+ {
+ DateTimeIntervalType localIntervalType = this.Axis.majorGrid.GetIntervalType();
+ this.interval = Axis.CalcInterval(
+ this.Axis.ViewMinimum,
+ this.Axis.ViewMinimum + (this.Axis.ViewMaximum - this.Axis.ViewMinimum) / Grid.NumberOfDateTimeIntervals,
+ true,
+ out localIntervalType,
+ ChartValueType.DateTime );
+ this.intervalType = localIntervalType;
+ this.intervalOffsetType = this.Axis.majorGrid.GetIntervalOffsetType();
+ this.intervalOffset = this.Axis.majorGrid.GetIntervalOffset();
+ }
+ }
+
+ if( _style == TickMarkStyle.None )
+ {
+ return;
+ }
+
+ // Check if custom tick marks should be drawn from custom labels
+ if (Axis.IsCustomTickMarks())
+ {
+ PaintCustom(graph, backElements);
+ return;
+ }
+
+ // Get first series attached to this axis
+ Series axisSeries = null;
+ if (Axis.axisType == AxisName.X || Axis.axisType == AxisName.X2)
+ {
+ List<string> seriesArray = Axis.ChartArea.GetXAxesSeries((Axis.axisType == AxisName.X) ? AxisType.Primary : AxisType.Secondary, Axis.SubAxisName);
+ if(seriesArray.Count > 0)
+ {
+ axisSeries = Axis.Common.DataManager.Series[seriesArray[0]];
+ if(axisSeries != null && !axisSeries.IsXValueIndexed)
+ {
+ axisSeries = null;
+ }
+ }
+ }
+
+ // Current position for tick mark is minimum
+ double current = Axis.ViewMinimum;
+
+ // Get offse type
+ DateTimeIntervalType offsetType = (GetIntervalOffsetType() == DateTimeIntervalType.Auto) ? GetIntervalType() : GetIntervalOffsetType();
+
+
+ // ***********************************
+ // Check if the AJAX zooming and scrolling mode is enabled.
+ // ***********************************
+
+ // Adjust start position depending on the interval type
+ if (!Axis.ChartArea.chartAreaIsCurcular ||
+ Axis.axisType == AxisName.Y ||
+ Axis.axisType == AxisName.Y2)
+ {
+ current = ChartHelper.AlignIntervalStart(current, this.GetInterval(), this.GetIntervalType(), axisSeries, this.majorGridTick);
+ }
+
+ // The Current position is start position, not minimum
+ if (GetIntervalOffset() != 0 && !double.IsNaN(GetIntervalOffset()) && axisSeries == null)
+ {
+ current += ChartHelper.GetIntervalSize(current, GetIntervalOffset(),
+ offsetType, axisSeries, 0, DateTimeIntervalType.Number, true, false);
+ }
+
+ // Too many tick marks
+ if ((Axis.ViewMaximum - Axis.ViewMinimum) / ChartHelper.GetIntervalSize(current, this.GetInterval(), this.GetIntervalType(), axisSeries, 0, DateTimeIntervalType.Number, true) > ChartHelper.MaxNumOfGridlines)
+ {
+ return;
+ }
+
+ // If Maximum, minimum and interval don’t have
+ // proper value do not draw tick marks.
+ if (Axis.ViewMaximum <= Axis.ViewMinimum)
+ {
+ return;
+ }
+
+ // Axis scroll bar will increase size of the Outside and Cross style tick marks
+ float scrollBarSize = 0;
+
+#if Microsoft_CONTROL
+
+ if (this.Axis.ScrollBar.IsVisible &&
+ this.Axis.ScrollBar.IsPositionedInside &&
+ (this.Axis.IsAxisOnAreaEdge || !this.Axis.IsMarksNextToAxis))
+ {
+ scrollBarSize = (float)this.Axis.ScrollBar.GetScrollBarRelativeSize();
+ }
+
+#endif // Microsoft_CONTROL
+
+ // Left tickmarks
+ if (Axis.AxisPosition == AxisPosition.Left)
+ {
+ // The tick marks will follow axis or they will
+ // be always on the border of the chart area.
+ if (Axis.GetIsMarksNextToAxis())
+ axisPosition = (float)Axis.GetAxisPosition();
+ else
+ axisPosition = Axis.PlotAreaPosition.X;
+
+ if( _style == TickMarkStyle.InsideArea )
+ {
+ first.X = axisPosition;
+ second.X = axisPosition + _size;
+ }
+ else if( _style == TickMarkStyle.OutsideArea )
+ {
+ first.X = axisPosition - _size - scrollBarSize;
+ second.X = axisPosition;
+ }
+ else if( _style == TickMarkStyle.AcrossAxis )
+ {
+ first.X = axisPosition - _size/2 - scrollBarSize;
+ second.X = axisPosition + _size/2;
+ }
+ }
+
+ // Right tickmarks
+ else if (Axis.AxisPosition == AxisPosition.Right)
+ {
+ // The tick marks will follow axis or they will
+ // be always on the border of the chart area.
+ if (Axis.GetIsMarksNextToAxis())
+ axisPosition = (float)Axis.GetAxisPosition();
+ else
+ axisPosition = Axis.PlotAreaPosition.Right;
+
+ if( _style == TickMarkStyle.InsideArea )
+ {
+ first.X = axisPosition - _size;
+ second.X = axisPosition;
+ }
+ else if( _style == TickMarkStyle.OutsideArea )
+ {
+ first.X = axisPosition;
+ second.X = axisPosition + _size + scrollBarSize;
+ }
+ else if( _style == TickMarkStyle.AcrossAxis )
+ {
+ first.X = axisPosition - _size/2;
+ second.X = axisPosition + _size/2 + scrollBarSize;
+ }
+ }
+
+ // Top tickmarks
+ else if (Axis.AxisPosition == AxisPosition.Top)
+ {
+ // The tick marks will follow axis or they will
+ // be always on the border of the chart area.
+ if (Axis.GetIsMarksNextToAxis())
+ axisPosition = (float)Axis.GetAxisPosition();
+ else
+ axisPosition = Axis.PlotAreaPosition.Y;
+
+ if( _style == TickMarkStyle.InsideArea )
+ {
+ first.Y = axisPosition;
+ second.Y = axisPosition + _size;
+ }
+ else if( _style == TickMarkStyle.OutsideArea )
+ {
+ first.Y = axisPosition - _size - scrollBarSize;
+ second.Y = axisPosition;
+ }
+ else if( _style == TickMarkStyle.AcrossAxis )
+ {
+ first.Y = axisPosition - _size/2 - scrollBarSize;
+ second.Y = axisPosition + _size/2;
+ }
+ }
+
+ // Bottom tickmarks
+ else if (Axis.AxisPosition == AxisPosition.Bottom)
+ {
+ // The tick marks will follow axis or they will
+ // be always on the border of the chart area.
+ if (Axis.GetIsMarksNextToAxis())
+ axisPosition = (float)Axis.GetAxisPosition();
+ else
+ axisPosition = Axis.PlotAreaPosition.Bottom;
+
+ if( _style == TickMarkStyle.InsideArea )
+ {
+ first.Y = axisPosition - _size;
+ second.Y = axisPosition;
+ }
+ else if( _style == TickMarkStyle.OutsideArea )
+ {
+ first.Y = axisPosition;
+ second.Y = axisPosition + _size + scrollBarSize;
+ }
+ else if( _style == TickMarkStyle.AcrossAxis )
+ {
+ first.Y = axisPosition - _size/2;
+ second.Y = axisPosition + _size/2 + scrollBarSize;
+ }
+ }
+
+
+ // Loop for drawing grid tick marks
+ int counter = 0;
+ int logStep = 1;
+ double oldCurrent = current;
+ double interval = 0;
+ while (current <= Axis.ViewMaximum)
+ {
+ double logInterval = 0;
+
+ // Take an interval between gridlines. Interval
+ // depends on interval type.
+ if (this.majorGridTick || this.Axis.IsLogarithmic == false)
+ {
+ // Take an interval between tickmarks. Interval
+ // depends on interval type.
+ interval = ChartHelper.GetIntervalSize(current, this.GetInterval(), this.GetIntervalType(), axisSeries, this.GetIntervalOffset(), offsetType, true);
+
+ }
+ // Code for linear minor gridlines and tickmarks
+ // if scale is logarithmic.
+ else
+ {
+ // This code is used only for logarithmic scale and minor tick marks or
+ // gridlines which have linear minor scale in logarithmic major scale.
+ // This code is used to find minimum value for the interval. For example
+ // if logarithmic base is 2 and interval is between 4 and 8; current value
+ // is 5.6; this method will return linearised value for 4. This code works
+ // like Math.Floor for logarithmic scale.
+ double logMinimum = this.GetLogMinimum( current, axisSeries );
+
+ if( oldCurrent != logMinimum )
+ {
+ oldCurrent = logMinimum;
+ logStep = 1;
+ }
+
+ // Find interval for logarithmic linearised scale
+ logInterval = Math.Log(1 + this.interval * logStep, Axis.logarithmBase);
+
+ current = oldCurrent;
+
+ interval = logInterval;
+
+ logStep++;
+
+ // Reset current position if major interval is passed.
+ if( this.GetLogMinimum( current + logInterval, axisSeries ) != logMinimum )
+ {
+ current += logInterval;
+ continue;
+ }
+ }
+
+ // For indexed series do not draw the last tickmark
+ if (current == Axis.ViewMaximum && axisSeries != null)
+ {
+ current += interval;
+
+ continue;
+ }
+
+ // Check interval size
+ if( interval == 0 )
+ {
+ throw (new InvalidOperationException(SR.ExceptionTickMarksIntervalIsZero));
+ }
+
+ // Check if we do not exceed max number of elements
+ if (counter++ > ChartHelper.MaxNumOfGridlines)
+ {
+ break;
+ }
+
+ // Do not draw the very first tick mark for circular chart area
+ if (this.Axis != null && this.Axis.ChartArea != null)
+ {
+ if (this.Axis.ChartArea.chartAreaIsCurcular &&
+ ((this.Axis.IsReversed == false && current == Axis.ViewMinimum) ||
+ (this.Axis.IsReversed == true && current == Axis.ViewMaximum)))
+ {
+ current += interval;
+
+ continue;
+ }
+ }
+
+ if (!this.majorGridTick && this.Axis.IsLogarithmic)
+ {
+ current += logInterval;
+
+ if (current > Axis.ViewMaximum)
+ {
+ break;
+ }
+ }
+
+ if ((decimal)current >= (decimal)Axis.ViewMinimum)
+ {
+ // Left tickmarks
+ if (Axis.AxisPosition == AxisPosition.Left)
+ {
+ first.Y = (float)Axis.GetLinearPosition(current);
+ second.Y = first.Y;
+ }
+
+ // Right tickmarks
+ else if (Axis.AxisPosition == AxisPosition.Right)
+ {
+ first.Y = (float)Axis.GetLinearPosition(current);
+ second.Y = first.Y;
+ }
+
+ // Top tickmarks
+ else if (Axis.AxisPosition == AxisPosition.Top)
+ {
+ first.X = (float)Axis.GetLinearPosition(current);
+ second.X = first.X;
+ }
+
+ // Bottom tickmarks
+ else if (Axis.AxisPosition == AxisPosition.Bottom)
+ {
+ first.X = (float)Axis.GetLinearPosition(current);
+ second.X = first.X;
+ }
+
+ if (Axis.Common.ProcessModeRegions)
+ {
+ if (this.Axis.ChartArea.chartAreaIsCurcular)
+ {
+ RectangleF rect = new RectangleF( first.X - 0.5f, first.Y - 0.5f, Math.Abs( second.X - first.X ) + 1, Math.Abs( second.Y - first.Y ) + 1 );
+ using (GraphicsPath path = new GraphicsPath())
+ {
+ path.AddRectangle(graph.GetAbsoluteRectangle(rect));
+ path.Transform(graph.Transform);
+ this.Axis.Common.HotRegionsList.AddHotRegion(
+ path,
+ false,
+ ChartElementType.TickMarks,
+ this);
+ }
+ }
+ else if (!this.Axis.ChartArea.Area3DStyle.Enable3D || this.Axis.ChartArea.chartAreaIsCurcular)
+ {
+ RectangleF rect = new RectangleF( first.X - 0.5f, first.Y - 0.5f, Math.Abs( second.X - first.X ) + 1, Math.Abs( second.Y - first.Y ) + 1 );
+
+ Axis.Common.HotRegionsList.AddHotRegion(rect, this, ChartElementType.TickMarks, true);
+ }
+ else
+ {
+ if (!Axis.Common.ProcessModePaint) //if ProcessModePaint is true it will be called later
+ Draw3DTickLine(graph, first, second, backElements);
+ }
+
+ }
+
+ if (Axis.Common.ProcessModePaint)
+ {
+ // Draw grid line
+ if (!this.Axis.ChartArea.Area3DStyle.Enable3D || this.Axis.ChartArea.chartAreaIsCurcular)
+ {
+ graph.DrawLineRel( borderColor, borderWidth, borderDashStyle, first, second );
+ }
+ else
+ {
+ Draw3DTickLine(graph, first, second, backElements);
+ }
+ }
+ }
+
+ // Move position
+ if (this.majorGridTick || this.Axis.IsLogarithmic == false)
+ {
+ current += interval;
+ }
+ }
+
+ // Used for auto interval for auto tick marks and
+ // gridlines
+ if( !this.majorGridTick )
+ {
+ this.interval = oldInterval;
+ this.intervalType = oldIntervalType;
+ this.intervalOffset = oldIntervalOffset;
+ this.intervalOffsetType = oldIntervalOffsetType;
+ }
+ }
+
+ /// <summary>
+ /// This method returns linearized logarithmic value
+ /// which is minimum for range with interval 1.
+ /// </summary>
+ /// <param name="current">Current value</param>
+ /// <param name="axisSeries">First series attached to axis.</param>
+ /// <returns>Returns Minimum for the range which contains current value</returns>
+ private double GetLogMinimum( double current, Series axisSeries )
+ {
+ double viewMinimum = Axis.ViewMinimum;
+ DateTimeIntervalType offsetType = (GetIntervalOffsetType() == DateTimeIntervalType.Auto) ? GetIntervalType() : GetIntervalOffsetType();
+ if( GetIntervalOffset() != 0 && axisSeries == null)
+ {
+ viewMinimum += ChartHelper.GetIntervalSize(viewMinimum, GetIntervalOffset(),
+ offsetType, axisSeries, 0, DateTimeIntervalType.Number, true, false);
+ }
+
+ return viewMinimum + Math.Floor( ( current - viewMinimum ));
+ }
+
+ /// <summary>
+ /// Draws and hit test for custom TickMarks from the custom labels collection.
+ /// </summary>
+ /// <param name="graph">Reference to the Chart Graphics object.</param>
+ /// <param name="backElements">Back elements of the axis should be drawn in 3D scene.</param>
+ internal void PaintCustom( ChartGraphics graph, bool backElements )
+ {
+ PointF first = PointF.Empty; // The First point of a tick mark
+ PointF second = PointF.Empty; // The Second point of a tick mark
+ float axisPosition; // Axis position.
+
+ // Axis scroll bar will increase size of the Outside and Cross style tick marks
+ float scrollBarSize = 0;
+
+#if Microsoft_CONTROL
+
+ if (this.Axis.ScrollBar.IsVisible && this.Axis.ScrollBar.IsPositionedInside && this.Axis.IsAxisOnAreaEdge)
+ {
+ scrollBarSize = (float)this.Axis.ScrollBar.GetScrollBarRelativeSize();
+ }
+
+#endif // Microsoft_CONTROL
+
+ // Left tickmarks
+ if (Axis.AxisPosition == AxisPosition.Left)
+ {
+ // The tick marks will follow axis or they will
+ // be always on the border of the chart area.
+ if (Axis.GetIsMarksNextToAxis())
+ axisPosition = (float)Axis.GetAxisPosition();
+ else
+ axisPosition = Axis.PlotAreaPosition.X;
+
+ if( _style == TickMarkStyle.InsideArea )
+ {
+ first.X = axisPosition;
+ second.X = axisPosition + _size;
+ }
+ else if( _style == TickMarkStyle.OutsideArea )
+ {
+ first.X = axisPosition - _size - scrollBarSize;
+ second.X = axisPosition;
+ }
+ else if( _style == TickMarkStyle.AcrossAxis )
+ {
+ first.X = axisPosition - _size/2 - scrollBarSize;
+ second.X = axisPosition + _size/2;
+ }
+ }
+
+ // Right tickmarks
+ else if (Axis.AxisPosition == AxisPosition.Right)
+ {
+ // The tick marks will follow axis or they will
+ // be always on the border of the chart area.
+ if (Axis.GetIsMarksNextToAxis())
+ axisPosition = (float)Axis.GetAxisPosition();
+ else
+ axisPosition = Axis.PlotAreaPosition.Right;
+
+ if( _style == TickMarkStyle.InsideArea )
+ {
+ first.X = axisPosition - _size;
+ second.X = axisPosition;
+ }
+ else if( _style == TickMarkStyle.OutsideArea )
+ {
+ first.X = axisPosition;
+ second.X = axisPosition + _size + scrollBarSize;
+ }
+ else if( _style == TickMarkStyle.AcrossAxis )
+ {
+ first.X = axisPosition - _size/2;
+ second.X = axisPosition + _size/2 + scrollBarSize;
+ }
+ }
+
+ // Top tickmarks
+ else if (Axis.AxisPosition == AxisPosition.Top)
+ {
+ // The tick marks will follow axis or they will
+ // be always on the border of the chart area.
+ if (Axis.GetIsMarksNextToAxis())
+ axisPosition = (float)Axis.GetAxisPosition();
+ else
+ axisPosition = Axis.PlotAreaPosition.Y;
+
+ if( _style == TickMarkStyle.InsideArea )
+ {
+ first.Y = axisPosition;
+ second.Y = axisPosition + _size;
+ }
+ else if( _style == TickMarkStyle.OutsideArea )
+ {
+ first.Y = axisPosition - _size - scrollBarSize;
+ second.Y = axisPosition;
+ }
+ else if( _style == TickMarkStyle.AcrossAxis )
+ {
+ first.Y = axisPosition - _size/2 - scrollBarSize;
+ second.Y = axisPosition + _size/2;
+ }
+ }
+
+ // Bottom tickmarks
+ else if (Axis.AxisPosition == AxisPosition.Bottom)
+ {
+ // The tick marks will follow axis or they will
+ // be always on the border of the chart area.
+ if (Axis.GetIsMarksNextToAxis())
+ axisPosition = (float)Axis.GetAxisPosition();
+ else
+ axisPosition = Axis.PlotAreaPosition.Bottom;
+
+ if( _style == TickMarkStyle.InsideArea )
+ {
+ first.Y = axisPosition - _size;
+ second.Y = axisPosition;
+ }
+ else if( _style == TickMarkStyle.OutsideArea )
+ {
+ first.Y = axisPosition;
+ second.Y = axisPosition + _size + scrollBarSize;
+ }
+ else if( _style == TickMarkStyle.AcrossAxis )
+ {
+ first.Y = axisPosition - _size/2;
+ second.Y = axisPosition + _size/2 + scrollBarSize;
+ }
+ }
+
+ // Loop through all custom labels
+ foreach (CustomLabel label in Axis.CustomLabels)
+ {
+ if((label.GridTicks & GridTickTypes.TickMark) == GridTickTypes.TickMark)
+ {
+ double position = (label.ToPosition + label.FromPosition) / 2.0;
+ if (position >= Axis.ViewMinimum && position <= Axis.ViewMaximum)
+ {
+ // Left tickmarks
+ if (Axis.AxisPosition == AxisPosition.Left)
+ {
+ first.Y = (float)Axis.GetLinearPosition(position);
+ second.Y = first.Y;
+ }
+
+ // Right tickmarks
+ else if (Axis.AxisPosition == AxisPosition.Right)
+ {
+ first.Y = (float)Axis.GetLinearPosition(position);
+ second.Y = first.Y;
+ }
+
+ // Top tickmarks
+ else if (Axis.AxisPosition == AxisPosition.Top)
+ {
+ first.X = (float)Axis.GetLinearPosition(position);
+ second.X = first.X;
+ }
+
+ // Bottom tickmarks
+ else if (Axis.AxisPosition == AxisPosition.Bottom)
+ {
+ first.X = (float)Axis.GetLinearPosition(position);
+ second.X = first.X;
+ }
+
+ if (Axis.Common.ProcessModeRegions)
+ {
+ if (!this.Axis.ChartArea.Area3DStyle.Enable3D || this.Axis.ChartArea.chartAreaIsCurcular)
+ {
+ RectangleF rect = new RectangleF( first.X - 0.5f, first.Y - 0.5f, Math.Abs( second.X - first.X ) + 1, Math.Abs( second.Y - first.Y ) + 1 );
+
+ Axis.Common.HotRegionsList.AddHotRegion(rect, this, ChartElementType.TickMarks, true);
+ }
+ else
+ {
+ Draw3DTickLine(graph, first, second, backElements);
+ }
+ }
+
+ if (Axis.Common.ProcessModePaint)
+ {
+ // Draw grid line
+ if (!this.Axis.ChartArea.Area3DStyle.Enable3D || this.Axis.ChartArea.chartAreaIsCurcular)
+ {
+ graph.DrawLineRel( borderColor, borderWidth, borderDashStyle, first, second );
+ }
+ else
+ {
+ Draw3DTickLine(graph, first, second, backElements);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Draws tick mark line in 3D space.
+ /// </summary>
+ /// <param name="graph">Reference to the Chart Graphics object.</param>
+ /// <param name="point1">First line point.</param>
+ /// <param name="point2">Second line point.</param>
+ /// <param name="backElements">Back elements of the axis should be drawn in 3D scene.</param>
+ internal void Draw3DTickLine(
+ ChartGraphics graph,
+ PointF point1,
+ PointF point2,
+ bool backElements
+ )
+ {
+
+ ChartArea area = this.Axis.ChartArea;
+
+ //*****************************************************************
+ //** Set the tick marks line depth
+ //*****************************************************************
+ bool axisOnEdge;
+ float wallZPosition = Axis.GetMarksZPosition(out axisOnEdge);
+
+ //*****************************************************************
+ //** Check if tick mark should be drawn as back or front element
+ //*****************************************************************
+
+ // Check if axis tick marks are drawn inside plotting area
+ bool tickMarksOnEdge = axisOnEdge;
+ if(tickMarksOnEdge &&
+ this.Axis.MajorTickMark.TickMarkStyle == TickMarkStyle.AcrossAxis ||
+ this.Axis.MajorTickMark.TickMarkStyle == TickMarkStyle.InsideArea ||
+ this.Axis.MinorTickMark.TickMarkStyle == TickMarkStyle.AcrossAxis ||
+ this.Axis.MinorTickMark.TickMarkStyle == TickMarkStyle.InsideArea)
+ {
+ tickMarksOnEdge = false;
+ }
+
+ SurfaceNames surfaceName = (wallZPosition == 0f) ? SurfaceNames.Back : SurfaceNames.Front;
+ if( !area.ShouldDrawOnSurface(surfaceName, backElements, tickMarksOnEdge) )
+ {
+ // Skip drawing
+ return;
+ }
+
+ //*****************************************************************
+ //** Add area scene wall width to the length of the tick mark
+ //*****************************************************************
+ if (Axis.AxisPosition == AxisPosition.Bottom &&
+ (!Axis.GetIsMarksNextToAxis() || axisOnEdge) &&
+ area.IsBottomSceneWallVisible())
+ {
+ point2.Y += area.areaSceneWallWidth.Height;
+ }
+ else if (Axis.AxisPosition == AxisPosition.Left &&
+ (!Axis.GetIsMarksNextToAxis() || axisOnEdge) &&
+ area.IsSideSceneWallOnLeft())
+ {
+ point1.X -= area.areaSceneWallWidth.Width;
+ }
+ else if (Axis.AxisPosition == AxisPosition.Right &&
+ (!Axis.GetIsMarksNextToAxis() || axisOnEdge) &&
+ !area.IsSideSceneWallOnLeft())
+ {
+ point2.X += area.areaSceneWallWidth.Width;
+ }
+ else if (Axis.AxisPosition == AxisPosition.Top &&
+ (!Axis.GetIsMarksNextToAxis() || axisOnEdge))
+ {
+ point1.Y -= area.areaSceneWallWidth.Height;
+ }
+
+ //*****************************************************************
+ //** Adjust grid line direction for the Top axis
+ //*****************************************************************
+ Point3D point3 = null, point4 = null;
+ if(axisOnEdge && area.areaSceneWallWidth.Width != 0f)
+ {
+ if (Axis.AxisPosition == AxisPosition.Top)
+ {
+ // Always use plot area position to draw tick mark
+ float axisPosition = Axis.PlotAreaPosition.Y;
+
+ if( _style == TickMarkStyle.InsideArea )
+ {
+ point1.Y = axisPosition;
+ point2.Y = axisPosition + _size;
+
+ point3 = new Point3D(point1.X, point1.Y, - area.areaSceneWallWidth.Width);
+ point4 = new Point3D(point1.X, point1.Y, 0f);
+ }
+ else if( _style == TickMarkStyle.OutsideArea )
+ {
+ point1.Y = axisPosition;
+ point2.Y = axisPosition;
+
+ point3 = new Point3D(point1.X, axisPosition, wallZPosition);
+ point4 = new Point3D(point1.X, point1.Y, - _size - area.areaSceneWallWidth.Width);
+ }
+ else if( _style == TickMarkStyle.AcrossAxis )
+ {
+ point1.Y = axisPosition;
+ point2.Y = axisPosition + _size/2;
+
+ point3 = new Point3D(point1.X, axisPosition, wallZPosition);
+ point4 = new Point3D(point1.X, point1.Y, - _size/2 - area.areaSceneWallWidth.Width);
+ }
+
+ // Do not show "bent" tick marks on the top surface
+ if(area.ShouldDrawOnSurface(SurfaceNames.Top, backElements, false))
+ {
+ point3 = null;
+ point4 = null;
+ }
+ }
+
+ //*****************************************************************
+ //** Adjust grid line direction for the Left axis
+ //*****************************************************************
+ if (Axis.AxisPosition == AxisPosition.Left && !area.IsSideSceneWallOnLeft())
+ {
+ // Always use plot area position to draw tick mark
+ float axisPosition = Axis.PlotAreaPosition.X;
+
+ if( _style == TickMarkStyle.InsideArea )
+ {
+ point1.X = axisPosition;
+ point2.X = axisPosition + _size;
+
+ point3 = new Point3D(point1.X, point1.Y, - area.areaSceneWallWidth.Width);
+ point4 = new Point3D(point1.X, point1.Y, 0f);
+ }
+ else if( _style == TickMarkStyle.OutsideArea )
+ {
+ point1.X = axisPosition;
+ point2.X = axisPosition;
+
+ point3 = new Point3D(axisPosition, point1.Y, wallZPosition);
+ point4 = new Point3D(axisPosition, point1.Y, - _size - area.areaSceneWallWidth.Width);
+ }
+ else if( _style == TickMarkStyle.AcrossAxis )
+ {
+ point1.X = axisPosition;
+ point2.X = axisPosition + _size/2;
+
+ point3 = new Point3D(axisPosition, point1.Y, wallZPosition);
+ point4 = new Point3D(axisPosition, point1.Y, - _size/2 - area.areaSceneWallWidth.Width);
+ }
+
+ // Do not show "bent" tick marks on the left surface
+ if(area.ShouldDrawOnSurface(SurfaceNames.Left, backElements, false))
+ {
+ point3 = null;
+ point4 = null;
+ }
+ }
+
+ //*****************************************************************
+ //** Adjust grid line direction for the Right axis
+ //*****************************************************************
+ else if (Axis.AxisPosition == AxisPosition.Right && area.IsSideSceneWallOnLeft())
+ {
+ // Always use plot area position to draw tick mark
+ float axisPosition = Axis.PlotAreaPosition.Right;
+
+ if( _style == TickMarkStyle.InsideArea )
+ {
+ point1.X = axisPosition - _size;
+ point2.X = axisPosition;
+
+ point3 = new Point3D(point2.X, point2.Y, - area.areaSceneWallWidth.Width);
+ point4 = new Point3D(point2.X, point2.Y, 0f);
+ }
+ else if( _style == TickMarkStyle.OutsideArea )
+ {
+ point1.X = axisPosition;
+ point2.X = axisPosition;
+
+ point3 = new Point3D(axisPosition, point1.Y, wallZPosition);
+ point4 = new Point3D(axisPosition, point1.Y, - _size - area.areaSceneWallWidth.Width);
+
+ }
+ else if( _style == TickMarkStyle.AcrossAxis )
+ {
+ point1.X = axisPosition - _size/2;
+ point2.X = axisPosition;
+
+ point3 = new Point3D(axisPosition, point1.Y, wallZPosition);
+ point4 = new Point3D(axisPosition, point1.Y, - _size/2 - area.areaSceneWallWidth.Width);
+ }
+
+ // Do not show "bent" tick marks on the right surface
+ if(area.ShouldDrawOnSurface(SurfaceNames.Right, backElements, false))
+ {
+ point3 = null;
+ point4 = null;
+ }
+ }
+ }
+
+ //*****************************************************************
+ //** Draw tick mark (first line)
+ //*****************************************************************
+ graph.Draw3DLine(
+ area.matrix3D,
+ borderColor, borderWidth, borderDashStyle,
+ new Point3D(point1.X, point1.Y, wallZPosition),
+ new Point3D(point2.X, point2.Y, wallZPosition),
+ Axis.Common,
+ this,
+ ChartElementType.TickMarks
+ );
+
+
+ //*****************************************************************
+ //** Draw tick mark (second line)
+ //*****************************************************************
+ if(point3 != null && point4 != null)
+ {
+ graph.Draw3DLine(
+ area.matrix3D,
+ borderColor, borderWidth, borderDashStyle,
+ point3,
+ point4,
+ Axis.Common,
+ this,
+ ChartElementType.TickMarks
+ );
+ }
+ }
+
+ #endregion
+
+ #region TickMark properties
+
+ /// <summary>
+ /// Tick mark style.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(TickMarkStyle.OutsideArea),
+ SRDescription("DescriptionAttributeTickMark_Style"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public TickMarkStyle TickMarkStyle
+ {
+ get
+ {
+ return _style;
+ }
+ set
+ {
+ _style = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Tick mark size.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(1.0F),
+ SRDescription("DescriptionAttributeTickMark_Size"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public float Size
+ {
+ get
+ {
+ return _size;
+ }
+ set
+ {
+ _size = value;
+ this.Invalidate();
+ }
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// The Grid class represents axis grid lines which are drawn in the
+ /// plotting area. It contains grid interval and visual appearance
+ /// properties. This class also contains methods for grid lines drawing.
+ /// </summary>
+ [
+ DefaultProperty("Enabled"),
+ SRDescription("DescriptionAttributeGrid_Grid"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class Grid
+ {
+ #region Grid fields and Constructors
+
+ // Reference to the Axis object
+ private Axis _axis = null;
+
+ // Flags indicate that interval properties where changed
+ internal bool intervalOffsetChanged = false;
+ internal bool intervalChanged = false;
+ internal bool intervalTypeChanged = false;
+ internal bool intervalOffsetTypeChanged = false;
+
+ internal bool enabledChanged = false;
+
+ // Data members, which store properties values
+ internal double intervalOffset = 0;
+ internal double interval = 0;
+ internal DateTimeIntervalType intervalType = DateTimeIntervalType.Auto;
+ internal DateTimeIntervalType intervalOffsetType = DateTimeIntervalType.Auto;
+ internal Color borderColor = Color.Black;
+ internal int borderWidth = 1;
+ internal ChartDashStyle borderDashStyle = ChartDashStyle.Solid;
+ internal bool enabled = true;
+
+ // Indicates that object describes Major Tick Mark or Grid Line
+ internal bool majorGridTick = false;
+
+ // Common number of intervals on the numeric and date-time axis
+ internal const double NumberOfIntervals = 5.0;
+ internal const double NumberOfDateTimeIntervals = 4.0;
+
+ /// <summary>
+ /// Public default constructor.
+ /// </summary>
+ public Grid()
+ {
+ }
+
+ /// <summary>
+ /// Public constructor.
+ /// </summary>
+ /// <param name="axis">Axis which owns the grid.</param>
+ /// <param name="major">Major axis element.</param>
+ internal Grid(Axis axis, bool major)
+ {
+ Initialize(axis, major);
+ }
+
+ /// <summary>
+ /// Initializes the object.
+ /// </summary>
+ /// <param name="axis">Axis which owns the grid.</param>
+ /// <param name="major">Major axis element.</param>
+ internal void Initialize(Axis axis, bool major)
+ {
+ // Minor elements are disabled by default
+ if(!this.enabledChanged &&
+ this._axis == null &&
+ !major)
+ {
+ enabled = false;
+ }
+
+ // If object was first created and populated with data and then added into the axis
+ // we need to remember changed values.
+ // NOTE: Fixes issue #6237
+ if(this._axis == null)
+ {
+ TickMark tickMark = this as TickMark;
+
+ if(this.interval != 0)
+ {
+ if (tickMark != null)
+ {
+ if(major)
+ {
+ axis.tempMajorTickMarkInterval = this.interval;
+ }
+ else
+ {
+ axis.tempMinorTickMarkInterval = this.interval;
+ }
+ }
+ else
+ {
+ if(major)
+ {
+ axis.tempMajorGridInterval = this.interval;
+ }
+ else
+ {
+ axis.tempMinorGridInterval = this.interval;
+ }
+ }
+ }
+ if(this.intervalType != DateTimeIntervalType.Auto)
+ {
+ if(tickMark != null)
+ {
+ if(major)
+ {
+ axis.tempTickMarkIntervalType = this.intervalType;
+ }
+ }
+ else
+ {
+ if(major)
+ {
+ axis.tempGridIntervalType = this.intervalType;
+ }
+ }
+ }
+ }
+
+ // Set axis object reference
+ this._axis = axis;
+
+ // Set a flag if this object represent minor or major tick
+ this.majorGridTick = major;
+
+// internal double interval = 0;
+// internal DateTimeIntervalType intervalType = DateTimeIntervalType.Auto;
+
+ }
+
+ #endregion
+
+ #region Grid helper functions
+ /// <summary>
+ /// Gets axes to which this object attached to
+ /// </summary>
+ /// <returns>Axis object.</returns>
+ internal Axis GetAxis()
+ {
+ return _axis;
+ }
+ /// <summary>
+ /// Invalidate chart area the axis belong to.
+ /// </summary>
+ internal void Invalidate()
+ {
+#if Microsoft_CONTROL
+
+ if(this._axis != null)
+ {
+ this._axis.Invalidate();
+ }
+#endif
+ }
+
+ #endregion
+
+ #region Grid lines drawing functions
+
+ /// <summary>
+ /// Draws grid lines.
+ /// </summary>
+ /// <param name="graph">Reference to the Chart Graphics object.</param>
+ internal void Paint( ChartGraphics graph )
+ {
+ // Grids are disabled
+ if( !this.enabled )
+ {
+ return;
+ }
+
+ // Check if custom grid lines should be drawn from custom labels
+ if(_axis.IsCustomGridLines())
+ {
+ PaintCustom( graph );
+ return;
+ }
+
+ double gridInterval; // Grid interval
+ double current; // Current position
+
+ // Get first series attached to this axis
+ Series axisSeries = null;
+ if(_axis.axisType == AxisName.X || _axis.axisType == AxisName.X2)
+ {
+ List<string> seriesArray = _axis.ChartArea.GetXAxesSeries((_axis.axisType == AxisName.X) ? AxisType.Primary : AxisType.Secondary, _axis.SubAxisName);
+ if(seriesArray.Count > 0)
+ {
+ axisSeries = _axis.Common.DataManager.Series[seriesArray[0]];
+ if(axisSeries != null && !axisSeries.IsXValueIndexed)
+ {
+ axisSeries = null;
+ }
+ }
+ }
+
+ // ****************************************************************
+ // This code creates auto interval for auto tick marks and
+ // gridlines. If type is not date there are always four tickmarks
+ // or gridlines between major gridlines and tickmarks. For date
+ // type interval is calculated using CalcInterval function.
+ // ****************************************************************
+ double oldInterval = this.interval;
+ DateTimeIntervalType oldIntervalType = this.intervalType;
+ double oldIntervalOffset = this.intervalOffset;
+ DateTimeIntervalType oldIntervalOffsetType = this.intervalOffsetType;
+ if( !this.majorGridTick && ( this.interval == 0 || double.IsNaN(this.interval) ) )
+ {
+ // Number type
+ if( this._axis.majorGrid.GetIntervalType() == DateTimeIntervalType.Auto )
+ {
+ this.interval = this._axis.majorGrid.GetInterval() / Grid.NumberOfIntervals;
+ }
+ // Date type
+ else
+ {
+ DateTimeIntervalType localIntervalType = this._axis.majorGrid.GetIntervalType();
+ this.interval = _axis.CalcInterval(
+ this._axis.minimum,
+ this._axis.minimum + (this._axis.maximum - this._axis.minimum) / Grid.NumberOfDateTimeIntervals,
+ true,
+ out localIntervalType,
+ ChartValueType.DateTime);
+ this.intervalType = localIntervalType;
+ this.intervalOffsetType = this._axis.majorGrid.GetIntervalOffsetType();
+ this.intervalOffset = this._axis.majorGrid.GetIntervalOffset();
+ }
+ }
+
+ // Current position for grid lines is minimum
+ current = _axis.ViewMinimum;
+
+
+ // ***********************************
+ // Check if the AJAX zooming and scrolling mode is enabled.
+ // ***********************************
+
+ // Adjust start position depending on the interval type
+ if(!_axis.ChartArea.chartAreaIsCurcular ||
+ _axis.axisType == AxisName.Y ||
+ _axis.axisType == AxisName.Y2 )
+ {
+ current = ChartHelper.AlignIntervalStart(current, this.GetInterval(), this.GetIntervalType(), axisSeries, this.majorGridTick);
+ }
+
+ // The Current position is start position, not minimum
+ DateTimeIntervalType offsetType = (GetIntervalOffsetType() == DateTimeIntervalType.Auto) ? GetIntervalType() : GetIntervalOffsetType();
+ if (GetIntervalOffset() != 0 && !double.IsNaN(GetIntervalOffset()) && axisSeries == null)
+ {
+ current += ChartHelper.GetIntervalSize(current, GetIntervalOffset(), offsetType, axisSeries, 0, DateTimeIntervalType.Number, true, false);
+ }
+
+ // Too many gridlines
+ if( ( _axis.ViewMaximum - _axis.ViewMinimum ) / ChartHelper.GetIntervalSize( current, this.GetInterval(), this.GetIntervalType(), axisSeries, 0, DateTimeIntervalType.Number, true ) > ChartHelper.MaxNumOfGridlines )
+ return;
+
+ // If Maximum, minimum and interval don’t have
+ // proper value do not draw grid lines.
+ if( _axis.ViewMaximum <= _axis.ViewMinimum )
+ return;
+
+ if( this.GetInterval() <= 0 )
+ return;
+
+ // Loop for drawing grid lines
+ int counter = 0;
+ int logStep = 1;
+ double oldCurrent = current;
+ decimal viewMaximum = (decimal)_axis.ViewMaximum;
+ while( (decimal)current <= viewMaximum )
+ {
+ // Take an interval between gridlines. Interval
+ // depends on interval type.
+ if( this.majorGridTick || this._axis.IsLogarithmic == false )
+ {
+ double autoInterval = this.GetInterval();
+
+ gridInterval = ChartHelper.GetIntervalSize(current, autoInterval, this.GetIntervalType(), axisSeries, this.GetIntervalOffset(), offsetType, true);
+
+ // Check interval size
+ if (gridInterval == 0)
+ {
+ throw (new InvalidOperationException(SR.ExceptionTickMarksIntervalIsZero));
+ }
+
+ // Draw between min & max values only
+ if((decimal)current >= (decimal)_axis.ViewMinimum)
+ {
+ DrawGrid( graph, current );
+ }
+
+ // Move position
+ current += gridInterval;
+ }
+ // Code for linear minor gridlines and tickmarks
+ // if scale is logarithmic.
+ else
+ {
+ // This code is used only for logarithmic scale and minor tick marks or
+ // gridlines which have linear minor scale in logarithmic major scale.
+ // This code is used to find minimum value for the interval. For example
+ // if logarithmic base is 2 and interval is between 4 and 8; current value
+ // is 5.6; this method will return linearised value for 4. This code works
+ // like Math.Floor for logarithmic scale.
+ double logMinimum = this.GetLogMinimum( current, axisSeries );
+
+ if( oldCurrent != logMinimum )
+ {
+ oldCurrent = logMinimum;
+ logStep = 1;
+ }
+
+ // Find interval for logarithmic linearised scale
+ double logInterval = Math.Log( 1 + this.interval * logStep, _axis.logarithmBase );
+
+ current = oldCurrent;
+
+ // Move position
+ current += logInterval;
+
+ logStep++;
+
+ // Reset current position if major interval is passed.
+ if( this.GetLogMinimum( current, axisSeries ) != logMinimum )
+ {
+ continue;
+ }
+
+ // Check interval size
+ if (logInterval == 0)
+ {
+ throw (new InvalidOperationException(SR.ExceptionTickMarksIntervalIsZero));
+ }
+
+ // Draw between min & max values only
+ if( (decimal)current >= (decimal)_axis.ViewMinimum && (decimal)current <= (decimal)_axis.ViewMaximum )
+ {
+ DrawGrid( graph, current );
+ }
+ }
+
+ // Check if we do not exceed max number of elements
+ if (counter++ > ChartHelper.MaxNumOfGridlines)
+ {
+ break;
+ }
+ }
+
+ // Used for auto interval for auto tick marks and
+ // gridlines
+ if( !this.majorGridTick )
+ {
+ this.interval = oldInterval;
+ this.intervalType = oldIntervalType;
+ this.intervalOffset = oldIntervalOffset;
+ this.intervalOffsetType = oldIntervalOffsetType;
+ }
+ }
+
+ /// <summary>
+ /// This method returns linearized logarithmic value
+ /// which is minimum for range with interval 1.
+ /// </summary>
+ /// <param name="current">Current value</param>
+ /// <param name="axisSeries">First series attached to axis.</param>
+ /// <returns>Returns Minimum for the range which contains current value</returns>
+ private double GetLogMinimum( double current, Series axisSeries )
+ {
+ double viewMinimum = _axis.ViewMinimum;
+ DateTimeIntervalType offsetType = (GetIntervalOffsetType() == DateTimeIntervalType.Auto) ? GetIntervalType() : GetIntervalOffsetType();
+ if( GetIntervalOffset() != 0 && axisSeries == null)
+ {
+ viewMinimum += ChartHelper.GetIntervalSize(viewMinimum, GetIntervalOffset(),
+ offsetType, axisSeries, 0, DateTimeIntervalType.Number, true, false);
+ }
+
+ return viewMinimum + Math.Floor( ( current - viewMinimum ));
+ }
+
+ /// <summary>
+ /// Draw the grid line
+ /// </summary>
+ /// <param name="graph">Chart Graphics object</param>
+ /// <param name="current">Current position of the gridline</param>
+ private void DrawGrid( ChartGraphics graph, double current )
+ {
+ // Common elements
+ CommonElements common = this._axis.Common;
+
+ PointF first = PointF.Empty; // The First point of a grid line
+ PointF second = PointF.Empty; // The Second point of a grid line
+ RectangleF plotArea; // Plot area position
+
+ plotArea = _axis.PlotAreaPosition.ToRectangleF();
+
+ // Horizontal gridlines
+ if( _axis.AxisPosition == AxisPosition.Left || _axis.AxisPosition == AxisPosition.Right )
+ {
+ first.X = plotArea.X;
+ second.X = plotArea.Right;
+ first.Y = (float)_axis.GetLinearPosition( current );
+ second.Y = first.Y;
+ }
+
+ // Vertical gridlines
+ if( _axis.AxisPosition == AxisPosition.Top || _axis.AxisPosition == AxisPosition.Bottom )
+ {
+ first.Y = plotArea.Y;
+ second.Y = plotArea.Bottom;
+ first.X = (float)_axis.GetLinearPosition( current );
+ second.X = first.X;
+ }
+
+ if( common.ProcessModeRegions )
+ {
+ if( this._axis.ChartArea.Area3DStyle.Enable3D && !this._axis.ChartArea.chartAreaIsCurcular)
+ {
+ if(!common.ProcessModePaint) //if ProcessModePaint is true it will be called later
+ graph.Draw3DGridLine(this._axis.ChartArea, borderColor, borderWidth, borderDashStyle, first, second, ( _axis.AxisPosition == AxisPosition.Left || _axis.AxisPosition == AxisPosition.Right ), common, this );
+ }
+ else if(!this._axis.ChartArea.chartAreaIsCurcular)
+ {
+ using (GraphicsPath path = new GraphicsPath())
+ {
+ if (Math.Abs(first.X - second.X) > Math.Abs(first.Y - second.Y))
+ {
+ path.AddLine(first.X, first.Y - 1, second.X, second.Y - 1);
+ path.AddLine(second.X, second.Y + 1, first.X, first.Y + 1);
+ path.CloseAllFigures();
+ }
+ else
+ {
+ path.AddLine(first.X - 1, first.Y, second.X - 1, second.Y);
+ path.AddLine(second.X + 1, second.Y, first.X + 1, first.Y);
+ path.CloseAllFigures();
+
+ }
+ common.HotRegionsList.AddHotRegion(path, true, ChartElementType.Gridlines, this);
+ }
+ }
+ }
+
+ if( common.ProcessModePaint )
+ {
+ // Check if grid lines should be drawn for circular chart area
+ if(_axis.ChartArea.chartAreaIsCurcular)
+ {
+ if(_axis.axisType == AxisName.Y)
+ {
+ _axis.DrawCircularLine( this, graph, borderColor, borderWidth, borderDashStyle, first.Y );
+ }
+ if(_axis.axisType == AxisName.X)
+ {
+ ICircularChartType chartType = this._axis.ChartArea.GetCircularChartType();
+ if(chartType != null && chartType.RadialGridLinesSupported())
+ {
+ _axis.DrawRadialLine( this, graph, borderColor, borderWidth, borderDashStyle, current );
+ }
+ }
+ }
+ else if(!this._axis.ChartArea.Area3DStyle.Enable3D || this._axis.ChartArea.chartAreaIsCurcular)
+ {
+ graph.DrawLineRel( borderColor, borderWidth, borderDashStyle, first, second );
+ }
+ else
+ {
+ graph.Draw3DGridLine( this._axis.ChartArea, borderColor, borderWidth, borderDashStyle, first, second, ( _axis.AxisPosition == AxisPosition.Left || _axis.AxisPosition == AxisPosition.Right ), _axis.Common, this );
+ }
+ }
+ }
+
+ /// <summary>
+ /// Draws custom grid lines from custom labels.
+ /// </summary>
+ /// <param name="graph">Reference to the Chart Graphics object.</param>
+ internal void PaintCustom( ChartGraphics graph )
+ {
+ // Common Elements
+ CommonElements common = this._axis.Common;
+
+ PointF first = PointF.Empty; // The First point of a grid line
+ PointF second = PointF.Empty; // The Second point of a grid line
+ RectangleF plotArea = _axis.PlotAreaPosition.ToRectangleF(); // Plot area position
+
+
+ // Loop through all custom labels
+ foreach(CustomLabel label in _axis.CustomLabels)
+ {
+ if((label.GridTicks & GridTickTypes.Gridline) == GridTickTypes.Gridline)
+ {
+ double position = (label.ToPosition + label.FromPosition) / 2.0;
+ if(position >= _axis.ViewMinimum && position <= _axis.ViewMaximum)
+ {
+ // Horizontal gridlines
+ if( _axis.AxisPosition == AxisPosition.Left || _axis.AxisPosition == AxisPosition.Right )
+ {
+ first.X = plotArea.X;
+ second.X = plotArea.Right;
+ first.Y = (float)_axis.GetLinearPosition( position );
+ second.Y = first.Y;
+
+ }
+
+ // Vertical gridlines
+ if( _axis.AxisPosition == AxisPosition.Top || _axis.AxisPosition == AxisPosition.Bottom )
+ {
+ first.Y = plotArea.Y;
+ second.Y = plotArea.Bottom;
+ first.X = (float)_axis.GetLinearPosition( position );
+ second.X = first.X;
+ }
+
+ if( common.ProcessModeRegions )
+ {
+ if( !this._axis.ChartArea.Area3DStyle.Enable3D || this._axis.ChartArea.chartAreaIsCurcular )
+ {
+ using (GraphicsPath path = new GraphicsPath())
+ {
+
+ if (Math.Abs(first.X - second.X) > Math.Abs(first.Y - second.Y))
+ {
+ path.AddLine(first.X, first.Y - 1, second.X, second.Y - 1);
+ path.AddLine(second.X, second.Y + 1, first.X, first.Y + 1);
+ path.CloseAllFigures();
+ }
+ else
+ {
+ path.AddLine(first.X - 1, first.Y, second.X - 1, second.Y);
+ path.AddLine(second.X + 1, second.Y, first.X + 1, first.Y);
+ path.CloseAllFigures();
+
+ }
+ common.HotRegionsList.AddHotRegion(path, true, ChartElementType.Gridlines, this);
+ }
+ }
+ else
+ {
+ graph.Draw3DGridLine(this._axis.ChartArea, borderColor, borderWidth, borderDashStyle, first, second, ( _axis.AxisPosition == AxisPosition.Left || _axis.AxisPosition == AxisPosition.Right ), common, this );
+ }
+ }
+
+ if( common.ProcessModePaint )
+ {
+ if(!this._axis.ChartArea.Area3DStyle.Enable3D || this._axis.ChartArea.chartAreaIsCurcular)
+ {
+ graph.DrawLineRel( borderColor, borderWidth, borderDashStyle, first, second );
+ }
+ else
+ {
+ graph.Draw3DGridLine(this._axis.ChartArea, borderColor, borderWidth, borderDashStyle, first, second, ( _axis.AxisPosition == AxisPosition.Left || _axis.AxisPosition == AxisPosition.Right ), _axis.Common, this );
+ }
+ }
+ }
+ }
+ }
+ }
+
+ #endregion
+
+ #region Grid properties
+
+ /// <summary>
+ /// Gets or sets grid or tick mark interval offset.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeIntervalOffset3"),
+ TypeConverter(typeof(AxisElementIntervalValueConverter)),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ ]
+ public double IntervalOffset
+ {
+ get
+ {
+ return intervalOffset;
+ }
+ set
+ {
+ intervalOffset = value;
+ intervalOffsetChanged = true;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Determines if Enabled property should be serialized.
+ /// </summary>
+ /// <returns></returns>
+ internal bool ShouldSerializeIntervalOffset()
+ {
+ if (this.majorGridTick)
+ {
+ return !double.IsNaN(intervalOffset);
+ }
+ return intervalOffset != 0d;
+ }
+
+
+ /// <summary>
+ /// Gets the interval offset.
+ /// </summary>
+ /// <returns></returns>
+ internal double GetIntervalOffset()
+ {
+ if(this.majorGridTick && double.IsNaN(intervalOffset) && this._axis != null)
+ {
+
+ return this._axis.IntervalOffset;
+ }
+ return intervalOffset;
+ }
+
+
+ /// <summary>
+ /// Gets or sets the unit of measurement of grid or tick mark offset.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeIntervalOffsetType6"),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public DateTimeIntervalType IntervalOffsetType
+ {
+ get
+ {
+ return intervalOffsetType;
+ }
+ set
+ {
+ intervalOffsetType = value;
+ intervalOffsetTypeChanged = true;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Determines if IntervalOffsetType property should be serialized.
+ /// </summary>
+ /// <returns></returns>
+ internal bool ShouldSerializeIntervalOffsetType()
+ {
+ if (this.majorGridTick)
+ {
+ return intervalOffsetType != DateTimeIntervalType.NotSet;
+ }
+ return intervalOffsetType != DateTimeIntervalType.Auto;
+ }
+
+ /// <summary>
+ /// Gets the type of the interval offset.
+ /// </summary>
+ /// <returns></returns>
+ internal DateTimeIntervalType GetIntervalOffsetType()
+ {
+ if(this.majorGridTick && intervalOffsetType == DateTimeIntervalType.NotSet && this._axis != null)
+ {
+ return this._axis.IntervalOffsetType;
+ }
+ return intervalOffsetType;
+ }
+
+ /// <summary>
+ /// Gets or sets grid or tick mark interval size.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeInterval6"),
+ TypeConverter(typeof(AxisElementIntervalValueConverter)),
+ RefreshProperties(RefreshProperties.All),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public double Interval
+ {
+ get
+ {
+ return interval;
+ }
+ set
+ {
+ // Validation
+ if (value < 0.0)
+ throw (new ArgumentException(SR.ExceptionTickMarksIntervalIsNegative, "value"));
+
+ interval = value;
+ intervalChanged = true;
+
+ // Enable minor elements
+ if (!this.majorGridTick && value != 0.0 && !Double.IsNaN(value))
+ {
+ // Prevent grids enabling during the serialization
+ if (this._axis != null)
+ {
+ if (this._axis.Chart != null && this._axis.Chart.serializing != false)
+ {
+ this.Enabled = true;
+ }
+ }
+ }
+
+ // Reset original property value fields
+ if (this._axis != null)
+ {
+ if (this is TickMark)
+ {
+ if (this.majorGridTick)
+ {
+ this._axis.tempMajorTickMarkInterval = interval;
+ }
+ else
+ {
+ this._axis.tempMinorTickMarkInterval = interval;
+ }
+ }
+ else
+ {
+ if (this.majorGridTick)
+ {
+ this._axis.tempMajorGridInterval = interval;
+ }
+ else
+ {
+ this._axis.tempMinorGridInterval = interval;
+ }
+ }
+ }
+
+ this.Invalidate();
+ }
+
+ }
+
+ /// <summary>
+ /// Determines if IntervalOffsetType property should be serialized.
+ /// </summary>
+ /// <returns></returns>
+ internal bool ShouldSerializeInterval()
+ {
+ if (this.majorGridTick)
+ {
+ return !double.IsNaN(interval);
+ }
+ return interval != 0d;
+ }
+
+ /// <summary>
+ /// Gets the interval.
+ /// </summary>
+ /// <returns></returns>
+ internal double GetInterval()
+ {
+ if(this.majorGridTick && double.IsNaN(interval) && this._axis != null)
+ {
+ return this._axis.Interval;
+ }
+ return interval;
+ }
+
+ /// <summary>
+ /// Gets or sets the unit of measurement of grid or tick mark interval.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeIntervalType3"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ RefreshPropertiesAttribute(RefreshProperties.All)
+ ]
+ public DateTimeIntervalType IntervalType
+ {
+ get
+ {
+ return intervalType;
+ }
+ set
+ {
+ intervalType = value;
+ intervalTypeChanged = true;
+
+ // Reset original property value fields
+ if (this._axis != null)
+ {
+ if (this is TickMark)
+ {
+ this._axis.tempTickMarkIntervalType = intervalType;
+ }
+ else
+ {
+ this._axis.tempGridIntervalType = intervalType;
+ }
+ }
+
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Determines if IntervalOffsetType property should be serialized.
+ /// </summary>
+ /// <returns></returns>
+ internal bool ShouldSerializeIntervalType()
+ {
+ if (this.majorGridTick)
+ {
+ return intervalType != DateTimeIntervalType.NotSet;
+ }
+ return intervalType != DateTimeIntervalType.Auto;
+ }
+
+
+ /// <summary>
+ /// Gets the type of the interval.
+ /// </summary>
+ /// <returns></returns>
+ internal DateTimeIntervalType GetIntervalType()
+ {
+ if(this.majorGridTick && intervalType == DateTimeIntervalType.NotSet && this._axis != null)
+ {
+ // Return default value during serialization
+ return this._axis.IntervalType;
+ }
+ return intervalType;
+ }
+
+ /// <summary>
+ /// Gets or sets grid or tick mark line color.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeLineColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color LineColor
+ {
+ get
+ {
+ return borderColor;
+ }
+ set
+ {
+ borderColor = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets grid or tick mark line style.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartDashStyle.Solid),
+ SRDescription("DescriptionAttributeLineDashStyle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public ChartDashStyle LineDashStyle
+ {
+ get
+ {
+ return borderDashStyle;
+ }
+ set
+ {
+ borderDashStyle = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets grid or tick mark line width.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(1),
+ SRDescription("DescriptionAttributeLineWidth"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public int LineWidth
+ {
+ get
+ {
+ return borderWidth;
+ }
+ set
+ {
+ borderWidth = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag which indicates if the grid or tick mark is enabled.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeEnabled5"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public bool Enabled
+ {
+ get
+ {
+ //// Never serialize this property for minor elements
+ //// "Disabled" property should be serialized instead.
+ //if(this.axis != null && this.axis.IsSerializing())
+ //{
+ // if(!this.majorGridTick)
+ // {
+ // // Return default value to prevent serialization
+ // return true;
+ // }
+ //}
+
+ return enabled;
+ }
+ set
+ {
+ enabled = value;
+ enabledChanged = true;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Determines if Enabled property should be serialized.
+ /// </summary>
+ /// <returns></returns>
+ internal bool ShouldSerializeEnabled()
+ {
+ if (this.majorGridTick)
+ {
+ return !this.Enabled;
+ }
+ return this.Enabled;
+ }
+
+ /// <summary>
+ /// Gets or sets the reference to the Axis object
+ /// </summary>
+ internal Axis Axis
+ {
+ get { return _axis; }
+ set { _axis = value; }
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/IChartRenderingEngine.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/IChartRenderingEngine.cs
new file mode 100644
index 00000000000..967f18c23a6
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/IChartRenderingEngine.cs
@@ -0,0 +1,536 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: IChartRenderingEngine.cs
+//
+// Namespace: DataVisualization.Charting
+//
+// Classes: IChartRenderingEngine, IChartAnimationEngine
+//
+// Purpose: Defines interfaces which must be implemented by
+// every rendering and animation engine class. These
+// interfaces are used in GDI+, SVG and Flash rendering.
+// Note that animation is only available in SVG and
+// Flash rendering engines.
+//
+// Reviwed: AG - Jul 15, 2003
+// AG - MArch 14, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Drawing.Text;
+using System.Drawing.Imaging;
+using System.ComponentModel;
+using System.Collections;
+
+#endregion
+
+#if WINFORMS_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ /// <summary>
+ /// IChartRenderingEngine interface defines a set of methods and properties
+ /// which must be implemented by any chart rendering engine. It contains
+ /// methods for drawing basic shapes.
+ /// </summary>
+ internal interface IChartRenderingEngine
+ {
+ #region Drawing Methods
+
+ /// <summary>
+ /// Draws a line connecting two PointF structures.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the line.</param>
+ /// <param name="pt1">PointF structure that represents the first point to connect.</param>
+ /// <param name="pt2">PointF structure that represents the second point to connect.</param>
+ void DrawLine(
+ Pen pen,
+ PointF pt1,
+ PointF pt2
+ );
+
+ /// <summary>
+ /// Draws a line connecting the two points specified by coordinate pairs.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the line.</param>
+ /// <param name="x1">x-coordinate of the first point.</param>
+ /// <param name="y1">y-coordinate of the first point.</param>
+ /// <param name="x2">x-coordinate of the second point.</param>
+ /// <param name="y2">y-coordinate of the second point.</param>
+ void DrawLine(
+ Pen pen,
+ float x1,
+ float y1,
+ float x2,
+ float y2
+ );
+
+ /// <summary>
+ /// Draws the specified portion of the specified Image object at the specified location and with the specified size.
+ /// </summary>
+ /// <param name="image">Image object to draw.</param>
+ /// <param name="destRect">Rectangle structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle.</param>
+ /// <param name="srcX">x-coordinate of the upper-left corner of the portion of the source image to draw.</param>
+ /// <param name="srcY">y-coordinate of the upper-left corner of the portion of the source image to draw.</param>
+ /// <param name="srcWidth">Width of the portion of the source image to draw.</param>
+ /// <param name="srcHeight">Height of the portion of the source image to draw.</param>
+ /// <param name="srcUnit">Member of the GraphicsUnit enumeration that specifies the units of measure used to determine the source rectangle.</param>
+ /// <param name="imageAttr">ImageAttributes object that specifies recoloring and gamma information for the image object.</param>
+ void DrawImage(
+ System.Drawing.Image image,
+ Rectangle destRect,
+ int srcX,
+ int srcY,
+ int srcWidth,
+ int srcHeight,
+ GraphicsUnit srcUnit,
+ ImageAttributes imageAttr
+ );
+
+ /// <summary>
+ /// Draws an ellipse defined by a bounding rectangle specified by
+ /// a pair of coordinates, a height, and a width.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the ellipse.</param>
+ /// <param name="x">x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.</param>
+ /// <param name="y">y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.</param>
+ /// <param name="width">Width of the bounding rectangle that defines the ellipse.</param>
+ /// <param name="height">Height of the bounding rectangle that defines the ellipse.</param>
+ void DrawEllipse(
+ Pen pen,
+ float x,
+ float y,
+ float width,
+ float height
+ );
+
+ /// <summary>
+ /// Draws a cardinal spline through a specified array of PointF structures
+ /// using a specified tension. The drawing begins offset from
+ /// the beginning of the array.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and height of the curve.</param>
+ /// <param name="points">Array of PointF structures that define the spline.</param>
+ /// <param name="offset">Offset from the first element in the array of the points parameter to the starting point in the curve.</param>
+ /// <param name="numberOfSegments">Number of segments after the starting point to include in the curve.</param>
+ /// <param name="tension">Value greater than or equal to 0.0F that specifies the tension of the curve.</param>
+ void DrawCurve(
+ Pen pen,
+ PointF[] points,
+ int offset,
+ int numberOfSegments,
+ float tension
+ );
+
+ /// <summary>
+ /// Draws a rectangle specified by a coordinate pair, a width, and a height.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the rectangle.</param>
+ /// <param name="x">x-coordinate of the upper-left corner of the rectangle to draw.</param>
+ /// <param name="y">y-coordinate of the upper-left corner of the rectangle to draw.</param>
+ /// <param name="width">Width of the rectangle to draw.</param>
+ /// <param name="height">Height of the rectangle to draw.</param>
+ void DrawRectangle(
+ Pen pen,
+ int x,
+ int y,
+ int width,
+ int height
+ );
+
+ /// <summary>
+ /// Draws a polygon defined by an array of PointF structures.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the polygon.</param>
+ /// <param name="points">Array of PointF structures that represent the vertices of the polygon.</param>
+ void DrawPolygon(
+ Pen pen,
+ PointF[] points
+ );
+
+ /// <summary>
+ /// Draws the specified text string in the specified rectangle with the specified Brush and Font objects using the formatting properties of the specified StringFormat object.
+ /// </summary>
+ /// <param name="s">String to draw.</param>
+ /// <param name="font">Font object that defines the text format of the string.</param>
+ /// <param name="brush">Brush object that determines the color and texture of the drawn text.</param>
+ /// <param name="layoutRectangle">RectangleF structure that specifies the location of the drawn text.</param>
+ /// <param name="format">StringFormat object that specifies formatting properties, such as line spacing and alignment, that are applied to the drawn text.</param>
+ void DrawString(
+ string s,
+ Font font,
+ Brush brush,
+ RectangleF layoutRectangle,
+ StringFormat format
+ );
+
+ /// <summary>
+ /// Draws the specified text string at the specified location with the specified Brush and Font objects using the formatting properties of the specified StringFormat object.
+ /// </summary>
+ /// <param name="s">String to draw.</param>
+ /// <param name="font">Font object that defines the text format of the string.</param>
+ /// <param name="brush">Brush object that determines the color and texture of the drawn text.</param>
+ /// <param name="point">PointF structure that specifies the upper-left corner of the drawn text.</param>
+ /// <param name="format">StringFormat object that specifies formatting properties, such as line spacing and alignment, that are applied to the drawn text.</param>
+ void DrawString(
+ string s,
+ Font font,
+ Brush brush,
+ PointF point,
+ StringFormat format
+ );
+
+ /// <summary>
+ /// Draws the specified portion of the specified Image object at the specified location and with the specified size.
+ /// </summary>
+ /// <param name="image">Image object to draw.</param>
+ /// <param name="destRect">Rectangle structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle.</param>
+ /// <param name="srcX">x-coordinate of the upper-left corner of the portion of the source image to draw.</param>
+ /// <param name="srcY">y-coordinate of the upper-left corner of the portion of the source image to draw.</param>
+ /// <param name="srcWidth">Width of the portion of the source image to draw.</param>
+ /// <param name="srcHeight">Height of the portion of the source image to draw.</param>
+ /// <param name="srcUnit">Member of the GraphicsUnit enumeration that specifies the units of measure used to determine the source rectangle.</param>
+ /// <param name="imageAttrs">ImageAttributes object that specifies recoloring and gamma information for the image object.</param>
+ void DrawImage(
+ System.Drawing.Image image,
+ Rectangle destRect,
+ float srcX,
+ float srcY,
+ float srcWidth,
+ float srcHeight,
+ GraphicsUnit srcUnit,
+ ImageAttributes imageAttrs
+ );
+
+ /// <summary>
+ /// Draws a rectangle specified by a coordinate pair, a width, and a height.
+ /// </summary>
+ /// <param name="pen">A Pen object that determines the color, width, and style of the rectangle.</param>
+ /// <param name="x">The x-coordinate of the upper-left corner of the rectangle to draw.</param>
+ /// <param name="y">The y-coordinate of the upper-left corner of the rectangle to draw.</param>
+ /// <param name="width">The width of the rectangle to draw.</param>
+ /// <param name="height">The height of the rectangle to draw.</param>
+ void DrawRectangle(
+ Pen pen,
+ float x,
+ float y,
+ float width,
+ float height
+ );
+
+ /// <summary>
+ /// Draws a GraphicsPath object.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the path.</param>
+ /// <param name="path">GraphicsPath object to draw.</param>
+ void DrawPath(
+ Pen pen,
+ GraphicsPath path
+ );
+
+ /// <summary>
+ /// Draws a pie shape defined by an ellipse specified by a coordinate pair, a width, and a height and two radial lines.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the pie shape.</param>
+ /// <param name="x">x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie shape comes.</param>
+ /// <param name="y">y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie shape comes.</param>
+ /// <param name="width">Width of the bounding rectangle that defines the ellipse from which the pie shape comes.</param>
+ /// <param name="height">Height of the bounding rectangle that defines the ellipse from which the pie shape comes.</param>
+ /// <param name="startAngle">Angle measured in degrees clockwise from the x-axis to the first side of the pie shape.</param>
+ /// <param name="sweepAngle">Angle measured in degrees clockwise from the startAngle parameter to the second side of the pie shape.</param>
+ void DrawPie(
+ Pen pen,
+ float x,
+ float y,
+ float width,
+ float height,
+ float startAngle,
+ float sweepAngle
+ );
+
+ /// <summary>
+ /// Draws an arc representing a portion of an ellipse specified by a pair of coordinates, a width, and a height.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the arc.</param>
+ /// <param name="x">x-coordinate of the upper-left corner of the rectangle that defines the ellipse.</param>
+ /// <param name="y">y-coordinate of the upper-left corner of the rectangle that defines the ellipse.</param>
+ /// <param name="width">Width of the rectangle that defines the ellipse.</param>
+ /// <param name="height">Height of the rectangle that defines the ellipse.</param>
+ /// <param name="startAngle">Angle in degrees measured clockwise from the x-axis to the starting point of the arc.</param>
+ /// <param name="sweepAngle">Angle in degrees measured clockwise from the startAngle parameter to ending point of the arc.</param>
+ void DrawArc(
+ Pen pen,
+ float x,
+ float y,
+ float width,
+ float height,
+ float startAngle,
+ float sweepAngle
+ );
+
+ /// <summary>
+ /// Draws the specified Image object at the specified location and with the specified size.
+ /// </summary>
+ /// <param name="image">Image object to draw.</param>
+ /// <param name="rect">RectangleF structure that specifies the location and size of the drawn image.</param>
+ void DrawImage(
+ System.Drawing.Image image,
+ RectangleF rect
+ );
+
+ /// <summary>
+ /// Draws an ellipse defined by a bounding RectangleF.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the ellipse.</param>
+ /// <param name="rect">RectangleF structure that defines the boundaries of the ellipse.</param>
+ void DrawEllipse(
+ Pen pen,
+ RectangleF rect
+ );
+
+ /// <summary>
+ /// Draws a series of line segments that connect an array of PointF structures.
+ /// </summary>
+ /// <param name="pen">Pen object that determines the color, width, and style of the line segments.</param>
+ /// <param name="points">Array of PointF structures that represent the points to connect.</param>
+ void DrawLines(
+ Pen pen,
+ PointF[] points
+ );
+
+ #endregion // Drawing Methods
+
+ #region Filling Methods
+
+ /// <summary>
+ /// Fills the interior of an ellipse defined by a bounding rectangle
+ /// specified by a RectangleF structure.
+ /// </summary>
+ /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
+ /// <param name="rect">RectangleF structure that represents the bounding rectangle that defines the ellipse.</param>
+ void FillEllipse(
+ Brush brush,
+ RectangleF rect
+ );
+
+ /// <summary>
+ /// Fills the interior of a GraphicsPath object.
+ /// </summary>
+ /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
+ /// <param name="path">GraphicsPath object that represents the path to fill.</param>
+ void FillPath(
+ Brush brush,
+ GraphicsPath path
+ );
+
+ /// <summary>
+ /// Fills the interior of a Region object.
+ /// </summary>
+ /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
+ /// <param name="region">Region object that represents the area to fill.</param>
+ void FillRegion(
+ Brush brush,
+ Region region
+ );
+
+ /// <summary>
+ /// Fills the interior of a rectangle specified by a RectangleF structure.
+ /// </summary>
+ /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
+ /// <param name="rect">RectangleF structure that represents the rectangle to fill.</param>
+ void FillRectangle(
+ Brush brush,
+ RectangleF rect
+ );
+
+ /// <summary>
+ /// Fills the interior of a rectangle specified by a pair of coordinates, a width, and a height.
+ /// </summary>
+ /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
+ /// <param name="x">x-coordinate of the upper-left corner of the rectangle to fill.</param>
+ /// <param name="y">y-coordinate of the upper-left corner of the rectangle to fill.</param>
+ /// <param name="width">Width of the rectangle to fill.</param>
+ /// <param name="height">Height of the rectangle to fill.</param>
+ void FillRectangle(
+ Brush brush,
+ float x,
+ float y,
+ float width,
+ float height
+ );
+
+ /// <summary>
+ /// Fills the interior of a polygon defined by an array of points specified by PointF structures .
+ /// </summary>
+ /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
+ /// <param name="points">Array of PointF structures that represent the vertices of the polygon to fill.</param>
+ void FillPolygon(
+ Brush brush,
+ PointF[] points
+ );
+
+ /// <summary>
+ /// Fills the interior of a pie section defined by an ellipse
+ /// specified by a pair of coordinates, a width, and a height
+ /// and two radial lines.
+ /// </summary>
+ /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
+ /// <param name="x">x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes.</param>
+ /// <param name="y">y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes.</param>
+ /// <param name="width">Width of the bounding rectangle that defines the ellipse from which the pie section comes.</param>
+ /// <param name="height">Height of the bounding rectangle that defines the ellipse from which the pie section comes.</param>
+ /// <param name="startAngle">Angle in degrees measured clockwise from the x-axis to the first side of the pie section.</param>
+ /// <param name="sweepAngle">Angle in degrees measured clockwise from the startAngle parameter to the second side of the pie section.</param>
+ void FillPie(
+ Brush brush,
+ float x,
+ float y,
+ float width,
+ float height,
+ float startAngle,
+ float sweepAngle
+ );
+
+ #endregion // Filling Methods
+
+ #region Other Methods
+
+ /// <summary>
+ /// Measures the specified string when drawn with the specified
+ /// Font object and formatted with the specified StringFormat object.
+ /// </summary>
+ /// <param name="text">String to measure.</param>
+ /// <param name="font">Font object defines the text format of the string.</param>
+ /// <param name="layoutArea">SizeF structure that specifies the maximum layout area for the text.</param>
+ /// <param name="stringFormat">StringFormat object that represents formatting information, such as line spacing, for the string.</param>
+ /// <returns>This method returns a SizeF structure that represents the size, in pixels, of the string specified in the text parameter as drawn with the font parameter and the stringFormat parameter.</returns>
+ SizeF MeasureString(
+ string text,
+ Font font,
+ SizeF layoutArea,
+ StringFormat stringFormat
+ );
+
+ /// <summary>
+ /// Measures the specified string when drawn with the specified
+ /// Font object and formatted with the specified StringFormat object.
+ /// </summary>
+ /// <param name="text">String to measure.</param>
+ /// <param name="font">Font object defines the text format of the string.</param>
+ /// <returns>This method returns a SizeF structure that represents the size, in pixels, of the string specified in the text parameter as drawn with the font parameter and the stringFormat parameter.</returns>
+ SizeF MeasureString(
+ string text,
+ Font font
+ );
+
+ /// <summary>
+ /// Saves the current state of this Graphics object and identifies the saved state with a GraphicsState object.
+ /// </summary>
+ /// <returns>This method returns a GraphicsState object that represents the saved state of this Graphics object.</returns>
+ GraphicsState Save();
+
+ /// <summary>
+ /// Restores the saved state of graphics object.
+ /// </summary>
+ /// <param name="gstate">State to restore.</param>
+ void Restore(
+ GraphicsState gstate
+ );
+
+ /// <summary>
+ /// Resets the clip region of this Graphics object to an infinite region.
+ /// </summary>
+ void ResetClip();
+
+ /// <summary>
+ /// Sets the clipping region of this Graphics object to the rectangle specified by a RectangleF structure.
+ /// </summary>
+ /// <param name="rect">RectangleF structure that represents the new clip region.</param>
+ void SetClip(
+ RectangleF rect
+ );
+
+ /// <summary>
+ /// Sets the clipping region of this Graphics object to the result of the
+ /// specified operation combining the current clip region and the
+ /// specified GraphicsPath object.
+ /// </summary>
+ /// <param name="path">GraphicsPath object to combine.</param>
+ /// <param name="combineMode">Member of the CombineMode enumeration that specifies the combining operation to use.</param>
+ void SetClip(
+ GraphicsPath path,
+ CombineMode combineMode
+ );
+
+ /// <summary>
+ /// Prepends the specified translation to the transformation matrix of this Graphics object.
+ /// </summary>
+ /// <param name="dx">x component of the translation.</param>
+ /// <param name="dy">y component of the translation.</param>
+ void TranslateTransform(
+ float dx,
+ float dy
+ );
+
+ /// <summary>
+ /// This method starts Selection mode
+ /// </summary>
+ /// <param name="hRef">The location of the referenced object, expressed as a URI reference.</param>
+ /// <param name="title">Title which could be used for tooltips.</param>
+ void BeginSelection( string hRef, string title );
+
+ /// <summary>
+ /// This method stops Selection mode
+ /// </summary>
+ void EndSelection( );
+
+ #endregion // Other Methods
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets the world transformation for this Graphics object.
+ /// </summary>
+ Matrix Transform {get; set;}
+
+ /// <summary>
+ /// Gets or sets the rendering quality for this Graphics object.
+ /// </summary>
+ SmoothingMode SmoothingMode {get; set;}
+
+ /// <summary>
+ /// Gets or sets the rendering mode for text associated with this Graphics object.
+ /// </summary>
+ TextRenderingHint TextRenderingHint {get; set;}
+
+ /// <summary>
+ /// Gets or sets a Region object that limits the drawing region of this Graphics object.
+ /// </summary>
+ Region Clip {get; set;}
+
+ /// <summary>
+ /// Reference to the Graphics object
+ /// </summary>
+ Graphics Graphics {get; set;}
+
+ /// <summary>
+ /// Gets a value indicating whether the clipping region of this Graphics object is empty.
+ /// </summary>
+ bool IsClipEmpty {get;}
+
+ #endregion // Properties
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ImageMap.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ImageMap.cs
new file mode 100644
index 00000000000..34847941aa0
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/ImageMap.cs
@@ -0,0 +1,891 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: ImageMap.cs
+//
+// Namespace: DataVisualization.Charting
+//
+// Classes: MapArea, MapAreasCollection
+//
+// Purpose: Collection of MapArea classes is used to generate
+// Chart image map, which provides functionality like
+// tooltip, drilldown and client-side scripting.
+//
+// Reviewed: AG - Jul 31, 2002
+// AG - Microsoft 14, 2007
+//
+//===================================================================
+
+
+#region Used namespaces
+
+using System;
+using System.Text;
+using System.Collections;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Drawing.Design;
+using System.Collections.ObjectModel;
+using System.Diagnostics.CodeAnalysis;
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+
+#else
+ using System.Web;
+ using System.Web.UI;
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+using System.Text.RegularExpressions;
+using System.IO;
+
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+
+ namespace System.Windows.Forms.DataVisualization.Charting
+
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+
+#if ! Microsoft_CONTROL
+
+ #region Map area shape enumeration
+
+ /// <summary>
+ /// An enumeration of map areas shapes.
+ /// </summary>
+ public enum MapAreaShape
+ {
+ /// <summary>
+ /// The shape of the map area is rectangular.
+ /// </summary>
+ Rectangle,
+
+ /// <summary>
+ /// The shape of the map area is circular.
+ /// </summary>
+ Circle,
+
+ /// <summary>
+ /// The shape of the map area is polygonal.
+ /// </summary>
+ Polygon
+ }
+
+
+ #endregion
+
+ #region IMapArea interface defenition
+
+ /// <summary>
+ /// Interface which defines common properties for the map area
+ /// </summary>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public interface IChartMapArea
+ {
+ /// <summary>
+ /// Map area tooltip
+ /// </summary>
+ /// <value>The tooltip.</value>
+ string ToolTip
+ {
+ set; get;
+ }
+ /// <summary>
+ /// Map area Href
+ /// </summary>
+ /// <value>The map area Href.</value>
+ [SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")]
+ string Url
+ {
+ set; get;
+ }
+ /// <summary>
+ /// Map area other custom attributes
+ /// </summary>
+ /// <value>The map area attributes.</value>
+ string MapAreaAttributes
+ {
+ set; get;
+ }
+
+ /// <summary>
+ /// Map area custom data
+ /// </summary>
+ /// <value>The tag.</value>
+ object Tag
+ {
+ set;
+ get;
+ }
+
+ /// <summary>
+ /// Map area post back value.
+ /// </summary>
+ /// <value>The post back value.</value>
+ string PostBackValue { get; set; }
+ }
+
+ #endregion
+
+ /// <summary>
+ /// The MapArea class represents an area of the chart with end-user
+ /// interactivity like tooltip, HREF or custom attributes.
+ /// </summary>
+ [
+ DefaultProperty("ToolTip"),
+ SRDescription("DescriptionAttributeMapArea_MapArea")
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class MapArea : ChartNamedElement, IChartMapArea
+ {
+
+ #region Member variables
+
+ private string _toolTip = String.Empty;
+ private string _url = String.Empty;
+ private string _attributes = String.Empty;
+ private string _postBackValue = String.Empty;
+ private bool _isCustom = true;
+ private MapAreaShape _shape = MapAreaShape.Rectangle;
+ private float[] _coordinates = new float[4];
+ private static Regex _mapAttributesRegex;
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MapArea"/> class.
+ /// </summary>
+ public MapArea()
+ : base()
+ {
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MapArea"/> class.
+ /// </summary>
+ /// <param name="url">The destination URL or anchor point of the map area.</param>
+ /// <param name="path">A GraphicsPath object that defines the shape of the map area.</param>
+ [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", MessageId = "0#")]
+ public MapArea(string url, GraphicsPath path)
+ : this(String.Empty, url, String.Empty, String.Empty, path, null)
+ {
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MapArea"/> class.
+ /// </summary>
+ /// <param name="url">The destination URL or anchor point of the map area.</param>
+ /// <param name="rect">A RectangleF structure that defines shape of the rectangular map area.</param>
+ [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", MessageId = "0#")]
+ public MapArea(string url, RectangleF rect)
+ : this(String.Empty, url, String.Empty, String.Empty, rect, null)
+ {
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MapArea"/> class.
+ /// </summary>
+ /// <param name="shape">Area shape.</param>
+ /// <param name="url">The destination URL or anchor point of the map area.</param>
+ /// <param name="coordinates">Coordinates array that determines the location of the circle, rectangle or polygon.
+ /// The type of shape that is being used determines the type of coordinates required.</param>
+ [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", MessageId = "1#")]
+ public MapArea(MapAreaShape shape, string url, float[] coordinates)
+ : this(shape, String.Empty, url, String.Empty, String.Empty, coordinates, null)
+ {
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MapArea"/> class.
+ /// </summary>
+ /// <param name="toolTip">Tool tip.</param>
+ /// <param name="url">Jump URL.</param>
+ /// <param name="attributes">Other area attributes.</param>
+ /// <param name="postBackValue">The postback value.</param>
+ /// <param name="path">Area coordinates as graphic path</param>
+ /// <param name="tag">The tag.</param>
+ [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", MessageId = "1#")]
+ public MapArea(string toolTip, string url, string attributes, string postBackValue, GraphicsPath path, object tag)
+ : base()
+ {
+ if(path.PointCount == 0)
+ {
+ throw new ArgumentException(SR.ExceptionImageMapPolygonShapeInvalid);
+ }
+
+ // Flatten all curved lines
+ path.Flatten();
+
+ // Allocate array of floats
+ PointF[] pathPoints = path.PathPoints;
+ float[] coord = new float[pathPoints.Length * 2];
+
+ // Transfer path points
+ int index = 0;
+ foreach(PointF point in pathPoints)
+ {
+ coord[index++] = point.X;
+ coord[index++] = point.Y;
+ }
+
+ // Initiazize area
+ Initialize(MapAreaShape.Polygon, toolTip, url, attributes, postBackValue, coord, tag);
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MapArea"/> class.
+ /// </summary>
+ /// <param name="toolTip">Tool tip.</param>
+ /// <param name="url">Jump URL.</param>
+ /// <param name="attributes">Other area attributes.</param>
+ /// <param name="postBackValue">The postback value.</param>
+ /// <param name="rect">Rect coordinates</param>
+ /// <param name="tag">The tag.</param>
+ [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", MessageId = "1#")]
+ public MapArea(string toolTip, string url, string attributes, string postBackValue, RectangleF rect, object tag)
+ : base()
+ {
+ float[] coord = new float[4];
+ coord[0] = rect.X;
+ coord[1] = rect.Y;
+ coord[2] = rect.Right;
+ coord[3] = rect.Bottom;
+
+ Initialize(MapAreaShape.Rectangle, toolTip, url, attributes, postBackValue, coord, tag);
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MapArea"/> class.
+ /// </summary>
+ /// <param name="shape">The shape.</param>
+ /// <param name="toolTip">The tool tip.</param>
+ /// <param name="url">The URL.</param>
+ /// <param name="attributes">The attributes.</param>
+ /// <param name="postBackValue">The postback value.</param>
+ /// <param name="coordinates">The coordinates.</param>
+ /// <param name="tag">The tag.</param>
+ [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", MessageId = "2#")]
+ public MapArea(MapAreaShape shape, string toolTip, string url, string attributes, string postBackValue, float[] coordinates, object tag)
+ : base()
+ {
+ Initialize(shape, toolTip, url, attributes, postBackValue, coordinates, tag);
+ }
+
+
+ private void Initialize(MapAreaShape shape, string toolTip, string url, string attributes, string postBackValue, float[] coordinates, object tag)
+ {
+ // Check number of coordinates depending on the area shape
+ if (shape == MapAreaShape.Circle && coordinates.Length != 3)
+ {
+ throw (new InvalidOperationException(SR.ExceptionImageMapCircleShapeInvalid));
+ }
+ if (shape == MapAreaShape.Rectangle && coordinates.Length != 4)
+ {
+ throw (new InvalidOperationException(SR.ExceptionImageMapRectangleShapeInvalid));
+ }
+ if (shape == MapAreaShape.Polygon && (coordinates.Length % 2f) != 0f)
+ {
+ throw (new InvalidOperationException(SR.ExceptionImageMapPolygonShapeInvalid));
+ }
+
+ // Create new area object
+ this._toolTip = toolTip;
+ this._url = url;
+ this._attributes = attributes;
+ this._shape = shape;
+ this._coordinates = new float[coordinates.Length];
+ this._postBackValue = postBackValue;
+ this.Tag = tag;
+ coordinates.CopyTo(this._coordinates, 0);
+ }
+ #endregion
+
+ #region Map area HTML tag generation methods
+
+ /// <summary>
+ /// Gets the name of the shape.
+ /// </summary>
+ /// <returns></returns>
+ private string GetShapeName()
+ {
+ //*****************************************
+ //** Set shape type
+ //*****************************************
+ if (_shape == MapAreaShape.Circle)
+ {
+ return "circle";
+ }
+ else if (_shape == MapAreaShape.Rectangle)
+ {
+ return "rect";
+ }
+ else if (_shape == MapAreaShape.Polygon)
+ {
+ return "poly";
+ }
+ return String.Empty;
+ }
+
+
+ /// <summary>
+ /// Gets the coordinates.
+ /// </summary>
+ /// <param name="graph">The graph.</param>
+ /// <returns></returns>
+ private string GetCoordinates(ChartGraphics graph)
+ {
+ // Transform coordinates from relative to pixels
+ float[] transformedCoord = new float[this.Coordinates.Length];
+ if (this.Shape == MapAreaShape.Circle)
+ {
+ PointF p = graph.GetAbsolutePoint(new PointF(this.Coordinates[0], this.Coordinates[1]));
+ transformedCoord[0] = p.X;
+ transformedCoord[1] = p.Y;
+ p = graph.GetAbsolutePoint(new PointF(this.Coordinates[2], this.Coordinates[1]));
+ transformedCoord[2] = p.X;
+ }
+ else if (this.Shape == MapAreaShape.Rectangle)
+ {
+ PointF p = graph.GetAbsolutePoint(new PointF(this.Coordinates[0], this.Coordinates[1]));
+ transformedCoord[0] = p.X;
+ transformedCoord[1] = p.Y;
+ p = graph.GetAbsolutePoint(new PointF(this.Coordinates[2], this.Coordinates[3]));
+ transformedCoord[2] = p.X;
+ transformedCoord[3] = p.Y;
+
+ // Check if rectangle has width and height
+ if ((int)Math.Round(transformedCoord[0]) == (int)Math.Round(transformedCoord[2]))
+ {
+ transformedCoord[2] = (float)Math.Round(transformedCoord[2]) + 1;
+ }
+ if ((int)Math.Round(transformedCoord[1]) == (int)Math.Round(transformedCoord[3]))
+ {
+ transformedCoord[3] = (float)Math.Round(transformedCoord[3]) + 1;
+ }
+ }
+ else
+ {
+ PointF pConverted = Point.Empty;
+ PointF pOriginal = Point.Empty;
+ for (int index = 0; index < this.Coordinates.Length - 1; index += 2)
+ {
+ pOriginal.X = this.Coordinates[index];
+ pOriginal.Y = this.Coordinates[index + 1];
+ pConverted = graph.GetAbsolutePoint(pOriginal);
+ transformedCoord[index] = pConverted.X;
+ transformedCoord[index + 1] = pConverted.Y;
+ }
+ }
+
+ StringBuilder tagStringBuilder = new StringBuilder();
+ // Store transformed coordinates in the string
+ bool firstElement = true;
+ foreach (float f in transformedCoord)
+ {
+ if (!firstElement)
+ {
+ tagStringBuilder.Append(",");
+ }
+ firstElement = false;
+ tagStringBuilder.Append((int)Math.Round(f));
+ }
+
+ return tagStringBuilder.ToString();
+ }
+
+ private static bool IsJavaScript(string value)
+ {
+ string checkValue = value.Trim().Replace("\r", String.Empty).Replace("\n", String.Empty);
+ if (checkValue.StartsWith("javascript:", StringComparison.OrdinalIgnoreCase))
+ {
+ return true;
+ }
+ return false;
+ }
+
+
+ /// <summary>
+ /// Encodes the value.
+ /// </summary>
+ /// <param name="chart">The chart.</param>
+ /// <param name="name">The name.</param>
+ /// <param name="value">The value.</param>
+ /// <returns></returns>
+ private static string EncodeValue(Chart chart, string name, string value)
+ {
+ if (chart.IsMapAreaAttributesEncoded)
+ {
+ if (IsJavaScript(value) ||
+ name.Trim().StartsWith("on", StringComparison.OrdinalIgnoreCase))
+ {
+ return HttpUtility.UrlEncode(value);
+ }
+ }
+ return value;
+ }
+
+ /// <summary>
+ /// Renders the tag.
+ /// </summary>
+ /// <param name="writer">The writer.</param>
+ /// <param name="chart">The chart.</param>
+ [SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification="We use lower case to generate html attributes.")]
+ internal void RenderTag(HtmlTextWriter writer, Chart chart)
+ {
+ StringBuilder excludedAttributes = new StringBuilder();
+
+ writer.WriteLine();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Shape, this.GetShapeName(), false);
+ writer.AddAttribute(HtmlTextWriterAttribute.Coords, this.GetCoordinates(chart.chartPicture.ChartGraph));
+
+ if (!String.IsNullOrEmpty(this.ToolTip))
+ {
+ excludedAttributes.Append("title,");
+ writer.AddAttribute(HtmlTextWriterAttribute.Title, EncodeValue(chart, "title", this.ToolTip));
+ }
+
+ bool postbackRendered = false;
+ if (!String.IsNullOrEmpty(this.Url))
+ {
+ excludedAttributes.Append("href,");
+ string resolvedUrl = chart.ResolveClientUrl(this.Url);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, EncodeValue(chart, "href", resolvedUrl));
+ }
+ else if (!String.IsNullOrEmpty(this.PostBackValue) && chart.Page != null)
+ {
+ postbackRendered = true;
+ excludedAttributes.Append("href,");
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, chart.Page.ClientScript.GetPostBackClientHyperlink(chart, this.PostBackValue));
+ }
+
+ if (!postbackRendered && !String.IsNullOrEmpty(this.PostBackValue) && chart.Page != null)
+ {
+ excludedAttributes.Append("onclick,");
+ writer.AddAttribute(HtmlTextWriterAttribute.Onclick, chart.Page.ClientScript.GetPostBackEventReference(chart, this.PostBackValue));
+ }
+
+ if (!String.IsNullOrEmpty(this._attributes))
+ {
+ string excludedAttr = excludedAttributes.ToString();
+
+ // matches name1="value1" name2="value2", don't match name1="val"ue1" or name1="value1" />
+ if (_mapAttributesRegex == null)
+ {
+ _mapAttributesRegex = new Regex(@"\s?(?<name>(\w+))\s?=\s?""(?<value>[^""]+)""\s?", RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled);
+ }
+
+ foreach (Match match in _mapAttributesRegex.Matches(this._attributes))
+ {
+ Group names = match.Groups["name"];
+ Group values = match.Groups["value"];
+ for (int i = 0; i < names.Captures.Count || i < values.Captures.Count; i++)
+ {
+ string name = names.Captures[i].Value.ToLowerInvariant();
+ string value = values.Captures[i].Value;
+
+ // skip already rendered attributes
+ if (!excludedAttr.Contains(name + ","))
+ {
+ // is it url?
+ if ("src,href,longdesc,background,".Contains(name + ",") && !IsJavaScript(value))
+ {
+ value = chart.ResolveClientUrl(value);
+ }
+ else
+ {
+ value = HttpUtility.HtmlAttributeEncode(value);
+ }
+ value = EncodeValue(chart, name, value);
+ writer.AddAttribute(name, value, false);
+ }
+ }
+ }
+ }
+
+ if (this._attributes.IndexOf(" alt=", StringComparison.OrdinalIgnoreCase) == -1)
+ {
+ if (!String.IsNullOrEmpty(this.ToolTip))
+ {
+ writer.AddAttribute(HtmlTextWriterAttribute.Alt, EncodeValue(chart, "title", this.ToolTip));
+ }
+ else
+ {
+ writer.AddAttribute(HtmlTextWriterAttribute.Alt, "");
+ }
+ }
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Area);
+ writer.RenderEndTag();
+ }
+
+ #endregion
+
+ #region MapArea Properties
+
+ /// <summary>
+ /// Gets or sets a flag which indicates whether the map area is custom.
+ /// </summary>
+ [
+ Browsable(false),
+ SRDescription("DescriptionAttributeMapArea_Custom"),
+ DefaultValue(""),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden)
+ ]
+ public bool IsCustom
+ {
+ get
+ {
+ return _isCustom;
+ }
+ internal set
+ {
+ _isCustom = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the coordinates of of the map area.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeShape"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeMapArea_Coordinates"),
+ DefaultValue(""),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ TypeConverter(typeof(MapAreaCoordinatesConverter))
+ ]
+ [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
+ public float[] Coordinates
+ {
+ get
+ {
+ return _coordinates;
+ }
+ set
+ {
+ _coordinates = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the shape of the map area.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeShape"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeMapArea_Shape"),
+ DefaultValue(typeof(MapAreaShape), "Rectangle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public MapAreaShape Shape
+ {
+ get
+ {
+ return _shape;
+ }
+ set
+ {
+ _shape = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the name of the map area.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ SRDescription("DescriptionAttributeMapArea_Name"),
+ DefaultValue("Map Area"),
+ Browsable(false),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden)
+ ]
+ public override string Name
+ {
+ get
+ {
+ return base.Name;
+ }
+ set
+ {
+ base.Name = value;
+ }
+ }
+ #endregion
+
+ #region IMapAreaAttributesutes Properties implementation
+
+ /// <summary>
+ /// Gets or sets the tooltip of the map area.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeMapArea"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeToolTip"),
+ DefaultValue(""),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+#endif
+ ]
+ public string ToolTip
+ {
+ set
+ {
+ _toolTip = value;
+ }
+ get
+ {
+ return _toolTip;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the URL of the map area.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMapArea"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeUrl"),
+ DefaultValue(""),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ Editor(Editors.UrlValueEditor.Editor, Editors.UrlValueEditor.Base)
+#endif
+ ]
+ public string Url
+ {
+ set
+ {
+ _url = value;
+ }
+ get
+ {
+ return _url;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the attributes of the map area.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMapArea"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeMapAreaAttributes"),
+ DefaultValue(""),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+#endif
+ ]
+ public string MapAreaAttributes
+ {
+ set
+ {
+ _attributes = value;
+ }
+ get
+ {
+ return _attributes;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the postback value which can be processed on click event.
+ /// </summary>
+ /// <value>The value which is passed to click event as argument.</value>
+ [DefaultValue("")]
+ [SRCategory(SR.Keys.CategoryAttributeMapArea)]
+ [SRDescription(SR.Keys.DescriptionAttributePostBackValue)]
+ public string PostBackValue
+ {
+ get
+ {
+ return this._postBackValue;
+ }
+ set
+ {
+ this._postBackValue = value;
+ }
+ }
+
+
+ #endregion
+
+ }
+
+
+ /// <summary>
+ /// The MapAreasCollection class is a strongly typed collection of MapAreas.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeMapAreasCollection_MapAreasCollection")
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class MapAreasCollection : ChartElementCollection<MapArea>
+ {
+
+ #region Constructors
+
+ /// <summary>
+ /// Public constructor.
+ /// </summary>
+ public MapAreasCollection()
+ : base(null)
+ {
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Insert new map area items into the collection.
+ /// </summary>
+ /// <param name="index">Index to insert at.</param>
+ /// <param name="toolTip">Tool tip.</param>
+ /// <param name="url">Jump URL.</param>
+ /// <param name="attributes">Other area attributes.</param>
+ /// <param name="postBackValue">The post back value associated with this item.</param>
+ /// <param name="path">Area coordinates as graphics path.</param>
+ /// <param name="absCoordinates">Absolute coordinates in the graphics path.</param>
+ /// <param name="graph">Chart graphics object.</param>
+ internal void InsertPath(
+ int index,
+ string toolTip,
+ string url,
+ string attributes,
+ string postBackValue,
+ GraphicsPath path,
+ bool absCoordinates,
+ ChartGraphics graph)
+ {
+
+ // If there is more then one graphical path split them and create
+ // image maps for every graphical path separately.
+ GraphicsPathIterator iterator = new GraphicsPathIterator(path);
+
+ // There is more then one path.
+ if( iterator.SubpathCount > 1 )
+ {
+ GraphicsPath subPath = new GraphicsPath();
+ while(iterator.NextMarker(subPath) > 0)
+ {
+ InsertSubpath(index, toolTip, url, attributes, postBackValue, subPath, absCoordinates, graph);
+ subPath.Reset();
+ }
+ }
+ // There is only one path
+ else
+ {
+ InsertSubpath(index, toolTip, url, attributes, postBackValue, path, absCoordinates, graph);
+ }
+ }
+
+ /// <summary>
+ /// Insert new map area item into the collection.
+ /// </summary>
+ /// <param name="index">Index to insert at.</param>
+ /// <param name="toolTip">Tool tip.</param>
+ /// <param name="url">Jump URL.</param>
+ /// <param name="attributes">Other area attributes.</param>
+ /// <param name="postBackValue">The post back value associated with this item.</param>
+ /// <param name="path">Area coordinates as graphics path.</param>
+ /// <param name="absCoordinates">Absolute coordinates in the graphics path.</param>
+ /// <param name="graph">Chart graphics object.</param>
+ private void InsertSubpath(
+ int index,
+ string toolTip,
+ string url,
+ string attributes,
+ string postBackValue,
+ GraphicsPath path,
+ bool absCoordinates,
+ ChartGraphics graph)
+ {
+ if(path.PointCount > 0)
+ {
+ // Flatten all curved lines
+ path.Flatten();
+
+ // Allocate array of floats
+ PointF[] pathPoints = path.PathPoints;
+ float[] coord = new float[pathPoints.Length * 2];
+
+ // Convert absolute coordinates to relative
+ if(absCoordinates)
+ {
+ for(int pointIndex = 0; pointIndex < pathPoints.Length; pointIndex++)
+ {
+ pathPoints[pointIndex] = graph.GetRelativePoint( pathPoints[pointIndex] );
+ }
+ }
+
+ // Transfer path points
+ int i = 0;
+ foreach(PointF point in pathPoints)
+ {
+ coord[i++] = point.X;
+ coord[i++] = point.Y;
+ }
+
+ // Add new area
+ MapArea area = new MapArea(MapAreaShape.Polygon, toolTip, url, attributes, postBackValue, coord, null);
+ area.IsCustom = false;
+ this.Insert(index, area);
+ }
+ }
+
+ /// <summary>
+ /// Removes all non custom map areas items from the collection.
+ /// </summary>
+ internal void RemoveNonCustom()
+ {
+ for(int index = 0; index < this.Count; index++)
+ {
+ // Check the custom flag
+ if(!this[index].IsCustom)
+ {
+ this.RemoveAt(index);
+ --index;
+ }
+ }
+ }
+
+ #endregion
+ }
+
+#endif
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Label.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Label.cs
new file mode 100644
index 00000000000..005ded256b6
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Label.cs
@@ -0,0 +1,3002 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: LabelStyle.cs
+//
+// Namespace: DataVisualization.Charting
+//
+// Classes: CustomLabelsCollection, CustomLabel, LabelStyle
+//
+// Purpose: LabelStyle and CustomLabel classes are used to determine
+// chart axis labels. Labels can be automatically
+// generated based on the series data or be “manually”
+// set by the user.
+//
+// Reviewed: AG - Jul 31, 2002
+// AG - Microsoft 14, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Drawing2D;
+using System.Drawing.Text;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Globalization;
+ using System.ComponentModel.Design.Serialization;
+ using System.Reflection;
+#else
+ using System.Web;
+ using System.Web.UI;
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+ namespace System.Web.UI.DataVisualization.Charting
+#endif
+{
+ #region Labels enumerations
+
+ /// <summary>
+ /// An enumeration that specifies a mark for custom labels.
+ /// </summary>
+ public enum LabelMarkStyle
+ {
+ /// <summary>
+ /// No label marks are used.
+ /// </summary>
+ None,
+
+ /// <summary>
+ /// Labels use side marks.
+ /// </summary>
+ SideMark,
+
+ /// <summary>
+ /// Labels use line and side marks.
+ /// </summary>
+ LineSideMark,
+
+
+ /// <summary>
+ /// Draws a box around the label. The box always starts at the axis position.
+ /// </summary>
+ Box
+ };
+
+
+ /// <summary>
+ /// An enumeration of custom grid lines and tick marks flags used in the custom labels.
+ /// </summary>
+ [Flags]
+ public enum GridTickTypes
+ {
+ /// <summary>
+ /// No tick mark or grid line are shown.
+ /// </summary>
+ None = 0,
+
+ /// <summary>
+ /// Tick mark is shown.
+ /// </summary>
+ TickMark = 1,
+
+ /// <summary>
+ /// Grid line is shown.
+ /// </summary>
+ Gridline = 2,
+
+ /// <summary>
+ /// Tick mark and grid line are shown.
+ /// </summary>
+ All = TickMark | Gridline
+ }
+
+
+ /// <summary>
+ /// An enumeration of label styles for circular chart area axis.
+ /// </summary>
+ internal enum CircularAxisLabelsStyle
+ {
+ /// <summary>
+ /// Style depends on number of labels.
+ /// </summary>
+ Auto,
+
+ /// <summary>
+ /// Label text positions around the circular area.
+ /// </summary>
+ Circular,
+
+ /// <summary>
+ /// Label text is always horizontal.
+ /// </summary>
+ Horizontal,
+
+ /// <summary>
+ /// Label text has the same angle as circular axis.
+ /// </summary>
+ Radial
+ }
+ #endregion
+
+ /// <summary>
+ /// The CustomLabelsCollection class is a strongly typed collection of
+ /// custom axis labels.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeCustomLabelsCollection_CustomLabelsCollection"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class CustomLabelsCollection : ChartElementCollection<CustomLabel>
+ {
+ #region Constructors
+
+ /// <summary>
+ /// Custom labels collection object constructor
+ /// </summary>
+ /// <param name="axis">Reference to the axis object.</param>
+ internal CustomLabelsCollection(Axis axis) : base(axis)
+ {
+ }
+
+ #endregion
+
+ #region Properties
+ internal Axis Axis
+ {
+ get { return Parent as Axis; }
+ }
+ #endregion
+
+ #region Labels adding methods
+
+ /// <summary>
+ /// Adds a custom label into the collection.
+ /// </summary>
+ /// <param name="fromPosition">Label left position.</param>
+ /// <param name="toPosition">Label right position.</param>
+ /// <param name="text">Label text.</param>
+ /// <returns>Newly added item.</returns>
+ public CustomLabel Add(double fromPosition, double toPosition, string text)
+ {
+ CustomLabel label = new CustomLabel(fromPosition, toPosition, text, 0, LabelMarkStyle.None);
+ Add(label);
+ return label;
+ }
+
+ /// <summary>
+ /// Adds one custom label into the collection. Custom label flag may be specified.
+ /// </summary>
+ /// <param name="fromPosition">Label left position.</param>
+ /// <param name="toPosition">Label right position.</param>
+ /// <param name="text">Label text.</param>
+ /// <param name="customLabel">Indicates if label is custom (created by user).</param>
+ /// <returns>Newly added item.</returns>
+ internal CustomLabel Add(double fromPosition, double toPosition, string text, bool customLabel)
+ {
+ CustomLabel label = new CustomLabel(fromPosition, toPosition, text, 0, LabelMarkStyle.None);
+ label.customLabel = customLabel;
+ Add(label);
+ return label;
+ }
+
+ /// <summary>
+ /// Adds a custom label into the collection.
+ /// </summary>
+ /// <param name="fromPosition">Label left position.</param>
+ /// <param name="toPosition">Label right position.</param>
+ /// <param name="text">Label text.</param>
+ /// <param name="rowIndex">Label row index.</param>
+ /// <param name="markStyle">Label marking style.</param>
+ /// <returns>Newly added item.</returns>
+ public CustomLabel Add(double fromPosition, double toPosition, string text, int rowIndex, LabelMarkStyle markStyle)
+ {
+ CustomLabel label = new CustomLabel(fromPosition, toPosition, text, rowIndex, markStyle);
+ Add(label);
+ return label;
+ }
+
+ /// <summary>
+ /// Adds a custom label into the collection.
+ /// </summary>
+ /// <param name="fromPosition">Label left position.</param>
+ /// <param name="toPosition">Label right position.</param>
+ /// <param name="text">Label text.</param>
+ /// <param name="rowIndex">Label row index.</param>
+ /// <param name="markStyle">Label marking style.</param>
+ /// <returns>Index of newly added item.</returns>
+ /// <param name="gridTick">Custom grid line and tick mark flag.</param>
+ public CustomLabel Add(double fromPosition, double toPosition, string text, int rowIndex, LabelMarkStyle markStyle, GridTickTypes gridTick)
+ {
+ CustomLabel label = new CustomLabel(fromPosition, toPosition, text, rowIndex, markStyle, gridTick);
+ Add(label);
+ return label;
+ }
+
+
+ /// <summary>
+ /// Adds multiple custom labels to the collection.
+ /// The labels will be DateTime labels with the specified interval type,
+ /// and will be generated for the axis range that is determined by the minimum and maximum arguments.
+ /// </summary>
+ /// <param name="labelsStep">The label step determines how often the custom labels will be drawn.</param>
+ /// <param name="intervalType">Unit of measurement of the label step.</param>
+ /// <param name="min">Minimum value..</param>
+ /// <param name="max">Maximum value..</param>
+ /// <param name="format">Label text format.</param>
+ /// <param name="rowIndex">Label row index.</param>
+ /// <param name="markStyle">Label marking style.</param>
+ public void Add(double labelsStep, DateTimeIntervalType intervalType, double min, double max, string format, int rowIndex, LabelMarkStyle markStyle)
+ {
+ // Find labels range min/max values
+ if(min == 0.0 &&
+ max == 0.0 &&
+ this.Axis != null &&
+ !double.IsNaN(this.Axis.Minimum) &&
+ !double.IsNaN(this.Axis.Maximum))
+ {
+ min = this.Axis.Minimum;
+ max = this.Axis.Maximum;
+ }
+ double fromX = Math.Min(min, max);
+ double toX = Math.Max(min, max);
+
+ this.SuspendUpdates();
+ try
+ {
+
+ // Loop through all label points
+ double labelStart = fromX;
+ double labelEnd = 0;
+ while (labelStart < toX)
+ {
+ // Determine label end location
+ if (intervalType == DateTimeIntervalType.Number)
+ {
+ labelEnd = labelStart + labelsStep;
+ }
+ else if (intervalType == DateTimeIntervalType.Milliseconds)
+ {
+ labelEnd = DateTime.FromOADate(labelStart).AddMilliseconds(labelsStep).ToOADate();
+ }
+ else if (intervalType == DateTimeIntervalType.Seconds)
+ {
+ labelEnd = DateTime.FromOADate(labelStart).AddSeconds(labelsStep).ToOADate();
+ }
+ else if (intervalType == DateTimeIntervalType.Minutes)
+ {
+ labelEnd = DateTime.FromOADate(labelStart).AddMinutes(labelsStep).ToOADate();
+ }
+ else if (intervalType == DateTimeIntervalType.Hours)
+ {
+ labelEnd = DateTime.FromOADate(labelStart).AddHours(labelsStep).ToOADate();
+ }
+ else if (intervalType == DateTimeIntervalType.Days)
+ {
+ labelEnd = DateTime.FromOADate(labelStart).AddDays(labelsStep).ToOADate();
+ }
+ else if (intervalType == DateTimeIntervalType.Weeks)
+ {
+ labelEnd = DateTime.FromOADate(labelStart).AddDays(7 * labelsStep).ToOADate();
+ }
+ else if (intervalType == DateTimeIntervalType.Months)
+ {
+ labelEnd = DateTime.FromOADate(labelStart).AddMonths((int)labelsStep).ToOADate();
+ }
+ else if (intervalType == DateTimeIntervalType.Years)
+ {
+ labelEnd = DateTime.FromOADate(labelStart).AddYears((int)labelsStep).ToOADate();
+ }
+ else
+ {
+ // Unsupported step type
+ throw (new ArgumentException(SR.ExceptionAxisLabelsIntervalTypeUnsupported(intervalType.ToString())));
+ }
+ if (labelEnd > toX)
+ {
+ labelEnd = toX;
+ }
+
+ // Generate label text
+ ChartValueType valueType = ChartValueType.Double;
+ if (intervalType != DateTimeIntervalType.Number)
+ {
+ if (this.Axis.GetAxisValuesType() == ChartValueType.DateTimeOffset)
+ valueType = ChartValueType.DateTimeOffset;
+ else
+ valueType = ChartValueType.DateTime;
+ }
+ string text = ValueConverter.FormatValue(
+ this.Common.Chart,
+ this.Axis,
+ null,
+ labelStart + (labelEnd - labelStart) / 2,
+ format,
+ valueType,
+ ChartElementType.AxisLabels);
+
+ // Add label
+ CustomLabel label = new CustomLabel(labelStart, labelEnd, text, rowIndex, markStyle);
+ this.Add(label);
+
+ labelStart = labelEnd;
+ }
+ }
+ finally
+ {
+ this.ResumeUpdates();
+ }
+ }
+
+ /// <summary>
+ /// Adds multiple custom labels to the collection.
+ /// The labels will be DateTime labels with the specified interval type,
+ /// and will be generated for the axis range that is determined by the minimum and maximum arguments.
+ /// </summary>
+ /// <param name="labelsStep">The label step determines how often the custom labels will be drawn.</param>
+ /// <param name="intervalType">Unit of measurement of the label step.</param>
+ public void Add(double labelsStep, DateTimeIntervalType intervalType)
+ {
+ Add(labelsStep, intervalType, 0, 0, "", 0, LabelMarkStyle.None);
+ }
+
+ /// <summary>
+ /// Adds multiple custom labels to the collection.
+ /// The labels will be DateTime labels with the specified interval type,
+ /// and will be generated for the axis range that is determined by the minimum and maximum arguments.
+ /// </summary>
+ /// <param name="labelsStep">The label step determines how often the custom labels will be drawn.</param>
+ /// <param name="intervalType">Unit of measurement of the label step.</param>
+ /// <param name="format">Label text format.</param>
+ public void Add(double labelsStep, DateTimeIntervalType intervalType, string format)
+ {
+ Add(labelsStep, intervalType, 0, 0, format, 0, LabelMarkStyle.None);
+ }
+
+ /// <summary>
+ /// Adds multiple custom labels to the collection.
+ /// The labels will be DateTime labels with the specified interval type,
+ /// and will be generated for the axis range that is determined by the minimum and maximum arguments.
+ /// </summary>
+ /// <param name="labelsStep">The label step determines how often the custom labels will be drawn.</param>
+ /// <param name="intervalType">Unit of measurement of the label step.</param>
+ /// <param name="format">Label text format.</param>
+ /// <param name="rowIndex">Label row index.</param>
+ /// <param name="markStyle">Label marking style.</param>
+ public void Add(double labelsStep, DateTimeIntervalType intervalType, string format, int rowIndex, LabelMarkStyle markStyle)
+ {
+ Add(labelsStep, intervalType, 0, 0, format, rowIndex, markStyle);
+ }
+
+ #endregion
+
+ }
+
+
+ /// <summary>
+ /// The CustomLabel class represents a single custom axis label. Text and
+ /// position along the axis is provided by the caller.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeCustomLabel_CustomLabel"),
+ DefaultProperty("Text"),
+ ]
+#if Microsoft_CONTROL
+ public class CustomLabel : ChartNamedElement
+#else
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class CustomLabel : ChartNamedElement, IChartMapArea
+#endif
+ {
+ #region Fields and Constructors
+
+ // Private data members, which store properties values
+ private double _fromPosition = 0;
+ private double _toPosition = 0;
+ private string _text = "";
+ private LabelMarkStyle _labelMark = LabelMarkStyle.None;
+ private Color _foreColor = Color.Empty;
+ private Color _markColor = Color.Empty;
+ private int _labelRowIndex = 0;
+
+ // Custom grid lines and tick marks flags
+ private GridTickTypes _gridTick = GridTickTypes.None;
+
+ // Indicates if label was automatically created or cpecified by user (custom)
+ internal bool customLabel = true;
+
+ // Image associated with the label
+ private string _image = string.Empty;
+
+ // Image transparent color
+ private Color _imageTransparentColor = Color.Empty;
+
+ // Label tooltip
+ private string _tooltip = string.Empty;
+
+ private Axis _axis = null;
+#if !Microsoft_CONTROL
+
+ // URL target of the label image.
+ private string _imageUrl = string.Empty;
+
+ // Other attributes of the label image map area.
+ private string _imageMapAreaAttributes = string.Empty;
+
+ private string _imagePostbackValue = String.Empty;
+
+ // Label tooltip
+ private string _url = string.Empty;
+
+ // Other attributes of the label image map area.
+ private string _mapAreaAttributes = string.Empty;
+
+ private string _postbackValue = String.Empty;
+
+
+#endif // !Microsoft_CONTROL
+
+
+
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public CustomLabel()
+ {
+ }
+
+ /// <summary>
+ /// CustomLabel constructor
+ /// </summary>
+ /// <param name="fromPosition">From position.</param>
+ /// <param name="toPosition">To position.</param>
+ /// <param name="text">Label text.</param>
+ /// <param name="labelRow">Label row index.</param>
+ /// <param name="markStyle">Label mark style.</param>
+ public CustomLabel(double fromPosition, double toPosition, string text, int labelRow, LabelMarkStyle markStyle)
+ {
+ this._fromPosition = fromPosition;
+ this._toPosition = toPosition;
+ this._text = text;
+ this._labelRowIndex = labelRow;
+ this._labelMark = markStyle;
+ this._gridTick = GridTickTypes.None;
+ }
+
+ /// <summary>
+ /// CustomLabel constructor
+ /// </summary>
+ /// <param name="fromPosition">From position.</param>
+ /// <param name="toPosition">To position.</param>
+ /// <param name="text">Label text.</param>
+ /// <param name="labelRow">Label row index.</param>
+ /// <param name="markStyle">Label mark style.</param>
+ /// <param name="gridTick">Custom grid line and tick marks flag.</param>
+ public CustomLabel(double fromPosition, double toPosition, string text, int labelRow, LabelMarkStyle markStyle, GridTickTypes gridTick)
+ {
+ this._fromPosition = fromPosition;
+ this._toPosition = toPosition;
+ this._text = text;
+ this._labelRowIndex = labelRow;
+ this._labelMark = markStyle;
+ this._gridTick = gridTick;
+ }
+
+ #endregion
+
+ #region Helper methods
+
+ /// <summary>
+ /// Returns a cloned label object.
+ /// </summary>
+ /// <returns>Copy of current custom label.</returns>
+ public CustomLabel Clone()
+ {
+ CustomLabel newLabel = new CustomLabel();
+
+ newLabel.FromPosition = this.FromPosition;
+ newLabel.ToPosition = this.ToPosition;
+ newLabel.Text = this.Text;
+ newLabel.ForeColor = this.ForeColor;
+ newLabel.MarkColor = this.MarkColor;
+ newLabel.RowIndex = this.RowIndex;
+ newLabel.LabelMark = this.LabelMark;
+ newLabel.GridTicks = this.GridTicks;
+
+
+
+ newLabel.ToolTip = this.ToolTip;
+ newLabel.Tag = this.Tag;
+ newLabel.Image = this.Image;
+ newLabel.ImageTransparentColor = this.ImageTransparentColor;
+
+#if !Microsoft_CONTROL
+ newLabel.Url = this.Url;
+ newLabel.MapAreaAttributes = this.MapAreaAttributes;
+ newLabel.ImageUrl = this.ImageUrl;
+ newLabel.ImageMapAreaAttributes = this.ImageMapAreaAttributes;
+#endif // !Microsoft_CONTROL
+
+
+
+ return newLabel;
+ }
+
+ internal override IChartElement Parent
+ {
+ get
+ {
+ return base.Parent;
+ }
+ set
+ {
+ base.Parent = value;
+ if (value != null)
+ {
+ _axis = Parent.Parent as Axis;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets the axis to which this object is attached to.
+ /// </summary>
+ /// <returns>Axis.</returns>
+ [
+ Browsable(false),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ ]
+ public Axis Axis
+ {
+ get
+ {
+ return _axis;
+ }
+ }
+
+ #endregion
+
+ #region CustomLabel properties
+
+ /// <summary>
+ /// Gets or sets the tooltip of the custom label.
+ /// </summary>
+ [
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+#endif //!Microsoft_CONTROL
+ SRCategory("CategoryAttributeMapArea"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeToolTip"),
+ DefaultValue("")
+ ]
+ public string ToolTip
+ {
+ set
+ {
+ this._tooltip = value;
+ }
+ get
+ {
+ return this._tooltip;
+ }
+ }
+
+
+#if !Microsoft_CONTROL
+
+ /// <summary>
+ /// URL target of the custom label.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMapArea"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeUrl"),
+ DefaultValue(""),
+ PersistenceMode(PersistenceMode.Attribute),
+ Editor(Editors.UrlValueEditor.Editor, Editors.UrlValueEditor.Base)
+ ]
+ public string Url
+ {
+ set
+ {
+ this._url = value;
+ }
+ get
+ {
+ return this._url;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the other attributes of the custom label map area.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMapArea"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeMapAreaAttributes"),
+ DefaultValue(""),
+ PersistenceMode(PersistenceMode.Attribute)
+ ]
+ public string MapAreaAttributes
+ {
+ set
+ {
+ this._mapAreaAttributes = value;
+ }
+ get
+ {
+ return this._mapAreaAttributes;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the postback value which can be processed on a click event.
+ /// </summary>
+ /// <value>The value which is passed to a click event as an argument.</value>
+ [DefaultValue("")]
+ [SRCategory(SR.Keys.CategoryAttributeMapArea)]
+ [SRDescription(SR.Keys.DescriptionAttributePostBackValue)]
+ public string PostBackValue
+ {
+ get
+ {
+ return this._postbackValue;
+ }
+ set
+ {
+ this._postbackValue = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the URL target of the custom label image.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMapArea"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeCustomLabel_ImageUrl"),
+ DefaultValue(""),
+ PersistenceMode(PersistenceMode.Attribute),
+ Editor(Editors.UrlValueEditor.Editor, Editors.UrlValueEditor.Base),
+ System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")
+ ]
+ public string ImageUrl
+ {
+ set
+ {
+ this._imageUrl = value;
+ }
+ get
+ {
+ return this._imageUrl;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the other attributes of the map area of the custom label image.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMapArea"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeMapAreaAttributes"),
+ DefaultValue(""),
+ PersistenceMode(PersistenceMode.Attribute)
+ ]
+ public string ImageMapAreaAttributes
+ {
+ set
+ {
+ this._imageMapAreaAttributes = value;
+ }
+ get
+ {
+ return this._imageMapAreaAttributes;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the postback value which can be processed on a click event.
+ /// </summary>
+ /// <value>The value which is passed to a click event as an argument.</value>
+ [DefaultValue("")]
+ [SRCategory(SR.Keys.CategoryAttributeMapArea)]
+ [SRDescription(SR.Keys.DescriptionAttributePostBackValue)]
+ public string ImagePostBackValue
+ {
+ get
+ {
+ return this._imagePostbackValue;
+ }
+ set
+ {
+ this._imagePostbackValue = value;
+ }
+ }
+
+
+#endif // !Microsoft_CONTROL
+
+ /// <summary>
+ /// Gets or sets the label image.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeCustomLabel_Image"),
+ Editor(Editors.ImageValueEditor.Editor, Editors.ImageValueEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ NotifyParentPropertyAttribute(true)
+ ]
+ public string Image
+ {
+ get
+ {
+ return _image;
+ }
+ set
+ {
+ _image = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a color which will be replaced with a transparent color while drawing the image.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeImageTransparentColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color ImageTransparentColor
+ {
+ get
+ {
+ return _imageTransparentColor;
+ }
+ set
+ {
+ _imageTransparentColor = value;
+ this.Invalidate();
+ }
+ }
+
+
+
+ /// <summary>
+ /// Custom label name. This property is for internal use only.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ SRDescription("DescriptionAttributeCustomLabel_Name"),
+ DefaultValue("Custom LabelStyle"),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ DesignOnlyAttribute(true),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden)
+ ]
+ public override string Name
+ {
+ get
+ {
+ return base.Name;
+ }
+ set
+ {
+ base.Name = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a property which specifies whether
+ /// custom tick marks and grid lines will be drawn in the center of the label.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(GridTickTypes.None),
+ SRDescription("DescriptionAttributeCustomLabel_GridTicks"),
+ Editor(Editors.FlagsEnumUITypeEditor.Editor, Editors.FlagsEnumUITypeEditor.Base)
+ ]
+ public GridTickTypes GridTicks
+ {
+ get
+ {
+ return _gridTick;
+ }
+ set
+ {
+ _gridTick = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the end position of the custom label in axis coordinates.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(0.0),
+ SRDescription("DescriptionAttributeCustomLabel_From"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ TypeConverter(typeof(AxisLabelDateValueConverter))
+ ]
+ public double FromPosition
+ {
+ get
+ {
+ return _fromPosition;
+ }
+ set
+ {
+ _fromPosition = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the starting position of the custom label in axis coordinates.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(0.0),
+ SRDescription("DescriptionAttributeCustomLabel_To"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ TypeConverter(typeof(AxisLabelDateValueConverter))
+ ]
+ public double ToPosition
+ {
+ get
+ {
+ return _toPosition;
+ }
+ set
+ {
+ _toPosition = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the text of the custom label.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeCustomLabel_Text"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public string Text
+ {
+ get
+ {
+ return _text;
+ }
+ set
+ {
+ _text = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the text color of the custom label.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeForeColor"),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color ForeColor
+ {
+ get
+ {
+ return _foreColor;
+ }
+ set
+ {
+ _foreColor = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the color of the label mark line of the custom label.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeCustomLabel_MarkColor"),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color MarkColor
+ {
+ get
+ {
+ return _markColor;
+ }
+ set
+ {
+ _markColor = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the row index of the custom label.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(0),
+ SRDescription("DescriptionAttributeCustomLabel_RowIndex"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public int RowIndex
+ {
+ get
+ {
+ return this._labelRowIndex;
+ }
+ set
+ {
+ if(value < 0)
+ {
+ throw (new InvalidOperationException(SR.ExceptionAxisLabelRowIndexIsNegative));
+ }
+
+ this._labelRowIndex = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a property which define the marks for the labels in the second row.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(LabelMarkStyle.None),
+ SRDescription("DescriptionAttributeCustomLabel_LabelMark"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public LabelMarkStyle LabelMark
+ {
+ get
+ {
+ return _labelMark;
+ }
+ set
+ {
+ _labelMark = value;
+ this.Invalidate();
+ }
+ }
+
+ #endregion
+
+ }
+
+ /// <summary>
+ /// The LabelStyle class contains properties which define the visual appearance of
+ /// the axis labels, their interval and position. This class is also
+ /// responsible for calculating the position of all the labels and
+ /// drawing them.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeLabel_Label"),
+ DefaultProperty("Enabled"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class LabelStyle : ChartElement
+ {
+ #region Fields
+
+ // Reference to the Axis
+ private Axis _axis = null;
+
+ // Private data members, which store properties values
+ private bool _enabled = true;
+
+ internal double intervalOffset = double.NaN;
+ internal double interval = double.NaN;
+ internal DateTimeIntervalType intervalType = DateTimeIntervalType.NotSet;
+ internal DateTimeIntervalType intervalOffsetType = DateTimeIntervalType.NotSet;
+
+ private FontCache _fontCache = new FontCache();
+ private Font _font;
+ private Color _foreColor = Color.Black;
+ internal int angle = 0;
+ internal bool isStaggered = false;
+ private bool _isEndLabelVisible = true;
+ private bool _truncatedLabels = false;
+ private string _format = "";
+
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// Public default constructor.
+ /// </summary>
+ public LabelStyle()
+ {
+ _font = _fontCache.DefaultFont;
+ }
+
+ /// <summary>
+ /// Public constructor.
+ /// </summary>
+ /// <param name="axis">Axis which owns the grid.</param>
+ internal LabelStyle(Axis axis)
+ : this()
+ {
+ _axis = axis;
+ }
+
+ #endregion
+
+ #region Axis labels drawing methods
+
+ /// <summary>
+ /// Draws axis labels on the circular chart area.
+ /// </summary>
+ /// <param name="graph">Reference to the Chart Graphics object.</param>
+ internal void PaintCircular( ChartGraphics graph )
+ {
+ // Label string drawing format
+ using (StringFormat format = new StringFormat())
+ {
+ format.FormatFlags |= StringFormatFlags.LineLimit;
+ format.Trimming = StringTrimming.EllipsisCharacter;
+
+ // Labels are disabled for this axis
+ if (!_axis.LabelStyle.Enabled)
+ return;
+
+ // Draw text with anti-aliasing
+ /*
+ if( (graph.AntiAliasing & AntiAliasing.Text) == AntiAliasing.Text )
+ {
+ graph.TextRenderingHint = TextRenderingHint.AntiAlias;
+ }
+ else
+ {
+ graph.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit;
+ }
+ */
+
+ // Gets axis labels style
+ CircularAxisLabelsStyle labelsStyle = this._axis.ChartArea.GetCircularAxisLabelsStyle();
+
+ // Get list of circular axes with labels
+ ArrayList circularAxes = this._axis.ChartArea.GetCircularAxisList();
+
+ // Draw each axis label
+ int index = 0;
+ foreach (CircularChartAreaAxis circAxis in circularAxes)
+ {
+ if (circAxis.Title.Length > 0)
+ {
+ //******************************************************************
+ //** Calculate label position corner position
+ //******************************************************************
+ PointF labelRelativePosition = new PointF(
+ this._axis.ChartArea.circularCenter.X,
+ this._axis.ChartArea.PlotAreaPosition.Y);
+
+ // Adjust labels Y position
+ labelRelativePosition.Y -= _axis.markSize + Axis.elementSpacing;
+
+ // Convert to absolute
+ PointF[] labelPosition = new PointF[] { graph.GetAbsolutePoint(labelRelativePosition) };
+
+ // Get label rotation angle
+ float labelAngle = circAxis.AxisPosition;
+ ICircularChartType chartType = this._axis.ChartArea.GetCircularChartType();
+ if (chartType != null && chartType.XAxisCrossingSupported())
+ {
+ if (!double.IsNaN(this._axis.ChartArea.AxisX.Crossing))
+ {
+ labelAngle += (float)this._axis.ChartArea.AxisX.Crossing;
+ }
+ }
+
+ // Make sure angle is presented as a positive number
+ while (labelAngle < 0)
+ {
+ labelAngle = 360f + labelAngle;
+ }
+
+ // Set graphics rotation matrix
+ Matrix newMatrix = new Matrix();
+ newMatrix.RotateAt(labelAngle, graph.GetAbsolutePoint(this._axis.ChartArea.circularCenter));
+ newMatrix.TransformPoints(labelPosition);
+
+ // Set text alignment
+ format.LineAlignment = StringAlignment.Center;
+ format.Alignment = StringAlignment.Near;
+ if (labelsStyle != CircularAxisLabelsStyle.Radial)
+ {
+ if (labelAngle < 5f || labelAngle > 355f)
+ {
+ format.Alignment = StringAlignment.Center;
+ format.LineAlignment = StringAlignment.Far;
+ }
+ if (labelAngle < 185f && labelAngle > 175f)
+ {
+ format.Alignment = StringAlignment.Center;
+ format.LineAlignment = StringAlignment.Near;
+ }
+ if (labelAngle > 185f && labelAngle < 355f)
+ {
+ format.Alignment = StringAlignment.Far;
+ }
+ }
+ else
+ {
+ if (labelAngle > 180f)
+ {
+ format.Alignment = StringAlignment.Far;
+ }
+ }
+
+
+ // Set text rotation angle
+ float textAngle = labelAngle;
+ if (labelsStyle == CircularAxisLabelsStyle.Radial)
+ {
+ if (labelAngle > 180)
+ {
+ textAngle += 90f;
+ }
+ else
+ {
+ textAngle -= 90f;
+ }
+ }
+ else if (labelsStyle == CircularAxisLabelsStyle.Circular)
+ {
+ format.Alignment = StringAlignment.Center;
+ format.LineAlignment = StringAlignment.Far;
+ }
+
+ // Set text rotation matrix
+ Matrix oldMatrix = graph.Transform;
+ if (labelsStyle == CircularAxisLabelsStyle.Radial || labelsStyle == CircularAxisLabelsStyle.Circular)
+ {
+ Matrix textRotationMatrix = oldMatrix.Clone();
+ textRotationMatrix.RotateAt(textAngle, labelPosition[0]);
+ graph.Transform = textRotationMatrix;
+ }
+
+ // Get axis titl (label) color
+ Color labelColor = _foreColor;
+ if (!circAxis.TitleForeColor.IsEmpty)
+ {
+ labelColor = circAxis.TitleForeColor;
+ }
+
+ // Draw label
+ using (Brush brush = new SolidBrush(labelColor))
+ {
+ graph.DrawString(
+ circAxis.Title.Replace("\\n", "\n"),
+ (_axis.autoLabelFont == null) ? _font : _axis.autoLabelFont,
+ brush,
+ labelPosition[0],
+ format);
+ }
+
+ // Process selection region
+ if (this._axis.Common.ProcessModeRegions)
+ {
+ SizeF size = graph.MeasureString(circAxis.Title.Replace("\\n", "\n"), (_axis.autoLabelFont == null) ? _font : _axis.autoLabelFont);
+ RectangleF labelRect = GetLabelPosition(
+ labelPosition[0],
+ size,
+ format);
+ PointF[] points = new PointF[]
+ {
+ labelRect.Location,
+ new PointF(labelRect.Right, labelRect.Y),
+ new PointF(labelRect.Right, labelRect.Bottom),
+ new PointF(labelRect.X, labelRect.Bottom)
+ };
+
+ using (GraphicsPath path = new GraphicsPath())
+ {
+ path.AddPolygon(points);
+ path.CloseAllFigures();
+ path.Transform(graph.Transform);
+ this._axis.Common.HotRegionsList.AddHotRegion(
+ path,
+ false,
+ ChartElementType.AxisLabels,
+ circAxis.Title);
+ }
+ }
+
+ // Restore graphics
+ if(labelsStyle == CircularAxisLabelsStyle.Radial || labelsStyle == CircularAxisLabelsStyle.Circular)
+ {
+ graph.Transform = oldMatrix;
+ }
+ }
+
+ ++index;
+ }
+ }
+
+ }
+
+ /// <summary>
+ /// Gets rectangle position of the label.
+ /// </summary>
+ /// <param name="position">Original label position.</param>
+ /// <param name="size">Label text size.</param>
+ /// <param name="format">Label string format.</param>
+ /// <returns>Label rectangle position.</returns>
+ internal static RectangleF GetLabelPosition(
+ PointF position,
+ SizeF size,
+ StringFormat format)
+ {
+ // Calculate label position rectangle
+ RectangleF labelPosition = RectangleF.Empty;
+ labelPosition.Width = size.Width;
+ labelPosition.Height = size.Height;
+
+ if(format.Alignment == StringAlignment.Far)
+ {
+ labelPosition.X = position.X - size.Width;
+ }
+ else if(format.Alignment == StringAlignment.Near)
+ {
+ labelPosition.X = position.X;
+ }
+ else if(format.Alignment == StringAlignment.Center)
+ {
+ labelPosition.X = position.X - size.Width/2F;
+ }
+
+ if(format.LineAlignment == StringAlignment.Far)
+ {
+ labelPosition.Y = position.Y - size.Height;
+ }
+ else if(format.LineAlignment == StringAlignment.Near)
+ {
+ labelPosition.Y = position.Y;
+ }
+ else if(format.LineAlignment == StringAlignment.Center)
+ {
+ labelPosition.Y = position.Y - size.Height/2F;
+ }
+
+ return labelPosition;
+ }
+
+ /// <summary>
+ /// Draws axis labels.
+ /// </summary>
+ /// <param name="graph">Reference to the Chart Graphics object.</param>
+ /// <param name="backElements">Back elements of the axis should be drawn in 3D scene.</param>
+ internal void Paint( ChartGraphics graph, bool backElements )
+ {
+ // Label string drawing format
+ using (StringFormat format = new StringFormat())
+ {
+ format.FormatFlags |= StringFormatFlags.LineLimit;
+ format.Trimming = StringTrimming.EllipsisCharacter;
+
+ // Labels are disabled for this axis
+ if (!_axis.LabelStyle.Enabled)
+ return;
+ // deliant fix-> VSTS #157848, #143286 - drawing custom label in empty axis
+ if (Double.IsNaN(_axis.ViewMinimum) || Double.IsNaN(_axis.ViewMaximum))
+ return;
+
+
+ // Draw labels in 3D space
+ if (this._axis.ChartArea.Area3DStyle.Enable3D && !this._axis.ChartArea.chartAreaIsCurcular)
+ {
+ this.Paint3D(graph, backElements);
+ return;
+ }
+
+ // Initialize all labels position rectangle
+ RectangleF rectLabels = _axis.ChartArea.Position.ToRectangleF();
+ float labelSize = _axis.labelSize;
+
+ if (_axis.AxisPosition == AxisPosition.Left)
+ {
+ rectLabels.Width = labelSize;
+ if (_axis.GetIsMarksNextToAxis())
+ rectLabels.X = (float)_axis.GetAxisPosition();
+ else
+ rectLabels.X = _axis.PlotAreaPosition.X;
+
+ rectLabels.X -= labelSize + _axis.markSize;
+
+ // Set label text alignment
+ format.Alignment = StringAlignment.Far;
+ format.LineAlignment = StringAlignment.Center;
+ }
+ else if (_axis.AxisPosition == AxisPosition.Right)
+ {
+ rectLabels.Width = labelSize;
+ if (_axis.GetIsMarksNextToAxis())
+ rectLabels.X = (float)_axis.GetAxisPosition();
+ else
+ rectLabels.X = _axis.PlotAreaPosition.Right;
+ rectLabels.X += _axis.markSize;
+
+ // Set label text alignment
+ format.Alignment = StringAlignment.Near;
+ format.LineAlignment = StringAlignment.Center;
+ }
+ else if (_axis.AxisPosition == AxisPosition.Top)
+ {
+ rectLabels.Height = labelSize;
+ if (_axis.GetIsMarksNextToAxis())
+ rectLabels.Y = (float)_axis.GetAxisPosition();
+ else
+ rectLabels.Y = _axis.PlotAreaPosition.Y;
+ rectLabels.Y -= labelSize + _axis.markSize;
+
+ // Set label text alignment
+ format.Alignment = StringAlignment.Center;
+ format.LineAlignment = StringAlignment.Far;
+ }
+ else if (_axis.AxisPosition == AxisPosition.Bottom)
+ {
+ rectLabels.Height = labelSize;
+ if (_axis.GetIsMarksNextToAxis())
+ rectLabels.Y = (float)_axis.GetAxisPosition();
+ else
+ rectLabels.Y = _axis.PlotAreaPosition.Bottom;
+ rectLabels.Y += _axis.markSize;
+
+ // Set label text alignment
+ format.Alignment = StringAlignment.Center;
+ format.LineAlignment = StringAlignment.Near;
+ }
+
+ // Calculate bounding rectangle
+ RectangleF boundaryRect = rectLabels;
+ if (boundaryRect != RectangleF.Empty && _axis.totlaGroupingLabelsSize > 0)
+ {
+ if (_axis.AxisPosition == AxisPosition.Left)
+ {
+ boundaryRect.X += _axis.totlaGroupingLabelsSize;
+ boundaryRect.Width -= _axis.totlaGroupingLabelsSize;
+ }
+ else if (_axis.AxisPosition == AxisPosition.Right)
+ {
+ boundaryRect.Width -= _axis.totlaGroupingLabelsSize;
+ }
+ else if (_axis.AxisPosition == AxisPosition.Top)
+ {
+ boundaryRect.Y += _axis.totlaGroupingLabelsSize;
+ boundaryRect.Height -= _axis.totlaGroupingLabelsSize;
+ }
+ else if (_axis.AxisPosition == AxisPosition.Bottom)
+ {
+ boundaryRect.Height -= _axis.totlaGroupingLabelsSize;
+ }
+ }
+
+ // Check if the AJAX zooming and scrolling mode is enabled.
+ // Labels are drawn slightly different in this case.
+ bool ajaxScrollingEnabled = false;
+ bool firstFrame = true;
+ bool lastFrame = true;
+
+ // Draw all labels from the collection
+ int labelIndex = 0;
+ foreach (CustomLabel label in this._axis.CustomLabels)
+ {
+ bool truncatedLeft = false;
+ bool truncatedRight = false;
+ double labelFrom = label.FromPosition;
+ double labelTo = label.ToPosition;
+ bool useRelativeCoordiantes = false;
+ double labelFromRelative = double.NaN;
+ double labelToRelative = double.NaN;
+
+ // Skip if label middle point is outside current scaleView
+ if (label.RowIndex == 0)
+ {
+ double middlePoint = (label.FromPosition + label.ToPosition) / 2.0;
+ decimal viewMin = (decimal)_axis.ViewMinimum;
+ decimal viewMax = (decimal)_axis.ViewMaximum;
+
+ if (ajaxScrollingEnabled)
+ {
+ // Skip very first and last labels if they are partialy outside the scaleView
+ if (firstFrame)
+ {
+ if ((decimal)label.FromPosition < (decimal)_axis.Minimum)
+ {
+ continue;
+ }
+ }
+ if (lastFrame)
+ {
+ if ((decimal)label.ToPosition > (decimal)_axis.Maximum)
+ {
+ continue;
+ }
+ }
+
+ // Skip label only if it is compleltly out of the scaleView
+ if ((decimal)label.ToPosition < viewMin ||
+ (decimal)label.FromPosition > viewMax)
+ {
+ continue;
+ }
+
+ // RecalculateAxesScale label index starting from the first frame.
+ // Index is used to determine position of the offset labels
+ if ((this._axis.autoLabelOffset == -1) ? this.IsStaggered : (this._axis.autoLabelOffset == 1))
+ {
+ // Reset index
+ labelIndex = 0;
+
+ // Get first series attached to this axis
+ Series axisSeries = null;
+ if (_axis.axisType == AxisName.X || _axis.axisType == AxisName.X2)
+ {
+ List<string> seriesArray = _axis.ChartArea.GetXAxesSeries((_axis.axisType == AxisName.X) ? AxisType.Primary : AxisType.Secondary, _axis.SubAxisName);
+ if (seriesArray.Count > 0)
+ {
+ axisSeries = _axis.Common.DataManager.Series[seriesArray[0]];
+ if (axisSeries != null && !axisSeries.IsXValueIndexed)
+ {
+ axisSeries = null;
+ }
+ }
+ }
+
+ // Set start position and iterate through label positions
+ // NOTE: Labels offset should not be taken in the account
+ double currentPosition = _axis.Minimum;
+ while (currentPosition < _axis.Maximum)
+ {
+ if (currentPosition >= middlePoint)
+ {
+ break;
+ }
+
+ currentPosition += ChartHelper.GetIntervalSize(currentPosition, _axis.LabelStyle.GetInterval(), _axis.LabelStyle.GetIntervalType(),
+ axisSeries, 0.0, DateTimeIntervalType.Number, true);
+ ++labelIndex;
+ }
+
+ }
+ }
+ else
+ {
+ // Skip label if label middle point is not in the scaleView
+ if ((decimal)middlePoint < viewMin ||
+ (decimal)middlePoint > viewMax)
+ {
+ continue;
+ }
+ }
+
+
+
+ // Make sure label To and From coordinates are processed by one scale segment based
+ // on the label middle point position.
+ if (_axis.ScaleSegments.Count > 0)
+ {
+ AxisScaleSegment scaleSegment = _axis.ScaleSegments.FindScaleSegmentForAxisValue(middlePoint);
+ _axis.ScaleSegments.AllowOutOfScaleValues = true;
+ _axis.ScaleSegments.EnforceSegment(scaleSegment);
+ }
+
+
+
+ // Use center point instead of the To/From if label takes all scaleView
+ // This is done to avoid issues with labels drawing with high
+ // zooming levels.
+ if ((decimal)label.FromPosition < viewMin &&
+ (decimal)label.ToPosition > viewMax)
+ {
+ // Indicates that chart relative coordinates should be used instead of axis values
+ useRelativeCoordiantes = true;
+
+ // Calculate label From/To in relative coordinates using
+ // label middle point and 100% width.
+ labelFromRelative = _axis.GetLinearPosition(middlePoint) - 50.0;
+ labelToRelative = labelFromRelative + 100.0;
+ }
+ }
+ else
+ {
+ // Skip labels completly outside the scaleView
+ if (label.ToPosition <= _axis.ViewMinimum || label.FromPosition >= _axis.ViewMaximum)
+ {
+ continue;
+ }
+
+ // Check if label is partially visible.
+ if (!ajaxScrollingEnabled &&
+ _axis.ScaleView.IsZoomed)
+ {
+ if (label.FromPosition < _axis.ViewMinimum)
+ {
+ truncatedLeft = true;
+ labelFrom = _axis.ViewMinimum;
+ }
+ if (label.ToPosition > _axis.ViewMaximum)
+ {
+ truncatedRight = true;
+ labelTo = _axis.ViewMaximum;
+ }
+ }
+ }
+
+ // Calculate single label position
+ RectangleF rect = rectLabels;
+
+ // Label is in the first row
+ if (label.RowIndex == 0)
+ {
+ if (_axis.AxisPosition == AxisPosition.Left)
+ {
+ rect.X = rectLabels.Right - _axis.unRotatedLabelSize;
+ rect.Width = _axis.unRotatedLabelSize;
+
+ // Adjust label rectangle if offset labels are used
+ if ((this._axis.autoLabelOffset == -1) ? this.IsStaggered : (this._axis.autoLabelOffset == 1))
+ {
+ rect.Width /= 2F;
+ if (labelIndex % 2 != 0F)
+ {
+ rect.X += rect.Width;
+ }
+ }
+ }
+ else if (_axis.AxisPosition == AxisPosition.Right)
+ {
+ rect.Width = _axis.unRotatedLabelSize;
+
+ // Adjust label rectangle if offset labels are used
+ if ((this._axis.autoLabelOffset == -1) ? this.IsStaggered : (this._axis.autoLabelOffset == 1))
+ {
+ rect.Width /= 2F;
+ if (labelIndex % 2 != 0F)
+ {
+ rect.X += rect.Width;
+ }
+ }
+ }
+ else if (_axis.AxisPosition == AxisPosition.Top)
+ {
+ rect.Y = rectLabels.Bottom - _axis.unRotatedLabelSize;
+ rect.Height = _axis.unRotatedLabelSize;
+
+ // Adjust label rectangle if offset labels are used
+ if ((this._axis.autoLabelOffset == -1) ? this.IsStaggered : (this._axis.autoLabelOffset == 1))
+ {
+ rect.Height /= 2F;
+ if (labelIndex % 2 != 0F)
+ {
+ rect.Y += rect.Height;
+ }
+ }
+ }
+ else if (_axis.AxisPosition == AxisPosition.Bottom)
+ {
+ rect.Height = _axis.unRotatedLabelSize;
+
+ // Adjust label rectangle if offset labels are used
+ if ((this._axis.autoLabelOffset == -1) ? this.IsStaggered : (this._axis.autoLabelOffset == 1))
+ {
+ rect.Height /= 2F;
+ if (labelIndex % 2 != 0F)
+ {
+ rect.Y += rect.Height;
+ }
+ }
+ }
+
+ // Increase label index
+ ++labelIndex;
+ }
+
+ // Label is in the second row
+ else if (label.RowIndex > 0)
+ {
+ if (_axis.AxisPosition == AxisPosition.Left)
+ {
+ rect.X += _axis.totlaGroupingLabelsSizeAdjustment;
+ for (int index = _axis.groupingLabelSizes.Length; index > label.RowIndex; index--)
+ {
+ rect.X += _axis.groupingLabelSizes[index - 1];
+ }
+ rect.Width = _axis.groupingLabelSizes[label.RowIndex - 1];
+ }
+ else if (_axis.AxisPosition == AxisPosition.Right)
+ {
+ rect.X = rect.Right - _axis.totlaGroupingLabelsSize - _axis.totlaGroupingLabelsSizeAdjustment;// + Axis.elementSpacing * 0.25f;
+ for (int index = 1; index < label.RowIndex; index++)
+ {
+ rect.X += _axis.groupingLabelSizes[index - 1];
+ }
+ rect.Width = _axis.groupingLabelSizes[label.RowIndex - 1];
+ }
+ else if (_axis.AxisPosition == AxisPosition.Top)
+ {
+ rect.Y += _axis.totlaGroupingLabelsSizeAdjustment;
+ for (int index = _axis.groupingLabelSizes.Length; index > label.RowIndex; index--)
+ {
+ rect.Y += _axis.groupingLabelSizes[index - 1];
+ }
+ rect.Height = _axis.groupingLabelSizes[label.RowIndex - 1];
+ }
+ if (_axis.AxisPosition == AxisPosition.Bottom)
+ {
+ rect.Y = rect.Bottom - _axis.totlaGroupingLabelsSize - _axis.totlaGroupingLabelsSizeAdjustment;
+ for (int index = 1; index < label.RowIndex; index++)
+ {
+ rect.Y += _axis.groupingLabelSizes[index - 1];
+ }
+ rect.Height = _axis.groupingLabelSizes[label.RowIndex - 1];
+ }
+ }
+
+ // Unknown label row value
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionAxisLabelIndexIsNegative));
+ }
+
+ // Set label From and To coordinates
+ double fromPosition = _axis.GetLinearPosition(labelFrom);
+ double toPosition = _axis.GetLinearPosition(labelTo);
+ if (useRelativeCoordiantes)
+ {
+ useRelativeCoordiantes = false;
+ fromPosition = labelFromRelative;
+ toPosition = labelToRelative;
+ }
+
+ if (_axis.AxisPosition == AxisPosition.Top || _axis.AxisPosition == AxisPosition.Bottom)
+ {
+ rect.X = (float)Math.Min(fromPosition, toPosition);
+ rect.Width = (float)Math.Max(fromPosition, toPosition) - rect.X;
+
+ // Adjust label To/From position if offset labels are used
+ if (label.RowIndex == 0 &&
+ ((this._axis.autoLabelOffset == -1) ? this.IsStaggered : (this._axis.autoLabelOffset == 1)))
+ {
+ rect.X -= rect.Width / 2F;
+ rect.Width *= 2F;
+ }
+ }
+ else
+ {
+ rect.Y = (float)Math.Min(fromPosition, toPosition);
+ rect.Height = (float)Math.Max(fromPosition, toPosition) - rect.Y;
+
+ // Adjust label To/From position if offset labels are used
+ if (label.RowIndex == 0 &&
+ ((this._axis.autoLabelOffset == -1) ? this.IsStaggered : (this._axis.autoLabelOffset == 1)))
+ {
+ rect.Y -= rect.Height / 2F;
+ rect.Height *= 2F;
+ }
+ }
+
+ // Draw label
+ using (Brush brush = new SolidBrush((label.ForeColor.IsEmpty) ? _foreColor : label.ForeColor))
+ {
+ graph.DrawLabelStringRel(_axis,
+ label.RowIndex,
+ label.LabelMark,
+ label.MarkColor,
+ label.Text,
+ label.Image,
+ label.ImageTransparentColor,
+ (_axis.autoLabelFont == null) ? _font : _axis.autoLabelFont,
+ brush,
+ rect,
+ format,
+ (_axis.autoLabelAngle < -90) ? angle : _axis.autoLabelAngle,
+ (!this.TruncatedLabels || label.RowIndex > 0) ? RectangleF.Empty : boundaryRect,
+ label,
+ truncatedLeft,
+ truncatedRight);
+ }
+
+ // Clear scale segment enforcement
+ _axis.ScaleSegments.EnforceSegment(null);
+ _axis.ScaleSegments.AllowOutOfScaleValues = false;
+ }
+ }
+ }
+
+ #endregion
+
+ #region 3D Axis labels drawing methods
+
+ /// <summary>
+ /// Get a rectangle between chart area position and plotting area on specified side.
+ /// Also sets axis labels string formatting for the specified labels position.
+ /// </summary>
+ /// <param name="area">Chart area object.</param>
+ /// <param name="position">Position in chart area.</param>
+ /// <param name="stringFormat">Axis labels string format.</param>
+ /// <returns>Axis labels rectangle.</returns>
+ private RectangleF GetAllLabelsRect(ChartArea area, AxisPosition position, StringFormat stringFormat)
+ {
+ // Find axis with same position
+ Axis labelsAxis = null;
+ foreach(Axis curAxis in area.Axes)
+ {
+ if(curAxis.AxisPosition == position)
+ {
+ labelsAxis = curAxis;
+ break;
+ }
+ }
+
+ if(labelsAxis == null)
+ {
+ return RectangleF.Empty;
+ }
+
+ // Calculate rect for different positions
+ RectangleF rectLabels = area.Position.ToRectangleF();
+ if( position == AxisPosition.Left )
+ {
+ rectLabels.Width = labelsAxis.labelSize;
+ if( labelsAxis.GetIsMarksNextToAxis() )
+ {
+ rectLabels.X = (float)labelsAxis.GetAxisPosition();
+ rectLabels.Width = (float)Math.Max(rectLabels.Width, rectLabels.X - labelsAxis.PlotAreaPosition.X);
+ }
+ else
+ {
+ rectLabels.X = labelsAxis.PlotAreaPosition.X;
+ }
+
+ rectLabels.X -= rectLabels.Width;
+
+ if(area.IsSideSceneWallOnLeft() || area.Area3DStyle.WallWidth == 0)
+ {
+ rectLabels.X -= labelsAxis.markSize;
+ }
+
+ // Set label text alignment
+ stringFormat.Alignment = StringAlignment.Far;
+ stringFormat.LineAlignment = StringAlignment.Center;
+ }
+ else if( position == AxisPosition.Right )
+ {
+ rectLabels.Width = labelsAxis.labelSize;
+ if( labelsAxis.GetIsMarksNextToAxis() )
+ {
+ rectLabels.X = (float)labelsAxis.GetAxisPosition();
+ rectLabels.Width = (float)Math.Max(rectLabels.Width, labelsAxis.PlotAreaPosition.Right - rectLabels.X);
+ }
+ else
+ {
+ rectLabels.X = labelsAxis.PlotAreaPosition.Right;
+ }
+
+ if(!area.IsSideSceneWallOnLeft() || area.Area3DStyle.WallWidth == 0)
+ {
+ rectLabels.X += labelsAxis.markSize;
+ }
+
+ // Set label text alignment
+ stringFormat.Alignment = StringAlignment.Near;
+ stringFormat.LineAlignment = StringAlignment.Center;
+ }
+ else if( position == AxisPosition.Top )
+ {
+ rectLabels.Height = labelsAxis.labelSize;
+ if( labelsAxis.GetIsMarksNextToAxis() )
+ {
+ rectLabels.Y = (float)labelsAxis.GetAxisPosition();
+ rectLabels.Height = (float)Math.Max(rectLabels.Height, rectLabels.Y - labelsAxis.PlotAreaPosition.Y);
+ }
+ else
+ {
+ rectLabels.Y = labelsAxis.PlotAreaPosition.Y;
+ }
+
+ rectLabels.Y -= rectLabels.Height;
+
+ if(area.Area3DStyle.WallWidth == 0)
+ {
+ rectLabels.Y -= labelsAxis.markSize;
+ }
+
+ // Set label text alignment
+ stringFormat.Alignment = StringAlignment.Center;
+ stringFormat.LineAlignment = StringAlignment.Far;
+ }
+ else if( position == AxisPosition.Bottom )
+ {
+ rectLabels.Height = labelsAxis.labelSize;
+ if( labelsAxis.GetIsMarksNextToAxis() )
+ {
+ rectLabels.Y = (float)labelsAxis.GetAxisPosition();
+ rectLabels.Height = (float)Math.Max(rectLabels.Height, labelsAxis.PlotAreaPosition.Bottom - rectLabels.Y);
+ }
+ else
+ {
+ rectLabels.Y = labelsAxis.PlotAreaPosition.Bottom;
+ }
+ rectLabels.Y += labelsAxis.markSize;
+
+ // Set label text alignment
+ stringFormat.Alignment = StringAlignment.Center;
+ stringFormat.LineAlignment = StringAlignment.Near;
+ }
+
+ return rectLabels;
+ }
+
+ /// <summary>
+ /// Gets position of axis labels.
+ /// Top and Bottom axis labels can be drawn on the sides (left or right)
+ /// of the plotting area. If angle between axis and it's projection is
+ /// between -25 and 25 degrees the axis are drawn at the bottom/top,
+ /// otherwise labels are moved on the left or right side.
+ /// </summary>
+ /// <param name="axis">Axis object.</param>
+ /// <returns>Position where axis labels should be drawn.</returns>
+ private AxisPosition GetLabelsPosition(Axis axis)
+ {
+ // Get angle between 2D axis and it's 3D projection.
+ double axisAngle = axis.GetAxisProjectionAngle();
+
+ // Pick the side to draw the labels on
+ if(axis.AxisPosition == AxisPosition.Bottom)
+ {
+ if(axisAngle <= -25 )
+ return AxisPosition.Right;
+ else if(axisAngle >= 25 )
+ return AxisPosition.Left;
+ }
+ else if(axis.AxisPosition == AxisPosition.Top)
+ {
+ if(axisAngle <= -25 )
+ return AxisPosition.Left;
+ else if(axisAngle >= 25 )
+ return AxisPosition.Right;
+ }
+
+ // Labels are on the same side as the axis
+ return axis.AxisPosition;
+ }
+
+ /// <summary>
+ /// Draws axis labels in 3D space.
+ /// </summary>
+ /// <param name="graph">Reference to the Chart Graphics object.</param>
+ /// <param name="backElements">Back elements of the axis should be drawn in 3D scene.</param>
+ internal void Paint3D( ChartGraphics graph, bool backElements )
+ {
+ // Label string drawing format
+ using (StringFormat format = new StringFormat())
+ {
+ format.Trimming = StringTrimming.EllipsisCharacter;
+
+ // Calculate single pixel size in relative coordinates
+ SizeF pixelSize = graph.GetRelativeSize(new SizeF(1f, 1f));
+
+ //********************************************************************
+ //** Determine the side of the plotting area to draw the labels on.
+ //********************************************************************
+ AxisPosition labelsPosition = GetLabelsPosition(_axis);
+
+ //*****************************************************************
+ //** Set the labels Z position
+ //*****************************************************************
+ bool axisOnEdge;
+ float labelsZPosition = _axis.GetMarksZPosition(out axisOnEdge);
+
+ // Adjust Z position for the "bent" tick marks
+ bool adjustForWallWidth = false;
+ if (this._axis.AxisPosition == AxisPosition.Top &&
+ !this._axis.ChartArea.ShouldDrawOnSurface(SurfaceNames.Top, backElements, false))
+ {
+ adjustForWallWidth = true;
+ }
+ if (this._axis.AxisPosition == AxisPosition.Left &&
+ !this._axis.ChartArea.ShouldDrawOnSurface(SurfaceNames.Left, backElements, false))
+ {
+ adjustForWallWidth = true;
+ }
+ if (this._axis.AxisPosition == AxisPosition.Right &&
+ !this._axis.ChartArea.ShouldDrawOnSurface(SurfaceNames.Right, backElements, false))
+ {
+ adjustForWallWidth = true;
+ }
+
+ if (adjustForWallWidth && this._axis.ChartArea.Area3DStyle.WallWidth > 0)
+ {
+ if (this._axis.MajorTickMark.TickMarkStyle == TickMarkStyle.InsideArea)
+ {
+ labelsZPosition -= this._axis.ChartArea.areaSceneWallWidth.Width;
+ }
+ else if (this._axis.MajorTickMark.TickMarkStyle == TickMarkStyle.OutsideArea)
+ {
+ labelsZPosition -= this._axis.MajorTickMark.Size + this._axis.ChartArea.areaSceneWallWidth.Width;
+ }
+ else if (this._axis.MajorTickMark.TickMarkStyle == TickMarkStyle.AcrossAxis)
+ {
+ labelsZPosition -= this._axis.MajorTickMark.Size / 2f + this._axis.ChartArea.areaSceneWallWidth.Width;
+ }
+ }
+
+ //*****************************************************************
+ //** Check if labels should be drawn as back or front element.
+ //*****************************************************************
+ bool labelsInsidePlotArea = (this._axis.GetIsMarksNextToAxis() && !axisOnEdge);
+ if (backElements == labelsInsidePlotArea)
+ {
+ // Skip drawing
+ return;
+ }
+
+ //********************************************************************
+ //** Initialize all labels position rectangle
+ //********************************************************************
+ RectangleF rectLabels = this.GetAllLabelsRect(this._axis.ChartArea, this._axis.AxisPosition, format);
+
+ //********************************************************************
+ //** Calculate bounding rectangle used to truncate labels on the
+ //** chart area boundary if TruncatedLabels property is set to true.
+ //********************************************************************
+ RectangleF boundaryRect = rectLabels;
+ if (boundaryRect != RectangleF.Empty && _axis.totlaGroupingLabelsSize > 0)
+ {
+ if (this._axis.AxisPosition == AxisPosition.Left)
+ {
+ boundaryRect.X += _axis.totlaGroupingLabelsSize;
+ boundaryRect.Width -= _axis.totlaGroupingLabelsSize;
+ }
+ else if (this._axis.AxisPosition == AxisPosition.Right)
+ {
+ boundaryRect.Width -= _axis.totlaGroupingLabelsSize;
+ }
+ else if (this._axis.AxisPosition == AxisPosition.Top)
+ {
+ boundaryRect.Y += _axis.totlaGroupingLabelsSize;
+ boundaryRect.Height -= _axis.totlaGroupingLabelsSize;
+ }
+ else if (this._axis.AxisPosition == AxisPosition.Bottom)
+ {
+ boundaryRect.Height -= _axis.totlaGroupingLabelsSize;
+ }
+ }
+
+ // Pre-calculated height of the first labels row
+ float firstLabelsRowHeight = -1f;
+
+ // For 3D axis labels the first row of labels
+ // has to be drawn after all other rows because
+ // of hot regions.
+ for (int selectionRow = 0; selectionRow <= this._axis.GetGroupLabelLevelCount(); selectionRow++)
+ {
+ //********************************************************************
+ //** Draw all labels from the collection
+ //********************************************************************
+ int labelIndex = 0;
+ foreach (CustomLabel label in this._axis.CustomLabels)
+ {
+ bool truncatedLeft = false;
+ bool truncatedRight = false;
+ double labelFrom = label.FromPosition;
+ double labelTo = label.ToPosition;
+
+ if (label.RowIndex != selectionRow)
+ {
+ continue;
+ }
+
+ // Skip if label middle point is outside current scaleView
+ if (label.RowIndex == 0)
+ {
+ double middlePoint = (label.FromPosition + label.ToPosition) / 2.0;
+ if ((decimal)middlePoint < (decimal)_axis.ViewMinimum ||
+ (decimal)middlePoint > (decimal)_axis.ViewMaximum)
+ {
+ continue;
+ }
+ }
+ else
+ {
+ // Skip labels completly outside the scaleView
+ if (label.ToPosition <= _axis.ViewMinimum || label.FromPosition >= _axis.ViewMaximum)
+ {
+ continue;
+ }
+
+ // Check if label is partially visible
+ if (_axis.ScaleView.IsZoomed)
+ {
+ if (label.FromPosition < _axis.ViewMinimum)
+ {
+ truncatedLeft = true;
+ labelFrom = _axis.ViewMinimum;
+ }
+ if (label.ToPosition > _axis.ViewMaximum)
+ {
+ truncatedRight = true;
+ labelTo = _axis.ViewMaximum;
+ }
+ }
+ }
+
+
+ // Calculate single label position
+ RectangleF rect = rectLabels;
+
+ // Label is in the first row
+ if (label.RowIndex == 0)
+ {
+ if (this._axis.AxisPosition == AxisPosition.Left)
+ {
+ if (!this._axis.GetIsMarksNextToAxis())
+ {
+ rect.X = rectLabels.Right - _axis.unRotatedLabelSize;
+ rect.Width = _axis.unRotatedLabelSize;
+ }
+
+ // Adjust label rectangle if offset labels are used
+ if ((this._axis.autoLabelOffset == -1) ? this.IsStaggered : (this._axis.autoLabelOffset == 1))
+ {
+ rect.Width /= 2F;
+ if (labelIndex % 2 != 0F)
+ {
+ rect.X += rect.Width;
+ }
+ }
+ }
+ else if (this._axis.AxisPosition == AxisPosition.Right)
+ {
+ if (!this._axis.GetIsMarksNextToAxis())
+ {
+ rect.Width = _axis.unRotatedLabelSize;
+ }
+
+ // Adjust label rectangle if offset labels are used
+ if ((this._axis.autoLabelOffset == -1) ? this.IsStaggered : (this._axis.autoLabelOffset == 1))
+ {
+ rect.Width /= 2F;
+ if (labelIndex % 2 != 0F)
+ {
+ rect.X += rect.Width;
+ }
+ }
+ }
+ else if (this._axis.AxisPosition == AxisPosition.Top)
+ {
+ if (!this._axis.GetIsMarksNextToAxis())
+ {
+ rect.Y = rectLabels.Bottom - _axis.unRotatedLabelSize;
+ rect.Height = _axis.unRotatedLabelSize;
+ }
+
+ // Adjust label rectangle if offset labels are used
+ if ((this._axis.autoLabelOffset == -1) ? this.IsStaggered : (this._axis.autoLabelOffset == 1))
+ {
+ rect.Height /= 2F;
+ if (labelIndex % 2 != 0F)
+ {
+ rect.Y += rect.Height;
+ }
+ }
+ }
+ else if (this._axis.AxisPosition == AxisPosition.Bottom)
+ {
+ if (!this._axis.GetIsMarksNextToAxis())
+ {
+ rect.Height = _axis.unRotatedLabelSize;
+ }
+
+ // Adjust label rectangle if offset labels are used
+ if ((this._axis.autoLabelOffset == -1) ? this.IsStaggered : (this._axis.autoLabelOffset == 1))
+ {
+ rect.Height /= 2F;
+ if (labelIndex % 2 != 0F)
+ {
+ rect.Y += rect.Height;
+ }
+ }
+ }
+
+ // Increase label index
+ ++labelIndex;
+ }
+
+ // Label is in the second row
+ else if (label.RowIndex > 0)
+ {
+ // Hide grouping labels (where index of row > 0) when they are displayed
+ // not on the same side as their axis. Fixes MS issue #64.
+ if (labelsPosition != this._axis.AxisPosition)
+ {
+ continue;
+ }
+
+ if (_axis.AxisPosition == AxisPosition.Left)
+ {
+ rect.X += _axis.totlaGroupingLabelsSizeAdjustment;
+ for (int index = _axis.groupingLabelSizes.Length; index > label.RowIndex; index--)
+ {
+ rect.X += _axis.groupingLabelSizes[index - 1];
+ }
+ rect.Width = _axis.groupingLabelSizes[label.RowIndex - 1];
+ }
+ else if (_axis.AxisPosition == AxisPosition.Right)
+ {
+ rect.X = rect.Right - _axis.totlaGroupingLabelsSize - _axis.totlaGroupingLabelsSizeAdjustment;// + Axis.elementSpacing * 0.25f;
+ for (int index = 1; index < label.RowIndex; index++)
+ {
+ rect.X += _axis.groupingLabelSizes[index - 1];
+ }
+ rect.Width = _axis.groupingLabelSizes[label.RowIndex - 1];
+ }
+ else if (_axis.AxisPosition == AxisPosition.Top)
+ {
+ rect.Y += _axis.totlaGroupingLabelsSizeAdjustment;
+ for (int index = _axis.groupingLabelSizes.Length; index > label.RowIndex; index--)
+ {
+ rect.Y += _axis.groupingLabelSizes[index - 1];
+ }
+ rect.Height = _axis.groupingLabelSizes[label.RowIndex - 1];
+ }
+ if (_axis.AxisPosition == AxisPosition.Bottom)
+ {
+ rect.Y = rect.Bottom - _axis.totlaGroupingLabelsSize - _axis.totlaGroupingLabelsSizeAdjustment;
+ for (int index = 1; index < label.RowIndex; index++)
+ {
+ rect.Y += _axis.groupingLabelSizes[index - 1];
+ }
+ rect.Height = _axis.groupingLabelSizes[label.RowIndex - 1];
+ }
+ }
+
+ // Unknown label row value
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionAxisLabelRowIndexMustBe1Or2));
+ }
+
+ //********************************************************************
+ //** Set label From and To coordinates.
+ //********************************************************************
+ double fromPosition = _axis.GetLinearPosition(labelFrom);
+ double toPosition = _axis.GetLinearPosition(labelTo);
+ if (this._axis.AxisPosition == AxisPosition.Top || this._axis.AxisPosition == AxisPosition.Bottom)
+ {
+ rect.X = (float)Math.Min(fromPosition, toPosition);
+ rect.Width = (float)Math.Max(fromPosition, toPosition) - rect.X;
+ if (rect.Width < pixelSize.Width)
+ {
+ rect.Width = pixelSize.Width;
+ }
+
+ // Adjust label To/From position if offset labels are used
+ if (label.RowIndex == 0 &&
+ ((this._axis.autoLabelOffset == -1) ? this.IsStaggered : (this._axis.autoLabelOffset == 1)))
+ {
+ rect.X -= rect.Width / 2F;
+ rect.Width *= 2F;
+ }
+ }
+ else
+ {
+ rect.Y = (float)Math.Min(fromPosition, toPosition);
+ rect.Height = (float)Math.Max(fromPosition, toPosition) - rect.Y;
+ if (rect.Height < pixelSize.Height)
+ {
+ rect.Height = pixelSize.Height;
+ }
+
+ // Adjust label To/From position if offset labels are used
+ if (label.RowIndex == 0 &&
+ ((this._axis.autoLabelOffset == -1) ? this.IsStaggered : (this._axis.autoLabelOffset == 1)))
+ {
+ rect.Y -= rect.Height / 2F;
+ rect.Height *= 2F;
+ }
+ }
+
+ // Save original rect
+ RectangleF initialRect = new RectangleF(rect.Location, rect.Size);
+
+ //********************************************************************
+ //** Transform and adjust label rectangle coordinates in 3D space.
+ //********************************************************************
+ Point3D[] rectPoints = new Point3D[3];
+ if (this._axis.AxisPosition == AxisPosition.Left)
+ {
+ rectPoints[0] = new Point3D(rect.Right, rect.Y, labelsZPosition);
+ rectPoints[1] = new Point3D(rect.Right, rect.Y + rect.Height / 2f, labelsZPosition);
+ rectPoints[2] = new Point3D(rect.Right, rect.Bottom, labelsZPosition);
+ this._axis.ChartArea.matrix3D.TransformPoints(rectPoints);
+ rect.Y = rectPoints[0].Y;
+ rect.Height = rectPoints[2].Y - rect.Y;
+ rect.Width = rectPoints[1].X - rect.X;
+ }
+ else if (this._axis.AxisPosition == AxisPosition.Right)
+ {
+ rectPoints[0] = new Point3D(rect.X, rect.Y, labelsZPosition);
+ rectPoints[1] = new Point3D(rect.X, rect.Y + rect.Height / 2f, labelsZPosition);
+ rectPoints[2] = new Point3D(rect.X, rect.Bottom, labelsZPosition);
+ this._axis.ChartArea.matrix3D.TransformPoints(rectPoints);
+ rect.Y = rectPoints[0].Y;
+ rect.Height = rectPoints[2].Y - rect.Y;
+ rect.Width = rect.Right - rectPoints[1].X;
+ rect.X = rectPoints[1].X;
+ }
+ else if (this._axis.AxisPosition == AxisPosition.Top)
+ {
+ // Transform 3 points of the rectangle
+ rectPoints[0] = new Point3D(rect.X, rect.Bottom, labelsZPosition);
+ rectPoints[1] = new Point3D(rect.X + rect.Width / 2f, rect.Bottom, labelsZPosition);
+ rectPoints[2] = new Point3D(rect.Right, rect.Bottom, labelsZPosition);
+ this._axis.ChartArea.matrix3D.TransformPoints(rectPoints);
+
+ if (labelsPosition == AxisPosition.Top)
+ {
+ rect.X = rectPoints[0].X;
+ rect.Width = rectPoints[2].X - rect.X;
+ rect.Height = rectPoints[1].Y - rect.Y;
+ }
+ else if (labelsPosition == AxisPosition.Right)
+ {
+ RectangleF rightLabelsRect = this.GetAllLabelsRect(this._axis.ChartArea, labelsPosition, format);
+ rect.Y = rectPoints[0].Y;
+ rect.Height = rectPoints[2].Y - rect.Y;
+ rect.X = rectPoints[1].X;
+ rect.Width = rightLabelsRect.Right - rect.X;
+ }
+ else if (labelsPosition == AxisPosition.Left)
+ {
+ RectangleF rightLabelsRect = this.GetAllLabelsRect(this._axis.ChartArea, labelsPosition, format);
+ rect.Y = rectPoints[2].Y;
+ rect.Height = rectPoints[0].Y - rect.Y;
+ rect.X = rightLabelsRect.X;
+ rect.Width = rectPoints[1].X - rightLabelsRect.X;
+ }
+ }
+ else if (this._axis.AxisPosition == AxisPosition.Bottom)
+ {
+ // Transform 3 points of the rectangle
+ rectPoints[0] = new Point3D(rect.X, rect.Y, labelsZPosition);
+ rectPoints[1] = new Point3D(rect.X + rect.Width / 2f, rect.Y, labelsZPosition);
+ rectPoints[2] = new Point3D(rect.Right, rect.Y, labelsZPosition);
+ this._axis.ChartArea.matrix3D.TransformPoints(rectPoints);
+
+ if (labelsPosition == AxisPosition.Bottom)
+ {
+ rect.X = rectPoints[0].X;
+ rect.Width = rectPoints[2].X - rect.X;
+ rect.Height = rect.Bottom - rectPoints[1].Y;
+ rect.Y = rectPoints[1].Y;
+ }
+ else if (labelsPosition == AxisPosition.Right)
+ {
+ RectangleF rightLabelsRect = this.GetAllLabelsRect(this._axis.ChartArea, labelsPosition, format);
+ rect.Y = rectPoints[2].Y;
+ rect.Height = rectPoints[0].Y - rect.Y;
+ rect.X = rectPoints[1].X;
+ rect.Width = rightLabelsRect.Right - rect.X;
+
+ // Adjust label rect by shifting it down by quarter of the tick size
+ if (this._axis.autoLabelAngle == 0)
+ {
+ rect.Y += this._axis.markSize / 4f;
+ }
+ }
+ else if (labelsPosition == AxisPosition.Left)
+ {
+ RectangleF rightLabelsRect = this.GetAllLabelsRect(this._axis.ChartArea, labelsPosition, format);
+ rect.Y = rectPoints[0].Y;
+ rect.Height = rectPoints[2].Y - rect.Y;
+ rect.X = rightLabelsRect.X;
+ rect.Width = rectPoints[1].X - rightLabelsRect.X;
+
+ // Adjust label rect by shifting it down by quarter of the tick size
+ if (this._axis.autoLabelAngle == 0)
+ {
+ rect.Y += this._axis.markSize / 4f;
+ }
+ }
+ }
+
+ // Find axis with same position
+ Axis labelsAxis = null;
+ foreach (Axis curAxis in this._axis.ChartArea.Axes)
+ {
+ if (curAxis.AxisPosition == labelsPosition)
+ {
+ labelsAxis = curAxis;
+ break;
+ }
+ }
+
+ //********************************************************************
+ //** Adjust font angles for Top and Bottom axis
+ //********************************************************************
+ int labelsFontAngle = (_axis.autoLabelAngle < -90) ? angle : _axis.autoLabelAngle;
+ if (labelsPosition != this._axis.AxisPosition)
+ {
+ if ((this._axis.AxisPosition == AxisPosition.Top || this._axis.AxisPosition == AxisPosition.Bottom) &&
+ (labelsFontAngle == 90 || labelsFontAngle == -90))
+ {
+ labelsFontAngle = 0;
+ }
+ else if (this._axis.AxisPosition == AxisPosition.Bottom)
+ {
+ if (labelsPosition == AxisPosition.Left && labelsFontAngle > 0)
+ {
+ labelsFontAngle = -labelsFontAngle;
+ }
+ else if (labelsPosition == AxisPosition.Right && labelsFontAngle < 0)
+ {
+ labelsFontAngle = -labelsFontAngle;
+ }
+ }
+ else if (this._axis.AxisPosition == AxisPosition.Top)
+ {
+ if (labelsPosition == AxisPosition.Left && labelsFontAngle < 0)
+ {
+ labelsFontAngle = -labelsFontAngle;
+ }
+ else if (labelsPosition == AxisPosition.Right && labelsFontAngle > 0)
+ {
+ labelsFontAngle = -labelsFontAngle;
+ }
+ }
+ }
+
+ //********************************************************************
+ //** NOTE: Code below improves chart labels readability in scenarios
+ //** described in MS issue #65.
+ //**
+ //** Prevent labels in the first row from overlapping the grouping
+ //** labels in the rows below. The solution only apply to the limited
+ //** use cases defined by the condition below.
+ //********************************************************************
+ StringFormatFlags oldFormatFlags = format.FormatFlags;
+
+ if (label.RowIndex == 0 &&
+ labelsFontAngle == 0 &&
+ _axis.groupingLabelSizes != null &&
+ _axis.groupingLabelSizes.Length > 0 &&
+ this._axis.AxisPosition == AxisPosition.Bottom &&
+ labelsPosition == AxisPosition.Bottom &&
+ !((this._axis.autoLabelOffset == -1) ? this.IsStaggered : (this._axis.autoLabelOffset == 1)))
+ {
+ if (firstLabelsRowHeight == -1f)
+ {
+ // Calculate first labels row max height
+ Point3D[] labelPositionPoints = new Point3D[1];
+ labelPositionPoints[0] = new Point3D(initialRect.X, initialRect.Bottom - _axis.totlaGroupingLabelsSize - _axis.totlaGroupingLabelsSizeAdjustment, labelsZPosition);
+ this._axis.ChartArea.matrix3D.TransformPoints(labelPositionPoints);
+
+ float height = labelPositionPoints[0].Y - rect.Y;
+
+ firstLabelsRowHeight = (height > 0f) ? height : rect.Height;
+ }
+
+ // Resuse pre-calculated first labels row height
+ rect.Height = firstLabelsRowHeight;
+
+ // Change current string format to prevent strings to go out of the
+ // specified bounding rectangle
+ if ((format.FormatFlags & StringFormatFlags.LineLimit) == 0)
+ {
+ format.FormatFlags |= StringFormatFlags.LineLimit;
+ }
+ }
+
+
+ //********************************************************************
+ //** Draw label text.
+ //********************************************************************
+
+ using (Brush brush = new SolidBrush((label.ForeColor.IsEmpty) ? _foreColor : label.ForeColor))
+ {
+ graph.DrawLabelStringRel(
+ labelsAxis,
+ label.RowIndex,
+ label.LabelMark,
+ label.MarkColor,
+ label.Text,
+ label.Image,
+ label.ImageTransparentColor,
+ (_axis.autoLabelFont == null) ? _font : _axis.autoLabelFont,
+ brush,
+ rect,
+ format,
+ labelsFontAngle,
+ (!this.TruncatedLabels || label.RowIndex > 0) ? RectangleF.Empty : boundaryRect,
+ label,
+ truncatedLeft,
+ truncatedRight);
+ }
+
+ // Restore old string format that was temporary modified
+ if (format.FormatFlags != oldFormatFlags)
+ {
+ format.FormatFlags = oldFormatFlags;
+ }
+ }
+ }
+ }
+ }
+
+ #endregion
+
+ #region Helper methods
+
+ /// <summary>
+ /// Sets the axis to which this object attached to.
+ /// </summary>
+ /// <returns>Axis object.</returns>
+ internal Axis Axis
+ {
+ set { _axis = value; }
+ }
+
+
+ /// <summary>
+ /// Invalidate chart picture
+ /// </summary>
+ internal override void Invalidate()
+ {
+#if Microsoft_CONTROL
+
+ if(this._axis != null)
+ {
+ this._axis.Invalidate();
+ }
+#endif
+ base.Invalidate();
+ }
+
+ #endregion
+
+ #region Label properties
+
+ /// <summary>
+ /// Gets or sets the interval offset of the label.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeLabel_IntervalOffset"),
+ DefaultValue(Double.NaN),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ TypeConverter(typeof(AxisElementIntervalValueConverter))
+ ]
+ public double IntervalOffset
+ {
+ get
+ {
+ return intervalOffset;
+ }
+ set
+ {
+ intervalOffset = value;
+ this.Invalidate();
+ }
+ }
+
+
+
+ /// <summary>
+ /// Gets the interval offset.
+ /// </summary>
+ /// <returns></returns>
+ internal double GetIntervalOffset()
+ {
+ if(double.IsNaN(intervalOffset) && this._axis != null)
+ {
+ return this._axis.IntervalOffset;
+ }
+ return intervalOffset;
+ }
+
+ /// <summary>
+ /// Gets or sets the unit of measurement of the label offset.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ Bindable(true),
+ DefaultValue(DateTimeIntervalType.NotSet),
+ SRDescription("DescriptionAttributeLabel_IntervalOffsetType"),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public DateTimeIntervalType IntervalOffsetType
+ {
+ get
+ {
+ return intervalOffsetType;
+ }
+ set
+ {
+ intervalOffsetType = value;
+ this.Invalidate();
+ }
+ }
+
+
+ /// <summary>
+ /// Gets the type of the interval offset.
+ /// </summary>
+ /// <returns></returns>
+ internal DateTimeIntervalType GetIntervalOffsetType()
+ {
+ if(intervalOffsetType == DateTimeIntervalType.NotSet && this._axis != null)
+ {
+ return this._axis.IntervalOffsetType;
+ }
+ return intervalOffsetType;
+ }
+
+ /// <summary>
+ /// Gets or sets the interval size of the label.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ Bindable(true),
+ DefaultValue(Double.NaN),
+ SRDescription("DescriptionAttributeLabel_Interval"),
+ TypeConverter(typeof(AxisElementIntervalValueConverter)),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ ]
+ public double Interval
+ {
+ get
+ {
+ return interval;
+ }
+ set
+ {
+ interval = value;
+
+ // Reset original property value fields
+ if (this._axis != null)
+ {
+ this._axis.tempLabelInterval = interval;
+ }
+
+ this.Invalidate();
+ }
+ }
+
+
+ /// <summary>
+ /// Gets the interval.
+ /// </summary>
+ /// <returns></returns>
+ internal double GetInterval()
+ {
+ if(double.IsNaN(interval) && this._axis != null)
+ {
+ return this._axis.Interval;
+ }
+ return interval;
+ }
+
+ /// <summary>
+ /// Gets or sets the unit of measurement of the interval size of the label.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ Bindable(true),
+ DefaultValue(DateTimeIntervalType.NotSet),
+ SRDescription("DescriptionAttributeLabel_IntervalType"),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public DateTimeIntervalType IntervalType
+ {
+ get
+ {
+ return intervalType;
+ }
+ set
+ {
+ intervalType = value;
+
+ // Reset original property value fields
+ if (this._axis != null)
+ {
+ this._axis.tempLabelIntervalType = intervalType;
+ }
+
+ this.Invalidate();
+ }
+ }
+
+
+ /// <summary>
+ /// Gets the type of the interval.
+ /// </summary>
+ /// <returns></returns>
+ internal DateTimeIntervalType GetIntervalType()
+ {
+ if(intervalType == DateTimeIntervalType.NotSet && this._axis != null)
+ {
+ return this._axis.IntervalType;
+ }
+ return intervalType;
+ }
+
+ /// <summary>
+ /// Gets or sets the font of the label.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Font), "Microsoft Sans Serif, 8pt"),
+ SRDescription("DescriptionAttributeLabel_Font"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Font Font
+ {
+ get
+ {
+ return _font;
+ }
+ set
+ {
+ // Turn off labels autofitting
+ if (this._axis != null && this._axis.Common!=null && this._axis.Common.Chart != null)
+ {
+ if(!this._axis.Common.Chart.serializing)
+ {
+ this._axis.IsLabelAutoFit = false;
+ }
+ }
+
+ _font = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the fore color of the label.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeFontColor"),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color ForeColor
+ {
+ get
+ {
+ return _foreColor;
+ }
+ set
+ {
+ _foreColor = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value that represents the angle at which font is drawn.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(0),
+ SRDescription("DescriptionAttributeLabel_FontAngle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ RefreshPropertiesAttribute(RefreshProperties.All)
+ ]
+ public int Angle
+ {
+ get
+ {
+ return angle;
+ }
+ set
+ {
+ if(value < -90 || value > 90)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionAxisLabelFontAngleInvalid));
+ }
+
+ // Turn of label offset if angle is not 0, 90 or -90
+ if(IsStaggered && value != 0 && value != -90 && value != 90)
+ {
+ IsStaggered = false;
+ }
+
+ // Turn off labels autofitting
+ if(this._axis != null && this._axis.Common!=null && this._axis.Common.Chart != null)
+ {
+ if (!this._axis.Common.Chart.serializing)
+ {
+ this._axis.IsLabelAutoFit = false;
+ }
+ }
+
+ angle = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a property which specifies whether the labels are shown with offset.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeLabel_OffsetLabels"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ RefreshPropertiesAttribute(RefreshProperties.All)
+ ]
+ public bool IsStaggered
+ {
+ get
+ {
+ return isStaggered;
+ }
+ set
+ {
+ // Make sure that angle is 0, 90 or -90
+ if(value && (this.Angle != 0 || this.Angle != -90 || this.Angle != 90))
+ {
+ this.Angle = 0;
+ }
+
+ // Turn off labels autofitting
+ if (this._axis != null && this._axis.Common != null && this._axis.Common.Chart != null)
+ {
+ if (!this._axis.Common.Chart.serializing)
+ {
+ this._axis.IsLabelAutoFit = false;
+ }
+ }
+
+ isStaggered = value;
+
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a property which specifies whether the labels are shown at axis ends.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeLabel_ShowEndLabels"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public bool IsEndLabelVisible
+ {
+ get
+ {
+ return _isEndLabelVisible;
+ }
+ set
+ {
+ _isEndLabelVisible = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a property which specifies whether the label can be truncated.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeLabel_TruncatedLabels"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public bool TruncatedLabels
+ {
+ get
+ {
+ return _truncatedLabels;
+ }
+ set
+ {
+ _truncatedLabels = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the formatting string for the label text.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeLabel_Format"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ ]
+ public string Format
+ {
+ get
+ {
+ return _format;
+ }
+ set
+ {
+ _format = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a property which indicates whether the label is enabled.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeLabel_Enabled"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public bool Enabled
+ {
+ get
+ {
+ return _enabled;
+ }
+ set
+ {
+ _enabled = value;
+ this.Invalidate();
+ }
+ }
+ #endregion
+
+ #region IDisposable Members
+
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ //Free managed resources
+ if (_fontCache!=null)
+ {
+ _fontCache.Dispose();
+ _fontCache = null;
+ }
+ }
+ }
+
+ #endregion
+
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Legend.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Legend.cs
new file mode 100644
index 00000000000..4b4a99955f3
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Legend.cs
@@ -0,0 +1,6284 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: Legend.cs
+//
+// Namespace: DataVisualization.Charting
+//
+// Classes: Legend, LegendCollection, LegendItemsCollection,
+// LegendItem
+//
+// Purpose: Chart Legend consist of default and custom legend
+// items. Default items are automatically added based
+// on the data series and custom items are added by
+// the user. Each item usually consist of 2 cells;
+// series color marker and series name. Legend item
+// cells form vertical columns in the legend.
+//
+// Please refer to the Chart documentation which
+// contains images and samples describing legend features.
+//
+// NOTE: In early versions of the Chart control only 1 legend was
+// exposed through the Legend property of the root chart object.
+// Due to the customer requests, support for unlimited number of
+// legends was added through the LegendCollection exposed as a
+// Legends property in the root chart object. Old propertys was
+// deprecated and marked as non-browsable.
+//
+// Reviewed: AG - Jul 31, 2002;
+// GS - Aug 7, 2002
+// AG - Microsoft 14, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Drawing2D;
+using System.Globalization;
+using System.Diagnostics.CodeAnalysis;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.ComponentModel.Design.Serialization;
+ using System.Reflection;
+ using System.Windows.Forms.Design;
+#else
+ using System.Web;
+ using System.Web.UI;
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+#endif
+
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ #region Legend enumerations
+
+ /// <summary>
+ /// An enumeration of legend item orderings.
+ /// </summary>
+ public enum LegendItemOrder
+ {
+ /// <summary>
+ /// Items will be added into the legend in an order automatically determined by the chart.
+ /// </summary>
+ Auto,
+
+ /// <summary>
+ /// Items will be added into the legend in the same order as the chart series.
+ /// </summary>
+ SameAsSeriesOrder,
+
+ /// <summary>
+ /// Items will be added into the legend in the same order as the chart series.
+ /// </summary>
+ ReversedSeriesOrder
+
+ };
+
+ /// <summary>
+ /// An enumeration of legend separator styles.
+ /// </summary>
+ public enum LegendSeparatorStyle
+ {
+ /// <summary>
+ /// No separator will be shown.
+ /// </summary>
+ None,
+
+ /// <summary>
+ /// Single solid line separator.
+ /// </summary>
+ Line,
+
+ /// <summary>
+ /// Single solid thick line separator.
+ /// </summary>
+ ThickLine,
+
+ /// <summary>
+ /// Double solid line separator.
+ /// </summary>
+ DoubleLine,
+
+ /// <summary>
+ /// Single dash line separator.
+ /// </summary>
+ DashLine,
+
+ /// <summary>
+ /// Single dot line separator.
+ /// </summary>
+ DotLine,
+
+ /// <summary>
+ /// Gradient solid line separator.
+ /// </summary>
+ GradientLine,
+
+ /// <summary>
+ /// Thick gradient solid line separator.
+ /// </summary>
+ ThickGradientLine,
+ }
+
+
+
+ /// <summary>
+ /// An enumeration that specifies a style for a legend item's symbol.
+ /// </summary>
+ public enum LegendImageStyle
+ {
+ /// <summary>
+ /// The symbol will be a rectangle.
+ /// </summary>
+ Rectangle,
+
+ /// <summary>
+ /// The symbol will be a line.
+ /// </summary>
+ Line,
+
+ /// <summary>
+ /// The symbol will be a marker.
+ /// </summary>
+ Marker
+ }
+
+ /// <summary>
+ /// An enumeration of legend styles.
+ /// </summary>
+ public enum LegendStyle
+ {
+ /// <summary>
+ /// One column, many rows.
+ /// </summary>
+ Column,
+
+ /// <summary>
+ /// One row, many columns.
+ /// </summary>
+ Row,
+
+ /// <summary>
+ /// Many column, many rows.
+ /// </summary>
+ Table
+ };
+
+ /// <summary>
+ /// An enumeration of legend table styles.
+ /// </summary>
+ public enum LegendTableStyle
+ {
+ /// <summary>
+ /// The legend table style is automatically determined by the chart.
+ /// </summary>
+ Auto,
+
+ /// <summary>
+ /// The legend items will be fit horizontally within the legend.
+ /// It is preferred to use this style when the docking is set to top or bottom.
+ /// </summary>
+ Wide,
+
+ /// <summary>
+ /// The legend items will be fit vertically within the legend.
+ /// It is preferred to use this style when docking is set to left or right.
+ /// </summary>
+ Tall
+ };
+
+ #endregion
+
+ /// <summary>
+ /// The legend class represents a single chart legend. It contains visual
+ /// appearance, position and content properties. This class is also
+ /// responsible for drawing and positioning of the legend.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeLegend_Legend"),
+ DefaultProperty("Enabled"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class Legend : ChartNamedElement
+ {
+ #region Fields
+
+ //***********************************************************
+ //** Private data members, which store properties values
+ //***********************************************************
+ private ElementPosition _position = null;
+ private bool _enabled = true;
+
+ private LegendStyle _legendStyle = LegendStyle.Table;
+
+ private LegendTableStyle _legendTableStyle = LegendTableStyle.Auto;
+ private LegendItemsCollection _customLegends = null;
+ private ChartHatchStyle _backHatchStyle = ChartHatchStyle.None;
+ private string _backImage = "";
+ private ChartImageWrapMode _backImageWrapMode = ChartImageWrapMode.Tile;
+ private Color _backImageTransparentColor = Color.Empty;
+ private ChartImageAlignmentStyle _backImageAlignment = ChartImageAlignmentStyle.TopLeft;
+ private GradientStyle _backGradientStyle = GradientStyle.None;
+ private Color _backSecondaryColor = Color.Empty;
+ private Color _borderColor = Color.Empty;
+ private Color _backColor = Color.Empty;
+ private int _borderWidth = 1;
+ private ChartDashStyle _borderDashStyle = ChartDashStyle.Solid;
+ private FontCache _fontCache = new FontCache();
+ private Font _font = null;
+ private Color _foreColor = Color.Black;
+ private StringAlignment _legendAlignment = StringAlignment.Near;
+ private Docking _legendDocking = Docking.Right;
+ private int _shadowOffset = 0;
+ private Color _shadowColor = Color.FromArgb(128, 0, 0, 0);
+ private bool _isTextAutoFit = true;
+ private string _dockedToChartArea = Constants.NotSetValue;
+ private bool _isDockedInsideChartArea = true;
+
+ //***********************************************************
+ //** Private data members
+ //***********************************************************
+
+ // Collection of custom and series legend items
+ internal LegendItemsCollection legendItems = null;
+
+ // Number of rows and columns
+ private int _itemColumns = 0;
+
+
+ // Font calculated by auto fitting
+ internal Font autofitFont = null;
+
+ // Indicates that all items in the legend should be equally spaced
+ private bool _isEquallySpacedItems = false;
+
+
+ // Indicate that legend rows should be drawn with isInterlaced background color.
+ private bool _interlacedRows = false;
+
+ // Legend isInterlaced rows color
+ private Color _interlacedRowsColor = Color.Empty;
+
+ // Legend offsets
+ private Size _offset = Size.Empty;
+
+ // Adjustment point used for legend animation
+ private float _maximumLegendAutoSize = 50f;
+
+ // Text length after which the legend item text will be wrapped on the next whitespace.
+ private int _textWrapThreshold = 25;
+
+ // Value used to calculate auto-fit font size from the legend Font.
+ private int _autoFitFontSizeAdjustment = 0;
+
+ // Legend column collection
+ private LegendCellColumnCollection _cellColumns = null;
+
+ // Indicates that legend items automatically added based on the exsisting
+ // series in reversed order.
+ private LegendItemOrder _legendItemOrder = LegendItemOrder.Auto;
+
+ // Legend title text
+ private string _title = String.Empty;
+
+ // Legend title color
+ private Color _titleForeColor = Color.Black;
+
+ // Legend title back color
+ private Color _titleBackColor = Color.Empty;
+
+ // Legend title font
+ private Font _titleFont = null;
+
+ // Legend title alignment
+ private StringAlignment _titleAlignment = StringAlignment.Center;
+
+ // Legend title visual separator
+ private LegendSeparatorStyle _titleSeparator = LegendSeparatorStyle.None;
+
+ // Legend title visual separator color
+ private Color _titleSeparatorColor = Color.Black;
+
+ // Legend header visual separator
+ private LegendSeparatorStyle _headerSeparator = LegendSeparatorStyle.None;
+
+ // Legend header visual separator color
+ private Color _headerSeparatorColor = Color.Black;
+
+ // Legend table columns visual separator
+ private LegendSeparatorStyle _itemColumnSeparator = LegendSeparatorStyle.None;
+
+ // Legend table columns visual separator color
+ private Color _itemColumnSeparatorColor = Color.Black;
+
+ // Legend table column spacing calculated as a percentage of the font
+ private int _itemColumnSpacing = 50;
+
+ // Legend table column spacing calculated in relative coordinates
+ private int _itemColumnSpacingRel = 0;
+
+ // Legend title position in pixelcoordinates.
+ // Note that legend title always docked to the top of the legend.
+ private Rectangle _titlePosition = Rectangle.Empty;
+
+ // Legend header position in pixel coordinates.
+ private Rectangle _headerPosition = Rectangle.Empty;
+
+ // Minimum font size that can be used by the legend auto-fitting algorithm
+ private int _autoFitMinFontSize = 7;
+
+ // Horizontal space left after fitting legend items
+ private int _horizontalSpaceLeft = 0;
+
+ // Vertical space left after fitting legend items
+ private int _verticalSpaceLeft = 0;
+
+ // Sub-columns sizes calculated during the fitting process
+ private int[,] _subColumnSizes = null;
+
+ // Legend item heigts
+ private int[,] _cellHeights = null;
+
+ // Number of rows per each legend table column
+ private int[] _numberOfRowsPerColumn = null;
+
+ // Number of items from the collection that should be processed
+ private int _numberOfLegendItemsToProcess = -1;
+
+ // Legend items area position in pixels
+ private Rectangle _legendItemsAreaPosition = Rectangle.Empty;
+
+ // Indicates that not all legend items were able to fit the legend
+ private bool _legendItemsTruncated = false;
+
+ // Size of the dots (pixels) that will drawn on the bottom of the legend when it is truncated
+ private int _truncatedDotsSize = 3;
+
+ // Maximum number of cells in the legend item
+ private int _numberOfCells = -1;
+
+ // Pixel size of the 'W' character
+ internal Size singleWCharacterSize = Size.Empty;
+
+
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// Legend constructor
+ /// </summary>
+ public Legend()
+ {
+ _position = new ElementPosition(this);
+ // Initialize custom items collection
+ _customLegends = new LegendItemsCollection(this);
+ legendItems = new LegendItemsCollection(this);
+ _cellColumns = new LegendCellColumnCollection(this);
+ _font = _fontCache.DefaultFont;
+ _titleFont = _fontCache.DefaultBoldFont;
+ }
+
+ /// <summary>
+ /// Legend constructor
+ /// </summary>
+ /// <param name="name">The legend name.</param>
+ public Legend(string name) : base (name)
+ {
+ _position = new ElementPosition(this);
+ // Initialize custom items collection
+ _customLegends = new LegendItemsCollection(this);
+ legendItems = new LegendItemsCollection(this);
+ _cellColumns = new LegendCellColumnCollection(this);
+ _font = _fontCache.DefaultFont;
+ _titleFont = _fontCache.DefaultBoldFont;
+ }
+
+ #endregion
+
+ #region Legend position & size methods
+
+ /// <summary>
+ /// Recalculates legend information:
+ /// - legend items collection
+ /// - maximum text rectangle
+ /// </summary>
+ /// <param name="chartGraph">Reference to the chart graphics.</param>
+ private void RecalcLegendInfo(ChartGraphics chartGraph)
+ {
+ // Reset some values
+ RectangleF legendPositionRel = _position.ToRectangleF();
+ Rectangle legendPosition = Rectangle.Round(chartGraph.GetAbsoluteRectangle(legendPositionRel));
+
+ //***********************************************************
+ //** Use size of the "W" characters in current font to
+ //** calculate legend spacing
+ //***********************************************************
+ this.singleWCharacterSize = chartGraph.MeasureStringAbs("W", this.Font);
+ Size doubleCharacterSize = chartGraph.MeasureStringAbs("WW", this.Font);
+ this.singleWCharacterSize.Width = doubleCharacterSize.Width - this.singleWCharacterSize.Width;
+
+ // Calculate left, top offset and column spacing
+ this._offset.Width = (int)Math.Ceiling(singleWCharacterSize.Width / 2f);
+ this._offset.Height = (int)Math.Ceiling(singleWCharacterSize.Width / 3f);
+
+ // Calculate item column spacing and make sure it is dividable by 2
+ this._itemColumnSpacingRel = (int)(singleWCharacterSize.Width * (this._itemColumnSpacing / 100f));
+ if(this._itemColumnSpacingRel % 2 == 1)
+ {
+ this._itemColumnSpacingRel += 1;
+ }
+
+ //***********************************************************
+ //** Calculate how much space required for the title.
+ //***********************************************************
+ this._titlePosition = Rectangle.Empty;
+ if(this.Title.Length > 0)
+ {
+ // Measure title text size
+ Size titleSize = this.GetTitleSize(chartGraph, legendPosition.Size);
+
+ // Set legend title position
+ this._titlePosition = new Rectangle(
+ legendPosition.Location.X,
+ legendPosition.Location.Y,
+ legendPosition.Width,
+ Math.Min(legendPosition.Height, titleSize.Height));
+
+ // Adjust legend items position height
+ legendPosition.Height -= this._titlePosition.Height;
+
+ // Increase title top location by border height
+ this._titlePosition.Y += this.GetBorderSize();
+ }
+
+
+ //***********************************************************
+ //** Calculate how much space required for the header.
+ //***********************************************************
+ this._headerPosition = Rectangle.Empty;
+
+ // Find the largest (height only) header
+ Size highestHeader = Size.Empty;
+ foreach(LegendCellColumn legendColumn in this.CellColumns)
+ {
+ if(legendColumn.HeaderText.Length > 0)
+ {
+ // Measure header text size
+ Size headerSize = this.GetHeaderSize(chartGraph, legendColumn);
+
+ // Get header with maximum height
+ highestHeader.Height = Math.Max(highestHeader.Height, headerSize.Height);
+ }
+ }
+
+ // Check if any headers where found
+ if(!highestHeader.IsEmpty)
+ {
+ // Set legend header position
+ this._headerPosition = new Rectangle(
+ legendPosition.Location.X + this.GetBorderSize() + this._offset.Width,
+ legendPosition.Location.Y + this._titlePosition.Height,
+ legendPosition.Width - (this.GetBorderSize() + this._offset.Width) * 2,
+ Math.Min(legendPosition.Height - this._titlePosition.Height, highestHeader.Height));
+ this._headerPosition.Height = Math.Max(this._headerPosition.Height, 0);
+
+ // Adjust legend items position height
+ legendPosition.Height -= this._headerPosition.Height;
+
+ // Increase header top location by border height
+ this._headerPosition.Y += this.GetBorderSize();
+ }
+
+
+ //***********************************************************
+ //** Calculate size available for all legend items
+ //***********************************************************
+ this._legendItemsAreaPosition = new Rectangle(
+ legendPosition.X + this._offset.Width + this.GetBorderSize(),
+ legendPosition.Y + this._offset.Height + this.GetBorderSize() + this._titlePosition.Height + this._headerPosition.Height,
+ legendPosition.Width - 2 * (this._offset.Width + this.GetBorderSize()),
+ legendPosition.Height - 2 * (this._offset.Height + this.GetBorderSize()) );
+
+ //***********************************************************
+ //** Calculate number of rows and columns depending on
+ //** the legend style
+ //***********************************************************
+ this.GetNumberOfRowsAndColumns(
+ chartGraph,
+ this._legendItemsAreaPosition.Size,
+ -1,
+ out this._numberOfRowsPerColumn,
+ out this._itemColumns,
+ out this._horizontalSpaceLeft,
+ out this._verticalSpaceLeft);
+
+ //***********************************************************
+ //** Try to fit all legend item cells reducing the font size
+ //***********************************************************
+
+ // Reset auto-fit font adjustment value and truncated legend flag
+ this._autoFitFontSizeAdjustment = 0;
+ this._legendItemsTruncated = false;
+
+ // Check if legend items fit into the legend area
+ bool autoFitDone = (this._horizontalSpaceLeft >= 0 && this._verticalSpaceLeft >= 0);
+
+ // Calculate total number of items fit and make sure we fit all of them
+ this._numberOfLegendItemsToProcess = this.legendItems.Count;
+ int itemsFit = 0;
+ for(int index = 0; index < this._itemColumns; index++)
+ {
+ itemsFit += this._numberOfRowsPerColumn[index];
+ }
+ if(itemsFit < this._numberOfLegendItemsToProcess)
+ {
+ autoFitDone = false;
+ }
+
+ // If items do not fit try reducing font or number of legend items
+ this.autofitFont = this.Font;
+ if(!autoFitDone)
+ {
+ do
+ {
+ // Check if legend item font size can be reduced
+ if(this.IsTextAutoFit &&
+ (this.Font.Size - this._autoFitFontSizeAdjustment) > this._autoFitMinFontSize)
+ {
+ // Reduce font size by one
+ ++this._autoFitFontSizeAdjustment;
+
+ // Calculate new font size
+ int newFontSize = (int)Math.Round(this.Font.Size - this._autoFitFontSizeAdjustment);
+ if(newFontSize < 1)
+ {
+ // Font can't be less than size 1
+ newFontSize = 1;
+ }
+
+ // Create new font
+ this.autofitFont = this.Common.ChartPicture.FontCache.GetFont(
+ this.Font.FontFamily,
+ newFontSize,
+ this.Font.Style,
+ this.Font.Unit);
+
+ // Calculate number of rows and columns
+ this.GetNumberOfRowsAndColumns(
+ chartGraph,
+ this._legendItemsAreaPosition.Size,
+ -1,
+ out this._numberOfRowsPerColumn,
+ out this._itemColumns,
+ out this._horizontalSpaceLeft,
+ out this._verticalSpaceLeft);
+
+ autoFitDone = (this._horizontalSpaceLeft >= 0 && this._verticalSpaceLeft >= 0);
+
+ // Calculate total number of items fit and make sure we fit all of them
+ itemsFit = 0;
+ for(int index = 0; index < this._itemColumns; index++)
+ {
+ itemsFit += this._numberOfRowsPerColumn[index];
+ }
+ if(itemsFit < this._numberOfLegendItemsToProcess)
+ {
+ autoFitDone = false;
+ }
+
+ }
+ else
+ {
+ // If font size cannot be reduced start removing legend items
+ if(this._numberOfLegendItemsToProcess > 2)
+ {
+ // Handle case of 1 column that do not fit horizontally
+ if(this._itemColumns == 1 && (this._horizontalSpaceLeft < 0 && this._verticalSpaceLeft >= 0))
+ {
+ autoFitDone = true;
+ this._numberOfLegendItemsToProcess =
+ Math.Min(this._numberOfLegendItemsToProcess, this._numberOfRowsPerColumn[0]);
+ }
+ // Handle case of 1 row that do not fit vertically
+ else if(this.GetMaximumNumberOfRows() == 1 && (this._verticalSpaceLeft < 0 && this._horizontalSpaceLeft >= 0))
+ {
+ autoFitDone = true;
+ this._numberOfLegendItemsToProcess =
+ Math.Min(this._numberOfLegendItemsToProcess, this._itemColumns);
+ }
+ else
+ {
+ // Adjust legend items area height by size required to show
+ // visually (dots) that legend is truncated
+ if(!this._legendItemsTruncated)
+ {
+ this._legendItemsAreaPosition.Height -= this._truncatedDotsSize;
+ }
+
+ // Remove last legend item
+ this._legendItemsTruncated = true;
+ --this._numberOfLegendItemsToProcess;
+
+ // RecalculateAxesScale number of rows and columns
+ this.GetNumberOfRowsAndColumns(
+ chartGraph,
+ this._legendItemsAreaPosition.Size,
+ this._numberOfLegendItemsToProcess,
+ out this._numberOfRowsPerColumn,
+ out this._itemColumns);
+ }
+
+ // Make sure we show truncated legend symbols when not all items shown
+ if(autoFitDone &&
+ !this._legendItemsTruncated &&
+ this._numberOfLegendItemsToProcess < this.legendItems.Count)
+ {
+ // Adjust legend items area height by size required to show
+ // visually (dots) that legend is truncated
+ this._legendItemsAreaPosition.Height -= this._truncatedDotsSize;
+
+ // Legend is truncated
+ this._legendItemsTruncated = true;
+ }
+ }
+ else
+ {
+ autoFitDone = true;
+ }
+
+ // Check if legend items fit into the legend area
+ if(!autoFitDone)
+ {
+ autoFitDone = this.CheckLegendItemsFit(
+ chartGraph,
+ this._legendItemsAreaPosition.Size,
+ this._numberOfLegendItemsToProcess,
+ this._autoFitFontSizeAdjustment,
+ this._itemColumns,
+ this._numberOfRowsPerColumn,
+ out this._subColumnSizes,
+ out this._cellHeights,
+ out this._horizontalSpaceLeft,
+ out this._verticalSpaceLeft);
+
+ }
+ }
+ } while(!autoFitDone);
+ }
+
+
+ //***********************************************************
+ //** Calculate position of all cells
+ //***********************************************************
+
+ // Calculate item vertical spacing in relative coordinates but rounded on pixel boundary
+ Size itemHalfSpacing = Size.Empty;
+ if(this._verticalSpaceLeft > 0)
+ {
+ itemHalfSpacing.Height = (int)(this._verticalSpaceLeft / this.GetMaximumNumberOfRows() / 2);
+ }
+ if(this._horizontalSpaceLeft > 0)
+ {
+ itemHalfSpacing.Width = (int)(_horizontalSpaceLeft / 2);
+ }
+
+ // Iterate through all legend items
+ int currentColumn = 0;
+ int currentRow = 0;
+ if(this._numberOfLegendItemsToProcess < 0)
+ {
+ this._numberOfLegendItemsToProcess = this.legendItems.Count;
+ }
+ for(int legendItemIndex = 0; legendItemIndex < this._numberOfLegendItemsToProcess; legendItemIndex++)
+ {
+ LegendItem legendItem = this.legendItems[legendItemIndex];
+
+ // Iterate through legend item cells
+ for(int cellIndex = 0; cellIndex < legendItem.Cells.Count; cellIndex++)
+ {
+ // Get legend cell
+ LegendCell legendCell = legendItem.Cells[cellIndex];
+
+ // Calculate cell position
+ Rectangle cellPosition = this.GetCellPosition(currentColumn, currentRow, cellIndex, itemHalfSpacing);
+
+ // Check if current cell spans through more than 1 cell
+ int overlappedCellsNumber = 0;
+ if(legendCell.CellSpan > 1)
+ {
+ for(int spanIndex = 1; spanIndex < legendCell.CellSpan && (cellIndex + spanIndex) < legendItem.Cells.Count; spanIndex++)
+ {
+ // Calculate overlapped cell position
+ Rectangle overlappedCellPosition = this.GetCellPosition(currentColumn, currentRow, cellIndex + spanIndex, itemHalfSpacing);
+
+ // Adjust current cell right position
+ if(cellPosition.Right < overlappedCellPosition.Right)
+ {
+ cellPosition.Width += overlappedCellPosition.Right - cellPosition.Right;
+ }
+
+ // Increase number of overlapped cells
+ ++overlappedCellsNumber;
+
+ // Set empty size for the overlapped cells
+ LegendCell overlappedLegendCell = legendItem.Cells[cellIndex + spanIndex];
+ overlappedLegendCell.SetCellPosition(
+ currentRow,
+ Rectangle.Empty,
+ this.singleWCharacterSize);
+ }
+ }
+
+ // Make sure cell is drawn inside the legend
+ cellPosition.Intersect(this._legendItemsAreaPosition);
+
+ // Set cell object position
+ legendCell.SetCellPosition(
+ currentRow,
+ cellPosition,
+ this.singleWCharacterSize);
+
+ // Skip overlapped cells
+ cellIndex += overlappedCellsNumber;
+ }
+
+ // Advance to the next row/column. Break if number of legend items exceed
+ // number of availabale rows/columns.
+ ++currentRow;
+ if(currentRow >= this._numberOfRowsPerColumn[currentColumn])
+ {
+ ++currentColumn;
+ currentRow = 0;
+ if(currentColumn >= this._itemColumns)
+ {
+ break;
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets single cell position in relative coordinates.
+ /// </summary>
+ /// <param name="columnIndex">Cell column index.</param>
+ /// <param name="rowIndex">Cell row index.</param>
+ /// <param name="cellIndex">Index of the cell in the legend item.</param>
+ /// <param name="itemHalfSpacing">Half legend item spacing in relative coordinates.</param>
+ /// <returns></returns>
+ private Rectangle GetCellPosition(
+ int columnIndex,
+ int rowIndex,
+ int cellIndex,
+ Size itemHalfSpacing)
+ {
+ Rectangle cellPosition = this._legendItemsAreaPosition;
+
+ //*****************************************************************
+ //** Get cell Top location
+ //*****************************************************************
+ for(int index = 0; index < rowIndex; index++)
+ {
+ cellPosition.Y += this._cellHeights[columnIndex, index];
+ }
+ if(itemHalfSpacing.Height > 0)
+ {
+ cellPosition.Y += itemHalfSpacing.Height * rowIndex * 2 + itemHalfSpacing.Height;
+ }
+
+ //*****************************************************************
+ //** Get cell Left location
+ //*****************************************************************
+
+ // Add extar space left after auto fitting
+ if(this._horizontalSpaceLeft > 0)
+ {
+ cellPosition.X += itemHalfSpacing.Width;
+ }
+
+ // Calculate how many sub-columns (cells) this legend has
+ int numberOfSubColumns = this.GetNumberOfCells();
+
+ // Iterate through all prev. columns
+ for(int index = 0; index < columnIndex; index++)
+ {
+ // Add width of previous columns
+ for(int subColumnIndex = 0; subColumnIndex < numberOfSubColumns; subColumnIndex++)
+ {
+ cellPosition.X += this._subColumnSizes[index, subColumnIndex];
+ }
+
+ // Add width of separator for the previous columns
+ cellPosition.X += this.GetSeparatorSize(this.ItemColumnSeparator).Width;
+ }
+ // Add width of current column cells
+ for(int subColumnIndex = 0; subColumnIndex < cellIndex; subColumnIndex++)
+ {
+ cellPosition.X += this._subColumnSizes[columnIndex, subColumnIndex];
+ }
+
+ //*****************************************************************
+ //** Get cell Height
+ //*****************************************************************
+ cellPosition.Height = this._cellHeights[columnIndex, rowIndex];
+
+ //*****************************************************************
+ //** Get cell Width
+ //*****************************************************************
+ cellPosition.Width = this._subColumnSizes[columnIndex, cellIndex];
+
+ return cellPosition;
+ }
+
+ /// <summary>
+ /// Calculates the optimal size of the legend.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics object.</param>
+ /// <param name="maxSizeRel">Max size for the legend.</param>
+ /// <returns>Legend optimal size.</returns>
+ private SizeF GetOptimalSize(ChartGraphics chartGraph, SizeF maxSizeRel)
+ {
+ // Reset some values
+ this._offset = Size.Empty;
+ this._itemColumns = 0;
+ this._horizontalSpaceLeft = 0;
+ this._verticalSpaceLeft = 0;
+ this._subColumnSizes = null;
+ this._numberOfRowsPerColumn = null;
+ this._cellHeights = null;
+ this.autofitFont = null;
+ this._autoFitFontSizeAdjustment = 0;
+ this._numberOfCells = -1;
+ this._numberOfLegendItemsToProcess = -1;
+ Size optimalSize = Size.Empty;
+
+ // Convert to pixels
+ SizeF maxSizeAbs = chartGraph.GetAbsoluteSize(maxSizeRel);
+ Size maxSize = new Size((int)maxSizeAbs.Width, (int)maxSizeAbs.Height);
+
+ // Clear all legend item cells cached information
+ foreach(LegendItem legendItem in this.legendItems)
+ {
+ foreach(LegendCell cell in legendItem.Cells)
+ {
+ cell.ResetCache();
+ }
+ }
+
+ // Check if legend is enabled
+ if(this.IsEnabled())
+ {
+ // Add all series legend into items collection and then add custom legend items
+ FillLegendItemsCollection();
+
+ // Call a notification event, so that legend items collection can be modified by user
+ this.Common.Chart.CallOnCustomizeLegend(legendItems, this.Name);
+
+ // Check if there are any items in the legend
+ if(this.legendItems.Count > 0)
+ {
+ //***********************************************************
+ //** Use size of the "W" character in current font to
+ //** calculate legend spacing
+ //***********************************************************
+ this.singleWCharacterSize = chartGraph.MeasureStringAbs("W", this.Font);
+ Size doubleCharacterSize = chartGraph.MeasureStringAbs("WW", this.Font);
+ this.singleWCharacterSize.Width = doubleCharacterSize.Width - this.singleWCharacterSize.Width;
+
+ // Calculate left, top offset and column spacing
+ this._offset.Width = (int)Math.Ceiling(singleWCharacterSize.Width / 2f);
+ this._offset.Height = (int)Math.Ceiling(singleWCharacterSize.Width / 3f);
+ this._itemColumnSpacingRel = (int)(singleWCharacterSize.Width * (this._itemColumnSpacing / 100f));
+ if(this._itemColumnSpacingRel % 2 == 1)
+ {
+ this._itemColumnSpacingRel += 1;
+ }
+
+
+ //***********************************************************
+ //** Add size required for the legend tile
+ //***********************************************************
+
+ Size titleSize = Size.Empty;
+ if(this.Title.Length > 0)
+ {
+ titleSize = this.GetTitleSize(chartGraph, maxSize);
+ }
+
+ //***********************************************************
+ //** Add size required for the legend header
+ //***********************************************************
+
+ Size highestHeader = Size.Empty;
+ foreach(LegendCellColumn legendColumn in this.CellColumns)
+ {
+ if(legendColumn.HeaderText.Length > 0)
+ {
+ // Measure header text size
+ Size headerSize = this.GetHeaderSize(chartGraph, legendColumn);
+
+ // Get header with maximum height
+ highestHeader.Height = Math.Max(highestHeader.Height, headerSize.Height);
+ }
+ }
+
+ //***********************************************************
+ //** Calculate size available for legend items
+ //***********************************************************
+ Size legenItemsMaxSize = maxSize;
+ legenItemsMaxSize.Width -= 2 * (this._offset.Width + this.GetBorderSize());
+ legenItemsMaxSize.Height -= 2 * (this._offset.Height + this.GetBorderSize());
+ legenItemsMaxSize.Height -= titleSize.Height;
+ legenItemsMaxSize.Height -= highestHeader.Height;
+
+ //***********************************************************
+ //** Calculate number of rows and columns depending on
+ //** the legend style
+ //***********************************************************
+ this._autoFitFontSizeAdjustment = 0;
+
+ this.autofitFont = this.Font;
+ int vertSpaceLeft = 0;
+ int horizSpaceLeft = 0;
+ bool reduceFont = this.IsTextAutoFit;
+ bool autoFit = false;
+ do
+ {
+ // Get number of columns and rows that we can fit in the legend
+ this.GetNumberOfRowsAndColumns(
+ chartGraph,
+ legenItemsMaxSize,
+ -1,
+ out this._numberOfRowsPerColumn,
+ out this._itemColumns,
+ out horizSpaceLeft,
+ out vertSpaceLeft);
+
+ // Calculate total number of items fit and make sure we fit all of them
+ int itemsFit = 0;
+ for(int index = 0; index < this._itemColumns; index++)
+ {
+ itemsFit += this._numberOfRowsPerColumn[index];
+ }
+ autoFit = (horizSpaceLeft >= 0 && vertSpaceLeft >= 0 && itemsFit >= this.legendItems.Count);
+
+ // Check if items fit
+ if(reduceFont && !autoFit)
+ {
+ if((this.Font.Size - this._autoFitFontSizeAdjustment) > this._autoFitMinFontSize)
+ {
+ // Reduce font size by one
+ ++this._autoFitFontSizeAdjustment;
+
+ // Calculate new font size
+ int newFontSize = (int)Math.Round(this.Font.Size - this._autoFitFontSizeAdjustment);
+ if(newFontSize < 1)
+ {
+ // Font can't be less than size 1
+ newFontSize = 1;
+ }
+
+ // Create new font
+ this.autofitFont = this.Common.ChartPicture.FontCache.GetFont(
+ this.Font.FontFamily,
+ newFontSize,
+ this.Font.Style,
+ this.Font.Unit);
+ }
+ else
+ {
+ reduceFont = false;
+ }
+ }
+ } while(reduceFont && !autoFit);
+
+ // Slightly reduce used space
+ horizSpaceLeft -= Math.Min(4, horizSpaceLeft);
+ vertSpaceLeft -= Math.Min(2, vertSpaceLeft);
+
+
+ //***********************************************************
+ //** Calculate legend size
+ //***********************************************************
+ optimalSize.Width = (legenItemsMaxSize.Width - horizSpaceLeft);
+ optimalSize.Width = Math.Max(optimalSize.Width, titleSize.Width);
+ optimalSize.Width += 2 * (this._offset.Width + this.GetBorderSize());
+
+ optimalSize.Height = (legenItemsMaxSize.Height - vertSpaceLeft) + titleSize.Height + highestHeader.Height;
+ optimalSize.Height += 2 * (this._offset.Height + this.GetBorderSize());
+
+ // Adjust legend items area height by size required to show
+ // visually (dots) that legend is truncated
+ if(horizSpaceLeft < 0 || vertSpaceLeft < 0)
+ {
+ optimalSize.Height += this._truncatedDotsSize;
+ }
+
+ //***********************************************************
+ //** Make sure legend size do not exceed max. value
+ //***********************************************************
+ if(optimalSize.Width > maxSize.Width)
+ {
+ optimalSize.Width = maxSize.Width;
+ }
+ if(optimalSize.Height > maxSize.Height)
+ {
+ optimalSize.Height = maxSize.Height;
+ }
+ if(optimalSize.Width < 0)
+ {
+ optimalSize.Width = 0;
+ }
+ if(optimalSize.Height < 0)
+ {
+ optimalSize.Height = 0;
+ }
+ }
+ }
+
+ // Convert result size from pixel to relative coordinates
+ return chartGraph.GetRelativeSize(optimalSize);
+ }
+
+
+
+ /// <summary>
+ /// Recalculates legend position.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics used.</param>
+ /// <param name="chartAreasRectangle">Area where the legend should be positioned.</param>
+ /// <param name="elementSpacing">Spacing size as a percentage of the area.</param>
+ internal void CalcLegendPosition(
+ ChartGraphics chartGraph,
+ ref RectangleF chartAreasRectangle,
+ float elementSpacing)
+ {
+ RectangleF legendPosition = new RectangleF();
+
+ // Get optimal legend size
+ SizeF maxSize = new SizeF(chartAreasRectangle.Width - 2*elementSpacing, chartAreasRectangle.Height - 2*elementSpacing);
+ if (this.DockedToChartArea == Constants.NotSetValue)
+ {
+
+ // Note: 'maxLegendSize' parameter is ignored. New legend property
+ // 'maximumLegendAutoSize' is used instead.
+ if(this.Docking == Docking.Top || this.Docking == Docking.Bottom)
+ {
+ maxSize.Height = (maxSize.Height / 100F) * this._maximumLegendAutoSize;
+ }
+ else
+ {
+ maxSize.Width = (maxSize.Width / 100F) * this._maximumLegendAutoSize;
+ }
+ }
+
+ if(maxSize.Width <= 0 || maxSize.Height <= 0)
+ {
+ return;
+ }
+
+ SizeF legendSize = this.GetOptimalSize(chartGraph, maxSize);
+ legendPosition.Height = legendSize.Height;
+ legendPosition.Width = legendSize.Width;
+ if(float.IsNaN(legendSize.Height) || float.IsNaN(legendSize.Width))
+ {
+ return;
+ }
+
+ // Calculate legend position
+ if(this.Docking == Docking.Top)
+ {
+ legendPosition.Y = chartAreasRectangle.Y + elementSpacing;
+ if(this.Alignment == StringAlignment.Near)
+ {
+ legendPosition.X = chartAreasRectangle.X + elementSpacing;
+ }
+ else if(this.Alignment == StringAlignment.Far)
+ {
+ legendPosition.X = chartAreasRectangle.Right - legendSize.Width - elementSpacing;
+ }
+ else if(this.Alignment == StringAlignment.Center)
+ {
+ legendPosition.X = chartAreasRectangle.X + (chartAreasRectangle.Width - legendSize.Width) / 2F;
+ }
+
+ // Adjust position of the chart area(s)
+ chartAreasRectangle.Height -= legendPosition.Height + elementSpacing;
+ chartAreasRectangle.Y = legendPosition.Bottom;
+ }
+ else if(this.Docking == Docking.Bottom)
+ {
+ legendPosition.Y = chartAreasRectangle.Bottom - legendSize.Height - elementSpacing;
+ if(this.Alignment == StringAlignment.Near)
+ {
+ legendPosition.X = chartAreasRectangle.X + elementSpacing;
+ }
+ else if(this.Alignment == StringAlignment.Far)
+ {
+ legendPosition.X = chartAreasRectangle.Right - legendSize.Width - elementSpacing;
+ }
+ else if(this.Alignment == StringAlignment.Center)
+ {
+ legendPosition.X = chartAreasRectangle.X + (chartAreasRectangle.Width - legendSize.Width) / 2F;
+ }
+
+ // Adjust position of the chart area(s)
+ chartAreasRectangle.Height -= legendPosition.Height + elementSpacing;
+ }
+ if(this.Docking == Docking.Left)
+ {
+ legendPosition.X = chartAreasRectangle.X + elementSpacing;
+ if(this.Alignment == StringAlignment.Near)
+ {
+ legendPosition.Y = chartAreasRectangle.Y + elementSpacing;
+ }
+ else if(this.Alignment == StringAlignment.Far)
+ {
+ legendPosition.Y = chartAreasRectangle.Bottom - legendSize.Height - elementSpacing;
+ }
+ else if(this.Alignment == StringAlignment.Center)
+ {
+ legendPosition.Y = chartAreasRectangle.Y + (chartAreasRectangle.Height - legendSize.Height) / 2F;
+ }
+
+ // Adjust position of the chart area(s)
+ chartAreasRectangle.Width -= legendPosition.Width + elementSpacing;
+ chartAreasRectangle.X = legendPosition.Right;
+ }
+ if(this.Docking == Docking.Right)
+ {
+ legendPosition.X = chartAreasRectangle.Right - legendSize.Width - elementSpacing;
+ if(this.Alignment == StringAlignment.Near)
+ {
+ legendPosition.Y = chartAreasRectangle.Y + elementSpacing;
+ }
+ else if(this.Alignment == StringAlignment.Far)
+ {
+ legendPosition.Y = chartAreasRectangle.Bottom - legendSize.Height - elementSpacing;
+ }
+ else if(this.Alignment == StringAlignment.Center)
+ {
+ legendPosition.Y = chartAreasRectangle.Y + (chartAreasRectangle.Height - legendSize.Height) / 2F;
+ }
+
+ // Adjust position of the chart area(s)
+ chartAreasRectangle.Width -= legendPosition.Width + elementSpacing;
+ }
+
+ this.Position.SetPositionNoAuto(legendPosition.X, legendPosition.Y, legendPosition.Width, legendPosition.Height);
+ }
+
+
+
+ /// <summary>
+ /// Get number of columns and rows that can be fit in specified size.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics.</param>
+ /// <param name="legendSize">Legend size.</param>
+ /// <param name="numberOfItemsToCheck">Number of legend items to check.</param>
+ /// <param name="numberOfRowsPerColumn">Array with number of rows per each column.</param>
+ /// <param name="columnNumber">Returns number of columns.</param>
+ private void GetNumberOfRowsAndColumns(
+ ChartGraphics chartGraph,
+ Size legendSize,
+ int numberOfItemsToCheck,
+ out int[] numberOfRowsPerColumn,
+ out int columnNumber)
+ {
+ int horSpaceLeft = 0;
+ int vertSpaceLeft = 0;
+ this.GetNumberOfRowsAndColumns(
+ chartGraph,
+ legendSize,
+ numberOfItemsToCheck,
+ out numberOfRowsPerColumn,
+ out columnNumber,
+ out horSpaceLeft,
+ out vertSpaceLeft);
+ }
+
+ /// <summary>
+ /// Get number of columns and rows that can be fit in specified size.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics.</param>
+ /// <param name="legendSize">Legend size.</param>
+ /// <param name="numberOfItemsToCheck">Legend items number to check.</param>
+ /// <param name="numberOfRowsPerColumn">Array with number of rows per each column.</param>
+ /// <param name="columnNumber">Returns number of columns.</param>
+ /// <param name="horSpaceLeft">Returns horizontal spacing left.</param>
+ /// <param name="vertSpaceLeft">Returns vertical spacing left.</param>
+ private void GetNumberOfRowsAndColumns(
+ ChartGraphics chartGraph,
+ Size legendSize,
+ int numberOfItemsToCheck,
+ out int[] numberOfRowsPerColumn,
+ out int columnNumber,
+ out int horSpaceLeft,
+ out int vertSpaceLeft)
+ {
+ // Initialize output parameters
+ numberOfRowsPerColumn = null;
+ columnNumber = 1;
+ horSpaceLeft = 0;
+ vertSpaceLeft = 0;
+
+ // If number of items to check is nor set use total number of items in the collection
+ if(numberOfItemsToCheck < 0)
+ {
+ numberOfItemsToCheck = legendItems.Count;
+ }
+
+ // Check legend style
+ if(this.LegendStyle == LegendStyle.Column || numberOfItemsToCheck <= 1)
+ {
+ columnNumber = 1;
+ numberOfRowsPerColumn = new int[] { numberOfItemsToCheck };
+ }
+ else if(this.LegendStyle == LegendStyle.Row)
+ {
+ columnNumber = numberOfItemsToCheck;
+ numberOfRowsPerColumn = new int[columnNumber];
+ for(int index = 0; index < columnNumber; index++)
+ {
+ numberOfRowsPerColumn[index] = 1;
+ }
+ }
+ else if(this.LegendStyle == LegendStyle.Table)
+ {
+ // Start with 1 column and 1 row
+ columnNumber = 1;
+ numberOfRowsPerColumn = new int[] { 1 };
+
+ // Get legend table style and adjust number of columns and rows accordinly
+ LegendTableStyle tableStyle = this.GetLegendTableStyle(chartGraph);
+
+ //*********************************************************************************
+ //** Tall table layout
+ //*********************************************************************************
+ if(tableStyle == LegendTableStyle.Tall)
+ {
+ // Iterate from second item trying to add them and check if their fit
+ bool exitLoop = false;
+ int legendItemIndex = 1;
+ for(legendItemIndex = 1; !exitLoop && legendItemIndex < numberOfItemsToCheck; legendItemIndex ++)
+ {
+ // Try to increase number of rows in the current column
+ ++numberOfRowsPerColumn[columnNumber - 1];
+
+ // Check if legend items fit into the legend area
+ bool autoFitDone = this.CheckLegendItemsFit(
+ chartGraph,
+ legendSize,
+ legendItemIndex + 1,
+ this._autoFitFontSizeAdjustment,
+ columnNumber,
+ numberOfRowsPerColumn,
+ out this._subColumnSizes,
+ out this._cellHeights,
+ out horSpaceLeft,
+ out vertSpaceLeft);
+
+ // Check if we fit or if we have just one column that do not fit
+ // horizontally but still have vertical space.
+ if(autoFitDone ||
+ ( (columnNumber == 1 || horSpaceLeft < 0) && vertSpaceLeft > 0) )
+ {
+ // Continue adding rows to the current column
+ continue;
+ }
+ else
+ {
+ // Reduce number of rows in the current column
+ if(numberOfRowsPerColumn[columnNumber - 1] > 1)
+ {
+ --numberOfRowsPerColumn[columnNumber - 1];
+ }
+
+ // Get half of average column width
+ int averageColumnWidth = 0;
+ if(horSpaceLeft > 0)
+ {
+ averageColumnWidth = (int)Math.Round((double)(legendSize.Width - horSpaceLeft) / columnNumber) / 2;
+ }
+
+ // Check if number of columns can be increased
+ if(columnNumber < 50 && horSpaceLeft >= averageColumnWidth)
+ {
+ // Add new column
+ ++columnNumber;
+
+ // Resize array that stores number of rows per column
+ int[] tempArray = numberOfRowsPerColumn;
+ numberOfRowsPerColumn = new int[columnNumber];
+ for(int index = 0; index < tempArray.Length; index++)
+ {
+ numberOfRowsPerColumn[index] = tempArray[index];
+ }
+ numberOfRowsPerColumn[columnNumber - 1] = 1;
+
+ // If last legend item is moved into a new column
+ // call the auto fitting method before leaving the loop
+ if(legendItemIndex == numberOfItemsToCheck - 1)
+ {
+ this.CheckLegendItemsFit(
+ chartGraph,
+ legendSize,
+ legendItemIndex + 1,
+ this._autoFitFontSizeAdjustment,
+ columnNumber,
+ numberOfRowsPerColumn,
+ out this._subColumnSizes,
+ out this._cellHeights,
+ out horSpaceLeft,
+ out vertSpaceLeft);
+ }
+ }
+ else
+ {
+ exitLoop = true;
+ }
+ }
+ }
+
+ // Check if we end up with legend with multiple columns
+ // where last column has sinificantly lower height of all rows
+ if(columnNumber > 1)
+ {
+ // Try reducing number of rows in the "tall" calumns and move them
+ // into the last column.
+ bool done = false;
+ while(!done)
+ {
+ // By default no more iterations required
+ done = true;
+
+ // Find maximum column height not taking the last row in consideration
+ int maxColumnHeight = -1;
+ for(int columnIndex = 0; columnIndex < columnNumber; columnIndex++)
+ {
+ // Calculate current column height not taking the last row in consideration
+ int columnHeight = 0;
+ for(int rowIndex = 0; rowIndex < this._numberOfRowsPerColumn[columnIndex] - 1; rowIndex++)
+ {
+ columnHeight += this._cellHeights[columnIndex, rowIndex];
+ }
+
+ // Find maximum height
+ maxColumnHeight = Math.Max(maxColumnHeight, columnHeight);
+ }
+
+ // Calculate total height of items in the last row
+ int totalHieghtOfItemInLastRow = 0;
+ for(int columnIndex = 0; columnIndex < (columnNumber - 1); columnIndex++)
+ {
+ if(this._numberOfRowsPerColumn[columnIndex] > 1)
+ {
+ totalHieghtOfItemInLastRow += this._cellHeights[columnIndex, this._numberOfRowsPerColumn[columnIndex] - 1];
+ }
+ }
+
+ // Check if rows are available for removal
+ if(totalHieghtOfItemInLastRow > 0)
+ {
+ // Get last column height
+ int lastColumnHeight = this.GetColumnHeight(columnNumber - 1);
+
+ // Check if all items in the last row can vertically fit in last column
+ if( (lastColumnHeight + totalHieghtOfItemInLastRow) <= maxColumnHeight )
+ {
+ // Reduce number of rows in all columns except last
+ int itemsToAdd = 0;
+ for(int columnIndex = 0; columnIndex < (columnNumber - 1); columnIndex++)
+ {
+ if(this._numberOfRowsPerColumn[columnIndex] > 1)
+ {
+ --this._numberOfRowsPerColumn[columnIndex];
+ ++itemsToAdd;
+ }
+ }
+
+ // Add rows to last column
+ if(itemsToAdd > 0)
+ {
+ // Add roes into the last column
+ this._numberOfRowsPerColumn[columnNumber - 1] += itemsToAdd;
+
+ // Check if legend items fit into the legend area
+ bool autoFitDone = this.CheckLegendItemsFit(
+ chartGraph,
+ legendSize,
+ legendItemIndex + 1,
+ this._autoFitFontSizeAdjustment,
+ columnNumber,
+ numberOfRowsPerColumn,
+ out this._subColumnSizes,
+ out this._cellHeights,
+ out horSpaceLeft,
+ out vertSpaceLeft);
+
+ // Try doing one more time
+ done = false;
+ }
+ }
+ }
+ }
+ }
+ }
+ //*********************************************************************************
+ //** Wide table layout
+ //*********************************************************************************
+ else if(tableStyle == LegendTableStyle.Wide)
+ {
+ // Iterate from second item trying to add them and check if they fit
+ bool exitLoop = false;
+ int legendItemIndex = 1;
+ for(legendItemIndex = 1; !exitLoop && legendItemIndex < numberOfItemsToCheck; legendItemIndex ++)
+ {
+ // Try to increase number of columns
+ ++columnNumber;
+
+ // Resize array that stores number of rows per column
+ int[] tempArray = numberOfRowsPerColumn;
+ numberOfRowsPerColumn = new int[columnNumber];
+ for(int index = 0; index < tempArray.Length; index++)
+ {
+ numberOfRowsPerColumn[index] = tempArray[index];
+ }
+ numberOfRowsPerColumn[columnNumber - 1] = 1;
+
+ // Check if legend items fit into the legend area
+ bool autoFitDone = this.CheckLegendItemsFit(
+ chartGraph,
+ legendSize,
+ legendItemIndex + 1,
+ this._autoFitFontSizeAdjustment,
+ columnNumber,
+ numberOfRowsPerColumn,
+ out this._subColumnSizes,
+ out this._cellHeights,
+ out horSpaceLeft,
+ out vertSpaceLeft);
+
+ // Check if we fit or if we have just one row that do not fit
+ // vertically but still have horizontal space.
+ if(autoFitDone ||
+ ( (this.GetMaximumNumberOfRows(numberOfRowsPerColumn) == 1 || vertSpaceLeft < 0) && horSpaceLeft > 0) )
+ {
+ // Continue adding columns
+ continue;
+ }
+ else
+ {
+ // Remove columns and increase number of rows
+ bool columnFitting = true;
+ while(columnFitting)
+ {
+ columnFitting = false;
+
+ // If we can't fit current number of columns reduce current column number
+ int rowsToAdd = 0;
+ if(columnNumber > 1)
+ {
+ rowsToAdd = numberOfRowsPerColumn[columnNumber - 1];
+ --columnNumber;
+
+ // Resize array that stores number of rows per column
+ tempArray = numberOfRowsPerColumn;
+ numberOfRowsPerColumn = new int[columnNumber];
+ for(int index = 0; index < columnNumber; index++)
+ {
+ numberOfRowsPerColumn[index] = tempArray[index];
+ }
+ }
+
+ // We may need to add more than 1 row
+ for(int indexRowToAdd = 0; indexRowToAdd < rowsToAdd; indexRowToAdd++)
+ {
+ // Find first column with smallest height
+ int smallestColumnIndex = -1;
+ int columnMinHeight = int.MaxValue;
+ for(int columnIndex = 0; columnIndex < columnNumber; columnIndex++)
+ {
+ int columnHeight = this.GetColumnHeight(columnIndex);
+ int nextColumnFirstItemHeight = 0;
+ if(columnIndex < columnNumber - 1)
+ {
+ nextColumnFirstItemHeight = this._cellHeights[columnIndex + 1, 0];
+ }
+ if(columnHeight < columnMinHeight &&
+ (columnHeight + nextColumnFirstItemHeight) < legendSize.Height)
+ {
+ // Remember column index and height
+ columnMinHeight = columnHeight;
+ smallestColumnIndex = columnIndex;
+ }
+ }
+
+ // No more items can fit
+ if(smallestColumnIndex < 0)
+ {
+ // Check if legend items fit into the legend area
+ autoFitDone = this.CheckLegendItemsFit(
+ chartGraph,
+ legendSize,
+ legendItemIndex + 1,
+ this._autoFitFontSizeAdjustment,
+ columnNumber,
+ numberOfRowsPerColumn,
+ out this._subColumnSizes,
+ out this._cellHeights,
+ out horSpaceLeft,
+ out vertSpaceLeft);
+
+ exitLoop = true;
+ break;
+ }
+
+ // Add new row to the smallest column
+ ++numberOfRowsPerColumn[smallestColumnIndex];
+
+ // Check if next column will be removed if it contains only 1 row
+ if(smallestColumnIndex < (columnNumber - 1))
+ {
+ if(numberOfRowsPerColumn[smallestColumnIndex + 1] == 1)
+ {
+ // Shift number of rows per column
+ tempArray = numberOfRowsPerColumn;
+ for(int index = smallestColumnIndex + 1; index < tempArray.Length - 1; index++)
+ {
+ numberOfRowsPerColumn[index] = tempArray[index + 1];
+ }
+ numberOfRowsPerColumn[columnNumber - 1] = 1;
+ }
+ }
+
+ // Check if legend items fit into the legend area
+ autoFitDone = this.CheckLegendItemsFit(
+ chartGraph,
+ legendSize,
+ legendItemIndex + 1,
+ this._autoFitFontSizeAdjustment,
+ columnNumber,
+ numberOfRowsPerColumn,
+ out this._subColumnSizes,
+ out this._cellHeights,
+ out horSpaceLeft,
+ out vertSpaceLeft);
+
+ }
+
+ // If there is more than 1 column and items do not fit
+ // horizontally - reduce number of columns.
+ if(!autoFitDone &&
+ horSpaceLeft < 0f &&
+ columnNumber > 1)
+ {
+ columnFitting = true;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // Check if items fit and how much empty space left
+ this.CheckLegendItemsFit(
+ chartGraph,
+ legendSize,
+ -1,
+ this._autoFitFontSizeAdjustment,
+ columnNumber,
+ numberOfRowsPerColumn,
+ out this._subColumnSizes,
+ out this._cellHeights,
+ out horSpaceLeft,
+ out vertSpaceLeft);
+ }
+
+ /// <summary>
+ /// Gets column height.
+ /// </summary>
+ /// <param name="columnIndex">Index of the column to get the height for.</param>
+ /// <returns>Column height in relative coordinates.</returns>
+ private int GetColumnHeight(int columnIndex)
+ {
+ // Calculate current column height
+ int columnHeight = 0;
+ for(int rowIndex = 0; rowIndex < this._numberOfRowsPerColumn[columnIndex]; rowIndex++)
+ {
+ columnHeight += this._cellHeights[columnIndex, rowIndex];
+ }
+
+ return columnHeight;
+ }
+
+ /// <summary>
+ /// Checks if legend background is selected.
+ /// </summary>
+ internal void SelectLegendBackground()
+ {
+ Common.HotRegionsList.AddHotRegion(this.Position.ToRectangleF(), this, ChartElementType.LegendArea, true);
+ }
+
+ #endregion Legend position & size methods
+
+ #region Legend Items Fitting Methods
+
+ /// <summary>
+ /// Gets maximum number of rows in all columns.
+ /// </summary>
+ /// <returns>Maximum number of rows.</returns>
+ private int GetMaximumNumberOfRows()
+ {
+ return this.GetMaximumNumberOfRows(this._numberOfRowsPerColumn);
+ }
+
+ /// <summary>
+ /// Gets maximum number of rows in all columns.
+ /// </summary>
+ /// <param name="rowsPerColumn">Array that stores number of rows per column.</param>
+ /// <returns>Maximum number of rows.</returns>
+ private int GetMaximumNumberOfRows(int[] rowsPerColumn)
+ {
+ // Find column with maximum number of rows
+ int maxNumberOfColumns = 0;
+ if(rowsPerColumn != null)
+ {
+ for(int columnIndex = 0; columnIndex < rowsPerColumn.Length; columnIndex++)
+ {
+ maxNumberOfColumns = Math.Max(maxNumberOfColumns, rowsPerColumn[columnIndex]);
+ }
+ }
+ return maxNumberOfColumns;
+ }
+
+ /// <summary>
+ /// Checks if specified legend will fit the specified size.
+ /// </summary>
+ /// <param name="graph">Chart graphics.</param>
+ /// <param name="legendItemsAreaSize">Area that legend items must fit.</param>
+ /// <param name="numberOfItemsToCheck">Number of items that should be fitted.</param>
+ /// <param name="fontSizeReducedBy">Number of points the standard legend font is reduced by auto-fitting algorithm.</param>
+ /// <param name="numberOfColumns">Legend column number.</param>
+ /// <param name="numberOfRowsPerColumn">Array of number of rows per column.</param>
+ /// <param name="subColumnSizes">Returns array of sub-column size.</param>
+ /// <param name="cellHeights">Returns array of cell heights.</param>
+ /// <param name="horizontalSpaceLeft">Returns horizontal space left.</param>
+ /// <param name="verticalSpaceLeft">Returns vertical space left.</param>
+ /// <returns>True if items fit.</returns>
+ private bool CheckLegendItemsFit(
+ ChartGraphics graph,
+ Size legendItemsAreaSize,
+ int numberOfItemsToCheck,
+ int fontSizeReducedBy,
+ int numberOfColumns,
+ int[] numberOfRowsPerColumn,
+ out int[,] subColumnSizes,
+ out int[,] cellHeights,
+ out int horizontalSpaceLeft,
+ out int verticalSpaceLeft)
+ {
+ bool fitFlag = true;
+
+ // Initialize output values
+ horizontalSpaceLeft = 0;
+ verticalSpaceLeft = 0;
+
+ // Use current legend item count if number of items to check is not specified
+ if(numberOfItemsToCheck < 0)
+ {
+ numberOfItemsToCheck = this.legendItems.Count;
+ }
+
+ // Calculate how many sub-columns (cells) this legend has
+ int numberOfSubColumns = this.GetNumberOfCells();
+
+ // Each column may have its own number of rows. Calculate the maximum number of rows.
+ int maxNumberOfRows = this.GetMaximumNumberOfRows(numberOfRowsPerColumn);
+
+ // Create multidimensional arrays that will be holding the widths and heightsof all
+ // individual cells. First dimension will be the legend column index, second dimension
+ // is row index and the third is sub-column (cell) index.
+ int[,,] cellWidths = new int[numberOfColumns, maxNumberOfRows, numberOfSubColumns];
+ cellHeights = new int[numberOfColumns, maxNumberOfRows];
+
+
+ //*************************************************************************
+ //** Measure legend font single character
+ //*************************************************************************
+ this.singleWCharacterSize = graph.MeasureStringAbs("W", (this.autofitFont == null) ? this.Font : this.autofitFont);
+ Size doubleCharacterSize = graph.MeasureStringAbs("WW", (this.autofitFont == null) ? this.Font : this.autofitFont);
+ this.singleWCharacterSize.Width = doubleCharacterSize.Width - this.singleWCharacterSize.Width;
+
+
+ //*************************************************************************
+ //** Iterate through all legend items and measure each individual cell
+ //*************************************************************************
+ int currentColumn = 0;
+ int currentRow = 0;
+ for(int legendItemIndex = 0; legendItemIndex < numberOfItemsToCheck; legendItemIndex++)
+ {
+ LegendItem legendItem = this.legendItems[legendItemIndex];
+
+ // Iterate through legend item cells
+ int numberOfCellsToSkip = 0;
+ for(int cellIndex = 0; cellIndex < legendItem.Cells.Count; cellIndex++)
+ {
+ // Get legend cell
+ LegendCell legendCell = legendItem.Cells[cellIndex];
+
+ // Get assocated legend column object (may be NULL)
+ LegendCellColumn legendColumn = null;
+ if(cellIndex < this.CellColumns.Count)
+ {
+ legendColumn = this.CellColumns[cellIndex];
+ }
+
+ // Check if current cell should be skipped becuse it's overlapped
+ // by the previous sell that uses CellSpan.
+ if(numberOfCellsToSkip > 0)
+ {
+ // Put size (-1) for the cells that follow a cell using ColumnSpan
+ cellWidths[currentColumn, currentRow, cellIndex] = -1;
+ --numberOfCellsToSkip;
+ continue;
+ }
+
+ // Check if current cell uses CellSpan
+ if(legendCell.CellSpan > 1)
+ {
+ numberOfCellsToSkip = legendCell.CellSpan - 1;
+ }
+
+ // Measure cell and store the value in the array
+ Size cellSize = legendCell.MeasureCell(
+ graph,
+ fontSizeReducedBy,
+ (this.autofitFont == null) ? this.Font : this.autofitFont,
+ this.singleWCharacterSize);
+
+ // Check for column maximum/minimum cell width restrictions
+ if(legendColumn != null)
+ {
+ if(legendColumn.MinimumWidth >= 0)
+ {
+ cellSize.Width = (int)Math.Max(cellSize.Width, legendColumn.MinimumWidth * singleWCharacterSize.Width / 100f);
+ }
+ if(legendColumn.MaximumWidth >= 0)
+ {
+ cellSize.Width = (int)Math.Min(cellSize.Width, legendColumn.MaximumWidth * singleWCharacterSize.Width / 100f);
+ }
+ }
+
+ // Store cell size in arrays
+ cellWidths[currentColumn, currentRow, cellIndex] = cellSize.Width;
+ if(cellIndex == 0)
+ {
+ cellHeights[currentColumn, currentRow] = cellSize.Height;
+ }
+ else
+ {
+ cellHeights[currentColumn, currentRow] =
+ Math.Max(cellHeights[currentColumn, currentRow], cellSize.Height);
+ }
+ }
+
+ // Advance to the next row/column. Break if number of legend items exceed
+ // number of availabale rows/columns.
+ ++currentRow;
+ if(currentRow >= numberOfRowsPerColumn[currentColumn])
+ {
+ ++currentColumn;
+ currentRow = 0;
+ if(currentColumn >= numberOfColumns)
+ {
+ // Check if we were able to fit all the items
+ if(legendItemIndex < numberOfItemsToCheck - 1)
+ {
+ fitFlag = false;
+ }
+ break;
+ }
+ }
+ }
+
+ //*************************************************************************
+ //** For each sub-column get the maximum cell width
+ //*************************************************************************
+ subColumnSizes = new int[numberOfColumns, numberOfSubColumns];
+ bool secondIterationRequired = false;
+ for(currentColumn = 0; currentColumn < numberOfColumns; currentColumn++)
+ {
+ for(int currentSubColumn = 0; currentSubColumn < numberOfSubColumns; currentSubColumn++)
+ {
+ int width = 0;
+ for(currentRow = 0; currentRow < numberOfRowsPerColumn[currentColumn]; currentRow++)
+ {
+ // Get current cell size
+ int cellWidth = cellWidths[currentColumn, currentRow, currentSubColumn];
+
+ // Skip overlapped cells and cells that use ColumnSpan during the
+ // first iteration. Their size will be determined during the
+ // second iteration.
+ if(cellWidth < 0)
+ {
+ secondIterationRequired = true;
+ continue;
+ }
+ if(currentSubColumn + 1 < numberOfSubColumns)
+ {
+ int nextCellWidth = cellWidths[currentColumn, currentRow, currentSubColumn + 1];
+ if(nextCellWidth < 0)
+ {
+ continue;
+ }
+ }
+
+ // Get maximum width
+ width = Math.Max(width, cellWidth );
+ }
+
+ // Store maximum width in the array
+ subColumnSizes[currentColumn, currentSubColumn] = width;
+ }
+ }
+
+ //*************************************************************************
+ //** If leagend header text is used check if it fits into the currenly
+ //** calculated sub-column sizes.
+ //*************************************************************************
+
+ for(currentColumn = 0; currentColumn < numberOfColumns; currentColumn++)
+ {
+ for(int currentSubColumn = 0; currentSubColumn < numberOfSubColumns; currentSubColumn++)
+ {
+ if(currentSubColumn < this.CellColumns.Count)
+ {
+ LegendCellColumn legendColumn = this.CellColumns[currentSubColumn];
+ if(legendColumn.HeaderText.Length > 0)
+ {
+ // Note that extra "I" character added to add more horizontal spacing
+ Size headerTextSize = graph.MeasureStringAbs(legendColumn.HeaderText + "I", legendColumn.HeaderFont);
+ if(headerTextSize.Width > subColumnSizes[currentColumn, currentSubColumn])
+ {
+ // Set new width
+ subColumnSizes[currentColumn, currentSubColumn] = headerTextSize.Width;
+
+ // Check for column maximum/minimum cell width restrictions
+ if(legendColumn.MinimumWidth >= 0)
+ {
+ subColumnSizes[currentColumn, currentSubColumn] =
+ (int)Math.Max(subColumnSizes[currentColumn, currentSubColumn], legendColumn.MinimumWidth * singleWCharacterSize.Width / 100f);
+ }
+ if(legendColumn.MaximumWidth >= 0)
+ {
+ subColumnSizes[currentColumn, currentSubColumn] =
+ (int)Math.Min(subColumnSizes[currentColumn, currentSubColumn], legendColumn.MaximumWidth * singleWCharacterSize.Width / 100f);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ //*************************************************************************
+ //** Adjust width of the cells to fit cell content displayed across
+ //** several cells (CellSpanning).
+ //*************************************************************************
+ if(secondIterationRequired)
+ {
+ for(currentColumn = 0; currentColumn < numberOfColumns; currentColumn++)
+ {
+ for(int currentSubColumn = 0; currentSubColumn < numberOfSubColumns; currentSubColumn++)
+ {
+ for(currentRow = 0; currentRow < numberOfRowsPerColumn[currentColumn]; currentRow++)
+ {
+ // Get current cell size
+ int cellWidth = cellWidths[currentColumn, currentRow, currentSubColumn];
+
+ // Second iteration used to adjust width of the cells that are used to
+ // draw content across several horizontal cells (CellSpanning)
+ // Check if current cell will be spanned to the next ones
+ int cellSpan = 0;
+ while(currentSubColumn + cellSpan + 1 < numberOfSubColumns)
+ {
+ int nextCellWidth = cellWidths[currentColumn, currentRow, currentSubColumn + cellSpan + 1];
+ if(nextCellWidth >= 0)
+ {
+ break;
+ }
+ ++cellSpan;
+ }
+
+
+ // Cell span was detected
+ if(cellSpan > 0)
+ {
+ // Calculate total width of current cell and all overlapped cells
+ int spanWidth = 0;
+ for(int index = 0; index <= cellSpan; index++)
+ {
+ spanWidth += subColumnSizes[currentColumn, currentSubColumn + index];
+ }
+
+ // Check if current cell fits into the cell span
+ if(cellWidth > spanWidth)
+ {
+ // Adjust last span cell width to fit all curent cell content
+ subColumnSizes[currentColumn, currentSubColumn + cellSpan] += cellWidth - spanWidth;
+ }
+ }
+ }
+ }
+ }
+ }
+
+
+ //*************************************************************************
+ //** Check if equally spaced legend columns are used
+ //*************************************************************************
+ if(this.IsEquallySpacedItems)
+ {
+ // Makre sure that same sub-colimn width are used in all columns
+ for(int currentSubColumn = 0; currentSubColumn < numberOfSubColumns; currentSubColumn++)
+ {
+ int width = 0;
+ for(currentColumn = 0; currentColumn < numberOfColumns; currentColumn++)
+ {
+ width = Math.Max(width, subColumnSizes[currentColumn, currentSubColumn]);
+ }
+
+ // Set new sub-column width for each column
+ for(currentColumn = 0; currentColumn < numberOfColumns; currentColumn++)
+ {
+ subColumnSizes[currentColumn, currentSubColumn] = width;
+ }
+ }
+ }
+
+ //*************************************************************************
+ //** Calculate total width and height occupied by all cells
+ //*************************************************************************
+ int totalWidth = 0;
+ int totalTableColumnSpacingWidth = 0;
+ for(currentColumn = 0; currentColumn < numberOfColumns; currentColumn++)
+ {
+ // Add up all sub-columns
+ for(int currentSubColumn = 0; currentSubColumn < numberOfSubColumns; currentSubColumn++)
+ {
+ totalWidth += subColumnSizes[currentColumn, currentSubColumn];
+ }
+
+ // Add spacer between columns
+ if(currentColumn < numberOfColumns - 1)
+ {
+ totalTableColumnSpacingWidth += this.GetSeparatorSize(this.ItemColumnSeparator).Width;
+ }
+ }
+
+ int totalHeight = 0;
+ for(currentColumn = 0; currentColumn < numberOfColumns; currentColumn++)
+ {
+ int columnHeight = 0;
+ for(currentRow = 0; currentRow < numberOfRowsPerColumn[currentColumn]; currentRow++)
+ {
+ columnHeight += cellHeights[currentColumn, currentRow];
+ }
+
+ totalHeight = Math.Max(totalHeight, columnHeight);
+ }
+
+ //*************************************************************************
+ //** Check if everything fits
+ //*************************************************************************
+ horizontalSpaceLeft = legendItemsAreaSize.Width - totalWidth - totalTableColumnSpacingWidth;
+ if(horizontalSpaceLeft < 0)
+ {
+ fitFlag = false;
+ }
+
+ verticalSpaceLeft = legendItemsAreaSize.Height - totalHeight;
+ if(verticalSpaceLeft < 0)
+ {
+ fitFlag = false;
+ }
+
+ return fitFlag;
+ }
+
+ /// <summary>
+ /// Gets maximum number of legend cells defined as Column objects
+ /// or Cells in the custom legend items.
+ /// </summary>
+ /// <returns>Maximum number of cells.</returns>
+ private int GetNumberOfCells()
+ {
+ // Calculate cell number if it was not previously cached
+ if(this._numberOfCells < 0)
+ {
+ // Initialize with number of defined columns
+ this._numberOfCells = this.CellColumns.Count;
+
+ // Check if number of cells in legend items exceed number of defined columns
+ foreach(LegendItem legendItem in this.legendItems)
+ {
+ this._numberOfCells = Math.Max(this._numberOfCells, legendItem.Cells.Count);
+ }
+ }
+ return this._numberOfCells;
+ }
+
+ #endregion // Legend Items Fitting Methods
+
+ #region Legend items collection filling methods
+
+ /// <summary>
+ /// Add all series legend into items collection and then
+ /// add custom legend items.
+ /// </summary>
+ private void FillLegendItemsCollection()
+ {
+ // Clear all items
+ legendItems.Clear();
+
+ // Check that there is no invalid legend names in the series
+ foreach(Series series in this.Common.DataManager.Series)
+ {
+ if (this.Common.ChartPicture.Legends.IndexOf(series.Legend)<0)
+ {
+ throw (new InvalidOperationException(SR.ExceptionLegendReferencedInSeriesNotFound(series.Name, series.Legend)));
+ }
+ }
+
+ // Flag which indicates that series requires legend items to be reversed
+ bool seriesWithReversedLegendItemsPresent = false;
+
+ // Add legend items based on the exsisting chart series
+ foreach(Series series in this.Common.DataManager.Series)
+ {
+ // Check if series uses this legend
+ // VSTS issue #140694 fix: support of series.Legend = "Default";
+ if (this.Common.ChartPicture.Legends[series.Legend] != this)
+ {
+ continue;
+ }
+
+ // Make sure series is assigned to the chart area
+ if(series.ChartArea.Length > 0)
+ {
+ // Check if chart area name is valid
+ bool areaNameFound = false;
+ foreach(ChartArea area in this.Common.ChartPicture.ChartAreas)
+ {
+ if(area.Name == series.ChartArea)
+ {
+ areaNameFound = true;
+ break;
+ }
+ }
+
+ // Check if series is visible and valid chart area name was used
+ if(series.IsVisible() && areaNameFound)
+ {
+ // Check if we should add all data points into the legend
+ IChartType chartType = this.Common.ChartTypeRegistry.GetChartType(series.ChartTypeName);
+
+
+ // Check if series legend items should be reversed
+ if (this.LegendItemOrder == LegendItemOrder.Auto)
+ {
+ if(series.ChartType == SeriesChartType.StackedArea ||
+ series.ChartType == SeriesChartType.StackedArea100 ||
+ series.ChartType == SeriesChartType.Pyramid ||
+ series.ChartType == SeriesChartType.StackedColumn ||
+ series.ChartType == SeriesChartType.StackedColumn100 )
+ {
+ seriesWithReversedLegendItemsPresent = true;
+ }
+ }
+ // Add item(s) based on series points label and fore color
+ if(chartType.DataPointsInLegend)
+ {
+ // Check if data points have X values set
+ bool xValuesSet = false;
+ foreach(DataPoint point in series.Points)
+ {
+ if(point.XValue != 0.0)
+ {
+ xValuesSet = true;
+ break;
+ }
+ }
+
+ // Add legend items for each point
+ int index = 0;
+ foreach(DataPoint point in series.Points)
+ {
+ // Do not show empty data points in the legend
+ if(point.IsEmpty)
+ {
+ ++index;
+ continue;
+ }
+
+ // Point should not be shown in the legend
+ if(!point.IsVisibleInLegend)
+ {
+ ++index;
+ continue;
+ }
+
+ // Create new legend item
+ LegendItem item = new LegendItem(point.Label, point.Color, "");
+
+ // Check if series is drawn in 3D chart area
+ bool area3D = this.Common.Chart.ChartAreas[series.ChartArea].Area3DStyle.Enable3D;
+
+ // Set legend item appearance properties
+ item.SetAttributes(this.Common, series);
+ item.SetAttributes(point, area3D);
+
+ // Set chart image map properties
+ item.ToolTip = point.ReplaceKeywords(point.LegendToolTip);
+#if !Microsoft_CONTROL
+ item.MapAreaAttributes = point.ReplaceKeywords(point.LegendMapAreaAttributes);
+ item.PostBackValue = point.ReplaceKeywords(point.LegendPostBackValue);
+ item.Url = point.ReplaceKeywords(point.LegendUrl);
+#endif
+ item.Name = point.ReplaceKeywords(point.LegendText);
+
+ item.SeriesPointIndex = index++;
+ if(item.Name.Length == 0)
+ {
+ item.Name = point.ReplaceKeywords((point.Label.Length > 0) ? point.Label : point.AxisLabel);
+ }
+
+ // If legend item name is not defined - try using the X value
+ if(item.Name.Length == 0 && xValuesSet)
+ {
+ item.Name = ValueConverter.FormatValue(
+ series.Chart,
+ this,
+ this.Tag,
+ point.XValue,
+ "", // Do not use point label format! For Y values only! point.LabelFormat,
+ point.series.XValueType,
+ ChartElementType.LegendItem);
+ }
+
+ // If legend item name is not defined - use index
+ if(item.Name.Length == 0)
+ {
+ item.Name = "Point " + index;
+ }
+
+ // Add legend item cells based on predefined columns
+ item.AddAutomaticCells(this);
+ foreach(LegendCell cell in item.Cells)
+ {
+ if(cell.Text.Length > 0)
+ {
+ // #LEGENDTEXT - series name
+ cell.Text = cell.Text.Replace(KeywordName.LegendText, item.Name);
+
+ // Process rest of the keywords
+ cell.Text = point.ReplaceKeywords(cell.Text);
+ cell.ToolTip = point.ReplaceKeywords(cell.ToolTip);
+#if !Microsoft_CONTROL
+ cell.Url = point.ReplaceKeywords(cell.Url);
+ cell.MapAreaAttributes = point.ReplaceKeywords(cell.MapAreaAttributes);
+ cell.PostBackValue = point.ReplaceKeywords(cell.PostBackValue);
+#endif // !Microsoft_CONTROL
+ }
+ }
+
+ legendItems.Add(item);
+ }
+ }
+
+ // Add item based on series name and fore color
+ else
+ {
+ // Point should not be shown in the legend
+ if(!series.IsVisibleInLegend)
+ {
+ continue;
+ }
+
+ // Create legend item
+ LegendItem item = new LegendItem(series.Name, series.Color, "");
+ item.SetAttributes(this.Common, series);
+
+ item.ToolTip = series.ReplaceKeywords(series.LegendToolTip);
+#if !Microsoft_CONTROL
+ item.Url = series.ReplaceKeywords(series.LegendUrl);
+ item.MapAreaAttributes = series.ReplaceKeywords(series.LegendMapAreaAttributes);
+ item.PostBackValue = series.ReplaceKeywords(series.LegendPostBackValue);
+#endif // !Microsoft_CONTROL
+
+ if (series.LegendText.Length > 0)
+ {
+ item.Name = series.ReplaceKeywords(series.LegendText);
+ }
+
+ // Add legend item cells based on predefined columns
+ item.AddAutomaticCells(this);
+ foreach(LegendCell cell in item.Cells)
+ {
+ if(cell.Text.Length > 0)
+ {
+ // #LEGENDTEXT - series name
+ cell.Text = cell.Text.Replace(KeywordName.LegendText, item.Name);
+
+ // Process rest of the keywords
+ cell.Text = series.ReplaceKeywords(cell.Text);
+ cell.ToolTip = series.ReplaceKeywords(cell.ToolTip);
+#if !Microsoft_CONTROL
+ cell.Url = series.ReplaceKeywords(cell.Url);
+ cell.MapAreaAttributes = series.ReplaceKeywords(cell.MapAreaAttributes);
+ cell.PostBackValue = series.ReplaceKeywords(cell.PostBackValue);
+#endif // !Microsoft_CONTROL
+ }
+ }
+
+ legendItems.Add(item);
+ }
+ }
+ }
+ }
+
+
+ // Check if series legend items should be reversed
+ if (this.LegendItemOrder == LegendItemOrder.SameAsSeriesOrder ||
+ (this.LegendItemOrder == LegendItemOrder.Auto && seriesWithReversedLegendItemsPresent))
+ {
+ // Reversed series generated legend items
+ legendItems.Reverse();
+ }
+
+
+ // Add custom items
+ foreach(LegendItem item in this._customLegends)
+ {
+ if(item.Enabled)
+ {
+ legendItems.Add(item);
+ }
+ }
+
+ // Legend can't be empty at design time
+ if(legendItems.Count == 0 && this.Common != null && this.Common.Chart != null)
+ {
+ if(this.Common.Chart.IsDesignMode())
+ {
+ LegendItem item = new LegendItem(this.Name + " - " + SR.DescriptionTypeEmpty, Color.White, "");
+ item.ImageStyle = LegendImageStyle.Line;
+ legendItems.Add(item);
+ }
+ }
+
+ // Add legend item cells based on predefined columns
+ foreach(LegendItem item in this.legendItems)
+ {
+ item.AddAutomaticCells(this);
+ }
+
+ }
+
+ #endregion
+
+ #region Legend painting methods
+
+ /// <summary>
+ /// Paints legend using chart graphics object.
+ /// </summary>
+ /// <param name="chartGraph">The graph provides drawing object to the display device. A Graphics object is associated with a specific device context.</param>
+ internal void Paint(ChartGraphics chartGraph )
+ {
+ // Reset some values
+ this._offset = Size.Empty;
+ this._itemColumns = 0;
+ this._horizontalSpaceLeft = 0;
+ this._verticalSpaceLeft = 0;
+ this._subColumnSizes = null;
+ this._numberOfRowsPerColumn = null;
+ this._cellHeights = null;
+ this.autofitFont = null;
+ this._autoFitFontSizeAdjustment = 0;
+ this._numberOfCells = -1;
+ this._numberOfLegendItemsToProcess = -1;
+
+ // Do nothing if legend disabled
+ if(!this.IsEnabled() ||
+ (this.MaximumAutoSize == 0f && this.Position.Auto))
+ {
+ return;
+ }
+
+ // Add all series legend into items collection and then add custom legend items
+ FillLegendItemsCollection();
+
+ // Clear all legend item cells information
+ foreach(LegendItem legendItem in this.legendItems)
+ {
+ foreach(LegendCell cell in legendItem.Cells)
+ {
+ cell.ResetCache();
+ }
+ }
+
+ // Call a notification event, so that legend items collection can be modified by user
+ this.Common.Chart.CallOnCustomizeLegend(legendItems, this.Name);
+
+ // Check if legend is empty
+ if(this.legendItems.Count == 0)
+ {
+ return;
+ }
+
+ //***********************************************************
+ //** RecalculateAxesScale legend information
+ //***********************************************************
+ this.RecalcLegendInfo(chartGraph);
+
+
+
+ //***********************************************************
+ //** Paint legend
+ //***********************************************************
+
+ // Call BackPaint event
+ if( Common.ProcessModePaint )
+ {
+ // Draw legend background, border and shadow
+ chartGraph.FillRectangleRel(
+ chartGraph.GetRelativeRectangle(Rectangle.Round(chartGraph.GetAbsoluteRectangle(this.Position.ToRectangleF()))),
+ BackColor,
+ BackHatchStyle,
+ BackImage,
+ BackImageWrapMode,
+ BackImageTransparentColor,
+ BackImageAlignment,
+ BackGradientStyle,
+ BackSecondaryColor,
+ BorderColor,
+ this.GetBorderSize(),
+ BorderDashStyle,
+ ShadowColor,
+ ShadowOffset,
+ PenAlignment.Inset);
+
+ Common.Chart.CallOnPrePaint(new ChartPaintEventArgs(this, chartGraph, Common, Position));
+ }
+
+ if( Common.ProcessModeRegions )
+ {
+ SelectLegendBackground();
+ }
+
+ //***********************************************************
+ //** Draw legend header
+ //***********************************************************
+
+ this.DrawLegendHeader(chartGraph);
+
+ //***********************************************************
+ //** Draw legend title
+ //***********************************************************
+
+ this.DrawLegendTitle(chartGraph);
+
+ // Add legend title hot region
+ if( Common.ProcessModeRegions && !this._titlePosition.IsEmpty)
+ {
+ Common.HotRegionsList.AddHotRegion(chartGraph.GetRelativeRectangle(this._titlePosition), this, ChartElementType.LegendTitle, true );
+ }
+
+ //***********************************************************
+ //** Draw legend items
+ //***********************************************************
+ if(this._numberOfLegendItemsToProcess < 0)
+ {
+ this._numberOfLegendItemsToProcess = this.legendItems.Count;
+ }
+ for(int itemIndex = 0; itemIndex < this._numberOfLegendItemsToProcess; itemIndex++)
+ {
+ LegendItem legendItem = this.legendItems[itemIndex];
+
+ // Iterate through legend item cells
+ for(int cellIndex = 0; cellIndex < legendItem.Cells.Count; cellIndex++)
+ {
+ // Get legend cell
+ LegendCell legendCell = legendItem.Cells[cellIndex];
+
+ // Paint cell
+ legendCell.Paint(
+ chartGraph,
+ this._autoFitFontSizeAdjustment,
+ this.autofitFont,
+ this.singleWCharacterSize);
+ }
+
+ // Paint legend item separator
+ if(legendItem.SeparatorType != LegendSeparatorStyle.None &&
+ legendItem.Cells.Count > 0)
+ {
+ // Calculate separator position
+ Rectangle separatorPosition = Rectangle.Empty;
+ separatorPosition.X = legendItem.Cells[0].cellPosition.Left;
+
+ // Find right most cell position excluding ovelapped cells that have negative size
+ int right = 0;
+ for(int index = legendItem.Cells.Count - 1; index >= 0; index--)
+ {
+ right = legendItem.Cells[index].cellPosition.Right;
+ if(right > 0)
+ {
+ break;
+ }
+ }
+ separatorPosition.Width = right - separatorPosition.X;
+ separatorPosition.Y = legendItem.Cells[0].cellPosition.Bottom;
+ separatorPosition.Height = this.GetSeparatorSize(legendItem.SeparatorType).Height;
+ separatorPosition.Intersect(this._legendItemsAreaPosition);
+
+ // Draw separator
+ this.DrawSeparator(
+ chartGraph,
+ legendItem.SeparatorType,
+ legendItem.SeparatorColor,
+ true,
+ separatorPosition);
+ }
+ }
+
+ //***********************************************************
+ //** If legend items are in multiple columns draw vertical
+ //** separator
+ //***********************************************************
+ if(this.ItemColumnSeparator != LegendSeparatorStyle.None)
+ {
+ Rectangle separatorRect = Rectangle.Round(chartGraph.GetAbsoluteRectangle(this.Position.ToRectangleF()));
+ separatorRect.Y += this.GetBorderSize() + this._titlePosition.Height;
+ separatorRect.Height -= 2 * this.GetBorderSize() + this._titlePosition.Height;
+ separatorRect.X += this.GetBorderSize() + this._offset.Width;
+ separatorRect.Width = this.GetSeparatorSize(this.ItemColumnSeparator).Width;
+ if(this._horizontalSpaceLeft > 0)
+ {
+ separatorRect.X += this._horizontalSpaceLeft / 2;
+ }
+
+ // Check position
+ if(separatorRect.Width > 0 && separatorRect.Height > 0)
+ {
+ // Iterate through all columns
+ for(int columnIndex = 0; columnIndex < this._itemColumns; columnIndex++ )
+ {
+ // Iterate through all sub-columns
+ int cellCount = this.GetNumberOfCells();
+ for(int subColumnIndex = 0; subColumnIndex < cellCount; subColumnIndex++ )
+ {
+ separatorRect.X += this._subColumnSizes[columnIndex, subColumnIndex];
+ }
+
+ // Draw separator if not the last column
+ if(columnIndex < this._itemColumns - 1)
+ {
+ this.DrawSeparator(chartGraph, this.ItemColumnSeparator, this.ItemColumnSeparatorColor, false, separatorRect);
+ }
+
+ // Add separator width
+ separatorRect.X += separatorRect.Width;
+ }
+ }
+ }
+
+ //***********************************************************
+ //** Draw special indicator on the bottom of the legend if
+ //** it was truncated.
+ //***********************************************************
+ if(this._legendItemsTruncated &&
+ this._legendItemsAreaPosition.Height > this._truncatedDotsSize / 2)
+ {
+ // Calculate dots step (no more than 10 pixel)
+ int markerCount = 3;
+ int step = (this._legendItemsAreaPosition.Width / 3) / markerCount;
+ step = (int)Math.Min(step, 10);
+
+ // Calculate start point
+ PointF point = new PointF(
+ this._legendItemsAreaPosition.X + this._legendItemsAreaPosition.Width / 2 - step * (float)Math.Floor(markerCount/2f),
+ this._legendItemsAreaPosition.Bottom + (this._truncatedDotsSize + this._offset.Height) / 2);
+
+ // Draw several dots at the bottom of the legend
+ for(int index = 0; index < markerCount; index++)
+ {
+ chartGraph.DrawMarkerRel(
+ chartGraph.GetRelativePoint(point),
+ MarkerStyle.Circle,
+ this._truncatedDotsSize,
+ this.ForeColor,
+ Color.Empty,
+ 0,
+ string.Empty,
+ Color.Empty,
+ 0,
+ Color.Empty,
+ RectangleF.Empty);
+
+ // Shift to the right
+ point.X += step;
+ }
+
+ }
+
+
+ // Call Paint event
+ if( Common.ProcessModePaint )
+ {
+ Common.Chart.CallOnPostPaint(new ChartPaintEventArgs(this, chartGraph, Common, Position));
+ }
+
+ // Remove temporary cells from legend items
+ foreach(LegendItem legendItem in this.legendItems)
+ {
+ if(legendItem.clearTempCells)
+ {
+ legendItem.clearTempCells = false;
+ legendItem.Cells.Clear();
+ }
+ }
+
+ }
+
+ #endregion
+
+ #region Legend properties
+
+ /// <summary>
+ /// Gets or sets the name of the legend.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeLegend_Name"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ ]
+ public override string Name
+ {
+ get
+ {
+ return base.Name;
+ }
+ set
+ {
+ base.Name = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the name of the chart area where the legend
+ /// should be docked.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeDocking"),
+ Bindable(true),
+ DefaultValue(Constants.NotSetValue),
+ SRDescription("DescriptionAttributeLegend_DockToChartArea"),
+ TypeConverter(typeof(LegendAreaNameConverter)),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ ]
+ public string DockedToChartArea
+ {
+ get
+ {
+ return _dockedToChartArea;
+ }
+ set
+ {
+ if(value != _dockedToChartArea)
+ {
+ if (String.IsNullOrEmpty(value))
+ {
+ _dockedToChartArea = Constants.NotSetValue;
+ }
+ else
+ {
+ if (Chart != null && Chart.ChartAreas != null)
+ {
+ Chart.ChartAreas.VerifyNameReference(value);
+ }
+ _dockedToChartArea = value;
+ }
+ this.Invalidate(false);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a property which indicates whether
+ /// the legend is docked inside the chart area.
+ /// This property is only available when DockedToChartArea is set.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeDocking"),
+ Bindable(true),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeLegend_DockInsideChartArea"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ ]
+ public bool IsDockedInsideChartArea
+ {
+ get
+ {
+ return _isDockedInsideChartArea;
+ }
+ set
+ {
+ if(value != _isDockedInsideChartArea)
+ {
+ _isDockedInsideChartArea = value;
+ this.Invalidate(false);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the position of the legend.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeLegend_Position"),
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ElementPositionConverter)),
+ SerializationVisibilityAttribute(SerializationVisibility.Element)
+ ]
+ public ElementPosition Position
+ {
+ get
+ {
+ // Serialize only position values if Auto set to false
+ if (this.Common != null && this.Common.Chart != null && this.Common.Chart.serializationStatus == SerializationStatus.Saving)
+ {
+ if(_position.Auto)
+ {
+ return new ElementPosition();
+ }
+ else
+ {
+ ElementPosition newPosition = new ElementPosition();
+#if Microsoft_CONTROL
+ newPosition.Auto = false;
+#else
+ newPosition.Auto = true;
+#endif
+ newPosition.SetPositionNoAuto(_position.X, _position.Y, _position.Width, _position.Height);
+ return newPosition;
+ }
+ }
+ return _position;
+ }
+ set
+ {
+ _position = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Determoines if this position should be serialized.
+ /// </summary>
+ /// <returns></returns>
+ internal bool ShouldSerializePosition()
+ {
+ return !this.Position.Auto;
+ }
+
+
+ /// <summary>
+ /// Gets or sets a property which indicates whether
+ /// all legend items are equally spaced.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeLegend_EquallySpacedItems"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public bool IsEquallySpacedItems
+ {
+ get
+ {
+ return _isEquallySpacedItems;
+ }
+ set
+ {
+ _isEquallySpacedItems = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag which indicates whether the legend is enabled.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeLegend_Enabled"),
+ NotifyParentPropertyAttribute(true),
+ ParenthesizePropertyNameAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public bool Enabled
+ {
+ get
+ {
+ return _enabled;
+ }
+ set
+ {
+ _enabled = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value that indicates if legend text is automatically sized.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeLegend_AutoFitText"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public bool IsTextAutoFit
+ {
+ get
+ {
+ return _isTextAutoFit;
+ }
+ set
+ {
+ _isTextAutoFit = value;
+
+ if(_isTextAutoFit)
+ {
+ // Reset the font size to "8"
+ // Use current font family name ans style if possible.
+ if(_font != null)
+ {
+ _font = _fontCache.GetFont(_font.FontFamily, 8, _font.Style); ;
+ }
+ else
+ {
+ _font = _fontCache.DefaultFont;
+ }
+ }
+
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the legend style.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(LegendStyle.Table),
+ SRDescription("DescriptionAttributeLegend_LegendStyle"),
+ NotifyParentPropertyAttribute(true),
+ ParenthesizePropertyNameAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public LegendStyle LegendStyle
+ {
+ get
+ {
+ return _legendStyle;
+ }
+ set
+ {
+ _legendStyle = value;
+ this.Invalidate(false);
+ }
+ }
+
+
+ /// <summary>
+ /// Gets or sets the minimum font size that can be used by the legend text's auto-fitting algorithm.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(7),
+ SRDescription("DescriptionAttributeLegend_AutoFitMinFontSize"),
+ ]
+ public int AutoFitMinFontSize
+ {
+ get
+ {
+ return this._autoFitMinFontSize;
+ }
+ set
+ {
+ // Font size cannot be less than 5
+ if(value < 5)
+ {
+ throw (new InvalidOperationException(SR.ExceptionLegendAutoFitMinFontSizeInvalid));
+ }
+
+ this._autoFitMinFontSize = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the maximum size (in percentage) of the legend used in the automatic layout algorithm.
+ /// </summary>
+ /// <remarks>
+ /// If the legend is docked to the left or right, this property determines the maximum width of the legend, measured as a percentage.
+ /// If the legend is docked to the top or bottom, this property determines the maximum height of the legend, measured as a percentage.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeDocking"),
+ DefaultValue(50f),
+ SRDescription("DescriptionAttributeLegend_MaxAutoSize"),
+ ]
+ public float MaximumAutoSize
+ {
+ get
+ {
+ return this._maximumLegendAutoSize;
+ }
+ set
+ {
+ if(value < 0f || value > 100f)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionLegendMaximumAutoSizeInvalid));
+ }
+ this._maximumLegendAutoSize = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets a collection of legend columns.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeCellColumns"),
+ SRDescription("DescriptionAttributeLegend_CellColumns"),
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ Editor(Editors.LegendCellColumnCollectionEditor.Editor, Editors.LegendCellColumnCollectionEditor.Base),
+ ]
+ public LegendCellColumnCollection CellColumns
+ {
+ get
+ {
+ return this._cellColumns;
+ }
+ }
+
+ /// <summary>
+ /// Gets the legend table style.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(LegendTableStyle.Auto),
+ SRDescription("DescriptionAttributeLegend_TableStyle"),
+ NotifyParentPropertyAttribute(true),
+ ParenthesizePropertyNameAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public LegendTableStyle TableStyle
+ {
+ get
+ {
+ return this._legendTableStyle;
+ }
+ set
+ {
+ this._legendTableStyle = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets the legend header separator style.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeCellColumns"),
+ DefaultValue(typeof(LegendSeparatorStyle), "None"),
+ SRDescription("DescriptionAttributeLegend_HeaderSeparator"),
+ ]
+ public LegendSeparatorStyle HeaderSeparator
+ {
+ get
+ {
+ return this._headerSeparator;
+ }
+ set
+ {
+ if(value != this._headerSeparator)
+ {
+ this._headerSeparator = value;
+ this.Invalidate(false);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the color of the legend header separator.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeCellColumns"),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeLegend_HeaderSeparatorColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ ]
+ public Color HeaderSeparatorColor
+ {
+ get
+ {
+ return this._headerSeparatorColor;
+ }
+ set
+ {
+ if(value != this._headerSeparatorColor)
+ {
+ this._headerSeparatorColor = value;
+ this.Invalidate(false);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the separator style of the legend table columns.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeCellColumns"),
+ DefaultValue(typeof(LegendSeparatorStyle), "None"),
+ SRDescription("DescriptionAttributeLegend_ItemColumnSeparator"),
+ ]
+ public LegendSeparatorStyle ItemColumnSeparator
+ {
+ get
+ {
+ return this._itemColumnSeparator;
+ }
+ set
+ {
+ if(value != this._itemColumnSeparator)
+ {
+ this._itemColumnSeparator = value;
+ this.Invalidate(false);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the color of the separator of the legend table columns.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeCellColumns"),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeLegend_ItemColumnSeparatorColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ ]
+ public Color ItemColumnSeparatorColor
+ {
+ get
+ {
+ return this._itemColumnSeparatorColor;
+ }
+ set
+ {
+ if(value != this._itemColumnSeparatorColor)
+ {
+ this._itemColumnSeparatorColor = value;
+ this.Invalidate(false);
+ }
+ }
+ }
+
+
+ /// <summary>
+ /// Gets or sets the legend table column spacing, as a percentage of the legend text font.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeCellColumns"),
+ DefaultValue(50),
+ SRDescription("DescriptionAttributeLegend_ItemColumnSpacing"),
+ ]
+ public int ItemColumnSpacing
+ {
+ get
+ {
+ return this._itemColumnSpacing;
+ }
+ set
+ {
+ if(value != this._itemColumnSpacing)
+ {
+ if(value < 0)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionLegendColumnSpacingInvalid));
+ }
+ this._itemColumnSpacing = value;
+ this.Invalidate(false);
+ }
+ }
+ }
+
+
+
+ /// <summary>
+ /// Gets or sets the legend background color.
+ /// </summary>
+ [
+ DefaultValue(typeof(Color), ""),
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeBackColor"),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BackColor
+ {
+ get
+ {
+ return _backColor;
+ }
+ set
+ {
+ _backColor = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the legend border color.
+ /// </summary>
+ [
+ DefaultValue(typeof(Color), ""),
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeBorderColor"),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BorderColor
+ {
+ get
+ {
+ return _borderColor;
+ }
+ set
+ {
+ _borderColor = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the legend border style.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartDashStyle.Solid),
+ SRDescription("DescriptionAttributeBorderDashStyle"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public ChartDashStyle BorderDashStyle
+ {
+ get
+ {
+ return _borderDashStyle;
+ }
+ set
+ {
+ _borderDashStyle = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the legend border width.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(1),
+ SRDescription("DescriptionAttributeBorderWidth"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public int BorderWidth
+ {
+ get
+ {
+ return _borderWidth;
+ }
+ set
+ {
+ if(value < 0)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionLegendBorderWidthIsNegative));
+ }
+ _borderWidth = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the legend background image.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeBackImage"),
+ Editor(Editors.ImageValueEditor.Editor, Editors.ImageValueEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ NotifyParentPropertyAttribute(true),
+ ]
+ public string BackImage
+ {
+ get
+ {
+ return _backImage;
+ }
+ set
+ {
+ _backImage = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the legend background image drawing mode.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartImageWrapMode.Tile),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeImageWrapMode"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public ChartImageWrapMode BackImageWrapMode
+ {
+ get
+ {
+ return _backImageWrapMode;
+ }
+ set
+ {
+ _backImageWrapMode = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a color which will be replaced with a transparent color while drawing the background image.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeImageTransparentColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BackImageTransparentColor
+ {
+ get
+ {
+ return _backImageTransparentColor;
+ }
+ set
+ {
+ _backImageTransparentColor = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background image alignment used for the unscaled drawing mode.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartImageAlignmentStyle.TopLeft),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackImageAlign"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public ChartImageAlignmentStyle BackImageAlignment
+ {
+ get
+ {
+ return _backImageAlignment;
+ }
+ set
+ {
+ _backImageAlignment = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets background gradient style of the legend.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(GradientStyle.None),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackGradientStyle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ Editor(Editors.GradientEditor.Editor, Editors.GradientEditor.Base)
+
+ ]
+ public GradientStyle BackGradientStyle
+ {
+ get
+ {
+ return _backGradientStyle;
+ }
+ set
+ {
+ _backGradientStyle = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the secondary background color.
+ /// <seealso cref="BackColor"/>
+ /// <seealso cref="BackHatchStyle"/>
+ /// <seealso cref="BackGradientStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value used for the secondary color of background with
+ /// hatching or gradient fill.
+ /// </value>
+ /// <remarks>
+ /// This color is used with <see cref="BackColor"/> when <see cref="BackHatchStyle"/> or
+ /// <see cref="BackGradientStyle"/> are used.
+ /// </remarks>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackSecondaryColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BackSecondaryColor
+ {
+ get
+ {
+ return _backSecondaryColor;
+ }
+ set
+ {
+ _backSecondaryColor = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background hatch style.
+ /// <seealso cref="BackSecondaryColor"/>
+ /// <seealso cref="BackColor"/>
+ /// <seealso cref="BackGradientStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="ChartHatchStyle"/> value used for the background.
+ /// </value>
+ /// <remarks>
+ /// Two colors are used to draw the hatching, <see cref="BackColor"/> and <see cref="BackSecondaryColor"/>.
+ /// </remarks>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartHatchStyle.None),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackHatchStyle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ Editor(Editors.HatchStyleEditor.Editor, Editors.HatchStyleEditor.Base)
+ ]
+ public ChartHatchStyle BackHatchStyle
+ {
+ get
+ {
+ return _backHatchStyle;
+ }
+ set
+ {
+ _backHatchStyle = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the font of the legend text.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Font), "Microsoft Sans Serif, 8pt"),
+ SRDescription("DescriptionAttributeLegend_Font"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Font Font
+ {
+ get
+ {
+ return _font;
+ }
+ set
+ {
+ this.IsTextAutoFit = false;
+
+ _font = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the color of the legend text.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeLegendFontColor"),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color ForeColor
+ {
+ get
+ {
+ return _foreColor;
+ }
+ set
+ {
+ _foreColor = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the text alignment.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeDocking"),
+ Bindable(true),
+ DefaultValue(StringAlignment.Near),
+ SRDescription("DescriptionAttributeLegend_Alignment"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public StringAlignment Alignment
+ {
+ get
+ {
+ return _legendAlignment;
+ }
+ set
+ {
+ _legendAlignment = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the property that specifies where the legend docks.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeDocking"),
+ Bindable(true),
+ DefaultValue(Docking.Right),
+ SRDescription("DescriptionAttributeLegend_Docking"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Docking Docking
+ {
+ get
+ {
+ return _legendDocking;
+ }
+ set
+ {
+ _legendDocking = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the offset between the legend and its shadow.
+ /// <seealso cref="ShadowColor"/>
+ /// </summary>
+ /// <value>
+ /// An integer value that represents the offset between the legend and its shadow.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(0),
+ SRDescription("DescriptionAttributeShadowOffset"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public int ShadowOffset
+ {
+ get
+ {
+ return _shadowOffset;
+ }
+ set
+ {
+ _shadowOffset = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the color of a legend's shadow.
+ /// <seealso cref="ShadowOffset"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value used to draw a legend's shadow.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), "128, 0, 0, 0"),
+ SRDescription("DescriptionAttributeShadowColor"),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color ShadowColor
+ {
+ get
+ {
+ return _shadowColor;
+ }
+ set
+ {
+ _shadowColor = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the name of the chart area name inside which the legend is drawn.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ Bindable(false),
+ DefaultValue(Constants.NotSetValue),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeLegend_InsideChartArea"),
+ EditorBrowsableAttribute(EditorBrowsableState.Never),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Content),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ TypeConverter(typeof(LegendAreaNameConverter))
+ ]
+ public string InsideChartArea
+ {
+ get
+ {
+ if(this.Common != null &&
+ this.Common.Chart != null &&
+ this.Common.Chart.serializing)
+ {
+ return "NotSet";
+ }
+ return this.DockedToChartArea;
+ }
+ set
+ {
+ if(value.Length == 0)
+ {
+ this.DockedToChartArea = Constants.NotSetValue;
+ }
+ else
+ {
+ this.DockedToChartArea = value;
+ }
+ this.Invalidate(false);
+ }
+ }
+
+
+ /// <summary>
+ /// Gets the custom legend items.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeLegend_CustomItems"),
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ Editor(Editors.LegendItemCollectionEditor.Editor, Editors.LegendItemCollectionEditor.Base),
+ ]
+ public LegendItemsCollection CustomItems
+ {
+ get
+ {
+ return _customLegends;
+ }
+ }
+
+
+
+ /// <summary>
+ /// Gets or sets a property that defines the preferred number of characters in a line of the legend text.
+ /// </summary>
+ /// <remarks>
+ /// When legend text exceeds the value defined in the <b>TextWrapThreshold</b> property, it will be
+ /// automatically wrapped on the next whitespace. Text will not be wrapped if there is no whitespace
+ /// characters in the text. Set this property to zero to disable the feature.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(25),
+ SRDescription("DescriptionAttributeLegend_TextWrapThreshold"),
+ ]
+ public int TextWrapThreshold
+ {
+ get
+ {
+ return this._textWrapThreshold;
+ }
+ set
+ {
+ if(value != this._textWrapThreshold)
+ {
+ if(value < 0)
+ {
+ throw (new ArgumentException(SR.ExceptionTextThresholdIsNegative, "value"));
+ }
+ this._textWrapThreshold = value;
+ this.Invalidate(false);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a property that specifies the order that legend items are shown. This property only affects
+ /// legend items automatically added for the chart series and has no effect on custom legend items.
+ /// </summary>
+ /// <remarks>
+ /// When the <b>LegendItemOrder</b> property is set to <b>Auto</b>, the legend will automatically be reversed
+ /// if StackedColumn, StackedColumn100, StackedArea or StackedArea100 chart types are used.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(LegendItemOrder.Auto),
+ SRDescription("DescriptionAttributeLegend_Reversed"),
+ ]
+ public LegendItemOrder LegendItemOrder
+ {
+ get
+ {
+ return this._legendItemOrder;
+ }
+ set
+ {
+ if(value != this._legendItemOrder)
+ {
+ this._legendItemOrder = value;
+ this.Invalidate(false);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag which indicates whether
+ /// legend rows should be drawn with interlaced background color.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeLegend_InterlacedRows"),
+ ]
+ public bool InterlacedRows
+ {
+ get
+ {
+ return this._interlacedRows;
+ }
+ set
+ {
+ if(value != this._interlacedRows)
+ {
+ this._interlacedRows = value;
+ this.Invalidate(false);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the legend interlaced row's background color. Only applicable if interlaced rows are used.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeLegend_InterlacedRowsColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ ]
+ public Color InterlacedRowsColor
+ {
+ get
+ {
+ return this._interlacedRowsColor;
+ }
+ set
+ {
+ if(value != this._interlacedRowsColor)
+ {
+ this._interlacedRowsColor = value;
+ this.Invalidate(false);
+ }
+ }
+ }
+
+ #endregion
+
+ #region Legend Title Properties
+
+ /// <summary>
+ /// Gets or sets the title text of the legend.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeTitle"),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeLegend_Title"),
+ ]
+ public string Title
+ {
+ get
+ {
+ return this._title;
+ }
+ set
+ {
+ if(value != this._title)
+ {
+ this._title = value;
+ this.Invalidate(false);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the text color of the legend title.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeTitle"),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeLegend_TitleColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ ]
+ public Color TitleForeColor
+ {
+ get
+ {
+ return this._titleForeColor;
+ }
+ set
+ {
+ if(value != this._titleForeColor)
+ {
+ this._titleForeColor = value;
+ this.Invalidate(false);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background color of the legend title.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeTitle"),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeTitleBackColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ ]
+ public Color TitleBackColor
+ {
+ get
+ {
+ return this._titleBackColor;
+ }
+ set
+ {
+ if(value != this._titleBackColor)
+ {
+ this._titleBackColor = value;
+ this.Invalidate(false);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the font of the legend title.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeTitle"),
+ DefaultValue(typeof(Font), "Microsoft Sans Serif, 8pt, style=Bold"),
+ SRDescription("DescriptionAttributeTitleFont"),
+ ]
+ public Font TitleFont
+ {
+ get
+ {
+ return this._titleFont;
+ }
+ set
+ {
+ if(value != this._titleFont)
+ {
+ this._titleFont = value;
+ this.Invalidate(false);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the text alignment of the legend title.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeTitle"),
+ DefaultValue(typeof(StringAlignment), "Center"),
+ SRDescription("DescriptionAttributeLegend_TitleAlignment"),
+ ]
+ public StringAlignment TitleAlignment
+ {
+ get
+ {
+ return this._titleAlignment;
+ }
+ set
+ {
+ if(value != this._titleAlignment)
+ {
+ this._titleAlignment = value;
+ this.Invalidate(false);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the separator style of the legend title.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeTitle"),
+ DefaultValue(typeof(LegendSeparatorStyle), "None"),
+ SRDescription("DescriptionAttributeLegend_TitleSeparator"),
+ ]
+ public LegendSeparatorStyle TitleSeparator
+ {
+ get
+ {
+ return this._titleSeparator;
+ }
+ set
+ {
+ if(value != this._titleSeparator)
+ {
+ this._titleSeparator = value;
+ this.Invalidate(false);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the separator color of the legend title.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeTitle"),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeLegend_TitleSeparatorColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ ]
+ public Color TitleSeparatorColor
+ {
+ get
+ {
+ return this._titleSeparatorColor;
+ }
+ set
+ {
+ if(value != this._titleSeparatorColor)
+ {
+ this._titleSeparatorColor = value;
+ this.Invalidate(false);
+ }
+ }
+ }
+
+
+
+ #endregion // Legend Title Properties
+
+ #region Legent Title and Header Helper methods
+
+ /// <summary>
+ /// Gets legend title size in relative coordinates.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics.</param>
+ /// <param name="titleMaxSize">Maximum possible legend title size.</param>
+ /// <returns>Legend yitle size.</returns>
+ private Size GetTitleSize(ChartGraphics chartGraph, Size titleMaxSize)
+ {
+ Size titleSize = Size.Empty;
+ if(this.Title.Length > 0)
+ {
+ // Adjust available space
+ titleMaxSize.Width -= this.GetBorderSize() * 2 + this._offset.Width;
+
+ // Measure title text size
+ titleSize = chartGraph.MeasureStringAbs(
+ this.Title.Replace("\\n", "\n"),
+ this.TitleFont,
+ titleMaxSize,
+ StringFormat.GenericTypographic);
+
+ // Add text spacing
+ titleSize.Height += this._offset.Height;
+ titleSize.Width += this._offset.Width;
+
+ // Add space required for the title separator
+ titleSize.Height += this.GetSeparatorSize(this.TitleSeparator).Height;
+ }
+
+ return titleSize;
+ }
+
+ /// <summary>
+ /// Gets legend header size in relative coordinates.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics.</param>
+ /// <param name="legendColumn">Legend column to get the header for.</param>
+ /// <returns>Legend yitle size.</returns>
+ private Size GetHeaderSize(ChartGraphics chartGraph, LegendCellColumn legendColumn)
+ {
+ Size headerSize = Size.Empty;
+ if(legendColumn.HeaderText.Length > 0)
+ {
+ // Measure title text size
+ headerSize = chartGraph.MeasureStringAbs(
+ legendColumn.HeaderText.Replace("\\n", "\n") + "I",
+ legendColumn.HeaderFont);
+
+ // Add text spacing
+ headerSize.Height += this._offset.Height;
+ headerSize.Width += this._offset.Width;
+
+ // Add space required for the title separator
+ headerSize.Height += this.GetSeparatorSize(this.HeaderSeparator).Height;
+ }
+
+ return headerSize;
+ }
+
+ /// <summary>
+ /// Draw Legend header.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics to draw the header on.</param>
+ private void DrawLegendHeader(ChartGraphics chartGraph)
+ {
+ // Check if header should be drawn
+ if(!this._headerPosition.IsEmpty &&
+ this._headerPosition.Width > 0 &&
+ this._headerPosition.Height > 0)
+ {
+ int prevRightLocation = -1;
+ bool redrawLegendBorder = false;
+
+ // Get Legend position
+ Rectangle legendPosition = Rectangle.Round(chartGraph.GetAbsoluteRectangle(this.Position.ToRectangleF()));
+ legendPosition.Y += /*this.offset.Height + */this.GetBorderSize();
+ legendPosition.Height -= 2 * (this._offset.Height + this.GetBorderSize());
+ legendPosition.X += this.GetBorderSize();
+ legendPosition.Width -= 2 * this.GetBorderSize();
+ if(this.GetBorderSize() > 0)
+ {
+ ++legendPosition.Height;
+ ++legendPosition.Width;
+ }
+
+ // Check if at least 1 column header has non-empty background color
+ bool headerBackFill = false;
+ for(int subColumnIndex = 0; subColumnIndex < this.CellColumns.Count; subColumnIndex++ )
+ {
+ LegendCellColumn legendColumn = this.CellColumns[subColumnIndex];
+ if(!legendColumn.HeaderBackColor.IsEmpty)
+ {
+ headerBackFill = true;
+ }
+ }
+
+ // Iterate through all columns
+ for(int columnIndex = 0; columnIndex < this._itemColumns; columnIndex++ )
+ {
+ int columnStart = 0;
+ int columnWidth = 0;
+
+ // Iterate through all sub-columns
+ int numberOfSubColumns = this._subColumnSizes.GetLength(1);
+ for(int subColumnIndex = 0; subColumnIndex < numberOfSubColumns; subColumnIndex++ )
+ {
+ // Calculate position of the header
+ Rectangle rect = this._headerPosition;
+ if(_horizontalSpaceLeft > 0)
+ {
+ rect.X += (int)(this._horizontalSpaceLeft / 2f);
+ }
+ if(prevRightLocation != -1)
+ {
+ rect.X = prevRightLocation;
+ }
+ rect.Width = this._subColumnSizes[columnIndex, subColumnIndex];
+ prevRightLocation = rect.Right;
+
+ // Remember column start position and update width
+ if(subColumnIndex == 0)
+ {
+ columnStart = rect.Left;
+ }
+ columnWidth += rect.Width;
+
+ // Make sure header position do not go outside of the legend
+ rect.Intersect(legendPosition);
+ if(rect.Width > 0 && rect.Height > 0)
+ {
+ // Define fill rectangle
+ Rectangle fillRect = rect;
+
+ // Make sure header fill riches legend top border
+ if(this._titlePosition.Height <= 0)
+ {
+ fillRect.Y -= this._offset.Height;
+ fillRect.Height += this._offset.Height;
+ }
+
+ // Stretch header fill rectangle and separators when vertical
+ // separator are used or if there is 1 column with header background
+ if( (this._itemColumns == 1 && headerBackFill) ||
+ this.ItemColumnSeparator != LegendSeparatorStyle.None)
+ {
+ // For the first cell in the first column stretch filling
+ // to the left side of the legend
+ if(columnIndex == 0 && subColumnIndex == 0)
+ {
+ int newX = legendPosition.X;
+ columnWidth += columnStart - newX;
+ columnStart = newX;
+ fillRect.Width += fillRect.X - legendPosition.X;
+ fillRect.X = newX;
+ }
+
+ // For the last cell in the last column stretch filling
+ // to the right side of the legend
+ if(columnIndex == (this._itemColumns - 1) &&
+ subColumnIndex == (numberOfSubColumns - 1) )
+ {
+ columnWidth += legendPosition.Right - fillRect.Right + 1;
+ fillRect.Width += legendPosition.Right - fillRect.Right + 1;
+ }
+
+ // For the first cell of any column except the first one
+ // make sure we also fill the item column spacing
+ if(columnIndex != 0 && subColumnIndex == 0)
+ {
+ columnWidth += this._itemColumnSpacingRel / 2;
+ columnStart -= this._itemColumnSpacingRel / 2;
+ fillRect.Width += this._itemColumnSpacingRel / 2;
+ fillRect.X -= this._itemColumnSpacingRel / 2;
+ }
+
+ // For the last cell in all columns except the last one
+ // make sure we also fill the item column spacing
+ if(columnIndex != (this._itemColumns - 1) &&
+ subColumnIndex == (numberOfSubColumns - 1) )
+ {
+ columnWidth += this._itemColumnSpacingRel / 2;
+ fillRect.Width += this._itemColumnSpacingRel / 2;
+ }
+ }
+
+ if(subColumnIndex < this.CellColumns.Count)
+ {
+ // Draw header background
+ LegendCellColumn legendColumn = this.CellColumns[subColumnIndex];
+ if(!legendColumn.HeaderBackColor.IsEmpty)
+ {
+ redrawLegendBorder = true;
+
+ // Fill title background
+ if(fillRect.Right > legendPosition.Right)
+ {
+ fillRect.Width -= (legendPosition.Right - fillRect.Right);
+ }
+ if(fillRect.X < legendPosition.X)
+ {
+ fillRect.X += legendPosition.X - fillRect.X;
+ fillRect.Width -= (legendPosition.X - fillRect.X);
+ }
+ fillRect.Intersect(legendPosition);
+ chartGraph.FillRectangleRel(
+ chartGraph.GetRelativeRectangle(fillRect),
+ legendColumn.HeaderBackColor,
+ ChartHatchStyle.None,
+ string.Empty,
+ ChartImageWrapMode.Tile,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ GradientStyle.None,
+ Color.Empty,
+ Color.Empty,
+ 0,
+ ChartDashStyle.NotSet,
+ Color.Empty,
+ 0,
+ PenAlignment.Inset);
+
+ }
+
+ // Draw header text
+ using(SolidBrush textBrush = new SolidBrush(legendColumn.HeaderForeColor))
+ {
+ // Set text alignment
+ using (StringFormat format = new StringFormat())
+ {
+ format.Alignment = legendColumn.HeaderAlignment;
+ format.LineAlignment = StringAlignment.Center;
+ format.FormatFlags = StringFormatFlags.LineLimit;
+ format.Trimming = StringTrimming.EllipsisCharacter;
+
+ // Draw string using relative coordinates
+ chartGraph.DrawStringRel(
+ legendColumn.HeaderText,
+ legendColumn.HeaderFont,
+ textBrush,
+ chartGraph.GetRelativeRectangle(rect),
+ format);
+ }
+ }
+ }
+ }
+ }
+
+ // Draw header separator for each column
+ Rectangle separatorRect = this._headerPosition;
+ separatorRect.X = columnStart;
+ separatorRect.Width = columnWidth;
+ if(this.HeaderSeparator == LegendSeparatorStyle.Line || this.HeaderSeparator == LegendSeparatorStyle.DoubleLine)
+ {
+ // NOTE: For some reason a line with a single pen width is drawn 1 pixel longer than
+ // any other line. Reduce width to solve the issue.
+ legendPosition.Width -= 1;
+ }
+ separatorRect.Intersect(legendPosition);
+ this.DrawSeparator(chartGraph, this.HeaderSeparator, this.HeaderSeparatorColor, true, separatorRect);
+
+ // Add spacing between columns
+ prevRightLocation += this.GetSeparatorSize(this.ItemColumnSeparator).Width;
+ }
+
+ // Draw legend border to solve any issues with header background overlapping
+ if(redrawLegendBorder)
+ {
+ chartGraph.FillRectangleRel(
+ chartGraph.GetRelativeRectangle(Rectangle.Round(chartGraph.GetAbsoluteRectangle(this.Position.ToRectangleF()))),
+ Color.Transparent,
+ ChartHatchStyle.None,
+ string.Empty,
+ ChartImageWrapMode.Tile,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ GradientStyle.None,
+ Color.Empty,
+ BorderColor,
+ this.GetBorderSize(),
+ BorderDashStyle,
+ Color.Empty,
+ 0,
+ PenAlignment.Inset);
+
+ }
+
+ // Add legend header hot region
+ if( Common.ProcessModeRegions && !this._headerPosition.IsEmpty)
+ {
+ Common.HotRegionsList.AddHotRegion(chartGraph.GetRelativeRectangle(this._headerPosition), this, ChartElementType.LegendHeader, true );
+ }
+
+ }
+ }
+
+ /// <summary>
+ /// Draw Legend title.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics to draw the title on.</param>
+ private void DrawLegendTitle(ChartGraphics chartGraph)
+ {
+ // Check if title text is specified and position recalculated
+ if(this.Title.Length > 0 &&
+ !this._titlePosition.IsEmpty)
+ {
+ // Get Legend position
+ Rectangle legendPosition = Rectangle.Round(chartGraph.GetAbsoluteRectangle(this.Position.ToRectangleF()));
+ legendPosition.Y += this.GetBorderSize();
+ legendPosition.Height -= 2 * this.GetBorderSize();
+ legendPosition.X += this.GetBorderSize();
+ legendPosition.Width -= 2 * this.GetBorderSize();
+ if(this.GetBorderSize() > 0)
+ {
+ ++legendPosition.Height;
+ ++legendPosition.Width;
+ }
+
+ // Draw title background
+ if(!this.TitleBackColor.IsEmpty)
+ {
+ // Fill title background
+ Rectangle fillRect = this._titlePosition;
+ fillRect.Intersect(legendPosition);
+ chartGraph.FillRectangleRel(
+ chartGraph.GetRelativeRectangle(fillRect),
+ this.TitleBackColor,
+ ChartHatchStyle.None,
+ string.Empty,
+ ChartImageWrapMode.Tile,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ GradientStyle.None,
+ Color.Empty,
+ Color.Empty,
+ 0,
+ ChartDashStyle.NotSet,
+ Color.Empty,
+ 0,
+ PenAlignment.Inset);
+ }
+
+ // Draw title text
+ using(SolidBrush textBrush = new SolidBrush(this.TitleForeColor))
+ {
+ // Set text alignment
+ StringFormat format = new StringFormat();
+ format.Alignment = this.TitleAlignment;
+ //format.LineAlignment = StringAlignment.Center;
+
+ // Shift text rectangle by the top offset amount
+ Rectangle rect = this._titlePosition;
+ rect.Y += this._offset.Height;
+ rect.X += this._offset.Width;
+ rect.X += this.GetBorderSize();
+ rect.Width -= this.GetBorderSize() * 2 + this._offset.Width;
+
+ // Draw string using relative coordinates
+ rect.Intersect(legendPosition);
+ chartGraph.DrawStringRel(
+ this.Title.Replace("\\n", "\n"),
+ this.TitleFont,
+ textBrush,
+ chartGraph.GetRelativeRectangle(rect),
+ format);
+ }
+
+ // Draw title separator
+ Rectangle separatorPosition = this._titlePosition;
+ if(this.TitleSeparator == LegendSeparatorStyle.Line || this.TitleSeparator == LegendSeparatorStyle.DoubleLine)
+ {
+ // NOTE: For some reason a line with a single pen width is drawn 1 pixel longer than
+ // any other line. Reduce width to solve the issue.
+ legendPosition.Width -= 1;
+ }
+ separatorPosition.Intersect(legendPosition);
+ this.DrawSeparator(chartGraph, this.TitleSeparator, this.TitleSeparatorColor, true, separatorPosition);
+
+ // Draw legend border to solve any issues with title background overlapping
+ if(!this.TitleBackColor.IsEmpty ||
+ this.TitleSeparator != LegendSeparatorStyle.None)
+ {
+ chartGraph.FillRectangleRel(
+ chartGraph.GetRelativeRectangle(Rectangle.Round(chartGraph.GetAbsoluteRectangle(this.Position.ToRectangleF()))),
+ Color.Transparent,
+ ChartHatchStyle.None,
+ string.Empty,
+ ChartImageWrapMode.Tile,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ GradientStyle.None,
+ Color.Empty,
+ BorderColor,
+ this.GetBorderSize(),
+ BorderDashStyle,
+ Color.Empty,
+ 0,
+ PenAlignment.Inset);
+
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets legend separator size in pixels
+ /// </summary>
+ /// <param name="separatorType">Separator type.</param>
+ /// <returns>Separator size in relative coordinates.</returns>
+ internal Size GetSeparatorSize(LegendSeparatorStyle separatorType)
+ {
+ Size size = Size.Empty;
+
+ if(separatorType == LegendSeparatorStyle.None)
+ {
+ size = Size.Empty;
+ }
+ else if(separatorType == LegendSeparatorStyle.Line)
+ {
+ size = new Size(1, 1);
+ }
+ else if(separatorType == LegendSeparatorStyle.DashLine)
+ {
+ size = new Size(1, 1);
+ }
+ else if(separatorType == LegendSeparatorStyle.DotLine)
+ {
+ size = new Size(1, 1);
+ }
+ else if(separatorType == LegendSeparatorStyle.ThickLine)
+ {
+ size = new Size(2, 2);
+ }
+ else if(separatorType == LegendSeparatorStyle.DoubleLine)
+ {
+ size = new Size(3, 3);
+ }
+ else if(separatorType == LegendSeparatorStyle.GradientLine)
+ {
+ size = new Size(1, 1);
+ }
+ else if(separatorType == LegendSeparatorStyle.ThickGradientLine)
+ {
+ size = new Size(2, 2);
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionLegendSeparatorTypeUnknown(separatorType.ToString())));
+ }
+
+ // For the vertical part of the separator always add additiobal spacing
+ size.Width += this._itemColumnSpacingRel;
+
+ return size;
+ }
+
+ /// <summary>
+ /// Draws specified legend separator.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics.</param>
+ /// <param name="separatorType">Separator type.</param>
+ /// <param name="color">Separator color.</param>
+ /// <param name="horizontal">Flag that determines if separator is vertical or horizontal.</param>
+ /// <param name="position">Separator position.</param>
+ private void DrawSeparator(
+ ChartGraphics chartGraph,
+ LegendSeparatorStyle separatorType,
+ Color color,
+ bool horizontal,
+ Rectangle position)
+ {
+ // Temporary disable antialiasing
+ SmoothingMode oldSmoothingMode = chartGraph.SmoothingMode;
+ chartGraph.SmoothingMode = SmoothingMode.None;
+
+ // Get line position in absolute coordinates
+ RectangleF rect = position;
+ if(!horizontal)
+ {
+ rect.X += (int)(_itemColumnSpacingRel / 2f);
+ rect.Width -= _itemColumnSpacingRel;
+ }
+ if(separatorType == LegendSeparatorStyle.Line)
+ {
+ if(horizontal)
+ {
+ // Draw horizontal line separator
+ chartGraph.DrawLineAbs(
+ color,
+ 1,
+ ChartDashStyle.Solid,
+ new PointF(rect.Left, rect.Bottom - 1),
+ new PointF(rect.Right, rect.Bottom - 1) );
+
+ }
+ else
+ {
+ // Draw vertical line separator
+ chartGraph.DrawLineAbs(
+ color,
+ 1,
+ ChartDashStyle.Solid,
+ new PointF(rect.Right - 1, rect.Top),
+ new PointF(rect.Right - 1, rect.Bottom) );
+ }
+ }
+ else if(separatorType == LegendSeparatorStyle.DashLine)
+ {
+ if(horizontal)
+ {
+ // Draw horizontal line separator
+ chartGraph.DrawLineAbs(
+ color,
+ 1,
+ ChartDashStyle.Dash,
+ new PointF(rect.Left, rect.Bottom - 1),
+ new PointF(rect.Right, rect.Bottom - 1) );
+
+ }
+ else
+ {
+ // Draw vertical line separator
+ chartGraph.DrawLineAbs(
+ color,
+ 1,
+ ChartDashStyle.Dash,
+ new PointF(rect.Right - 1, rect.Top),
+ new PointF(rect.Right - 1, rect.Bottom) );
+ }
+ }
+ else if(separatorType == LegendSeparatorStyle.DotLine)
+ {
+ if(horizontal)
+ {
+ // Draw horizontal line separator
+ chartGraph.DrawLineAbs(
+ color,
+ 1,
+ ChartDashStyle.Dot,
+ new PointF(rect.Left, rect.Bottom - 1),
+ new PointF(rect.Right, rect.Bottom - 1) );
+
+ }
+ else
+ {
+ // Draw vertical line separator
+ chartGraph.DrawLineAbs(
+ color,
+ 1,
+ ChartDashStyle.Dot,
+ new PointF(rect.Right - 1, rect.Top),
+ new PointF(rect.Right - 1, rect.Bottom) );
+ }
+ }
+ else if(separatorType == LegendSeparatorStyle.ThickLine)
+ {
+ if(horizontal)
+ {
+ // Draw horizontal line separator
+ chartGraph.DrawLineAbs(
+ color,
+ 2,
+ ChartDashStyle.Solid,
+ new PointF(rect.Left, rect.Bottom - 1f),
+ new PointF(rect.Right, rect.Bottom - 1f) );
+ }
+ else
+ {
+ // Draw vertical line separator
+ chartGraph.DrawLineAbs(
+ color,
+ 2,
+ ChartDashStyle.Solid,
+ new PointF(rect.Right - 1f, rect.Top),
+ new PointF(rect.Right - 1f, rect.Bottom) );
+ }
+ }
+ else if(separatorType == LegendSeparatorStyle.DoubleLine)
+ {
+ if(horizontal)
+ {
+ // Draw horizontal line separator
+ chartGraph.DrawLineAbs(
+ color,
+ 1,
+ ChartDashStyle.Solid,
+ new PointF(rect.Left, rect.Bottom - 3),
+ new PointF(rect.Right, rect.Bottom - 3) );
+ chartGraph.DrawLineAbs(
+ color,
+ 1,
+ ChartDashStyle.Solid,
+ new PointF(rect.Left, rect.Bottom - 1),
+ new PointF(rect.Right, rect.Bottom - 1) );
+ }
+ else
+ {
+ // Draw vertical line separator
+ chartGraph.DrawLineAbs(
+ color,
+ 1,
+ ChartDashStyle.Solid,
+ new PointF(rect.Right - 3, rect.Top),
+ new PointF(rect.Right - 3, rect.Bottom) );
+ chartGraph.DrawLineAbs(
+ color,
+ 1,
+ ChartDashStyle.Solid,
+ new PointF(rect.Right - 1, rect.Top),
+ new PointF(rect.Right - 1, rect.Bottom) );
+ }
+ }
+ else if(separatorType == LegendSeparatorStyle.GradientLine)
+ {
+ if(horizontal)
+ {
+ // Draw horizontal line separator
+ chartGraph.FillRectangleAbs(
+ new RectangleF(rect.Left, rect.Bottom - 1f, rect.Width, 0f),
+ Color.Transparent,
+ ChartHatchStyle.None,
+ string.Empty,
+ ChartImageWrapMode.Tile,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ GradientStyle.VerticalCenter,
+ color,
+ Color.Empty,
+ 0,
+ ChartDashStyle.NotSet,
+ PenAlignment.Inset);
+ }
+ else
+ {
+ // Draw vertical line separator
+ chartGraph.FillRectangleAbs(
+ new RectangleF(rect.Right - 1f, rect.Top, 0f, rect.Height),
+ Color.Transparent,
+ ChartHatchStyle.None,
+ string.Empty,
+ ChartImageWrapMode.Tile,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ GradientStyle.HorizontalCenter,
+ color,
+ Color.Empty,
+ 0,
+ ChartDashStyle.NotSet,
+ PenAlignment.Inset);
+ }
+ }
+ else if(separatorType == LegendSeparatorStyle.ThickGradientLine)
+ {
+ if(horizontal)
+ {
+ // Draw horizontal line separator
+ chartGraph.FillRectangleAbs(
+ new RectangleF(rect.Left, rect.Bottom - 2f, rect.Width, 1f),
+ Color.Transparent,
+ ChartHatchStyle.None,
+ string.Empty,
+ ChartImageWrapMode.Tile,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ GradientStyle.VerticalCenter,
+ color,
+ Color.Empty,
+ 0,
+ ChartDashStyle.NotSet,
+ PenAlignment.Inset);
+ }
+ else
+ {
+ // Draw vertical line separator
+ chartGraph.FillRectangleAbs(
+ new RectangleF(rect.Right - 2f, rect.Top, 1f, rect.Height),
+ Color.Transparent,
+ ChartHatchStyle.None,
+ string.Empty,
+ ChartImageWrapMode.Tile,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ GradientStyle.HorizontalCenter,
+ color,
+ Color.Empty,
+ 0,
+ ChartDashStyle.NotSet,
+ PenAlignment.Inset);
+ }
+ }
+
+ // Restore smoothing
+ chartGraph.SmoothingMode = oldSmoothingMode;
+ }
+
+ #endregion // Legent Title Helper methods
+
+ #region Helper methods
+
+ /// <summary>
+ /// Get visible legend border size.
+ /// </summary>
+ /// <returns>Visible legend border size.</returns>
+ private int GetBorderSize()
+ {
+ if(this.BorderWidth > 0 &&
+ this.BorderDashStyle != ChartDashStyle.NotSet &&
+ !this.BorderColor.IsEmpty &&
+ this.BorderColor != Color.Transparent)
+ {
+ return this.BorderWidth;
+ }
+ return 0;
+ }
+
+ /// <summary>
+ /// Helper method which returns current legend table style.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics.</param>
+ /// <returns>Legend table style.</returns>
+ private LegendTableStyle GetLegendTableStyle(ChartGraphics chartGraph)
+ {
+ LegendTableStyle style = this.TableStyle;
+ if(this.TableStyle == LegendTableStyle.Auto)
+ {
+ if(this.Position.Auto)
+ {
+ // If legend is automatically positioned, use docking
+ // do determine preffered table style
+ if(this.Docking == Docking.Left ||
+ this.Docking == Docking.Right)
+ {
+ return LegendTableStyle.Tall;
+ }
+ else
+ {
+ return LegendTableStyle.Wide;
+ }
+ }
+ else
+ {
+ // If legend is custom positioned, use legend width and heiht
+ // to determine the best table layout.
+ SizeF legendPixelSize = chartGraph.GetAbsoluteRectangle(this.Position.ToRectangleF()).Size;
+ if(legendPixelSize.Width < legendPixelSize.Height)
+ {
+ return LegendTableStyle.Tall;
+ }
+ else
+ {
+ return LegendTableStyle.Wide;
+ }
+ }
+ }
+
+ return style;
+ }
+
+
+
+ /// <summary>
+ /// Helper method that checks if legend is enabled.
+ /// </summary>
+ /// <returns>True if legend is enabled.</returns>
+ internal bool IsEnabled()
+ {
+ if(this.Enabled)
+ {
+
+ // Check if legend is docked to the chart area
+ if(this.DockedToChartArea.Length > 0 &&
+ this.Common != null &&
+ this.Common.ChartPicture != null)
+ {
+ if(this.Common.ChartPicture.ChartAreas.IndexOf(this.DockedToChartArea) >= 0)
+ {
+ // Do not show legend when it is docked to invisible chart area
+ ChartArea area = this.Common.ChartPicture.ChartAreas[this.DockedToChartArea];
+ if(!area.Visible)
+ {
+ return false;
+ }
+ }
+ }
+
+
+ return true;
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// Invalidate chart legend when one of the properties is changed
+ /// </summary>
+ /// <param name="invalidateLegendOnly">Indicates that only legend area should be invalidated.</param>
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Justification = "This parameter is used when compiling for the Microsoft version of Chart")]
+ internal void Invalidate(bool invalidateLegendOnly)
+ {
+#if Microsoft_CONTROL
+
+ if(Chart != null && !Chart.disableInvalidates)
+ {
+ if(invalidateLegendOnly)
+ {
+ // Calculate the position of the legend
+ Rectangle invalRect = Chart.ClientRectangle;
+ if(this.Position.Width != 0 && this.Position.Height != 0 )
+ {
+ // Convert relative coordinates to absolute coordinates
+ invalRect.X = (int)(this.Position.X * (this.Common.ChartPicture.Width - 1) / 100F);
+ invalRect.Y = (int)(this.Position.Y * (this.Common.ChartPicture.Height - 1) / 100F);
+ invalRect.Width = (int)(this.Position.Width * (this.Common.ChartPicture.Width - 1) / 100F);
+ invalRect.Height = (int)(this.Position.Height * (this.Common.ChartPicture.Height - 1) / 100F);
+
+ // Inflate rectangle size using border size and shadow size
+ invalRect.Inflate(this.BorderWidth + this.ShadowOffset + 1, this.BorderWidth + this.ShadowOffset + 1);
+ }
+
+ // Invalidate legend rectangle only
+ Chart.dirtyFlag = true;
+ Chart.Invalidate(invalRect);
+ }
+ else
+ {
+ Invalidate();
+ }
+ }
+#endif
+ }
+
+ #endregion
+
+ #region IDisposable Members
+
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ //Free managed resources
+ if (_fontCache != null)
+ {
+ _fontCache.Dispose();
+ _fontCache = null;
+ }
+ if (legendItems != null)
+ {
+ legendItems.Dispose();
+ legendItems = null;
+ }
+ if (_cellColumns != null)
+ {
+ _cellColumns.Dispose();
+ _cellColumns = null;
+ }
+ if (_customLegends != null)
+ {
+ _customLegends.Dispose();
+ _customLegends = null;
+ }
+ if (_position != null)
+ {
+ _position.Dispose();
+ _position = null;
+ }
+ }
+ }
+
+
+ #endregion
+ }
+
+ /// <summary>
+ /// The LegendCollection class is a strongly typed collection of legends.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeLegendCollection_LegendCollection"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class LegendCollection : ChartNamedElementCollection<Legend>
+ {
+ #region Constructors
+ /// <summary>
+ /// LegendCollection constructor.
+ /// </summary>
+ /// <param name="chartPicture">Chart picture object.</param>
+ internal LegendCollection(ChartPicture chartPicture)
+ : base(chartPicture)
+ {
+ }
+
+ #endregion
+
+ #region Properties
+ /// <summary>
+ /// Gets the default legend name.
+ /// </summary>
+ internal string DefaultNameReference
+ {
+ get { return this.Count > 0 ? this[0].Name : String.Empty; }
+ }
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Creates a new Legend with the specified name and adds it to the collection.
+ /// </summary>
+ /// <param name="name">The new chart area name.</param>
+ /// <returns>New legend</returns>
+ public Legend Add(string name)
+ {
+ Legend legend = new Legend(name);
+ this.Add(legend);
+ return legend;
+ }
+
+ /// <summary>
+ /// Recalculates legend position in the collection.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics used.</param>
+ /// <param name="chartAreasRectangle">Area where the legend should be positioned.</param>
+ /// <param name="elementSpacing">Spacing size as a percentage of the area.</param>
+ internal void CalcLegendPosition(
+ ChartGraphics chartGraph,
+ ref RectangleF chartAreasRectangle,
+ float elementSpacing)
+ {
+ // Loop through all legends
+ foreach(Legend legend in this)
+ {
+ // Calculate position of the legends docked to the chart picture
+ if(legend.IsEnabled() &&
+ legend.DockedToChartArea == Constants.NotSetValue &&
+ legend.Position.Auto)
+ {
+ legend.CalcLegendPosition(chartGraph, ref chartAreasRectangle, elementSpacing);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Recalculates legend position in the collection for legends docked outside of chart area.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics used.</param>
+ /// <param name="area">Area the legend is docked to.</param>
+ /// <param name="chartAreasRectangle">Area where the legend should be positioned.</param>
+ /// <param name="elementSpacing">Spacing size as a percentage of the area.</param>
+ internal void CalcOutsideLegendPosition(
+ ChartGraphics chartGraph,
+ ChartArea area,
+ ref RectangleF chartAreasRectangle,
+ float elementSpacing)
+ {
+ if(Common != null && Common.ChartPicture != null)
+ {
+ // Get elemets spacing
+ float areaSpacing = Math.Min((chartAreasRectangle.Height/100F) * elementSpacing, (chartAreasRectangle.Width/100F) * elementSpacing);
+
+ // Loop through all legends
+ foreach(Legend legend in this)
+ {
+ // Check if all chart area names are valid
+ if (legend.DockedToChartArea != Constants.NotSetValue && this.Chart.ChartAreas.IndexOf(legend.DockedToChartArea)<0)
+ {
+ throw (new ArgumentException(SR.ExceptionLegendDockedChartAreaIsMissing((string)legend.DockedToChartArea)));
+ }
+
+ // Process only legends docked to specified area
+ if(legend.IsEnabled() &&
+ legend.IsDockedInsideChartArea == false &&
+ legend.DockedToChartArea == area.Name &&
+ legend.Position.Auto)
+ {
+ // Calculate legend position
+ legend.CalcLegendPosition(chartGraph,
+ ref chartAreasRectangle,
+ areaSpacing);
+
+ // Adjust legend position
+ RectangleF legendPosition = legend.Position.ToRectangleF();
+ if(legend.Docking == Docking.Top)
+ {
+ legendPosition.Y -= areaSpacing;
+ if(!area.Position.Auto)
+ {
+ legendPosition.Y -= legendPosition.Height;
+ }
+ }
+ else if(legend.Docking == Docking.Bottom)
+ {
+ legendPosition.Y += areaSpacing;
+ if(!area.Position.Auto)
+ {
+ legendPosition.Y = area.Position.Bottom + areaSpacing;
+ }
+ }
+ if(legend.Docking == Docking.Left)
+ {
+ legendPosition.X -= areaSpacing;
+ if(!area.Position.Auto)
+ {
+ legendPosition.X -= legendPosition.Width;
+ }
+ }
+ if(legend.Docking == Docking.Right)
+ {
+ legendPosition.X += areaSpacing;
+ if(!area.Position.Auto)
+ {
+ legendPosition.X = area.Position.Right + areaSpacing;
+ }
+ }
+
+ legend.Position.SetPositionNoAuto(legendPosition.X, legendPosition.Y, legendPosition.Width, legendPosition.Height);
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Recalculates legend position inside chart area in the collection.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics used.</param>
+ /// <param name="elementSpacing">Spacing size as a percentage of the area.</param>
+ internal void CalcInsideLegendPosition(
+ ChartGraphics chartGraph,
+ float elementSpacing)
+ {
+ if(Common != null && Common.ChartPicture != null)
+ {
+ // Check if all chart area names are valid
+ foreach(Legend legend in this)
+ {
+ if (legend.DockedToChartArea != Constants.NotSetValue)
+ {
+ try
+ {
+ ChartArea area = Common.ChartPicture.ChartAreas[legend.DockedToChartArea];
+ }
+ catch
+ {
+ throw(new ArgumentException( SR.ExceptionLegendDockedChartAreaIsMissing( (string)legend.DockedToChartArea ) ) );
+ }
+ }
+ }
+
+ // Loop through all chart areas
+ foreach (ChartArea area in Common.ChartPicture.ChartAreas)
+ {
+
+ // Check if chart area is visible
+ if(area.Visible)
+
+ {
+ // Get area position
+ RectangleF legendPlottingRectangle = area.PlotAreaPosition.ToRectangleF();
+
+ // Get elemets spacing
+ float areaSpacing = Math.Min((legendPlottingRectangle.Height/100F) * elementSpacing, (legendPlottingRectangle.Width/100F) * elementSpacing);
+
+ // Loop through all legends
+ foreach(Legend legend in this)
+ {
+ if(legend.IsEnabled() &&
+ legend.IsDockedInsideChartArea == true &&
+ legend.DockedToChartArea == area.Name &&
+ legend.Position.Auto)
+ {
+ // Calculate legend position
+ legend.CalcLegendPosition(chartGraph,
+ ref legendPlottingRectangle,
+ areaSpacing);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ #endregion
+
+ #region Event handlers
+ internal void ChartAreaNameReferenceChanged(object sender, NameReferenceChangedEventArgs e)
+ {
+ //If all the chart areas are removed and then the first one is added we don't want to dock the legends
+ if (e.OldElement == null)
+ return;
+
+ foreach (Legend legend in this)
+ if (legend.DockedToChartArea == e.OldName)
+ legend.DockedToChartArea = e.NewName;
+ }
+ #endregion
+
+ }
+
+ /// <summary>
+ /// The LegendItemsCollection class is a strongly typed collection of legend items.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeCustomLabelsCollection_CustomLabelsCollection"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class LegendItemsCollection : ChartElementCollection<LegendItem>
+ {
+ #region Constructors
+
+ /// <summary>
+ /// LegendItemsCollection constructor
+ /// </summary>
+ internal LegendItemsCollection(Legend legend)
+ : base(legend)
+ {
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Adds a legend item into the collection.
+ /// </summary>
+ /// <param name="color">Legend item color.</param>
+ /// <param name="text">Legend item text.</param>
+ /// <returns>Index of newly added item.</returns>
+ public int Add(Color color, string text)
+ {
+ LegendItem item = new LegendItem(text, color, "");
+ Add(item);
+ return Count - 1;
+ }
+
+ /// <summary>
+ /// Insert a legend item into the collection.
+ /// </summary>
+ /// <param name="index">Index to insert at.</param>
+ /// <param name="color">Legend item color.</param>
+ /// <param name="text">Legend item text.</param>
+ /// <returns>Index of newly added item.</returns>
+ public void Insert(int index, Color color, string text)
+ {
+ LegendItem item = new LegendItem(text, color, "");
+ this.Insert(index, item);
+ }
+
+ /// <summary>
+ /// Adds a legend item into the collection.
+ /// </summary>
+ /// <param name="image">Legend item image.</param>
+ /// <param name="text">Legend item text.</param>
+ /// <returns>Index of newly added item.</returns>
+ public int Add(string image, string text)
+ {
+ LegendItem item = new LegendItem(text, Color.Empty, image);
+ Add(item);
+ return Count-1;
+ }
+
+ /// <summary>
+ /// Insert one legend item into the collection.
+ /// </summary>
+ /// <param name="index">Index to insert at.</param>
+ /// <param name="image">Legend item image.</param>
+ /// <param name="text">Legend item text.</param>
+ /// <returns>Index of newly added item.</returns>
+ public void Insert(int index, string image, string text)
+ {
+ LegendItem item = new LegendItem(text, Color.Empty, image);
+ this.Insert(index, item);
+ }
+
+ /// <summary>
+ /// Reverses the order of items in the collection.
+ /// </summary>
+ public void Reverse()
+ {
+ List<LegendItem> list = this.Items as List<LegendItem>;
+ list.Reverse();
+ Invalidate();
+ }
+
+ #endregion
+
+ }
+
+
+ /// <summary>
+ /// The LegendItem class represents a single item (row) in the legend.
+ /// It contains properties which describe visual appearance and
+ /// content of the legend item.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeLegendItem_LegendItem"),
+ DefaultProperty("Name"),
+ ]
+#if Microsoft_CONTROL
+ public class LegendItem : ChartNamedElement
+#else
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class LegendItem : ChartNamedElement, IChartMapArea
+#endif
+ {
+ #region Fields
+
+ // Private data members, which store properties values
+ private Color _color = Color.Empty;
+ private string _image = "";
+ private string _seriesName = "";
+ private int _seriesPointIndex = -1;
+
+ // Chart image map properties
+ private string _toolTip = "";
+
+#if !Microsoft_CONTROL
+ private string _url = "";
+ private string _attributes = "";
+ private string _postbackValue = String.Empty;
+#endif
+
+ // Additional appearance properties
+ internal LegendImageStyle style = LegendImageStyle.Rectangle;
+ internal GradientStyle backGradientStyle = GradientStyle.None;
+ internal Color backSecondaryColor = Color.Empty;
+ internal Color backImageTransparentColor = Color.Empty;
+ internal Color borderColor = Color.Black;
+ internal int borderWidth = 1;
+ internal ChartDashStyle borderDashStyle = ChartDashStyle.Solid;
+ internal ChartHatchStyle backHatchStyle = ChartHatchStyle.None;
+ internal int shadowOffset = 0;
+ internal Color shadowColor = Color.FromArgb(128, 0, 0, 0);
+ internal ChartImageWrapMode backImageWrapMode = ChartImageWrapMode.Tile;
+ internal ChartImageAlignmentStyle backImageAlign = ChartImageAlignmentStyle.TopLeft;
+
+ // Marker properties
+ internal MarkerStyle markerStyle = MarkerStyle.None;
+ internal int markerSize = 5;
+ internal string markerImage = "";
+ internal Color markerImageTransparentColor = Color.Empty;
+ internal Color markerColor = Color.Empty;
+ internal Color markerBorderColor = Color.Empty;
+
+ // True if legend item is enabled.
+ private bool _enabled = true;
+
+ // Series marker border width
+ private int _markerBorderWidth = 1;
+
+ // Collection of legend item cells
+ private LegendCellCollection _cells = null;
+
+ // Legend item visual separator
+ private LegendSeparatorStyle _separatorType = LegendSeparatorStyle.None;
+
+ // Legend item visual separator color
+ private Color _separatorColor = Color.Black;
+
+ // Indicates that temporary cells where added and thet have to be removed
+ internal bool clearTempCells = false;
+
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// LegendItem constructor
+ /// </summary>
+ public LegendItem()
+ {
+
+ // Create collection of legend item cells
+ this._cells = new LegendCellCollection(this);
+#if !Microsoft_CONTROL
+ this.PostBackValue = String.Empty;
+#endif //!WIN_CONTROL
+ }
+
+ /// <summary>
+ /// LegendItem constructor
+ /// </summary>
+ /// <param name="name">Item name.</param>
+ /// <param name="color">Item color.</param>
+ /// <param name="image">Item image.</param>
+ public LegendItem(string name, Color color, string image) : base (name)
+ {
+ this._color = color;
+ this._image = image;
+
+ // Create collection of legend item cells
+ this._cells = new LegendCellCollection(this);
+#if !Microsoft_CONTROL
+ this.PostBackValue = String.Empty;
+#endif //!WIN_CONTROL
+ }
+
+ #endregion
+
+ #region Legend item properties
+
+ /// <summary>
+ /// Gets the Legend object which the item belongs to.
+ /// </summary>
+ [
+ Bindable(false),
+ Browsable(false),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ ]
+ public Legend Legend
+ {
+ get
+ {
+ if (Parent != null)
+ return Parent.Parent as Legend;
+ else
+ return null;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the name of the legend item.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeLegendItem_Name"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ ParenthesizePropertyNameAttribute(true)
+ ]
+ public override string Name
+ {
+ get
+ {
+ return base.Name;
+ }
+ set
+ {
+ base.Name = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the color of the legend item.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeLegendItem_Color"),
+ DefaultValue(typeof(Color), ""),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color Color
+ {
+ get
+ {
+ return _color;
+ }
+ set
+ {
+ _color = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a string value that represents a URL to an image file, which will be used for the legend item's symbol.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeLegendItem_Image"),
+ DefaultValue(""),
+ Editor(Editors.ImageValueEditor.Editor, Editors.ImageValueEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ NotifyParentPropertyAttribute(true)
+ ]
+ public string Image
+ {
+ get
+ {
+ return _image;
+ }
+ set
+ {
+ _image = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the picture style of the legend item image.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(LegendImageStyle), "Rectangle"),
+ SRDescription("DescriptionAttributeLegendItem_Style"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ ParenthesizePropertyNameAttribute(true)
+ ]
+ public LegendImageStyle ImageStyle
+ {
+ get
+ {
+ return style;
+ }
+ set
+ {
+ style = value;
+ this.Invalidate(true);
+ }
+ }
+
+
+ /// <summary>
+ /// Gets or sets the border color of the legend item.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeBorderColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BorderColor
+ {
+ get
+ {
+ return borderColor;
+ }
+ set
+ {
+ borderColor = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background hatch style of the legend item.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartHatchStyle.None),
+ SRDescription("DescriptionAttributeBackHatchStyle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ Editor(Editors.HatchStyleEditor.Editor, Editors.HatchStyleEditor.Base)
+ ]
+ public ChartHatchStyle BackHatchStyle
+ {
+ get
+ {
+ return backHatchStyle;
+ }
+ set
+ {
+ backHatchStyle = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a color which will be replaced with a transparent color while drawing the background image.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeImageTransparentColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BackImageTransparentColor
+ {
+ get
+ {
+ return backImageTransparentColor;
+ }
+ set
+ {
+ backImageTransparentColor = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets background gradient style of the legend item.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(GradientStyle.None),
+ SRDescription("DescriptionAttributeBackGradientStyle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ Editor(Editors.GradientEditor.Editor, Editors.GradientEditor.Base)
+ ]
+ public GradientStyle BackGradientStyle
+ {
+ get
+ {
+ return backGradientStyle;
+ }
+ set
+ {
+ backGradientStyle = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the secondary background color.
+ /// <seealso cref="Color"/>
+ /// <seealso cref="BackHatchStyle"/>
+ /// <seealso cref="BackGradientStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value used for the secondary color of background with
+ /// hatching or gradient fill.
+ /// </value>
+ /// <remarks>
+ /// This color is used with <see cref="Color"/> when <see cref="BackHatchStyle"/> or
+ /// <see cref="BackGradientStyle"/> are used.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeBackSecondaryColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BackSecondaryColor
+ {
+ get
+ {
+ return backSecondaryColor;
+ }
+ set
+ {
+ if(value != Color.Empty && (value.A != 255 || value == Color.Transparent))
+ {
+ throw (new ArgumentException(SR.ExceptionBackSecondaryColorIsTransparent));
+ }
+
+ backSecondaryColor = value;
+
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the border width of the legend item.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(1),
+ SRDescription("DescriptionAttributeBorderWidth"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public int BorderWidth
+ {
+ get
+ {
+ return borderWidth;
+ }
+ set
+ {
+ if(value < 0)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionBorderWidthIsZero));
+ }
+ borderWidth = value;
+ this.Invalidate(false);
+ }
+ }
+
+
+
+ /// <summary>
+ /// Gets or sets a flag which indicates whether the Legend item is enabled.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeLegendItem_Enabled"),
+ ParenthesizePropertyNameAttribute(true),
+ ]
+ public bool Enabled
+ {
+ get
+ {
+ return this._enabled;
+ }
+ set
+ {
+ this._enabled = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the marker border width of the legend item.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMarker"),
+ DefaultValue(1),
+ SRDescription("DescriptionAttributeMarkerBorderWidth"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public int MarkerBorderWidth
+ {
+ get
+ {
+ return this._markerBorderWidth;
+ }
+ set
+ {
+ if(value < 0)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionLegendMarkerBorderWidthIsNegative));
+ }
+ this._markerBorderWidth = value;
+ this.Invalidate(false);
+ }
+ }
+
+
+
+ /// <summary>
+ /// Gets or sets the legend item border style.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartDashStyle.Solid),
+ SRDescription("DescriptionAttributeBorderDashStyle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public ChartDashStyle BorderDashStyle
+ {
+ get
+ {
+ return borderDashStyle;
+ }
+ set
+ {
+ borderDashStyle = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the offset between the legend item and its shadow.
+ /// <seealso cref="ShadowColor"/>
+ /// </summary>
+ /// <value>
+ /// An integer value that represents the offset between the legend item and its shadow.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeShadowOffset"),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ DefaultValue(0)
+ ]
+ public int ShadowOffset
+ {
+ get
+ {
+ return shadowOffset;
+ }
+ set
+ {
+ shadowOffset = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the color of a legend item's shadow.
+ /// <seealso cref="ShadowOffset"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value used to draw a legend item's shadow.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), "128,0,0,0"),
+ SRDescription("DescriptionAttributeShadowColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color ShadowColor
+ {
+ get
+ {
+ return shadowColor;
+ }
+ set
+ {
+ shadowColor = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the marker style of the legend item.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMarker"),
+ Bindable(true),
+ DefaultValue(MarkerStyle.None),
+ SRDescription("DescriptionAttributeLegendItem_MarkerStyle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ Editor(Editors.MarkerStyleEditor.Editor, Editors.MarkerStyleEditor.Base),
+ RefreshProperties(RefreshProperties.All)
+ ]
+ public MarkerStyle MarkerStyle
+ {
+ get
+ {
+ return markerStyle;
+ }
+ set
+ {
+ markerStyle = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the marker size of the legend item.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMarker"),
+ Bindable(true),
+ DefaultValue(5),
+ SRDescription("DescriptionAttributeLegendItem_MarkerSize"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ RefreshProperties(RefreshProperties.All)
+ ]
+ public int MarkerSize
+ {
+ get
+ {
+ return markerSize;
+ }
+ set
+ {
+ markerSize = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the marker image of the legend item.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMarker"),
+ Bindable(true),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeMarkerImage"),
+ Editor(Editors.ImageValueEditor.Editor, Editors.ImageValueEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ RefreshProperties(RefreshProperties.All)
+ ]
+ public string MarkerImage
+ {
+ get
+ {
+ return markerImage;
+ }
+ set
+ {
+ markerImage = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a color which will be replaced with a transparent color while drawing the marker image.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMarker"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeImageTransparentColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ RefreshProperties(RefreshProperties.All)
+ ]
+ public Color MarkerImageTransparentColor
+ {
+ get
+ {
+ return markerImageTransparentColor;
+ }
+ set
+ {
+ markerImageTransparentColor = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the marker color of the legend item.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMarker"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeLegendItem_MarkerColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ RefreshProperties(RefreshProperties.All)
+ ]
+ public Color MarkerColor
+ {
+ get
+ {
+ return markerColor;
+ }
+ set
+ {
+ markerColor = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the marker border color of the legend item.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMarker"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeMarkerBorderColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ RefreshProperties(RefreshProperties.All)
+ ]
+ public Color MarkerBorderColor
+ {
+ get
+ {
+ return markerBorderColor;
+ }
+ set
+ {
+ markerBorderColor = value;
+ this.Invalidate(true);
+ }
+ }
+
+
+ /// <summary>
+ /// Gets or sets the series name of the legend item..
+ /// </summary>
+ [
+ Browsable(false),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeLegendItem_SeriesName"),
+ DefaultValue("")
+ ]
+ public string SeriesName
+ {
+ get
+ {
+ return _seriesName;
+ }
+ set
+ {
+ _seriesName = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the index of the legend item's associated DataPoint object.
+ /// </summary>
+ [
+ Browsable(false),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ SRDescription("DescriptionAttributeLegendItem_SeriesPointIndex"),
+ DefaultValue(-1)
+ ]
+ public int SeriesPointIndex
+ {
+ get
+ {
+ return _seriesPointIndex;
+ }
+ set
+ {
+ _seriesPointIndex = value;
+ }
+ }
+
+
+
+
+ /// <summary>
+ /// Gets or sets the separator style of the legend item.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(typeof(LegendSeparatorStyle), "None"),
+ SRDescription("DescriptionAttributeLegendItem_Separator"),
+ ]
+ public LegendSeparatorStyle SeparatorType
+ {
+ get
+ {
+ return this._separatorType;
+ }
+ set
+ {
+ if(value != this._separatorType)
+ {
+ this._separatorType = value;
+ this.Invalidate(false);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the separator color of the legend item.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeLegendItem_SeparatorColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ ]
+ public Color SeparatorColor
+ {
+ get
+ {
+ return this._separatorColor;
+ }
+ set
+ {
+ if(value != this._separatorColor)
+ {
+ this._separatorColor = value;
+ this.Invalidate(false);
+ }
+ }
+ }
+
+
+ /// <summary>
+ /// The LegendCellCollection class is a collection of legend item cells.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ SRDescription("DescriptionAttributeLegendItem_Cells"),
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ Editor(Editors.LegendCellCollectionEditor.Editor, Editors.LegendCellCollectionEditor.Base),
+ ]
+ public LegendCellCollection Cells
+ {
+ get
+ {
+ return this._cells;
+ }
+ }
+
+ #endregion
+
+ #region IMapAreaAttributesutes Properties implementation
+
+ /// <summary>
+ /// Tooltip of the area.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMapArea"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeToolTip"),
+ DefaultValue(""),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public string ToolTip
+ {
+ set
+ {
+ _toolTip = value;
+#if Microsoft_CONTROL
+ if(Chart != null && Chart.selection != null)
+ {
+ Chart.selection.enabledChecked = false;
+ }
+#endif
+
+ }
+ get
+ {
+ return _toolTip;
+ }
+ }
+
+#if !Microsoft_CONTROL
+ /// <summary>
+ /// URL target of the area.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMapArea"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeUrl"),
+ DefaultValue(""),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ Editor(Editors.UrlValueEditor.Editor, Editors.UrlValueEditor.Base)
+#endif
+ ]
+ public string Url
+ {
+ set
+ {
+ _url = value;
+ }
+ get
+ {
+ return _url;
+ }
+ }
+
+#endif
+#if !Microsoft_CONTROL
+
+ /// <summary>
+ /// Other attributes of the area.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMapArea"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeMapAreaAttributes"),
+ DefaultValue(""),
+ PersistenceMode(PersistenceMode.Attribute)
+ ]
+ public string MapAreaAttributes
+ {
+ set
+ {
+ _attributes = value;
+ }
+ get
+ {
+ return _attributes;
+ }
+ }
+ /// <summary>
+ /// Gets or sets the postback value which can be processed on a click event.
+ /// </summary>
+ /// <value>The value which is passed to a click event as an argument.</value>
+ [DefaultValue("")]
+ [SRCategory(SR.Keys.CategoryAttributeMapArea)]
+ [SRDescription(SR.Keys.DescriptionAttributePostBackValue)]
+ public string PostBackValue
+ {
+ get
+ {
+ return this._postbackValue;
+ }
+ set
+ {
+ this._postbackValue = value;
+ }
+ }
+
+
+#endif //!Microsoft_CONTROL
+ #endregion
+
+ #region Helper methods
+
+ /// <summary>
+ /// Helper method adds default legend item cells based on the columns
+ /// specified. If columns collection is empty we assume the presence of
+ /// two columns: series marker and legend item text.
+ /// </summary>
+ /// <param name="legend">Legend this item belongs to.</param>
+ internal void AddAutomaticCells(Legend legend)
+ {
+ // Check if cells defined
+ if(this.Cells.Count == 0)
+ {
+ // Check if legend item was generated for the series
+ if(this.SeriesName.Length > 0)
+ {
+ // If legend do not have any columns set add a series marker
+ // and legend text cells
+ if(legend.CellColumns.Count == 0)
+ {
+ // VSTS 96787 - Text Direction (RTL/LTR)
+ if (legend.Common != null && legend.Common.ChartPicture.RightToLeft == RightToLeft.Yes)
+ {
+ this.Cells.Add(LegendCellType.Text, KeywordName.LegendText, ContentAlignment.MiddleLeft);
+ this.Cells.Add(LegendCellType.SeriesSymbol, string.Empty, ContentAlignment.MiddleCenter);
+ }
+ else
+ {
+ this.Cells.Add(LegendCellType.SeriesSymbol, string.Empty, ContentAlignment.MiddleCenter);
+ this.Cells.Add(LegendCellType.Text, KeywordName.LegendText, ContentAlignment.MiddleLeft);
+ }
+ }
+ else
+ {
+ // Add cell for each of the columns
+ foreach(LegendCellColumn legendColumn in legend.CellColumns)
+ {
+ this.Cells.Add(legendColumn.CreateNewCell());
+ }
+ }
+ }
+ else
+ {
+ // Add Marker plus text for everything else
+ this.clearTempCells = true;
+ this.Cells.Add(LegendCellType.SeriesSymbol, string.Empty, ContentAlignment.MiddleCenter);
+ this.Cells.Add(LegendCellType.Text, KeywordName.LegendText, ContentAlignment.MiddleLeft);
+ }
+ }
+ }
+
+
+ /// <summary>
+ /// Sets legend item properties from the series
+ /// </summary>
+ /// <param name="series">Series object.</param>
+ /// <param name="common">Common elements object.</param>
+ internal void SetAttributes(CommonElements common, Series series)
+ {
+ // Get legend item picture style
+ IChartType chartType = common.ChartTypeRegistry.GetChartType(series.ChartTypeName);
+ style = chartType.GetLegendImageStyle(series);
+
+ // Set series name
+ _seriesName = series.Name;
+
+ // Get shadow properties
+ shadowOffset = series.ShadowOffset;
+ shadowColor = series.ShadowColor;
+
+ // Check if series is drawn in 3D chart area
+ bool area3D = common.Chart.ChartAreas[series.ChartArea].Area3DStyle.Enable3D;
+
+ // Get other properties
+ SetAttributes((DataPointCustomProperties) series, area3D);
+ }
+
+ /// <summary>
+ /// Sets legend item properties from the DataPointCustomProperties object.
+ /// </summary>
+ /// <param name="properties">DataPointCustomProperties object.</param>
+ /// <param name="area3D">Element belongs to the 3D area.</param>
+ internal void SetAttributes(DataPointCustomProperties properties, bool area3D)
+ {
+ borderColor = properties.BorderColor;
+ borderWidth = properties.BorderWidth;
+ borderDashStyle = properties.BorderDashStyle;
+ markerStyle = properties.MarkerStyle;
+ markerSize = properties.MarkerSize;
+ markerImage = properties.MarkerImage;
+ markerImageTransparentColor = properties.MarkerImageTransparentColor;
+ markerColor = properties.MarkerColor;
+ markerBorderColor = properties.MarkerBorderColor;
+
+
+ this._markerBorderWidth = properties.MarkerBorderWidth;
+
+ float dpi = 96;
+
+ if(Common != null)
+ dpi = Common.graph.Graphics.DpiX;
+
+ int maxBorderWidth = (int)Math.Round((2 * dpi) / 96);
+
+ if (this._markerBorderWidth > maxBorderWidth)
+ {
+ this._markerBorderWidth = maxBorderWidth;
+ }
+
+ if(properties.MarkerBorderWidth <= 0)
+ {
+ markerBorderColor = Color.Transparent;
+ }
+
+ // Improve readability of the line series marker by using at least 2 pixel wide lines
+ if(this.style == LegendImageStyle.Line &&
+ borderWidth <= (int)Math.Round(dpi / 96) )
+ {
+ borderWidth = maxBorderWidth;
+ }
+
+ if(!area3D)
+ {
+ backGradientStyle = properties.BackGradientStyle;
+ backSecondaryColor = properties.BackSecondaryColor;
+ backImageTransparentColor = properties.BackImageTransparentColor;
+ backImageWrapMode = properties.BackImageWrapMode;
+ backImageAlign = properties.BackImageAlignment;
+ backHatchStyle = properties.BackHatchStyle;
+ }
+ }
+
+ /// <summary>
+ /// Invalidate chart (or just legend )when collection is changed
+ /// </summary>
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Justification = "This parameter is used when compiling for the Microsoft version of Chart")]
+ private void Invalidate(bool invalidateLegendOnly)
+ {
+#if Microsoft_CONTROL
+ if(Legend != null)
+ {
+ // Invalidate control
+ Legend.Invalidate(invalidateLegendOnly);
+ }
+#endif
+ }
+
+ #endregion
+
+ #region IDisposable Members
+
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ if (_cells != null)
+ {
+ _cells.Dispose();
+ _cells = null;
+ }
+ }
+ base.Dispose(disposing);
+ }
+
+
+ #endregion
+
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/LegendColumns.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/LegendColumns.cs
new file mode 100644
index 00000000000..04d52956a71
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/LegendColumns.cs
@@ -0,0 +1,2909 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: LegendColumns.cs
+//
+// Namespace: DataVisualization.Charting
+//
+// Classes: LegendCellColumn, LegendCellColumnCollection,
+// LegendCell, LegendCellCollection, Margins
+//
+// Purpose: LegendCell and LegendCellColumn classes allow to
+// create highly customize legends. Please refer to
+// Chart documentation which contains images and
+// samples describing this functionality.
+//
+// Reviewed: AG - Microsoft 14, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Drawing2D;
+using System.Globalization;
+using System.Diagnostics.CodeAnalysis;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.ComponentModel.Design.Serialization;
+ using System.Reflection;
+ using System.Windows.Forms.Design;
+#else
+ using System.Web;
+ using System.Web.UI;
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+#endif
+
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+#endif
+{
+ #region Enumerations
+
+ /// <summary>
+ /// An enumeration of legend cell types.
+ /// </summary>
+ public enum LegendCellType
+ {
+ /// <summary>
+ /// Legend cell contains text.
+ /// </summary>
+ Text,
+
+ /// <summary>
+ /// Legend cell contains series symbol.
+ /// </summary>
+ SeriesSymbol,
+
+ /// <summary>
+ /// Legend cell contains image.
+ /// </summary>
+ Image
+ }
+
+ /// <summary>
+ /// An enumeration of legend cell column types.
+ /// </summary>
+ public enum LegendCellColumnType
+ {
+ /// <summary>
+ /// Legend column contains text.
+ /// </summary>
+ Text,
+
+ /// <summary>
+ /// Legend column contains series symbol.
+ /// </summary>
+ SeriesSymbol
+ }
+
+ #endregion // Enumerations
+
+ /// <summary>
+ /// The LegendCellColumn class represents a cell column in a legend,
+ /// used to extend the functionality of the default legend. It contains
+ /// visual appearance properties, legend header settings and also determine
+ /// how and in which order cells are formed for each of the legend items.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeLegendCellColumn_LegendCellColumn"),
+ ]
+#if Microsoft_CONTROL
+ public class LegendCellColumn : ChartNamedElement
+#else
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class LegendCellColumn : ChartNamedElement, IChartMapArea
+#endif //!Microsoft_CONTROL
+ {
+ #region Fields
+
+ // Legend column type
+ private LegendCellColumnType _columnType = LegendCellColumnType.Text;
+
+ // Legend column text
+ private string _text = KeywordName.LegendText;
+
+ // Legend column text color
+ private Color _foreColor = Color.Empty;
+
+ // Legend column back color
+ private Color _backColor = Color.Empty;
+
+ // Font cache
+ private FontCache _fontCache = new FontCache();
+
+ // Legend column text font
+ private Font _font = null;
+
+ // Legend column series symbol size
+ private Size _seriesSymbolSize = new Size(200, 70);
+
+ // Legend column content allignment
+ private ContentAlignment _alignment = ContentAlignment.MiddleCenter;
+
+ // Legend column tooltip
+ private string _toolTip = string.Empty;
+
+ // Legend column margins
+ private Margins _margins = new Margins(0, 0, 15, 15);
+
+#if !Microsoft_CONTROL
+
+ // Legend column Url
+ private string _url = string.Empty;
+
+ // Legend column map area attribute
+ private string _mapAreaAttribute = string.Empty;
+ private string _postbackValue = String.Empty;
+#endif // !Microsoft_CONTROL
+
+ // Legend column header text
+ private string _headerText = string.Empty;
+
+ // Legend column/cell content allignment
+ private StringAlignment _headerAlignment = StringAlignment.Center;
+
+ // Legend column header text color
+ private Color _headerForeColor = Color.Black;
+
+ // Legend column header text back color
+ private Color _headerBackColor = Color.Empty;
+
+ // Legend column header text font
+ private Font _headerFont = null;
+
+ // Minimum column width
+ private int _minimumCellWidth = -1;
+
+ // Maximum column width
+ private int _maximumCellWidth = -1;
+
+ #endregion // Fields
+
+ #region Constructors
+
+ /// <summary>
+ /// LegendCellColumn constructor.
+ /// </summary>
+ public LegendCellColumn()
+ : this(string.Empty, LegendCellColumnType.Text, KeywordName.LegendText, ContentAlignment.MiddleCenter)
+ {
+ _headerFont = _fontCache.DefaultBoldFont;
+ }
+
+
+ /// <summary>
+ /// LegendCellColumn constructor.
+ /// </summary>
+ /// <param name="headerText">Column header text.</param>
+ /// <param name="columnType">Column type.</param>
+ /// <param name="text">Column cell text.</param>
+ public LegendCellColumn(string headerText, LegendCellColumnType columnType, string text) : this(headerText, columnType, text, ContentAlignment.MiddleCenter)
+ {
+
+ }
+
+ /// <summary>
+ /// Legend column object constructor.
+ /// </summary>
+ /// <param name="headerText">Column header text.</param>
+ /// <param name="columnType">Column type.</param>
+ /// <param name="text">Column cell text .</param>
+ /// <param name="alignment">Column cell content alignment.</param>
+ public LegendCellColumn(string headerText, LegendCellColumnType columnType, string text, ContentAlignment alignment)
+ {
+ this._headerText = headerText;
+ this._columnType = columnType;
+ this._text = text;
+ this._alignment = alignment;
+ }
+
+
+ #endregion // Constructors
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets name of legend column.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ SRDescription("DescriptionAttributeLegendCellColumn_Name"),
+ ]
+ public override string Name
+ {
+ get
+ {
+ return base.Name;
+ }
+ set
+ {
+ base.Name = value;
+ }
+ }
+
+
+ /// <summary>
+ /// Gets legend this column belongs too.
+ /// </summary>
+ [
+ Browsable(false),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ ]
+ public virtual Legend Legend
+ {
+ get
+ {
+ if (Parent != null)
+ return Parent.Parent as Legend;
+ else
+ return null;
+ }
+ }
+
+
+ /// <summary>
+ /// Gets or sets legend column type. This is only applicable to items that are automatically generated for the series.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeSeriesItems"),
+ DefaultValue(LegendCellColumnType.Text),
+ SRDescription("DescriptionAttributeLegendCellColumn_ColumnType"),
+ ParenthesizePropertyNameAttribute(true)
+ ]
+ public virtual LegendCellColumnType ColumnType
+ {
+ get
+ {
+ return this._columnType;
+ }
+ set
+ {
+ this._columnType = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets legend column text. This is only applicable to items that are automatically generated for the series.
+ /// Set the ColumnType property to text to use this property.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeSeriesItems"),
+ DefaultValue(KeywordName.LegendText),
+ SRDescription("DescriptionAttributeLegendCellColumn_Text"),
+ Editor(Editors.KeywordsStringEditor.Editor, Editors.KeywordsStringEditor.Base),
+ ]
+ public virtual string Text
+ {
+ get
+ {
+ return this._text;
+ }
+ set
+ {
+ this._text = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the text color of the legend column.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeSeriesItems"),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeForeColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ ]
+ public virtual Color ForeColor
+ {
+ get
+ {
+ return this._foreColor;
+ }
+ set
+ {
+ this._foreColor = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background color of the legend column.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeSeriesItems"),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeBackColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ ]
+ public virtual Color BackColor
+ {
+ get
+ {
+ return this._backColor;
+ }
+ set
+ {
+ this._backColor = value;
+ this.Invalidate();
+ }
+ }
+
+
+ /// <summary>
+ /// Gets or sets the font of the legend column text.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeSeriesItems"),
+ DefaultValue(null),
+ SRDescription("DescriptionAttributeLegendCellColumn_Font"),
+ ]
+ public virtual Font Font
+ {
+ get
+ {
+ return this._font;
+ }
+ set
+ {
+ this._font = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the series symbol size of the legend column
+ /// for the items automatically generated for the series.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeSeriesItems"),
+ DefaultValue(typeof(Size), "200, 70"),
+ SRDescription("DescriptionAttributeLegendCellColumn_SeriesSymbolSize"),
+ ]
+ public virtual Size SeriesSymbolSize
+ {
+ get
+ {
+ return this._seriesSymbolSize;
+ }
+ set
+ {
+ if(value.Width < 0 || value.Height < 0)
+ {
+ throw (new ArgumentException(SR.ExceptionSeriesSymbolSizeIsNegative, "value"));
+ }
+ this._seriesSymbolSize = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the content alignment of the legend column.
+ /// This is only applicable to items that are automatically generated for the series.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeSeriesItems"),
+ DefaultValue(ContentAlignment.MiddleCenter),
+ SRDescription("DescriptionAttributeLegendCellColumn_Alignment"),
+ ]
+ public virtual ContentAlignment Alignment
+ {
+ get
+ {
+ return this._alignment;
+ }
+ set
+ {
+ this._alignment = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the margins of the legend column (as a percentage of legend font size).
+ /// This is only applicable to items that are automatically generated for the series.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeSeriesItems"),
+ DefaultValue(typeof(Margins), "0,0,15,15"),
+ SRDescription("DescriptionAttributeLegendCellColumn_Margins"),
+ SerializationVisibilityAttribute(SerializationVisibility.Attribute),
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+ NotifyParentPropertyAttribute(true),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ ]
+ public virtual Margins Margins
+ {
+ get
+ {
+ return this._margins;
+ }
+ set
+ {
+ this._margins = value;
+ this.Invalidate();
+
+#if Microsoft_CONTROL
+ // Set common elements of the new margins class
+ if(this.Legend != null)
+ {
+ this._margins.Common = this.Legend.Common;
+ }
+#endif // Microsoft_CONTROL
+ }
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized. This is for internal use only.
+ /// </summary>
+ [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+ public bool ShouldSerializeMargins()
+ {
+ if(this._margins.Top == 0 &&
+ this._margins.Bottom == 0 &&
+ this._margins.Left == 15 &&
+ this._margins.Right == 15 )
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /// <summary>
+ /// Gets or sets the legend column tooltip. This is only applicable to items that are automatically generated for the series.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeSeriesItems"),
+ SRDescription("DescriptionAttributeToolTip"),
+ DefaultValue(""),
+ Editor(Editors.KeywordsStringEditor.Editor, Editors.KeywordsStringEditor.Base),
+ ]
+ public virtual string ToolTip
+ {
+ set
+ {
+ this._toolTip = value;
+#if Microsoft_CONTROL
+ if(Chart != null &&
+ Chart.selection != null)
+ {
+ Chart.selection.enabledChecked = false;
+ }
+#endif
+ }
+ get
+ {
+ return this._toolTip;
+ }
+ }
+
+#if !Microsoft_CONTROL
+
+ /// <summary>
+ /// Gets or sets the URL target of the legend items automatically generated for the series.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeSeriesItems"),
+ SRDescription("DescriptionAttributeUrl"),
+ DefaultValue(""),
+ Editor(Editors.KeywordsStringEditor.Editor, Editors.KeywordsStringEditor.Base),
+ ]
+ public virtual string Url
+ {
+ set
+ {
+ this._url = value;
+ }
+ get
+ {
+ return this._url;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the other attributes of the legend items automatically generated for the series.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeSeriesItems"),
+ SRDescription("DescriptionAttributeMapAreaAttributes"),
+ Editor(Editors.KeywordsStringEditor.Editor, Editors.KeywordsStringEditor.Base),
+ DefaultValue(""),
+ ]
+ public virtual string MapAreaAttributes
+ {
+ set
+ {
+ this._mapAreaAttribute = value;
+ }
+ get
+ {
+ return this._mapAreaAttribute;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the postback value which can be processed on a click event.
+ /// </summary>
+ /// <value>The value which is passed to a click event as an argument.</value>
+ [DefaultValue("")]
+ [SRCategory(SR.Keys.CategoryAttributeSeriesItems)]
+ [SRDescription(SR.Keys.DescriptionAttributePostBackValue)]
+ public string PostBackValue
+ {
+ get
+ {
+ return this._postbackValue;
+ }
+ set
+ {
+ this._postbackValue = value;
+ }
+ }
+
+
+#endif // !Microsoft_CONTROL
+
+ /// <summary>
+ /// Gets or sets the legend column header text.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeHeader"),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeLegendCellColumn_HeaderText"),
+ ]
+ public virtual string HeaderText
+ {
+ get
+ {
+ return this._headerText;
+ }
+ set
+ {
+ this._headerText = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the color of the legend column header text.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeHeader"),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeLegendCellColumn_HeaderColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ ]
+ public virtual Color HeaderForeColor
+ {
+ get
+ {
+ return this._headerForeColor;
+ }
+ set
+ {
+ this._headerForeColor = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background color of the legend column header.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeHeader"),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeHeaderBackColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ ]
+ public virtual Color HeaderBackColor
+ {
+ get
+ {
+ return this._headerBackColor;
+ }
+ set
+ {
+ this._headerBackColor = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the font of the legend column header.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeHeader"),
+ DefaultValue(typeof(Font), "Microsoft Sans Serif, 8pt, style=Bold"),
+ SRDescription("DescriptionAttributeLegendCellColumn_HeaderFont"),
+ ]
+ public virtual Font HeaderFont
+ {
+ get
+ {
+ return this._headerFont;
+ }
+ set
+ {
+ this._headerFont = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the horizontal text alignment of the legend column header.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeHeader"),
+ DefaultValue(typeof(StringAlignment), "Center"),
+ SRDescription("DescriptionAttributeLegendCellColumn_HeaderTextAlignment"),
+ ]
+ public StringAlignment HeaderAlignment
+ {
+ get
+ {
+ return this._headerAlignment;
+ }
+ set
+ {
+ if(value != this._headerAlignment)
+ {
+ this._headerAlignment = value;
+ this.Invalidate();
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the minimum width (as a percentage of legend font size) of legend column. Set this property to -1 for automatic calculation.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeSize"),
+ DefaultValue(-1),
+ TypeConverter(typeof(IntNanValueConverter)),
+ SRDescription("DescriptionAttributeLegendCellColumn_MinimumWidth"),
+ ]
+ public virtual int MinimumWidth
+ {
+ get
+ {
+ return this._minimumCellWidth;
+ }
+ set
+ {
+ if(value < -1)
+ {
+ throw (new ArgumentException(SR.ExceptionMinimumCellWidthIsWrong, "value"));
+ }
+
+ this._minimumCellWidth = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the maximum width (as a percentage of legend font size) of legend column. Set this property to -1 for automatic calculation.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeSize"),
+ DefaultValue(-1),
+ TypeConverter(typeof(IntNanValueConverter)),
+ SRDescription("DescriptionAttributeLegendCellColumn_MaximumWidth"),
+ ]
+ public virtual int MaximumWidth
+ {
+ get
+ {
+ return this._maximumCellWidth;
+ }
+ set
+ {
+ if(value < -1)
+ {
+ throw (new ArgumentException(SR.ExceptionMaximumCellWidthIsWrong, "value"));
+ }
+ this._maximumCellWidth = value;
+ this.Invalidate();
+ }
+ }
+
+ #endregion // Properties
+
+ #region Methods
+
+ /// <summary>
+ /// Creates a new LegendCell object and copies all properties from the
+ /// current column into the newly created one.
+ /// </summary>
+ /// <returns>A new copy of the LegendCell</returns>
+ internal LegendCell CreateNewCell()
+ {
+ LegendCell newCell = new LegendCell();
+ newCell.CellType = (this.ColumnType == LegendCellColumnType.SeriesSymbol) ? LegendCellType.SeriesSymbol : LegendCellType.Text;
+ newCell.Text = this.Text;
+ newCell.ToolTip = this.ToolTip;
+#if !Microsoft_CONTROL
+ newCell.Url = this.Url;
+ newCell.MapAreaAttributes = this.MapAreaAttributes;
+ newCell.PostBackValue = this.PostBackValue;
+#endif // !Microsoft_CONTROL
+
+ newCell.SeriesSymbolSize = this.SeriesSymbolSize;
+ newCell.Alignment = this.Alignment;
+ newCell.Margins = new Margins(this.Margins.Top, this.Margins.Bottom, this.Margins.Left, this.Margins.Right);
+ return newCell;
+ }
+
+ #endregion // Methods
+
+ #region IDisposable Members
+
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ if (_fontCache != null)
+ {
+ _fontCache.Dispose();
+ _fontCache = null;
+ }
+ }
+ }
+
+
+ #endregion
+ }
+
+ /// <summary>
+ /// The LegendCell class represents a single cell in the chart legend.
+ /// Legend contains several legend items. Each item contains several
+ /// cells which form the vertical columns. This class provides properties
+ /// which determine content of the cell and its visual appearance. It
+ /// also contains method which determine the size of the cell and draw
+ /// cell in the chart.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeLegendCell_LegendCell"),
+ ]
+#if Microsoft_CONTROL
+ public class LegendCell : ChartNamedElement
+#else
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class LegendCell : ChartNamedElement, IChartMapArea
+#endif
+ {
+ #region Fields
+
+ // Legend cell type
+ private LegendCellType _cellType = LegendCellType.Text;
+
+ // Legend cell text
+ private string _text = string.Empty;
+
+ // Legend cell text color
+ private Color _foreColor = Color.Empty;
+
+ // Legend cell back color
+ private Color _backColor = Color.Empty;
+
+ // Font cache
+ private FontCache _fontCache = new FontCache();
+
+ // Legend cell text font
+ private Font _font = null;
+
+ // Legend cell image name
+ private string _image = string.Empty;
+
+ // Legend cell image transparent color
+ private Color _imageTransparentColor = Color.Empty;
+
+ // Legend cell image size
+ private Size _imageSize = Size.Empty;
+
+ // Legend cell series symbol size
+ private Size _seriesSymbolSize = new Size(200, 70);
+
+ // Legend cell content allignment
+ private ContentAlignment _alignment = ContentAlignment.MiddleCenter;
+
+ // Numer of cells this cell uses to show it's content
+ private int _cellSpan = 1;
+
+ // Legend cell tooltip
+ private string _toolTip = string.Empty;
+
+ // Legend cell margins
+ private Margins _margins = new Margins(0, 0, 15, 15);
+
+ // Cell row index
+ private int _rowIndex = -1;
+
+#if !Microsoft_CONTROL
+
+ // Legend cell Url
+ private string _url = string.Empty;
+
+ // Legend cell map area attribute
+ private string _mapAreaAttribute = string.Empty;
+ private string _postbackValue = String.Empty;
+
+#endif // !Microsoft_CONTROL
+
+ // Position where cell is drawn in pixel coordinates.
+ // Exncludes margins and space required for separators
+ internal Rectangle cellPosition = Rectangle.Empty;
+
+ // Position where cell is drawn in pixel coordinates.
+ // Includes margins and space required for separators
+ internal Rectangle cellPositionWithMargins = Rectangle.Empty;
+
+ // Last cached cell size.
+ private Size _cachedCellSize = Size.Empty;
+
+ // Font reduced value used to calculate last cached cell size
+ private int _cachedCellSizeFontReducedBy = 0;
+
+ #endregion // Fields
+
+ #region Constructors
+
+ /// <summary>
+ /// LegendCell constructor.
+ /// </summary>
+ public LegendCell()
+ {
+ this.Intitialize(LegendCellType.Text, string.Empty, ContentAlignment.MiddleCenter);
+ }
+
+ /// <summary>
+ /// LegendCell constructor.
+ /// </summary>
+ /// <param name="text">Cell text or image name, depending on the type.</param>
+ public LegendCell(string text)
+ {
+ this.Intitialize(LegendCellType.Text, text, ContentAlignment.MiddleCenter);
+ }
+
+ /// <summary>
+ /// LegendCell constructor.
+ /// </summary>
+ /// <param name="cellType">Cell type.</param>
+ /// <param name="text">Cell text or image name, depending on the type.</param>
+ public LegendCell(LegendCellType cellType, string text)
+ {
+ this.Intitialize(cellType, text, ContentAlignment.MiddleCenter);
+ }
+
+ /// <summary>
+ /// LegendCell constructor.
+ /// </summary>
+ /// <param name="cellType">Cell type.</param>
+ /// <param name="text">Cell text or image name, depending on the type.</param>
+ /// <param name="alignment">Cell content alignment.</param>
+ public LegendCell(LegendCellType cellType, string text, ContentAlignment alignment)
+ {
+ this.Intitialize(cellType, text, alignment);
+ }
+
+ /// <summary>
+ /// Initializes newly created object.
+ /// </summary>
+ /// <param name="cellType">Cell type.</param>
+ /// <param name="text">Cell text or image name depending on the type.</param>
+ /// <param name="alignment">Cell content alignment.</param>
+ private void Intitialize(LegendCellType cellType, string text, ContentAlignment alignment)
+ {
+ this._cellType = cellType;
+ if(this._cellType == LegendCellType.Image)
+ {
+ this._image = text;
+ }
+ else
+ {
+ this._text = text;
+ }
+ this._alignment = alignment;
+#if !Microsoft_CONTROL
+ this.PostBackValue = String.Empty;
+#endif //!WIN_CONTROL
+ }
+
+ #endregion // Constructors
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets the name of the legend cell.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ SRDescription("DescriptionAttributeLegendCell_Name"),
+ ]
+ public override string Name
+ {
+ get
+ {
+ return base.Name;
+ }
+ set
+ {
+ base.Name = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the type of the legend cell.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(LegendCellType.Text),
+ SRDescription("DescriptionAttributeLegendCell_CellType"),
+ ParenthesizePropertyNameAttribute(true)
+ ]
+ public virtual LegendCellType CellType
+ {
+ get
+ {
+ return this._cellType;
+ }
+ set
+ {
+ this._cellType = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets legend this column/cell belongs too.
+ /// </summary>
+ [
+ Browsable(false),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ ]
+ public virtual Legend Legend
+ {
+ get
+ {
+ LegendItem item = this.LegendItem;
+ if (item != null)
+ return item.Legend;
+ else
+ return null;
+ }
+ }
+
+ /// <summary>
+ /// Gets legend item this cell belongs too.
+ /// </summary>
+ [
+ Browsable(false),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ ]
+ public virtual LegendItem LegendItem
+ {
+ get
+ {
+ if (Parent != null)
+ return Parent.Parent as LegendItem;
+ else
+ return null;
+ }
+ }
+
+
+
+ /// <summary>
+ /// Gets or sets the text of the legend cell. Set CellType to text to use this property.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeLegendCell_Text"),
+ ]
+ public virtual string Text
+ {
+ get
+ {
+ return this._text;
+ }
+ set
+ {
+ this._text = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the text color of the legend cell. Set CellType to text to use this property.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeForeColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ ]
+ public virtual Color ForeColor
+ {
+ get
+ {
+ return this._foreColor;
+ }
+ set
+ {
+ this._foreColor = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background color of the legend cell.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeBackColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ ]
+ public virtual Color BackColor
+ {
+ get
+ {
+ return this._backColor;
+ }
+ set
+ {
+ this._backColor = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the font of the legend cell. Set CellType to text to use this property.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(null),
+ SRDescription("DescriptionAttributeLegendCell_Font"),
+ ]
+ public virtual Font Font
+ {
+ get
+ {
+ return this._font;
+ }
+ set
+ {
+ this._font = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the URL of the image of the legend cell. Set CellType to image to use this property.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeLegendCell_Image"),
+ Editor(Editors.ImageValueEditor.Editor, Editors.ImageValueEditor.Base),
+ ]
+ public virtual string Image
+ {
+ get
+ {
+ return this._image;
+ }
+ set
+ {
+ this._image = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a color which will be replaced with a transparent color while drawing the image. Set CellType to image to use this property.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeImageTransparentColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ ]
+ public virtual Color ImageTransparentColor
+ {
+ get
+ {
+ return this._imageTransparentColor;
+ }
+ set
+ {
+ this._imageTransparentColor = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the image size (as a percentage of legend font size) of the legend cell.
+ /// Set CellType to Image to use this property.
+ /// </summary>
+ /// <remarks>
+ /// If property is set to Size.IsEmpty, the original image pixels size is used.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeLayout"),
+ DefaultValue(typeof(Size), "0, 0"),
+ TypeConverter(typeof(SizeEmptyValueConverter)),
+ SRDescription("DescriptionAttributeLegendCell_ImageSize"),
+ ]
+ public virtual Size ImageSize
+ {
+ get
+ {
+ return this._imageSize;
+ }
+ set
+ {
+ if(value.Width < 0 || value.Height < 0)
+ {
+ throw (new ArgumentException(SR.ExceptionLegendCellImageSizeIsNegative, "value"));
+ }
+ this._imageSize = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the series symbol size (as a percentage of legend font size) of the legend cell.
+ /// Set CellType to SeriesSymbol to use this property.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeLayout"),
+ DefaultValue(typeof(Size), "200, 70"),
+ SRDescription("DescriptionAttributeLegendCell_SeriesSymbolSize"),
+ ]
+ public virtual Size SeriesSymbolSize
+ {
+ get
+ {
+ return this._seriesSymbolSize;
+ }
+ set
+ {
+ if(value.Width < 0 || value.Height < 0)
+ {
+ throw (new ArgumentException(SR.ExceptionLegendCellSeriesSymbolSizeIsNegative, "value"));
+ }
+ this._seriesSymbolSize = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the content alignment of the legend cell.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeLayout"),
+ DefaultValue(ContentAlignment.MiddleCenter),
+ SRDescription("DescriptionAttributeLegendCell_Alignment"),
+ ]
+ public virtual ContentAlignment Alignment
+ {
+ get
+ {
+ return this._alignment;
+ }
+ set
+ {
+ this._alignment = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the number of horizontal cells used to draw the content.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeLayout"),
+ DefaultValue(1),
+ SRDescription("DescriptionAttributeLegendCell_CellSpan"),
+ ]
+ public virtual int CellSpan
+ {
+ get
+ {
+ return this._cellSpan;
+ }
+ set
+ {
+ if(value < 1)
+ {
+ throw (new ArgumentException(SR.ExceptionLegendCellSpanIsLessThenOne, "value"));
+ }
+ this._cellSpan = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the legend cell margins (as a percentage of legend font size).
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeLayout"),
+ DefaultValue(typeof(Margins), "0,0,15,15"),
+ SRDescription("DescriptionAttributeLegendCell_Margins"),
+ SerializationVisibilityAttribute(SerializationVisibility.Attribute),
+ NotifyParentPropertyAttribute(true),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ ]
+ public virtual Margins Margins
+ {
+ get
+ {
+ return this._margins;
+ }
+ set
+ {
+ this._margins = value;
+ this.Invalidate();
+
+#if Microsoft_CONTROL
+ // Set common elements of the new margins class
+ if(this.Legend != null)
+ {
+ this._margins.Common = this.Common;
+ }
+#endif // Microsoft_CONTROL
+ }
+ }
+
+ /// <summary>
+ /// Returns true if property should be serialized. This method is for internal use only.
+ /// </summary>
+ [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+ internal bool ShouldSerializeMargins()
+ {
+ if(this._margins.Top == 0 &&
+ this._margins.Bottom == 0 &&
+ this._margins.Left == 15 &&
+ this._margins.Right == 15 )
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /// <summary>
+ /// Gets or sets the tooltip of the legend cell.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMapArea"),
+ SRDescription("DescriptionAttributeToolTip"),
+ DefaultValue(""),
+ ]
+ public virtual string ToolTip
+ {
+ set
+ {
+ this._toolTip = value;
+#if Microsoft_CONTROL
+ if(this.Chart != null &&
+ this.Chart.selection != null)
+ {
+ this.Chart.selection.enabledChecked = false;
+ }
+#endif
+ }
+ get
+ {
+ return this._toolTip;
+ }
+ }
+
+#if !Microsoft_CONTROL
+
+ /// <summary>
+ /// Gets or sets the URL target of the legend cell.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMapArea"),
+ SRDescription("DescriptionAttributeUrl"),
+ DefaultValue(""),
+ Editor(Editors.UrlValueEditor.Editor, Editors.UrlValueEditor.Base)
+ ]
+ public virtual string Url
+ {
+ set
+ {
+ this._url = value;
+ }
+ get
+ {
+ return this._url;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the other map area attributes of the legend cell.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMapArea"),
+ SRDescription("DescriptionAttributeMapAreaAttributes"),
+ DefaultValue(""),
+ ]
+ public virtual string MapAreaAttributes
+ {
+ set
+ {
+ this._mapAreaAttribute = value;
+ }
+ get
+ {
+ return this._mapAreaAttribute;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the postback value which can be processed on a click event.
+ /// </summary>
+ /// <value>The value which is passed to a click event as an argument.</value>
+ [DefaultValue("")]
+ [SRCategory(SR.Keys.CategoryAttributeMapArea)]
+ [SRDescription(SR.Keys.DescriptionAttributePostBackValue)]
+ public string PostBackValue
+ {
+ get
+ {
+ return this._postbackValue;
+ }
+ set
+ {
+ this._postbackValue = value;
+ }
+ }
+
+
+#endif // !Microsoft_CONTROL
+
+ #endregion // Properties
+
+ #region Methods
+
+ /// <summary>
+ /// Resets cached cell values.
+ /// </summary>
+ internal void ResetCache()
+ {
+ this._cachedCellSize = Size.Empty;
+ this._cachedCellSizeFontReducedBy = 0;
+ }
+
+ /// <summary>
+ /// Sets cell position in relative coordinates.
+ /// </summary>
+ /// <param name="rowIndex">Cell row index.</param>
+ /// <param name="position">Cell position.</param>
+ /// <param name="singleWCharacterSize">Size of the 'W' character used to calculate elements.</param>
+ internal void SetCellPosition(
+ int rowIndex,
+ Rectangle position,
+ Size singleWCharacterSize)
+ {
+ // Set cell position
+ this.cellPosition = position;
+ this.cellPositionWithMargins = position;
+ this._rowIndex = rowIndex;
+
+ // Adjust cell position by specified margin
+ this.cellPosition.X += (int)(this.Margins.Left * singleWCharacterSize.Width / 100f);
+ this.cellPosition.Y += (int)(this.Margins.Top * singleWCharacterSize.Height / 100f);
+ this.cellPosition.Width -= (int)(this.Margins.Left * singleWCharacterSize.Width / 100f)
+ + (int)(this.Margins.Right * singleWCharacterSize.Width / 100f);
+ this.cellPosition.Height -= (int)(this.Margins.Top * singleWCharacterSize.Height / 100f)
+ + (int)(this.Margins.Bottom * singleWCharacterSize.Height / 100f);
+
+ // Adjust cell position by space required for the separatorType
+ if( LegendItem != null &&
+ LegendItem.SeparatorType != LegendSeparatorStyle.None)
+ {
+ this.cellPosition.Height -= this.Legend.GetSeparatorSize(LegendItem.SeparatorType).Height;
+ }
+ }
+
+ /// <summary>
+ /// Measures legend cell size in chart relative coordinates.
+ /// </summary>
+ /// <param name="graph">
+ /// Chart graphics.
+ /// </param>
+ /// <param name="fontSizeReducedBy">
+ /// A positive or negative integer value that determines the how standard cell font size
+ /// should be adjusted. As a result smaller or larger font can be used.
+ /// </param>
+ /// <param name="legendAutoFont">
+ /// Auto fit font used in the legend.
+ /// </param>
+ /// <param name="singleWCharacterSize">
+ /// Size of the 'W' character used to calculate elements.
+ /// </param>
+ /// <returns>Legend cell size.</returns>
+ internal Size MeasureCell(
+ ChartGraphics graph,
+ int fontSizeReducedBy,
+ Font legendAutoFont,
+ Size singleWCharacterSize)
+ {
+ // Check if cached size may be reused
+ if(this._cachedCellSizeFontReducedBy == fontSizeReducedBy &&
+ !this._cachedCellSize.IsEmpty)
+ {
+ return this._cachedCellSize;
+ }
+
+ // Get cell font
+ Size cellSize = Size.Empty;
+ bool disposeFont = false;
+ Font cellFont = this.GetCellFont(legendAutoFont, fontSizeReducedBy, out disposeFont);
+
+ // Measure cell content size based on the type
+ if(this.CellType == LegendCellType.SeriesSymbol)
+ {
+ cellSize.Width = (int)(Math.Abs(this.SeriesSymbolSize.Width) * singleWCharacterSize.Width / 100f);
+ cellSize.Height = (int)(Math.Abs(this.SeriesSymbolSize.Height) * singleWCharacterSize.Height / 100f);
+ }
+ else if(this.CellType == LegendCellType.Image)
+ {
+ if(this.ImageSize.IsEmpty && this.Image.Length > 0)
+ {
+ SizeF imageSize = new SizeF();
+
+ // Use original image size
+ if (this.Common.ImageLoader.GetAdjustedImageSize(this.Image, graph.Graphics, ref imageSize))
+ {
+ cellSize.Width = (int)imageSize.Width;
+ cellSize.Height = (int)imageSize.Height;
+ }
+ }
+ else
+ {
+ cellSize.Width = (int)(Math.Abs(this.ImageSize.Width) * singleWCharacterSize.Width / 100f);
+ cellSize.Height = (int)(Math.Abs(this.ImageSize.Height) * singleWCharacterSize.Height / 100f);
+ }
+ }
+ else if(this.CellType == LegendCellType.Text)
+ {
+ // Get current cell text taking in consideration keywords
+ // and automatic text wrapping.
+ string cellText = this.GetCellText();
+
+ // Measure text size.
+ // Note that extra "I" character added to add more horizontal spacing
+ cellSize = graph.MeasureStringAbs(cellText + "I", cellFont);
+ }
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionLegendCellTypeUnknown(this.CellType.ToString())));
+ }
+
+ // Add cell margins
+ cellSize.Width += (int)((this.Margins.Left + this.Margins.Right) * singleWCharacterSize.Width / 100f);
+ cellSize.Height += (int)((this.Margins.Top + this.Margins.Bottom) * singleWCharacterSize.Height / 100f);
+
+ // Add space required for the separatorType
+ if( LegendItem != null &&
+ LegendItem.SeparatorType != LegendSeparatorStyle.None)
+ {
+ cellSize.Height += this.Legend.GetSeparatorSize(LegendItem.SeparatorType).Height;
+ }
+
+ // Dispose created font object
+ if(disposeFont)
+ {
+ cellFont.Dispose();
+ cellFont = null;
+ }
+
+ // Save calculated size
+ this._cachedCellSize = cellSize;
+ this._cachedCellSizeFontReducedBy = fontSizeReducedBy;
+
+ return cellSize;
+ }
+
+ /// <summary>
+ /// Gets cell background color.
+ /// </summary>
+ /// <returns></returns>
+ private Color GetCellBackColor()
+ {
+ Color resultColor = this.BackColor;
+ if(this.BackColor.IsEmpty && this.Legend != null)
+ {
+ // Try getting back color from the associated column
+ if(this.LegendItem != null)
+ {
+ // Get index of this cell
+ int cellIndex = this.LegendItem.Cells.IndexOf(this);
+ if(cellIndex >= 0)
+ {
+ // Check if associated column exsists
+ if(cellIndex < this.Legend.CellColumns.Count &&
+ !this.Legend.CellColumns[cellIndex].BackColor.IsEmpty)
+ {
+ resultColor = this.Legend.CellColumns[cellIndex].BackColor;
+ }
+ }
+ }
+
+ // Get font from the legend isInterlaced
+ if(resultColor.IsEmpty &&
+ this.Legend.InterlacedRows &&
+ this._rowIndex % 2 != 0)
+ {
+ if(this.Legend.InterlacedRowsColor.IsEmpty)
+ {
+ // Automatically determine background color
+ // If isInterlaced strips color is not set - use darker color of the area
+ if(this.Legend.BackColor == Color.Empty)
+ {
+ resultColor = Color.LightGray;
+ }
+ else if(this.Legend.BackColor == Color.Transparent)
+ {
+ if(Chart.BackColor != Color.Transparent &&
+ Chart.BackColor != Color.Black)
+ {
+ resultColor = ChartGraphics.GetGradientColor( Chart.BackColor, Color.Black, 0.2 );
+ }
+ else
+ {
+ resultColor = Color.LightGray;
+ }
+ }
+ else
+ {
+ resultColor = ChartGraphics.GetGradientColor( this.Legend.BackColor, Color.Black, 0.2 );
+ }
+ }
+ else
+ {
+ resultColor = this.Legend.InterlacedRowsColor;
+ }
+ }
+ }
+ return resultColor;
+ }
+
+ /// <summary>
+ /// Gets default cell font. Font can be specified in the cell, column or in the legend.
+ /// </summary>
+ /// <param name="legendAutoFont">Auto fit font used in the legend.</param>
+ /// <param name="fontSizeReducedBy">Number of points legend auto-font reduced by.</param>
+ /// <param name="disposeFont">Returns a flag if result font object should be disposed.</param>
+ /// <returns>Default cell font.</returns>
+ private Font GetCellFont(Font legendAutoFont, int fontSizeReducedBy, out bool disposeFont)
+ {
+ Font cellFont = this.Font;
+ disposeFont = false;
+
+ // Check if font is not set in the cell and legend object reference is valid
+ if(cellFont == null &&
+ this.Legend != null)
+ {
+ // Try getting font from the associated column
+ if(this.LegendItem != null)
+ {
+ // Get index of this cell
+ int cellIndex = this.LegendItem.Cells.IndexOf(this);
+ if(cellIndex >= 0)
+ {
+ // Check if associated column exsists
+ if(cellIndex < this.Legend.CellColumns.Count &&
+ this.Legend.CellColumns[cellIndex].Font != null)
+ {
+ cellFont = this.Legend.CellColumns[cellIndex].Font;
+ }
+ }
+ }
+
+ // Get font from the legend
+ if(cellFont == null)
+ {
+ cellFont = legendAutoFont;
+
+ // No further processing required.
+ // Font is already reduced.
+ return cellFont;
+ }
+ }
+
+ // Check if font size should be adjusted
+ if(cellFont != null && fontSizeReducedBy != 0)
+ {
+ // New font is created anf it must be disposed
+ disposeFont = true;
+
+ // Calculate new font size
+ int newFontSize = (int)Math.Round(cellFont.Size - fontSizeReducedBy);
+ if(newFontSize < 1)
+ {
+ // Font can't be less than size 1
+ newFontSize = 1;
+ }
+
+ // Create new font
+ cellFont = new Font(
+ cellFont.FontFamily,
+ newFontSize,
+ cellFont.Style,
+ cellFont.Unit);
+ }
+
+ return cellFont;
+ }
+
+ /// <summary>
+ /// Helper function that returns cell tooltip.
+ /// </summary>
+ /// <remarks>
+ /// Tooltip can be set in the cell or in the legend item. Cell
+ /// tooltip always has a higher priority.
+ /// </remarks>
+ /// <returns>Returns cell text.</returns>
+ private string GetCellToolTip()
+ {
+ // Check if tooltip is set in the cell (highest priority)
+ if(this.ToolTip.Length > 0)
+ {
+ return this.ToolTip;
+ }
+
+ // Check if tooltip is set in associated legend item
+ if(this.LegendItem != null)
+ {
+ return this.LegendItem.ToolTip;
+ }
+
+ return string.Empty;
+ }
+
+ /// <summary>
+ /// Helper function that returns cell url.
+ /// </summary>
+ /// <remarks>
+ /// Url can be set in the cell or in the legend item. Cell
+ /// tooltip always has a higher priority.
+ /// </remarks>
+ /// <returns>Returns cell text.</returns>
+ private string GetCellUrl()
+ {
+#if !Microsoft_CONTROL
+ // Check if tooltip is set in the cell (highest priority)
+ if(this._url.Length > 0)
+ {
+ return this._url;
+ }
+
+ // Check if tooltip is set in associated legend item
+ if(this.LegendItem != null)
+ {
+ return this.LegendItem.Url;
+ }
+#endif // !Microsoft_CONTROL
+ return string.Empty;
+ }
+
+ /// <summary>
+ /// Helper function that returns cell url.
+ /// </summary>
+ /// <remarks>
+ /// Url can be set in the cell or in the legend item. Cell
+ /// tooltip always has a higher priority.
+ /// </remarks>
+ /// <returns>Returns cell text.</returns>
+ private string GetCellMapAreaAttributes()
+ {
+#if !Microsoft_CONTROL
+ // Check if tooltip is set in the cell (highest priority)
+ if(this._mapAreaAttribute.Length > 0)
+ {
+ return this._mapAreaAttribute;
+ }
+
+ // Check if tooltip is set in associated legend item
+ if(this.LegendItem != null)
+ {
+ return this.LegendItem.MapAreaAttributes;
+ }
+#endif // !Microsoft_CONTROL
+ return string.Empty;
+ }
+
+ /// <summary>
+ /// Helper function that returns cell url.
+ /// </summary>
+ /// <remarks>
+ /// Url can be set in the cell or in the legend item. Cell
+ /// tooltip always has a higher priority.
+ /// </remarks>
+ /// <returns>Returns cell text.</returns>
+ private string GetCellPostBackValue()
+ {
+#if !Microsoft_CONTROL
+ // Check if tooltip is set in the cell (highest priority)
+ if (this._postbackValue.Length > 0)
+ {
+ return this._postbackValue;
+ }
+
+ // Check if tooltip is set in associated legend item
+ if (this.LegendItem != null)
+ {
+ return this.LegendItem.PostBackValue;
+ }
+#endif // !Microsoft_CONTROL
+ return string.Empty;
+ }
+
+ /// <summary>
+ /// Helper function that returns the exact text presented in the cell.
+ /// </summary>
+ /// <remarks>
+ /// This method replaces the "\n" substring with the new line character
+ /// and automatically wrap text if required.
+ /// </remarks>
+ /// <returns>Returns cell text.</returns>
+ private string GetCellText()
+ {
+ // Replace all "\n" strings with the new line character
+ string resultString = this.Text.Replace("\\n", "\n");
+
+ // Replace the KeywordName.LegendText keyword with legend item Name property
+ if(this.LegendItem != null)
+ {
+ resultString = resultString.Replace(KeywordName.LegendText, this.LegendItem.Name);
+ }
+ else
+ {
+ resultString = resultString.Replace(KeywordName.LegendText, "");
+ }
+
+ // Check if text width exceeds recomended character length
+ if(this.Legend != null)
+ {
+ int recomendedTextLength = this.Legend.TextWrapThreshold;
+
+ if(recomendedTextLength > 0 &&
+ resultString.Length > recomendedTextLength)
+ {
+ // Iterate through all text characters
+ int lineLength = 0;
+ for(int charIndex = 0; charIndex < resultString.Length; charIndex++)
+ {
+ // Reset line length when new line character is found
+ if(resultString[charIndex] == '\n')
+ {
+ lineLength = 0;
+ continue;
+ }
+
+ // Increase line length counter
+ ++lineLength;
+
+ // Check if current character is a white space and
+ // current line length exceeds the recomended values.
+ if(char.IsWhiteSpace(resultString, charIndex) &&
+ lineLength >= recomendedTextLength)
+ {
+ // Insert new line character in the string
+ lineLength = 0;
+ resultString = resultString.Substring(0, charIndex) + "\n" +
+ resultString.Substring(charIndex + 1).TrimStart();
+ }
+ }
+ }
+ }
+
+ return resultString;
+ }
+
+ /// <summary>
+ /// Helper function that returns cell text color.
+ /// </summary>
+ /// <returns>Cell text color.</returns>
+ private Color GetCellForeColor()
+ {
+ // Check if cell text color defined in the cell
+ if(!this.ForeColor.IsEmpty)
+ {
+ return this.ForeColor;
+ }
+
+ // Check if color from the Column or legend should be used
+ if(this.Legend != null)
+ {
+ // Try getting font from the associated column
+ if(this.LegendItem != null)
+ {
+ // Get index of this cell
+ int cellIndex = this.LegendItem.Cells.IndexOf(this);
+ if(cellIndex >= 0)
+ {
+ // Check if associated column exsists
+ if(cellIndex < this.Legend.CellColumns.Count &&
+ !this.Legend.CellColumns[cellIndex].ForeColor.IsEmpty)
+ {
+ return this.Legend.CellColumns[cellIndex].ForeColor;
+ }
+ }
+ }
+
+ // Use legend text color
+ return this.Legend.ForeColor;
+ }
+
+ return Color.Black;
+ }
+
+ #endregion // Methods
+
+ #region Cell Painting Methods
+
+ /// <summary>
+ /// Paints content of the legend cell.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics to draw content on.</param>
+ /// <param name="fontSizeReducedBy">Number that determines how much the cell font should be reduced by.</param>
+ /// <param name="legendAutoFont">Auto-fit font used in the legend.</param>
+ /// <param name="singleWCharacterSize">Size of the 'W' character in auto-fit font.</param>
+ internal void Paint(
+ ChartGraphics chartGraph,
+ int fontSizeReducedBy,
+ Font legendAutoFont,
+ Size singleWCharacterSize)
+ {
+ // Check cell size before painting
+ if(this.cellPosition.Width <= 0 || this.cellPosition.Height <= 0)
+ {
+ return;
+ }
+
+ // Chart elements painting mode
+ if( this.Common.ProcessModePaint )
+ {
+ // Check if cell background should be painted
+ Color cellBackColor = this.GetCellBackColor();
+ RectangleF rectRelative = chartGraph.GetRelativeRectangle(this.cellPositionWithMargins);
+ if(!cellBackColor.IsEmpty)
+ {
+ chartGraph.FillRectangleRel(
+ rectRelative,
+ cellBackColor,
+ ChartHatchStyle.None,
+ string.Empty,
+ ChartImageWrapMode.Tile,
+ Color.Empty,
+ ChartImageAlignmentStyle.Center,
+ GradientStyle.None,
+ Color.Empty,
+ Color.Empty,
+ 0,
+ ChartDashStyle.NotSet,
+ Color.Empty,
+ 0,
+ PenAlignment.Inset);
+ }
+
+ // Fire an event for custom cell back drawing
+ this.Chart.CallOnPrePaint(new ChartPaintEventArgs(this, chartGraph, this.Common, new ElementPosition(rectRelative.X, rectRelative.Y, rectRelative.Width, rectRelative.Height)));
+
+ // Check legend cell type
+ switch(this.CellType)
+ {
+ case(LegendCellType.Text):
+ this.PaintCellText(chartGraph, fontSizeReducedBy, legendAutoFont);
+ break;
+ case(LegendCellType.Image):
+ this.PaintCellImage(chartGraph, singleWCharacterSize);
+ break;
+ case(LegendCellType.SeriesSymbol):
+ this.PaintCellSeriesSymbol(chartGraph, singleWCharacterSize);
+ break;
+ default:
+ throw (new InvalidOperationException(SR.ExceptionLegendCellTypeUnknown(this.CellType.ToString())));
+ }
+
+ // Fire an event for custom cell drawing
+ this.Chart.CallOnPostPaint(new ChartPaintEventArgs(this, chartGraph, this.Common, new ElementPosition(rectRelative.X, rectRelative.Y, rectRelative.Width, rectRelative.Height)));
+ }
+#if DEBUG
+ // Draw bounding rectangle for debug purpose
+// RectangleF absRectangle = this.cellPosition;
+// chartGraph.DrawRectangle(Pens.Red, absRectangle.X, absRectangle.Y, absRectangle.Width, absRectangle.Height);
+#endif // DEBUG
+
+ // Legend cell selection mode
+ if( this.Common.ProcessModeRegions )
+ {
+ // Add hot region.
+ // Note that legend cell is passed as sub-object of legend item
+ this.Common.HotRegionsList.AddHotRegion(
+ chartGraph.GetRelativeRectangle(this.cellPositionWithMargins),
+ this.GetCellToolTip(),
+ this.GetCellUrl(),
+ this.GetCellMapAreaAttributes(),
+ this.GetCellPostBackValue(),
+ this.LegendItem,
+ this,
+ ChartElementType.LegendItem,
+ this.LegendItem.SeriesName);
+ }
+ }
+
+ /// <summary>
+ /// Draw legend cell text.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics to draw the text on.</param>
+ /// <param name="fontSizeReducedBy">Number that determines how much the cell font should be reduced by.</param>
+ /// <param name="legendAutoFont">Auto-fit font used in the legend.</param>
+ private void PaintCellText(
+ ChartGraphics chartGraph,
+ int fontSizeReducedBy,
+ Font legendAutoFont)
+ {
+ // Get cell font
+ bool disposeFont = false;
+ Font cellFont = this.GetCellFont(legendAutoFont, fontSizeReducedBy, out disposeFont);
+
+ // Start Svg Selection mode
+ chartGraph.StartHotRegion( this.GetCellUrl(), this.GetCellToolTip() );
+
+ // Create font brush
+ using(SolidBrush fontBrush = new SolidBrush(this.GetCellForeColor()))
+ {
+ // Create cell text format
+ using (StringFormat format = new StringFormat(StringFormat.GenericDefault))
+ {
+ format.FormatFlags = StringFormatFlags.LineLimit;
+ format.Trimming = StringTrimming.EllipsisCharacter;
+ format.Alignment = StringAlignment.Center;
+ if (this.Alignment == ContentAlignment.BottomLeft ||
+ this.Alignment == ContentAlignment.MiddleLeft ||
+ this.Alignment == ContentAlignment.TopLeft)
+ {
+ format.Alignment = StringAlignment.Near;
+ }
+ else if (this.Alignment == ContentAlignment.BottomRight ||
+ this.Alignment == ContentAlignment.MiddleRight ||
+ this.Alignment == ContentAlignment.TopRight)
+ {
+ format.Alignment = StringAlignment.Far;
+ }
+ format.LineAlignment = StringAlignment.Center;
+ if (this.Alignment == ContentAlignment.BottomCenter ||
+ this.Alignment == ContentAlignment.BottomLeft ||
+ this.Alignment == ContentAlignment.BottomRight)
+ {
+ format.LineAlignment = StringAlignment.Far;
+ }
+ else if (this.Alignment == ContentAlignment.TopCenter ||
+ this.Alignment == ContentAlignment.TopLeft ||
+ this.Alignment == ContentAlignment.TopRight)
+ {
+ format.LineAlignment = StringAlignment.Near;
+ }
+
+ // Measure string height out of one character
+ SizeF charSize = chartGraph.MeasureStringAbs(this.GetCellText(), cellFont, new SizeF(10000f, 10000f), format);
+
+ // If height of one characte is more than rectangle heigjt - remove LineLimit flag
+ if (charSize.Height > this.cellPosition.Height && (format.FormatFlags & StringFormatFlags.LineLimit) != 0)
+ {
+ format.FormatFlags ^= StringFormatFlags.LineLimit;
+ }
+
+ else if (charSize.Height < this.cellPosition.Height && (format.FormatFlags & StringFormatFlags.LineLimit) == 0)
+ {
+ format.FormatFlags |= StringFormatFlags.LineLimit;
+ }
+
+ // Draw text
+ chartGraph.DrawStringRel(
+ this.GetCellText(),
+ cellFont,
+ fontBrush,
+ chartGraph.GetRelativeRectangle(this.cellPosition),
+ format);
+ }
+ }
+
+ // End Svg Selection mode
+ chartGraph.EndHotRegion( );
+
+ // Dispose created cell font object
+ if(disposeFont)
+ {
+ cellFont.Dispose();
+ cellFont = null;
+ }
+ }
+
+ /// <summary>
+ /// Paints cell image.
+ /// </summary>
+ /// <param name="chartGraph">Graphics used to draw cell image.</param>
+ /// <param name="singleWCharacterSize">Size of the 'W' character in auto-fit font.</param>
+ private void PaintCellImage(
+ ChartGraphics chartGraph,
+ Size singleWCharacterSize)
+ {
+ if(this.Image.Length > 0)
+ {
+ // Get image size in relative coordinates
+ Rectangle imagePosition = Rectangle.Empty;
+ System.Drawing.Image image = this.Common.ImageLoader.LoadImage(this.Image);
+
+ SizeF imageSize = new SizeF();
+
+ ImageLoader.GetAdjustedImageSize(image, chartGraph.Graphics, ref imageSize);
+
+ imagePosition.Width = (int)imageSize.Width;
+ imagePosition.Height = (int)imageSize.Height;
+
+ // Calculate cell position
+ Rectangle imageCellPosition = this.cellPosition;
+ imageCellPosition.Width = imagePosition.Width;
+ imageCellPosition.Height = imagePosition.Height;
+ if(!this.ImageSize.IsEmpty)
+ {
+ // Adjust cell size using image symbol size specified
+ if(this.ImageSize.Width > 0)
+ {
+ int newWidth = (int)(this.ImageSize.Width * singleWCharacterSize.Width / 100f);
+ if(newWidth > this.cellPosition.Width)
+ {
+ newWidth = this.cellPosition.Width;
+ }
+ imageCellPosition.Width = newWidth;
+ }
+ if(this.ImageSize.Height > 0)
+ {
+ int newHeight = (int)(this.ImageSize.Height * singleWCharacterSize.Height / 100f);
+ if(newHeight > this.cellPosition.Height)
+ {
+ newHeight = this.cellPosition.Height;
+ }
+ imageCellPosition.Height = newHeight;
+ }
+ }
+
+ // Make sure image size fits into the cell drawing rectangle
+ float scaleValue = 1f;
+ if(imagePosition.Height > imageCellPosition.Height)
+ {
+ scaleValue = (float)imagePosition.Height / (float)imageCellPosition.Height;
+ }
+ if(imagePosition.Width > imageCellPosition.Width)
+ {
+ scaleValue = Math.Max(scaleValue, (float)imagePosition.Width / (float)imageCellPosition.Width);
+ }
+
+ // Scale image size
+ imagePosition.Height = (int)(imagePosition.Height / scaleValue);
+ imagePosition.Width = (int)(imagePosition.Width / scaleValue);
+
+ // Get image location
+ imagePosition.X = (int)((this.cellPosition.X + this.cellPosition.Width/2f) - imagePosition.Width/2f);
+ imagePosition.Y = (int)((this.cellPosition.Y + this.cellPosition.Height/2f) - imagePosition.Height/2f);
+
+ // Adjust image location based on the cell content alignment
+ if(this.Alignment == ContentAlignment.BottomLeft ||
+ this.Alignment == ContentAlignment.MiddleLeft ||
+ this.Alignment == ContentAlignment.TopLeft)
+ {
+ imagePosition.X = this.cellPosition.X;
+ }
+ else if(this.Alignment == ContentAlignment.BottomRight ||
+ this.Alignment == ContentAlignment.MiddleRight ||
+ this.Alignment == ContentAlignment.TopRight)
+ {
+ imagePosition.X = this.cellPosition.Right - imagePosition.Width;
+ }
+
+ if(this.Alignment == ContentAlignment.BottomCenter ||
+ this.Alignment == ContentAlignment.BottomLeft ||
+ this.Alignment == ContentAlignment.BottomRight)
+ {
+ imagePosition.Y = this.cellPosition.Bottom - imagePosition.Height;
+ }
+ else if(this.Alignment == ContentAlignment.TopCenter ||
+ this.Alignment == ContentAlignment.TopLeft ||
+ this.Alignment == ContentAlignment.TopRight)
+ {
+ imagePosition.Y = this.cellPosition.Y;
+ }
+
+ // Set image transparent color
+ System.Drawing.Imaging.ImageAttributes imageAttributes = new System.Drawing.Imaging.ImageAttributes();
+ if(this.ImageTransparentColor != Color.Empty)
+ {
+ imageAttributes.SetColorKey(this.ImageTransparentColor, this.ImageTransparentColor, System.Drawing.Imaging.ColorAdjustType.Default);
+ }
+
+ // Increase quality of image scaling
+ SmoothingMode oldSmoothingMode = chartGraph.SmoothingMode;
+ CompositingQuality oldCompositingQuality = chartGraph.Graphics.CompositingQuality;
+ InterpolationMode oldInterpolationMode = chartGraph.Graphics.InterpolationMode;
+ chartGraph.SmoothingMode = SmoothingMode.AntiAlias;
+ chartGraph.Graphics.CompositingQuality = CompositingQuality.HighQuality;
+ chartGraph.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
+
+ // Draw image
+ chartGraph.DrawImage(
+ image,
+ imagePosition,
+ 0,
+ 0,
+ image.Width,
+ image.Height,
+ GraphicsUnit.Pixel,
+ imageAttributes);
+
+ // Restore graphics settings
+ chartGraph.SmoothingMode = oldSmoothingMode;
+ chartGraph.Graphics.CompositingQuality = oldCompositingQuality;
+ chartGraph.Graphics.InterpolationMode = oldInterpolationMode;
+ }
+ }
+
+ /// <summary>
+ /// Paint a series symbol in the cell.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics</param>
+ /// <param name="singleWCharacterSize">Size of the 'W' character in auto-fit font.</param>
+ private void PaintCellSeriesSymbol(
+ ChartGraphics chartGraph,
+ SizeF singleWCharacterSize)
+ {
+ //Cache legend item
+ LegendItem legendItem = this.LegendItem;
+
+ // Calculate cell position
+ Rectangle seriesMarkerPosition = this.cellPosition;
+
+ // Adjust cell size using image symbol size specified
+ if(this.SeriesSymbolSize.Width >= 0)
+ {
+ int newWidth = (int)(this.SeriesSymbolSize.Width * singleWCharacterSize.Width / 100f);
+ if(newWidth > this.cellPosition.Width)
+ {
+ newWidth = this.cellPosition.Width;
+ }
+ seriesMarkerPosition.Width = newWidth;
+ }
+ if(this.SeriesSymbolSize.Height >= 0)
+ {
+ int newHeight = (int)(this.SeriesSymbolSize.Height * singleWCharacterSize.Height / 100f);
+ if(newHeight > this.cellPosition.Height)
+ {
+ newHeight = this.cellPosition.Height;
+ }
+ seriesMarkerPosition.Height = newHeight;
+ }
+
+ // Check for empty size
+ if(seriesMarkerPosition.Height <= 0 || seriesMarkerPosition.Width <= 0)
+ {
+ return;
+ }
+
+ // Get symbol location
+ seriesMarkerPosition.X = (int)((this.cellPosition.X + this.cellPosition.Width/2f) - seriesMarkerPosition.Width/2f);
+ seriesMarkerPosition.Y = (int)((this.cellPosition.Y + this.cellPosition.Height/2f) - seriesMarkerPosition.Height/2f);
+
+ // Adjust image location based on the cell content alignment
+ if(this.Alignment == ContentAlignment.BottomLeft ||
+ this.Alignment == ContentAlignment.MiddleLeft ||
+ this.Alignment == ContentAlignment.TopLeft)
+ {
+ seriesMarkerPosition.X = this.cellPosition.X;
+ }
+ else if(this.Alignment == ContentAlignment.BottomRight ||
+ this.Alignment == ContentAlignment.MiddleRight ||
+ this.Alignment == ContentAlignment.TopRight)
+ {
+ seriesMarkerPosition.X = this.cellPosition.Right - seriesMarkerPosition.Width;
+ }
+
+ if(this.Alignment == ContentAlignment.BottomCenter ||
+ this.Alignment == ContentAlignment.BottomLeft ||
+ this.Alignment == ContentAlignment.BottomRight)
+ {
+ seriesMarkerPosition.Y = this.cellPosition.Bottom - seriesMarkerPosition.Height;
+ }
+ else if(this.Alignment == ContentAlignment.TopCenter ||
+ this.Alignment == ContentAlignment.TopLeft ||
+ this.Alignment == ContentAlignment.TopRight)
+ {
+ seriesMarkerPosition.Y = this.cellPosition.Y;
+ }
+
+ // Start Svg Selection mode
+ chartGraph.StartHotRegion( this.GetCellUrl(), this.GetCellToolTip() );
+
+ // Draw legend item image
+ if(legendItem.Image.Length > 0)
+ {
+ // Get image size
+ Rectangle imageScale = Rectangle.Empty;
+ System.Drawing.Image image = this.Common.ImageLoader.LoadImage(legendItem.Image);
+
+ if (image != null)
+ {
+ SizeF imageSize = new SizeF();
+
+ ImageLoader.GetAdjustedImageSize(image, chartGraph.Graphics, ref imageSize);
+
+ imageScale.Width = (int)imageSize.Width;
+ imageScale.Height = (int)imageSize.Height;
+
+ // Make sure image size fits into the drawing rectangle
+ float scaleValue = 1f;
+ if (imageScale.Height > seriesMarkerPosition.Height)
+ {
+ scaleValue = (float)imageScale.Height / (float)seriesMarkerPosition.Height;
+ }
+ if (imageScale.Width > seriesMarkerPosition.Width)
+ {
+ scaleValue = Math.Max(scaleValue, (float)imageScale.Width / (float)seriesMarkerPosition.Width);
+ }
+
+ // Scale image size
+ imageScale.Height = (int)(imageScale.Height / scaleValue);
+ imageScale.Width = (int)(imageScale.Width / scaleValue);
+
+ imageScale.X = (int)((seriesMarkerPosition.X + seriesMarkerPosition.Width / 2f) - imageScale.Width / 2f);
+ imageScale.Y = (int)((seriesMarkerPosition.Y + seriesMarkerPosition.Height / 2f) - imageScale.Height / 2f);
+
+ // Set image transparent color
+ System.Drawing.Imaging.ImageAttributes imageAttributes = new System.Drawing.Imaging.ImageAttributes();
+ if (legendItem.BackImageTransparentColor != Color.Empty)
+ {
+ imageAttributes.SetColorKey(legendItem.BackImageTransparentColor, legendItem.BackImageTransparentColor, System.Drawing.Imaging.ColorAdjustType.Default);
+ }
+
+ // Draw image
+ chartGraph.DrawImage(
+ image,
+ imageScale,
+ 0,
+ 0,
+ image.Width,
+ image.Height,
+ GraphicsUnit.Pixel,
+ imageAttributes);
+ }
+ }
+
+ else
+ {
+ int maxShadowOffset = (int)Math.Round((3 * chartGraph.Graphics.DpiX) / 96);
+ int maxBorderWidth = (int)Math.Round((3 * chartGraph.Graphics.DpiX) / 96);
+
+ if(legendItem.ImageStyle == LegendImageStyle.Rectangle)
+ {
+ int maxBorderWidthRect = (int)Math.Round((2 * chartGraph.Graphics.DpiX) / 96);
+
+ // Draw series rectangle
+ chartGraph.FillRectangleRel(
+ chartGraph.GetRelativeRectangle(seriesMarkerPosition),
+ legendItem.Color,
+ legendItem.BackHatchStyle,
+ legendItem.Image,
+ legendItem.backImageWrapMode,
+ legendItem.BackImageTransparentColor,
+ legendItem.backImageAlign,
+ legendItem.backGradientStyle,
+ legendItem.backSecondaryColor,
+ legendItem.borderColor,
+ (legendItem.BorderWidth > maxBorderWidthRect) ? maxBorderWidthRect : legendItem.BorderWidth,
+ legendItem.BorderDashStyle,
+ legendItem.ShadowColor,
+ (legendItem.ShadowOffset > maxShadowOffset) ? maxShadowOffset : legendItem.ShadowOffset,
+ PenAlignment.Inset);
+ }
+ if(legendItem.ImageStyle == LegendImageStyle.Line)
+ {
+ // Prepare line coordinates
+ Point point1 = new Point();
+ point1.X = seriesMarkerPosition.X;
+ point1.Y = (int)(seriesMarkerPosition.Y + seriesMarkerPosition.Height/2F);
+ Point point2 = new Point();
+ point2.Y = point1.Y;
+ point2.X = seriesMarkerPosition.Right;
+
+ // Disable antialiasing
+ SmoothingMode oldMode = chartGraph.SmoothingMode;
+ chartGraph.SmoothingMode = SmoothingMode.None;
+
+ // Draw line
+ chartGraph.DrawLineRel(
+ legendItem.Color,
+ (legendItem.borderWidth > maxBorderWidth) ? maxBorderWidth : legendItem.borderWidth,
+ legendItem.borderDashStyle,
+ chartGraph.GetRelativePoint(point1),
+ chartGraph.GetRelativePoint(point2),
+ legendItem.shadowColor,
+ (legendItem.shadowOffset > maxShadowOffset) ? maxShadowOffset : legendItem.shadowOffset);
+
+ // Restore antialiasing mode
+ chartGraph.SmoothingMode = oldMode;
+ }
+
+ // Draw symbol (for line also)
+ if(legendItem.ImageStyle == LegendImageStyle.Marker ||
+ legendItem.ImageStyle == LegendImageStyle.Line)
+ {
+ MarkerStyle markerStyle = legendItem.markerStyle;
+ if(legendItem.style == LegendImageStyle.Marker)
+ {
+ markerStyle = (legendItem.markerStyle == MarkerStyle.None) ?
+ MarkerStyle.Circle : legendItem.markerStyle;
+ }
+
+ if(markerStyle != MarkerStyle.None ||
+ legendItem.markerImage.Length > 0)
+ {
+ // Calculate marker size
+ int markerSize = (int)Math.Min(seriesMarkerPosition.Width, seriesMarkerPosition.Height);
+ markerSize = (int)Math.Min(legendItem.markerSize, (legendItem.style == LegendImageStyle.Line) ? 2f*(markerSize/3f) : markerSize);
+
+ // Reduce marker size to fit border
+ int markerBorderWidth = (legendItem.MarkerBorderWidth > maxBorderWidth) ? maxBorderWidth : legendItem.MarkerBorderWidth;
+ if(markerBorderWidth > 0)
+ {
+ markerSize -= markerBorderWidth;
+ if(markerSize < 1)
+ {
+ markerSize = 1;
+ }
+ }
+
+ // Draw marker
+ Point point = new Point();
+ point.X = (int)(seriesMarkerPosition.X + seriesMarkerPosition.Width/2f);
+ point.Y = (int)(seriesMarkerPosition.Y + seriesMarkerPosition.Height/2f);
+
+ // Calculate image scale
+ Rectangle imageScale = Rectangle.Empty;
+ if(legendItem.markerImage.Length > 0)
+ {
+ // Get image size
+ System.Drawing.Image image = this.Common.ImageLoader.LoadImage(legendItem.markerImage);
+
+ SizeF imageSize = new SizeF();
+
+ ImageLoader.GetAdjustedImageSize(image, chartGraph.Graphics, ref imageSize);
+
+ imageScale.Width = (int)imageSize.Width;
+ imageScale.Height = (int)imageSize.Height;
+
+ // Make sure image size fits into the drawing rectangle
+ float scaleValue = 1f;
+ if(imageScale.Height > seriesMarkerPosition.Height)
+ {
+ scaleValue = (float)imageScale.Height / (float)seriesMarkerPosition.Height;
+ }
+ if(imageScale.Width > seriesMarkerPosition.Width)
+ {
+ scaleValue = Math.Max(scaleValue, (float)imageScale.Width / (float)seriesMarkerPosition.Width);
+ }
+
+ // Scale image size
+ imageScale.Height = (int)(imageScale.Height / scaleValue);
+ imageScale.Width = (int)(imageScale.Width / scaleValue);
+ }
+
+ // Adjust marker position so that it always drawn on pixel
+ // boundary.
+ PointF pointF = new PointF(point.X, point.Y);
+ if( (markerSize%2) != 0.0 )
+ {
+ pointF.X -= 0.5f;
+ pointF.Y -= 0.5f;
+ }
+
+ // Draw marker if it's not image
+ chartGraph.DrawMarkerRel(
+ chartGraph.GetRelativePoint(pointF),
+ markerStyle,
+ markerSize,
+ (legendItem.markerColor == Color.Empty) ? legendItem.Color : legendItem.markerColor,
+ (legendItem.markerBorderColor == Color.Empty) ? legendItem.borderColor : legendItem.markerBorderColor,
+ markerBorderWidth,
+ legendItem.markerImage,
+ legendItem.markerImageTransparentColor,
+ (legendItem.shadowOffset > maxShadowOffset) ? maxShadowOffset : legendItem.shadowOffset,
+ legendItem.shadowColor,
+ imageScale);
+ }
+ }
+ }
+
+ // End Svg Selection mode
+ chartGraph.EndHotRegion( );
+ }
+
+ #endregion // Cell Painting Methods
+
+ #region IDisposable Members
+
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ if (_fontCache != null)
+ {
+ _fontCache.Dispose();
+ _fontCache = null;
+ }
+ }
+ base.Dispose(disposing);
+ }
+
+
+ #endregion
+ }
+
+ /// <summary>
+ /// The Margins class represents the margins for various chart elements.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeMargins_Margins"),
+ TypeConverter(typeof(MarginExpandableObjectConverter)),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class Margins
+ {
+ #region Fields
+
+ // Top margin
+ private int _top = 0;
+
+ // Bottom margin
+ private int _bottom = 0;
+
+ // Left margin
+ private int _left = 0;
+
+ // Right margin
+ private int _right = 0;
+
+#if Microsoft_CONTROL
+
+ // Reference to common chart elements which allows to invalidate
+ // chart when one of the properties is changed.
+ internal CommonElements Common = null;
+
+#endif // Microsoft_CONTROL
+
+ #endregion // Fields
+
+ #region Constructor
+
+ /// <summary>
+ /// Margins constructor.
+ /// </summary>
+ public Margins()
+ {
+ }
+
+ /// <summary>
+ /// Margins constructor.
+ /// </summary>
+ /// <param name="top">Top margin.</param>
+ /// <param name="bottom">Bottom margin.</param>
+ /// <param name="left">Left margin.</param>
+ /// <param name="right">Right margin.</param>
+ public Margins(int top, int bottom, int left, int right)
+ {
+ this._top = top;
+ this._bottom = bottom;
+ this._left = left;
+ this._right = right;
+ }
+
+ #endregion // Constructor
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets the top margin.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(0),
+ SRDescription("DescriptionAttributeMargins_Top"),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ NotifyParentPropertyAttribute(true),
+ ]
+ public int Top
+ {
+ get
+ {
+ return this._top;
+ }
+ set
+ {
+ if(value < 0)
+ {
+ throw (new ArgumentException(SR.ExceptionMarginTopIsNegative, "value"));
+ }
+ this._top = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the bottom margin.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(0),
+ SRDescription("DescriptionAttributeMargins_Bottom"),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ NotifyParentPropertyAttribute(true),
+ ]
+ public int Bottom
+ {
+ get
+ {
+ return this._bottom;
+ }
+ set
+ {
+ if(value < 0)
+ {
+ throw (new ArgumentException(SR.ExceptionMarginBottomIsNegative, "value"));
+ }
+ this._bottom = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the left margin.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(0),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ SRDescription("DescriptionAttributeMargins_Left"),
+ NotifyParentPropertyAttribute(true),
+ ]
+ public int Left
+ {
+ get
+ {
+ return this._left;
+ }
+ set
+ {
+ if(value < 0)
+ {
+ throw (new ArgumentException(SR.ExceptionMarginLeftIsNegative, "value"));
+ }
+ this._left = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the right margin.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(0),
+ SRDescription("DescriptionAttributeMargins_Right"),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ NotifyParentPropertyAttribute(true),
+ ]
+ public int Right
+ {
+ get
+ {
+ return this._right;
+ }
+ set
+ {
+ if(value < 0)
+ {
+ throw (new ArgumentException(SR.ExceptionMarginRightIsNegative, "value"));
+ }
+ this._right = value;
+ this.Invalidate();
+ }
+ }
+
+ #endregion // Properties
+
+ #region Methods
+
+ /// <summary>
+ /// Convert margins object to string.
+ /// </summary>
+ /// <returns>A string that represents the margins object.</returns>
+ [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
+ public override string ToString()
+ {
+ return string.Format(
+ CultureInfo.InvariantCulture,
+ "{0:D}, {1:D}, {2:D}, {3:D}",
+ this.Top,
+ this.Bottom,
+ this.Left,
+ this.Right);
+ }
+
+ /// <summary>
+ /// Determines whether the specified Object is equal to the current Object.
+ /// </summary>
+ /// <param name="obj">
+ /// The Object to compare with the current Object.
+ /// </param>
+ /// <returns>
+ /// True if the specified Object is equal to the current Object; otherwise, false.
+ /// </returns>
+ [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
+ public override bool Equals(object obj)
+ {
+ Margins margins = obj as Margins;
+ if(margins != null)
+ {
+ if(this.Top == margins.Top &&
+ this.Bottom == margins.Bottom &&
+ this.Left == margins.Left &&
+ this.Right == margins.Right)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// Gets object hash code.
+ /// </summary>
+ /// <returns>Margins object hash value.</returns>
+ [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
+ public override int GetHashCode()
+ {
+ return this.Top.GetHashCode() + this.Bottom.GetHashCode() + this.Left.GetHashCode() + this.Right.GetHashCode();
+ }
+
+ /// <summary>
+ /// Checks if there is no margin.
+ /// </summary>
+ /// <returns>
+ /// <b>True</b> if all margins values are zeros.
+ /// </returns>
+ public bool IsEmpty()
+ {
+ return (this.Top == 0 && this.Bottom == 0 && this.Left == 0 && this.Right ==0);
+ }
+
+ /// <summary>
+ /// Converts Margins class to RectangleF class.
+ /// </summary>
+ /// <returns>A RectangleF class that contains the values of the margins.</returns>
+ public RectangleF ToRectangleF()
+ {
+ return new RectangleF(this.Left, this.Top, this.Right, this.Bottom);
+ }
+
+ /// <summary>
+ /// Invalidates chart.
+ /// </summary>
+ private void Invalidate()
+ {
+#if Microsoft_CONTROL
+ if(this.Common != null && this.Common.Chart != null)
+ {
+ this.Common.Chart.Invalidate();
+ }
+#endif // Microsoft_CONTROL
+ }
+
+ #endregion // Methods
+ }
+
+ /// <summary>
+ /// <b>LegendCellCollection</b> is a strongly typed collection of LegendCell objects.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeLegendCellCollection_LegendCellCollection"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class LegendCellCollection : ChartNamedElementCollection<LegendCell>
+ {
+
+ #region Constructors
+
+ /// <summary>
+ /// LegendCellCollection constructor.
+ /// </summary>
+ /// <remarks>
+ /// This constructor is for internal use and should not be part of documentation.
+ /// </remarks>
+ /// <param name="parent">Legend item this collection belongs to.</param>
+ internal LegendCellCollection(LegendItem parent) : base (parent)
+ {
+ }
+
+ #endregion
+
+ #region Methods
+ /// <summary>
+ /// Adds a cell to the end of the collection.
+ /// </summary>
+ /// <param name="cellType">
+ /// A <see cref="LegendCellType"/> value representing the cell type.
+ /// </param>
+ /// <param name="text">
+ /// A <b>string</b> value representing cell text or image name depending
+ /// on the <b>cellType</b> parameter.
+ /// </param>
+ /// <param name="alignment">
+ /// A <see cref="ContentAlignment"/> value representing cell content alignment.
+ /// </param>
+ /// <returns>
+ /// Index of the newly added object.
+ /// </returns>
+ public int Add(LegendCellType cellType, string text, ContentAlignment alignment)
+ {
+ Add(new LegendCell(cellType, text, alignment));
+ return Count - 1;
+ }
+
+ /// <summary>
+ /// Inserts a cell into the collection.
+ /// </summary>
+ /// <param name="index">
+ /// Index to insert the object at.
+ /// </param>
+ /// <param name="cellType">
+ /// A <see cref="LegendCellType"/> value representing the cell type.
+ /// </param>
+ /// <param name="text">
+ /// A <b>string</b> value representing cell text or image name depending
+ /// on the <b>cellType</b> parameter.
+ /// </param>
+ /// <param name="alignment">
+ /// A <see cref="ContentAlignment"/> value representing cell content alignment.
+ /// </param>
+ public void Insert(int index, LegendCellType cellType, string text, ContentAlignment alignment)
+ {
+ this.Insert(index, new LegendCell(cellType, text, alignment));
+ }
+
+ #endregion
+
+ }
+
+ /// <summary>
+ /// The <b>LegendCellColumnCollection</b> class is a strongly typed collection
+ /// of LegendCellColumn objects.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeLegendCellColumnCollection_LegendCellColumnCollection"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class LegendCellColumnCollection : ChartNamedElementCollection<LegendCellColumn>
+ {
+
+ #region Construction and Initialization
+
+ /// <summary>
+ /// LegendCellColumnCollection constructor.
+ /// </summary>
+ /// <remarks>
+ /// This constructor is for internal use and should not be part of documentation.
+ /// </remarks>
+ /// <param name="legend">
+ /// Chart legend which this collection belongs to.
+ /// </param>
+ internal LegendCellColumnCollection(Legend legend)
+ : base(legend)
+ {
+ }
+
+ #endregion // Construction and Initialization
+
+ #region IDisposable Members
+
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ //Free managed resources
+ foreach (LegendCellColumn item in this)
+ {
+ item.Dispose();
+ }
+ this.ClearItems();
+ }
+ base.Dispose(disposing);
+ }
+
+
+ #endregion
+ }
+
+}
+
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Matrix3D.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Matrix3D.cs
new file mode 100644
index 00000000000..04caadda682
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Matrix3D.cs
@@ -0,0 +1,1222 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: Matrix3D.cs
+//
+// Namespace: DataVisualization.Charting
+//
+// Classes: Matrix3D
+//
+// Purpose: Matrix3D class is used during the 3D drawings to
+// transform plotting area 3D coordinates into the 2D
+// projection coordinates based on rotation and
+// perspective settings.
+//
+// Reviewed: AG - Dec 4, 2002
+// AG - Microsoft 14, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Drawing.Text;
+using System.Drawing.Imaging;
+using System.ComponentModel;
+using System.Collections;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+
+#else
+ //using System.Web.UI.DataVisualization.Charting.Utilities;
+ //using System.Web.UI.DataVisualization.Charting.Borders3D;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ /// <summary>
+ /// This class is responsible for all 3D coordinates transformations: Translation,
+ /// Rotation, Scale, Perspective and RightAngle Projection. Translation
+ /// and rotation are stored in composite matrix (mainMatrix), and scaling,
+ /// projection and non-composite translation are stored in private fields.
+ /// Matrix is initialized with Chart Area 3D cube, which is invisible boundary
+ /// cube of 3D Chart area. The matrix has to be initialized every time
+ /// when angles, position or perspective parameters are changed. Method
+ /// TransformPoints will apply 3D Transformation on points using
+ /// Initialization values: Main matrix and other initialization values.
+ /// </summary>
+ internal class Matrix3D
+ {
+ #region Enumerations
+
+ /// <summary>
+ /// 3D Axis used for rotation
+ /// </summary>
+ private enum RotationAxis
+ {
+ /// <summary>
+ /// Rotation around X axis.
+ /// </summary>
+ X,
+
+ /// <summary>
+ /// Rotation around Y axis.
+ /// </summary>
+ Y,
+
+ /// <summary>
+ /// Rotation around Z axis.
+ /// </summary>
+ Z
+ }
+
+ #endregion // Enumerations
+
+ #region Fields
+
+ /// <summary>
+ /// Composite matrix.
+ /// </summary>
+ private float [][] _mainMatrix;
+
+ /// <summary>
+ /// Default translation for chart area cube ( without composition ).
+ /// </summary>
+ private float _translateX;
+
+ /// <summary>
+ /// Default translation for chart area cube ( without composition ).
+ /// </summary>
+ private float _translateY;
+
+ /// <summary>
+ /// Default translation for chart area cube ( without composition ).
+ /// </summary>
+ private float _translateZ;
+
+ /// <summary>
+ /// The value, which is used to rescale chart area.
+ /// </summary>
+ private float _scale;
+
+ /// <summary>
+ /// The value used for Isometric Shift.
+ /// </summary>
+ private float _shiftX;
+
+ /// <summary>
+ /// The value used for Isometric Shift.
+ /// </summary>
+ private float _shiftY;
+
+ /// <summary>
+ /// Perspective value.
+ /// </summary>
+ internal float _perspective;
+
+ /// <summary>
+ /// Isometric projection.
+ /// </summary>
+ private bool _rightAngleAxis;
+
+ /// <summary>
+ /// The value, which is used for perspective.
+ /// </summary>
+ private float _perspectiveFactor = float.NaN;
+
+ /// <summary>
+ /// The value, which is used to set projection plane.
+ /// </summary>
+ private float _perspectiveZ;
+
+ /// <summary>
+ /// X Angle.
+ /// </summary>
+ private float _angleX;
+
+ /// <summary>
+ /// Y Angle.
+ /// </summary>
+ private float _angleY;
+
+ /// <summary>
+ /// Private fields used for lighting
+ /// </summary>
+ Point3D [] _lightVectors = new Point3D[7];
+
+ /// <summary>
+ /// LightStyle Style
+ /// </summary>
+ LightStyle _lightStyle;
+
+ #endregion // Fields
+
+ #region Properties
+
+ /// <summary>
+ /// Gets the X Angle.
+ /// </summary>
+ internal float AngleX
+ {
+ get { return _angleX; }
+ }
+
+ /// <summary>
+ /// Gets the Y Angle.
+ /// </summary>
+ internal float AngleY
+ {
+ get { return _angleY; }
+ }
+
+ /// <summary>
+ /// Get perspective value.
+ /// </summary>
+ internal float Perspective
+ {
+ get { return _perspective; }
+ }
+
+ #endregion // Properties
+
+ #region Internal and Public Methods
+
+ /// <summary>
+ /// Constructor for Matrix 3D
+ /// </summary>
+ public Matrix3D()
+ {
+ }
+
+ /// <summary>
+ /// Checks if 3D matrix was initialized.
+ /// </summary>
+ /// <returns>True if matrix was initialized.</returns>
+ public bool IsInitialized()
+ {
+ return (this._mainMatrix != null);
+ }
+
+ /// <summary>
+ /// Initialize Matrix 3D. This method calculates how much a chart area
+ /// cube has to be resized to fit Inner Plotting Area rectangle. Order
+ /// of operation is following: Translation for X and Y axes, Rotation
+ /// by X-axis, Rotation by Y-axis and same scaling for all axes. All
+ /// other elements, which belongs to this chart area cube (Data points,
+ /// grid lines etc.) has to follow same order. Translation and rotation
+ /// form composite matrix mainMatrix. Scale has to be allied separately.
+ /// </summary>
+ /// <param name="innerPlotRectangle">Inner Plotting Area position. Chart area cube has to be inside this rectangle</param>
+ /// <param name="depth">Depth of chart area cube</param>
+ /// <param name="angleX">Angle of rotation by X axis.</param>
+ /// <param name="angleY">Angle of rotation by Y axis.</param>
+ /// <param name="perspective">Perspective in percentages</param>
+ /// <param name="rightAngleAxis">Right angle flag.</param>
+ internal void Initialize(
+ RectangleF innerPlotRectangle,
+ float depth,
+ float angleX,
+ float angleY,
+ float perspective,
+ bool rightAngleAxis )
+ {
+ // Initialization for mainMatrix
+ Reset();
+
+ // Remember non-composite translation
+ _translateX = innerPlotRectangle.X+innerPlotRectangle.Width/2;
+ _translateY = innerPlotRectangle.Y+innerPlotRectangle.Height/2;
+ _translateZ = depth / 2F;
+ float width = innerPlotRectangle.Width;
+ float height = innerPlotRectangle.Height;
+ this._perspective = perspective;
+ this._rightAngleAxis = rightAngleAxis;
+
+ // Remember Angles
+ this._angleX = angleX;
+ this._angleY = angleY;
+
+ // Change Degrees to radians.
+ angleX = angleX / 180F * (float)Math.PI;
+ angleY = angleY / 180F * (float)Math.PI;
+
+ // Set points for 3D Bar which represents 3D Chart Area Cube.
+ Point3D [] points = Set3DBarPoints( width, height, depth );
+
+ // Translate Chart Area Cube WITH CENTER OF ROTATION - COMPOSITE TRANSLATION.
+ Translate( _translateX, _translateY, 0 );
+
+ // Non Isometric projection
+ if( !rightAngleAxis )
+ {
+ // Rotate Chart Area Cube by X axis.
+ Rotate( angleX, RotationAxis.X );
+
+ // Rotate Chart Area Cube by Y axis.
+ Rotate( angleY, RotationAxis.Y );
+ }
+ else
+ {
+ if( this._angleY >= 45 )
+ {
+ // Rotate Chart Area Cube by Y axis.
+ Rotate( Math.PI / 2, RotationAxis.Y );
+ }
+ else if( this._angleY <= -45 )
+ {
+ // Rotate Chart Area Cube by Y axis.
+ Rotate( -Math.PI / 2, RotationAxis.Y );
+ }
+ }
+
+ // Apply composed transformation ( Translation and rotation ).
+ GetValues( points );
+
+ float maxZ = float.MinValue;
+
+ if( perspective != 0F || rightAngleAxis )
+ {
+ // Find projection plane
+ foreach( Point3D point in points )
+ {
+ if( point.Z > maxZ )
+ maxZ = point.Z;
+ }
+
+ // Set Projection plane
+ _perspectiveZ = maxZ;
+ }
+
+ if( perspective != 0F )
+ {
+ _perspectiveFactor = perspective / 2000F;
+
+ // Apply perspective
+ ApplyPerspective( points );
+ }
+
+ // Isometric projection is active
+ if( rightAngleAxis )
+ {
+ RightAngleProjection( points );
+
+ float minX = 0F;
+ float minY = 0F;
+ float maxX = 0F;
+ float maxY = 0F;
+
+ // Point loop
+ foreach( Point3D point in points )
+ {
+ if( point.X - _translateX < 0F && Math.Abs( point.X - _translateX ) > minX )
+ minX = Math.Abs( point.X - _translateX );
+
+ if( point.X - _translateX >=0F && Math.Abs( point.X - _translateX ) > maxX )
+ maxX = Math.Abs( point.X - _translateX );
+
+ if( point.Y - _translateY < 0F && Math.Abs( point.Y - _translateY ) > minY )
+ minY = Math.Abs( point.Y - _translateY );
+
+ if( point.Y - _translateY >=0F && Math.Abs( point.Y - _translateY ) > maxY )
+ maxY = Math.Abs( point.Y - _translateY );
+ }
+
+ _shiftX = (maxX - minX)/2F;
+ _shiftY = (maxY - minY)/2F;
+ RightAngleShift( points );
+ }
+
+ // This code searches for value, which will be used for scaling.
+ float maxXScale = float.MinValue;
+ float maxYScale = float.MinValue;
+
+ foreach( Point3D point in points )
+ {
+ // Find maximum relative distance for X axis.
+ // Relative distance is (distance from the center of plotting area
+ // position) / (distance from the edge of rectangle to
+ // the center of the rectangle).
+ if( maxXScale < Math.Abs(point.X - _translateX) / width * 2 )
+ maxXScale = Math.Abs(point.X - _translateX) / width * 2;
+
+ // Find maximum relative distance for Y axis.
+ if( maxYScale < Math.Abs(point.Y - _translateY) / height * 2 )
+ maxYScale = Math.Abs(point.Y - _translateY) / height * 2;
+ }
+
+ // Remember scale factor
+ _scale = (maxYScale > maxXScale ) ? maxYScale : maxXScale;
+
+ // Apply scaling
+ Scale( points );
+
+ }
+
+ /// <summary>
+ /// Apply transformations on array od 3D Points. Order of operation is
+ /// following: Translation ( Set coordinate system for 0:100 to -50:50
+ /// Center of rotation is always 0), Composite Translation for X and Y
+ /// axes ( Moving center of rotation ), Rotation by X-axis, Rotation
+ /// by Y-axis, perspective and same scaling for all axes.
+ /// </summary>
+ /// <param name="points">3D Points array.</param>
+ public void TransformPoints( Point3D[] points )
+ {
+ TransformPoints( points, true );
+ }
+#if RS_DEADCODE
+ /// <summary>
+ /// This Method returns scale factor
+ /// </summary>
+ /// <returns></returns>
+ internal float GetScale()
+ {
+ return scale;
+ }
+#endif //RS_DEADCODE
+ #endregion // Internal and Public Methods
+
+ #region Private Methods
+
+ /// <summary>
+ /// Apply transformations on array od 3D Points. Order of operation is
+ /// following: Translation ( Set coordinate system for 0:100 to -50:50
+ /// Center of rotation is always 0), Composite Translation for X and Y
+ /// axes ( Moving center of rotation ), Rotation by X-axis, Rotation
+ /// by Y-axis, perspective and same scaling for all axes.
+ /// </summary>
+ /// <param name="points">3D Points array.</param>
+ /// <param name="withPerspective">Applay Perspective</param>
+ private void TransformPoints( Point3D[] points, bool withPerspective )
+ {
+ // Matrix is not initialized.
+ if( _mainMatrix == null )
+ {
+ throw new InvalidOperationException(SR.ExceptionMatrix3DNotinitialized);
+ }
+
+ // Translate point. CENTER OF ROTATION is 0 and that center is in
+ // the middle of chart area 3D CUBE. Translate method cannot
+ // be used because composite translation WILL MOVE
+ // CENTER OF ROTATION.
+ foreach( Point3D point in points )
+ {
+ point.X -= _translateX;
+ point.Y -= _translateY;
+ point.Z -= _translateZ;
+ }
+
+ // Transform points using composite mainMatrix. (Translation of points together with
+ // Center of rotation and rotations by X and Y axes).
+ GetValues( points );
+
+ // Apply perspective
+ if( _perspective != 0F && withPerspective )
+ {
+ ApplyPerspective( points );
+ }
+
+ // RightAngle Projection
+ if( _rightAngleAxis )
+ {
+ RightAngleProjection( points );
+ RightAngleShift( points );
+ }
+
+ // Scales data points. Scaling has to be performed SEPARATELY from
+ // composite matrix. If scale is used with composite matrix after
+ // rotation, scaling will deform object.
+ Scale( points );
+ }
+
+ /// <summary>
+ /// This method adjusts a position of 3D Chart Area cube. This
+ /// method will translate chart for better use of the inner
+ /// plotting area. Center of rotation is shifted for
+ /// right Angle projection.
+ /// </summary>
+ /// <param name="points">3D Points array.</param>
+ private void RightAngleShift( Point3D [] points )
+ {
+ foreach( Point3D point in points )
+ {
+ point.X = point.X - _shiftX;
+ point.Y = point.Y - _shiftY;
+ }
+ }
+
+ /// <summary>
+ /// Method used to calculate right Angle projection.
+ /// </summary>
+ /// <param name="points">3D points array.</param>
+ private void RightAngleProjection( Point3D [] points )
+ {
+ float coorectionAngle = 45F;
+
+ float xFactor = this._angleX / 45;
+
+ float yFactor;
+
+ if( this._angleY >= 45 )
+ {
+ yFactor = (this._angleY - 90) / coorectionAngle;
+ }
+ else if ( this._angleY <= -45 )
+ {
+ yFactor = ( this._angleY + 90 ) / coorectionAngle;
+ }
+ else
+ {
+ yFactor = this._angleY / coorectionAngle;
+ }
+
+ // Projection formula
+ // perspectiveZ - Position of perspective plain.
+ // Perspective Factor - Intensity of projection.
+ foreach( Point3D point in points )
+ {
+ point.X = point.X + ( _perspectiveZ - point.Z ) * yFactor;
+ point.Y = point.Y - ( _perspectiveZ - point.Z ) * xFactor;
+ }
+ }
+
+ /// <summary>
+ /// Method is used for Planar Geometric projection.
+ /// </summary>
+ /// <param name="points">3D Points array.</param>
+ private void ApplyPerspective( Point3D [] points )
+ {
+ // Projection formula
+ // perspectiveZ - Position of perspective plain.
+ // perspectiveFactor - Intensity of projection.
+ foreach( Point3D point in points )
+ {
+ point.X = _translateX + (point.X - _translateX) / ( 1 + (_perspectiveZ - point.Z) * _perspectiveFactor);
+ point.Y = _translateY + (point.Y - _translateY) / ( 1 + (_perspectiveZ - point.Z) * _perspectiveFactor);
+ }
+ }
+
+ /// <summary>
+ /// Scales data points. Scaling has to be performed SEPARATELY from
+ /// composite matrix. If scale is used with composite matrix after
+ /// rotation, scaling will deform object.
+ /// </summary>
+ /// <param name="points">3D Points array.</param>
+ private void Scale( Point3D [] points )
+ {
+ foreach( Point3D point in points )
+ {
+ point.X = _translateX + (point.X - _translateX) / _scale;
+ point.Y = _translateY + (point.Y - _translateY) / _scale;
+ }
+ }
+
+ /// <summary>
+ /// Prepend to this Matrix object a translation. This method is used
+ /// only if CENTER OF ROTATION HAS TO BE MOVED.
+ /// </summary>
+ /// <param name="dx">Translate in x axis direction.</param>
+ /// <param name="dy">Translate in y axis direction.</param>
+ /// <param name="dz">Translate in z axis direction.</param>
+ private void Translate( float dx, float dy, float dz )
+ {
+ float [][] translationMatrix = new float[4][];
+ translationMatrix[0] = new float[4];
+ translationMatrix[1] = new float[4];
+ translationMatrix[2] = new float[4];
+ translationMatrix[3] = new float[4];
+
+ // Matrix initialization
+ // Row loop
+ for( int row = 0; row < 4; row ++ )
+ {
+ // Column loop
+ for( int column = 0; column < 4; column ++ )
+ {
+ // For initialization: Diagonal matrix elements are equal to one
+ // and all other elements are equal to zero.
+ if( row == column )
+ {
+ translationMatrix[row][column] = 1F;
+ }
+ else
+ {
+ translationMatrix[row][column] = 0F;
+ }
+ }
+ }
+
+ // Set translation values to the matrix
+ translationMatrix[0][3] = dx;
+ translationMatrix[1][3] = dy;
+ translationMatrix[2][3] = dz;
+
+ // Translate main Matrix
+ Multiply( translationMatrix, MatrixOrder.Prepend, true );
+
+ }
+
+ /// <summary>
+ /// This method initialize and set default values for mainMatrix ( there is no rotation and translation )
+ /// </summary>
+ private void Reset()
+ {
+ // First element is row and second element is column !!!
+ _mainMatrix = new float[4][];
+ _mainMatrix[0] = new float[4];
+ _mainMatrix[1] = new float[4];
+ _mainMatrix[2] = new float[4];
+ _mainMatrix[3] = new float[4];
+
+ // Matrix initialization
+ // Row loop
+ for( int row = 0; row < 4; row ++ )
+ {
+ // Column loop
+ for( int column = 0; column < 4; column ++ )
+ {
+ // For initialization: Diagonal matrix elements are equal to one
+ // and all other elements are equal to zero.
+ if( row == column )
+ {
+ _mainMatrix[row][column] = 1F;
+ }
+ else
+ {
+ _mainMatrix[row][column] = 0F;
+ }
+ }
+ }
+ }
+
+
+ /// <summary>
+ /// Multiplies this Matrix object by the matrix specified in the
+ /// matrix parameter, and in the order specified in the order parameter.
+ /// </summary>
+ /// <param name="mulMatrix">The Matrix object by which this Matrix object is to be multiplied.</param>
+ /// <param name="order">The MatrixOrder enumeration that represents the order of the multiplication. If the specified order is MatrixOrder.Prepend, this Matrix object is multiplied by the specified matrix in a prepended order. If the specified order is MatrixOrder.Append, this Matrix object is multiplied by the specified matrix in an appended order.</param>
+ /// <param name="setMainMatrix">Set main matrix to be result of multiplication</param>
+ /// <returns>Matrix multiplication result.</returns>
+ private float[][] Multiply( float [][] mulMatrix, MatrixOrder order, bool setMainMatrix )
+ {
+ // A matrix which is result of matrix multiplication
+ // of mulMatrix and mainMatrix
+ float [][] resultMatrix = new float[4][];
+ resultMatrix[0] = new float[4];
+ resultMatrix[1] = new float[4];
+ resultMatrix[2] = new float[4];
+ resultMatrix[3] = new float[4];
+
+ // Row loop
+ for( int row = 0; row < 4; row ++ )
+ {
+ // Column loop
+ for( int column = 0; column < 4; column ++ )
+ {
+ // Initialize element
+ resultMatrix[row][column ] = 0F;
+ for( int sumIndx = 0; sumIndx < 4; sumIndx ++ )
+ {
+ // Find matrix element
+ if( order == MatrixOrder.Prepend )
+ {
+ // Order of matrix multiplication
+ resultMatrix[row][column ] += _mainMatrix[row][sumIndx ] * mulMatrix[sumIndx][column];
+ }
+ else
+ {
+ // Order of matrix multiplication
+ resultMatrix[row][column] += mulMatrix[row][sumIndx] * _mainMatrix[sumIndx][column];
+ }
+ }
+ }
+ }
+
+ // Set result matrix to be main matrix
+ if( setMainMatrix )
+ {
+ _mainMatrix = resultMatrix;
+ }
+
+ return resultMatrix;
+ }
+
+
+ /// <summary>
+ /// Multiplies this Matrix object by the Vector specified in the
+ /// vector parameter.
+ /// </summary>
+ /// <param name="mulVector">The vector object by which this Matrix object is to be multiplied.</param>
+ /// <param name="resultVector">Vector which is result of matrix and vector multiplication.</param>
+ private void MultiplyVector( float [] mulVector, ref float [] resultVector )
+ {
+ // Row loop
+ for( int row = 0; row < 3; row ++ )
+ {
+ // Initialize element
+ resultVector[ row ] = 0F;
+
+ // Column loop
+ for( int column = 0; column < 4; column ++ )
+ {
+ // Find matrix element
+ resultVector[ row ] += _mainMatrix[row][column] * mulVector[ column ];
+ }
+ }
+ }
+
+ /// <summary>
+ /// Prepend to this Matrix object a clockwise rotation, around the axis and by the specified angle.
+ /// </summary>
+ /// <param name="angle">Angle to rotate</param>
+ /// <param name="axis">Axis used for rotation</param>
+ private void Rotate( double angle, RotationAxis axis )
+ {
+ float [][] rotationMatrix = new float[4][];
+ rotationMatrix[0] = new float[4];
+ rotationMatrix[1] = new float[4];
+ rotationMatrix[2] = new float[4];
+ rotationMatrix[3] = new float[4];
+
+ // Change angle direction
+ angle = -1F * angle;
+
+ // Matrix initialization
+ // Row loop
+ for( int row = 0; row < 4; row ++ )
+ {
+ // Column loop
+ for( int column = 0; column < 4; column ++ )
+ {
+ // For initialization: Diagonal matrix elements are equal to one
+ // and all other elements are equal to zero.
+ if( row == column )
+ {
+ rotationMatrix[row][column] = 1F;
+ }
+ else
+ {
+ rotationMatrix[row][column] = 0F;
+ }
+ }
+ }
+
+ // Rotation about axis
+ switch( axis )
+ {
+ // Rotation about X axis
+ case RotationAxis.X:
+ rotationMatrix[1][1] = (float)Math.Cos( angle );
+ rotationMatrix[1][2] = (float)-Math.Sin( angle );
+ rotationMatrix[2][1] = (float)Math.Sin( angle );
+ rotationMatrix[2][2] = (float)Math.Cos( angle );
+ break;
+
+ // Rotation about Y axis
+ case RotationAxis.Y:
+ rotationMatrix[0][0] = (float)Math.Cos( angle );
+ rotationMatrix[0][2] = (float)Math.Sin( angle );
+ rotationMatrix[2][0] = (float)-Math.Sin( angle );
+ rotationMatrix[2][2] = (float)Math.Cos( angle );
+ break;
+
+ // Rotation about Z axis
+ case RotationAxis.Z:
+ rotationMatrix[0][0] = (float)Math.Cos( angle );
+ rotationMatrix[0][1] = (float)-Math.Sin( angle );
+ rotationMatrix[1][0] = (float)Math.Sin( angle );
+ rotationMatrix[1][1] = (float)Math.Cos( angle );
+ break;
+
+ }
+
+ // Rotate Main matrix
+ Multiply( rotationMatrix, MatrixOrder.Prepend, true );
+
+ }
+
+ /// <summary>
+ /// Returns transformed x and y values from x, y and z values
+ /// and composed main matrix values (All rotations,
+ /// translations and scaling).
+ /// </summary>
+ /// <param name="points">Array of 3D points.</param>
+ private void GetValues( Point3D [] points )
+ {
+ // Create one dimensional matrix (vector)
+ float [] inputVector = new float[4];
+
+ // A vector which is result of matrix and vector multiplication
+ float [] resultVector = new float[4];
+
+ foreach( Point3D point in points )
+ {
+ // Fill input vector with x, y and z coordinates
+ inputVector[0] = point.X;
+ inputVector[1] = point.Y;
+ inputVector[2] = point.Z;
+ inputVector[3] = 1;
+
+ // Apply 3D transformations.
+ MultiplyVector( inputVector, ref resultVector );
+
+ // Return x and y coordinates.
+ point.X = resultVector[0];
+ point.Y = resultVector[1];
+ point.Z = resultVector[2];
+ }
+ }
+
+
+ /// <summary>
+ /// Set points for 3D Bar which represents 3D Chart Area.
+ /// </summary>
+ /// <param name="dx">Width of the bar 3D.</param>
+ /// <param name="dy">Height of the bar 3D.</param>
+ /// <param name="dz">Depth of the bar 3D.</param>
+ /// <returns>Collection of Points 3D.</returns>
+ private Point3D [] Set3DBarPoints( float dx, float dy, float dz )
+ {
+ Point3D [] points = new Point3D[8];
+
+ // ********************************************
+ // 3D Bar side: Front
+ // ********************************************
+ points[0] = new Point3D(-dx/2, -dy/2, dz/2);
+ points[1] = new Point3D(dx/2, -dy/2, dz/2);
+ points[2] = new Point3D(dx/2, dy/2, dz/2);
+ points[3] = new Point3D(-dx/2, dy/2, dz/2);
+
+ // ********************************************
+ // 3D Bar side: Back
+ // ********************************************
+ points[4] = new Point3D(-dx/2, -dy/2, -dz/2);
+ points[5] = new Point3D(dx/2, -dy/2, -dz/2);
+ points[6] = new Point3D(dx/2, dy/2, -dz/2);
+ points[7] = new Point3D(-dx/2, dy/2, -dz/2);
+
+ return points;
+ }
+
+ #endregion // Private Methods
+
+ #region Lighting Methods
+
+ /// <summary>
+ /// Initial Lighting. Use matrix transformation only once
+ /// for Normal vectors.
+ /// </summary>
+ /// <param name="lightStyle">LightStyle Style</param>
+ internal void InitLight( LightStyle lightStyle )
+ {
+ // Set LightStyle Style
+ this._lightStyle = lightStyle;
+
+ // Center of rotation
+ _lightVectors[0] = new Point3D( 0F, 0F, 0F );
+
+ // Front side normal Vector.
+ _lightVectors[1] = new Point3D( 0F, 0F, 1F );
+
+ // Back side normal Vector.
+ _lightVectors[2] = new Point3D( 0F, 0F, -1F );
+
+ // Left side normal Vector.
+ _lightVectors[3] = new Point3D( -1F, 0F, 0F );
+
+ // Right side normal Vector.
+ _lightVectors[4] = new Point3D( 1F, 0F, 0F );
+
+ // Top side normal Vector.
+ _lightVectors[5] = new Point3D( 0F, -1F, 0F );
+
+ // Bottom side normal Vector.
+ _lightVectors[6] = new Point3D( 0F, 1F, 0F );
+
+ // Apply matrix transformations
+ TransformPoints( _lightVectors, false );
+
+ // ********************************************************
+ // LightStyle Vector and normal vectors have to have same center.
+ // Shift Normal vectors.
+ // ********************************************************
+
+ // Front Side shift
+ _lightVectors[1].X -= _lightVectors[0].X;
+ _lightVectors[1].Y -= _lightVectors[0].Y;
+ _lightVectors[1].Z -= _lightVectors[0].Z;
+
+ // Back Side shift
+ _lightVectors[2].X -= _lightVectors[0].X;
+ _lightVectors[2].Y -= _lightVectors[0].Y;
+ _lightVectors[2].Z -= _lightVectors[0].Z;
+
+ // Left Side shift
+ _lightVectors[3].X -= _lightVectors[0].X;
+ _lightVectors[3].Y -= _lightVectors[0].Y;
+ _lightVectors[3].Z -= _lightVectors[0].Z;
+
+ // Right Side shift
+ _lightVectors[4].X -= _lightVectors[0].X;
+ _lightVectors[4].Y -= _lightVectors[0].Y;
+ _lightVectors[4].Z -= _lightVectors[0].Z;
+
+ // Top Side shift
+ _lightVectors[5].X -= _lightVectors[0].X;
+ _lightVectors[5].Y -= _lightVectors[0].Y;
+ _lightVectors[5].Z -= _lightVectors[0].Z;
+
+ // Bottom Side shift
+ _lightVectors[6].X -= _lightVectors[0].X;
+ _lightVectors[6].Y -= _lightVectors[0].Y;
+ _lightVectors[6].Z -= _lightVectors[0].Z;
+
+ }
+
+ /// <summary>
+ /// Return intensity of lightStyle for 3D Cube. There are tree types of lights: None,
+ /// Simplistic and Realistic. None Style have same lightStyle intensity on
+ /// all polygons. Normal vector doesn’t have influence on this type
+ /// of lighting. Simplistic style have lightStyle source, which is
+ /// rotated together with scene. Realistic lighting have fixed lightStyle
+ /// source and intensity of lightStyle is change when scene is rotated.
+ /// </summary>
+ /// <param name="surfaceColor">Color used for polygons without lighting</param>
+ /// <param name="front">Color corrected with intensity of lightStyle for Front side of the 3D Rectangle</param>
+ /// <param name="back">Color corrected with intensity of lightStyle for Back side of the 3D Rectangle</param>
+ /// <param name="left">Color corrected with intensity of lightStyle for Left side of the 3D Rectangle</param>
+ /// <param name="right">Color corrected with intensity of lightStyle for Right side of the 3D Rectangle</param>
+ /// <param name="top">Color corrected with intensity of lightStyle for Top side of the 3D Rectangle</param>
+ /// <param name="bottom">Color corrected with intensity of lightStyle for Bottom side of the 3D Rectangle</param>
+ internal void GetLight( Color surfaceColor, out Color front, out Color back, out Color left, out Color right, out Color top, out Color bottom )
+ {
+ switch( _lightStyle )
+ {
+ // LightStyle style is None
+ case LightStyle.None:
+ {
+ front = surfaceColor;
+ left = surfaceColor;
+ top = surfaceColor;
+ back = surfaceColor;
+ right = surfaceColor;
+ bottom = surfaceColor;
+ break;
+ }
+ // LightStyle style is Simplistic
+ case LightStyle.Simplistic:
+ {
+ front = surfaceColor;
+ left = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, 0.25);
+ top = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, 0.15);
+ back = surfaceColor;
+ right = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, 0.25);
+ bottom = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, 0.15);
+ break;
+ }
+ // LightStyle style is Realistic
+ default:
+ {
+
+ // For Right Axis angle Realistic lightStyle should be different
+ if( _rightAngleAxis )
+ {
+ // LightStyle source Vector
+ Point3D lightSource = new Point3D( 0F, 0F, -1F );
+ Point3D [] rightPRpoints = new Point3D[1];
+ rightPRpoints[0] = lightSource;
+ RightAngleProjection(rightPRpoints);
+
+ // ******************************************************************
+ // Color correction. Angle between Normal vector of polygon and
+ // vector of lightStyle source is used.
+ // ******************************************************************
+ if( this._angleY >= 45 || this._angleY <= -45 )
+ {
+ front = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, GetAngle(lightSource,_lightVectors[1])/Math.PI );
+
+ back = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, GetAngle(lightSource,_lightVectors[2])/Math.PI );
+
+ left = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, 0 );
+
+ right = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, 0 );
+ }
+ else
+ {
+ front = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, 0 );
+
+ back = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, 1 );
+
+ left = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, GetAngle(lightSource,_lightVectors[3])/Math.PI );
+
+ right = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, GetAngle(lightSource,_lightVectors[4])/Math.PI );
+ }
+
+ top = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, GetAngle(lightSource,_lightVectors[5])/Math.PI );
+
+ bottom = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, GetAngle(lightSource,_lightVectors[6])/Math.PI );
+ }
+ else
+ {
+ // LightStyle source Vector
+ Point3D lightSource = new Point3D( 0F, 0F, 1F );
+
+ // ******************************************************************
+ // Color correction. Angle between Normal vector of polygon and
+ // vector of lightStyle source is used.
+ // ******************************************************************
+ front = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,_lightVectors[1])/Math.PI );
+
+ back = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,_lightVectors[2])/Math.PI );
+
+ left = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,_lightVectors[3])/Math.PI );
+
+ right = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,_lightVectors[4])/Math.PI );
+
+ top = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,_lightVectors[5])/Math.PI );
+
+ bottom = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,_lightVectors[6])/Math.PI );
+ }
+
+ break;
+ }
+ }
+ }
+
+
+ /// <summary>
+ /// Return intensity of lightStyle for Polygons. There are tree types of lights: None,
+ /// Simplistic and Realistic. None Style have same lightStyle intensity on
+ /// all polygons. Normal vector doesn’t have influence on this type
+ /// of lighting. Simplistic style have lightStyle source, which is
+ /// rotated together with scene. Realistic lighting have fixed lightStyle
+ /// source and intensity of lightStyle is change when scene is rotated.
+ /// </summary>
+ /// <param name="points">Points of the polygon</param>
+ /// <param name="surfaceColor">Color used for polygons without lighting</param>
+ /// <param name="visiblePolygon">This flag gets information if polygon is visible or not.</param>
+ /// <param name="rotation">Y angle ( from -90 to 90 ) Should be used width switchSeriesOrder to get from -180 to 180</param>
+ /// <param name="surfaceName">Used for lighting of front - back and left - right sides</param>
+ /// <param name="switchSeriesOrder">Used to calculate real y angle</param>
+ /// <returns>Color corrected with intensity of lightStyle</returns>
+ internal Color GetPolygonLight(Point3D[] points, Color surfaceColor, bool visiblePolygon, float rotation, SurfaceNames surfaceName, bool switchSeriesOrder)
+ {
+ // Corrected color
+ Color color = surfaceColor;
+
+ // Direction of lightStyle source
+ Point3D lightSource;
+ lightSource = new Point3D( 0F, 0F, 1F );
+
+ // There are tree different lightStyle styles: None, Simplistic and realistic.
+ switch( _lightStyle )
+ {
+ // LightStyle style is None
+ case LightStyle.None:
+ {
+ // Use same color
+ break;
+ }
+ // LightStyle style is Simplistic
+ case LightStyle.Simplistic:
+ {
+ // Find two vectors of polygon
+ Point3D firstVector = new Point3D();
+ firstVector.X = points[0].X - points[1].X;
+ firstVector.Y = points[0].Y - points[1].Y;
+ firstVector.Z = points[0].Z - points[1].Z;
+
+ Point3D secondVector = new Point3D();
+ secondVector.X = points[2].X - points[1].X;
+ secondVector.Y = points[2].Y - points[1].Y;
+ secondVector.Z = points[2].Z - points[1].Z;
+
+ // Find Normal vector for Polygon
+ Point3D normalVector = new Point3D();
+ normalVector.X = firstVector.Y * secondVector.Z - firstVector.Z * secondVector.Y;
+ normalVector.Y = firstVector.Z * secondVector.X - firstVector.X * secondVector.Z;
+ normalVector.Z = firstVector.X * secondVector.Y - firstVector.Y * secondVector.X;
+
+ // Polygon is left side ( like side of area chart )
+ if( surfaceName == SurfaceNames.Left )
+ {
+ color = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, 0.15);
+ }
+ // Polygon is right side ( like side of area chart )
+ else if( surfaceName == SurfaceNames.Right )
+ {
+ color = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, 0.15);
+ }
+ // Polygon is front side ( like side of area chart )
+ else if( surfaceName == SurfaceNames.Front )
+ {
+ color = surfaceColor;
+ }
+ // Polygon is back side ( like side of area chart )
+ else if( surfaceName == SurfaceNames.Back )
+ {
+ color = surfaceColor;
+ }
+ // Polygon has angle with bottom side ( Line chart or top of area chart )
+ else
+ {
+ float angleLeft;
+ float angleRight;
+
+ // Find angles between lightStyle and polygon for different y-axis angles.
+ if( switchSeriesOrder )
+ {
+ if (rotation > 0 && rotation <= 90)
+ {
+ angleLeft = GetAngle( normalVector, _lightVectors[3] );
+ angleRight = GetAngle( normalVector, _lightVectors[4] );
+ }
+ else
+ {
+ angleLeft = GetAngle( normalVector, _lightVectors[4] );
+ angleRight = GetAngle( normalVector, _lightVectors[3] );
+ }
+ }
+ else
+ {
+ if (rotation > 0 && rotation <= 90)
+ {
+ angleLeft = GetAngle( normalVector, _lightVectors[4] );
+ angleRight = GetAngle( normalVector, _lightVectors[3] );
+ }
+ else
+ {
+ angleLeft = GetAngle( normalVector, _lightVectors[3] );
+ angleRight = GetAngle( normalVector, _lightVectors[4] );
+ }
+ }
+
+ if( Math.Abs( angleLeft - angleRight ) < 0.01 )
+ {
+ color = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, 0.25);
+ }
+ else if( angleLeft < angleRight )
+ {
+ color = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, 0.25);
+ }
+ else
+ {
+ color = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, 0.15);
+ }
+ }
+
+ break;
+ }
+ // LightStyle style is Realistic
+ default:
+ {
+
+ // Find two vectors of polygon
+ Point3D firstVector = new Point3D();
+ firstVector.X = points[0].X - points[1].X;
+ firstVector.Y = points[0].Y - points[1].Y;
+ firstVector.Z = points[0].Z - points[1].Z;
+
+ Point3D secondVector = new Point3D();
+ secondVector.X = points[2].X - points[1].X;
+ secondVector.Y = points[2].Y - points[1].Y;
+ secondVector.Z = points[2].Z - points[1].Z;
+
+ // Find Normal vector for Polygon
+ Point3D normalVector = new Point3D();
+ normalVector.X = firstVector.Y * secondVector.Z - firstVector.Z * secondVector.Y;
+ normalVector.Y = firstVector.Z * secondVector.X - firstVector.X * secondVector.Z;
+ normalVector.Z = firstVector.X * secondVector.Y - firstVector.Y * secondVector.X;
+
+ // ******************************************************************
+ // Color correction. Angle between Normal vector of polygon and
+ // vector of lightStyle source is used.
+ // ******************************************************************
+ if( surfaceName == SurfaceNames.Front )
+ {
+ lightSource.Z *= -1;
+ color = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,_lightVectors[2])/Math.PI );
+ }
+ else if( surfaceName == SurfaceNames.Back )
+ {
+ lightSource.Z *= -1;
+ color = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,_lightVectors[1])/Math.PI );
+ }
+ else
+ {
+ if( visiblePolygon )
+ {
+ lightSource.Z *= -1;
+ }
+
+ color = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,normalVector)/Math.PI );
+ }
+
+ break;
+ }
+ }
+ return color;
+
+ }
+
+ /// <summary>
+ /// This method creates gradien color with brightnes.
+ /// </summary>
+ /// <param name="beginColor">Start color for gradient.</param>
+ /// <param name="position">Position used between Start and end color.</param>
+ /// <returns>Calculated Gradient color from gradient position</returns>
+ private Color GetBrightGradientColor( Color beginColor, double position )
+ {
+ position = position * 2;
+ double brightness = 0.5;
+ if( position < brightness )
+ {
+ return ChartGraphics.GetGradientColor( Color.FromArgb(beginColor.A,255,255,255), beginColor, 1 - brightness + position );
+ }
+ else if( -brightness + position < 1 )
+ {
+ return ChartGraphics.GetGradientColor( beginColor, Color.Black, -brightness + position );
+ }
+ else
+ {
+ return Color.FromArgb( beginColor.A, 0, 0, 0 );
+ }
+ }
+
+ /// <summary>
+ /// Returns the angle between two 3D vectors (a and b);
+ /// </summary>
+ /// <param name="a">First vector</param>
+ /// <param name="b">Second Vector</param>
+ /// <returns>Angle between vectors</returns>
+ private float GetAngle(Point3D a,Point3D b)
+ {
+ double angle;
+
+ angle = Math.Acos( ( a.X * b.X + a.Y * b.Y + a.Z * b.Z ) / ( Math.Sqrt( a.X * a.X + a.Y * a.Y + a.Z * a.Z ) * Math.Sqrt( b.X * b.X + b.Y * b.Y + b.Z * b.Z ) ) );
+
+ return (float)angle;
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/NamedImageCollection.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/NamedImageCollection.cs
new file mode 100644
index 00000000000..01af71e1d5c
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/NamedImageCollection.cs
@@ -0,0 +1,175 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: NamedImagesCollection.cs
+//
+// Namespace: System.Windows.Forms.DataVisualization.Charting.ChartTypes
+//
+// Classes: NamedImagesCollection, NamedImage
+//
+// Purpose: Every property in the chart references images by names.
+// This means that you can set MarkerImage property to a
+// full image path or URL. In case when the user wants to
+// dynamically generate an image or load it from other
+// location (like database) you can use named image
+// collection which is exposed as Images property of the
+// chart. Any Image can be added to this collection with
+// unique name and than this name can be used in all the
+// chart properties which require image names.
+//
+// Reviewed: AG - Microsoft 14, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Collections;
+using System.Drawing;
+using System.ComponentModel;
+using System.Globalization;
+using System.Reflection;
+using System.ComponentModel.Design.Serialization;
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+ namespace System.Web.UI.DataVisualization.Charting
+#endif
+{
+ /// <summary>
+ /// The NamedImagesCollection class is a strongly typed collection of NamedImage
+ /// objects.
+ /// </summary>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class NamedImagesCollection : ChartNamedElementCollection<NamedImage>
+ {
+ #region Constructor
+
+ /// <summary>
+ /// Constructor
+ /// </summary>
+ internal NamedImagesCollection() : base(null)
+ {
+ }
+
+ #endregion
+
+ }
+
+ /// <summary>
+ /// The NamedImage class stores a single Image with its unique name.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeNamedImage_NamedImage"),
+ DefaultProperty("Name"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class NamedImage : ChartNamedElement
+ {
+ #region Fields
+
+ private string _name = string.Empty;
+ private System.Drawing.Image _image = null;
+
+ #endregion
+
+ #region Constructor
+
+ /// <summary>
+ /// NamedImage constructor.
+ /// </summary>
+ public NamedImage()
+ {
+ }
+
+ /// <summary>
+ /// NamedImage constructor.
+ /// </summary>
+ /// <param name="name">Image name.</param>
+ /// <param name="image">Image object.</param>
+ public NamedImage(string name, System.Drawing.Image image)
+ {
+ this._name = name;
+ this._image = image;
+ }
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets the image name.
+ /// </summary>
+ [
+ Bindable(false),
+ SRDescription("DescriptionAttributeNamedImage_Name"),
+ ]
+ public override string Name
+ {
+ get
+ {
+ return _name;
+ }
+ set
+ {
+ _name = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the image object.
+ /// </summary>
+ [
+ Bindable(false),
+ SRDescription("DescriptionAttributeNamedImage_Image"),
+ ]
+ public System.Drawing.Image Image
+ {
+ get
+ {
+ return _image;
+ }
+ set
+ {
+ _image = value;
+ }
+ }
+
+ #endregion
+
+
+ #region IDisposable Members
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ // Dispose managed resources
+ if (_image != null)
+ {
+ _image.Dispose();
+ _image = null;
+ }
+ }
+ base.Dispose(disposing);
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Selection.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Selection.cs
new file mode 100644
index 00000000000..554003cc1a9
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Selection.cs
@@ -0,0 +1,3495 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: Selection.cs
+//
+// Namespace: DataVisualization.Charting
+//
+// Classes: Selection, HitTestResult, ToolTipEventArgs,
+// HotRegionElement, Hot Region
+//
+// Purpose: This file contains methods used for Win Form selection
+//
+// Reviewed: AG - Oct 21
+//
+//===================================================================
+
+
+#region Used namespaces
+
+using System;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Collections;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Diagnostics.CodeAnalysis;
+using System.ComponentModel.Design;
+using System.ComponentModel;
+using System.Text;
+using System.Collections.ObjectModel;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms;
+#endif
+
+
+#endregion
+
+#if Microsoft_CONTROL
+namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+#endif
+{
+ #region Enumerations
+
+
+ // Plase keep the folowing enumaration in chart layering order - ex. ChartArea is under DataPoint
+ /// <summary>
+ /// An enumeration of types of Chart Element.
+ /// </summary>
+ public enum ChartElementType
+ {
+ /// <summary>
+ /// No chart element.
+ /// </summary>
+ Nothing,
+
+ /// <summary>
+ /// The title of a chart.
+ /// </summary>
+ Title,
+
+ /// <summary>
+ /// Plotting area (chart area excluding axes, labels, etc.).
+ /// Also excludes the regions that data points may occupy.
+ /// </summary>
+ PlottingArea,
+
+ /// <summary>
+ /// An Axis object.
+ /// </summary>
+ Axis,
+
+ /// <summary>
+ /// Any major or minor tick mark.
+ /// </summary>
+ TickMarks,
+
+ /// <summary>
+ /// Any major or minor grid line (both vertical or horizontal).
+ /// </summary>
+ Gridlines,
+
+ /// <summary>
+ /// A StripLine object.
+ /// </summary>
+ StripLines,
+
+ /// <summary>
+ /// Axis label Image.
+ /// </summary>
+ AxisLabelImage,
+
+ /// <summary>
+ /// Axis labels
+ /// </summary>
+ AxisLabels,
+
+ /// <summary>
+ /// Axis title
+ /// </summary>
+ AxisTitle,
+
+
+#if Microsoft_CONTROL
+
+ /// <summary>
+ /// A scrollbar tracking thumb.
+ /// </summary>
+ ScrollBarThumbTracker,
+
+ /// <summary>
+ /// A scrollbar small decrement button. A "down arrow"
+ /// button for a vertical scrollbar, or a "left arrow"
+ /// button for a horizontal scroll bar.
+ /// </summary>
+ ScrollBarSmallDecrement,
+
+ /// <summary>
+ /// A scrollbar small increment button. An "up arrow"
+ /// button for a vertical scrollbar, or a "right arrow"
+ /// button for a horizontal scroll bar.
+ /// </summary>
+ ScrollBarSmallIncrement,
+
+ /// <summary>
+ /// The background of a scrollbar that will result in
+ /// a large decrement in the scale view size when clicked.
+ /// This is the background below the thumb for
+ /// a vertical scrollbar, and to the left of
+ /// the thumb for a horizontal scrollbar.
+ /// </summary>
+ ScrollBarLargeDecrement,
+
+ /// <summary>
+ /// The background of a scrollbar that will result in
+ /// a large increment in the scale view size when clicked.
+ /// This is the background above the thumb for
+ /// a vertical scrollbar, and to the right of
+ /// the thumb for a horizontal scrollbar.
+ /// </summary>
+ ScrollBarLargeIncrement,
+
+ /// <summary>
+ /// The zoom reset button of a scrollbar.
+ /// </summary>
+ ScrollBarZoomReset,
+
+#endif // Microsoft_CONTROL
+
+ /// <summary>
+ /// A DataPoint object.
+ /// </summary>
+ DataPoint,
+
+ /// <summary>
+ /// Series data point label.
+ /// </summary>
+ DataPointLabel,
+
+ /// <summary>
+ /// The area inside a Legend object. Does not include
+ /// the space occupied by legend items.
+ /// </summary>
+ LegendArea,
+
+ /// <summary>
+ /// Legend title.
+ /// </summary>
+ LegendTitle,
+
+ /// <summary>
+ /// Legend header.
+ /// </summary>
+ LegendHeader,
+
+ /// <summary>
+ /// A LegendItem object.
+ /// </summary>
+ LegendItem,
+
+
+ /// <summary>
+ /// Chart annotation object.
+ /// </summary>
+ Annotation,
+
+
+ }
+
+ /// <summary>
+ /// Enumeration (Flag) used for processing chart types.
+ /// </summary>
+ [Flags]
+ internal enum ProcessMode
+ {
+ /// <summary>
+ /// Paint mode
+ /// </summary>
+ Paint = 1,
+
+ /// <summary>
+ /// Selection mode. Collection of hot regions has to be created.
+ /// </summary>
+ HotRegions = 2,
+
+ /// <summary>
+ /// Used for image maps
+ /// </summary>
+ ImageMaps = 4
+ }
+
+ #endregion
+
+ /// <summary>
+ /// This class presents item in
+ /// the collection of hot regions.
+ /// </summary>
+ internal class HotRegion : IDisposable
+ {
+ #region Fields
+
+ // Private data members, which store properties values
+ private GraphicsPath _path = null;
+ private bool _relativeCoordinates = true;
+ private RectangleF _boundingRectangle = RectangleF.Empty;
+ private object _selectedObject = null;
+ private int _pointIndex = -1;
+ private string _seriesName = "";
+ private ChartElementType _type = ChartElementType.Nothing;
+
+
+ private object _selectedSubObject = null;
+
+
+ #endregion // Fields
+
+ #region Properties
+
+ /// <summary>
+ /// Region is Graphics path
+ /// </summary>
+ internal GraphicsPath Path
+ {
+ get
+ {
+ return _path;
+ }
+ set
+ {
+ _path = value;
+ }
+ }
+
+ /// <summary>
+ /// Relative coordinates are used
+ /// to define region
+ /// </summary>
+ internal bool RelativeCoordinates
+ {
+ get
+ {
+ return _relativeCoordinates;
+ }
+ set
+ {
+ _relativeCoordinates = value;
+ }
+ }
+
+ /// <summary>
+ /// Bounding Rectangle of an shape
+ /// </summary>
+ internal RectangleF BoundingRectangle
+ {
+ get
+ {
+ return _boundingRectangle;
+ }
+ set
+ {
+ _boundingRectangle = value;
+ }
+ }
+
+ /// <summary>
+ /// Object which is presented with this region
+ /// </summary>
+ internal object SelectedObject
+ {
+ get
+ {
+ return _selectedObject;
+ }
+ set
+ {
+ _selectedObject = value;
+ }
+ }
+
+
+
+ /// <summary>
+ /// Sub-Object which is presented with this region
+ /// </summary>
+ internal object SelectedSubObject
+ {
+ get
+ {
+ return _selectedSubObject;
+ }
+ set
+ {
+ _selectedSubObject = value;
+ }
+ }
+
+
+
+ /// <summary>
+ /// Index of the data point which is presented with this region
+ /// </summary>
+ internal int PointIndex
+ {
+ get
+ {
+ return _pointIndex;
+ }
+ set
+ {
+ _pointIndex = value;
+ }
+ }
+
+ /// <summary>
+ /// Name of the series which is presented with the region
+ /// </summary>
+ internal string SeriesName
+ {
+ get
+ {
+ return _seriesName;
+ }
+ set
+ {
+ _seriesName = value;
+ }
+ }
+
+ /// <summary>
+ /// Chart Element AxisName
+ /// </summary>
+ internal ChartElementType Type
+ {
+ get
+ {
+ return _type;
+ }
+ set
+ {
+ _type = value;
+ }
+ }
+
+ #endregion // Properties
+
+ #region IDisposable members
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected virtual void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ if (_path != null)
+ {
+ _path.Dispose();
+ _path = null;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// </summary>
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
+ /// </summary>
+ /// <returns>
+ /// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
+ /// </returns>
+ public override string ToString()
+ {
+ string objectType = this.SelectedObject != null ? this.SelectedObject.ToString() : "null";
+ if (this.SelectedObject == null && !String.IsNullOrEmpty(this.SeriesName))
+ {
+ objectType = this.SeriesName;
+ }
+ return String.Format(CultureInfo.CurrentCulture, "{0} of {1}", this.Type, objectType);
+ }
+
+ #endregion //Methods
+ }
+
+ /// <summary>
+ /// This class is used to fill and
+ /// manage collection with Hot Regions
+ /// </summary>
+ internal class HotRegionsList : IDisposable
+ {
+ #region Fields
+
+ /// <summary>
+ /// Process chart mode Flag
+ /// </summary>
+ private ProcessMode _processChartMode = ProcessMode.Paint;
+
+ /// <summary>
+ /// Collection with Hor Region Elements
+ /// </summary>
+ private System.Collections.ArrayList _regionList = new ArrayList();
+
+ /// <summary>
+ /// Reference to the common elements object
+ /// </summary>
+ private CommonElements _common = null;
+
+#if Microsoft_CONTROL
+
+ /// <summary>
+ /// True if hit test function is called
+ /// </summary>
+ internal bool hitTestCalled = false;
+
+#endif // Microsoft_CONTROL
+
+ #endregion // Fields
+
+ #region Properties
+
+ /// <summary>
+ /// Flag used for processing chart types. It could
+ /// be Paint, HotRegion or both mode.
+ /// </summary>
+ internal ProcessMode ProcessChartMode
+ {
+ get
+ {
+ return _processChartMode;
+ }
+ set
+ {
+ _processChartMode = value;
+ if(this._common != null)
+ {
+ this._common.processModePaint =
+ (_processChartMode & ProcessMode.Paint ) == ProcessMode.Paint;
+ this._common.processModeRegions =
+ ( _processChartMode & ProcessMode.HotRegions ) == ProcessMode.HotRegions ||
+ ( _processChartMode & ProcessMode.ImageMaps ) == ProcessMode.ImageMaps;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Collection with Hor Region Elements
+ /// </summary>
+ internal ArrayList List
+ {
+ get
+ {
+ return _regionList;
+ }
+ }
+
+ #endregion // Properties
+
+ #region Methods
+
+ /// <summary>
+ /// Constructor
+ /// </summary>
+ /// <param name="common">Reference to the CommonElements</param>
+ internal HotRegionsList( CommonElements common )
+ {
+ this._common = common;
+ }
+
+ /// <summary>
+ /// Add hot region to the collection.
+ /// </summary>
+ /// <param name="rectSize">Rectangle which presents an Hot Region</param>
+ /// <param name="point">Data Point</param>
+ /// <param name="seriesName">Data Series</param>
+ /// <param name="pointIndex">Index of an Data Point in the series</param>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ public void AddHotRegion(
+ RectangleF rectSize,
+ DataPoint point,
+ string seriesName,
+ int pointIndex
+ )
+ {
+
+#if !Microsoft_CONTROL
+ if( ( ProcessChartMode & ProcessMode.ImageMaps ) == ProcessMode.ImageMaps )
+ {
+ if (_common.ChartPicture.IsMapEnabled == true)
+ {
+ if(point.ToolTip.Length > 0 ||
+ point.Url.Length > 0 ||
+ point.MapAreaAttributes.Length > 0 ||
+ point.PostBackValue.Length > 0
+ )
+ {
+ MapArea area = new MapArea(
+ point.ReplaceKeywords(point.ToolTip),
+ point.ReplaceKeywords(point.Url),
+ point.ReplaceKeywords(point.MapAreaAttributes),
+ point.ReplaceKeywords(point.PostBackValue),
+ rectSize,
+ point.Tag);
+ area.IsCustom = false;
+ _common.ChartPicture.MapAreas.Insert(0, area);
+ }
+ }
+ }
+#endif // !Microsoft_CONTROL
+
+ if( ( ProcessChartMode & ProcessMode.HotRegions ) == ProcessMode.HotRegions )
+ {
+ HotRegion region = new HotRegion();
+
+ region.BoundingRectangle = rectSize;
+ region.SeriesName = seriesName;
+ region.PointIndex = pointIndex;
+ region.Type = ChartElementType.DataPoint;
+ region.RelativeCoordinates = true;
+
+
+
+ // Use index of the original data point
+ if(point != null && point.IsCustomPropertySet("OriginalPointIndex"))
+ {
+ region.PointIndex = int.Parse(point["OriginalPointIndex"], CultureInfo.InvariantCulture);
+ }
+
+
+
+ _regionList.Add( region );
+ }
+ }
+
+
+ /// <summary>
+ /// Adds the hot region.
+ /// </summary>
+ /// <param name="path">Bounding GraphicsPath.</param>
+ /// <param name="relativePath">if set to <c>true</c> the is relative path.</param>
+ /// <param name="graph">Chart Graphics Object</param>
+ /// <param name="point">Selected data point</param>
+ /// <param name="seriesName">Name of the series.</param>
+ /// <param name="pointIndex">Index of the point.</param>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "graph")]
+ internal void AddHotRegion(
+ GraphicsPath path,
+ bool relativePath,
+ ChartGraphics graph,
+ DataPoint point,
+ string seriesName,
+ int pointIndex
+ )
+ {
+ if( path == null )
+ {
+ return;
+ }
+#if !Microsoft_CONTROL
+ if( ( ProcessChartMode & ProcessMode.ImageMaps ) == ProcessMode.ImageMaps )
+ {
+ if (_common.ChartPicture.IsMapEnabled == true)
+ {
+ if(point.ToolTip.Length > 0 ||
+ point.Url.Length > 0 ||
+ point.MapAreaAttributes.Length > 0 ||
+ point.PostBackValue.Length > 0
+ )
+ {
+ int prevMapAreaCount = _common.ChartPicture.MapAreas.Count;
+ _common.ChartPicture.MapAreas.InsertPath(
+ 0,
+ point.ReplaceKeywords(point.ToolTip),
+ point.ReplaceKeywords(point.Url),
+ point.ReplaceKeywords(point.MapAreaAttributes),
+ point.ReplaceKeywords(point.PostBackValue),
+ path,
+ !relativePath,
+ graph
+ );
+
+
+ // Set map area type
+ for (int i = 0; i < _common.ChartPicture.MapAreas.Count - prevMapAreaCount; i++)
+ ((IChartMapArea)_common.ChartPicture.MapAreas[i]).Tag = ((IChartMapArea)point).Tag;
+ }
+ }
+ }
+#endif // !Microsoft_CONTROL
+
+ if( ( ProcessChartMode & ProcessMode.HotRegions ) == ProcessMode.HotRegions )
+ {
+
+ HotRegion region = new HotRegion();
+
+ region.SeriesName = seriesName;
+ region.PointIndex = pointIndex;
+ region.Type = ChartElementType.DataPoint;
+ region.Path = (GraphicsPath)path.Clone();
+ region.BoundingRectangle = path.GetBounds();
+ region.RelativeCoordinates = relativePath;
+
+
+
+ // Use index of the original data point
+ if(point != null && point.IsCustomPropertySet("OriginalPointIndex"))
+ {
+ region.PointIndex = int.Parse(point["OriginalPointIndex"], CultureInfo.InvariantCulture);
+ }
+
+
+
+ _regionList.Add( region );
+
+ }
+ }
+
+ /// <summary>
+ /// Adds the hot region.
+ /// </summary>
+ /// <param name="insertIndex">Position where to insert element. Used for image maps only</param>
+ /// <param name="path">Bounding GraphicsPath.</param>
+ /// <param name="relativePath">if set to <c>true</c> the is relative path.</param>
+ /// <param name="graph">Chart Graphics Object</param>
+ /// <param name="point">Selected data point</param>
+ /// <param name="seriesName">Name of the series.</param>
+ /// <param name="pointIndex">Index of the point.</param>
+ [
+ System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "graph"),
+ System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "insertIndex")
+ ]
+ internal void AddHotRegion(
+ int insertIndex,
+ GraphicsPath path,
+ bool relativePath,
+ ChartGraphics graph,
+ DataPoint point,
+ string seriesName,
+ int pointIndex
+ )
+ {
+#if !Microsoft_CONTROL
+ if( ( ProcessChartMode & ProcessMode.ImageMaps ) == ProcessMode.ImageMaps )
+ {
+ if (_common.ChartPicture.IsMapEnabled == true)
+ {
+ if(point.ToolTip.Length > 0 ||
+ point.Url.Length > 0 ||
+ point.MapAreaAttributes.Length > 0 ||
+ point.PostBackValue.Length > 0)
+
+ {
+ int prevMapAreaCount = _common.ChartPicture.MapAreas.Count;
+
+ _common.ChartPicture.MapAreas.InsertPath(
+ insertIndex,
+ point.ReplaceKeywords(point.ToolTip),
+ point.ReplaceKeywords(point.Url),
+ point.ReplaceKeywords(point.MapAreaAttributes),
+ point.ReplaceKeywords(point.PostBackValue),
+ path,
+ !relativePath,
+ graph
+ );
+
+ // Set map area type
+ for (int i = insertIndex; i < _common.ChartPicture.MapAreas.Count - prevMapAreaCount; i++)
+ ((IChartMapArea)_common.ChartPicture.MapAreas[i]).Tag = ((IChartMapArea)point).Tag;
+ }
+ }
+ }
+#endif // !Microsoft_CONTROL
+
+ if( ( ProcessChartMode & ProcessMode.HotRegions ) == ProcessMode.HotRegions )
+ {
+
+ HotRegion region = new HotRegion();
+
+ region.SeriesName = seriesName;
+ region.PointIndex = pointIndex;
+ region.Type = ChartElementType.DataPoint;
+ region.Path = (GraphicsPath)path.Clone();
+ region.BoundingRectangle = path.GetBounds();
+ region.RelativeCoordinates = relativePath;
+
+
+
+ // Use index of the original data point
+ if(point != null && point.IsCustomPropertySet("OriginalPointIndex"))
+ {
+ region.PointIndex = int.Parse(point["OriginalPointIndex"], CultureInfo.InvariantCulture);
+ }
+
+
+
+ _regionList.Add( region );
+
+ }
+ }
+
+ /// <summary>
+ /// Add hot region to the collection.
+ /// </summary>
+ /// <param name="path">Graphics path which presents hot region</param>
+ /// <param name="relativePath">Graphics path uses relative or absolute coordinates</param>
+ /// <param name="coord">Coordinates which defines polygon (Graphics Path). Used for image maps</param>
+ /// <param name="point">Selected data point</param>
+ /// <param name="seriesName">Data Series</param>
+ /// <param name="pointIndex">Index of an Data Point in the series</param>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "coord")]
+ internal void AddHotRegion( GraphicsPath path, bool relativePath, float [] coord, DataPoint point, string seriesName, int pointIndex )
+ {
+
+#if !Microsoft_CONTROL
+ if( ( ProcessChartMode & ProcessMode.ImageMaps ) == ProcessMode.ImageMaps )
+ {
+ if (_common.ChartPicture.IsMapEnabled == true)
+ {
+ if(point.ToolTip.Length > 0 ||
+ point.Url.Length > 0 ||
+ point.MapAreaAttributes.Length > 0 ||
+ point.PostBackValue.Length > 0)
+ {
+ MapArea area = new MapArea(
+ MapAreaShape.Polygon,
+ point.ReplaceKeywords(point.ToolTip),
+ point.ReplaceKeywords(point.Url),
+ point.ReplaceKeywords(point.MapAreaAttributes),
+ point.ReplaceKeywords(point.PostBackValue),
+ coord,
+ point.Tag);
+ area.IsCustom = false;
+ _common.ChartPicture.MapAreas.Insert(0,area);
+
+ }
+ }
+ }
+#endif // !Microsoft_CONTROL
+
+ if( ( ProcessChartMode & ProcessMode.HotRegions ) == ProcessMode.HotRegions )
+ {
+
+ HotRegion region = new HotRegion();
+
+ region.SeriesName = seriesName;
+ region.PointIndex = pointIndex;
+ region.Type = ChartElementType.DataPoint;
+ region.Path = (GraphicsPath)path.Clone();
+ region.BoundingRectangle = path.GetBounds();
+ region.RelativeCoordinates = relativePath;
+
+
+
+ // Use index of the original data point
+ if(point != null && point.IsCustomPropertySet("OriginalPointIndex"))
+ {
+ region.PointIndex = int.Parse(point["OriginalPointIndex"], CultureInfo.InvariantCulture);
+ }
+
+
+
+ _regionList.Add( region );
+
+ }
+
+ }
+
+ /// <summary>
+ /// Add Hot region to the collection.
+ /// </summary>
+ /// <param name="insertIndex">Position where to insert element. Used for image maps only</param>
+ /// <param name="graph">Chart Graphics Object</param>
+ /// <param name="x">x coordinate.</param>
+ /// <param name="y">y coordinate.</param>
+ /// <param name="radius">The radius.</param>
+ /// <param name="point">Selected data point</param>
+ /// <param name="seriesName">Data Series</param>
+ /// <param name="pointIndex">Index of an Data Point in the series</param>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "insertIndex")]
+ internal void AddHotRegion( int insertIndex, ChartGraphics graph, float x, float y, float radius, DataPoint point, string seriesName, int pointIndex )
+ {
+
+#if !Microsoft_CONTROL
+ if( ( ProcessChartMode & ProcessMode.ImageMaps ) == ProcessMode.ImageMaps )
+ {
+ if (_common.ChartPicture.IsMapEnabled == true)
+ {
+ if(point.ToolTip.Length > 0 ||
+ point.Url.Length > 0 ||
+ point.MapAreaAttributes.Length > 0 ||
+ point.PostBackValue.Length > 0 )
+ {
+
+ float[] circCoord = new float[3];
+ circCoord[0] = x;
+ circCoord[1] = y;
+ circCoord[2] = radius;
+
+ MapArea area = new MapArea(
+ MapAreaShape.Circle,
+ point.ReplaceKeywords(point.ToolTip),
+ point.ReplaceKeywords(point.Url),
+ point.ReplaceKeywords(point.MapAreaAttributes),
+ point.ReplaceKeywords(point.PostBackValue),
+ circCoord,
+ point.Tag);
+ area.IsCustom = false;
+ // Insert area
+ _common.ChartPicture.MapAreas.Insert(insertIndex,area);
+
+ }
+ }
+ }
+#endif // !Microsoft_CONTROL
+
+ if( ( ProcessChartMode & ProcessMode.HotRegions ) == ProcessMode.HotRegions )
+ {
+ HotRegion region = new HotRegion();
+
+ PointF circleCenter = graph.GetAbsolutePoint( new PointF( x, y ) );
+ SizeF circleRadius = graph.GetAbsoluteSize( new SizeF( radius, radius ) );
+
+ GraphicsPath path = new GraphicsPath();
+ path.AddEllipse(
+ circleCenter.X - circleRadius.Width,
+ circleCenter.Y - circleRadius.Width,
+ 2 * circleRadius.Width,
+ 2 * circleRadius.Width
+ );
+ region.BoundingRectangle = path.GetBounds();
+ region.SeriesName = seriesName;
+ region.Type = ChartElementType.DataPoint;
+ region.PointIndex = pointIndex;
+ region.Path = path;
+ region.RelativeCoordinates = false;
+
+
+
+ // Use index of the original data point
+ if(point != null && point.IsCustomPropertySet("OriginalPointIndex"))
+ {
+ region.PointIndex = int.Parse(point["OriginalPointIndex"], CultureInfo.InvariantCulture);
+ }
+
+
+
+ _regionList.Add( region );
+ }
+ }
+
+
+ /// <summary>
+ /// Add Hot region to the collection.
+ /// </summary>
+ /// <param name="rectArea">Hot Region rectangle</param>
+ /// <param name="toolTip">Tool Tip Text</param>
+ /// <param name="hRef">HRef string</param>
+ /// <param name="mapAreaAttributes">Map area Attribute string</param>
+ /// <param name="postBackValue">The post back value associated with this item</param>
+ /// <param name="selectedObject">Object which present hot region</param>
+ /// <param name="type">AxisName of the object which present hot region</param>
+ /// <param name="series">Selected series</param>
+ [
+ System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "hRef"),
+ System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "mapAreaAttributes"),
+ System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "postBackValue"),
+ System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "toolTip")
+ ]
+ internal void AddHotRegion( RectangleF rectArea, string toolTip, string hRef, string mapAreaAttributes, string postBackValue, object selectedObject, ChartElementType type, string series )
+ {
+#if !Microsoft_CONTROL
+ if( ( ProcessChartMode & ProcessMode.ImageMaps ) == ProcessMode.ImageMaps )
+ {
+ // Add items to the image map collection
+ if (_common.ChartPicture.IsMapEnabled == true)
+ {
+ if(toolTip.Length > 0 ||
+ hRef.Length > 0 ||
+ mapAreaAttributes.Length > 0 ||
+ postBackValue.Length > 0)
+ {
+ MapArea area = new MapArea(
+ toolTip,
+ hRef,
+ mapAreaAttributes,
+ postBackValue,
+ rectArea,
+ ((IChartMapArea)selectedObject).Tag);
+ area.IsCustom = false;
+ _common.ChartPicture.MapAreas.Add( area);
+ }
+ }
+ }
+#endif // !Microsoft_CONTROL
+
+ if( ( ProcessChartMode & ProcessMode.HotRegions ) == ProcessMode.HotRegions )
+ {
+ HotRegion region = new HotRegion();
+
+ region.BoundingRectangle = rectArea;
+ region.RelativeCoordinates = true;
+ region.Type = type;
+ region.SelectedObject = selectedObject;
+ if(!String.IsNullOrEmpty(series))
+ {
+ region.SeriesName = series;
+ }
+ _regionList.Add( region );
+ }
+ }
+
+
+
+ /// <summary>
+ /// Add Hot region to the collection.
+ /// </summary>
+ /// <param name="rectArea">Hot Region rectangle</param>
+ /// <param name="toolTip">Tool Tip Text</param>
+ /// <param name="hRef">HRef string</param>
+ /// <param name="mapAreaAttributes">Map area Attribute string</param>
+ /// <param name="postBackValue">The post back value associated with this item</param>
+ /// <param name="selectedObject">Object which present hot region</param>
+ /// <param name="selectedSubObject">Sub-Object which present hot region</param>
+ /// <param name="type">AxisName of the object which present hot region</param>
+ /// <param name="series">Selected series</param>
+ [
+ System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "hRef"),
+ System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "mapAreaAttributes"),
+ System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "postBackValue"),
+ System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "toolTip")
+ ]
+ internal void AddHotRegion(
+ RectangleF rectArea,
+ string toolTip,
+ string hRef,
+ string mapAreaAttributes,
+ string postBackValue,
+ object selectedObject,
+ object selectedSubObject,
+ ChartElementType type,
+ string series )
+ {
+#if !Microsoft_CONTROL
+ if( ( ProcessChartMode & ProcessMode.ImageMaps ) == ProcessMode.ImageMaps )
+ {
+ // Add items to the image map collection
+ if (_common.ChartPicture.IsMapEnabled == true)
+ {
+ if(toolTip.Length > 0 ||
+ hRef.Length > 0 ||
+ mapAreaAttributes.Length > 0 ||
+ postBackValue.Length > 0)
+ {
+ MapArea area = new MapArea(
+ toolTip,
+ hRef,
+ mapAreaAttributes,
+ postBackValue,
+ rectArea,
+ ((IChartMapArea)selectedObject).Tag);
+ area.IsCustom = false;
+ _common.ChartPicture.MapAreas.Add( area);
+ }
+ }
+ }
+#endif // !Microsoft_CONTROL
+
+ if( ( ProcessChartMode & ProcessMode.HotRegions ) == ProcessMode.HotRegions )
+ {
+ HotRegion region = new HotRegion();
+
+ region.BoundingRectangle = rectArea;
+ region.RelativeCoordinates = true;
+ region.Type = type;
+ region.SelectedObject = selectedObject;
+ region.SelectedSubObject = selectedSubObject;
+ if(!String.IsNullOrEmpty(series))
+ {
+ region.SeriesName = series;
+ }
+ _regionList.Add( region );
+ }
+ }
+
+
+
+ /// <summary>
+ /// Add Hot region to the collection.
+ /// </summary>
+ /// <param name="graph">Chart Graphics Object</param>
+ /// <param name="path">Graphics path</param>
+ /// <param name="relativePath">Used relative coordinates for graphics path.</param>
+ /// <param name="toolTip">Tool Tip Text</param>
+ /// <param name="hRef">HRef string</param>
+ /// <param name="mapAreaAttributes">Map area Attribute string</param>
+ /// <param name="postBackValue">The post back value associated with this item</param>
+ /// <param name="selectedObject">Object which present hot region</param>
+ /// <param name="type">AxisName of the object which present hot region</param>
+ [
+ System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "graph"),
+ System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "hRef"),
+ System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "mapAreaAttributes"),
+ System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "postBackValue"),
+ System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "toolTip")
+ ]
+ internal void AddHotRegion( ChartGraphics graph, GraphicsPath path, bool relativePath, string toolTip, string hRef, string mapAreaAttributes, string postBackValue, object selectedObject, ChartElementType type )
+ {
+#if !Microsoft_CONTROL
+ if( ( ProcessChartMode & ProcessMode.ImageMaps ) == ProcessMode.ImageMaps )
+ {
+ if (_common.ChartPicture.IsMapEnabled == true)
+ {
+
+ if(toolTip.Length > 0 ||
+ hRef.Length > 0 ||
+ mapAreaAttributes.Length > 0 ||
+ postBackValue.Length > 0)
+ {
+ _common.ChartPicture.MapAreas.InsertPath(
+ 0,
+ toolTip,
+ hRef,
+ mapAreaAttributes,
+ postBackValue,
+ path,
+ !relativePath,
+ graph
+ );
+ }
+ }
+ }
+#endif // !Microsoft_CONTROL
+
+ if( ( ProcessChartMode & ProcessMode.HotRegions ) == ProcessMode.HotRegions )
+ {
+
+ HotRegion region = new HotRegion();
+
+ region.Type = type;
+ region.Path = (GraphicsPath)path.Clone();
+ region.SelectedObject = selectedObject;
+ region.BoundingRectangle = path.GetBounds();
+ region.RelativeCoordinates = relativePath;
+
+ _regionList.Add( region );
+
+ }
+ }
+
+ /// <summary>
+ /// Add Hot region to the collection.
+ /// </summary>
+ /// <param name="rectArea">Hot Region rectangle</param>
+ /// <param name="selectedObject">Object which present hot region</param>
+ /// <param name="type">AxisName of the object which present hot region</param>
+ /// <param name="relativeCoordinates">Coordinates for rectangle are relative</param>
+ internal void AddHotRegion( RectangleF rectArea, object selectedObject, ChartElementType type, bool relativeCoordinates )
+ {
+ this.AddHotRegion( rectArea, selectedObject, type, relativeCoordinates, false );
+ }
+
+ /// <summary>
+ /// Add Hot region to the collection.
+ /// </summary>
+ /// <param name="rectArea">Hot Region rectangle</param>
+ /// <param name="selectedObject">Object which present hot region</param>
+ /// <param name="type">AxisName of the object which present hot region</param>
+ /// <param name="relativeCoordinates">Coordinates for rectangle are relative</param>
+ /// <param name="insertAtBeginning">Insert the hot region at the beginning of the collection</param>
+ internal void AddHotRegion( RectangleF rectArea, object selectedObject, ChartElementType type, bool relativeCoordinates, bool insertAtBeginning )
+ {
+ if( ( ProcessChartMode & ProcessMode.HotRegions ) == ProcessMode.HotRegions )
+ {
+ HotRegion region = new HotRegion();
+
+ region.BoundingRectangle = rectArea;
+ region.RelativeCoordinates = relativeCoordinates;
+ region.Type = type;
+ region.SelectedObject = selectedObject;
+
+ if( insertAtBeginning )
+ {
+ _regionList.Insert( _regionList.Count - 1, region );
+ }
+ else
+ {
+ _regionList.Add( region );
+ }
+ }
+ }
+
+ /// <summary>
+ /// Add Hot region to the collection.
+ /// </summary>
+ /// <param name="path">Graphics path</param>
+ /// <param name="relativePath">Used relative coordinates for graphics path.</param>
+ /// <param name="type">Type of the object which present hot region</param>
+ /// <param name="selectedObject">Object which present hot region</param>
+ internal void AddHotRegion(
+ GraphicsPath path,
+ bool relativePath,
+ ChartElementType type,
+ object selectedObject
+ )
+ {
+ if( ( ProcessChartMode & ProcessMode.HotRegions ) == ProcessMode.HotRegions )
+ {
+
+ HotRegion region = new HotRegion();
+
+ region.SelectedObject = selectedObject;
+ region.Type = type;
+ region.Path = (GraphicsPath)path.Clone();
+ region.BoundingRectangle = path.GetBounds();
+ region.RelativeCoordinates = relativePath;
+
+ _regionList.Add( region );
+
+ }
+ }
+
+ /// <summary>
+ /// This method search for position in Map Areas which is the first
+ /// position after Custom areas.
+ /// </summary>
+ /// <returns>Insert Index</returns>
+ internal int FindInsertIndex()
+ {
+ int insertIndex = 0;
+#if !Microsoft_CONTROL
+ foreach (MapArea mapArea in _common.ChartPicture.MapAreas)
+ {
+ if(!mapArea.IsCustom)
+ {
+ break;
+ }
+ ++insertIndex;
+ }
+#endif // !Microsoft_CONTROL
+
+ return insertIndex;
+ }
+
+ /// <summary>
+ /// Clears this instance.
+ /// </summary>
+ public void Clear()
+ {
+ foreach (HotRegion hotRegion in this._regionList)
+ hotRegion.Dispose();
+
+ this._regionList.Clear();
+ }
+
+ #endregion // Methods
+
+ #region IDisposable members
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected virtual void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ if (this._regionList != null)
+ {
+ foreach (HotRegion hotRegion in this._regionList)
+ hotRegion.Dispose();
+
+ this._regionList.Clear();
+ }
+ }
+ }
+
+ /// <summary>
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// </summary>
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+ #endregion
+
+ }
+
+ /// <summary>
+ /// The HitTestResult class contains the result of the hit test function.
+ /// </summary>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class HitTestResult
+ {
+ #region Fields
+
+ // Private members
+ private object _obj = null;
+ private Series _series = null;
+ private int _dataPoint = -1;
+ private ChartArea _chartArea = null;
+ private Axis _axis = null;
+ private ChartElementType _type = ChartElementType.Nothing;
+ private object _subObject = null;
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets the data series object.
+ /// </summary>
+ public Series Series
+ {
+ get
+ {
+ return _series;
+ }
+ set
+ {
+ _series = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the data point index.
+ /// </summary>
+ public int PointIndex
+ {
+ get
+ {
+ return _dataPoint;
+ }
+ set
+ {
+ _dataPoint = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the chart area object.
+ /// </summary>
+ public ChartArea ChartArea
+ {
+ get
+ {
+ return _chartArea;
+ }
+ set
+ {
+ _chartArea = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the axis object.
+ /// </summary>
+ public Axis Axis
+ {
+ get
+ {
+ return _axis;
+ }
+ set
+ {
+ _axis = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the chart element type.
+ /// </summary>
+ public ChartElementType ChartElementType
+ {
+ get
+ {
+ return _type;
+ }
+ set
+ {
+ _type = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the selected object.
+ /// </summary>
+ public object Object
+ {
+ get
+ {
+ return _obj;
+ }
+ set
+ {
+ _obj = value;
+ }
+ }
+
+
+
+ /// <summary>
+ /// Gets or sets the selected sub object.
+ /// </summary>
+ public object SubObject
+ {
+ get
+ {
+ return _subObject;
+ }
+ set
+ {
+ _subObject = value;
+ }
+ }
+
+ #endregion
+ }
+
+
+ /// <summary>
+ /// This class represents an array of marker points and
+ /// the outline path used for visual object selection in the chart.
+ /// </summary>
+ /// <remarks>
+ /// <see cref="OutlinePath"/> may be null for complex objects or objects with two points or fewer.
+ /// </remarks>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class ChartElementOutline : IDisposable
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ChartElementOutline"/> class.
+ /// </summary>
+ internal ChartElementOutline()
+ {
+ this.Markers = new ReadOnlyCollection<PointF>( new PointF[] {});
+ }
+
+ /// <summary>
+ /// Gets the markers.
+ /// </summary>
+ /// <value>The markers.</value>
+ public ReadOnlyCollection<PointF> Markers { get; internal set; }
+
+ /// <summary>
+ /// Gets or sets the outline path. The result could be null for complex objects and objects with two points or fewer.
+ /// </summary>
+ /// <value>The outline path.</value>
+ public GraphicsPath OutlinePath { get; internal set; }
+
+
+ #region IDisposable Members
+
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected virtual void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ if (this.OutlinePath != null)
+ {
+ this.OutlinePath.Dispose();
+ this.OutlinePath = null;
+ }
+ this.Markers = null;
+ }
+ }
+
+ /// <summary>
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// </summary>
+ [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ #endregion
+ }
+
+
+ /// <summary>
+ /// This class contains methods used for Windows Forms selection.
+ /// </summary>
+ internal class Selection : IServiceProvider
+#if Microsoft_CONTROL
+ , IDisposable
+#endif //Microsoft_CONTROL
+ {
+ #region Fields
+
+ /// <summary>
+ /// The chart service container
+ /// </summary>
+ private IServiceContainer _service = null;
+
+#if Microsoft_CONTROL
+
+ /// <summary>
+ /// Stores the tooltip of the control.
+ /// </summary>
+ private ToolTip _toolTip = new ToolTip();
+
+ /// <summary>
+ /// Used by the tooltip - stores the time when the tooltip is activated.
+ /// </summary>
+ private DateTime _toolTipActivationTime = DateTime.Now;
+
+ /// <summary>
+ /// Stores the last mouse move X and Y coordinates, so we can ignore false calls to
+ /// OnMouseMove generated my the tooltip.
+ /// </summary>
+ private Point _lastMouseMove = new Point(int.MinValue, int.MinValue);
+
+
+ // ToolTips enabled or disabled from series or legend
+ private bool _toolTipsEnabled = false;
+
+ // Tool tips enabled flag checked
+ internal bool enabledChecked = false;
+
+#endif //Microsoft_CONTROL
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="Selection"/> class.
+ /// </summary>
+ /// <param name="service">The service.</param>
+ internal Selection(IServiceContainer service)
+ {
+ this._service = service;
+ this._chartControl = this.ChartControl;
+#if Microsoft_CONTROL
+
+ // Set up the tooltip
+ this._toolTip.Active = true;
+ this._toolTip.AutoPopDelay = 30000; // maximum delay possible
+ this._toolTip.InitialDelay = 500;
+ this._toolTip.ReshowDelay = 50;
+ this._toolTip.ShowAlways = true;
+ this._toolTip.Active = false;
+#endif //Microsoft_CONTROL
+
+ }
+
+#if Microsoft_CONTROL
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ private void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ if (_toolTip != null)
+ {
+ _toolTip.Dispose();
+ _toolTip = null;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// </summary>
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+#endif //Microsoft_CONTROL
+
+ #endregion //Constructors
+
+ #region Properties
+
+ private Chart _chartControl = null;
+ /// <summary>
+ /// Returns the attached chart control
+ /// </summary>
+ internal Chart ChartControl
+ {
+ get
+ {
+ if (this._chartControl == null)
+ {
+ if (this.ChartPicture != null)
+ {
+ this._chartControl = this.ChartPicture.Chart;
+ }
+ }
+ return this._chartControl;
+ }
+ }
+
+ private ChartPicture _chartPicture = null;
+ /// <summary>
+ /// Returns the attached ChartPicture
+ /// </summary>
+ internal ChartPicture ChartPicture
+ {
+ get
+ {
+ if (this._chartPicture == null)
+ {
+ this._chartPicture = ((IServiceProvider)this).GetService(typeof(ChartImage)) as ChartPicture;
+ if (this._chartPicture == null)
+ {
+ this._chartPicture = ((IServiceProvider)this).GetService(typeof(ChartPicture)) as ChartPicture;
+ }
+ }
+ return this._chartPicture;
+ }
+ }
+
+ private Data.DataManager _dataManager = null;
+ /// <summary>
+ /// Gets the chart data manager ( for series access )
+ /// </summary>
+ internal Data.DataManager DataManager
+ {
+ get
+ {
+ if (this._dataManager == null)
+ {
+ this._dataManager = ((IServiceProvider)this).GetService(typeof(Data.DataManager)) as Data.DataManager;
+ }
+ return this._dataManager;
+ }
+ }
+
+ /// <summary>
+ /// Gets the chart ChartGraphics
+ /// </summary>
+ internal ChartGraphics Graph
+ {
+ get
+ {
+ if (this.ChartPicture != null)
+ {
+ return this.ChartPicture.Common.graph;
+ }
+ return null;
+ }
+ }
+
+ #endregion //Private Properties
+
+ #region Methods
+
+ #region Tooltips
+#if Microsoft_CONTROL
+ /// <summary>
+ /// Checks if tooltips are enabled
+ /// </summary>
+ /// <returns>true if tooltips enabled</returns>
+ private bool IsToolTipsEnabled()
+ {
+ // Enabled checked. Don’t check every time series
+ // and data points for tooltips.
+ if( enabledChecked )
+ {
+ return _toolTipsEnabled;
+ }
+
+ enabledChecked = true;
+
+
+
+
+ // Annotations loop
+ foreach( Annotation annotation in _chartControl.Annotations )
+ {
+ // ToolTip empty
+ if( annotation.ToolTip.Length > 0 )
+ {
+ // ToolTips enabled
+ _toolTipsEnabled = true;
+ return true;
+ }
+ }
+
+
+ // Data series loop
+ foreach( Series series in _chartControl.Series )
+ {
+ // Check series tooltips
+ if( series.ToolTip.Length > 0 ||
+ series.LegendToolTip.Length > 0 ||
+ series.LabelToolTip.Length > 0)
+ {
+ // ToolTips enabled
+ _toolTipsEnabled = true;
+ return true;
+ }
+
+
+ // Check if custom properties (Pie collected slice) that create tooltips are used
+ if(series.IsCustomPropertySet(Utilities.CustomPropertyName.CollectedToolTip))
+ {
+ // ToolTips enabled
+ _toolTipsEnabled = true;
+ return true;
+ }
+
+
+ // Check point tooltips only for "non-Fast" chart types
+ if( !series.IsFastChartType() )
+ {
+ // Data point loop
+ foreach( DataPoint point in series.Points )
+ {
+ // ToolTip empty
+ if( point.ToolTip.Length > 0 ||
+ point.LegendToolTip.Length > 0 ||
+ point.LabelToolTip.Length > 0)
+ {
+ // ToolTips enabled
+ _toolTipsEnabled = true;
+ return true;
+ }
+ }
+ }
+ }
+
+ // Legend items loop
+ foreach( Legend legend in _chartControl.Legends )
+ {
+ // Check custom legend items
+ foreach( LegendItem legendItem in legend.CustomItems )
+ {
+ // ToolTip empty
+ if( legendItem.ToolTip.Length > 0 )
+ {
+ _toolTipsEnabled = true;
+ return true;
+ }
+
+
+ // Check all custom cells in the legend item
+ foreach(LegendCell legendCell in legendItem.Cells)
+ {
+ if(legendCell.ToolTip.Length > 0)
+ {
+ _toolTipsEnabled = true;
+ return true;
+ }
+ }
+
+ }
+
+
+ // Iterate through legend columns
+ foreach(LegendCellColumn legendColumn in legend.CellColumns)
+ {
+ if(legendColumn.ToolTip.Length > 0)
+ {
+ _toolTipsEnabled = true;
+ return true;
+ }
+ }
+
+ }
+
+ // Title items loop
+ foreach( Title title in _chartControl.Titles )
+ {
+ // ToolTip empty
+ if( title.ToolTip.Length > 0 )
+ {
+ _toolTipsEnabled = true;
+ return true;
+ }
+ }
+
+ // Chart areas loop
+ foreach( ChartArea area in _chartControl.ChartAreas )
+ {
+
+ // Check if chart area is visible
+ if(area.Visible)
+
+ {
+ // Axis loop
+ foreach(Axis axis in area.Axes)
+ {
+
+ // Check ToolTip
+ if( axis.ToolTip.Length > 0 )
+ {
+ _toolTipsEnabled = true;
+ return true;
+ }
+
+
+ // Strip lines loop
+ foreach(StripLine stripLine in axis.StripLines)
+ {
+ // Check ToolTip
+ if( stripLine.ToolTip.Length > 0 )
+ {
+ _toolTipsEnabled = true;
+ return true;
+ }
+ }
+ // Check custom labels
+ foreach(CustomLabel customLabel in axis.CustomLabels)
+ {
+ if( customLabel.ToolTip.Length > 0 )
+ {
+ _toolTipsEnabled = true;
+ return true;
+ }
+ }
+ }
+ }
+ }
+
+ // ToolTips disabled
+ _toolTipsEnabled = false;
+ return false;
+ }
+
+ [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily",
+ Justification = "Too large of a code change to justify making this change")]
+ internal string EvaluateToolTip(System.Windows.Forms.MouseEventArgs e)
+ {
+ object obj;
+ object subObj;
+ ChartElementType type;
+ int dataPointIndex;
+ string seriesName;
+ string toolTipText = " ";
+
+ HitTestResult hitTest = this.HitTest(e.X, e.Y, true);
+
+ type = hitTest.ChartElementType;
+ dataPointIndex = hitTest.PointIndex;
+ seriesName = hitTest.Series != null ? hitTest.Series.Name : String.Empty;
+ obj = hitTest.Object;
+ subObj = hitTest.SubObject;
+
+
+ // Get tooltips from data points
+ if (type == ChartElementType.DataPoint)
+ {
+ if (_chartControl.Series.IndexOf(seriesName) >= 0 &&
+ dataPointIndex >= 0 &&
+ dataPointIndex < _chartControl.Series[seriesName].Points.Count)
+ {
+ // Take tool tip from data point
+ toolTipText = _chartControl.Series[seriesName].Points[dataPointIndex].ReplaceKeywords(_chartControl.Series[seriesName].Points[dataPointIndex].ToolTip);
+ }
+ else
+ {
+ DataPoint dataPoint = obj as DataPoint;
+ if (dataPoint != null)
+ {
+ // Take tool tip from data point
+ toolTipText = dataPoint.ReplaceKeywords(dataPoint.ToolTip);
+ }
+ }
+ }
+
+
+
+ // Get tooltips from data points
+ if (type == ChartElementType.DataPointLabel)
+ {
+ if (_chartControl.Series.IndexOf(seriesName) >= 0 &&
+ dataPointIndex >= 0 &&
+ dataPointIndex < _chartControl.Series[seriesName].Points.Count)
+ {
+ // Take tool tip from data point
+ toolTipText = _chartControl.Series[seriesName].Points[dataPointIndex].ReplaceKeywords(_chartControl.Series[seriesName].Points[dataPointIndex].LabelToolTip);
+ }
+ }
+
+
+ // Get tooltips from custom label
+ if (type == ChartElementType.AxisLabels &&
+ obj is CustomLabel)
+ {
+ toolTipText = ((CustomLabel)obj).ToolTip;
+ }
+
+
+
+
+ // Get tooltips from data points
+ else if (type == ChartElementType.Annotation && obj != null && obj is Annotation)
+ {
+ // Take tool tip from data point
+ toolTipText = ((Annotation)obj).ReplaceKeywords(((Annotation)obj).ToolTip);
+
+ }
+ // Get tooltips from axis
+ else if (type == ChartElementType.Axis && obj != null && obj is Axis)
+ {
+ // Take tool tip from strip line
+ toolTipText = ((Axis)obj).ToolTip;
+ }
+
+ // Get tooltips from strip lines
+ else if (type == ChartElementType.StripLines && obj != null && obj is StripLine)
+ {
+ // Take tool tip from strip line
+ toolTipText = ((StripLine)obj).ToolTip;
+
+ }
+ // Get tooltips from data points
+ else if (type == ChartElementType.Title && obj != null && obj is Title)
+ {
+ // Take tool tip from data point
+ toolTipText = ((Title)obj).ToolTip;
+
+ } // Get tooltips for legend items
+
+ // Get tooltips for legend items
+ else if (type == ChartElementType.LegendItem)
+ {
+ // Take tool tip from legend item
+ toolTipText = ((LegendItem)obj).ToolTip;
+
+
+ // Check if cell has it's own tooltip
+ LegendCell legendCell = subObj as LegendCell;
+ if (legendCell != null && legendCell.ToolTip.Length > 0)
+ {
+ toolTipText = legendCell.ToolTip;
+ }
+
+
+ // Check if series is associated with legend item
+ if (toolTipText.Length == 0 &&
+ seriesName.Length > 0 &&
+ _chartControl.Series.IndexOf(seriesName) >= 0)
+ {
+ // Take tool tip from data point
+ if (dataPointIndex == -1)
+ {
+ if (seriesName.Length > 0)
+ {
+ // Take tool tip from series
+ toolTipText = _chartControl.Series[seriesName].ReplaceKeywords(_chartControl.Series[seriesName].LegendToolTip);
+ }
+ }
+ else
+ {
+ if (dataPointIndex >= 0 &&
+ dataPointIndex < _chartControl.Series[seriesName].Points.Count)
+ {
+ // Take tool tip from data point
+ toolTipText = _chartControl.Series[seriesName].Points[dataPointIndex].ReplaceKeywords(_chartControl.Series[seriesName].Points[dataPointIndex].LegendToolTip);
+ }
+ }
+ }
+ }
+
+ // Set event arguments
+ ToolTipEventArgs args = new ToolTipEventArgs(e.X, e.Y, toolTipText, hitTest);
+
+ // Event
+ _chartControl.OnGetToolTipText(args);
+
+ return args.Text.Trim();
+
+ }
+
+
+ /// <summary>
+ /// Mouse move event handler.
+ /// </summary>
+ /// <param name="sender">Sender</param>
+ /// <param name="e">Arguments</param>
+ internal void Selection_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
+ {
+
+ // Ignore false calls to OnMouseMove caused by the tootip control.
+ if (e.X == this._lastMouseMove.X && e.Y == this._lastMouseMove.Y)
+ {
+ return;
+ }
+ else
+ {
+ this._lastMouseMove.X = e.X;
+ this._lastMouseMove.Y = e.Y;
+ }
+
+ // Event is not active and tooltip properties are nor set.
+ if (!IsToolTipsEnabled() && !_chartControl.IsToolTipEventUsed())
+ {
+ return;
+ }
+
+ string newToolTipText = this.EvaluateToolTip(e);
+
+ if (!String.IsNullOrEmpty(newToolTipText))
+ {
+ string oldToolTipText = this._toolTip.GetToolTip(this._chartControl);
+ TimeSpan timeSpan = DateTime.Now.Subtract(this._toolTipActivationTime);
+ if (oldToolTipText != newToolTipText || timeSpan.Milliseconds > 600)
+ {
+ // Activate the tooltip
+ this._toolTip.Active = false;
+ this._toolTip.SetToolTip(this._chartControl, newToolTipText);
+ this._toolTip.Active = true;
+ this._toolTipActivationTime = DateTime.Now;
+ }
+ }
+ else
+ {
+ // We do not have a tooltip, so deactivate it
+ this._toolTip.Active = false;
+ this._toolTip.SetToolTip(this._chartControl, string.Empty);
+ }
+ }
+
+#endif //Microsoft_CONTROL
+
+ #endregion //Tooltips
+
+ #region HitTest
+
+
+ /// <summary>
+ /// Call this method to determine the chart element,
+ /// if any, that is located at a point defined by the given X and Y
+ /// coordinates.
+ /// <seealso cref="HitTestResult"/></summary>
+ /// <param name="x">The X coordinate for the point in question.
+ /// Often obtained from a parameter in an event
+ /// (e.g. the X parameter value in the MouseDown event).</param>
+ /// <param name="y">The Y coordinate for the point in question.
+ /// Often obtained from a parameter in an event
+ /// (e.g. the Y parameter value in the MouseDown event).</param>
+ /// <param name="requestedElementTypes">
+ /// An array of type which specify the types
+ /// to test for, on order to filter the result. If omitted checking for
+ /// elementTypes will be ignored and all kind of elementTypes will be
+ /// valid.
+ /// </param>
+ /// <param name="ignoreTransparent">Indicates that transparent
+ /// elements should be ignored.</param>
+ /// <returns>
+ /// A array of <see cref="HitTestResult"/> objects,
+ /// which provides information concerning the chart element
+ /// (if any) that is at the specified location. Result contains at least
+ /// one element, which could be ChartElementType.Nothing.
+ /// The objects in the result are sorted in from top to bottom of
+ /// different layers of control. </returns>
+ /// <remarks>Call this method to determine the gauge element
+ /// (if any) that is located at a specified point. Often this method is used in
+ /// some mouse-related event (e.g. MouseDown)
+ /// to determine what gauge element the end-user clicked on.
+ /// The X and Y mouse coordinates obtained from the
+ /// event parameters are then used for the X and Y parameter
+ /// values of this method call. The returned
+ /// <see cref="HitTestResult"/> object's properties
+ /// can then be used to determine what chart element was clicked on,
+ /// and also provides a reference to the actual object selected (if
+ /// any).</remarks>
+ internal HitTestResult[] HitTest(int x, int y, bool ignoreTransparent, params ChartElementType[] requestedElementTypes)
+ {
+ List<HitTestResult> result = new List<HitTestResult>();
+ ArrayList regionList = this.ChartPicture.Common.HotRegionsList.List;
+
+ if (regionList.Count == 0)
+ {
+ this.ChartPicture.PaintOffScreen();
+ }
+
+ string alowedElements = String.Empty;
+ if (requestedElementTypes.Length > 0)
+ {
+ StringBuilder builder = new StringBuilder();
+ foreach (ChartElementType elementType in requestedElementTypes)
+ {
+ builder.Append(elementType.ToString() + ";");
+ }
+ alowedElements = builder.ToString();
+ }
+
+ float newX;
+ float newY;
+ float relativeX;
+ float relativeY;
+ RectangleF newMouseRect;
+
+ // Find mouse position in relative and absolute coordinates
+ RectangleF mouseRect = new RectangleF(x - 1, y - 1, 2, 2);
+ relativeX = this.Graph.GetRelativePoint(new PointF(x, y)).X;
+ relativeY = this.Graph.GetRelativePoint(new PointF(x, y)).Y;
+ RectangleF relativeMouseRect = this.Graph.GetRelativeRectangle(mouseRect);
+
+ // Try to pass through series object in design time.
+ // The series ussualy contain autogenerated points with short lifetime - during painting;
+ // This hit test result will be used in VS2005 desing time click.
+ for (int index = regionList.Count - 1; index >= 0; index--)
+ {
+ HotRegion region = (HotRegion)regionList[index];
+
+ // Check if only looking for specific chart element type
+ if (!String.IsNullOrEmpty(alowedElements) && alowedElements.IndexOf(region.Type.ToString() + ";", StringComparison.Ordinal) == -1)
+ {
+ continue;
+ }
+
+
+ // Change coordinates if relative path is used
+ if (region.RelativeCoordinates)
+ {
+ newX = relativeX;
+ newY = relativeY;
+ newMouseRect = relativeMouseRect;
+ }
+ else
+ {
+ newX = (float)x;
+ newY = (float)y;
+ newMouseRect = mouseRect;
+ }
+
+
+ // Check if series name and point index are valid
+ if (region.SeriesName.Length > 0 &&
+ (this.ChartControl.Series.IndexOf(region.SeriesName) < 0 || region.PointIndex >= this.ChartControl.Series[region.SeriesName].Points.Count)
+ )
+ {
+ continue;
+ }
+
+ // Check if transparent chart elements should be ignored
+ if (ignoreTransparent && IsElementTransparent(region))
+ {
+ continue;
+ }
+ // Check intersection with bounding rectangle
+ if (region.BoundingRectangle.IntersectsWith(newMouseRect))
+ {
+ bool pointVisible = false;
+
+ if (region.Path != null)
+ {
+ // If there is more then one graphical path split them and create
+ // image maps for every graphical path separately.
+ GraphicsPathIterator iterator = new GraphicsPathIterator(region.Path);
+
+ // There is more then one path.
+ if (iterator.SubpathCount > 1)
+ {
+ GraphicsPath subPath = new GraphicsPath();
+ while (iterator.NextMarker(subPath) > 0 && pointVisible == false)
+ {
+ if (subPath.IsVisible(newX, newY))
+ {
+ pointVisible = true;
+ }
+ subPath.Reset();
+ }
+ }
+
+ // There is only one path
+ else if (region.Path.IsVisible(newX, newY))
+ {
+ pointVisible = true;
+ }
+ }
+ else
+ {
+ // Point is inside bounding rectangle and path is not specified
+ pointVisible = true;
+ }
+
+ // Check if point is inside the hot region
+ if (pointVisible)
+ {
+ HitTestResult hitTestToAdd = this.GetHitTestResult(
+ region.SeriesName,
+ region.PointIndex,
+ region.Type,
+ region.SelectedObject,
+ region.SelectedSubObject
+ );
+
+ int elementIndex = result.FindIndex(
+ delegate(HitTestResult test)
+ {
+ if (
+ (test.ChartElementType == hitTestToAdd.ChartElementType) &&
+ (test.Object == hitTestToAdd.Object) &&
+ (test.SubObject == hitTestToAdd.SubObject) &&
+ (test.Series == hitTestToAdd.Series) &&
+ (test.PointIndex == hitTestToAdd.PointIndex)
+ )
+ {
+ return true;
+ }
+ return false;
+ }
+ );
+
+ if (elementIndex == -1)
+ {
+ result.Add(hitTestToAdd);
+ }
+ }
+ }
+ }
+ if (result.Count == 0)
+ {
+ result.Add(this.GetHitTestResult(String.Empty, 0, ChartElementType.Nothing, null, null));
+ }
+ return result.ToArray();
+ }
+
+ /// <summary>
+ /// This method performs the hit test and returns a HitTestResult objects.
+ /// </summary>
+ /// <param name="x">X coordinate</param>
+ /// <param name="y">Y coordinate</param>
+ /// <returns>Hit test result object</returns>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X and Y are cartesian coordinates and well understood")]
+ internal HitTestResult HitTest(int x, int y)
+ {
+ return this.HitTest(x, y, false, new ChartElementType[] {})[0];
+ }
+
+ /// <summary>
+ /// This method performs the hit test and returns a HitTestResult object.
+ /// </summary>
+ /// <param name="x">X coordinate</param>
+ /// <param name="y">Y coordinate</param>
+ /// <param name="ignoreTransparent">Indicates that transparent elements should be ignored.</param>
+ /// <returns>Hit test result object</returns>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X and Y are cartesian coordinates and well understood")]
+ public HitTestResult HitTest(int x, int y, bool ignoreTransparent)
+ {
+ return this.HitTest(x, y, ignoreTransparent, new ChartElementType[] { })[0];
+ }
+
+ /// <summary>
+ /// This method performs the hit test and returns a HitTestResult object.
+ /// </summary>
+ /// <param name="x">X coordinate</param>
+ /// <param name="y">Y coordinate</param>
+ /// <param name="requestedElement">Only this chart element will be hit tested.</param>
+ /// <returns>Hit test result object</returns>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X and Y are cartesian coordinates and well understood")]
+ public HitTestResult HitTest(int x, int y, ChartElementType requestedElement)
+ {
+ return this.HitTest(x, y, false, requestedElement)[0];
+ }
+
+ /// <summary>
+ /// Checks if chart element associated with hot region has transparent background.
+ /// </summary>
+ /// <param name="region">Element hot region.</param>
+ /// <returns>True if chart element is transparent.</returns>
+ private bool IsElementTransparent(HotRegion region)
+ {
+ bool isTransparent = false;
+
+ if (region.Type == ChartElementType.DataPoint)
+ {
+ if (this.ChartControl != null)
+ {
+ DataPoint dataPoint = region.SelectedObject as DataPoint;
+ if (region.SeriesName.Length > 0)
+ {
+ dataPoint = this.ChartControl.Series[region.SeriesName].Points[region.PointIndex];
+ }
+ if (dataPoint != null && dataPoint.Color == Color.Transparent)
+ {
+ isTransparent = true;
+ }
+ }
+ }
+ else if (region.SelectedObject is Axis)
+ {
+ if (((Axis)region.SelectedObject).LineColor == Color.Transparent)
+ {
+ isTransparent = true;
+ }
+ }
+ else if (region.SelectedObject is ChartArea)
+ {
+ if (((ChartArea)region.SelectedObject).BackColor == Color.Transparent)
+ {
+ isTransparent = true;
+ }
+ }
+ else if (region.SelectedObject is Legend)
+ {
+ if (((Legend)region.SelectedObject).BackColor == Color.Transparent)
+ {
+ isTransparent = true;
+ }
+ }
+ else if (region.SelectedObject is Grid)
+ {
+ if (((Grid)region.SelectedObject).LineColor == Color.Transparent)
+ {
+ isTransparent = true;
+ }
+ }
+ else if (region.SelectedObject is StripLine)
+ {
+ if (((StripLine)region.SelectedObject).BackColor == Color.Transparent)
+ {
+ isTransparent = true;
+ }
+ }
+ else if (region.SelectedObject is TickMark)
+ {
+ if (((TickMark)region.SelectedObject).LineColor == Color.Transparent)
+ {
+ isTransparent = true;
+ }
+ }
+ else if (region.SelectedObject is Title)
+ {
+ Title title = (Title)region.SelectedObject;
+ if ((title.Text.Length == 0 || title.ForeColor == Color.Transparent) &&
+ (title.BackColor == Color.Transparent || title.BackColor.IsEmpty))
+ {
+ isTransparent = true;
+ }
+ }
+
+ return isTransparent;
+ }
+
+ /// <summary>
+ /// Returns Hit Test Result object
+ /// </summary>
+ /// <param name="seriesName">Data series Name</param>
+ /// <param name="pointIndex">Data point index</param>
+ /// <param name="type">Selected Chart element type</param>
+ /// <param name="obj">Selected object</param>
+ /// <param name="subObject">Selected sub object</param>
+ /// <returns>Hit test result object</returns>
+ [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily",
+ Justification = "Too large of a code change to justify making this change")]
+ internal HitTestResult GetHitTestResult(
+ string seriesName,
+ int pointIndex,
+ ChartElementType type,
+ object obj,
+ object subObject)
+ {
+ HitTestResult result = new HitTestResult();
+ Chart chart = this.ChartControl;
+ // If data point is selected convert series
+ // name to series object.
+ if (seriesName.Length > 0)
+ {
+ result.Series = chart.Series[seriesName];
+ }
+
+ // Selected Object
+ result.Object = obj;
+
+ result.SubObject = subObject;
+
+ result.PointIndex = pointIndex;
+ result.ChartElementType = type;
+
+#if Microsoft_CONTROL
+ AxisScrollBar scrollBar;
+#endif // Microsoft_CONTROL
+
+ switch (type)
+ {
+ case ChartElementType.Axis:
+ Axis axis = (Axis)obj;
+ result.Axis = axis;
+ if (axis != null)
+ {
+ result.ChartArea = axis.ChartArea;
+ }
+ break;
+ case ChartElementType.DataPoint:
+ {
+ if (chart.Series.IndexOf(seriesName) >= 0 &&
+ pointIndex < chart.Series[seriesName].Points.Count)
+ {
+ DataPoint dataPoint = chart.Series[seriesName].Points[pointIndex];
+ result.Axis = null;
+ result.ChartArea = chart.ChartAreas[dataPoint.series.ChartArea];
+ result.Object = dataPoint;
+ }
+ break;
+ }
+
+ case ChartElementType.DataPointLabel:
+ {
+ if (chart.Series.IndexOf(seriesName) >= 0 &&
+ pointIndex < chart.Series[seriesName].Points.Count)
+ {
+ DataPoint dataPoint = chart.Series[seriesName].Points[pointIndex];
+ result.Axis = null;
+ result.ChartArea = chart.ChartAreas[dataPoint.series.ChartArea];
+ result.Object = dataPoint;
+ }
+ break;
+ }
+
+ case ChartElementType.Gridlines:
+ Grid gridLines = (Grid)obj;
+ result.Axis = gridLines.Axis;
+ if (gridLines.Axis != null)
+ {
+ result.ChartArea = gridLines.Axis.ChartArea;
+ }
+ break;
+ case ChartElementType.LegendArea:
+ result.Axis = null;
+ result.ChartArea = null;
+ break;
+ case ChartElementType.LegendItem:
+ result.PointIndex = ((LegendItem)obj).SeriesPointIndex;
+ result.Axis = null;
+ result.ChartArea = null;
+ break;
+ case ChartElementType.PlottingArea:
+ ChartArea area = (ChartArea)obj;
+ result.Axis = null;
+ result.ChartArea = area;
+ break;
+ case ChartElementType.StripLines:
+ StripLine stripLines = (StripLine)obj;
+ result.Axis = stripLines.Axis;
+ if (stripLines.Axis != null)
+ {
+ result.ChartArea = stripLines.Axis.ChartArea;
+ }
+ break;
+ case ChartElementType.TickMarks:
+ TickMark tickMarks = (TickMark)obj;
+ result.Axis = tickMarks.Axis;
+ if (tickMarks.Axis != null)
+ {
+ result.ChartArea = tickMarks.Axis.ChartArea;
+ }
+ break;
+ case ChartElementType.Title:
+ result.Axis = null;
+ result.ChartArea = null;
+ break;
+ case ChartElementType.AxisLabels:
+ if (obj is CustomLabel)
+ {
+ CustomLabel label = (CustomLabel)obj;
+ result.Axis = label.Axis;
+ result.ChartArea = label.Axis!=null ? label.Axis.ChartArea : null;
+ }
+ break;
+ case ChartElementType.AxisLabelImage:
+ if (obj is CustomLabel)
+ {
+ CustomLabel label = (CustomLabel)obj;
+ result.Axis = label.Axis;
+ result.ChartArea = label.Axis!=null ? label.Axis.ChartArea : null;
+ }
+ break;
+ case ChartElementType.AxisTitle:
+ if (obj is Axis)
+ {
+ result.Axis = (Axis)obj;
+ result.ChartArea = result.Axis.ChartArea;
+ }
+ break;
+#if Microsoft_CONTROL
+ case ChartElementType.ScrollBarLargeDecrement:
+ scrollBar = (AxisScrollBar)obj;
+ result.Axis = scrollBar.axis;
+ if (scrollBar.axis != null)
+ {
+ result.ChartArea = scrollBar.axis.ChartArea;
+ }
+ break;
+ case ChartElementType.ScrollBarLargeIncrement:
+ scrollBar = (AxisScrollBar)obj;
+ result.Axis = scrollBar.axis;
+ if (scrollBar.axis != null)
+ {
+ result.ChartArea = scrollBar.axis.ChartArea;
+ }
+ break;
+ case ChartElementType.ScrollBarSmallDecrement:
+ scrollBar = (AxisScrollBar)obj;
+ result.Axis = scrollBar.axis;
+ if (scrollBar.axis != null)
+ {
+ result.ChartArea = scrollBar.axis.ChartArea;
+ }
+ break;
+ case ChartElementType.ScrollBarSmallIncrement:
+ scrollBar = (AxisScrollBar)obj;
+ result.Axis = scrollBar.axis;
+ if (scrollBar.axis != null)
+ {
+ result.ChartArea = scrollBar.axis.ChartArea;
+ }
+ break;
+ case ChartElementType.ScrollBarThumbTracker:
+ scrollBar = (AxisScrollBar)obj;
+ result.Axis = scrollBar.axis;
+ if (scrollBar.axis != null)
+ {
+ result.ChartArea = scrollBar.axis.ChartArea;
+ }
+ break;
+#endif // Microsoft_CONTROL
+
+ case ChartElementType.Annotation:
+ result.Axis = null;
+ result.ChartArea = null;
+ break;
+ }
+ return result;
+ }
+
+ #endregion //HitTest
+
+ #region Outline
+
+ /// <summary>
+ /// Gets the chart element outline.
+ /// </summary>
+ /// <param name="chartObject">The chart object.</param>
+ /// <param name="elementType">Type of the element.</param>
+ /// <returns></returns>
+ internal ChartElementOutline GetChartElementOutline(object chartObject, ChartElementType elementType)
+ {
+ // Check arguments
+ if (chartObject == null)
+ throw new ArgumentNullException("chartObject");
+
+ // Get outline
+ ChartElementOutline result = new ChartElementOutline();
+ chartObject = this.GetAutoGeneratedObject(chartObject);
+ ArrayList list = this.GetMarkers(chartObject, elementType);
+ result.Markers = new ReadOnlyCollection<PointF>((PointF[])list.ToArray(typeof(PointF)));
+ result.OutlinePath = GetGraphicsPath(list, chartObject, elementType);
+ return result;
+ }
+
+ #endregion //Outline
+
+ #region Selection
+
+ /// <summary>
+ /// Gets the graphics path.
+ /// </summary>
+ /// <param name="markers">The markers.</param>
+ /// <param name="chartObject">The chart object.</param>
+ /// <param name="elementType">Type of the element.</param>
+ /// <returns></returns>
+ private GraphicsPath GetGraphicsPath(IList markers, object chartObject, ChartElementType elementType)
+ {
+ bool chartArea3D = false;
+ ChartArea chartArea = chartObject as ChartArea;
+ if (chartArea != null && elementType == ChartElementType.PlottingArea)
+ {
+ chartArea3D = IsArea3D(chartArea);
+ }
+ if (elementType != ChartElementType.DataPoint &&
+ elementType != ChartElementType.Gridlines &&
+ elementType != ChartElementType.StripLines &&
+ elementType != ChartElementType.TickMarks &&
+ !chartArea3D
+ )
+ {
+ GraphicsPath path = new GraphicsPath();
+ PointF[] points = new PointF[markers.Count];
+ markers.CopyTo(points, 0);
+ if (points.Length > 3)
+ {
+ if (elementType == ChartElementType.DataPointLabel)
+ {
+ for (int i = 0; i < points.Length; i += 4)
+ {
+ RectangleF rect = RectangleF.FromLTRB(points[i].X, points[i].Y, points[i + 2].X, points[i + 2].Y);
+ path.Reset();
+ path.AddRectangle(Rectangle.Round(rect));
+ }
+ }
+ else
+ {
+ if (points.Length == 4)
+ {
+ Point[] pointsAlligned = new Point[points.Length];
+ for (int i = 0; i < points.Length; i++)
+ {
+ pointsAlligned[i] = Point.Round(points[i]);
+ }
+ path.AddPolygon(pointsAlligned);
+ }
+ else
+ {
+ path.AddPolygon(points);
+ }
+ }
+ }
+ return path;
+ }
+ return null;
+ }
+
+ private static Int32 GetDataPointIndex(DataPoint dataPoint)
+ {
+ int pointIndex = -1;
+ if (dataPoint != null && dataPoint.series != null)
+ {
+ pointIndex = dataPoint.series.Points.IndexOf(dataPoint);
+ if (pointIndex == -1 && dataPoint.IsCustomPropertySet("OriginalPointIndex"))
+ {
+ if (!Int32.TryParse(dataPoint.GetCustomProperty("OriginalPointIndex"), out pointIndex))
+ return -1;
+ }
+ }
+ return pointIndex;
+ }
+
+ /// <summary>
+ /// Gets the auto generated object.
+ /// </summary>
+ /// <param name="chartObject">The chart object.</param>
+ /// <returns></returns>
+ private object GetAutoGeneratedObject(object chartObject)
+ {
+ DataPoint dataPoint = chartObject as DataPoint;
+ if (dataPoint != null)
+ {
+ if (dataPoint.series != null)
+ {
+ string seriesName = dataPoint.series.Name;
+ int pointIndex = dataPoint.series.Points.IndexOf(dataPoint);
+ if (this.ChartControl.Series.IndexOf(seriesName) != -1)
+ {
+ Series series = this.ChartControl.Series[seriesName];
+ if (series.Points.Contains(dataPoint))
+ {
+ return chartObject;
+ }
+ if (pointIndex >= 0)
+ {
+ if (series.Points.Count > pointIndex)
+ {
+ return series.Points[pointIndex];
+ }
+ }
+ }
+ }
+ }
+
+ Series asSeries = chartObject as Series;
+ if (asSeries != null)
+ {
+ if (this.ChartControl.Series.Contains(asSeries))
+ {
+ return chartObject;
+ }
+ if (this.ChartControl.Series.IndexOf(asSeries.Name) != -1)
+ {
+ return this.ChartControl.Series[asSeries.Name];
+ }
+ }
+ return chartObject;
+ }
+
+ /// <summary>
+ /// Gets the hot regions.
+ /// </summary>
+ /// <param name="cntxObj">The CNTX obj.</param>
+ /// <param name="elementType">Type of the element.</param>
+ /// <returns></returns>
+ private HotRegion[] GetHotRegions(object cntxObj, ChartElementType elementType)
+ {
+ ArrayList result = new ArrayList();
+ HotRegionsList hrList = this.ChartPicture.Common.HotRegionsList;
+ string dataPointSeries = String.Empty;
+ int dataPointIndex = -1;
+
+ for (int i = hrList.List.Count - 1; i >= 0; i--)
+ {
+ HotRegion rgn = (HotRegion)hrList.List[i];
+ if (rgn.Type == elementType)
+ {
+ switch (rgn.Type)
+ {
+ case ChartElementType.LegendItem:
+ LegendItem legendItem = cntxObj as LegendItem;
+ if (legendItem != null)
+ {
+ if (((LegendItem)rgn.SelectedObject).Name == legendItem.Name)
+ {
+ result.Add(rgn);
+ }
+ }
+ break;
+ case ChartElementType.AxisLabelImage:
+ case ChartElementType.AxisLabels:
+ CustomLabel label1 = cntxObj as CustomLabel;
+ CustomLabel label2 = rgn.SelectedObject as CustomLabel;
+ if (label1 != null)
+ {
+ if (label1 != null && label2 != null)
+ {
+ if (label1.Axis == label2.Axis)
+ {
+ if (label1.FromPosition == label2.FromPosition &&
+ label1.ToPosition == label2.ToPosition &&
+ label1.RowIndex == label2.RowIndex)
+ {
+ if (rgn.Path == null)
+ {
+ result.Add(rgn);
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ Axis axis = cntxObj as Axis;
+ if (axis != null)
+ {
+ if (axis == label2.Axis)
+ {
+ if (rgn.Path == null)
+ {
+ result.Add(rgn);
+ }
+ }
+ }
+ }
+ break;
+ case ChartElementType.DataPointLabel:
+ case ChartElementType.DataPoint:
+ DataPoint dataPoint = cntxObj as DataPoint;
+ if (dataPoint != null)
+ {
+ if (String.IsNullOrEmpty(dataPointSeries) || dataPointIndex == -1)
+ {
+ dataPointSeries = dataPoint.series.Name;
+ dataPointIndex = GetDataPointIndex(dataPoint);
+ }
+ if (rgn.PointIndex == dataPointIndex && rgn.SeriesName == dataPointSeries)
+ {
+ result.Add(rgn);
+ }
+ }
+ else
+ {
+ DataPointCollection dataPointCollection = cntxObj as DataPointCollection;
+ if (dataPointCollection != null)
+ {
+ cntxObj = dataPointCollection.series;
+ }
+ Series series = cntxObj as Series;
+ if (series != null)
+ {
+ if (String.IsNullOrEmpty(dataPointSeries) || dataPointIndex == -1)
+ {
+ dataPointSeries = series.Name;
+ }
+ if (rgn.SeriesName == dataPointSeries)
+ {
+ result.Add(rgn);
+ }
+ }
+ }
+ break;
+
+ default:
+ if (rgn.SelectedObject == cntxObj)
+ {
+ result.Add(rgn);
+ }
+ break;
+ }
+ }
+ }
+ return (HotRegion[])result.ToArray(typeof(HotRegion));
+ }
+
+
+
+ /// <summary>
+ /// Gets the markers from regions.
+ /// </summary>
+ /// <param name="chartObject">The chart object.</param>
+ /// <param name="elementType">Type of the element.</param>
+ /// <returns></returns>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
+ private ArrayList GetMarkersFromRegions(object chartObject, ChartElementType elementType)
+ {
+ ArrayList list = new ArrayList();
+ HotRegion[] regions = this.GetHotRegions(chartObject, elementType);
+ ChartGraphics graph = this.Graph;
+ RectangleF rect;
+
+ Grid grid = chartObject as Grid;
+ if (grid != null)
+ {
+ foreach (HotRegion rgn in regions)
+ {
+ if (!IsArea3D(grid.Axis.ChartArea))
+ {
+ if (IsChartAreaCircular(grid.Axis.ChartArea))
+ {
+ GraphicsPathIterator iterator = new GraphicsPathIterator(rgn.Path);
+
+ // There is more then one path.
+ if (iterator.SubpathCount > 1)
+ {
+ GraphicsPath subPath = new GraphicsPath();
+ while (iterator.NextMarker(subPath) > 0)
+ {
+ rect = subPath.GetBounds();
+ list.Add(new PointF(rect.Left + rect.Width / 2, rect.Top));
+ list.Add(new PointF(rect.Right, rect.Top + rect.Height / 2));
+ list.Add(new PointF(rect.Right - rect.Width / 2, rect.Bottom));
+ list.Add(new PointF(rect.Left, rect.Bottom - rect.Height / 2));
+ subPath.Reset();
+ }
+ }
+ }
+ else
+ {
+ // 2D
+ rect = this.GetHotRegionRectangle(rgn, RectangleF.Empty, elementType);
+ if (grid != null)
+ {
+ if (grid.GetAxis().AxisPosition == AxisPosition.Bottom ||
+ grid.GetAxis().AxisPosition == AxisPosition.Top)
+ {
+ rect.Offset(rect.Width / 2, 0);
+ rect.Width = 0;
+ }
+ else
+ {
+ rect.Offset(0, rect.Height / 2);
+ rect.Height = 0;
+ }
+ }
+ list.AddRange(this.GetMarkers(rect, false));
+ }
+ }
+ else
+ { // 3D
+ PointF[] points = rgn.Path.PathPoints;
+ for (int i = 0; i < points.Length - 3; i = i + 4)
+ { //Each gridline has a corresponding set of 4 points in the path
+ //One of the ends of a gridline is in the middle the line between points #0 and #3
+ //Another ends of a gridline is in the middle the line between points #1 and #2
+ //So we find those middles and put a marks to the ends of the gridline.
+ PointF middleP0P3 = new PointF((points[i].X + points[i + 3].X) / 2f, (points[i].Y + points[i + 3].Y) / 2f);
+ PointF middleP1P2 = new PointF((points[i + 1].X + points[i + 2].X) / 2f, (points[i + 1].Y + points[i + 2].Y) / 2f);
+ list.Add(graph.GetAbsolutePoint(middleP0P3));
+ list.Add(graph.GetAbsolutePoint(middleP1P2));
+ }
+ }
+ }
+ return list;
+ }
+
+ DataPoint dataPoint = chartObject as DataPoint;
+ if (dataPoint != null && elementType != ChartElementType.DataPointLabel)
+ {
+ rect = Rectangle.Empty;
+ Series series = dataPoint.series;
+ if (this.ChartControl.ChartAreas.IndexOf(series.ChartArea) == -1)
+ {
+ return list;
+ }
+ ChartArea area = this.ChartControl.ChartAreas[series.ChartArea];
+ PointF pp = this.Transform3D(area, dataPoint);
+ if (!(float.IsNaN(pp.X) || float.IsNaN(pp.Y)))
+ {
+ list.Add(graph.GetAbsolutePoint(pp));
+ }
+ return list;
+ }
+
+ Axis axis = chartObject as Axis;
+ if (axis != null && elementType == ChartElementType.AxisTitle)
+ {
+ foreach (HotRegion rgn in regions)
+ {
+ if (!IsArea3D(axis.ChartArea))
+ { // 2D
+ rect = this.GetHotRegionRectangle(rgn, RectangleF.Empty, elementType);
+ list.AddRange(this.GetMarkers(rect, elementType));
+ }
+ else
+ { // 3D
+ PointF[] points = rgn.Path.PathPoints;
+ list.AddRange(points);
+ }
+ }
+ return list;
+ }
+
+ LegendItem legendItem = chartObject as LegendItem;
+ if (legendItem != null)
+ {
+ rect = Rectangle.Empty;
+ foreach (HotRegion rgn in regions)
+ {
+ rect = this.GetHotRegionRectangle(rgn, rect, elementType);
+ }
+ if (!rect.IsEmpty)
+ {
+ list.AddRange(this.GetMarkers(rect, elementType));
+ }
+ return list;
+ }
+ else if (chartObject is Annotation)
+ {
+ rect = Rectangle.Empty;
+ foreach (HotRegion rgn in regions)
+ {
+ rect = this.GetHotRegionRectangle(rgn, rect, elementType);
+ }
+ if (!rect.IsEmpty)
+ {
+ list.AddRange(this.GetMarkers(rect, elementType));
+ }
+ return list;
+ }
+ foreach (HotRegion rgn in regions)
+ {
+ rect = this.GetHotRegionRectangle(rgn, RectangleF.Empty, elementType);
+ list.AddRange(this.GetMarkers(rect, elementType));
+ }
+ return list;
+
+ }
+
+
+ /// <summary>
+ /// Gets the markers.
+ /// </summary>
+ /// <param name="chartObject">The chart object.</param>
+ /// <param name="elementType">Type of the element.</param>
+ /// <returns></returns>
+ private ArrayList GetMarkers(object chartObject, ChartElementType elementType)
+ {
+ ChartArea chartArea = chartObject as ChartArea;
+ if (chartArea != null)
+ {
+ return this.GetAreaMarkers(this.Graph, chartArea);
+ }
+
+
+ Axis axis = chartObject as Axis;
+ if (axis != null)
+ {
+ if (
+ elementType == ChartElementType.AxisLabelImage ||
+ elementType == ChartElementType.AxisLabels ||
+ elementType == ChartElementType.AxisTitle
+ )
+ {
+ return this.GetMarkersFromRegions(chartObject, elementType);
+ }
+ return this.GetAxisMarkers(this.Graph, axis);
+ }
+
+ DataPoint dataPoint = chartObject as DataPoint;
+ if (dataPoint != null)
+ {
+ return this.GetMarkersFromRegions(chartObject, elementType);
+ }
+
+ Series series = chartObject as Series;
+ if (series != null)
+ {
+ if (elementType == ChartElementType.DataPointLabel)
+ {
+ return this.GetMarkersFromRegions(chartObject, elementType);
+ }
+ return this.GetSeriesMarkers(series);
+ }
+
+ return this.GetMarkersFromRegions(chartObject, elementType);
+ }
+
+ /// <summary>
+ /// Determines whether specified chart area is circular or not have axes. These chart areas contain pie, doughnut, polar, radar
+ /// </summary>
+ /// <param name="area">The area.</param>
+ /// <returns>
+ /// <c>true</c> if specified chart area is circular; otherwise, <c>false</c>.
+ /// </returns>
+ private Boolean IsChartAreaCircular(ChartArea area)
+ {
+ foreach (object o in area.ChartTypes)
+ {
+ ChartTypes.IChartType chartType = area.Common.ChartTypeRegistry.GetChartType(o.ToString());
+ if (chartType != null && (chartType.CircularChartArea || !chartType.RequireAxes))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// Determines whether the chart area is in 3D mode.
+ /// </summary>
+ /// <param name="area">The area.</param>
+ /// <returns>
+ /// <c>true</c> if the chart area is in 3D mode; otherwise, <c>false</c>.
+ /// </returns>
+ private Boolean IsArea3D(ChartArea area)
+ {
+ return area.Area3DStyle.Enable3D && !this.IsChartAreaCircular(area) && area.matrix3D != null && area.matrix3D.IsInitialized();
+ }
+
+ /// <summary>
+ /// Gets the series markers.
+ /// </summary>
+ /// <param name="series">The series.</param>
+ /// <returns>List of PointF.</returns>
+ private ArrayList GetSeriesMarkers(Series series)
+ {
+ ArrayList list = new ArrayList();
+ if (series != null)
+ {
+ String areaName = series.ChartArea;
+
+ if (String.IsNullOrEmpty(areaName))
+ {
+ areaName = ChartPicture.ChartAreas.DefaultNameReference;
+ }
+
+ if (ChartPicture.ChartAreas.IndexOf(areaName) != -1 && series.Enabled)
+ {
+
+ ChartArea chartArea = ChartPicture.ChartAreas[areaName];
+
+ if (ChartControl.Series.IndexOf(series.Name) != -1)
+ {
+ series = ChartControl.Series[series.Name];
+ }
+
+ DataPointCollection points = series.Points;
+ // in design mode we have usually fake points
+ if (points.Count == 0)
+ {
+ points = series.fakeDataPoints;
+ }
+ // transform points in 3D
+ foreach (DataPoint point in points)
+ {
+ PointF pp = this.Transform3D(chartArea, point);
+ if (float.IsNaN(pp.X) || float.IsNaN(pp.Y))
+ {
+ continue;
+ }
+ list.Add(this.Graph.GetAbsolutePoint(pp));
+ }
+ }
+ }
+ return list;
+ }
+
+ /// <summary>
+ /// Gets the axis markers - list of points where markers are drawn.
+ /// </summary>
+ /// <param name="graph">The graph.</param>
+ /// <param name="axis">The axis.</param>
+ /// <returns>List of PointF.</returns>
+ private ArrayList GetAxisMarkers(ChartGraphics graph, Axis axis)
+ {
+ ArrayList list = new ArrayList();
+ if (axis == null)
+ {
+ return list;
+ }
+ PointF first = PointF.Empty;
+ PointF second = PointF.Empty;
+
+ // Set the position of axis
+ switch (axis.AxisPosition)
+ {
+
+ case AxisPosition.Left:
+
+ first.X = (float)axis.GetAxisPosition();
+ first.Y = axis.PlotAreaPosition.Y;
+ second.X = (float)axis.GetAxisPosition();
+ second.Y = axis.PlotAreaPosition.Bottom;
+ first.X -= axis.labelSize + axis.markSize;
+ break;
+
+ case AxisPosition.Right:
+
+ first.X = (float)axis.GetAxisPosition();
+ first.Y = axis.PlotAreaPosition.Y;
+ second.X = (float)axis.GetAxisPosition();
+ second.Y = axis.PlotAreaPosition.Bottom;
+ second.X += axis.labelSize + axis.markSize;
+ break;
+
+ case AxisPosition.Bottom:
+
+ first.X = axis.PlotAreaPosition.X;
+ first.Y = (float)axis.GetAxisPosition();
+ second.X = axis.PlotAreaPosition.Right;
+ second.Y = (float)axis.GetAxisPosition();
+ second.Y += axis.labelSize + axis.markSize;
+ break;
+
+ case AxisPosition.Top:
+
+ first.X = axis.PlotAreaPosition.X;
+ first.Y = (float)axis.GetAxisPosition();
+ second.X = axis.PlotAreaPosition.Right;
+ second.Y = (float)axis.GetAxisPosition();
+ first.Y -= axis.labelSize + axis.markSize;
+ break;
+ }
+
+ // Update axis line position for circular area
+ if (axis.ChartArea.chartAreaIsCurcular)
+ {
+ second.Y = axis.PlotAreaPosition.Y + axis.PlotAreaPosition.Height / 2f;
+ }
+
+ RectangleF rect1 = new RectangleF(first.X, first.Y, second.X - first.X, second.Y - first.Y);
+
+ SizeF size = graph.GetRelativeSize(new SizeF(3, 3));
+ if (axis.AxisPosition == AxisPosition.Top || axis.AxisPosition == AxisPosition.Bottom)
+ {
+ rect1.Inflate(2, size.Height);
+ }
+ else
+ {
+ rect1.Inflate(size.Width, 2);
+ }
+ IList list1 = this.GetMarkers(rect1, ChartElementType.Axis);
+ ChartArea area = axis.ChartArea;
+ if (this.IsArea3D(area))
+ {
+
+ Boolean axisOnEdge = false;
+ float zPositon = axis.GetMarksZPosition(out axisOnEdge);
+
+ // Transform coordinates
+ Point3D[] points = new Point3D[list1.Count];
+ for (int i = 0; i < list1.Count; i++)
+ {
+ points[i] = new Point3D(((PointF)list1[i]).X, ((PointF)list1[i]).Y, zPositon);
+ }
+ axis.ChartArea.matrix3D.TransformPoints(points);
+ for (int i = 0; i < list1.Count; i++)
+ {
+ list1[i] = points[i].PointF;
+ }
+ }
+ foreach (PointF p in list1)
+ {
+ list.Add(graph.GetAbsolutePoint(p));
+ }
+ return list;
+ }
+
+ /// <summary>
+ /// Gets the area markers.
+ /// </summary>
+ /// <param name="graph">The graph.</param>
+ /// <param name="area">The area.</param>
+ /// <returns>List of PointF.</returns>
+ private ArrayList GetAreaMarkers(ChartGraphics graph, ChartArea area)
+ {
+ ArrayList list = new ArrayList();
+ if (area == null)
+ {
+ return list;
+ }
+ IList list1 = this.GetMarkers(area.PlotAreaPosition.ToRectangleF(), ChartElementType.PlottingArea);
+ if (this.IsChartAreaCircular(area))
+ {
+ list1 = this.GetMarkers(area.lastAreaPosition, ChartElementType.PlottingArea);
+ }
+ if (IsArea3D(area))
+ {
+ float zPositon = 0; // area.areaSceneDepth;
+ // Transform coordinates
+ Point3D[] points = new Point3D[list1.Count];
+ for (int i = 0; i < list1.Count; i++)
+ {
+ points[i] = new Point3D(((PointF)list1[i]).X, ((PointF)list1[i]).Y, zPositon);
+ }
+ area.matrix3D.TransformPoints(points);
+ for (int i = 0; i < list1.Count; i++)
+ {
+ list1[i] = points[i].PointF;
+ }
+ }
+ foreach (PointF p in list1)
+ {
+ list.Add(graph.GetAbsolutePoint(p));
+ }
+ return list;
+ }
+
+ /// <summary>
+ /// Builds list of markers (PointF) based on rectangle
+ /// </summary>
+ /// <param name="rect">The rectangle</param>
+ /// <param name="elementType">The type of chart elements to retrieve.</param>
+ /// <returns>List of PointF</returns>
+ private ArrayList GetMarkers(RectangleF rect, ChartElementType elementType)
+ {
+ if (elementType.ToString().StartsWith("Legend", StringComparison.Ordinal) || elementType.ToString().StartsWith("Title", StringComparison.Ordinal))
+ {
+ rect.Inflate(4f, 4f);
+ }
+ if (elementType.ToString().StartsWith("PlottingArea", StringComparison.Ordinal))
+ {
+ SizeF relSize = this.Graph.GetRelativeSize(new SizeF(4f, 4f));
+ rect.Inflate(relSize.Width, relSize.Height);
+ }
+
+ if ((elementType != ChartElementType.Nothing) && (elementType != ChartElementType.PlottingArea))
+ {
+ return this.GetMarkers(rect, false);
+ }
+ return this.GetMarkers(rect, true);
+ }
+
+
+ /// <summary>
+ /// Builds list of markers (PointF) based on rectangle
+ /// </summary>
+ /// <param name="rect">The rectangle</param>
+ /// <param name="addAdditionalMarkers">Add additional markers to the rectangle.</param>
+ /// <returns>List of PointF</returns>
+ private ArrayList GetMarkers(RectangleF rect, Boolean addAdditionalMarkers)
+ {
+ ArrayList list = new ArrayList();
+ if (!addAdditionalMarkers)
+ {
+ if (rect.Width > 0 && rect.Height > 0)
+ {
+ list.Add(new PointF(rect.Left, rect.Top));
+ list.Add(new PointF(rect.Right, rect.Top));
+ list.Add(new PointF(rect.Right, rect.Bottom));
+ list.Add(new PointF(rect.Left, rect.Bottom));
+ }
+ else if (rect.Width > 0)
+ {
+ list.Add(new PointF(rect.Left, rect.Top));
+ list.Add(new PointF(rect.Right, rect.Top));
+ }
+ else if (rect.Height > 0)
+ {
+ list.Add(new PointF(rect.Left, rect.Top));
+ list.Add(new PointF(rect.Left, rect.Bottom));
+ }
+ }
+ else
+ {
+ if (rect.Width > 0)
+ {
+ list.Add(new PointF(rect.Left, rect.Top));
+
+ if (rect.Width > 30)
+ {
+ list.Add(new PointF(rect.Left + rect.Width / 2, rect.Top));
+ }
+
+ list.Add(new PointF(rect.Right, rect.Top));
+
+ if (rect.Height > 30)
+ {
+ list.Add(new PointF(rect.Right, rect.Top + rect.Height / 2));
+ }
+
+ list.Add(new PointF(rect.Right, rect.Bottom));
+ if (rect.Width > 30)
+ {
+ list.Add(new PointF(rect.Left + rect.Width / 2, rect.Bottom));
+ }
+
+ list.Add(new PointF(rect.Left, rect.Bottom));
+ if (rect.Height > 30)
+ {
+ list.Add(new PointF(rect.Left, rect.Top + rect.Height / 2));
+ }
+ }
+
+ else if (rect.Width > 0)
+ {
+ list.Add(new PointF(rect.Left, rect.Top));
+
+ if (rect.Width > 30)
+ {
+ list.Add(new PointF(rect.Left + rect.Width / 2, rect.Top));
+ }
+
+ list.Add(new PointF(rect.Right, rect.Top));
+ }
+ else if (rect.Height > 0)
+ {
+ list.Add(new PointF(rect.Left, rect.Bottom));
+ if (rect.Height > 30)
+ {
+ list.Add(new PointF(rect.Left, rect.Top + rect.Height / 2));
+ }
+ list.Add(new PointF(rect.Left, rect.Top));
+ }
+ }
+ return list;
+ }
+
+ /// <summary>
+ /// Gets the region markers from graphics path.
+ /// </summary>
+ /// <param name="path">The path.</param>
+ /// <returns>List of PointF.</returns>
+ private ArrayList GetRegionMarkers(GraphicsPath path)
+ {
+ return new ArrayList(path.PathPoints);
+ }
+
+ /// <summary>
+ /// Calculates a DataPoint of 3D area into PointF to draw.
+ /// </summary>
+ /// <param name="chartArea">3D chart area</param>
+ /// <param name="point">The DataPoint</param>
+ /// <returns>Calculated PointF</returns>
+ private PointF Transform3D(ChartArea chartArea, DataPoint point)
+ {
+ if (chartArea is ChartArea && IsArea3D(chartArea))
+ {
+ // Get anotation Z coordinate (use scene depth or anchored point Z position)
+ float positionZ = chartArea.areaSceneDepth;
+ if (point != null && point.series != null)
+ {
+ float depth = 0f;
+ chartArea.GetSeriesZPositionAndDepth(
+ point.series,
+ out depth,
+ out positionZ);
+ positionZ += depth / 2f;
+ }
+
+ PointF pf = point.positionRel;
+
+ // Define 3D points of annotation object
+ Point3D[] annot3DPoints = new Point3D[1];
+ annot3DPoints[0] = new Point3D(pf.X, pf.Y, positionZ);
+
+ // Tranform cube coordinates
+ chartArea.matrix3D.TransformPoints(annot3DPoints);
+
+ return annot3DPoints[0].PointF;
+ }
+ return point.positionRel;
+ }
+
+ /// <summary>
+ /// Gets the hot region rectangle.
+ /// </summary>
+ /// <param name="rgn">The hot region.</param>
+ /// <param name="unionWith">The rectangle to union with.</param>
+ /// <param name="elementType">The type of the element.</param>
+ /// <returns>Returns the rectangle around the hot region.</returns>
+ private RectangleF GetHotRegionRectangle(HotRegion rgn, RectangleF unionWith, ChartElementType elementType)
+ {
+ RectangleF rect;
+ if (rgn.Path != null)
+ {
+ rect = rgn.Path.GetBounds();
+ }
+ else
+ {
+ rect = rgn.BoundingRectangle;
+ }
+ if (rgn.RelativeCoordinates)
+ {
+ rect = this.Graph.GetAbsoluteRectangle(rect);
+ }
+ if (elementType == ChartElementType.AxisLabels)
+ {
+ if (rect.Width > rect.Height)
+ {
+ rect.Inflate(-5, -2);
+ }
+ else if (rect.Width < rect.Height)
+ {
+ rect.Inflate(-2, -5);
+ }
+ }
+ if (!unionWith.IsEmpty)
+ {
+ return RectangleF.Union(unionWith, rect);
+ }
+ return rect;
+ }
+
+ #endregion //Selection
+
+ #endregion //Tooltips
+
+ #region IServiceProvider Members
+
+ /// <summary>
+ /// Gets the service object of the specified type.
+ /// </summary>
+ /// <param name="serviceType">An object that specifies the type of service object to get.</param>
+ /// <returns>
+ /// A service object of type <paramref name="serviceType"/>. It returns null
+ /// if there is no service object of type <paramref name="serviceType"/>.
+ /// </returns>
+ object IServiceProvider.GetService(Type serviceType)
+ {
+ if (serviceType == typeof(Selection))
+ {
+ return this;
+ }
+ if (_service != null)
+ {
+ return _service.GetService(serviceType);
+ }
+ return null;
+ }
+
+ #endregion
+
+ }
+
+
+#if Microsoft_CONTROL
+ /// <summary>
+ /// The ToolTipEventArgs class stores the tool tips event arguments.
+ /// </summary>
+ public class ToolTipEventArgs : EventArgs
+ {
+ #region Private fields
+
+ // Private fields for properties values storage
+ private int x = 0;
+ private int y = 0;
+ private string text = "";
+ private HitTestResult result = new HitTestResult();
+
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// ToolTipEventArgs constructor. Creates ToolTip event arguments.
+ /// </summary>
+ /// <param name="x">X-coordinate of mouse.</param>
+ /// <param name="y">Y-coordinate of mouse.</param>
+ /// <param name="text">Tooltip text.</param>
+ /// <param name="result">Hit test result object.</param>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X and Y are cartesian coordinates and well understood")]
+ public ToolTipEventArgs(int x, int y, string text, HitTestResult result)
+ {
+ this.x = x;
+ this.y = y;
+ this.text = text;
+ this.result = result;
+ }
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Gets the x-coordinate of the mouse.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeToolTipEventArgs_X"),
+ ]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "X")]
+ public int X
+ {
+ get
+ {
+ return x;
+ }
+ }
+
+ /// <summary>
+ /// Gets the result of the hit test.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeToolTipEventArgs_HitTestResult"),
+ ]
+ public HitTestResult HitTestResult
+ {
+ get
+ {
+ return result;
+ }
+ }
+
+ /// <summary>
+ /// Gets the y-coordinate of the mouse.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeToolTipEventArgs_Y"),
+ ]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Y")]
+ public int Y
+ {
+ get
+ {
+ return y;
+ }
+ }
+
+ /// <summary>
+ /// Gets the text of the tooltip.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeToolTipEventArgs_Text"),
+ ]
+ public string Text
+ {
+ get
+ {
+ return text;
+ }
+ set
+ {
+ text = value;
+ }
+ }
+
+ #endregion
+ }
+
+#endif // #if Microsoft_CONTROL
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/SmartLabels.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/SmartLabels.cs
new file mode 100644
index 00000000000..1b4ac8190b2
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/SmartLabels.cs
@@ -0,0 +1,1710 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: SmartLabelStyle.cs
+//
+// Namespace: DataVisualization.Charting
+//
+// Classes: SmartLabelStyle, SmartLabelStyle
+//
+// Purpose: Smart Labels are used to avoid data point's labels
+// overlapping. SmartLabelStyle class is exposed from
+// the Series and Annotation classes and allows enabling
+// and adjusting of SmartLabelStyle algorithm. SmartLabelStyle class
+// exposes a set of helper utility methods and store
+// information about labels in a chart area.
+//
+// Reviewed: AG - Microsoft 14, 2007
+//
+//===================================================================
+
+#region Used namespaces
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Drawing2D;
+#if Microsoft_CONTROL
+
+using System.Windows.Forms.DataVisualization.Charting.Data;
+using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+using System.Windows.Forms.DataVisualization.Charting.Utilities;
+using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+using System.Windows.Forms.DataVisualization.Charting;
+
+using System.Globalization;
+using System.ComponentModel.Design.Serialization;
+using System.Reflection;
+using System.Windows.Forms.Design;
+#else
+ using System.Web;
+ using System.Web.UI;
+ using System.Globalization;
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+ using System.Web.UI.DataVisualization.Charting.Borders3D;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ #region Enumerations
+
+ /// <summary>
+ /// Line anchor cap style.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeLineAnchorCapStyle_LineAnchorCapStyle")
+ ]
+ public enum LineAnchorCapStyle
+ {
+ /// <summary>
+ /// No line anchor cap.
+ /// </summary>
+ None,
+ /// <summary>
+ /// Arrow line anchor cap.
+ /// </summary>
+ Arrow,
+ /// <summary>
+ /// Diamond line anchor cap.
+ /// </summary>
+ Diamond,
+ /// <summary>
+ /// Square line anchor cap.
+ /// </summary>
+ Square,
+ /// <summary>
+ /// Round line anchor cap.
+ /// </summary>
+ Round
+ }
+
+ /// <summary>
+ /// Data point label callout style.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeLabelCalloutStyle_LabelCalloutStyle")
+ ]
+ public enum LabelCalloutStyle
+ {
+ /// <summary>
+ /// Label connected with the marker using just a line.
+ /// </summary>
+ None,
+ /// <summary>
+ /// Label is undelined and connected with the marker using a line.
+ /// </summary>
+ Underlined,
+ /// <summary>
+ /// Box is drawn around the label and it's connected with the marker using a line.
+ /// </summary>
+ Box
+ }
+
+ /// <summary>
+ /// Data point label outside of the plotting area style.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeLabelOutsidePlotAreaStyle_LabelOutsidePlotAreaStyle")
+ ]
+ public enum LabelOutsidePlotAreaStyle
+ {
+ /// <summary>
+ /// Labels can be positioned outside of the plotting area.
+ /// </summary>
+ Yes,
+ /// <summary>
+ /// Labels can not be positioned outside of the plotting area.
+ /// </summary>
+ No,
+ /// <summary>
+ /// Labels can be partially outside of the plotting area.
+ /// </summary>
+ Partial
+ }
+
+ #endregion
+
+ /// <summary>
+ /// SmartLabelStyle class is used to enable and configure the
+ /// SmartLabelStyle algorithm for data point labels and annotations.
+ /// In most of the cases it is enough just to enable the algorithm,
+ /// but this class also contains properties which allow controlling
+ /// how the labels are moved around to avoid collisions. Visual
+ /// appearance of callouts can also be set through this class.
+ /// </summary>
+ [
+ DefaultProperty("Enabled"),
+ SRDescription("DescriptionAttributeSmartLabelsStyle_SmartLabelsStyle"),
+ TypeConverter(typeof(NoNameExpandableObjectConverter))
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class SmartLabelStyle
+ {
+ #region Fields
+
+ // Reference to the series this style belongs to
+ internal object chartElement = null;
+
+ // Indicates if SmartLabelStyle algorithm is enabled.
+ private bool _enabled = true;
+
+ // Indicates that marker overlapping by label is allowed.
+ private bool _isMarkerOverlappingAllowed = false;
+
+ // Indicates that overlapped labels that can't be repositioned will be hidden.
+ private bool _isOverlappedHidden = true;
+
+ // Possible moving directions for the overlapped SmartLabelStyle.
+ private LabelAlignmentStyles _movingDirection = LabelAlignmentStyles.Top | LabelAlignmentStyles.Bottom | LabelAlignmentStyles.Right | LabelAlignmentStyles.Left | LabelAlignmentStyles.TopLeft | LabelAlignmentStyles.TopRight | LabelAlignmentStyles.BottomLeft | LabelAlignmentStyles.BottomRight;
+
+ // Minimum distance the overlapped SmartLabelStyle can be moved from the marker. Distance is measured in pixels.
+ private double _minMovingDistance = 0.0;
+
+ // Maximum distance the overlapped SmartLabelStyle can be moved from the marker. Distance is measured in pixels.
+ private double _maxMovingDistance = 30.0;
+
+ // Defines if SmartLabelStyle are allowed to be drawn outside of the plotting area.
+ private LabelOutsidePlotAreaStyle _allowOutsidePlotArea = LabelOutsidePlotAreaStyle.Partial;
+
+ // Callout style of the repositioned SmartLabelStyle.
+ private LabelCalloutStyle _calloutStyle = LabelCalloutStyle.Underlined;
+
+ // Label callout line color.
+ private Color _calloutLineColor = Color.Black;
+
+ // Label callout line style.
+ private ChartDashStyle _calloutLineDashStyle = ChartDashStyle.Solid;
+
+ // Label callout back color. Applies to the Box style only!
+ private Color _calloutBackColor = Color.Transparent;
+
+ // Label callout line width.
+ private int _calloutLineWidth = 1;
+
+ // Label callout line anchor cap.
+ private LineAnchorCapStyle _calloutLineAnchorCapStyle = LineAnchorCapStyle.Arrow;
+
+ #endregion
+
+ #region Constructors and initialization
+
+ /// <summary>
+ /// Default public constructor.
+ /// </summary>
+ public SmartLabelStyle()
+ {
+ this.chartElement = null;
+ }
+
+ /// <summary>
+ /// Constructor.
+ /// </summary>
+ /// <param name="chartElement">Chart element this style belongs to.</param>
+ internal SmartLabelStyle(Object chartElement)
+ {
+ this.chartElement = chartElement;
+ }
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// SmartLabelStyle algorithm enabled flag.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeEnabled13"),
+ ParenthesizePropertyNameAttribute(true),
+ ]
+ virtual public bool Enabled
+ {
+ get
+ {
+ return _enabled;
+ }
+ set
+ {
+ _enabled = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Indicates that marker overlapping by label is allowed.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeMarkerOverlapping"),
+ ]
+ virtual public bool IsMarkerOverlappingAllowed
+ {
+ get
+ {
+ return _isMarkerOverlappingAllowed;
+ }
+ set
+ {
+ _isMarkerOverlappingAllowed = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Indicates that overlapped labels that can't be repositioned will be hidden.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeHideOverlapped"),
+ ]
+ virtual public bool IsOverlappedHidden
+ {
+ get
+ {
+ return _isOverlappedHidden;
+ }
+ set
+ {
+ _isOverlappedHidden = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Possible moving directions for the overlapped SmartLabelStyle.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ DefaultValue(typeof(LabelAlignmentStyles), "Top, Bottom, Right, Left, TopLeft, TopRight, BottomLeft, BottomRight"),
+ SRDescription("DescriptionAttributeMovingDirection"),
+ Editor(Editors.FlagsEnumUITypeEditor.Editor, Editors.FlagsEnumUITypeEditor.Base),
+ ]
+ virtual public LabelAlignmentStyles MovingDirection
+ {
+ get
+ {
+ return _movingDirection;
+ }
+ set
+ {
+ if(value == 0)
+ {
+ throw (new InvalidOperationException(SR.ExceptionSmartLabelsDirectionUndefined));
+ }
+
+ _movingDirection = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Minimum distance the overlapped SmartLabelStyle can be moved from the marker. Distance is measured in pixels.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ DefaultValue(0.0),
+ SRDescription("DescriptionAttributeMinMovingDistance"),
+ ]
+ virtual public double MinMovingDistance
+ {
+ get
+ {
+ return _minMovingDistance;
+ }
+ set
+ {
+ if(value < 0)
+ {
+ throw (new InvalidOperationException(SR.ExceptionSmartLabelsMinMovingDistanceIsNegative));
+ }
+ _minMovingDistance = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Maximum distance the overlapped SmartLabelStyle can be moved from the marker. Distance is measured in pixels.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ DefaultValue(30.0),
+ SRDescription("DescriptionAttributeMaxMovingDistance"),
+ ]
+ virtual public double MaxMovingDistance
+ {
+ get
+ {
+ return _maxMovingDistance;
+ }
+ set
+ {
+ if(value < 0 )
+ {
+ throw (new InvalidOperationException(SR.ExceptionSmartLabelsMaxMovingDistanceIsNegative));
+ }
+ _maxMovingDistance = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Defines if SmartLabelStyle are allowed to be drawn outside of the plotting area.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ DefaultValue(LabelOutsidePlotAreaStyle.Partial),
+ SRDescription("DescriptionAttributeAllowOutsidePlotArea"),
+ ]
+ virtual public LabelOutsidePlotAreaStyle AllowOutsidePlotArea
+ {
+ get
+ {
+ return _allowOutsidePlotArea;
+ }
+ set
+ {
+ _allowOutsidePlotArea = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Callout style of the repositioned SmartLabelStyle.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ DefaultValue(LabelCalloutStyle.Underlined),
+ SRDescription("DescriptionAttributeCalloutStyle3"),
+ ]
+ virtual public LabelCalloutStyle CalloutStyle
+ {
+ get
+ {
+ return _calloutStyle;
+ }
+ set
+ {
+ _calloutStyle = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Label callout line color.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeCalloutLineColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ ]
+ virtual public Color CalloutLineColor
+ {
+ get
+ {
+ return _calloutLineColor;
+ }
+ set
+ {
+ _calloutLineColor = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Label callout line style.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartDashStyle.Solid),
+ SRDescription("DescriptionAttributeLineDashStyle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ virtual public ChartDashStyle CalloutLineDashStyle
+ {
+ get
+ {
+ return _calloutLineDashStyle;
+ }
+ set
+ {
+ _calloutLineDashStyle = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Label callout back color. Applies to the Box style only!
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), "Transparent"),
+ SRDescription("DescriptionAttributeCalloutBackColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ ]
+ virtual public Color CalloutBackColor
+ {
+ get
+ {
+ return _calloutBackColor;
+ }
+ set
+ {
+ _calloutBackColor = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Label callout line width.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(1),
+ SRDescription("DescriptionAttributeLineWidth"),
+ ]
+ virtual public int CalloutLineWidth
+ {
+ get
+ {
+ return _calloutLineWidth;
+ }
+ set
+ {
+ _calloutLineWidth = value;
+ Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Label callout line anchor cap.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(LineAnchorCapStyle.Arrow),
+ SRDescription(SR.Keys.DescriptionAttributeCalloutLineAnchorCap),
+ ]
+ virtual public LineAnchorCapStyle CalloutLineAnchorCapStyle
+ {
+ get
+ {
+ return _calloutLineAnchorCapStyle;
+ }
+ set
+ {
+ _calloutLineAnchorCapStyle = value;
+ Invalidate();
+ }
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Invalidates ----osiated chart element.
+ /// </summary>
+ private void Invalidate()
+ {
+ if(chartElement != null)
+ {
+ if(chartElement is Series)
+ {
+ ((Series)chartElement).Invalidate(false, false);
+ }
+
+ else if(chartElement is Annotation)
+ {
+ ((Annotation)chartElement).Invalidate();
+ }
+
+ }
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// SmartLabelStyle class implements the SmartLabelStyle algorithm for the
+ /// data series points. It keeps track of all labels drawn and
+ /// detects their collisions. When labels collision is detected
+ /// the algorithm tries to resolve it by repositioning the labels.
+ /// If label can not be repositioned it maybe hidden depending on
+ /// the current settings.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeSmartLabels_SmartLabels"),
+ ]
+ internal class SmartLabel
+ {
+ #region Fields
+
+ // List of all SmartLabelStyle positions in the area
+ internal ArrayList smartLabelsPositions = null;
+
+ // Indicates that not a single collision is allowed
+ internal bool checkAllCollisions = false;
+
+ // Number of positions in array for the markers
+ internal int markersCount = 0;
+
+ #endregion
+
+ #region Constructors and initialization
+
+ /// <summary>
+ /// Default public constructor.
+ /// </summary>
+ public SmartLabel()
+ {
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Reset SmartLabelStyle object.
+ /// </summary>
+ internal void Reset()
+ {
+ // Re-initialize list of labels position
+ smartLabelsPositions = new ArrayList();
+ }
+
+ /// <summary>
+ /// Process single SmartLabelStyle by adjusting it's position in case of collision.
+ /// </summary>
+ /// <param name="common">Reference to common elements.</param>
+ /// <param name="graph">Reference to chart graphics object.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="smartLabelStyle">Smart labels style.</param>
+ /// <param name="labelPosition">Original label position.</param>
+ /// <param name="labelSize">Label text size.</param>
+ /// <param name="format">Label string format.</param>
+ /// <param name="markerPosition">Marker position.</param>
+ /// <param name="markerSize">Marker size.</param>
+ /// <param name="labelAlignment">Original label alignment.</param>
+ /// <returns>Adjusted position of the label.</returns>
+ internal PointF AdjustSmartLabelPosition(
+ CommonElements common,
+ ChartGraphics graph,
+ ChartArea area,
+ SmartLabelStyle smartLabelStyle,
+ PointF labelPosition,
+ SizeF labelSize,
+ StringFormat format,
+ PointF markerPosition,
+ SizeF markerSize,
+ LabelAlignmentStyles labelAlignment)
+ {
+ return AdjustSmartLabelPosition(
+ common,
+ graph,
+ area,
+ smartLabelStyle,
+ labelPosition,
+ labelSize,
+ format,
+ markerPosition,
+ markerSize,
+ labelAlignment,
+ false);
+ }
+
+ /// <summary>
+ /// Process single SmartLabelStyle by adjusting it's position in case of collision.
+ /// </summary>
+ /// <param name="common">Reference to common elements.</param>
+ /// <param name="graph">Reference to chart graphics object.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="smartLabelStyle">Smart labels style.</param>
+ /// <param name="labelPosition">Original label position.</param>
+ /// <param name="labelSize">Label text size.</param>
+ /// <param name="format">Label string format.</param>
+ /// <param name="markerPosition">Marker position.</param>
+ /// <param name="markerSize">Marker size.</param>
+ /// <param name="labelAlignment">Original label alignment.</param>
+ /// <param name="checkCalloutLineOverlapping">Indicates that labels overlapping by callout line must be checked.</param>
+ /// <returns>Adjusted position of the label.</returns>
+ internal PointF AdjustSmartLabelPosition(
+ CommonElements common,
+ ChartGraphics graph,
+ ChartArea area,
+ SmartLabelStyle smartLabelStyle,
+ PointF labelPosition,
+ SizeF labelSize,
+ StringFormat format,
+ PointF markerPosition,
+ SizeF markerSize,
+ LabelAlignmentStyles labelAlignment,
+ bool checkCalloutLineOverlapping)
+ {
+ // Check if SmartLabelStyle are enabled
+ if(smartLabelStyle.Enabled)
+ {
+ bool labelMovedAway = false;
+
+ // Add series markers positions to avoid their overlapping
+ bool rememberMarkersCount = (this.smartLabelsPositions.Count == 0);
+ AddMarkersPosition(common, area);
+ if(rememberMarkersCount)
+ {
+ this.markersCount = this.smartLabelsPositions.Count;
+ }
+
+ // Check label collision
+ if(IsSmartLabelCollide(
+ common,
+ graph,
+ area,
+ smartLabelStyle,
+ labelPosition,
+ labelSize,
+ markerPosition,
+ format,
+ labelAlignment,
+ checkCalloutLineOverlapping))
+ {
+ // Try to find a new position for the SmartLabelStyle
+ labelMovedAway = FindNewPosition(
+ common,
+ graph,
+ area,
+ smartLabelStyle,
+ ref labelPosition,
+ labelSize,
+ format,
+ markerPosition,
+ ref markerSize,
+ ref labelAlignment,
+ checkCalloutLineOverlapping);
+
+ // Draw label callout if label was moved away or
+ // it's displayed in the corners of the marker
+ if(labelMovedAway ||
+ (labelAlignment == LabelAlignmentStyles.BottomLeft ||
+ labelAlignment == LabelAlignmentStyles.BottomRight ||
+ labelAlignment == LabelAlignmentStyles.TopLeft ||
+ labelAlignment == LabelAlignmentStyles.TopRight))
+ {
+ if(!labelPosition.IsEmpty)
+ {
+ DrawCallout(
+ common,
+ graph,
+ area,
+ smartLabelStyle,
+ labelPosition,
+ labelSize,
+ format,
+ markerPosition,
+ markerSize,
+ labelAlignment);
+ }
+ }
+ }
+
+ // Add label position into the list
+ AddSmartLabelPosition(graph, labelPosition, labelSize, format);
+ }
+
+ // Return label position
+ return labelPosition;
+ }
+
+
+ /// <summary>
+ /// Process single SmartLabelStyle by adjusting it's position in case of collision.
+ /// </summary>
+ /// <param name="common">Reference to common elements.</param>
+ /// <param name="graph">Reference to chart graphics object.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="smartLabelStyle">Smart labels style.</param>
+ /// <param name="labelPosition">Original label position.</param>
+ /// <param name="labelSize">Label text size.</param>
+ /// <param name="format">Label string format.</param>
+ /// <param name="markerPosition">Marker position.</param>
+ /// <param name="markerSize">Marker size.</param>
+ /// <param name="labelAlignment">Label alignment.</param>
+ /// <param name="checkCalloutLineOverlapping">Indicates that labels overlapping by callout line must be checked.</param>
+ /// <returns>True if label was moved away from the marker.</returns>
+ private bool FindNewPosition(
+ CommonElements common,
+ ChartGraphics graph,
+ ChartArea area,
+ SmartLabelStyle smartLabelStyle,
+ ref PointF labelPosition,
+ SizeF labelSize,
+ StringFormat format,
+ PointF markerPosition,
+ ref SizeF markerSize,
+ ref LabelAlignmentStyles labelAlignment,
+ bool checkCalloutLineOverlapping)
+ {
+ SizeF newMarkerSize = SizeF.Empty;
+ PointF newLabelPosition = PointF.Empty;
+ int positionIndex = 0;
+ float labelMovement = 0f;
+ bool labelMovedAway = false;
+ LabelAlignmentStyles[] positions = new LabelAlignmentStyles[] {
+ LabelAlignmentStyles.Top,
+ LabelAlignmentStyles.Bottom,
+ LabelAlignmentStyles.Left,
+ LabelAlignmentStyles.Right,
+ LabelAlignmentStyles.TopLeft,
+ LabelAlignmentStyles.TopRight,
+ LabelAlignmentStyles.BottomLeft,
+ LabelAlignmentStyles.BottomRight,
+ LabelAlignmentStyles.Center
+ };
+
+ // Get relative size of single pixel
+ SizeF pixelSize = graph.GetRelativeSize(new SizeF(1f, 1f));
+
+ // Try to find a new position for the label
+ bool positionFound = false;
+ float movingStep = 2f;
+ float minMove = (float)Math.Min(smartLabelStyle.MinMovingDistance, smartLabelStyle.MaxMovingDistance);
+ float maxMove = (float)Math.Max(smartLabelStyle.MinMovingDistance, smartLabelStyle.MaxMovingDistance);
+ for(labelMovement = minMove; !positionFound && labelMovement <= maxMove; labelMovement += movingStep)
+ {
+ // Move label by increasing marker size by 4 pixels
+ newMarkerSize = new SizeF(
+ markerSize.Width + labelMovement*(pixelSize.Width * 2f),
+ markerSize.Height + labelMovement*(pixelSize.Height * 2f));
+
+ // Loop through different alignment types
+ for(positionIndex = 0; positionIndex < positions.Length; positionIndex++)
+ {
+ // Center label alignment should only be tried once!
+ if(positions[positionIndex] == LabelAlignmentStyles.Center && labelMovement != minMove)
+ {
+ continue;
+ }
+
+ // Check if this alignment is valid
+ if((smartLabelStyle.MovingDirection & positions[positionIndex]) == positions[positionIndex])
+ {
+ // Calculate new position of the label
+ newLabelPosition = CalculatePosition(
+ positions[positionIndex],
+ markerPosition,
+ newMarkerSize,
+ labelSize,
+ ref format);
+
+ // Check new position collision
+ if(!IsSmartLabelCollide(
+ common,
+ null,
+ area,
+ smartLabelStyle,
+ newLabelPosition,
+ labelSize,
+ markerPosition,
+ format,
+ positions[positionIndex],
+ checkCalloutLineOverlapping))
+ {
+ positionFound = true;
+ labelMovedAway = (labelMovement == 0f) ? false : true;
+ break;
+ }
+ }
+ }
+ }
+
+ // Set new data if new label position was found
+ if(positionFound)
+ {
+ markerSize = newMarkerSize;
+ labelPosition = newLabelPosition;
+ labelAlignment = positions[positionIndex];
+ }
+
+ // DEBUG code
+#if DEBUG
+ if(common.Chart.ShowDebugMarkings)
+ {
+ RectangleF lp = GetLabelPosition(graph, labelPosition, labelSize, format, false);
+ if(positionFound)
+ {
+ graph.Graphics.DrawRectangle(Pens.Green, Rectangle.Round(graph.GetAbsoluteRectangle(lp)));
+ }
+ else
+ {
+ graph.Graphics.DrawRectangle(new Pen(Color.Magenta, 3), Rectangle.Round(graph.GetAbsoluteRectangle(lp)));
+ }
+ }
+#endif
+ // Do not draw overlapped labels that can't be repositioned
+ if(!positionFound && smartLabelStyle.IsOverlappedHidden)
+ {
+ labelPosition = PointF.Empty;
+ }
+
+
+ return (labelMovedAway && positionFound) ? true : false;
+ }
+
+ /// <summary>
+ /// Process single SmartLabelStyle by adjusting it's position in case of collision.
+ /// </summary>
+ /// <param name="common">Reference to common elements.</param>
+ /// <param name="graph">Reference to chart graphics object.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="smartLabelStyle">Smart labels style.</param>
+ /// <param name="labelPosition">Original label position.</param>
+ /// <param name="labelSize">Label text size.</param>
+ /// <param name="format">Label string format.</param>
+ /// <param name="markerPosition">Marker position.</param>
+ /// <param name="markerSize">Marker size.</param>
+ /// <param name="labelAlignment">Label alignment.</param>
+ /// <returns>Adjusted position of the label.</returns>
+ virtual internal void DrawCallout(
+ CommonElements common,
+ ChartGraphics graph,
+ ChartArea area,
+ SmartLabelStyle smartLabelStyle,
+ PointF labelPosition,
+ SizeF labelSize,
+ StringFormat format,
+ PointF markerPosition,
+ SizeF markerSize,
+ LabelAlignmentStyles labelAlignment)
+ {
+ // Calculate label position rectangle
+ RectangleF labelRectAbs = graph.GetAbsoluteRectangle(
+ GetLabelPosition(graph, labelPosition, labelSize, format, true));
+
+ // Create callout pen
+ Pen calloutPen = new Pen(smartLabelStyle.CalloutLineColor, smartLabelStyle.CalloutLineWidth);
+ calloutPen.DashStyle = graph.GetPenStyle(smartLabelStyle.CalloutLineDashStyle);
+
+ // Draw callout frame
+ if(smartLabelStyle.CalloutStyle == LabelCalloutStyle.Box)
+ {
+ // Fill callout box around the label
+ if(smartLabelStyle.CalloutBackColor != Color.Transparent)
+ {
+ using (Brush calloutBrush = new SolidBrush(smartLabelStyle.CalloutBackColor))
+ {
+ graph.FillRectangle(calloutBrush, labelRectAbs);
+ }
+ }
+
+ // Draw box border
+ graph.DrawRectangle(calloutPen, labelRectAbs.X, labelRectAbs.Y, labelRectAbs.Width, labelRectAbs.Height);
+ }
+
+ else if(smartLabelStyle.CalloutStyle == LabelCalloutStyle.Underlined)
+ {
+ if(labelAlignment == LabelAlignmentStyles.Right)
+ {
+ // Draw line to the left of label's text
+ graph.DrawLine(calloutPen, labelRectAbs.X, labelRectAbs.Top, labelRectAbs.X, labelRectAbs.Bottom);
+ }
+ else if(labelAlignment == LabelAlignmentStyles.Left)
+ {
+ // Draw line to the right of label's text
+ graph.DrawLine(calloutPen, labelRectAbs.Right, labelRectAbs.Top, labelRectAbs.Right, labelRectAbs.Bottom);
+ }
+ else if(labelAlignment == LabelAlignmentStyles.Bottom)
+ {
+ // Draw line on top of the label's text
+ graph.DrawLine(calloutPen, labelRectAbs.X, labelRectAbs.Top, labelRectAbs.Right, labelRectAbs.Top);
+ }
+ else
+ {
+ // Draw line under the label's text
+ graph.DrawLine(calloutPen, labelRectAbs.X, labelRectAbs.Bottom, labelRectAbs.Right, labelRectAbs.Bottom);
+ }
+ }
+
+ // Calculate connector line point on the label
+ PointF connectorPosition = graph.GetAbsolutePoint(labelPosition);
+ if(labelAlignment == LabelAlignmentStyles.Top)
+ {
+ connectorPosition.Y = labelRectAbs.Bottom;
+ }
+ else if(labelAlignment == LabelAlignmentStyles.Bottom)
+ {
+ connectorPosition.Y = labelRectAbs.Top;
+ }
+
+ if(smartLabelStyle.CalloutStyle == LabelCalloutStyle.Underlined)
+ {
+ if(labelAlignment == LabelAlignmentStyles.TopLeft ||
+ labelAlignment == LabelAlignmentStyles.TopRight ||
+ labelAlignment == LabelAlignmentStyles.BottomLeft ||
+ labelAlignment == LabelAlignmentStyles.BottomRight)
+ {
+ connectorPosition.Y = labelRectAbs.Bottom;
+ }
+ }
+
+ // Apply anchor cap settings
+ if(smartLabelStyle.CalloutLineAnchorCapStyle == LineAnchorCapStyle.Arrow)
+ {
+ //calloutPen.StartCap = LineCap.ArrowAnchor;
+ calloutPen.StartCap = LineCap.Custom;
+ calloutPen.CustomStartCap = new AdjustableArrowCap(calloutPen.Width + 2, calloutPen.Width + 3, true);
+ }
+ else if(smartLabelStyle.CalloutLineAnchorCapStyle == LineAnchorCapStyle.Diamond)
+ {
+ calloutPen.StartCap = LineCap.DiamondAnchor;
+ }
+ else if(smartLabelStyle.CalloutLineAnchorCapStyle == LineAnchorCapStyle.Round)
+ {
+ calloutPen.StartCap = LineCap.RoundAnchor;
+ }
+ else if(smartLabelStyle.CalloutLineAnchorCapStyle == LineAnchorCapStyle.Square)
+ {
+ calloutPen.StartCap = LineCap.SquareAnchor;
+ }
+
+ // Draw connection line between marker position and label
+ PointF markerPositionAbs = graph.GetAbsolutePoint(markerPosition);
+ graph.DrawLine(
+ calloutPen,
+ markerPositionAbs.X,
+ markerPositionAbs.Y,
+ connectorPosition.X,
+ connectorPosition.Y);
+ }
+
+ /// <summary>
+ /// Checks SmartLabelStyle collision.
+ /// </summary>
+ /// <param name="common">Reference to common elements.</param>
+ /// <param name="graph">Reference to chart graphics object.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="smartLabelStyle">Smart labels style.</param>
+ /// <param name="position">Original label position.</param>
+ /// <param name="size">Label text size.</param>
+ /// <param name="markerPosition">Marker position.</param>
+ /// <param name="format">Label string format.</param>
+ /// <param name="labelAlignment">Label alignment.</param>
+ /// <param name="checkCalloutLineOverlapping">Indicates that labels overlapping by callout line must be checked.</param>
+ /// <returns>True if label collides.</returns>
+ virtual internal bool IsSmartLabelCollide(
+ CommonElements common,
+ ChartGraphics graph,
+ ChartArea area,
+ SmartLabelStyle smartLabelStyle,
+ PointF position,
+ SizeF size,
+ PointF markerPosition,
+ StringFormat format,
+ LabelAlignmentStyles labelAlignment,
+ bool checkCalloutLineOverlapping)
+ {
+ bool collisionDetected = false;
+
+ // Calculate label position rectangle
+ RectangleF labelPosition = GetLabelPosition(graph, position, size, format, false);
+
+ // Check if label goes outside of the chart picture
+ if(labelPosition.X < 0f || labelPosition.Y < 0f ||
+ labelPosition.Bottom > 100f || labelPosition.Right > 100f)
+ {
+#if DEBUG
+ // DEBUG: Mark collided labels
+ if (graph != null && common!=null && common.Chart!=null && common.Chart.ShowDebugMarkings)
+ {
+ graph.Graphics.DrawRectangle(Pens.Cyan, Rectangle.Round(graph.GetAbsoluteRectangle(labelPosition)));
+ }
+#endif
+ collisionDetected = true;
+ }
+
+
+ // Check if label is drawn outside of plotting area (collides with axis?).
+ if(!collisionDetected && area != null)
+ {
+ if(area.chartAreaIsCurcular)
+ {
+ using( GraphicsPath areaPath = new GraphicsPath() )
+ {
+ // Add circular shape of the area into the graphics path
+ areaPath.AddEllipse(area.PlotAreaPosition.ToRectangleF());
+
+ if(smartLabelStyle.AllowOutsidePlotArea == LabelOutsidePlotAreaStyle.Partial)
+ {
+ PointF centerPos = new PointF(
+ labelPosition.X + labelPosition.Width/2f,
+ labelPosition.Y + labelPosition.Height/2f);
+ if(!areaPath.IsVisible(centerPos))
+ {
+ // DEBUG: Mark collided labels
+#if DEBUG
+ if(graph != null && common.Chart.ShowDebugMarkings)
+ {
+ graph.Graphics.DrawRectangle(Pens.Cyan, Rectangle.Round(graph.GetAbsoluteRectangle(labelPosition)));
+ }
+#endif
+ collisionDetected = true;
+ }
+ }
+ else if(smartLabelStyle.AllowOutsidePlotArea == LabelOutsidePlotAreaStyle.No)
+ {
+ if(!areaPath.IsVisible(labelPosition.Location) ||
+ !areaPath.IsVisible(new PointF(labelPosition.Right, labelPosition.Y)) ||
+ !areaPath.IsVisible(new PointF(labelPosition.Right, labelPosition.Bottom)) ||
+ !areaPath.IsVisible(new PointF(labelPosition.X, labelPosition.Bottom)) )
+ {
+ // DEBUG: Mark collided labels
+#if DEBUG
+ if(graph != null && common.Chart.ShowDebugMarkings)
+ {
+ graph.Graphics.DrawRectangle(Pens.Cyan, Rectangle.Round(graph.GetAbsoluteRectangle(labelPosition)));
+ }
+#endif
+ collisionDetected = true;
+ }
+ }
+ }
+ }
+ else
+ {
+ if(smartLabelStyle.AllowOutsidePlotArea == LabelOutsidePlotAreaStyle.Partial)
+ {
+ PointF centerPos = new PointF(
+ labelPosition.X + labelPosition.Width/2f,
+ labelPosition.Y + labelPosition.Height/2f);
+ if(!area.PlotAreaPosition.ToRectangleF().Contains(centerPos))
+ {
+ // DEBUG: Mark collided labels
+#if DEBUG
+ if(graph != null && common.Chart.ShowDebugMarkings)
+ {
+ graph.Graphics.DrawRectangle(Pens.Cyan, Rectangle.Round(graph.GetAbsoluteRectangle(labelPosition)));
+ }
+#endif
+ collisionDetected = true;
+ }
+ }
+ else if(smartLabelStyle.AllowOutsidePlotArea == LabelOutsidePlotAreaStyle.No)
+ {
+ if(!area.PlotAreaPosition.ToRectangleF().Contains(labelPosition))
+ {
+ // DEBUG: Mark collided labels
+#if DEBUG
+ if(graph != null && common.Chart.ShowDebugMarkings)
+ {
+ graph.Graphics.DrawRectangle(Pens.Cyan, Rectangle.Round(graph.GetAbsoluteRectangle(labelPosition)));
+ }
+#endif
+ collisionDetected = true;
+ }
+ }
+ }
+ }
+
+ // Check if 1 collisuion is aceptable in case of cennter alignment
+ bool allowOneCollision =
+ (labelAlignment == LabelAlignmentStyles.Center && !smartLabelStyle.IsMarkerOverlappingAllowed) ? true : false;
+ if(this.checkAllCollisions)
+ {
+ allowOneCollision = false;
+ }
+
+
+ // Loop through all smart label positions
+ if(!collisionDetected && this.smartLabelsPositions != null)
+ {
+ int index = -1;
+ foreach(RectangleF pos in this.smartLabelsPositions)
+ {
+ // Increase index
+ ++index;
+
+ // Check if label collide with other labels or markers.
+ bool collision = pos.IntersectsWith(labelPosition);
+
+ // Check if label callout line collide with other labels or markers.
+ // Line may overlap markers!
+ if(!collision &&
+ checkCalloutLineOverlapping &&
+ index >= markersCount)
+ {
+ PointF labelCenter = new PointF(
+ labelPosition.X + labelPosition.Width / 2f,
+ labelPosition.Y + labelPosition.Height / 2f);
+ if(LineIntersectRectangle(pos, markerPosition, labelCenter))
+ {
+ collision = true;
+ }
+ }
+
+ // Collision detected
+ if(collision)
+ {
+ // Check if 1 collision allowed
+ if(allowOneCollision)
+ {
+ allowOneCollision = false;
+ continue;
+ }
+
+ // DEBUG: Mark collided labels
+#if DEBUG
+ if(graph != null &&
+ common.ChartPicture != null &&
+ common.ChartPicture.ChartGraph != null &&
+ common.Chart.ShowDebugMarkings)
+ {
+ common.ChartPicture.ChartGraph.Graphics.DrawRectangle(Pens.Blue, Rectangle.Round(common.ChartPicture.ChartGraph.GetAbsoluteRectangle(pos)));
+ common.ChartPicture.ChartGraph.Graphics.DrawRectangle(Pens.Red, Rectangle.Round(common.ChartPicture.ChartGraph.GetAbsoluteRectangle(labelPosition)));
+ }
+#endif
+ collisionDetected = true;
+ break;
+ }
+ }
+ }
+
+ return collisionDetected;
+ }
+
+ /// <summary>
+ /// Checks if rectangle intersected by the line.
+ /// </summary>
+ /// <param name="rect">Rectangle to be tested.</param>
+ /// <param name="point1">First line point.</param>
+ /// <param name="point2">Second line point.</param>
+ /// <returns>True if line intersects rectangle.</returns>
+ private bool LineIntersectRectangle(RectangleF rect, PointF point1, PointF point2)
+ {
+ // Check for horizontal line
+ if(point1.X == point2.X)
+ {
+ if(point1.X >= rect.X && point1.X <= rect.Right)
+ {
+ if(point1.Y < rect.Y && point2.Y < rect.Y)
+ {
+ return false;
+ }
+ if(point1.Y > rect.Bottom && point2.Y > rect.Bottom)
+ {
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ // Check for vertical line
+ if(point1.Y == point2.Y)
+ {
+ if(point1.Y >= rect.Y && point1.Y <= rect.Bottom)
+ {
+ if(point1.X < rect.X && point2.X < rect.X)
+ {
+ return false;
+ }
+ if(point1.X > rect.Right && point2.X > rect.Right)
+ {
+ return false;
+ }
+ return true;
+ }
+ return false;
+
+ }
+
+ // Check if line completly outside rectangle
+ if(point1.X < rect.X && point2.X < rect.X)
+ {
+ return false;
+ }
+ else if(point1.X > rect.Right && point2.X > rect.Right)
+ {
+ return false;
+ }
+ else if(point1.Y < rect.Y && point2.Y < rect.Y)
+ {
+ return false;
+ }
+ else if(point1.Y > rect.Bottom && point2.Y > rect.Bottom)
+ {
+ return false;
+ }
+
+ // Check if one of the points inside rectangle
+ if( rect.Contains(point1) ||
+ rect.Contains(point2) )
+ {
+ return true;
+ }
+
+ // Calculate intersection point of the line with each side of the rectangle
+ PointF intersection = CalloutAnnotation.GetIntersectionY(point1, point2, rect.Y);
+ if( rect.Contains(intersection))
+ {
+ return true;
+ }
+ intersection = CalloutAnnotation.GetIntersectionY(point1, point2, rect.Bottom);
+ if( rect.Contains(intersection))
+ {
+ return true;
+ }
+ intersection = CalloutAnnotation.GetIntersectionX(point1, point2, rect.X);
+ if( rect.Contains(intersection))
+ {
+ return true;
+ }
+ intersection = CalloutAnnotation.GetIntersectionX(point1, point2, rect.Right);
+ if( rect.Contains(intersection))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ /// <summary>
+ /// Adds positions of the series markers into the list.
+ /// </summary>
+ /// <param name="common">Reference to common elements.</param>
+ /// <param name="area">Chart area.</param>
+ virtual internal void AddMarkersPosition(
+ CommonElements common,
+ ChartArea area)
+ {
+ // Proceed only if there is no items in the list yet
+ if(this.smartLabelsPositions.Count == 0 && area != null)
+ {
+ // Get chart types registry
+ ChartTypeRegistry registry = common.ChartTypeRegistry;
+
+ // Loop through all the series from this chart area
+ foreach(Series series in common.DataManager.Series)
+ {
+ // Check if marker overapping is enabled for the series
+ if(series.ChartArea == area.Name &&
+ series.SmartLabelStyle.Enabled &&
+ !series.SmartLabelStyle.IsMarkerOverlappingAllowed)
+ {
+ // Get series chart type
+ IChartType chartType = registry.GetChartType(series.ChartTypeName);
+
+ // Add series markers positions into the list
+ chartType.AddSmartLabelMarkerPositions(common, area, series, this.smartLabelsPositions);
+ }
+ }
+
+
+
+ // Make sure labels do not intersect with scale breaks
+ foreach(Axis currentAxis in area.Axes)
+ {
+ // Check if scale breaks are defined and there are non zero spacing
+ if(currentAxis.ScaleBreakStyle.Spacing > 0.0
+ && currentAxis.ScaleSegments.Count > 0)
+ {
+ for(int index = 0; index < (currentAxis.ScaleSegments.Count - 1); index++)
+ {
+ // Get break position in pixel coordinates
+ RectangleF breakPosition = currentAxis.ScaleSegments[index].GetBreakLinePosition(common.graph, currentAxis.ScaleSegments[index + 1]);
+ breakPosition = common.graph.GetRelativeRectangle(breakPosition);
+
+ // Create array list if needed
+ if(this.smartLabelsPositions == null)
+ {
+ this.smartLabelsPositions = new ArrayList();
+ }
+
+ // Add label position into the list
+ this.smartLabelsPositions.Add(breakPosition);
+
+ }
+ }
+ }
+
+
+ }
+ }
+
+ /// <summary>
+ /// Adds single Smart Label position into the list.
+ /// </summary>
+ /// <param name="graph">Chart graphics object.</param>
+ /// <param name="position">Original label position.</param>
+ /// <param name="size">Label text size.</param>
+ /// <param name="format">Label string format.</param>
+ internal void AddSmartLabelPosition(
+ ChartGraphics graph,
+ PointF position,
+ SizeF size,
+ StringFormat format)
+ {
+ // Calculate label position rectangle
+ RectangleF labelPosition = GetLabelPosition(graph, position, size, format, false);
+
+ if(this.smartLabelsPositions == null)
+ {
+ this.smartLabelsPositions = new ArrayList();
+ }
+
+ // Add label position into the list
+ this.smartLabelsPositions.Add(labelPosition);
+ }
+
+ /// <summary>
+ /// Gets rectangle position of the label.
+ /// </summary>
+ /// <param name="graph">Chart graphics object.</param>
+ /// <param name="position">Original label position.</param>
+ /// <param name="size">Label text size.</param>
+ /// <param name="format">Label string format.</param>
+ /// <param name="adjustForDrawing">Result position is adjusted for drawing.</param>
+ /// <returns>Label rectangle position.</returns>
+ internal RectangleF GetLabelPosition(
+ ChartGraphics graph,
+ PointF position,
+ SizeF size,
+ StringFormat format,
+ bool adjustForDrawing)
+ {
+ // Calculate label position rectangle
+ RectangleF labelPosition = RectangleF.Empty;
+ labelPosition.Width = size.Width;
+ labelPosition.Height = size.Height;
+
+ // Calculate pixel size in relative coordiantes
+ SizeF pixelSize = SizeF.Empty;
+ if(graph != null)
+ {
+ pixelSize = graph.GetRelativeSize(new SizeF(1f, 1f));
+ }
+
+ if(format.Alignment == StringAlignment.Far)
+ {
+ labelPosition.X = position.X - size.Width;
+ if(adjustForDrawing && !pixelSize.IsEmpty)
+ {
+ labelPosition.X -= 4f*pixelSize.Width;
+ labelPosition.Width += 4f*pixelSize.Width;
+ }
+ }
+ else if(format.Alignment == StringAlignment.Near)
+ {
+ labelPosition.X = position.X;
+ if(adjustForDrawing && !pixelSize.IsEmpty)
+ {
+ labelPosition.Width += 4f*pixelSize.Width;
+ }
+ }
+ else if(format.Alignment == StringAlignment.Center)
+ {
+ labelPosition.X = position.X - size.Width/2F;
+ if(adjustForDrawing && !pixelSize.IsEmpty)
+ {
+ labelPosition.X -= 2f*pixelSize.Width;
+ labelPosition.Width += 4f*pixelSize.Width;
+ }
+ }
+
+ if(format.LineAlignment == StringAlignment.Far)
+ {
+ labelPosition.Y = position.Y - size.Height;
+ }
+ else if(format.LineAlignment == StringAlignment.Near)
+ {
+ labelPosition.Y = position.Y;
+ }
+ else if(format.LineAlignment == StringAlignment.Center)
+ {
+ labelPosition.Y = position.Y - size.Height/2F;
+ }
+
+ return labelPosition;
+ }
+
+ /// <summary>
+ /// Gets point position of the label.
+ /// </summary>
+ /// <param name="labelAlignment">Label alignment.</param>
+ /// <param name="markerPosition">Marker position.</param>
+ /// <param name="sizeMarker">Marker size.</param>
+ /// <param name="sizeFont">Label size.</param>
+ /// <param name="format">String format.</param>
+ /// <returns>Label point position.</returns>
+ private PointF CalculatePosition(
+ LabelAlignmentStyles labelAlignment,
+ PointF markerPosition,
+ SizeF sizeMarker,
+ SizeF sizeFont,
+ ref StringFormat format)
+ {
+ format.Alignment = StringAlignment.Near;
+ format.LineAlignment = StringAlignment.Center;
+
+ // Calculate label position
+ PointF position = new PointF(markerPosition.X, markerPosition.Y);
+ switch(labelAlignment)
+ {
+ case LabelAlignmentStyles.Center:
+ format.Alignment = StringAlignment.Center;
+ break;
+ case LabelAlignmentStyles.Bottom:
+ format.Alignment = StringAlignment.Center;
+ position.Y += sizeMarker.Height / 1.75F;
+ position.Y += sizeFont.Height/ 2F;
+ break;
+ case LabelAlignmentStyles.Top:
+ format.Alignment = StringAlignment.Center;
+ position.Y -= sizeMarker.Height / 1.75F;
+ position.Y -= sizeFont.Height/ 2F;
+ break;
+ case LabelAlignmentStyles.Left:
+ format.Alignment = StringAlignment.Far;
+ position.X -= sizeMarker.Height / 1.75F;
+ break;
+ case LabelAlignmentStyles.TopLeft:
+ format.Alignment = StringAlignment.Far;
+ position.X -= sizeMarker.Height / 1.75F;
+ position.Y -= sizeMarker.Height / 1.75F;
+ position.Y -= sizeFont.Height/ 2F;
+ break;
+ case LabelAlignmentStyles.BottomLeft:
+ format.Alignment = StringAlignment.Far;
+ position.X -= sizeMarker.Height / 1.75F;
+ position.Y += sizeMarker.Height / 1.75F;
+ position.Y += sizeFont.Height/ 2F;
+ break;
+ case LabelAlignmentStyles.Right:
+ position.X += sizeMarker.Height / 1.75F;
+ break;
+ case LabelAlignmentStyles.TopRight:
+ position.X += sizeMarker.Height / 1.75F;
+ position.Y -= sizeMarker.Height / 1.75F;
+ position.Y -= sizeFont.Height/ 2F;
+ break;
+ case LabelAlignmentStyles.BottomRight:
+ position.X += sizeMarker.Height / 1.75F;
+ position.Y += sizeMarker.Height / 1.75F;
+ position.Y += sizeFont.Height/ 2F;
+ break;
+ }
+
+ return position;
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// AnnotationSmartLabel class provides SmartLabelStyle functionality
+ /// specific to the annotation objects.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeAnnotationSmartLabels_AnnotationSmartLabels"),
+ ]
+ internal class AnnotationSmartLabel : SmartLabel
+ {
+ #region Constructors and initialization
+
+ /// <summary>
+ /// Default public constructor.
+ /// </summary>
+ public AnnotationSmartLabel()
+ {
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Checks SmartLabelStyle collision.
+ /// </summary>
+ /// <param name="common">Reference to common elements.</param>
+ /// <param name="graph">Reference to chart graphics object.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="smartLabelStyle">Smart labels style.</param>
+ /// <param name="position">Original label position.</param>
+ /// <param name="size">Label text size.</param>
+ /// <param name="markerPosition">Marker position.</param>
+ /// <param name="format">Label string format.</param>
+ /// <param name="labelAlignment">Label alignment.</param>
+ /// <param name="checkCalloutLineOverlapping">Indicates that labels overlapping by callout line must be checked.</param>
+ /// <returns>True if label collides.</returns>
+ override internal bool IsSmartLabelCollide(
+ CommonElements common,
+ ChartGraphics graph,
+ ChartArea area,
+ SmartLabelStyle smartLabelStyle,
+ PointF position,
+ SizeF size,
+ PointF markerPosition,
+ StringFormat format,
+ LabelAlignmentStyles labelAlignment,
+ bool checkCalloutLineOverlapping)
+ {
+ bool collisionDetected = false;
+
+ //*******************************************************************
+ //** Check collision with smatl labels of series in chart area
+ //*******************************************************************
+ if (area != null && area.Visible)
+ {
+ area.smartLabels.checkAllCollisions = true;
+ if (area.smartLabels.IsSmartLabelCollide(
+ common,
+ graph,
+ area,
+ smartLabelStyle,
+ position,
+ size,
+ markerPosition,
+ format,
+ labelAlignment,
+ checkCalloutLineOverlapping) )
+ {
+ area.smartLabels.checkAllCollisions = false;
+ return true;
+ }
+ area.smartLabels.checkAllCollisions = false;
+ }
+
+ //*******************************************************************
+ //** Check collision with other annotations.
+ //*******************************************************************
+
+ // Calculate label position rectangle
+ RectangleF labelPosition = GetLabelPosition(graph, position, size, format, false);
+
+ // Check if 1 collisuion is aceptable in case of cennter alignment
+ bool allowOneCollision =
+ (labelAlignment == LabelAlignmentStyles.Center && !smartLabelStyle.IsMarkerOverlappingAllowed) ? true : false;
+ if(this.checkAllCollisions)
+ {
+ allowOneCollision = false;
+ }
+
+ // Check if label collide with other labels or markers.
+ foreach(RectangleF pos in this.smartLabelsPositions)
+ {
+ if(pos.IntersectsWith(labelPosition))
+ {
+ // Check if 1 collision allowed
+ if(allowOneCollision)
+ {
+ allowOneCollision = false;
+ continue;
+ }
+
+ // DEBUG: Mark collided labels
+#if DEBUG
+ if(graph != null && common.Chart.ShowDebugMarkings)
+ {
+ graph.Graphics.DrawRectangle(Pens.Blue, Rectangle.Round(graph.GetAbsoluteRectangle(pos)));
+ graph.Graphics.DrawRectangle(Pens.Red, Rectangle.Round(graph.GetAbsoluteRectangle(labelPosition)));
+ }
+#endif
+ collisionDetected = true;
+ break;
+ }
+ }
+
+ return collisionDetected;
+ }
+
+ /// <summary>
+ /// Adds positions of the series markers into the list.
+ /// </summary>
+ /// <param name="common">Reference to common elements.</param>
+ /// <param name="area">Chart area.</param>
+ override internal void AddMarkersPosition(
+ CommonElements common,
+ ChartArea area)
+ {
+ // Proceed only if there is no items in the list yet
+ if(this.smartLabelsPositions.Count == 0 &&
+ common != null &&
+ common.Chart != null)
+ {
+ // Add annotations anchor points
+ foreach(Annotation annotation in common.Chart.Annotations)
+ {
+ annotation.AddSmartLabelMarkerPositions(this.smartLabelsPositions);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Process single SmartLabelStyle by adjusting it's position in case of collision.
+ /// </summary>
+ /// <param name="common">Reference to common elements.</param>
+ /// <param name="graph">Reference to chart graphics object.</param>
+ /// <param name="area">Chart area.</param>
+ /// <param name="smartLabelStyle">Smart labels style.</param>
+ /// <param name="labelPosition">Original label position.</param>
+ /// <param name="labelSize">Label text size.</param>
+ /// <param name="format">Label string format.</param>
+ /// <param name="markerPosition">Marker position.</param>
+ /// <param name="markerSize">Marker size.</param>
+ /// <param name="labelAlignment">Label alignment.</param>
+ /// <returns>Adjusted position of the label.</returns>
+ override internal void DrawCallout(
+ CommonElements common,
+ ChartGraphics graph,
+ ChartArea area,
+ SmartLabelStyle smartLabelStyle,
+ PointF labelPosition,
+ SizeF labelSize,
+ StringFormat format,
+ PointF markerPosition,
+ SizeF markerSize,
+ LabelAlignmentStyles labelAlignment)
+ {
+ // No callout is drawn for the annotations
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Statistics.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Statistics.cs
new file mode 100644
index 00000000000..2f5461831b3
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Statistics.cs
@@ -0,0 +1,1671 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: StatisticFormula.cs
+//
+// Namespace: DataVisualization.Charting
+//
+// Classes: StatisticFormula, TTestResult, FTestResult, AnovaResult,
+// ZTestResult
+//
+// Purpose: StatisticFormula class provides helper methods for statistical
+// calculations like TTest, FTest, Anova, ZTest and others.
+// Actual calculations are made in the DataFormula class and
+// the StatisticFormula class mange formula parameters, input and
+// output series.
+//
+// TTestResult, FTestResult, AnovaResult and ZTestResult
+// classes are used to store the results of the calculatiions.
+//
+// StatisticFormula class is exposed to the user through
+// DataManipulator.StatisticFormula property. Here is an example of
+// using the Anova test:
+//
+// AnovaResult result = Chart1.DataManipulator.StatisticFormula.Anova(0.6, "Group1,Group2,Group3");
+//
+// NOTE: First versions of the chart use single method to execute
+// ALL formulas. Formula name and parameters were passed as
+// strings. Input and outpat data was passed through data
+// series.
+//
+// This approach was hard to use by the end-user and was
+// changed to a specific method for each formula. StatisticFormula
+// class provides that simplified interface for all statistics
+// formulas. Internally it still uses the DataFormula.Formula
+// method with string parameters.
+//
+// Reviewed: AG - April 1, 2003
+// AG - Microsoft 14, 2007
+//
+//===================================================================
+
+using System;
+using System.Diagnostics.CodeAnalysis;
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ /// <summary>
+ /// The StatisticFormula class provides helper methods for statistical calculations.
+ /// Actual calculations are made in the DataFormula class and the StatisticFormula
+ /// class provide a simplified API which automatically prepares parameters and
+ /// deals with input and output series.
+ /// </summary>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class StatisticFormula
+ {
+ #region Fields
+
+ // Name used for temporary data series
+ private string _tempOutputSeriesName = "Statistical Analyses Formula Temporary Output Series 2552003";
+
+ // Reference to the class which describes calculation settings and
+ // provides access to chart common elements.
+ private DataFormula _formulaData = null;
+
+ #endregion // Fields
+
+ #region Constructor
+
+ /// <summary>
+ /// StatisticFormula Constructor
+ /// </summary>
+ /// <param name="formulaData">Formula Data</param>
+ internal StatisticFormula( DataFormula formulaData )
+ {
+ this._formulaData = formulaData;
+ }
+
+ #endregion // Constructor
+
+ #region Tests
+
+ /// <summary>
+ /// This formula performs a Z Test using Normal distribution.
+ /// </summary>
+ /// <param name="hypothesizedMeanDifference">Hypothesized mean difference.</param>
+ /// <param name="varianceFirstGroup">Variance first group.</param>
+ /// <param name="varianceSecondGroup">Variance second group.</param>
+ /// <param name="probability">Probability.</param>
+ /// <param name="firstInputSeriesName">First input series name.</param>
+ /// <param name="secondInputSeriesName">Second input series name.</param>
+ /// <returns>ZTestResult object.</returns>
+ public ZTestResult ZTest(
+ double hypothesizedMeanDifference,
+ double varianceFirstGroup,
+ double varianceSecondGroup,
+ double probability,
+ string firstInputSeriesName,
+ string secondInputSeriesName )
+ {
+ // Check arguments
+ if (firstInputSeriesName == null)
+ throw new ArgumentNullException("firstInputSeriesName");
+ if (secondInputSeriesName == null)
+ throw new ArgumentNullException("secondInputSeriesName");
+
+ // Create output class
+ ZTestResult zTestResult = new ZTestResult();
+
+ // Make string with parameters
+ string parameter = hypothesizedMeanDifference.ToString(System.Globalization.CultureInfo.InvariantCulture);
+ parameter += "," + varianceFirstGroup.ToString(System.Globalization.CultureInfo.InvariantCulture);
+ parameter += "," + varianceSecondGroup.ToString(System.Globalization.CultureInfo.InvariantCulture);
+ parameter += "," + probability.ToString(System.Globalization.CultureInfo.InvariantCulture);
+
+ // Create temporary output series.
+ _formulaData.Common.DataManager.Series.Add( new Series(_tempOutputSeriesName) );
+
+ // Set input series string
+ string inputSeriesParameter = firstInputSeriesName.ToString(System.Globalization.CultureInfo.InvariantCulture) + "," + secondInputSeriesName.ToString(System.Globalization.CultureInfo.InvariantCulture);
+
+ // Execute formula
+ try
+ {
+ _formulaData.Formula("ZTest", parameter, inputSeriesParameter, _tempOutputSeriesName);
+
+ DataPointCollection points = _formulaData.Common.DataManager.Series[_tempOutputSeriesName].Points;
+
+ // Fill Output class
+ zTestResult.firstSeriesMean = points[0].YValues[0];
+ zTestResult.secondSeriesMean = points[1].YValues[0];
+ zTestResult.firstSeriesVariance = points[2].YValues[0];
+ zTestResult.secondSeriesVariance = points[3].YValues[0];
+ zTestResult.zValue = points[4].YValues[0];
+ zTestResult.probabilityZOneTail = points[5].YValues[0];
+ zTestResult.zCriticalValueOneTail = points[6].YValues[0];
+ zTestResult.probabilityZTwoTail = points[7].YValues[0];
+ zTestResult.zCriticalValueTwoTail = points[8].YValues[0];
+ }
+ finally
+ {
+ // Remove Temporary output series
+ _formulaData.Common.DataManager.Series.Remove(_formulaData.Common.DataManager.Series[_tempOutputSeriesName]);
+ }
+
+ // Return result class
+ return zTestResult;
+
+ }
+
+ /// <summary>
+ /// Perform a T Test using Students distribution (T distribution) with unequal variances.
+ /// </summary>
+ /// <param name="hypothesizedMeanDifference">Hypothesized mean difference.</param>
+ /// <param name="probability">Probability.</param>
+ /// <param name="firstInputSeriesName">First input series name.</param>
+ /// <param name="secondInputSeriesName">Second input series name.</param>
+ /// <returns>TTestResult object.</returns>
+ public TTestResult TTestUnequalVariances(
+ double hypothesizedMeanDifference,
+ double probability,
+ string firstInputSeriesName,
+ string secondInputSeriesName )
+ {
+ // Check arguments
+ if (firstInputSeriesName == null)
+ throw new ArgumentNullException("firstInputSeriesName");
+ if (secondInputSeriesName == null)
+ throw new ArgumentNullException("secondInputSeriesName");
+
+ // Create output class
+ TTestResult tTestResult = new TTestResult();
+
+ // Make string with parameters
+ string parameter = hypothesizedMeanDifference.ToString(System.Globalization.CultureInfo.InvariantCulture);
+ parameter += "," + probability.ToString(System.Globalization.CultureInfo.InvariantCulture);
+
+ // Create temporary output series.
+ _formulaData.Common.DataManager.Series.Add( new Series(_tempOutputSeriesName) );
+
+ // Set input series string
+ try
+ {
+ string inputSeriesParameter = firstInputSeriesName.ToString(System.Globalization.CultureInfo.InvariantCulture) + "," + secondInputSeriesName.ToString(System.Globalization.CultureInfo.InvariantCulture);
+
+ // Execute formula
+ _formulaData.Formula("TTestUnequalVariances", parameter, inputSeriesParameter, _tempOutputSeriesName);
+
+ DataPointCollection points = _formulaData.Common.DataManager.Series[_tempOutputSeriesName].Points;
+
+ // Fill Output class
+ tTestResult.firstSeriesMean = points[0].YValues[0];
+ tTestResult.secondSeriesMean = points[1].YValues[0];
+ tTestResult.firstSeriesVariance = points[2].YValues[0];
+ tTestResult.secondSeriesVariance = points[3].YValues[0];
+ tTestResult.tValue = points[4].YValues[0];
+ tTestResult.degreeOfFreedom = points[5].YValues[0];
+ tTestResult.probabilityTOneTail = points[6].YValues[0];
+ tTestResult.tCriticalValueOneTail = points[7].YValues[0];
+ tTestResult.probabilityTTwoTail = points[8].YValues[0];
+ tTestResult.tCriticalValueTwoTail = points[9].YValues[0];
+ }
+ finally
+ {
+ // Remove Temporary output series
+ _formulaData.Common.DataManager.Series.Remove(_formulaData.Common.DataManager.Series[_tempOutputSeriesName]);
+ }
+
+ // Return result class
+ return tTestResult;
+
+ }
+
+ /// <summary>
+ /// Perform a T Test using Students distribution (T distribution) with equal variances.
+ /// </summary>
+ /// <param name="hypothesizedMeanDifference">Hypothesized mean difference.</param>
+ /// <param name="probability">Probability.</param>
+ /// <param name="firstInputSeriesName">First input series name.</param>
+ /// <param name="secondInputSeriesName">Second input series name.</param>
+ /// <returns>TTestResult object.</returns>
+ public TTestResult TTestEqualVariances(
+ double hypothesizedMeanDifference,
+ double probability,
+ string firstInputSeriesName,
+ string secondInputSeriesName )
+ {
+ // Check arguments
+ if (firstInputSeriesName == null)
+ throw new ArgumentNullException("firstInputSeriesName");
+ if (secondInputSeriesName == null)
+ throw new ArgumentNullException("secondInputSeriesName");
+
+ // Create output class
+ TTestResult tTestResult = new TTestResult();
+
+ // Make string with parameters
+ string parameter = hypothesizedMeanDifference.ToString(System.Globalization.CultureInfo.InvariantCulture);
+ parameter += "," + probability.ToString(System.Globalization.CultureInfo.InvariantCulture);
+
+ // Create temporary output series.
+ _formulaData.Common.DataManager.Series.Add( new Series(_tempOutputSeriesName) );
+
+ // Set input series string
+ string inputSeriesParameter = firstInputSeriesName.ToString(System.Globalization.CultureInfo.InvariantCulture) + "," + secondInputSeriesName.ToString(System.Globalization.CultureInfo.InvariantCulture);
+
+ // Execute formula
+ try
+ {
+ _formulaData.Formula("TTestEqualVariances", parameter, inputSeriesParameter, _tempOutputSeriesName);
+
+ DataPointCollection points = _formulaData.Common.DataManager.Series[_tempOutputSeriesName].Points;
+
+ // Fill Output class
+ tTestResult.firstSeriesMean = points[0].YValues[0];
+ tTestResult.secondSeriesMean = points[1].YValues[0];
+ tTestResult.firstSeriesVariance = points[2].YValues[0];
+ tTestResult.secondSeriesVariance = points[3].YValues[0];
+ tTestResult.tValue = points[4].YValues[0];
+ tTestResult.degreeOfFreedom = points[5].YValues[0];
+ tTestResult.probabilityTOneTail = points[6].YValues[0];
+ tTestResult.tCriticalValueOneTail = points[7].YValues[0];
+ tTestResult.probabilityTTwoTail = points[8].YValues[0];
+ tTestResult.tCriticalValueTwoTail = points[9].YValues[0];
+ }
+ finally
+ {
+ // Remove Temporary output series
+ _formulaData.Common.DataManager.Series.Remove(_formulaData.Common.DataManager.Series[_tempOutputSeriesName]);
+ }
+
+ // Return result class
+ return tTestResult;
+ }
+
+ /// <summary>
+ /// Performs a T Test using Students distribution (T distribution) with paired samples.
+ /// This is useful when there is a natural pairing of observations in samples.
+ /// </summary>
+ /// <param name="hypothesizedMeanDifference">Hypothesized mean difference.</param>
+ /// <param name="probability">Probability.</param>
+ /// <param name="firstInputSeriesName">First input series name.</param>
+ /// <param name="secondInputSeriesName">Second input series name.</param>
+ /// <returns>TTestResult object.</returns>
+ public TTestResult TTestPaired(
+ double hypothesizedMeanDifference,
+ double probability,
+ string firstInputSeriesName,
+ string secondInputSeriesName )
+ {
+ // Check arguments
+ if (firstInputSeriesName == null)
+ throw new ArgumentNullException("firstInputSeriesName");
+ if (secondInputSeriesName == null)
+ throw new ArgumentNullException("secondInputSeriesName");
+
+ // Create output class
+ TTestResult tTestResult = new TTestResult();
+
+ // Make string with parameters
+ string parameter = hypothesizedMeanDifference.ToString(System.Globalization.CultureInfo.InvariantCulture);
+ parameter += "," + probability.ToString(System.Globalization.CultureInfo.InvariantCulture);
+
+ // Create temporary output series.
+ _formulaData.Common.DataManager.Series.Add( new Series(_tempOutputSeriesName) );
+
+ // Set input series string
+ string inputSeriesParameter = firstInputSeriesName.ToString(System.Globalization.CultureInfo.InvariantCulture) + "," + secondInputSeriesName.ToString(System.Globalization.CultureInfo.InvariantCulture);
+
+ // Execute formula
+ try
+ {
+ _formulaData.Formula("TTestPaired", parameter, inputSeriesParameter, _tempOutputSeriesName);
+
+ DataPointCollection points = _formulaData.Common.DataManager.Series[_tempOutputSeriesName].Points;
+
+ // Fill Output class
+ tTestResult.firstSeriesMean = points[0].YValues[0];
+ tTestResult.secondSeriesMean = points[1].YValues[0];
+ tTestResult.firstSeriesVariance = points[2].YValues[0];
+ tTestResult.secondSeriesVariance = points[3].YValues[0];
+ tTestResult.tValue = points[4].YValues[0];
+ tTestResult.degreeOfFreedom = points[5].YValues[0];
+ tTestResult.probabilityTOneTail = points[6].YValues[0];
+ tTestResult.tCriticalValueOneTail = points[7].YValues[0];
+ tTestResult.probabilityTTwoTail = points[8].YValues[0];
+ tTestResult.tCriticalValueTwoTail = points[9].YValues[0];
+ }
+ finally
+ {
+ // Remove Temporary output series
+ _formulaData.Common.DataManager.Series.Remove(_formulaData.Common.DataManager.Series[_tempOutputSeriesName]);
+ }
+
+ // Return result class
+ return tTestResult;
+
+ }
+
+ /// <summary>
+ /// Removes empty points from series.
+ /// </summary>
+ /// <param name="seriesName">series name</param>
+ private void RemoveEmptyPoints(string seriesName)
+ {
+ Series series = _formulaData.Common.DataManager.Series[seriesName];
+ for (int pointIndex = 0; pointIndex < series.Points.Count; pointIndex++)
+ {
+ if (series.Points[pointIndex].IsEmpty)
+ {
+ series.Points.RemoveAt(pointIndex--);
+ }
+ }
+ }
+
+ /// <summary>
+ /// This formula performs a two-sample F Test using the F distribution, and is used to see if the samples have different variances.
+ /// </summary>
+ /// <param name="probability">Probability.</param>
+ /// <param name="firstInputSeriesName">First input series name.</param>
+ /// <param name="secondInputSeriesName">Second input series name.</param>
+ /// <returns>FTestResult object.</returns>
+ public FTestResult FTest(
+ double probability,
+ string firstInputSeriesName,
+ string secondInputSeriesName )
+ {
+ // Check arguments
+ if (firstInputSeriesName == null)
+ throw new ArgumentNullException("firstInputSeriesName");
+ if (secondInputSeriesName == null)
+ throw new ArgumentNullException("secondInputSeriesName");
+
+ // Create output class
+ FTestResult fTestResult = new FTestResult();
+
+ // Make string with parameters
+ string parameter = probability.ToString(System.Globalization.CultureInfo.InvariantCulture);
+
+ // Set input series string
+ string inputSeriesParameter = firstInputSeriesName.ToString(System.Globalization.CultureInfo.InvariantCulture) + "," + secondInputSeriesName.ToString(System.Globalization.CultureInfo.InvariantCulture);
+
+ // Create temporary output series.
+ _formulaData.Common.DataManager.Series.Add( new Series(_tempOutputSeriesName) );
+
+
+ // remove empty points from the collection.
+ RemoveEmptyPoints(firstInputSeriesName);
+ RemoveEmptyPoints(secondInputSeriesName);
+
+ // Execute formula
+ try
+ {
+ _formulaData.Formula("FTest", parameter, inputSeriesParameter, _tempOutputSeriesName);
+
+ DataPointCollection points = _formulaData.Common.DataManager.Series[_tempOutputSeriesName].Points;
+
+ // Fill Output class
+ fTestResult.firstSeriesMean = points[0].YValues[0];
+ fTestResult.secondSeriesMean = points[1].YValues[0];
+ fTestResult.firstSeriesVariance = points[2].YValues[0];
+ fTestResult.secondSeriesVariance = points[3].YValues[0];
+ fTestResult.fValue = points[4].YValues[0];
+ fTestResult.probabilityFOneTail = points[5].YValues[0];
+ fTestResult.fCriticalValueOneTail = points[6].YValues[0];
+ }
+ finally
+ {
+ // Remove Temporary output series
+ _formulaData.Common.DataManager.Series.Remove(_formulaData.Common.DataManager.Series[_tempOutputSeriesName]);
+ }
+
+ // Return result class
+ return fTestResult;
+
+ }
+
+
+ /// <summary>
+ /// An Anova test is used to determine the existence, or absence of a statistically
+ /// significant difference between the mean values of two or more groups of data.
+ /// </summary>
+ /// <param name="probability">Probability.</param>
+ /// <param name="inputSeriesNames">Comma-delimited list of input series names.</param>
+ /// <returns>AnovaResult object.</returns>
+ public AnovaResult Anova(
+ double probability,
+ string inputSeriesNames)
+ {
+ // Check arguments
+ if (inputSeriesNames == null)
+ throw new ArgumentNullException("inputSeriesNames");
+
+ // Create output class
+ AnovaResult anovaResult = new AnovaResult();
+
+ // Make string with parameters
+ string parameter = probability.ToString(System.Globalization.CultureInfo.InvariantCulture);
+
+ // Create temporary output series.
+ _formulaData.Common.DataManager.Series.Add( new Series(_tempOutputSeriesName) );
+
+ // Execute formula
+ try
+ {
+ _formulaData.Formula("Anova", parameter, inputSeriesNames, _tempOutputSeriesName);
+
+ DataPointCollection points = _formulaData.Common.DataManager.Series[_tempOutputSeriesName].Points;
+
+ // Fill Output class
+ anovaResult.sumOfSquaresBetweenGroups = points[0].YValues[0];
+ anovaResult.sumOfSquaresWithinGroups = points[1].YValues[0];
+ anovaResult.sumOfSquaresTotal = points[2].YValues[0];
+ anovaResult.degreeOfFreedomBetweenGroups = points[3].YValues[0];
+ anovaResult.degreeOfFreedomWithinGroups = points[4].YValues[0];
+ anovaResult.degreeOfFreedomTotal = points[5].YValues[0];
+ anovaResult.meanSquareVarianceBetweenGroups = points[6].YValues[0];
+ anovaResult.meanSquareVarianceWithinGroups = points[7].YValues[0];
+ anovaResult.fRatio = points[8].YValues[0];
+ anovaResult.fCriticalValue = points[9].YValues[0];
+ }
+ finally
+ {
+ // Remove Temporary output series
+ _formulaData.Common.DataManager.Series.Remove(_formulaData.Common.DataManager.Series[_tempOutputSeriesName]);
+ }
+
+ // Return result class
+ return anovaResult;
+ }
+
+ #endregion // Test
+
+ #region Distributions
+
+ /// <summary>
+ /// This method returns the probability for the standard normal cumulative distribution function.
+ /// </summary>
+ /// <param name="zValue">The Z value for which the probability is required.</param>
+ /// <returns>Returns value from the standard normal cumulative distribution function.</returns>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "Z is a cartesian coordinate and well understood")]
+ public double NormalDistribution(double zValue)
+ {
+ // Make string with parameters
+ string parameter = zValue.ToString(System.Globalization.CultureInfo.InvariantCulture);
+
+ // Create temporary output series.
+ _formulaData.Common.DataManager.Series.Add( new Series(_tempOutputSeriesName) );
+
+ // Execute formula
+ double result = double.NaN;
+ try
+ {
+ _formulaData.Formula("NormalDistribution", parameter, _tempOutputSeriesName, _tempOutputSeriesName);
+
+ DataPointCollection points = _formulaData.Common.DataManager.Series[_tempOutputSeriesName].Points;
+
+ // Fill Output class
+ result = points[0].YValues[0];
+ }
+ finally
+ {
+ // Remove Temporary output series
+ _formulaData.Common.DataManager.Series.Remove(_formulaData.Common.DataManager.Series[_tempOutputSeriesName]);
+ }
+
+ // Return result class
+ return result;
+
+ }
+
+ /// <summary>
+ /// This method returns the inverse of the standard normal cumulative distribution.
+ /// </summary>
+ /// <param name="probability">Probability.</param>
+ /// <returns>Returns value from the inverse standard normal cumulative distribution function.</returns>
+ public double InverseNormalDistribution( double probability )
+ {
+
+ // Make string with parameters
+ string parameter = probability.ToString(System.Globalization.CultureInfo.InvariantCulture);
+
+ // Create temporary output series.
+ _formulaData.Common.DataManager.Series.Add( new Series(_tempOutputSeriesName) );
+
+ // Execute formula
+ double result = double.NaN;
+ try
+ {
+ _formulaData.Formula("InverseNormalDistribution", parameter, _tempOutputSeriesName, _tempOutputSeriesName);
+
+ DataPointCollection points = _formulaData.Common.DataManager.Series[_tempOutputSeriesName].Points;
+
+ // Fill Output class
+ result = points[0].YValues[0];
+ }
+ finally
+ {
+ // Remove Temporary output series
+ _formulaData.Common.DataManager.Series.Remove(_formulaData.Common.DataManager.Series[_tempOutputSeriesName]);
+ }
+
+ // Return result class
+ return result;
+ }
+
+ /// <summary>
+ /// This method returns the cumulative F distribution function probability.
+ /// </summary>
+ /// <param name="value">F Value.</param>
+ /// <param name="firstDegreeOfFreedom">First degree of freedom.</param>
+ /// <param name="secondDegreeOfFreedom">Second degree of freedom.</param>
+ /// <returns>Returns value from the cumulative F distribution function.</returns>
+ public double FDistribution(
+ double value,
+ int firstDegreeOfFreedom,
+ int secondDegreeOfFreedom )
+ {
+
+ // Make string with parameters
+ string parameter = value.ToString(System.Globalization.CultureInfo.InvariantCulture);
+ parameter += "," + firstDegreeOfFreedom.ToString(System.Globalization.CultureInfo.InvariantCulture);
+ parameter += "," + secondDegreeOfFreedom.ToString(System.Globalization.CultureInfo.InvariantCulture);
+
+ // Create temporary output series.
+ _formulaData.Common.DataManager.Series.Add( new Series(_tempOutputSeriesName) );
+
+ // Execute formula
+ double result = double.NaN;
+ try
+ {
+ _formulaData.Formula("FDistribution", parameter, _tempOutputSeriesName, _tempOutputSeriesName);
+
+ DataPointCollection points = _formulaData.Common.DataManager.Series[_tempOutputSeriesName].Points;
+
+ // Fill Output class
+ result = points[0].YValues[0];
+ }
+ finally
+ {
+ // Remove Temporary output series
+ _formulaData.Common.DataManager.Series.Remove(_formulaData.Common.DataManager.Series[_tempOutputSeriesName]);
+ }
+
+ // Return result class
+ return result;
+ }
+
+ /// <summary>
+ /// Returns the inverse of the F cumulative distribution.
+ /// </summary>
+ /// <param name="probability">Probability.</param>
+ /// <param name="firstDegreeOfFreedom">First degree of freedom.</param>
+ /// <param name="secondDegreeOfFreedom">Second degree of freedom.</param>
+ /// <returns>Returns value from the inverse F distribution function.</returns>
+ public double InverseFDistribution(
+ double probability,
+ int firstDegreeOfFreedom,
+ int secondDegreeOfFreedom )
+ {
+
+ // Make string with parameters
+ string parameter = probability.ToString(System.Globalization.CultureInfo.InvariantCulture);
+ parameter += "," + firstDegreeOfFreedom.ToString(System.Globalization.CultureInfo.InvariantCulture);
+ parameter += "," + secondDegreeOfFreedom.ToString(System.Globalization.CultureInfo.InvariantCulture);
+
+ // Create temporary output series.
+ _formulaData.Common.DataManager.Series.Add( new Series(_tempOutputSeriesName) );
+
+ // Execute formula
+ double result = double.NaN;
+ try
+ {
+ _formulaData.Formula("InverseFDistribution", parameter, _tempOutputSeriesName, _tempOutputSeriesName);
+
+ DataPointCollection points = _formulaData.Common.DataManager.Series[_tempOutputSeriesName].Points;
+
+ // Fill Output class
+ result = points[0].YValues[0];
+ }
+ finally
+ {
+ // Remove Temporary output series
+ _formulaData.Common.DataManager.Series.Remove(_formulaData.Common.DataManager.Series[_tempOutputSeriesName]);
+ }
+
+ // Return result class
+ return result;
+ }
+
+ /// <summary>
+ /// Returns the probability for the T distribution (student's distribution).
+ /// </summary>
+ /// <param name="value">T value</param>
+ /// <param name="degreeOfFreedom">Degree of freedom</param>
+ /// <param name="oneTail">If true, one-tailed distribution is used; otherwise two-tailed distribution is used.</param>
+ /// <returns>Returns T Distribution cumulative function</returns>
+ public double TDistribution(
+ double value,
+ int degreeOfFreedom,
+ bool oneTail )
+ {
+
+ // Make string with parameters
+ string parameter = value.ToString(System.Globalization.CultureInfo.InvariantCulture);
+ parameter += "," + degreeOfFreedom.ToString(System.Globalization.CultureInfo.InvariantCulture);
+ if( oneTail )
+ {
+ parameter += ",1";
+ }
+ else
+ {
+ parameter += ",2";
+ }
+
+
+ // Create temporary output series.
+ _formulaData.Common.DataManager.Series.Add( new Series(_tempOutputSeriesName) );
+
+ // Execute formula
+ double result = double.NaN;
+ try
+ {
+ _formulaData.Formula("TDistribution", parameter, _tempOutputSeriesName, _tempOutputSeriesName);
+
+ DataPointCollection points = _formulaData.Common.DataManager.Series[_tempOutputSeriesName].Points;
+
+ // Fill Output class
+ result = points[0].YValues[0];
+ }
+ finally
+ {
+ // Remove Temporary output series
+ _formulaData.Common.DataManager.Series.Remove(_formulaData.Common.DataManager.Series[_tempOutputSeriesName]);
+ }
+
+ // Return result class
+ return result;
+
+ }
+
+ /// <summary>
+ /// Returns the T-value of the T distribution as a function of probability and degrees of freedom.
+ /// </summary>
+ /// <param name="probability">Probability.</param>
+ /// <param name="degreeOfFreedom">Degree of freedom.</param>
+ /// <returns>Returns Inverse T distribution.</returns>
+ public double InverseTDistribution(
+ double probability,
+ int degreeOfFreedom )
+ {
+
+ // Make string with parameters
+ string parameter = probability.ToString(System.Globalization.CultureInfo.InvariantCulture);
+ parameter += "," + degreeOfFreedom.ToString(System.Globalization.CultureInfo.InvariantCulture);
+
+ // Create temporary output series.
+ _formulaData.Common.DataManager.Series.Add( new Series(_tempOutputSeriesName) );
+
+ // Execute formula
+ double result = double.NaN;
+ try
+ {
+ _formulaData.Formula("InverseTDistribution", parameter, _tempOutputSeriesName, _tempOutputSeriesName);
+
+ DataPointCollection points = _formulaData.Common.DataManager.Series[_tempOutputSeriesName].Points;
+
+ // Fill Output class
+ result = points[0].YValues[0];
+ }
+ finally
+ {
+ // Remove Temporary output series
+ _formulaData.Common.DataManager.Series.Remove(_formulaData.Common.DataManager.Series[_tempOutputSeriesName]);
+ }
+
+ // Return result class
+ return result;
+
+ }
+
+ #endregion // Distributions
+
+ #region Correlation and Covariance
+
+ /// <summary>
+ /// This method gets the covariance value for two series of data.
+ /// </summary>
+ /// <param name="firstInputSeriesName">First input series name.</param>
+ /// <param name="secondInputSeriesName">Second input series name.</param>
+ /// <returns>Covariance.</returns>
+ public double Covariance(
+ string firstInputSeriesName,
+ string secondInputSeriesName )
+ {
+ // Check arguments
+ if (firstInputSeriesName == null)
+ throw new ArgumentNullException("firstInputSeriesName");
+ if (secondInputSeriesName == null)
+ throw new ArgumentNullException("secondInputSeriesName");
+
+ // Create temporary output series.
+ _formulaData.Common.DataManager.Series.Add( new Series(_tempOutputSeriesName) );
+
+ // Set input series string
+ string inputSeriesParameter = firstInputSeriesName.ToString(System.Globalization.CultureInfo.InvariantCulture) + "," + secondInputSeriesName.ToString(System.Globalization.CultureInfo.InvariantCulture);
+
+ // Execute formula
+ double result = double.NaN;
+ try
+ {
+ _formulaData.Formula("Covariance", "", inputSeriesParameter, _tempOutputSeriesName);
+
+ DataPointCollection points = _formulaData.Common.DataManager.Series[_tempOutputSeriesName].Points;
+
+ // Fill Output value
+ result = points[0].YValues[0];
+ }
+ finally
+ {
+ // Remove Temporary output series
+ _formulaData.Common.DataManager.Series.Remove(_formulaData.Common.DataManager.Series[_tempOutputSeriesName]);
+ }
+
+ // Return result
+ return result;
+
+ }
+
+ /// <summary>
+ /// This method gets the correlation value for two series of data.
+ /// </summary>
+ /// <param name="firstInputSeriesName">First input series name.</param>
+ /// <param name="secondInputSeriesName">Second input series name.</param>
+ /// <returns>Returns Correlation</returns>
+ public double Correlation(
+ string firstInputSeriesName,
+ string secondInputSeriesName )
+ {
+ // Check arguments
+ if (firstInputSeriesName == null)
+ throw new ArgumentNullException("firstInputSeriesName");
+ if (secondInputSeriesName == null)
+ throw new ArgumentNullException("secondInputSeriesName");
+
+ // Create temporary output series.
+ _formulaData.Common.DataManager.Series.Add( new Series(_tempOutputSeriesName) );
+
+ // Set input series string
+ string inputSeriesParameter = firstInputSeriesName + "," + secondInputSeriesName;
+
+ // Execute formula
+ double result = double.NaN;
+ try
+ {
+ _formulaData.Formula("Correlation", "", inputSeriesParameter, _tempOutputSeriesName);
+
+ DataPointCollection points = _formulaData.Common.DataManager.Series[_tempOutputSeriesName].Points;
+
+ // Fill Output value
+ result = points[0].YValues[0];
+ }
+ finally
+ {
+ // Remove Temporary output series
+ _formulaData.Common.DataManager.Series.Remove(_formulaData.Common.DataManager.Series[_tempOutputSeriesName]);
+ }
+
+ // Return result
+ return result;
+
+ }
+
+ /// <summary>
+ /// This method returns the average of all data points stored in the specified series.
+ /// </summary>
+ /// <param name="inputSeriesName">Input series name.</param>
+ /// <returns>The average of all data points.</returns>
+ public double Mean(
+ string inputSeriesName )
+ {
+ // Check arguments
+ if (inputSeriesName == null)
+ throw new ArgumentNullException("inputSeriesName");
+
+ // Create temporary output series.
+ _formulaData.Common.DataManager.Series.Add( new Series(_tempOutputSeriesName) );
+
+ // Set input series string
+ string inputSeriesParameter = inputSeriesName;
+
+ // Execute formula
+ double result = double.NaN;
+ try
+ {
+ _formulaData.Formula("Mean", "", inputSeriesParameter, _tempOutputSeriesName);
+
+ DataPointCollection points = _formulaData.Common.DataManager.Series[_tempOutputSeriesName].Points;
+
+ // Fill Output value
+ result = points[0].YValues[0];
+ }
+ finally
+ {
+ // Remove Temporary output series
+ _formulaData.Common.DataManager.Series.Remove(_formulaData.Common.DataManager.Series[_tempOutputSeriesName]);
+ }
+
+ // Return result
+ return result;
+
+ }
+
+ /// <summary>
+ /// This method returns the median of all data points in the specified series.
+ /// </summary>
+ /// <param name="inputSeriesName">Input series name.</param>
+ /// <returns>Median.</returns>
+ public double Median(
+ string inputSeriesName )
+ {
+ // Check arguments
+ if (inputSeriesName == null)
+ throw new ArgumentNullException("inputSeriesName");
+
+ // Create temporary output series.
+ _formulaData.Common.DataManager.Series.Add( new Series(_tempOutputSeriesName) );
+
+ // Set input series string
+ string inputSeriesParameter = inputSeriesName;
+
+ // Execute formula
+ double result = double.NaN;
+ try
+ {
+ _formulaData.Formula("Median", "", inputSeriesParameter, _tempOutputSeriesName);
+
+ DataPointCollection points = _formulaData.Common.DataManager.Series[_tempOutputSeriesName].Points;
+
+ // Fill Output value
+ result = points[0].YValues[0];
+ }
+ finally
+ {
+ // Remove Temporary output series
+ _formulaData.Common.DataManager.Series.Remove(_formulaData.Common.DataManager.Series[_tempOutputSeriesName]);
+ }
+
+ // Return result
+ return result;
+
+ }
+
+ /// <summary>
+ /// This method returns the variance for a series.
+ /// </summary>
+ /// <param name="inputSeriesName">Input series name.</param>
+ /// <param name="sampleVariance">If true, the data is a sample of the population. If false, it is the entire population.</param>
+ /// <returns>Variance.</returns>
+ public double Variance(
+ string inputSeriesName,
+ bool sampleVariance )
+ {
+ // Check arguments
+ if (inputSeriesName == null)
+ throw new ArgumentNullException("inputSeriesName");
+
+ // Create temporary output series.
+ _formulaData.Common.DataManager.Series.Add( new Series(_tempOutputSeriesName) );
+
+ // Set input series string
+ string inputSeriesParameter = inputSeriesName;
+
+ // Formula parameter
+ string parameter = sampleVariance.ToString(System.Globalization.CultureInfo.InvariantCulture);
+
+ // Execute formula
+ double result = double.NaN;
+ try
+ {
+ _formulaData.Formula("Variance", parameter, inputSeriesParameter, _tempOutputSeriesName);
+
+ DataPointCollection points = _formulaData.Common.DataManager.Series[_tempOutputSeriesName].Points;
+
+ // Fill Output value
+ result = points[0].YValues[0];
+ }
+ finally
+ {
+ // Remove Temporary output series
+ _formulaData.Common.DataManager.Series.Remove(_formulaData.Common.DataManager.Series[_tempOutputSeriesName]);
+ }
+
+ // Return result
+ return result;
+
+ }
+
+ /// <summary>
+ /// This method returns the beta function for two given values.
+ /// </summary>
+ /// <param name="m">First parameter for beta function</param>
+ /// <param name="n">Second Parameter for beta function</param>
+ /// <returns>Returns beta function for the two given values.</returns>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "The Beta Function is a mathematical function where arbitrary letters to indicate inputs are common")]
+ public double BetaFunction(
+ double m,
+ double n )
+ {
+ // Fix for the VSTS 230829: The BetaFunction for the m=0,n=0 is double.NaN
+ if (m == 0 && n == 0)
+ return double.NaN;
+
+ // Create temporary output series.
+ _formulaData.Common.DataManager.Series.Add( new Series(_tempOutputSeriesName) );
+
+ // Formula parameter
+ string parameter = m.ToString(System.Globalization.CultureInfo.InvariantCulture);
+ parameter += "," + n.ToString(System.Globalization.CultureInfo.InvariantCulture);
+
+ // Execute formula
+ double result = double.NaN;
+ try
+ {
+ _formulaData.Formula("BetaFunction", parameter, _tempOutputSeriesName, _tempOutputSeriesName);
+
+ DataPointCollection points = _formulaData.Common.DataManager.Series[_tempOutputSeriesName].Points;
+
+ // Fill Output value
+ result = points[0].YValues[0];
+ }
+ finally
+ {
+ // Remove Temporary output series
+ _formulaData.Common.DataManager.Series.Remove(_formulaData.Common.DataManager.Series[_tempOutputSeriesName]);
+ }
+
+ // Return result
+ return result;
+ }
+
+ /// <summary>
+ /// This method returns the gamma function value for the given variable.
+ /// </summary>
+ /// <param name="value">The value.</param>
+ /// <returns>Returns gamma function</returns>
+ public double GammaFunction(
+ double value )
+ {
+
+ // Create temporary output series.
+ _formulaData.Common.DataManager.Series.Add( new Series(_tempOutputSeriesName) );
+
+ // Formula parameter
+ string parameter = value.ToString(System.Globalization.CultureInfo.InvariantCulture);
+
+ // Execute formula
+ double result = double.NaN;
+ try
+ {
+ _formulaData.Formula("GammaFunction", parameter, _tempOutputSeriesName, _tempOutputSeriesName);
+
+ DataPointCollection points = _formulaData.Common.DataManager.Series[_tempOutputSeriesName].Points;
+
+ // Fill Output value
+ result = points[0].YValues[0];
+ }
+ finally
+ {
+ // Remove Temporary output series
+ _formulaData.Common.DataManager.Series.Remove(_formulaData.Common.DataManager.Series[_tempOutputSeriesName]);
+ }
+
+ // Return result
+ return result;
+
+ }
+
+ #endregion
+ }
+
+ #region Output classes used to store statistical calculations results
+
+ /// <summary>
+ /// The TTestResult class stores the results of the TTest statistical calculations.
+ /// </summary>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class TTestResult
+ {
+ #region Fields
+
+ /// <summary>
+ /// First series' mean.
+ /// </summary>
+ internal double firstSeriesMean = 0.0;
+
+ /// <summary>
+ /// Second series' mean.
+ /// </summary>
+ internal double secondSeriesMean = 0.0;
+
+ /// <summary>
+ /// First series' variance.
+ /// </summary>
+ internal double firstSeriesVariance = 0.0;
+
+ /// <summary>
+ /// Second series' variance.
+ /// </summary>
+ internal double secondSeriesVariance = 0.0;
+
+ /// <summary>
+ /// T value.
+ /// </summary>
+ internal double tValue = 0.0;
+
+ /// <summary>
+ /// Degree of freedom.
+ /// </summary>
+ internal double degreeOfFreedom = 0.0;
+
+ /// <summary>
+ /// Probability T one tail.
+ /// </summary>
+ internal double probabilityTOneTail = 0.0;
+
+ /// <summary>
+ /// Critical T one tail.
+ /// </summary>
+ internal double tCriticalValueOneTail = 0.0;
+
+ /// <summary>
+ /// Probability T two tails.
+ /// </summary>
+ internal double probabilityTTwoTail = 0.0;
+
+ /// <summary>
+ /// Critical T two tails.
+ /// </summary>
+ internal double tCriticalValueTwoTail = 0.0;
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Gets the mean of the first series.
+ /// </summary>
+ public double FirstSeriesMean
+ {
+ get
+ {
+ return firstSeriesMean;
+ }
+ }
+
+ /// <summary>
+ /// Gets the mean of the second series.
+ /// </summary>
+ public double SecondSeriesMean
+ {
+ get
+ {
+ return secondSeriesMean;
+ }
+ }
+
+ /// <summary>
+ /// Gets the variance of the first series.
+ /// </summary>
+ public double FirstSeriesVariance
+ {
+ get
+ {
+ return firstSeriesVariance;
+ }
+ }
+
+ /// <summary>
+ /// Gets the variance of the second series.
+ /// </summary>
+ public double SecondSeriesVariance
+ {
+ get
+ {
+ return secondSeriesVariance;
+ }
+ }
+
+ /// <summary>
+ /// Gets the T value.
+ /// </summary>
+ public double TValue
+ {
+ get
+ {
+ return tValue;
+ }
+ }
+
+ /// <summary>
+ /// Gets the degree of freedom.
+ /// </summary>
+ public double DegreeOfFreedom
+ {
+ get
+ {
+ return degreeOfFreedom;
+ }
+ }
+
+ /// <summary>
+ /// Gets the probability T one tail value.
+ /// </summary>
+ [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly",
+ Justification = "T One Tail is a statistics term. 'Tone' is not the intended word here.")]
+ public double ProbabilityTOneTail
+ {
+ get
+ {
+ return probabilityTOneTail;
+ }
+ }
+
+ /// <summary>
+ /// Gets the critical T one tail value.
+ /// </summary>
+ public double TCriticalValueOneTail
+ {
+ get
+ {
+ return tCriticalValueOneTail;
+ }
+ }
+
+ /// <summary>
+ /// Gets the probability T two tails value.
+ /// </summary>
+ public double ProbabilityTTwoTail
+ {
+ get
+ {
+ return probabilityTTwoTail;
+ }
+ }
+
+ /// <summary>
+ /// Gets the critical T two tails value.
+ /// </summary>
+ public double TCriticalValueTwoTail
+ {
+ get
+ {
+ return tCriticalValueTwoTail;
+ }
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// The FTestResult class stores the results of the FTest statistical calculations.
+ /// </summary>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class FTestResult
+ {
+ #region Fields
+
+ /// <summary>
+ /// First series' mean.
+ /// </summary>
+ internal double firstSeriesMean = 0.0;
+
+ /// <summary>
+ /// Second series' mean.
+ /// </summary>
+ internal double secondSeriesMean = 0.0;
+
+ /// <summary>
+ /// First series' variance.
+ /// </summary>
+ internal double firstSeriesVariance = 0.0;
+
+ /// <summary>
+ /// Second series' variance.
+ /// </summary>
+ internal double secondSeriesVariance = 0.0;
+
+ /// <summary>
+ /// F value.
+ /// </summary>
+ internal double fValue = 0.0;
+
+ /// <summary>
+ /// Probability F one tail.
+ /// </summary>
+ internal double probabilityFOneTail = 0.0;
+
+ /// <summary>
+ /// Critical F one tail.
+ /// </summary>
+ internal double fCriticalValueOneTail = 0.0;
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Gets the mean of the first series.
+ /// </summary>
+ public double FirstSeriesMean
+ {
+ get
+ {
+ return firstSeriesMean;
+ }
+ }
+
+ /// <summary>
+ /// Gets the mean of the second series.
+ /// </summary>
+ public double SecondSeriesMean
+ {
+ get
+ {
+ return secondSeriesMean;
+ }
+ }
+
+ /// <summary>
+ /// Gets the variance of the first series.
+ /// </summary>
+ public double FirstSeriesVariance
+ {
+ get
+ {
+ return firstSeriesVariance;
+ }
+ }
+
+ /// <summary>
+ /// Gets the variance of the second series.
+ /// </summary>
+ public double SecondSeriesVariance
+ {
+ get
+ {
+ return secondSeriesVariance;
+ }
+ }
+
+ /// <summary>
+ /// Gets the F value.
+ /// </summary>
+ public double FValue
+ {
+ get
+ {
+ return fValue;
+ }
+ }
+
+ /// <summary>
+ /// Gets the probability F one tail.
+ /// </summary>
+ public double ProbabilityFOneTail
+ {
+ get
+ {
+ return probabilityFOneTail;
+ }
+ }
+
+ /// <summary>
+ /// Gets the critical F one tail.
+ /// </summary>
+ public double FCriticalValueOneTail
+ {
+ get
+ {
+ return fCriticalValueOneTail;
+ }
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// The AnovaResult class stores the results of the Anova statistical calculations.
+ /// </summary>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class AnovaResult
+ {
+ #region Fields
+
+ /// <summary>
+ /// Sum of squares between groups.
+ /// </summary>
+ internal double sumOfSquaresBetweenGroups = 0.0;
+
+ /// <summary>
+ /// Sum of squares within groups.
+ /// </summary>
+ internal double sumOfSquaresWithinGroups = 0.0;
+
+ /// <summary>
+ /// Total sum of squares.
+ /// </summary>
+ internal double sumOfSquaresTotal = 0.0;
+
+ /// <summary>
+ /// Degree of freedom between groups.
+ /// </summary>
+ internal double degreeOfFreedomBetweenGroups = 0.0;
+
+ /// <summary>
+ /// Degree of freedom within groups.
+ /// </summary>
+ internal double degreeOfFreedomWithinGroups = 0.0;
+
+ /// <summary>
+ /// Total degree of freedom.
+ /// </summary>
+ internal double degreeOfFreedomTotal = 0.0;
+
+ /// <summary>
+ /// Mean square variance between groups.
+ /// </summary>
+ internal double meanSquareVarianceBetweenGroups = 0.0;
+
+ /// <summary>
+ /// Mean square variance between groups.
+ /// </summary>
+ internal double meanSquareVarianceWithinGroups = 0.0;
+
+ /// <summary>
+ /// F ratio.
+ /// </summary>
+ internal double fRatio = 0.0;
+
+ /// <summary>
+ /// F critical value.
+ /// </summary>
+ internal double fCriticalValue = 0.0;
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Gets the sum of squares between groups.
+ /// </summary>
+ public double SumOfSquaresBetweenGroups
+ {
+ get
+ {
+ return sumOfSquaresBetweenGroups;
+ }
+ }
+
+ /// <summary>
+ /// Gets the sum of squares within groups.
+ /// </summary>
+ public double SumOfSquaresWithinGroups
+ {
+ get
+ {
+ return sumOfSquaresWithinGroups;
+ }
+ }
+
+
+ /// <summary>
+ /// Gets the total sum of squares.
+ /// </summary>
+ public double SumOfSquaresTotal
+ {
+ get
+ {
+ return sumOfSquaresTotal;
+ }
+ }
+
+ /// <summary>
+ /// Gets the degree of freedom between groups.
+ /// </summary>
+ public double DegreeOfFreedomBetweenGroups
+ {
+ get
+ {
+ return degreeOfFreedomBetweenGroups;
+ }
+ }
+
+ /// <summary>
+ /// Gets the degree of freedom within groups.
+ /// </summary>
+ public double DegreeOfFreedomWithinGroups
+ {
+ get
+ {
+ return degreeOfFreedomWithinGroups;
+ }
+ }
+
+ /// <summary>
+ /// Gets the total degree of freedom.
+ /// </summary>
+ public double DegreeOfFreedomTotal
+ {
+ get
+ {
+ return degreeOfFreedomTotal;
+ }
+ }
+
+ /// <summary>
+ /// Gets the mean square variance between groups.
+ /// </summary>
+ public double MeanSquareVarianceBetweenGroups
+ {
+ get
+ {
+ return meanSquareVarianceBetweenGroups;
+ }
+ }
+
+ /// <summary>
+ /// Gets the mean square variance within groups.
+ /// </summary>
+ public double MeanSquareVarianceWithinGroups
+ {
+ get
+ {
+ return meanSquareVarianceWithinGroups;
+ }
+ }
+
+ /// <summary>
+ /// Gets the F ratio.
+ /// </summary>
+ public double FRatio
+ {
+ get
+ {
+ return fRatio;
+ }
+ }
+
+ /// <summary>
+ /// Gets the F critical value.
+ /// </summary>
+ public double FCriticalValue
+ {
+ get
+ {
+ return fCriticalValue;
+ }
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// The ZTestResult class stores the results of the ZTest statistical calculations.
+ /// </summary>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class ZTestResult
+ {
+ #region Constructor
+
+ /// <summary>
+ /// ZTestResult Constructor
+ /// </summary>
+ public ZTestResult()
+ {
+ }
+
+ #endregion // Constructor
+
+ #region Fields
+
+ // Internal fields used for public properties
+ internal double firstSeriesMean;
+ internal double secondSeriesMean;
+ internal double firstSeriesVariance;
+ internal double secondSeriesVariance;
+ internal double zValue;
+ internal double probabilityZOneTail;
+ internal double zCriticalValueOneTail;
+ internal double probabilityZTwoTail;
+ internal double zCriticalValueTwoTail;
+
+
+ #endregion // Fields
+
+ #region Properties
+
+ /// <summary>
+ /// Gets the mean of the first series.
+ /// </summary>
+ public double FirstSeriesMean
+ {
+ get
+ {
+ return firstSeriesMean;
+ }
+ }
+
+ /// <summary>
+ /// Gets the mean of the second series.
+ /// </summary>
+ public double SecondSeriesMean
+ {
+ get
+ {
+ return secondSeriesMean;
+ }
+ }
+
+ /// <summary>
+ /// Gets the variance of the first series.
+ /// </summary>
+ public double FirstSeriesVariance
+ {
+ get
+ {
+ return firstSeriesVariance;
+ }
+ }
+
+ /// <summary>
+ /// Gets the variance of the second series.
+ /// </summary>
+ public double SecondSeriesVariance
+ {
+ get
+ {
+ return secondSeriesVariance;
+ }
+ }
+
+ /// <summary>
+ /// Gets the Z Value
+ /// </summary>
+ public double ZValue
+ {
+ get
+ {
+ return zValue;
+ }
+ }
+
+ /// <summary>
+ /// Gets the probability Z one tail value.
+ /// </summary>
+ [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly",
+ Justification = "Z One Tail is a statistics term. 'Zone' is not the intended word here.")]
+ public double ProbabilityZOneTail
+ {
+ get
+ {
+ return probabilityZOneTail;
+ }
+ }
+
+ /// <summary>
+ /// Gets the Z critical value one tail value.
+ /// </summary>
+ public double ZCriticalValueOneTail
+ {
+ get
+ {
+ return zCriticalValueOneTail;
+ }
+ }
+
+ /// <summary>
+ /// Gets the probability Z two tail value.
+ /// </summary>
+ public double ProbabilityZTwoTail
+ {
+ get
+ {
+ return probabilityZTwoTail;
+ }
+ }
+
+ /// <summary>
+ /// Gets the Z critical value two tail value.
+ /// </summary>
+ public double ZCriticalValueTwoTail
+ {
+ get
+ {
+ return zCriticalValueTwoTail;
+ }
+ }
+
+ #endregion // Properties
+ }
+
+ #endregion // Output Classes
+}
+
+
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/StripLine.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/StripLine.cs
new file mode 100644
index 00000000000..62876044260
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/StripLine.cs
@@ -0,0 +1,1616 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: StripLine.cs
+//
+// Namespace: DataVisualization.Charting
+//
+// Classes: StripLinesCollection, StripLine
+//
+// Purpose: StripLinesCollection class is used to expose stripes
+// or lines on the plotting area and is exposed through
+// StripLines property of each Axis.
+//
+// Each StripLine class presents one or series of
+// repeated axis horizontal or vertical strips within
+// the plotting are.
+//
+// When multiple strip lines are defined for an axis,
+// there is a possibility of overlap. The z-order of
+// StripLine objects is determined by their order of
+// occurrence in the StripLinesCollection object. The
+// z-order follows this convention, the first occurrence
+// is drawn first, the second occurrence is drawn second,
+// and so on.
+//
+// Highlighting weekends on date axis is a good example
+// of using strip lines with interval.
+//
+// Reviewed: AG - Jul 31, 2002;
+// GS - Aug 7, 2002
+// AG - Microsoft 13, 2007
+//
+//===================================================================
+
+
+#region Used namespaces
+
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Drawing2D;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+ using System.Globalization;
+ using System.ComponentModel.Design.Serialization;
+ using System.Reflection;
+ using System.Windows.Forms.Design;
+#else
+ using System.Web;
+ using System.Web.UI;
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+ namespace System.Web.UI.DataVisualization.Charting
+#endif
+
+{
+ /// <summary>
+ /// The StripLinesCollection class is a strongly typed collection of
+ /// StripLine classes.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeStripLinesCollection_StripLinesCollection"),
+
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class StripLinesCollection : ChartElementCollection<StripLine>
+ {
+
+ #region Constructor
+ /// <summary>
+ /// Legend item collection object constructor
+ /// </summary>
+ /// <param name="axis">Axis object reference.</param>
+ internal StripLinesCollection(Axis axis)
+ : base(axis)
+ {
+ }
+ #endregion
+
+
+ }
+
+ /// <summary>
+ /// The StripLine class contains properties which define visual appearance
+ /// of the stripe or line, its position according to the axis. It
+ /// may optionally contain the repeat interval. Text may associate
+ /// with a strip or a line. It also contains methods of drawing and hit
+ /// testing.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeStripLine_StripLine"),
+ DefaultProperty("IntervalOffset"),
+ ]
+#if Microsoft_CONTROL
+ public class StripLine : ChartElement
+#else
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class StripLine : ChartElement, IChartMapArea
+#endif
+ {
+
+ #region Fields
+
+ // Private data members, which store properties values
+ private double _intervalOffset = 0;
+ private double _interval = 0;
+ private DateTimeIntervalType _intervalType = DateTimeIntervalType.Auto;
+ internal DateTimeIntervalType intervalOffsetType = DateTimeIntervalType.Auto;
+ internal bool interlaced = false;
+ private double _stripWidth = 0;
+ private DateTimeIntervalType _stripWidthType = DateTimeIntervalType.Auto;
+ private Color _backColor = Color.Empty;
+ private ChartHatchStyle _backHatchStyle = ChartHatchStyle.None;
+ private string _backImage = "";
+ private ChartImageWrapMode _backImageWrapMode = ChartImageWrapMode.Tile;
+ private Color _backImageTransparentColor = Color.Empty;
+ private ChartImageAlignmentStyle _backImageAlignment = ChartImageAlignmentStyle.TopLeft;
+ private GradientStyle _backGradientStyle = GradientStyle.None;
+ private Color _backSecondaryColor = Color.Empty;
+ private Color _borderColor = Color.Empty;
+ private int _borderWidth = 1;
+ private ChartDashStyle _borderDashStyle = ChartDashStyle.Solid;
+
+ // Strip/Line title properties
+ private string _text = "";
+ private Color _foreColor = Color.Black;
+ private FontCache _fontCache = new FontCache();
+ private Font _font = null;
+ private StringAlignment _textAlignment = StringAlignment.Far;
+ private StringAlignment _textLineAlignment = StringAlignment.Near;
+
+ // Chart image map properties
+ private string _toolTip = "";
+
+#if !Microsoft_CONTROL
+ private string _url = "";
+ private string _attributes = "";
+ private string _postbackValue = String.Empty;
+#endif
+
+ // Default text orientation
+ private TextOrientation _textOrientation = TextOrientation.Auto;
+
+ #endregion
+
+ #region Properties
+ /// <summary>
+ /// Gets axes to which this object attached to.
+ /// </summary>
+ /// <returns>Axis object reference.</returns>
+ internal Axis Axis
+ {
+ get
+ {
+ if (Parent != null)
+ return Parent.Parent as Axis;
+ else
+ return null;
+ }
+ }
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// Strip line object constructor.
+ /// </summary>
+ public StripLine()
+ : base()
+ {
+ _font = _fontCache.DefaultFont;
+ }
+
+ #endregion
+
+ #region Painting methods
+
+ /// <summary>
+ /// Checks if chart title is drawn vertically.
+ /// Note: From the drawing perspective stacked text orientation is not vertical.
+ /// </summary>
+ /// <returns>True if text is vertical.</returns>
+ private bool IsTextVertical
+ {
+ get
+ {
+ TextOrientation currentTextOrientation = this.GetTextOrientation();
+ return currentTextOrientation == TextOrientation.Rotated90 || currentTextOrientation == TextOrientation.Rotated270;
+ }
+ }
+
+ /// <summary>
+ /// Returns stripline text orientation. If set to Auto automatically determines the
+ /// orientation based on the orientation of the stripline.
+ /// </summary>
+ /// <returns>Current text orientation.</returns>
+ private TextOrientation GetTextOrientation()
+ {
+ if (this.TextOrientation == TextOrientation.Auto && this.Axis != null)
+ {
+ if (this.Axis.AxisPosition == AxisPosition.Bottom || this.Axis.AxisPosition == AxisPosition.Top)
+ {
+ return TextOrientation.Rotated270;
+ }
+ return TextOrientation.Horizontal;
+ }
+ return this.TextOrientation;
+ }
+
+ /// <summary>
+ /// Draw strip(s) or line(s).
+ /// </summary>
+ /// <param name="graph">Reference to the Chart Graphics object.</param>
+ /// <param name="common">Common objects.</param>
+ /// <param name="drawLinesOnly">Indicates if Lines or Stripes should be drawn.</param>
+ internal void Paint(
+ ChartGraphics graph,
+ CommonElements common,
+ bool drawLinesOnly)
+ {
+ // Strip lines are not supported in circular chart area
+ if(this.Axis.ChartArea.chartAreaIsCurcular)
+ {
+ return;
+ }
+
+ // Get plot area position
+ RectangleF plotAreaPosition = this.Axis.ChartArea.PlotAreaPosition.ToRectangleF();
+
+ // Detect if strip/line is horizontal or vertical
+ bool horizontal = true;
+ if(this.Axis.AxisPosition == AxisPosition.Bottom || this.Axis.AxisPosition == AxisPosition.Top)
+ {
+ horizontal = false;
+ }
+
+ // Get first series attached to this axis
+ Series axisSeries = null;
+ if(Axis.axisType == AxisName.X || Axis.axisType == AxisName.X2)
+ {
+ List<string> seriesArray = Axis.ChartArea.GetXAxesSeries((Axis.axisType == AxisName.X) ? AxisType.Primary : AxisType.Secondary, Axis.SubAxisName);
+ if(seriesArray.Count > 0)
+ {
+ axisSeries = Axis.Common.DataManager.Series[seriesArray[0]];
+ if(axisSeries != null && !axisSeries.IsXValueIndexed)
+ {
+ axisSeries = null;
+ }
+ }
+ }
+
+ // Get starting position from axis
+ // NOTE: Starting position was changed from "this.Axis.minimum" to
+ // fix the minimum scaleView location to fix issue #5962 -- AG
+ double currentPosition = this.Axis.ViewMinimum;
+
+ // Adjust start position depending on the interval type
+ if(!Axis.ChartArea.chartAreaIsCurcular ||
+ Axis.axisType == AxisName.Y ||
+ Axis.axisType == AxisName.Y2 )
+ {
+ double intervalToUse = this.Interval;
+
+ // NOTE: fix for issue #5962
+ // Always use original grid interval for isInterlaced strip lines.
+ if (this.interlaced)
+ {
+ // Automaticly generated isInterlaced strips have interval twice as big as major grids
+ intervalToUse /= 2.0;
+ }
+ currentPosition = ChartHelper.AlignIntervalStart(currentPosition, intervalToUse, this.IntervalType, axisSeries);
+ }
+
+ // Too many tick marks
+ if(this.Interval != 0)
+ {
+ if( ( Axis.ViewMaximum - Axis.ViewMinimum ) / ChartHelper.GetIntervalSize(currentPosition, this._interval, this._intervalType, axisSeries, 0, DateTimeIntervalType.Number, false) > ChartHelper.MaxNumOfGridlines)
+ return;
+ }
+
+ DateTimeIntervalType offsetType = (IntervalOffsetType == DateTimeIntervalType.Auto) ? IntervalType : IntervalOffsetType;
+ if(this.Interval == 0)
+ {
+ currentPosition = this.IntervalOffset;
+ }
+ /******************************************************************
+ * Removed by AG. Causing issues with interalced strip lines.
+ /******************************************************************
+ else if(axisSeries != null && axisSeries.IsXValueIndexed)
+ {
+ // Align first position for indexed series
+ currentPosition += this.Axis.AlignIndexedIntervalStart(
+ currentPosition,
+ this.Interval,
+ this.IntervalType,
+ axisSeries,
+ this.IntervalOffset,
+ offsetType,
+ false);
+ }
+ */
+ else
+ {
+ if(this.IntervalOffset > 0)
+ {
+ currentPosition += ChartHelper.GetIntervalSize(currentPosition, this.IntervalOffset,
+ offsetType, axisSeries, 0, DateTimeIntervalType.Number, false);
+ }
+ else if(this.IntervalOffset < 0)
+ {
+ currentPosition -= ChartHelper.GetIntervalSize(currentPosition, -this.IntervalOffset,
+ offsetType, axisSeries, 0, DateTimeIntervalType.Number, false);
+ }
+ }
+
+ // Draw several lines or strips if Interval property is set
+ int counter = 0;
+ do
+ {
+ // Check if we do not exceed max number of elements
+ if(counter++ > ChartHelper.MaxNumOfGridlines)
+ {
+ break;
+ }
+
+ // Draw strip
+ if(this.StripWidth > 0 && !drawLinesOnly)
+ {
+ double stripRightPosition = currentPosition + ChartHelper.GetIntervalSize(currentPosition, this.StripWidth, this.StripWidthType, axisSeries, this.IntervalOffset, offsetType, false);
+ if (stripRightPosition > this.Axis.ViewMinimum && currentPosition < this.Axis.ViewMaximum)
+ {
+ // Calculate strip rectangle
+ RectangleF rect = RectangleF.Empty;
+ double pos1 = (float)this.Axis.GetLinearPosition(currentPosition);
+ double pos2 = (float)this.Axis.GetLinearPosition(stripRightPosition);
+ if(horizontal)
+ {
+ rect.X = plotAreaPosition.X;
+ rect.Width = plotAreaPosition.Width;
+ rect.Y = (float)Math.Min(pos1, pos2);
+ rect.Height = (float)Math.Max(pos1, pos2) - rect.Y;
+
+ // Check rectangle boundaries
+ rect.Intersect(plotAreaPosition);
+ }
+ else
+ {
+ rect.Y = plotAreaPosition.Y;
+ rect.Height = plotAreaPosition.Height;
+ rect.X = (float)Math.Min(pos1, pos2);
+ rect.Width = (float)Math.Max(pos1, pos2) - rect.X;
+
+ // Check rectangle boundaries
+ rect.Intersect(plotAreaPosition);
+ }
+
+ if(rect.Width > 0 && rect.Height > 0)
+ {
+
+ #if Microsoft_CONTROL
+ // Start Svg Selection mode
+ graph.StartHotRegion( "", this._toolTip );
+ #else
+ // Start Svg Selection mode
+ graph.StartHotRegion( this._url, this._toolTip );
+ #endif
+ if(!this.Axis.ChartArea.Area3DStyle.Enable3D)
+ {
+ // Draw strip
+ graph.FillRectangleRel( rect,
+ this.BackColor, this.BackHatchStyle, this.BackImage,
+ this.BackImageWrapMode, this.BackImageTransparentColor, this.BackImageAlignment,
+ this.BackGradientStyle, this.BackSecondaryColor, this.BorderColor,
+ this.BorderWidth, this.BorderDashStyle, Color.Empty,
+ 0, PenAlignment.Inset );
+ }
+ else
+ {
+ Draw3DStrip( graph, rect, horizontal );
+ }
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+
+ // Draw strip line title
+ PaintTitle(graph, rect);
+
+ if( common.ProcessModeRegions )
+ {
+ if(!this.Axis.ChartArea.Area3DStyle.Enable3D)
+ {
+#if !Microsoft_CONTROL
+ common.HotRegionsList.AddHotRegion(rect, this.ToolTip, this.Url, this.MapAreaAttributes, this.PostBackValue, this, ChartElementType.StripLines, string.Empty);
+#else
+ common.HotRegionsList.AddHotRegion(rect, this.ToolTip, string.Empty, string.Empty, string.Empty, this, ChartElementType.StripLines, null );
+#endif // !Microsoft_CONTROL
+ }
+ }
+ }
+
+ }
+ }
+ // Draw line
+ else if(this.StripWidth == 0 && drawLinesOnly)
+ {
+ if(currentPosition > this.Axis.ViewMinimum && currentPosition < this.Axis.ViewMaximum)
+ {
+ // Calculate line position
+ PointF point1 = PointF.Empty;
+ PointF point2 = PointF.Empty;
+ if(horizontal)
+ {
+ point1.X = plotAreaPosition.X;
+ point1.Y = (float)this.Axis.GetLinearPosition(currentPosition);
+ point2.X = plotAreaPosition.Right;
+ point2.Y = point1.Y;
+ }
+ else
+ {
+ point1.X = (float)this.Axis.GetLinearPosition(currentPosition);
+ point1.Y = plotAreaPosition.Y;
+ point2.X = point1.X;
+ point2.Y = plotAreaPosition.Bottom;
+ }
+
+#if Microsoft_CONTROL
+ // Start Svg Selection mode
+ graph.StartHotRegion( "", this._toolTip );
+#else
+ // Start Svg Selection mode
+ graph.StartHotRegion( this._url, this._toolTip );
+#endif
+ // Draw Line
+ if(!this.Axis.ChartArea.Area3DStyle.Enable3D)
+ {
+ graph.DrawLineRel(this.BorderColor, this.BorderWidth, this.BorderDashStyle, point1, point2);
+ }
+ else
+ {
+ graph.Draw3DGridLine(this.Axis.ChartArea, _borderColor, _borderWidth, _borderDashStyle, point1, point2, horizontal, Axis.Common, this );
+ }
+
+ // End Svg Selection mode
+ graph.EndHotRegion( );
+
+ // Draw strip line title
+ PaintTitle(graph, point1, point2);
+
+ if( common.ProcessModeRegions )
+ {
+ SizeF relBorderWidth = new SizeF(this.BorderWidth + 1, this.BorderWidth + 1);
+ relBorderWidth = graph.GetRelativeSize(relBorderWidth);
+ RectangleF lineRect = RectangleF.Empty;
+ if(horizontal)
+ {
+ lineRect.X = point1.X;
+ lineRect.Y = point1.Y - relBorderWidth.Height / 2f;
+ lineRect.Width = point2.X - point1.X;
+ lineRect.Height = relBorderWidth.Height;
+ }
+ else
+ {
+ lineRect.X = point1.X - relBorderWidth.Width / 2f;
+ lineRect.Y = point1.Y;
+ lineRect.Width = relBorderWidth.Width;
+ lineRect.Height = point2.Y - point1.Y;
+ }
+
+#if !Microsoft_CONTROL
+ common.HotRegionsList.AddHotRegion( lineRect, this.ToolTip, this.Url, this.MapAreaAttributes, this.PostBackValue, this, ChartElementType.StripLines, string.Empty );
+#else
+ common.HotRegionsList.AddHotRegion( lineRect, this.ToolTip, null, null, null, this, ChartElementType.StripLines, null );
+#endif // !Microsoft_CONTROL
+ }
+ }
+ }
+
+ // Go to the next line/strip
+ if(this.Interval > 0)
+ {
+ currentPosition += ChartHelper.GetIntervalSize(currentPosition, this.Interval, this.IntervalType, axisSeries, this.IntervalOffset, offsetType, false);
+ }
+
+ } while(this.Interval > 0 && currentPosition <= this.Axis.ViewMaximum);
+ }
+
+ /// <summary>
+ /// Draws strip line in 3d.
+ /// </summary>
+ /// <param name="graph">Chart graphics.</param>
+ /// <param name="rect">Strip rectangle.</param>
+ /// <param name="horizontal">Indicates that strip is horizontal</param>
+ private void Draw3DStrip(ChartGraphics graph, RectangleF rect, bool horizontal )
+ {
+ ChartArea area = this.Axis.ChartArea;
+ GraphicsPath path = null;
+ DrawingOperationTypes operationType = DrawingOperationTypes.DrawElement;
+
+ if( this.Axis.Common.ProcessModeRegions )
+ {
+ operationType |= DrawingOperationTypes.CalcElementPath;
+ }
+
+ // Draw strip on the back/front wall
+ path = graph.Fill3DRectangle(
+ rect,
+ area.IsMainSceneWallOnFront() ? area.areaSceneDepth : 0f,
+ 0,
+ area.matrix3D,
+ area.Area3DStyle.LightStyle,
+ this.BackColor,
+ this.BorderColor,
+ this.BorderWidth,
+ this.BorderDashStyle,
+ operationType );
+
+ if( this.Axis.Common.ProcessModeRegions )
+ {
+
+#if !Microsoft_CONTROL
+ this.Axis.Common.HotRegionsList.AddHotRegion( graph, path, false, this.ToolTip, this.Url, this.MapAreaAttributes, this.PostBackValue, this, ChartElementType.StripLines );
+#else
+ this.Axis.Common.HotRegionsList.AddHotRegion( graph, path, false, this.ToolTip, null, null, null, this, ChartElementType.StripLines );
+#endif // !Microsoft_CONTROL
+ }
+
+ if(horizontal)
+ {
+ // Draw strip on the side wall (left or right)
+ if(!area.IsSideSceneWallOnLeft())
+ {
+ rect.X = rect.Right;
+ }
+ rect.Width = 0f;
+
+ path = graph.Fill3DRectangle(
+ rect,
+ 0f,
+ area.areaSceneDepth,
+ area.matrix3D,
+ area.Area3DStyle.LightStyle,
+ this.BackColor,
+ this.BorderColor,
+ this.BorderWidth,
+ this.BorderDashStyle,
+ operationType );
+
+ }
+ else if(area.IsBottomSceneWallVisible())
+ {
+ // Draw strip on the bottom wall (if visible)
+ rect.Y = rect.Bottom;
+ rect.Height = 0f;
+
+ path = graph.Fill3DRectangle(
+ rect,
+ 0f,
+ area.areaSceneDepth,
+ area.matrix3D,
+ area.Area3DStyle.LightStyle,
+ this.BackColor,
+ this.BorderColor,
+ this.BorderWidth,
+ this.BorderDashStyle,
+ operationType );
+
+ }
+ if( this.Axis.Common.ProcessModeRegions )
+ {
+#if !Microsoft_CONTROL
+ this.Axis.Common.HotRegionsList.AddHotRegion( graph, path, false, this.ToolTip, this.Url, this.MapAreaAttributes, this.PostBackValue, this, ChartElementType.StripLines );
+#else
+ this.Axis.Common.HotRegionsList.AddHotRegion( graph, path, false, this.ToolTip, null, null, null, this, ChartElementType.StripLines );
+#endif // !Microsoft_CONTROL
+ }
+ if (path != null)
+ {
+ path.Dispose();
+ }
+ }
+
+ /// <summary>
+ /// Draw strip/line title text
+ /// </summary>
+ /// <param name="graph">Chart graphics object.</param>
+ /// <param name="point1">First line point.</param>
+ /// <param name="point2">Second line point.</param>
+ private void PaintTitle(ChartGraphics graph, PointF point1, PointF point2)
+ {
+ if(this.Text.Length > 0)
+ {
+ // Define a rectangle to draw the title
+ RectangleF rect = RectangleF.Empty;
+ rect.X = point1.X;
+ rect.Y = point1.Y;
+ rect.Height = point2.Y - rect.Y;
+ rect.Width = point2.X - rect.X;
+
+ // Paint title using a rect
+ PaintTitle(graph, rect);
+ }
+ }
+
+ /// <summary>
+ /// Draw strip/line title text
+ /// </summary>
+ /// <param name="graph">Chart graphics object.</param>
+ /// <param name="rect">Rectangle to draw in.</param>
+ private void PaintTitle(ChartGraphics graph, RectangleF rect)
+ {
+ if(this.Text.Length > 0)
+ {
+ // Get title text
+ string titleText = this.Text;
+
+ // Prepare string format
+ using (StringFormat format = new StringFormat())
+ {
+ format.Alignment = this.TextAlignment;
+
+ if (graph.IsRightToLeft)
+ {
+ if (format.Alignment == StringAlignment.Far)
+ {
+ format.Alignment = StringAlignment.Near;
+ }
+ else if (format.Alignment == StringAlignment.Near)
+ {
+ format.Alignment = StringAlignment.Far;
+ }
+ }
+
+ format.LineAlignment = this.TextLineAlignment;
+
+ // Adjust default title angle for horizontal lines
+ int angle = 0;
+ switch (this.TextOrientation)
+ {
+ case (TextOrientation.Rotated90):
+ angle = 90;
+ break;
+ case (TextOrientation.Rotated270):
+ angle = 270;
+ break;
+ case (TextOrientation.Auto):
+ if (this.Axis.AxisPosition == AxisPosition.Bottom || this.Axis.AxisPosition == AxisPosition.Top)
+ {
+ angle = 270;
+ }
+ break;
+ }
+
+ // Set vertical text for horizontal lines
+ if (angle == 90)
+ {
+ format.FormatFlags = StringFormatFlags.DirectionVertical;
+ angle = 0;
+ }
+ else if (angle == 270)
+ {
+ format.FormatFlags = StringFormatFlags.DirectionVertical;
+ angle = 180;
+ }
+
+ // Measure string size
+ SizeF size = graph.MeasureStringRel(titleText.Replace("\\n", "\n"), this.Font, new SizeF(100, 100), format, this.GetTextOrientation());
+
+ // Adjust text size
+ float zPositon = 0f;
+ if (this.Axis.ChartArea.Area3DStyle.Enable3D)
+ {
+ // Get projection coordinates
+ Point3D[] textSizeProjection = new Point3D[3];
+ zPositon = this.Axis.ChartArea.IsMainSceneWallOnFront() ? this.Axis.ChartArea.areaSceneDepth : 0f;
+ textSizeProjection[0] = new Point3D(0f, 0f, zPositon);
+ textSizeProjection[1] = new Point3D(size.Width, 0f, zPositon);
+ textSizeProjection[2] = new Point3D(0f, size.Height, zPositon);
+
+ // Transform coordinates of text size
+ this.Axis.ChartArea.matrix3D.TransformPoints(textSizeProjection);
+
+ // Adjust text size
+ int index = this.Axis.ChartArea.IsMainSceneWallOnFront() ? 0 : 1;
+ size.Width *= size.Width / (textSizeProjection[index].X - textSizeProjection[(index == 0) ? 1 : 0].X);
+ size.Height *= size.Height / (textSizeProjection[2].Y - textSizeProjection[0].Y);
+ }
+
+
+ // Get relative size of the border width
+ SizeF sizeBorder = graph.GetRelativeSize(new SizeF(this.BorderWidth, this.BorderWidth));
+
+ // Find the center of rotation
+ PointF rotationCenter = PointF.Empty;
+ if (format.Alignment == StringAlignment.Near)
+ { // Near
+ rotationCenter.X = rect.X + size.Width / 2 + sizeBorder.Width;
+ }
+ else if (format.Alignment == StringAlignment.Far)
+ { // Far
+ rotationCenter.X = rect.Right - size.Width / 2 - sizeBorder.Width;
+ }
+ else
+ { // Center
+ rotationCenter.X = (rect.Left + rect.Right) / 2;
+ }
+
+ if (format.LineAlignment == StringAlignment.Near)
+ { // Near
+ rotationCenter.Y = rect.Top + size.Height / 2 + sizeBorder.Height;
+ }
+ else if (format.LineAlignment == StringAlignment.Far)
+ { // Far
+ rotationCenter.Y = rect.Bottom - size.Height / 2 - sizeBorder.Height;
+ }
+ else
+ { // Center
+ rotationCenter.Y = (rect.Bottom + rect.Top) / 2;
+ }
+
+ // Reset string alignment to center point
+ format.Alignment = StringAlignment.Center;
+ format.LineAlignment = StringAlignment.Center;
+
+ if (this.Axis.ChartArea.Area3DStyle.Enable3D)
+ {
+ // Get projection coordinates
+ Point3D[] rotationCenterProjection = new Point3D[2];
+ rotationCenterProjection[0] = new Point3D(rotationCenter.X, rotationCenter.Y, zPositon);
+ if (format.FormatFlags == StringFormatFlags.DirectionVertical)
+ {
+ rotationCenterProjection[1] = new Point3D(rotationCenter.X, rotationCenter.Y - 20f, zPositon);
+ }
+ else
+ {
+ rotationCenterProjection[1] = new Point3D(rotationCenter.X - 20f, rotationCenter.Y, zPositon);
+ }
+
+ // Transform coordinates of text rotation point
+ this.Axis.ChartArea.matrix3D.TransformPoints(rotationCenterProjection);
+
+ // Adjust rotation point
+ rotationCenter = rotationCenterProjection[0].PointF;
+
+ // Adjust angle of the text
+ if (angle == 0 || angle == 180 || angle == 90 || angle == 270)
+ {
+ if (format.FormatFlags == StringFormatFlags.DirectionVertical)
+ {
+ angle += 90;
+ }
+
+ // Convert coordinates to absolute
+ rotationCenterProjection[0].PointF = graph.GetAbsolutePoint(rotationCenterProjection[0].PointF);
+ rotationCenterProjection[1].PointF = graph.GetAbsolutePoint(rotationCenterProjection[1].PointF);
+
+ // Calcuate axis angle
+ float angleXAxis = (float)Math.Atan(
+ (rotationCenterProjection[1].Y - rotationCenterProjection[0].Y) /
+ (rotationCenterProjection[1].X - rotationCenterProjection[0].X));
+ angleXAxis = (float)Math.Round(angleXAxis * 180f / (float)Math.PI);
+ angle += (int)angleXAxis;
+ }
+ }
+
+ // Draw string
+ using (Brush brush = new SolidBrush(this.ForeColor))
+ {
+ graph.DrawStringRel(
+ titleText.Replace("\\n", "\n"),
+ this.Font,
+ brush,
+ rotationCenter,
+ format,
+ angle,
+ this.GetTextOrientation());
+ }
+
+ }
+ }
+ }
+
+ #endregion
+
+ #region Strip line properties
+
+ /// <summary>
+ /// Gets or sets the text orientation.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(TextOrientation.Auto),
+ SRDescription("DescriptionAttribute_TextOrientation"),
+ NotifyParentPropertyAttribute(true),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+#endif
+]
+ public TextOrientation TextOrientation
+ {
+ get
+ {
+ return this._textOrientation;
+ }
+ set
+ {
+ this._textOrientation = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the strip or line starting position offset.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ Bindable(true),
+ DefaultValue(0.0),
+ SRDescription("DescriptionAttributeStripLine_IntervalOffset"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ TypeConverter(typeof(AxisLabelDateValueConverter))
+ ]
+ public double IntervalOffset
+ {
+ get
+ {
+ return _intervalOffset;
+ }
+ set
+ {
+ _intervalOffset = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the unit of measurement of the strip or line offset.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ Bindable(true),
+ DefaultValue(DateTimeIntervalType.Auto),
+ SRDescription("DescriptionAttributeStripLine_IntervalOffsetType"),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public DateTimeIntervalType IntervalOffsetType
+ {
+ get
+ {
+ return intervalOffsetType;
+ }
+ set
+ {
+ intervalOffsetType = (value != DateTimeIntervalType.NotSet) ? value : DateTimeIntervalType.Auto;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the strip or line step size.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ Bindable(true),
+ DefaultValue(0.0),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ SRDescription("DescriptionAttributeStripLine_Interval"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public double Interval
+ {
+ get
+ {
+ return _interval;
+ }
+ set
+ {
+ _interval = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the unit of measurement of the strip or line step.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ Bindable(true),
+ DefaultValue(DateTimeIntervalType.Auto),
+ SRDescription("DescriptionAttributeStripLine_IntervalType"),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public DateTimeIntervalType IntervalType
+ {
+ get
+ {
+ return _intervalType;
+ }
+ set
+ {
+ _intervalType = (value != DateTimeIntervalType.NotSet) ? value : DateTimeIntervalType.Auto;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the strip width.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ Bindable(true),
+ DefaultValue(0.0),
+ SRDescription("DescriptionAttributeStripLine_StripWidth"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public double StripWidth
+ {
+ get
+ {
+ return _stripWidth;
+ }
+ set
+ {
+ if(value < 0)
+ {
+ throw (new ArgumentException(SR.ExceptionStripLineWidthIsNegative, "value"));
+ }
+ _stripWidth = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the unit of measurement of the strip width.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ Bindable(true),
+ DefaultValue(DateTimeIntervalType.Auto),
+ SRDescription("DescriptionAttributeStripLine_StripWidthType"),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public DateTimeIntervalType StripWidthType
+ {
+ get
+ {
+ return _stripWidthType;
+ }
+ set
+ {
+ _stripWidthType = (value != DateTimeIntervalType.NotSet) ? value : DateTimeIntervalType.Auto;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background color.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeBackColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BackColor
+ {
+ get
+ {
+ return _backColor;
+ }
+ set
+ {
+ _backColor = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the border color.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeBorderColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BorderColor
+ {
+ get
+ {
+ return _borderColor;
+ }
+ set
+ {
+ _borderColor = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the border style.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartDashStyle.Solid),
+ SRDescription("DescriptionAttributeBorderDashStyle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public ChartDashStyle BorderDashStyle
+ {
+ get
+ {
+ return _borderDashStyle;
+ }
+ set
+ {
+ _borderDashStyle = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the border width.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(1),
+ SRDescription("DescriptionAttributeBorderWidth"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public int BorderWidth
+ {
+ get
+ {
+ return _borderWidth;
+ }
+ set
+ {
+ _borderWidth = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background image.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeBackImage"),
+ Editor(Editors.ImageValueEditor.Editor, Editors.ImageValueEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ NotifyParentPropertyAttribute(true)
+ ]
+ public string BackImage
+ {
+ get
+ {
+ return _backImage;
+ }
+ set
+ {
+ _backImage = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background image drawing mode.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartImageWrapMode.Tile),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeImageWrapMode"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public ChartImageWrapMode BackImageWrapMode
+ {
+ get
+ {
+ return _backImageWrapMode;
+ }
+ set
+ {
+ _backImageWrapMode = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a color which will be replaced with a transparent color while drawing the background image.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeImageTransparentColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BackImageTransparentColor
+ {
+ get
+ {
+ return _backImageTransparentColor;
+ }
+ set
+ {
+ _backImageTransparentColor = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background image alignment used by unscale drawing mode.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartImageAlignmentStyle.TopLeft),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackImageAlign"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public ChartImageAlignmentStyle BackImageAlignment
+ {
+ get
+ {
+ return _backImageAlignment;
+ }
+ set
+ {
+ _backImageAlignment = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background gradient style.
+ /// <seealso cref="BackSecondaryColor"/>
+ /// <seealso cref="BackColor"/>
+ /// <seealso cref="BackHatchStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="GradientStyle"/> value used for the background.
+ /// </value>
+ /// <remarks>
+ /// Two colors are used to draw the gradient, <see cref="BackColor"/> and <see cref="BackSecondaryColor"/>.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(GradientStyle.None),
+ SRDescription("DescriptionAttributeBackGradientStyle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ Editor(Editors.GradientEditor.Editor, Editors.GradientEditor.Base)
+ ]
+ public GradientStyle BackGradientStyle
+ {
+ get
+ {
+ return _backGradientStyle;
+ }
+ set
+ {
+ _backGradientStyle = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the secondary background color.
+ /// <seealso cref="BackColor"/>
+ /// <seealso cref="BackHatchStyle"/>
+ /// <seealso cref="BackGradientStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value used for the secondary color of a background with
+ /// hatching or gradient fill.
+ /// </value>
+ /// <remarks>
+ /// This color is used with <see cref="BackColor"/> when <see cref="BackHatchStyle"/> or
+ /// <see cref="BackGradientStyle"/> are used.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeBackSecondaryColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BackSecondaryColor
+ {
+ get
+ {
+ return _backSecondaryColor;
+ }
+ set
+ {
+ _backSecondaryColor = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background hatch style.
+ /// <seealso cref="BackSecondaryColor"/>
+ /// <seealso cref="BackColor"/>
+ /// <seealso cref="BackGradientStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="ChartHatchStyle"/> value used for the background.
+ /// </value>
+ /// <remarks>
+ /// Two colors are used to draw the hatching, <see cref="BackColor"/> and <see cref="BackSecondaryColor"/>.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartHatchStyle.None),
+ SRDescription("DescriptionAttributeBackHatchStyle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ Editor(Editors.HatchStyleEditor.Editor, Editors.HatchStyleEditor.Base)
+ ]
+ public ChartHatchStyle BackHatchStyle
+ {
+ get
+ {
+ return _backHatchStyle;
+ }
+ set
+ {
+ _backHatchStyle = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the name of the strip line.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(false),
+ Browsable(false),
+ DefaultValue("StripLine"),
+ SRDescription("DescriptionAttributeStripLine_Name"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden)
+ ]
+ public string Name
+ {
+ get
+ {
+ return "StripLine";
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the title text of the strip line.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeTitle"),
+ Bindable(true),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeStripLine_Title"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public string Text
+ {
+ get
+ {
+ return _text;
+ }
+ set
+ {
+ _text = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the fore color of the strip line.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeTitle"),
+ Bindable(true),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeStripLine_TitleColor"),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color ForeColor
+ {
+ get
+ {
+ return _foreColor;
+ }
+ set
+ {
+ _foreColor = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the text alignment of the strip line.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeTitle"),
+ Bindable(true),
+ DefaultValue(typeof(StringAlignment), "Far"),
+ SRDescription("DescriptionAttributeStripLine_TitleAlignment"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public StringAlignment TextAlignment
+ {
+ get
+ {
+ return _textAlignment;
+ }
+ set
+ {
+ _textAlignment = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the text line alignment of the strip line.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeTitle"),
+ Bindable(true),
+ DefaultValue(typeof(StringAlignment), "Near"),
+ SRDescription("DescriptionAttributeStripLine_TitleLineAlignment"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public StringAlignment TextLineAlignment
+ {
+ get
+ {
+ return _textLineAlignment;
+ }
+ set
+ {
+ _textLineAlignment = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the title font.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeTitle"),
+ Bindable(true),
+ DefaultValue(typeof(Font), "Microsoft Sans Serif, 8pt"),
+ SRDescription("DescriptionAttributeTitleFont"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Font Font
+ {
+ get
+ {
+ return _font;
+ }
+ set
+ {
+ _font = value;
+ this.Invalidate();
+ }
+ }
+
+
+ /// <summary>
+ /// Gets or sets the tooltip.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMapArea"),
+
+ Bindable(true),
+ SRDescription("DescriptionAttributeToolTip"),
+ DefaultValue(""),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public string ToolTip
+ {
+ set
+ {
+ this.Invalidate();
+ _toolTip = value;
+ }
+ get
+ {
+ return _toolTip;
+ }
+ }
+
+#if !Microsoft_CONTROL
+
+ /// <summary>
+ /// Gets or sets the URL.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMapArea"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeUrl"),
+ DefaultValue(""),
+ PersistenceMode(PersistenceMode.Attribute),
+ Editor(Editors.UrlValueEditor.Editor, Editors.UrlValueEditor.Base)
+
+ ]
+ public string Url
+ {
+ set
+ {
+ _url = value;
+ this.Invalidate();
+ }
+ get
+ {
+ return _url;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the other map area attributes.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMapArea"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeMapAreaAttributes"),
+ DefaultValue(""),
+ PersistenceMode(PersistenceMode.Attribute)
+ ]
+ public string MapAreaAttributes
+ {
+ set
+ {
+ _attributes = value;
+ this.Invalidate();
+ }
+ get
+ {
+ return _attributes;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the postback value which can be processed on a click event.
+ /// </summary>
+ /// <value>The value which is passed to a click event as an argument.</value>
+ [DefaultValue("")]
+ [SRCategory(SR.Keys.CategoryAttributeMapArea)]
+ [SRDescription(SR.Keys.DescriptionAttributePostBackValue)]
+ public string PostBackValue
+ {
+ get
+ {
+ return this._postbackValue;
+ }
+ set
+ {
+ this._postbackValue = value;
+ }
+ }
+
+
+#endif //#if !Microsoft_CONTROL
+
+ #endregion
+
+
+ #region Invalidation methods
+
+ /// <summary>
+ /// Invalidate chart area
+ /// </summary>
+ private new void Invalidate()
+ {
+#if Microsoft_CONTROL
+
+ if(this.Axis != null)
+ {
+ Axis.Invalidate();
+ }
+#endif
+ }
+
+ #endregion
+
+ #region IDisposable Members
+
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ if (_fontCache != null)
+ {
+ _fontCache.Dispose();
+ _fontCache = null;
+ }
+ }
+ base.Dispose(disposing);
+ }
+
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/SubAxis.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/SubAxis.cs
new file mode 100644
index 00000000000..58ddbccff0a
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/SubAxis.cs
@@ -0,0 +1,823 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: SubAxis.cs
+//
+// Namespace: DataVisualization.Charting
+//
+// Classes: SubAxis, SubAxisCollection
+//
+// Purpose: Each chart area contains four main axes PrimaryX,
+// PrimaryY, SecondaryX and SecondaryY which are usually
+// positioned on each side of the plotting area. Most of
+// the charts use only two axes; X and Y, but for some
+// charts even 4 axes is not sufficient. Sub-axes were
+// introduced to provide unlimited number of axes in
+// the chart.
+//
+// Each main axis has a collection of SubAxis which is
+// empty by default. By adding SubAxis into this collection
+// user can add unlimited number of sub-axis which will
+// be positioned next to the main axis.
+//
+// Each of the SubAxis have a unique name. To associate
+// data series with a sub axis YSubAxisName and XSubAxisName
+// properties of the Series should be used.
+//
+// Reviewed: AG - March 13, 2007
+//
+//===================================================================
+
+#if SUBAXES
+
+#region Used namespace
+using System;
+using System.Globalization;
+using System.Reflection;
+using System.Collections;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.ComponentModel.Design.Serialization;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Text;
+using System.Drawing.Drawing2D;
+#if WINFORMS_CONTROL
+using System.Windows.Forms.DataVisualization.Charting;
+using System.Windows.Forms.DataVisualization.Charting.Data;
+using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+using System.Windows.Forms.DataVisualization.Charting.Utilities;
+using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+using System.Windows.Forms.DataVisualization.Charting;
+
+#else
+ using System.Web;
+ using System.Web.UI;
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Data;
+ using System.Web.UI.DataVisualization.Charting.Utilities;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+#endif
+
+
+#endregion
+
+#if WINFORMS_CONTROL
+namespace System.Windows.Forms.DataVisualization.Charting
+
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ /// <summary>
+ /// SubAxis class is derived from the main Axis class and provides
+ /// additional axis associated with one of the main chart axis.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeSubAxis_SubAxis"),
+ DefaultProperty("Enabled"),
+#if WINFORMS_CONTROL
+ TypeConverter(typeof(SubAxis.SubAxisConverter)),
+#endif
+
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class SubAxis : Axis
+ {
+#region Fields
+
+ /// <summary>
+ /// Sub-Axis parent axis object.
+ /// </summary>
+ internal Axis parentAxis = null;
+
+ /// <summary>
+ /// Sub axis offset from the parent axis
+ /// </summary>
+ internal double offsetFromParent = 0.0;
+
+ /// <summary>
+ /// Margin between prev. axis
+ /// </summary>
+ internal double locationOffset = 0.0;
+
+#endregion // Fields
+
+#region Constructor
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public SubAxis() : base()
+ {
+ base.Name = string.Empty;
+ }
+
+ /// <summary>
+ /// Object constructor.
+ /// </summary>
+ /// <param name="name">Unique name of the object.</param>
+ public SubAxis(string name) : base()
+ {
+ base.Name = name;
+ }
+
+#endregion
+
+#region Properties
+
+ /// <summary>
+ /// Axis automatic scale breaks style.
+ /// </summary>
+ [
+ Browsable(false),
+ EditorBrowsable(EditorBrowsableState.Never),
+ SRCategory("CategoryAttributeScale"),
+ SRDescription("DescriptionAttributeScaleBreakStyle"),
+ TypeConverter(typeof(NoNameExpandableObjectConverter)),
+ NotifyParentPropertyAttribute(true),
+#if WINFORMS_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ ]
+ override public AxisScaleBreakStyle ScaleBreakStyle
+ {
+ get
+ {
+ return base.ScaleBreakStyle;
+ }
+ set
+ {
+ base.ScaleBreakStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Sub axis parent axis.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAxis"),
+ Bindable(true),
+ Browsable(false),
+ DefaultValue(null),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeSubAxis_ParentAxis"),
+#if !WINFORMS_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+#endif
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden)
+ ]
+ public Axis ParentAxis
+ {
+ get
+ {
+ return this.parentAxis;
+ }
+ }
+
+
+ /// <summary>
+ /// Sub axis location offset relative to the previous axis.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeLocation"),
+ Bindable(true),
+ DefaultValue(0.0),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeSubAxis_LocationOffset"),
+#if !WINFORMS_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+#endif
+ ]
+ public double LocationOffset
+ {
+ get
+ {
+ return this.locationOffset;
+ }
+ set
+ {
+ this.locationOffset = value;
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Axis position
+ /// </summary>
+ [
+ Bindable(true),
+ Browsable(false),
+ DefaultValue(AxisPosition.Left),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeReverse"),
+#if !WINFORMS_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+#endif
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden)
+ ]
+ override internal AxisPosition AxisPosition
+ {
+ get
+ {
+ if(this.parentAxis != null)
+ {
+ return this.parentAxis.AxisPosition;
+ }
+ return AxisPosition.Left;
+ }
+ set
+ {
+ }
+ }
+
+ /// <summary>
+ /// SubAxis name.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ Browsable(true),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeSubAxis_Name"),
+#if !WINFORMS_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+#endif
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible),
+ SerializationVisibilityAttribute(SerializationVisibility.Attribute)
+ ]
+ override public string Name
+ {
+ get
+ {
+ return base.Name;
+ }
+ set
+ {
+ base.Name = value;
+ }
+ }
+
+ /// <summary>
+ /// Tick marks and labels move with axis when
+ /// the crossing value is changed.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Browsable(false),
+ EditorBrowsable(EditorBrowsableState.Never),
+ Bindable(true),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeMarksNextToAxis"),
+ NotifyParentPropertyAttribute(true),
+#if !WINFORMS_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+#endif
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden)
+ ]
+ override public bool IsMarksNextToAxis
+ {
+ get
+ {
+ return base.IsMarksNextToAxis;
+ }
+ set
+ {
+ base.IsMarksNextToAxis = value;
+ }
+ }
+
+ /// <summary>
+ /// Point where axis is crossed by another axis.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeScale"),
+ Browsable(false),
+ EditorBrowsable(EditorBrowsableState.Never),
+ Bindable(true),
+ DefaultValue(Double.NaN),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeCrossing"),
+#if !WINFORMS_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+#endif
+ TypeConverter(typeof(AxisCrossingValueConverter)),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden)
+ ]
+ override public double Crossing
+ {
+ get
+ {
+ return base.Crossing;
+ }
+ set
+ {
+ base.Crossing = value;
+ }
+ }
+
+ /// <summary>
+ /// Sub-axes collection.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeSubAxes"),
+ Browsable(false),
+ EditorBrowsable(EditorBrowsableState.Never),
+ Bindable(true),
+ SRDescription("DescriptionAttributeSubAxes"),
+ Editor(Editors.ChartCollectionEditor.Editor, Editors.ChartCollectionEditor.Base),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ ]
+ override public SubAxisCollection SubAxes
+ {
+ get
+ {
+ return base.SubAxes;
+ }
+ }
+
+ /// <summary>
+ /// Indicates if this axis object present the main or sub axis.
+ /// </summary>
+ override internal bool IsSubAxis
+ {
+ get
+ {
+ return true;
+ }
+ }
+
+ /// <summary>
+ /// Returns sub-axis name.
+ /// </summary>
+ override internal string SubAxisName
+ {
+ get
+ {
+ return base.Name;
+ }
+ }
+
+#endregion // Properties
+
+#region Methods
+
+ /// <summary>
+ /// Find axis position using crossing value.
+ /// </summary>
+ /// <param name="ignoreCrossing">Axis crossing should be ignored.</param>
+ /// <returns>Relative position</returns>
+ override internal double GetAxisPosition(bool ignoreCrossing)
+ {
+ // Parent axis must be set
+ if(this.parentAxis != null)
+ {
+ // Get position of the parent axis
+ double position = this.parentAxis.GetAxisPosition(ignoreCrossing);
+
+ // Addjust parent position by the offset
+ if(this.parentAxis.AxisPosition == AxisPosition.Left)
+ {
+ position -= this.offsetFromParent;
+ }
+ else if(this.parentAxis.AxisPosition == AxisPosition.Right)
+ {
+ position += this.offsetFromParent;
+ }
+ else if(this.parentAxis.AxisPosition == AxisPosition.Top)
+ {
+ position -= this.offsetFromParent;
+ }
+ else if(this.parentAxis.AxisPosition == AxisPosition.Bottom)
+ {
+ position += this.offsetFromParent;
+ }
+ return position;
+ }
+
+ return 0.0;
+ }
+
+#endregion // Methods
+
+#region Type converter
+
+#if WINFORMS_CONTROL
+
+ internal class SubAxisConverter : TypeConverter
+ {
+ /// <summary>
+ /// This method overrides CanConvertTo from TypeConverter. This is called when someone
+ /// wants to convert an instance of object to another type. Here,
+ /// only conversion to an InstanceDescriptor is supported.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="destinationType">Destination type.</param>
+ /// <returns>True if object can be converted.</returns>
+ public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
+ {
+ if (destinationType == typeof(InstanceDescriptor))
+ {
+ return true;
+ }
+
+ // Always call the base to see if it can perform the conversion.
+ return base.CanConvertTo(context, destinationType);
+ }
+
+ /// <summary>
+ /// This code performs the actual conversion from an object to an InstanceDescriptor.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Object value.</param>
+ /// <param name="destinationType">Destination type.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+ {
+ if (destinationType == typeof(InstanceDescriptor))
+ {
+ ConstructorInfo ci = typeof(SubAxis).GetConstructor(System.Type.EmptyTypes);
+ return new InstanceDescriptor(ci, null, false);
+ }
+
+ // Always call base, even if you can't convert.
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
+ }
+
+#endif //#if WINFORMS_CONTROL
+
+#endregion
+ }
+
+ /// <summary>
+ /// <b>SubAxisCollection</b> is a strongly typed collection of chart sub-axes objects.
+ /// Collection indexer can accept sub-axis index or it's unique name as a parameter.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeSubAxisCollection_SubAxisCollection"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class SubAxisCollection : CollectionBase
+ {
+#region Fields
+
+ /// <summary>
+ /// Sub-Axis parent axis object.
+ /// </summary>
+ internal Axis parentAxis = null;
+
+#endregion
+
+#region Construction and Initialization
+
+ /// <summary>
+ /// Default public constructor.
+ /// </summary>
+ /// <remarks>
+ /// This constructor is for internal use and should not be part of documentation.
+ /// </remarks>
+ public SubAxisCollection()
+ {
+ this.parentAxis = null;
+ }
+
+ /// <summary>
+ /// Public constructor.
+ /// </summary>
+ /// <param name="parentAxis">
+ /// Chart <see cref="Axis"/> object.
+ /// </param>
+ /// <remarks>
+ /// This constructor is for the internal use and should not be part of documentation.
+ /// </remarks>
+ internal SubAxisCollection(Axis parentAxis)
+ {
+ this.parentAxis = parentAxis;
+ }
+
+#endregion
+
+#region Indexer
+
+ /// <summary>
+ /// SubAxis collection indexer.
+ /// </summary>
+ /// <remarks>
+ /// The <b>SubAxis</b> object's name or index can be provided as a parameter. Returns the <see cref="SubAxis"/> object.
+ /// Make sure to cast the SubAxis to it's type (e.g. LineSubAxis) to access type
+ /// specific properties.
+ /// </remarks>
+ [
+ SRDescription("DescriptionAttributeSubAxisCollection_Item"),
+ ]
+ public SubAxis this[object parameter]
+ {
+ get
+ {
+ // Get SubAxis by index
+ if(parameter is int)
+ {
+ return (SubAxis)this.List[(int)parameter];
+ }
+
+ // Get SubAxis by name
+ else if(parameter is string)
+ {
+ // Find SubAxis with specified name
+ foreach(SubAxis SubAxis in this.List)
+ {
+ if(SubAxis.Name == (string)parameter)
+ {
+ return SubAxis;
+ }
+ }
+
+ // SubAxis with specified name was not found
+ throw(new ArgumentException( SR.ExceptionSubAxisNameNotFound( (string)parameter ) ) );
+ }
+
+ // Invalid type of the indexer argument
+ throw(new ArgumentException(SR.ExceptionInvalidIndexerArgumentType));
+ }
+
+ set
+ {
+ // Check new SubAxis name
+ int indexSubAxis = -1;
+ if(value.Name.Length != 0)
+ {
+ indexSubAxis = this.List.IndexOf(value);
+ }
+ else
+ {
+ AssignUniqueName(value);
+ }
+
+ // Set using index in the collection
+ if(parameter is int)
+ {
+ // Check if SubAxis with this name already exists
+ if( indexSubAxis != -1 && indexSubAxis != (int)parameter)
+ {
+ throw( new ArgumentException( SR.ExceptionSubAxisNameAlreadyExistsInCollection( value.Name ) ) );
+ }
+
+ this.List[(int)parameter] = value;
+ }
+
+ // Set using name in the collection
+ else if(parameter is string)
+ {
+ // Find legend with specified name
+ int index = 0;
+ foreach(SubAxis SubAxis in this.List)
+ {
+ if(SubAxis.Name == (string)parameter)
+ {
+ // Check if SubAxis with this name already exists
+ if( indexSubAxis != -1 && indexSubAxis != index)
+ {
+ throw( new ArgumentException( SR.ExceptionSubAxisNameAlreadyExistsInCollection( value.Name ) ) );
+ }
+
+ this.List[index] = value;
+ break;
+ }
+ ++index;
+ }
+ }
+ else
+ {
+ throw(new ArgumentException(SR.ExceptionInvalidIndexerArgumentType));
+ }
+
+ this.Invalidate();
+ }
+ }
+
+#endregion
+
+#region Collection Add and Insert methods
+
+ /// <summary>
+ /// Removes the SubAxis with the specified name from the collection.
+ /// </summary>
+ /// <param name="name">
+ /// Name of the SubAxis to be removed.
+ /// </param>
+ public void Remove(string name)
+ {
+ SubAxis axis = FindByName(name);
+ if(axis != null)
+ {
+ this.List.Remove(axis);
+ }
+ }
+
+ /// <summary>
+ /// Removes the given SubAxis from the collection.
+ /// </summary>
+ /// <param name="SubAxis">
+ /// <see cref="SubAxis"/> object to be removed.
+ /// </param>
+ public void Remove(SubAxis SubAxis)
+ {
+ if(SubAxis != null)
+ {
+ this.List.Remove(SubAxis);
+ }
+ }
+
+ /// <summary>
+ /// Adds a SubAxis to the end of the collection.
+ /// </summary>
+ /// <param name="SubAxis">
+ /// <see cref="SubAxis"/> object to add.
+ /// </param>
+ /// <returns>
+ /// Index of the newly added object.
+ /// </returns>
+ public int Add(SubAxis SubAxis)
+ {
+ return this.List.Add(SubAxis);
+ }
+
+ /// <summary>
+ /// Inserts a SubAxis into the collection.
+ /// </summary>
+ /// <param name="index">
+ /// Index to insert the object at.
+ /// </param>
+ /// <param name="SubAxis">
+ /// <see cref="SubAxis"/> object to insert.
+ /// </param>
+ public void Insert(int index, SubAxis SubAxis)
+ {
+ this.List.Insert(index, SubAxis);
+ }
+
+#endregion
+
+#region Items Inserting and Removing Notification methods
+
+ /// <summary>
+ /// Called before the new item is inserted.
+ /// </summary>
+ /// <param name="index">Item index.</param>
+ /// <param name="value">Item object.</param>
+ /// <remarks>
+ /// This is an internal method and should not be part of the documentation.
+ /// </remarks>
+ protected override void OnInsert(int index, object value)
+ {
+ // Check SubAxis object name
+ if( ((SubAxis)value).Name.Length == 0 )
+ {
+ AssignUniqueName((SubAxis)value);
+ }
+ else
+ {
+ if(this.FindByName(((SubAxis)value).Name) != null)
+ {
+ throw(new InvalidOperationException(SR.ExceptionSubAxisNameIsNotUnique( ((SubAxis)value).Name )));
+ }
+ }
+ }
+
+ /// <summary>
+ /// After new item inserted.
+ /// </summary>
+ /// <param name="index">Item index.</param>
+ /// <param name="value">Item object.</param>
+ /// <remarks>
+ /// This is an internal method and should not be part of the documentation.
+ /// </remarks>
+ protected override void OnInsertComplete(int index, object value)
+ {
+ // Set SubAxis parent axis reference
+ SubAxis subAxis = (SubAxis)value;
+ subAxis.parentAxis = this.parentAxis;
+ if(this.parentAxis != null)
+ {
+ subAxis.chart = this.parentAxis.chart;
+ subAxis.Common = this.parentAxis.Common;
+ subAxis.chartArea = this.parentAxis.chartArea;
+ subAxis.axisType= this.parentAxis.axisType;
+ subAxis.AxisPosition= this.parentAxis.AxisPosition;
+ }
+ this.Invalidate();
+ }
+
+ /// <summary>
+ /// After item removed.
+ /// </summary>
+ /// <param name="index">Item index.</param>
+ /// <param name="value">Item object.</param>
+ /// <remarks>
+ /// This is an internal method and should not be part of the documentation.
+ /// </remarks>
+ protected override void OnRemoveComplete(int index, object value)
+ {
+ // Reset SubAxis parent axis reference
+ ((SubAxis)value).parentAxis = null;
+
+ this.Invalidate();
+ }
+
+ /// <summary>
+ /// After all items removed.
+ /// </summary>
+ /// <remarks>
+ /// This is an internal method and should not be part of the documentation.
+ /// </remarks>
+ protected override void OnClearComplete()
+ {
+ this.Invalidate();
+ }
+
+#endregion
+
+#region Helper Methods
+
+ /// <summary>
+ /// Invalidates chart the collection belongs to.
+ /// </summary>
+ private void Invalidate()
+ {
+#if WINFORMS_CONTROL
+ if(this.parentAxis != null && this.parentAxis.chart != null)
+ {
+ this.parentAxis.chart.dirtyFlag = true;
+ this.parentAxis.chart.Invalidate();
+ }
+#endif
+ }
+
+ /// <summary>
+ /// Assigns a unique name to the SubAxis object based on it's type.
+ /// </summary>
+ /// <param name="SubAxis">SubAxis object to be named.</param>
+ internal void AssignUniqueName(SubAxis SubAxis)
+ {
+ // Generate name using SubAxis type name and unique index
+ string name = string.Empty;
+ int index = 1;
+ do
+ {
+ name = "SubAxis" + index.ToString();
+ ++index;
+ } while(this.FindByName(name) != null && index < 10000 );
+
+ // Asign unique name;
+ SubAxis.Name = name;
+ }
+
+ /// <summary>
+ /// Finds SubAxis by name.
+ /// </summary>
+ /// <param name="name">Name of the chart SubAxis.</param>
+ /// <returns>SubAxis or null if it does not exist.</returns>
+ internal SubAxis FindByName(string name)
+ {
+ SubAxis result = null;
+ for(int index = 0; index < this.List.Count; index ++)
+ {
+ // Compare SubAxis name
+ if(String.Compare(this[index].Name, name, true, System.Globalization.CultureInfo.CurrentCulture) == 0)
+ {
+ result = this[index];
+ break;
+ }
+ }
+
+ return result;
+ }
+
+#endregion
+ }
+}
+
+#endif // SUBAXES
+
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Title.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Title.cs
new file mode 100644
index 00000000000..00090cfdcf1
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/General/Title.cs
@@ -0,0 +1,2237 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: Title.cs
+//
+// Namespace: DataVisualization.Charting
+//
+// Classes: TitleCollection, Title, Docking
+//
+// Purpose: Titles can be added to the chart by simply including
+// those titles into the Titles collection, which is
+// found in the root Chart object. The Title object
+// incorporates several properties that can be used to
+// position, dock, and control the appearance of any
+// Title. Title positioning can be explicitly set, or
+// you can specify that your title be docked. The
+// charting control gives you full control over all of
+// the appearance properties of your Titles, so you have
+// the ability to set specific properties for such things
+// as fonts, or colors, and even text effects.
+//
+// NOTE: In early versions of the Chart control only 1 title was
+// exposed through the Title, TitleFont and TitleFontColor properties
+// in the root chart object. Due to the customer requests, support for
+// unlimited number of titles was added through the TitleCollection
+// exposed as a Titles property of the root chart object. Old
+// properties were deprecated and marked as non-browsable.
+//
+// Reviewed: AG - Microsoft 13, 2007
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Drawing2D;
+using System.Diagnostics.CodeAnalysis;
+using System.Globalization;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+ using System.ComponentModel.Design.Serialization;
+ using System.Reflection;
+ using System.Windows.Forms.Design;
+#else
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.DataVisualization.Charting;
+using System.Web.UI.DataVisualization.Charting.Data;
+using System.Web.UI.DataVisualization.Charting.Utilities;
+#endif
+
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ #region Title enumerations
+
+ /// <summary>
+ /// An enumeration of chart element docking styles.
+ /// </summary>
+ public enum Docking
+ {
+ /// <summary>
+ /// Docked to the top.
+ /// </summary>
+ Top,
+
+ /// <summary>
+ /// Docked to the right.
+ /// </summary>
+ Right,
+
+ /// <summary>
+ /// Docked to the bottom.
+ /// </summary>
+ Bottom,
+
+ /// <summary>
+ /// Docked to the left.
+ /// </summary>
+ Left,
+ };
+
+ /// <summary>
+ /// Text drawing styles.
+ /// </summary>
+ public enum TextStyle
+ {
+ /// <summary>
+ /// Default text drawing style.
+ /// </summary>
+ Default,
+
+ /// <summary>
+ /// Shadow text.
+ /// </summary>
+ Shadow,
+
+ /// <summary>
+ /// Emboss text.
+ /// </summary>
+ Emboss,
+
+ /// <summary>
+ /// Embed text.
+ /// </summary>
+ Embed,
+
+ /// <summary>
+ /// Frame text.
+ /// </summary>
+ Frame
+ }
+
+
+ /// <summary>
+ /// An enumeration of chart text orientation.
+ /// </summary>
+ public enum TextOrientation
+ {
+ /// <summary>
+ /// Orientation is automatically determined based on the type of the
+ /// chart element it is used in.
+ /// </summary>
+ Auto,
+
+ /// <summary>
+ /// Horizontal text.
+ /// </summary>
+ Horizontal,
+
+ /// <summary>
+ /// Text rotated 90 degrees and oriented from top to bottom.
+ /// </summary>
+ Rotated90,
+
+ /// <summary>
+ /// Text rotated 270 degrees and oriented from bottom to top.
+ /// </summary>
+ Rotated270,
+
+ /// <summary>
+ /// Text characters are not rotated and position one below the other.
+ /// </summary>
+ Stacked
+ }
+
+ #endregion
+
+ /// <summary>
+ /// The Title class provides properties which define content, visual
+ /// appearance and position of the single chart title. It also
+ /// contains methods responsible for calculating title position,
+ /// drawing and hit testing.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeTitle5"),
+ ]
+#if Microsoft_CONTROL
+ public class Title : ChartNamedElement, IDisposable
+#else
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class Title : ChartNamedElement, IDisposable, IChartMapArea
+#endif
+ {
+ #region Fields
+
+ // Spacing between title text and the border in pixels
+ internal int titleBorderSpacing = 4;
+
+
+ //***********************************************************
+ //** Private data members, which store properties values
+ //***********************************************************
+
+ // Title text
+ private string _text = String.Empty;
+
+ // Title drawing style
+ private TextStyle _style = TextStyle.Default;
+
+ // Title position
+ private ElementPosition _position = null;
+
+ // Background properties
+ private bool _visible = true;
+ private Color _backColor = Color.Empty;
+ private ChartHatchStyle _backHatchStyle = ChartHatchStyle.None;
+ private string _backImage = "";
+ private ChartImageWrapMode _backImageWrapMode = ChartImageWrapMode.Tile;
+ private Color _backImageTransparentColor = Color.Empty;
+ private ChartImageAlignmentStyle _backImageAlignment = ChartImageAlignmentStyle.TopLeft;
+ private GradientStyle _backGradientStyle = GradientStyle.None;
+ private Color _backSecondaryColor = Color.Empty;
+ private int _shadowOffset = 0;
+ private Color _shadowColor = Color.FromArgb(128, 0, 0, 0);
+
+ // Border properties
+ private Color _borderColor = Color.Empty;
+ private int _borderWidth = 1;
+ private ChartDashStyle _borderDashStyle = ChartDashStyle.Solid;
+
+ // Font properties
+ private FontCache _fontCache = new FontCache();
+ private Font _font;
+ private Color _foreColor = Color.Black;
+
+ // Docking and Alignment properties
+ private ContentAlignment _alignment = ContentAlignment.MiddleCenter;
+ private Docking _docking = Docking.Top;
+ private string _dockedToChartArea = Constants.NotSetValue;
+ private bool _isDockedInsideChartArea = true;
+ private int _dockingOffset = 0;
+
+ // Interactive properties
+ private string _toolTip = String.Empty;
+
+#if !Microsoft_CONTROL
+ private string _url = String.Empty;
+ private string _mapAreaAttributes = String.Empty;
+ private string _postbackValue = String.Empty;
+#endif
+
+ // Default text orientation
+ private TextOrientation _textOrientation = TextOrientation.Auto;
+
+ #endregion
+
+ #region Constructors and Initialization
+
+ /// <summary>
+ /// Title constructor.
+ /// </summary>
+ public Title()
+ {
+ Initialize(string.Empty, Docking.Top, null, Color.Black);
+ }
+
+ /// <summary>
+ /// Public constructor.
+ /// </summary>
+ /// <param name="text">Title text.</param>
+ public Title(string text)
+ {
+ Initialize(text, Docking.Top, null, Color.Black);
+ }
+
+ /// <summary>
+ /// Title constructor.
+ /// </summary>
+ /// <param name="text">Title text.</param>
+ /// <param name="docking">Title docking.</param>
+ public Title(string text, Docking docking)
+ {
+ Initialize(text, docking, null, Color.Black);
+ }
+
+ /// <summary>
+ /// Title constructor.
+ /// </summary>
+ /// <param name="text">Title text.</param>
+ /// <param name="docking">Title docking.</param>
+ /// <param name="font">Title font.</param>
+ /// <param name="color">Title color.</param>
+ public Title(string text, Docking docking, Font font, Color color)
+ {
+ Initialize(text, docking, font, color);
+ }
+
+ /// <summary>
+ /// Initialize title object.
+ /// </summary>
+ /// <param name="text">Title text.</param>
+ /// <param name="docking">Title docking.</param>
+ /// <param name="font">Title font.</param>
+ /// <param name="color">Title color.</param>
+ private void Initialize(string text, Docking docking, Font font, Color color)
+ {
+ // Initialize fields
+ this._position = new ElementPosition(this);
+ this._font = _fontCache.DefaultFont;
+ this._text = text;
+ this._docking = docking;
+ this._foreColor = color;
+ if(font != null)
+ {
+ this._font = font;
+ }
+ }
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets the unique name of a ChartArea object.
+ /// </summary>
+ [
+
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeTitle_Name"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public override string Name
+ {
+ get
+ {
+ return base.Name;
+ }
+ set
+ {
+ base.Name = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the text orientation.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(TextOrientation.Auto),
+ SRDescription("DescriptionAttribute_TextOrientation"),
+ NotifyParentPropertyAttribute(true),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+#endif
+]
+ public TextOrientation TextOrientation
+ {
+ get
+ {
+ return this._textOrientation;
+ }
+ set
+ {
+ this._textOrientation = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag that specifies whether the title is visible.
+ /// </summary>
+ /// <value>
+ /// <b>True</b> if the title is visible; <b>false</b> otherwise.
+ /// </value>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeTitle_Visible"),
+ ParenthesizePropertyNameAttribute(true),
+ ]
+ virtual public bool Visible
+ {
+ get
+ {
+ return _visible;
+ }
+ set
+ {
+ _visible = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the chart area name which the title is docked to inside or outside.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeDocking"),
+ Bindable(true),
+ DefaultValue(Constants.NotSetValue),
+ SRDescription("DescriptionAttributeTitle_DockToChartArea"),
+ TypeConverter(typeof(LegendAreaNameConverter)),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ ]
+ public string DockedToChartArea
+ {
+ get
+ {
+ return _dockedToChartArea;
+ }
+ set
+ {
+ if(value != _dockedToChartArea)
+ {
+ if(value.Length == 0)
+ {
+ _dockedToChartArea = Constants.NotSetValue;
+ }
+ else
+ {
+ if (Chart != null && Chart.ChartAreas != null)
+ {
+ Chart.ChartAreas.VerifyNameReference(value);
+ }
+ _dockedToChartArea = value;
+ }
+ this.Invalidate(false);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a property which indicates whether the title is docked inside chart area.
+ /// DockedToChartArea property must be set first.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeDocking"),
+ Bindable(true),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeTitle_DockInsideChartArea"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ ]
+ public bool IsDockedInsideChartArea
+ {
+ get
+ {
+ return _isDockedInsideChartArea;
+ }
+ set
+ {
+ if(value != _isDockedInsideChartArea)
+ {
+ _isDockedInsideChartArea = value;
+ this.Invalidate(false);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the positive or negative offset of the docked title position.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeDocking"),
+ Bindable(true),
+ DefaultValue(0),
+ SRDescription("DescriptionAttributeTitle_DockOffset"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ ]
+ public int DockingOffset
+ {
+ get
+ {
+ return _dockingOffset;
+ }
+ set
+ {
+ if(value != _dockingOffset)
+ {
+ if (value < -100 || value > 100)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionValueMustBeInRange("DockingOffset", (-100).ToString(CultureInfo.CurrentCulture), (100).ToString(CultureInfo.CurrentCulture))));
+ }
+ _dockingOffset = value;
+ this.Invalidate(false);
+ }
+ }
+ }
+
+
+ /// <summary>
+ /// Gets or sets the position of the title.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeTitle_Position"),
+#if Microsoft_CONTROL
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
+#else
+ PersistenceMode(PersistenceMode.InnerProperty),
+#endif
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ElementPositionConverter)),
+ SerializationVisibilityAttribute(SerializationVisibility.Element)
+ ]
+ public ElementPosition Position
+ {
+ get
+ {
+ // Serialize only position values if Auto set to false
+ if (Chart != null && Chart.serializationStatus == SerializationStatus.Saving)
+ {
+ if(_position.Auto)
+ {
+ return new ElementPosition();
+ }
+ else
+ {
+ ElementPosition newPosition = new ElementPosition();
+#if Microsoft_CONTROL
+ newPosition.Auto = false;
+#else
+ newPosition.Auto = true;
+#endif
+ newPosition.SetPositionNoAuto(_position.X, _position.Y, _position.Width, _position.Height);
+ return newPosition;
+ }
+ }
+ return _position;
+ }
+ set
+ {
+ _position = value;
+ _position.Parent = this;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Determoines if this position should be serialized.
+ /// </summary>
+ /// <returns></returns>
+ internal bool ShouldSerializePosition()
+ {
+ return !this.Position.Auto;
+ }
+
+
+ /// <summary>
+ /// Gets or sets the text of the title.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeTitle_Text"),
+ NotifyParentPropertyAttribute(true),
+ ParenthesizePropertyNameAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public string Text
+ {
+ get
+ {
+ return _text;
+ }
+ set
+ {
+ _text = (value == null) ? string.Empty : value;
+ this.Invalidate(false);
+ }
+ }
+
+
+ /// <summary>
+ /// Title drawing style.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(TextStyle.Default),
+ SRDescription("DescriptionAttributeTextStyle"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public TextStyle TextStyle
+ {
+ get
+ {
+ return _style;
+ }
+ set
+ {
+ _style = value;
+ this.Invalidate(true);
+ }
+ }
+
+
+ /// <summary>
+ /// Gets or sets the background color of the title.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeBackColor"),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BackColor
+ {
+ get
+ {
+ return _backColor;
+ }
+ set
+ {
+ _backColor = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the border color of the title.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeBorderColor"),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BorderColor
+ {
+ get
+ {
+ return _borderColor;
+ }
+ set
+ {
+ _borderColor = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the border style of the title.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartDashStyle.Solid),
+ SRDescription("DescriptionAttributeBorderDashStyle"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public ChartDashStyle BorderDashStyle
+ {
+ get
+ {
+ return _borderDashStyle;
+ }
+ set
+ {
+ _borderDashStyle = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the border width of the title.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(1),
+ SRDescription("DescriptionAttributeBorderWidth"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public int BorderWidth
+ {
+ get
+ {
+ return _borderWidth;
+ }
+ set
+ {
+ if(value < 0)
+ {
+ throw (new ArgumentOutOfRangeException("value", SR.ExceptionTitleBorderWidthIsNegative));
+ }
+ _borderWidth = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background image.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeBackImage"),
+ Editor(Editors.ImageValueEditor.Editor, Editors.ImageValueEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ NotifyParentPropertyAttribute(true),
+ ]
+ public string BackImage
+ {
+ get
+ {
+ return _backImage;
+ }
+ set
+ {
+ _backImage = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background image drawing mode.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartImageWrapMode.Tile),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeImageWrapMode"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public ChartImageWrapMode BackImageWrapMode
+ {
+ get
+ {
+ return _backImageWrapMode;
+ }
+ set
+ {
+ _backImageWrapMode = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a color which will be replaced with a transparent color while drawing the background image.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeImageTransparentColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BackImageTransparentColor
+ {
+ get
+ {
+ return _backImageTransparentColor;
+ }
+ set
+ {
+ _backImageTransparentColor = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background image alignment used by unscale drawing mode.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartImageAlignmentStyle.TopLeft),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackImageAlign"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public ChartImageAlignmentStyle BackImageAlignment
+ {
+ get
+ {
+ return _backImageAlignment;
+ }
+ set
+ {
+ _backImageAlignment = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background gradient style.
+ /// <seealso cref="BackSecondaryColor"/>
+ /// <seealso cref="BackColor"/>
+ /// <seealso cref="BackHatchStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="GradientStyle"/> value used for the background.
+ /// </value>
+ /// <remarks>
+ /// Two colors are used to draw the gradient, <see cref="BackColor"/> and <see cref="BackSecondaryColor"/>.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(GradientStyle.None),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackGradientStyle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ Editor(Editors.GradientEditor.Editor, Editors.GradientEditor.Base)
+ ]
+ public GradientStyle BackGradientStyle
+ {
+ get
+ {
+ return _backGradientStyle;
+ }
+ set
+ {
+ _backGradientStyle = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the secondary background color.
+ /// <seealso cref="BackColor"/>
+ /// <seealso cref="BackHatchStyle"/>
+ /// <seealso cref="BackGradientStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="Color"/> value used for the secondary color of a background with
+ /// hatching or gradient fill.
+ /// </value>
+ /// <remarks>
+ /// This color is used with <see cref="BackColor"/> when <see cref="BackHatchStyle"/> or
+ /// <see cref="BackGradientStyle"/> are used.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackSecondaryColor"),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color BackSecondaryColor
+ {
+ get
+ {
+ return _backSecondaryColor;
+ }
+ set
+ {
+ _backSecondaryColor = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background hatch style.
+ /// <seealso cref="BackSecondaryColor"/>
+ /// <seealso cref="BackColor"/>
+ /// <seealso cref="BackGradientStyle"/>
+ /// </summary>
+ /// <value>
+ /// A <see cref="ChartHatchStyle"/> value used for the background.
+ /// </value>
+ /// <remarks>
+ /// Two colors are used to draw the hatching, <see cref="BackColor"/> and <see cref="BackSecondaryColor"/>.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartHatchStyle.None),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackHatchStyle"),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ #endif
+ Editor(Editors.HatchStyleEditor.Editor, Editors.HatchStyleEditor.Base)
+ ]
+ public ChartHatchStyle BackHatchStyle
+ {
+ get
+ {
+ return _backHatchStyle;
+ }
+ set
+ {
+ _backHatchStyle = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the title font.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Font), "Microsoft Sans Serif, 8pt"),
+ SRDescription("DescriptionAttributeTitle_Font"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Font Font
+ {
+ get
+ {
+ return _font;
+ }
+ set
+ {
+ _font = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the title fore color.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), "Black"),
+ SRDescription("DescriptionAttributeTitle_Color"),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color ForeColor
+ {
+ get
+ {
+ return _foreColor;
+ }
+ set
+ {
+ _foreColor = value;
+ this.Invalidate(true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets title alignment.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeDocking"),
+ Bindable(true),
+ DefaultValue(ContentAlignment.MiddleCenter),
+ SRDescription("DescriptionAttributeTitle_Alignment"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public ContentAlignment Alignment
+ {
+ get
+ {
+ return _alignment;
+ }
+ set
+ {
+ _alignment = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the title docking style.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeDocking"),
+ Bindable(true),
+ DefaultValue(Docking.Top),
+ SRDescription("DescriptionAttributeTitle_Docking"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Docking Docking
+ {
+ get
+ {
+ return _docking;
+ }
+ set
+ {
+ _docking = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the title shadow offset.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(0),
+ SRDescription("DescriptionAttributeShadowOffset"),
+ NotifyParentPropertyAttribute(true),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public int ShadowOffset
+ {
+ get
+ {
+ return _shadowOffset;
+ }
+ set
+ {
+ _shadowOffset = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the title shadow color.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), "128, 0, 0, 0"),
+ SRDescription("DescriptionAttributeShadowColor"),
+ NotifyParentPropertyAttribute(true),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public Color ShadowColor
+ {
+ get
+ {
+ return _shadowColor;
+ }
+ set
+ {
+ _shadowColor = value;
+ this.Invalidate(false);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the tooltip.
+ /// </summary>
+ [
+#if !Microsoft_CONTROL
+ SRCategory("CategoryAttributeMapArea"),
+#else
+ SRCategory("CategoryAttributeToolTip"),
+#endif
+ Bindable(true),
+ SRDescription("DescriptionAttributeToolTip"),
+ DefaultValue(""),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public string ToolTip
+ {
+ set
+ {
+ _toolTip = value;
+ }
+ get
+ {
+ return _toolTip;
+ }
+ }
+
+
+#if !Microsoft_CONTROL
+
+ /// <summary>
+ /// Gets or sets the URL target of the title.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMapArea"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeUrl"),
+ DefaultValue(""),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute),
+ Editor(Editors.UrlValueEditor.Editor, Editors.UrlValueEditor.Base)
+#endif
+ ]
+ public string Url
+ {
+ set
+ {
+ _url = value;
+ }
+ get
+ {
+ return _url;
+ }
+ }
+ /// <summary>
+ /// Gets or sets the other attributes of the title map area.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMapArea"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeMapAreaAttributes"),
+ DefaultValue(""),
+ PersistenceMode(PersistenceMode.Attribute)
+ ]
+ public string MapAreaAttributes
+ {
+ set
+ {
+ _mapAreaAttributes = value;
+ }
+ get
+ {
+ return _mapAreaAttributes;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the postback value which can be processed on a click event.
+ /// </summary>
+ /// <value>The value which is passed to a click event as an argument.</value>
+ [DefaultValue("")]
+ [SRCategory(SR.Keys.CategoryAttributeMapArea)]
+ [SRDescription(SR.Keys.DescriptionAttributePostBackValue)]
+ public string PostBackValue
+ {
+ get
+ {
+ return this._postbackValue;
+ }
+ set
+ {
+ this._postbackValue = value;
+ }
+ }
+
+
+#endif
+
+ /// <summary>
+ /// True if title background or border is visible
+ /// </summary>
+ internal bool BackGroundIsVisible
+ {
+ get
+ {
+ if(!this.BackColor.IsEmpty ||
+ this.BackImage.Length > 0 ||
+ (!this.BorderColor.IsEmpty && this.BorderDashStyle != ChartDashStyle.NotSet) )
+ {
+ return true;
+ }
+
+ return false;
+ }
+ }
+
+ #endregion
+
+ #region Helper Methods
+
+ /// <summary>
+ /// Checks if chart title is drawn vertically.
+ /// Note: From the drawing perspective stacked text orientation is not vertical.
+ /// </summary>
+ /// <returns>True if text is vertical.</returns>
+ private bool IsTextVertical
+ {
+ get
+ {
+ TextOrientation currentTextOrientation = this.GetTextOrientation();
+ return currentTextOrientation == TextOrientation.Rotated90 || currentTextOrientation == TextOrientation.Rotated270;
+ }
+ }
+
+ /// <summary>
+ /// Returns title text orientation. If set to Auto automatically determines the
+ /// orientation based on title docking.
+ /// </summary>
+ /// <returns>Current text orientation.</returns>
+ private TextOrientation GetTextOrientation()
+ {
+ if (this.TextOrientation == TextOrientation.Auto)
+ {
+ // When chart title is docked to the left or right we automatically
+ // set vertical text with different rotation angles.
+ if (this.Position.Auto)
+ {
+ if (this.Docking == Docking.Left)
+ {
+ return TextOrientation.Rotated270;
+ }
+ else if (this.Docking == Docking.Right)
+ {
+ return TextOrientation.Rotated90;
+ }
+ }
+ return TextOrientation.Horizontal;
+ }
+ return this.TextOrientation;
+ }
+
+ /// <summary>
+ /// Helper method that checks if title is visible.
+ /// </summary>
+ /// <returns>True if title is visible.</returns>
+ internal bool IsVisible()
+ {
+ if(this.Visible)
+ {
+
+ // Check if title is docked to the chart area
+ if(this.DockedToChartArea.Length > 0 &&
+ this.Chart != null)
+ {
+ if(this.Chart.ChartAreas.IndexOf(this.DockedToChartArea) >= 0)
+ {
+ // Do not show title when it is docked to invisible chart area
+ ChartArea area = this.Chart.ChartAreas[this.DockedToChartArea];
+ if(!area.Visible)
+ {
+ return false;
+ }
+ }
+ }
+
+
+ return true;
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// Invalidate chart title when one of the properties is changed.
+ /// </summary>
+ /// <param name="invalidateTitleOnly">Indicates that only title area should be invalidated.</param>
+ [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Justification = "This parameter is used when compiling for the Microsoft version of Chart")]
+ internal void Invalidate(bool invalidateTitleOnly)
+ {
+#if Microsoft_CONTROL
+ if(Chart != null)
+ {
+ // Set dirty flag
+ Chart.dirtyFlag = true;
+
+ // Invalidate chart
+ if(invalidateTitleOnly)
+ {
+ // Calculate the position of the title
+ Rectangle invalRect = Chart.ClientRectangle;
+ if(this.Position.Width != 0 && this.Position.Height != 0 )
+ {
+ // Convert relative coordinates to absolute coordinates
+ invalRect.X = (int)(this.Position.X * (Common.ChartPicture.Width - 1) / 100F);
+ invalRect.Y = (int)(this.Position.Y * (Common.ChartPicture.Height - 1) / 100F);
+ invalRect.Width = (int)(this.Position.Width * (Common.ChartPicture.Width - 1) / 100F);
+ invalRect.Height = (int)(this.Position.Height * (Common.ChartPicture.Height - 1) / 100F);
+
+ // Inflate rectangle size using border size and shadow size
+ invalRect.Inflate(this.BorderWidth + this.ShadowOffset + 1, this.BorderWidth + this.ShadowOffset + 1);
+ }
+
+ // Invalidate title rectangle only
+ Chart.Invalidate(invalRect);
+ }
+ else
+ {
+ Invalidate();
+ }
+ }
+#endif // #if Microsoft_CONTROL
+ }
+
+ #endregion
+
+ #region Painting and Selection Methods
+
+ /// <summary>
+ /// Paints title using chart graphics object.
+ /// </summary>
+ /// <param name="chartGraph">The graph provides drawing object to the display device. A Graphics object is associated with a specific device context.</param>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode")]
+ internal void Paint(ChartGraphics chartGraph )
+ {
+ // check if title is visible
+ if(!this.IsVisible())
+ {
+ return;
+ }
+
+ // Title text
+ string titleText = this.Text;
+
+ //***************************************************************
+ //** Calculate title relative position
+ //***************************************************************
+ RectangleF titlePosition = this.Position.ToRectangleF();
+
+ // Auto set the title position if width or height is not set for custom position
+ if(!this.Position.Auto && Common != null && Common.ChartPicture != null)
+ {
+ if(titlePosition.Width == 0 || titlePosition.Height == 0)
+ {
+ // Calculate text layout area
+ SizeF layoutArea = new SizeF(
+ (titlePosition.Width == 0) ? Common.ChartPicture.Width : titlePosition.Width,
+ (titlePosition.Height == 0) ? Common.ChartPicture.Height : titlePosition.Height);
+ if (this.IsTextVertical)
+ {
+ float tempValue = layoutArea.Width;
+ layoutArea.Width = layoutArea.Height;
+ layoutArea.Height = tempValue;
+ }
+
+ // Measure text size
+ layoutArea = chartGraph.GetAbsoluteSize(layoutArea);
+ SizeF titleSize = chartGraph.MeasureString(
+ "W" + titleText.Replace("\\n", "\n"),
+ this.Font,
+ layoutArea,
+ StringFormat.GenericDefault,
+ this.GetTextOrientation());
+
+ // Increase text size by 4 pixels
+ if(this.BackGroundIsVisible)
+ {
+ titleSize.Width += titleBorderSpacing;
+ titleSize.Height += titleBorderSpacing;
+ }
+
+ // Switch width and height for vertical text
+ if (this.IsTextVertical)
+ {
+ float tempValue = titleSize.Width;
+ titleSize.Width = titleSize.Height;
+ titleSize.Height = tempValue;
+ }
+
+ // Convert text size to relative coordinates
+ titleSize = chartGraph.GetRelativeSize(titleSize);
+
+ // Update custom position
+ if(titlePosition.Width == 0)
+ {
+ titlePosition.Width = titleSize.Width;
+ if(this.Alignment == ContentAlignment.BottomRight ||
+ this.Alignment == ContentAlignment.MiddleRight ||
+ this.Alignment == ContentAlignment.TopRight)
+ {
+ titlePosition.X = titlePosition.X - titlePosition.Width;
+ }
+ else if(this.Alignment == ContentAlignment.BottomCenter ||
+ this.Alignment == ContentAlignment.MiddleCenter ||
+ this.Alignment == ContentAlignment.TopCenter)
+ {
+ titlePosition.X = titlePosition.X - titlePosition.Width/2f;
+ }
+ }
+ if(titlePosition.Height == 0)
+ {
+ titlePosition.Height = titleSize.Height;
+ if(this.Alignment == ContentAlignment.BottomRight ||
+ this.Alignment == ContentAlignment.BottomCenter ||
+ this.Alignment == ContentAlignment.BottomLeft)
+ {
+ titlePosition.Y = titlePosition.Y - titlePosition.Height;
+ }
+ else if(this.Alignment == ContentAlignment.MiddleCenter ||
+ this.Alignment == ContentAlignment.MiddleLeft ||
+ this.Alignment == ContentAlignment.MiddleRight)
+ {
+ titlePosition.Y = titlePosition.Y - titlePosition.Height/2f;
+ }
+ }
+
+ }
+ }
+
+ //***************************************************************
+ //** Convert title position to absolute coordinates
+ //***************************************************************
+ RectangleF absPosition = new RectangleF(titlePosition.Location, titlePosition.Size);
+ absPosition = chartGraph.GetAbsoluteRectangle(absPosition);
+
+ //***************************************************************
+ //** Draw title background, border and shadow
+ //***************************************************************
+ if(this.BackGroundIsVisible && Common.ProcessModePaint )
+ {
+ chartGraph.FillRectangleRel( titlePosition,
+ BackColor,
+ BackHatchStyle,
+ BackImage,
+ BackImageWrapMode,
+ BackImageTransparentColor,
+ BackImageAlignment,
+ BackGradientStyle,
+ BackSecondaryColor,
+ BorderColor,
+ BorderWidth,
+ BorderDashStyle,
+ ShadowColor,
+ ShadowOffset,
+ PenAlignment.Inset);
+ }
+ else
+ {
+ // Adjust text position to be only around the text itself
+ SizeF titleArea = chartGraph.GetAbsoluteSize(titlePosition.Size);
+ SizeF titleSize = chartGraph.MeasureString(
+ "W" + titleText.Replace("\\n", "\n"),
+ this.Font,
+ titleArea,
+ StringFormat.GenericDefault,
+ this.GetTextOrientation());
+
+ // Convert text size to relative coordinates
+ titleSize = chartGraph.GetRelativeSize(titleSize);
+
+ // Adjust position depending on alignment
+ RectangleF exactTitleRect = new RectangleF(
+ titlePosition.X,
+ titlePosition.Y,
+ titleSize.Width,
+ titleSize.Height);
+ if(this.Alignment == ContentAlignment.BottomCenter ||
+ this.Alignment == ContentAlignment.BottomLeft ||
+ this.Alignment == ContentAlignment.BottomRight )
+ {
+ exactTitleRect.Y = titlePosition.Bottom - exactTitleRect.Height;
+ }
+ else if(this.Alignment == ContentAlignment.MiddleCenter ||
+ this.Alignment == ContentAlignment.MiddleLeft ||
+ this.Alignment == ContentAlignment.MiddleRight )
+ {
+ exactTitleRect.Y = titlePosition.Y +
+ titlePosition.Height / 2f -
+ exactTitleRect.Height / 2f;
+ }
+
+ if(this.Alignment == ContentAlignment.BottomRight ||
+ this.Alignment == ContentAlignment.MiddleRight ||
+ this.Alignment == ContentAlignment.TopRight )
+ {
+ exactTitleRect.X = titlePosition.Right - exactTitleRect.Width;
+ }
+ else if(this.Alignment == ContentAlignment.BottomCenter ||
+ this.Alignment == ContentAlignment.MiddleCenter ||
+ this.Alignment == ContentAlignment.TopCenter )
+ {
+ exactTitleRect.X = titlePosition.X +
+ titlePosition.Width / 2f -
+ exactTitleRect.Width / 2f;
+ }
+
+ // NOTE: This approach for text selection can not be used with
+ // Flash animations because of the bug in Flash viewer. When the
+ // button shape is placed in the last frame the Alpha value of the
+ // color is ignored.
+
+ // NOTE: Feature tested again with Flash Player 7 and it seems to be
+ // working fine. Code below is commented to enable selection in flash
+ // through transparent rectangle.
+ // Fixes issue #4172.
+
+ bool drawRect = true;
+
+ // Draw transparent rectangle in the text position
+ if(drawRect)
+ {
+ chartGraph.FillRectangleRel(
+ exactTitleRect,
+ Color.FromArgb(0, Color.White),
+ ChartHatchStyle.None,
+ String.Empty,
+ ChartImageWrapMode.Tile,
+ BackImageTransparentColor,
+ BackImageAlignment,
+ GradientStyle.None,
+ BackSecondaryColor,
+ Color.Transparent,
+ 0,
+ BorderDashStyle,
+ Color.Transparent,
+ 0,
+ PenAlignment.Inset);
+ }
+
+ // End Selection mode
+ chartGraph.EndHotRegion( );
+ }
+
+ if( Common.ProcessModePaint)
+ Common.Chart.CallOnPrePaint(new ChartPaintEventArgs(this, chartGraph, Common, Position));
+
+ //***************************************************************
+ //** Add spacing between text and border
+ //***************************************************************
+ if(this.BackGroundIsVisible)
+ {
+ absPosition.Width -= this.titleBorderSpacing;
+ absPosition.Height -= this.titleBorderSpacing;
+ absPosition.X += this.titleBorderSpacing / 2f;
+ absPosition.Y += this.titleBorderSpacing / 2f;
+ }
+
+ //***************************************************************
+ //** Create string format
+ //***************************************************************
+ using (StringFormat format = new StringFormat())
+ {
+ format.Alignment = StringAlignment.Center;
+ format.LineAlignment = StringAlignment.Center;
+
+ if (this.Alignment == ContentAlignment.BottomCenter ||
+ this.Alignment == ContentAlignment.BottomLeft ||
+ this.Alignment == ContentAlignment.BottomRight)
+ {
+ format.LineAlignment = StringAlignment.Far;
+ }
+ else if (this.Alignment == ContentAlignment.TopCenter ||
+ this.Alignment == ContentAlignment.TopLeft ||
+ this.Alignment == ContentAlignment.TopRight)
+ {
+ format.LineAlignment = StringAlignment.Near;
+ }
+
+ if (this.Alignment == ContentAlignment.BottomLeft ||
+ this.Alignment == ContentAlignment.MiddleLeft ||
+ this.Alignment == ContentAlignment.TopLeft)
+ {
+ format.Alignment = StringAlignment.Near;
+ }
+ else if (this.Alignment == ContentAlignment.BottomRight ||
+ this.Alignment == ContentAlignment.MiddleRight ||
+ this.Alignment == ContentAlignment.TopRight)
+ {
+ format.Alignment = StringAlignment.Far;
+ }
+
+ //***************************************************************
+ //** Draw text shadow for the default style when background is not drawn anf ShadowOffset is not null
+ //***************************************************************
+ Color textShadowColor = ChartGraphics.GetGradientColor(this.ForeColor, Color.Black, 0.8);
+ int textShadowOffset = 1;
+ TextStyle textStyle = this.TextStyle;
+ if ((textStyle == TextStyle.Default || textStyle == TextStyle.Shadow) &&
+ !this.BackGroundIsVisible &&
+ ShadowOffset != 0)
+ {
+ // Draw shadowed text
+ textStyle = TextStyle.Shadow;
+ textShadowColor = ShadowColor;
+ textShadowOffset = ShadowOffset;
+ }
+
+ if (textStyle == TextStyle.Shadow)
+ {
+ textShadowColor = (textShadowColor.A != 255) ? textShadowColor : Color.FromArgb(textShadowColor.A / 2, textShadowColor);
+ }
+
+ //***************************************************************
+ //** Replace new line characters
+ //***************************************************************
+ titleText = titleText.Replace("\\n", "\n");
+
+ //***************************************************************
+ //** Define text angle depending on the docking
+ //***************************************************************
+ Matrix oldTransform = null;
+ if (this.IsTextVertical)
+ {
+ if (this.GetTextOrientation() == TextOrientation.Rotated270)
+ {
+ // IMPORTANT !
+ // Right to Left flag has to be used because of bug with .net with multi line vertical text. As soon as .net bug is fixed this flag HAS TO be removed. Bug number 1870.
+ format.FormatFlags |= StringFormatFlags.DirectionVertical | StringFormatFlags.DirectionRightToLeft;
+
+ // Save old graphics transformation
+ oldTransform = chartGraph.Transform.Clone();
+
+ // Rotate tile 180 degrees at center
+ PointF center = PointF.Empty;
+
+ center.X = absPosition.X + absPosition.Width / 2F;
+ center.Y = absPosition.Y + absPosition.Height / 2F;
+
+ // Create and set new transformation matrix
+ Matrix newMatrix = chartGraph.Transform.Clone();
+ newMatrix.RotateAt(180, center);
+ chartGraph.Transform = newMatrix;
+ }
+ else if (this.GetTextOrientation() == TextOrientation.Rotated90)
+ {
+ // IMPORTANT !
+ // Right to Left flag has to be used because of bug with .net with multi line vertical text. As soon as .net bug is fixed this flag HAS TO be removed. Bug number 1870.
+ format.FormatFlags |= StringFormatFlags.DirectionVertical | StringFormatFlags.DirectionRightToLeft;
+ }
+ }
+ try
+ {
+ chartGraph.IsTextClipped = !Position.Auto;
+ Title.DrawStringWithStyle(chartGraph, titleText, textStyle, this.Font, absPosition, this.ForeColor, textShadowColor, textShadowOffset, format, this.GetTextOrientation());
+ }
+ finally
+ {
+ chartGraph.IsTextClipped = false;
+ }
+ // Call Paint event
+ if (Common.ProcessModePaint)
+ Common.Chart.CallOnPostPaint(new ChartPaintEventArgs(this, chartGraph, Common, Position));
+
+ //***************************************************************
+ //** Restore old transformation
+ //***************************************************************
+ if(oldTransform != null)
+ {
+ chartGraph.Transform = oldTransform;
+ }
+
+ if( Common.ProcessModeRegions )
+ {
+#if !Microsoft_CONTROL
+ Common.HotRegionsList.AddHotRegion( titlePosition, this.ToolTip, this.Url, this.MapAreaAttributes, this.PostBackValue, this, ChartElementType.Title, string.Empty );
+#else
+ Common.HotRegionsList.AddHotRegion( titlePosition, this.ToolTip, null, null, null, this, ChartElementType.Title, null );
+#endif // !Microsoft_CONTROL
+ }
+ }
+ }
+
+ /// <summary>
+ /// Draws the string with style.
+ /// </summary>
+ /// <param name="chartGraph">The chart graph.</param>
+ /// <param name="titleText">The title text.</param>
+ /// <param name="textStyle">The text style.</param>
+ /// <param name="font">The font.</param>
+ /// <param name="absPosition">The abs position.</param>
+ /// <param name="foreColor">Color of the fore.</param>
+ /// <param name="shadowColor">Color of the shadow.</param>
+ /// <param name="shadowOffset">The shadow offset.</param>
+ /// <param name="format">The format.</param>
+ /// <param name="orientation">The orientation.</param>
+ internal static void DrawStringWithStyle(
+ ChartGraphics chartGraph,
+ string titleText,
+ TextStyle textStyle,
+ Font font,
+ RectangleF absPosition,
+ Color foreColor,
+ Color shadowColor,
+ int shadowOffset,
+ StringFormat format,
+ TextOrientation orientation
+ )
+ {
+ //***************************************************************
+ //** Draw title text
+ //***************************************************************
+ if (titleText.Length > 0)
+ {
+ if (textStyle == TextStyle.Default)
+ {
+ using (SolidBrush brush = new SolidBrush(foreColor))
+ {
+ chartGraph.DrawString(titleText, font, brush, absPosition, format, orientation);
+ }
+ }
+ else if (textStyle == TextStyle.Frame)
+ {
+ using (GraphicsPath graphicsPath = new GraphicsPath())
+ {
+ graphicsPath.AddString(
+ titleText,
+ font.FontFamily,
+ (int)font.Style,
+ font.Size * 1.3f,
+ absPosition,
+ format);
+ graphicsPath.CloseAllFigures();
+
+
+ using (Pen pen = new Pen(foreColor, 1))
+ {
+ chartGraph.DrawPath(pen, graphicsPath);
+ }
+ }
+ }
+ else if (textStyle == TextStyle.Embed)
+ {
+ // Draw shadow
+ RectangleF shadowPosition = new RectangleF(absPosition.Location, absPosition.Size);
+ shadowPosition.X -= 1;
+ shadowPosition.Y -= 1;
+ using (SolidBrush brush = new SolidBrush(shadowColor))
+ {
+ chartGraph.DrawString(titleText, font, brush, shadowPosition, format, orientation);
+ }
+ // Draw highlighting
+ shadowPosition.X += 2;
+ shadowPosition.Y += 2;
+ Color texthighlightColor = ChartGraphics.GetGradientColor(Color.White, foreColor, 0.3);
+ using (SolidBrush brush = new SolidBrush(texthighlightColor))
+ {
+ chartGraph.DrawString(titleText, font, brush, shadowPosition, format, orientation);
+ }
+ using (SolidBrush brush = new SolidBrush(foreColor))
+ {
+ // Draw text
+ chartGraph.DrawString(titleText, font, brush, absPosition, format, orientation);
+ }
+ }
+ else if (textStyle == TextStyle.Emboss)
+ {
+ // Draw shadow
+ RectangleF shadowPosition = new RectangleF(absPosition.Location, absPosition.Size);
+ shadowPosition.X += 1;
+ shadowPosition.Y += 1;
+ using (SolidBrush brush = new SolidBrush(shadowColor))
+ {
+ chartGraph.DrawString(titleText, font, brush, shadowPosition, format, orientation);
+ }
+ // Draw highlighting
+ shadowPosition.X -= 2;
+ shadowPosition.Y -= 2;
+ Color texthighlightColor = ChartGraphics.GetGradientColor(Color.White, foreColor, 0.3);
+ using (SolidBrush brush = new SolidBrush(texthighlightColor))
+ {
+ chartGraph.DrawString(titleText, font, brush, shadowPosition, format, orientation);
+ }
+ // Draw text
+ using (SolidBrush brush = new SolidBrush(foreColor))
+ {
+ chartGraph.DrawString(titleText, font, brush, absPosition, format, orientation);
+ }
+
+ }
+ else if (textStyle == TextStyle.Shadow)
+ {
+ // Draw shadow
+ RectangleF shadowPosition = new RectangleF(absPosition.Location, absPosition.Size);
+ shadowPosition.X += shadowOffset;
+ shadowPosition.Y += shadowOffset;
+ using (SolidBrush brush = new SolidBrush(shadowColor))
+ {
+ chartGraph.DrawString(titleText, font, brush, shadowPosition, format, orientation);
+ }
+ // Draw text
+ using (SolidBrush brush = new SolidBrush(foreColor))
+ {
+ chartGraph.DrawString(titleText, font, brush, absPosition, format, orientation);
+ }
+
+ }
+ }
+ }
+
+ #endregion
+
+ #region Position Calculation Methods
+
+ /// <summary>
+ /// Recalculates title position.
+ /// </summary>
+ /// <param name="chartGraph">Chart graphics used.</param>
+ /// <param name="chartAreasRectangle">Area where the title should be docked.</param>
+ /// <param name="frameTitlePosition">Position of the title in the frame.</param>
+ /// <param name="elementSpacing">Spacing size in percentage of the area.</param>
+ internal void CalcTitlePosition(
+ ChartGraphics chartGraph,
+ ref RectangleF chartAreasRectangle,
+ ref RectangleF frameTitlePosition,
+ float elementSpacing)
+ {
+ // Special case for the first title docked to the top when the title frame is used
+ if(!frameTitlePosition.IsEmpty &&
+ this.Position.Auto &&
+ this.Docking == Docking.Top &&
+ this.DockedToChartArea == Constants.NotSetValue)
+ {
+ this.Position.SetPositionNoAuto(
+ frameTitlePosition.X + elementSpacing,
+ frameTitlePosition.Y,
+ frameTitlePosition.Width - 2f * elementSpacing,
+ frameTitlePosition.Height);
+ frameTitlePosition = RectangleF.Empty;
+ return;
+ }
+
+ // Get title size
+ RectangleF titlePosition = new RectangleF();
+ SizeF layoutArea = new SizeF(chartAreasRectangle.Width, chartAreasRectangle.Height);
+
+ // Switch width and height for vertical text
+ if (this.IsTextVertical)
+ {
+ float tempValue = layoutArea.Width;
+ layoutArea.Width = layoutArea.Height;
+ layoutArea.Height = tempValue;
+ }
+
+ // Meausure text size
+ layoutArea.Width -= 2f * elementSpacing;
+ layoutArea.Height -= 2f * elementSpacing;
+ layoutArea = chartGraph.GetAbsoluteSize(layoutArea);
+ SizeF titleSize = chartGraph.MeasureString(
+ "W" + this.Text.Replace("\\n", "\n"),
+ this.Font,
+ layoutArea,
+ StringFormat.GenericDefault,
+ this.GetTextOrientation());
+
+ // Increase text size by 4 pixels
+ if(this.BackGroundIsVisible)
+ {
+ titleSize.Width += titleBorderSpacing;
+ titleSize.Height += titleBorderSpacing;
+ }
+
+ // Switch width and height for vertical text
+ if (this.IsTextVertical)
+ {
+ float tempValue = titleSize.Width;
+ titleSize.Width = titleSize.Height;
+ titleSize.Height = tempValue;
+ }
+
+ // Convert text size to relative coordinates
+ titleSize = chartGraph.GetRelativeSize(titleSize);
+ titlePosition.Height = titleSize.Height;
+ titlePosition.Width = titleSize.Width;
+ if(float.IsNaN(titleSize.Height) || float.IsNaN(titleSize.Width))
+ {
+ return;
+ }
+
+ // Calculate title position
+ if(this.Docking == Docking.Top)
+ {
+ titlePosition.Y = chartAreasRectangle.Y + elementSpacing;
+ titlePosition.X = chartAreasRectangle.X + elementSpacing;
+ titlePosition.Width = chartAreasRectangle.Right - titlePosition.X - elementSpacing;
+ if(titlePosition.Width < 0)
+ {
+ titlePosition.Width = 0;
+ }
+
+ // Adjust position of the chart area(s)
+ chartAreasRectangle.Height -= titlePosition.Height + elementSpacing;
+ chartAreasRectangle.Y = titlePosition.Bottom;
+ }
+ else if(this.Docking == Docking.Bottom)
+ {
+ titlePosition.Y = chartAreasRectangle.Bottom - titleSize.Height - elementSpacing;
+ titlePosition.X = chartAreasRectangle.X + elementSpacing;
+ titlePosition.Width = chartAreasRectangle.Right - titlePosition.X - elementSpacing;
+ if(titlePosition.Width < 0)
+ {
+ titlePosition.Width = 0;
+ }
+
+ // Adjust position of the chart area(s)
+ chartAreasRectangle.Height -= titlePosition.Height + elementSpacing;
+ }
+ if(this.Docking == Docking.Left)
+ {
+ titlePosition.X = chartAreasRectangle.X + elementSpacing;
+ titlePosition.Y = chartAreasRectangle.Y + elementSpacing;
+ titlePosition.Height = chartAreasRectangle.Bottom - titlePosition.Y - elementSpacing;
+ if(titlePosition.Height < 0)
+ {
+ titlePosition.Height = 0;
+ }
+
+ // Adjust position of the chart area(s)
+ chartAreasRectangle.Width -= titlePosition.Width + elementSpacing;
+ chartAreasRectangle.X = titlePosition.Right;
+ }
+ if(this.Docking == Docking.Right)
+ {
+ titlePosition.X = chartAreasRectangle.Right - titleSize.Width - elementSpacing;
+ titlePosition.Y = chartAreasRectangle.Y + elementSpacing;
+ titlePosition.Height = chartAreasRectangle.Bottom - titlePosition.Y - elementSpacing;
+ if(titlePosition.Height < 0)
+ {
+ titlePosition.Height = 0;
+ }
+
+ // Adjust position of the chart area(s)
+ chartAreasRectangle.Width -= titlePosition.Width + elementSpacing;
+ }
+
+
+ // Offset calculated docking position
+ if(this.DockingOffset != 0)
+ {
+ if(this.Docking == Docking.Top || this.Docking == Docking.Bottom)
+ {
+ titlePosition.Y += this.DockingOffset;
+ }
+ else
+ {
+ titlePosition.X += this.DockingOffset;
+ }
+ }
+
+ this.Position.SetPositionNoAuto(titlePosition.X, titlePosition.Y, titlePosition.Width, titlePosition.Height);
+ }
+
+ #endregion
+
+ #region IDisposable Members
+
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ if (_fontCache != null)
+ {
+ _fontCache.Dispose();
+ _fontCache = null;
+ }
+ if (_position != null)
+ {
+ _position.Dispose();
+ _position = null;
+ }
+ }
+ }
+
+
+ #endregion
+ }
+
+ /// <summary>
+ /// The TitleCollection class is a strongly typed collection of Title classes.
+ /// Indexer of this collection can take the title index (integer) or unique
+ /// title name (string) as a parameter.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeTitles"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class TitleCollection : ChartNamedElementCollection<Title>
+ {
+
+ #region Constructors
+
+ /// <summary>
+ /// TitleCollection constructor.
+ /// </summary>
+ /// <param name="parent">Parent chart element.</param>
+ internal TitleCollection(IChartElement parent)
+ : base(parent)
+ {
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Creates a new Title with the specified name and adds it to the collection.
+ /// </summary>
+ /// <param name="name">The new chart area name.</param>
+ /// <returns>New title</returns>
+ public Title Add(string name)
+ {
+ Title title = new Title(name);
+ this.Add(title);
+ return title;
+ }
+
+
+ /// <summary>
+ /// Recalculates title position in the collection for titles docked outside of chart area.
+ /// </summary>
+ /// <param name="chartPicture">Chart picture object.</param>
+ /// <param name="chartGraph">Chart graphics used.</param>
+ /// <param name="area">Area the title is docked to.</param>
+ /// <param name="chartAreasRectangle">Area where the title should be positioned.</param>
+ /// <param name="elementSpacing">Spacing size in percentage of the area.</param>
+ internal static void CalcOutsideTitlePosition(
+ ChartPicture chartPicture,
+ ChartGraphics chartGraph,
+ ChartArea area,
+ ref RectangleF chartAreasRectangle,
+ float elementSpacing)
+ {
+ if(chartPicture != null)
+ {
+ // Get elemets spacing
+ float areaSpacing = Math.Min((chartAreasRectangle.Height/100F) * elementSpacing, (chartAreasRectangle.Width/100F) * elementSpacing);
+
+ // Loop through all titles
+ foreach(Title title in chartPicture.Titles)
+ {
+ // Check if title visible
+ if(!title.IsVisible())
+ {
+ continue;
+ }
+
+ // Check if all chart area names are valid
+ if (title.DockedToChartArea != Constants.NotSetValue && chartPicture.ChartAreas.IndexOf(title.DockedToChartArea)<0)
+ {
+ throw (new ArgumentException(SR.ExceptionChartTitleDockedChartAreaIsMissing((string)title.DockedToChartArea)));
+ }
+
+ // Process only titles docked to specified area
+ if(title.IsDockedInsideChartArea == false &&
+ title.DockedToChartArea == area.Name &&
+ title.Position.Auto)
+ {
+ // Calculate title position
+ RectangleF frameRect = RectangleF.Empty;
+ RectangleF prevChartAreasRectangle = chartAreasRectangle;
+ title.CalcTitlePosition(chartGraph,
+ ref chartAreasRectangle,
+ ref frameRect,
+ areaSpacing);
+
+ // Adjust title position
+ RectangleF titlePosition = title.Position.ToRectangleF();
+ if(title.Docking == Docking.Top)
+ {
+ titlePosition.Y -= areaSpacing;
+ if(!area.Position.Auto)
+ {
+ titlePosition.Y -= titlePosition.Height;
+ prevChartAreasRectangle.Y -= titlePosition.Height + areaSpacing;
+ prevChartAreasRectangle.Height += titlePosition.Height + areaSpacing;
+ }
+ }
+ else if(title.Docking == Docking.Bottom)
+ {
+ titlePosition.Y += areaSpacing;
+ if(!area.Position.Auto)
+ {
+ titlePosition.Y = prevChartAreasRectangle.Bottom + areaSpacing;
+ prevChartAreasRectangle.Height += titlePosition.Height +areaSpacing;
+ }
+ }
+ if(title.Docking == Docking.Left)
+ {
+ titlePosition.X -= areaSpacing;
+ if(!area.Position.Auto)
+ {
+ titlePosition.X -= titlePosition.Width;
+ prevChartAreasRectangle.X -= titlePosition.Width + areaSpacing;
+ prevChartAreasRectangle.Width += titlePosition.Width + areaSpacing;
+ }
+ }
+ if(title.Docking == Docking.Right)
+ {
+ titlePosition.X += areaSpacing;
+ if(!area.Position.Auto)
+ {
+ titlePosition.X = prevChartAreasRectangle.Right + areaSpacing;
+ prevChartAreasRectangle.Width += titlePosition.Width + areaSpacing;
+ }
+ }
+
+ // Set title position without changing the 'Auto' flag
+ title.Position.SetPositionNoAuto(titlePosition.X, titlePosition.Y, titlePosition.Width, titlePosition.Height);
+
+ // If custom position is used in the chart area reset the curent adjusted position
+ if (!area.Position.Auto)
+ {
+ chartAreasRectangle = prevChartAreasRectangle;
+ }
+
+ }
+ }
+
+ }
+ }
+
+ /// <summary>
+ /// Recalculates all titles position inside chart area in the collection.
+ /// </summary>
+ /// <param name="chartPicture">Chart picture object.</param>
+ /// <param name="chartGraph">Chart graphics used.</param>
+ /// <param name="elementSpacing">Spacing size in percentage of the area.</param>
+ internal static void CalcInsideTitlePosition(
+ ChartPicture chartPicture,
+ ChartGraphics chartGraph,
+ float elementSpacing)
+ {
+ if(chartPicture != null)
+ {
+ // Check if all chart area names are valid
+ foreach(Title title in chartPicture.Titles)
+ {
+ // Check if title visible
+ if(!title.IsVisible())
+ {
+ continue;
+ }
+
+ if (title.DockedToChartArea != Constants.NotSetValue)
+ {
+ try
+ {
+ ChartArea area = chartPicture.ChartAreas[title.DockedToChartArea];
+ }
+ catch
+ {
+ throw(new ArgumentException( SR.ExceptionChartTitleDockedChartAreaIsMissing( (string)title.DockedToChartArea ) ) );
+ }
+ }
+ }
+
+ // Loop through all chart areas
+ foreach(ChartArea area in chartPicture.ChartAreas)
+ {
+
+ // Check if chart area is visible
+ if(area.Visible)
+
+ {
+ // Get area position
+ RectangleF titlePlottingRectangle = area.PlotAreaPosition.ToRectangleF();
+
+ // Get elemets spacing
+ float areaSpacing = Math.Min((titlePlottingRectangle.Height/100F) * elementSpacing, (titlePlottingRectangle.Width/100F) * elementSpacing);
+
+ // Loop through all titles
+ foreach(Title title in chartPicture.Titles)
+ {
+ if(title.IsDockedInsideChartArea == true &&
+ title.DockedToChartArea == area.Name &&
+ title.Position.Auto)
+ {
+ // Calculate title position
+ RectangleF frameRect = RectangleF.Empty;
+ title.CalcTitlePosition(chartGraph,
+ ref titlePlottingRectangle,
+ ref frameRect,
+ areaSpacing);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ #endregion
+
+ #region Event handlers
+ internal void ChartAreaNameReferenceChanged(object sender, NameReferenceChangedEventArgs e)
+ {
+ //If all the chart areas are removed and then the first one is added we don't want to dock the titles
+ if (e.OldElement == null)
+ return;
+
+ foreach (Title title in this)
+ if (title.DockedToChartArea == e.OldName)
+ title.DockedToChartArea = e.NewName;
+ }
+ #endregion
+
+
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/SR.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/SR.cs
new file mode 100644
index 00000000000..c585a6720d4
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/SR.cs
@@ -0,0 +1,12528 @@
+// WARNING:
+// This file was generated by the Microsoft DataWarehouse String Resource Tool 1.33.0.0
+// from information in SR.strings.
+// DO NOT MODIFY THIS FILE'S CONTENTS, THEY WILL BE OVERWRITTEN
+//
+#if Microsoft_CONTROL
+namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+#endif
+{
+ using System;
+ using System.Resources;
+ using System.Globalization;
+
+
+ [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class SR
+ {
+
+ protected SR()
+ {
+ }
+
+ public static CultureInfo Culture
+ {
+ get
+ {
+ return Keys.Culture;
+ }
+ set
+ {
+ Keys.Culture = value;
+ }
+ }
+
+ public static string ExceptionElementPositionConverter
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionElementPositionConverter);
+ }
+ }
+
+ public static string ExceptionInvalidServiceContainer
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionInvalidServiceContainer);
+ }
+ }
+
+ public static string ExceptionImageLoaderInvalidServiceContainer
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionImageLoaderInvalidServiceContainer);
+ }
+ }
+
+ public static string ExceptionImageMapAddedHasWrongType
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionImageMapAddedHasWrongType);
+ }
+ }
+
+ public static string ExceptionImageMapInsertedHasWrongType
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionImageMapInsertedHasWrongType);
+ }
+ }
+
+ public static string ExceptionImageMapCircleShapeInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionImageMapCircleShapeInvalid);
+ }
+ }
+
+ public static string ExceptionImageMapRectangleShapeInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionImageMapRectangleShapeInvalid);
+ }
+ }
+
+ public static string ExceptionImageMapPolygonShapeInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionImageMapPolygonShapeInvalid);
+ }
+ }
+
+ public static string ExceptionAnnotationNameIsEmpty
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAnnotationNameIsEmpty);
+ }
+ }
+
+ public static string ExceptionAnnotationPathAddLineAsSegmentsInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAnnotationPathAddLineAsSegmentsInvalid);
+ }
+ }
+
+ public static string ExceptionAnnotationLineWidthIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAnnotationLineWidthIsNegative);
+ }
+ }
+
+ public static string ExceptionAnnotationAnchorOffsetInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAnnotationAnchorOffsetInvalid);
+ }
+ }
+
+ public static string ExceptionAnnotationGroupedAnchorDataPointMustBeEmpty
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAnnotationGroupedAnchorDataPointMustBeEmpty);
+ }
+ }
+
+ public static string ExceptionAnnotationGroupedUnableToStartPlacement
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAnnotationGroupedUnableToStartPlacement);
+ }
+ }
+
+ public static string ExceptionAnnotationNotInCollection
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAnnotationNotInCollection);
+ }
+ }
+
+ public static string ExceptionAnnotationGroupedAxisMustBeEmpty
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAnnotationGroupedAxisMustBeEmpty);
+ }
+ }
+
+ public static string ExceptionAnnotationArrowSizeIsZero
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAnnotationArrowSizeIsZero);
+ }
+ }
+
+ public static string ExceptionAnnotationArrowSizeMustBeLessThen100
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAnnotationArrowSizeMustBeLessThen100);
+ }
+ }
+
+ public static string ExceptionAnnotationArrowStyleUnknown
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAnnotationArrowStyleUnknown);
+ }
+ }
+
+ public static string ExceptionInvalidIndexerArgumentType
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionInvalidIndexerArgumentType);
+ }
+ }
+
+ public static string ExceptionTitleNameIsEmpty
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionTitleNameIsEmpty);
+ }
+ }
+
+ public static string ExceptionDataSeriesObjectRequired
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataSeriesObjectRequired);
+ }
+ }
+
+ public static string ExceptionDataSeriesNameIsEmpty
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataSeriesNameIsEmpty);
+ }
+ }
+
+ public static string ExceptionDataSeriesYValuesPerPointIsZero
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataSeriesYValuesPerPointIsZero);
+ }
+ }
+
+ public static string ExceptionDataSeriesYValueNumberInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataSeriesYValueNumberInvalid);
+ }
+ }
+
+ public static string ExceptionSeriesNameIsEmpty
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionSeriesNameIsEmpty);
+ }
+ }
+
+ public static string ExceptionEditorChartTypeRegistryServiceInaccessible
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionEditorChartTypeRegistryServiceInaccessible);
+ }
+ }
+
+ public static string ExceptionEditorMultipleSeriesEditiingUnsupported
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionEditorMultipleSeriesEditiingUnsupported);
+ }
+ }
+
+ public static string ExceptionEditorContectInstantsIsNotChartObject
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionEditorContectInstantsIsNotChartObject);
+ }
+ }
+
+ public static string ExceptionEditorUITypeEditorInapplicable
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionEditorUITypeEditorInapplicable);
+ }
+ }
+
+ public static string ExceptionEditorUITypeEditorInt32ApplicableOnly
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionEditorUITypeEditorInt32ApplicableOnly);
+ }
+ }
+
+ public static string ExceptionRectangleConverterStringFormatInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionRectangleConverterStringFormatInvalid);
+ }
+ }
+
+ public static string ExceptionChartAreaObjectRequired
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartAreaObjectRequired);
+ }
+ }
+
+ public static string ExceptionChartAreaInsertedHasWrongType
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartAreaInsertedHasWrongType);
+ }
+ }
+
+ public static string ExceptionChartAreaAlreadyExistsShort
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartAreaAlreadyExistsShort);
+ }
+ }
+
+ public static string ExceptionChartAreaNameIsEmpty
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartAreaNameIsEmpty);
+ }
+ }
+
+ public static string ExceptionChartArea3DPerspectiveInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartArea3DPerspectiveInvalid);
+ }
+ }
+
+ public static string ExceptionChartArea3DInclinationInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartArea3DInclinationInvalid);
+ }
+ }
+
+ public static string ExceptionChartArea3DRotationInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartArea3DRotationInvalid);
+ }
+ }
+
+ public static string ExceptionChartArea3DWallWidthInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartArea3DWallWidthInvalid);
+ }
+ }
+
+ public static string ExceptionChartArea3DPointsDepthInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartArea3DPointsDepthInvalid);
+ }
+ }
+
+ public static string ExceptionChartArea3DPointsGapInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartArea3DPointsGapInvalid);
+ }
+ }
+
+ public static string ExceptionCursorIntervalOffsetIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionCursorIntervalOffsetIsNegative);
+ }
+ }
+
+ public static string ExceptionCursorLineWidthIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionCursorLineWidthIsNegative);
+ }
+ }
+
+ public static string ExceptionGraphicsMarkerStyleUnknown
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionGraphicsMarkerStyleUnknown);
+ }
+ }
+
+ public static string ExceptionGraphics3DMarkerStyleUnknown
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionGraphics3DMarkerStyleUnknown);
+ }
+ }
+
+ public static string ExceptionGraphics3DCoordinatesInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionGraphics3DCoordinatesInvalid);
+ }
+ }
+
+ public static string ExceptionAxisLabelsAutoFitMinFontSizeValueInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisLabelsAutoFitMinFontSizeValueInvalid);
+ }
+ }
+
+ public static string ExceptionAxisLabelRowIndexIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisLabelRowIndexIsNegative);
+ }
+ }
+
+ public static string ExceptionAxisLabelRowIndexMustBe1Or2
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisLabelRowIndexMustBe1Or2);
+ }
+ }
+
+ public static string ExceptionAxisLabelIndexIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisLabelIndexIsNegative);
+ }
+ }
+
+ public static string ExceptionAxisLabelFontAngleInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisLabelFontAngleInvalid);
+ }
+ }
+
+ public static string ExceptionCustomLabelAddedHasWrongType
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionCustomLabelAddedHasWrongType);
+ }
+ }
+
+ public static string ExceptionCustomLabelInsertedHasWrongType
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionCustomLabelInsertedHasWrongType);
+ }
+ }
+
+ public static string ExceptionSmartLabelsDirectionUndefined
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionSmartLabelsDirectionUndefined);
+ }
+ }
+
+ public static string ExceptionSmartLabelsMinMovingDistanceIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionSmartLabelsMinMovingDistanceIsNegative);
+ }
+ }
+
+ public static string ExceptionSmartLabelsMaxMovingDistanceIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionSmartLabelsMaxMovingDistanceIsNegative);
+ }
+ }
+
+ public static string ExceptionStripLineAddedHasWrongType
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStripLineAddedHasWrongType);
+ }
+ }
+
+ public static string ExceptionStripLineWidthIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStripLineWidthIsNegative);
+ }
+ }
+
+ public static string ExceptionAxisWidthIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisWidthIsNegative);
+ }
+ }
+
+ public static string ExceptionAxisDynamicIntervalCalculationFailed
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisDynamicIntervalCalculationFailed);
+ }
+ }
+
+ public static string ExceptionAxisIntervalDecreasingFailed
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisIntervalDecreasingFailed);
+ }
+ }
+
+ public static string ExceptionAxisIntervalIncreasingFailed
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisIntervalIncreasingFailed);
+ }
+ }
+
+ public static string ExceptionAxisLabelsAutoFitMaxFontSizeInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisLabelsAutoFitMaxFontSizeInvalid);
+ }
+ }
+
+ public static string ExceptionAxisMinimumMaximumInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisMinimumMaximumInvalid);
+ }
+ }
+
+ public static string ExceptionAxisStackedChartsDataPointsNumberMismatch
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisStackedChartsDataPointsNumberMismatch);
+ }
+ }
+
+ public static string ExceptionAxisSeriesNotAligned
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisSeriesNotAligned);
+ }
+ }
+
+ public static string ExceptionAxisScaleLogarithmBaseInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisScaleLogarithmBaseInvalid);
+ }
+ }
+
+ public static string ExceptionAxisScalePositionInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisScalePositionInvalid);
+ }
+ }
+
+ public static string ExceptionAxisScalePositionToValueCallFailed
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisScalePositionToValueCallFailed);
+ }
+ }
+
+ public static string ExceptionAxisScaleIntervalIsZero
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisScaleIntervalIsZero);
+ }
+ }
+
+ public static string ExceptionAxisScaleMinimumMaximumInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisScaleMinimumMaximumInvalid);
+ }
+ }
+
+ public static string ExceptionAxisScaleIntervalIsLessThen1Year
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisScaleIntervalIsLessThen1Year);
+ }
+ }
+
+ public static string ExceptionAxisScaleAutoIntervalInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisScaleAutoIntervalInvalid);
+ }
+ }
+
+ public static string ExceptionAxisScaleMinimumValueIsGreaterThenMaximumDataPoint
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisScaleMinimumValueIsGreaterThenMaximumDataPoint);
+ }
+ }
+
+ public static string ExceptionAxisScaleLogarithmicNegativeValues
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisScaleLogarithmicNegativeValues);
+ }
+ }
+
+ public static string ExceptionChartAreaAxisScaleLogarithmicUnsuitable
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartAreaAxisScaleLogarithmicUnsuitable);
+ }
+ }
+
+ public static string ExceptionChartAreaChartTypesCanNotCombine
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartAreaChartTypesCanNotCombine);
+ }
+ }
+
+ public static string ExceptionChartAreaSeriesNotFound
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartAreaSeriesNotFound);
+ }
+ }
+
+ public static string ExceptionAxisScaleBreaksNumberInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisScaleBreaksNumberInvalid);
+ }
+ }
+
+ public static string ExceptionAxisScaleBreaksCollapsibleSpaceInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisScaleBreaksCollapsibleSpaceInvalid);
+ }
+ }
+
+ public static string ExceptionAxisScaleBreaksSpacingInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisScaleBreaksSpacingInvalid);
+ }
+ }
+
+ public static string ExceptionAxisScaleBreaksLineWidthInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisScaleBreaksLineWidthInvalid);
+ }
+ }
+
+ public static string ExceptionAxisScaleSegmentsPositionInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisScaleSegmentsPositionInvalid);
+ }
+ }
+
+ public static string ExceptionAxisScaleSegmentsSizeInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisScaleSegmentsSizeInvalid);
+ }
+ }
+
+ public static string ExceptionAxisScaleSegmentsSpacingInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAxisScaleSegmentsSpacingInvalid);
+ }
+ }
+
+ public static string ExceptionTickMarksIntervalIsZero
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionTickMarksIntervalIsZero);
+ }
+ }
+
+ public static string ExceptionTickMarksIntervalIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionTickMarksIntervalIsNegative);
+ }
+ }
+
+ public static string ExceptionScrollBarSizeInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionScrollBarSizeInvalid);
+ }
+ }
+
+ public static string ExceptionScrollBarZoomResetsNumberInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionScrollBarZoomResetsNumberInvalid);
+ }
+ }
+
+ public static string ExceptionMarkerStepNegativeValue
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionMarkerStepNegativeValue);
+ }
+ }
+
+ public static string ExceptionTextThresholdIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionTextThresholdIsNegative);
+ }
+ }
+
+ public static string ExceptionNamedImageObjectRequired
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionNamedImageObjectRequired);
+ }
+ }
+
+ public static string ExceptionNamedImageInsertedHasWrongType
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionNamedImageInsertedHasWrongType);
+ }
+ }
+
+ public static string ExceptionLegendNameIsEmpty
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionLegendNameIsEmpty);
+ }
+ }
+
+ public static string ExceptionLegendAddedHasWrongType
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionLegendAddedHasWrongType);
+ }
+ }
+
+ public static string ExceptionLegendInsertedHasWrongType
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionLegendInsertedHasWrongType);
+ }
+ }
+
+ public static string ExceptionBackSecondaryColorIsTransparent
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionBackSecondaryColorIsTransparent);
+ }
+ }
+
+ public static string ExceptionLegendAutoFitMinFontSizeInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionLegendAutoFitMinFontSizeInvalid);
+ }
+ }
+
+ public static string ExceptionLegendMaximumAutoSizeInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionLegendMaximumAutoSizeInvalid);
+ }
+ }
+
+ public static string ExceptionLegendColumnSpacingInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionLegendColumnSpacingInvalid);
+ }
+ }
+
+ public static string ExceptionLegendMarkerBorderWidthIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionLegendMarkerBorderWidthIsNegative);
+ }
+ }
+
+ public static string ExceptionLegendItemAddedHasWrongType
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionLegendItemAddedHasWrongType);
+ }
+ }
+
+ public static string ExceptionLegendItemInsertedHasWrongType
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionLegendItemInsertedHasWrongType);
+ }
+ }
+
+ public static string ExceptionLegendColumnIsEmpty
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionLegendColumnIsEmpty);
+ }
+ }
+
+ public static string ExceptionSeriesSymbolSizeIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionSeriesSymbolSizeIsNegative);
+ }
+ }
+
+ public static string ExceptionMinimumCellWidthIsWrong
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionMinimumCellWidthIsWrong);
+ }
+ }
+
+ public static string ExceptionMaximumCellWidthIsWrong
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionMaximumCellWidthIsWrong);
+ }
+ }
+
+ public static string ExceptionLegendCellNameIsEmpty
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionLegendCellNameIsEmpty);
+ }
+ }
+
+ public static string ExceptionLegendCellImageSizeIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionLegendCellImageSizeIsNegative);
+ }
+ }
+
+ public static string ExceptionLegendCellSeriesSymbolSizeIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionLegendCellSeriesSymbolSizeIsNegative);
+ }
+ }
+
+ public static string ExceptionLegendCellSpanIsLessThenOne
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionLegendCellSpanIsLessThenOne);
+ }
+ }
+
+ public static string ExceptionMarginTopIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionMarginTopIsNegative);
+ }
+ }
+
+ public static string ExceptionMarginBottomIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionMarginBottomIsNegative);
+ }
+ }
+
+ public static string ExceptionMarginLeftIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionMarginLeftIsNegative);
+ }
+ }
+
+ public static string ExceptionMarginRightIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionMarginRightIsNegative);
+ }
+ }
+
+ public static string ExceptionElementPositionArgumentOutOfRange
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionElementPositionArgumentOutOfRange);
+ }
+ }
+
+ public static string ExceptionChartHeightIsNotInPixels
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartHeightIsNotInPixels);
+ }
+ }
+
+ public static string ExceptionChartWidthIsNotInPixels
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartWidthIsNotInPixels);
+ }
+ }
+
+ public static string ExceptionChartBorderIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartBorderIsNegative);
+ }
+ }
+
+ public static string ExceptionChartCompressionInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartCompressionInvalid);
+ }
+ }
+
+ public static string ExceptionChartDataPointsAlignmentFaild
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartDataPointsAlignmentFaild);
+ }
+ }
+
+ public static string ExceptionChartDataPointsAlignmentFaildAxisLabelsInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartDataPointsAlignmentFaildAxisLabelsInvalid);
+ }
+ }
+
+ public static string ExceptionChartDataPointsInsertionFailedYValuesEmpty
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartDataPointsInsertionFailedYValuesEmpty);
+ }
+ }
+
+ public static string ExceptionChartTypeHasNoInterface
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartTypeHasNoInterface);
+ }
+ }
+
+ public static string ExceptionBorderTypeHasNoInterface
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionBorderTypeHasNoInterface);
+ }
+ }
+
+ public static string ExceptionChartSerializerContentFlagUnsupported
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartSerializerContentFlagUnsupported);
+ }
+ }
+
+ public static string ExceptionChartSerializerContentStringFormatInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartSerializerContentStringFormatInvalid);
+ }
+ }
+
+ public static string ExceptionChartSerializerClassNameUndefined
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartSerializerClassNameUndefined);
+ }
+ }
+
+ public static string ExceptionChartSerializerPropertyNameUndefined
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartSerializerPropertyNameUndefined);
+ }
+ }
+
+ public static string ExceptionChartSerializerWriterObjectInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartSerializerWriterObjectInvalid);
+ }
+ }
+
+ public static string ExceptionChartSerializerReaderObjectInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartSerializerReaderObjectInvalid);
+ }
+ }
+
+ public static string ExceptionChartSerializerDestinationObjectInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartSerializerDestinationObjectInvalid);
+ }
+ }
+
+ public static string ExceptionChartSerializerSourceObjectInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartSerializerSourceObjectInvalid);
+ }
+ }
+
+ public static string ExceptionChartSerializerBinaryIgnoreUnknownAttributesUnsupported
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartSerializerBinaryIgnoreUnknownAttributesUnsupported);
+ }
+ }
+
+ public static string ExceptionChartSerializerBinaryFromatInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartSerializerBinaryFromatInvalid);
+ }
+ }
+
+ public static string ExceptionChartSerializerPropertyNotFound
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartSerializerPropertyNotFound);
+ }
+ }
+
+ public static string ExceptionDataManipulatorPointCountIsZero
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataManipulatorPointCountIsZero);
+ }
+ }
+
+ public static string ExceptionDataManipulatorIndexUndefined
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataManipulatorIndexUndefined);
+ }
+ }
+
+ public static string ExceptionDataManipulatorIndexFormatInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataManipulatorIndexFormatInvalid);
+ }
+ }
+
+ public static string ExceptionDataManipulatorGroupedSeriesNotSorted
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataManipulatorGroupedSeriesNotSorted);
+ }
+ }
+
+ public static string ExceptionDataManipulatorGroupingFormulaUndefined
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataManipulatorGroupingFormulaUndefined);
+ }
+ }
+
+ public static string ExceptionDataManipulatorGroupingFormulaUnsupported
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataManipulatorGroupingFormulaUnsupported);
+ }
+ }
+
+ public static string ExceptionDataManipulatorGroupingInputSeriesUndefined
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataManipulatorGroupingInputSeriesUndefined);
+ }
+ }
+
+ public static string ExceptionDataManipulatorGroupingInputOutputSeriesNumberMismatch
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataManipulatorGroupingInputOutputSeriesNumberMismatch);
+ }
+ }
+
+ public static string ExceptionDataBindYValuesToString
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataBindYValuesToString);
+ }
+ }
+
+ public static string ExceptionDataBindXValuesToString
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataBindXValuesToString);
+ }
+ }
+
+ public static string ExceptionDataBindSeriesToString
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataBindSeriesToString);
+ }
+ }
+
+ public static string ExceptionDataBindSeriesGroupByParameterIsEmpty
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataBindSeriesGroupByParameterIsEmpty);
+ }
+ }
+
+ public static string ExceptionImageUrlIsEmpty
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionImageUrlIsEmpty);
+ }
+ }
+
+ public static string ExceptionImageUrlInvalidFormatters
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionImageUrlInvalidFormatters);
+ }
+ }
+
+ public static string ExceptionImageUrlInvalidFormat
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionImageUrlInvalidFormat);
+ }
+ }
+
+ public static string ExceptionImageUrlMissedFormatter
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionImageUrlMissedFormatter);
+ }
+ }
+
+ public static string ExceptionDataManager100StackedSeriesPointsNumeberMismatch
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataManager100StackedSeriesPointsNumeberMismatch);
+ }
+ }
+
+ public static string ExceptionFormulaModuleHasNoInterface
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionFormulaModuleHasNoInterface);
+ }
+ }
+
+ public static string ExceptionDataPointConverterInvalidSorting
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataPointConverterInvalidSorting);
+ }
+ }
+
+ public static string ExceptionDataPointConverterWrongTypes
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataPointConverterWrongTypes);
+ }
+ }
+
+ public static string ExceptionDataPointInsertionXValuesQtyIsLessYValues
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataPointInsertionXValuesQtyIsLessYValues);
+ }
+ }
+
+ public static string ExceptionDataPointValueNameInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataPointValueNameInvalid);
+ }
+ }
+
+ public static string ExceptionDataPointValueNameYIndexOutOfRange
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataPointValueNameYIndexOutOfRange);
+ }
+ }
+
+ public static string ExceptionDataPointValueNameYIndexIsNotPositive
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataPointValueNameYIndexIsNotPositive);
+ }
+ }
+
+ public static string ExceptionDataPointInsertionNoDataSource
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataPointInsertionNoDataSource);
+ }
+ }
+
+ public static string ExceptionDataPointBindingYValueNotSpecified
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataPointBindingYValueNotSpecified);
+ }
+ }
+
+ public static string ExceptionDataPointInsertionYValueNotSpecified
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataPointInsertionYValueNotSpecified);
+ }
+ }
+
+ public static string ExceptionAttributeUnableToDelete
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAttributeUnableToDelete);
+ }
+ }
+
+ public static string ExceptionAttributeNameIsEmpty
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAttributeNameIsEmpty);
+ }
+ }
+
+ public static string ExceptionAttributeInvalidFormat
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAttributeInvalidFormat);
+ }
+ }
+
+ public static string ExceptionAttributeDrawSideBySideInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAttributeDrawSideBySideInvalid);
+ }
+ }
+
+ public static string ExceptionLabelBorderIsNotPositive
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionLabelBorderIsNotPositive);
+ }
+ }
+
+ public static string ExceptionBorderWidthIsNotPositive
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionBorderWidthIsNotPositive);
+ }
+ }
+
+ public static string ExceptionAngleRangeInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionAngleRangeInvalid);
+ }
+ }
+
+ public static string ExceptionDataPointYValueStringFormat
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDataPointYValueStringFormat);
+ }
+ }
+
+ public static string ExceptionParameterFormatInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionParameterFormatInvalid);
+ }
+ }
+
+ public static string ExceptionStatisticalAnalysesInvalidAlphaValue
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStatisticalAnalysesInvalidAlphaValue);
+ }
+ }
+
+ public static string ExceptionStatisticalAnalysesInvalidProbabilityValue
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStatisticalAnalysesInvalidProbabilityValue);
+ }
+ }
+
+ public static string ExceptionStatisticalAnalysesInvalidDegreeOfFreedom
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStatisticalAnalysesInvalidDegreeOfFreedom);
+ }
+ }
+
+ public static string ExceptionStatisticalAnalysesNegativeMeanDifference
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStatisticalAnalysesNegativeMeanDifference);
+ }
+ }
+
+ public static string ExceptionStatisticalAnalysesInvalidSeriesNumber
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStatisticalAnalysesInvalidSeriesNumber);
+ }
+ }
+
+ public static string ExceptionStatisticalAnalysesInvalidMeanDifference
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStatisticalAnalysesInvalidMeanDifference);
+ }
+ }
+
+ public static string ExceptionStatisticalAnalysesNotEnoughDataPoints
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStatisticalAnalysesNotEnoughDataPoints);
+ }
+ }
+
+ public static string ExceptionStatisticalAnalysesInvalidVariance
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStatisticalAnalysesInvalidVariance);
+ }
+ }
+
+ public static string ExceptionStatisticalAnalysesInvalidTValue
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStatisticalAnalysesInvalidTValue);
+ }
+ }
+
+ public static string ExceptionStatisticalAnalysesGammaBetaNegativeParameters
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStatisticalAnalysesGammaBetaNegativeParameters);
+ }
+ }
+
+ public static string ExceptionStatisticalAnalysesInvalidZValue
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStatisticalAnalysesInvalidZValue);
+ }
+ }
+
+ public static string ExceptionStatisticalAnalysesZeroVariance
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStatisticalAnalysesZeroVariance);
+ }
+ }
+
+ public static string ExceptionStatisticalAnalysesNotEnoughInputSeries
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStatisticalAnalysesNotEnoughInputSeries);
+ }
+ }
+
+ public static string ExceptionStatisticalAnalysesInvalidVariableRanges
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStatisticalAnalysesInvalidVariableRanges);
+ }
+ }
+
+ public static string ExceptionStatisticalAnalysesStudentsInvalidTValue
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStatisticalAnalysesStudentsInvalidTValue);
+ }
+ }
+
+ public static string ExceptionStatisticalAnalysesStudentsNegativeFreedomDegree
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStatisticalAnalysesStudentsNegativeFreedomDegree);
+ }
+ }
+
+ public static string ExceptionStatisticalAnalysesNormalInvalidProbabilityValue
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStatisticalAnalysesNormalInvalidProbabilityValue);
+ }
+ }
+
+ public static string ExceptionStatisticalAnalysesInvalidTailedParameter
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStatisticalAnalysesInvalidTailedParameter);
+ }
+ }
+
+ public static string ExceptionStatisticalAnalysesInvalidInputParameter
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStatisticalAnalysesInvalidInputParameter);
+ }
+ }
+
+ public static string ExceptionStatisticalAnalysesIncompleteBetaFunction
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStatisticalAnalysesIncompleteBetaFunction);
+ }
+ }
+
+ public static string ExceptionStatisticalAnalysesInvalidAnovaTest
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStatisticalAnalysesInvalidAnovaTest);
+ }
+ }
+
+ public static string ExceptionStatisticalAnalysesCovariance
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStatisticalAnalysesCovariance);
+ }
+ }
+
+ public static string ExceptionStatisticalAnalysesInvalidMedianConditions
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStatisticalAnalysesInvalidMedianConditions);
+ }
+ }
+
+ public static string ExceptionStatisticalAnalysesInvalidMeanConditions
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStatisticalAnalysesInvalidMeanConditions);
+ }
+ }
+
+ public static string ExceptionStatisticalAnalysesInvalidVarianceConditions
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStatisticalAnalysesInvalidVarianceConditions);
+ }
+ }
+
+ public static string ExceptionPeriodParameterIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPeriodParameterIsNegative);
+ }
+ }
+
+ public static string ExceptionPeriodAverageParameterIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPeriodAverageParameterIsNegative);
+ }
+ }
+
+ public static string ExceptionPeriodShortParameterIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPeriodShortParameterIsNegative);
+ }
+ }
+
+ public static string ExceptionPeriodLongParameterIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPeriodLongParameterIsNegative);
+ }
+ }
+
+ public static string ExceptionIndicatorsDeviationMissing
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionIndicatorsDeviationMissing);
+ }
+ }
+
+ public static string ExceptionIndicatorsLongPeriodLessThenShortPeriod
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionIndicatorsLongPeriodLessThenShortPeriod);
+ }
+ }
+
+ public static string ExceptionOscillatorObjectInvalidPeriod
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionOscillatorObjectInvalidPeriod);
+ }
+ }
+
+ public static string ExceptionOscillatorNegativeSignalPeriod
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionOscillatorNegativeSignalPeriod);
+ }
+ }
+
+ public static string ExceptionOscillatorNegativePeriodParameter
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionOscillatorNegativePeriodParameter);
+ }
+ }
+
+ public static string ExceptionVolumeIndicatorStartValueMissing
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionVolumeIndicatorStartValueMissing);
+ }
+ }
+
+ public static string ExceptionPriceIndicatorsShiftParameterMissing
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPriceIndicatorsShiftParameterMissing);
+ }
+ }
+
+ public static string ExceptionPriceIndicatorsSameYNumber
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPriceIndicatorsSameYNumber);
+ }
+ }
+
+ public static string ExceptionPriceIndicatorsSameXYNumber
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPriceIndicatorsSameXYNumber);
+ }
+ }
+
+ public static string ExceptionPriceIndicatorsPeriodMissing
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPriceIndicatorsPeriodMissing);
+ }
+ }
+
+ public static string ExceptionPriceIndicatorsNotEnoughPoints
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPriceIndicatorsNotEnoughPoints);
+ }
+ }
+
+ public static string ExceptionPriceIndicatorsFormulaRequiresOneArray
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPriceIndicatorsFormulaRequiresOneArray);
+ }
+ }
+
+ public static string ExceptionPriceIndicatorsFormulaRequiresTwoArrays
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPriceIndicatorsFormulaRequiresTwoArrays);
+ }
+ }
+
+ public static string ExceptionPriceIndicatorsFormulaRequiresThreeArrays
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPriceIndicatorsFormulaRequiresThreeArrays);
+ }
+ }
+
+ public static string ExceptionPriceIndicatorsFormulaRequiresFourArrays
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPriceIndicatorsFormulaRequiresFourArrays);
+ }
+ }
+
+ public static string ExceptionObjectReferenceIsNull
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionObjectReferenceIsNull);
+ }
+ }
+
+ public static string ExceptionThreeLineBreakCanNotCobine
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionThreeLineBreakCanNotCobine);
+ }
+ }
+
+ public static string ExceptionThreeLineBreakNullReference
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionThreeLineBreakNullReference);
+ }
+ }
+
+ public static string ExceptionThreeLineBreakUsedYValueOutOfRange
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionThreeLineBreakUsedYValueOutOfRange);
+ }
+ }
+
+ public static string ExceptionThreeLineBreakNumberOfLinesInBreakFormatInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionThreeLineBreakNumberOfLinesInBreakFormatInvalid);
+ }
+ }
+
+ public static string ExceptionThreeLineBreakUpBrickColorInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionThreeLineBreakUpBrickColorInvalid);
+ }
+ }
+
+ public static string ExceptionThreeLineBreakUsedYValueInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionThreeLineBreakUsedYValueInvalid);
+ }
+ }
+
+ public static string ExceptionThreeLineBreakNumberOfLinesInBreakValueInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionThreeLineBreakNumberOfLinesInBreakValueInvalid);
+ }
+ }
+
+ public static string ExceptionRenkoCanNotCobine
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionRenkoCanNotCobine);
+ }
+ }
+
+ public static string ExceptionRenkoNullReference
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionRenkoNullReference);
+ }
+ }
+
+ public static string ExceptionRenkoUsedYValueOutOfRange
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionRenkoUsedYValueOutOfRange);
+ }
+ }
+
+ public static string ExceptionRenkoBoxSizeFormatInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionRenkoBoxSizeFormatInvalid);
+ }
+ }
+
+ public static string ExceptionRenkoUpBrickColorInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionRenkoUpBrickColorInvalid);
+ }
+ }
+
+ public static string ExceptionRenkoUsedYValueFormatInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionRenkoUsedYValueFormatInvalid);
+ }
+ }
+
+ public static string ExceptionPieIntervalsInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPieIntervalsInvalid);
+ }
+ }
+
+ public static string ExceptionPieUnassignedFrontBackPoints
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPieUnassignedFrontBackPoints);
+ }
+ }
+
+ public static string ExceptionPiePointOrderInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPiePointOrderInvalid);
+ }
+ }
+
+ public static string ExceptionPieHorizontalLineSizeInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPieHorizontalLineSizeInvalid);
+ }
+ }
+
+ public static string ExceptionPieRadialLineSizeInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPieRadialLineSizeInvalid);
+ }
+ }
+
+ public static string ExceptionPie3DLabelLineSizeInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPie3DLabelLineSizeInvalid);
+ }
+ }
+
+ public static string ExceptionPieRadiusInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPieRadiusInvalid);
+ }
+ }
+
+ public static string ExceptionPieMinimumRelativePieSizeInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPieMinimumRelativePieSizeInvalid);
+ }
+ }
+
+ public static string ExceptionPieOrderOperationInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPieOrderOperationInvalid);
+ }
+ }
+
+ public static string ExceptionPieIntervalsOverlapping
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPieIntervalsOverlapping);
+ }
+ }
+
+ public static string ExceptionDoughnutNullReference
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDoughnutNullReference);
+ }
+ }
+
+ public static string ExceptionDoughnutThresholdInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDoughnutThresholdInvalid);
+ }
+ }
+
+ public static string ExceptionDoughnutCollectedThresholdUsePercentInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDoughnutCollectedThresholdUsePercentInvalid);
+ }
+ }
+
+ public static string ExceptionDoughnutCollectedColorInvalidFormat
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDoughnutCollectedColorInvalidFormat);
+ }
+ }
+
+ public static string ExceptionDoughnutCollectedThresholdInvalidFormat
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDoughnutCollectedThresholdInvalidFormat);
+ }
+ }
+
+ public static string ExceptionDoughnutCollectedThresholdInvalidRange
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionDoughnutCollectedThresholdInvalidRange);
+ }
+ }
+
+ public static string ExceptionPointAndFigureUpBrickColorInvalidFormat
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPointAndFigureUpBrickColorInvalidFormat);
+ }
+ }
+
+ public static string ExceptionPointAndFigureCanNotCombine
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPointAndFigureCanNotCombine);
+ }
+ }
+
+ public static string ExceptionPointAndFigureNullReference
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPointAndFigureNullReference);
+ }
+ }
+
+ public static string ExceptionPointAndFigureUsedYValueHighOutOfRange
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPointAndFigureUsedYValueHighOutOfRange);
+ }
+ }
+
+ public static string ExceptionPointAndFigureUsedYValueLowOutOfrange
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPointAndFigureUsedYValueLowOutOfrange);
+ }
+ }
+
+ public static string ExceptionPointAndFigureReversalAmountInvalidFormat
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPointAndFigureReversalAmountInvalidFormat);
+ }
+ }
+
+ public static string ExceptionPointAndFigureUsedYValueHighInvalidFormat
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPointAndFigureUsedYValueHighInvalidFormat);
+ }
+ }
+
+ public static string ExceptionPointAndFigureUsedYValueLowInvalidFormat
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPointAndFigureUsedYValueLowInvalidFormat);
+ }
+ }
+
+ public static string ExceptionFastPointMarkerStyleUnknown
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionFastPointMarkerStyleUnknown);
+ }
+ }
+
+ public static string ExceptionFunnelAngleRangeInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionFunnelAngleRangeInvalid);
+ }
+ }
+
+ public static string ExceptionFunnelCanNotCombine
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionFunnelCanNotCombine);
+ }
+ }
+
+ public static string ExceptionFunnelNeckHeightInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionFunnelNeckHeightInvalid);
+ }
+ }
+
+ public static string ExceptionFunnelNeckWidthInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionFunnelNeckWidthInvalid);
+ }
+ }
+
+ public static string ExceptionKagiNullReference
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionKagiNullReference);
+ }
+ }
+
+ public static string ExceptionKagiCanNotCombine
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionKagiCanNotCombine);
+ }
+ }
+
+ public static string ExceptionStackedAreaChartSeriesDataPointsNumberMismatch
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionStackedAreaChartSeriesDataPointsNumberMismatch);
+ }
+ }
+
+ public static string Exception3DPieLabelsIndexInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.Exception3DPieLabelsIndexInvalid);
+ }
+ }
+
+ public static string Exception3DChartPointsXValuesUnsorted
+ {
+ get
+ {
+ return Keys.GetString(Keys.Exception3DChartPointsXValuesUnsorted);
+ }
+ }
+
+ public static string ExceptionFunnelMinimumPointHeightAttributeInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionFunnelMinimumPointHeightAttributeInvalid);
+ }
+ }
+
+ public static string ExceptionErrorBarParameterUndefined
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionErrorBarParameterUndefined);
+ }
+ }
+
+ public static string Exception3DSplineY1ValueIsLessThenY2
+ {
+ get
+ {
+ return Keys.GetString(Keys.Exception3DSplineY1ValueIsLessThenY2);
+ }
+ }
+
+ public static string ExceptionCustomAttributeDefaultValueTypeInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionCustomAttributeDefaultValueTypeInvalid);
+ }
+ }
+
+ public static string ExceptionFormulaDataItemsNumberMismatch
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionFormulaDataItemsNumberMismatch);
+ }
+ }
+
+ public static string ExceptionFormulaDataItemsNumberMismatch2
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionFormulaDataItemsNumberMismatch2);
+ }
+ }
+
+ public static string ExceptionFormulaDataOutputSeriesNumberYValuesIncorrect
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionFormulaDataOutputSeriesNumberYValuesIncorrect);
+ }
+ }
+
+ public static string ExceptionFormulaYIndexInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionFormulaYIndexInvalid);
+ }
+ }
+
+ public static string ExceptionFormulaXValuesNotAligned
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionFormulaXValuesNotAligned);
+ }
+ }
+
+ public static string ExceptionFormulaInputOutputSeriesMismatch
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionFormulaInputOutputSeriesMismatch);
+ }
+ }
+
+ public static string ExceptionForecastingDegreeInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionForecastingDegreeInvalid);
+ }
+ }
+
+ public static string ExceptionForecastingExponentialRegressionHasZeroYValues
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionForecastingExponentialRegressionHasZeroYValues);
+ }
+ }
+
+ public static string ExceptionForecastingPowerRegressionHasZeroYValues
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionForecastingPowerRegressionHasZeroYValues);
+ }
+ }
+
+ public static string ExceptionBorderWidthIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionBorderWidthIsNegative);
+ }
+ }
+
+ public static string ExceptionBorderWidthIsZero
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionBorderWidthIsZero);
+ }
+ }
+
+ public static string ExceptionLegendBorderWidthIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionLegendBorderWidthIsNegative);
+ }
+ }
+
+ public static string ExceptionTitleBorderWidthIsNegative
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionTitleBorderWidthIsNegative);
+ }
+ }
+
+ public static string ExceptionMatrix3DNotinitialized
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionMatrix3DNotinitialized);
+ }
+ }
+
+ public static string ExceptionPaletteIsEmpty
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionPaletteIsEmpty);
+ }
+ }
+
+ public static string ExceptionChartPreviewNotAvailable
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartPreviewNotAvailable);
+ }
+ }
+
+ public static string ExceptionChartPreviewNotAvailableShort
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartPreviewNotAvailableShort);
+ }
+ }
+
+ public static string ExceptionChartOutOfLimits
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionChartOutOfLimits);
+ }
+ }
+
+ public static string ExceptionHttpHandlerCanNotSave
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionHttpHandlerCanNotSave);
+ }
+ }
+
+ public static string ExceptionHttpHandlerValueInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionHttpHandlerValueInvalid);
+ }
+ }
+
+ public static string ExceptionHttpHandlerTimeoutParameterInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionHttpHandlerTimeoutParameterInvalid);
+ }
+ }
+
+ public static string ExceptionHttpHandlerUrlMissing
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionHttpHandlerUrlMissing);
+ }
+ }
+
+ public static string ExceptionHttpHandlerUrlInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionHttpHandlerUrlInvalid);
+ }
+ }
+
+ public static string ExceptionHttpHandlerInvalidLocation
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionHttpHandlerInvalidLocation);
+ }
+ }
+
+ public static string ExceptionHttpHandlerImageNotFound
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionHttpHandlerImageNotFound);
+ }
+ }
+
+ public static string DescriptionCustomAttributeEmptyPointValue
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeEmptyPointValue);
+ }
+ }
+
+ public static string DescriptionCustomAttributeIsXAxisQuantitive
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeIsXAxisQuantitive);
+ }
+ }
+
+ public static string DescriptionCustomAttributePieDonutExploded
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributePieDonutExploded);
+ }
+ }
+
+ public static string DescriptionCustomAttributeProportionalSymbols
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeProportionalSymbols);
+ }
+ }
+
+ public static string DescriptionCustomAttributeDrawSideBySide
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeDrawSideBySide);
+ }
+ }
+
+ public static string DescriptionCustomAttributeShowMarkerLines
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeShowMarkerLines);
+ }
+ }
+
+ public static string DescriptionCustomAttributeShowOpenClose
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeShowOpenClose);
+ }
+ }
+
+ public static string DescriptionCustomAttributeBoxPlotShowAverage
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeBoxPlotShowAverage);
+ }
+ }
+
+ public static string DescriptionCustomAttributeBubbleUseSizeForLabel
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeBubbleUseSizeForLabel);
+ }
+ }
+
+ public static string DescriptionCustomAttributeBoxPlotShowMedian
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeBoxPlotShowMedian);
+ }
+ }
+
+ public static string DescriptionCustomAttributeBoxPlotShowUnusualValues
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeBoxPlotShowUnusualValues);
+ }
+ }
+
+ public static string DescriptionCustomAttributeBoxPlotSeries
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeBoxPlotSeries);
+ }
+ }
+
+ public static string DescriptionCustomAttributePieStartAngle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributePieStartAngle);
+ }
+ }
+
+ public static string DescriptionCustomAttributeLabelStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeLabelStyle);
+ }
+ }
+
+ public static string DescriptionCustomAttributeFunnelLabelStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeFunnelLabelStyle);
+ }
+ }
+
+ public static string DescriptionCustomAttributeFunnelStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeFunnelStyle);
+ }
+ }
+
+ public static string DescriptionCustomAttributePolarDrawingStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributePolarDrawingStyle);
+ }
+ }
+
+ public static string DescriptionCustomAttributePyramidLabelStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributePyramidLabelStyle);
+ }
+ }
+
+ public static string DescriptionCustomAttributeRadarDrawingStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeRadarDrawingStyle);
+ }
+ }
+
+ public static string DescriptionCustomAttributeBoxSize
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeBoxSize);
+ }
+ }
+
+ public static string DescriptionCustomAttributeCollectedColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeCollectedColor);
+ }
+ }
+
+ public static string DescriptionCustomAttributeCollectedLabel
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeCollectedLabel);
+ }
+ }
+
+ public static string DescriptionCustomAttributeCollectedLegendText
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeCollectedLegendText);
+ }
+ }
+
+ public static string DescriptionCustomAttributeCollectedLegendDefaultText
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeCollectedLegendDefaultText);
+ }
+ }
+
+ public static string DescriptionCustomAttributeCollectedLabelDefaultText
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeCollectedLabelDefaultText);
+ }
+ }
+
+ public static string DescriptionCustomAttributeCollectedToolTip
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeCollectedToolTip);
+ }
+ }
+
+ public static string DescriptionCustomAttributePyramidValueType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributePyramidValueType);
+ }
+ }
+
+ public static string DescriptionCustomAttribute_3DLabelLineSize
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttribute_3DLabelLineSize);
+ }
+ }
+
+ public static string DescriptionCustomAttributeFunnel3DRotationAngle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeFunnel3DRotationAngle);
+ }
+ }
+
+ public static string DescriptionCustomAttributePyramid3DRotationAngle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributePyramid3DRotationAngle);
+ }
+ }
+
+ public static string DescriptionCustomAttributePixelPointDepth
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributePixelPointDepth);
+ }
+ }
+
+ public static string DescriptionCustomAttributePixelPointGapDepth
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributePixelPointGapDepth);
+ }
+ }
+
+ public static string DescriptionCustomAttributeErrorBarCenterMarkerStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeErrorBarCenterMarkerStyle);
+ }
+ }
+
+ public static string DescriptionCustomAttributePointFigureBoxSize
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributePointFigureBoxSize);
+ }
+ }
+
+ public static string DescriptionCustomAttributeBubbleScaleMax
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeBubbleScaleMax);
+ }
+ }
+
+ public static string DescriptionCustomAttributeBubbleScaleMin
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeBubbleScaleMin);
+ }
+ }
+
+ public static string DescriptionCustomAttributeCollectedThreshold
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeCollectedThreshold);
+ }
+ }
+
+ public static string DescriptionCustomAttributePieLineColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributePieLineColor);
+ }
+ }
+
+ public static string DescriptionCustomAttributeCalloutLineColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeCalloutLineColor);
+ }
+ }
+
+ public static string DescriptionCustomAttributePieLabelStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributePieLabelStyle);
+ }
+ }
+
+ public static string DescriptionCustomAttributeFunnel3DDrawingStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeFunnel3DDrawingStyle);
+ }
+ }
+
+ public static string DescriptionCustomAttributePyramid3DDrawingStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributePyramid3DDrawingStyle);
+ }
+ }
+
+ public static string DescriptionCustomAttributeDrawingStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeDrawingStyle);
+ }
+ }
+
+ public static string DescriptionCustomAttributePieDrawingStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributePieDrawingStyle);
+ }
+ }
+
+ public static string DescriptionCustomAttributeCollectedSliceExploded
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeCollectedSliceExploded);
+ }
+ }
+
+ public static string DescriptionCustomAttributeCollectedThresholdUsePercent
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeCollectedThresholdUsePercent);
+ }
+ }
+
+ public static string DescriptionCustomAttributeFunnelNeckHeight
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeFunnelNeckHeight);
+ }
+ }
+
+ public static string DescriptionCustomAttributeFunnelNeckWidth
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeFunnelNeckWidth);
+ }
+ }
+
+ public static string DescriptionCustomAttributePyramidPointGap
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributePyramidPointGap);
+ }
+ }
+
+ public static string DescriptionCustomAttributeFunnelPointGap
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeFunnelPointGap);
+ }
+ }
+
+ public static string DescriptionCustomAttributeLabelsHorizontalLineSize
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeLabelsHorizontalLineSize);
+ }
+ }
+
+ public static string DescriptionCustomAttributeDoughnutRadius
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeDoughnutRadius);
+ }
+ }
+
+ public static string DescriptionCustomAttributePolarCircularLabelsStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributePolarCircularLabelsStyle);
+ }
+ }
+
+ public static string DescriptionCustomAttributeRadarCircularLabelsStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeRadarCircularLabelsStyle);
+ }
+ }
+
+ public static string DescriptionCustomAttributeOpenCloseStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeOpenCloseStyle);
+ }
+ }
+
+ public static string DescriptionCustomAttributeBubbleMaxSize
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeBubbleMaxSize);
+ }
+ }
+
+ public static string DescriptionCustomAttributeMaxPixelPointWidth
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeMaxPixelPointWidth);
+ }
+ }
+
+ public static string DescriptionCustomAttributePyramidMinPointHeight
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributePyramidMinPointHeight);
+ }
+ }
+
+ public static string DescriptionCustomAttributeFunnelMinPointHeight
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeFunnelMinPointHeight);
+ }
+ }
+
+ public static string DescriptionCustomAttributeMinimumRelativePieSize
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeMinimumRelativePieSize);
+ }
+ }
+
+ public static string DescriptionCustomAttributeMinPixelPointWidth
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeMinPixelPointWidth);
+ }
+ }
+
+ public static string DescriptionCustomAttributeErrorBarSeries
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeErrorBarSeries);
+ }
+ }
+
+ public static string DescriptionCustomAttributeNumberOfLinesInBreak
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeNumberOfLinesInBreak);
+ }
+ }
+
+ public static string DescriptionCustomAttributePyramidOutsideLabelPlacement
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributePyramidOutsideLabelPlacement);
+ }
+ }
+
+ public static string DescriptionCustomAttributeFunnelOutsideLabelPlacement
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeFunnelOutsideLabelPlacement);
+ }
+ }
+
+ public static string DescriptionCustomAttributeBoxPlotPercentile
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeBoxPlotPercentile);
+ }
+ }
+
+ public static string DescriptionCustomAttributeBoxPlotWhiskerPercentile
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeBoxPlotWhiskerPercentile);
+ }
+ }
+
+ public static string DescriptionCustomAttributeBarLabelStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeBarLabelStyle);
+ }
+ }
+
+ public static string DescriptionCustomAttributeLabelsRadialLineSize
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeLabelsRadialLineSize);
+ }
+ }
+
+ public static string DescriptionCustomAttributePointWidth
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributePointWidth);
+ }
+ }
+
+ public static string DescriptionCustomAttributeReversalAmount
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeReversalAmount);
+ }
+ }
+
+ public static string DescriptionCustomAttributePolarAreaDrawingStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributePolarAreaDrawingStyle);
+ }
+ }
+
+ public static string DescriptionCustomAttributeRadarAreaDrawingStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeRadarAreaDrawingStyle);
+ }
+ }
+
+ public static string DescriptionCustomAttributeStackedGroupName
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeStackedGroupName);
+ }
+ }
+
+ public static string DescriptionCustomAttributeLineTension
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeLineTension);
+ }
+ }
+
+ public static string DescriptionCustomAttributeCandlePriceUpColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeCandlePriceUpColor);
+ }
+ }
+
+ public static string DescriptionCustomAttributeBarsPriceUpColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeBarsPriceUpColor);
+ }
+ }
+
+ public static string DescriptionCustomAttributePriceDownColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributePriceDownColor);
+ }
+ }
+
+ public static string DescriptionCustomAttributeUsedYValueHigh
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeUsedYValueHigh);
+ }
+ }
+
+ public static string DescriptionCustomAttributeUsedYValueLow
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeUsedYValueLow);
+ }
+ }
+
+ public static string DescriptionCustomAttributeRenkoUsedYValue
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeRenkoUsedYValue);
+ }
+ }
+
+ public static string DescriptionCustomAttributeThreeLineBreakUsedYValue
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeThreeLineBreakUsedYValue);
+ }
+ }
+
+ public static string DescriptionCustomAttributePyramidInsideLabelAlignment
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributePyramidInsideLabelAlignment);
+ }
+ }
+
+ public static string DescriptionCustomAttributeFunnelInsideLabelAlignment
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeFunnelInsideLabelAlignment);
+ }
+ }
+
+ public static string DescriptionCustomAttributeErrorBarStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeErrorBarStyle);
+ }
+ }
+
+ public static string DescriptionCustomAttributePixelPointWidth
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributePixelPointWidth);
+ }
+ }
+
+ public static string DescriptionCustomAttributeLabelValueType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeLabelValueType);
+ }
+ }
+
+ public static string DescriptionCustomAttributeUsedYValue
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeUsedYValue);
+ }
+ }
+
+ public static string DescriptionCustomAttributeKagiReversalAmount
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeKagiReversalAmount);
+ }
+ }
+
+ public static string DescriptionCustomAttributeErrorBarType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionCustomAttributeErrorBarType);
+ }
+ }
+
+ public static string DescriptionAttributeChart_ImageStorageMode
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChart_ImageStorageMode);
+ }
+ }
+
+ public static string DescriptionKeyWordAverageYValues
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordAverageYValues);
+ }
+ }
+
+ public static string DescriptionKeyWordAxisLabelDataPoint
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordAxisLabelDataPoint);
+ }
+ }
+
+ public static string DescriptionKeyWordIndexDataPoint
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordIndexDataPoint);
+ }
+ }
+
+ public static string DescriptionKeyWordLabelDataPoint
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordLabelDataPoint);
+ }
+ }
+
+ public static string DescriptionKeyWordYValuePercentTotal
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordYValuePercentTotal);
+ }
+ }
+
+ public static string DescriptionKeyWordIndexDataPoint2
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordIndexDataPoint2);
+ }
+ }
+
+ public static string DescriptionKeyWordLegendText
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordLegendText);
+ }
+ }
+
+ public static string DescriptionKeyWordMaximumYValues
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordMaximumYValues);
+ }
+ }
+
+ public static string DescriptionKeyWordMinimumYValues
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordMinimumYValues);
+ }
+ }
+
+ public static string DescriptionKeyWordSeriesName
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordSeriesName);
+ }
+ }
+
+ public static string DescriptionKeyWordTotalYValues
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordTotalYValues);
+ }
+ }
+
+ public static string DescriptionKeyWordXValue
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordXValue);
+ }
+ }
+
+ public static string DescriptionKeyWordFirstPointYValue
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordFirstPointYValue);
+ }
+ }
+
+ public static string DescriptionKeyWordLastPointYValue
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordLastPointYValue);
+ }
+ }
+
+ public static string DescriptionKeyWordYValue
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordYValue);
+ }
+ }
+
+ public static string DescriptionKeyWordNameIndexDataPoint
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordNameIndexDataPoint);
+ }
+ }
+
+ public static string DescriptionKeyWordNameXValue
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordNameXValue);
+ }
+ }
+
+ public static string DescriptionKeyWordNameYValue
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordNameYValue);
+ }
+ }
+
+ public static string DescriptionKeyWordNameTotalYValues
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordNameTotalYValues);
+ }
+ }
+
+ public static string DescriptionKeyWordNameYValuePercentTotal
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordNameYValuePercentTotal);
+ }
+ }
+
+ public static string DescriptionKeyWordNameIndexTheDataPoint
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordNameIndexTheDataPoint);
+ }
+ }
+
+ public static string DescriptionKeyWordNameLabelDataPoint
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordNameLabelDataPoint);
+ }
+ }
+
+ public static string DescriptionKeyWordNameAxisLabelDataPoint
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordNameAxisLabelDataPoint);
+ }
+ }
+
+ public static string DescriptionKeyWordNameLegendText
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordNameLegendText);
+ }
+ }
+
+ public static string DescriptionKeyWordNameSeriesName
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordNameSeriesName);
+ }
+ }
+
+ public static string DescriptionKeyWordNameAverageYValues
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordNameAverageYValues);
+ }
+ }
+
+ public static string DescriptionKeyWordNameMaximumYValues
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordNameMaximumYValues);
+ }
+ }
+
+ public static string DescriptionKeyWordNameMinimumYValues
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordNameMinimumYValues);
+ }
+ }
+
+ public static string DescriptionKeyWordNameLastPointYValue
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordNameLastPointYValue);
+ }
+ }
+
+ public static string DescriptionKeyWordNameFirstPointYValue
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionKeyWordNameFirstPointYValue);
+ }
+ }
+
+ public static string DescriptionNumberFormatTypeCurrency
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionNumberFormatTypeCurrency);
+ }
+ }
+
+ public static string DescriptionNumberFormatTypeDecimal
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionNumberFormatTypeDecimal);
+ }
+ }
+
+ public static string DescriptionNumberFormatTypeScientific
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionNumberFormatTypeScientific);
+ }
+ }
+
+ public static string DescriptionNumberFormatTypeFixedPoint
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionNumberFormatTypeFixedPoint);
+ }
+ }
+
+ public static string DescriptionNumberFormatTypeGeneral
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionNumberFormatTypeGeneral);
+ }
+ }
+
+ public static string DescriptionNumberFormatTypeNumber
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionNumberFormatTypeNumber);
+ }
+ }
+
+ public static string DescriptionNumberFormatTypePercent
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionNumberFormatTypePercent);
+ }
+ }
+
+ public static string DescriptionTypeNone
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionTypeNone);
+ }
+ }
+
+ public static string DescriptionTypeCustom
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionTypeCustom);
+ }
+ }
+
+ public static string DescriptionTypeEmpty
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionTypeEmpty);
+ }
+ }
+
+ public static string DescriptionTypePoint
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionTypePoint);
+ }
+ }
+
+ public static string LabelKeyFormat
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelKeyFormat);
+ }
+ }
+
+ public static string LabelKeyCustomFormat
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelKeyCustomFormat);
+ }
+ }
+
+ public static string LabelStringWithKeywords
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStringWithKeywords);
+ }
+ }
+
+ public static string LabelEditKeyword
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelEditKeyword);
+ }
+ }
+
+ public static string LabelInsertNewKeyword
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelInsertNewKeyword);
+ }
+ }
+
+ public static string LabelStringKeywordsEditor
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStringKeywordsEditor);
+ }
+ }
+
+ public static string LabelKeywordEditor
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelKeywordEditor);
+ }
+ }
+
+ public static string LabelDescription
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelDescription);
+ }
+ }
+
+ public static string LabelFormatKeySample
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelFormatKeySample);
+ }
+ }
+
+ public static string LabelKeyYValueIndex
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelKeyYValueIndex);
+ }
+ }
+
+ public static string LabelKeyPrecision
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelKeyPrecision);
+ }
+ }
+
+ public static string LabelKeyKeywords
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelKeyKeywords);
+ }
+ }
+
+ public static string LabelValueFormatting
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelValueFormatting);
+ }
+ }
+
+ public static string LabelButtonOk
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelButtonOk);
+ }
+ }
+
+ public static string LabelButtonCancel
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelButtonCancel);
+ }
+ }
+
+ public static string DescriptionToolTipCustomFormatCharacters
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionToolTipCustomFormatCharacters);
+ }
+ }
+
+ public static string DesciptionCustomLabelEditorTitle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DesciptionCustomLabelEditorTitle);
+ }
+ }
+
+ public static string DesciptionCustomLabelFormatInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.DesciptionCustomLabelFormatInvalid);
+ }
+ }
+
+ public static string LabelStatisticalSumOfSquaresBetweenGroups
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalSumOfSquaresBetweenGroups);
+ }
+ }
+
+ public static string LabelStatisticalSumOfSquaresWithinGroups
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalSumOfSquaresWithinGroups);
+ }
+ }
+
+ public static string LabelStatisticalSumOfSquaresTotal
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalSumOfSquaresTotal);
+ }
+ }
+
+ public static string LabelStatisticalDegreesOfFreedomBetweenGroups
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalDegreesOfFreedomBetweenGroups);
+ }
+ }
+
+ public static string LabelStatisticalDegreesOfFreedomWithinGroups
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalDegreesOfFreedomWithinGroups);
+ }
+ }
+
+ public static string LabelStatisticalDegreesOfFreedomTotal
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalDegreesOfFreedomTotal);
+ }
+ }
+
+ public static string LabelStatisticalMeanSquareVarianceBetweenGroups
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalMeanSquareVarianceBetweenGroups);
+ }
+ }
+
+ public static string LabelStatisticalMeanSquareVarianceWithinGroups
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalMeanSquareVarianceWithinGroups);
+ }
+ }
+
+ public static string LabelStatisticalFRatio
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalFRatio);
+ }
+ }
+
+ public static string LabelStatisticalFCriteria
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalFCriteria);
+ }
+ }
+
+ public static string LabelStatisticalCorrelation
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalCorrelation);
+ }
+ }
+
+ public static string LabelStatisticalCovariance
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalCovariance);
+ }
+ }
+
+ public static string LabelStatisticalProbability
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalProbability);
+ }
+ }
+
+ public static string LabelStatisticalAverage
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalAverage);
+ }
+ }
+
+ public static string LabelStatisticalVariance
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalVariance);
+ }
+ }
+
+ public static string LabelStatisticalMedian
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalMedian);
+ }
+ }
+
+ public static string LabelStatisticalBetaFunction
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalBetaFunction);
+ }
+ }
+
+ public static string LabelStatisticalGammaFunction
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalGammaFunction);
+ }
+ }
+
+ public static string LabelStatisticalTheFirstGroupMean
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalTheFirstGroupMean);
+ }
+ }
+
+ public static string LabelStatisticalTheSecondGroupMean
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalTheSecondGroupMean);
+ }
+ }
+
+ public static string LabelStatisticalTheFirstGroupVariance
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalTheFirstGroupVariance);
+ }
+ }
+
+ public static string LabelStatisticalTheSecondGroupVariance
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalTheSecondGroupVariance);
+ }
+ }
+
+ public static string LabelStatisticalFValue
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalFValue);
+ }
+ }
+
+ public static string LabelStatisticalFCriticalValueOneTail
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalFCriticalValueOneTail);
+ }
+ }
+
+ public static string LabelStatisticalZValue
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalZValue);
+ }
+ }
+
+ public static string LabelStatisticalZCriticalValueOneTail
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalZCriticalValueOneTail);
+ }
+ }
+
+ public static string LabelStatisticalZCriticalValueTwoTail
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalZCriticalValueTwoTail);
+ }
+ }
+
+ public static string LabelStatisticalPZLessEqualSmallZOneTail
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalPZLessEqualSmallZOneTail);
+ }
+ }
+
+ public static string LabelStatisticalPZLessEqualSmallZTwoTail
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalPZLessEqualSmallZTwoTail);
+ }
+ }
+
+ public static string LabelStatisticalPFLessEqualSmallFOneTail
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalPFLessEqualSmallFOneTail);
+ }
+ }
+
+ public static string LabelStatisticalTValue
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalTValue);
+ }
+ }
+
+ public static string LabelStatisticalDegreeOfFreedom
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalDegreeOfFreedom);
+ }
+ }
+
+ public static string LabelStatisticalPTLessEqualSmallTOneTail
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalPTLessEqualSmallTOneTail);
+ }
+ }
+
+ public static string LabelStatisticalSmallTCrititcalOneTail
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalSmallTCrititcalOneTail);
+ }
+ }
+
+ public static string LabelStatisticalPTLessEqualSmallTTwoTail
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalPTLessEqualSmallTTwoTail);
+ }
+ }
+
+ public static string LabelStatisticalSmallTCrititcalTwoTail
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelStatisticalSmallTCrititcalTwoTail);
+ }
+ }
+
+ public static string MessagePrecisionInvalid
+ {
+ get
+ {
+ return Keys.GetString(Keys.MessagePrecisionInvalid);
+ }
+ }
+
+ public static string MessageChangingChartAreaPositionProperty
+ {
+ get
+ {
+ return Keys.GetString(Keys.MessageChangingChartAreaPositionProperty);
+ }
+ }
+
+ public static string MessageChangingChartAreaPositionConfirmAutomatic
+ {
+ get
+ {
+ return Keys.GetString(Keys.MessageChangingChartAreaPositionConfirmAutomatic);
+ }
+ }
+
+ public static string MessageChangingChartAreaPositionConfirmCustom
+ {
+ get
+ {
+ return Keys.GetString(Keys.MessageChangingChartAreaPositionConfirmCustom);
+ }
+ }
+
+ public static string MessageChartException
+ {
+ get
+ {
+ return Keys.GetString(Keys.MessageChartException);
+ }
+ }
+
+ public static string MessageSite
+ {
+ get
+ {
+ return Keys.GetString(Keys.MessageSite);
+ }
+ }
+
+ public static string MessageStackTrace
+ {
+ get
+ {
+ return Keys.GetString(Keys.MessageStackTrace);
+ }
+ }
+
+ public static string MessageChartTitle
+ {
+ get
+ {
+ return Keys.GetString(Keys.MessageChartTitle);
+ }
+ }
+
+ public static string TitleAxisX
+ {
+ get
+ {
+ return Keys.GetString(Keys.TitleAxisX);
+ }
+ }
+
+ public static string TitleAxisY
+ {
+ get
+ {
+ return Keys.GetString(Keys.TitleAxisY);
+ }
+ }
+
+ public static string TitleAxisX2
+ {
+ get
+ {
+ return Keys.GetString(Keys.TitleAxisX2);
+ }
+ }
+
+ public static string TitleAxisY2
+ {
+ get
+ {
+ return Keys.GetString(Keys.TitleAxisY2);
+ }
+ }
+
+ public static string FormulaNamePriceIndicators
+ {
+ get
+ {
+ return Keys.GetString(Keys.FormulaNamePriceIndicators);
+ }
+ }
+
+ public static string FormulaNameGeneralTechnicalIndicators
+ {
+ get
+ {
+ return Keys.GetString(Keys.FormulaNameGeneralTechnicalIndicators);
+ }
+ }
+
+ public static string FormulaNameTechnicalVolumeIndicators
+ {
+ get
+ {
+ return Keys.GetString(Keys.FormulaNameTechnicalVolumeIndicators);
+ }
+ }
+
+ public static string FormulaNameOscillator
+ {
+ get
+ {
+ return Keys.GetString(Keys.FormulaNameOscillator);
+ }
+ }
+
+ public static string FormulaNameGeneralFormulas
+ {
+ get
+ {
+ return Keys.GetString(Keys.FormulaNameGeneralFormulas);
+ }
+ }
+
+ public static string FormulaNameTimeSeriesAndForecasting
+ {
+ get
+ {
+ return Keys.GetString(Keys.FormulaNameTimeSeriesAndForecasting);
+ }
+ }
+
+ public static string FormulaNameStatisticalAnalysis
+ {
+ get
+ {
+ return Keys.GetString(Keys.FormulaNameStatisticalAnalysis);
+ }
+ }
+
+ public static string FormulaNameVolumeIndicators
+ {
+ get
+ {
+ return Keys.GetString(Keys.FormulaNameVolumeIndicators);
+ }
+ }
+
+ public static string LabelTextRow
+ {
+ get
+ {
+ return Keys.GetString(Keys.LabelTextRow);
+ }
+ }
+
+ public static string DescriptionAttributeBackImage
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeBackImage);
+ }
+ }
+
+ public static string DescriptionAttributeMarkerImage
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMarkerImage);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotationBaseY
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotationBaseY);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotationWidth
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotationWidth);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotationHeight
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotationHeight);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotationClipToChartArea
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotationClipToChartArea);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotationBaseX
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotationBaseX);
+ }
+ }
+
+ public static string DescriptionAttributeChartImageType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartImageType);
+ }
+ }
+
+ public static string DescriptionAttributeMultiValueSeparator
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMultiValueSeparator);
+ }
+ }
+
+ public static string DescriptionAttributeDataSeriesGroupID
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeDataSeriesGroupID);
+ }
+ }
+
+ public static string DescriptionAttributeSuppressCodeExceptions
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSuppressCodeExceptions);
+ }
+ }
+
+ public static string DescriptionAttributeNoDataMessage
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeNoDataMessage);
+ }
+ }
+
+ public static string DescriptionAttributeReverseSeriesOrder
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeReverseSeriesOrder);
+ }
+ }
+
+ public static string DescriptionAttributeUserDefined
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeUserDefined);
+ }
+ }
+
+ public static string DescriptionAttributeChartEvent_GetToolTipText
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartEvent_GetToolTipText);
+ }
+ }
+
+ public static string DescriptionAttributeArrowAnnotation_ArrowSize
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeArrowAnnotation_ArrowSize);
+ }
+ }
+
+ public static string DescriptionAttributeChartSerializer_Content
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartSerializer_Content);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_Enabled
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_Enabled);
+ }
+ }
+
+ public static string DescriptionAttributeEnabled5
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeEnabled5);
+ }
+ }
+
+ public static string DescriptionAttributeAxisScaleBreakStyle_Enabled
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisScaleBreakStyle_Enabled);
+ }
+ }
+
+ public static string DescriptionAttributeEnabled7
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeEnabled7);
+ }
+ }
+
+ public static string DescriptionAttributeLabel_Enabled
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLabel_Enabled);
+ }
+ }
+
+ public static string DescriptionAttributeLegendItem_Enabled
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendItem_Enabled);
+ }
+ }
+
+ public static string DescriptionAttributeAxisScrollBar_Enabled
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisScrollBar_Enabled);
+ }
+ }
+
+ public static string DescriptionAttributeEnabled13
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeEnabled13);
+ }
+ }
+
+ public static string DescriptionAttributeSeries_Enabled
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSeries_Enabled);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCell_CellSpan
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCell_CellSpan);
+ }
+ }
+
+ public static string DescriptionAttributeCursor_SelectionColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCursor_SelectionColor);
+ }
+ }
+
+ public static string DescriptionAttributeInterlaced
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeInterlaced);
+ }
+ }
+
+ public static string DescriptionAttributeMapArea_Coordinates
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMapArea_Coordinates);
+ }
+ }
+
+ public static string DescriptionAttributeChartEvent_PostPaint
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartEvent_PostPaint);
+ }
+ }
+
+ public static string DescriptionAttributeStripLine_Title
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeStripLine_Title);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_Title
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_Title);
+ }
+ }
+
+ public static string DescriptionAttributeTitle5
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTitle5);
+ }
+ }
+
+ public static string DescriptionAttributeTitle6
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTitle6);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotation_Annotation
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotation_Annotation);
+ }
+ }
+
+ public static string DescriptionAttributeTitleFont
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTitleFont);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea_Axes
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea_Axes);
+ }
+ }
+
+ public static string DescriptionAttributeChartSerializer_NonSerializableContent
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartSerializer_NonSerializableContent);
+ }
+ }
+
+ public static string DescriptionAttributeShadowOffset
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeShadowOffset);
+ }
+ }
+
+ public static string DescriptionAttributeCalloutLineAnchorCap
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCalloutLineAnchorCap);
+ }
+ }
+
+ public static string DescriptionAttributeMapAreaAttributes
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMapAreaAttributes);
+ }
+ }
+
+ public static string DescriptionAttributeSubAxis_SubAxis
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSubAxis_SubAxis);
+ }
+ }
+
+ public static string DescriptionAttributeMajorGrid
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMajorGrid);
+ }
+ }
+
+ public static string DescriptionAttributeElementPosition_Y
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeElementPosition_Y);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotationPathPoint_Y
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotationPathPoint_Y);
+ }
+ }
+
+ public static string DescriptionAttributeToolTipEventArgs_Y
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeToolTipEventArgs_Y);
+ }
+ }
+
+ public static string DescriptionAttributePoint3D_Y
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributePoint3D_Y);
+ }
+ }
+
+ public static string DescriptionAttributePoint3D_Z
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributePoint3D_Z);
+ }
+ }
+
+ public static string DescriptionAttributeMajorTickMark
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMajorTickMark);
+ }
+ }
+
+ public static string DescriptionAttributeDrawInfinitive
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeDrawInfinitive);
+ }
+ }
+
+ public static string DescriptionAttributeAxisDataView_MinSize
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisDataView_MinSize);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCellColumnCollection_LegendCellColumnCollection
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCellColumnCollection_LegendCellColumnCollection);
+ }
+ }
+
+ public static string DescriptionAttributeMarkerOverlapping
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMarkerOverlapping);
+ }
+ }
+
+ public static string DescriptionAttributeChart_OnCustomizeLegend
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChart_OnCustomizeLegend);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCellColumn_HeaderTextAlignment
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCellColumn_HeaderTextAlignment);
+ }
+ }
+
+ public static string DescriptionAttributeScrollBarEventArgs_MousePositionY
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeScrollBarEventArgs_MousePositionY);
+ }
+ }
+
+ public static string DescriptionAttributeNamedImage_NamedImage
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeNamedImage_NamedImage);
+ }
+ }
+
+ public static string DescriptionAttributeScrollBar
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeScrollBar);
+ }
+ }
+
+ public static string DescriptionAttributeMapArea_MapArea
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMapArea_MapArea);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_CustomItems
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_CustomItems);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotationSmartLabelsStyle_AnnotationSmartLabelsStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotationSmartLabelsStyle_AnnotationSmartLabelsStyle);
+ }
+ }
+
+ public static string DescriptionAttributePolylineAnnotation_PolylineAnnotation
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributePolylineAnnotation_PolylineAnnotation);
+ }
+ }
+
+ public static string DescriptionAttributeChartEvent_AxisViewChanged
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartEvent_AxisViewChanged);
+ }
+ }
+
+ public static string DescriptionAttributeCrossing
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCrossing);
+ }
+ }
+
+ public static string DescriptionAttributeMargins_Top
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMargins_Top);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCellColumn_HeaderFont
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCellColumn_HeaderFont);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_InterlacedRows
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_InterlacedRows);
+ }
+ }
+
+ public static string DescriptionAttributeAxisDataView_MinSizeType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisDataView_MinSizeType);
+ }
+ }
+
+ public static string DescriptionAttributeLineWidth
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLineWidth);
+ }
+ }
+
+ public static string DescriptionAttributeDataPoint_XValue
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeDataPoint_XValue);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea_AxisY2
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea_AxisY2);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea_AxisX2
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea_AxisX2);
+ }
+ }
+
+ public static string DescriptionAttributeChartEvent_AnnotationPositionChanging
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartEvent_AnnotationPositionChanging);
+ }
+ }
+
+ public static string DescriptionAttributeStripLine_StripLine
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeStripLine_StripLine);
+ }
+ }
+
+ public static string DescriptionAttributeBorderColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeBorderColor);
+ }
+ }
+
+ public static string DescriptionAttributeMarkerBorderColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMarkerBorderColor);
+ }
+ }
+
+ public static string DescriptionAttributeLegendText
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendText);
+ }
+ }
+
+ public static string DescriptionAttributeCustomLabel_LabelMark
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCustomLabel_LabelMark);
+ }
+ }
+
+ public static string DescriptionAttributeTextAntiAliasingQuality
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTextAntiAliasingQuality);
+ }
+ }
+
+ public static string DescriptionAttributeAllowMoving
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAllowMoving);
+ }
+ }
+
+ public static string DescriptionAttributeCalloutAnnotation_CalloutAnnotation
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCalloutAnnotation_CalloutAnnotation);
+ }
+ }
+
+ public static string DescriptionAttributeStripLine_Name
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeStripLine_Name);
+ }
+ }
+
+ public static string DescriptionAttributeTitle_Name
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTitle_Name);
+ }
+ }
+
+ public static string DescriptionAttributeName4
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeName4);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotationPathPoint_Name
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotationPathPoint_Name);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCell_Name
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCell_Name);
+ }
+ }
+
+ public static string DescriptionAttributeMapArea_Name
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMapArea_Name);
+ }
+ }
+
+ public static string DescriptionAttributeSeries_Name
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSeries_Name);
+ }
+ }
+
+ public static string DescriptionAttributeAxis_Name
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxis_Name);
+ }
+ }
+
+ public static string DescriptionAttributeNamedImage_Name
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeNamedImage_Name);
+ }
+ }
+
+ public static string DescriptionAttributeSubAxis_Name
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSubAxis_Name);
+ }
+ }
+
+ public static string DescriptionAttributeDataPoint_Name
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeDataPoint_Name);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCellColumn_Name
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCellColumn_Name);
+ }
+ }
+
+ public static string DescriptionAttributeLegendItem_Name
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendItem_Name);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_Name
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_Name);
+ }
+ }
+
+ public static string DescriptionAttributeCustomLabel_Name
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCustomLabel_Name);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea_Name
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea_Name);
+ }
+ }
+
+ public static string DescriptionAttributeCursor_Cursor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCursor_Cursor);
+ }
+ }
+
+ public static string DescriptionAttributeAnchorX
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnchorX);
+ }
+ }
+
+ public static string DescriptionAttributeToolTip
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeToolTip);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_TableStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_TableStyle);
+ }
+ }
+
+ public static string DescriptionAttributeDataPoint_Empty
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeDataPoint_Empty);
+ }
+ }
+
+ public static string DescriptionAttributeScrollBarEventArgs_Handled
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeScrollBarEventArgs_Handled);
+ }
+ }
+
+ public static string DescriptionAttributeAxisLabel
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisLabel);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotationGroup_AllowPathEditing
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotationGroup_AllowPathEditing);
+ }
+ }
+
+ public static string DescriptionAttributeAllowPathEditing3
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAllowPathEditing3);
+ }
+ }
+
+ public static string DescriptionAttributeChart_OnPaint
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChart_OnPaint);
+ }
+ }
+
+ public static string DescriptionAttributeCalloutAnnotation_AnchorOffsetX
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCalloutAnnotation_AnchorOffsetX);
+ }
+ }
+
+ public static string DescriptionAttributeAnchorOffsetX3
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnchorOffsetX3);
+ }
+ }
+
+ public static string DescriptionAttributeCalloutAnnotation_AnchorOffsetY
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCalloutAnnotation_AnchorOffsetY);
+ }
+ }
+
+ public static string DescriptionAttributeAnchorOffsetY3
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnchorOffsetY3);
+ }
+ }
+
+ public static string DescriptionAttributeChartEvent_CursorPositionChanging
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartEvent_CursorPositionChanging);
+ }
+ }
+
+ public static string DescriptionAttributeScrollBarEventArgs_ButtonType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeScrollBarEventArgs_ButtonType);
+ }
+ }
+
+ public static string DescriptionAttributeLabelsAutoFitStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLabelsAutoFitStyle);
+ }
+ }
+
+ public static string DescriptionAttributeLabelStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLabelStyle);
+ }
+ }
+
+ public static string DescriptionAttributeStripLine_IntervalOffsetType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeStripLine_IntervalOffsetType);
+ }
+ }
+
+ public static string DescriptionAttributeLabel_IntervalOffsetType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLabel_IntervalOffsetType);
+ }
+ }
+
+ public static string DescriptionAttributeIntervalOffsetType4
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeIntervalOffsetType4);
+ }
+ }
+
+ public static string DescriptionAttributeCursor_IntervalOffsetType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCursor_IntervalOffsetType);
+ }
+ }
+
+ public static string DescriptionAttributeIntervalOffsetType6
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeIntervalOffsetType6);
+ }
+ }
+
+ public static string DescriptionAttributeAxisScaleSegment_IntervalOffsetType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisScaleSegment_IntervalOffsetType);
+ }
+ }
+
+ public static string DescriptionAttributeReverse
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeReverse);
+ }
+ }
+
+ public static string DescriptionAttributeSeries_Points
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSeries_Points);
+ }
+ }
+
+ public static string DescriptionAttributeBorderSkin_SkinStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeBorderSkin_SkinStyle);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea3DStyle_Clustered
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea3DStyle_Clustered);
+ }
+ }
+
+ public static string DescriptionAttributeAnchorDataPointName
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnchorDataPointName);
+ }
+ }
+
+ public static string DescriptionAttributeChartEvent_AnnotationPositionChanged
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartEvent_AnnotationPositionChanged);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea3DStyle_PointGapDepth
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea3DStyle_PointGapDepth);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_Reversed
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_Reversed);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotation_AnnotationType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotation_AnnotationType);
+ }
+ }
+
+ public static string DescriptionAttributeTextAnnotation_AnnotationType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTextAnnotation_AnnotationType);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotationType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotationType);
+ }
+ }
+
+ public static string DescriptionAttributeBorderSkin_FrameBorderDashStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeBorderSkin_FrameBorderDashStyle);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_HeaderSeparatorColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_HeaderSeparatorColor);
+ }
+ }
+
+ public static string DescriptionAttributeChartEvent_AnnotationSelectionChanged
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartEvent_AnnotationSelectionChanged);
+ }
+ }
+
+ public static string DescriptionAttributeFont
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeFont);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_Font
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_Font);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCellColumn_Font
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCellColumn_Font);
+ }
+ }
+
+ public static string DescriptionAttributeLabel_Font
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLabel_Font);
+ }
+ }
+
+ public static string DescriptionAttributeTitle_Font
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTitle_Font);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCell_Font
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCell_Font);
+ }
+ }
+
+ public static string DescriptionAttributeSeries_ValueMemberX
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSeries_ValueMemberX);
+ }
+ }
+
+ public static string DescriptionAttributeArrows
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeArrows);
+ }
+ }
+
+ public static string DescriptionAttributeType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeType);
+ }
+ }
+
+ public static string DescriptionAttributeSeries_Type
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSeries_Type);
+ }
+ }
+
+ public static string DescriptionAttributeBorder3DAnnotation_Border3DAnnotation
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeBorder3DAnnotation_Border3DAnnotation);
+ }
+ }
+
+ public static string DescriptionAttributeChart_Images
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChart_Images);
+ }
+ }
+
+ public static string DescriptionAttributeLegendToolTip
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendToolTip);
+ }
+ }
+
+ public static string DescriptionAttributeCustomLabel_CustomLabel
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCustomLabel_CustomLabel);
+ }
+ }
+
+ public static string DescriptionAttributeChartEvent_AnnotationPlaced
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartEvent_AnnotationPlaced);
+ }
+ }
+
+ public static string DescriptionAttributeBackColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeBackColor);
+ }
+ }
+
+ public static string DescriptionAttributeCalloutBackColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCalloutBackColor);
+ }
+ }
+
+ public static string DescriptionAttributeFrameBackColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeFrameBackColor);
+ }
+ }
+
+ public static string DescriptionAttributeTitleBackColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTitleBackColor);
+ }
+ }
+
+ public static string DescriptionAttributeLabelBackColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLabelBackColor);
+ }
+ }
+
+ public static string DescriptionAttributeHeaderBackColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeHeaderBackColor);
+ }
+ }
+
+ public static string DescriptionAttributeLabel_ShowEndLabels
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLabel_ShowEndLabels);
+ }
+ }
+
+ public static string DescriptionAttributeLabelToolTip
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLabelToolTip);
+ }
+ }
+
+ public static string DescriptionAttributeSeries_MarkerStep
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSeries_MarkerStep);
+ }
+ }
+
+ public static string DescriptionAttributeTickMark_Style
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTickMark_Style);
+ }
+ }
+
+ public static string DescriptionAttribute_TextOrientation
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttribute_TextOrientation);
+ }
+ }
+
+ public static string DescriptionAttributeLegendItem_Style
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendItem_Style);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea3DStyle_Rotation
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea3DStyle_Rotation);
+ }
+ }
+
+ public static string DescriptionAttributeSizeAlwaysRelative
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSizeAlwaysRelative);
+ }
+ }
+
+ public static string DescriptionAttributeSizeAlwaysRelative3
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSizeAlwaysRelative3);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotationGroup_SizeAlwaysRelative
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotationGroup_SizeAlwaysRelative);
+ }
+ }
+
+ public static string DescriptionAttributeChart_BorderlineWidth
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChart_BorderlineWidth);
+ }
+ }
+
+ public static string DescriptionAttributeSeries_XValueIndexed
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSeries_XValueIndexed);
+ }
+ }
+
+ public static string DescriptionAttributeEllipseAnnotation_EllipseAnnotation
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeEllipseAnnotation_EllipseAnnotation);
+ }
+ }
+
+ public static string DescriptionAttributeAnchorAlignment
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnchorAlignment);
+ }
+ }
+
+ public static string DescriptionAttributeWidth
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeWidth);
+ }
+ }
+
+ public static string DescriptionAttributeElementPosition_Width
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeElementPosition_Width);
+ }
+ }
+
+ public static string DescriptionAttributeAxisXName
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisXName);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea3DStyle_Inclination
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea3DStyle_Inclination);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCollection_LegendCollection
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCollection_LegendCollection);
+ }
+ }
+
+ public static string DescriptionAttributeAxisYName
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisYName);
+ }
+ }
+
+ public static string DescriptionAttributeAxisScaleSegment_Spacing
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisScaleSegment_Spacing);
+ }
+ }
+
+ public static string DescriptionAttributeAxisScaleBreakStyle_Spacing
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisScaleBreakStyle_Spacing);
+ }
+ }
+
+ public static string DescriptionAttributeSelected
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSelected);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotationGroup_Selected
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotationGroup_Selected);
+ }
+ }
+
+ public static string DescriptionAttributeVerticalLineAnnotation_VerticalLineAnnotation
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeVerticalLineAnnotation_VerticalLineAnnotation);
+ }
+ }
+
+ public static string DescriptionAttributeLabelsAutoFitMaxFontSize
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLabelsAutoFitMaxFontSize);
+ }
+ }
+
+ public static string DescriptionAttributeFreeDrawPlacement
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeFreeDrawPlacement);
+ }
+ }
+
+ public static string DescriptionAttributeStripLinesCollection_StripLinesCollection
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeStripLinesCollection_StripLinesCollection);
+ }
+ }
+
+ public static string DescriptionAttributeAxisDataView_IsZoomed
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisDataView_IsZoomed);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea3DStyle_Perspective
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea3DStyle_Perspective);
+ }
+ }
+
+ public static string DescriptionAttributeChart_OnCustomize
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChart_OnCustomize);
+ }
+ }
+
+ public static string DescriptionAttributeLabel
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLabel);
+ }
+ }
+
+ public static string DescriptionAttributeLabel_Label
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLabel_Label);
+ }
+ }
+
+ public static string DescriptionAttributeStartCap3
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeStartCap3);
+ }
+ }
+
+ public static string DescriptionAttributeFontColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeFontColor);
+ }
+ }
+
+ public static string DescriptionAttributeLegendFontColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendFontColor);
+ }
+ }
+
+ public static string DescriptionAttributeLabel_OffsetLabels
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLabel_OffsetLabels);
+ }
+ }
+
+ public static string DescriptionAttributeMargin
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMargin);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotationPositionChangingEventArgs_AnnotationPositionChangingEventArgs
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotationPositionChangingEventArgs_AnnotationPositionChangingEventArgs);
+ }
+ }
+
+ public static string DescriptionAttributeCursorEventArgs_NewSelectionStart
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCursorEventArgs_NewSelectionStart);
+ }
+ }
+
+ public static string DescriptionAttributeSeries_XSubAxisName
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSeries_XSubAxisName);
+ }
+ }
+
+ public static string DescriptionAttributeHideOverlapped
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeHideOverlapped);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCellColumn_MaximumWidth
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCellColumn_MaximumWidth);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_InsideChartArea
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_InsideChartArea);
+ }
+ }
+
+ public static string DescriptionAttributeImageTransparentColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeImageTransparentColor);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_EquallySpacedItems
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_EquallySpacedItems);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea_CursorY
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea_CursorY);
+ }
+ }
+
+ public static string DescriptionAttributeChart_Printing
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChart_Printing);
+ }
+ }
+
+ public static string DescriptionAttributeAxis
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxis);
+ }
+ }
+
+ public static string DescriptionAttributeAxis_Axis
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxis_Axis);
+ }
+ }
+
+ public static string DescriptionAttributeBackImageAlign
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeBackImageAlign);
+ }
+ }
+
+ public static string DescriptionAttributeShowInLegend
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeShowInLegend);
+ }
+ }
+
+ public static string DescriptionAttributeChartSerializer_ChartSerializer
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartSerializer_ChartSerializer);
+ }
+ }
+
+ public static string DescriptionAttributeChart_Compression
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChart_Compression);
+ }
+ }
+
+ public static string DescriptionAttributeChartImage_Compression
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartImage_Compression);
+ }
+ }
+
+ public static string DescriptionAttributeCursor_AutoScroll
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCursor_AutoScroll);
+ }
+ }
+
+ public static string DescriptionAttributeElementPosition_Height
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeElementPosition_Height);
+ }
+ }
+
+ public static string DescriptionAttributeHeight3
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeHeight3);
+ }
+ }
+
+ public static string DescriptionAttributeChart_ViewStateContent
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChart_ViewStateContent);
+ }
+ }
+
+ public static string DescriptionAttributeAxisDataView_SmallScrollSizeType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisDataView_SmallScrollSizeType);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_CellColumns
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_CellColumns);
+ }
+ }
+
+ public static string DescriptionAttributeAxisScrollBar_Buttons
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisScrollBar_Buttons);
+ }
+ }
+
+ public static string DescriptionAttributeLegends
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegends);
+ }
+ }
+
+ public static string DescriptionAttributeElementPosition_X
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeElementPosition_X);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotationPathPoint_X
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotationPathPoint_X);
+ }
+ }
+
+ public static string DescriptionAttributePoint3D_X
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributePoint3D_X);
+ }
+ }
+
+ public static string DescriptionAttributeToolTipEventArgs_X
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeToolTipEventArgs_X);
+ }
+ }
+
+ public static string DescriptionAttributeCustomAttributesExtended
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCustomAttributesExtended);
+ }
+ }
+
+ public static string DescriptionAttributeMargins_Left
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMargins_Left);
+ }
+ }
+
+ public static string DescriptionAttributeAxisScrollBar_PositionInside
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisScrollBar_PositionInside);
+ }
+ }
+
+ public static string DescriptionAttributeSeries_ValueMembersY
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSeries_ValueMembersY);
+ }
+ }
+
+ public static string DescriptionAttributeSmartLabelsStyle_SmartLabelsStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSmartLabelsStyle_SmartLabelsStyle);
+ }
+ }
+
+ public static string DescriptionAttributeChartEvent_SelectionRangeChanging
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartEvent_SelectionRangeChanging);
+ }
+ }
+
+ public static string DescriptionAttributeLabelsAutoFitMinFontSize
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLabelsAutoFitMinFontSize);
+ }
+ }
+
+ public static string DescriptionAttributeMaxMovingDistance
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMaxMovingDistance);
+ }
+ }
+
+ public static string DescriptionAttributeTitle_DockToChartArea
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTitle_DockToChartArea);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_DockToChartArea
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_DockToChartArea);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea3DStyle_RightAngleAxes
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea3DStyle_RightAngleAxes);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_LegendStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_LegendStyle);
+ }
+ }
+
+ public static string DescriptionAttributeAxisDataView_AxisDataView
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisDataView_AxisDataView);
+ }
+ }
+
+ public static string DescriptionAttributeBorderDashStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeBorderDashStyle);
+ }
+ }
+
+ public static string DescriptionAttributeLabelBorderDashStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLabelBorderDashStyle);
+ }
+ }
+
+ public static string DescriptionAttributeBackSecondaryColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeBackSecondaryColor);
+ }
+ }
+
+ public static string DescriptionAttributeBorderSkin_FrameBackSecondaryColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeBorderSkin_FrameBackSecondaryColor);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_TitleSeparator
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_TitleSeparator);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea_InnerPlotPosition
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea_InnerPlotPosition);
+ }
+ }
+
+ public static string DescriptionAttributeChartEvent_CustomizeLegend
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartEvent_CustomizeLegend);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotationPathPoint_AnnotationPathPoint
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotationPathPoint_AnnotationPathPoint);
+ }
+ }
+
+ public static string DescriptionAttributeDataPoint_YValues
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeDataPoint_YValues);
+ }
+ }
+
+ public static string DescriptionAttributeCustomLabel_RowIndex
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCustomLabel_RowIndex);
+ }
+ }
+
+ public static string DescriptionAttributeSeries_YSubAxisName
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSeries_YSubAxisName);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea_AlignType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea_AlignType);
+ }
+ }
+
+ public static string DescriptionAttributeAllowResizing
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAllowResizing);
+ }
+ }
+
+ public static string DescriptionAttributeShowLabelAsValue
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeShowLabelAsValue);
+ }
+ }
+
+ public static string DescriptionAttributeForeColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeForeColor);
+ }
+ }
+
+ public static string DescriptionAttributePathPoints
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributePathPoints);
+ }
+ }
+
+ public static string DescriptionAttributeViewEventArgs_NewSizeType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeViewEventArgs_NewSizeType);
+ }
+ }
+
+ public static string DescriptionAttributeChart_BuildNumber
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChart_BuildNumber);
+ }
+ }
+
+ public static string DescriptionAttributeAxisScaleSegmentCollection_AxisScaleSegmentCollection
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisScaleSegmentCollection_AxisScaleSegmentCollection);
+ }
+ }
+
+ public static string DescriptionAttributeMarkerSize
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMarkerSize);
+ }
+ }
+
+ public static string DescriptionAttributeLegendItem_MarkerSize
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendItem_MarkerSize);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCell_SeriesSymbolSize
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCell_SeriesSymbolSize);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCellColumn_SeriesSymbolSize
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCellColumn_SeriesSymbolSize);
+ }
+ }
+
+ public static string DescriptionAttributeDisabled
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeDisabled);
+ }
+ }
+
+ public static string DescriptionAttributeChartSerializer_ResetWhenLoading
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartSerializer_ResetWhenLoading);
+ }
+ }
+
+ public static string DescriptionAttributeBackGradientStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeBackGradientStyle);
+ }
+ }
+
+ public static string DescriptionAttributeDataSource
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeDataSource);
+ }
+ }
+
+ public static string DescriptionAttributeCustomLabels
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCustomLabels);
+ }
+ }
+
+ public static string DescriptionAttributeArrowAnnotation_ArrowAnnotation
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeArrowAnnotation_ArrowAnnotation);
+ }
+ }
+
+ public static string DescriptionAttributeCursor_AxisType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCursor_AxisType);
+ }
+ }
+
+ public static string DescriptionAttributeLegendItem_Cells
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendItem_Cells);
+ }
+ }
+
+ public static string DescriptionAttributeBorderSkin
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeBorderSkin);
+ }
+ }
+
+ public static string DescriptionAttributeBorderSkin_BorderSkin
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeBorderSkin_BorderSkin);
+ }
+ }
+
+ public static string DescriptionAttributeSubAxisCollection_SubAxisCollection
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSubAxisCollection_SubAxisCollection);
+ }
+ }
+
+ public static string DescriptionAttributeAllowSelecting
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAllowSelecting);
+ }
+ }
+
+ public static string DescriptionAttributeChartEvent_Customize
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartEvent_Customize);
+ }
+ }
+
+ public static string DescriptionAttributeChartEvent_Click
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartEvent_Click);
+ }
+ }
+
+ public static string DescriptionAttributeImageAnnotation_ImageAnnotation
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeImageAnnotation_ImageAnnotation);
+ }
+ }
+
+ public static string DescriptionAttributeAxisDataView_SmallScrollSize
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisDataView_SmallScrollSize);
+ }
+ }
+
+ public static string DescriptionAttributeAxisScaleSegment_Interval
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisScaleSegment_Interval);
+ }
+ }
+
+ public static string DescriptionAttributeCursor_Interval
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCursor_Interval);
+ }
+ }
+
+ public static string DescriptionAttributeInterval4
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeInterval4);
+ }
+ }
+
+ public static string DescriptionAttributeStripLine_Interval
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeStripLine_Interval);
+ }
+ }
+
+ public static string DescriptionAttributeInterval6
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeInterval6);
+ }
+ }
+
+ public static string DescriptionAttributeLabel_Interval
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLabel_Interval);
+ }
+ }
+
+ public static string DescriptionAttributeStripLine_TitleLineAlignment
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeStripLine_TitleLineAlignment);
+ }
+ }
+
+ public static string DescriptionAttributeMaximum
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMaximum);
+ }
+ }
+
+ public static string DescriptionAttributeElementPosition_Auto
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeElementPosition_Auto);
+ }
+ }
+
+ public static string DescriptionAttributeSeries_YAxisType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSeries_YAxisType);
+ }
+ }
+
+ public static string DescriptionAttributeLineDashStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLineDashStyle);
+ }
+ }
+
+ public static string DescriptionAttributeLogarithmBase
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLogarithmBase);
+ }
+ }
+
+ public static string DescriptionAttributeAntiAlias
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAntiAlias);
+ }
+ }
+
+ public static string DescriptionAttributeImageWrapMode
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeImageWrapMode);
+ }
+ }
+
+ public static string DescriptionAttributeChartSerializer_IgnoreUnknownXmlAttributes
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartSerializer_IgnoreUnknownXmlAttributes);
+ }
+ }
+
+ public static string DescriptionAttributeAxisScaleSegment_Tag
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisScaleSegment_Tag);
+ }
+ }
+
+ public static string DescriptionAttributeTag
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTag);
+ }
+ }
+
+ public static string DescriptionAttributeLegend
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_Legend
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_Legend);
+ }
+ }
+
+ public static string DescriptionAttributeSeries_Legend
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSeries_Legend);
+ }
+ }
+
+ public static string DescriptionAttributeDataPointComparer_DataPointComparer
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeDataPointComparer_DataPointComparer);
+ }
+ }
+
+ public static string DescriptionAttributeBackHatchStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeBackHatchStyle);
+ }
+ }
+
+ public static string DescriptionAttributeFrameBackHatchStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeFrameBackHatchStyle);
+ }
+ }
+
+ public static string DescriptionAttributeChartAreaCollection_Item
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartAreaCollection_Item);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCollection_Item
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCollection_Item);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotationCollection_Item
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotationCollection_Item);
+ }
+ }
+
+ public static string DescriptionAttributeSubAxisCollection_Item
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSubAxisCollection_Item);
+ }
+ }
+
+ public static string DescriptionAttributeSeriesCollection_Item
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSeriesCollection_Item);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotationPathPointCollection_Item
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotationPathPointCollection_Item);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCellColumnCollection_Item
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCellColumnCollection_Item);
+ }
+ }
+
+ public static string DescriptionAttributeAxisScaleSegmentCollection_Item
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisScaleSegmentCollection_Item);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCellCollection_Item
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCellCollection_Item);
+ }
+ }
+
+ public static string DescriptionAttributeNamedImagesCollection_Item
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeNamedImagesCollection_Item);
+ }
+ }
+
+ public static string DescriptionAttributeAxisScaleSegment_ScaleMinimum
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisScaleSegment_ScaleMinimum);
+ }
+ }
+
+ public static string DescriptionAttributeSmartLabels
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSmartLabels);
+ }
+ }
+
+ public static string DescriptionAttributeSeries_SmartLabels
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSeries_SmartLabels);
+ }
+ }
+
+ public static string DescriptionAttributeSmartLabels_SmartLabels
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSmartLabels_SmartLabels);
+ }
+ }
+
+ public static string DescriptionAttributeMinorTickMark
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMinorTickMark);
+ }
+ }
+
+ public static string DescriptionAttributeMapAreasCollection_MapAreasCollection
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMapAreasCollection_MapAreasCollection);
+ }
+ }
+
+ public static string DescriptionAttributeMovingDirection
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMovingDirection);
+ }
+ }
+
+ public static string DescriptionAttributeCursor_UserSelection
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCursor_UserSelection);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea);
+ }
+ }
+
+ public static string DescriptionAttributeSeries_ChartArea
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSeries_ChartArea);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea_ChartArea
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea_ChartArea);
+ }
+ }
+
+ public static string DescriptionAttributeToolTipEventArgs_HitTestResult
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeToolTipEventArgs_HitTestResult);
+ }
+ }
+
+ public static string DescriptionAttributeAxisScaleSegment_AxisScaleSegment
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisScaleSegment_AxisScaleSegment);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_ItemColumnSeparatorColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_ItemColumnSeparatorColor);
+ }
+ }
+
+ public static string DescriptionAttributeDataManipulator
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeDataManipulator);
+ }
+ }
+
+ public static string DescriptionAttributeTitle_Color
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTitle_Color);
+ }
+ }
+
+ public static string DescriptionAttributeLegendItem_Color
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendItem_Color);
+ }
+ }
+
+ public static string DescriptionAttributeColor4
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeColor4);
+ }
+ }
+
+ public static string DescriptionAttributeMargins_Right
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMargins_Right);
+ }
+ }
+
+ public static string DescriptionAttributeRight3
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeRight3);
+ }
+ }
+
+ public static string DescriptionAttributeChart_OnBackPaint
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChart_OnBackPaint);
+ }
+ }
+
+ public static string DescriptionAttributeLineColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLineColor);
+ }
+ }
+
+ public static string DescriptionAttributeCalloutLineColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCalloutLineColor);
+ }
+ }
+
+ public static string DescriptionAttributeArrowAnnotation_ArrowStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeArrowAnnotation_ArrowStyle);
+ }
+ }
+
+ public static string DescriptionAttributeArrowStyle_ArrowStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeArrowStyle_ArrowStyle);
+ }
+ }
+
+ public static string DescriptionAttributeSeries_XValueType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSeries_XValueType);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotationGroup_Annotations
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotationGroup_Annotations);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotations3
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotations3);
+ }
+ }
+
+ public static string DescriptionAttributeMinorGrid
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMinorGrid);
+ }
+ }
+
+ public static string DescriptionAttributeMapArea_Custom
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMapArea_Custom);
+ }
+ }
+
+ public static string DescriptionAttributeChart_EnableViewState
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChart_EnableViewState);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea3DStyle_Enable3D
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea3DStyle_Enable3D);
+ }
+ }
+
+ public static string DescriptionAttributeInterlacedColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeInterlacedColor);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCellColumn_Margins
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCellColumn_Margins);
+ }
+ }
+
+ public static string DescriptionAttributeMargins_Margins
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMargins_Margins);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCell_Margins
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCell_Margins);
+ }
+ }
+
+ public static string DescriptionAttributeLegendItem_MarkerColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendItem_MarkerColor);
+ }
+ }
+
+ public static string DescriptionAttributeMarkerColor3
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMarkerColor3);
+ }
+ }
+
+ public static string DescriptionAttributeChart_Size
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChart_Size);
+ }
+ }
+
+ public static string DescriptionAttributeTickMark_Size
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTickMark_Size);
+ }
+ }
+
+ public static string DescriptionAttributeAxisScaleSegment_Size
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisScaleSegment_Size);
+ }
+ }
+
+ public static string DescriptionAttributeAxisDataView_Size
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisDataView_Size);
+ }
+ }
+
+ public static string DescriptionAttributeAxisScrollBar_Size
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisScrollBar_Size);
+ }
+ }
+
+ public static string DescriptionAttributeViewEventArgs_NewSize
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeViewEventArgs_NewSize);
+ }
+ }
+
+ public static string DescriptionAttributeSeries_XAxisType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSeries_XAxisType);
+ }
+ }
+
+ public static string DescriptionAttributeAllowOutsidePlotArea
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAllowOutsidePlotArea);
+ }
+ }
+
+ public static string DescriptionAttributeLegendItem_MarkerStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendItem_MarkerStyle);
+ }
+ }
+
+ public static string DescriptionAttributeMarkerStyle4
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMarkerStyle4);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCell_ImageSize
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCell_ImageSize);
+ }
+ }
+
+ public static string DescriptionAttributeView
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeView);
+ }
+ }
+
+ public static string DescriptionAttributeSeriesCollection_SeriesCollection
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSeriesCollection_SeriesCollection);
+ }
+ }
+
+ public static string DescriptionAttributeCursorEventArgs_NewPosition
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCursorEventArgs_NewPosition);
+ }
+ }
+
+ public static string DescriptionAttributeViewEventArgs_NewPosition
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeViewEventArgs_NewPosition);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCell_Image
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCell_Image);
+ }
+ }
+
+ public static string DescriptionAttributeNamedImage_Image
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeNamedImage_Image);
+ }
+ }
+
+ public static string DescriptionAttributeImageAnnotation_Image
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeImageAnnotation_Image);
+ }
+ }
+
+ public static string DescriptionAttributeLegendItem_Image
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendItem_Image);
+ }
+ }
+
+ public static string DescriptionAttributeCustomLabel_Image
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCustomLabel_Image);
+ }
+ }
+
+ public static string DescriptionAttributeAxisScaleSegment_IntervalOffset
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisScaleSegment_IntervalOffset);
+ }
+ }
+
+ public static string DescriptionAttributeIntervalOffset3
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeIntervalOffset3);
+ }
+ }
+
+ public static string DescriptionAttributeLabel_IntervalOffset
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLabel_IntervalOffset);
+ }
+ }
+
+ public static string DescriptionAttributeCursor_IntervalOffset
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCursor_IntervalOffset);
+ }
+ }
+
+ public static string DescriptionAttributeIntervalOffset6
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeIntervalOffset6);
+ }
+ }
+
+ public static string DescriptionAttributeStripLine_IntervalOffset
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeStripLine_IntervalOffset);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_DockInsideChartArea
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_DockInsideChartArea);
+ }
+ }
+
+ public static string DescriptionAttributeTitle_DockInsideChartArea
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTitle_DockInsideChartArea);
+ }
+ }
+
+ public static string DescriptionAttributeChart_RenderType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChart_RenderType);
+ }
+ }
+
+ public static string DescriptionAttributeAxisScaleBreakStyle_CollapsibleSpaceThreshold
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisScaleBreakStyle_CollapsibleSpaceThreshold);
+ }
+ }
+
+ public static string DescriptionAttributeChartEvent_AxisViewChanging
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartEvent_AxisViewChanging);
+ }
+ }
+
+ public static string DescriptionAttributeLabelCalloutStyle_LabelCalloutStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLabelCalloutStyle_LabelCalloutStyle);
+ }
+ }
+
+ public static string DescriptionAttributePath
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributePath);
+ }
+ }
+
+ public static string DescriptionAttributeLegendItem_SeriesPointIndex
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendItem_SeriesPointIndex);
+ }
+ }
+
+ public static string DescriptionAttributeMapAreas
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMapAreas);
+ }
+ }
+
+ public static string DescriptionAttributeTickMark_TickMark
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTickMark_TickMark);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCellColumn_LegendCellColumn
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCellColumn_LegendCellColumn);
+ }
+ }
+
+ public static string DescriptionAttributeLegendItem_LegendItem
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendItem_LegendItem);
+ }
+ }
+
+ public static string DescriptionAttributeTitleAlignment
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTitleAlignment);
+ }
+ }
+
+ public static string DescriptionAttributeStripLine_TitleAlignment
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeStripLine_TitleAlignment);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_TitleAlignment
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_TitleAlignment);
+ }
+ }
+
+ public static string DescriptionAttributeElementPosition_ElementPosition
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeElementPosition_ElementPosition);
+ }
+ }
+
+ public static string DescriptionAttributeCustomLabel_To
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCustomLabel_To);
+ }
+ }
+
+ public static string DescriptionAttributeLabel_FontAngle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLabel_FontAngle);
+ }
+ }
+
+ public static string DescriptionAttributeIntervalAutoMode
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeIntervalAutoMode);
+ }
+ }
+
+ public static string DescriptionAttributeStripLine_StripWidth
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeStripLine_StripWidth);
+ }
+ }
+
+ public static string DescriptionAttributeCursor_UserEnabled
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCursor_UserEnabled);
+ }
+ }
+
+ public static string DescriptionAttributeBorderSkin_FrameBorderWidth
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeBorderSkin_FrameBorderWidth);
+ }
+ }
+
+ public static string DescriptionAttributeAxisScaleSegment_Position
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisScaleSegment_Position);
+ }
+ }
+
+ public static string DescriptionAttributeAxisDataView_Position
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisDataView_Position);
+ }
+ }
+
+ public static string DescriptionAttributeTitle_Position
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTitle_Position);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_Position
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_Position);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea_Position
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea_Position);
+ }
+ }
+
+ public static string DescriptionAttributeCursor_Position
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCursor_Position);
+ }
+ }
+
+ public static string DescriptionAttributeSubAxis_ParentAxis
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSubAxis_ParentAxis);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotationCollectionEditor_AnnotationCollectionEditor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotationCollectionEditor_AnnotationCollectionEditor);
+ }
+ }
+
+ public static string DescriptionAttributeBottom
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeBottom);
+ }
+ }
+
+ public static string DescriptionAttributeMargins_Bottom
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMargins_Bottom);
+ }
+ }
+
+ public static string DescriptionAttributeAxisScaleBreakStyle_AxisScaleBreakStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisScaleBreakStyle_AxisScaleBreakStyle);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_HeaderSeparator
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_HeaderSeparator);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea3DStyle_PointDepth
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea3DStyle_PointDepth);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotationGroup_AnnotationGroup
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotationGroup_AnnotationGroup);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotationPathPointCollection_AnnotationPathPointCollection
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotationPathPointCollection_AnnotationPathPointCollection);
+ }
+ }
+
+ public static string DescriptionAttributeStripLine_StripWidthType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeStripLine_StripWidthType);
+ }
+ }
+
+ public static string DescriptionAttributeCustomLabel_From
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCustomLabel_From);
+ }
+ }
+
+ public static string DescriptionAttributePoint3D_PointF
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributePoint3D_PointF);
+ }
+ }
+
+ public static string DescriptionAttributeBorderWidth
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeBorderWidth);
+ }
+ }
+
+ public static string DescriptionAttributeMarkerBorderWidth
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMarkerBorderWidth);
+ }
+ }
+
+ public static string DescriptionAttributeCursor_SelectionEnd
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCursor_SelectionEnd);
+ }
+ }
+
+ public static string DescriptionAttributeLineAnnotation_LineAnnotation
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLineAnnotation_LineAnnotation);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotationSmartLabels_AnnotationSmartLabels
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotationSmartLabels_AnnotationSmartLabels);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotationGroup_Visible
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotationGroup_Visible);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea_Visible
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea_Visible);
+ }
+ }
+
+ public static string DescriptionAttributeTitle_Visible
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTitle_Visible);
+ }
+ }
+
+ public static string DescriptionAttributeVisible
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeVisible);
+ }
+ }
+
+ public static string DescriptionAttributeLegendItem_Separator
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendItem_Separator);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCell_CellType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCell_CellType);
+ }
+ }
+
+ public static string DescriptionAttributeChart_Serializer
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChart_Serializer);
+ }
+ }
+
+ public static string DescriptionAttributeAxisX
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisX);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea_AxisX
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea_AxisX);
+ }
+ }
+
+ public static string DescriptionAttributeImageType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeImageType);
+ }
+ }
+
+ public static string DescriptionAttributeCursor_SelectionStart
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCursor_SelectionStart);
+ }
+ }
+
+ public static string DescriptionAttributeLabelsAutoFit
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLabelsAutoFit);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCellColumn_HeaderText
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCellColumn_HeaderText);
+ }
+ }
+
+ public static string DescriptionAttributeMapEnabled
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMapEnabled);
+ }
+ }
+
+ public static string DescriptionAttributeAxisDataView_Zoomable
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisDataView_Zoomable);
+ }
+ }
+
+ public static string DescriptionAttributeDataManager_PaletteCustomColors
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeDataManager_PaletteCustomColors);
+ }
+ }
+
+ public static string DescriptionAttributeChart_PaletteCustomColors
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChart_PaletteCustomColors);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_ItemColumnSeparator
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_ItemColumnSeparator);
+ }
+ }
+
+ public static string DescriptionAttributeCursorEventArgs_NewSelectionEnd
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCursorEventArgs_NewSelectionEnd);
+ }
+ }
+
+ public static string DescriptionAttributeLegendItem_SeriesName
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendItem_SeriesName);
+ }
+ }
+
+ public static string DescriptionAttributeChartAreas
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartAreas);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea_AlignWithChartArea
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea_AlignWithChartArea);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_MaxAutoSize
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_MaxAutoSize);
+ }
+ }
+
+ public static string DescriptionAttributeAxis_MaxAutoSize
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxis_MaxAutoSize);
+ }
+ }
+
+ public static string DescriptionAttributeGrid_Grid
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeGrid_Grid);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea_EquallySizedAxesFont
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea_EquallySizedAxesFont);
+ }
+ }
+
+ public static string DescriptionAttributeChartEvent_CustomizeMapAreas
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartEvent_CustomizeMapAreas);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea3DStyle_WallWidth
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea3DStyle_WallWidth);
+ }
+ }
+
+ public static string DescriptionAttributeCustomLabel_Row
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCustomLabel_Row);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_TitleSeparatorColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_TitleSeparatorColor);
+ }
+ }
+
+ public static string DescriptionAttributeChartSerializer_TemplateMode
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartSerializer_TemplateMode);
+ }
+ }
+
+ public static string DescriptionAttributeShadowColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeShadowColor);
+ }
+ }
+
+ public static string DescriptionAttributeAxisScaleBreakStyle_MaxNumberOfBreaks
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisScaleBreakStyle_MaxNumberOfBreaks);
+ }
+ }
+
+ public static string DescriptionAttributeChartEvent_AxisScrollBarClicked
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartEvent_AxisScrollBarClicked);
+ }
+ }
+
+ public static string DescriptionAttributeAnchorY
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnchorY);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_AutoFitMinFontSize
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_AutoFitMinFontSize);
+ }
+ }
+
+ public static string DescriptionAttributeChartEvent_AnnotationTextChanged
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartEvent_AnnotationTextChanged);
+ }
+ }
+
+ public static string DescriptionAttributeChart_Series
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChart_Series);
+ }
+ }
+
+ public static string DescriptionAttributeSeries_Series
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSeries_Series);
+ }
+ }
+
+ public static string DescriptionAttributeMapArea_Shape
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMapArea_Shape);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_TextWrapThreshold
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_TextWrapThreshold);
+ }
+ }
+
+ public static string DescriptionAttributeLabelOutsidePlotAreaStyle_LabelOutsidePlotAreaStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLabelOutsidePlotAreaStyle_LabelOutsidePlotAreaStyle);
+ }
+ }
+
+ public static string DescriptionAttributeSubAxes
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSubAxes);
+ }
+ }
+
+ public static string DescriptionAttributeAxisScaleBreakStyle_StartFromZero
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisScaleBreakStyle_StartFromZero);
+ }
+ }
+
+ public static string DescriptionAttributeStartFromZero3
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeStartFromZero3);
+ }
+ }
+
+ public static string DescriptionAttributeRectangleAnnotation_RectangleAnnotation
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeRectangleAnnotation_RectangleAnnotation);
+ }
+ }
+
+ public static string DescriptionAttributeUrl
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeUrl);
+ }
+ }
+
+ public static string DescriptionAttributeAxisScaleBreakStyle_BreakLineType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisScaleBreakStyle_BreakLineType);
+ }
+ }
+
+ public static string DescriptionAttributeChartEvent_CursorPositionChanged
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartEvent_CursorPositionChanged);
+ }
+ }
+
+ public static string DescriptionAttributeChartSerializer_SerializableContent
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartSerializer_SerializableContent);
+ }
+ }
+
+ public static string DescriptionAttributeCalloutAnnotation_CalloutStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCalloutAnnotation_CalloutStyle);
+ }
+ }
+
+ public static string DescriptionAttributeCalloutStyle3
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCalloutStyle3);
+ }
+ }
+
+ public static string DescriptionAttributeCalloutStyle_CalloutStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCalloutStyle_CalloutStyle);
+ }
+ }
+
+ public static string DescriptionAttributeTitle_Docking
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTitle_Docking);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_Docking
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_Docking);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotationGroup_AllowAnchorMoving
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotationGroup_AllowAnchorMoving);
+ }
+ }
+
+ public static string DescriptionAttributeAllowAnchorMoving3
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAllowAnchorMoving3);
+ }
+ }
+
+ public static string DescriptionAttributeTitleColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTitleColor);
+ }
+ }
+
+ public static string DescriptionAttributeStripLine_TitleColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeStripLine_TitleColor);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_TitleColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_TitleColor);
+ }
+ }
+
+ public static string DescriptionAttributeTitles
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTitles);
+ }
+ }
+
+ public static string DescriptionAttributePolygonAnnotation_PolygonAnnotation
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributePolygonAnnotation_PolygonAnnotation);
+ }
+ }
+
+ public static string DescriptionAttributeLabel_IntervalType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLabel_IntervalType);
+ }
+ }
+
+ public static string DescriptionAttributeIntervalType3
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeIntervalType3);
+ }
+ }
+
+ public static string DescriptionAttributeIntervalType4
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeIntervalType4);
+ }
+ }
+
+ public static string DescriptionAttributeStripLine_IntervalType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeStripLine_IntervalType);
+ }
+ }
+
+ public static string DescriptionAttributeAxisScaleSegment_IntervalType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisScaleSegment_IntervalType);
+ }
+ }
+
+ public static string DescriptionAttributeCursor_IntervalType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCursor_IntervalType);
+ }
+ }
+
+ public static string DescriptionAttributeLegendItem_SeparatorColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendItem_SeparatorColor);
+ }
+ }
+
+ public static string DescriptionAttributeSeries_YValuesPerPoint
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSeries_YValuesPerPoint);
+ }
+ }
+
+ public static string DescriptionAttributeChartEvent_PrePaint
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartEvent_PrePaint);
+ }
+ }
+
+ public static string DescriptionAttributeLegendUrl
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendUrl);
+ }
+ }
+
+ public static string DescriptionAttributeCustomLabel_ImageUrl
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCustomLabel_ImageUrl);
+ }
+ }
+
+ public static string DescriptionAttributeLabel_Format
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLabel_Format);
+ }
+ }
+
+ public static string DescriptionAttributeChartSerializer_Format
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartSerializer_Format);
+ }
+ }
+
+ public static string DescriptionAttributeStripLines
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeStripLines);
+ }
+ }
+
+ public static string DescriptionAttributeChart_ViewStateData
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChart_ViewStateData);
+ }
+ }
+
+ public static string DescriptionAttributeTitle_DockOffset
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTitle_DockOffset);
+ }
+ }
+
+ public static string DescriptionAttributeAnchorDataPoint
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnchorDataPoint);
+ }
+ }
+
+ public static string DescriptionAttributeLabelFormat
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLabelFormat);
+ }
+ }
+
+ public static string DescriptionAttributeSuppressExceptions
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSuppressExceptions);
+ }
+ }
+
+ public static string DescriptionAttributeSeries_EmptyPointStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSeries_EmptyPointStyle);
+ }
+ }
+
+ public static string DescriptionAttributeCustomAttributes
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCustomAttributes);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCellCollection_LegendCellCollection
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCellCollection_LegendCellCollection);
+ }
+ }
+
+ public static string DescriptionAttributeCustomLabelsCollection_CustomLabelsCollection
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCustomLabelsCollection_CustomLabelsCollection);
+ }
+ }
+
+ public static string DescriptionAttributeCustomLabel_MarkColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCustomLabel_MarkColor);
+ }
+ }
+
+ public static string DescriptionAttributePalette
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributePalette);
+ }
+ }
+
+ public static string DescriptionAttributeScaleBreakStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeScaleBreakStyle);
+ }
+ }
+
+ public static string DescriptionAttributeChart_ImageUrl
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChart_ImageUrl);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_InterlacedRowsColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_InterlacedRowsColor);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCellColumn_ColumnType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCellColumn_ColumnType);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea_AlignOrientation
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea_AlignOrientation);
+ }
+ }
+
+ public static string DescriptionAttributeChart_SoftShadows
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChart_SoftShadows);
+ }
+ }
+
+ public static string DescriptionAttributeSoftShadows3
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSoftShadows3);
+ }
+ }
+
+ public static string DescriptionAttributePrintingManager_PrintDocument
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributePrintingManager_PrintDocument);
+ }
+ }
+
+ public static string DescriptionAttributeMinimum
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMinimum);
+ }
+ }
+
+ public static string DescriptionAttributeAxisScaleSegment_ScaleMaximum
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisScaleSegment_ScaleMaximum);
+ }
+ }
+
+ public static string DescriptionAttributeScrollBarEventArgs_MousePositionX
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeScrollBarEventArgs_MousePositionX);
+ }
+ }
+
+ public static string DescriptionAttributeLabel_TruncatedLabels
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLabel_TruncatedLabels);
+ }
+ }
+
+ public static string DescriptionAttributeCustomLabel_GridTicks
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCustomLabel_GridTicks);
+ }
+ }
+
+ public static string DescriptionAttributeImageAnnotation_Alignment
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeImageAnnotation_Alignment);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCellColumn_Alignment
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCellColumn_Alignment);
+ }
+ }
+
+ public static string DescriptionAttributeTitle_Alignment
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTitle_Alignment);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCell_Alignment
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCell_Alignment);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_Alignment
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_Alignment);
+ }
+ }
+
+ public static string DescriptionAttributeAlignment
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAlignment);
+ }
+ }
+
+ public static string DescriptionAttributeChart_OnCustomizeMapAreas
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChart_OnCustomizeMapAreas);
+ }
+ }
+
+ public static string DescriptionAttributeSubAxis_LocationOffset
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSubAxis_LocationOffset);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCellColumn_MinimumWidth
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCellColumn_MinimumWidth);
+ }
+ }
+
+ public static string DescriptionAttributeSelectionPointsStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSelectionPointsStyle);
+ }
+ }
+
+ public static string DescriptionAttributeAxisY
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisY);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea_AxisY
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea_AxisY);
+ }
+ }
+
+ public static string DescriptionAttributeTextFont
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTextFont);
+ }
+ }
+
+ public static string DescriptionAttributeTextFont4
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTextFont4);
+ }
+ }
+
+ public static string DescriptionAttributeAxisDataView_SizeType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisDataView_SizeType);
+ }
+ }
+
+ public static string DescriptionAttributeMinMovingDistance
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMinMovingDistance);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea_CursorX
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea_CursorX);
+ }
+ }
+
+ public static string DescriptionAttributeAxisDataView_SmallScrollMinSize
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisDataView_SmallScrollMinSize);
+ }
+ }
+
+ public static string DescriptionAttributeAxisDataView_SmallScrollMinSizeType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisDataView_SmallScrollMinSizeType);
+ }
+ }
+
+ public static string DescriptionAttributeAxisScrollBar_ButtonColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAxisScrollBar_ButtonColor);
+ }
+ }
+
+ public static string DescriptionAttributeArea3DStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeArea3DStyle);
+ }
+ }
+
+ public static string DescriptionAttributeChart
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChart);
+ }
+ }
+
+ public static string DescriptionAttributeChart_Chart
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChart_Chart);
+ }
+ }
+
+ public static string DescriptionAttributeBorderSkin_PageColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeBorderSkin_PageColor);
+ }
+ }
+
+ public static string DescriptionAttributeDataPoint_DataPoint
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeDataPoint_DataPoint);
+ }
+ }
+
+ public static string DescriptionAttributeChartArea3DStyle_Light
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartArea3DStyle_Light);
+ }
+ }
+
+ public static string DescriptionAttributeDataPointCustomProperties_DataPointCustomProperties
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeDataPointCustomProperties_DataPointCustomProperties);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_AutoFitText
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_AutoFitText);
+ }
+ }
+
+ public static string DescriptionAttributeAllowTextEditing
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAllowTextEditing);
+ }
+ }
+
+ public static string DescriptionAttributeCustomLabel_Text
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCustomLabel_Text);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCell_Text
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCell_Text);
+ }
+ }
+
+ public static string DescriptionAttributeText
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeText);
+ }
+ }
+
+ public static string DescriptionAttributeTitle_Text
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTitle_Text);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCellColumn_Text
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCellColumn_Text);
+ }
+ }
+
+ public static string DescriptionAttributeToolTipEventArgs_Text
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeToolTipEventArgs_Text);
+ }
+ }
+
+ public static string DescriptionAttributeMultiline
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMultiline);
+ }
+ }
+
+ public static string DescriptionAttributeTextAnnotation_TextAnnotation
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTextAnnotation_TextAnnotation);
+ }
+ }
+
+ public static string DescriptionAttributeAnnotationGroup_ClipToChartArea
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeAnnotationGroup_ClipToChartArea);
+ }
+ }
+
+ public static string DescriptionAttributeSeries_YValueType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeSeries_YValueType);
+ }
+ }
+
+ public static string DescriptionAttributeInternalIntervalType
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeInternalIntervalType);
+ }
+ }
+
+ public static string DescriptionAttributeCalloutAnnotation_CalloutAnchorCap
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeCalloutAnnotation_CalloutAnchorCap);
+ }
+ }
+
+ public static string DescriptionAttributeLogarithmic
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLogarithmic);
+ }
+ }
+
+ public static string DescriptionAttributeLegend_ItemColumnSpacing
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegend_ItemColumnSpacing);
+ }
+ }
+
+ public static string DescriptionAttributeMarksNextToAxis
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeMarksNextToAxis);
+ }
+ }
+
+ public static string DescriptionAttributeChartEvent_SelectionRangeChanged
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartEvent_SelectionRangeChanged);
+ }
+ }
+
+ public static string DescriptionAttributeDataPointCollection_DataPointCollection
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeDataPointCollection_DataPointCollection);
+ }
+ }
+
+ public static string DescriptionAttributeHorizontalLineAnnotation_HorizontalLineAnnotation
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeHorizontalLineAnnotation_HorizontalLineAnnotation);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCellColumn_HeaderColor
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCellColumn_HeaderColor);
+ }
+ }
+
+ public static string DescriptionAttributeLegendCell_LegendCell
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeLegendCell_LegendCell);
+ }
+ }
+
+ public static string DescriptionAttributeChartImageDescriptionUrl
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartImageDescriptionUrl);
+ }
+ }
+
+ public static string DescriptionAttributeChartImageAlternateText
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeChartImageAlternateText);
+ }
+ }
+
+ public static string DescriptionAttributePostBackValue
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributePostBackValue);
+ }
+ }
+
+ public static string DescriptionAttributeTextStyle
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeTextStyle);
+ }
+ }
+
+ public static string DescriptionAttributeIsMapAreaAttributesEncoded
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeIsMapAreaAttributesEncoded);
+ }
+ }
+
+ public static string DescriptionAttributeRightToLeft
+ {
+ get
+ {
+ return Keys.GetString(Keys.DescriptionAttributeRightToLeft);
+ }
+ }
+
+ public static string CategoryAttributeCellColumns
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeCellColumns);
+ }
+ }
+
+ public static string CategoryAttributeAxis
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeAxis);
+ }
+ }
+
+ public static string CategoryAttributeEditing
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeEditing);
+ }
+ }
+
+ public static string CategoryAttributeSize
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeSize);
+ }
+ }
+
+ public static string CategoryAttributePosition
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributePosition);
+ }
+ }
+
+ public static string CategoryAttributeViewState
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeViewState);
+ }
+ }
+
+ public static string CategoryAttributeInterval
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeInterval);
+ }
+ }
+
+ public static string CategoryAttributeAppearance
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeAppearance);
+ }
+ }
+
+ public static string CategoryAttributeDocking
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeDocking);
+ }
+ }
+
+ public static string CategoryAttributeDataSource
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeDataSource);
+ }
+ }
+
+ public static string CategoryAttributeAxisView
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeAxisView);
+ }
+ }
+
+ public static string CategoryAttributeLayout
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeLayout);
+ }
+ }
+
+ public static string CategoryAttribute3D
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttribute3D);
+ }
+ }
+
+ public static string CategoryAttributeData
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeData);
+ }
+ }
+
+ public static string CategoryAttributeTitle
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeTitle);
+ }
+ }
+
+ public static string CategoryAttributeToolTips
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeToolTips);
+ }
+ }
+
+ public static string CategoryAttributeLabels
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeLabels);
+ }
+ }
+
+ public static string CategoryAttributeGridTickMarks
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeGridTickMarks);
+ }
+ }
+
+ public static string CategoryAttributeLabelAppearance
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeLabelAppearance);
+ }
+ }
+
+ public static string CategoryAttributeHeader
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeHeader);
+ }
+ }
+
+ public static string CategoryAttributeAxes
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeAxes);
+ }
+ }
+
+ public static string CategoryAttributeImage
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeImage);
+ }
+ }
+
+ public static string CategoryAttributeEmptyPoints
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeEmptyPoints);
+ }
+ }
+
+ public static string CategoryAttributeAlignment
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeAlignment);
+ }
+ }
+
+ public static string CategoryAttributeAnnotation
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeAnnotation);
+ }
+ }
+
+ public static string CategoryAttributeMarker
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeMarker);
+ }
+ }
+
+ public static string CategoryAttributeChart
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeChart);
+ }
+ }
+
+ public static string CategoryAttributeLocation
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeLocation);
+ }
+ }
+
+ public static string CategoryAttributeToolTip
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeToolTip);
+ }
+ }
+
+ public static string CategoryAttributeMap
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeMap);
+ }
+ }
+
+ public static string CategoryAttributeMapArea
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeMapArea);
+ }
+ }
+
+ public static string CategoryAttributeLabel
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeLabel);
+ }
+ }
+
+ public static string CategoryAttributeShape
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeShape);
+ }
+ }
+
+ public static string CategoryAttributeMisc
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeMisc);
+ }
+ }
+
+ public static string CategoryAttributeSerializer
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeSerializer);
+ }
+ }
+
+ public static string CategoryAttributeSubAxes
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeSubAxes);
+ }
+ }
+
+ public static string CategoryAttributeSeriesItems
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeSeriesItems);
+ }
+ }
+
+ public static string CategoryAttributeDataView
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeDataView);
+ }
+ }
+
+ public static string CategoryAttributeCharttitle
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeCharttitle);
+ }
+ }
+
+ public static string CategoryAttributeLegend
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeLegend);
+ }
+ }
+
+ public static string CategoryAttributeAction
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeAction);
+ }
+ }
+
+ public static string CategoryAttributeScale
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeScale);
+ }
+ }
+
+ public static string CategoryAttributeAnnotations
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeAnnotations);
+ }
+ }
+
+ public static string CategoryAttributeAnchor
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeAnchor);
+ }
+ }
+
+ public static string CategoryAttributeBehavior
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeBehavior);
+ }
+ }
+
+ public static string CategoryAttributeCursor
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeCursor);
+ }
+ }
+
+ public static string CategoryAttributeAnchorAxes
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeAnchorAxes);
+ }
+ }
+
+ public static string CategoryAttributeAccessibility
+ {
+ get
+ {
+ return Keys.GetString(Keys.CategoryAttributeAccessibility);
+ }
+ }
+
+ public static string FormatErrorString
+ {
+ get
+ {
+ return Keys.GetString(Keys.FormatErrorString);
+ }
+ }
+
+ public static string ExceptionNameIsEmpty
+ {
+ get
+ {
+ return Keys.GetString(Keys.ExceptionNameIsEmpty);
+ }
+ }
+
+ public static string ActionListSeriesChartType
+ {
+ get
+ {
+ return Keys.GetString(Keys.ActionListSeriesChartType);
+ }
+ }
+
+ public static string ActionListSeriesXValueMember
+ {
+ get
+ {
+ return Keys.GetString(Keys.ActionListSeriesXValueMember);
+ }
+ }
+
+ public static string ActionListSeriesYValueMembers
+ {
+ get
+ {
+ return Keys.GetString(Keys.ActionListSeriesYValueMembers);
+ }
+ }
+
+ public static string DiagnosticHeader
+ {
+ get
+ {
+ return Keys.GetString(Keys.DiagnosticHeader);
+ }
+ }
+
+ public static string DiagnosticSettingsHeader
+ {
+ get
+ {
+ return Keys.GetString(Keys.DiagnosticSettingsHeader);
+ }
+ }
+
+ public static string DiagnosticSettingsKey
+ {
+ get
+ {
+ return Keys.GetString(Keys.DiagnosticSettingsKey);
+ }
+ }
+
+ public static string DiagnosticSettingsValue
+ {
+ get
+ {
+ return Keys.GetString(Keys.DiagnosticSettingsValue);
+ }
+ }
+
+ public static string DiagnosticSettingsInfo
+ {
+ get
+ {
+ return Keys.GetString(Keys.DiagnosticSettingsInfo);
+ }
+ }
+
+ public static string DiagnosticQueueStateHeader
+ {
+ get
+ {
+ return Keys.GetString(Keys.DiagnosticQueueStateHeader);
+ }
+ }
+
+ public static string DiagnosticQueueStateName
+ {
+ get
+ {
+ return Keys.GetString(Keys.DiagnosticQueueStateName);
+ }
+ }
+
+ public static string DiagnosticQueueStateAccess
+ {
+ get
+ {
+ return Keys.GetString(Keys.DiagnosticQueueStateAccess);
+ }
+ }
+
+ public static string DiagnosticQueueStateAccessOK
+ {
+ get
+ {
+ return Keys.GetString(Keys.DiagnosticQueueStateAccessOK);
+ }
+ }
+
+ public static string DiagnosticQueueStateAccessFail
+ {
+ get
+ {
+ return Keys.GetString(Keys.DiagnosticQueueStateAccessFail);
+ }
+ }
+
+ public static string DiagnosticQueueStateAccessInfo
+ {
+ get
+ {
+ return Keys.GetString(Keys.DiagnosticQueueStateAccessInfo);
+ }
+ }
+
+ public static string DiagnosticActivityHeader
+ {
+ get
+ {
+ return Keys.GetString(Keys.DiagnosticActivityHeader);
+ }
+ }
+
+ public static string DiagnosticActivityTime
+ {
+ get
+ {
+ return Keys.GetString(Keys.DiagnosticActivityTime);
+ }
+ }
+
+ public static string DiagnosticActivityMessage
+ {
+ get
+ {
+ return Keys.GetString(Keys.DiagnosticActivityMessage);
+ }
+ }
+
+ public static string DiagnosticActivityError
+ {
+ get
+ {
+ return Keys.GetString(Keys.DiagnosticActivityError);
+ }
+ }
+
+ public static string DiagnosticChartImageServedFailNotFound
+ {
+ get
+ {
+ return Keys.GetString(Keys.DiagnosticChartImageServedFailNotFound);
+ }
+ }
+
+ public static string ExceptionImageLoaderUnsupportedType(String typeName)
+ {
+ return Keys.GetString(Keys.ExceptionImageLoaderUnsupportedType, typeName);
+ }
+
+ public static string ExceptionImageLoaderIncorrectImageUrl(String url)
+ {
+ return Keys.GetString(Keys.ExceptionImageLoaderIncorrectImageUrl, url);
+ }
+
+ public static string ExceptionImageLoaderIncorrectImageLocation(String location)
+ {
+ return Keys.GetString(Keys.ExceptionImageLoaderIncorrectImageLocation, location);
+ }
+
+ public static string ExceptionAnnotationNameIsNotUnique(String name)
+ {
+ return Keys.GetString(Keys.ExceptionAnnotationNameIsNotUnique, name);
+ }
+
+ public static string ExceptionAnnotationNameAlreadyExistsInCollection(string name)
+ {
+ return Keys.GetString(Keys.ExceptionAnnotationNameAlreadyExistsInCollection, name);
+ }
+
+ public static string ExceptionAnnotationNameNotFound(String name)
+ {
+ return Keys.GetString(Keys.ExceptionAnnotationNameNotFound, name);
+ }
+
+ public static string ExceptionTitleNameIsNotUnique(String name)
+ {
+ return Keys.GetString(Keys.ExceptionTitleNameIsNotUnique, name);
+ }
+
+ public static string ExceptionTitleNameAddedIsNotUnique(String name)
+ {
+ return Keys.GetString(Keys.ExceptionTitleNameAddedIsNotUnique, name);
+ }
+
+ public static string ExceptionTitleNameNotFound(String name)
+ {
+ return Keys.GetString(Keys.ExceptionTitleNameNotFound, name);
+ }
+
+ public static string ExceptionDataSeriesNameNotFound(string name)
+ {
+ return Keys.GetString(Keys.ExceptionDataSeriesNameNotFound, name);
+ }
+
+ public static string ExceptionDataSeriesPointTypeUnsupported(string type)
+ {
+ return Keys.GetString(Keys.ExceptionDataSeriesPointTypeUnsupported, type);
+ }
+
+ public static string ExceptionDataSeriesYValueIndexNotExists(string yValueIndex, string seriesName)
+ {
+ return Keys.GetString(Keys.ExceptionDataSeriesYValueIndexNotExists, yValueIndex, seriesName);
+ }
+
+ public static string ExceptionDataSeriesKeywordFormatInvalid(string format)
+ {
+ return Keys.GetString(Keys.ExceptionDataSeriesKeywordFormatInvalid, format);
+ }
+
+ public static string ExceptionDataSeriesChartAreaInvalid(string chartArea, string seriesName)
+ {
+ return Keys.GetString(Keys.ExceptionDataSeriesChartAreaInvalid, chartArea, seriesName);
+ }
+
+ public static string ExceptionSeriesNameIsNotUnique(string name)
+ {
+ return Keys.GetString(Keys.ExceptionSeriesNameIsNotUnique, name);
+ }
+
+ public static string ExceptionSeriesNameAddedIsNotUnique(string name)
+ {
+ return Keys.GetString(Keys.ExceptionSeriesNameAddedIsNotUnique, name);
+ }
+
+ public static string ExceptionEditorChartTypeRegistryServiceInObjectInaccessible(string objectName)
+ {
+ return Keys.GetString(Keys.ExceptionEditorChartTypeRegistryServiceInObjectInaccessible, objectName);
+ }
+
+ public static string ExceptionLegendDesignerMarginObjectInvalid(string @string)
+ {
+ return Keys.GetString(Keys.ExceptionLegendDesignerMarginObjectInvalid, @string);
+ }
+
+ public static string ExceptionChartAreaAddedIsNotUnique(string name)
+ {
+ return Keys.GetString(Keys.ExceptionChartAreaAddedIsNotUnique, name);
+ }
+
+ public static string ExceptionChartAreaInsertedIsNotUnique(string name)
+ {
+ return Keys.GetString(Keys.ExceptionChartAreaInsertedIsNotUnique, name);
+ }
+
+ public static string ExceptionChartAreaAlreadyExistsInCollection(string name)
+ {
+ return Keys.GetString(Keys.ExceptionChartAreaAlreadyExistsInCollection, name);
+ }
+
+ public static string ExceptionAxisLabelsIntervalTypeUnsupported(string type)
+ {
+ return Keys.GetString(Keys.ExceptionAxisLabelsIntervalTypeUnsupported, type);
+ }
+
+ public static string ExceptionSubAxisNameNotFoundShort(string name)
+ {
+ return Keys.GetString(Keys.ExceptionSubAxisNameNotFoundShort, name);
+ }
+
+ public static string ExceptionSubAxisNameIsNotUnique(string name)
+ {
+ return Keys.GetString(Keys.ExceptionSubAxisNameIsNotUnique, name);
+ }
+
+ public static string ExceptionEnumInvalid(string name)
+ {
+ return Keys.GetString(Keys.ExceptionEnumInvalid, name);
+ }
+
+ public static string ExceptionNamedImageNotFound(string name)
+ {
+ return Keys.GetString(Keys.ExceptionNamedImageNotFound, name);
+ }
+
+ public static string ExceptionNamedImageAddedIsNotUnique(string name)
+ {
+ return Keys.GetString(Keys.ExceptionNamedImageAddedIsNotUnique, name);
+ }
+
+ public static string ExceptionNamedImageInsertedIsNotUnique(string name)
+ {
+ return Keys.GetString(Keys.ExceptionNamedImageInsertedIsNotUnique, name);
+ }
+
+ public static string ExceptionLegendNameIsNotUnique(string name)
+ {
+ return Keys.GetString(Keys.ExceptionLegendNameIsNotUnique, name);
+ }
+
+ public static string ExceptionLegendNotFound(string name)
+ {
+ return Keys.GetString(Keys.ExceptionLegendNotFound, name);
+ }
+
+ public static string ExceptionLegendAddedIsNotUnique(string name)
+ {
+ return Keys.GetString(Keys.ExceptionLegendAddedIsNotUnique, name);
+ }
+
+ public static string ExceptionLegendDockedChartAreaIsMissing(string name)
+ {
+ return Keys.GetString(Keys.ExceptionLegendDockedChartAreaIsMissing, name);
+ }
+
+ public static string ExceptionLegendReferencedInSeriesNotFound(string seriesName, string legendName)
+ {
+ return Keys.GetString(Keys.ExceptionLegendReferencedInSeriesNotFound, seriesName, legendName);
+ }
+
+ public static string ExceptionLegendSeparatorTypeUnknown(string type)
+ {
+ return Keys.GetString(Keys.ExceptionLegendSeparatorTypeUnknown, type);
+ }
+
+ public static string ExceptionLegendCellTypeUnknown(string type)
+ {
+ return Keys.GetString(Keys.ExceptionLegendCellTypeUnknown, type);
+ }
+
+ public static string ExceptionLegendColumnAlreadyExistsInCollection(string name)
+ {
+ return Keys.GetString(Keys.ExceptionLegendColumnAlreadyExistsInCollection, name);
+ }
+
+ public static string ExceptionLegendCellNameAlreadyExistsInCollection(string name)
+ {
+ return Keys.GetString(Keys.ExceptionLegendCellNameAlreadyExistsInCollection, name);
+ }
+
+ public static string ExceptionLegendCellNotFound(string name)
+ {
+ return Keys.GetString(Keys.ExceptionLegendCellNotFound, name);
+ }
+
+ public static string ExceptionLegendCellColumnNotFound(string name)
+ {
+ return Keys.GetString(Keys.ExceptionLegendCellColumnNotFound, name);
+ }
+
+ public static string ExceptionLegendCellColumnAlreadyExistsInCollection(string name)
+ {
+ return Keys.GetString(Keys.ExceptionLegendCellColumnAlreadyExistsInCollection, name);
+ }
+
+ public static string ExceptionChartAreaNameReferenceInvalid(string chartArea1, string chartArea2)
+ {
+ return Keys.GetString(Keys.ExceptionChartAreaNameReferenceInvalid, chartArea1, chartArea2);
+ }
+
+ public static string ExceptionTraceManagerUnsupportedType(string name)
+ {
+ return Keys.GetString(Keys.ExceptionTraceManagerUnsupportedType, name);
+ }
+
+ public static string ExceptionChartTypeRegistryUnsupportedType(string name)
+ {
+ return Keys.GetString(Keys.ExceptionChartTypeRegistryUnsupportedType, name);
+ }
+
+ public static string ExceptionChartTypeNameIsNotUnique(string name)
+ {
+ return Keys.GetString(Keys.ExceptionChartTypeNameIsNotUnique, name);
+ }
+
+ public static string ExceptionChartTypeUnknown(string name)
+ {
+ return Keys.GetString(Keys.ExceptionChartTypeUnknown, name);
+ }
+
+ public static string ExceptionChartTypeRequiresYValues(string name, string yValues)
+ {
+ return Keys.GetString(Keys.ExceptionChartTypeRequiresYValues, name, yValues);
+ }
+
+ public static string ExceptionChartTypeSecondaryYAxisUnsupported(string name)
+ {
+ return Keys.GetString(Keys.ExceptionChartTypeSecondaryYAxisUnsupported, name);
+ }
+
+ public static string ExceptionChartTypeSecondaryXAxisUnsupported(string name)
+ {
+ return Keys.GetString(Keys.ExceptionChartTypeSecondaryXAxisUnsupported, name);
+ }
+
+ public static string ExceptionChartTypeCanNotCombine(string type1, string type2)
+ {
+ return Keys.GetString(Keys.ExceptionChartTypeCanNotCombine, type1, type2);
+ }
+
+ public static string ExceptionBorderTypeRegistryUnsupportedType(string name)
+ {
+ return Keys.GetString(Keys.ExceptionBorderTypeRegistryUnsupportedType, name);
+ }
+
+ public static string ExceptionBorderTypeNameIsNotUnique(string name)
+ {
+ return Keys.GetString(Keys.ExceptionBorderTypeNameIsNotUnique, name);
+ }
+
+ public static string ExceptionBorderTypeUnknown(string name)
+ {
+ return Keys.GetString(Keys.ExceptionBorderTypeUnknown, name);
+ }
+
+ public static string ExceptionChartSerializerUnsupportedType(string name)
+ {
+ return Keys.GetString(Keys.ExceptionChartSerializerUnsupportedType, name);
+ }
+
+ public static string ExceptionChartSerializerDefaultConstructorUndefined(string property)
+ {
+ return Keys.GetString(Keys.ExceptionChartSerializerDefaultConstructorUndefined, property);
+ }
+
+ public static string ExceptionChartSerializerTypeUnsupported(string type)
+ {
+ return Keys.GetString(Keys.ExceptionChartSerializerTypeUnsupported, type);
+ }
+
+ public static string ExceptionChartSerializerPropertyNameUnknown(string property, string @object)
+ {
+ return Keys.GetString(Keys.ExceptionChartSerializerPropertyNameUnknown, property, @object);
+ }
+
+ public static string ExceptionChartSerializerBinaryTypeUnsupported(string type)
+ {
+ return Keys.GetString(Keys.ExceptionChartSerializerBinaryTypeUnsupported, type);
+ }
+
+ public static string ExceptionChartSerializerBinaryHashCodeDuplicate(string anem1, string name2)
+ {
+ return Keys.GetString(Keys.ExceptionChartSerializerBinaryHashCodeDuplicate, anem1, name2);
+ }
+
+ public static string ExceptionDataManipulatorYValuesIndexExceeded(string formula)
+ {
+ return Keys.GetString(Keys.ExceptionDataManipulatorYValuesIndexExceeded, formula);
+ }
+
+ public static string ExceptionDataManipulatorGroupingFormulaAlreadyDefined(string formulaName)
+ {
+ return Keys.GetString(Keys.ExceptionDataManipulatorGroupingFormulaAlreadyDefined, formulaName);
+ }
+
+ public static string ExceptionDataManipulatorGroupingFormulaFormatInvalid(string formula)
+ {
+ return Keys.GetString(Keys.ExceptionDataManipulatorGroupingFormulaFormatInvalid, formula);
+ }
+
+ public static string ExceptionDataManipulatorGroupingFormulaNameInvalid(string name)
+ {
+ return Keys.GetString(Keys.ExceptionDataManipulatorGroupingFormulaNameInvalid, name);
+ }
+
+ public static string ExceptionChartPictureUnsupportedType(string name)
+ {
+ return Keys.GetString(Keys.ExceptionChartPictureUnsupportedType, name);
+ }
+
+ public static string ExceptionSubAxisNameNotFound(string name)
+ {
+ return Keys.GetString(Keys.ExceptionSubAxisNameNotFound, name);
+ }
+
+ public static string ExceptionSubAxisNameAlreadyExistsInCollection(string name)
+ {
+ return Keys.GetString(Keys.ExceptionSubAxisNameAlreadyExistsInCollection, name);
+ }
+
+ public static string ExceptionChartTitleSetIsNotUnique(string name)
+ {
+ return Keys.GetString(Keys.ExceptionChartTitleSetIsNotUnique, name);
+ }
+
+ public static string ExceptionChartTitleAddedIsNotUnique(string name)
+ {
+ return Keys.GetString(Keys.ExceptionChartTitleAddedIsNotUnique, name);
+ }
+
+ public static string ExceptionChartTitleDockedChartAreaIsMissing(string name)
+ {
+ return Keys.GetString(Keys.ExceptionChartTitleDockedChartAreaIsMissing, name);
+ }
+
+ public static string ExceptionDataManagerUnsupportedType(string name)
+ {
+ return Keys.GetString(Keys.ExceptionDataManagerUnsupportedType, name);
+ }
+
+ public static string ExceptionKeywordsRegistryUnsupportedType(string name)
+ {
+ return Keys.GetString(Keys.ExceptionKeywordsRegistryUnsupportedType, name);
+ }
+
+ public static string ExceptionCustomAttributesRegistryUnsupportedType(string name)
+ {
+ return Keys.GetString(Keys.ExceptionCustomAttributesRegistryUnsupportedType, name);
+ }
+
+ public static string ExceptionFormulaModuleNameIsNotUnique(string name)
+ {
+ return Keys.GetString(Keys.ExceptionFormulaModuleNameIsNotUnique, name);
+ }
+
+ public static string ExceptionFormulaModuleRegistryUnsupportedType(string name)
+ {
+ return Keys.GetString(Keys.ExceptionFormulaModuleRegistryUnsupportedType, name);
+ }
+
+ public static string ExceptionFormulaModuleNameUnknown(string name)
+ {
+ return Keys.GetString(Keys.ExceptionFormulaModuleNameUnknown, name);
+ }
+
+ public static string ExceptionColumnNameNotFound(string name)
+ {
+ return Keys.GetString(Keys.ExceptionColumnNameNotFound, name);
+ }
+
+ public static string ExceptionDataPointConverterUnavailableSorting(string value, string count)
+ {
+ return Keys.GetString(Keys.ExceptionDataPointConverterUnavailableSorting, value, count);
+ }
+
+ public static string ExceptionDataPointYValuesCountMismatch(string count)
+ {
+ return Keys.GetString(Keys.ExceptionDataPointYValuesCountMismatch, count);
+ }
+
+ public static string ExceptionDataPointYValuesBindingCountMismatch(string count)
+ {
+ return Keys.GetString(Keys.ExceptionDataPointYValuesBindingCountMismatch, count);
+ }
+
+ public static string ExceptionDataPointYValuesSettingCountMismatch(string count)
+ {
+ return Keys.GetString(Keys.ExceptionDataPointYValuesSettingCountMismatch, count);
+ }
+
+ public static string ExceptionAttributeNameIsNotUnique(string name)
+ {
+ return Keys.GetString(Keys.ExceptionAttributeNameIsNotUnique, name);
+ }
+
+ public static string ExceptionFormulaInvalidPeriod(string name)
+ {
+ return Keys.GetString(Keys.ExceptionFormulaInvalidPeriod, name);
+ }
+
+ public static string ExceptionFormulaNotEnoughDataPoints(string name)
+ {
+ return Keys.GetString(Keys.ExceptionFormulaNotEnoughDataPoints, name);
+ }
+
+ public static string ExceptionKagiAttributeFormatInvalid(string attribute)
+ {
+ return Keys.GetString(Keys.ExceptionKagiAttributeFormatInvalid, attribute);
+ }
+
+ public static string ExceptionKagiAttributeOutOfRange(string name)
+ {
+ return Keys.GetString(Keys.ExceptionKagiAttributeOutOfRange, name);
+ }
+
+ public static string ExceptionFunnelStyleUnknown(string style)
+ {
+ return Keys.GetString(Keys.ExceptionFunnelStyleUnknown, style);
+ }
+
+ public static string ExceptionErrorBarTypeInvalid(string type)
+ {
+ return Keys.GetString(Keys.ExceptionErrorBarTypeInvalid, type);
+ }
+
+ public static string ExceptionErrorBarTypeFormatInvalid(string format)
+ {
+ return Keys.GetString(Keys.ExceptionErrorBarTypeFormatInvalid, format);
+ }
+
+ public static string ExceptionChartCanNotCombine(string name)
+ {
+ return Keys.GetString(Keys.ExceptionChartCanNotCombine, name);
+ }
+
+ public static string ExceptionCustomAttributeValueInvalid(string value, string name)
+ {
+ return Keys.GetString(Keys.ExceptionCustomAttributeValueInvalid, value, name);
+ }
+
+ public static string ExceptionCustomAttributeValueInvalid2(string name)
+ {
+ return Keys.GetString(Keys.ExceptionCustomAttributeValueInvalid2, name);
+ }
+
+ public static string ExceptionCustomAttributeAngleOutOfRange(string name)
+ {
+ return Keys.GetString(Keys.ExceptionCustomAttributeAngleOutOfRange, name);
+ }
+
+ public static string ExceptionCustomAttributeIsNotInRange0to1(string name)
+ {
+ return Keys.GetString(Keys.ExceptionCustomAttributeIsNotInRange0to1, name);
+ }
+
+ public static string ExceptionCustomAttributeIsNotInRange0to100(string name)
+ {
+ return Keys.GetString(Keys.ExceptionCustomAttributeIsNotInRange0to100, name);
+ }
+
+ public static string ExceptionCustomAttributeIsNotLargerThenZiro(string name)
+ {
+ return Keys.GetString(Keys.ExceptionCustomAttributeIsNotLargerThenZiro, name);
+ }
+
+ public static string ExceptionCustomAttributeIsNotInRange0to50(string name)
+ {
+ return Keys.GetString(Keys.ExceptionCustomAttributeIsNotInRange0to50, name);
+ }
+
+ public static string ExceptionCustomAttributeSeriesNameNotFound(string attributeName, string seriesName)
+ {
+ return Keys.GetString(Keys.ExceptionCustomAttributeSeriesNameNotFound, attributeName, seriesName);
+ }
+
+ public static string ExceptionCustomAttributeMustBeMoreThenValue(string attributeName, string value)
+ {
+ return Keys.GetString(Keys.ExceptionCustomAttributeMustBeMoreThenValue, attributeName, value);
+ }
+
+ public static string ExceptionCustomAttributeMustBeBiggerThenValue(string attributeName, string value)
+ {
+ return Keys.GetString(Keys.ExceptionCustomAttributeMustBeBiggerThenValue, attributeName, value);
+ }
+
+ public static string ExceptionCustomAttributeMustBeInRange(string attributeName, string fromValue, string toValue)
+ {
+ return Keys.GetString(Keys.ExceptionCustomAttributeMustBeInRange, attributeName, fromValue, toValue);
+ }
+
+ public static string ExceptionCustomAttributeTypeUnsupported(string type)
+ {
+ return Keys.GetString(Keys.ExceptionCustomAttributeTypeUnsupported, type);
+ }
+
+ public static string ExceptionCustomAttributeTypeOrMaximumPossibleValueInvalid(string attributeName)
+ {
+ return Keys.GetString(Keys.ExceptionCustomAttributeTypeOrMaximumPossibleValueInvalid, attributeName);
+ }
+
+ public static string ExceptionCustomAttributeTypeOrMinimumPossibleValueUnsupported(string name)
+ {
+ return Keys.GetString(Keys.ExceptionCustomAttributeTypeOrMinimumPossibleValueUnsupported, name);
+ }
+
+ public static string ExceptionCustomAttributeTypeOrMinimumPossibleValueInvalid(string attributeName)
+ {
+ return Keys.GetString(Keys.ExceptionCustomAttributeTypeOrMinimumPossibleValueInvalid, attributeName);
+ }
+
+ public static string ExceptionFormulaDataSeriesNameNotFoundInCollection(string name)
+ {
+ return Keys.GetString(Keys.ExceptionFormulaDataSeriesNameNotFoundInCollection, name);
+ }
+
+ public static string ExceptionFormulaDataSeriesNameNotFound(string name)
+ {
+ return Keys.GetString(Keys.ExceptionFormulaDataSeriesNameNotFound, name);
+ }
+
+ public static string ExceptionFormulaDataFormatInvalid(string name)
+ {
+ return Keys.GetString(Keys.ExceptionFormulaDataFormatInvalid, name);
+ }
+
+ public static string ExceptionFormulaDataSeriesAreNotAlignedDifferentXValues(string series1, string series2)
+ {
+ return Keys.GetString(Keys.ExceptionFormulaDataSeriesAreNotAlignedDifferentXValues, series1, series2);
+ }
+
+ public static string ExceptionFormulaDataSeriesAreNotAlignedDifferentDataPoints(string series1, string series2)
+ {
+ return Keys.GetString(Keys.ExceptionFormulaDataSeriesAreNotAlignedDifferentDataPoints, series1, series2);
+ }
+
+ public static string ExceptionFormulaNotFound(string name)
+ {
+ return Keys.GetString(Keys.ExceptionFormulaNotFound, name);
+ }
+
+ public static string ExceptionForecastingNotEnoughDataPoints(string minimum)
+ {
+ return Keys.GetString(Keys.ExceptionForecastingNotEnoughDataPoints, minimum);
+ }
+
+ public static string ExceptionValueMustBeGreaterThan(string propertyName, string value)
+ {
+ return Keys.GetString(Keys.ExceptionValueMustBeGreaterThan, propertyName, value);
+ }
+
+ public static string ExceptionValueMustBeLessThan(string propertyName, string value)
+ {
+ return Keys.GetString(Keys.ExceptionValueMustBeLessThan, propertyName, value);
+ }
+
+ public static string ExceptionValueMustBeInRange(string propertyName, string fromValue, string toValue)
+ {
+ return Keys.GetString(Keys.ExceptionValueMustBeInRange, propertyName, fromValue, toValue);
+ }
+
+ public static string ExceptionHttpHandlerCanNotLoadType(string type)
+ {
+ return Keys.GetString(Keys.ExceptionHttpHandlerCanNotLoadType, type);
+ }
+
+ public static string ExceptionHttpHandlerImageHandlerInterfaceUnsupported(string name)
+ {
+ return Keys.GetString(Keys.ExceptionHttpHandlerImageHandlerInterfaceUnsupported, name);
+ }
+
+ public static string ExceptionHttpHandlerParameterUnknown(string name, string value)
+ {
+ return Keys.GetString(Keys.ExceptionHttpHandlerParameterUnknown, name, value);
+ }
+
+ public static string ExceptionHttpHandlerParameterInvalid(string name, string value)
+ {
+ return Keys.GetString(Keys.ExceptionHttpHandlerParameterInvalid, name, value);
+ }
+
+ public static string ExceptionHttpHandlerPrivacyKeyInvalid(string name, string value)
+ {
+ return Keys.GetString(Keys.ExceptionHttpHandlerPrivacyKeyInvalid, name, value);
+ }
+
+ public static string ExceptionHttpHandlerTempDirectoryInvalid(string directory)
+ {
+ return Keys.GetString(Keys.ExceptionHttpHandlerTempDirectoryInvalid, directory);
+ }
+
+ public static string ExceptionHttpHandlerTempDirectoryUnaccesible(string directory)
+ {
+ return Keys.GetString(Keys.ExceptionHttpHandlerTempDirectoryUnaccesible, directory);
+ }
+
+ public static string ExceptionHttpHandlerStorageTypeUnsupported(string type)
+ {
+ return Keys.GetString(Keys.ExceptionHttpHandlerStorageTypeUnsupported, type);
+ }
+
+ public static string ExceptionWebConfigUpdateFailed(string message)
+ {
+ return Keys.GetString(Keys.ExceptionWebConfigUpdateFailed, message);
+ }
+
+ public static string EvenLogMessageChartImageFileTimeToLive(string minutes)
+ {
+ return Keys.GetString(Keys.EvenLogMessageChartImageFileTimeToLive, minutes);
+ }
+
+ public static string MessageYValueIndexInvalid(string maxIndex)
+ {
+ return Keys.GetString(Keys.MessageYValueIndexInvalid, maxIndex);
+ }
+
+ public static string AccessibilityTitleName(string name)
+ {
+ return Keys.GetString(Keys.AccessibilityTitleName, name);
+ }
+
+ public static string AccessibilityAnnotationName(string name)
+ {
+ return Keys.GetString(Keys.AccessibilityAnnotationName, name);
+ }
+
+ public static string AccessibilityLegendName(string name)
+ {
+ return Keys.GetString(Keys.AccessibilityLegendName, name);
+ }
+
+ public static string AccessibilitySeriesName(string name)
+ {
+ return Keys.GetString(Keys.AccessibilitySeriesName, name);
+ }
+
+ public static string AccessibilityDataPointName(int index)
+ {
+ return Keys.GetString(Keys.AccessibilityDataPointName, index);
+ }
+
+ public static string AccessibilityDataPointLabelName(int index)
+ {
+ return Keys.GetString(Keys.AccessibilityDataPointLabelName, index);
+ }
+
+ public static string AccessibilityLegendTitleName(string name)
+ {
+ return Keys.GetString(Keys.AccessibilityLegendTitleName, name);
+ }
+
+ public static string AccessibilityChartAreaName(string name)
+ {
+ return Keys.GetString(Keys.AccessibilityChartAreaName, name);
+ }
+
+ public static string AccessibilityChartAxisTitleName(string name)
+ {
+ return Keys.GetString(Keys.AccessibilityChartAxisTitleName, name);
+ }
+
+ public static string AccessibilityChartAxisMajorGridlinesName(string name)
+ {
+ return Keys.GetString(Keys.AccessibilityChartAxisMajorGridlinesName, name);
+ }
+
+ public static string AccessibilityChartAxisMinorGridlinesName(string name)
+ {
+ return Keys.GetString(Keys.AccessibilityChartAxisMinorGridlinesName, name);
+ }
+
+ public static string ExceptionNameAlreadyExistsInCollection(string name, string collection)
+ {
+ return Keys.GetString(Keys.ExceptionNameAlreadyExistsInCollection, name, collection);
+ }
+
+ public static string ExceptionNameNotFound(string name, string collection)
+ {
+ return Keys.GetString(Keys.ExceptionNameNotFound, name, collection);
+ }
+
+ public static string ActionListSeriesDataGroup(string name)
+ {
+ return Keys.GetString(Keys.ActionListSeriesDataGroup, name);
+ }
+
+ public static string DiagnosticSettingsConfig(string s)
+ {
+ return Keys.GetString(Keys.DiagnosticSettingsConfig, s);
+ }
+
+ public static string DiagnosticChartImageSaved(string name)
+ {
+ return Keys.GetString(Keys.DiagnosticChartImageSaved, name);
+ }
+
+ public static string DiagnosticChartImageSavedPrivate(string name, string keyType)
+ {
+ return Keys.GetString(Keys.DiagnosticChartImageSavedPrivate, name, keyType);
+ }
+
+ public static string DiagnosticChartImageDeleted(string name)
+ {
+ return Keys.GetString(Keys.DiagnosticChartImageDeleted, name);
+ }
+
+ public static string DiagnosticChartImageServed(string name)
+ {
+ return Keys.GetString(Keys.DiagnosticChartImageServed, name);
+ }
+
+ public static string DiagnosticChartImageServedFail(string name, string reason)
+ {
+ return Keys.GetString(Keys.DiagnosticChartImageServedFail, name, reason);
+ }
+
+ public static string DiagnosticChartImageServedFailPrivacyFail(string keyType)
+ {
+ return Keys.GetString(Keys.DiagnosticChartImageServedFailPrivacyFail, keyType);
+ }
+
+ [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ public class Keys
+ {
+
+ static ResourceManager resourceManager = new ResourceManager(typeof(SR).FullName, typeof(SR).Module.Assembly);
+
+ static CultureInfo _culture = null;
+
+ public const string ExceptionElementPositionConverter = "ExceptionElementPositionConverter";
+
+ public const string ExceptionInvalidServiceContainer = "ExceptionInvalidServiceContainer";
+
+ public const string ExceptionImageLoaderInvalidServiceContainer = "ExceptionImageLoaderInvalidServiceContainer";
+
+ public const string ExceptionImageLoaderUnsupportedType = "ExceptionImageLoaderUnsupportedType";
+
+ public const string ExceptionImageLoaderIncorrectImageUrl = "ExceptionImageLoaderIncorrectImageUrl";
+
+ public const string ExceptionImageLoaderIncorrectImageLocation = "ExceptionImageLoaderIncorrectImageLocation";
+
+ public const string ExceptionImageMapAddedHasWrongType = "ExceptionImageMapAddedHasWrongType";
+
+ public const string ExceptionImageMapInsertedHasWrongType = "ExceptionImageMapInsertedHasWrongType";
+
+ public const string ExceptionImageMapCircleShapeInvalid = "ExceptionImageMapCircleShapeInvalid";
+
+ public const string ExceptionImageMapRectangleShapeInvalid = "ExceptionImageMapRectangleShapeInvalid";
+
+ public const string ExceptionImageMapPolygonShapeInvalid = "ExceptionImageMapPolygonShapeInvalid";
+
+ public const string ExceptionAnnotationNameIsEmpty = "ExceptionAnnotationNameIsEmpty";
+
+ public const string ExceptionAnnotationNameIsNotUnique = "ExceptionAnnotationNameIsNotUnique";
+
+ public const string ExceptionAnnotationNameAlreadyExistsInCollection = "ExceptionAnnotationNameAlreadyExistsInCollection";
+
+ public const string ExceptionAnnotationNameNotFound = "ExceptionAnnotationNameNotFound";
+
+ public const string ExceptionAnnotationPathAddLineAsSegmentsInvalid = "ExceptionAnnotationPathAddLineAsSegmentsInvalid";
+
+ public const string ExceptionAnnotationLineWidthIsNegative = "ExceptionAnnotationLineWidthIsNegative";
+
+ public const string ExceptionAnnotationAnchorOffsetInvalid = "ExceptionAnnotationAnchorOffsetInvalid";
+
+ public const string ExceptionAnnotationGroupedAnchorDataPointMustBeEmpty = "ExceptionAnnotationGroupedAnchorDataPointMustBeEmpty";
+
+ public const string ExceptionAnnotationGroupedUnableToStartPlacement = "ExceptionAnnotationGroupedUnableToStartPlacement";
+
+ public const string ExceptionAnnotationNotInCollection = "ExceptionAnnotationNotInCollection";
+
+ public const string ExceptionAnnotationGroupedAxisMustBeEmpty = "ExceptionAnnotationGroupedAxisMustBeEmpty";
+
+ public const string ExceptionAnnotationArrowSizeIsZero = "ExceptionAnnotationArrowSizeIsZero";
+
+ public const string ExceptionAnnotationArrowSizeMustBeLessThen100 = "ExceptionAnnotationArrowSizeMustBeLessThen100";
+
+ public const string ExceptionAnnotationArrowStyleUnknown = "ExceptionAnnotationArrowStyleUnknown";
+
+ public const string ExceptionInvalidIndexerArgumentType = "ExceptionInvalidIndexerArgumentType";
+
+ public const string ExceptionTitleNameIsNotUnique = "ExceptionTitleNameIsNotUnique";
+
+ public const string ExceptionTitleNameAddedIsNotUnique = "ExceptionTitleNameAddedIsNotUnique";
+
+ public const string ExceptionTitleNameNotFound = "ExceptionTitleNameNotFound";
+
+ public const string ExceptionTitleNameIsEmpty = "ExceptionTitleNameIsEmpty";
+
+ public const string ExceptionDataSeriesNameNotFound = "ExceptionDataSeriesNameNotFound";
+
+ public const string ExceptionDataSeriesObjectRequired = "ExceptionDataSeriesObjectRequired";
+
+ public const string ExceptionDataSeriesNameIsEmpty = "ExceptionDataSeriesNameIsEmpty";
+
+ public const string ExceptionDataSeriesYValuesPerPointIsZero = "ExceptionDataSeriesYValuesPerPointIsZero";
+
+ public const string ExceptionDataSeriesPointTypeUnsupported = "ExceptionDataSeriesPointTypeUnsupported";
+
+ public const string ExceptionDataSeriesYValueIndexNotExists = "ExceptionDataSeriesYValueIndexNotExists";
+
+ public const string ExceptionDataSeriesKeywordFormatInvalid = "ExceptionDataSeriesKeywordFormatInvalid";
+
+ public const string ExceptionDataSeriesChartAreaInvalid = "ExceptionDataSeriesChartAreaInvalid";
+
+ public const string ExceptionDataSeriesYValueNumberInvalid = "ExceptionDataSeriesYValueNumberInvalid";
+
+ public const string ExceptionSeriesNameIsNotUnique = "ExceptionSeriesNameIsNotUnique";
+
+ public const string ExceptionSeriesNameAddedIsNotUnique = "ExceptionSeriesNameAddedIsNotUnique";
+
+ public const string ExceptionSeriesNameIsEmpty = "ExceptionSeriesNameIsEmpty";
+
+ public const string ExceptionEditorChartTypeRegistryServiceInaccessible = "ExceptionEditorChartTypeRegistryServiceInaccessible";
+
+ public const string ExceptionEditorChartTypeRegistryServiceInObjectInaccessible = "ExceptionEditorChartTypeRegistryServiceInObjectInaccessible";
+
+ public const string ExceptionEditorMultipleSeriesEditiingUnsupported = "ExceptionEditorMultipleSeriesEditiingUnsupported";
+
+ public const string ExceptionEditorContectInstantsIsNotChartObject = "ExceptionEditorContectInstantsIsNotChartObject";
+
+ public const string ExceptionEditorUITypeEditorInapplicable = "ExceptionEditorUITypeEditorInapplicable";
+
+ public const string ExceptionEditorUITypeEditorInt32ApplicableOnly = "ExceptionEditorUITypeEditorInt32ApplicableOnly";
+
+ public const string ExceptionLegendDesignerMarginObjectInvalid = "ExceptionLegendDesignerMarginObjectInvalid";
+
+ public const string ExceptionRectangleConverterStringFormatInvalid = "ExceptionRectangleConverterStringFormatInvalid";
+
+ public const string ExceptionChartAreaAddedIsNotUnique = "ExceptionChartAreaAddedIsNotUnique";
+
+ public const string ExceptionChartAreaInsertedIsNotUnique = "ExceptionChartAreaInsertedIsNotUnique";
+
+ public const string ExceptionChartAreaObjectRequired = "ExceptionChartAreaObjectRequired";
+
+ public const string ExceptionChartAreaAlreadyExistsInCollection = "ExceptionChartAreaAlreadyExistsInCollection";
+
+ public const string ExceptionChartAreaInsertedHasWrongType = "ExceptionChartAreaInsertedHasWrongType";
+
+ public const string ExceptionChartAreaAlreadyExistsShort = "ExceptionChartAreaAlreadyExistsShort";
+
+ public const string ExceptionChartAreaNameIsEmpty = "ExceptionChartAreaNameIsEmpty";
+
+ public const string ExceptionChartArea3DPerspectiveInvalid = "ExceptionChartArea3DPerspectiveInvalid";
+
+ public const string ExceptionChartArea3DInclinationInvalid = "ExceptionChartArea3DInclinationInvalid";
+
+ public const string ExceptionChartArea3DRotationInvalid = "ExceptionChartArea3DRotationInvalid";
+
+ public const string ExceptionChartArea3DWallWidthInvalid = "ExceptionChartArea3DWallWidthInvalid";
+
+ public const string ExceptionChartArea3DPointsDepthInvalid = "ExceptionChartArea3DPointsDepthInvalid";
+
+ public const string ExceptionChartArea3DPointsGapInvalid = "ExceptionChartArea3DPointsGapInvalid";
+
+ public const string ExceptionCursorIntervalOffsetIsNegative = "ExceptionCursorIntervalOffsetIsNegative";
+
+ public const string ExceptionCursorLineWidthIsNegative = "ExceptionCursorLineWidthIsNegative";
+
+ public const string ExceptionGraphicsMarkerStyleUnknown = "ExceptionGraphicsMarkerStyleUnknown";
+
+ public const string ExceptionGraphics3DMarkerStyleUnknown = "ExceptionGraphics3DMarkerStyleUnknown";
+
+ public const string ExceptionGraphics3DCoordinatesInvalid = "ExceptionGraphics3DCoordinatesInvalid";
+
+ public const string ExceptionAxisLabelsAutoFitMinFontSizeValueInvalid = "ExceptionAxisLabelsAutoFitMinFontSizeValueInvalid";
+
+ public const string ExceptionAxisLabelsIntervalTypeUnsupported = "ExceptionAxisLabelsIntervalTypeUnsupported";
+
+ public const string ExceptionAxisLabelRowIndexIsNegative = "ExceptionAxisLabelRowIndexIsNegative";
+
+ public const string ExceptionAxisLabelRowIndexMustBe1Or2 = "ExceptionAxisLabelRowIndexMustBe1Or2";
+
+ public const string ExceptionAxisLabelIndexIsNegative = "ExceptionAxisLabelIndexIsNegative";
+
+ public const string ExceptionAxisLabelFontAngleInvalid = "ExceptionAxisLabelFontAngleInvalid";
+
+ public const string ExceptionCustomLabelAddedHasWrongType = "ExceptionCustomLabelAddedHasWrongType";
+
+ public const string ExceptionCustomLabelInsertedHasWrongType = "ExceptionCustomLabelInsertedHasWrongType";
+
+ public const string ExceptionSmartLabelsDirectionUndefined = "ExceptionSmartLabelsDirectionUndefined";
+
+ public const string ExceptionSmartLabelsMinMovingDistanceIsNegative = "ExceptionSmartLabelsMinMovingDistanceIsNegative";
+
+ public const string ExceptionSmartLabelsMaxMovingDistanceIsNegative = "ExceptionSmartLabelsMaxMovingDistanceIsNegative";
+
+ public const string ExceptionStripLineAddedHasWrongType = "ExceptionStripLineAddedHasWrongType";
+
+ public const string ExceptionStripLineWidthIsNegative = "ExceptionStripLineWidthIsNegative";
+
+ public const string ExceptionAxisWidthIsNegative = "ExceptionAxisWidthIsNegative";
+
+ public const string ExceptionAxisDynamicIntervalCalculationFailed = "ExceptionAxisDynamicIntervalCalculationFailed";
+
+ public const string ExceptionAxisIntervalDecreasingFailed = "ExceptionAxisIntervalDecreasingFailed";
+
+ public const string ExceptionAxisIntervalIncreasingFailed = "ExceptionAxisIntervalIncreasingFailed";
+
+ public const string ExceptionAxisLabelsAutoFitMaxFontSizeInvalid = "ExceptionAxisLabelsAutoFitMaxFontSizeInvalid";
+
+ public const string ExceptionAxisMinimumMaximumInvalid = "ExceptionAxisMinimumMaximumInvalid";
+
+ public const string ExceptionAxisStackedChartsDataPointsNumberMismatch = "ExceptionAxisStackedChartsDataPointsNumberMismatch";
+
+ public const string ExceptionAxisSeriesNotAligned = "ExceptionAxisSeriesNotAligned";
+
+ public const string ExceptionSubAxisNameNotFoundShort = "ExceptionSubAxisNameNotFoundShort";
+
+ public const string ExceptionSubAxisNameIsNotUnique = "ExceptionSubAxisNameIsNotUnique";
+
+ public const string ExceptionEnumInvalid = "ExceptionEnumInvalid";
+
+ public const string ExceptionAxisScaleLogarithmBaseInvalid = "ExceptionAxisScaleLogarithmBaseInvalid";
+
+ public const string ExceptionAxisScalePositionInvalid = "ExceptionAxisScalePositionInvalid";
+
+ public const string ExceptionAxisScalePositionToValueCallFailed = "ExceptionAxisScalePositionToValueCallFailed";
+
+ public const string ExceptionAxisScaleIntervalIsZero = "ExceptionAxisScaleIntervalIsZero";
+
+ public const string ExceptionAxisScaleMinimumMaximumInvalid = "ExceptionAxisScaleMinimumMaximumInvalid";
+
+ public const string ExceptionAxisScaleIntervalIsLessThen1Year = "ExceptionAxisScaleIntervalIsLessThen1Year";
+
+ public const string ExceptionAxisScaleAutoIntervalInvalid = "ExceptionAxisScaleAutoIntervalInvalid";
+
+ public const string ExceptionAxisScaleMinimumValueIsGreaterThenMaximumDataPoint = "ExceptionAxisScaleMinimumValueIsGreaterThenMaximumDataPoint";
+
+ public const string ExceptionAxisScaleLogarithmicNegativeValues = "ExceptionAxisScaleLogarithmicNegativeValues";
+
+ public const string ExceptionChartAreaAxisScaleLogarithmicUnsuitable = "ExceptionChartAreaAxisScaleLogarithmicUnsuitable";
+
+ public const string ExceptionChartAreaChartTypesCanNotCombine = "ExceptionChartAreaChartTypesCanNotCombine";
+
+ public const string ExceptionChartAreaSeriesNotFound = "ExceptionChartAreaSeriesNotFound";
+
+ public const string ExceptionAxisScaleBreaksNumberInvalid = "ExceptionAxisScaleBreaksNumberInvalid";
+
+ public const string ExceptionAxisScaleBreaksCollapsibleSpaceInvalid = "ExceptionAxisScaleBreaksCollapsibleSpaceInvalid";
+
+ public const string ExceptionAxisScaleBreaksSpacingInvalid = "ExceptionAxisScaleBreaksSpacingInvalid";
+
+ public const string ExceptionAxisScaleBreaksLineWidthInvalid = "ExceptionAxisScaleBreaksLineWidthInvalid";
+
+ public const string ExceptionAxisScaleSegmentsPositionInvalid = "ExceptionAxisScaleSegmentsPositionInvalid";
+
+ public const string ExceptionAxisScaleSegmentsSizeInvalid = "ExceptionAxisScaleSegmentsSizeInvalid";
+
+ public const string ExceptionAxisScaleSegmentsSpacingInvalid = "ExceptionAxisScaleSegmentsSpacingInvalid";
+
+ public const string ExceptionTickMarksIntervalIsZero = "ExceptionTickMarksIntervalIsZero";
+
+ public const string ExceptionTickMarksIntervalIsNegative = "ExceptionTickMarksIntervalIsNegative";
+
+ public const string ExceptionScrollBarSizeInvalid = "ExceptionScrollBarSizeInvalid";
+
+ public const string ExceptionScrollBarZoomResetsNumberInvalid = "ExceptionScrollBarZoomResetsNumberInvalid";
+
+ public const string ExceptionMarkerStepNegativeValue = "ExceptionMarkerStepNegativeValue";
+
+ public const string ExceptionTextThresholdIsNegative = "ExceptionTextThresholdIsNegative";
+
+ public const string ExceptionNamedImageObjectRequired = "ExceptionNamedImageObjectRequired";
+
+ public const string ExceptionNamedImageNotFound = "ExceptionNamedImageNotFound";
+
+ public const string ExceptionNamedImageAddedIsNotUnique = "ExceptionNamedImageAddedIsNotUnique";
+
+ public const string ExceptionNamedImageInsertedIsNotUnique = "ExceptionNamedImageInsertedIsNotUnique";
+
+ public const string ExceptionNamedImageInsertedHasWrongType = "ExceptionNamedImageInsertedHasWrongType";
+
+ public const string ExceptionLegendNameIsEmpty = "ExceptionLegendNameIsEmpty";
+
+ public const string ExceptionLegendNameIsNotUnique = "ExceptionLegendNameIsNotUnique";
+
+ public const string ExceptionLegendNotFound = "ExceptionLegendNotFound";
+
+ public const string ExceptionLegendAddedIsNotUnique = "ExceptionLegendAddedIsNotUnique";
+
+ public const string ExceptionLegendAddedHasWrongType = "ExceptionLegendAddedHasWrongType";
+
+ public const string ExceptionLegendInsertedHasWrongType = "ExceptionLegendInsertedHasWrongType";
+
+ public const string ExceptionLegendDockedChartAreaIsMissing = "ExceptionLegendDockedChartAreaIsMissing";
+
+ public const string ExceptionBackSecondaryColorIsTransparent = "ExceptionBackSecondaryColorIsTransparent";
+
+ public const string ExceptionLegendReferencedInSeriesNotFound = "ExceptionLegendReferencedInSeriesNotFound";
+
+ public const string ExceptionLegendAutoFitMinFontSizeInvalid = "ExceptionLegendAutoFitMinFontSizeInvalid";
+
+ public const string ExceptionLegendMaximumAutoSizeInvalid = "ExceptionLegendMaximumAutoSizeInvalid";
+
+ public const string ExceptionLegendColumnSpacingInvalid = "ExceptionLegendColumnSpacingInvalid";
+
+ public const string ExceptionLegendSeparatorTypeUnknown = "ExceptionLegendSeparatorTypeUnknown";
+
+ public const string ExceptionLegendMarkerBorderWidthIsNegative = "ExceptionLegendMarkerBorderWidthIsNegative";
+
+ public const string ExceptionLegendCellTypeUnknown = "ExceptionLegendCellTypeUnknown";
+
+ public const string ExceptionLegendItemAddedHasWrongType = "ExceptionLegendItemAddedHasWrongType";
+
+ public const string ExceptionLegendItemInsertedHasWrongType = "ExceptionLegendItemInsertedHasWrongType";
+
+ public const string ExceptionLegendColumnIsEmpty = "ExceptionLegendColumnIsEmpty";
+
+ public const string ExceptionLegendColumnAlreadyExistsInCollection = "ExceptionLegendColumnAlreadyExistsInCollection";
+
+ public const string ExceptionSeriesSymbolSizeIsNegative = "ExceptionSeriesSymbolSizeIsNegative";
+
+ public const string ExceptionMinimumCellWidthIsWrong = "ExceptionMinimumCellWidthIsWrong";
+
+ public const string ExceptionMaximumCellWidthIsWrong = "ExceptionMaximumCellWidthIsWrong";
+
+ public const string ExceptionLegendCellNameAlreadyExistsInCollection = "ExceptionLegendCellNameAlreadyExistsInCollection";
+
+ public const string ExceptionLegendCellNameIsEmpty = "ExceptionLegendCellNameIsEmpty";
+
+ public const string ExceptionLegendCellImageSizeIsNegative = "ExceptionLegendCellImageSizeIsNegative";
+
+ public const string ExceptionLegendCellSeriesSymbolSizeIsNegative = "ExceptionLegendCellSeriesSymbolSizeIsNegative";
+
+ public const string ExceptionLegendCellSpanIsLessThenOne = "ExceptionLegendCellSpanIsLessThenOne";
+
+ public const string ExceptionLegendCellNotFound = "ExceptionLegendCellNotFound";
+
+ public const string ExceptionLegendCellColumnNotFound = "ExceptionLegendCellColumnNotFound";
+
+ public const string ExceptionLegendCellColumnAlreadyExistsInCollection = "ExceptionLegendCellColumnAlreadyExistsInCollection";
+
+ public const string ExceptionMarginTopIsNegative = "ExceptionMarginTopIsNegative";
+
+ public const string ExceptionMarginBottomIsNegative = "ExceptionMarginBottomIsNegative";
+
+ public const string ExceptionMarginLeftIsNegative = "ExceptionMarginLeftIsNegative";
+
+ public const string ExceptionMarginRightIsNegative = "ExceptionMarginRightIsNegative";
+
+ public const string ExceptionElementPositionArgumentOutOfRange = "ExceptionElementPositionArgumentOutOfRange";
+
+ public const string ExceptionChartHeightIsNotInPixels = "ExceptionChartHeightIsNotInPixels";
+
+ public const string ExceptionChartWidthIsNotInPixels = "ExceptionChartWidthIsNotInPixels";
+
+ public const string ExceptionChartBorderIsNegative = "ExceptionChartBorderIsNegative";
+
+ public const string ExceptionChartAreaNameReferenceInvalid = "ExceptionChartAreaNameReferenceInvalid";
+
+ public const string ExceptionChartCompressionInvalid = "ExceptionChartCompressionInvalid";
+
+ public const string ExceptionChartDataPointsAlignmentFaild = "ExceptionChartDataPointsAlignmentFaild";
+
+ public const string ExceptionChartDataPointsAlignmentFaildAxisLabelsInvalid = "ExceptionChartDataPointsAlignmentFaildAxisLabelsInvalid";
+
+ public const string ExceptionChartDataPointsInsertionFailedYValuesEmpty = "ExceptionChartDataPointsInsertionFailedYValuesEmpty";
+
+ public const string ExceptionTraceManagerUnsupportedType = "ExceptionTraceManagerUnsupportedType";
+
+ public const string ExceptionChartTypeRegistryUnsupportedType = "ExceptionChartTypeRegistryUnsupportedType";
+
+ public const string ExceptionChartTypeNameIsNotUnique = "ExceptionChartTypeNameIsNotUnique";
+
+ public const string ExceptionChartTypeHasNoInterface = "ExceptionChartTypeHasNoInterface";
+
+ public const string ExceptionChartTypeUnknown = "ExceptionChartTypeUnknown";
+
+ public const string ExceptionChartTypeRequiresYValues = "ExceptionChartTypeRequiresYValues";
+
+ public const string ExceptionChartTypeSecondaryYAxisUnsupported = "ExceptionChartTypeSecondaryYAxisUnsupported";
+
+ public const string ExceptionChartTypeSecondaryXAxisUnsupported = "ExceptionChartTypeSecondaryXAxisUnsupported";
+
+ public const string ExceptionChartTypeCanNotCombine = "ExceptionChartTypeCanNotCombine";
+
+ public const string ExceptionBorderTypeRegistryUnsupportedType = "ExceptionBorderTypeRegistryUnsupportedType";
+
+ public const string ExceptionBorderTypeNameIsNotUnique = "ExceptionBorderTypeNameIsNotUnique";
+
+ public const string ExceptionBorderTypeHasNoInterface = "ExceptionBorderTypeHasNoInterface";
+
+ public const string ExceptionBorderTypeUnknown = "ExceptionBorderTypeUnknown";
+
+ public const string ExceptionChartSerializerUnsupportedType = "ExceptionChartSerializerUnsupportedType";
+
+ public const string ExceptionChartSerializerContentFlagUnsupported = "ExceptionChartSerializerContentFlagUnsupported";
+
+ public const string ExceptionChartSerializerDefaultConstructorUndefined = "ExceptionChartSerializerDefaultConstructorUndefined";
+
+ public const string ExceptionChartSerializerContentStringFormatInvalid = "ExceptionChartSerializerContentStringFormatInvalid";
+
+ public const string ExceptionChartSerializerClassNameUndefined = "ExceptionChartSerializerClassNameUndefined";
+
+ public const string ExceptionChartSerializerPropertyNameUndefined = "ExceptionChartSerializerPropertyNameUndefined";
+
+ public const string ExceptionChartSerializerTypeUnsupported = "ExceptionChartSerializerTypeUnsupported";
+
+ public const string ExceptionChartSerializerWriterObjectInvalid = "ExceptionChartSerializerWriterObjectInvalid";
+
+ public const string ExceptionChartSerializerReaderObjectInvalid = "ExceptionChartSerializerReaderObjectInvalid";
+
+ public const string ExceptionChartSerializerPropertyNameUnknown = "ExceptionChartSerializerPropertyNameUnknown";
+
+ public const string ExceptionChartSerializerDestinationObjectInvalid = "ExceptionChartSerializerDestinationObjectInvalid";
+
+ public const string ExceptionChartSerializerSourceObjectInvalid = "ExceptionChartSerializerSourceObjectInvalid";
+
+ public const string ExceptionChartSerializerBinaryTypeUnsupported = "ExceptionChartSerializerBinaryTypeUnsupported";
+
+ public const string ExceptionChartSerializerBinaryHashCodeDuplicate = "ExceptionChartSerializerBinaryHashCodeDuplicate";
+
+ public const string ExceptionChartSerializerBinaryIgnoreUnknownAttributesUnsupported = "ExceptionChartSerializerBinaryIgnoreUnknownAttributesUnsupported";
+
+ public const string ExceptionChartSerializerBinaryFromatInvalid = "ExceptionChartSerializerBinaryFromatInvalid";
+
+ public const string ExceptionChartSerializerPropertyNotFound = "ExceptionChartSerializerPropertyNotFound";
+
+ public const string ExceptionDataManipulatorPointCountIsZero = "ExceptionDataManipulatorPointCountIsZero";
+
+ public const string ExceptionDataManipulatorIndexUndefined = "ExceptionDataManipulatorIndexUndefined";
+
+ public const string ExceptionDataManipulatorIndexFormatInvalid = "ExceptionDataManipulatorIndexFormatInvalid";
+
+ public const string ExceptionDataManipulatorGroupedSeriesNotSorted = "ExceptionDataManipulatorGroupedSeriesNotSorted";
+
+ public const string ExceptionDataManipulatorGroupingFormulaUndefined = "ExceptionDataManipulatorGroupingFormulaUndefined";
+
+ public const string ExceptionDataManipulatorYValuesIndexExceeded = "ExceptionDataManipulatorYValuesIndexExceeded";
+
+ public const string ExceptionDataManipulatorGroupingFormulaAlreadyDefined = "ExceptionDataManipulatorGroupingFormulaAlreadyDefined";
+
+ public const string ExceptionDataManipulatorGroupingFormulaUnsupported = "ExceptionDataManipulatorGroupingFormulaUnsupported";
+
+ public const string ExceptionDataManipulatorGroupingFormulaFormatInvalid = "ExceptionDataManipulatorGroupingFormulaFormatInvalid";
+
+ public const string ExceptionDataManipulatorGroupingInputSeriesUndefined = "ExceptionDataManipulatorGroupingInputSeriesUndefined";
+
+ public const string ExceptionDataManipulatorGroupingInputOutputSeriesNumberMismatch = "ExceptionDataManipulatorGroupingInputOutputSeriesNumberMismatch";
+
+ public const string ExceptionDataManipulatorGroupingFormulaNameInvalid = "ExceptionDataManipulatorGroupingFormulaNameInvalid";
+
+ public const string ExceptionDataBindYValuesToString = "ExceptionDataBindYValuesToString";
+
+ public const string ExceptionDataBindXValuesToString = "ExceptionDataBindXValuesToString";
+
+ public const string ExceptionDataBindSeriesToString = "ExceptionDataBindSeriesToString";
+
+ public const string ExceptionDataBindSeriesGroupByParameterIsEmpty = "ExceptionDataBindSeriesGroupByParameterIsEmpty";
+
+ public const string ExceptionChartPictureUnsupportedType = "ExceptionChartPictureUnsupportedType";
+
+ public const string ExceptionImageUrlIsEmpty = "ExceptionImageUrlIsEmpty";
+
+ public const string ExceptionImageUrlInvalidFormatters = "ExceptionImageUrlInvalidFormatters";
+
+ public const string ExceptionImageUrlInvalidFormat = "ExceptionImageUrlInvalidFormat";
+
+ public const string ExceptionImageUrlMissedFormatter = "ExceptionImageUrlMissedFormatter";
+
+ public const string ExceptionSubAxisNameNotFound = "ExceptionSubAxisNameNotFound";
+
+ public const string ExceptionSubAxisNameAlreadyExistsInCollection = "ExceptionSubAxisNameAlreadyExistsInCollection";
+
+ public const string ExceptionChartTitleSetIsNotUnique = "ExceptionChartTitleSetIsNotUnique";
+
+ public const string ExceptionChartTitleAddedIsNotUnique = "ExceptionChartTitleAddedIsNotUnique";
+
+ public const string ExceptionChartTitleDockedChartAreaIsMissing = "ExceptionChartTitleDockedChartAreaIsMissing";
+
+ public const string ExceptionDataManagerUnsupportedType = "ExceptionDataManagerUnsupportedType";
+
+ public const string ExceptionDataManager100StackedSeriesPointsNumeberMismatch = "ExceptionDataManager100StackedSeriesPointsNumeberMismatch";
+
+ public const string ExceptionKeywordsRegistryUnsupportedType = "ExceptionKeywordsRegistryUnsupportedType";
+
+ public const string ExceptionCustomAttributesRegistryUnsupportedType = "ExceptionCustomAttributesRegistryUnsupportedType";
+
+ public const string ExceptionFormulaModuleNameIsNotUnique = "ExceptionFormulaModuleNameIsNotUnique";
+
+ public const string ExceptionFormulaModuleHasNoInterface = "ExceptionFormulaModuleHasNoInterface";
+
+ public const string ExceptionFormulaModuleRegistryUnsupportedType = "ExceptionFormulaModuleRegistryUnsupportedType";
+
+ public const string ExceptionFormulaModuleNameUnknown = "ExceptionFormulaModuleNameUnknown";
+
+ public const string ExceptionColumnNameNotFound = "ExceptionColumnNameNotFound";
+
+ public const string ExceptionDataPointConverterInvalidSorting = "ExceptionDataPointConverterInvalidSorting";
+
+ public const string ExceptionDataPointConverterUnavailableSorting = "ExceptionDataPointConverterUnavailableSorting";
+
+ public const string ExceptionDataPointConverterWrongTypes = "ExceptionDataPointConverterWrongTypes";
+
+ public const string ExceptionDataPointInsertionXValuesQtyIsLessYValues = "ExceptionDataPointInsertionXValuesQtyIsLessYValues";
+
+ public const string ExceptionDataPointValueNameInvalid = "ExceptionDataPointValueNameInvalid";
+
+ public const string ExceptionDataPointValueNameYIndexOutOfRange = "ExceptionDataPointValueNameYIndexOutOfRange";
+
+ public const string ExceptionDataPointValueNameYIndexIsNotPositive = "ExceptionDataPointValueNameYIndexIsNotPositive";
+
+ public const string ExceptionDataPointInsertionNoDataSource = "ExceptionDataPointInsertionNoDataSource";
+
+ public const string ExceptionDataPointYValuesCountMismatch = "ExceptionDataPointYValuesCountMismatch";
+
+ public const string ExceptionDataPointYValuesBindingCountMismatch = "ExceptionDataPointYValuesBindingCountMismatch";
+
+ public const string ExceptionDataPointYValuesSettingCountMismatch = "ExceptionDataPointYValuesSettingCountMismatch";
+
+ public const string ExceptionDataPointBindingYValueNotSpecified = "ExceptionDataPointBindingYValueNotSpecified";
+
+ public const string ExceptionDataPointInsertionYValueNotSpecified = "ExceptionDataPointInsertionYValueNotSpecified";
+
+ public const string ExceptionAttributeUnableToDelete = "ExceptionAttributeUnableToDelete";
+
+ public const string ExceptionAttributeNameIsEmpty = "ExceptionAttributeNameIsEmpty";
+
+ public const string ExceptionAttributeInvalidFormat = "ExceptionAttributeInvalidFormat";
+
+ public const string ExceptionAttributeNameIsNotUnique = "ExceptionAttributeNameIsNotUnique";
+
+ public const string ExceptionAttributeDrawSideBySideInvalid = "ExceptionAttributeDrawSideBySideInvalid";
+
+ public const string ExceptionLabelBorderIsNotPositive = "ExceptionLabelBorderIsNotPositive";
+
+ public const string ExceptionBorderWidthIsNotPositive = "ExceptionBorderWidthIsNotPositive";
+
+ public const string ExceptionAngleRangeInvalid = "ExceptionAngleRangeInvalid";
+
+ public const string ExceptionDataPointYValueStringFormat = "ExceptionDataPointYValueStringFormat";
+
+ public const string ExceptionParameterFormatInvalid = "ExceptionParameterFormatInvalid";
+
+ public const string ExceptionStatisticalAnalysesInvalidAlphaValue = "ExceptionStatisticalAnalysesInvalidAlphaValue";
+
+ public const string ExceptionStatisticalAnalysesInvalidProbabilityValue = "ExceptionStatisticalAnalysesInvalidProbabilityValue";
+
+ public const string ExceptionStatisticalAnalysesInvalidDegreeOfFreedom = "ExceptionStatisticalAnalysesInvalidDegreeOfFreedom";
+
+ public const string ExceptionStatisticalAnalysesNegativeMeanDifference = "ExceptionStatisticalAnalysesNegativeMeanDifference";
+
+ public const string ExceptionStatisticalAnalysesInvalidSeriesNumber = "ExceptionStatisticalAnalysesInvalidSeriesNumber";
+
+ public const string ExceptionStatisticalAnalysesInvalidMeanDifference = "ExceptionStatisticalAnalysesInvalidMeanDifference";
+
+ public const string ExceptionStatisticalAnalysesNotEnoughDataPoints = "ExceptionStatisticalAnalysesNotEnoughDataPoints";
+
+ public const string ExceptionStatisticalAnalysesInvalidVariance = "ExceptionStatisticalAnalysesInvalidVariance";
+
+ public const string ExceptionStatisticalAnalysesInvalidTValue = "ExceptionStatisticalAnalysesInvalidTValue";
+
+ public const string ExceptionStatisticalAnalysesGammaBetaNegativeParameters = "ExceptionStatisticalAnalysesGammaBetaNegativeParameters";
+
+ public const string ExceptionStatisticalAnalysesInvalidZValue = "ExceptionStatisticalAnalysesInvalidZValue";
+
+ public const string ExceptionStatisticalAnalysesZeroVariance = "ExceptionStatisticalAnalysesZeroVariance";
+
+ public const string ExceptionStatisticalAnalysesNotEnoughInputSeries = "ExceptionStatisticalAnalysesNotEnoughInputSeries";
+
+ public const string ExceptionStatisticalAnalysesInvalidVariableRanges = "ExceptionStatisticalAnalysesInvalidVariableRanges";
+
+ public const string ExceptionStatisticalAnalysesStudentsInvalidTValue = "ExceptionStatisticalAnalysesStudentsInvalidTValue";
+
+ public const string ExceptionStatisticalAnalysesStudentsNegativeFreedomDegree = "ExceptionStatisticalAnalysesStudentsNegativeFreedomDegree";
+
+ public const string ExceptionStatisticalAnalysesNormalInvalidProbabilityValue = "ExceptionStatisticalAnalysesNormalInvalidProbabilityValue";
+
+ public const string ExceptionStatisticalAnalysesInvalidTailedParameter = "ExceptionStatisticalAnalysesInvalidTailedParameter";
+
+ public const string ExceptionStatisticalAnalysesInvalidInputParameter = "ExceptionStatisticalAnalysesInvalidInputParameter";
+
+ public const string ExceptionStatisticalAnalysesIncompleteBetaFunction = "ExceptionStatisticalAnalysesIncompleteBetaFunction";
+
+ public const string ExceptionStatisticalAnalysesInvalidAnovaTest = "ExceptionStatisticalAnalysesInvalidAnovaTest";
+
+ public const string ExceptionStatisticalAnalysesCovariance = "ExceptionStatisticalAnalysesCovariance";
+
+ public const string ExceptionStatisticalAnalysesInvalidMedianConditions = "ExceptionStatisticalAnalysesInvalidMedianConditions";
+
+ public const string ExceptionStatisticalAnalysesInvalidMeanConditions = "ExceptionStatisticalAnalysesInvalidMeanConditions";
+
+ public const string ExceptionStatisticalAnalysesInvalidVarianceConditions = "ExceptionStatisticalAnalysesInvalidVarianceConditions";
+
+ public const string ExceptionPeriodParameterIsNegative = "ExceptionPeriodParameterIsNegative";
+
+ public const string ExceptionPeriodAverageParameterIsNegative = "ExceptionPeriodAverageParameterIsNegative";
+
+ public const string ExceptionPeriodShortParameterIsNegative = "ExceptionPeriodShortParameterIsNegative";
+
+ public const string ExceptionPeriodLongParameterIsNegative = "ExceptionPeriodLongParameterIsNegative";
+
+ public const string ExceptionFormulaInvalidPeriod = "ExceptionFormulaInvalidPeriod";
+
+ public const string ExceptionFormulaNotEnoughDataPoints = "ExceptionFormulaNotEnoughDataPoints";
+
+ public const string ExceptionIndicatorsDeviationMissing = "ExceptionIndicatorsDeviationMissing";
+
+ public const string ExceptionIndicatorsLongPeriodLessThenShortPeriod = "ExceptionIndicatorsLongPeriodLessThenShortPeriod";
+
+ public const string ExceptionOscillatorObjectInvalidPeriod = "ExceptionOscillatorObjectInvalidPeriod";
+
+ public const string ExceptionOscillatorNegativeSignalPeriod = "ExceptionOscillatorNegativeSignalPeriod";
+
+ public const string ExceptionOscillatorNegativePeriodParameter = "ExceptionOscillatorNegativePeriodParameter";
+
+ public const string ExceptionVolumeIndicatorStartValueMissing = "ExceptionVolumeIndicatorStartValueMissing";
+
+ public const string ExceptionPriceIndicatorsShiftParameterMissing = "ExceptionPriceIndicatorsShiftParameterMissing";
+
+ public const string ExceptionPriceIndicatorsSameYNumber = "ExceptionPriceIndicatorsSameYNumber";
+
+ public const string ExceptionPriceIndicatorsSameXYNumber = "ExceptionPriceIndicatorsSameXYNumber";
+
+ public const string ExceptionPriceIndicatorsPeriodMissing = "ExceptionPriceIndicatorsPeriodMissing";
+
+ public const string ExceptionPriceIndicatorsNotEnoughPoints = "ExceptionPriceIndicatorsNotEnoughPoints";
+
+ public const string ExceptionPriceIndicatorsFormulaRequiresOneArray = "ExceptionPriceIndicatorsFormulaRequiresOneArray";
+
+ public const string ExceptionPriceIndicatorsFormulaRequiresTwoArrays = "ExceptionPriceIndicatorsFormulaRequiresTwoArrays";
+
+ public const string ExceptionPriceIndicatorsFormulaRequiresThreeArrays = "ExceptionPriceIndicatorsFormulaRequiresThreeArrays";
+
+ public const string ExceptionPriceIndicatorsFormulaRequiresFourArrays = "ExceptionPriceIndicatorsFormulaRequiresFourArrays";
+
+ public const string ExceptionObjectReferenceIsNull = "ExceptionObjectReferenceIsNull";
+
+ public const string ExceptionThreeLineBreakCanNotCobine = "ExceptionThreeLineBreakCanNotCobine";
+
+ public const string ExceptionThreeLineBreakNullReference = "ExceptionThreeLineBreakNullReference";
+
+ public const string ExceptionThreeLineBreakUsedYValueOutOfRange = "ExceptionThreeLineBreakUsedYValueOutOfRange";
+
+ public const string ExceptionThreeLineBreakNumberOfLinesInBreakFormatInvalid = "ExceptionThreeLineBreakNumberOfLinesInBreakFormatInvalid";
+
+ public const string ExceptionThreeLineBreakUpBrickColorInvalid = "ExceptionThreeLineBreakUpBrickColorInvalid";
+
+ public const string ExceptionThreeLineBreakUsedYValueInvalid = "ExceptionThreeLineBreakUsedYValueInvalid";
+
+ public const string ExceptionThreeLineBreakNumberOfLinesInBreakValueInvalid = "ExceptionThreeLineBreakNumberOfLinesInBreakValueInvalid";
+
+ public const string ExceptionRenkoCanNotCobine = "ExceptionRenkoCanNotCobine";
+
+ public const string ExceptionRenkoNullReference = "ExceptionRenkoNullReference";
+
+ public const string ExceptionRenkoUsedYValueOutOfRange = "ExceptionRenkoUsedYValueOutOfRange";
+
+ public const string ExceptionRenkoBoxSizeFormatInvalid = "ExceptionRenkoBoxSizeFormatInvalid";
+
+ public const string ExceptionRenkoUpBrickColorInvalid = "ExceptionRenkoUpBrickColorInvalid";
+
+ public const string ExceptionRenkoUsedYValueFormatInvalid = "ExceptionRenkoUsedYValueFormatInvalid";
+
+ public const string ExceptionPieIntervalsInvalid = "ExceptionPieIntervalsInvalid";
+
+ public const string ExceptionPieUnassignedFrontBackPoints = "ExceptionPieUnassignedFrontBackPoints";
+
+ public const string ExceptionPiePointOrderInvalid = "ExceptionPiePointOrderInvalid";
+
+ public const string ExceptionPieHorizontalLineSizeInvalid = "ExceptionPieHorizontalLineSizeInvalid";
+
+ public const string ExceptionPieRadialLineSizeInvalid = "ExceptionPieRadialLineSizeInvalid";
+
+ public const string ExceptionPie3DLabelLineSizeInvalid = "ExceptionPie3DLabelLineSizeInvalid";
+
+ public const string ExceptionPieRadiusInvalid = "ExceptionPieRadiusInvalid";
+
+ public const string ExceptionPieMinimumRelativePieSizeInvalid = "ExceptionPieMinimumRelativePieSizeInvalid";
+
+ public const string ExceptionPieOrderOperationInvalid = "ExceptionPieOrderOperationInvalid";
+
+ public const string ExceptionPieIntervalsOverlapping = "ExceptionPieIntervalsOverlapping";
+
+ public const string ExceptionDoughnutNullReference = "ExceptionDoughnutNullReference";
+
+ public const string ExceptionDoughnutThresholdInvalid = "ExceptionDoughnutThresholdInvalid";
+
+ public const string ExceptionDoughnutCollectedThresholdUsePercentInvalid = "ExceptionDoughnutCollectedThresholdUsePercentInvalid";
+
+ public const string ExceptionDoughnutCollectedColorInvalidFormat = "ExceptionDoughnutCollectedColorInvalidFormat";
+
+ public const string ExceptionDoughnutCollectedThresholdInvalidFormat = "ExceptionDoughnutCollectedThresholdInvalidFormat";
+
+ public const string ExceptionDoughnutCollectedThresholdInvalidRange = "ExceptionDoughnutCollectedThresholdInvalidRange";
+
+ public const string ExceptionPointAndFigureUpBrickColorInvalidFormat = "ExceptionPointAndFigureUpBrickColorInvalidFormat";
+
+ public const string ExceptionPointAndFigureCanNotCombine = "ExceptionPointAndFigureCanNotCombine";
+
+ public const string ExceptionPointAndFigureNullReference = "ExceptionPointAndFigureNullReference";
+
+ public const string ExceptionPointAndFigureUsedYValueHighOutOfRange = "ExceptionPointAndFigureUsedYValueHighOutOfRange";
+
+ public const string ExceptionPointAndFigureUsedYValueLowOutOfrange = "ExceptionPointAndFigureUsedYValueLowOutOfrange";
+
+ public const string ExceptionPointAndFigureReversalAmountInvalidFormat = "ExceptionPointAndFigureReversalAmountInvalidFormat";
+
+ public const string ExceptionPointAndFigureUsedYValueHighInvalidFormat = "ExceptionPointAndFigureUsedYValueHighInvalidFormat";
+
+ public const string ExceptionPointAndFigureUsedYValueLowInvalidFormat = "ExceptionPointAndFigureUsedYValueLowInvalidFormat";
+
+ public const string ExceptionFastPointMarkerStyleUnknown = "ExceptionFastPointMarkerStyleUnknown";
+
+ public const string ExceptionFunnelAngleRangeInvalid = "ExceptionFunnelAngleRangeInvalid";
+
+ public const string ExceptionFunnelCanNotCombine = "ExceptionFunnelCanNotCombine";
+
+ public const string ExceptionFunnelNeckHeightInvalid = "ExceptionFunnelNeckHeightInvalid";
+
+ public const string ExceptionFunnelNeckWidthInvalid = "ExceptionFunnelNeckWidthInvalid";
+
+ public const string ExceptionKagiAttributeFormatInvalid = "ExceptionKagiAttributeFormatInvalid";
+
+ public const string ExceptionKagiNullReference = "ExceptionKagiNullReference";
+
+ public const string ExceptionKagiCanNotCombine = "ExceptionKagiCanNotCombine";
+
+ public const string ExceptionKagiAttributeOutOfRange = "ExceptionKagiAttributeOutOfRange";
+
+ public const string ExceptionStackedAreaChartSeriesDataPointsNumberMismatch = "ExceptionStackedAreaChartSeriesDataPointsNumberMismatch";
+
+ public const string Exception3DPieLabelsIndexInvalid = "Exception3DPieLabelsIndexInvalid";
+
+ public const string Exception3DChartPointsXValuesUnsorted = "Exception3DChartPointsXValuesUnsorted";
+
+ public const string ExceptionFunnelStyleUnknown = "ExceptionFunnelStyleUnknown";
+
+ public const string ExceptionFunnelMinimumPointHeightAttributeInvalid = "ExceptionFunnelMinimumPointHeightAttributeInvalid";
+
+ public const string ExceptionErrorBarParameterUndefined = "ExceptionErrorBarParameterUndefined";
+
+ public const string ExceptionErrorBarTypeInvalid = "ExceptionErrorBarTypeInvalid";
+
+ public const string ExceptionErrorBarTypeFormatInvalid = "ExceptionErrorBarTypeFormatInvalid";
+
+ public const string Exception3DSplineY1ValueIsLessThenY2 = "Exception3DSplineY1ValueIsLessThenY2";
+
+ public const string ExceptionChartCanNotCombine = "ExceptionChartCanNotCombine";
+
+ public const string ExceptionCustomAttributeValueInvalid = "ExceptionCustomAttributeValueInvalid";
+
+ public const string ExceptionCustomAttributeValueInvalid2 = "ExceptionCustomAttributeValueInvalid2";
+
+ public const string ExceptionCustomAttributeAngleOutOfRange = "ExceptionCustomAttributeAngleOutOfRange";
+
+ public const string ExceptionCustomAttributeIsNotInRange0to1 = "ExceptionCustomAttributeIsNotInRange0to1";
+
+ public const string ExceptionCustomAttributeIsNotInRange0to100 = "ExceptionCustomAttributeIsNotInRange0to100";
+
+ public const string ExceptionCustomAttributeIsNotLargerThenZiro = "ExceptionCustomAttributeIsNotLargerThenZiro";
+
+ public const string ExceptionCustomAttributeIsNotInRange0to50 = "ExceptionCustomAttributeIsNotInRange0to50";
+
+ public const string ExceptionCustomAttributeSeriesNameNotFound = "ExceptionCustomAttributeSeriesNameNotFound";
+
+ public const string ExceptionCustomAttributeMustBeMoreThenValue = "ExceptionCustomAttributeMustBeMoreThenValue";
+
+ public const string ExceptionCustomAttributeMustBeBiggerThenValue = "ExceptionCustomAttributeMustBeBiggerThenValue";
+
+ public const string ExceptionCustomAttributeMustBeInRange = "ExceptionCustomAttributeMustBeInRange";
+
+ public const string ExceptionCustomAttributeDefaultValueTypeInvalid = "ExceptionCustomAttributeDefaultValueTypeInvalid";
+
+ public const string ExceptionCustomAttributeTypeUnsupported = "ExceptionCustomAttributeTypeUnsupported";
+
+ public const string ExceptionCustomAttributeTypeOrMaximumPossibleValueInvalid = "ExceptionCustomAttributeTypeOrMaximumPossibleValueInvalid";
+
+ public const string ExceptionCustomAttributeTypeOrMinimumPossibleValueUnsupported = "ExceptionCustomAttributeTypeOrMinimumPossibleValueUnsupported";
+
+ public const string ExceptionCustomAttributeTypeOrMinimumPossibleValueInvalid = "ExceptionCustomAttributeTypeOrMinimumPossibleValueInvalid";
+
+ public const string ExceptionFormulaDataItemsNumberMismatch = "ExceptionFormulaDataItemsNumberMismatch";
+
+ public const string ExceptionFormulaDataItemsNumberMismatch2 = "ExceptionFormulaDataItemsNumberMismatch2";
+
+ public const string ExceptionFormulaDataSeriesNameNotFoundInCollection = "ExceptionFormulaDataSeriesNameNotFoundInCollection";
+
+ public const string ExceptionFormulaDataSeriesNameNotFound = "ExceptionFormulaDataSeriesNameNotFound";
+
+ public const string ExceptionFormulaDataFormatInvalid = "ExceptionFormulaDataFormatInvalid";
+
+ public const string ExceptionFormulaDataOutputSeriesNumberYValuesIncorrect = "ExceptionFormulaDataOutputSeriesNumberYValuesIncorrect";
+
+ public const string ExceptionFormulaDataSeriesAreNotAlignedDifferentXValues = "ExceptionFormulaDataSeriesAreNotAlignedDifferentXValues";
+
+ public const string ExceptionFormulaDataSeriesAreNotAlignedDifferentDataPoints = "ExceptionFormulaDataSeriesAreNotAlignedDifferentDataPoints";
+
+ public const string ExceptionFormulaYIndexInvalid = "ExceptionFormulaYIndexInvalid";
+
+ public const string ExceptionFormulaXValuesNotAligned = "ExceptionFormulaXValuesNotAligned";
+
+ public const string ExceptionFormulaInputOutputSeriesMismatch = "ExceptionFormulaInputOutputSeriesMismatch";
+
+ public const string ExceptionFormulaNotFound = "ExceptionFormulaNotFound";
+
+ public const string ExceptionForecastingDegreeInvalid = "ExceptionForecastingDegreeInvalid";
+
+ public const string ExceptionForecastingNotEnoughDataPoints = "ExceptionForecastingNotEnoughDataPoints";
+
+ public const string ExceptionForecastingExponentialRegressionHasZeroYValues = "ExceptionForecastingExponentialRegressionHasZeroYValues";
+
+ public const string ExceptionForecastingPowerRegressionHasZeroYValues = "ExceptionForecastingPowerRegressionHasZeroYValues";
+
+ public const string ExceptionBorderWidthIsNegative = "ExceptionBorderWidthIsNegative";
+
+ public const string ExceptionBorderWidthIsZero = "ExceptionBorderWidthIsZero";
+
+ public const string ExceptionLegendBorderWidthIsNegative = "ExceptionLegendBorderWidthIsNegative";
+
+ public const string ExceptionTitleBorderWidthIsNegative = "ExceptionTitleBorderWidthIsNegative";
+
+ public const string ExceptionMatrix3DNotinitialized = "ExceptionMatrix3DNotinitialized";
+
+ public const string ExceptionPaletteIsEmpty = "ExceptionPaletteIsEmpty";
+
+ public const string ExceptionValueMustBeGreaterThan = "ExceptionValueMustBeGreaterThan";
+
+ public const string ExceptionValueMustBeLessThan = "ExceptionValueMustBeLessThan";
+
+ public const string ExceptionValueMustBeInRange = "ExceptionValueMustBeInRange";
+
+ public const string ExceptionChartPreviewNotAvailable = "ExceptionChartPreviewNotAvailable";
+
+ public const string ExceptionChartPreviewNotAvailableShort = "ExceptionChartPreviewNotAvailableShort";
+
+ public const string ExceptionChartOutOfLimits = "ExceptionChartOutOfLimits";
+
+ public const string ExceptionHttpHandlerCanNotSave = "ExceptionHttpHandlerCanNotSave";
+
+ public const string ExceptionHttpHandlerCanNotLoadType = "ExceptionHttpHandlerCanNotLoadType";
+
+ public const string ExceptionHttpHandlerImageHandlerInterfaceUnsupported = "ExceptionHttpHandlerImageHandlerInterfaceUnsupported";
+
+ public const string ExceptionHttpHandlerParameterUnknown = "ExceptionHttpHandlerParameterUnknown";
+
+ public const string ExceptionHttpHandlerParameterInvalid = "ExceptionHttpHandlerParameterInvalid";
+
+ public const string ExceptionHttpHandlerPrivacyKeyInvalid = "ExceptionHttpHandlerPrivacyKeyInvalid";
+
+ public const string ExceptionHttpHandlerValueInvalid = "ExceptionHttpHandlerValueInvalid";
+
+ public const string ExceptionHttpHandlerTimeoutParameterInvalid = "ExceptionHttpHandlerTimeoutParameterInvalid";
+
+ public const string ExceptionHttpHandlerUrlMissing = "ExceptionHttpHandlerUrlMissing";
+
+ public const string ExceptionHttpHandlerUrlInvalid = "ExceptionHttpHandlerUrlInvalid";
+
+ public const string ExceptionHttpHandlerTempDirectoryInvalid = "ExceptionHttpHandlerTempDirectoryInvalid";
+
+ public const string ExceptionHttpHandlerTempDirectoryUnaccesible = "ExceptionHttpHandlerTempDirectoryUnaccesible";
+
+ public const string ExceptionHttpHandlerStorageTypeUnsupported = "ExceptionHttpHandlerStorageTypeUnsupported";
+
+ public const string ExceptionHttpHandlerInvalidLocation = "ExceptionHttpHandlerInvalidLocation";
+
+ public const string ExceptionHttpHandlerImageNotFound = "ExceptionHttpHandlerImageNotFound";
+
+ public const string ExceptionWebConfigUpdateFailed = "ExceptionWebConfigUpdateFailed";
+
+ public const string DescriptionCustomAttributeEmptyPointValue = "DescriptionCustomAttributeEmptyPointValue";
+
+ public const string DescriptionCustomAttributeIsXAxisQuantitive = "DescriptionCustomAttributeIsXAxisQuantitive";
+
+ public const string DescriptionCustomAttributePieDonutExploded = "DescriptionCustomAttributePieDonutExploded";
+
+ public const string DescriptionCustomAttributeProportionalSymbols = "DescriptionCustomAttributeProportionalSymbols";
+
+ public const string DescriptionCustomAttributeDrawSideBySide = "DescriptionCustomAttributeDrawSideBySide";
+
+ public const string DescriptionCustomAttributeShowMarkerLines = "DescriptionCustomAttributeShowMarkerLines";
+
+ public const string DescriptionCustomAttributeShowOpenClose = "DescriptionCustomAttributeShowOpenClose";
+
+ public const string DescriptionCustomAttributeBoxPlotShowAverage = "DescriptionCustomAttributeBoxPlotShowAverage";
+
+ public const string DescriptionCustomAttributeBubbleUseSizeForLabel = "DescriptionCustomAttributeBubbleUseSizeForLabel";
+
+ public const string DescriptionCustomAttributeBoxPlotShowMedian = "DescriptionCustomAttributeBoxPlotShowMedian";
+
+ public const string DescriptionCustomAttributeBoxPlotShowUnusualValues = "DescriptionCustomAttributeBoxPlotShowUnusualValues";
+
+ public const string DescriptionCustomAttributeBoxPlotSeries = "DescriptionCustomAttributeBoxPlotSeries";
+
+ public const string DescriptionCustomAttributePieStartAngle = "DescriptionCustomAttributePieStartAngle";
+
+ public const string DescriptionCustomAttributeLabelStyle = "DescriptionCustomAttributeLabelStyle";
+
+ public const string DescriptionCustomAttributeFunnelLabelStyle = "DescriptionCustomAttributeFunnelLabelStyle";
+
+ public const string DescriptionCustomAttributeFunnelStyle = "DescriptionCustomAttributeFunnelStyle";
+
+ public const string DescriptionCustomAttributePolarDrawingStyle = "DescriptionCustomAttributePolarDrawingStyle";
+
+ public const string DescriptionCustomAttributePyramidLabelStyle = "DescriptionCustomAttributePyramidLabelStyle";
+
+ public const string DescriptionCustomAttributeRadarDrawingStyle = "DescriptionCustomAttributeRadarDrawingStyle";
+
+ public const string DescriptionCustomAttributeBoxSize = "DescriptionCustomAttributeBoxSize";
+
+ public const string DescriptionCustomAttributeCollectedColor = "DescriptionCustomAttributeCollectedColor";
+
+ public const string DescriptionCustomAttributeCollectedLabel = "DescriptionCustomAttributeCollectedLabel";
+
+ public const string DescriptionCustomAttributeCollectedLegendText = "DescriptionCustomAttributeCollectedLegendText";
+
+ public const string DescriptionCustomAttributeCollectedLegendDefaultText = "DescriptionCustomAttributeCollectedLegendDefaultText";
+
+ public const string DescriptionCustomAttributeCollectedLabelDefaultText = "DescriptionCustomAttributeCollectedLabelDefaultText";
+
+ public const string DescriptionCustomAttributeCollectedToolTip = "DescriptionCustomAttributeCollectedToolTip";
+
+ public const string DescriptionCustomAttributePyramidValueType = "DescriptionCustomAttributePyramidValueType";
+
+ public const string DescriptionCustomAttribute_3DLabelLineSize = "DescriptionCustomAttribute_3DLabelLineSize";
+
+ public const string DescriptionCustomAttributeFunnel3DRotationAngle = "DescriptionCustomAttributeFunnel3DRotationAngle";
+
+ public const string DescriptionCustomAttributePyramid3DRotationAngle = "DescriptionCustomAttributePyramid3DRotationAngle";
+
+ public const string DescriptionCustomAttributePixelPointDepth = "DescriptionCustomAttributePixelPointDepth";
+
+ public const string DescriptionCustomAttributePixelPointGapDepth = "DescriptionCustomAttributePixelPointGapDepth";
+
+ public const string DescriptionCustomAttributeErrorBarCenterMarkerStyle = "DescriptionCustomAttributeErrorBarCenterMarkerStyle";
+
+ public const string DescriptionCustomAttributePointFigureBoxSize = "DescriptionCustomAttributePointFigureBoxSize";
+
+ public const string DescriptionCustomAttributeBubbleScaleMax = "DescriptionCustomAttributeBubbleScaleMax";
+
+ public const string DescriptionCustomAttributeBubbleScaleMin = "DescriptionCustomAttributeBubbleScaleMin";
+
+ public const string DescriptionCustomAttributeCollectedThreshold = "DescriptionCustomAttributeCollectedThreshold";
+
+ public const string DescriptionCustomAttributePieLineColor = "DescriptionCustomAttributePieLineColor";
+
+ public const string DescriptionCustomAttributeCalloutLineColor = "DescriptionCustomAttributeCalloutLineColor";
+
+ public const string DescriptionCustomAttributePieLabelStyle = "DescriptionCustomAttributePieLabelStyle";
+
+ public const string DescriptionCustomAttributeFunnel3DDrawingStyle = "DescriptionCustomAttributeFunnel3DDrawingStyle";
+
+ public const string DescriptionCustomAttributePyramid3DDrawingStyle = "DescriptionCustomAttributePyramid3DDrawingStyle";
+
+ public const string DescriptionCustomAttributeDrawingStyle = "DescriptionCustomAttributeDrawingStyle";
+
+ public const string DescriptionCustomAttributePieDrawingStyle = "DescriptionCustomAttributePieDrawingStyle";
+
+ public const string DescriptionCustomAttributeCollectedSliceExploded = "DescriptionCustomAttributeCollectedSliceExploded";
+
+ public const string DescriptionCustomAttributeCollectedThresholdUsePercent = "DescriptionCustomAttributeCollectedThresholdUsePercent";
+
+ public const string DescriptionCustomAttributeFunnelNeckHeight = "DescriptionCustomAttributeFunnelNeckHeight";
+
+ public const string DescriptionCustomAttributeFunnelNeckWidth = "DescriptionCustomAttributeFunnelNeckWidth";
+
+ public const string DescriptionCustomAttributePyramidPointGap = "DescriptionCustomAttributePyramidPointGap";
+
+ public const string DescriptionCustomAttributeFunnelPointGap = "DescriptionCustomAttributeFunnelPointGap";
+
+ public const string DescriptionCustomAttributeLabelsHorizontalLineSize = "DescriptionCustomAttributeLabelsHorizontalLineSize";
+
+ public const string DescriptionCustomAttributeDoughnutRadius = "DescriptionCustomAttributeDoughnutRadius";
+
+ public const string DescriptionCustomAttributePolarCircularLabelsStyle = "DescriptionCustomAttributePolarCircularLabelsStyle";
+
+ public const string DescriptionCustomAttributeRadarCircularLabelsStyle = "DescriptionCustomAttributeRadarCircularLabelsStyle";
+
+ public const string DescriptionCustomAttributeOpenCloseStyle = "DescriptionCustomAttributeOpenCloseStyle";
+
+ public const string DescriptionCustomAttributeBubbleMaxSize = "DescriptionCustomAttributeBubbleMaxSize";
+
+ public const string DescriptionCustomAttributeMaxPixelPointWidth = "DescriptionCustomAttributeMaxPixelPointWidth";
+
+ public const string DescriptionCustomAttributePyramidMinPointHeight = "DescriptionCustomAttributePyramidMinPointHeight";
+
+ public const string DescriptionCustomAttributeFunnelMinPointHeight = "DescriptionCustomAttributeFunnelMinPointHeight";
+
+ public const string DescriptionCustomAttributeMinimumRelativePieSize = "DescriptionCustomAttributeMinimumRelativePieSize";
+
+ public const string DescriptionCustomAttributeMinPixelPointWidth = "DescriptionCustomAttributeMinPixelPointWidth";
+
+ public const string DescriptionCustomAttributeErrorBarSeries = "DescriptionCustomAttributeErrorBarSeries";
+
+ public const string DescriptionCustomAttributeNumberOfLinesInBreak = "DescriptionCustomAttributeNumberOfLinesInBreak";
+
+ public const string DescriptionCustomAttributePyramidOutsideLabelPlacement = "DescriptionCustomAttributePyramidOutsideLabelPlacement";
+
+ public const string DescriptionCustomAttributeFunnelOutsideLabelPlacement = "DescriptionCustomAttributeFunnelOutsideLabelPlacement";
+
+ public const string DescriptionCustomAttributeBoxPlotPercentile = "DescriptionCustomAttributeBoxPlotPercentile";
+
+ public const string DescriptionCustomAttributeBoxPlotWhiskerPercentile = "DescriptionCustomAttributeBoxPlotWhiskerPercentile";
+
+ public const string DescriptionCustomAttributeBarLabelStyle = "DescriptionCustomAttributeBarLabelStyle";
+
+ public const string DescriptionCustomAttributeLabelsRadialLineSize = "DescriptionCustomAttributeLabelsRadialLineSize";
+
+ public const string DescriptionCustomAttributePointWidth = "DescriptionCustomAttributePointWidth";
+
+ public const string DescriptionCustomAttributeReversalAmount = "DescriptionCustomAttributeReversalAmount";
+
+ public const string DescriptionCustomAttributePolarAreaDrawingStyle = "DescriptionCustomAttributePolarAreaDrawingStyle";
+
+ public const string DescriptionCustomAttributeRadarAreaDrawingStyle = "DescriptionCustomAttributeRadarAreaDrawingStyle";
+
+ public const string DescriptionCustomAttributeStackedGroupName = "DescriptionCustomAttributeStackedGroupName";
+
+ public const string DescriptionCustomAttributeLineTension = "DescriptionCustomAttributeLineTension";
+
+ public const string DescriptionCustomAttributeCandlePriceUpColor = "DescriptionCustomAttributeCandlePriceUpColor";
+
+ public const string DescriptionCustomAttributeBarsPriceUpColor = "DescriptionCustomAttributeBarsPriceUpColor";
+
+ public const string DescriptionCustomAttributePriceDownColor = "DescriptionCustomAttributePriceDownColor";
+
+ public const string DescriptionCustomAttributeUsedYValueHigh = "DescriptionCustomAttributeUsedYValueHigh";
+
+ public const string DescriptionCustomAttributeUsedYValueLow = "DescriptionCustomAttributeUsedYValueLow";
+
+ public const string DescriptionCustomAttributeRenkoUsedYValue = "DescriptionCustomAttributeRenkoUsedYValue";
+
+ public const string DescriptionCustomAttributeThreeLineBreakUsedYValue = "DescriptionCustomAttributeThreeLineBreakUsedYValue";
+
+ public const string DescriptionCustomAttributePyramidInsideLabelAlignment = "DescriptionCustomAttributePyramidInsideLabelAlignment";
+
+ public const string DescriptionCustomAttributeFunnelInsideLabelAlignment = "DescriptionCustomAttributeFunnelInsideLabelAlignment";
+
+ public const string DescriptionCustomAttributeErrorBarStyle = "DescriptionCustomAttributeErrorBarStyle";
+
+ public const string DescriptionCustomAttributePixelPointWidth = "DescriptionCustomAttributePixelPointWidth";
+
+ public const string DescriptionCustomAttributeLabelValueType = "DescriptionCustomAttributeLabelValueType";
+
+ public const string DescriptionCustomAttributeUsedYValue = "DescriptionCustomAttributeUsedYValue";
+
+ public const string DescriptionCustomAttributeKagiReversalAmount = "DescriptionCustomAttributeKagiReversalAmount";
+
+ public const string DescriptionCustomAttributeErrorBarType = "DescriptionCustomAttributeErrorBarType";
+
+ public const string DescriptionAttributeChart_ImageStorageMode = "DescriptionAttributeChart_ImageStorageMode";
+
+ public const string DescriptionKeyWordAverageYValues = "DescriptionKeyWordAverageYValues";
+
+ public const string DescriptionKeyWordAxisLabelDataPoint = "DescriptionKeyWordAxisLabelDataPoint";
+
+ public const string DescriptionKeyWordIndexDataPoint = "DescriptionKeyWordIndexDataPoint";
+
+ public const string DescriptionKeyWordLabelDataPoint = "DescriptionKeyWordLabelDataPoint";
+
+ public const string DescriptionKeyWordYValuePercentTotal = "DescriptionKeyWordYValuePercentTotal";
+
+ public const string DescriptionKeyWordIndexDataPoint2 = "DescriptionKeyWordIndexDataPoint2";
+
+ public const string DescriptionKeyWordLegendText = "DescriptionKeyWordLegendText";
+
+ public const string DescriptionKeyWordMaximumYValues = "DescriptionKeyWordMaximumYValues";
+
+ public const string DescriptionKeyWordMinimumYValues = "DescriptionKeyWordMinimumYValues";
+
+ public const string DescriptionKeyWordSeriesName = "DescriptionKeyWordSeriesName";
+
+ public const string DescriptionKeyWordTotalYValues = "DescriptionKeyWordTotalYValues";
+
+ public const string DescriptionKeyWordXValue = "DescriptionKeyWordXValue";
+
+ public const string DescriptionKeyWordFirstPointYValue = "DescriptionKeyWordFirstPointYValue";
+
+ public const string DescriptionKeyWordLastPointYValue = "DescriptionKeyWordLastPointYValue";
+
+ public const string DescriptionKeyWordYValue = "DescriptionKeyWordYValue";
+
+ public const string DescriptionKeyWordNameIndexDataPoint = "DescriptionKeyWordNameIndexDataPoint";
+
+ public const string DescriptionKeyWordNameXValue = "DescriptionKeyWordNameXValue";
+
+ public const string DescriptionKeyWordNameYValue = "DescriptionKeyWordNameYValue";
+
+ public const string DescriptionKeyWordNameTotalYValues = "DescriptionKeyWordNameTotalYValues";
+
+ public const string DescriptionKeyWordNameYValuePercentTotal = "DescriptionKeyWordNameYValuePercentTotal";
+
+ public const string DescriptionKeyWordNameIndexTheDataPoint = "DescriptionKeyWordNameIndexTheDataPoint";
+
+ public const string DescriptionKeyWordNameLabelDataPoint = "DescriptionKeyWordNameLabelDataPoint";
+
+ public const string DescriptionKeyWordNameAxisLabelDataPoint = "DescriptionKeyWordNameAxisLabelDataPoint";
+
+ public const string DescriptionKeyWordNameLegendText = "DescriptionKeyWordNameLegendText";
+
+ public const string DescriptionKeyWordNameSeriesName = "DescriptionKeyWordNameSeriesName";
+
+ public const string DescriptionKeyWordNameAverageYValues = "DescriptionKeyWordNameAverageYValues";
+
+ public const string DescriptionKeyWordNameMaximumYValues = "DescriptionKeyWordNameMaximumYValues";
+
+ public const string DescriptionKeyWordNameMinimumYValues = "DescriptionKeyWordNameMinimumYValues";
+
+ public const string DescriptionKeyWordNameLastPointYValue = "DescriptionKeyWordNameLastPointYValue";
+
+ public const string DescriptionKeyWordNameFirstPointYValue = "DescriptionKeyWordNameFirstPointYValue";
+
+ public const string DescriptionNumberFormatTypeCurrency = "DescriptionNumberFormatTypeCurrency";
+
+ public const string DescriptionNumberFormatTypeDecimal = "DescriptionNumberFormatTypeDecimal";
+
+ public const string DescriptionNumberFormatTypeScientific = "DescriptionNumberFormatTypeScientific";
+
+ public const string DescriptionNumberFormatTypeFixedPoint = "DescriptionNumberFormatTypeFixedPoint";
+
+ public const string DescriptionNumberFormatTypeGeneral = "DescriptionNumberFormatTypeGeneral";
+
+ public const string DescriptionNumberFormatTypeNumber = "DescriptionNumberFormatTypeNumber";
+
+ public const string DescriptionNumberFormatTypePercent = "DescriptionNumberFormatTypePercent";
+
+ public const string DescriptionTypeNone = "DescriptionTypeNone";
+
+ public const string DescriptionTypeCustom = "DescriptionTypeCustom";
+
+ public const string DescriptionTypeEmpty = "DescriptionTypeEmpty";
+
+ public const string DescriptionTypePoint = "DescriptionTypePoint";
+
+ public const string LabelKeyFormat = "LabelKeyFormat";
+
+ public const string LabelKeyCustomFormat = "LabelKeyCustomFormat";
+
+ public const string LabelStringWithKeywords = "LabelStringWithKeywords";
+
+ public const string LabelEditKeyword = "LabelEditKeyword";
+
+ public const string LabelInsertNewKeyword = "LabelInsertNewKeyword";
+
+ public const string LabelStringKeywordsEditor = "LabelStringKeywordsEditor";
+
+ public const string LabelKeywordEditor = "LabelKeywordEditor";
+
+ public const string LabelDescription = "LabelDescription";
+
+ public const string LabelFormatKeySample = "LabelFormatKeySample";
+
+ public const string LabelKeyYValueIndex = "LabelKeyYValueIndex";
+
+ public const string LabelKeyPrecision = "LabelKeyPrecision";
+
+ public const string LabelKeyKeywords = "LabelKeyKeywords";
+
+ public const string LabelValueFormatting = "LabelValueFormatting";
+
+ public const string LabelButtonOk = "LabelButtonOk";
+
+ public const string LabelButtonCancel = "LabelButtonCancel";
+
+ public const string DescriptionToolTipCustomFormatCharacters = "DescriptionToolTipCustomFormatCharacters";
+
+ public const string DesciptionCustomLabelEditorTitle = "DesciptionCustomLabelEditorTitle";
+
+ public const string DesciptionCustomLabelFormatInvalid = "DesciptionCustomLabelFormatInvalid";
+
+ public const string LabelStatisticalSumOfSquaresBetweenGroups = "LabelStatisticalSumOfSquaresBetweenGroups";
+
+ public const string LabelStatisticalSumOfSquaresWithinGroups = "LabelStatisticalSumOfSquaresWithinGroups";
+
+ public const string LabelStatisticalSumOfSquaresTotal = "LabelStatisticalSumOfSquaresTotal";
+
+ public const string LabelStatisticalDegreesOfFreedomBetweenGroups = "LabelStatisticalDegreesOfFreedomBetweenGroups";
+
+ public const string LabelStatisticalDegreesOfFreedomWithinGroups = "LabelStatisticalDegreesOfFreedomWithinGroups";
+
+ public const string LabelStatisticalDegreesOfFreedomTotal = "LabelStatisticalDegreesOfFreedomTotal";
+
+ public const string LabelStatisticalMeanSquareVarianceBetweenGroups = "LabelStatisticalMeanSquareVarianceBetweenGroups";
+
+ public const string LabelStatisticalMeanSquareVarianceWithinGroups = "LabelStatisticalMeanSquareVarianceWithinGroups";
+
+ public const string LabelStatisticalFRatio = "LabelStatisticalFRatio";
+
+ public const string LabelStatisticalFCriteria = "LabelStatisticalFCriteria";
+
+ public const string LabelStatisticalCorrelation = "LabelStatisticalCorrelation";
+
+ public const string LabelStatisticalCovariance = "LabelStatisticalCovariance";
+
+ public const string LabelStatisticalProbability = "LabelStatisticalProbability";
+
+ public const string LabelStatisticalAverage = "LabelStatisticalAverage";
+
+ public const string LabelStatisticalVariance = "LabelStatisticalVariance";
+
+ public const string LabelStatisticalMedian = "LabelStatisticalMedian";
+
+ public const string LabelStatisticalBetaFunction = "LabelStatisticalBetaFunction";
+
+ public const string LabelStatisticalGammaFunction = "LabelStatisticalGammaFunction";
+
+ public const string LabelStatisticalTheFirstGroupMean = "LabelStatisticalTheFirstGroupMean";
+
+ public const string LabelStatisticalTheSecondGroupMean = "LabelStatisticalTheSecondGroupMean";
+
+ public const string LabelStatisticalTheFirstGroupVariance = "LabelStatisticalTheFirstGroupVariance";
+
+ public const string LabelStatisticalTheSecondGroupVariance = "LabelStatisticalTheSecondGroupVariance";
+
+ public const string LabelStatisticalFValue = "LabelStatisticalFValue";
+
+ public const string LabelStatisticalFCriticalValueOneTail = "LabelStatisticalFCriticalValueOneTail";
+
+ public const string LabelStatisticalZValue = "LabelStatisticalZValue";
+
+ public const string LabelStatisticalZCriticalValueOneTail = "LabelStatisticalZCriticalValueOneTail";
+
+ public const string LabelStatisticalZCriticalValueTwoTail = "LabelStatisticalZCriticalValueTwoTail";
+
+ public const string LabelStatisticalPZLessEqualSmallZOneTail = "LabelStatisticalPZLessEqualSmallZOneTail";
+
+ public const string LabelStatisticalPZLessEqualSmallZTwoTail = "LabelStatisticalPZLessEqualSmallZTwoTail";
+
+ public const string LabelStatisticalPFLessEqualSmallFOneTail = "LabelStatisticalPFLessEqualSmallFOneTail";
+
+ public const string LabelStatisticalTValue = "LabelStatisticalTValue";
+
+ public const string LabelStatisticalDegreeOfFreedom = "LabelStatisticalDegreeOfFreedom";
+
+ public const string LabelStatisticalPTLessEqualSmallTOneTail = "LabelStatisticalPTLessEqualSmallTOneTail";
+
+ public const string LabelStatisticalSmallTCrititcalOneTail = "LabelStatisticalSmallTCrititcalOneTail";
+
+ public const string LabelStatisticalPTLessEqualSmallTTwoTail = "LabelStatisticalPTLessEqualSmallTTwoTail";
+
+ public const string LabelStatisticalSmallTCrititcalTwoTail = "LabelStatisticalSmallTCrititcalTwoTail";
+
+ public const string EvenLogMessageChartImageFileTimeToLive = "EvenLogMessageChartImageFileTimeToLive";
+
+ public const string MessageYValueIndexInvalid = "MessageYValueIndexInvalid";
+
+ public const string MessagePrecisionInvalid = "MessagePrecisionInvalid";
+
+ public const string MessageChangingChartAreaPositionProperty = "MessageChangingChartAreaPositionProperty";
+
+ public const string MessageChangingChartAreaPositionConfirmAutomatic = "MessageChangingChartAreaPositionConfirmAutomatic";
+
+ public const string MessageChangingChartAreaPositionConfirmCustom = "MessageChangingChartAreaPositionConfirmCustom";
+
+ public const string MessageChartException = "MessageChartException";
+
+ public const string MessageSite = "MessageSite";
+
+ public const string MessageStackTrace = "MessageStackTrace";
+
+ public const string MessageChartTitle = "MessageChartTitle";
+
+ public const string TitleAxisX = "TitleAxisX";
+
+ public const string TitleAxisY = "TitleAxisY";
+
+ public const string TitleAxisX2 = "TitleAxisX2";
+
+ public const string TitleAxisY2 = "TitleAxisY2";
+
+ public const string FormulaNamePriceIndicators = "FormulaNamePriceIndicators";
+
+ public const string FormulaNameGeneralTechnicalIndicators = "FormulaNameGeneralTechnicalIndicators";
+
+ public const string FormulaNameTechnicalVolumeIndicators = "FormulaNameTechnicalVolumeIndicators";
+
+ public const string FormulaNameOscillator = "FormulaNameOscillator";
+
+ public const string FormulaNameGeneralFormulas = "FormulaNameGeneralFormulas";
+
+ public const string FormulaNameTimeSeriesAndForecasting = "FormulaNameTimeSeriesAndForecasting";
+
+ public const string FormulaNameStatisticalAnalysis = "FormulaNameStatisticalAnalysis";
+
+ public const string FormulaNameVolumeIndicators = "FormulaNameVolumeIndicators";
+
+ public const string LabelTextRow = "LabelTextRow";
+
+ public const string DescriptionAttributeBackImage = "DescriptionAttributeBackImage";
+
+ public const string DescriptionAttributeMarkerImage = "DescriptionAttributeMarkerImage";
+
+ public const string DescriptionAttributeAnnotationBaseY = "DescriptionAttributeAnnotationBaseY";
+
+ public const string DescriptionAttributeAnnotationWidth = "DescriptionAttributeAnnotationWidth";
+
+ public const string DescriptionAttributeAnnotationHeight = "DescriptionAttributeAnnotationHeight";
+
+ public const string DescriptionAttributeAnnotationClipToChartArea = "DescriptionAttributeAnnotationClipToChartArea";
+
+ public const string DescriptionAttributeAnnotationBaseX = "DescriptionAttributeAnnotationBaseX";
+
+ public const string DescriptionAttributeChartImageType = "DescriptionAttributeChartImageType";
+
+ public const string DescriptionAttributeMultiValueSeparator = "DescriptionAttributeMultiValueSeparator";
+
+ public const string DescriptionAttributeDataSeriesGroupID = "DescriptionAttributeDataSeriesGroupID";
+
+ public const string DescriptionAttributeSuppressCodeExceptions = "DescriptionAttributeSuppressCodeExceptions";
+
+ public const string DescriptionAttributeNoDataMessage = "DescriptionAttributeNoDataMessage";
+
+ public const string DescriptionAttributeReverseSeriesOrder = "DescriptionAttributeReverseSeriesOrder";
+
+ public const string DescriptionAttributeUserDefined = "DescriptionAttributeUserDefined";
+
+ public const string DescriptionAttributeChartEvent_GetToolTipText = "DescriptionAttributeChartEvent_GetToolTipText";
+
+ public const string DescriptionAttributeArrowAnnotation_ArrowSize = "DescriptionAttributeArrowAnnotation_ArrowSize";
+
+ public const string DescriptionAttributeChartSerializer_Content = "DescriptionAttributeChartSerializer_Content";
+
+ public const string DescriptionAttributeLegend_Enabled = "DescriptionAttributeLegend_Enabled";
+
+ public const string DescriptionAttributeEnabled5 = "DescriptionAttributeEnabled5";
+
+ public const string DescriptionAttributeAxisScaleBreakStyle_Enabled = "DescriptionAttributeAxisScaleBreakStyle_Enabled";
+
+ public const string DescriptionAttributeEnabled7 = "DescriptionAttributeEnabled7";
+
+ public const string DescriptionAttributeLabel_Enabled = "DescriptionAttributeLabel_Enabled";
+
+ public const string DescriptionAttributeLegendItem_Enabled = "DescriptionAttributeLegendItem_Enabled";
+
+ public const string DescriptionAttributeAxisScrollBar_Enabled = "DescriptionAttributeAxisScrollBar_Enabled";
+
+ public const string DescriptionAttributeEnabled13 = "DescriptionAttributeEnabled13";
+
+ public const string DescriptionAttributeSeries_Enabled = "DescriptionAttributeSeries_Enabled";
+
+ public const string DescriptionAttributeLegendCell_CellSpan = "DescriptionAttributeLegendCell_CellSpan";
+
+ public const string DescriptionAttributeCursor_SelectionColor = "DescriptionAttributeCursor_SelectionColor";
+
+ public const string DescriptionAttributeInterlaced = "DescriptionAttributeInterlaced";
+
+ public const string DescriptionAttributeMapArea_Coordinates = "DescriptionAttributeMapArea_Coordinates";
+
+ public const string DescriptionAttributeChartEvent_PostPaint = "DescriptionAttributeChartEvent_PostPaint";
+
+ public const string DescriptionAttributeStripLine_Title = "DescriptionAttributeStripLine_Title";
+
+ public const string DescriptionAttributeLegend_Title = "DescriptionAttributeLegend_Title";
+
+ public const string DescriptionAttributeTitle5 = "DescriptionAttributeTitle5";
+
+ public const string DescriptionAttributeTitle6 = "DescriptionAttributeTitle6";
+
+ public const string DescriptionAttributeAnnotation_Annotation = "DescriptionAttributeAnnotation_Annotation";
+
+ public const string DescriptionAttributeTitleFont = "DescriptionAttributeTitleFont";
+
+ public const string DescriptionAttributeChartArea_Axes = "DescriptionAttributeChartArea_Axes";
+
+ public const string DescriptionAttributeChartSerializer_NonSerializableContent = "DescriptionAttributeChartSerializer_NonSerializableContent";
+
+ public const string DescriptionAttributeShadowOffset = "DescriptionAttributeShadowOffset";
+
+ public const string DescriptionAttributeCalloutLineAnchorCap = "DescriptionAttributeCalloutLineAnchorCap";
+
+ public const string DescriptionAttributeMapAreaAttributes = "DescriptionAttributeMapAreaAttributes";
+
+ public const string DescriptionAttributeSubAxis_SubAxis = "DescriptionAttributeSubAxis_SubAxis";
+
+ public const string DescriptionAttributeMajorGrid = "DescriptionAttributeMajorGrid";
+
+ public const string DescriptionAttributeElementPosition_Y = "DescriptionAttributeElementPosition_Y";
+
+ public const string DescriptionAttributeAnnotationPathPoint_Y = "DescriptionAttributeAnnotationPathPoint_Y";
+
+ public const string DescriptionAttributeToolTipEventArgs_Y = "DescriptionAttributeToolTipEventArgs_Y";
+
+ public const string DescriptionAttributePoint3D_Y = "DescriptionAttributePoint3D_Y";
+
+ public const string DescriptionAttributePoint3D_Z = "DescriptionAttributePoint3D_Z";
+
+ public const string DescriptionAttributeMajorTickMark = "DescriptionAttributeMajorTickMark";
+
+ public const string DescriptionAttributeDrawInfinitive = "DescriptionAttributeDrawInfinitive";
+
+ public const string DescriptionAttributeAxisDataView_MinSize = "DescriptionAttributeAxisDataView_MinSize";
+
+ public const string DescriptionAttributeLegendCellColumnCollection_LegendCellColumnCollection = "DescriptionAttributeLegendCellColumnCollection_LegendCellColumnCollection";
+
+ public const string DescriptionAttributeMarkerOverlapping = "DescriptionAttributeMarkerOverlapping";
+
+ public const string DescriptionAttributeChart_OnCustomizeLegend = "DescriptionAttributeChart_OnCustomizeLegend";
+
+ public const string DescriptionAttributeLegendCellColumn_HeaderTextAlignment = "DescriptionAttributeLegendCellColumn_HeaderTextAlignment";
+
+ public const string DescriptionAttributeScrollBarEventArgs_MousePositionY = "DescriptionAttributeScrollBarEventArgs_MousePositionY";
+
+ public const string DescriptionAttributeNamedImage_NamedImage = "DescriptionAttributeNamedImage_NamedImage";
+
+ public const string DescriptionAttributeScrollBar = "DescriptionAttributeScrollBar";
+
+ public const string DescriptionAttributeMapArea_MapArea = "DescriptionAttributeMapArea_MapArea";
+
+ public const string DescriptionAttributeLegend_CustomItems = "DescriptionAttributeLegend_CustomItems";
+
+ public const string DescriptionAttributeAnnotationSmartLabelsStyle_AnnotationSmartLabelsStyle = "DescriptionAttributeAnnotationSmartLabelsStyle_AnnotationSmartLabelsStyle";
+
+ public const string DescriptionAttributePolylineAnnotation_PolylineAnnotation = "DescriptionAttributePolylineAnnotation_PolylineAnnotation";
+
+ public const string DescriptionAttributeChartEvent_AxisViewChanged = "DescriptionAttributeChartEvent_AxisViewChanged";
+
+ public const string DescriptionAttributeCrossing = "DescriptionAttributeCrossing";
+
+ public const string DescriptionAttributeMargins_Top = "DescriptionAttributeMargins_Top";
+
+ public const string DescriptionAttributeLegendCellColumn_HeaderFont = "DescriptionAttributeLegendCellColumn_HeaderFont";
+
+ public const string DescriptionAttributeLegend_InterlacedRows = "DescriptionAttributeLegend_InterlacedRows";
+
+ public const string DescriptionAttributeAxisDataView_MinSizeType = "DescriptionAttributeAxisDataView_MinSizeType";
+
+ public const string DescriptionAttributeLineWidth = "DescriptionAttributeLineWidth";
+
+ public const string DescriptionAttributeDataPoint_XValue = "DescriptionAttributeDataPoint_XValue";
+
+ public const string DescriptionAttributeChartArea_AxisY2 = "DescriptionAttributeChartArea_AxisY2";
+
+ public const string DescriptionAttributeChartArea_AxisX2 = "DescriptionAttributeChartArea_AxisX2";
+
+ public const string DescriptionAttributeChartEvent_AnnotationPositionChanging = "DescriptionAttributeChartEvent_AnnotationPositionChanging";
+
+ public const string DescriptionAttributeStripLine_StripLine = "DescriptionAttributeStripLine_StripLine";
+
+ public const string DescriptionAttributeBorderColor = "DescriptionAttributeBorderColor";
+
+ public const string DescriptionAttributeMarkerBorderColor = "DescriptionAttributeMarkerBorderColor";
+
+ public const string DescriptionAttributeLegendText = "DescriptionAttributeLegendText";
+
+ public const string DescriptionAttributeCustomLabel_LabelMark = "DescriptionAttributeCustomLabel_LabelMark";
+
+ public const string DescriptionAttributeTextAntiAliasingQuality = "DescriptionAttributeTextAntiAliasingQuality";
+
+ public const string DescriptionAttributeAllowMoving = "DescriptionAttributeAllowMoving";
+
+ public const string DescriptionAttributeCalloutAnnotation_CalloutAnnotation = "DescriptionAttributeCalloutAnnotation_CalloutAnnotation";
+
+ public const string DescriptionAttributeStripLine_Name = "DescriptionAttributeStripLine_Name";
+
+ public const string DescriptionAttributeTitle_Name = "DescriptionAttributeTitle_Name";
+
+ public const string DescriptionAttributeName4 = "DescriptionAttributeName4";
+
+ public const string DescriptionAttributeAnnotationPathPoint_Name = "DescriptionAttributeAnnotationPathPoint_Name";
+
+ public const string DescriptionAttributeLegendCell_Name = "DescriptionAttributeLegendCell_Name";
+
+ public const string DescriptionAttributeMapArea_Name = "DescriptionAttributeMapArea_Name";
+
+ public const string DescriptionAttributeSeries_Name = "DescriptionAttributeSeries_Name";
+
+ public const string DescriptionAttributeAxis_Name = "DescriptionAttributeAxis_Name";
+
+ public const string DescriptionAttributeNamedImage_Name = "DescriptionAttributeNamedImage_Name";
+
+ public const string DescriptionAttributeSubAxis_Name = "DescriptionAttributeSubAxis_Name";
+
+ public const string DescriptionAttributeDataPoint_Name = "DescriptionAttributeDataPoint_Name";
+
+ public const string DescriptionAttributeLegendCellColumn_Name = "DescriptionAttributeLegendCellColumn_Name";
+
+ public const string DescriptionAttributeLegendItem_Name = "DescriptionAttributeLegendItem_Name";
+
+ public const string DescriptionAttributeLegend_Name = "DescriptionAttributeLegend_Name";
+
+ public const string DescriptionAttributeCustomLabel_Name = "DescriptionAttributeCustomLabel_Name";
+
+ public const string DescriptionAttributeChartArea_Name = "DescriptionAttributeChartArea_Name";
+
+ public const string DescriptionAttributeCursor_Cursor = "DescriptionAttributeCursor_Cursor";
+
+ public const string DescriptionAttributeAnchorX = "DescriptionAttributeAnchorX";
+
+ public const string DescriptionAttributeToolTip = "DescriptionAttributeToolTip";
+
+ public const string DescriptionAttributeLegend_TableStyle = "DescriptionAttributeLegend_TableStyle";
+
+ public const string DescriptionAttributeDataPoint_Empty = "DescriptionAttributeDataPoint_Empty";
+
+ public const string DescriptionAttributeScrollBarEventArgs_Handled = "DescriptionAttributeScrollBarEventArgs_Handled";
+
+ public const string DescriptionAttributeAxisLabel = "DescriptionAttributeAxisLabel";
+
+ public const string DescriptionAttributeAnnotationGroup_AllowPathEditing = "DescriptionAttributeAnnotationGroup_AllowPathEditing";
+
+ public const string DescriptionAttributeAllowPathEditing3 = "DescriptionAttributeAllowPathEditing3";
+
+ public const string DescriptionAttributeChart_OnPaint = "DescriptionAttributeChart_OnPaint";
+
+ public const string DescriptionAttributeCalloutAnnotation_AnchorOffsetX = "DescriptionAttributeCalloutAnnotation_AnchorOffsetX";
+
+ public const string DescriptionAttributeAnchorOffsetX3 = "DescriptionAttributeAnchorOffsetX3";
+
+ public const string DescriptionAttributeCalloutAnnotation_AnchorOffsetY = "DescriptionAttributeCalloutAnnotation_AnchorOffsetY";
+
+ public const string DescriptionAttributeAnchorOffsetY3 = "DescriptionAttributeAnchorOffsetY3";
+
+ public const string DescriptionAttributeChartEvent_CursorPositionChanging = "DescriptionAttributeChartEvent_CursorPositionChanging";
+
+ public const string DescriptionAttributeScrollBarEventArgs_ButtonType = "DescriptionAttributeScrollBarEventArgs_ButtonType";
+
+ public const string DescriptionAttributeLabelsAutoFitStyle = "DescriptionAttributeLabelsAutoFitStyle";
+
+ public const string DescriptionAttributeLabelStyle = "DescriptionAttributeLabelStyle";
+
+ public const string DescriptionAttributeStripLine_IntervalOffsetType = "DescriptionAttributeStripLine_IntervalOffsetType";
+
+ public const string DescriptionAttributeLabel_IntervalOffsetType = "DescriptionAttributeLabel_IntervalOffsetType";
+
+ public const string DescriptionAttributeIntervalOffsetType4 = "DescriptionAttributeIntervalOffsetType4";
+
+ public const string DescriptionAttributeCursor_IntervalOffsetType = "DescriptionAttributeCursor_IntervalOffsetType";
+
+ public const string DescriptionAttributeIntervalOffsetType6 = "DescriptionAttributeIntervalOffsetType6";
+
+ public const string DescriptionAttributeAxisScaleSegment_IntervalOffsetType = "DescriptionAttributeAxisScaleSegment_IntervalOffsetType";
+
+ public const string DescriptionAttributeReverse = "DescriptionAttributeReverse";
+
+ public const string DescriptionAttributeSeries_Points = "DescriptionAttributeSeries_Points";
+
+ public const string DescriptionAttributeBorderSkin_SkinStyle = "DescriptionAttributeBorderSkin_SkinStyle";
+
+ public const string DescriptionAttributeChartArea3DStyle_Clustered = "DescriptionAttributeChartArea3DStyle_Clustered";
+
+ public const string DescriptionAttributeAnchorDataPointName = "DescriptionAttributeAnchorDataPointName";
+
+ public const string DescriptionAttributeChartEvent_AnnotationPositionChanged = "DescriptionAttributeChartEvent_AnnotationPositionChanged";
+
+ public const string DescriptionAttributeChartArea3DStyle_PointGapDepth = "DescriptionAttributeChartArea3DStyle_PointGapDepth";
+
+ public const string DescriptionAttributeLegend_Reversed = "DescriptionAttributeLegend_Reversed";
+
+ public const string DescriptionAttributeAnnotation_AnnotationType = "DescriptionAttributeAnnotation_AnnotationType";
+
+ public const string DescriptionAttributeTextAnnotation_AnnotationType = "DescriptionAttributeTextAnnotation_AnnotationType";
+
+ public const string DescriptionAttributeAnnotationType = "DescriptionAttributeAnnotationType";
+
+ public const string DescriptionAttributeBorderSkin_FrameBorderDashStyle = "DescriptionAttributeBorderSkin_FrameBorderDashStyle";
+
+ public const string DescriptionAttributeLegend_HeaderSeparatorColor = "DescriptionAttributeLegend_HeaderSeparatorColor";
+
+ public const string DescriptionAttributeChartEvent_AnnotationSelectionChanged = "DescriptionAttributeChartEvent_AnnotationSelectionChanged";
+
+ public const string DescriptionAttributeFont = "DescriptionAttributeFont";
+
+ public const string DescriptionAttributeLegend_Font = "DescriptionAttributeLegend_Font";
+
+ public const string DescriptionAttributeLegendCellColumn_Font = "DescriptionAttributeLegendCellColumn_Font";
+
+ public const string DescriptionAttributeLabel_Font = "DescriptionAttributeLabel_Font";
+
+ public const string DescriptionAttributeTitle_Font = "DescriptionAttributeTitle_Font";
+
+ public const string DescriptionAttributeLegendCell_Font = "DescriptionAttributeLegendCell_Font";
+
+ public const string DescriptionAttributeSeries_ValueMemberX = "DescriptionAttributeSeries_ValueMemberX";
+
+ public const string DescriptionAttributeArrows = "DescriptionAttributeArrows";
+
+ public const string DescriptionAttributeType = "DescriptionAttributeType";
+
+ public const string DescriptionAttributeSeries_Type = "DescriptionAttributeSeries_Type";
+
+ public const string DescriptionAttributeBorder3DAnnotation_Border3DAnnotation = "DescriptionAttributeBorder3DAnnotation_Border3DAnnotation";
+
+ public const string DescriptionAttributeChart_Images = "DescriptionAttributeChart_Images";
+
+ public const string DescriptionAttributeLegendToolTip = "DescriptionAttributeLegendToolTip";
+
+ public const string DescriptionAttributeCustomLabel_CustomLabel = "DescriptionAttributeCustomLabel_CustomLabel";
+
+ public const string DescriptionAttributeChartEvent_AnnotationPlaced = "DescriptionAttributeChartEvent_AnnotationPlaced";
+
+ public const string DescriptionAttributeBackColor = "DescriptionAttributeBackColor";
+
+ public const string DescriptionAttributeCalloutBackColor = "DescriptionAttributeCalloutBackColor";
+
+ public const string DescriptionAttributeFrameBackColor = "DescriptionAttributeFrameBackColor";
+
+ public const string DescriptionAttributeTitleBackColor = "DescriptionAttributeTitleBackColor";
+
+ public const string DescriptionAttributeLabelBackColor = "DescriptionAttributeLabelBackColor";
+
+ public const string DescriptionAttributeHeaderBackColor = "DescriptionAttributeHeaderBackColor";
+
+ public const string DescriptionAttributeLabel_ShowEndLabels = "DescriptionAttributeLabel_ShowEndLabels";
+
+ public const string DescriptionAttributeLabelToolTip = "DescriptionAttributeLabelToolTip";
+
+ public const string DescriptionAttributeSeries_MarkerStep = "DescriptionAttributeSeries_MarkerStep";
+
+ public const string DescriptionAttributeTickMark_Style = "DescriptionAttributeTickMark_Style";
+
+ public const string DescriptionAttribute_TextOrientation = "DescriptionAttribute_TextOrientation";
+
+ public const string DescriptionAttributeLegendItem_Style = "DescriptionAttributeLegendItem_Style";
+
+ public const string DescriptionAttributeChartArea3DStyle_Rotation = "DescriptionAttributeChartArea3DStyle_Rotation";
+
+ public const string DescriptionAttributeSizeAlwaysRelative = "DescriptionAttributeSizeAlwaysRelative";
+
+ public const string DescriptionAttributeSizeAlwaysRelative3 = "DescriptionAttributeSizeAlwaysRelative3";
+
+ public const string DescriptionAttributeAnnotationGroup_SizeAlwaysRelative = "DescriptionAttributeAnnotationGroup_SizeAlwaysRelative";
+
+ public const string DescriptionAttributeChart_BorderlineWidth = "DescriptionAttributeChart_BorderlineWidth";
+
+ public const string DescriptionAttributeSeries_XValueIndexed = "DescriptionAttributeSeries_XValueIndexed";
+
+ public const string DescriptionAttributeEllipseAnnotation_EllipseAnnotation = "DescriptionAttributeEllipseAnnotation_EllipseAnnotation";
+
+ public const string DescriptionAttributeAnchorAlignment = "DescriptionAttributeAnchorAlignment";
+
+ public const string DescriptionAttributeWidth = "DescriptionAttributeWidth";
+
+ public const string DescriptionAttributeElementPosition_Width = "DescriptionAttributeElementPosition_Width";
+
+ public const string DescriptionAttributeAxisXName = "DescriptionAttributeAxisXName";
+
+ public const string DescriptionAttributeChartArea3DStyle_Inclination = "DescriptionAttributeChartArea3DStyle_Inclination";
+
+ public const string DescriptionAttributeLegendCollection_LegendCollection = "DescriptionAttributeLegendCollection_LegendCollection";
+
+ public const string DescriptionAttributeAxisYName = "DescriptionAttributeAxisYName";
+
+ public const string DescriptionAttributeAxisScaleSegment_Spacing = "DescriptionAttributeAxisScaleSegment_Spacing";
+
+ public const string DescriptionAttributeAxisScaleBreakStyle_Spacing = "DescriptionAttributeAxisScaleBreakStyle_Spacing";
+
+ public const string DescriptionAttributeSelected = "DescriptionAttributeSelected";
+
+ public const string DescriptionAttributeAnnotationGroup_Selected = "DescriptionAttributeAnnotationGroup_Selected";
+
+ public const string DescriptionAttributeVerticalLineAnnotation_VerticalLineAnnotation = "DescriptionAttributeVerticalLineAnnotation_VerticalLineAnnotation";
+
+ public const string DescriptionAttributeLabelsAutoFitMaxFontSize = "DescriptionAttributeLabelsAutoFitMaxFontSize";
+
+ public const string DescriptionAttributeFreeDrawPlacement = "DescriptionAttributeFreeDrawPlacement";
+
+ public const string DescriptionAttributeStripLinesCollection_StripLinesCollection = "DescriptionAttributeStripLinesCollection_StripLinesCollection";
+
+ public const string DescriptionAttributeAxisDataView_IsZoomed = "DescriptionAttributeAxisDataView_IsZoomed";
+
+ public const string DescriptionAttributeChartArea3DStyle_Perspective = "DescriptionAttributeChartArea3DStyle_Perspective";
+
+ public const string DescriptionAttributeChart_OnCustomize = "DescriptionAttributeChart_OnCustomize";
+
+ public const string DescriptionAttributeLabel = "DescriptionAttributeLabel";
+
+ public const string DescriptionAttributeLabel_Label = "DescriptionAttributeLabel_Label";
+
+ public const string DescriptionAttributeStartCap3 = "DescriptionAttributeStartCap3";
+
+ public const string DescriptionAttributeFontColor = "DescriptionAttributeFontColor";
+
+ public const string DescriptionAttributeLegendFontColor = "DescriptionAttributeLegendFontColor";
+
+ public const string DescriptionAttributeLabel_OffsetLabels = "DescriptionAttributeLabel_OffsetLabels";
+
+ public const string DescriptionAttributeMargin = "DescriptionAttributeMargin";
+
+ public const string DescriptionAttributeAnnotationPositionChangingEventArgs_AnnotationPositionChangingEventArgs = "DescriptionAttributeAnnotationPositionChangingEventArgs_AnnotationPositionChangin" +
+ "gEventArgs";
+
+ public const string DescriptionAttributeCursorEventArgs_NewSelectionStart = "DescriptionAttributeCursorEventArgs_NewSelectionStart";
+
+ public const string DescriptionAttributeSeries_XSubAxisName = "DescriptionAttributeSeries_XSubAxisName";
+
+ public const string DescriptionAttributeHideOverlapped = "DescriptionAttributeHideOverlapped";
+
+ public const string DescriptionAttributeLegendCellColumn_MaximumWidth = "DescriptionAttributeLegendCellColumn_MaximumWidth";
+
+ public const string DescriptionAttributeLegend_InsideChartArea = "DescriptionAttributeLegend_InsideChartArea";
+
+ public const string DescriptionAttributeImageTransparentColor = "DescriptionAttributeImageTransparentColor";
+
+ public const string DescriptionAttributeLegend_EquallySpacedItems = "DescriptionAttributeLegend_EquallySpacedItems";
+
+ public const string DescriptionAttributeChartArea_CursorY = "DescriptionAttributeChartArea_CursorY";
+
+ public const string DescriptionAttributeChart_Printing = "DescriptionAttributeChart_Printing";
+
+ public const string DescriptionAttributeAxis = "DescriptionAttributeAxis";
+
+ public const string DescriptionAttributeAxis_Axis = "DescriptionAttributeAxis_Axis";
+
+ public const string DescriptionAttributeBackImageAlign = "DescriptionAttributeBackImageAlign";
+
+ public const string DescriptionAttributeShowInLegend = "DescriptionAttributeShowInLegend";
+
+ public const string DescriptionAttributeChartSerializer_ChartSerializer = "DescriptionAttributeChartSerializer_ChartSerializer";
+
+ public const string DescriptionAttributeChart_Compression = "DescriptionAttributeChart_Compression";
+
+ public const string DescriptionAttributeChartImage_Compression = "DescriptionAttributeChartImage_Compression";
+
+ public const string DescriptionAttributeCursor_AutoScroll = "DescriptionAttributeCursor_AutoScroll";
+
+ public const string DescriptionAttributeElementPosition_Height = "DescriptionAttributeElementPosition_Height";
+
+ public const string DescriptionAttributeHeight3 = "DescriptionAttributeHeight3";
+
+ public const string DescriptionAttributeChart_ViewStateContent = "DescriptionAttributeChart_ViewStateContent";
+
+ public const string DescriptionAttributeAxisDataView_SmallScrollSizeType = "DescriptionAttributeAxisDataView_SmallScrollSizeType";
+
+ public const string DescriptionAttributeLegend_CellColumns = "DescriptionAttributeLegend_CellColumns";
+
+ public const string DescriptionAttributeAxisScrollBar_Buttons = "DescriptionAttributeAxisScrollBar_Buttons";
+
+ public const string DescriptionAttributeLegends = "DescriptionAttributeLegends";
+
+ public const string DescriptionAttributeElementPosition_X = "DescriptionAttributeElementPosition_X";
+
+ public const string DescriptionAttributeAnnotationPathPoint_X = "DescriptionAttributeAnnotationPathPoint_X";
+
+ public const string DescriptionAttributePoint3D_X = "DescriptionAttributePoint3D_X";
+
+ public const string DescriptionAttributeToolTipEventArgs_X = "DescriptionAttributeToolTipEventArgs_X";
+
+ public const string DescriptionAttributeCustomAttributesExtended = "DescriptionAttributeCustomAttributesExtended";
+
+ public const string DescriptionAttributeMargins_Left = "DescriptionAttributeMargins_Left";
+
+ public const string DescriptionAttributeAxisScrollBar_PositionInside = "DescriptionAttributeAxisScrollBar_PositionInside";
+
+ public const string DescriptionAttributeSeries_ValueMembersY = "DescriptionAttributeSeries_ValueMembersY";
+
+ public const string DescriptionAttributeSmartLabelsStyle_SmartLabelsStyle = "DescriptionAttributeSmartLabelsStyle_SmartLabelsStyle";
+
+ public const string DescriptionAttributeChartEvent_SelectionRangeChanging = "DescriptionAttributeChartEvent_SelectionRangeChanging";
+
+ public const string DescriptionAttributeLabelsAutoFitMinFontSize = "DescriptionAttributeLabelsAutoFitMinFontSize";
+
+ public const string DescriptionAttributeMaxMovingDistance = "DescriptionAttributeMaxMovingDistance";
+
+ public const string DescriptionAttributeTitle_DockToChartArea = "DescriptionAttributeTitle_DockToChartArea";
+
+ public const string DescriptionAttributeLegend_DockToChartArea = "DescriptionAttributeLegend_DockToChartArea";
+
+ public const string DescriptionAttributeChartArea3DStyle_RightAngleAxes = "DescriptionAttributeChartArea3DStyle_RightAngleAxes";
+
+ public const string DescriptionAttributeLegend_LegendStyle = "DescriptionAttributeLegend_LegendStyle";
+
+ public const string DescriptionAttributeAxisDataView_AxisDataView = "DescriptionAttributeAxisDataView_AxisDataView";
+
+ public const string DescriptionAttributeBorderDashStyle = "DescriptionAttributeBorderDashStyle";
+
+ public const string DescriptionAttributeLabelBorderDashStyle = "DescriptionAttributeLabelBorderDashStyle";
+
+ public const string DescriptionAttributeBackSecondaryColor = "DescriptionAttributeBackSecondaryColor";
+
+ public const string DescriptionAttributeBorderSkin_FrameBackSecondaryColor = "DescriptionAttributeBorderSkin_FrameBackSecondaryColor";
+
+ public const string DescriptionAttributeLegend_TitleSeparator = "DescriptionAttributeLegend_TitleSeparator";
+
+ public const string DescriptionAttributeChartArea_InnerPlotPosition = "DescriptionAttributeChartArea_InnerPlotPosition";
+
+ public const string DescriptionAttributeChartEvent_CustomizeLegend = "DescriptionAttributeChartEvent_CustomizeLegend";
+
+ public const string DescriptionAttributeAnnotationPathPoint_AnnotationPathPoint = "DescriptionAttributeAnnotationPathPoint_AnnotationPathPoint";
+
+ public const string DescriptionAttributeDataPoint_YValues = "DescriptionAttributeDataPoint_YValues";
+
+ public const string DescriptionAttributeCustomLabel_RowIndex = "DescriptionAttributeCustomLabel_RowIndex";
+
+ public const string DescriptionAttributeSeries_YSubAxisName = "DescriptionAttributeSeries_YSubAxisName";
+
+ public const string DescriptionAttributeChartArea_AlignType = "DescriptionAttributeChartArea_AlignType";
+
+ public const string DescriptionAttributeAllowResizing = "DescriptionAttributeAllowResizing";
+
+ public const string DescriptionAttributeShowLabelAsValue = "DescriptionAttributeShowLabelAsValue";
+
+ public const string DescriptionAttributeForeColor = "DescriptionAttributeForeColor";
+
+ public const string DescriptionAttributePathPoints = "DescriptionAttributePathPoints";
+
+ public const string DescriptionAttributeViewEventArgs_NewSizeType = "DescriptionAttributeViewEventArgs_NewSizeType";
+
+ public const string DescriptionAttributeChart_BuildNumber = "DescriptionAttributeChart_BuildNumber";
+
+ public const string DescriptionAttributeAxisScaleSegmentCollection_AxisScaleSegmentCollection = "DescriptionAttributeAxisScaleSegmentCollection_AxisScaleSegmentCollection";
+
+ public const string DescriptionAttributeMarkerSize = "DescriptionAttributeMarkerSize";
+
+ public const string DescriptionAttributeLegendItem_MarkerSize = "DescriptionAttributeLegendItem_MarkerSize";
+
+ public const string DescriptionAttributeLegendCell_SeriesSymbolSize = "DescriptionAttributeLegendCell_SeriesSymbolSize";
+
+ public const string DescriptionAttributeLegendCellColumn_SeriesSymbolSize = "DescriptionAttributeLegendCellColumn_SeriesSymbolSize";
+
+ public const string DescriptionAttributeDisabled = "DescriptionAttributeDisabled";
+
+ public const string DescriptionAttributeChartSerializer_ResetWhenLoading = "DescriptionAttributeChartSerializer_ResetWhenLoading";
+
+ public const string DescriptionAttributeBackGradientStyle = "DescriptionAttributeBackGradientStyle";
+
+ public const string DescriptionAttributeDataSource = "DescriptionAttributeDataSource";
+
+ public const string DescriptionAttributeCustomLabels = "DescriptionAttributeCustomLabels";
+
+ public const string DescriptionAttributeArrowAnnotation_ArrowAnnotation = "DescriptionAttributeArrowAnnotation_ArrowAnnotation";
+
+ public const string DescriptionAttributeCursor_AxisType = "DescriptionAttributeCursor_AxisType";
+
+ public const string DescriptionAttributeLegendItem_Cells = "DescriptionAttributeLegendItem_Cells";
+
+ public const string DescriptionAttributeBorderSkin = "DescriptionAttributeBorderSkin";
+
+ public const string DescriptionAttributeBorderSkin_BorderSkin = "DescriptionAttributeBorderSkin_BorderSkin";
+
+ public const string DescriptionAttributeSubAxisCollection_SubAxisCollection = "DescriptionAttributeSubAxisCollection_SubAxisCollection";
+
+ public const string DescriptionAttributeAllowSelecting = "DescriptionAttributeAllowSelecting";
+
+ public const string DescriptionAttributeChartEvent_Customize = "DescriptionAttributeChartEvent_Customize";
+
+ public const string DescriptionAttributeChartEvent_Click = "DescriptionAttributeChartEvent_Click";
+
+ public const string DescriptionAttributeImageAnnotation_ImageAnnotation = "DescriptionAttributeImageAnnotation_ImageAnnotation";
+
+ public const string DescriptionAttributeAxisDataView_SmallScrollSize = "DescriptionAttributeAxisDataView_SmallScrollSize";
+
+ public const string DescriptionAttributeAxisScaleSegment_Interval = "DescriptionAttributeAxisScaleSegment_Interval";
+
+ public const string DescriptionAttributeCursor_Interval = "DescriptionAttributeCursor_Interval";
+
+ public const string DescriptionAttributeInterval4 = "DescriptionAttributeInterval4";
+
+ public const string DescriptionAttributeStripLine_Interval = "DescriptionAttributeStripLine_Interval";
+
+ public const string DescriptionAttributeInterval6 = "DescriptionAttributeInterval6";
+
+ public const string DescriptionAttributeLabel_Interval = "DescriptionAttributeLabel_Interval";
+
+ public const string DescriptionAttributeStripLine_TitleLineAlignment = "DescriptionAttributeStripLine_TitleLineAlignment";
+
+ public const string DescriptionAttributeMaximum = "DescriptionAttributeMaximum";
+
+ public const string DescriptionAttributeElementPosition_Auto = "DescriptionAttributeElementPosition_Auto";
+
+ public const string DescriptionAttributeSeries_YAxisType = "DescriptionAttributeSeries_YAxisType";
+
+ public const string DescriptionAttributeLineDashStyle = "DescriptionAttributeLineDashStyle";
+
+ public const string DescriptionAttributeLogarithmBase = "DescriptionAttributeLogarithmBase";
+
+ public const string DescriptionAttributeAntiAlias = "DescriptionAttributeAntiAlias";
+
+ public const string DescriptionAttributeImageWrapMode = "DescriptionAttributeImageWrapMode";
+
+ public const string DescriptionAttributeChartSerializer_IgnoreUnknownXmlAttributes = "DescriptionAttributeChartSerializer_IgnoreUnknownXmlAttributes";
+
+ public const string DescriptionAttributeAxisScaleSegment_Tag = "DescriptionAttributeAxisScaleSegment_Tag";
+
+ public const string DescriptionAttributeTag = "DescriptionAttributeTag";
+
+ public const string DescriptionAttributeLegend = "DescriptionAttributeLegend";
+
+ public const string DescriptionAttributeLegend_Legend = "DescriptionAttributeLegend_Legend";
+
+ public const string DescriptionAttributeSeries_Legend = "DescriptionAttributeSeries_Legend";
+
+ public const string DescriptionAttributeDataPointComparer_DataPointComparer = "DescriptionAttributeDataPointComparer_DataPointComparer";
+
+ public const string DescriptionAttributeBackHatchStyle = "DescriptionAttributeBackHatchStyle";
+
+ public const string DescriptionAttributeFrameBackHatchStyle = "DescriptionAttributeFrameBackHatchStyle";
+
+ public const string DescriptionAttributeChartAreaCollection_Item = "DescriptionAttributeChartAreaCollection_Item";
+
+ public const string DescriptionAttributeLegendCollection_Item = "DescriptionAttributeLegendCollection_Item";
+
+ public const string DescriptionAttributeAnnotationCollection_Item = "DescriptionAttributeAnnotationCollection_Item";
+
+ public const string DescriptionAttributeSubAxisCollection_Item = "DescriptionAttributeSubAxisCollection_Item";
+
+ public const string DescriptionAttributeSeriesCollection_Item = "DescriptionAttributeSeriesCollection_Item";
+
+ public const string DescriptionAttributeAnnotationPathPointCollection_Item = "DescriptionAttributeAnnotationPathPointCollection_Item";
+
+ public const string DescriptionAttributeLegendCellColumnCollection_Item = "DescriptionAttributeLegendCellColumnCollection_Item";
+
+ public const string DescriptionAttributeAxisScaleSegmentCollection_Item = "DescriptionAttributeAxisScaleSegmentCollection_Item";
+
+ public const string DescriptionAttributeLegendCellCollection_Item = "DescriptionAttributeLegendCellCollection_Item";
+
+ public const string DescriptionAttributeNamedImagesCollection_Item = "DescriptionAttributeNamedImagesCollection_Item";
+
+ public const string DescriptionAttributeAxisScaleSegment_ScaleMinimum = "DescriptionAttributeAxisScaleSegment_ScaleMinimum";
+
+ public const string DescriptionAttributeSmartLabels = "DescriptionAttributeSmartLabels";
+
+ public const string DescriptionAttributeSeries_SmartLabels = "DescriptionAttributeSeries_SmartLabels";
+
+ public const string DescriptionAttributeSmartLabels_SmartLabels = "DescriptionAttributeSmartLabels_SmartLabels";
+
+ public const string DescriptionAttributeMinorTickMark = "DescriptionAttributeMinorTickMark";
+
+ public const string DescriptionAttributeMapAreasCollection_MapAreasCollection = "DescriptionAttributeMapAreasCollection_MapAreasCollection";
+
+ public const string DescriptionAttributeMovingDirection = "DescriptionAttributeMovingDirection";
+
+ public const string DescriptionAttributeCursor_UserSelection = "DescriptionAttributeCursor_UserSelection";
+
+ public const string DescriptionAttributeChartArea = "DescriptionAttributeChartArea";
+
+ public const string DescriptionAttributeSeries_ChartArea = "DescriptionAttributeSeries_ChartArea";
+
+ public const string DescriptionAttributeChartArea_ChartArea = "DescriptionAttributeChartArea_ChartArea";
+
+ public const string DescriptionAttributeToolTipEventArgs_HitTestResult = "DescriptionAttributeToolTipEventArgs_HitTestResult";
+
+ public const string DescriptionAttributeAxisScaleSegment_AxisScaleSegment = "DescriptionAttributeAxisScaleSegment_AxisScaleSegment";
+
+ public const string DescriptionAttributeLegend_ItemColumnSeparatorColor = "DescriptionAttributeLegend_ItemColumnSeparatorColor";
+
+ public const string DescriptionAttributeDataManipulator = "DescriptionAttributeDataManipulator";
+
+ public const string DescriptionAttributeTitle_Color = "DescriptionAttributeTitle_Color";
+
+ public const string DescriptionAttributeLegendItem_Color = "DescriptionAttributeLegendItem_Color";
+
+ public const string DescriptionAttributeColor4 = "DescriptionAttributeColor4";
+
+ public const string DescriptionAttributeMargins_Right = "DescriptionAttributeMargins_Right";
+
+ public const string DescriptionAttributeRight3 = "DescriptionAttributeRight3";
+
+ public const string DescriptionAttributeChart_OnBackPaint = "DescriptionAttributeChart_OnBackPaint";
+
+ public const string DescriptionAttributeLineColor = "DescriptionAttributeLineColor";
+
+ public const string DescriptionAttributeCalloutLineColor = "DescriptionAttributeCalloutLineColor";
+
+ public const string DescriptionAttributeArrowAnnotation_ArrowStyle = "DescriptionAttributeArrowAnnotation_ArrowStyle";
+
+ public const string DescriptionAttributeArrowStyle_ArrowStyle = "DescriptionAttributeArrowStyle_ArrowStyle";
+
+ public const string DescriptionAttributeSeries_XValueType = "DescriptionAttributeSeries_XValueType";
+
+ public const string DescriptionAttributeAnnotationGroup_Annotations = "DescriptionAttributeAnnotationGroup_Annotations";
+
+ public const string DescriptionAttributeAnnotations3 = "DescriptionAttributeAnnotations3";
+
+ public const string DescriptionAttributeMinorGrid = "DescriptionAttributeMinorGrid";
+
+ public const string DescriptionAttributeMapArea_Custom = "DescriptionAttributeMapArea_Custom";
+
+ public const string DescriptionAttributeChart_EnableViewState = "DescriptionAttributeChart_EnableViewState";
+
+ public const string DescriptionAttributeChartArea3DStyle_Enable3D = "DescriptionAttributeChartArea3DStyle_Enable3D";
+
+ public const string DescriptionAttributeInterlacedColor = "DescriptionAttributeInterlacedColor";
+
+ public const string DescriptionAttributeLegendCellColumn_Margins = "DescriptionAttributeLegendCellColumn_Margins";
+
+ public const string DescriptionAttributeMargins_Margins = "DescriptionAttributeMargins_Margins";
+
+ public const string DescriptionAttributeLegendCell_Margins = "DescriptionAttributeLegendCell_Margins";
+
+ public const string DescriptionAttributeLegendItem_MarkerColor = "DescriptionAttributeLegendItem_MarkerColor";
+
+ public const string DescriptionAttributeMarkerColor3 = "DescriptionAttributeMarkerColor3";
+
+ public const string DescriptionAttributeChart_Size = "DescriptionAttributeChart_Size";
+
+ public const string DescriptionAttributeTickMark_Size = "DescriptionAttributeTickMark_Size";
+
+ public const string DescriptionAttributeAxisScaleSegment_Size = "DescriptionAttributeAxisScaleSegment_Size";
+
+ public const string DescriptionAttributeAxisDataView_Size = "DescriptionAttributeAxisDataView_Size";
+
+ public const string DescriptionAttributeAxisScrollBar_Size = "DescriptionAttributeAxisScrollBar_Size";
+
+ public const string DescriptionAttributeViewEventArgs_NewSize = "DescriptionAttributeViewEventArgs_NewSize";
+
+ public const string DescriptionAttributeSeries_XAxisType = "DescriptionAttributeSeries_XAxisType";
+
+ public const string DescriptionAttributeAllowOutsidePlotArea = "DescriptionAttributeAllowOutsidePlotArea";
+
+ public const string DescriptionAttributeLegendItem_MarkerStyle = "DescriptionAttributeLegendItem_MarkerStyle";
+
+ public const string DescriptionAttributeMarkerStyle4 = "DescriptionAttributeMarkerStyle4";
+
+ public const string DescriptionAttributeLegendCell_ImageSize = "DescriptionAttributeLegendCell_ImageSize";
+
+ public const string DescriptionAttributeView = "DescriptionAttributeView";
+
+ public const string DescriptionAttributeSeriesCollection_SeriesCollection = "DescriptionAttributeSeriesCollection_SeriesCollection";
+
+ public const string DescriptionAttributeCursorEventArgs_NewPosition = "DescriptionAttributeCursorEventArgs_NewPosition";
+
+ public const string DescriptionAttributeViewEventArgs_NewPosition = "DescriptionAttributeViewEventArgs_NewPosition";
+
+ public const string DescriptionAttributeLegendCell_Image = "DescriptionAttributeLegendCell_Image";
+
+ public const string DescriptionAttributeNamedImage_Image = "DescriptionAttributeNamedImage_Image";
+
+ public const string DescriptionAttributeImageAnnotation_Image = "DescriptionAttributeImageAnnotation_Image";
+
+ public const string DescriptionAttributeLegendItem_Image = "DescriptionAttributeLegendItem_Image";
+
+ public const string DescriptionAttributeCustomLabel_Image = "DescriptionAttributeCustomLabel_Image";
+
+ public const string DescriptionAttributeAxisScaleSegment_IntervalOffset = "DescriptionAttributeAxisScaleSegment_IntervalOffset";
+
+ public const string DescriptionAttributeIntervalOffset3 = "DescriptionAttributeIntervalOffset3";
+
+ public const string DescriptionAttributeLabel_IntervalOffset = "DescriptionAttributeLabel_IntervalOffset";
+
+ public const string DescriptionAttributeCursor_IntervalOffset = "DescriptionAttributeCursor_IntervalOffset";
+
+ public const string DescriptionAttributeIntervalOffset6 = "DescriptionAttributeIntervalOffset6";
+
+ public const string DescriptionAttributeStripLine_IntervalOffset = "DescriptionAttributeStripLine_IntervalOffset";
+
+ public const string DescriptionAttributeLegend_DockInsideChartArea = "DescriptionAttributeLegend_DockInsideChartArea";
+
+ public const string DescriptionAttributeTitle_DockInsideChartArea = "DescriptionAttributeTitle_DockInsideChartArea";
+
+ public const string DescriptionAttributeChart_RenderType = "DescriptionAttributeChart_RenderType";
+
+ public const string DescriptionAttributeAxisScaleBreakStyle_CollapsibleSpaceThreshold = "DescriptionAttributeAxisScaleBreakStyle_CollapsibleSpaceThreshold";
+
+ public const string DescriptionAttributeChartEvent_AxisViewChanging = "DescriptionAttributeChartEvent_AxisViewChanging";
+
+ public const string DescriptionAttributeLabelCalloutStyle_LabelCalloutStyle = "DescriptionAttributeLabelCalloutStyle_LabelCalloutStyle";
+
+ public const string DescriptionAttributePath = "DescriptionAttributePath";
+
+ public const string DescriptionAttributeLegendItem_SeriesPointIndex = "DescriptionAttributeLegendItem_SeriesPointIndex";
+
+ public const string DescriptionAttributeMapAreas = "DescriptionAttributeMapAreas";
+
+ public const string DescriptionAttributeTickMark_TickMark = "DescriptionAttributeTickMark_TickMark";
+
+ public const string DescriptionAttributeLegendCellColumn_LegendCellColumn = "DescriptionAttributeLegendCellColumn_LegendCellColumn";
+
+ public const string DescriptionAttributeLegendItem_LegendItem = "DescriptionAttributeLegendItem_LegendItem";
+
+ public const string DescriptionAttributeTitleAlignment = "DescriptionAttributeTitleAlignment";
+
+ public const string DescriptionAttributeStripLine_TitleAlignment = "DescriptionAttributeStripLine_TitleAlignment";
+
+ public const string DescriptionAttributeLegend_TitleAlignment = "DescriptionAttributeLegend_TitleAlignment";
+
+ public const string DescriptionAttributeElementPosition_ElementPosition = "DescriptionAttributeElementPosition_ElementPosition";
+
+ public const string DescriptionAttributeCustomLabel_To = "DescriptionAttributeCustomLabel_To";
+
+ public const string DescriptionAttributeLabel_FontAngle = "DescriptionAttributeLabel_FontAngle";
+
+ public const string DescriptionAttributeIntervalAutoMode = "DescriptionAttributeIntervalAutoMode";
+
+ public const string DescriptionAttributeStripLine_StripWidth = "DescriptionAttributeStripLine_StripWidth";
+
+ public const string DescriptionAttributeCursor_UserEnabled = "DescriptionAttributeCursor_UserEnabled";
+
+ public const string DescriptionAttributeBorderSkin_FrameBorderWidth = "DescriptionAttributeBorderSkin_FrameBorderWidth";
+
+ public const string DescriptionAttributeAxisScaleSegment_Position = "DescriptionAttributeAxisScaleSegment_Position";
+
+ public const string DescriptionAttributeAxisDataView_Position = "DescriptionAttributeAxisDataView_Position";
+
+ public const string DescriptionAttributeTitle_Position = "DescriptionAttributeTitle_Position";
+
+ public const string DescriptionAttributeLegend_Position = "DescriptionAttributeLegend_Position";
+
+ public const string DescriptionAttributeChartArea_Position = "DescriptionAttributeChartArea_Position";
+
+ public const string DescriptionAttributeCursor_Position = "DescriptionAttributeCursor_Position";
+
+ public const string DescriptionAttributeSubAxis_ParentAxis = "DescriptionAttributeSubAxis_ParentAxis";
+
+ public const string DescriptionAttributeAnnotationCollectionEditor_AnnotationCollectionEditor = "DescriptionAttributeAnnotationCollectionEditor_AnnotationCollectionEditor";
+
+ public const string DescriptionAttributeBottom = "DescriptionAttributeBottom";
+
+ public const string DescriptionAttributeMargins_Bottom = "DescriptionAttributeMargins_Bottom";
+
+ public const string DescriptionAttributeAxisScaleBreakStyle_AxisScaleBreakStyle = "DescriptionAttributeAxisScaleBreakStyle_AxisScaleBreakStyle";
+
+ public const string DescriptionAttributeLegend_HeaderSeparator = "DescriptionAttributeLegend_HeaderSeparator";
+
+ public const string DescriptionAttributeChartArea3DStyle_PointDepth = "DescriptionAttributeChartArea3DStyle_PointDepth";
+
+ public const string DescriptionAttributeAnnotationGroup_AnnotationGroup = "DescriptionAttributeAnnotationGroup_AnnotationGroup";
+
+ public const string DescriptionAttributeAnnotationPathPointCollection_AnnotationPathPointCollection = "DescriptionAttributeAnnotationPathPointCollection_AnnotationPathPointCollection";
+
+ public const string DescriptionAttributeStripLine_StripWidthType = "DescriptionAttributeStripLine_StripWidthType";
+
+ public const string DescriptionAttributeCustomLabel_From = "DescriptionAttributeCustomLabel_From";
+
+ public const string DescriptionAttributePoint3D_PointF = "DescriptionAttributePoint3D_PointF";
+
+ public const string DescriptionAttributeBorderWidth = "DescriptionAttributeBorderWidth";
+
+ public const string DescriptionAttributeMarkerBorderWidth = "DescriptionAttributeMarkerBorderWidth";
+
+ public const string DescriptionAttributeCursor_SelectionEnd = "DescriptionAttributeCursor_SelectionEnd";
+
+ public const string DescriptionAttributeLineAnnotation_LineAnnotation = "DescriptionAttributeLineAnnotation_LineAnnotation";
+
+ public const string DescriptionAttributeAnnotationSmartLabels_AnnotationSmartLabels = "DescriptionAttributeAnnotationSmartLabels_AnnotationSmartLabels";
+
+ public const string DescriptionAttributeAnnotationGroup_Visible = "DescriptionAttributeAnnotationGroup_Visible";
+
+ public const string DescriptionAttributeChartArea_Visible = "DescriptionAttributeChartArea_Visible";
+
+ public const string DescriptionAttributeTitle_Visible = "DescriptionAttributeTitle_Visible";
+
+ public const string DescriptionAttributeVisible = "DescriptionAttributeVisible";
+
+ public const string DescriptionAttributeLegendItem_Separator = "DescriptionAttributeLegendItem_Separator";
+
+ public const string DescriptionAttributeLegendCell_CellType = "DescriptionAttributeLegendCell_CellType";
+
+ public const string DescriptionAttributeChart_Serializer = "DescriptionAttributeChart_Serializer";
+
+ public const string DescriptionAttributeAxisX = "DescriptionAttributeAxisX";
+
+ public const string DescriptionAttributeChartArea_AxisX = "DescriptionAttributeChartArea_AxisX";
+
+ public const string DescriptionAttributeImageType = "DescriptionAttributeImageType";
+
+ public const string DescriptionAttributeCursor_SelectionStart = "DescriptionAttributeCursor_SelectionStart";
+
+ public const string DescriptionAttributeLabelsAutoFit = "DescriptionAttributeLabelsAutoFit";
+
+ public const string DescriptionAttributeLegendCellColumn_HeaderText = "DescriptionAttributeLegendCellColumn_HeaderText";
+
+ public const string DescriptionAttributeMapEnabled = "DescriptionAttributeMapEnabled";
+
+ public const string DescriptionAttributeAxisDataView_Zoomable = "DescriptionAttributeAxisDataView_Zoomable";
+
+ public const string DescriptionAttributeDataManager_PaletteCustomColors = "DescriptionAttributeDataManager_PaletteCustomColors";
+
+ public const string DescriptionAttributeChart_PaletteCustomColors = "DescriptionAttributeChart_PaletteCustomColors";
+
+ public const string DescriptionAttributeLegend_ItemColumnSeparator = "DescriptionAttributeLegend_ItemColumnSeparator";
+
+ public const string DescriptionAttributeCursorEventArgs_NewSelectionEnd = "DescriptionAttributeCursorEventArgs_NewSelectionEnd";
+
+ public const string DescriptionAttributeLegendItem_SeriesName = "DescriptionAttributeLegendItem_SeriesName";
+
+ public const string DescriptionAttributeChartAreas = "DescriptionAttributeChartAreas";
+
+ public const string DescriptionAttributeChartArea_AlignWithChartArea = "DescriptionAttributeChartArea_AlignWithChartArea";
+
+ public const string DescriptionAttributeLegend_MaxAutoSize = "DescriptionAttributeLegend_MaxAutoSize";
+
+ public const string DescriptionAttributeAxis_MaxAutoSize = "DescriptionAttributeAxis_MaxAutoSize";
+
+ public const string DescriptionAttributeGrid_Grid = "DescriptionAttributeGrid_Grid";
+
+ public const string DescriptionAttributeChartArea_EquallySizedAxesFont = "DescriptionAttributeChartArea_EquallySizedAxesFont";
+
+ public const string DescriptionAttributeChartEvent_CustomizeMapAreas = "DescriptionAttributeChartEvent_CustomizeMapAreas";
+
+ public const string DescriptionAttributeChartArea3DStyle_WallWidth = "DescriptionAttributeChartArea3DStyle_WallWidth";
+
+ public const string DescriptionAttributeCustomLabel_Row = "DescriptionAttributeCustomLabel_Row";
+
+ public const string DescriptionAttributeLegend_TitleSeparatorColor = "DescriptionAttributeLegend_TitleSeparatorColor";
+
+ public const string DescriptionAttributeChartSerializer_TemplateMode = "DescriptionAttributeChartSerializer_TemplateMode";
+
+ public const string DescriptionAttributeShadowColor = "DescriptionAttributeShadowColor";
+
+ public const string DescriptionAttributeAxisScaleBreakStyle_MaxNumberOfBreaks = "DescriptionAttributeAxisScaleBreakStyle_MaxNumberOfBreaks";
+
+ public const string DescriptionAttributeChartEvent_AxisScrollBarClicked = "DescriptionAttributeChartEvent_AxisScrollBarClicked";
+
+ public const string DescriptionAttributeAnchorY = "DescriptionAttributeAnchorY";
+
+ public const string DescriptionAttributeLegend_AutoFitMinFontSize = "DescriptionAttributeLegend_AutoFitMinFontSize";
+
+ public const string DescriptionAttributeChartEvent_AnnotationTextChanged = "DescriptionAttributeChartEvent_AnnotationTextChanged";
+
+ public const string DescriptionAttributeChart_Series = "DescriptionAttributeChart_Series";
+
+ public const string DescriptionAttributeSeries_Series = "DescriptionAttributeSeries_Series";
+
+ public const string DescriptionAttributeMapArea_Shape = "DescriptionAttributeMapArea_Shape";
+
+ public const string DescriptionAttributeLegend_TextWrapThreshold = "DescriptionAttributeLegend_TextWrapThreshold";
+
+ public const string DescriptionAttributeLabelOutsidePlotAreaStyle_LabelOutsidePlotAreaStyle = "DescriptionAttributeLabelOutsidePlotAreaStyle_LabelOutsidePlotAreaStyle";
+
+ public const string DescriptionAttributeSubAxes = "DescriptionAttributeSubAxes";
+
+ public const string DescriptionAttributeAxisScaleBreakStyle_StartFromZero = "DescriptionAttributeAxisScaleBreakStyle_StartFromZero";
+
+ public const string DescriptionAttributeStartFromZero3 = "DescriptionAttributeStartFromZero3";
+
+ public const string DescriptionAttributeRectangleAnnotation_RectangleAnnotation = "DescriptionAttributeRectangleAnnotation_RectangleAnnotation";
+
+ public const string DescriptionAttributeUrl = "DescriptionAttributeUrl";
+
+ public const string DescriptionAttributeAxisScaleBreakStyle_BreakLineType = "DescriptionAttributeAxisScaleBreakStyle_BreakLineType";
+
+ public const string DescriptionAttributeChartEvent_CursorPositionChanged = "DescriptionAttributeChartEvent_CursorPositionChanged";
+
+ public const string DescriptionAttributeChartSerializer_SerializableContent = "DescriptionAttributeChartSerializer_SerializableContent";
+
+ public const string DescriptionAttributeCalloutAnnotation_CalloutStyle = "DescriptionAttributeCalloutAnnotation_CalloutStyle";
+
+ public const string DescriptionAttributeCalloutStyle3 = "DescriptionAttributeCalloutStyle3";
+
+ public const string DescriptionAttributeCalloutStyle_CalloutStyle = "DescriptionAttributeCalloutStyle_CalloutStyle";
+
+ public const string DescriptionAttributeTitle_Docking = "DescriptionAttributeTitle_Docking";
+
+ public const string DescriptionAttributeLegend_Docking = "DescriptionAttributeLegend_Docking";
+
+ public const string DescriptionAttributeAnnotationGroup_AllowAnchorMoving = "DescriptionAttributeAnnotationGroup_AllowAnchorMoving";
+
+ public const string DescriptionAttributeAllowAnchorMoving3 = "DescriptionAttributeAllowAnchorMoving3";
+
+ public const string DescriptionAttributeTitleColor = "DescriptionAttributeTitleColor";
+
+ public const string DescriptionAttributeStripLine_TitleColor = "DescriptionAttributeStripLine_TitleColor";
+
+ public const string DescriptionAttributeLegend_TitleColor = "DescriptionAttributeLegend_TitleColor";
+
+ public const string DescriptionAttributeTitles = "DescriptionAttributeTitles";
+
+ public const string DescriptionAttributePolygonAnnotation_PolygonAnnotation = "DescriptionAttributePolygonAnnotation_PolygonAnnotation";
+
+ public const string DescriptionAttributeLabel_IntervalType = "DescriptionAttributeLabel_IntervalType";
+
+ public const string DescriptionAttributeIntervalType3 = "DescriptionAttributeIntervalType3";
+
+ public const string DescriptionAttributeIntervalType4 = "DescriptionAttributeIntervalType4";
+
+ public const string DescriptionAttributeStripLine_IntervalType = "DescriptionAttributeStripLine_IntervalType";
+
+ public const string DescriptionAttributeAxisScaleSegment_IntervalType = "DescriptionAttributeAxisScaleSegment_IntervalType";
+
+ public const string DescriptionAttributeCursor_IntervalType = "DescriptionAttributeCursor_IntervalType";
+
+ public const string DescriptionAttributeLegendItem_SeparatorColor = "DescriptionAttributeLegendItem_SeparatorColor";
+
+ public const string DescriptionAttributeSeries_YValuesPerPoint = "DescriptionAttributeSeries_YValuesPerPoint";
+
+ public const string DescriptionAttributeChartEvent_PrePaint = "DescriptionAttributeChartEvent_PrePaint";
+
+ public const string DescriptionAttributeLegendUrl = "DescriptionAttributeLegendUrl";
+
+ public const string DescriptionAttributeCustomLabel_ImageUrl = "DescriptionAttributeCustomLabel_ImageUrl";
+
+ public const string DescriptionAttributeLabel_Format = "DescriptionAttributeLabel_Format";
+
+ public const string DescriptionAttributeChartSerializer_Format = "DescriptionAttributeChartSerializer_Format";
+
+ public const string DescriptionAttributeStripLines = "DescriptionAttributeStripLines";
+
+ public const string DescriptionAttributeChart_ViewStateData = "DescriptionAttributeChart_ViewStateData";
+
+ public const string DescriptionAttributeTitle_DockOffset = "DescriptionAttributeTitle_DockOffset";
+
+ public const string DescriptionAttributeAnchorDataPoint = "DescriptionAttributeAnchorDataPoint";
+
+ public const string DescriptionAttributeLabelFormat = "DescriptionAttributeLabelFormat";
+
+ public const string DescriptionAttributeSuppressExceptions = "DescriptionAttributeSuppressExceptions";
+
+ public const string DescriptionAttributeSeries_EmptyPointStyle = "DescriptionAttributeSeries_EmptyPointStyle";
+
+ public const string DescriptionAttributeCustomAttributes = "DescriptionAttributeCustomAttributes";
+
+ public const string DescriptionAttributeLegendCellCollection_LegendCellCollection = "DescriptionAttributeLegendCellCollection_LegendCellCollection";
+
+ public const string DescriptionAttributeCustomLabelsCollection_CustomLabelsCollection = "DescriptionAttributeCustomLabelsCollection_CustomLabelsCollection";
+
+ public const string DescriptionAttributeCustomLabel_MarkColor = "DescriptionAttributeCustomLabel_MarkColor";
+
+ public const string DescriptionAttributePalette = "DescriptionAttributePalette";
+
+ public const string DescriptionAttributeScaleBreakStyle = "DescriptionAttributeScaleBreakStyle";
+
+ public const string DescriptionAttributeChart_ImageUrl = "DescriptionAttributeChart_ImageUrl";
+
+ public const string DescriptionAttributeLegend_InterlacedRowsColor = "DescriptionAttributeLegend_InterlacedRowsColor";
+
+ public const string DescriptionAttributeLegendCellColumn_ColumnType = "DescriptionAttributeLegendCellColumn_ColumnType";
+
+ public const string DescriptionAttributeChartArea_AlignOrientation = "DescriptionAttributeChartArea_AlignOrientation";
+
+ public const string DescriptionAttributeChart_SoftShadows = "DescriptionAttributeChart_SoftShadows";
+
+ public const string DescriptionAttributeSoftShadows3 = "DescriptionAttributeSoftShadows3";
+
+ public const string DescriptionAttributePrintingManager_PrintDocument = "DescriptionAttributePrintingManager_PrintDocument";
+
+ public const string DescriptionAttributeMinimum = "DescriptionAttributeMinimum";
+
+ public const string DescriptionAttributeAxisScaleSegment_ScaleMaximum = "DescriptionAttributeAxisScaleSegment_ScaleMaximum";
+
+ public const string DescriptionAttributeScrollBarEventArgs_MousePositionX = "DescriptionAttributeScrollBarEventArgs_MousePositionX";
+
+ public const string DescriptionAttributeLabel_TruncatedLabels = "DescriptionAttributeLabel_TruncatedLabels";
+
+ public const string DescriptionAttributeCustomLabel_GridTicks = "DescriptionAttributeCustomLabel_GridTicks";
+
+ public const string DescriptionAttributeImageAnnotation_Alignment = "DescriptionAttributeImageAnnotation_Alignment";
+
+ public const string DescriptionAttributeLegendCellColumn_Alignment = "DescriptionAttributeLegendCellColumn_Alignment";
+
+ public const string DescriptionAttributeTitle_Alignment = "DescriptionAttributeTitle_Alignment";
+
+ public const string DescriptionAttributeLegendCell_Alignment = "DescriptionAttributeLegendCell_Alignment";
+
+ public const string DescriptionAttributeLegend_Alignment = "DescriptionAttributeLegend_Alignment";
+
+ public const string DescriptionAttributeAlignment = "DescriptionAttributeAlignment";
+
+ public const string DescriptionAttributeChart_OnCustomizeMapAreas = "DescriptionAttributeChart_OnCustomizeMapAreas";
+
+ public const string DescriptionAttributeSubAxis_LocationOffset = "DescriptionAttributeSubAxis_LocationOffset";
+
+ public const string DescriptionAttributeLegendCellColumn_MinimumWidth = "DescriptionAttributeLegendCellColumn_MinimumWidth";
+
+ public const string DescriptionAttributeSelectionPointsStyle = "DescriptionAttributeSelectionPointsStyle";
+
+ public const string DescriptionAttributeAxisY = "DescriptionAttributeAxisY";
+
+ public const string DescriptionAttributeChartArea_AxisY = "DescriptionAttributeChartArea_AxisY";
+
+ public const string DescriptionAttributeTextFont = "DescriptionAttributeTextFont";
+
+ public const string DescriptionAttributeTextFont4 = "DescriptionAttributeTextFont4";
+
+ public const string DescriptionAttributeAxisDataView_SizeType = "DescriptionAttributeAxisDataView_SizeType";
+
+ public const string DescriptionAttributeMinMovingDistance = "DescriptionAttributeMinMovingDistance";
+
+ public const string DescriptionAttributeChartArea_CursorX = "DescriptionAttributeChartArea_CursorX";
+
+ public const string DescriptionAttributeAxisDataView_SmallScrollMinSize = "DescriptionAttributeAxisDataView_SmallScrollMinSize";
+
+ public const string DescriptionAttributeAxisDataView_SmallScrollMinSizeType = "DescriptionAttributeAxisDataView_SmallScrollMinSizeType";
+
+ public const string DescriptionAttributeAxisScrollBar_ButtonColor = "DescriptionAttributeAxisScrollBar_ButtonColor";
+
+ public const string DescriptionAttributeArea3DStyle = "DescriptionAttributeArea3DStyle";
+
+ public const string DescriptionAttributeChart = "DescriptionAttributeChart";
+
+ public const string DescriptionAttributeChart_Chart = "DescriptionAttributeChart_Chart";
+
+ public const string DescriptionAttributeBorderSkin_PageColor = "DescriptionAttributeBorderSkin_PageColor";
+
+ public const string DescriptionAttributeDataPoint_DataPoint = "DescriptionAttributeDataPoint_DataPoint";
+
+ public const string DescriptionAttributeChartArea3DStyle_Light = "DescriptionAttributeChartArea3DStyle_Light";
+
+ public const string DescriptionAttributeDataPointCustomProperties_DataPointCustomProperties = "DescriptionAttributeDataPointCustomProperties_DataPointCustomProperties";
+
+ public const string DescriptionAttributeLegend_AutoFitText = "DescriptionAttributeLegend_AutoFitText";
+
+ public const string DescriptionAttributeAllowTextEditing = "DescriptionAttributeAllowTextEditing";
+
+ public const string DescriptionAttributeCustomLabel_Text = "DescriptionAttributeCustomLabel_Text";
+
+ public const string DescriptionAttributeLegendCell_Text = "DescriptionAttributeLegendCell_Text";
+
+ public const string DescriptionAttributeText = "DescriptionAttributeText";
+
+ public const string DescriptionAttributeTitle_Text = "DescriptionAttributeTitle_Text";
+
+ public const string DescriptionAttributeLegendCellColumn_Text = "DescriptionAttributeLegendCellColumn_Text";
+
+ public const string DescriptionAttributeToolTipEventArgs_Text = "DescriptionAttributeToolTipEventArgs_Text";
+
+ public const string DescriptionAttributeMultiline = "DescriptionAttributeMultiline";
+
+ public const string DescriptionAttributeTextAnnotation_TextAnnotation = "DescriptionAttributeTextAnnotation_TextAnnotation";
+
+ public const string DescriptionAttributeAnnotationGroup_ClipToChartArea = "DescriptionAttributeAnnotationGroup_ClipToChartArea";
+
+ public const string DescriptionAttributeSeries_YValueType = "DescriptionAttributeSeries_YValueType";
+
+ public const string DescriptionAttributeInternalIntervalType = "DescriptionAttributeInternalIntervalType";
+
+ public const string DescriptionAttributeCalloutAnnotation_CalloutAnchorCap = "DescriptionAttributeCalloutAnnotation_CalloutAnchorCap";
+
+ public const string DescriptionAttributeLogarithmic = "DescriptionAttributeLogarithmic";
+
+ public const string DescriptionAttributeLegend_ItemColumnSpacing = "DescriptionAttributeLegend_ItemColumnSpacing";
+
+ public const string DescriptionAttributeMarksNextToAxis = "DescriptionAttributeMarksNextToAxis";
+
+ public const string DescriptionAttributeChartEvent_SelectionRangeChanged = "DescriptionAttributeChartEvent_SelectionRangeChanged";
+
+ public const string DescriptionAttributeDataPointCollection_DataPointCollection = "DescriptionAttributeDataPointCollection_DataPointCollection";
+
+ public const string DescriptionAttributeHorizontalLineAnnotation_HorizontalLineAnnotation = "DescriptionAttributeHorizontalLineAnnotation_HorizontalLineAnnotation";
+
+ public const string DescriptionAttributeLegendCellColumn_HeaderColor = "DescriptionAttributeLegendCellColumn_HeaderColor";
+
+ public const string DescriptionAttributeLegendCell_LegendCell = "DescriptionAttributeLegendCell_LegendCell";
+
+ public const string DescriptionAttributeChartImageDescriptionUrl = "DescriptionAttributeChartImageDescriptionUrl";
+
+ public const string DescriptionAttributeChartImageAlternateText = "DescriptionAttributeChartImageAlternateText";
+
+ public const string DescriptionAttributePostBackValue = "DescriptionAttributePostBackValue";
+
+ public const string DescriptionAttributeTextStyle = "DescriptionAttributeTextStyle";
+
+ public const string DescriptionAttributeIsMapAreaAttributesEncoded = "DescriptionAttributeIsMapAreaAttributesEncoded";
+
+ public const string DescriptionAttributeRightToLeft = "DescriptionAttributeRightToLeft";
+
+ public const string CategoryAttributeCellColumns = "CategoryAttributeCellColumns";
+
+ public const string CategoryAttributeAxis = "CategoryAttributeAxis";
+
+ public const string CategoryAttributeEditing = "CategoryAttributeEditing";
+
+ public const string CategoryAttributeSize = "CategoryAttributeSize";
+
+ public const string CategoryAttributePosition = "CategoryAttributePosition";
+
+ public const string CategoryAttributeViewState = "CategoryAttributeViewState";
+
+ public const string CategoryAttributeInterval = "CategoryAttributeInterval";
+
+ public const string CategoryAttributeAppearance = "CategoryAttributeAppearance";
+
+ public const string CategoryAttributeDocking = "CategoryAttributeDocking";
+
+ public const string CategoryAttributeDataSource = "CategoryAttributeDataSource";
+
+ public const string CategoryAttributeAxisView = "CategoryAttributeAxisView";
+
+ public const string CategoryAttributeLayout = "CategoryAttributeLayout";
+
+ public const string CategoryAttribute3D = "CategoryAttribute3D";
+
+ public const string CategoryAttributeData = "CategoryAttributeData";
+
+ public const string CategoryAttributeTitle = "CategoryAttributeTitle";
+
+ public const string CategoryAttributeToolTips = "CategoryAttributeToolTips";
+
+ public const string CategoryAttributeLabels = "CategoryAttributeLabels";
+
+ public const string CategoryAttributeGridTickMarks = "CategoryAttributeGridTickMarks";
+
+ public const string CategoryAttributeLabelAppearance = "CategoryAttributeLabelAppearance";
+
+ public const string CategoryAttributeHeader = "CategoryAttributeHeader";
+
+ public const string CategoryAttributeAxes = "CategoryAttributeAxes";
+
+ public const string CategoryAttributeImage = "CategoryAttributeImage";
+
+ public const string CategoryAttributeEmptyPoints = "CategoryAttributeEmptyPoints";
+
+ public const string CategoryAttributeAlignment = "CategoryAttributeAlignment";
+
+ public const string CategoryAttributeAnnotation = "CategoryAttributeAnnotation";
+
+ public const string CategoryAttributeMarker = "CategoryAttributeMarker";
+
+ public const string CategoryAttributeChart = "CategoryAttributeChart";
+
+ public const string CategoryAttributeLocation = "CategoryAttributeLocation";
+
+ public const string CategoryAttributeToolTip = "CategoryAttributeToolTip";
+
+ public const string CategoryAttributeMap = "CategoryAttributeMap";
+
+ public const string CategoryAttributeMapArea = "CategoryAttributeMapArea";
+
+ public const string CategoryAttributeLabel = "CategoryAttributeLabel";
+
+ public const string CategoryAttributeShape = "CategoryAttributeShape";
+
+ public const string CategoryAttributeMisc = "CategoryAttributeMisc";
+
+ public const string CategoryAttributeSerializer = "CategoryAttributeSerializer";
+
+ public const string CategoryAttributeSubAxes = "CategoryAttributeSubAxes";
+
+ public const string CategoryAttributeSeriesItems = "CategoryAttributeSeriesItems";
+
+ public const string CategoryAttributeDataView = "CategoryAttributeDataView";
+
+ public const string CategoryAttributeCharttitle = "CategoryAttributeCharttitle";
+
+ public const string CategoryAttributeLegend = "CategoryAttributeLegend";
+
+ public const string CategoryAttributeAction = "CategoryAttributeAction";
+
+ public const string CategoryAttributeScale = "CategoryAttributeScale";
+
+ public const string CategoryAttributeAnnotations = "CategoryAttributeAnnotations";
+
+ public const string CategoryAttributeAnchor = "CategoryAttributeAnchor";
+
+ public const string CategoryAttributeBehavior = "CategoryAttributeBehavior";
+
+ public const string CategoryAttributeCursor = "CategoryAttributeCursor";
+
+ public const string CategoryAttributeAnchorAxes = "CategoryAttributeAnchorAxes";
+
+ public const string CategoryAttributeAccessibility = "CategoryAttributeAccessibility";
+
+ public const string AccessibilityTitleName = "AccessibilityTitleName";
+
+ public const string AccessibilityAnnotationName = "AccessibilityAnnotationName";
+
+ public const string AccessibilityLegendName = "AccessibilityLegendName";
+
+ public const string AccessibilitySeriesName = "AccessibilitySeriesName";
+
+ public const string AccessibilityDataPointName = "AccessibilityDataPointName";
+
+ public const string AccessibilityDataPointLabelName = "AccessibilityDataPointLabelName";
+
+ public const string AccessibilityLegendTitleName = "AccessibilityLegendTitleName";
+
+ public const string AccessibilityChartAreaName = "AccessibilityChartAreaName";
+
+ public const string AccessibilityChartAxisTitleName = "AccessibilityChartAxisTitleName";
+
+ public const string AccessibilityChartAxisMajorGridlinesName = "AccessibilityChartAxisMajorGridlinesName";
+
+ public const string AccessibilityChartAxisMinorGridlinesName = "AccessibilityChartAxisMinorGridlinesName";
+
+ public const string FormatErrorString = "FormatErrorString";
+
+ public const string ExceptionNameIsEmpty = "ExceptionNameIsEmpty";
+
+ public const string ExceptionNameAlreadyExistsInCollection = "ExceptionNameAlreadyExistsInCollection";
+
+ public const string ExceptionNameNotFound = "ExceptionNameNotFound";
+
+ public const string ActionListSeriesChartType = "ActionListSeriesChartType";
+
+ public const string ActionListSeriesDataGroup = "ActionListSeriesDataGroup";
+
+ public const string ActionListSeriesXValueMember = "ActionListSeriesXValueMember";
+
+ public const string ActionListSeriesYValueMembers = "ActionListSeriesYValueMembers";
+
+ public const string DiagnosticHeader = "DiagnosticHeader";
+
+ public const string DiagnosticSettingsConfig = "DiagnosticSettingsConfig";
+
+ public const string DiagnosticSettingsHeader = "DiagnosticSettingsHeader";
+
+ public const string DiagnosticSettingsKey = "DiagnosticSettingsKey";
+
+ public const string DiagnosticSettingsValue = "DiagnosticSettingsValue";
+
+ public const string DiagnosticSettingsInfo = "DiagnosticSettingsInfo";
+
+ public const string DiagnosticQueueStateHeader = "DiagnosticQueueStateHeader";
+
+ public const string DiagnosticQueueStateName = "DiagnosticQueueStateName";
+
+ public const string DiagnosticQueueStateAccess = "DiagnosticQueueStateAccess";
+
+ public const string DiagnosticQueueStateAccessOK = "DiagnosticQueueStateAccessOK";
+
+ public const string DiagnosticQueueStateAccessFail = "DiagnosticQueueStateAccessFail";
+
+ public const string DiagnosticQueueStateAccessInfo = "DiagnosticQueueStateAccessInfo";
+
+ public const string DiagnosticActivityHeader = "DiagnosticActivityHeader";
+
+ public const string DiagnosticActivityTime = "DiagnosticActivityTime";
+
+ public const string DiagnosticActivityMessage = "DiagnosticActivityMessage";
+
+ public const string DiagnosticActivityError = "DiagnosticActivityError";
+
+ public const string DiagnosticChartImageSaved = "DiagnosticChartImageSaved";
+
+ public const string DiagnosticChartImageSavedPrivate = "DiagnosticChartImageSavedPrivate";
+
+ public const string DiagnosticChartImageDeleted = "DiagnosticChartImageDeleted";
+
+ public const string DiagnosticChartImageServed = "DiagnosticChartImageServed";
+
+ public const string DiagnosticChartImageServedFail = "DiagnosticChartImageServedFail";
+
+ public const string DiagnosticChartImageServedFailNotFound = "DiagnosticChartImageServedFailNotFound";
+
+ public const string DiagnosticChartImageServedFailPrivacyFail = "DiagnosticChartImageServedFailPrivacyFail";
+
+ private Keys()
+ {
+ }
+
+ public static CultureInfo Culture
+ {
+ get
+ {
+ return _culture;
+ }
+ set
+ {
+ _culture = value;
+ }
+ }
+
+ public static string GetString(string key)
+ {
+ return resourceManager.GetString(key, _culture);
+ }
+
+ public static string GetString(string key, object arg0)
+ {
+ return string.Format(global::System.Globalization.CultureInfo.CurrentCulture, resourceManager.GetString(key, _culture), arg0);
+ }
+
+ public static string GetString(string key, object arg0, object arg1)
+ {
+ return string.Format(global::System.Globalization.CultureInfo.CurrentCulture, resourceManager.GetString(key, _culture), arg0, arg1);
+ }
+
+ public static string GetString(string key, object arg0, object arg1, object arg2)
+ {
+ return string.Format(global::System.Globalization.CultureInfo.CurrentCulture, resourceManager.GetString(key, _culture), arg0, arg1, arg2);
+ }
+ }
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/SRCategoryAttribute.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/SRCategoryAttribute.cs
new file mode 100644
index 00000000000..7020a508d71
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/SRCategoryAttribute.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.ComponentModel;
+
+#if Microsoft_CONTROL
+namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+#endif
+{
+ [AttributeUsage(AttributeTargets.All)]
+ internal sealed class SRCategoryAttribute : CategoryAttribute
+ {
+ // Methods
+ public SRCategoryAttribute(string category)
+ : base(category)
+ {
+ }
+
+ protected override string GetLocalizedString(string value)
+ {
+ return SR.Keys.GetString(value);
+ }
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/SRDescriptionAttribute.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/SRDescriptionAttribute.cs
new file mode 100644
index 00000000000..590dfbd61d7
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/SRDescriptionAttribute.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.ComponentModel;
+
+#if Microsoft_CONTROL
+namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+#endif
+{
+ [AttributeUsage(AttributeTargets.All)]
+ internal sealed class SRDescriptionAttribute : DescriptionAttribute
+ {
+ // Fields
+ private bool replaced;
+
+ // Methods
+ public SRDescriptionAttribute(string description)
+ : base(description)
+ {
+ }
+
+ // Properties
+ public override string Description
+ {
+ get
+ {
+ if (!this.replaced)
+ {
+ this.replaced = true;
+ base.DescriptionValue = SR.Keys.GetString(base.Description);
+ }
+ return base.Description;
+ }
+ }
+ }
+
+
+
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/ColorPalette.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/ColorPalette.cs
new file mode 100644
index 00000000000..639e6d73b43
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/ColorPalette.cs
@@ -0,0 +1,396 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: ColorPalette.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+// System.Web.UI.WebControls[Windows.Forms].Charting.Utilities
+//
+// Classes: ChartPaletteColors
+//
+// Purpose: A utility class which defines chart palette colors.
+// These palettes are used to assign unique colors to
+// different chart series. For some chart types, like
+// Pie, different colors are applied on the data point
+// level.
+//
+// Selected chart series/points palette is exposed
+// through Chart.Palette property. Series.Palette
+// property should be used to set different palette
+// color for each point of the series.
+//
+// Reviewed: AG - August 7, 2002
+// AG - Microsoft 5, 2007
+//
+//===================================================================
+
+#region Used Namespaces
+
+using System;
+using System.Drawing;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+#else
+ using System.Web.UI.DataVisualization.Charting;
+#endif
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ #region Color palettes enumeration
+
+ /// <summary>
+ /// Chart color palettes enumeration
+ /// </summary>
+ public enum ChartColorPalette
+ {
+ /// <summary>
+ /// Palette not set.
+ /// </summary>
+ None,
+
+ /// <summary>
+ /// Bright palette.
+ /// </summary>
+ Bright,
+
+ /// <summary>
+ /// Palette with gray scale colors.
+ /// </summary>
+ Grayscale,
+
+ /// <summary>
+ /// Palette with Excel style colors.
+ /// </summary>
+ Excel,
+
+ /// <summary>
+ /// Palette with LightStyle style colors.
+ /// </summary>
+ Light,
+
+ /// <summary>
+ /// Palette with Pastel style colors.
+ /// </summary>
+ Pastel,
+
+ /// <summary>
+ /// Palette with Earth Tones style colors.
+ /// </summary>
+ EarthTones,
+
+ /// <summary>
+ /// Palette with SemiTransparent style colors.
+ /// </summary>
+ SemiTransparent,
+
+ /// <summary>
+ /// Palette with Berry style colors.
+ /// </summary>
+ Berry,
+
+ /// <summary>
+ /// Palette with Chocolate style colors.
+ /// </summary>
+ Chocolate,
+
+ /// <summary>
+ /// Palette with Fire style colors.
+ /// </summary>
+ Fire,
+
+ /// <summary>
+ /// Palette with SeaGreen style colors.
+ /// </summary>
+ SeaGreen,
+
+ /// <summary>
+ /// Bright pastel palette.
+ /// </summary>
+ BrightPastel
+ };
+
+ #endregion
+}
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.Utilities
+#else
+ namespace System.Web.UI.DataVisualization.Charting.Utilities
+#endif
+{
+ /// <summary>
+ /// ChartPaletteColors is a utility class which provides access
+ /// to the predefined chart color palettes. These palettes are
+ /// used to assign unique colors to different chart series.
+ /// For some chart types, like Pie, different colors are applied
+ /// on the data point level.
+ ///
+ /// GetPaletteColors method takes a ChartColorPalette enumeration
+ /// as a parameter and returns back an array of Colors. Each
+ /// palette contains different number of colors but it is a
+ /// good practice to keep this number around 15.
+ /// </summary>
+ internal static class ChartPaletteColors
+ {
+ #region Fields
+
+ // Fields which store the palette color values
+ private static Color[] _colorsGrayScale = InitializeGrayScaleColors();
+ private static Color[] _colorsDefault = {
+ Color.Green,
+ Color.Blue,
+ Color.Purple,
+ Color.Lime,
+ Color.Fuchsia,
+ Color.Teal,
+ Color.Yellow,
+ Color.Gray,
+ Color.Aqua,
+ Color.Navy,
+ Color.Maroon,
+ Color.Red,
+ Color.Olive,
+ Color.Silver,
+ Color.Tomato,
+ Color.Moccasin
+ };
+
+ private static Color[] _colorsPastel = {
+ Color.SkyBlue,
+ Color.LimeGreen,
+ Color.MediumOrchid,
+ Color.LightCoral,
+ Color.SteelBlue,
+ Color.YellowGreen,
+ Color.Turquoise,
+ Color.HotPink,
+ Color.Khaki,
+ Color.Tan,
+ Color.DarkSeaGreen,
+ Color.CornflowerBlue,
+ Color.Plum,
+ Color.CadetBlue,
+ Color.PeachPuff,
+ Color.LightSalmon
+ };
+
+ private static Color[] _colorsEarth = {
+ Color.FromArgb(255, 128, 0),
+ Color.DarkGoldenrod,
+ Color.FromArgb(192, 64, 0),
+ Color.OliveDrab,
+ Color.Peru,
+ Color.FromArgb(192, 192, 0),
+ Color.ForestGreen,
+ Color.Chocolate,
+ Color.Olive,
+ Color.LightSeaGreen,
+ Color.SandyBrown,
+ Color.FromArgb(0, 192, 0),
+ Color.DarkSeaGreen,
+ Color.Firebrick,
+ Color.SaddleBrown,
+ Color.FromArgb(192, 0, 0)
+ };
+
+ private static Color[] _colorsSemiTransparent = {
+ Color.FromArgb(150, 255, 0, 0),
+ Color.FromArgb(150, 0, 255, 0),
+ Color.FromArgb(150, 0, 0, 255),
+ Color.FromArgb(150, 255, 255, 0),
+ Color.FromArgb(150, 0, 255, 255),
+ Color.FromArgb(150, 255, 0, 255),
+ Color.FromArgb(150, 170, 120, 20),
+ Color.FromArgb(80, 255, 0, 0),
+ Color.FromArgb(80, 0, 255, 0),
+ Color.FromArgb(80, 0, 0, 255),
+ Color.FromArgb(80, 255, 255, 0),
+ Color.FromArgb(80, 0, 255, 255),
+ Color.FromArgb(80, 255, 0, 255),
+ Color.FromArgb(80, 170, 120, 20),
+ Color.FromArgb(150, 100, 120, 50),
+ Color.FromArgb(150, 40, 90, 150)
+ };
+
+ private static Color[] _colorsLight = {
+ Color.Lavender,
+ Color.LavenderBlush,
+ Color.PeachPuff,
+ Color.LemonChiffon,
+ Color.MistyRose,
+ Color.Honeydew,
+ Color.AliceBlue,
+ Color.WhiteSmoke,
+ Color.AntiqueWhite,
+ Color.LightCyan
+ };
+
+ private static Color[] _colorsExcel = {
+ Color.FromArgb(153,153,255),
+ Color.FromArgb(153,51,102),
+ Color.FromArgb(255,255,204),
+ Color.FromArgb(204,255,255),
+ Color.FromArgb(102,0,102),
+ Color.FromArgb(255,128,128),
+ Color.FromArgb(0,102,204),
+ Color.FromArgb(204,204,255),
+ Color.FromArgb(0,0,128),
+ Color.FromArgb(255,0,255),
+ Color.FromArgb(255,255,0),
+ Color.FromArgb(0,255,255),
+ Color.FromArgb(128,0,128),
+ Color.FromArgb(128,0,0),
+ Color.FromArgb(0,128,128),
+ Color.FromArgb(0,0,255)};
+
+ private static Color[] _colorsBerry = {
+ Color.BlueViolet,
+ Color.MediumOrchid,
+ Color.RoyalBlue,
+ Color.MediumVioletRed,
+ Color.Blue,
+ Color.BlueViolet,
+ Color.Orchid,
+ Color.MediumSlateBlue,
+ Color.FromArgb(192, 0, 192),
+ Color.MediumBlue,
+ Color.Purple
+ };
+
+ private static Color[] _colorsChocolate = {
+ Color.Sienna,
+ Color.Chocolate,
+ Color.DarkRed,
+ Color.Peru,
+ Color.Brown,
+ Color.SandyBrown,
+ Color.SaddleBrown,
+ Color.FromArgb(192, 64, 0),
+ Color.Firebrick,
+ Color.FromArgb(182, 92, 58)
+ };
+
+ private static Color[] _colorsFire = {
+ Color.Gold,
+ Color.Red,
+ Color.DeepPink,
+ Color.Crimson,
+ Color.DarkOrange,
+ Color.Magenta,
+ Color.Yellow,
+ Color.OrangeRed,
+ Color.MediumVioletRed,
+ Color.FromArgb(221, 226, 33)
+ };
+
+ private static Color[] _colorsSeaGreen = {
+ Color.SeaGreen,
+ Color.MediumAquamarine,
+ Color.SteelBlue,
+ Color.DarkCyan,
+ Color.CadetBlue,
+ Color.MediumSeaGreen,
+ Color.MediumTurquoise,
+ Color.LightSteelBlue,
+ Color.DarkSeaGreen,
+ Color.SkyBlue
+ };
+
+ private static Color[] _colorsBrightPastel = {
+ Color.FromArgb(65, 140, 240),
+ Color.FromArgb(252, 180, 65),
+ Color.FromArgb(224, 64, 10),
+ Color.FromArgb(5, 100, 146),
+ Color.FromArgb(191, 191, 191),
+ Color.FromArgb(26, 59, 105),
+ Color.FromArgb(255, 227, 130),
+ Color.FromArgb(18, 156, 221),
+ Color.FromArgb(202, 107, 75),
+ Color.FromArgb(0, 92, 219),
+ Color.FromArgb(243, 210, 136),
+ Color.FromArgb(80, 99, 129),
+ Color.FromArgb(241, 185, 168),
+ Color.FromArgb(224, 131, 10),
+ Color.FromArgb(120, 147, 190)
+ };
+
+ #endregion
+
+ #region Constructor
+
+ /// <summary>
+ /// Initializes the GrayScale color array
+ /// </summary>
+ private static Color[] InitializeGrayScaleColors()
+ {
+ // Define gray scale colors
+ Color[] grayScale = new Color[16];
+ for(int i = 0; i < grayScale.Length; i++)
+ {
+ int colorValue = 200 - i * (180/16);
+ grayScale[i] = Color.FromArgb(colorValue, colorValue, colorValue);
+ }
+
+ return grayScale;
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Return array of colors for the specified palette. Number of
+ /// colors returned varies depending on the palette selected.
+ /// </summary>
+ /// <param name="palette">Palette to get the colors for.</param>
+ /// <returns>Array of colors.</returns>
+ public static Color[] GetPaletteColors(ChartColorPalette palette)
+ {
+ switch(palette)
+ {
+ case(ChartColorPalette.None):
+ {
+ throw (new ArgumentException(SR.ExceptionPaletteIsEmpty));
+ }
+ case(ChartColorPalette.Bright):
+ return _colorsDefault;
+ case(ChartColorPalette.Grayscale):
+ return _colorsGrayScale;
+ case(ChartColorPalette.Excel):
+ return _colorsExcel;
+ case(ChartColorPalette.Pastel):
+ return _colorsPastel;
+ case(ChartColorPalette.Light):
+ return _colorsLight;
+ case(ChartColorPalette.EarthTones):
+ return _colorsEarth;
+ case(ChartColorPalette.SemiTransparent):
+ return _colorsSemiTransparent;
+ case(ChartColorPalette.Berry):
+ return _colorsBerry;
+ case(ChartColorPalette.Chocolate):
+ return _colorsChocolate;
+ case(ChartColorPalette.Fire):
+ return _colorsFire;
+ case(ChartColorPalette.SeaGreen):
+ return _colorsSeaGreen;
+ case(ChartColorPalette.BrightPastel):
+ return _colorsBrightPastel;
+ }
+ return null;
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/CustomAttributesRegistry.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/CustomAttributesRegistry.cs
new file mode 100644
index 00000000000..67a41ff1bf9
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/CustomAttributesRegistry.cs
@@ -0,0 +1,1974 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: CustomProperties.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting.Utilities
+//
+// Classes: CustomPropertyRegistry, CustomPropertyInfo,
+// CustomPropertyName
+//
+// Purpose: CustomPropertyRegistry contains information for all
+// chart custom properties. This informatin is used at
+// design-time to provide simple editors for the
+// CustomProperty property of the Series and DataPoint.
+//
+// Custom Properties Overview:
+// ---------------------------
+//
+// Different chart types may have unique settings that only apply to
+// this chart type. For example, ‘Exploded’ attribute on the data point
+// only make sense in case of Pie and Doughnut chart types. Instead of
+// adding properties that only will work with specific chart types
+// CustomProperties were introduced.
+//
+// Custom properties are implemented using the CustomProperties property
+// of both Series objects and their associated DataPoint objects. Here
+// is an example of setting data point custom attribute:
+//
+// Chart1.Series["Default"].Points[0][CustomPropertyName.Exploded] = "true";
+//
+// Custom attribute names are case-sensitive. You should be mindful of
+// this fact when formatting custom properties in code-behind. Further,
+// if the CustomProperty value contains a comma, then each comma must
+// be preceded by a '\' character to escape the comma. This is useful
+// when, for example, an RGB color value is set in your application.
+// In such cases, the setting of custom properties that contain commas
+// can either be done at runtime, or design-time.
+//
+// Reviewed: AG - Microsoft 5, 2007
+//
+//===================================================================
+
+
+#region Used Namespaces
+
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+#else
+using System.Web.UI.DataVisualization.Charting;
+using System.Web.UI.DataVisualization.Charting.ChartTypes;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.Utilities
+#else // Microsoft_CONTROL
+ namespace System.Web.UI.DataVisualization.Charting.Utilities
+#endif // Microsoft_CONTROL
+{
+ #region Enumerations
+
+
+ /// <summary>
+ /// Circular chart drawing style.
+ /// </summary>
+ internal enum PolarDrawingStyles
+ {
+ /// <summary>
+ /// Series are drawn as lines.
+ /// </summary>
+ Line,
+ /// <summary>
+ /// Series are drawn as markers.
+ /// </summary>
+ Marker
+ }
+
+ /// <summary>
+ /// CircularAreaDrawingStyle
+ /// </summary>
+ internal enum CircularAreaDrawingStyles
+ {
+ /// <summary>
+ /// Drawn as polygon
+ /// </summary>
+ Polygon,
+
+ /// <summary>
+ /// Drawn as circle
+ /// </summary>
+ Circle = 1,
+ }
+
+ /// <summary>
+ /// Marker Style
+ /// </summary>
+ internal enum ErrorBarMarkerStyles
+ {
+ /// <summary>
+ /// Marker disabled
+ /// </summary>
+ None = 0,
+
+ /// <summary>
+ /// The marker style is Square
+ /// </summary>
+ Square = 1,
+
+ /// <summary>
+ /// The marker style is Circle
+ /// </summary>
+ Circle = 2,
+
+ /// <summary>
+ /// The marker style is Diamond
+ /// </summary>
+ Diamond = 3,
+
+ /// <summary>
+ /// The marker style is Triangle
+ /// </summary>
+ Triangle = 4,
+
+ /// <summary>
+ /// The marker style is Cross
+ /// </summary>
+ Cross = 5,
+
+ /// <summary>
+ /// The marker style is 4 corner star
+ /// </summary>
+ Star4 = 6,
+
+ /// <summary>
+ /// The marker style is 5 corner star
+ /// </summary>
+ Star5 = 7,
+
+ /// <summary>
+ /// The marker style is 6 corner star
+ /// </summary>
+ Star6 = 8,
+
+ /// <summary>
+ /// The marker style is 10 corner star
+ /// </summary>
+ Star10 = 9,
+
+ /// <summary>
+ /// Line marker
+ /// </summary>
+ Line = 10
+
+ };
+
+ /// <summary>
+ /// AxisName of stock chart markers
+ /// </summary>
+ internal enum StockShowOpenCloseTypes
+ {
+ /// <summary>
+ /// Open and Close markers are shown.
+ /// </summary>
+ Both,
+
+ /// <summary>
+ /// Only Open markers are shown.
+ /// </summary>
+ Open,
+
+ /// <summary>
+ /// Only Close markers are shown.
+ /// </summary>
+ Close,
+ }
+
+
+ /// <summary>
+ /// IsEmpty point value attribute
+ /// </summary>
+ internal enum EmptyPointTypes
+ {
+ /// <summary>
+ /// Average of two neighbor points is used.
+ /// </summary>
+ Average,
+
+ /// <summary>
+ /// Zero value is used
+ /// </summary>
+ Zero
+ }
+
+ /// <summary>
+ /// Stock chart point labels attribute
+ /// </summary>
+ internal enum StockLabelValueTypes
+ {
+ /// <summary>
+ /// High Y value is used to generate point label.
+ /// </summary>
+ High,
+
+ /// <summary>
+ /// Low Y value is used to generate point label.
+ /// </summary>
+ Low,
+
+ /// <summary>
+ /// Open Y value is used to generate point label.
+ /// </summary>
+ Open,
+
+ /// <summary>
+ /// Close Y value is used to generate point label.
+ /// </summary>
+ Close,
+ }
+
+ /// <summary>
+ /// Data point label alignment.
+ /// </summary>
+ [Flags]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue")]
+ internal enum LabelAlignments
+ {
+ /// <summary>
+ /// Automatic position.
+ /// </summary>
+ Auto = 0,
+ /// <summary>
+ /// Label aligned on the top of the marker.
+ /// </summary>
+ Top = 1,
+ /// <summary>
+ /// Label aligned on the bottom of the marker.
+ /// </summary>
+ Bottom = 2,
+ /// <summary>
+ /// Label aligned on the right of the marker.
+ /// </summary>
+ Right = 4,
+ /// <summary>
+ /// Label aligned on the left of the marker.
+ /// </summary>
+ Left = 8,
+ /// <summary>
+ /// Label aligned on the top-left of the marker.
+ /// </summary>
+ TopLeft = 16,
+ /// <summary>
+ /// Label aligned on the top-right of the marker.
+ /// </summary>
+ TopRight = 32,
+ /// <summary>
+ /// Label aligned on the bottom-left of the marker.
+ /// </summary>
+ BottomLeft = 64,
+ /// <summary>
+ /// Label aligned on the bottom-right of the marker.
+ /// </summary>
+ BottomRight = 128,
+ /// <summary>
+ /// Label aligned in the center of the marker.
+ /// </summary>
+ Center = 256,
+ }
+
+ #endregion //Enumerations
+
+ /// <summary>
+ /// CustomPropertyName class contains constant strings defining
+ /// names of all custom properties used in the chart.
+ /// </summary>
+ internal static class CustomPropertyName
+ {
+ #region Common Custom Properties Names
+
+ internal const string DrawSideBySide = "DrawSideBySide";
+ internal const string EmptyPointValue = "EmptyPointValue";
+ internal const string IsXAxisQuantitative = "IsXAxisQuantitative";
+ internal const string BarLabelStyle = "BarLabelStyle";
+ internal const string StackedGroupName = "StackedGroupName";
+ internal const string DrawingStyle = "DrawingStyle";
+ internal const string PointWidth = "PointWidth";
+ internal const string PixelPointWidth = "PixelPointWidth";
+ internal const string MinPixelPointWidth = "MinPixelPointWidth";
+ internal const string MaxPixelPointWidth = "MaxPixelPointWidth";
+ internal const string PriceUpColor = "PriceUpColor";
+ internal const string PriceDownColor = "PriceDownColor";
+ internal const string LabelValueType = "LabelValueType";
+ internal const string OpenCloseStyle = "OpenCloseStyle";
+ internal const string ShowOpenClose = "ShowOpenClose";
+ internal const string BubbleScaleMin = "BubbleScaleMin";
+ internal const string BubbleScaleMax = "BubbleScaleMax";
+ internal const string BubbleMaxSize = "BubbleMaxSize";
+ internal const string BubbleMinSize = "BubbleMinSize";
+ internal const string BubbleUseSizeForLabel = "BubbleUseSizeForLabel";
+ internal const string PieDrawingStyle = "PieDrawingStyle";
+ internal const string CollectedStyle = "CollectedStyle";
+ internal const string CollectedThreshold = "CollectedThreshold";
+ internal const string CollectedThresholdUsePercent = "CollectedThresholdUsePercent";
+ internal const string CollectedSliceExploded = "CollectedSliceExploded";
+ internal const string CollectedLabel = "CollectedLabel";
+ internal const string CollectedLegendText = "CollectedLegendText";
+ internal const string CollectedToolTip = "CollectedToolTip";
+ internal const string CollectedColor = "CollectedColor";
+ internal const string CollectedChartShowLegend = "CollectedChartShowLegend";
+ internal const string CollectedChartShowLabels = "CollectedChartShowLabels";
+ internal const string PieStartAngle = "PieStartAngle";
+ internal const string Exploded = "Exploded";
+ internal const string LabelsRadialLineSize = "LabelsRadialLineSize";
+ internal const string LabelsHorizontalLineSize = "LabelsHorizontalLineSize";
+ internal const string PieLabelStyle = "PieLabelStyle";
+ internal const string MinimumRelativePieSize = "MinimumRelativePieSize";
+ internal const string _3DLabelLineSize = "3DLabelLineSize";
+ internal const string PieLineColor = "PieLineColor";
+ internal const string PieAutoAxisLabels = "AutoAxisLabels";
+ internal const string DoughnutRadius = "DoughnutRadius";
+ internal const string LabelStyle = "LabelStyle";
+ internal const string ShowMarkerLines = "ShowMarkerLines";
+ internal const string LineTension = "LineTension";
+ internal const string PixelPointDepth = "PixelPointDepth";
+ internal const string PixelPointGapDepth = "PixelPointGapDepth";
+ internal const string PermittedPixelError = "PermittedPixelError";
+ internal const string CircularLabelsStyle = "CircularLabelsStyle";
+ internal const string PolarDrawingStyle = "PolarDrawingStyle";
+ internal const string AreaDrawingStyle = "AreaDrawingStyle";
+ internal const string RadarDrawingStyle = "RadarDrawingStyle";
+ internal const string BoxPlotPercentile = "BoxPlotPercentile";
+ internal const string BoxPlotWhiskerPercentile = "BoxPlotWhiskerPercentile";
+ internal const string BoxPlotShowAverage = "BoxPlotShowAverage";
+ internal const string BoxPlotShowMedian = "BoxPlotShowMedian";
+ internal const string BoxPlotShowUnusualValues = "BoxPlotShowUnusualValues";
+ internal const string BoxPlotSeries = "BoxPlotSeries";
+ internal const string ErrorBarStyle = "ErrorBarStyle";
+ internal const string ErrorBarCenterMarkerStyle = "ErrorBarCenterMarkerStyle";
+ internal const string ErrorBarSeries = "ErrorBarSeries";
+ internal const string ErrorBarType = "ErrorBarType";
+ internal const string UsedYValueHigh = "UsedYValueHigh";
+ internal const string UsedYValueLow = "UsedYValueLow";
+ internal const string BoxSize = "BoxSize";
+ internal const string ProportionalSymbols = "ProportionalSymbols";
+ internal const string ReversalAmount = "ReversalAmount";
+ internal const string UsedYValue = "UsedYValue";
+ internal const string NumberOfLinesInBreak = "NumberOfLinesInBreak";
+ internal const string FunnelLabelStyle = "FunnelLabelStyle";
+ internal const string FunnelNeckWidth = "FunnelNeckWidth";
+ internal const string FunnelNeckHeight = "FunnelNeckHeight";
+ internal const string FunnelMinPointHeight = "FunnelMinPointHeight";
+ internal const string Funnel3DRotationAngle = "Funnel3DRotationAngle";
+ internal const string FunnelPointGap = "FunnelPointGap";
+ internal const string Funnel3DDrawingStyle = "Funnel3DDrawingStyle";
+ internal const string FunnelStyle = "FunnelStyle";
+ internal const string FunnelInsideLabelAlignment = "FunnelInsideLabelAlignment";
+ internal const string FunnelOutsideLabelPlacement = "FunnelOutsideLabelPlacement";
+ internal const string CalloutLineColor = "CalloutLineColor";
+ internal const string PyramidLabelStyle = "PyramidLabelStyle";
+ internal const string PyramidMinPointHeight = "PyramidMinPointHeight";
+ internal const string Pyramid3DRotationAngle = "Pyramid3DRotationAngle";
+ internal const string PyramidPointGap = "PyramidPointGap";
+ internal const string Pyramid3DDrawingStyle = "Pyramid3DDrawingStyle";
+ internal const string PyramidInsideLabelAlignment = "PyramidInsideLabelAlignment";
+ internal const string PyramidOutsideLabelPlacement = "PyramidOutsideLabelPlacement";
+ internal const string PyramidValueType = "PyramidValueType";
+
+ #endregion // Common Custom Properties Names
+ }
+
+ /// <summary>
+ /// CustomPropertyRegistry contains information for all chart
+ /// custom properties. This data is exposed through the
+ /// ‘registeredCustomProperties’ field which is an ArrayList
+ /// containing CustomPropertyInfo classes.
+ /// </summary>
+ internal class CustomPropertyRegistry : IServiceProvider
+ {
+ #region Fields
+
+ // List of registered properties
+ internal ArrayList registeredCustomProperties = new ArrayList();
+
+ // Defines maximum value which can be set to the attribute which uses pixels
+ internal static int MaxValueOfPixelAttribute = 10000;
+
+ internal static System.Collections.Generic.List<SeriesChartType> IsXAxisQuantitativeChartTypes =
+ new System.Collections.Generic.List<SeriesChartType >(
+ new SeriesChartType[] {
+ SeriesChartType.Line,
+ SeriesChartType.FastLine,
+ SeriesChartType.Spline,
+ SeriesChartType.Point,
+ SeriesChartType.FastPoint,
+ SeriesChartType.Bubble,
+ SeriesChartType.RangeColumn,
+ SeriesChartType.RangeBar,
+ });
+ #endregion
+
+ #region Constructor and Services
+
+ /// <summary>
+ /// Custom properties registry public constructor.
+ /// </summary>
+ public CustomPropertyRegistry()
+ {
+ // Register properties used in the chart
+ RegisterProperties();
+ }
+
+ /// <summary>
+ /// Returns custom properties registry service object.
+ /// </summary>
+ /// <param name="serviceType">Service type to get.</param>
+ /// <returns>Custom properties registry service.</returns>
+ [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+ object IServiceProvider.GetService(Type serviceType)
+ {
+ if(serviceType == typeof(CustomPropertyRegistry))
+ {
+ return this;
+ }
+ throw (new ArgumentException(SR.ExceptionCustomAttributesRegistryUnsupportedType( serviceType.ToString()) ));
+ }
+
+ #endregion
+
+ #region Properties Regestering methods
+
+ /// <summary>
+ /// This method registers all standard custom properties used in
+ /// the chart and provides all the additional information like
+ /// description, value validation and scenarios where custom
+ /// attribute can be used.
+ /// </summary>
+ private void RegisterProperties()
+ {
+ SeriesChartType[] chartTypes = null;
+ CustomPropertyInfo attrInfo = null;
+
+ //***********************************************************************
+ //** DrawSideBySide properties
+ //***********************************************************************
+ chartTypes = new SeriesChartType[] {
+ SeriesChartType.Bar,
+ SeriesChartType.Column,
+
+ SeriesChartType.RangeColumn,
+ SeriesChartType.BoxPlot,
+ SeriesChartType.RangeBar,
+ SeriesChartType.ErrorBar,
+
+ };
+ // "DrawSideBySide" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.DrawSideBySide,
+ typeof(AxisEnabled),
+ "Auto",
+ SR.DescriptionCustomAttributeDrawSideBySide,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ //***********************************************************************
+ //** IsXAxisQuantitative properties
+ //***********************************************************************
+ registeredCustomProperties.Add(new CustomPropertyInfo(
+ CustomPropertyName.IsXAxisQuantitative,
+ typeof(bool),
+ "false",
+ SR.DescriptionCustomAttributeIsXAxisQuantitive,
+ IsXAxisQuantitativeChartTypes.ToArray(),
+ true,
+ false));
+
+ //***********************************************************************
+ //** EmptyPointValue properties
+ //***********************************************************************
+ chartTypes = new SeriesChartType[] {
+ SeriesChartType.Point,
+ SeriesChartType.Bubble,
+ SeriesChartType.Line,
+ SeriesChartType.Spline,
+ SeriesChartType.StepLine,
+ SeriesChartType.Column,
+ SeriesChartType.RangeColumn,
+ SeriesChartType.RangeBar,
+ SeriesChartType.Radar,
+ SeriesChartType.Range,
+ SeriesChartType.SplineRange,
+ SeriesChartType.Polar,
+ SeriesChartType.Area,
+ SeriesChartType.SplineArea,
+ SeriesChartType.Bar,
+ };
+ registeredCustomProperties.Add( new CustomPropertyInfo(
+ CustomPropertyName.EmptyPointValue,
+ typeof(EmptyPointTypes),
+ "Average",
+ SR.DescriptionCustomAttributeEmptyPointValue,
+ chartTypes,
+ true,
+ false) );
+
+
+ //***********************************************************************
+ //** Bar label styles properties
+ //***********************************************************************
+ chartTypes = new SeriesChartType[] {
+ SeriesChartType.StackedBar,
+ SeriesChartType.StackedBar100,
+ SeriesChartType.RangeBar,
+ };
+ // "BarLabelStyle" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.BarLabelStyle,
+ typeof(BarValueLabelDrawingStyle),
+ "Center",
+ SR.DescriptionCustomAttributeBarLabelStyle,
+ chartTypes,
+ true,
+ true);
+ registeredCustomProperties.Add( attrInfo );
+
+
+
+ //***********************************************************************
+ //** Stacked Column/Bar properties
+ //***********************************************************************
+ chartTypes = new SeriesChartType[] {
+ SeriesChartType.StackedBar,
+ SeriesChartType.StackedBar100,
+ SeriesChartType.StackedColumn,
+ SeriesChartType.StackedColumn100,
+
+ };
+
+ // "StackedGroupName" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.StackedGroupName,
+ typeof(string),
+ string.Empty,
+ SR.DescriptionCustomAttributeStackedGroupName,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add(attrInfo);
+
+
+
+ //***********************************************************************
+ //** Bar label styles properties
+ //***********************************************************************
+ chartTypes = new SeriesChartType[] {
+ SeriesChartType.Bar,
+ };
+ // "BarLabelStyle" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.BarLabelStyle,
+ typeof(BarValueLabelDrawingStyle),
+ "Outside",
+ SR.DescriptionCustomAttributeBarLabelStyle,
+ chartTypes,
+ true,
+ true);
+ registeredCustomProperties.Add( attrInfo );
+
+ //***********************************************************************
+ //** Bar and Columnt chart types properties
+ //***********************************************************************
+ chartTypes = new SeriesChartType[] {
+ SeriesChartType.Bar,
+ SeriesChartType.Column,
+ SeriesChartType.StackedBar,
+ SeriesChartType.StackedBar100,
+ SeriesChartType.StackedColumn,
+ SeriesChartType.StackedColumn100,
+ SeriesChartType.RangeBar,
+ SeriesChartType.RangeColumn,
+
+ };
+ // "DrawingStyle" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.DrawingStyle,
+ typeof(BarDrawingStyle),
+ "Default",
+ SR.DescriptionCustomAttributeDrawingStyle,
+ chartTypes,
+ true,
+ true);
+ registeredCustomProperties.Add( attrInfo );
+
+ //***********************************************************************
+ //** Chart types point width properties
+ //***********************************************************************
+ chartTypes = new SeriesChartType[] {
+ SeriesChartType.Bar,
+ SeriesChartType.Candlestick,
+ SeriesChartType.Column,
+ SeriesChartType.StackedBar,
+ SeriesChartType.StackedBar100,
+ SeriesChartType.StackedColumn,
+ SeriesChartType.StackedColumn100,
+ SeriesChartType.Stock,
+ SeriesChartType.BoxPlot,
+ SeriesChartType.ErrorBar,
+ SeriesChartType.RangeBar,
+ SeriesChartType.RangeColumn,
+ };
+ // "PointWidth" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.PointWidth,
+ typeof(float),
+ 0.8f,
+ SR.DescriptionCustomAttributePointWidth,
+ chartTypes,
+ true,
+ false);
+ attrInfo.MinValue = 0f;
+ attrInfo.MaxValue = 2f;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "PixelPointWidth" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.PixelPointWidth,
+ typeof(int),
+ 0,
+ SR.DescriptionCustomAttributePixelPointWidth,
+ chartTypes,
+ true,
+ false);
+ attrInfo.MinValue = 0;
+ attrInfo.MaxValue = CustomPropertyRegistry.MaxValueOfPixelAttribute;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "MinPixelPointWidth" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.MinPixelPointWidth,
+ typeof(int),
+ 0,
+ SR.DescriptionCustomAttributeMinPixelPointWidth,
+ chartTypes,
+ true,
+ false);
+ attrInfo.MinValue = 0;
+ attrInfo.MaxValue = CustomPropertyRegistry.MaxValueOfPixelAttribute;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "MaxPixelPointWidth" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.MaxPixelPointWidth,
+ typeof(int),
+ 0,
+ SR.DescriptionCustomAttributeMaxPixelPointWidth,
+ chartTypes,
+ true,
+ false);
+ attrInfo.MinValue = 0;
+ attrInfo.MaxValue = CustomPropertyRegistry.MaxValueOfPixelAttribute;
+ registeredCustomProperties.Add( attrInfo );
+
+
+
+ //***********************************************************************
+ //** CandleStick chart types properties
+ //***********************************************************************
+ chartTypes = new SeriesChartType[] { SeriesChartType.Candlestick };
+
+ // "PriceUpColor" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.PriceUpColor,
+ typeof(Color),
+ "",
+ SR.DescriptionCustomAttributeCandlePriceUpColor,
+ chartTypes,
+ true,
+ true);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "PriceDownColor" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.PriceDownColor,
+ typeof(Color),
+ "",
+ SR.DescriptionCustomAttributePriceDownColor,
+ chartTypes,
+ true,
+ true);
+ registeredCustomProperties.Add( attrInfo );
+
+
+ //***********************************************************************
+ //** Stock and CandleStick chart types properties
+ //***********************************************************************
+ chartTypes = new SeriesChartType[] { SeriesChartType.Stock, SeriesChartType.Candlestick };
+
+ // "LabelValueType" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.LabelValueType,
+ typeof(StockLabelValueTypes),
+ "Close",
+ SR.DescriptionCustomAttributeLabelValueType,
+ chartTypes,
+ true,
+ true);
+ registeredCustomProperties.Add( attrInfo );
+
+ //***********************************************************************
+ //** Stock chart types properties
+ //***********************************************************************
+ chartTypes = new SeriesChartType[] { SeriesChartType.Stock };
+
+ // "OpenCloseStyle" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.OpenCloseStyle,
+ typeof(StockOpenCloseMarkStyle),
+ "Line",
+ SR.DescriptionCustomAttributeOpenCloseStyle,
+ chartTypes,
+ true,
+ true);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "ShowOpenClose" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.ShowOpenClose,
+ typeof(StockShowOpenCloseTypes),
+ "Both",
+ SR.DescriptionCustomAttributeShowOpenClose,
+ chartTypes,
+ true,
+ true);
+ registeredCustomProperties.Add( attrInfo );
+
+
+ //***********************************************************************
+ //** Bubble chart types properties
+ //***********************************************************************
+ chartTypes = new SeriesChartType[] { SeriesChartType.Bubble };
+
+ // "BubbleScaleMin" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.BubbleScaleMin,
+ typeof(float),
+ 0f,
+ SR.DescriptionCustomAttributeBubbleScaleMin,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "BubbleScaleMax" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.BubbleScaleMax,
+ typeof(float),
+ 0f,
+ SR.DescriptionCustomAttributeBubbleScaleMax,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "BubbleMaxSize" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.BubbleMaxSize,
+ typeof(float),
+ 15f,
+ SR.DescriptionCustomAttributeBubbleMaxSize,
+ chartTypes,
+ true,
+ false);
+ attrInfo.MinValue = 0f;
+ attrInfo.MaxValue = 100f;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "BubbleMinSize" attribute of the Bubble chart
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.BubbleMinSize,
+ typeof(float),
+ 3f,
+ SR.DescriptionCustomAttributeBubbleMaxSize,
+ chartTypes,
+ true,
+ false);
+ attrInfo.MinValue = 0f;
+ attrInfo.MaxValue = 100f;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "BubbleUseSizeForLabel" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.BubbleUseSizeForLabel,
+ typeof(bool),
+ false,
+ SR.DescriptionCustomAttributeBubbleUseSizeForLabel,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+
+
+ //***********************************************************************
+ //** Pie and Doughnut chart types properties
+ //***********************************************************************
+ chartTypes = new SeriesChartType[] {
+ SeriesChartType.Pie,
+ SeriesChartType.Doughnut
+ };
+
+
+ // "PieDrawingStyle" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.PieDrawingStyle,
+ typeof(PieDrawingStyle),
+ "Default",
+ SR.DescriptionCustomAttributePieDrawingStyle,
+ chartTypes,
+ true,
+ false);
+ attrInfo.AppliesTo3D = false;
+ registeredCustomProperties.Add( attrInfo );
+
+
+ // "CollectedThreshold" attribute of the Pie chart
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.CollectedThreshold,
+ typeof(double),
+ 0.0,
+ SR.DescriptionCustomAttributeCollectedThreshold,
+ chartTypes,
+ true,
+ false);
+ attrInfo.MinValue = 0.0;
+ attrInfo.MaxValue = double.MaxValue;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "CollectedThresholdUsePercent" attribute of the Pie chart
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.CollectedThresholdUsePercent,
+ typeof(bool),
+ true,
+ SR.DescriptionCustomAttributeCollectedThresholdUsePercent,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "CollectedSliceExploded" attribute of the Pie chart
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.CollectedSliceExploded,
+ typeof(bool),
+ false,
+ SR.DescriptionCustomAttributeCollectedSliceExploded,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "CollectedLabel" attribute of the Pie chart
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.CollectedLabel,
+ typeof(string),
+ string.Empty,
+ SR.DescriptionCustomAttributeCollectedLabel,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "CollectedLegendText" attribute of the Pie chart
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.CollectedLegendText,
+ typeof(string),
+ SR.DescriptionCustomAttributeCollectedLegendDefaultText,
+ SR.DescriptionCustomAttributeCollectedLegendText,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "CollectedToolTip" attribute of the Pie chart
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.CollectedToolTip,
+ typeof(string),
+ string.Empty,
+ SR.DescriptionCustomAttributeCollectedToolTip,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "CollectedColor" attribute of the Pie chart
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.CollectedColor,
+ typeof(Color),
+ "",
+ SR.DescriptionCustomAttributeCollectedColor,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+
+ // "PieStartAngle" attribute of the Pie chart
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.PieStartAngle,
+ typeof(int),
+ 0,
+ SR.DescriptionCustomAttributePieStartAngle,
+ chartTypes,
+ true,
+ false);
+ attrInfo.MinValue = 0;
+ attrInfo.MaxValue = 360;
+ registeredCustomProperties.Add( attrInfo );
+
+
+
+
+ // "Exploded" attribute of the Pie chart
+ registeredCustomProperties.Add( new CustomPropertyInfo(
+ CustomPropertyName.Exploded,
+ typeof(bool),
+ false,
+ SR.DescriptionCustomAttributePieDonutExploded,
+ chartTypes,
+ false,
+ true) );
+
+ // "LabelsRadialLineSize" attribute of the Pie chart
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.LabelsRadialLineSize,
+ typeof(float),
+ 1f,
+ SR.DescriptionCustomAttributeLabelsRadialLineSize,
+ chartTypes,
+ true,
+ true);
+ attrInfo.AppliesTo3D = false;
+ attrInfo.MinValue = 0f;
+ attrInfo.MaxValue = 100f;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "LabelsHorizontalLineSize" attribute of the Pie chart
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.LabelsHorizontalLineSize,
+ typeof(float),
+ 1f,
+ SR.DescriptionCustomAttributeLabelsHorizontalLineSize,
+ chartTypes,
+ true,
+ true);
+ attrInfo.AppliesTo3D = false;
+ attrInfo.MinValue = 0f;
+ attrInfo.MaxValue = 100f;
+ registeredCustomProperties.Add( attrInfo );
+
+
+ // "PieLabelStyle" attribute of the Pie chart
+ registeredCustomProperties.Add( new CustomPropertyInfo(
+ CustomPropertyName.PieLabelStyle,
+ typeof(PieLabelStyle),
+ "Inside",
+ SR.DescriptionCustomAttributePieLabelStyle,
+ chartTypes,
+ true,
+ true) );
+
+
+ // "MinimumRelativePieSize" attribute of the Pie chart
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.MinimumRelativePieSize,
+ typeof(float),
+ 30f,
+ SR.DescriptionCustomAttributeMinimumRelativePieSize,
+ chartTypes,
+ true,
+ false);
+ attrInfo.MinValue = 10f;
+ attrInfo.MaxValue = 70f;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "3DLabelLineSize" attribute of the Pie chart
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName._3DLabelLineSize,
+ typeof(float),
+ 100f,
+ SR.DescriptionCustomAttribute_3DLabelLineSize,
+ chartTypes,
+ true,
+ false);
+ attrInfo.AppliesTo2D = false;
+ attrInfo.MinValue = 30f;
+ attrInfo.MaxValue = 200f;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "PieLineColor" attribute of the Pie chart
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.PieLineColor,
+ typeof(Color),
+ "",
+ SR.DescriptionCustomAttributePieLineColor,
+ chartTypes,
+ true,
+ true);
+ registeredCustomProperties.Add( attrInfo );
+
+ //***********************************************************************
+ //** Doughnut chart types properties
+ //***********************************************************************
+
+ // "DoughnutRadius" attribute of the Pie chart
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.DoughnutRadius,
+ typeof(float),
+ 60f,
+ SR.DescriptionCustomAttributeDoughnutRadius,
+ new SeriesChartType[] { SeriesChartType.Doughnut },
+ true,
+ false);
+ attrInfo.MinValue = 0f;
+ attrInfo.MaxValue = 99f;
+ registeredCustomProperties.Add( attrInfo );
+
+
+ //***********************************************************************
+ //** Other
+ //***********************************************************************
+
+ // "LabelStyle" attribute
+ chartTypes = new SeriesChartType[] {
+ SeriesChartType.Point,
+ SeriesChartType.Column,
+ SeriesChartType.Bubble,
+ SeriesChartType.Line,
+ SeriesChartType.Spline,
+ SeriesChartType.StepLine,
+ SeriesChartType.Area,
+ SeriesChartType.SplineArea,
+ SeriesChartType.Range,
+ SeriesChartType.SplineRange,
+ SeriesChartType.Radar,
+ SeriesChartType.Polar,
+
+ };
+ registeredCustomProperties.Add( new CustomPropertyInfo(
+ CustomPropertyName.LabelStyle,
+ typeof(LabelAlignments),
+ "Auto",
+ SR.DescriptionCustomAttributeLabelStyle,
+ chartTypes,
+ true,
+ true) );
+
+ // "ShowMarkerLines" attribute
+ chartTypes = new SeriesChartType[] {
+ SeriesChartType.Line,
+ SeriesChartType.Spline,
+ SeriesChartType.StepLine,
+ SeriesChartType.Area,
+ SeriesChartType.SplineArea,
+ SeriesChartType.Range,
+ SeriesChartType.SplineRange
+ };
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.ShowMarkerLines,
+ typeof(bool),
+ false,
+ SR.DescriptionCustomAttributeShowMarkerLines,
+ chartTypes,
+ true,
+ true);
+ attrInfo.AppliesTo2D = false;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "LineTension" attribute
+ chartTypes = new SeriesChartType[] {
+ SeriesChartType.Spline,
+ SeriesChartType.SplineArea,
+ SeriesChartType.SplineRange
+ };
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.LineTension,
+ typeof(float),
+ 0.5f,
+ SR.DescriptionCustomAttributeLineTension,
+ chartTypes,
+ true,
+ false);
+ attrInfo.MinValue = 0f;
+ attrInfo.MaxValue = 2f;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "PixelPointDepth" attribute
+ chartTypes = new SeriesChartType[] {
+ SeriesChartType.Area,
+ SeriesChartType.Bar,
+ SeriesChartType.Bubble,
+ SeriesChartType.Candlestick,
+ SeriesChartType.Column,
+ SeriesChartType.Line,
+ SeriesChartType.Point,
+ SeriesChartType.Spline,
+ SeriesChartType.SplineArea,
+ SeriesChartType.StackedArea,
+ SeriesChartType.StackedArea100,
+ SeriesChartType.StackedBar,
+ SeriesChartType.StackedBar100,
+ SeriesChartType.StackedColumn,
+ SeriesChartType.StackedColumn100,
+ SeriesChartType.StepLine,
+ SeriesChartType.Stock,
+
+ SeriesChartType.ThreeLineBreak,
+ SeriesChartType.BoxPlot,
+ SeriesChartType.ErrorBar,
+ SeriesChartType.RangeBar,
+ SeriesChartType.Kagi,
+ SeriesChartType.PointAndFigure,
+ SeriesChartType.Range,
+ SeriesChartType.RangeColumn,
+ SeriesChartType.Renko,
+ SeriesChartType.SplineRange,
+ SeriesChartType.FastLine,
+ };
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.PixelPointDepth,
+ typeof(int),
+ 0,
+ SR.DescriptionCustomAttributePixelPointDepth,
+ chartTypes,
+ true,
+ false);
+ attrInfo.MinValue = 0;
+ attrInfo.MaxValue = CustomPropertyRegistry.MaxValueOfPixelAttribute;
+ attrInfo.AppliesTo2D = false;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "PixelPointGapDepth" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.PixelPointGapDepth,
+ typeof(int),
+ 0,
+ SR.DescriptionCustomAttributePixelPointGapDepth,
+ chartTypes,
+ true,
+ false);
+ attrInfo.MinValue = 0;
+ attrInfo.MaxValue = CustomPropertyRegistry.MaxValueOfPixelAttribute;
+ attrInfo.AppliesTo2D = false;
+ registeredCustomProperties.Add( attrInfo );
+
+
+
+ //***********************************************************************
+ //** FastLine chart type properties
+ //***********************************************************************
+ chartTypes = new SeriesChartType[] {
+ SeriesChartType.FastLine,
+ SeriesChartType.FastPoint,
+ };
+
+/* NOTE: This is an internal attribute
+ *
+ // "PermittedPixelError" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.PixelPointGapDepth,
+ typeof(float),
+ 1f,
+ "Gets or sets the acceptable error in pixels for the data point filtering algorithm.",
+ chartTypes,
+ true,
+ false);
+ attrInfo.MinValue = 0f;
+ attrInfo.MaxValue = 1f;
+ registeredCustomProperties.Add( attrInfo );
+*/
+ //***********************************************************************
+ //** Polar chart type properties
+ //***********************************************************************
+ chartTypes = new SeriesChartType[] {
+ SeriesChartType.Polar
+ };
+ // "AreaDrawingStyle" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.AreaDrawingStyle,
+ typeof(CircularAreaDrawingStyles),
+ "Circle",
+ SR.DescriptionCustomAttributePolarAreaDrawingStyle,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "CircularLabelsStyle" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.CircularLabelsStyle,
+ typeof(CircularAxisLabelsStyle),
+ "Auto",
+ SR.DescriptionCustomAttributePolarCircularLabelsStyle,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "PolarDrawingStyle" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.PolarDrawingStyle,
+ typeof(PolarDrawingStyles),
+ "Line",
+ SR.DescriptionCustomAttributePolarDrawingStyle,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+
+
+ //***********************************************************************
+ //** Radar chart type properties
+ //***********************************************************************
+ chartTypes = new SeriesChartType[] {
+ SeriesChartType.Radar
+ };
+ // "AreaDrawingStyle" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.AreaDrawingStyle,
+ typeof(CircularAreaDrawingStyles),
+ "Circle",
+ SR.DescriptionCustomAttributeRadarAreaDrawingStyle,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "CircularLabelsStyle" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.CircularLabelsStyle,
+ typeof(CircularAxisLabelsStyle),
+ "Auto",
+ SR.DescriptionCustomAttributeRadarCircularLabelsStyle,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "RadarDrawingStyle" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.RadarDrawingStyle,
+ typeof(RadarDrawingStyle),
+ "Area",
+ SR.DescriptionCustomAttributeRadarDrawingStyle,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+
+ //***********************************************************************
+ //** BoxPlot chart type properties
+ //***********************************************************************
+ chartTypes = new SeriesChartType[] {
+ SeriesChartType.BoxPlot
+ };
+ // "BoxPlotPercentile" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.BoxPlotPercentile,
+ typeof(float),
+ 25f,
+ SR.DescriptionCustomAttributeBoxPlotPercentile,
+ chartTypes,
+ true,
+ false);
+ attrInfo.MinValue = 0f;
+ attrInfo.MaxValue = 1000f;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "BoxPlotWhiskerPercentile" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.BoxPlotWhiskerPercentile,
+ typeof(float),
+ 10f,
+ SR.DescriptionCustomAttributeBoxPlotWhiskerPercentile,
+ chartTypes,
+ true,
+ false);
+ attrInfo.MinValue = 0f;
+ attrInfo.MaxValue = 1000f;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "BoxPlotShowAverage" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.BoxPlotShowAverage,
+ typeof(bool),
+ true,
+ SR.DescriptionCustomAttributeBoxPlotShowAverage,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "BoxPlotShowMedian" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.BoxPlotShowMedian,
+ typeof(bool),
+ true,
+ SR.DescriptionCustomAttributeBoxPlotShowMedian,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "BoxPlotShowUnusualValues" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.BoxPlotShowUnusualValues,
+ typeof(bool),
+ false,
+ SR.DescriptionCustomAttributeBoxPlotShowUnusualValues,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "BoxPlotSeries" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.BoxPlotSeries,
+ typeof(string),
+ "",
+ SR.DescriptionCustomAttributeBoxPlotSeries,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ //***********************************************************************
+ //** ErrorBar chart type properties
+ //***********************************************************************
+ chartTypes = new SeriesChartType[] {
+ SeriesChartType.ErrorBar
+ };
+ // "ErrorBarStyle" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.ErrorBarStyle,
+ typeof(ErrorBarStyle),
+ "Both",
+ SR.DescriptionCustomAttributeErrorBarStyle,
+ chartTypes,
+ true,
+ true);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "ErrorBarCenterMarkerStyle" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.ErrorBarCenterMarkerStyle,
+ typeof(ErrorBarMarkerStyles),
+ "Line",
+ SR.DescriptionCustomAttributeErrorBarCenterMarkerStyle,
+ chartTypes,
+ true,
+ true);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "ErrorBarSeries" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.ErrorBarSeries,
+ typeof(string),
+ "",
+ SR.DescriptionCustomAttributeErrorBarSeries,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "ErrorBarType" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.ErrorBarType,
+ typeof(string),
+ String.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}({1:N0})", ErrorBarType.StandardError, ErrorBarChart.DefaultErrorBarTypeValue(ErrorBarType.StandardError)),
+ SR.DescriptionCustomAttributeErrorBarType,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+
+ //***********************************************************************
+ //** PointAndFigure chart types properties
+ //***********************************************************************
+ chartTypes = new SeriesChartType[] { SeriesChartType.PointAndFigure };
+
+ // "UsedYValueHigh" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.UsedYValueHigh,
+ typeof(int),
+ 0,
+ SR.DescriptionCustomAttributeUsedYValueHigh,
+ chartTypes,
+ true,
+ false);
+ attrInfo.MinValue = 0;
+ attrInfo.MaxValue = 20;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "UsedYValueLow" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.UsedYValueLow,
+ typeof(int),
+ 1,
+ SR.DescriptionCustomAttributeUsedYValueLow,
+ chartTypes,
+ true,
+ false);
+ attrInfo.MinValue = 0;
+ attrInfo.MaxValue = 20;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "PriceUpColor" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.PriceUpColor,
+ typeof(Color),
+ "",
+ SR.DescriptionCustomAttributeBarsPriceUpColor,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "BoxSize" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.BoxSize,
+ typeof(string),
+ "4%",
+ SR.DescriptionCustomAttributePointFigureBoxSize,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "ProportionalSymbols" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.ProportionalSymbols,
+ typeof(bool),
+ true,
+ SR.DescriptionCustomAttributeProportionalSymbols,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "ReversalAmount" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.ReversalAmount,
+ typeof(int),
+ "3",
+ SR.DescriptionCustomAttributeReversalAmount,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ //***********************************************************************
+ //** Kagi chart types properties
+ //***********************************************************************
+ chartTypes = new SeriesChartType[] { SeriesChartType.Kagi };
+
+ // "UsedYValue" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.UsedYValue,
+ typeof(int),
+ 0,
+ SR.DescriptionCustomAttributeUsedYValue,
+ chartTypes,
+ true,
+ false);
+ attrInfo.MinValue = 0;
+ attrInfo.MaxValue = 20;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "PriceUpColor" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.PriceUpColor,
+ typeof(Color),
+ "",
+ SR.DescriptionCustomAttributeBarsPriceUpColor,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "ReversalAmount" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.ReversalAmount,
+ typeof(string),
+ "3%",
+ SR.DescriptionCustomAttributeKagiReversalAmount,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ //***********************************************************************
+ //** Renko chart types properties
+ //***********************************************************************
+ chartTypes = new SeriesChartType[] { SeriesChartType.Renko };
+
+ // "UsedYValue" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.UsedYValue,
+ typeof(int),
+ 0,
+ SR.DescriptionCustomAttributeRenkoUsedYValue,
+ chartTypes,
+ true,
+ false);
+ attrInfo.MinValue = 0;
+ attrInfo.MaxValue = 20;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "PriceUpColor" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.PriceUpColor,
+ typeof(Color),
+ "",
+ SR.DescriptionCustomAttributeBarsPriceUpColor,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "BoxSize" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.BoxSize,
+ typeof(string),
+ "4%",
+ SR.DescriptionCustomAttributeBoxSize,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ //***********************************************************************
+ //** ThreeLineBreak chart types properties
+ //***********************************************************************
+ chartTypes = new SeriesChartType[] { SeriesChartType.ThreeLineBreak };
+
+ // "UsedYValue" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.UsedYValue,
+ typeof(int),
+ 0,
+ SR.DescriptionCustomAttributeThreeLineBreakUsedYValue,
+ chartTypes,
+ true,
+ false);
+ attrInfo.MinValue = 0;
+ attrInfo.MaxValue = 20;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "PriceUpColor" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.PriceUpColor,
+ typeof(Color),
+ "",
+ SR.DescriptionCustomAttributeBarsPriceUpColor,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "NumberOfLinesInBreak" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.NumberOfLinesInBreak,
+ typeof(int),
+ 3,
+ SR.DescriptionCustomAttributeNumberOfLinesInBreak,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+
+
+ //***********************************************************************
+ //** Funnel chart types properties
+ //***********************************************************************
+ chartTypes = new SeriesChartType[] { SeriesChartType.Funnel };
+
+
+ // "FunnelLabelStyle" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.FunnelLabelStyle,
+ typeof(FunnelLabelStyle),
+ "OutsideInColumn",
+ SR.DescriptionCustomAttributeFunnelLabelStyle,
+ chartTypes,
+ true,
+ true);
+ registeredCustomProperties.Add( attrInfo );
+
+
+ // "FunnelNeckWidth" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.FunnelNeckWidth,
+ typeof(float),
+ 5f,
+ SR.DescriptionCustomAttributeFunnelNeckWidth,
+ chartTypes,
+ true,
+ false);
+ attrInfo.MinValue = 0f;
+ attrInfo.MaxValue = 100f;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "FunnelNeckHeight" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.FunnelNeckHeight,
+ typeof(float),
+ 5f,
+ SR.DescriptionCustomAttributeFunnelNeckHeight,
+ chartTypes,
+ true,
+ false);
+ attrInfo.MinValue = 0f;
+ attrInfo.MaxValue = 100f;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "FunnelMinPointHeight" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.FunnelMinPointHeight,
+ typeof(float),
+ 0f,
+ SR.DescriptionCustomAttributeFunnelMinPointHeight,
+ chartTypes,
+ true,
+ false);
+ attrInfo.MinValue = 0f;
+ attrInfo.MaxValue = 100f;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "Funnel3DRotationAngle" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.Funnel3DRotationAngle,
+ typeof(float),
+ 5f,
+ SR.DescriptionCustomAttributeFunnel3DRotationAngle,
+ chartTypes,
+ true,
+ false);
+ attrInfo.AppliesTo2D = false;
+ attrInfo.MinValue = -10f;
+ attrInfo.MaxValue = 10f;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "FunnelPointGap" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.FunnelPointGap,
+ typeof(float),
+ 0f,
+ SR.DescriptionCustomAttributeFunnelPointGap,
+ chartTypes,
+ true,
+ false);
+ attrInfo.MinValue = 0f;
+ attrInfo.MaxValue = 100f;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "Funnel3DDrawingStyle" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.Funnel3DDrawingStyle,
+ typeof(Funnel3DDrawingStyle),
+ "CircularBase",
+ SR.DescriptionCustomAttributeFunnel3DDrawingStyle,
+ chartTypes,
+ true,
+ false);
+ attrInfo.AppliesTo2D = false;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "FunnelStyle" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.FunnelStyle,
+ typeof(FunnelStyle),
+ "YIsHeight",
+ SR.DescriptionCustomAttributeFunnelStyle,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "FunnelInsideLabelAlignment" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.FunnelInsideLabelAlignment,
+ typeof(FunnelLabelVerticalAlignment),
+ "Center",
+ SR.DescriptionCustomAttributeFunnelInsideLabelAlignment,
+ chartTypes,
+ true,
+ true);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "FunnelOutsideLabelPlacement" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.FunnelOutsideLabelPlacement,
+ typeof(FunnelLabelPlacement),
+ "Right",
+ SR.DescriptionCustomAttributeFunnelOutsideLabelPlacement,
+ chartTypes,
+ true,
+ true);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "CalloutLineColor" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.CalloutLineColor,
+ typeof(Color),
+ "Black",
+ SR.DescriptionCustomAttributeCalloutLineColor,
+ chartTypes,
+ true,
+ true);
+ registeredCustomProperties.Add( attrInfo );
+
+ //***********************************************************************
+ //** Pyramid chart types properties
+ //***********************************************************************
+ chartTypes = new SeriesChartType[] { SeriesChartType.Pyramid };
+
+
+ // "PyramidLabelStyle" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.PyramidLabelStyle,
+ typeof(FunnelLabelStyle),
+ "OutsideInColumn",
+ SR.DescriptionCustomAttributePyramidLabelStyle,
+ chartTypes,
+ true,
+ true);
+ registeredCustomProperties.Add( attrInfo );
+
+
+ // "PyramidMinPointHeight" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.PyramidMinPointHeight,
+ typeof(float),
+ 0f,
+ SR.DescriptionCustomAttributePyramidMinPointHeight,
+ chartTypes,
+ true,
+ false);
+ attrInfo.MinValue = 0f;
+ attrInfo.MaxValue = 100f;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "Pyramid3DRotationAngle" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.Pyramid3DRotationAngle,
+ typeof(float),
+ 5f,
+ SR.DescriptionCustomAttributePyramid3DRotationAngle,
+ chartTypes,
+ true,
+ false);
+ attrInfo.AppliesTo2D = false;
+ attrInfo.MinValue = -10f;
+ attrInfo.MaxValue = 10f;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "PyramidPointGap" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.PyramidPointGap,
+ typeof(float),
+ 0f,
+ SR.DescriptionCustomAttributePyramidPointGap,
+ chartTypes,
+ true,
+ false);
+ attrInfo.MinValue = 0f;
+ attrInfo.MaxValue = 100f;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "Pyramid3DDrawingStyle" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.Pyramid3DDrawingStyle,
+ typeof(Funnel3DDrawingStyle),
+ "SquareBase",
+ SR.DescriptionCustomAttributePyramid3DDrawingStyle,
+ chartTypes,
+ true,
+ false);
+ attrInfo.AppliesTo2D = false;
+ registeredCustomProperties.Add( attrInfo );
+
+ // "PyramidInsideLabelAlignment" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.PyramidInsideLabelAlignment,
+ typeof(FunnelLabelVerticalAlignment),
+ "Center",
+ SR.DescriptionCustomAttributePyramidInsideLabelAlignment,
+ chartTypes,
+ true,
+ true);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "PyramidOutsideLabelPlacement" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.PyramidOutsideLabelPlacement,
+ typeof(FunnelLabelPlacement),
+ "Right",
+ SR.DescriptionCustomAttributePyramidOutsideLabelPlacement,
+ chartTypes,
+ true,
+ true);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "CalloutLineColor" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.CalloutLineColor,
+ typeof(Color),
+ "Black",
+ SR.DescriptionCustomAttributeCalloutLineColor,
+ chartTypes,
+ true,
+ true);
+ registeredCustomProperties.Add( attrInfo );
+
+ // "PyramidValueType" attribute
+ attrInfo = new CustomPropertyInfo(
+ CustomPropertyName.PyramidValueType,
+ typeof(PyramidValueType),
+ "Linear",
+ SR.DescriptionCustomAttributePyramidValueType,
+ chartTypes,
+ true,
+ false);
+ registeredCustomProperties.Add( attrInfo );
+
+
+ }
+
+ #endregion // Attributes Regestering methods
+
+ #region Registry methods
+
+ /// <summary>
+ /// Adds custom attribute information into the registry.
+ /// </summary>
+ /// <param name="customPropertyInfo">Custom attribute information.</param>
+ public void Register(CustomPropertyInfo customPropertyInfo)
+ {
+ // Add custom attribute information to the hash table
+ registeredCustomProperties.Add(customPropertyInfo);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// CustomPropertyInfo class stores information about single
+ /// custom attribute. It includes Name, Description, Default
+ /// Value, any restrictions and the conditions when it can
+ /// be used.
+ ///
+ /// Most of the custom attribute can only be used when specific
+ /// chart type is selected. Some of the properties only work
+ /// in 2D or 3D mode and some can be applied to the whole
+ /// series or data points only.
+ /// </summary>
+ internal class CustomPropertyInfo
+ {
+ #region Public Fields
+
+ /// <summary>
+ /// Attribute name.
+ /// </summary>
+ public string Name = String.Empty;
+
+ /// <summary>
+ /// Attribute value type.
+ /// </summary>
+ public Type ValueType = typeof(int);
+
+ /// <summary>
+ /// Attribute default value.
+ /// </summary>
+ public object DefaultValue = null;
+
+ /// <summary>
+ /// Attribute description.
+ /// </summary>
+ public string Description = String.Empty;
+
+ /// <summary>
+ /// Array of chart type supported by the attribute
+ /// </summary>
+ public SeriesChartType[] AppliesToChartType = null;
+
+ /// <summary>
+ /// Indicates that attribute can be applied on series.
+ /// </summary>
+ public bool AppliesToSeries = true;
+
+ /// <summary>
+ /// Indicates that attribute can be applied on data point.
+ /// </summary>
+ public bool AppliesToDataPoint = true;
+
+ /// <summary>
+ /// Indicates that attribute can be applied on 3D chart type.
+ /// </summary>
+ public bool AppliesTo3D = true;
+
+ /// <summary>
+ /// Indicates that attribute can be applied on 2D chart type.
+ /// </summary>
+ public bool AppliesTo2D = true;
+
+ /// <summary>
+ /// Attribute minimum value.
+ /// </summary>
+ public object MinValue = null;
+
+ /// <summary>
+ /// Attribute maximum value.
+ /// </summary>
+ public object MaxValue = null;
+
+ #endregion // Public Fields
+
+ #region Constructor
+
+ /// <summary>
+ /// Public constructor.
+ /// </summary>
+ /// <param name="name">Attribute name</param>
+ /// <param name="valueType">Attribute value type.</param>
+ /// <param name="defaultValue">Attribute default value.</param>
+ /// <param name="description">Attribute description.</param>
+ /// <param name="appliesToChartType">Array of chart types where attribute used.</param>
+ /// <param name="appliesToSeries">True if properties can be set in series.</param>
+ /// <param name="appliesToDataPoint">True if properties can be set in data point.</param>
+ public CustomPropertyInfo(
+ string name,
+ Type valueType,
+ object defaultValue,
+ string description,
+ SeriesChartType[] appliesToChartType,
+ bool appliesToSeries,
+ bool appliesToDataPoint)
+ {
+ this.Name = name;
+ this.ValueType = valueType;
+ this.DefaultValue = defaultValue;
+ this.Description = description;
+ this.AppliesToChartType = appliesToChartType;
+ this.AppliesToSeries = appliesToSeries;
+ this.AppliesToDataPoint = appliesToDataPoint;
+ }
+
+ #endregion // Constructor
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/ElementPosition.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/ElementPosition.cs
new file mode 100644
index 00000000000..2b8707df6c8
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/ElementPosition.cs
@@ -0,0 +1,535 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: ElementPosition.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting
+//
+// Classes: ElementPosition
+//
+// Purpose: Class is used to store relative position of the chart
+// elements like Legend, Title and others. It uses
+// relative coordinate system where top left corner is
+// 0,0 and bottom right is 100,100.
+//
+// If Auto property is set to true, all position properties
+// (X,Y,Width and Height) are ignored and they automatically
+// calculated during chart rendering.
+//
+// Note that setting any of the position properties will
+// automatically set Auto property to false.
+//
+// Reviewed: AG - August 7, 2002
+// AG - Microsoft 5, 2007
+//
+//===================================================================
+
+
+#region Used Namespaces
+
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Design;
+using System.Drawing.Drawing2D;
+using System.Diagnostics.CodeAnalysis;
+using System.Globalization;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.Data;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+ using System.Windows.Forms.DataVisualization.Charting.Utilities;
+ using System.Windows.Forms.DataVisualization.Charting.Borders3D;
+#else
+ using System.Web;
+ using System.Web.UI;
+ using System.Web.UI.DataVisualization.Charting;
+ using System.Web.UI.DataVisualization.Charting.Data;
+#endif
+
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting
+#else
+namespace System.Web.UI.DataVisualization.Charting
+
+#endif
+{
+ /// <summary>
+ /// ElementPosition is the base class for many chart visual
+ /// elements like Legend, Title and ChartArea. It provides
+ /// the position of the chart element in relative coordinates,
+ /// from (0,0) to (100,100).
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeElementPosition_ElementPosition"),
+ DefaultProperty("Data"),
+ ]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class ElementPosition : ChartElement
+ {
+ #region Fields
+
+ // Private data members, which store properties values
+ private float _x = 0;
+ private float _y = 0;
+ private float _width = 0;
+ private float _height = 0;
+ internal bool _auto = true;
+
+ // Indicates the auto position of all areas must be reset
+ internal bool resetAreaAutoPosition = false;
+
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// ElementPosition default constructor
+ /// </summary>
+ public ElementPosition()
+ {
+ }
+
+ /// <summary>
+ /// ElementPosition default constructor
+ /// </summary>
+ internal ElementPosition(IChartElement parent)
+ : base(parent)
+ {
+ }
+
+
+ /// <summary>
+ /// ElementPosition constructor.
+ /// </summary>
+ /// <param name="x">X position.</param>
+ /// <param name="y">Y position.</param>
+ /// <param name="width">Width.</param>
+ /// <param name="height">Height.</param>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X and Y are cartesian coordinates and well understood")]
+ public ElementPosition(float x, float y, float width, float height)
+ {
+ this._auto = false;
+ this._x = x;
+ this._y = y;
+ this._width = width;
+ this._height = height;
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Asks the user at design-time if he wants to change the Auto position
+ /// of all areas at the same time.
+ /// </summary>
+ /// <param name="autoValue">Value to be set for the Auto property.</param>
+ private void ResetAllAreasAutoPosition(bool autoValue)
+ {
+ if(resetAreaAutoPosition)
+ {
+ // Proceed only if at design time
+ if(Chart != null && Chart.IsDesignMode() && !Chart.serializing && Chart.Site != null)
+ {
+ // Check if there is more than one area and Auto position set to the same value
+ if(Chart.ChartAreas.Count > 1)
+ {
+ bool firstAutoValue = Chart.ChartAreas[0].Position.Auto;
+ bool sameAutoValue = true;
+ foreach(ChartArea area in Chart.ChartAreas)
+ {
+ if(area.Position.Auto != firstAutoValue)
+ {
+ sameAutoValue = false;
+ break;
+ }
+ }
+
+ // Proceed only all Auto values are the same
+ if(sameAutoValue)
+ {
+ string message = SR.MessageChangingChartAreaPositionProperty;
+ if (autoValue)
+ {
+ message += SR.MessageChangingChartAreaPositionConfirmAutomatic;
+ }
+ else
+ {
+ message += SR.MessageChangingChartAreaPositionConfirmCustom;
+ }
+
+
+ IDesignerMessageBoxDialog confirm = Chart.Site.GetService(typeof(IDesignerMessageBoxDialog)) as IDesignerMessageBoxDialog;
+ if (confirm != null && confirm.ShowQuestion(message))
+ {
+ foreach (ChartArea area in Chart.ChartAreas)
+ {
+ if (autoValue)
+ {
+ this.SetPositionNoAuto(0f, 0f, 0f, 0f);
+ }
+ area.Position._auto = autoValue;
+ }
+
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Convert element position into RectangleF
+ /// </summary>
+ /// <returns>RectangleF structure.</returns>
+ public RectangleF ToRectangleF()
+ {
+ return new RectangleF(_x, _y, _width, _height);
+ }
+
+ /// <summary>
+ /// Initializes ElementPosition from RectangleF
+ /// </summary>
+ /// <param name="rect">RectangleF structure.</param>
+ public void FromRectangleF(RectangleF rect)
+ {
+ if (rect == null)
+ throw new ArgumentNullException("rect");
+
+ this._x = rect.X;
+ this._y = rect.Y;
+ this._width = rect.Width;
+ this._height = rect.Height;
+ this._auto = false;
+ }
+
+ /// <summary>
+ /// Gets the size of the ElementPosition object.
+ /// </summary>
+ /// <returns>The size of the ElementPosition object.</returns>
+ [Browsable(false)]
+ [Utilities.SerializationVisibility(Utilities.SerializationVisibility.Hidden)]
+ public SizeF Size
+ {
+ get { return new SizeF(this._width, this._height); }
+ }
+
+ /// <summary>
+ /// Gets the bottom position in relative coordinates.
+ /// </summary>
+ /// <returns>Bottom position.</returns>
+ [Browsable(false)]
+ [Utilities.SerializationVisibility(Utilities.SerializationVisibility.Hidden)]
+ public float Bottom
+ {
+ get { return this._y + this._height; }
+ }
+
+ /// <summary>
+ /// Gets the right position in relative coordinates.
+ /// </summary>
+ /// <returns>Right position.</returns>
+ [Browsable(false)]
+ [Utilities.SerializationVisibility(Utilities.SerializationVisibility.Hidden)]
+ public float Right
+ {
+ get{ return this._x + this._width; }
+ }
+
+ /// <summary>
+ /// Determines whether the specified Object is equal to the current Object.
+ /// </summary>
+ /// <param name="obj">The Object to compare with the current Object.</param>
+ /// <returns>true if the specified Object is equal to the current Object; otherwise, false.</returns>
+ internal override bool EqualsInternal(object obj)
+ {
+ ElementPosition pos = obj as ElementPosition;
+ if(pos != null)
+ {
+ if(this._auto == true && this._auto == pos._auto)
+ {
+ return true;
+ }
+ else if(this._x == pos._x && this._y == pos._y &&
+ this._width == pos._width && this._height == pos._height)
+ {
+ return true;
+ }
+
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// Returns a string that represents the element position data.
+ /// </summary>
+ /// <returns>Element position data as a string.</returns>
+ internal override string ToStringInternal()
+ {
+ string posString = Constants.AutoValue;
+ if(!this._auto)
+ {
+ posString =
+ this._x.ToString(System.Globalization.CultureInfo.CurrentCulture)+", "+
+ this._y.ToString(System.Globalization.CultureInfo.CurrentCulture)+", "+
+ this._width.ToString(System.Globalization.CultureInfo.CurrentCulture)+", "+
+ this._height.ToString(System.Globalization.CultureInfo.CurrentCulture);
+ }
+ return posString;
+ }
+
+ /// <summary>
+ /// Set the element position without modifying the "Auto" property
+ /// </summary>
+ /// <param name="x">X position.</param>
+ /// <param name="y">Y position.</param>
+ /// <param name="width">Width.</param>
+ /// <param name="height">Height.</param>
+ internal void SetPositionNoAuto(float x, float y, float width, float height)
+ {
+ bool oldValue = this._auto;
+ this._x = x;
+ this._y = y;
+ this._width = width;
+ this._height = height;
+ this._auto = oldValue;
+ }
+
+ #endregion
+
+ #region Element Position properties
+
+ /// <summary>
+ /// X position of element.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ DefaultValue(0.0F),
+ SRDescription("DescriptionAttributeElementPosition_X"),
+ NotifyParentPropertyAttribute(true),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "X")]
+ public float X
+ {
+ get
+ {
+ return _x;
+ }
+ set
+ {
+ if(value < 0.0 || value > 100.0)
+ {
+ throw(new ArgumentOutOfRangeException("value", SR.ExceptionElementPositionArgumentOutOfRange));
+ }
+ _x = value;
+ Auto = false;
+
+ // Adjust width
+ if( (_x + Width) > 100)
+ {
+ Width = 100 - _x;
+ }
+
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Y position of element.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ DefaultValue(0.0F),
+ SRDescription("DescriptionAttributeElementPosition_Y"),
+ NotifyParentPropertyAttribute(true),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Y")]
+ public float Y
+ {
+ get
+ {
+ return _y;
+ }
+ set
+ {
+ if(value < 0.0 || value > 100.0)
+ {
+ throw(new ArgumentOutOfRangeException("value", SR.ExceptionElementPositionArgumentOutOfRange));
+ }
+ _y = value;
+ Auto = false;
+
+ // Adjust heigth
+ if( (_y + Height) > 100)
+ {
+ Height = 100 - _y;
+ }
+
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Width of element.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ DefaultValue(0.0F),
+ SRDescription("DescriptionAttributeElementPosition_Width"),
+ NotifyParentPropertyAttribute(true),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public float Width
+ {
+ get
+ {
+ return _width;
+ }
+ set
+ {
+ if(value < 0.0 || value > 100.0)
+ {
+ throw(new ArgumentOutOfRangeException("value", SR.ExceptionElementPositionArgumentOutOfRange));
+ }
+ _width = value;
+ Auto = false;
+
+ // Adjust x
+ if( (_x + Width) > 100)
+ {
+ _x = 100 - Width;
+ }
+
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Height of element.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ DefaultValue(0.0F),
+ SRDescription("DescriptionAttributeElementPosition_Height"),
+ NotifyParentPropertyAttribute(true),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public float Height
+ {
+ get
+ {
+ return _height;
+ }
+ set
+ {
+ if(value < 0.0 || value > 100.0)
+ {
+ throw(new ArgumentOutOfRangeException("value", SR.ExceptionElementPositionArgumentOutOfRange));
+ }
+ _height = value;
+ Auto = false;
+
+ // Adjust y
+ if( (_y + Height) > 100)
+ {
+ _y = 100 - Height;
+
+ }
+
+ this.Invalidate();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a flag which indicates whether positioning is on.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ Bindable(true),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeElementPosition_Auto"),
+ NotifyParentPropertyAttribute(true),
+ RefreshPropertiesAttribute(RefreshProperties.All),
+ #if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+ #endif
+ ]
+ public bool Auto
+ {
+ get
+ {
+ return _auto;
+ }
+ set
+ {
+ if(value != _auto)
+ {
+ ResetAllAreasAutoPosition(value);
+
+ if(value)
+ {
+ this._x = 0;
+ this._y = 0;
+ this._width = 0;
+ this._height = 0;
+ }
+ _auto = value;
+
+ this.Invalidate();
+ }
+ }
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Used for invoking windows forms MesageBox dialog.
+ /// </summary>
+ internal interface IDesignerMessageBoxDialog
+ {
+ /// <summary>
+ /// Shows Yes/No MessageBox.
+ /// </summary>
+ /// <param name="message">The message.</param>
+ /// <returns>
+ /// true if user confirms with Yes
+ /// </returns>
+ bool ShowQuestion(string message);
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/ImageLoader.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/ImageLoader.cs
new file mode 100644
index 00000000000..1b07b467c2f
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/ImageLoader.cs
@@ -0,0 +1,421 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: ImageLoader.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting.Utilities
+//
+// Classes: ImageLoader
+//
+// Purpose: ImageLoader utility class loads specified image and
+// caches it in the memory for the future use.
+//
+// Images can be loaded from different places including
+// Files, URIs, WebRequests and Control Resources.
+//
+// Reviewed: AG - August 7, 2002
+// AG - Microsoft 5, 2007
+//
+//===================================================================
+
+
+#region Used Namespaces
+
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Reflection;
+using System.Net;
+using System.IO;
+using System.Security;
+using System.Resources;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+#else
+ using System.Web;
+ using System.Web.UI.DataVisualization.Charting;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.Utilities
+#else
+ namespace System.Web.UI.DataVisualization.Charting.Utilities
+#endif
+{
+ /// <summary>
+ /// ImageLoader utility class loads and returns specified image
+ /// form the File, URI, Web Request or Chart Resources.
+ /// Loaded images are stored in the internal hashtable which
+ /// allows to improve performance if image need to be used
+ /// several times.
+ /// </summary>
+ internal class ImageLoader : IDisposable, IServiceProvider
+ {
+ #region Fields
+
+ // Image storage
+ private Hashtable _imageData = null;
+
+ // Reference to the service container
+ private IServiceContainer _serviceContainer = null;
+
+ #endregion
+
+ #region Constructors and Initialization
+
+ /// <summary>
+ /// Default constructor is not accessible.
+ /// </summary>
+ private ImageLoader()
+ {
+ }
+
+ /// <summary>
+ /// Default public constructor.
+ /// </summary>
+ /// <param name="container">Service container.</param>
+ public ImageLoader(IServiceContainer container)
+ {
+ if(container == null)
+ {
+ throw(new ArgumentNullException(SR.ExceptionImageLoaderInvalidServiceContainer));
+ }
+ _serviceContainer = container;
+ }
+
+ /// <summary>
+ /// Returns Image Loader service object
+ /// </summary>
+ /// <param name="serviceType">Requested service type.</param>
+ /// <returns>Image Loader service object.</returns>
+ [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+ object IServiceProvider.GetService(Type serviceType)
+ {
+ if(serviceType == typeof(ImageLoader))
+ {
+ return this;
+ }
+ throw (new ArgumentException( SR.ExceptionImageLoaderUnsupportedType( serviceType.ToString())));
+ }
+
+ /// <summary>
+ /// Dispose images in the hashtable
+ /// </summary>
+ public void Dispose()
+ {
+ if (_imageData != null)
+ {
+ foreach (DictionaryEntry entry in _imageData)
+ {
+ if (entry.Value is IDisposable)
+ {
+ ((IDisposable)entry.Value).Dispose();
+ }
+ }
+ _imageData = null;
+ GC.SuppressFinalize(this);
+ }
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Loads image from URL. Checks if image already loaded (cached).
+ /// </summary>
+ /// <param name="imageURL">Image name (FileName, URL, Resource).</param>
+ /// <returns>Image object.</returns>
+ public System.Drawing.Image LoadImage(string imageURL)
+ {
+ return LoadImage(imageURL, true);
+ }
+
+ /// <summary>
+ /// Loads image from URL. Checks if image already loaded (cached).
+ /// </summary>
+ /// <param name="imageURL">Image name (FileName, URL, Resource).</param>
+ /// <param name="saveImage">True if loaded image should be saved in cache.</param>
+ /// <returns>Image object</returns>
+ public System.Drawing.Image LoadImage(string imageURL, bool saveImage)
+ {
+ System.Drawing.Image image = null;
+
+ // Check if image is defined in the chart image collection
+ if (_serviceContainer != null)
+ {
+ Chart chart = (Chart)_serviceContainer.GetService(typeof(Chart));
+ if(chart != null)
+ {
+ foreach(NamedImage namedImage in chart.Images)
+ {
+ if(namedImage.Name == imageURL)
+ {
+ return namedImage.Image;
+ }
+ }
+ }
+ }
+
+ // Create new hashtable
+ if (_imageData == null)
+ {
+ _imageData = new Hashtable(StringComparer.OrdinalIgnoreCase);
+ }
+
+ // First check if image with this name already loaded
+ if (_imageData.Contains(imageURL))
+ {
+ image = (System.Drawing.Image)_imageData[imageURL];
+ }
+
+#if ! Microsoft_CONTROL
+
+ // Try to load as relative URL using the Control object
+ if(image == null)
+ {
+ Chart control = (Chart)_serviceContainer.GetService(typeof(Chart));
+ if (control != null && control.Page != null)
+ {
+ if (!control.IsDesignMode())
+ {
+ image = LoadFromFile(control.Page.MapPath(imageURL));
+ }
+ else if (control.IsDesignMode() && !String.IsNullOrEmpty(control.webFormDocumentURL))
+ {
+ // Find current web page path and fileName
+ Uri pageUri = new Uri(control.webFormDocumentURL);
+ string path = pageUri.LocalPath;
+ string pageFile = pageUri.Segments[pageUri.Segments.Length-1];
+
+ // Find full image fileName
+ string imageFileRelative = control.ResolveClientUrl(imageURL);
+ string imageFile = path.Replace(pageFile, imageFileRelative);
+
+ // Load image
+ image = LoadFromFile(imageFile);
+ }
+ }
+
+ else if ( HttpContext.Current != null )
+ {
+ image = LoadFromFile(HttpContext.Current.Request.MapPath(imageURL));
+ }
+ }
+#endif
+
+ // Try to load image from resource
+ if(image == null)
+ {
+ try
+ {
+
+ // Check if resource class type was specified
+ int columnIndex = imageURL.IndexOf("::", StringComparison.Ordinal);
+ if (columnIndex > 0)
+ {
+ string resourceRootName = imageURL.Substring(0, columnIndex);
+ string resourceName = imageURL.Substring(columnIndex + 2);
+ System.Resources.ResourceManager resourceManager = new System.Resources.ResourceManager(resourceRootName, Assembly.GetExecutingAssembly());
+ image = (System.Drawing.Image)(resourceManager.GetObject(resourceName));
+ }
+#if Microsoft_CONTROL
+ else if (Assembly.GetEntryAssembly() != null)
+ {
+ // Check if resource class type was specified
+ columnIndex = imageURL.IndexOf(':');
+ if (columnIndex > 0)
+ {
+ string resourceRootName = imageURL.Substring(0, columnIndex);
+ string resourceName = imageURL.Substring(columnIndex + 1);
+ System.Resources.ResourceManager resourceManager = new System.Resources.ResourceManager(resourceRootName, Assembly.GetEntryAssembly());
+ image = (Image)(resourceManager.GetObject(resourceName));
+ }
+ else
+ {
+ // Try to load resource from every type defined in entry assembly
+ Assembly entryAssembly = Assembly.GetEntryAssembly();
+ if (entryAssembly != null)
+ {
+ foreach (Type type in entryAssembly.GetTypes())
+ {
+ System.Resources.ResourceManager resourceManager = new System.Resources.ResourceManager(type);
+ try
+ {
+ image = (Image)(resourceManager.GetObject(imageURL));
+ }
+ catch (ArgumentNullException)
+ {
+ }
+ catch (MissingManifestResourceException)
+ {
+ }
+
+ // Check if image was loaded
+ if (image != null)
+ {
+ break;
+ }
+ }
+ }
+ }
+ }
+#endif
+ }
+ catch (MissingManifestResourceException)
+ {
+ }
+ }
+
+
+ // Try to load image using the Web Request
+ if(image == null)
+ {
+ Uri imageUri = null;
+ try
+ {
+ // Try to create URI directly from image URL (will work in case of absolute URL)
+ imageUri = new Uri(imageURL);
+ }
+ catch(UriFormatException)
+ {}
+
+
+ // Load image from file or web resource
+ if(imageUri != null)
+ {
+ try
+ {
+ WebRequest request = WebRequest.Create(imageUri);
+ image = System.Drawing.Image.FromStream(request.GetResponse().GetResponseStream());
+ }
+ catch (ArgumentException)
+ {
+ }
+ catch (NotSupportedException)
+ {
+ }
+ catch (SecurityException)
+ {
+ }
+ }
+ }
+#if Microsoft_CONTROL
+ // absolute uri(without Server.MapPath)in web is not allowed. Loading from replative uri Server[Page].MapPath is done above.
+ // Try to load as file
+ if(image == null)
+ {
+
+ image = LoadFromFile(imageURL);
+ }
+#endif
+
+ // Error loading image
+ if(image == null)
+ {
+#if ! Microsoft_CONTROL
+ throw(new ArgumentException( SR.ExceptionImageLoaderIncorrectImageUrl( imageURL ) ) );
+#else
+ throw(new ArgumentException( SR.ExceptionImageLoaderIncorrectImageLocation( imageURL ) ) );
+#endif
+ }
+
+ // Save new image in cache
+ if(saveImage)
+ {
+ _imageData[imageURL] = image;
+ }
+
+ return image;
+ }
+
+ /// <summary>
+ /// Helper function which loads image from file.
+ /// </summary>
+ /// <param name="fileName">File name.</param>
+ /// <returns>Loaded image or null.</returns>
+ private System.Drawing.Image LoadFromFile(string fileName)
+ {
+ // Try to load image from file
+ try
+ {
+ return System.Drawing.Image.FromFile(fileName);
+ }
+ catch(FileNotFoundException)
+ {
+ return null;
+ }
+ }
+
+ /// <summary>
+ /// Returns the image size taking the image DPI into consideration.
+ /// </summary>
+ /// <param name="name">Image name (FileName, URL, Resource).</param>
+ /// <param name="graphics">Graphics used to calculate the image size.</param>
+ /// <param name="size">Calculated size.</param>
+ /// <returns>false if it fails to calculate the size, otherwise true.</returns>
+ internal bool GetAdjustedImageSize(string name, Graphics graphics, ref SizeF size)
+ {
+ Image image = LoadImage(name);
+
+ if (image == null)
+ return false;
+
+ GetAdjustedImageSize(image, graphics, ref size);
+
+ return true;
+ }
+
+ /// <summary>
+ /// Returns the image size taking the image DPI into consideration.
+ /// </summary>
+ /// <param name="image">Image for whcih to calculate the size.</param>
+ /// <param name="graphics">Graphics used to calculate the image size.</param>
+ /// <param name="size">Calculated size.</param>
+ internal static void GetAdjustedImageSize(Image image, Graphics graphics, ref SizeF size)
+ {
+ if (graphics != null)
+ {
+ //this will work in case the image DPI is specified, otherwise the image DPI will be assumed to be same as the screen DPI
+ size.Width = image.Width * graphics.DpiX / image.HorizontalResolution;
+ size.Height = image.Height * graphics.DpiY / image.VerticalResolution;
+ }
+ else
+ {
+ size.Width = image.Width;
+ size.Height = image.Height;
+ }
+ }
+
+ /// <summary>
+ /// Checks if the image has the same DPI as the graphics object.
+ /// </summary>
+ /// <param name="image">Image to be checked.</param>
+ /// <param name="graphics">Graphics object to be used.</param>
+ /// <returns>true if they match, otherwise false.</returns>
+ internal static bool DoDpisMatch(Image image, Graphics graphics)
+ {
+ return graphics.DpiX == image.HorizontalResolution && graphics.DpiY == image.VerticalResolution;
+ }
+
+ internal static Image GetScaledImage(Image image, Graphics graphics)
+ {
+ Bitmap scaledImage = new Bitmap(image, new Size((int)(image.Width * graphics.DpiX / image.HorizontalResolution),
+ (int)(image.Height * graphics.DpiY / image.VerticalResolution)));
+
+ return scaledImage;
+ }
+
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/KeywordsRegistry.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/KeywordsRegistry.cs
new file mode 100644
index 00000000000..09fbdaac8d2
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/KeywordsRegistry.cs
@@ -0,0 +1,495 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: KeywordsRegistry.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting.Utilities
+//
+// Classes: KeywordsRegistry, KeywordInfo
+//
+// Purpose: A registry that keeps track of all available
+// keywords and name of the objects and properties
+// where they can be used.
+//
+// Formatting Keywords Overview:
+// -----------------------------
+// A Formatting Keyword is a specially formatted character sequence
+// that gets replaced by an associated Chart Series value, or
+// calculated value. Keywords can be used with most string properties
+// of Series and DataPoint objects.
+//
+// Here is an example of setting series labels so that the first
+// line will display the Y value and the second line displays
+// the X value.
+//
+// Chart1.Series["Series1"].Label = "Y = #VALY\nX = #VALX";
+//
+// Series label in this case will look like this:
+//
+// Y = 45.78
+// X = 456
+//
+// An optional format string can be added after the keyword.
+// For example, when you set the Format option to Percent for
+// the first Y value, the resulting keyword produced is "#VALY{P}".
+// You can also apply format strings in code-behind using the same
+// nomenclature; you do this by following the keyword with a format
+// specifier enclosed in braces. For information concerning the
+// types of formatting that can be used, see the Formatting Types
+// topic in the MSDN library.
+//
+// Reviewed: AG - Microsoft 5, 2007
+//
+//===================================================================
+
+
+#region Used Namespaces
+
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+#else
+using System.Web.UI.DataVisualization.Charting;
+using System.Web.UI.DataVisualization.Charting.ChartTypes;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.Utilities
+#else // Microsoft_CONTROL
+ namespace System.Web.UI.DataVisualization.Charting.Utilities
+#endif // Microsoft_CONTROL
+{
+ /// <summary>
+ /// KeywordName class contains constant strings defining
+ /// names of all keywords used in the data point and series classes.
+ /// </summary>
+ internal static class KeywordName
+ {
+ #region Keyword Names
+
+ internal const string Index = "#INDEX";
+ internal const string ValX = "#VALX";
+ internal const string ValY = "#VALY";
+ internal const string Val = "#VAL";
+ internal const string Total = "#TOTAL";
+ internal const string Percent = "#PERCENT";
+ internal const string Label = "#LABEL";
+ internal const string AxisLabel = "#AXISLABEL";
+ internal const string LegendText = "#LEGENDTEXT";
+ internal const string SeriesName = "#SERIESNAME";
+ internal const string Ser = "#SER";
+ internal const string Avg = "#AVG";
+ internal const string Max = "#MAX";
+ internal const string Min = "#MIN";
+ internal const string Last = "#LAST";
+ internal const string First = "#FIRST";
+ internal const string CustomProperty = "#CUSTOMPROPERTY";
+
+ #endregion // Keyword Names
+ }
+
+ /// <summary>
+ /// KeywordRegistry class stores information about all
+ /// chart formatting keywords. It automatically registers
+ /// all known keywords when object is constructed. This
+ /// data is exposed as ArrayList through the ‘registeredKeywords’
+ /// field. Each item in this ArrayList is a KeywordInfo
+ /// object which describes a single formatting keyword.
+ /// </summary>
+ internal class KeywordsRegistry : IServiceProvider
+ {
+ #region Fields
+
+ // List of registered keywords
+ internal ArrayList registeredKeywords = new ArrayList();
+
+ #endregion
+
+ #region Constructor and Services
+
+ /// <summary>
+ /// Keywords registry public constructor.
+ /// </summary>
+ public KeywordsRegistry()
+ {
+ // Register Keywords used in the chart
+ RegisterKeywords();
+ }
+
+ /// <summary>
+ /// Returns Keywords registry service object.
+ /// </summary>
+ /// <param name="serviceType">Service type to get.</param>
+ /// <returns>Custom properties registry service.</returns>
+ [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+ object IServiceProvider.GetService(Type serviceType)
+ {
+ if(serviceType == typeof(KeywordsRegistry))
+ {
+ return this;
+ }
+ throw (new ArgumentException( SR.ExceptionKeywordsRegistryUnsupportedType(serviceType.ToString())));
+ }
+
+ #endregion
+
+ #region Keywords Registering methods
+
+ /// <summary>
+ /// Registers all chart formatting keywords.
+ /// </summary>
+ private void RegisterKeywords()
+ {
+ string seriesPointSupportedProperties = "Text,Label,LabelMapAreaAttributes,ToolTip,Url,LabelToolTip,MapAreaAttributes,AxisLabel,LegendToolTip,LegendMapAreaAttributes,LegendUrl,LegendText";
+
+ // #INDEX keyword
+ this.Register(
+ SR.DescriptionKeyWordNameIndexDataPoint,
+ KeywordName.Index,
+ string.Empty,
+ SR.DescriptionKeyWordIndexDataPoint2,
+ "DataPoint",
+ seriesPointSupportedProperties,
+ false,
+ false);
+
+ // #VALX keyword
+ this.Register(
+ SR.DescriptionKeyWordNameXValue,
+ KeywordName.ValX,
+ string.Empty,
+ SR.DescriptionKeyWordXValue,
+ "Series,DataPoint,Annotation,LegendCellColumn",
+ seriesPointSupportedProperties,
+ true,
+ false);
+
+ // #VALY keyword
+ this.Register(
+ SR.DescriptionKeyWordNameYValue,
+ KeywordName.Val,
+ string.Empty,
+ SR.DescriptionKeyWordYValue,
+ "Series,DataPoint,Annotation,LegendCellColumn,LegendCellColumn",
+ seriesPointSupportedProperties,
+ true,
+ true);
+
+ // #TOTAL keyword
+ this.Register(
+ SR.DescriptionKeyWordNameTotalYValues,
+ KeywordName.Total,
+ string.Empty,
+ SR.DescriptionKeyWordTotalYValues,
+ "Series,DataPoint,Annotation,LegendCellColumn",
+ seriesPointSupportedProperties,
+ true,
+ false);
+
+ // #PERCENT keyword
+ this.Register(
+ SR.DescriptionKeyWordNameYValuePercentTotal,
+ KeywordName.Percent,
+ string.Empty,
+ SR.DescriptionKeyWordYValuePercentTotal,
+ "Series,DataPoint,Annotation,LegendCellColumn",
+ seriesPointSupportedProperties,
+ true,
+ true);
+
+ // #INDEX keyword
+ this.Register(
+ SR.DescriptionKeyWordNameIndexTheDataPoint,
+ KeywordName.Index,
+ string.Empty,
+ SR.DescriptionKeyWordIndexDataPoint,
+ "Series,DataPoint,Annotation,LegendCellColumn",
+ seriesPointSupportedProperties,
+ false,
+ false);
+
+ // #LABEL keyword
+ this.Register(
+ SR.DescriptionKeyWordNameLabelDataPoint,
+ KeywordName.Label,
+ string.Empty,
+ SR.DescriptionKeyWordLabelDataPoint,
+ "Series,DataPoint,Annotation,LegendCellColumn",
+ seriesPointSupportedProperties,
+ false,
+ false);
+
+ // #AXISLABEL keyword
+ this.Register(
+ SR.DescriptionKeyWordNameAxisLabelDataPoint,
+ KeywordName.AxisLabel,
+ string.Empty,
+ SR.DescriptionKeyWordAxisLabelDataPoint,
+ "Series,DataPoint,Annotation,LegendCellColumn",
+ seriesPointSupportedProperties,
+ false,
+ false);
+
+ // #LEGENDTEXT keyword
+ this.Register(
+ SR.DescriptionKeyWordNameLegendText,
+ KeywordName.LegendText,
+ string.Empty,
+ SR.DescriptionKeyWordLegendText,
+ "Series,DataPoint,Annotation,LegendCellColumn",
+ seriesPointSupportedProperties,
+ false,
+ false);
+
+ // #SERIESNAME keyword
+ this.Register(
+ SR.DescriptionKeyWordNameSeriesName,
+ KeywordName.SeriesName,
+ KeywordName.Ser,
+ SR.DescriptionKeyWordSeriesName,
+ "Series,DataPoint,Annotation,LegendCellColumn",
+ seriesPointSupportedProperties,
+ false,
+ false);
+
+ // *************** NEW KEYWORDS in version 5.5 ***************
+
+ // #AVG keyword
+ this.Register(
+ SR.DescriptionKeyWordNameAverageYValues,
+ KeywordName.Avg,
+ string.Empty,
+ SR.DescriptionKeyWordAverageYValues,
+ "Series,DataPoint,Annotation,LegendCellColumn",
+ seriesPointSupportedProperties,
+ true,
+ true);
+
+ // #MAX keyword
+ this.Register(
+ SR.DescriptionKeyWordNameMaximumYValues,
+ KeywordName.Max,
+ string.Empty,
+ SR.DescriptionKeyWordMaximumYValues,
+ "Series,DataPoint,Annotation,LegendCellColumn",
+ seriesPointSupportedProperties,
+ true,
+ true);
+
+ // #MIN keyword
+ this.Register(
+ SR.DescriptionKeyWordNameMinimumYValues,
+ KeywordName.Min,
+ string.Empty,
+ SR.DescriptionKeyWordMinimumYValues,
+ "Series,DataPoint,Annotation,LegendCellColumn",
+ seriesPointSupportedProperties,
+ true,
+ true);
+
+ // #LAST keyword
+ this.Register(
+ SR.DescriptionKeyWordNameLastPointYValue,
+ KeywordName.Last,
+ string.Empty,
+ SR.DescriptionKeyWordLastPointYValue,
+ "Series,DataPoint,Annotation,LegendCellColumn",
+ seriesPointSupportedProperties,
+ true,
+ true);
+
+ // #FIRST keyword
+ this.Register(
+ SR.DescriptionKeyWordNameFirstPointYValue,
+ KeywordName.First,
+ string.Empty,
+ SR.DescriptionKeyWordFirstPointYValue,
+ "Series,DataPoint,Annotation,LegendCellColumn",
+ seriesPointSupportedProperties,
+ true,
+ true);
+ }
+
+ #endregion // Keywords Registering methods
+
+ #region Registry methods
+
+ /// <summary>
+ /// Adds keyword information into the registry.
+ /// </summary>
+ /// <param name="name">Keyword full name.</param>
+ /// <param name="keyword">Keyword text.</param>
+ /// <param name="keywordAliases">Keyword alternative text.</param>
+ /// <param name="description">Keyword description.</param>
+ /// <param name="appliesToTypes">Comma separated list of applicable classes</param>
+ /// <param name="appliesToProperties">Comma separated list of applicable properties.</param>
+ /// <param name="supportsFormatting">True if formatting is supported.</param>
+ /// <param name="supportsValueIndex">True if different point Y values are supported.</param>
+ public void Register(
+ string name,
+ string keyword,
+ string keywordAliases,
+ string description,
+ string appliesToTypes,
+ string appliesToProperties,
+ bool supportsFormatting,
+ bool supportsValueIndex)
+ {
+ // Create new keyword information object
+ KeywordInfo keywordInfo = new KeywordInfo(
+ name,
+ keyword,
+ keywordAliases,
+ description,
+ appliesToTypes,
+ appliesToProperties,
+ supportsFormatting,
+ supportsValueIndex);
+
+ // Add keyword information to the hash table
+ registeredKeywords.Add(keywordInfo);
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// KeywordInfo class stores information about a single
+ /// formatting keyword. This information includes Name,
+ /// Description, list of data types and properties it
+ /// applies to and other information.
+ /// </summary>
+ internal class KeywordInfo
+ {
+ #region Public Fields
+
+ /// <summary>
+ /// Keyword full name.
+ /// </summary>
+ public string Name = String.Empty;
+
+ /// <summary>
+ /// String that represent this keyword in the property (keyword).
+ /// </summary>
+ public string Keyword = String.Empty;
+
+ /// <summary>
+ /// Comma separated strings that may alternatively represent this
+ /// keyword in the property.
+ /// </summary>
+ public string KeywordAliases = String.Empty;
+
+ /// <summary>
+ /// Keyword description.
+ /// </summary>
+ public string Description = String.Empty;
+
+ /// <summary>
+ /// Comma separated names of classes this keyword applies to.
+ /// </summary>
+ public string AppliesToTypes = String.Empty;
+
+ /// <summary>
+ /// Comma separated names of properties this keyword applies to.
+ /// </summary>
+ public string AppliesToProperties = String.Empty;
+
+ /// <summary>
+ /// True if keyword value can be formatted.
+ /// </summary>
+ public bool SupportsFormatting = false;
+
+ /// <summary>
+ /// True if keyword can be used with different point Y values.
+ /// </summary>
+ public bool SupportsValueIndex = false;
+
+ #endregion // Public Fields
+
+ #region Constructor
+
+ /// <summary>
+ /// Keyword information object constructor
+ /// </summary>
+ /// <param name="name">Keyword full name.</param>
+ /// <param name="keyword">Keyword text.</param>
+ /// <param name="keywordAliases">Keyword alternative text.</param>
+ /// <param name="description">Keyword description.</param>
+ /// <param name="appliesToTypes">Comma separated list of applicable classes</param>
+ /// <param name="appliesToProperties">Comma separated list of applicable properties.</param>
+ /// <param name="supportsFormatting">True if formatting is supported.</param>
+ /// <param name="supportsValueIndex">True if different point Y values are supported.</param>
+ public KeywordInfo(
+ string name,
+ string keyword,
+ string keywordAliases,
+ string description,
+ string appliesToTypes,
+ string appliesToProperties,
+ bool supportsFormatting,
+ bool supportsValueIndex)
+ {
+ this.Name = name;
+ this.Keyword = keyword;
+ this.KeywordAliases = keywordAliases;
+ this.Description = description;
+ this.AppliesToTypes = appliesToTypes;
+ this.AppliesToProperties = appliesToProperties;
+ this.SupportsFormatting = supportsFormatting;
+ this.SupportsValueIndex = supportsValueIndex;
+ }
+
+ #endregion // Constructor
+
+ #region Methods
+
+ /// <summary>
+ /// Returns a String that represents the current keyword Information.
+ /// </summary>
+ /// <returns>Returns keyword name.</returns>
+ public override string ToString()
+ {
+ return this.Name;
+ }
+ /// <summary>
+ /// Gets an array of keywords names including the aliases.
+ /// </summary>
+ /// <returns>A string array of keyword names that represent this keyword.</returns>
+ public string[] GetKeywords()
+ {
+ // NOTE: Each keyword has a unique name. In addition the keyword may have an
+ // alternative names (aliases).
+ // Most common scenario for a keyword aliase is when keyword has a long and
+ // short form. For example, KeywordName.Ser and "#SERIES".
+
+ // Fill array of possible names for that keyword
+ if(this.KeywordAliases.Length > 0)
+ {
+ string[] keywordAliases = this.KeywordAliases.Split(',');
+ string[] keywordNames = new string[keywordAliases.Length + 1];
+ keywordNames[0] = this.Keyword;
+ keywordAliases.CopyTo(keywordNames, 1);
+ return keywordNames;
+ }
+ else
+ {
+ return new string[] { this.Keyword };
+ }
+ }
+
+ #endregion // Methods
+ }
+}
+
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/ValueConverter.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/ValueConverter.cs
new file mode 100644
index 00000000000..24a08a05552
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/ValueConverter.cs
@@ -0,0 +1,194 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: ValueConverter.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting.Utilities
+//
+// Classes: ValueConverter
+//
+// Purpose: Helper class which converts DateTime or numeric
+// values to string. It used to display data point
+// values as labels, tooltips and axis labels.
+//
+// Reviewed: AG - August 7, 2002
+// AG - Microsoft 5, 2007
+//
+//===================================================================
+
+
+#region Used Namespaces
+
+using System;
+using System.Globalization;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting;
+#else
+ using System.Web.UI.DataVisualization.Charting;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.Utilities
+#else
+ namespace System.Web.UI.DataVisualization.Charting.Utilities
+#endif
+{
+ /// <summary>
+ /// ValueConverter class is used when numeric or DateTime
+ /// value needs to be converted to a string using specified format.
+ /// </summary>
+ internal static class ValueConverter
+ {
+ #region Methods
+
+ /// <summary>
+ /// Converts value to string using specified format.
+ /// </summary>
+ /// <param name="chart">Reference to the chart object.</param>
+ /// <param name="obj">Reference to the object being formatted.</param>
+ /// <param name="objTag">Additional object tag.</param>
+ /// <param name="value">Value converted to string.</param>
+ /// <param name="format">Format string.</param>
+ /// <param name="valueType">Value type.</param>
+ /// <param name="elementType">Chart element type being formatted.</param>
+ public static string FormatValue(
+ Chart chart,
+ object obj,
+ object objTag,
+ double value,
+ string format,
+ ChartValueType valueType,
+ ChartElementType elementType)
+ {
+ format = format ?? String.Empty;
+ string convertionFormat = format;
+ string result = "";
+
+ // Make sure value index is part of the format
+ if(convertionFormat != null && convertionFormat.Length > 0)
+ {
+ int bracketIndex = convertionFormat.IndexOf('{', 0);
+ if(bracketIndex >= 0)
+ {
+ while(bracketIndex >= 0)
+ {
+ // If format is not followed by the value index
+ if(!convertionFormat.Substring(bracketIndex).StartsWith("{0:", StringComparison.Ordinal))
+ {
+ // Check charcter prior to the bracket
+ if(bracketIndex >= 1 && convertionFormat.Substring(bracketIndex - 1, 1) == "{")
+ {
+ continue;
+ }
+ else
+ {
+ // Insert value index in format
+ convertionFormat = convertionFormat.Insert(bracketIndex + 1, "0:");
+ }
+ }
+
+ bracketIndex = convertionFormat.IndexOf('{', bracketIndex + 1);
+ }
+ }
+ else
+ {
+ convertionFormat = "{0:" + convertionFormat + "}";
+ }
+ }
+
+ // Date/time formating
+ if (valueType == ChartValueType.DateTime ||
+ valueType == ChartValueType.DateTimeOffset ||
+ valueType == ChartValueType.Date)
+ {
+ // Set default format
+ if(convertionFormat.Length == 0)
+ {
+ convertionFormat = "{0:d}";
+ if (valueType == ChartValueType.DateTimeOffset)
+ convertionFormat += " +0";
+ }
+
+ // Convert date to string
+ result = String.Format(CultureInfo.CurrentCulture, convertionFormat, DateTime.FromOADate(value));
+ }
+ else if(valueType == ChartValueType.Time)
+ {
+ // Set default format
+ if(convertionFormat.Length == 0)
+ {
+ convertionFormat = "{0:t}";
+ }
+
+ // Convert date to string
+ result = String.Format(CultureInfo.CurrentCulture, convertionFormat, DateTime.FromOADate(value));
+ }
+ else
+ {
+ bool failedFlag = false;
+
+ // Set default format
+ if(convertionFormat.Length == 0)
+ {
+ convertionFormat = "{0:G}";
+ }
+
+ try
+ {
+ // Numeric value formatting
+ result = String.Format(CultureInfo.CurrentCulture,convertionFormat, value);
+ }
+ catch(FormatException)
+ {
+ failedFlag = true;
+ }
+
+ // If numeric formatting failed try to format using decimal number
+ if(failedFlag)
+ {
+ failedFlag = false;
+ try
+ {
+ // Decimal value formatting
+ result = String.Format(CultureInfo.CurrentCulture, convertionFormat, (long)value);
+ }
+ catch (ArgumentNullException)
+ {
+ failedFlag = true;
+ }
+ catch (FormatException)
+ {
+ failedFlag = true;
+ }
+ }
+
+ // Return format string as result (literal) if all formatting methods failed
+ if(failedFlag)
+ {
+ result = format;
+ }
+ }
+
+ // For the Reporting Services chart a special number formatting
+ // handler may be set and used for all formatting needs.
+ if (chart != null)
+ {
+ // Call number formatter
+ FormatNumberEventArgs eventArguments = new FormatNumberEventArgs(value, format, valueType, result, objTag, elementType);
+ chart.CallOnFormatNumber(obj, eventArguments);
+ result = eventArguments.LocalizedValue;
+ }
+
+ return result;
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/XmlSerializer.cs b/mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/XmlSerializer.cs
new file mode 100644
index 00000000000..000f56f2d67
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/Common/Utilities/XmlSerializer.cs
@@ -0,0 +1,3274 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: XmlSerializer.cs
+//
+// Namespace: System.Web.UI.WebControls[Windows.Forms].Charting.Utilities
+//
+// Classes: XmlFormatSerializer, BinaryFormatSerializer
+// SerializerBase, SerializationVisibilityAttribute
+//
+// Purpose:
+//
+// Chart serializer allows persisting of all chart data and
+// settings into the stream or file using XML or binary format.
+// This data can be later loaded back into the chart completely
+// restoring its state. Serialize can also be used to reset chart
+// control state to its default values.
+//
+// Both XML and Binary serialization methods use reflection to
+// discover class properties which need to be serialized. Only
+// properties with non-default values are persisted. Full Trust
+// is required to use chartserialization.
+//
+// SerializeBase class implements all the chart serializer
+// properties and methods to reset chart content. XmlFormatSerializer
+// and BinaryFormatSerializer classes derive from the SerializeBase
+// class and provide saving and loading functionality for XML and
+// binary format.
+//
+// By default, all chart content is Saved, Loaded or Reset, but
+// this can be changed using serializer Content, SerializableContent
+// and NonSerializableContent properties. Content property allows a
+// simple way to serialize everything, appearance or just chart data.
+//
+// SerializableContent and NonSerializableContent properties provide
+// more control over what is beign persisted and they override the
+// Content property settings. Each of the properties is a string
+// which is a comma-separated listing of all chart properties to be
+// serialized. The syntax of this property is "Class.Property[,Class.Property]",
+// and wildcards may be used (represented by an asterisk). For example,
+// to serialize all chart BackColor properties set this property to
+// "*.BackColor".
+//
+// Reviewed: AG - August 7, 2002
+// AG - Microsoft 6, 2007
+//
+//===================================================================
+
+
+#region Used Namespaces
+
+using System;
+using System.Xml;
+using System.Reflection;
+using System.Collections;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Drawing.Imaging;
+using System.ComponentModel;
+using System.IO;
+using System.Text;
+using System.Globalization;
+using System.Diagnostics.CodeAnalysis;
+using System.Collections.Specialized;
+using System.Security;
+
+#if Microsoft_CONTROL
+ using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
+#else
+ using System.Web.UI.WebControls;
+ using System.Web.UI.DataVisualization.Charting.ChartTypes;
+#endif
+
+#endregion
+
+#if Microsoft_CONTROL
+ namespace System.Windows.Forms.DataVisualization.Charting.Utilities
+#else
+ namespace System.Web.UI.DataVisualization.Charting.Utilities
+#endif
+{
+ #region Serialization enumerations
+
+ /// <summary>
+ /// Enumeration which describes how to persist property during the serialization
+ /// </summary>
+ internal enum SerializationVisibility
+ {
+ /// <summary>
+ /// Do not serialize
+ /// </summary>
+ Hidden,
+
+ /// <summary>
+ /// Serialize as XML attribute
+ /// </summary>
+ Attribute,
+
+ /// <summary>
+ /// Serialize as XML element
+ /// </summary>
+ Element
+ }
+
+ /// <summary>
+ /// Determines chart current serialization status.
+ /// </summary>
+ internal enum SerializationStatus
+ {
+ /// <summary>
+ /// Chart is not serializing
+ /// </summary>
+ None,
+
+ /// <summary>
+ /// Chart is loading
+ /// </summary>
+ Loading,
+
+ /// <summary>
+ /// Chart is saving
+ /// </summary>
+ Saving,
+
+ /// <summary>
+ /// Chart is resetting
+ /// </summary>
+ Resetting
+ }
+
+ #endregion
+
+ /// <summary>
+ /// Attribute which describes how to persist property during the serialization.
+ /// </summary>
+ [AttributeUsage(AttributeTargets.All)]
+ internal sealed class SerializationVisibilityAttribute : System.Attribute
+ {
+ #region Fields
+
+ // Visibility style
+ private SerializationVisibility _visibility = SerializationVisibility.Attribute;
+
+ #endregion
+
+ #region Constructor
+
+ /// <summary>
+ /// Public constructor
+ /// </summary>
+ /// <param name="visibility">Serialization visibility.</param>
+ internal SerializationVisibilityAttribute(SerializationVisibility visibility)
+ {
+ this._visibility = visibility;
+ }
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Serialization visibility property
+ /// </summary>
+ public SerializationVisibility Visibility
+ {
+ get
+ {
+ return _visibility;
+ }
+ //set
+ //{
+ // _visibility = value;
+ //}
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Base class of the serializers. Common properties and methods for all serializers.
+ /// </summary>
+ internal abstract class SerializerBase
+ {
+ #region Fields
+
+ /// <summary>
+ /// Indicates that unknown properties and elements are ignored
+ /// </summary>
+ private bool _isUnknownAttributeIgnored = false;
+
+ /// <summary>
+ /// Indicates that serializer works in template creation mode
+ /// </summary>
+ private bool _isTemplateMode = false;
+
+ /// <summary>
+ /// Indicates that object properties are reset before loading
+ /// </summary>
+ private bool _isResetWhenLoading = true;
+
+ /// <summary>
+ /// Comma separated list of serializable (Save/Load/Reset) properties. "ClassName.PropertyName"
+ /// </summary>
+ private string _serializableContent = "";
+
+ /// <summary>
+ /// Comma separated list of NON serializable (Save/Load/Reset) properties. "ClassName.PropertyName"
+ /// </summary>
+ private string _nonSerializableContent = "";
+
+ /// <summary>
+ /// Font converters used while serializing/deserializing
+ /// </summary>
+ internal static FontConverter fontConverter = new FontConverter();
+
+ /// <summary>
+ /// Color converters used while serializing/deserializing
+ /// </summary>
+ internal static ColorConverter colorConverter = new ColorConverter();
+
+ /// <summary>
+ /// Hash code provider.
+ /// </summary>
+ protected static StringComparer hashCodeProvider = StringComparer.OrdinalIgnoreCase;
+
+ /// <summary>
+ /// Contains chart specific converters
+ /// </summary>
+ HybridDictionary _converterDict = new HybridDictionary();
+
+
+ #endregion
+
+ #region Public properties
+
+ /// <summary>
+ /// Indicates that unknown properties and elements will be
+ /// ignored without throwing an exception.
+ /// </summary>
+ internal bool IsUnknownAttributeIgnored
+ {
+ get
+ {
+ return _isUnknownAttributeIgnored;
+ }
+ set
+ {
+ _isUnknownAttributeIgnored = value;
+ }
+ }
+
+ /// <summary>
+ /// Indicates that serializer works in template creation mode
+ /// </summary>
+ internal bool IsTemplateMode
+ {
+ get
+ {
+ return _isTemplateMode;
+ }
+ set
+ {
+ _isTemplateMode = value;
+ }
+ }
+
+ /// <summary>
+ /// Indicates that object properties are reset to default
+ /// values before loading.
+ /// </summary>
+ internal bool IsResetWhenLoading
+ {
+ get
+ {
+ return _isResetWhenLoading;
+ }
+ set
+ {
+ _isResetWhenLoading = value;
+ }
+ }
+
+ /// <summary>
+ /// Comma separated list of serializable (Save/Load/Reset) properties.
+ /// "ClassName.PropertyName,[ClassName.PropertyName]".
+ /// </summary>
+ internal string SerializableContent
+ {
+ get
+ {
+ return _serializableContent;
+ }
+ set
+ {
+ _serializableContent = value;
+
+ // Reset list
+ serializableContentList = null;
+ }
+ }
+
+ /// <summary>
+ /// Comma separated list of serializable (Save/Load/Reset) properties.
+ /// "ClassName.PropertyName,[ClassName.PropertyName]".
+ /// </summary>
+ internal string NonSerializableContent
+ {
+ get
+ {
+ return _nonSerializableContent;
+ }
+ set
+ {
+ _nonSerializableContent = value;
+
+ // Reset list
+ nonSerializableContentList = null;
+ }
+ }
+
+ #endregion
+
+ #region Resetting methods
+
+ /// <summary>
+ /// Reset properties of the object to default values.
+ /// </summary>
+ /// <param name="objectToReset">Object to be reset.</param>
+ virtual internal void ResetObjectProperties(object objectToReset)
+ {
+ // Reset object properties
+ ResetObjectProperties(objectToReset, null, GetObjectName(objectToReset));
+ }
+
+ /// <summary>
+ /// Reset properties of the object to default values.
+ /// Method is called recursively to reset child objects properties.
+ /// </summary>
+ /// <param name="objectToReset">Object to be reset.</param>
+ /// <param name="parent">Parent of the reset object.</param>
+ /// <param name="elementName">Object element name.</param>
+ virtual internal void ResetObjectProperties(object objectToReset, object parent, string elementName)
+ {
+ // Check input parameters
+ if(objectToReset == null)
+ {
+ return;
+ }
+
+ IList list = objectToReset as IList;
+
+ // Check if object is a list
+ if(list != null && IsSerializableContent(elementName, parent))
+ {
+ // Reset list by clearing all the items
+ list.Clear();
+ return;
+ }
+
+ // Retrive properties list of the object
+ PropertyInfo[] properties = objectToReset.GetType().GetProperties();
+ if(properties != null)
+ {
+ // Loop through all properties and reset public properties
+ foreach(PropertyInfo pi in properties)
+ {
+ // Get property descriptor
+ PropertyDescriptor pd = TypeDescriptor.GetProperties(objectToReset)[pi.Name];
+
+ // Check XmlFormatSerializerStyle attribute
+ if(pd != null)
+ {
+ SerializationVisibilityAttribute styleAttribute = (SerializationVisibilityAttribute)pd.Attributes[typeof(SerializationVisibilityAttribute)];
+ if(styleAttribute != null)
+ {
+ // Hidden property
+ if(styleAttribute.Visibility == SerializationVisibility.Hidden)
+ {
+ continue;
+ }
+ }
+ }
+
+ // Check if this property should be reset
+ bool resetProperty = IsSerializableContent(pi.Name, objectToReset);
+
+ // Skip inherited properties from the root object
+ if(IsChartBaseProperty(objectToReset, parent, pi))
+ {
+ continue;
+ }
+
+ // Reset list
+ if(pi.CanRead && pi.PropertyType.GetInterface("IList", true) != null)
+ {
+ if(resetProperty)
+ {
+ // Check if collection has "Reset" method
+ bool resetComplete = false;
+ MethodInfo mi = objectToReset.GetType().GetMethod("Reset" + pi.Name, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
+ if(mi != null)
+ {
+ mi.Invoke(objectToReset, null);
+ resetComplete = true;
+ }
+
+ // Reset list by clearing all the items
+ if(!resetComplete)
+ {
+ ((IList)pi.GetValue(objectToReset, null)).Clear();
+ }
+ }
+ else
+ {
+ // Reset objects of the list
+ foreach(object listObject in ((IList)pi.GetValue(objectToReset, null)))
+ {
+ ResetObjectProperties(listObject, objectToReset, this.GetObjectName(listObject));
+ }
+ }
+ }
+
+ // Reset public properties with Get and Set methods
+ else if(pi.CanRead && pi.CanWrite)
+ {
+ // Skip indexes
+ if(pi.Name == "Item")
+ {
+ continue;
+ }
+
+ // Skip Names
+ if (pi.Name == "Name")
+ {
+ continue;
+ }
+
+ // Reset inner properies
+ if(ShouldSerializeAsAttribute(pi, objectToReset))
+ {
+ if(resetProperty)
+ {
+ // Reset the property using property descriptor
+
+ if(pd != null)
+ {
+ // Get property object
+ object objectProperty = pi.GetValue(objectToReset, null);
+
+ // Get default value of the property
+ DefaultValueAttribute defValueAttribute = (DefaultValueAttribute)pd.Attributes[typeof(DefaultValueAttribute)];
+ if(defValueAttribute != null)
+ {
+ if(objectProperty == null)
+ {
+ if(defValueAttribute.Value != null)
+ {
+ pd.SetValue(objectToReset, defValueAttribute.Value);
+ }
+ }
+ else if(! objectProperty.Equals(defValueAttribute.Value))
+ {
+ pd.SetValue(objectToReset, defValueAttribute.Value);
+ }
+ }
+ else
+ {
+ // Check if property has "Reset" method
+ MethodInfo mi = objectToReset.GetType().GetMethod("Reset" + pi.Name, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
+ if(mi != null)
+ {
+ mi.Invoke(objectToReset, null);
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ // Reset inner object
+ ResetObjectProperties(pi.GetValue(objectToReset, null), objectToReset, pi.Name);
+ }
+ }
+ }
+ }
+ return;
+ }
+
+
+ #endregion
+
+ #region Abstract Serialization/Deserialization methods
+
+ /// <summary>
+ /// Serialize specified object into the destination object.
+ /// </summary>
+ /// <param name="objectToSerialize">Object to be serialized.</param>
+ /// <param name="destination">Destination of the serialization.</param>
+ internal abstract void Serialize(object objectToSerialize, object destination);
+
+ /// <summary>
+ /// Deserialize specified object from the source object.
+ /// </summary>
+ /// <param name="objectToDeserialize">Object to be deserialized.</param>
+ /// <param name="source">Source of the deserialization.</param>
+ internal abstract void Deserialize(object objectToDeserialize, object source);
+
+ #endregion
+
+ #region Protected helper methods
+
+ /// <summary>
+ /// Converts specified font object into a string.
+ /// </summary>
+ /// <param name="font">Font object to convert.</param>
+ /// <returns>String that contains font data.</returns>
+ internal static string FontToString(Font font)
+ {
+ // Save basic properties persisted by font converter
+ string fontData = (string)SerializerBase.fontConverter.ConvertToInvariantString(font);
+
+ // Persist properties not serialiazed by the converter
+ if(font.GdiCharSet != 1)
+ {
+ fontData += ", GdiCharSet=" + font.GdiCharSet.ToString(System.Globalization.CultureInfo.InvariantCulture);
+ }
+ if(font.GdiVerticalFont)
+ {
+ fontData += ", GdiVerticalFont";
+ }
+
+ return fontData;
+ }
+
+ /// <summary>
+ /// Converts string data into a font object.
+ /// </summary>
+ /// <param name="fontString">String with font data.</param>
+ /// <returns>Newly created font object.</returns>
+ internal static Font FontFromString(string fontString)
+ {
+ // Check if string contains non-standard values "GdiCharSet" or "GdiVerticalFont"
+ string standardData = fontString;
+ byte gdiCharSet = 1;
+ bool gdiVerticalFont = false;
+ int charIndex = fontString.IndexOf(", GdiCharSet=", StringComparison.Ordinal);
+ if(charIndex >= 0)
+ {
+ // Read value
+ string val = fontString.Substring(charIndex + 13);
+ int commaIndex = val.IndexOf(",", StringComparison.Ordinal);
+ if(commaIndex >= 0)
+ {
+ val = val.Substring(0, commaIndex);
+ }
+
+ gdiCharSet = (byte)Int32.Parse(val, System.Globalization.CultureInfo.InvariantCulture);
+
+ // Truncate standard data string
+ if(standardData.Length > charIndex)
+ {
+ standardData = standardData.Substring(0, charIndex);
+ }
+ }
+ charIndex = fontString.IndexOf(", GdiVerticalFont", StringComparison.Ordinal);
+ if(charIndex >= 0)
+ {
+ gdiVerticalFont = true;
+
+ // Truncate standard data string
+ if(standardData.Length > charIndex)
+ {
+ standardData = standardData.Substring(0, charIndex);
+ }
+ }
+
+ // Create Font object from standard parameters
+ Font font = (Font)SerializerBase.fontConverter.ConvertFromInvariantString(standardData);
+
+ // check if non-standard parameters provided
+ if(gdiVerticalFont || gdiCharSet != 1)
+ {
+ Font newFont = new Font(
+ font.Name,
+ font.SizeInPoints,
+ font.Style,
+ GraphicsUnit.Point,
+ gdiCharSet,
+ gdiVerticalFont);
+
+ font.Dispose();
+
+ return newFont;
+ }
+
+ return font;
+ }
+
+ /// <summary>
+ /// Returns a hash code of a specified string.
+ /// </summary>
+ /// <param name="str">String to get the hash code for.</param>
+ /// <returns>String hash code.</returns>
+ internal static short GetStringHashCode(string str)
+ {
+ return (short)(hashCodeProvider.GetHashCode(str) + str.Length * 2);
+ }
+
+ /// <summary>
+ /// Reads hash ID from the specified binary reader.
+ /// </summary>
+ /// <param name="reader">Binary reader to get the data from.</param>
+ /// <returns>Property name or collection member type ID.</returns>
+ internal Int16 ReadHashID(BinaryReader reader)
+ {
+ // For later versions return ID without transformations
+ return reader.ReadInt16();
+ }
+
+ /// <summary>
+ /// Checks if property belongs to the base class of the chart "Control".
+ /// </summary>
+ /// <param name="objectToSerialize">Serializable object.</param>
+ /// <param name="parent">Object parent.</param>
+ /// <param name="pi">Serializable property information.</param>
+ /// <returns>True if property belongs to the base class.</returns>
+ internal bool IsChartBaseProperty(object objectToSerialize, object parent, PropertyInfo pi)
+ {
+ bool result = false;
+
+ // Check only for the root object
+ if(parent == null)
+ {
+ Type currentType = objectToSerialize.GetType();
+ while(currentType != null)
+ {
+ if(pi.DeclaringType == currentType)
+ {
+ result = false;
+ break;
+ }
+
+ // Check if it's a chart class
+ if( currentType == typeof(Chart))
+ {
+ result = true;
+ break;
+ }
+
+ // Get base class type
+ currentType = currentType.BaseType;
+ }
+ }
+
+ return result;
+ }
+
+
+ /// <summary>
+ /// Converts Image object into the BASE64 encoded string
+ /// </summary>
+ /// <param name="image">Image to convert.</param>
+ /// <returns>BASE64 encoded image data.</returns>
+ internal static string ImageToString(System.Drawing.Image image)
+ {
+ // Save image into the stream using BASE64 encoding
+ MemoryStream imageStream = new MemoryStream();
+ image.Save(imageStream, ImageFormat.Png);
+ imageStream.Seek(0, SeekOrigin.Begin);
+
+ // Create XmlTextWriter and save image in BASE64
+ StringBuilder stringBuilder = new StringBuilder();
+ XmlTextWriter textWriter = new XmlTextWriter(new StringWriter(stringBuilder, CultureInfo.InvariantCulture));
+ byte[] imageByteData = imageStream.ToArray();
+ textWriter.WriteBase64(imageByteData, 0, imageByteData.Length);
+
+ // Close image stream
+ textWriter.Close();
+ imageStream.Close();
+
+ return stringBuilder.ToString();
+ }
+
+ /// <summary>
+ /// Converts BASE64 encoded string to image.
+ /// </summary>
+ /// <param name="data">BASE64 encoded data.</param>
+ /// <returns>Image.</returns>
+ internal static System.Drawing.Image ImageFromString(string data)
+ {
+ // Create XML text reader
+ byte[] buffer = new byte[1000];
+ MemoryStream imageStream = new MemoryStream();
+ XmlTextReader textReader = new XmlTextReader(new StringReader("<base64>" + data + "</base64>"));
+
+ // Read tags and BASE64 encoded data
+ textReader.Read();
+ int bytesRead = 0;
+ while((bytesRead = textReader.ReadBase64(buffer, 0, 1000)) > 0)
+ {
+ imageStream.Write(buffer, 0, bytesRead);
+ }
+ textReader.Read();
+
+ // Create image from stream
+ imageStream.Seek(0, SeekOrigin.Begin);
+ System.Drawing.Image tempImage = System.Drawing.Image.FromStream(imageStream);
+ System.Drawing.Bitmap image = new Bitmap(tempImage); // !!! .Net bug when image source stream is closed - can create brush using the image
+ image.SetResolution(tempImage.HorizontalResolution, tempImage.VerticalResolution); //The bitmap created using the constructor does not copy the resolution of the image
+
+ // Close image stream
+ textReader.Close();
+ imageStream.Close();
+
+ return image;
+ }
+
+ /// <summary>
+ /// Get the name of the object class
+ /// </summary>
+ /// <param name="obj">Object to get the name of.</param>
+ /// <returns>Name of the object class (without namespace).</returns>
+ internal string GetObjectName(object obj)
+ {
+ string name = obj.GetType().ToString();
+ return name.Substring(name.LastIndexOf('.') + 1);
+ }
+
+ /// <summary>
+ /// Create new empty item for the list.
+ /// AxisName of the objects is determined by the return type of the indexer.
+ /// </summary>
+ /// <param name="list">List used to detect type of the item objects.</param>
+ /// <param name="itemTypeName">Name of collection type.</param>
+ /// <param name="itemName">Optional item name to return.</param>
+ /// <param name="reusedObject">Indicates that object with specified name was already in the collection and it being reused.</param>
+ /// <returns>New list item object.</returns>
+ internal object GetListNewItem(IList list, string itemTypeName, ref string itemName, ref bool reusedObject)
+ {
+ // Get type of item in collection
+ Type itemType = null;
+ if(itemTypeName.Length > 0)
+ {
+ itemType = Type.GetType(typeof(Chart).Namespace + "." + itemTypeName, false, true);
+ }
+
+ reusedObject = false;
+ PropertyInfo pi = list.GetType().GetProperty("Item", itemType, new Type[] {typeof(string)} );
+ MethodInfo mi = list.GetType().GetMethod("IndexOf", new Type[] { typeof(String) });
+ ConstructorInfo ci = null;
+ if(pi != null)
+ {
+ // Try to get object by name using the indexer
+ if(itemName != null && itemName.Length > 0)
+ {
+ bool itemChecked = false;
+ if (mi != null)
+ {
+ try
+ {
+ int index = -1;
+ object oindex = mi.Invoke(list, new object[] { itemName });
+ if (oindex is int)
+ {
+ index = (int)oindex;
+ itemChecked = true;
+ }
+ if (index != -1)
+ {
+ object objByName = list[index];
+ if (objByName != null)
+ {
+ // Remove found object from the list
+ list.Remove(objByName);
+
+ // Return found object
+ reusedObject = true;
+ return objByName;
+ }
+ }
+ }
+ catch (ArgumentException)
+ {
+ }
+ catch (TargetException)
+ {
+ }
+ catch (TargetInvocationException)
+ {
+ }
+ }
+ if (!itemChecked)
+ {
+ object objByName = null;
+ try
+ {
+ objByName = pi.GetValue(list, new object[] { itemName });
+ }
+ catch (ArgumentException)
+ {
+ objByName = null;
+ }
+ catch (TargetException)
+ {
+ objByName = null;
+ }
+ catch (TargetInvocationException)
+ {
+ objByName = null;
+ }
+
+ if (objByName != null)
+ {
+ try
+ {
+ // Remove found object from the list
+ list.Remove(objByName);
+ }
+ catch (NotSupportedException)
+ {
+ }
+
+ // Return found object
+ reusedObject = true;
+ return objByName;
+ }
+ }
+ itemName = null;
+ }
+
+ }
+ // Get the constructor of the type returned by indexer
+ if (itemType != null)
+ {
+ ci = itemType.GetConstructor(Type.EmptyTypes);
+ }
+ else
+ {
+ ci = pi.PropertyType.GetConstructor(Type.EmptyTypes);
+ }
+ if (ci == null)
+ {
+ throw (new InvalidOperationException(SR.ExceptionChartSerializerDefaultConstructorUndefined(pi.PropertyType.ToString())));
+ }
+ return ci.Invoke(null);
+ }
+
+ /// <summary>
+ /// Returns true if the object property should be serialized as
+ /// parent element attribute. Otherwise as a child element.
+ /// </summary>
+ /// <param name="pi">Property information.</param>
+ /// <param name="parent">Object that the property belongs to.</param>
+ /// <returns>True if property should be serialized as attribute.</returns>
+ internal bool ShouldSerializeAsAttribute(PropertyInfo pi, object parent)
+ {
+ // Check if SerializationVisibilityAttribute is set
+ if(parent != null)
+ {
+ PropertyDescriptor pd = TypeDescriptor.GetProperties(parent)[pi.Name];
+ if(pd != null)
+ {
+ SerializationVisibilityAttribute styleAttribute = (SerializationVisibilityAttribute)pd.Attributes[typeof(SerializationVisibilityAttribute)];
+ if(styleAttribute != null)
+ {
+ if(styleAttribute.Visibility == SerializationVisibility.Attribute)
+ {
+ return true;
+ }
+ else if(styleAttribute.Visibility == SerializationVisibility.Element)
+ {
+ return false;
+ }
+ }
+ }
+ }
+
+ // If a simple type - serialize as property
+ if(!pi.PropertyType.IsClass)
+ {
+ return true;
+ }
+
+ // Some classes are serialized as properties
+ if(pi.PropertyType == typeof(string) ||
+ pi.PropertyType == typeof(Font) ||
+ pi.PropertyType == typeof(Color) ||
+ pi.PropertyType == typeof(System.Drawing.Image))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+
+ /// <summary>
+ /// Determines if this property should be serialized as attribute
+ /// </summary>
+ /// <param name="pi">Property information.</param>
+ /// <param name="objectToSerialize">Object that the property belongs to.</param>
+ /// <returns>True if should be serialized as attribute</returns>
+ internal bool SerializeICollAsAtribute(PropertyInfo pi, object objectToSerialize)
+ {
+ if (objectToSerialize != null)
+ {
+ PropertyDescriptor pd = TypeDescriptor.GetProperties(objectToSerialize)[pi.Name];
+ if (pd != null)
+ {
+ SerializationVisibilityAttribute styleAttribute = (SerializationVisibilityAttribute)pd.Attributes[typeof(SerializationVisibilityAttribute)];
+ if (styleAttribute != null)
+ {
+ if (styleAttribute.Visibility == SerializationVisibility.Attribute)
+ {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// Returns true if the object property is serializable.
+ /// </summary>
+ /// <param name="propertyName">Property name.</param>
+ /// <param name="parent">Object that the property belongs to.</param>
+ /// <returns>True if property is serializable.</returns>
+ internal bool IsSerializableContent(string propertyName, object parent)
+ {
+ bool serializable = true;
+ if(_serializableContent.Length > 0 || _nonSerializableContent.Length > 0)
+ {
+ int serialzableClassFitType = 0; // 0 - undefined; 1 - '*'; 2 - 'Back*'; 3 - Exact
+ int serialzablePropertyFitType = 0; // 0 - undefined; 1 - '*'; 2 - 'Back*'; 3 - Exact
+ string ownerClassName = GetObjectName(parent);
+
+ // Check if property in this class is part of the serializable content
+ serializable = IsPropertyInList(GetSerializableContentList(), ownerClassName, propertyName, out serialzableClassFitType, out serialzablePropertyFitType);
+
+ // Check if property in this class is part of the NON serializable content
+ if(serializable)
+ {
+ int nonSerialzableClassFitType = 0; // 0 - undefined; 1 - '*'; 2 - 'Back*'; 3 - Exact
+ int nonSerialzablePropertyFitType = 0; // 0 - undefined; 1 - '*'; 2 - 'Back*'; 3 - Exact
+ bool nonSerializable = IsPropertyInList(GetNonSerializableContentList(), ownerClassName, propertyName, out nonSerialzableClassFitType, out nonSerialzablePropertyFitType);
+
+ // If property was found in non serializable content list - check the type priority
+ // Priority order: Exact match, 'Back*' mask match, '*' all mask match
+ if(nonSerializable)
+ {
+ // Check priority
+ if((nonSerialzableClassFitType + nonSerialzablePropertyFitType) >
+ (serialzableClassFitType + serialzablePropertyFitType))
+ {
+ serializable = false;
+ }
+ }
+ }
+ }
+
+ return serializable;
+ }
+
+ /// <summary>
+ /// Checks if property belongs is defined in the mask list.
+ /// </summary>
+ /// <param name="contentList">Array list of class/property items.</param>
+ /// <param name="className">Class name.</param>
+ /// <param name="propertyName">Property name.</param>
+ /// <param name="classFitType">Return class mask fit type.</param>
+ /// <param name="propertyFitType">Return property mask fit type.</param>
+ /// <returns>True if property was found in the list.</returns>
+ private bool IsPropertyInList(ArrayList contentList, string className, string propertyName, out int classFitType, out int propertyFitType)
+ {
+ // Initialize result values
+ classFitType = 0;
+ propertyFitType = 0;
+
+ if(contentList != null)
+ {
+ // Loop through all items in the list using step 2
+ for(int itemIndex = 0; itemIndex < contentList.Count; itemIndex += 2)
+ {
+ // Initialize result values
+ classFitType = 0;
+ propertyFitType = 0;
+
+ // Check if object class and property name match the mask
+ if(NameMatchMask((ItemInfo)contentList[itemIndex], className, out classFitType))
+ {
+ if(NameMatchMask((ItemInfo)contentList[itemIndex + 1], propertyName, out propertyFitType))
+ {
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /// <summary>
+ /// Compares class/property name with the specified mask
+ /// </summary>
+ /// <param name="itemInfo">Class/Property item information.</param>
+ /// <param name="objectName">Class/Property name.</param>
+ /// <param name="type">AxisName of matching. 0-No Match; 1-'*' any wild card; 2-'Back*' contain wild card; 3-exact match</param>
+ /// <returns>True if name match the mask.</returns>
+ private bool NameMatchMask(ItemInfo itemInfo, string objectName, out int type)
+ {
+ // Initialize type
+ type = 0;
+
+ // Any class mask
+ if(itemInfo.any)
+ {
+ type = 1;
+ return true;
+ }
+
+ // Ends with class mask
+ if(itemInfo.endsWith)
+ {
+ if(itemInfo.name.Length <= objectName.Length)
+ {
+ if(objectName.Substring(0, itemInfo.name.Length) == itemInfo.name)
+ {
+ type = 2;
+ return true;
+ }
+ }
+ }
+
+ // Starts with class mask
+ if(itemInfo.startsWith)
+ {
+ if(itemInfo.name.Length <= objectName.Length)
+ {
+ if(objectName.Substring(objectName.Length - itemInfo.name.Length, itemInfo.name.Length) == itemInfo.name)
+ {
+ type = 2;
+ return true;
+ }
+ }
+ }
+
+ // Exact name is specified
+ if(itemInfo.name == objectName)
+ {
+ type = 3;
+ return true;
+ }
+
+ return false;
+ }
+
+
+ /// <summary>
+ /// Finds a converter by property descriptor.
+ /// </summary>
+ /// <param name="pd">Property descriptor.</param>
+ /// <returns>A converter registered in TypeConverterAttribute or by property type</returns>
+ internal TypeConverter FindConverter(PropertyDescriptor pd)
+ {
+ TypeConverter result;
+ TypeConverterAttribute typeConverterAttrib = (TypeConverterAttribute)pd.Attributes[typeof(TypeConverterAttribute)];
+ if (typeConverterAttrib != null && typeConverterAttrib.ConverterTypeName.Length > 0)
+ {
+ result = this.FindConverterByType(typeConverterAttrib);
+ if (result != null)
+ {
+ return result;
+ }
+ try
+ {
+ return pd.Converter;
+ }
+ catch (SecurityException)
+ {
+ }
+ catch (MethodAccessException)
+ {
+ }
+ }
+ return TypeDescriptor.GetConverter(pd.PropertyType);
+ }
+
+ /// <summary>
+ /// Finds a converter by TypeConverterAttribute.
+ /// </summary>
+ /// <param name="attr">TypeConverterAttribute.</param>
+ /// <returns>TypeConvetrer or null</returns>
+ internal TypeConverter FindConverterByType( TypeConverterAttribute attr)
+ {
+ // In default Inranet zone (partial trust) ConsrtuctorInfo.Invoke (PropertyDescriptor.Converter)
+ // throws SecurityException or MethodAccessException when the converter class is internal.
+ // Thats why we have this giant if - elseif here - to create type converters whitout reflection.
+ if (_converterDict.Contains(attr.ConverterTypeName))
+ {
+ return (TypeConverter)_converterDict[attr.ConverterTypeName];
+ }
+ String typeStr = attr.ConverterTypeName;
+
+ if (attr.ConverterTypeName.Contains(",") )
+ {
+ typeStr = attr.ConverterTypeName.Split(',')[0];
+ }
+
+ TypeConverter result = null;
+
+ if (typeStr.EndsWith(".CustomPropertiesTypeConverter", StringComparison.OrdinalIgnoreCase)) { result = new CustomPropertiesTypeConverter(); }
+ else if (typeStr.EndsWith(".DoubleNanValueConverter", StringComparison.OrdinalIgnoreCase)) { result = new DoubleNanValueConverter(); }
+ else if (typeStr.EndsWith(".DoubleDateNanValueConverter", StringComparison.OrdinalIgnoreCase)) { result = new DoubleDateNanValueConverter(); }
+#if !Microsoft_CONTROL
+ else if (typeStr.EndsWith(".MapAreaCoordinatesConverter", StringComparison.OrdinalIgnoreCase)) { result = new MapAreaCoordinatesConverter(); }
+#endif //Microsoft_CONTROL
+ else if (typeStr.EndsWith(".ElementPositionConverter", StringComparison.OrdinalIgnoreCase)) { result = new ElementPositionConverter(); }
+ else if (typeStr.EndsWith(".SeriesAreaNameConverter", StringComparison.OrdinalIgnoreCase)) { result = new SeriesAreaNameConverter(); }
+ else if (typeStr.EndsWith(".ChartDataSourceConverter", StringComparison.OrdinalIgnoreCase)) { result = new ChartDataSourceConverter(); }
+ else if (typeStr.EndsWith(".SeriesDataSourceMemberConverter", StringComparison.OrdinalIgnoreCase)) { result = new SeriesDataSourceMemberConverter(); }
+ else if (typeStr.EndsWith(".SeriesLegendNameConverter", StringComparison.OrdinalIgnoreCase)) { result = new SeriesLegendNameConverter(); }
+ else if (typeStr.EndsWith(".ChartTypeConverter", StringComparison.OrdinalIgnoreCase)) { result = new ChartTypeConverter(); }
+ else if (typeStr.EndsWith(".SeriesNameConverter", StringComparison.OrdinalIgnoreCase)) { result = new SeriesNameConverter(); }
+ else if (typeStr.EndsWith(".NoNameExpandableObjectConverter", StringComparison.OrdinalIgnoreCase)) { result = new NoNameExpandableObjectConverter(); }
+ else if (typeStr.EndsWith(".DoubleArrayConverter", StringComparison.OrdinalIgnoreCase)) { result = new DoubleArrayConverter(); }
+ else if (typeStr.EndsWith(".DataPointValueConverter", StringComparison.OrdinalIgnoreCase)) { result = new DataPointValueConverter(); }
+ else if (typeStr.EndsWith(".SeriesYValueTypeConverter", StringComparison.OrdinalIgnoreCase)) { result = new SeriesYValueTypeConverter(typeof(ChartValueType)); }
+ else if (typeStr.EndsWith(".ColorArrayConverter", StringComparison.OrdinalIgnoreCase)) { result = new ColorArrayConverter(); }
+ else if (typeStr.EndsWith(".LegendAreaNameConverter", StringComparison.OrdinalIgnoreCase)) { result = new LegendAreaNameConverter(); }
+ else if (typeStr.EndsWith(".LegendConverter", StringComparison.OrdinalIgnoreCase)) { result = new LegendConverter(); }
+ else if (typeStr.EndsWith(".SizeEmptyValueConverter", StringComparison.OrdinalIgnoreCase)) { result = new SizeEmptyValueConverter(); }
+ else if (typeStr.EndsWith(".MarginExpandableObjectConverter", StringComparison.OrdinalIgnoreCase)) { result = new MarginExpandableObjectConverter(); }
+ else if (typeStr.EndsWith(".IntNanValueConverter", StringComparison.OrdinalIgnoreCase)) { result = new IntNanValueConverter(); }
+ else if (typeStr.EndsWith(".AxesArrayConverter", StringComparison.OrdinalIgnoreCase)) { result = new AxesArrayConverter(); }
+ else if (typeStr.EndsWith(".AxisLabelDateValueConverter", StringComparison.OrdinalIgnoreCase)) { result = new AxisLabelDateValueConverter(); }
+ else if (typeStr.EndsWith(".AxisMinMaxValueConverter", StringComparison.OrdinalIgnoreCase)) { result = new AxisMinMaxValueConverter(); }
+ else if (typeStr.EndsWith(".AxisCrossingValueConverter", StringComparison.OrdinalIgnoreCase)) { result = new AxisCrossingValueConverter(); }
+ else if (typeStr.EndsWith(".AxisMinMaxAutoValueConverter", StringComparison.OrdinalIgnoreCase)) { result = new AxisMinMaxAutoValueConverter(); }
+ else if (typeStr.EndsWith(".StripLineTitleAngleConverter", StringComparison.OrdinalIgnoreCase)) { result = new StripLineTitleAngleConverter(); }
+ else if (typeStr.EndsWith(".AxisIntervalValueConverter", StringComparison.OrdinalIgnoreCase)) { result = new AxisIntervalValueConverter(); }
+ else if (typeStr.EndsWith(".AxisElementIntervalValueConverter", StringComparison.OrdinalIgnoreCase)) { result = new AxisElementIntervalValueConverter(); }
+ else if (typeStr.EndsWith(".AnchorPointValueConverter", StringComparison.OrdinalIgnoreCase)) { result = new AnchorPointValueConverter(); }
+ else if (typeStr.EndsWith(".AnnotationAxisValueConverter", StringComparison.OrdinalIgnoreCase)) { result = new AnnotationAxisValueConverter(); }
+
+ if (result != null) _converterDict[attr.ConverterTypeName] = result;
+
+ return result;
+ }
+
+ #endregion
+
+ #region Serializable content list managment fields, methods and classes
+
+ /// <summary>
+ /// Stores information about content item (class or property)
+ /// </summary>
+ private class ItemInfo
+ {
+ public string name = "";
+ public bool any = false;
+ public bool startsWith = false;
+ public bool endsWith = false;
+ }
+
+ // Storage for serializable content items
+ private ArrayList serializableContentList = null;
+
+ // Storage for non serializable content items
+ private ArrayList nonSerializableContentList = null;
+
+ /// <summary>
+ /// Return serializable content list.
+ /// </summary>
+ /// <returns>Serializable content list.</returns>
+ private ArrayList GetSerializableContentList()
+ {
+ if(serializableContentList == null)
+ {
+ serializableContentList = new ArrayList();
+ FillContentList(
+ serializableContentList,
+ (this.SerializableContent.Length > 0 ) ? this.SerializableContent : "*.*");
+ }
+
+ return serializableContentList;
+ }
+
+ /// <summary>
+ /// Return non serializable content list.
+ /// </summary>
+ /// <returns>Non serializable content list.</returns>
+ private ArrayList GetNonSerializableContentList()
+ {
+ if(nonSerializableContentList == null)
+ {
+ nonSerializableContentList = new ArrayList();
+ FillContentList(nonSerializableContentList, this.NonSerializableContent);
+ }
+
+ return nonSerializableContentList;
+ }
+
+ /// <summary>
+ /// Fill content list from the string.
+ /// </summary>
+ /// <param name="list">Array list class.</param>
+ /// <param name="content">Content string.</param>
+ private void FillContentList(ArrayList list, string content)
+ {
+ if(content.Length > 0)
+ {
+ string[] classPropertyPairs = content.Split(',');
+ foreach(string item in classPropertyPairs)
+ {
+ // Create two content items: one for the class and one for the property
+ ItemInfo classInfo = new ItemInfo();
+ ItemInfo propertyInfo = new ItemInfo();
+
+ // Find class and property name
+ int pointIndex = item.IndexOf('.');
+ if(pointIndex == -1)
+ {
+ throw (new ArgumentException(SR.ExceptionChartSerializerContentStringFormatInvalid));
+ }
+ classInfo.name = item.Substring(0, pointIndex).Trim();
+ propertyInfo.name = item.Substring(pointIndex + 1).Trim();
+ if(classInfo.name.Length == 0)
+ {
+ throw (new ArgumentException(SR.ExceptionChartSerializerClassNameUndefined));
+ }
+ if(propertyInfo.name.Length == 0)
+ {
+ throw (new ArgumentException(SR.ExceptionChartSerializerPropertyNameUndefined));
+ }
+
+ // Make sure property name do not have point character
+ if(propertyInfo.name.IndexOf('.') != -1)
+ {
+ throw (new ArgumentException(SR.ExceptionChartSerializerContentStringFormatInvalid));
+ }
+
+ // Check for wildcards in names
+ CheckWildCars(classInfo);
+ CheckWildCars(propertyInfo);
+
+ // Add class & property items into the array
+ list.Add(classInfo);
+ list.Add(propertyInfo);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Checks wildcards in the name of the item.
+ /// Possible values:
+ /// "*"
+ /// "*Name"
+ /// "Name*"
+ /// </summary>
+ /// <param name="info">Item information class.</param>
+ private void CheckWildCars(ItemInfo info)
+ {
+ // Any class mask
+ if(info.name == "*")
+ {
+ info.any = true;
+ }
+
+ // Ends with class mask
+ else if(info.name[info.name.Length - 1] == '*')
+ {
+ info.endsWith = true;
+ info.name = info.name.TrimEnd('*');
+ }
+
+ // Starts with class mask
+ else if(info.name[0] == '*')
+ {
+ info.startsWith = true;
+ info.name = info.name.TrimStart('*');
+ }
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Utility class which serialize object using XML format
+ /// </summary>
+ internal class XmlFormatSerializer : SerializerBase
+ {
+ #region Serialization public methods
+
+ /// <summary>
+ /// Serialize specified object into the stream.
+ /// </summary>
+ /// <param name="objectToSerialize">Object to be serialized.</param>
+ /// <param name="stream">The stream used to write the XML document.</param>
+
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal void Serialize(object objectToSerialize, Stream stream)
+ {
+ Serialize(objectToSerialize, (object)stream);
+ }
+
+ /// <summary>
+ /// Serialize specified object into the XML writer.
+ /// </summary>
+ /// <param name="objectToSerialize">Object to be serialized.</param>
+ /// <param name="xmlWriter">The XmlWriter used to write the XML document.</param>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal void Serialize(object objectToSerialize, XmlWriter xmlWriter)
+ {
+ Serialize(objectToSerialize, (object)xmlWriter);
+ }
+
+ /// <summary>
+ /// Serialize specified object into the text writer.
+ /// </summary>
+ /// <param name="objectToSerialize">Object to be serialized.</param>
+ /// <param name="textWriter">The TextWriter used to write the XML document.</param>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal void Serialize(object objectToSerialize, TextWriter textWriter)
+ {
+ Serialize(objectToSerialize, (object)textWriter);
+ }
+
+ /// <summary>
+ /// Serialize specified object into the file.
+ /// </summary>
+ /// <param name="objectToSerialize">Object to be serialized.</param>
+ /// <param name="fileName">The file name used to write the XML document.</param>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal void Serialize(object objectToSerialize, string fileName)
+ {
+ Serialize(objectToSerialize, (object)fileName);
+ }
+
+ #endregion
+
+ #region Serialization private methods
+
+ /// <summary>
+ /// Serialize specified object into different types of writers using XML format.
+ /// Here is what is serialized in the object:
+ /// - all public properties with Set and Get methods
+ /// - all public properties with Get method which derived from ICollection
+ /// </summary>
+ /// <param name="objectToSerialize">Object to be serialized.</param>
+ /// <param name="writer">Defines the serialization destination. Can be Stream, TextWriter, XmlWriter or String (file name).</param>
+
+ internal override void Serialize(object objectToSerialize, object writer)
+ {
+ // the possible writer types
+ Stream stream = writer as Stream;
+ TextWriter textWriter = writer as TextWriter;
+ XmlWriter xmlWriter = writer as XmlWriter;
+ string writerStr = writer as string;
+
+ // Check input parameters
+ if(objectToSerialize == null)
+ {
+ throw(new ArgumentNullException("objectToSerialize"));
+ }
+ if(writer == null)
+ {
+ throw(new ArgumentNullException("writer"));
+ }
+ if(stream == null && textWriter == null && xmlWriter == null && writerStr == null)
+ {
+ throw (new ArgumentException(SR.ExceptionChartSerializerWriterObjectInvalid, "writer"));
+ }
+
+ // Create XML document
+ XmlDocument xmlDocument = new XmlDocument();
+
+ // Create document fragment
+ XmlDocumentFragment docFragment = xmlDocument.CreateDocumentFragment();
+
+
+
+ // Serialize object
+ SerializeObject(objectToSerialize, null, GetObjectName(objectToSerialize), docFragment, xmlDocument);
+
+
+ // Append document fragment
+ xmlDocument.AppendChild(docFragment);
+
+ // Remove empty child nodes
+ RemoveEmptyChildNodes(xmlDocument);
+
+ // Save XML document into the writer
+ if(stream != null)
+ {
+ xmlDocument.Save(stream);
+
+ // Flush stream and seek to the beginning
+ stream.Flush();
+ stream.Seek(0, SeekOrigin.Begin);
+ }
+
+ if(writerStr != null)
+ {
+ xmlDocument.Save(writerStr);
+ }
+
+ if(xmlWriter != null)
+ {
+ xmlDocument.Save(xmlWriter);
+ }
+
+ if(textWriter != null)
+ {
+ xmlDocument.Save(textWriter);
+ }
+ }
+ /// <summary>
+ /// Serialize specified object into the XML format.
+ /// Method is called recursively to serialize child objects.
+ /// </summary>
+ /// <param name="objectToSerialize">Object to be serialized.</param>
+ /// <param name="parent">Parent of the serialized object.</param>
+ /// <param name="elementName">Object element name.</param>
+ /// <param name="xmlParentNode">The XmlNode of the parent object to serialize the data in.</param>
+ /// <param name="xmlDocument">The XmlDocument the parent node belongs to.</param>
+ virtual protected void SerializeObject(object objectToSerialize, object parent, string elementName, XmlNode xmlParentNode, XmlDocument xmlDocument)
+ {
+ // Check input parameters
+ if(objectToSerialize == null)
+ {
+ return;
+ }
+
+ // Check if object should be serialized
+ if(parent != null)
+ {
+ PropertyDescriptor pd = TypeDescriptor.GetProperties(parent)[elementName];
+ if(pd != null)
+ {
+ SerializationVisibilityAttribute styleAttribute = (SerializationVisibilityAttribute)pd.Attributes[typeof(SerializationVisibilityAttribute)];
+ if(styleAttribute != null)
+ {
+ // Hidden property
+ if(styleAttribute.Visibility == SerializationVisibility.Hidden)
+ {
+ return;
+ }
+ }
+ }
+ }
+
+ // Check if object is a collection
+ if(objectToSerialize is ICollection)
+ {
+ // Serialize collection
+ SerializeCollection(objectToSerialize, elementName, xmlParentNode, xmlDocument);
+ return;
+ }
+
+ // Create object element inside the parents node
+ XmlNode xmlNode = xmlDocument.CreateElement(elementName);
+ xmlParentNode.AppendChild(xmlNode);
+
+ // Write template data into collection items
+ bool templateListItem = false;
+ IList parentList = parent as IList;
+ if(this.IsTemplateMode && parentList != null)
+ {
+ // Create "_Template_" attribute
+ XmlAttribute attrib = xmlDocument.CreateAttribute("_Template_");
+
+ // Check number of items in collection
+ if (parentList.Count == 1)
+ {
+ // If only one iten in collection, set "All" value.
+ // This means that style of this object should be applied to all
+ // existing items of the collection.
+ attrib.Value = "All";
+ }
+ else
+ {
+ // If there is more than one item, use it's index.
+ // When loading, style of these items will be applied to existing
+ // items in collection in the loop.
+ int itemIndex = parentList.IndexOf(objectToSerialize);
+ attrib.Value = itemIndex.ToString(CultureInfo.InvariantCulture);
+ }
+
+ // Add "_Template_" attribute into the XML node
+ xmlNode.Attributes.Append(attrib);
+ templateListItem = true;
+ }
+
+ // Retrive properties list of the object
+ PropertyInfo[] properties = objectToSerialize.GetType().GetProperties();
+ if (properties != null)
+ {
+ // Loop through all properties and serialize public properties
+ foreach(PropertyInfo pi in properties)
+ {
+
+ // Skip "Name" property from collection items in template mode
+ if(templateListItem && pi.Name == "Name")
+ {
+ continue;
+ }
+
+ // Skip inherited properties from the root object
+ if(IsChartBaseProperty(objectToSerialize, parent, pi))
+ {
+ continue;
+ }
+
+ // Check if this property is serializable content
+ if (!IsSerializableContent(pi.Name, objectToSerialize))
+ {
+ continue;
+ }
+
+ // Serialize collection
+
+ if (pi.CanRead && pi.PropertyType.GetInterface("ICollection", true) != null && !this.SerializeICollAsAtribute(pi, objectToSerialize))
+ {
+ // Check if SerializationVisibilityAttribute is set
+ bool serialize = true;
+ if(objectToSerialize != null)
+ {
+ PropertyDescriptor pd = TypeDescriptor.GetProperties(objectToSerialize)[pi.Name];
+ if(pd != null)
+ {
+ SerializationVisibilityAttribute styleAttribute = (SerializationVisibilityAttribute)pd.Attributes[typeof(SerializationVisibilityAttribute)];
+ if(styleAttribute != null)
+ {
+ if(styleAttribute.Visibility == SerializationVisibility.Hidden)
+ {
+ serialize = false;
+ }
+ }
+ }
+ }
+ // Check if collection has "ShouldSerialize" method
+ MethodInfo mi = objectToSerialize.GetType().GetMethod("ShouldSerialize" + pi.Name, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public );
+ if(mi != null)
+ {
+ object result = mi.Invoke(objectToSerialize, null);
+ if(result is bool && ((bool)result) == false)
+ {
+ // Do not serialize collection
+ serialize = false;
+ }
+ }
+
+ // Serialize collection
+ if(serialize)
+ {
+ SerializeCollection(pi.GetValue(objectToSerialize, null), pi.Name, xmlNode, xmlDocument);
+ }
+ }
+
+ // Serialize public properties with Get and Set methods
+ else if(pi.CanRead && pi.CanWrite)
+ {
+ // Skip indexes
+ if(pi.Name == "Item")
+ {
+ continue;
+ }
+
+ // Check if an object should be serialized as a property or as a class
+ if(ShouldSerializeAsAttribute(pi, objectToSerialize))
+ {
+ // Serialize property
+ SerializeProperty(pi.GetValue(objectToSerialize, null), objectToSerialize, pi.Name, xmlNode, xmlDocument);
+ }
+ else
+ {
+ // Serialize inner object
+ SerializeObject(pi.GetValue(objectToSerialize, null), objectToSerialize, pi.Name, xmlNode, xmlDocument);
+ }
+ }
+ }
+ }
+ return;
+ }
+
+
+ /// <summary>
+ /// Serializes the data point.
+ /// </summary>
+ /// <param name="objectToSerialize">The object to serialize.</param>
+ /// <param name="xmlParentNode">The XML parent node.</param>
+ /// <param name="xmlDocument">The XML document.</param>
+ internal void SerializeDataPoint(object objectToSerialize, XmlNode xmlParentNode, XmlDocument xmlDocument)
+ {
+ // Create object element inside the parents node
+ XmlNode xmlNode = xmlDocument.CreateElement(GetObjectName(objectToSerialize));
+ xmlParentNode.AppendChild(xmlNode);
+
+ DataPoint dataPoint = objectToSerialize as DataPoint;
+ if (dataPoint.XValue != 0d && IsSerializableContent("XValue", objectToSerialize))
+ {
+ XmlAttribute attrib = xmlDocument.CreateAttribute("XValue");
+ attrib.Value = GetXmlValue(dataPoint.XValue, dataPoint, "XValue");
+ xmlNode.Attributes.Append(attrib);
+ }
+ if (dataPoint.YValues.Length > 0 && IsSerializableContent("YValues", objectToSerialize))
+ {
+ XmlAttribute attrib = xmlDocument.CreateAttribute("YValues");
+ attrib.Value = GetXmlValue(dataPoint.YValues, dataPoint, "YValues");
+ xmlNode.Attributes.Append(attrib);
+ }
+ if (dataPoint.IsEmpty && IsSerializableContent("IsEmpty", objectToSerialize))
+ {
+ XmlAttribute attrib = xmlDocument.CreateAttribute("IsEmpty");
+ attrib.Value = GetXmlValue(dataPoint.isEmptyPoint, dataPoint, "IsEmpty");
+ xmlNode.Attributes.Append(attrib);
+ }
+ bool hasCustomProperties = false;
+ foreach (DictionaryEntry entry in dataPoint.properties)
+ {
+ if (entry.Key is int)
+ {
+ CommonCustomProperties propertyType = (CommonCustomProperties)((int)entry.Key);
+ String properyName = propertyType.ToString();
+ if (IsSerializableContent(properyName, objectToSerialize))
+ {
+ XmlAttribute attrib = xmlDocument.CreateAttribute(properyName);
+ attrib.Value = GetXmlValue(entry.Value, dataPoint, properyName);
+ xmlNode.Attributes.Append(attrib);
+ }
+ }
+ else
+ {
+ hasCustomProperties = true;
+ }
+ }
+
+ if (hasCustomProperties && !String.IsNullOrEmpty(dataPoint.CustomProperties) && IsSerializableContent("CustomProperties", objectToSerialize))
+ {
+ XmlAttribute attrib = xmlDocument.CreateAttribute("CustomProperties");
+ attrib.Value = GetXmlValue(dataPoint.CustomProperties, dataPoint, "CustomProperties");
+ xmlNode.Attributes.Append(attrib);
+ }
+
+ }
+
+ /// <summary>
+ /// Serialize specified object into the XML text writer.
+ /// Method is called recursively to serialize child objects.
+ /// </summary>
+ /// <param name="objectToSerialize">Object to be serialized.</param>
+ /// <param name="elementName">Object element name.</param>
+ /// <param name="xmlParentNode">The XmlNode of the parent object to serialize the data in.</param>
+ /// <param name="xmlDocument">The XmlDocument the parent node belongs to.</param>
+ virtual protected void SerializeCollection(object objectToSerialize, string elementName, XmlNode xmlParentNode, XmlDocument xmlDocument)
+ {
+ ICollection collection = objectToSerialize as ICollection;
+ if(collection != null)
+ {
+ // Create object element inside the parents node
+ XmlNode xmlNode = xmlDocument.CreateElement(elementName);
+ xmlParentNode.AppendChild(xmlNode);
+ // Enumerate through all objects in collection and serialize them
+ foreach(object obj in collection)
+ {
+
+ if (obj is DataPoint)
+ {
+ SerializeDataPoint(obj, xmlNode, xmlDocument);
+ continue;
+ }
+
+ SerializeObject(obj, objectToSerialize, GetObjectName(obj), xmlNode, xmlDocument);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Serialize specified object into the XML text writer.
+ /// Method is called recursively to serialize child objects.
+ /// </summary>
+ /// <param name="objectToSerialize">Object to be serialized.</param>
+ /// <param name="parent">Parent of the serialized object.</param>
+ /// <param name="elementName">Object element name.</param>
+ /// <param name="xmlParentNode">The XmlNode of the parent object to serialize the data in.</param>
+ /// <param name="xmlDocument">The XmlDocument the parent node belongs to.</param>
+ virtual protected void SerializeProperty(object objectToSerialize, object parent, string elementName, XmlNode xmlParentNode, XmlDocument xmlDocument)
+ {
+ // Check input parameters
+ if(objectToSerialize == null || parent == null)
+ {
+ return;
+ }
+
+ // Check if property has non-default value
+ PropertyDescriptor pd = TypeDescriptor.GetProperties(parent)[elementName];
+ if(pd != null)
+ {
+ DefaultValueAttribute defValueAttribute = (DefaultValueAttribute)pd.Attributes[typeof(DefaultValueAttribute)];
+ if(defValueAttribute != null)
+ {
+ if(objectToSerialize.Equals(defValueAttribute.Value))
+ {
+ // Do not serialize properties with default values
+ return;
+ }
+ }
+ else
+ {
+ // Check if property has "ShouldSerialize" method
+ MethodInfo mi = parent.GetType().GetMethod("ShouldSerialize" + elementName, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
+ if(mi != null)
+ {
+ object result = mi.Invoke(parent, null);
+ if(result is bool && ((bool)result) == false)
+ {
+ // Do not serialize properties with default values
+ return;
+ }
+ }
+ }
+
+ // Check XmlFormatSerializerStyle attribute
+ SerializationVisibilityAttribute styleAttribute = (SerializationVisibilityAttribute)pd.Attributes[typeof(SerializationVisibilityAttribute)];
+ if(styleAttribute != null)
+ {
+ // Hidden property
+ if(styleAttribute.Visibility == SerializationVisibility.Hidden)
+ {
+ return;
+ }
+ }
+ }
+
+ // Serialize property as a parents node attribute
+ XmlAttribute attrib = xmlDocument.CreateAttribute(elementName);
+ attrib.Value = GetXmlValue(objectToSerialize, parent, elementName);
+ xmlParentNode.Attributes.Append(attrib);
+ }
+
+ /// <summary>
+ /// Converts object value into the string.
+ /// </summary>
+ /// <param name="obj">Object to convert.</param>
+ /// <param name="parent">Object parent.</param>
+ /// <param name="elementName">Object name.</param>
+ /// <returns>Object value as strig.</returns>
+ protected string GetXmlValue(object obj, object parent, string elementName)
+ {
+ string objStr = obj as string;
+ if(objStr != null)
+ {
+ return objStr;
+ }
+
+ Font font = obj as Font;
+ if(font != null)
+ {
+ return SerializerBase.FontToString(font);
+ }
+
+ if(obj is Color)
+ {
+ return colorConverter.ConvertToString(null, System.Globalization.CultureInfo.InvariantCulture, obj);
+ }
+
+ Color[] colors = obj as Color[];
+ if(colors != null)
+ {
+ return ColorArrayConverter.ColorArrayToString(colors);
+ }
+
+#if !Microsoft_CONTROL
+ if(obj is Unit)
+ {
+ Unit unit = (Unit)obj;
+ return unit.Value.ToString(System.Globalization.CultureInfo.InvariantCulture);
+ }
+#endif
+
+ System.Drawing.Image image = obj as System.Drawing.Image;
+ if(image != null)
+ {
+ return ImageToString(image);
+ }
+
+ // Look for the converter set with the attibute
+ PropertyDescriptor pd = TypeDescriptor.GetProperties(parent)[elementName];
+ if(pd != null)
+ {
+ TypeConverter converter = this.FindConverter(pd);
+ if (converter != null && converter.CanConvertTo(typeof(string)))
+ {
+ return converter.ConvertToString(null, System.Globalization.CultureInfo.InvariantCulture, obj);
+ }
+ }
+
+ // Try using default string convertion
+ return obj.ToString();
+ }
+
+ /// <summary>
+ /// Removes all empty nodes from the XML document.
+ /// Method is called recursively to remove empty child nodes first.
+ /// </summary>
+ /// <param name="xmlNode">The node where to start the removing.</param>
+ private void RemoveEmptyChildNodes(XmlNode xmlNode)
+ {
+ // Loop through all child nodes
+ for(int nodeIndex = 0; nodeIndex < xmlNode.ChildNodes.Count; nodeIndex++)
+ {
+ // Remove empty child nodes of the child
+ RemoveEmptyChildNodes(xmlNode.ChildNodes[nodeIndex]);
+
+ // Check if there are any non-empty nodes left
+ XmlNode currentNode = xmlNode.ChildNodes[nodeIndex];
+ if( currentNode.ParentNode != null &&
+ !(currentNode.ParentNode is XmlDocument) )
+ {
+ if(!currentNode.HasChildNodes &&
+ (currentNode.Attributes == null ||
+ currentNode.Attributes.Count == 0))
+ {
+ // Remove node
+ xmlNode.RemoveChild(xmlNode.ChildNodes[nodeIndex]);
+ --nodeIndex;
+ }
+ }
+
+
+
+ // Remove node with one "_Template_" attribute
+ if(!currentNode.HasChildNodes &&
+ currentNode.Attributes.Count == 1 &&
+ currentNode.Attributes["_Template_"] != null)
+ {
+ // Remove node
+ xmlNode.RemoveChild(xmlNode.ChildNodes[nodeIndex]);
+ --nodeIndex;
+ }
+
+
+
+ }
+ }
+
+ #endregion
+
+ #region Deserialization public methods
+
+ /// <summary>
+ /// Deserialize specified object from the stream.
+ /// </summary>
+ /// <param name="objectToDeserialize">Object to be deserialized.</param>
+ /// <param name="stream">The stream used to read the XML document from.</param>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal void Deserialize(object objectToDeserialize, Stream stream)
+ {
+ Deserialize(objectToDeserialize, (object)stream);
+ }
+
+ /// <summary>
+ /// Deserialize specified object from the XML reader.
+ /// </summary>
+ /// <param name="objectToDeserialize">Object to be deserialized.</param>
+ /// <param name="xmlReader">The XmlReader used to read the XML document from.</param>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal void Deserialize(object objectToDeserialize, XmlReader xmlReader)
+ {
+ Deserialize(objectToDeserialize, (object)xmlReader);
+ }
+
+ /// <summary>
+ /// Deserialize specified object from the text reader.
+ /// </summary>
+ /// <param name="objectToDeserialize">Object to be deserialized.</param>
+ /// <param name="textReader">The TextReader used to write the XML document from.</param>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal void Deserialize(object objectToDeserialize, TextReader textReader)
+ {
+ Deserialize(objectToDeserialize, (object)textReader);
+ }
+
+ /// <summary>
+ /// Deserialize specified object from the file.
+ /// </summary>
+ /// <param name="objectToDeserialize">Object to be deserialized.</param>
+ /// <param name="fileName">The file name used to read the XML document from.</param>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal void Deserialize(object objectToDeserialize, string fileName)
+ {
+ Deserialize(objectToDeserialize, (object)fileName);
+ }
+
+ #endregion
+
+ #region Deserialization private methods
+
+ /// <summary>
+ /// Deserialize object from different types of readers using XML format.
+ /// </summary>
+ /// <param name="objectToDeserialize">Object to be deserialized.</param>
+ /// <param name="reader">Defines the deserialization data source. Can be Stream, TextReader, XmlReader or String (file name).</param>
+ internal override void Deserialize(object objectToDeserialize, object reader)
+ {
+ // the four possible types of readers
+ Stream stream = reader as Stream;
+ TextReader textReader = reader as TextReader;
+ XmlReader xmlReader = reader as XmlReader;
+ string readerStr = reader as string;
+
+ // Check input parameters
+ if(objectToDeserialize == null)
+ {
+ throw(new ArgumentNullException("objectToDeserialize"));
+ }
+ if(reader == null)
+ {
+ throw(new ArgumentNullException("reader"));
+ }
+ if(stream == null && textReader == null && xmlReader == null && readerStr == null)
+ {
+ throw (new ArgumentException(SR.ExceptionChartSerializerReaderObjectInvalid, "reader"));
+ }
+
+ // Create XML document
+ XmlDocument xmlDocument = new XmlDocument();
+ XmlReader xmlBaseReader = null;
+ try
+ {
+ // process files without DTD
+ XmlReaderSettings settings = new XmlReaderSettings();
+ // settings.ProhibitDtd is obsolete inn NetFx 4.0, the #ifdef stays for compilation under NetFx 3.5.
+#if OLD_DTD
+ settings.ProhibitDtd = true;
+#else
+ settings.DtdProcessing = DtdProcessing.Prohibit; //don't allow DTD
+#endif
+ // Load XML document from the reader
+ if (stream != null)
+ {
+ xmlBaseReader = XmlReader.Create(stream, settings);
+ }
+ if (readerStr != null)
+ {
+ xmlBaseReader = XmlReader.Create(readerStr, settings);
+ }
+ if (xmlReader != null)
+ {
+ xmlBaseReader = XmlReader.Create(xmlReader, settings);
+ }
+ if (textReader != null)
+ {
+ xmlBaseReader = XmlReader.Create(textReader, settings);
+ }
+
+ xmlDocument.Load(xmlBaseReader);
+
+ // Reset properties of the root object
+ if (IsResetWhenLoading)
+ {
+ ResetObjectProperties(objectToDeserialize);
+ }
+
+ // Deserialize object
+ DeserializeObject(objectToDeserialize, null, GetObjectName(objectToDeserialize), xmlDocument.DocumentElement, xmlDocument);
+ }
+ finally
+ {
+ if (xmlBaseReader != null)
+ {
+ ((IDisposable)xmlBaseReader).Dispose();
+ }
+ }
+ }
+
+ /// <summary>
+ /// Deserialize object from the XML format.
+ /// Method is called recursively to deserialize child objects.
+ /// </summary>
+ /// <param name="objectToDeserialize">Object to be deserialized.</param>
+ /// <param name="parent">Parent of the deserialized object.</param>
+ /// <param name="elementName">Object element name.</param>
+ /// <param name="xmlParentNode">The XmlNode of the parent object to deserialize the data from.</param>
+ /// <param name="xmlDocument">The XmlDocument the parent node belongs to.</param>
+ /// <returns>Number of properties set.</returns>
+ virtual internal int DeserializeObject(object objectToDeserialize, object parent, string elementName, XmlNode xmlParentNode, XmlDocument xmlDocument)
+ {
+ int setPropertiesNumber = 0;
+
+ // Check input parameters
+ if(objectToDeserialize == null)
+ {
+ return setPropertiesNumber;
+ }
+
+ // Loop through all node properties
+ foreach(XmlAttribute attr in xmlParentNode.Attributes)
+ {
+ // Skip template collection item attribute
+ if(attr.Name == "_Template_")
+ {
+ continue;
+ }
+
+ // Check if this property is serializable content
+ if(IsSerializableContent(attr.Name, objectToDeserialize))
+ {
+ SetXmlValue(objectToDeserialize, attr.Name, attr.Value);
+ ++setPropertiesNumber;
+ }
+ }
+
+
+
+ // Read template data into the collection
+ IList list = objectToDeserialize as IList;
+
+ if(this.IsTemplateMode &&
+ list != null &&
+ xmlParentNode.FirstChild.Attributes["_Template_"] != null)
+ {
+ // Loop through all items in collection
+ int itemIndex = 0;
+ foreach(object listItem in list)
+ {
+ // Find XML node appropriate for the item from the collection
+ XmlNode listItemNode = null;
+
+ // Loop through all child nodes
+ foreach(XmlNode childNode in xmlParentNode.ChildNodes)
+ {
+ string templateString = childNode.Attributes["_Template_"].Value;
+ if(templateString != null && templateString.Length > 0)
+ {
+ if(templateString == "All")
+ {
+ listItemNode = childNode;
+ break;
+ }
+ else
+ {
+ // If there is more items in collection than XML node in template
+ // apply items in a loop
+ int loopItemIndex = itemIndex;
+ while(loopItemIndex > xmlParentNode.ChildNodes.Count - 1)
+ {
+ loopItemIndex -= xmlParentNode.ChildNodes.Count;
+ }
+
+ // Convert attribute value to index
+ int nodeIndex = int.Parse(templateString, CultureInfo.InvariantCulture);
+ if(nodeIndex == loopItemIndex)
+ {
+ listItemNode = childNode;
+ break;
+ }
+ }
+ }
+ }
+
+ // Load data from the node
+ if(listItemNode != null)
+ {
+ // Load object data
+ DeserializeObject(listItem, objectToDeserialize, "", listItemNode, xmlDocument);
+ }
+
+ // Increase item index
+ ++itemIndex;
+ }
+
+ // No futher loading required
+ return 0;
+ }
+
+
+
+ // Loop through all child elements
+ int listItemIndex = 0;
+ foreach(XmlNode childNode in xmlParentNode.ChildNodes)
+ {
+ // Special handling for the collections
+ // Bug VSTS #235707 - The collections IsSerializableContent are already checked as a property in the else statement.
+ if (list != null)
+ {
+ // Create new item object
+ string itemName = null;
+ if (childNode.Attributes["Name"] != null)
+ {
+ itemName = childNode.Attributes["Name"].Value;
+ }
+
+ bool reusedObject = false;
+ object listItem = GetListNewItem(list, childNode.Name, ref itemName, ref reusedObject);
+
+ // Deserialize list item object
+ int itemSetProperties = DeserializeObject(listItem, objectToDeserialize, "", childNode, xmlDocument);
+ setPropertiesNumber += itemSetProperties;
+
+ // Add item object into the list
+ if (itemSetProperties > 0 || reusedObject)
+ {
+ list.Insert(listItemIndex++, listItem);
+ }
+ }
+
+ else
+ {
+ // Check if this property is serializable content
+ if (IsSerializableContent(childNode.Name, objectToDeserialize))
+ {
+ // Deserialize the property using property descriptor
+ PropertyDescriptor pd = TypeDescriptor.GetProperties(objectToDeserialize)[childNode.Name];
+ if (pd != null)
+ {
+ object innerObject = pd.GetValue(objectToDeserialize);
+
+ // Deserialize list item object
+ setPropertiesNumber += DeserializeObject(innerObject, objectToDeserialize, childNode.Name, childNode, xmlDocument);
+ }
+ else if (!IsUnknownAttributeIgnored)
+ {
+ throw (new InvalidOperationException(SR.ExceptionChartSerializerPropertyNameUnknown(childNode.Name, objectToDeserialize.GetType().ToString())));
+ }
+ }
+ }
+ }
+
+ return setPropertiesNumber;
+ }
+
+ /// <summary>
+ /// Sets a property of an object using name and value as string.
+ /// </summary>
+ /// <param name="obj">Object to set.</param>
+ /// <param name="attrName">Attribute (property) name.</param>
+ /// <param name="attrValue">Object value..</param>
+ /// <returns>Object value as strig.</returns>
+ private void SetXmlValue(object obj, string attrName, string attrValue)
+ {
+ PropertyInfo pi = obj.GetType().GetProperty(attrName);
+ if(pi != null)
+ {
+ // Convert string to object value
+ object objValue = attrValue;
+
+ if(pi.PropertyType == typeof(string))
+ {
+ objValue = attrValue;
+ }
+
+ else if(pi.PropertyType == typeof(Font))
+ {
+ objValue = SerializerBase.FontFromString(attrValue);
+ }
+
+ else if(pi.PropertyType == typeof(Color))
+ {
+ objValue = (Color)colorConverter.ConvertFromString(null, System.Globalization.CultureInfo.InvariantCulture, attrValue);
+ }
+
+#if !Microsoft_CONTROL
+ else if(pi.PropertyType == typeof(Unit))
+ {
+ objValue = new Unit(Int32.Parse(attrValue, System.Globalization.CultureInfo.InvariantCulture));
+ }
+#endif
+
+ else if(pi.PropertyType == typeof(System.Drawing.Image))
+ {
+ objValue = ImageFromString(attrValue);
+ }
+
+ else
+ {
+ // Look for the converter set with the attibute
+ PropertyDescriptor pd = TypeDescriptor.GetProperties(obj)[attrName];
+ if(pd != null)
+ {
+ TypeConverter converter = this.FindConverter(pd);
+ if (converter != null && converter.CanConvertFrom(typeof(string)))
+ {
+ objValue = converter.ConvertFromString(null, System.Globalization.CultureInfo.InvariantCulture, attrValue);
+ }
+ }
+ }
+
+ // Set object value
+ pi.SetValue(obj, objValue, null);
+ }
+ else if(!IsUnknownAttributeIgnored)
+ {
+ throw(new InvalidOperationException(SR.ExceptionChartSerializerPropertyNameUnknown( attrName,obj.GetType().ToString())));
+ }
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Utility class which serialize object using binary format
+ /// </summary>
+ internal class BinaryFormatSerializer : SerializerBase
+ {
+ #region Serialization methods
+
+ /// <summary>
+ /// Serialize specified object into the destination using binary format.
+ /// </summary>
+ /// <param name="objectToSerialize">Object to be serialized.</param>
+ /// <param name="destination">Serialization destination.</param>
+ internal override void Serialize(object objectToSerialize, object destination)
+ {
+ // Check input parameters
+ if (objectToSerialize == null)
+ {
+ throw (new ArgumentNullException("objectToSerialize"));
+ }
+ if (destination == null)
+ {
+ throw (new ArgumentNullException("destination"));
+ }
+
+ string destinationStr = destination as string;
+ if (destinationStr != null)
+ {
+ Serialize(objectToSerialize, destinationStr);
+ return;
+ }
+
+ Stream stream = destination as Stream;
+ if (stream != null)
+ {
+ Serialize(objectToSerialize, stream);
+ return;
+ }
+
+ BinaryWriter binaryWriter = destination as BinaryWriter;
+ if (binaryWriter != null)
+ {
+ Serialize(objectToSerialize, binaryWriter);
+ return;
+ }
+
+ throw (new ArgumentException(SR.ExceptionChartSerializerDestinationObjectInvalid, "destination"));
+ }
+
+ /// <summary>
+ /// Serialize specified object into the file using binary format.
+ /// </summary>
+ /// <param name="objectToSerialize">Object to be serialized.</param>
+ /// <param name="fileName">File name to serialize the data in.</param>
+ internal void Serialize(object objectToSerialize, string fileName)
+ {
+ FileStream stream = new FileStream(fileName, FileMode.Create);
+ Serialize(objectToSerialize, new BinaryWriter(stream));
+ stream.Close();
+ }
+
+
+ /// <summary>
+ /// Serialize specified object into the stream using binary format.
+ /// </summary>
+ /// <param name="objectToSerialize">Object to be serialized.</param>
+ /// <param name="stream">Defines the serialization destination.</param>
+ internal void Serialize(object objectToSerialize, Stream stream)
+ {
+ Serialize(objectToSerialize, new BinaryWriter(stream));
+ }
+
+ /// <summary>
+ /// Serialize specified object into different types of writers using binary format.
+ /// Here is what is serialized in the object:
+ /// - all public properties with Set and Get methods
+ /// - all public properties with Get method which derived from ICollection
+ /// </summary>
+ /// <param name="objectToSerialize">Object to be serialized.</param>
+ /// <param name="writer">Defines the serialization destination.</param>
+ internal void Serialize(object objectToSerialize, BinaryWriter writer)
+ {
+ // Check input parameters
+ if(objectToSerialize == null)
+ {
+ throw(new ArgumentNullException("objectToSerialize"));
+ }
+ if(writer == null)
+ {
+ throw(new ArgumentNullException("writer"));
+ }
+
+ // Write bnary format header into the stream, which consist of 15 characters
+ char[] header = new char[15] {'D', 'C', 'B', 'F', '4', '0', '0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0'};
+ writer.Write(header);
+
+
+ // Serialize object
+ SerializeObject(objectToSerialize, null, GetObjectName(objectToSerialize), writer);
+
+
+ // Flush the writer stream
+ writer.Flush();
+
+ // Reset stream position
+ writer.Seek(0, SeekOrigin.Begin);
+ }
+
+ /// <summary>
+ /// Serialize specified object into the binary format.
+ /// Method is called recursively to serialize child objects.
+ /// </summary>
+ /// <param name="objectToSerialize">Object to be serialized.</param>
+ /// <param name="parent">Parent of the serialized object.</param>
+ /// <param name="elementName">Object element name.</param>
+ /// <param name="writer">Binary writer object.</param>
+ virtual internal void SerializeObject(object objectToSerialize, object parent, string elementName, BinaryWriter writer)
+ {
+ // Check input parameters
+ if(objectToSerialize == null)
+ {
+ return;
+ }
+
+ // Check if object should be serialized
+ if(parent != null)
+ {
+ PropertyDescriptor pd = TypeDescriptor.GetProperties(parent)[elementName];
+ if(pd != null)
+ {
+ SerializationVisibilityAttribute styleAttribute = (SerializationVisibilityAttribute)pd.Attributes[typeof(SerializationVisibilityAttribute)];
+ if(styleAttribute != null)
+ {
+ // Hidden property
+ if(styleAttribute.Visibility == SerializationVisibility.Hidden)
+ {
+ return;
+ }
+ }
+ }
+ }
+
+ // Check if object is a collection
+ if(objectToSerialize is ICollection)
+ {
+ // Serialize collection
+ SerializeCollection(objectToSerialize, elementName, writer);
+ return;
+ }
+
+ // Write object ID (hash of the name) into the writer
+ writer.Write(SerializerBase.GetStringHashCode(elementName));
+
+ // Remember position where object data is started
+ long elementStartPosition = writer.Seek(0, SeekOrigin.Current);
+
+ // Retrive properties list of the object
+ ArrayList propNamesList = new ArrayList();
+ PropertyInfo[] properties = objectToSerialize.GetType().GetProperties();
+ if(properties != null)
+ {
+ // Loop through all properties and serialize public properties
+ foreach(PropertyInfo pi in properties)
+ {
+ // Skip inherited properties from the root object
+ if(IsChartBaseProperty(objectToSerialize, parent, pi))
+ {
+ continue;
+ }
+ // Serialize collection
+ if (pi.CanRead && pi.PropertyType.GetInterface("ICollection", true) != null && !this.SerializeICollAsAtribute(pi, objectToSerialize))
+ {
+ bool serialize = IsSerializableContent(pi.Name, objectToSerialize);
+
+ // fixing Axes Array Framework 2.0 side effect
+ // fixed by:DT
+ if (serialize && objectToSerialize != null)
+ {
+ PropertyDescriptor pd = TypeDescriptor.GetProperties(objectToSerialize)[pi.Name];
+ if (pd != null)
+ {
+ SerializationVisibilityAttribute styleAttribute = (SerializationVisibilityAttribute)pd.Attributes[typeof(SerializationVisibilityAttribute)];
+ if (styleAttribute != null)
+ {
+ if (styleAttribute.Visibility == SerializationVisibility.Hidden)
+ {
+ serialize = false;
+ }
+ }
+ }
+ }
+
+ MethodInfo mi = objectToSerialize.GetType().GetMethod("ShouldSerialize" + pi.Name, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
+ if( serialize && mi != null)
+ {
+ object result = mi.Invoke(objectToSerialize, null);
+ if(result is bool && ((bool)result) == false)
+ {
+ // Do not serialize collection
+ serialize = false;
+ }
+ }
+
+ // Serialize collection
+ if(serialize)
+ {
+ propNamesList.Add(pi.Name);
+ SerializeCollection(pi.GetValue(objectToSerialize, null), pi.Name, writer);
+ }
+ }
+
+ // Serialize public properties with Get and Set methods
+ else if(pi.CanRead && pi.CanWrite)
+ {
+ // Skip indexes
+ if(pi.Name == "Item")
+ {
+ continue;
+ }
+ // Check if this property is serializable content
+ if (IsSerializableContent(pi.Name, objectToSerialize))
+ {
+ // Check if an object should be serialized as a property or as a class
+ if (ShouldSerializeAsAttribute(pi, objectToSerialize))
+ {
+ // Serialize property
+ SerializeProperty(pi.GetValue(objectToSerialize, null), objectToSerialize, pi.Name, writer);
+ }
+ else
+ {
+ // Serialize inner object
+ SerializeObject(pi.GetValue(objectToSerialize, null), objectToSerialize, pi.Name, writer);
+ }
+ }
+ propNamesList.Add(pi.Name);
+ }
+ }
+
+ // Check that all properties have unique IDs
+ CheckPropertiesID(propNamesList);
+ }
+
+
+ // If position of the writer did not change - nothing was written
+ if(writer.Seek(0, SeekOrigin.Current) == elementStartPosition)
+ {
+ // Remove object ID from the stream
+ writer.Seek(-2, SeekOrigin.Current);
+ writer.Write((short)0);
+ writer.Seek(-2, SeekOrigin.Current);
+ }
+ else
+ {
+ // Write the end objectTag
+ writer.Write((short)0);
+ }
+
+ return;
+ }
+
+
+ /// <summary>
+ /// Serializes the data point.
+ /// </summary>
+ /// <param name="objectToSerialize">The object to serialize.</param>
+ /// <param name="elementName">Name of the element.</param>
+ /// <param name="writer">The writer.</param>
+ private void SerializeDataPoint(object objectToSerialize, string elementName, BinaryWriter writer)
+ {
+
+ // Write object ID (hash of the name) into the writer
+ writer.Write(SerializerBase.GetStringHashCode(elementName));
+ // Remember position where object data is started
+ long elementStartPosition = writer.Seek(0, SeekOrigin.Current);
+
+ DataPoint dataPoint = objectToSerialize as DataPoint;
+ if (dataPoint.XValue != 0d && IsSerializableContent("XValue", objectToSerialize))
+ {
+ SerializeProperty(dataPoint.XValue, dataPoint, "XValue", writer);
+ }
+ if (dataPoint.YValues.Length > 0 && IsSerializableContent("YValues", objectToSerialize))
+ {
+ SerializeProperty(dataPoint.YValues, dataPoint, "YValues", writer);
+ }
+ if (dataPoint.IsEmpty && IsSerializableContent("IsEmpty", objectToSerialize))
+ {
+ SerializeProperty(dataPoint.IsEmpty, dataPoint, "IsEmpty", writer);
+ }
+ bool hasCustomProperties = false;
+ foreach (DictionaryEntry entry in dataPoint.properties)
+ {
+ if (entry.Key is int)
+ {
+ CommonCustomProperties propertyType = (CommonCustomProperties)((int)entry.Key);
+ String properyName = propertyType.ToString();
+ if (IsSerializableContent(properyName, objectToSerialize))
+ {
+ SerializeProperty(entry.Value, dataPoint, properyName, writer);
+ }
+ }
+ else
+ {
+ hasCustomProperties = true;
+ }
+ }
+
+ if (hasCustomProperties && !String.IsNullOrEmpty(dataPoint.CustomProperties) && IsSerializableContent("CustomProperties", objectToSerialize))
+ {
+ SerializeProperty(dataPoint.CustomProperties, dataPoint, "CustomProperties", writer);
+ }
+
+ // If position of the writer did not change - nothing was written
+ if (writer.Seek(0, SeekOrigin.Current) == elementStartPosition)
+ {
+ // Remove object ID from the stream
+ writer.Seek(-2, SeekOrigin.Current);
+ writer.Write((short)0);
+ writer.Seek(-2, SeekOrigin.Current);
+ }
+ else
+ {
+ // Write the end objectTag
+ writer.Write((short)0);
+ }
+ }
+
+
+ /// <summary>
+ /// Serialize specified object into the binary writer.
+ /// Method is called recursively to serialize child objects.
+ /// </summary>
+ /// <param name="objectToSerialize">Object to be serialized.</param>
+ /// <param name="elementName">Object element name.</param>
+ /// <param name="writer">Binary writer.</param>
+ virtual internal void SerializeCollection(object objectToSerialize, string elementName, BinaryWriter writer)
+ {
+ ICollection collection = objectToSerialize as ICollection;
+ if(collection != null)
+ {
+ // Write object ID (hash of the name) into the writer
+ writer.Write(SerializerBase.GetStringHashCode(elementName));
+
+ // Remember position where object data is started
+ long elementStartPosition = writer.Seek(0, SeekOrigin.Current);
+
+ // Enumerate through all objects in collection and serialize them
+ foreach (object obj in collection)
+ {
+
+ if (obj is DataPoint)
+ {
+ SerializeDataPoint(obj, GetObjectName(obj), writer);
+ continue;
+ }
+
+ SerializeObject(obj, objectToSerialize, GetObjectName(obj), writer);
+ }
+
+ // If position of the writer did not change - nothing was written
+ if(writer.Seek(0, SeekOrigin.Current) == elementStartPosition)
+ {
+ // Remove object ID from the stream
+ writer.Seek(-2, SeekOrigin.Current);
+ writer.Write((short)0);
+ writer.Seek(-2, SeekOrigin.Current);
+ }
+ else
+ {
+ // Write the end objectTag
+ writer.Write((short)0);
+ }
+
+ }
+ }
+
+ /// <summary>
+ /// Serialize specified object into the binary writer.
+ /// Method is called recursively to serialize child objects.
+ /// </summary>
+ /// <param name="objectToSerialize">Object to be serialized.</param>
+ /// <param name="parent">Parent of the serialized object.</param>
+ /// <param name="elementName">Object element name.</param>
+ /// <param name="writer">Binary writer.</param>
+ virtual internal void SerializeProperty(object objectToSerialize, object parent, string elementName, BinaryWriter writer)
+ {
+ // Check input parameters
+ if(objectToSerialize == null || parent == null)
+ {
+ return;
+ }
+
+ // Check if property has non-default value
+ PropertyDescriptor pd = TypeDescriptor.GetProperties(parent)[elementName];
+ if(pd != null)
+ {
+ DefaultValueAttribute defValueAttribute = (DefaultValueAttribute)pd.Attributes[typeof(DefaultValueAttribute)];
+ if(defValueAttribute != null)
+ {
+ if(objectToSerialize.Equals(defValueAttribute.Value))
+ {
+ // Do not serialize properties with default values
+ return;
+ }
+ }
+ else
+ {
+ // Check if property has "ShouldSerialize" method
+ MethodInfo mi = parent.GetType().GetMethod("ShouldSerialize" + elementName, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public );
+ if(mi != null)
+ {
+ object result = mi.Invoke(parent, null);
+ if(result is bool && ((bool)result) == false)
+ {
+ // Do not serialize properties with default values
+ return;
+ }
+ }
+ }
+
+ // Check XmlFormatSerializerStyle attribute
+ SerializationVisibilityAttribute styleAttribute = (SerializationVisibilityAttribute)pd.Attributes[typeof(SerializationVisibilityAttribute)];
+ if(styleAttribute != null)
+ {
+ // Hidden property
+ if(styleAttribute.Visibility == SerializationVisibility.Hidden)
+ {
+ return;
+ }
+ }
+ }
+
+ // Write property
+ WritePropertyValue(objectToSerialize, elementName, writer);
+ }
+
+ /// <summary>
+ /// Converts object value into the string.
+ /// </summary>
+ /// <param name="obj">Object to convert.</param>
+ /// <param name="elementName">Object name.</param>
+ /// <param name="writer">Binary writer.</param>
+ /// <returns>Object value as strig.</returns>
+ [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily",
+ Justification = "Too large of a code change to justify making this change")]
+ internal void WritePropertyValue(object obj, string elementName, BinaryWriter writer)
+ {
+ // Write property ID (hash of the name) into the writer
+ writer.Write(SerializerBase.GetStringHashCode(elementName));
+
+ if(obj is bool)
+ {
+ writer.Write(((bool)obj));
+ }
+ else if(obj is double)
+ {
+ writer.Write(((double)obj));
+ }
+ else if(obj is string)
+ {
+ writer.Write(((string)obj));
+ }
+ else if(obj is int)
+ {
+ writer.Write(((int)obj));
+ }
+ else if(obj is long)
+ {
+ writer.Write(((long)obj));
+ }
+ else if(obj is float)
+ {
+ writer.Write(((float)obj));
+ }
+ else if(obj.GetType().IsEnum)
+ {
+ // NOTE: Using 'ToString' method instead of the 'Enum.GetName' fixes
+ // an issue (#4314 & #4424) with flagged enumerations when there are
+ // more then 1 values set.
+ string enumValue = obj.ToString();
+ writer.Write(enumValue);
+ }
+
+ else if(obj is byte)
+ {
+ // Write as long
+ writer.Write((byte)obj);
+ }
+
+#if !Microsoft_CONTROL
+ else if(obj is Unit)
+ {
+ writer.Write(((Unit)obj).Value);
+ }
+#endif
+
+ else if(obj is Font)
+ {
+ // Write as string
+ writer.Write(SerializerBase.FontToString((Font)obj));
+ }
+
+ else if(obj is Color)
+ {
+ // Write as int
+ writer.Write(((Color)obj).ToArgb());
+ }
+
+ else if(obj is DateTime)
+ {
+ // Write as long
+ writer.Write(((DateTime)obj).Ticks);
+ }
+
+ else if(obj is Size)
+ {
+ // Write as two integers
+ writer.Write(((Size)obj).Width);
+ writer.Write(((Size)obj).Height);
+ }
+
+ else if(obj is double[])
+ {
+ double[] arr = (double[])obj;
+
+ // Write the size of the array (int)
+ writer.Write(arr.Length);
+
+ // Write each element of the array
+ foreach(double d in arr)
+ {
+ writer.Write(d);
+ }
+ }
+
+ else if(obj is Color[])
+ {
+ Color[] arr = (Color[])obj;
+
+ // Write the size of the array (int)
+ writer.Write(arr.Length);
+
+ // Write each element of the array
+ foreach(Color color in arr)
+ {
+ writer.Write(color.ToArgb());
+ }
+ }
+
+ else if(obj is System.Drawing.Image)
+ {
+ // Save image into the memory stream
+ MemoryStream imageStream = new MemoryStream();
+ ((System.Drawing.Image)obj).Save(imageStream, ((System.Drawing.Image)obj).RawFormat);
+
+ // Write the size of the data
+ int imageSize = (int)imageStream.Seek(0, SeekOrigin.End);
+ imageStream.Seek(0, SeekOrigin.Begin);
+ writer.Write(imageSize);
+
+ // Write the data
+ writer.Write(imageStream.ToArray());
+
+ imageStream.Close();
+ }
+
+
+
+ else if(obj is Margins)
+ {
+ // Write as 4 integers
+ writer.Write(((Margins)obj).Top);
+ writer.Write(((Margins)obj).Bottom);
+ writer.Write(((Margins)obj).Left);
+ writer.Write(((Margins)obj).Right);
+ }
+
+
+
+ else
+ {
+ throw (new InvalidOperationException(SR.ExceptionChartSerializerBinaryTypeUnsupported(obj.GetType().ToString())));
+ }
+ }
+
+ /// <summary>
+ /// Checks if all properties will have a unique ID.
+ /// Property ID is a hash of it's name.
+ /// !!!USED IN DEBUG BUILD ONLY!!!
+ /// </summary>
+ /// <param name="propNames">Array of properties names.</param>
+ internal void CheckPropertiesID(ArrayList propNames)
+ {
+#if DEBUG
+ if(propNames != null)
+ {
+ // Loop through all properties and check the hash values
+ foreach(string name1 in propNames)
+ {
+ foreach(string name2 in propNames)
+ {
+ if(name1 != name2)
+ {
+ if( SerializerBase.GetStringHashCode(name1) == SerializerBase.GetStringHashCode(name2) )
+ {
+ throw (new InvalidOperationException(SR.ExceptionChartSerializerBinaryHashCodeDuplicate(name1,name2)));
+ }
+ }
+ }
+ }
+ }
+#endif
+ }
+ #endregion
+
+ #region Deserialization methods
+
+ /// <summary>
+ /// Deserialize specified object from the source using binary format.
+ /// </summary>
+ /// <param name="objectToDeserialize">Object to be deserialized.</param>
+ /// <param name="source">Deserialization source.</param>
+ internal override void Deserialize(object objectToDeserialize, object source)
+ {
+ // Check input parameters
+ if (objectToDeserialize == null)
+ {
+ throw (new ArgumentNullException("objectToDeserialize"));
+ }
+ if (source == null)
+ {
+ throw (new ArgumentNullException("source"));
+ }
+
+ string sourceStr = source as string;
+ if (sourceStr != null)
+ {
+ Deserialize(objectToDeserialize, sourceStr);
+ return;
+ }
+
+ Stream stream = source as Stream;
+ if (stream != null)
+ {
+ Deserialize(objectToDeserialize, stream);
+ return;
+ }
+
+ BinaryWriter binaryWriter = source as BinaryWriter;
+ if (binaryWriter != null)
+ {
+ Deserialize(objectToDeserialize, binaryWriter);
+ return;
+ }
+
+ throw (new ArgumentException(SR.ExceptionChartSerializerSourceObjectInvalid, "source"));
+ }
+
+ /// <summary>
+ /// Deserialize object from the file using binary format.
+ /// </summary>
+ /// <param name="objectToDeserialize">Object to be deserialized.</param>
+ /// <param name="fileName">File name to read the data from.</param>
+ public void Deserialize(object objectToDeserialize, string fileName)
+ {
+ FileStream stream = new FileStream(fileName, FileMode.Open);
+ Deserialize(objectToDeserialize, new BinaryReader(stream));
+ stream.Close();
+ }
+
+ /// <summary>
+ /// Deserialize object from the stream using binary format.
+ /// </summary>
+ /// <param name="objectToDeserialize">Object to be deserialized.</param>
+ /// <param name="stream">Stream to read the data from.</param>
+ public void Deserialize(object objectToDeserialize, Stream stream)
+ {
+ Deserialize(objectToDeserialize, new BinaryReader(stream));
+ }
+
+ /// <summary>
+ /// Deserialize object from different types of readers using binary format.
+ /// </summary>
+ /// <param name="objectToDeserialize">Object to be deserialized.</param>
+ /// <param name="reader">Binary reader.</param>
+ public void Deserialize(object objectToDeserialize, BinaryReader reader)
+ {
+ // Check input parameters
+ if(objectToDeserialize == null)
+ {
+ throw(new ArgumentNullException("objectToDeserialize"));
+ }
+ if(reader == null)
+ {
+ throw(new ArgumentNullException("reader"));
+ }
+
+ // Binary deserializer do not support IsUnknownAttributeIgnored property
+ if(base.IsUnknownAttributeIgnored)
+ {
+ throw (new InvalidOperationException(SR.ExceptionChartSerializerBinaryIgnoreUnknownAttributesUnsupported));
+ }
+
+ // Read 15 characters of file header
+ char[] header = reader.ReadChars(15);
+ if(header[0] != 'D' || header[1] != 'C' || header[2] != 'B' || header[3] != 'F')
+ {
+ throw (new InvalidOperationException(SR.ExceptionChartSerializerBinaryFromatInvalid));
+ }
+
+ // Get ID of the root object
+ this.ReadHashID(reader);
+
+ // Reset properties of the root object
+ if(IsResetWhenLoading)
+ {
+ ResetObjectProperties(objectToDeserialize);
+ }
+
+ // Deserialize object
+ DeserializeObject(objectToDeserialize, null, GetObjectName(objectToDeserialize), reader, false);
+ }
+
+ /// <summary>
+ /// Deserialize object from the binary format.
+ /// Method is called recursively to deserialize child objects.
+ /// </summary>
+ /// <param name="objectToDeserialize">Object to be deserialized.</param>
+ /// <param name="parent">Parent of the deserialized object.</param>
+ /// <param name="elementName">Object element name.</param>
+ /// <param name="reader">Binary reader object.</param>
+ /// <param name="skipElement">if set to <c>true</c> the element will not be set.</param>
+ /// <returns>Number of properties set.</returns>
+ virtual protected int DeserializeObject(object objectToDeserialize, object parent, string elementName, BinaryReader reader, bool skipElement)
+ {
+ int setPropertiesNumber = 0;
+
+ // Check input parameters
+ if(objectToDeserialize == null)
+ {
+ return setPropertiesNumber;
+ }
+
+ // Special handling for the collections
+ Type[] assemblyTypes = null;
+ int listItemIndex = 0;
+
+ IList list = objectToDeserialize as IList;
+
+ if(list != null)
+ {
+ // Loop through all list items
+ Int16 typeHash = 0;
+ PropertyInfo listItemPI = objectToDeserialize.GetType().GetProperty("Item", new Type[] { typeof(int) });
+ while ((typeHash = this.ReadHashID(reader)) != 0)
+ {
+ // Get collection item type from hashed type name
+ string typeName = String.Empty;
+ if(listItemPI != null)
+ {
+ if ((SerializerBase.GetStringHashCode(listItemPI.PropertyType.Name)) == typeHash)
+ {
+ typeName = listItemPI.PropertyType.Name;
+ }
+ else
+ {
+ Assembly assembly = listItemPI.PropertyType.Assembly;
+ if (assembly != null)
+ {
+ // Find all classes derived from this type
+ if (assemblyTypes == null)
+ {
+ assemblyTypes = assembly.GetExportedTypes();
+ }
+ foreach (Type type in assemblyTypes)
+ {
+ if (type.IsSubclassOf(listItemPI.PropertyType))
+ {
+ if ((SerializerBase.GetStringHashCode(type.Name)) == typeHash)
+ {
+ typeName = type.Name;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // Create new item object
+ string itemName = null;
+ bool reusedObject = false;
+ object listItem = GetListNewItem(list, typeName, ref itemName, ref reusedObject);
+
+
+ // Deserialize list item object
+ int itemSetProperties = DeserializeObject(listItem, objectToDeserialize, "", reader, skipElement);
+
+ // Add item object into the list
+ if (!skipElement && (itemSetProperties > 0 || reusedObject))
+ {
+ list.Insert(listItemIndex++, listItem);
+ }
+ // TD: here was removed a code which doesn't work but cause heavy workload: GetListNewItem removes the reusedObject from the list.
+ // Add properties set for collection item
+ setPropertiesNumber += itemSetProperties;
+ }
+
+ return setPropertiesNumber;
+ }
+
+ // Get list of object's properties
+ PropertyInfo[] properties = objectToDeserialize.GetType().GetProperties();
+ if(properties == null)
+ {
+ return setPropertiesNumber;
+ }
+
+ // Get property information by reading the ID
+ PropertyInfo pi = null;
+ while ( (pi = ReadPropertyInfo(objectToDeserialize, parent, properties, reader)) != null)
+ {
+ // Read simple properties
+ if(ShouldSerializeAsAttribute(pi, objectToDeserialize))
+ {
+ if(SetPropertyValue(objectToDeserialize, pi, reader, skipElement))
+ {
+ ++setPropertiesNumber;
+ }
+ }
+
+ else
+ {
+ // Get property descriptor
+ PropertyDescriptor pd = TypeDescriptor.GetProperties(objectToDeserialize)[pi.Name];
+ if(pd != null)
+ {
+ object innerObject = pd.GetValue(objectToDeserialize);
+
+ // Deserialize inner item object
+ setPropertiesNumber += DeserializeObject(innerObject, objectToDeserialize, pi.Name, reader, !IsSerializableContent(pi.Name, objectToDeserialize));
+ }
+ else if(!IsUnknownAttributeIgnored)
+ {
+ throw(new InvalidOperationException(SR.ExceptionChartSerializerPropertyNameUnknown( pi.Name,objectToDeserialize.GetType().ToString())));
+ }
+ }
+ }
+
+ return setPropertiesNumber;
+ }
+
+ /// <summary>
+ /// Reads and sets a property of an object.
+ /// </summary>
+ /// <param name="obj">Object to set.</param>
+ /// <param name="pi">Property information.</param>
+ /// <param name="reader">Binary reader.</param>
+ /// <param name="skipElement">if set to <c>true</c> the property will not be set.</param>
+ /// <returns>True if property was set.</returns>
+ private bool SetPropertyValue(object obj, PropertyInfo pi, BinaryReader reader, bool skipElement)
+ {
+ if(pi != null)
+ {
+ object objValue = null;
+
+
+ if(pi.PropertyType == typeof(bool))
+ {
+ objValue = reader.ReadBoolean();
+ }
+ else if(pi.PropertyType == typeof(double))
+ {
+ objValue = reader.ReadDouble();
+ }
+ else if(pi.PropertyType == typeof(string))
+ {
+ objValue = reader.ReadString();
+ }
+ else if(pi.PropertyType == typeof(int))
+ {
+ objValue = reader.ReadInt32();
+ }
+ else if(pi.PropertyType == typeof(long))
+ {
+ objValue = reader.ReadInt64();
+ }
+ else if(pi.PropertyType == typeof(float))
+ {
+ objValue = reader.ReadSingle();
+ }
+ else if(pi.PropertyType.IsEnum)
+ {
+ // Read as string
+ objValue = Enum.Parse(pi.PropertyType, reader.ReadString());
+ }
+ else if(pi.PropertyType == typeof(byte))
+ {
+ objValue = reader.ReadByte();
+ }
+
+#if !Microsoft_CONTROL
+ else if(pi.PropertyType == typeof(Unit))
+ {
+ objValue = new Unit((double)reader.ReadDouble());
+ }
+#endif
+
+ else if(pi.PropertyType == typeof(Font))
+ {
+ // Read as string
+ objValue = SerializerBase.FontFromString(reader.ReadString());
+ }
+
+ else if(pi.PropertyType == typeof(Color))
+ {
+ // Read as int
+ objValue = Color.FromArgb(reader.ReadInt32());
+ }
+
+ else if(pi.PropertyType == typeof(DateTime))
+ {
+ // Read as long
+ objValue = new DateTime(reader.ReadInt64());
+ }
+
+ else if(pi.PropertyType == typeof(Size))
+ {
+ // Read as two integers
+ objValue = new Size(reader.ReadInt32(), reader.ReadInt32());
+ }
+
+
+
+ else if(pi.PropertyType == typeof(Margins) )
+ {
+ // Read as 4 integers
+ objValue = new Margins(
+ reader.ReadInt32(),
+ reader.ReadInt32(),
+ reader.ReadInt32(),
+ reader.ReadInt32());
+ }
+
+
+
+ else if(pi.PropertyType == typeof(double[]))
+ {
+ // Allocate array
+ double[] array = new double[reader.ReadInt32()];
+
+ // Read each element of the array
+ for(int arrayIndex = 0; arrayIndex < array.Length; arrayIndex++)
+ {
+ array[arrayIndex] = reader.ReadDouble();
+ }
+
+ objValue = array;
+ }
+
+ else if(pi.PropertyType == typeof(Color[]))
+ {
+ // Allocate array
+ Color[] array = new Color[reader.ReadInt32()];
+
+ // Read each element of the array
+ for(int arrayIndex = 0; arrayIndex < array.Length; arrayIndex++)
+ {
+ array[arrayIndex] = Color.FromArgb(reader.ReadInt32());
+ }
+
+ objValue = array;
+ }
+
+ else if(pi.PropertyType == typeof(System.Drawing.Image))
+ {
+ // Get image data size
+ int imageSize = reader.ReadInt32();
+
+ // Create image stream
+ MemoryStream imageStream = new MemoryStream(imageSize + 10);
+
+ // Copy image data into separate stream
+ imageStream.Write(reader.ReadBytes(imageSize), 0, imageSize);
+
+ // Create image object
+ objValue = new Bitmap(System.Drawing.Image.FromStream(imageStream)); // !!! .Net bug when image source stream is closed - can create brush using the image
+
+ // Close image stream
+ imageStream.Close();
+ }
+
+ else
+ {
+ throw(new InvalidOperationException(SR.ExceptionChartSerializerBinaryTypeUnsupported( obj.GetType().ToString() )));
+ }
+
+
+ // Check if this property is serializable content
+ if (!skipElement && IsSerializableContent(pi.Name, obj))
+ {
+ // Set object value
+ pi.SetValue(obj, objValue, null);
+
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /// <summary>
+ /// Reads property ID and return property information
+ /// </summary>
+ /// <param name="objectToDeserialize">Object to be deserialized.</param>
+ /// <param name="parent">Parent of the deserialized object.</param>
+ /// <param name="properties">List of properties information.</param>
+ /// <param name="reader">Binary reader.</param>
+ /// <returns>Property information.</returns>
+ private PropertyInfo ReadPropertyInfo(object objectToDeserialize, object parent, PropertyInfo[] properties, BinaryReader reader)
+ {
+ // Read property ID
+ short propertyID = this.ReadHashID(reader);
+
+ // End objectTag reached
+ if(propertyID == 0)
+ {
+ return null;
+ }
+
+ // Loop through all properties and check properties IDs (hash code of name)
+ foreach(PropertyInfo pi in properties)
+ {
+ // Skip inherited properties from the root object
+ if(IsChartBaseProperty(objectToDeserialize, parent, pi))
+ {
+ continue;
+ }
+
+ // Check collection
+ if (pi.CanRead && pi.PropertyType.GetInterface("ICollection", true) != null)
+ {
+ if((SerializerBase.GetStringHashCode(pi.Name)) == propertyID)
+ {
+ return pi;
+ }
+ }
+
+ // Check public properties with Get and Set methods
+ else if(pi.CanRead && pi.CanWrite)
+ {
+ // Skip indexes
+ if(pi.Name == "Item")
+ {
+ continue;
+ }
+
+ if((SerializerBase.GetStringHashCode(pi.Name)) == propertyID)
+ {
+ return pi;
+ }
+ }
+ }
+
+ // Property was not found
+ throw (new InvalidOperationException(SR.ExceptionChartSerializerPropertyNotFound));
+ }
+
+ #endregion
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/WebForm/AssemblyInfo.cs b/mcs/class/referencesource/System.Web.DataVisualization/WebForm/AssemblyInfo.cs
new file mode 100644
index 00000000000..f6efcda5297
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/WebForm/AssemblyInfo.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Reflection;
+using System.Security;
+using System.Security.Permissions;
+using System.Runtime.CompilerServices;
+using System.Web.UI;
+using System.Runtime.InteropServices;
+using System.Resources;
+
+//
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+//
+[assembly: InternalsVisibleTo("System.Web.DataVisualization.Design, PublicKey=" + AssemblyRef.SharedLibPublicKeyFull)]
+[assembly: TagPrefix("System.Web.UI.DataVisualization.Charting", "asp")]
+
+#if VS_BUILD
+[assembly: AssemblyVersion(ThisAssembly.Version)]
+[assembly: ComVisible(false)]
+[assembly: CLSCompliant(true)]
+[assembly: NeutralResourcesLanguageAttribute("")]
+[assembly: AllowPartiallyTrustedCallers]
+#endif //VS_BUILD
+
+[module: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA900:AptcaAssembliesShouldBeReviewed",
+ Justification = "We have APTCA signoff, for details please refer to SWI Track, Project ID 7972")] \ No newline at end of file
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/WebForm/ChartWebControl.cs b/mcs/class/referencesource/System.Web.DataVisualization/WebForm/ChartWebControl.cs
new file mode 100644
index 00000000000..3046fcd58a2
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/WebForm/ChartWebControl.cs
@@ -0,0 +1,3408 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: WebCustomControl1.cs
+//
+// Namespace: System.Web.UI.DataVisualization.Charting
+//
+// Classes: Chart, TraceManager
+// CustomizeMapAreasEventArgs
+//
+// Purpose: Chart web control main class.
+//
+// Reviewed:
+//
+//===================================================================
+
+#region Used namespaces
+
+using System;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Drawing.Design;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Drawing.Imaging;
+using System.Data;
+using System.Web;
+using System.Net;
+using System.IO;
+using System.Text;
+using System.Reflection;
+using System.Diagnostics.CodeAnalysis;
+
+using System.Collections;
+using System.Diagnostics;
+using System.Xml;
+using System.Web.UI.DataVisualization.Charting;
+using System.Globalization;
+
+using System.Web.UI.DataVisualization.Charting.Data;
+using System.Web.UI.DataVisualization.Charting.Utilities;
+using System.Web.UI.DataVisualization.Charting.ChartTypes;
+using System.Web.UI.DataVisualization.Charting.Borders3D;
+
+using System.Web.UI.DataVisualization.Charting.Formulas;
+using System.Security;
+using System.Security.Permissions;
+
+
+
+#endregion
+
+namespace System.Web.UI.DataVisualization.Charting
+{
+
+ #region Chart enumerations
+
+ /// <summary>
+ /// Chart image storage mode.
+ /// </summary>
+ public enum ImageStorageMode
+ {
+
+ /// <summary>
+ /// Images are stored using HTTP Handler.
+ /// </summary>
+ UseHttpHandler,
+
+ /// <summary>
+ /// Images is saved in temp. file using ImageLocation specified.
+ /// </summary>
+ UseImageLocation
+ }
+
+ /// <summary>
+ /// Specifies the format of the image
+ /// </summary>
+ public enum ChartImageFormat
+ {
+ /// <summary>
+ /// Gets the Joint Photographic Experts Group (JPEG) image format.
+ /// </summary>
+ Jpeg,
+
+ /// <summary>
+ /// Gets the W3C Portable Network Graphics (PNG) image format.
+ /// </summary>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Png")]
+ Png,
+
+ /// <summary>
+ /// Gets the bitmap image format (BMP).
+ /// </summary>
+ Bmp,
+
+ /// <summary>
+ /// Gets the Tag Image File Format (TIFF) image format.
+ /// </summary>
+ Tiff,
+
+ /// <summary>
+ /// Gets the Graphics Interchange Format (GIF) image format.
+ /// </summary>
+ Gif,
+
+ /// <summary>
+ /// Gets the Enhanced Meta File (Emf) image format.
+ /// </summary>
+ Emf,
+
+ /// <summary>
+ /// Gets the Enhanced Meta File (Emf+) image format.
+ /// </summary>
+ EmfPlus,
+
+ /// <summary>
+ /// Gets the Enhanced Meta File (EmfDual) image format.
+ /// </summary>
+ EmfDual,
+ }
+
+ /// <summary>
+ /// Chart image rendering type
+ /// </summary>
+ public enum RenderType
+ {
+ /// <summary>
+ /// Chart image is rendered as image tag.
+ /// </summary>
+ ImageTag,
+
+ /// <summary>
+ /// Chart image is streamed back directly.
+ /// </summary>
+ BinaryStreaming,
+
+ /// <summary>
+ /// Chart image map is rendered.
+ /// </summary>
+ ImageMap
+ }
+
+ #endregion
+
+ /// <summary>
+ /// Summary description for enterprize chart control.
+ /// </summary>
+ [
+ ToolboxData("<{0}:Chart runat=server>" +
+ "<Series><{0}:Series Name=\"Series1\"></{0}:Series></Series>" +
+ "<ChartAreas><{0}:ChartArea Name=\"ChartArea1\"></{0}:ChartArea></ChartAreas>" +
+ "</{0}:Chart>"),
+ ToolboxBitmap(typeof(Chart), "ChartControl.ico"),
+ Designer(Editors.ChartWebDesigner)
+ ]
+ [SuppressMessage("Microsoft.Naming", "CA1724:TypeNamesShouldNotMatchNamespaces")]
+ [DisplayNameAttribute("Chart")]
+ [SupportsEventValidation]
+ [DefaultEvent("Load")]
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class Chart : System.Web.UI.WebControls.DataBoundControl, IPostBackEventHandler
+ {
+
+ #region Control fields
+
+ /// <summary>
+ /// True if smart labels debug markings should be drawn.
+ /// This field is for SmartLabels related issues debugging only.
+ /// </summary>
+ internal bool ShowDebugMarkings = false;
+
+ // Chart services components
+ private ChartTypeRegistry _chartTypeRegistry = null;
+ private BorderTypeRegistry _borderTypeRegistry = null;
+ private CustomPropertyRegistry _customPropertyRegistry = null;
+ private DataManager _dataManager = null;
+ internal ChartImage chartPicture = null;
+ private ImageLoader _imageLoader = null;
+ internal static ITypeDescriptorContext controlCurrentContext = null;
+ internal string webFormDocumentURL = "";
+ internal ServiceContainer serviceContainer = null;
+
+ // Named images collection
+ private NamedImagesCollection _namedImages = null;
+
+
+ private FormulaRegistry _formulaRegistry = null;
+
+
+ // Product ID
+
+ internal static string productID = "MSC-WCE-10";
+
+ // Control license
+ private License _license = null;
+
+ // Private data members, which store properties values
+ private RenderType _renderType = RenderType.ImageTag;
+ private string _chartImageLocation = "ChartPic_#SEQ(300,3)";
+
+ // Indicates that chart is serializing the data
+ internal bool serializing = false;
+
+ // Detailed serialization status which allows not only to determine if serialization
+ // is curently in process but also check if we are saving, loading or resetting the chart.
+ internal SerializationStatus serializationStatus = SerializationStatus.None;
+
+ // Chart serializer
+ private ChartSerializer _chartSerializer = null;
+
+ // Chart content saved in the view state
+ private SerializationContents _viewStateContent = SerializationContents .Default;
+
+ // Image URL the chart will be renderd to
+ private string _currentChartImageLocation = String.Empty;
+
+ // Image Handler URL the chart will be renderd to
+ private string _currentChartHandlerImageLocation = String.Empty;
+
+ // Indicates if unique GUID should be added to image file name to solve cashing issues
+ private bool _addGuidParam = true;
+
+ private KeywordsRegistry _keywordsRegistry = null;
+
+ // Indicates image storage mode.
+ private ImageStorageMode _imageStorageMode = ImageStorageMode.UseHttpHandler;
+
+
+ // Selection class
+ internal Selection selection = null;
+
+ #endregion
+
+ #region Constructors and initialization
+
+ /// <summary>
+ /// Chart control constructor.
+ /// </summary>
+ public Chart() : base()
+ {
+ base.EnableViewState = false;
+
+ //*********************************************************
+ //** Create services
+ //*********************************************************
+ serviceContainer = new ServiceContainer();
+ _chartTypeRegistry = new ChartTypeRegistry();
+ _borderTypeRegistry = new BorderTypeRegistry();
+ _customPropertyRegistry = new CustomPropertyRegistry();
+
+ _keywordsRegistry = new KeywordsRegistry();
+
+ _dataManager = new DataManager(serviceContainer);
+ _imageLoader = new ImageLoader(serviceContainer);
+ chartPicture = new ChartImage(serviceContainer);
+ _chartSerializer = new ChartSerializer(serviceContainer);
+
+
+ _formulaRegistry = new FormulaRegistry();
+
+ // Add services to the service container
+ serviceContainer.AddService(typeof(Chart), this); // Chart Control
+ serviceContainer.AddService(_chartTypeRegistry.GetType(), _chartTypeRegistry);// Chart types registry
+ serviceContainer.AddService(_borderTypeRegistry.GetType(), _borderTypeRegistry);// Border types registry
+ serviceContainer.AddService(_customPropertyRegistry.GetType(), _customPropertyRegistry);// Custom attribute registry
+ serviceContainer.AddService(_dataManager.GetType(), _dataManager); // Data Manager service
+ serviceContainer.AddService(_imageLoader.GetType(), _imageLoader); // Image Loader service
+ serviceContainer.AddService(chartPicture.GetType(), chartPicture); // Chart image service
+ serviceContainer.AddService(_chartSerializer.GetType(), _chartSerializer); // Chart serializer service
+
+
+ serviceContainer.AddService(_formulaRegistry.GetType(), _formulaRegistry); // Formula modules service
+
+
+
+ serviceContainer.AddService(_keywordsRegistry.GetType(), _keywordsRegistry); // Keywords registry
+
+
+
+ // Initialize objects
+ _dataManager.Initialize();
+
+ // Register known chart types
+ _chartTypeRegistry.Register(ChartTypeNames.Bar, typeof(BarChart));
+ _chartTypeRegistry.Register(ChartTypeNames.Column, typeof(ColumnChart));
+ _chartTypeRegistry.Register(ChartTypeNames.Point, typeof(PointChart));
+ _chartTypeRegistry.Register(ChartTypeNames.Bubble, typeof(BubbleChart));
+ _chartTypeRegistry.Register(ChartTypeNames.Line, typeof(LineChart));
+ _chartTypeRegistry.Register(ChartTypeNames.Spline, typeof(SplineChart));
+ _chartTypeRegistry.Register(ChartTypeNames.StepLine, typeof(StepLineChart));
+ _chartTypeRegistry.Register(ChartTypeNames.Area, typeof(AreaChart));
+ _chartTypeRegistry.Register(ChartTypeNames.SplineArea, typeof(SplineAreaChart));
+ _chartTypeRegistry.Register(ChartTypeNames.StackedArea, typeof(StackedAreaChart));
+ _chartTypeRegistry.Register(ChartTypeNames.Pie, typeof(PieChart));
+ _chartTypeRegistry.Register(ChartTypeNames.Stock, typeof(StockChart));
+ _chartTypeRegistry.Register(ChartTypeNames.Candlestick, typeof(CandleStickChart));
+ _chartTypeRegistry.Register(ChartTypeNames.Doughnut, typeof(DoughnutChart));
+ _chartTypeRegistry.Register(ChartTypeNames.StackedBar, typeof(StackedBarChart));
+ _chartTypeRegistry.Register(ChartTypeNames.StackedColumn, typeof(StackedColumnChart));
+ _chartTypeRegistry.Register(ChartTypeNames.OneHundredPercentStackedColumn, typeof(HundredPercentStackedColumnChart));
+ _chartTypeRegistry.Register(ChartTypeNames.OneHundredPercentStackedBar, typeof(HundredPercentStackedBarChart));
+ _chartTypeRegistry.Register(ChartTypeNames.OneHundredPercentStackedArea, typeof(HundredPercentStackedAreaChart));
+
+
+
+ _chartTypeRegistry.Register(ChartTypeNames.Range, typeof(RangeChart));
+ _chartTypeRegistry.Register(ChartTypeNames.SplineRange, typeof(SplineRangeChart));
+ _chartTypeRegistry.Register(ChartTypeNames.RangeBar, typeof(RangeBarChart));
+ _chartTypeRegistry.Register(ChartTypeNames.RangeColumn, typeof(RangeColumnChart));
+ _chartTypeRegistry.Register(ChartTypeNames.ErrorBar, typeof(ErrorBarChart));
+ _chartTypeRegistry.Register(ChartTypeNames.BoxPlot, typeof(BoxPlotChart));
+ _chartTypeRegistry.Register(ChartTypeNames.Radar, typeof(RadarChart));
+
+
+
+ _chartTypeRegistry.Register(ChartTypeNames.Renko, typeof(RenkoChart));
+ _chartTypeRegistry.Register(ChartTypeNames.ThreeLineBreak, typeof(ThreeLineBreakChart));
+ _chartTypeRegistry.Register(ChartTypeNames.Kagi, typeof(KagiChart));
+ _chartTypeRegistry.Register(ChartTypeNames.PointAndFigure, typeof(PointAndFigureChart));
+
+
+
+
+
+ _chartTypeRegistry.Register(ChartTypeNames.Polar, typeof(PolarChart));
+ _chartTypeRegistry.Register(ChartTypeNames.FastLine, typeof(FastLineChart));
+ _chartTypeRegistry.Register(ChartTypeNames.Funnel, typeof(FunnelChart));
+ _chartTypeRegistry.Register(ChartTypeNames.Pyramid, typeof(PyramidChart));
+
+
+
+
+
+ _chartTypeRegistry.Register(ChartTypeNames.FastPoint, typeof(FastPointChart));
+
+
+
+
+ // Register known formula modules
+ _formulaRegistry.Register(SR.FormulaNamePriceIndicators, typeof(PriceIndicators));
+ _formulaRegistry.Register(SR.FormulaNameGeneralTechnicalIndicators, typeof(GeneralTechnicalIndicators));
+ _formulaRegistry.Register(SR.FormulaNameTechnicalVolumeIndicators, typeof(VolumeIndicators));
+ _formulaRegistry.Register(SR.FormulaNameOscillator, typeof(Oscillators));
+ _formulaRegistry.Register(SR.FormulaNameGeneralFormulas, typeof(GeneralFormulas));
+ _formulaRegistry.Register(SR.FormulaNameTimeSeriesAndForecasting, typeof(TimeSeriesAndForecasting));
+ _formulaRegistry.Register(SR.FormulaNameStatisticalAnalysis, typeof(StatisticalAnalysis));
+
+ // Register known 3D border types
+ _borderTypeRegistry.Register("Emboss", typeof(EmbossBorder));
+ _borderTypeRegistry.Register("Raised", typeof(RaisedBorder));
+ _borderTypeRegistry.Register("Sunken", typeof(SunkenBorder));
+ _borderTypeRegistry.Register("FrameThin1", typeof(FrameThin1Border));
+ _borderTypeRegistry.Register("FrameThin2", typeof(FrameThin2Border));
+ _borderTypeRegistry.Register("FrameThin3", typeof(FrameThin3Border));
+ _borderTypeRegistry.Register("FrameThin4", typeof(FrameThin4Border));
+ _borderTypeRegistry.Register("FrameThin5", typeof(FrameThin5Border));
+ _borderTypeRegistry.Register("FrameThin6", typeof(FrameThin6Border));
+ _borderTypeRegistry.Register("FrameTitle1", typeof(FrameTitle1Border));
+ _borderTypeRegistry.Register("FrameTitle2", typeof(FrameTitle2Border));
+ _borderTypeRegistry.Register("FrameTitle3", typeof(FrameTitle3Border));
+ _borderTypeRegistry.Register("FrameTitle4", typeof(FrameTitle4Border));
+ _borderTypeRegistry.Register("FrameTitle5", typeof(FrameTitle5Border));
+ _borderTypeRegistry.Register("FrameTitle6", typeof(FrameTitle6Border));
+ _borderTypeRegistry.Register("FrameTitle7", typeof(FrameTitle7Border));
+ _borderTypeRegistry.Register("FrameTitle8", typeof(FrameTitle8Border));
+
+ // Create selection object
+ this.selection = new Selection(serviceContainer);
+
+ // Create named images collection
+ _namedImages = new NamedImagesCollection();
+
+ // Hook up event handlers
+ ChartAreas.NameReferenceChanged += new EventHandler<NameReferenceChangedEventArgs>(Series.ChartAreaNameReferenceChanged);
+ ChartAreas.NameReferenceChanged += new EventHandler<NameReferenceChangedEventArgs>(Legends.ChartAreaNameReferenceChanged);
+ ChartAreas.NameReferenceChanged += new EventHandler<NameReferenceChangedEventArgs>(Titles.ChartAreaNameReferenceChanged);
+ ChartAreas.NameReferenceChanged += new EventHandler<NameReferenceChangedEventArgs>(Annotations.ChartAreaNameReferenceChanged);
+ Legends.NameReferenceChanged += new EventHandler<NameReferenceChangedEventArgs>(Series.LegendNameReferenceChanged);
+
+ this.AlternateText = String.Empty;
+ this.DescriptionUrl = String.Empty;
+ }
+
+ #endregion
+
+ #region Chart rendering methods
+
+ /// <summary>
+ /// Gets current image URL the chart control will be rendered into.
+ /// </summary>
+ /// <returns>Current chart image URL.</returns>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1055:UriReturnValuesShouldNotBeStrings")]
+ [
+ Bindable(false),
+ Browsable(false),
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
+ SerializationVisibility(SerializationVisibility.Hidden),
+ ]
+ public string CurrentImageLocation
+ {
+ get
+ {
+
+ if (this.RenderType == RenderType.ImageTag && this.GetImageStorageMode() == ImageStorageMode.UseHttpHandler)
+ {
+ return _currentChartHandlerImageLocation;
+ }
+
+ // Image name is already created
+ if (this._currentChartImageLocation.Length > 0)
+ {
+ return this._currentChartImageLocation;
+ }
+
+ // Get picture name
+ this._currentChartImageLocation = this.ImageLocation;
+ int indexUID = -1;
+ if (this.RenderType == RenderType.ImageTag)
+ {
+ // Make sure image URL is not empty
+ if (this.ImageLocation.Length == 0)
+ {
+ throw (new InvalidOperationException(SR.ExceptionImageUrlIsEmpty));
+ }
+ // Add file extension if there is no one
+ char[] slashesArray = { '\\', '/' };
+ int pointIndex = _currentChartImageLocation.LastIndexOf('.');
+ int slashIndex = _currentChartImageLocation.LastIndexOfAny(slashesArray);
+ if (pointIndex < 0 || pointIndex < slashIndex)
+ {
+ switch (chartPicture.ImageType)
+ {
+ case (ChartImageType.Bmp):
+ _currentChartImageLocation += ".bmp";
+ break;
+ case (ChartImageType.Jpeg):
+ _currentChartImageLocation += ".jpeg";
+ break;
+ case (ChartImageType.Png):
+ _currentChartImageLocation += ".png";
+ break;
+ case (ChartImageType.Emf):
+ _currentChartImageLocation += ".emf";
+ break;
+ }
+ }
+
+ // Double chech that #UID is not used with #SEQ
+ // Add GUID to the filename
+ indexUID = _currentChartImageLocation.IndexOf("#UID", StringComparison.Ordinal);
+ int indexSEQ = _currentChartImageLocation.IndexOf("#SEQ", StringComparison.Ordinal);
+ if (indexUID >= 0 && indexSEQ >= 0)
+ {
+ throw (new InvalidOperationException(SR.ExceptionImageUrlInvalidFormatters));
+ }
+
+ // Add GUID to the filename
+ if (indexUID >= 0)
+ {
+ // Replace "#UID" with GUID string
+ _currentChartImageLocation = _currentChartImageLocation.Replace("#UID", Guid.NewGuid().ToString());
+ }
+
+ // Add GUID to the filename
+ else if (indexSEQ >= 0)
+ {
+ // Replace "#SEQ(XXX,XXX)" with the sequence string number
+ _currentChartImageLocation = GetNewSeqImageUrl(_currentChartImageLocation);
+ }
+
+ }
+
+ // Check if GUID parameter should be added to the SRC tag
+ // Solves issue with image caching in IE
+ int indexNoGuidParam = _currentChartImageLocation.IndexOf("#NOGUIDPARAM", StringComparison.Ordinal);
+ if (indexNoGuidParam > 0)
+ {
+ _currentChartImageLocation = _currentChartImageLocation.Replace("#NOGUIDPARAM", "");
+ }
+
+ // Check for virtual root character
+ if (_currentChartImageLocation.StartsWith("~", StringComparison.Ordinal) && HttpContext.Current != null && this.Page.Request != null)
+ {
+ // NOTE: Solves issue #4771
+ _currentChartImageLocation = this.Page.ResolveUrl(_currentChartImageLocation);
+ }
+
+ return _currentChartImageLocation;
+ }
+ }
+
+
+
+ /// <summary>
+ /// Determines if chart should render image maps
+ /// </summary>
+ /// <returns>True if should render image maps</returns>
+ private bool HasImageMaps()
+ {
+ // Render chart image map
+ if (this.RenderType != RenderType.BinaryStreaming && this.IsMapEnabled)
+ {
+ if (this.MapAreas.Count > 0 || this.RenderType == RenderType.ImageMap)
+ {
+ // Render image map
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// Caches the IsImageRendersBorder result.
+ /// </summary>
+ private static int _isImageRendersBorder;
+ /// <summary>
+ /// Checks and returns true if the image renders border. Before Fx 4.0 image control renders border if is not declared.
+ /// After Fx 4.0 this is not by default.
+ /// </summary>
+ /// <returns>True if image control renders border style</returns>
+ private static bool IsImageRendersBorder
+ {
+ get
+ {
+ if (_isImageRendersBorder == 0)
+ {
+ using (StringWriter sw = new StringWriter(CultureInfo.InvariantCulture))
+ {
+ using (HtmlTextWriter w = new HtmlTextWriter(sw))
+ {
+ System.Web.UI.WebControls.Image img = new System.Web.UI.WebControls.Image();
+ img.RenderControl(w);
+ }
+ _isImageRendersBorder = sw.ToString().IndexOf("border", 0, StringComparison.OrdinalIgnoreCase) != -1 ? 1 : -1;
+ }
+ }
+ return _isImageRendersBorder == 1;
+ }
+ }
+
+ /// <summary>
+ /// Custom image control for supporting miage maps.
+ /// </summary>
+ private class CustomImageControl : System.Web.UI.WebControls.Image
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="CustomImageControl"/> class.
+ /// </summary>
+ internal CustomImageControl() : base()
+ {
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance has image map.
+ /// </summary>
+ /// <value>
+ /// <c>true</c> if this instance has image map; otherwise, <c>false</c>.
+ /// </value>
+ internal bool HasImageMap { get; set; }
+
+ /// <summary>
+ /// Adds the attributes of an <see cref="T:System.Web.UI.WebControls.Image"/> to the output stream for rendering on the client.
+ /// </summary>
+ /// <param name="writer">A <see cref="T:System.Web.UI.HtmlTextWriter"/> that contains the output stream to render on the client browser.</param>
+ protected override void AddAttributesToRender(HtmlTextWriter writer)
+ {
+ base.AddAttributesToRender(writer);
+ if (this.HasImageMap)
+ {
+ writer.AddAttribute(HtmlTextWriterAttribute.Usemap, "#"+this.ClientID+"ImageMap", false);
+ }
+ if (!this.Enabled)
+ {
+ writer.AddAttribute(HtmlTextWriterAttribute.Disabled, "disabled");
+ }
+ }
+ }
+
+ /// <summary>
+ /// Builds the image control.
+ /// </summary>
+ /// <param name="chartImageSrc">The chart image SRC.</param>
+ /// <param name="addGuidParameter">if set to <c>true</c> to add GUID parameter.</param>
+ /// <returns>A custom image control with image maps attribute</returns>
+ private CustomImageControl BuildImageControl(string chartImageSrc, bool addGuidParameter)
+ {
+ CustomImageControl htmlImage = new CustomImageControl();
+ htmlImage.ImageUrl = chartImageSrc + (addGuidParameter ? "?" + Guid.NewGuid().ToString() : "");
+ htmlImage.ToolTip = this.ToolTip;
+ htmlImage.CssClass = this.CssClass;
+ htmlImage.AlternateText = this.AlternateText;
+ htmlImage.DescriptionUrl = this.DescriptionUrl;
+ htmlImage.AccessKey = this.AccessKey;
+ htmlImage.TabIndex = this.TabIndex;
+ htmlImage.Enabled = this.IsEnabled;
+ htmlImage.CopyBaseAttributes(this);
+ if (!IsImageRendersBorder)
+ {
+ // set border 0px only if is not declared yet.
+ if ( String.IsNullOrEmpty(htmlImage.Style[HtmlTextWriterStyle.BorderWidth]) &&
+ String.IsNullOrEmpty(htmlImage.Style["border"]) &&
+ String.IsNullOrEmpty(htmlImage.Style["border-width"]))
+ {
+ htmlImage.Style.Value = "border-width:0px;" + htmlImage.Style.Value;
+ }
+ }
+
+ htmlImage.ID = this.ClientID;
+
+ htmlImage.GenerateEmptyAlternateText = true;
+
+ htmlImage.Width = this.Width;
+ htmlImage.Height = this.Height;
+ htmlImage.HasImageMap = this.HasImageMaps();
+
+ return htmlImage;
+ }
+
+ private string _designTimeChart;
+ /// <summary>
+ /// Render this control to the output parameter specified.
+ /// </summary>
+ /// <param name="writer">HTML writer.</param>
+ protected override void Render(HtmlTextWriter writer)
+ {
+ // If by any reason (rudimentary designer host, no designer, embeded in user control, etc)
+ // Render() is called in design mode ( should be handled by control designed )
+ // we render the chart in temp file.
+ if (this.DesignMode)
+ {
+ if (String.IsNullOrEmpty(_designTimeChart))
+ {
+ _designTimeChart = Path.GetTempFileName() + ".bmp";
+ }
+ SaveImage(_designTimeChart, ChartImageFormat.Bmp);
+ using (CustomImageControl imageControl = this.BuildImageControl("file://" + _designTimeChart, false))
+ {
+ imageControl.RenderControl(writer);
+ }
+ return;
+ }
+
+ // Check if GUID parameter should be added to the SRC tag
+ // Solves issue with image caching in IE
+ _addGuidParam = true;
+ int indexNoGuidParam = this.ImageLocation.IndexOf("#NOGUIDPARAM", StringComparison.Ordinal);
+ if(indexNoGuidParam > 0)
+ {
+ _addGuidParam = false;
+ }
+
+ // Get picture name
+ string chartImage = this.CurrentImageLocation;
+
+
+ if (this.RenderType == RenderType.ImageTag)
+ {
+ if (this.GetImageStorageMode() == ImageStorageMode.UseHttpHandler)
+ {
+ using (MemoryStream stream = new MemoryStream())
+ {
+ this.SaveImage(stream);
+ chartImage = ChartHttpHandler.GetChartImageUrl(stream, this.ImageType.ToString());
+ _currentChartHandlerImageLocation = chartImage;
+ }
+ _addGuidParam = false;
+ }
+ else
+ {
+ // Save chart into specified image URL
+ SaveImage(this.Page.MapPath(chartImage));
+ }
+
+ using (CustomImageControl imageControl = this.BuildImageControl(chartImage, _addGuidParam))
+ {
+ imageControl.RenderControl(writer);
+ }
+
+ }
+
+ // Render chart image as image tag + image map
+ else if(this.RenderType == RenderType.ImageMap)
+ {
+
+ // Get chart image (do not save it)
+ chartPicture.PaintOffScreen();
+
+ using (CustomImageControl imageControl = this.BuildImageControl(chartImage, _addGuidParam))
+ {
+ imageControl.RenderControl(writer);
+ }
+
+ }
+ // Render chart using binary data streaming
+ else
+ {
+
+ // Set response content type
+ switch (chartPicture.ImageType)
+ {
+ case (ChartImageType.Bmp):
+ this.Page.Response.ContentType = "image/bmp";
+ break;
+ case (ChartImageType.Jpeg):
+ this.Page.Response.ContentType = "image/jpeg";
+ break;
+ case (ChartImageType.Png):
+ this.Page.Response.ContentType = "image/png";
+ break;
+ }
+
+ this.Page.Response.Charset = "";
+
+ // Save image into the memory stream
+ MemoryStream stream = new MemoryStream();
+ SaveImage(stream);
+ this.Page.Response.BinaryWrite(stream.GetBuffer());
+ }
+
+
+ // Render chart image map
+ if (this.HasImageMaps())
+ {
+ // Render image map
+ chartPicture.WriteChartMapTag(writer, this.ClientID + "ImageMap");
+ }
+
+ // Reset image Url field
+ this._currentChartImageLocation = String.Empty;
+
+ }
+
+
+ /// <summary>
+ /// Checks image URL sequence format.
+ /// </summary>
+ /// <param name="imageURL">Image URL to test.</param>
+ void CheckImageURLSeqFormat(string imageURL)
+ {
+ // Find the begginning of the "#SEQ" formatting string
+ int indexSEQ = imageURL.IndexOf("#SEQ", StringComparison.Ordinal);
+ indexSEQ += 4;
+
+ // The "#SEQ" formatter must be followed by (MMM,TTT), where MMM - max sequence number and TTT - time to live
+ if(imageURL[indexSEQ] != '(')
+ {
+ throw( new ArgumentException(SR.ExceptionImageUrlInvalidFormat, "imageURL"));
+ }
+ // Find closing bracket
+ int indexClosing = imageURL.IndexOf(')', 1);
+ if(indexClosing < 0)
+ {
+ throw (new ArgumentException(SR.ExceptionImageUrlInvalidFormat, "imageURL"));
+ }
+
+ // Get max sequence number and time to live
+ string[] values = imageURL.Substring(indexSEQ + 1, indexClosing - indexSEQ - 1).Split(',');
+ if(values == null || values.Length != 2)
+ {
+ throw (new ArgumentException(SR.ExceptionImageUrlInvalidFormat, "imageURL"));
+ }
+
+ // Make sure all characters are digits
+ foreach(String str in values)
+ {
+ if (String.IsNullOrEmpty(str) || str.Length > 7)
+ {
+ throw (new ArgumentException(SR.ExceptionImageUrlInvalidFormat, "imageURL"));
+ }
+ foreach (Char c in str)
+ {
+ if(!Char.IsDigit(c))
+ {
+ throw( new ArgumentException( SR.ExceptionImageUrlInvalidFormat, "imageURL"));
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Helper function, which returns a new image URL
+ /// using the sequence numbers
+ /// </summary>
+ /// <param name="imageUrl">Image URL format.</param>
+ /// <returns>New image URL.</returns>
+ private string GetNewSeqImageUrl(string imageUrl)
+ {
+ // Initialize image URL max sequence number and image time to live values
+ int maxSeqNumber = 0;
+ int imageTimeToLive = 0;
+ string result = "";
+
+ //*********************************************************
+ //** Check image URL format
+ //*********************************************************
+
+ // Find the begginning of the "#SEQ" formatting string
+ int indexSEQ = imageUrl.IndexOf("#SEQ", StringComparison.Ordinal);
+ if(indexSEQ < 0)
+ {
+ throw( new ArgumentException( SR.ExceptionImageUrlMissedFormatter, "imageUrl"));
+ }
+
+ // Check format
+ CheckImageURLSeqFormat(imageUrl);
+
+ // Copy everything till the beginning of the format in the result string
+ result = imageUrl.Substring(0, indexSEQ);
+ indexSEQ += 4;
+
+ // Find closing bracket
+ int indexClosing = imageUrl.IndexOf(')', 1);
+
+ // Add sequence position and everything after closing bracket into the result string
+ result += "{0:D6}";
+ result += imageUrl.Substring(indexClosing + 1);
+
+ // Get max sequence number and time to live
+ string[] values = imageUrl.Substring(indexSEQ + 1, indexClosing - indexSEQ - 1).Split(',');
+ maxSeqNumber = Int32.Parse(values[0], System.Globalization.CultureInfo.InvariantCulture);
+ imageTimeToLive = Int32.Parse(values[1], System.Globalization.CultureInfo.InvariantCulture);
+
+ //*********************************************************
+ //** Generate new sequence number
+ //*********************************************************
+ int imageSeqNumber = 1;
+
+ // Make sure application scope variable "ImageSeqNumber" exist
+ this.Page.Application.Lock();
+ if(this.Page.Application[Chart.productID+"_ImageSeqNumber"] != null)
+ {
+ imageSeqNumber = (int)this.Page.Application[Chart.productID+"_ImageSeqNumber"] + 1;
+ if(imageSeqNumber > maxSeqNumber)
+ {
+ imageSeqNumber = 1;
+ }
+ }
+ // Save sequence number
+ this.Page.Application[Chart.productID+"_ImageSeqNumber"] = imageSeqNumber;
+ this.Page.Application.UnLock();
+
+ //*********************************************************
+ //** Prepare result string
+ //*********************************************************
+
+ result = String.Format(CultureInfo.InvariantCulture, result, imageSeqNumber);
+
+ //*********************************************************
+ //** Check if the image with this name exsists and it's
+ //** live time is smaller than image time-to-live specified.
+ //** In this case put a warning into the even log.
+ //*********************************************************
+ if(imageTimeToLive > 0)
+ {
+ CheckChartFileTime(result, imageTimeToLive);
+ }
+
+ return result;
+ }
+
+ /// <summary>
+ /// Check if the image with this name exsists and it's
+ /// live time is smaller than image time-to-live specified.
+ /// In this case put a warning into the even log.
+ /// </summary>
+ /// <param name="fileName">File name.</param>
+ /// <param name="imageTimeToLive">Time to live.</param>
+ private void CheckChartFileTime(string fileName, int imageTimeToLive)
+ {
+ //*********************************************************
+ //** Check if the image with this name exsists and it's
+ //** live time is smaller than image time-to-live specified.
+ //** In this case put a warning into the even log.
+ //*********************************************************
+ try
+ {
+ if (imageTimeToLive > 0)
+ {
+ fileName = this.Page.MapPath(fileName);
+ if (File.Exists(fileName))
+ {
+ DateTime fileTime = File.GetLastWriteTime(fileName);
+ if (fileTime.AddMinutes(imageTimeToLive) > DateTime.Now)
+ {
+ const string eventSource = "ChartComponent";
+
+ // Create the source, if it does not already exist.
+ if (!EventLog.SourceExists(eventSource))
+ {
+ EventLog.CreateEventSource(eventSource, "Application");
+ }
+
+ // Create an EventLog instance and assign its source.
+ EventLog eventLog = new EventLog();
+ eventLog.Source = eventSource;
+
+ // Write an informational entry to the event log.
+ TimeSpan timeSpan = DateTime.Now - fileTime;
+ eventLog.WriteEntry(SR.EvenLogMessageChartImageFileTimeToLive(timeSpan.Minutes.ToString(CultureInfo.InvariantCulture)), EventLogEntryType.Warning);
+ }
+ }
+ }
+ }
+ catch (SecurityException)
+ {
+ }
+ catch (ArgumentException)
+ {
+ }
+ catch (InvalidOperationException)
+ {
+ }
+ catch (Win32Exception)
+ {
+ }
+ }
+
+ #endregion
+
+ #region Chart selection methods
+
+ /// <summary>
+ /// This method performs the hit test and returns a HitTestResult objects.
+ /// </summary>
+ /// <param name="x">X coordinate</param>
+ /// <param name="y">Y coordinate</param>
+ /// <returns>Hit test result object</returns>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X and Y are cartesian coordinates and well understood")]
+ public HitTestResult HitTest(int x, int y)
+ {
+ return selection.HitTest(x, y);
+ }
+
+ /// <summary>
+ /// This method performs the hit test and returns a HitTestResult object.
+ /// </summary>
+ /// <param name="x">X coordinate</param>
+ /// <param name="y">Y coordinate</param>
+ /// <param name="ignoreTransparent">Indicates that transparent elements should be ignored.</param>
+ /// <returns>Hit test result object</returns>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X and Y are cartesian coordinates and well understood")]
+ public HitTestResult HitTest(int x, int y, bool ignoreTransparent)
+ {
+ return selection.HitTest(x, y, ignoreTransparent);
+ }
+
+ /// <summary>
+ /// This method performs the hit test and returns a HitTestResult object.
+ /// </summary>
+ /// <param name="x">X coordinate</param>
+ /// <param name="y">Y coordinate</param>
+ /// <param name="requestedElement">Only this chart element will be hit tested.</param>
+ /// <returns>Hit test result object</returns>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X and Y are cartesian coordinates and well understood")]
+ public HitTestResult HitTest(int x, int y, ChartElementType requestedElement)
+ {
+ return selection.HitTest(x, y, requestedElement);
+ }
+
+ /// <summary>
+ /// Call this method to determine the chart element,
+ /// if any, that is located at a point defined by the given X and Y
+ /// coordinates.
+ /// <seealso cref="HitTestResult"/></summary>
+ /// <param name="x">The X coordinate for the point in question.
+ /// Often obtained from a parameter in an event
+ /// (e.g. the X parameter value in the MouseDown event).</param>
+ /// <param name="y">The Y coordinate for the point in question.
+ /// Often obtained from a parameter in an event
+ /// (e.g. the Y parameter value in the MouseDown event).</param>
+ /// <param name="ignoreTransparent">Indicates that transparent
+ /// elements should be ignored.</param>
+ /// <param name="requestedElement">
+ /// An array of type which specify the types
+ /// to test for, on order to filter the result. If omitted checking for
+ /// elementTypes will be ignored and all kind of elementTypes will be
+ /// valid.
+ /// </param>
+ /// <returns>
+ /// A array of <see cref="HitTestResult"/> objects,
+ /// which provides information concerning the chart element
+ /// (if any) that is at the specified location. Result contains at least
+ /// one element, which could be ChartElementType.Nothing.
+ /// The objects in the result are sorted in from top to bottom of
+ /// different layers of control. </returns>
+ /// <remarks>Call this method to determine the gauge element
+ /// (if any) that is located at a specified point. Often this method is used in
+ /// some mouse-related event (e.g. MouseDown)
+ /// to determine what gauge element the end-user clicked on.
+ /// The X and Y mouse coordinates obtained from the
+ /// event parameters are then used for the X and Y parameter
+ /// values of this method call. The returned
+ /// <see cref="HitTestResult"/> object's properties
+ /// can then be used to determine what chart element was clicked on,
+ /// and also provides a reference to the actual object selected (if
+ /// any).</remarks>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X and Y are cartesian coordinates and well understood")]
+ public HitTestResult[] HitTest(int x, int y, bool ignoreTransparent, params ChartElementType[] requestedElement)
+ {
+ return this.selection.HitTest(x, y, ignoreTransparent, requestedElement);
+ }
+
+ /// <summary>
+ /// Gets the chart element outline.
+ /// </summary>
+ /// <param name="chartElement">The chart element.</param>
+ /// <param name="elementType">Type of the element.</param>
+ /// <returns> A <see cref="ChartElementOutline"/> object which contains
+ /// 1) An array of points in absolute coordinates which can be used as outline markers arround this chart element.
+ /// 2) A GraphicsPath for drawing aouline around this chart emenent.
+ /// </returns>
+ /// <remarks>
+ /// If the <paramref name="chartElement"/> is not part of the chart or <paramref name="elementType"/> cannot be combined
+ /// with <paramref name="chartElement"/> then the result will contain empty array of marker points.
+ /// The marker points are sorted clockwise.
+ /// </remarks>
+ public ChartElementOutline GetChartElementOutline(object chartElement, ChartElementType elementType)
+ {
+ return this.selection.GetChartElementOutline(chartElement, elementType);
+ }
+
+ #endregion
+
+ #region Chart image saving methods
+
+ /// <summary>
+ /// Draws chart on the graphics.
+ /// </summary>
+ /// <param name="graphics">Graphics.</param>
+ /// <param name="position">Position to draw in the graphics.</param>
+ public void Paint(Graphics graphics, Rectangle position)
+ {
+ // Change chart size to fit the new position
+ int oldWidth = this.chartPicture.Width;
+ int oldHeight = this.chartPicture.Height;
+ // Save graphics state.
+ GraphicsState transState = graphics.Save();
+ try
+ {
+ this.chartPicture.Width = position.Width;
+ this.chartPicture.Height = position.Height;
+ // Set required transformation
+ graphics.TranslateTransform(position.X, position.Y);
+ // Set printing indicator
+ this.chartPicture.isPrinting = true;
+ // Draw chart
+ this.chartPicture.Paint(graphics, false);
+ // Clear printing indicator
+ this.chartPicture.isPrinting = false;
+
+ }
+ finally
+ {
+ // Restore graphics state.
+ graphics.Restore(transState);
+ // Restore old chart position
+ this.chartPicture.Width = oldWidth;
+ this.chartPicture.Height = oldHeight;
+
+ }
+ }
+
+ /// <summary>
+ /// Saves chart image into the file.
+ /// </summary>
+ /// <param name="imageFileName">Image file name</param>
+ /// <param name="format">Image format.</param>
+ public void SaveImage(string imageFileName, ChartImageFormat format)
+ {
+ // Check arguments
+ if (imageFileName == null)
+ throw new ArgumentNullException("imageFileName");
+
+ // Create file stream for the specified file name
+ FileStream fileStream = new FileStream(imageFileName, FileMode.Create);
+
+ // Save into stream
+ try
+ {
+ SaveImage(fileStream, format);
+ }
+ finally
+ {
+ // Close file stream
+ fileStream.Close();
+ }
+ }
+
+
+ /// <summary>
+ /// Saves chart image into the stream.
+ /// </summary>
+ /// <param name="imageStream">Image stream.</param>
+ /// <param name="format">Image format.</param>
+ public void SaveImage( Stream imageStream, ChartImageFormat format)
+ {
+ // Check arguments
+ if (imageStream == null)
+ throw new ArgumentNullException("imageStream");
+
+ this.chartPicture.isPrinting = true;
+ try
+ {
+ if (format == ChartImageFormat.Emf ||
+ format == ChartImageFormat.EmfDual ||
+ format == ChartImageFormat.EmfPlus)
+ {
+ EmfType emfType = EmfType.EmfOnly;
+ if (format == ChartImageFormat.EmfDual)
+ {
+ emfType = EmfType.EmfPlusDual;
+ }
+ else if (format == ChartImageFormat.EmfPlus)
+ {
+ emfType = EmfType.EmfPlusOnly;
+ }
+
+ // Save into the metafile
+ this.chartPicture.SaveIntoMetafile(imageStream, emfType);
+ }
+ else
+ {
+ // Get chart image
+ System.Drawing.Image chartImage = this.chartPicture.GetImage();
+
+ ImageFormat standardImageFormat = ImageFormat.Png;
+
+ switch (format)
+ {
+ case ChartImageFormat.Bmp:
+ standardImageFormat = ImageFormat.Bmp;
+ break;
+
+ case ChartImageFormat.Gif:
+ standardImageFormat = ImageFormat.Gif;
+ break;
+
+ case ChartImageFormat.Tiff:
+ standardImageFormat = ImageFormat.Tiff;
+ break;
+
+
+ case ChartImageFormat.Jpeg:
+ standardImageFormat = ImageFormat.Jpeg;
+ break;
+ case ChartImageFormat.Png:
+ standardImageFormat = ImageFormat.Png;
+ break;
+
+
+ case ChartImageFormat.Emf:
+ standardImageFormat = ImageFormat.Emf;
+ break;
+ }
+
+ // Save image into the file
+ chartImage.Save(imageStream, standardImageFormat);
+
+ // Dispose image
+ chartImage.Dispose();
+ }
+ }
+ finally
+ {
+ this.chartPicture.isPrinting = false;
+ }
+ }
+
+
+ /// <summary>
+ /// Saves image into the stream. ImageType, Compression and other control properties are used.
+ /// </summary>
+ /// <param name="imageStream">Image stream.</param>
+ public void SaveImage(Stream imageStream)
+ {
+ // Check arguments
+ if (imageStream == null)
+ throw new ArgumentNullException("imageStream");
+
+ //*****************************************************
+ //** Disable validating the license for now....
+ //*****************************************************
+ // ValidateLicense();
+
+ this.chartPicture.isPrinting = true;
+ try
+ {
+
+ // Save into the metafile
+ if( ImageType == ChartImageType.Emf)
+ {
+ this.chartPicture.SaveIntoMetafile(imageStream, EmfType.EmfOnly);
+ return;
+ }
+
+ System.Drawing.Image image = chartPicture.GetImage();
+ // Set image settings
+ ImageCodecInfo imageCodecInfo = null;
+ EncoderParameter encoderParameter = null;
+ EncoderParameters encoderParameters = new EncoderParameters(1);
+
+ // Get image codec information
+ if(ImageType == ChartImageType.Bmp)
+ {
+ imageCodecInfo = GetEncoderInfo("image/bmp");
+ }
+ else if(ImageType == ChartImageType.Jpeg)
+ {
+ imageCodecInfo = GetEncoderInfo("image/jpeg");
+ }
+ else if(ImageType == ChartImageType.Png)
+ {
+ imageCodecInfo = GetEncoderInfo("image/png");
+ }
+
+ // Set image quality
+ encoderParameter = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, (long)100-Compression);
+ encoderParameters.Param[0] = encoderParameter;
+
+ // Save image into the file
+ if(imageCodecInfo == null)
+ {
+ ImageFormat format = (ImageFormat)new ImageFormatConverter().ConvertFromString(ImageType.ToString());
+ image.Save(imageStream, format);
+ }
+ else
+ {
+ image.Save(imageStream, imageCodecInfo, encoderParameters);
+ }
+
+ image.Dispose();
+ }
+ finally
+ {
+ this.chartPicture.isPrinting = false;
+ }
+ }
+
+
+ /// <summary>
+ /// Saves image into the file. ImageType, Compression and other control properties are used.
+ /// </summary>
+ /// <param name="imageFileName">Image file name</param>
+ public void SaveImage(string imageFileName)
+ {
+ // Check arguments
+ if (imageFileName == null)
+ throw new ArgumentNullException("imageFileName");
+
+ // Create file stream for the specified file name
+ FileStream fileStream = new FileStream(imageFileName, FileMode.Create);
+
+ // Save into stream
+ try
+ {
+ SaveImage(fileStream);
+ }
+ finally
+ {
+ // Close file stream
+ fileStream.Close();
+ }
+ }
+
+
+
+
+
+ /// <summary>
+ /// Helper function. Returns image encoder using Mime image type
+ /// </summary>
+ /// <param name="mimeType">Mime image type</param>
+ /// <returns>Image codec</returns>
+ private static ImageCodecInfo GetEncoderInfo(String mimeType)
+ {
+ int j;
+ ImageCodecInfo[] encoders;
+ encoders = ImageCodecInfo.GetImageEncoders();
+ for(j = 0; j < encoders.Length; ++j)
+ {
+ if(encoders[j].MimeType == mimeType)
+ {
+ return encoders[j];
+ }
+ }
+ return null;
+ }
+
+#endregion
+
+ #region Control events
+
+
+ // Defines a key for storing the delegate for the PrePaint event
+ // in the Events list.
+ private static readonly object _prePaintEvent = new object();
+
+ /// <summary>
+ /// Fires after the chart element backround was drawn.
+ /// This event is fired for elements like: ChartPicture, ChartArea and Legend
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeChartEvent_PrePaint")
+ ]
+ public event EventHandler<ChartPaintEventArgs> PrePaint
+ {
+ add { Events.AddHandler(_prePaintEvent, value); }
+ remove { Events.RemoveHandler(_prePaintEvent, value); }
+ }
+
+ // Defines a key for storing the delegate for the PrePaint event
+ // in the Events list.
+ private static readonly object _postPaintEvent = new object();
+
+ /// <summary>
+ /// Fires after chart element was drawn.
+ /// This event is fired for elements like: ChartPicture, ChartArea and Legend
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeChartEvent_PostPaint")
+ ]
+ public event EventHandler<ChartPaintEventArgs> PostPaint
+ {
+ add { Events.AddHandler(_postPaintEvent, value); }
+ remove { Events.RemoveHandler(_postPaintEvent, value); }
+ }
+
+ // Defines a key for storing the delegate for the CustomizeMapAreas event
+ // in the Events list.
+ private static readonly object _customizeMapAreasEvent = new object();
+
+ /// <summary>
+ /// Fires just before the chart image map is rendered. Use this event to customize the map areas items.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeChartEvent_CustomizeMapAreas")
+ ]
+ public event EventHandler<CustomizeMapAreasEventArgs> CustomizeMapAreas
+ {
+ add { Events.AddHandler(_customizeMapAreasEvent, value); }
+ remove { Events.RemoveHandler(_customizeMapAreasEvent, value); }
+ }
+
+
+
+ // Defines a key for storing the delegate for the CustomizeMapAreas event
+ // in the Events list.
+ private static readonly object _customizeEvent = new object();
+ /// <summary>
+ /// Fires just before the chart image is drawn. Use this event to customize the chart picture.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeChartEvent_Customize")
+ ]
+ public event EventHandler Customize
+ {
+ add { Events.AddHandler(_customizeEvent, value); }
+ remove { Events.RemoveHandler(_customizeEvent, value); }
+ }
+
+ // Defines a key for storing the delegate for the CustomizeMapAreas event
+ // in the Events list.
+ private static readonly object _customizeLegendEvent = new object();
+ /// <summary>
+ /// Fires just before the chart legend is drawn. Use this event to customize the chart legend items.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeChartEvent_CustomizeLegend")
+ ]
+ public event EventHandler<CustomizeLegendEventArgs> CustomizeLegend
+ {
+ add { Events.AddHandler(_customizeLegendEvent, value); }
+ remove { Events.RemoveHandler(_customizeLegendEvent, value); }
+ }
+
+ // Defines a key for storing the delegate for the Click event
+ // in the Events list.
+ private static readonly object _clickEvent = new object();
+ /// <summary>
+ /// Occurs when active image map area defined by PostBackValue on Chart control is clicked.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAction"),
+ SRDescription(SR.Keys.DescriptionAttributeChartEvent_Click)
+ ]
+ public event ImageMapEventHandler Click
+ {
+ add { Events.AddHandler(_clickEvent, value); }
+ remove { Events.RemoveHandler(_clickEvent, value); }
+ }
+
+
+ #endregion
+
+ #region Event Handling
+
+
+ /// <summary>
+ /// Invokes delegates registered with the Click event.
+ /// </summary>
+ /// <param name="e"></param>
+ [SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers", MessageId = "0#")]
+ protected virtual void OnClick(ImageMapEventArgs e)
+ {
+ ImageMapEventHandler clickEventDelegate = (ImageMapEventHandler)Events[_clickEvent];
+ if (clickEventDelegate != null)
+ {
+ clickEventDelegate(this, e);
+ }
+ }
+
+
+ /// <summary>
+ /// Raises events for the Chart control when a form is posted back to the server.
+ /// </summary>
+ /// <param name="eventArgument">Event argument.</param>
+ [SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")]
+ protected virtual void RaisePostBackEvent(string eventArgument)
+ {
+ if (!String.IsNullOrEmpty(eventArgument))
+ {
+ this.OnClick(new ImageMapEventArgs(eventArgument));
+ }
+ }
+
+ /// <summary>
+ /// Fires when chart element backround must be drawn.
+ /// This event is fired for elements like: ChatPicture, ChartArea and Legend
+ /// </summary>
+ /// <param name="e">Event arguments.</param>
+ [
+ SRDescription("DescriptionAttributeChart_OnBackPaint")
+ ]
+ [SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers", MessageId = "0#")]
+ protected virtual void OnPrePaint(ChartPaintEventArgs e)
+ {
+ EventHandler<ChartPaintEventArgs> prePaintEventDelegate = (EventHandler<ChartPaintEventArgs>)Events[_prePaintEvent];
+ if (prePaintEventDelegate != null)
+ {
+ prePaintEventDelegate(this, e);
+ }
+ }
+
+ /// <summary>
+ /// Fires when chart element backround must be drawn.
+ /// This event is fired for elements like: ChatPicture, ChartArea and Legend
+ /// </summary>
+ /// <param name="e">Event arguments.</param>
+ internal void CallOnPrePaint(ChartPaintEventArgs e)
+ {
+ this.OnPrePaint(e);
+ }
+
+ /// <summary>
+ /// Fires when chart element must be drawn.
+ /// This event is fired for elements like: ChatPicture, ChartArea and Legend
+ /// </summary>
+ /// <param name="e">Event arguments.</param>
+ [
+ SRDescription("DescriptionAttributeChart_OnPaint")
+ ]
+ [SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers", MessageId = "0#")]
+ protected virtual void OnPostPaint(ChartPaintEventArgs e)
+ {
+ EventHandler<ChartPaintEventArgs> postPaintEventDelegate = (EventHandler<ChartPaintEventArgs>)Events[_postPaintEvent];
+ if (postPaintEventDelegate != null)
+ {
+ postPaintEventDelegate(this, e);
+ }
+ }
+
+ /// <summary>
+ /// Fires when chart element must be drawn.
+ /// This event is fired for elements like: ChatPicture, ChartArea and Legend
+ /// </summary>
+ /// <param name="e">Event arguments.</param>
+ internal void CallOnPostPaint(ChartPaintEventArgs e)
+ {
+ this.OnPostPaint(e);
+ }
+
+ /// <summary>
+ /// Fires when chart image map data is prepared to be rendered.
+ /// </summary>
+ /// <param name="e">The <see cref="System.Web.UI.DataVisualization.Charting.CustomizeMapAreasEventArgs"/> instance containing the event data.</param>
+ [
+ SRDescription("DescriptionAttributeChart_OnCustomizeMapAreas")
+ ]
+ [SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers", MessageId = "0#")]
+ protected virtual void OnCustomizeMapAreas(CustomizeMapAreasEventArgs e)
+ {
+ EventHandler<CustomizeMapAreasEventArgs> customizeMapAreasEventDelegate = (EventHandler<CustomizeMapAreasEventArgs>)Events[_customizeMapAreasEvent];
+ if (customizeMapAreasEventDelegate != null)
+ {
+ customizeMapAreasEventDelegate(this, e);
+ }
+ }
+
+ /// <summary>
+ /// Fires when chart image map data is prepared to be rendered.
+ /// </summary>
+ internal void CallOnCustomizeMapAreas(MapAreasCollection areaItems)
+ {
+ this.OnCustomizeMapAreas(new CustomizeMapAreasEventArgs(areaItems));
+ }
+
+ /// <summary>
+ /// Fires when all chart data is prepared to be customized before drawing.
+ /// </summary>
+ /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
+ [
+ SRDescription("DescriptionAttributeChart_OnCustomize")
+ ]
+ [SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers", MessageId = "0#")]
+ protected virtual void OnCustomize(EventArgs e)
+ {
+ EventHandler customizeEventDelegate = (EventHandler)Events[_customizeEvent];
+ if (customizeEventDelegate != null)
+ {
+ customizeEventDelegate(this, e);
+ }
+ }
+
+ /// <summary>
+ /// Fires when all chart legend data is prepared to be customized before drawing.
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeChart_OnCustomizeLegend")
+ ]
+ [SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers", MessageId = "0#")]
+ protected virtual void OnCustomizeLegend(CustomizeLegendEventArgs e)
+ {
+ EventHandler<CustomizeLegendEventArgs> customizeLegendEventDelegate = (EventHandler<CustomizeLegendEventArgs>)Events[_customizeLegendEvent];
+ if (customizeLegendEventDelegate != null)
+ {
+ customizeLegendEventDelegate(this, e);
+ }
+ }
+
+ /// <summary>
+ /// Event firing helper function.
+ /// </summary>
+ internal void CallOnCustomize()
+ {
+ OnCustomize(EventArgs.Empty);
+ }
+
+ /// <summary>
+ /// Event firing helper function.
+ /// </summary>
+ internal void CallOnCustomizeLegend(LegendItemsCollection legendItems, string legendName)
+ {
+ OnCustomizeLegend(new CustomizeLegendEventArgs(legendItems, legendName));
+ }
+
+ #endregion
+
+ #region View state properties and methods
+
+
+ /// <summary>
+ /// Restores view-state information from a previous page request that was saved by the SaveViewState method.
+ /// </summary>
+ /// <param name="savedState">An Object that represents the control state to be restored.</param>
+ protected override void LoadViewState(object savedState)
+ {
+ // Call the base class
+ base.LoadViewState(savedState);
+
+ // Check if view state is enabled
+ if(this.EnableViewState)
+ {
+
+ // Load chart's data if custom user state data was not set
+ if(this.ViewState["ViewStateData"] != null &&
+ (this.ViewState["CustomUserViewStateData"] == null ||
+ ((string)this.ViewState["CustomUserViewStateData"]) == "false"))
+ {
+ // Set serializable content
+ SerializationContents oldContent = this.Serializer.Content;
+ string oldSerializable = this.Serializer.SerializableContent;
+ string oldNonSerializable = this.Serializer.NonSerializableContent;
+ SerializationFormat oldFormat = this.Serializer.Format;
+ this.Serializer.Content = this.ViewStateContent;
+ this.Serializer.Format = SerializationFormat.Xml;
+
+ // Load data in the chart from the view state
+ StringReader stringReader = new StringReader((string)this.ViewState["ViewStateData"]);
+
+ this.Serializer.Load(stringReader);
+
+ // Remove chart data from view state
+ this.ViewState.Remove("ViewStateData");
+
+ // Restore serializable content
+ this.Serializer.Format = oldFormat;
+ this.Serializer.Content = oldContent;
+ this.Serializer.SerializableContent = oldSerializable;
+ this.Serializer.NonSerializableContent = oldNonSerializable;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Saves any server control view-state changes that have occurred since the time the page was posted back to the server.
+ /// </summary>
+ /// <returns>Returns the server control's current view state. </returns>
+ protected override object SaveViewState()
+ {
+ // Check if view state is enabled
+ if(base.EnableViewState)
+ {
+ // Save chart's data if custom user state data was not set
+ if(this.ViewState["ViewStateData"] == null)
+ {
+ // Set serializable content
+ SerializationContents oldContent = this.Serializer.Content;
+ string oldSerializable = this.Serializer.SerializableContent;
+ string oldNonSerializable = this.Serializer.NonSerializableContent;
+ this.Serializer.Content = this.ViewStateContent;
+
+ // Save data from the chart into the view state
+ StringBuilder stringBuilder = new StringBuilder();
+ StringWriter stringWriter = new StringWriter(stringBuilder, CultureInfo.InvariantCulture);
+ this.Serializer.Save(stringWriter);
+
+ // Put data in view state
+ this.ViewState["ViewStateData"] = (string)stringBuilder.ToString();
+
+ // Remove chart user custom view state flag
+ this.ViewState.Remove("CustomUserViewStateData");
+
+ // Restore serializable content
+ this.Serializer.Content = oldContent;
+ this.Serializer.SerializableContent = oldSerializable;
+ this.Serializer.NonSerializableContent = oldNonSerializable;
+ }
+ // Call base class
+ }
+ return base.SaveViewState();
+ }
+
+
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the control persists its view state.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeViewState"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeChart_EnableViewState"),
+ PersistenceModeAttribute(PersistenceMode.Attribute),
+ DefaultValue(false)
+ ]
+ public override bool EnableViewState
+ {
+ get
+ {
+ return base.EnableViewState;
+ }
+ set
+ {
+ base.EnableViewState = value;
+ }
+ }
+
+
+
+ /// <summary>
+ /// Chart content saved in the view state.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeBehavior"),
+ Bindable(true),
+ DefaultValue(typeof(SerializationContents ), "Default"),
+ SRDescription("DescriptionAttributeChart_ViewStateContent"),
+ Editor(Editors.FlagsEnumUITypeEditor.Editor, Editors.FlagsEnumUITypeEditor.Base)
+ ]
+ public SerializationContents ViewStateContent
+ {
+ get
+ {
+ return _viewStateContent;
+ }
+ set
+ {
+ int result = 0;
+ if (Int32.TryParse(value.ToString(), out result))
+ {
+ throw new ArgumentException(SR.ExceptionEnumInvalid(value.ToString()));
+ }
+ _viewStateContent = value;
+ }
+ }
+
+ /// <summary>
+ /// User defined control state data in XML format.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeViewState"),
+ Browsable(false),
+ Obsolete("ViewStateData has been deprecated. Please investigate Control.ViewState instead."),
+ Bindable(true),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeChart_ViewStateData"),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden),
+ EditorBrowsable(EditorBrowsableState.Never)
+ ]
+ public string ViewStateData
+ {
+ get
+ {
+ return (string)this.ViewState["ViewStateData"];
+ }
+ set
+ {
+ // Set state data
+ this.ViewState["ViewStateData"] = value;
+
+ // Set custom user state data indicator
+ this.ViewState["CustomUserViewStateData"] = "true";
+ }
+ }
+
+
+ #endregion
+
+ #region Control properties
+
+
+
+ /// <summary>
+ /// Indicates that non-critical chart exceptions will be suppressed.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMisc"),
+ DefaultValue(false),
+ SRDescription("DescriptionAttributeSuppressExceptions"),
+ ]
+ public bool SuppressExceptions
+ {
+ set
+ {
+ this.chartPicture.SuppressExceptions = value;
+ }
+ get
+ {
+ return this.chartPicture.SuppressExceptions;
+ }
+ }
+
+
+
+ /// <summary>
+ /// Chart named images collection.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeChart"),
+ Bindable(false),
+ SRDescription("DescriptionAttributeChart_Images"),
+ Browsable(false),
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
+ , EditorBrowsable(EditorBrowsableState.Never)
+ ]
+ public NamedImagesCollection Images
+ {
+ get
+ {
+ return _namedImages;
+ }
+ }
+
+ /// <summary>
+ /// Font property is not used.
+ /// </summary>
+ [
+ Browsable(false),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden)
+ ]
+ public override FontInfo Font
+ {
+ get
+ {
+ return base.Font;
+ }
+ }
+
+ /// <summary>
+ /// Chart rendering type. Image tag, input tag, binary data streaming and image map are the options.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeImage"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeChart_RenderType"),
+ PersistenceModeAttribute(PersistenceMode.Attribute),
+ DefaultValue(RenderType.ImageTag)
+ ]
+ public RenderType RenderType
+ {
+ get
+ {
+ return _renderType;
+ }
+ set
+ {
+ _renderType = value;
+
+ if(_renderType == RenderType.ImageMap && this.IsMapEnabled == false)
+ {
+ this.IsMapEnabled = true;
+ }
+ }
+ }
+
+
+
+ /// <summary>
+ /// Location where chart image is saved, when image tag is used for rendering.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeImage"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeChart_ImageUrl"),
+ PersistenceModeAttribute(PersistenceMode.Attribute),
+ DefaultValue("ChartPic_#SEQ(300,3)"),
+ Editor(Editors.ImageValueEditor.Editor, Editors.ImageValueEditor.Base)
+ ]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")]
+ public string ImageLocation
+ {
+ get
+ {
+ return _chartImageLocation;
+ }
+ set
+ {
+ // Find the begginning of the "#SEQ" formatting string
+ int indexSEQ = value.IndexOf("#SEQ", StringComparison.Ordinal);
+ if(indexSEQ > 0)
+ {
+ // Check format
+ CheckImageURLSeqFormat(value);
+ }
+ _chartImageLocation = value;
+ }
+ }
+
+ // VSTS 96787-Text Direction (RTL/LTR)
+
+ /// <summary>
+ /// Indicates whether the control should draw right-to-left for RTL languages.
+ /// <seealso cref="AntiAliasing"/>
+ /// </summary>
+ /// <value>
+ /// One of the <see cref="System.Windows.Forms.RightToLeft"/> values. The default is
+ /// <b>RightToLeft.No</b>.
+ /// </value>
+ /// <remarks>This property affects the direction of legend color keys.</remarks>
+ [
+ Category("Appearance"),
+ SRDescription("DescriptionAttributeRightToLeft"),
+ PersistenceMode(PersistenceMode.Attribute),
+ DefaultValue(RightToLeft.No)
+ ]
+ public RightToLeft RightToLeft
+ {
+ get
+ {
+ return this.chartPicture.RightToLeft;
+ }
+ set
+ {
+ this.chartPicture.RightToLeft = value;
+ }
+ }
+
+ #endregion
+
+ #region Data Manager Properties
+
+ /// <summary>
+ /// Chart series collection.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeChart"),
+ SRDescription("DescriptionAttributeChart_Series"),
+ PersistenceModeAttribute(PersistenceMode.InnerProperty),
+ Editor(Editors.SeriesCollectionEditor.Editor, Editors.SeriesCollectionEditor.Base),
+#if !Microsoft_CONTROL
+ Themeable(false)
+#endif
+ ]
+ public SeriesCollection Series
+ {
+ get
+ {
+ return _dataManager.Series;
+ }
+ }
+
+ /// <summary>
+ /// Color palette to use
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ SRDescription("DescriptionAttributePalette"),
+ PersistenceModeAttribute(PersistenceMode.Attribute),
+ DefaultValue(ChartColorPalette.BrightPastel),
+ Editor(Editors.ColorPaletteEditor.Editor, Editors.ColorPaletteEditor.Base)
+ ]
+ public ChartColorPalette Palette
+ {
+ get
+ {
+ return _dataManager.Palette;
+ }
+ set
+ {
+ _dataManager.Palette = value;
+ }
+ }
+
+
+
+ /// <summary>
+ /// Array of custom palette colors.
+ /// </summary>
+ /// <remarks>
+ /// When this custom colors array is non-empty the <b>Palette</b> property is ignored.
+ /// </remarks>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ SerializationVisibilityAttribute(SerializationVisibility.Attribute),
+ SRDescription("DescriptionAttributeChart_PaletteCustomColors"),
+ TypeConverter(typeof(ColorArrayConverter))
+ ]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
+ public Color[] PaletteCustomColors
+ {
+ set
+ {
+ this._dataManager.PaletteCustomColors = value;
+ }
+ get
+ {
+ return this._dataManager.PaletteCustomColors;
+ }
+ }
+
+ /// <summary>
+ /// Method resets custom colors array. Internal use only.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ internal void ResetPaletteCustomColors()
+ {
+ this.PaletteCustomColors = new Color[0];
+ }
+
+ /// <summary>
+ /// Method resets custom colors array. Internal use only.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ internal bool ShouldSerializePaletteCustomColors()
+ {
+ if(this.PaletteCustomColors == null ||
+ this.PaletteCustomColors.Length == 0)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+
+ #endregion
+
+ #region Chart Properties
+
+
+ /// <summary>
+ /// "The data source used to populate series data. Series ValueMember properties must be also set."
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeDataSource"),
+ PersistenceModeAttribute(PersistenceMode.Attribute),
+ DefaultValue(null),
+ TypeConverter(typeof(ChartDataSourceConverter)),
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden)
+ ]
+ public override object DataSource
+ {
+ get
+ {
+ return base.DataSource;
+ }
+ set
+ {
+ base.DataSource = value;
+ chartPicture.DataSource = value;
+ }
+ }
+
+ /// <summary>
+ /// Build number of the control
+ /// </summary>
+ [
+ SRDescription("DescriptionAttributeChart_BuildNumber"),
+ Browsable(false),
+ EditorBrowsable(EditorBrowsableState.Never),
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
+ DefaultValue("")
+ ]
+ public string BuildNumber
+ {
+ get
+ {
+ // Get build number from the assembly
+ string buildNumber = String.Empty;
+ Assembly assembly = Assembly.GetExecutingAssembly();
+ if(assembly != null)
+ {
+ buildNumber = assembly.FullName.ToUpper(CultureInfo.InvariantCulture);
+ int versionIndex = buildNumber.IndexOf("VERSION=", StringComparison.Ordinal);
+ if(versionIndex >= 0)
+ {
+ buildNumber = buildNumber.Substring(versionIndex + 8);
+ }
+ versionIndex = buildNumber.IndexOf(",", StringComparison.Ordinal);
+ if(versionIndex >= 0)
+ {
+ buildNumber = buildNumber.Substring(0, versionIndex);
+ }
+ }
+ return buildNumber;
+ }
+ }
+
+ /// <summary>
+ /// Chart serializer object.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeSerializer"),
+ SRDescription("DescriptionAttributeChart_Serializer"),
+ Browsable(false),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden)
+ ]
+ public ChartSerializer Serializer
+ {
+ get
+ {
+ return _chartSerializer;
+ }
+ }
+
+
+
+ /// <summary>
+ /// Image type (Jpeg, BMP, Png, Svg, Flash)
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeImage"),
+ Bindable(true),
+ DefaultValue(ChartImageType.Png),
+ SRDescription("DescriptionAttributeChartImageType"),
+ PersistenceMode(PersistenceMode.Attribute),
+ RefreshProperties(RefreshProperties.All)
+ ]
+ public ChartImageType ImageType
+ {
+ get
+ {
+ return chartPicture.ImageType;
+ }
+ set
+ {
+ chartPicture.ImageType = value;
+ }
+ }
+
+ /// <summary>
+ /// Image compression value
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeImage"),
+ Bindable(true),
+ DefaultValue(0),
+ SRDescription("DescriptionAttributeChart_Compression"),
+ PersistenceMode(PersistenceMode.Attribute)
+ ]
+ public int Compression
+ {
+ get
+ {
+ return chartPicture.Compression;
+ }
+ set
+ {
+ chartPicture.Compression = value;
+ }
+ }
+
+ /*
+ * Disabled until we get responce from Microsoft
+ * --- Alex
+ *
+ /// <summary>
+ /// Gif image transparent color
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeImage"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ Description("Gif image transparent color."),
+ PersistenceMode(PersistenceMode.Attribute),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ ]
+ public Color TransparentColor
+ {
+ get
+ {
+ return chartPicture.TransparentColor;
+ }
+ set
+ {
+ chartPicture.TransparentColor = value;
+ }
+ }
+ */
+ #endregion
+
+ #region Chart Image Properties
+
+ /// <summary>
+ /// Indicates that chart image map is enabled.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMap"),
+ Bindable(true),
+ SRDescription(SR.Keys.DescriptionAttributeIsMapAreaAttributesEncoded),
+ PersistenceModeAttribute(PersistenceMode.Attribute),
+ DefaultValue(false)
+ ]
+ public bool IsMapAreaAttributesEncoded { get; set; }
+
+
+ /// <summary>
+ /// Indicates that chart image map is enabled.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMap"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeMapEnabled"),
+ PersistenceModeAttribute(PersistenceMode.Attribute),
+ DefaultValue(true)
+ ]
+ public bool IsMapEnabled
+ {
+ get
+ {
+ return chartPicture.IsMapEnabled;
+ }
+ set
+ {
+ chartPicture.IsMapEnabled = value;
+ }
+ }
+
+ /// <summary>
+ /// Chart map areas collection.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeMap"),
+ SRDescription("DescriptionAttributeMapAreas"),
+ PersistenceModeAttribute(PersistenceMode.InnerProperty),
+ Editor(Editors.ChartCollectionEditor.Editor, Editors.ChartCollectionEditor.Base)
+ ]
+ public MapAreasCollection MapAreas
+ {
+ get
+ {
+ return chartPicture.MapAreas;
+ }
+ }
+
+ /// <summary>
+ /// Specifies whether smoothing (antialiasing) is applied while drawing chart.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeImage"),
+ Bindable(true),
+ DefaultValue(typeof(AntiAliasingStyles), "All"),
+ SRDescription("DescriptionAttributeAntiAlias"),
+ PersistenceMode(PersistenceMode.Attribute),
+ Editor(Editors.FlagsEnumUITypeEditor.Editor, Editors.FlagsEnumUITypeEditor.Base)
+ ]
+ public AntiAliasingStyles AntiAliasing
+ {
+ get
+ {
+ return chartPicture.AntiAliasing;
+ }
+ set
+ {
+ chartPicture.AntiAliasing = value;
+ }
+ }
+
+ /// <summary>
+ /// Specifies the quality of text antialiasing.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeImage"),
+ Bindable(true),
+ DefaultValue(typeof(TextAntiAliasingQuality), "High"),
+ SRDescription("DescriptionAttributeTextAntiAliasingQuality"),
+#if !Microsoft_CONTROL
+ PersistenceMode(PersistenceMode.Attribute)
+#endif
+ ]
+ public TextAntiAliasingQuality TextAntiAliasingQuality
+ {
+ get
+ {
+ return chartPicture.TextAntiAliasingQuality;
+ }
+ set
+ {
+ chartPicture.TextAntiAliasingQuality = value;
+ }
+ }
+
+ /// <summary>
+ /// Specifies whether smoothing is applied while drawing shadows.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeImage"),
+ Bindable(true),
+ DefaultValue(true),
+ SRDescription("DescriptionAttributeChart_SoftShadows"),
+ PersistenceMode(PersistenceMode.Attribute)
+ ]
+ public bool IsSoftShadows
+ {
+ get
+ {
+ return chartPicture.IsSoftShadows;
+ }
+ set
+ {
+ chartPicture.IsSoftShadows = value;
+ }
+ }
+
+ /// <summary>
+ /// Reference to chart area collection
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeChart"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeChartAreas"),
+ PersistenceMode(PersistenceMode.InnerProperty),
+ Editor(Editors.ChartCollectionEditor.Editor, Editors.ChartCollectionEditor.Base)
+ ]
+ public ChartAreaCollection ChartAreas
+ {
+ get
+ {
+ return chartPicture.ChartAreas;
+ }
+ }
+
+ /// <summary>
+ /// Back ground color for the Chart
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), "White"),
+ SRDescription("DescriptionAttributeBackColor"),
+ PersistenceMode(PersistenceMode.Attribute),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ ]
+ public override Color BackColor
+ {
+ get
+ {
+ return chartPicture.BackColor;
+ }
+ set
+ {
+ chartPicture.BackColor = value;
+ }
+ }
+
+ /// <summary>
+ /// Fore color propery (not used)
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(false),
+ Browsable(false),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeChart_ForeColor"),
+ PersistenceMode(PersistenceMode.Attribute),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ ]
+ public override Color ForeColor
+ {
+ get
+ {
+ return Color.Empty;
+ }
+ set
+ {
+ }
+ }
+
+ /// <summary>
+ /// Chart width
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeImage"),
+ Bindable(true),
+ DefaultValue(typeof(Unit), "300"),
+ SRDescription("DescriptionAttributeWidth"),
+ PersistenceMode(PersistenceMode.Attribute)
+ ]
+ public override Unit Width
+ {
+ get
+ {
+ return new Unit(chartPicture.Width);
+ }
+ set
+ {
+ if(value.Type != UnitType.Pixel)
+ {
+ throw (new ArgumentException(SR.ExceptionChartWidthIsNotInPixels));
+ }
+ chartPicture.Width = (int)value.Value;
+ }
+ }
+
+ /// <summary>
+ /// Chart legend collection.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeChart"),
+ SRDescription("DescriptionAttributeLegends"),
+ PersistenceMode(PersistenceMode.InnerProperty),
+ Editor(Editors.LegendCollectionEditor.Editor, Editors.LegendCollectionEditor.Base),
+ ]
+ public LegendCollection Legends
+ {
+ get
+ {
+ return chartPicture.Legends;
+ }
+ }
+
+ /// <summary>
+ /// Chart title collection.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeChart"),
+ SRDescription("DescriptionAttributeTitles"),
+ Editor(Editors.ChartCollectionEditor.Editor, Editors.ChartCollectionEditor.Base),
+ PersistenceMode(PersistenceMode.InnerProperty),
+ ]
+ public TitleCollection Titles
+ {
+ get
+ {
+ return chartPicture.Titles;
+ }
+ }
+
+
+ /// <summary>
+ /// Chart annotation collection.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeChart"),
+ SRDescription("DescriptionAttributeAnnotations3"),
+ Editor(Editors.AnnotationCollectionEditor.Editor, Editors.AnnotationCollectionEditor.Base),
+ PersistenceMode(PersistenceMode.InnerProperty),
+ ]
+ public AnnotationCollection Annotations
+ {
+ get
+ {
+ return chartPicture.Annotations;
+ }
+ }
+
+
+ /// <summary>
+ /// Series data manipulator
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeData"),
+ SRDescription("DescriptionAttributeDataManipulator"),
+ Browsable(false),
+ DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
+ SerializationVisibilityAttribute(SerializationVisibility.Hidden)
+ ]
+ public DataManipulator DataManipulator
+ {
+ get
+ {
+ return chartPicture.DataManipulator;
+ }
+ }
+
+
+ /// <summary>
+ /// Chart height
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeImage"),
+ Bindable(true),
+ DefaultValue(typeof(Unit), "300"),
+ SRDescription("DescriptionAttributeHeight3"),
+ PersistenceMode(PersistenceMode.Attribute)
+ ]
+ public override Unit Height
+ {
+ get
+ {
+ return new Unit(chartPicture.Height);
+ }
+ set
+ {
+ if(value.Type != UnitType.Pixel)
+ {
+ throw (new ArgumentException(SR.ExceptionChartHeightIsNotInPixels));
+ }
+ chartPicture.Height = (int)value.Value;
+ }
+ }
+
+
+ /// <summary>
+ /// Back Hatch style
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartHatchStyle.None),
+ SRDescription("DescriptionAttributeBackHatchStyle"),
+ PersistenceMode(PersistenceMode.Attribute),
+ Editor(Editors.HatchStyleEditor.Editor, Editors.HatchStyleEditor.Base)
+ ]
+ public ChartHatchStyle BackHatchStyle
+ {
+ get
+ {
+ return chartPicture.BackHatchStyle;
+ }
+ set
+ {
+ chartPicture.BackHatchStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Chart area background image
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(""),
+ SRDescription("DescriptionAttributeBackImage"),
+ PersistenceMode(PersistenceMode.Attribute),
+ NotifyParentPropertyAttribute(true),
+ Editor(Editors.UrlValueEditor.Editor, Editors.UrlValueEditor.Base)
+ ]
+ public string BackImage
+ {
+ get
+ {
+ return chartPicture.BackImage;
+ }
+ set
+ {
+ chartPicture.BackImage = value;
+ }
+ }
+
+ /// <summary>
+ /// Chart area background image drawing mode.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartImageWrapMode.Tile),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeImageWrapMode"),
+ PersistenceMode(PersistenceMode.Attribute)
+ ]
+ public ChartImageWrapMode BackImageWrapMode
+ {
+ get
+ {
+ return chartPicture.BackImageWrapMode;
+ }
+ set
+ {
+ chartPicture.BackImageWrapMode = value;
+ }
+ }
+
+ /// <summary>
+ /// Background image transparent color.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeImageTransparentColor"),
+ PersistenceMode(PersistenceMode.Attribute),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ ]
+ public Color BackImageTransparentColor
+ {
+ get
+ {
+ return chartPicture.BackImageTransparentColor;
+ }
+ set
+ {
+ chartPicture.BackImageTransparentColor = value;
+ }
+ }
+
+ /// <summary>
+ /// Background image alignment used by ClampUnscale drawing mode.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartImageAlignmentStyle.TopLeft),
+ NotifyParentPropertyAttribute(true),
+ SRDescription("DescriptionAttributeBackImageAlign"),
+ PersistenceMode(PersistenceMode.Attribute)
+ ]
+ public ChartImageAlignmentStyle BackImageAlignment
+ {
+ get
+ {
+ return chartPicture.BackImageAlignment;
+ }
+ set
+ {
+ chartPicture.BackImageAlignment = value;
+ }
+ }
+
+ /// <summary>
+ /// A type for the background gradient
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(GradientStyle.None),
+ SRDescription("DescriptionAttributeBackGradientStyle"),
+ PersistenceMode(PersistenceMode.Attribute),
+ Editor(Editors.GradientEditor.Editor, Editors.GradientEditor.Base)
+ ]
+ public GradientStyle BackGradientStyle
+ {
+ get
+ {
+ return chartPicture.BackGradientStyle;
+ }
+ set
+ {
+ chartPicture.BackGradientStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// The second color which is used for a gradient
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), ""),
+ SRDescription("DescriptionAttributeBackSecondaryColor"),
+ PersistenceMode(PersistenceMode.Attribute),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ ]
+ public Color BackSecondaryColor
+ {
+ get
+ {
+ return chartPicture.BackSecondaryColor;
+ }
+ set
+ {
+ chartPicture.BackSecondaryColor = value;
+ }
+ }
+
+
+ /// <summary>
+ /// Gets or sets the border color of the Chart.
+ /// </summary>
+ [
+ Browsable(false),
+ EditorBrowsable(EditorBrowsableState.Never)
+ ]
+ public override Color BorderColor
+ {
+ get { return base.BorderColor; }
+ set { base.BorderColor = value; }
+ }
+
+ /// <summary>
+ /// Gets or sets the border width of the Chart.
+ /// </summary>
+ [
+ Browsable(false),
+ EditorBrowsable(EditorBrowsableState.Never)
+ ]
+ public override Unit BorderWidth
+ {
+ get { return base.BorderWidth;}
+ set { base.BorderWidth = value;}
+ }
+
+ /// <summary>
+ /// Gets or sets the border style of the Chart.
+ /// </summary>
+ [
+ Browsable(false),
+ EditorBrowsable(EditorBrowsableState.Never)
+ ]
+ public override BorderStyle BorderStyle
+ {
+ get { return base.BorderStyle; }
+ set { base.BorderStyle = value; }
+ }
+
+
+ /// <summary>
+ /// Border line color for the Chart
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(typeof(Color), "White"),
+ SRDescription("DescriptionAttributeBorderColor"),
+ PersistenceMode(PersistenceMode.Attribute),
+ TypeConverter(typeof(ColorConverter)),
+ Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
+ ]
+ public Color BorderlineColor
+ {
+ get
+ {
+ return chartPicture.BorderColor;
+ }
+ set
+ {
+ chartPicture.BorderColor = value;
+ }
+ }
+
+ /// <summary>
+ /// The width of the border line
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(1),
+ SRDescription("DescriptionAttributeChart_BorderlineWidth"),
+ PersistenceMode(PersistenceMode.Attribute)
+ ]
+ public int BorderlineWidth
+ {
+ get
+ {
+ return chartPicture.BorderWidth;
+ }
+ set
+ {
+ chartPicture.BorderWidth = value;
+ }
+ }
+
+ /// <summary>
+ /// The style of the border line
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(ChartDashStyle.NotSet),
+ SRDescription("DescriptionAttributeBorderDashStyle"),
+ PersistenceMode(PersistenceMode.Attribute)
+ ]
+ public ChartDashStyle BorderlineDashStyle
+ {
+ get
+ {
+ return chartPicture.BorderDashStyle;
+ }
+ set
+ {
+ chartPicture.BorderDashStyle = value;
+ }
+ }
+
+ /// <summary>
+ /// Chart border skin style.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeAppearance"),
+ Bindable(true),
+ DefaultValue(BorderSkinStyle.None),
+ SRDescription("DescriptionAttributeBorderSkin"),
+ PersistenceMode(PersistenceMode.InnerProperty),
+ NotifyParentProperty(true),
+ TypeConverterAttribute(typeof(LegendConverter)),
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Content)
+ ]
+ public BorderSkin BorderSkin
+ {
+ get
+ {
+ return chartPicture.BorderSkin;
+ }
+ set
+ {
+ chartPicture.BorderSkin = value;
+ }
+ }
+
+ /// <summary>
+ /// When overridden in a derived class, gets or sets the alternate text displayed in the Chart control when the chart image is unavailable.
+ /// </summary>
+ [
+ Bindable(true),
+ SRDescription(SR.Keys.DescriptionAttributeChartImageAlternateText),
+ Localizable(true),
+ SRCategory(SR.Keys.CategoryAttributeAppearance),
+ DefaultValue("")
+ ]
+ public string AlternateText { get; set; }
+
+ /// <summary>
+ /// When overridden in a derived class, gets or sets the location to a detailed description for the chart.
+ /// </summary>
+ [
+ Bindable(true),
+ SRDescription(SR.Keys.DescriptionAttributeChartImageDescriptionUrl),
+ Localizable(true),
+ SRCategory(SR.Keys.CategoryAttributeAccessibility),
+ DefaultValue(""),
+ UrlProperty,
+ Editor(Editors.UrlValueEditor.Editor, Editors.UrlValueEditor.Base),
+ SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")
+ ]
+ public string DescriptionUrl { get; set; }
+
+ #endregion
+
+ #region Control public methods
+
+ /// <summary>
+ /// Creates the HTML text writer.
+ /// </summary>
+ /// <param name="tw">The inner text writer.</param>
+ /// <returns></returns>
+ private HtmlTextWriter CreateHtmlTextWriter(TextWriter tw)
+ {
+ if (((this.Context != null) && (this.Context.Request != null)) && (this.Context.Request.Browser != null))
+ {
+ return this.Context.Request.Browser.CreateHtmlTextWriter(tw);
+ }
+ return new Html32TextWriter(tw);
+ }
+
+ /// <summary>
+ /// Gets HTML image map of the currently rendered chart.
+ /// Save(...) method MUST be called before calling this method!
+ /// </summary>
+ /// <param name="name">Name of the image map tag.</param>
+ /// <returns>HTML image map.</returns>
+ public string GetHtmlImageMap(string name)
+ {
+ // Check arguments
+ if (name == null)
+ throw new ArgumentNullException("name");
+
+ using (StringWriter swriter = new StringWriter(CultureInfo.InvariantCulture))
+ {
+ using (HtmlTextWriter writer = CreateHtmlTextWriter(swriter))
+ {
+ this.chartPicture.WriteChartMapTag(writer, name);
+ return swriter.GetStringBuilder().ToString();
+ }
+ }
+ }
+
+
+ /// <summary>
+ /// Saves the current state of the chart to an XML file. This is
+ /// mainly used for support purposes. The executing thread must have
+ /// file write permission
+ /// </summary>
+ /// <param name="name">File path and name to save.</param>
+ public void SaveXml(string name)
+ {
+ try
+ {
+ this.Serializer.Save(name);
+ }
+ catch(XmlException)
+ { }
+ }
+
+
+ /// <summary>
+ /// Loads chart appearance template from file.
+ /// </summary>
+ /// <param name="name">Template file name to load from.</param>
+ public void LoadTemplate(string name)
+ {
+ chartPicture.LoadTemplate(name);
+ }
+
+ /// <summary>
+ /// Loads chart appearance template from stream.
+ /// </summary>
+ /// <param name="stream">Template stream to load from.</param>
+ public void LoadTemplate(Stream stream)
+ {
+ chartPicture.LoadTemplate(stream);
+ }
+
+
+ /// <summary>
+ /// Applies palette colors to series or data points.
+ /// </summary>
+ public void ApplyPaletteColors()
+ {
+ // Apply palette colors to series
+ this._dataManager.ApplyPaletteColors();
+
+ // Apply palette colors to data Points in series
+ foreach(Series series in this.Series)
+ {
+ // Check if palette colors should be aplied to the points
+ bool applyToPoints = false;
+ if(series.Palette != ChartColorPalette.None)
+ {
+ applyToPoints = true;
+ }
+ else
+ {
+ IChartType chartType = this._chartTypeRegistry.GetChartType(series.ChartTypeName);
+ applyToPoints = chartType.ApplyPaletteColorsToPoints;
+ }
+
+ // Apply palette colors to the points
+ if(applyToPoints)
+ {
+ series.ApplyPaletteColors();
+ }
+ }
+ }
+
+ /// <summary>
+ /// Checks if control is in design mode.
+ /// </summary>
+ /// <returns>True if control is in design mode.</returns>
+ internal bool IsDesignMode()
+ {
+ return this.DesignMode;
+ }
+
+ /// <summary>
+ /// Reset auto calculated chart properties values to "Auto".
+ /// </summary>
+ public void ResetAutoValues()
+ {
+ // Reset auto calculated series properties values
+ foreach(Series series in this.Series)
+ {
+ series.ResetAutoValues();
+ }
+
+ // Reset auto calculated axis properties values
+ foreach(ChartArea chartArea in this.ChartAreas)
+ {
+ chartArea.ResetAutoValues();
+ }
+
+ }
+
+ #endregion
+
+ #region Control DataBind method
+
+ /// <summary>
+ /// Verifies that the object a data-bound control binds to is one it can work with.
+ /// </summary>
+ /// <param name="dataSource">The object to verify</param>
+ protected override void ValidateDataSource(object dataSource)
+ {
+ if (!ChartImage.IsValidDataSource(dataSource))
+ {
+ base.ValidateDataSource(dataSource);
+ }
+ }
+
+ /// <summary>
+ /// Binds the specified data source to the Chart control.
+ /// </summary>
+ /// <param name="data">An <see cref="IEnumerable"/> that represents the data source.</param>
+ protected override void PerformDataBinding(IEnumerable data)
+ {
+ this.chartPicture.DataBind(data, null);
+ this.chartPicture.boundToDataSource = true;
+ }
+
+ /// <summary>
+ /// Aligns data points using their axis labels.
+ /// </summary>
+ public void AlignDataPointsByAxisLabel()
+ {
+ this.chartPicture.AlignDataPointsByAxisLabel(false, PointSortOrder.Ascending);
+ }
+
+ /// <summary>
+ /// Aligns data points using their axis labels.
+ /// </summary>
+ /// <param name="series">Comma separated list of series that should be aligned by axis label.</param>
+ public void AlignDataPointsByAxisLabel(string series)
+ {
+ // Create list of series
+ ArrayList seriesList = new ArrayList();
+ string[] seriesNames = series.Split(',');
+ foreach(string name in seriesNames)
+ {
+ seriesList.Add(this.Series[name.Trim()]);
+ }
+
+ // Align series
+ this.chartPicture.AlignDataPointsByAxisLabel(seriesList, false, PointSortOrder.Ascending);
+ }
+
+ /// <summary>
+ /// Aligns data points using their axis labels.
+ /// </summary>
+ /// <param name="series">Comma separated list of series that should be aligned by axis label.</param>
+ /// <param name="sortingOrder">Points sorting order by axis labels.</param>
+ public void AlignDataPointsByAxisLabel(string series, PointSortOrder sortingOrder)
+ {
+ // Create list of series
+ ArrayList seriesList = new ArrayList();
+ string[] seriesNames = series.Split(',');
+ foreach(string name in seriesNames)
+ {
+ seriesList.Add(this.Series[name.Trim()]);
+ }
+
+ // Align series
+ this.chartPicture.AlignDataPointsByAxisLabel(seriesList, true, sortingOrder);
+ }
+
+ /// <summary>
+ /// Aligns data points using their axis labels.
+ /// </summary>
+ /// <param name="sortingOrder">Points sorting order by axis labels.</param>
+ public void AlignDataPointsByAxisLabel(PointSortOrder sortingOrder)
+ {
+ this.chartPicture.AlignDataPointsByAxisLabel(true, sortingOrder);
+ }
+
+
+
+ /// <summary>
+ /// Automatically creates and binds series to specified data table.
+ /// Each column of the table becomes a Y value in a separate series.
+ /// Series X value field may also be provided.
+ /// </summary>
+ /// <param name="dataSource">Data source.</param>
+ /// <param name="xField">Name of the field for series X values.</param>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X is a cartesian coordinate and well understood")]
+ public void DataBindTable(
+ IEnumerable dataSource,
+ string xField)
+ {
+ this.chartPicture.DataBindTable(
+ dataSource,
+ xField);
+ }
+
+ /// <summary>
+ /// Automatically creates and binds series to specified data table.
+ /// Each column of the table becomes a Y value in a separate series.
+ /// </summary>
+ /// <param name="dataSource">Data source.</param>
+ public void DataBindTable(IEnumerable dataSource)
+ {
+ this.chartPicture.DataBindTable(
+ dataSource,
+ String.Empty);
+ }
+
+ /// <summary>
+ /// Data bind chart to the table. Series will be automatically added to the chart depending on
+ /// the number of unique values in the seriesGroupByField column of the data source.
+ /// Data source can be the Ole(SQL)DataReader, DataView, DataSet, DataTable or DataRow.
+ /// </summary>
+ /// <param name="dataSource">Data source.</param>
+ /// <param name="seriesGroupByField">Name of the field used to group data into series.</param>
+ /// <param name="xField">Name of the field for X values.</param>
+ /// <param name="yFields">Comma separated name(s) of the field(s) for Y value(s).</param>
+ /// <param name="otherFields">Other point properties binding rule in format: PointProperty=Field[{Format}] [,PointProperty=Field[{Format}]]. For example: "Tooltip=Price{C1},Url=WebSiteName".</param>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X and Y are cartesian coordinates and well understood")]
+ public void DataBindCrossTable(
+ IEnumerable dataSource,
+ string seriesGroupByField,
+ string xField,
+ string yFields,
+ string otherFields)
+ {
+ this.chartPicture.DataBindCrossTab(
+ dataSource,
+ seriesGroupByField,
+ xField,
+ yFields,
+ otherFields,
+ false,
+ PointSortOrder.Ascending);
+ }
+
+ /// <summary>
+ /// Data bind chart to the table. Series will be automatically added to the chart depending on
+ /// the number of unique values in the seriesGroupByField column of the data source.
+ /// Data source can be the Ole(SQL)DataReader, DataView, DataSet, DataTable or DataRow.
+ /// </summary>
+ /// <param name="dataSource">Data source.</param>
+ /// <param name="seriesGroupByField">Name of the field used to group data into series.</param>
+ /// <param name="xField">Name of the field for X values.</param>
+ /// <param name="yFields">Comma separated name(s) of the field(s) for Y value(s).</param>
+ /// <param name="otherFields">Other point properties binding rule in format: PointProperty=Field[{Format}] [,PointProperty=Field[{Format}]]. For example: "Tooltip=Price{C1},Url=WebSiteName".</param>
+ /// <param name="sortingOrder">Series will be sorted by group field values in specified order.</param>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
+ Justification = "X and Y are cartesian coordinates and well understood")]
+ public void DataBindCrossTable(
+ IEnumerable dataSource,
+ string seriesGroupByField,
+ string xField,
+ string yFields,
+ string otherFields,
+ PointSortOrder sortingOrder)
+ {
+ this.chartPicture.DataBindCrossTab(
+ dataSource,
+ seriesGroupByField,
+ xField,
+ yFields,
+ otherFields,
+ true,
+ sortingOrder);
+ }
+
+
+ #endregion
+
+ #region Special Extension Methods and Properties
+
+ /// <summary>
+ /// Gets the requested chart service.
+ /// </summary>
+ /// <param name="serviceType">Type of requested chart service.</param>
+ /// <returns>Instance of the service or null if it can't be found.</returns>
+ public object GetService(Type serviceType)
+ {
+ // Check arguments
+ if (serviceType == null)
+ throw new ArgumentNullException("serviceType");
+
+ object service = null;
+ if(serviceContainer != null)
+ {
+ service = serviceContainer.GetService(serviceType);
+ }
+
+ return service;
+ }
+
+ /// <summary>
+ /// Called when a numeric value has to be converted to a string.
+ /// </summary>
+ [SRDescription("DescriptionAttributeChartEvent_PrePaint")]
+ public event EventHandler<FormatNumberEventArgs> FormatNumber;
+
+ /// <summary>
+ /// Called when a numeric value has to be converted to a string.
+ /// </summary>
+ /// <param name="caller">Event caller. Can be ChartPicture, ChartArea or Legend objects.</param>
+ /// <param name="e">Event arguments.</param>
+ [SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers", MessageId = "1#")]
+ protected virtual void OnFormatNumber(object caller, FormatNumberEventArgs e)
+ {
+ if (FormatNumber != null)
+ {
+ FormatNumber(caller, e);
+ }
+ }
+
+ /// <summary>
+ /// Called when a numeric value has to be converted to a string.
+ /// </summary>
+ /// <param name="caller">Event caller. Can be ChartPicture, ChartArea or Legend objects.</param>
+ /// <param name="e">Event arguments.</param>
+ internal void CallOnFormatNumber(object caller, FormatNumberEventArgs e)
+ {
+ this.OnFormatNumber(caller, e);
+ }
+
+ #endregion
+
+ #region HttpHandler Support
+
+ /// <summary>
+ /// Chart rendering type. Image tag, input tag, binary data streaming and image map are the options.
+ /// </summary>
+ [
+ SRCategory("CategoryAttributeImage"),
+ Bindable(true),
+ SRDescription("DescriptionAttributeChart_ImageStorageMode"),
+ PersistenceModeAttribute(PersistenceMode.Attribute),
+ DefaultValue(ImageStorageMode.UseHttpHandler)
+ ]
+ public ImageStorageMode ImageStorageMode
+ {
+ get
+ {
+ return this._imageStorageMode;
+ }
+ set
+ {
+ this._imageStorageMode = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets the image storage mode.
+ /// </summary>
+ /// <returns></returns>
+ internal ImageStorageMode GetImageStorageMode()
+ {
+ if (this.ImageStorageMode == ImageStorageMode.UseHttpHandler)
+ {
+ ChartHttpHandler.EnsureInstalled();
+ }
+ return this.ImageStorageMode;
+ }
+
+ #endregion //HttpHandler Support
+
+ #region IPostBackEventHandler Members
+
+ void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)
+ {
+ this.RaisePostBackEvent(eventArgument);
+ }
+
+ #endregion
+
+ #region IDisposable overrides
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected virtual void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ if (!String.IsNullOrEmpty(_designTimeChart))
+ {
+ try
+ {
+ File.Delete(_designTimeChart);
+ }
+ catch (ArgumentException) { }
+ catch (DirectoryNotFoundException) { }
+ catch (IOException) { }
+ catch (NotSupportedException) { }
+ catch (UnauthorizedAccessException) { }
+ }
+
+ // Dispose managed objects here
+ if (_imageLoader != null)
+ {
+ _imageLoader.Dispose();
+ _imageLoader = null;
+ }
+ if (_namedImages != null)
+ {
+ _namedImages.Dispose();
+ _namedImages = null;
+ }
+ if (_chartTypeRegistry != null)
+ {
+ _chartTypeRegistry.Dispose();
+ _chartTypeRegistry = null;
+ }
+ if (serviceContainer != null)
+ {
+ serviceContainer.Dispose();
+ serviceContainer = null;
+ }
+ if (_license != null)
+ {
+ _license.Dispose();
+ _license = null;
+ }
+ }
+ //Base dispose
+ base.Dispose();
+ if (disposing)
+ {
+ if (_dataManager != null)
+ {
+ _dataManager.Dispose();
+ _dataManager = null;
+ }
+ if (chartPicture != null)
+ {
+ chartPicture.Dispose();
+ chartPicture = null;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Disposing control resoursec
+ /// </summary>
+ public override sealed void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ #endregion
+
+ }
+
+ /// <summary>
+ /// Chart map areas customize events arguments
+ /// </summary>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class CustomizeMapAreasEventArgs : EventArgs
+ {
+ private MapAreasCollection _areaItems = null;
+
+ /// <summary>
+ /// Default construvtor is not accessible
+ /// </summary>
+ private CustomizeMapAreasEventArgs()
+ {
+ }
+
+ /// <summary>
+ /// Customize map area event arguments constructor
+ /// </summary>
+ /// <param name="areaItems">Legend items collection.</param>
+ public CustomizeMapAreasEventArgs(MapAreasCollection areaItems)
+ {
+ this._areaItems = areaItems;
+ }
+
+ /// <summary>
+ /// Legend items collection.
+ /// </summary>
+ public MapAreasCollection MapAreaItems
+ {
+ get
+ {
+ return _areaItems;
+ }
+ }
+
+ }
+
+
+
+ /// <summary>
+ /// Chart legend customize events arguments
+ /// </summary>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class CustomizeLegendEventArgs : EventArgs
+ {
+ private LegendItemsCollection _legendItems = null;
+ private string _legendName = "";
+
+ /// <summary>
+ /// Default construvtor is not accessible
+ /// </summary>
+ private CustomizeLegendEventArgs()
+ {
+ }
+
+ /// <summary>
+ /// Customize legend event arguments constructor
+ /// </summary>
+ /// <param name="legendItems">Legend items collection.</param>
+ public CustomizeLegendEventArgs(LegendItemsCollection legendItems)
+ {
+ this._legendItems = legendItems;
+ }
+
+ /// <summary>
+ /// Customize legend event arguments constructor
+ /// </summary>
+ /// <param name="legendItems">Legend items collection.</param>
+ /// <param name="legendName">Legend name.</param>
+ public CustomizeLegendEventArgs(LegendItemsCollection legendItems, string legendName)
+ {
+ this._legendItems = legendItems;
+ this._legendName = legendName;
+ }
+
+ /// <summary>
+ /// Legend name.
+ /// </summary>
+ public string LegendName
+ {
+ get
+ {
+ return _legendName;
+ }
+ }
+
+ /// <summary>
+ /// Legend items collection.
+ /// </summary>
+ public LegendItemsCollection LegendItems
+ {
+ get
+ {
+ return _legendItems;
+ }
+ }
+
+ }
+
+ /// <summary>
+ /// Specifies a value indicating whether the text appears from right to left, such as when using Hebrew or Arabic fonts
+ /// </summary>
+ public enum RightToLeft
+ {
+ /// <summary>
+ /// The text reads from left to right. This is the default.
+ /// </summary>
+ No,
+ /// <summary>
+ /// The text reads from right to left.
+ /// </summary>
+ Yes,
+ /// <summary>
+ /// Not used
+ /// </summary>
+ [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
+ Inherit = No
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/WebForm/Converters/MapAreaCoordinatesConverter.cs b/mcs/class/referencesource/System.Web.DataVisualization/WebForm/Converters/MapAreaCoordinatesConverter.cs
new file mode 100644
index 00000000000..66695efaaf8
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/WebForm/Converters/MapAreaCoordinatesConverter.cs
@@ -0,0 +1,103 @@
+//-------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//-------------------------------------------------------------
+// @owner=alexgor, deliant
+//=================================================================
+// File: MapAreaCoordinatesConverter.cs
+//
+// Namespace: System.Web.UI.DataVisualization.Charting
+//
+// Classes: MapAreaCoordinatesConverter
+//
+// Purpose: Design-time converter for map area coordinates
+//
+// Reviewed: AG - August 7, 2002
+//
+//===================================================================
+
+using System.ComponentModel;
+using System.Globalization;
+
+namespace System.Web.UI.DataVisualization.Charting
+{
+ /// <summary>
+ /// Converter for the array of map area coordinates
+ /// </summary>
+ internal class MapAreaCoordinatesConverter : ArrayConverter
+ {
+ /// <summary>
+ /// Overrides the CanConvertFrom method of TypeConverter.
+ /// The ITypeDescriptorContext interface provides the context for the
+ /// conversion. Typically this interface is used at design time to
+ /// provide information about the design-time container.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="sourceType">Convertion source type.</param>
+ /// <returns>Indicates if convertion is possible.</returns>
+ public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
+ {
+ if (sourceType == typeof(string))
+ {
+ return true;
+ }
+ return base.CanConvertFrom(context, sourceType);
+ }
+
+ /// <summary>
+ /// Overrides the ConvertFrom method of TypeConverter.
+ /// Convert from comma separated values in the string.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert from.</param>
+ /// <returns>Indicates if convertion is possible.</returns>
+ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
+ {
+ // Can convert from string where each array element is separated by comma
+ string stringValue = value as string;
+ if (stringValue != null)
+ {
+ string[] values = stringValue.Split(new char[] { ',' });
+ float[] array = new float[values.Length];
+ for (int index = 0; index < values.Length; index++)
+ {
+ array[index] = float.Parse(values[index], System.Globalization.CultureInfo.CurrentCulture);
+ }
+
+ return array;
+ }
+
+ // Call base class
+ return base.ConvertFrom(context, culture, value);
+ }
+
+ /// <summary>
+ /// Overrides the ConvertTo method of TypeConverter.
+ /// Convert coordinates array to comma separated values in string.
+ /// </summary>
+ /// <param name="context">Descriptor context.</param>
+ /// <param name="culture">Culture information.</param>
+ /// <param name="value">Value to convert.</param>
+ /// <param name="destinationType">Convertion destination type.</param>
+ /// <returns>Converted object.</returns>
+ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+ {
+ if (destinationType == typeof(string))
+ {
+ float[] array = (float[])value;
+ string result = "";
+
+ foreach (float d in array)
+ {
+ result += d.ToString(System.Globalization.CultureInfo.CurrentCulture) + ",";
+ }
+
+ return result.TrimEnd(',');
+ }
+
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
+ }
+}
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/WebForm/FxCopExclusionsByDesign.cs b/mcs/class/referencesource/System.Web.DataVisualization/WebForm/FxCopExclusionsByDesign.cs
new file mode 100644
index 00000000000..7bdc72f6930
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/WebForm/FxCopExclusionsByDesign.cs
@@ -0,0 +1,553 @@
+// <copyright company='Microsoft Corporation'>
+// Copyright (c) Microsoft Corporation. All Rights Reserved.
+// </copyright>
+// @owner=krisztb
+
+using System.Diagnostics.CodeAnalysis;
+
+#region CA1501:AvoidExcessiveInheritance
+
+[module: SuppressMessage("Microsoft.Maintainability", "CA1501:AvoidExcessiveInheritance", Scope = "type", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.HundredPercentStackedAreaChart")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1501:AvoidExcessiveInheritance", Scope = "type", Target = "System.Web.UI.DataVisualization.Charting.EllipseAnnotation")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1501:AvoidExcessiveInheritance", Scope = "type", Target = "System.Web.UI.DataVisualization.Charting.Border3DAnnotation")]
+
+#endregion // CA1501:AvoidExcessiveInheritance
+
+
+#region CA1502:AvoidExcessiveComplexity
+
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.BubbleChart.#ScaleBubbleSize(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Double)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.BubbleChart.#AxisScaleBubbleSize(System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Double,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.HundredPercentStackedBarChart.#GetYValue(System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series,System.Web.UI.DataVisualization.Charting.DataPoint,System.Int32,System.Int32)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.StackedColumnChart.#ProcessChartType3D(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Boolean,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.StackedColumnChart.#ProcessChartType(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Boolean,System.Boolean,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.FunnelChart.#GetLabelsPosition()")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.FunnelChart.#DrawFunnel3DSquareSegment(System.Web.UI.DataVisualization.Charting.DataPoint,System.Int32,System.Single,System.Single,System.Single,System.Single,System.Boolean,System.Boolean,System.Boolean,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.FunnelChart.#DrawFunnelCircularSegment(System.Web.UI.DataVisualization.Charting.DataPoint,System.Int32,System.Single,System.Single,System.Single,System.Single,System.Boolean,System.Boolean,System.Boolean,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.ThreeLineBreakChart.#FillThreeLineBreakData(System.Web.UI.DataVisualization.Charting.Series,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.ErrorBarChart.#ProcessChartType(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.ErrorBarChart.#CalculateErrorAmount(System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.ErrorBarChart.#ProcessChartType3D(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.BoxPlotChart.#ProcessChartType3D(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.BoxPlotChart.#ProcessChartType(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.BoxPlotChart.#CalculateBoxPlotValues(System.Web.UI.DataVisualization.Charting.DataPoint&,System.Web.UI.DataVisualization.Charting.Series,System.String)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PointChart.#ProcessChartType(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PointChart.#DrawLabels(System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Drawing.PointF,System.Int32,System.Web.UI.DataVisualization.Charting.DataPoint,System.Web.UI.DataVisualization.Charting.Series,System.Int32)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PointChart.#ProcessSinglePoint3D(System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.HundredPercentStackedColumnChart.#GetYValue(System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series,System.Web.UI.DataVisualization.Charting.DataPoint,System.Int32,System.Int32)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PointAndFigureChart.#FillPointAndFigureData(System.Web.UI.DataVisualization.Charting.Series,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.StackedBarChart.#ProcessChartType3D(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Boolean,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.StackedBarChart.#ProcessChartType(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Boolean,System.Boolean,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.StackedBarChart.#DrawLabels3D(System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Drawing.RectangleF,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Web.UI.DataVisualization.Charting.Series,System.Double,System.Double,System.Double,System.Int32)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.StackedAreaChart.#ProcessChartType(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.BarChart.#ProcessChartType3D(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.BarChart.#DrawLabelsAndMarkers(System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Drawing.RectangleF,System.Web.UI.DataVisualization.Charting.DataPoint,System.Web.UI.DataVisualization.Charting.Series,System.Double,System.Double,System.Double,System.Int32,System.Int32&)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.BarChart.#ProcessChartType(System.Boolean,System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.BarChart.#DrawLabels3D(System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Drawing.RectangleF,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Web.UI.DataVisualization.Charting.Series,System.Double,System.Double,System.Double,System.Int32)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.StepLineChart.#Draw3DSurface(System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.Matrix3D,System.Web.UI.DataVisualization.Charting.LightStyle,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Single,System.Single,System.Collections.ArrayList,System.Int32,System.Int32,System.Single,System.Web.UI.DataVisualization.Charting.DrawingOperationTypes,System.Single,System.Single,System.Drawing.PointF,System.Drawing.PointF,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.ColumnChart.#ProcessChartType(System.Boolean,System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.ColumnChart.#ProcessChartType3D(System.Boolean,System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.RangeChart.#Draw3DSurface(System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Boolean,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.Matrix3D,System.Web.UI.DataVisualization.Charting.LightStyle,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Single,System.Single,System.Collections.ArrayList,System.Int32,System.Int32,System.Single,System.Web.UI.DataVisualization.Charting.DrawingOperationTypes,System.Web.UI.DataVisualization.Charting.LineSegmentType,System.Single,System.Single,System.Drawing.PointF,System.Drawing.PointF,System.Boolean,System.Boolean,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.RangeChart.#DrawLine(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.DataPoint,System.Web.UI.DataVisualization.Charting.Series,System.Drawing.PointF[],System.Int32,System.Single)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart.#EstimateLabels(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Drawing.PointF,System.Drawing.SizeF,System.Single,System.Single,System.Web.UI.DataVisualization.Charting.DataPoint,System.Boolean,System.Web.UI.DataVisualization.Charting.ChartArea)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart.#PointOrder(System.Web.UI.DataVisualization.Charting.Series,System.Web.UI.DataVisualization.Charting.ChartArea,System.Single[]&,System.Single[]&,System.Int32[]&,System.Boolean&)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart.#DrawDoughnutCurves(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.DataPoint,System.Single,System.Single,System.Drawing.PointF[],System.Drawing.SolidBrush,System.Drawing.Pen,System.Boolean,System.Boolean,System.Int32)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart.#ProcessChartType3D(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Single)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart.#DrawLabels(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Drawing.PointF,System.Drawing.SizeF,System.Single,System.Single,System.Web.UI.DataVisualization.Charting.DataPoint,System.Single,System.Boolean,System.Web.UI.DataVisualization.Charting.ChartArea,System.Boolean,System.Int32,System.Drawing.Color)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart.#DrawPieCurves(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.DataPoint,System.Single,System.Single,System.Drawing.PointF[],System.Drawing.SolidBrush,System.Drawing.Pen,System.Boolean,System.Boolean,System.Int32)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart.#ProcessChartType(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Boolean,System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart+LabelsMode)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart.#PrepareData(System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart.#Draw3DPie(System.Int32,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.DataPoint,System.Web.UI.DataVisualization.Charting.ChartArea,System.Drawing.RectangleF,System.Single,System.Single,System.Single,System.Single,System.Boolean,System.Boolean,System.Int32)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.HundredPercentStackedAreaChart.#GetYValue(System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series,System.Web.UI.DataVisualization.Charting.DataPoint,System.Int32,System.Int32)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.FastLineChart.#Paint(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.FastPointChart.#Paint(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.RadarChart.#DrawLabels(System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Drawing.PointF,System.Int32,System.Web.UI.DataVisualization.Charting.DataPoint,System.Web.UI.DataVisualization.Charting.Series,System.Int32)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.RadarChart.#ProcessChartType(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.StockChart.#DrawOpenCloseMarks(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series,System.Web.UI.DataVisualization.Charting.DataPoint,System.Single,System.Single)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.StockChart.#ProcessChartType(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.StockChart.#ProcessChartType3D(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.StockChart.#DrawOpenCloseMarks3D(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series,System.Web.UI.DataVisualization.Charting.DataPoint,System.Single,System.Single,System.Single,System.Single)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.LineChart.#DrawLine(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.DataPoint,System.Web.UI.DataVisualization.Charting.Series,System.Drawing.PointF[],System.Int32,System.Single)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.LineChart.#ClipBottomPoints(System.Drawing.Drawing2D.GraphicsPath,System.Web.UI.DataVisualization.Charting.DataPoint3D&,System.Web.UI.DataVisualization.Charting.DataPoint3D&,System.Drawing.PointF&,System.Drawing.PointF&,System.Boolean,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.Matrix3D,System.Web.UI.DataVisualization.Charting.LightStyle,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Single,System.Single,System.Collections.ArrayList,System.Int32,System.Int32,System.Single,System.Web.UI.DataVisualization.Charting.DrawingOperationTypes,System.Web.UI.DataVisualization.Charting.LineSegmentType,System.Single,System.Single)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.LineChart.#ProcessLineChartType3D(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.LineChart.#ProcessChartType(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.LineChart.#ClipTopPoints(System.Drawing.Drawing2D.GraphicsPath,System.Web.UI.DataVisualization.Charting.DataPoint3D&,System.Web.UI.DataVisualization.Charting.DataPoint3D&,System.Boolean,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.Matrix3D,System.Web.UI.DataVisualization.Charting.LightStyle,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Single,System.Single,System.Collections.ArrayList,System.Int32,System.Int32,System.Single,System.Web.UI.DataVisualization.Charting.DrawingOperationTypes,System.Web.UI.DataVisualization.Charting.LineSegmentType,System.Single,System.Single)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.KagiChart.#Draw3DSurface(System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.Matrix3D,System.Web.UI.DataVisualization.Charting.LightStyle,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Single,System.Single,System.Collections.ArrayList,System.Int32,System.Int32,System.Single,System.Web.UI.DataVisualization.Charting.DrawingOperationTypes,System.Single,System.Single,System.Drawing.PointF,System.Drawing.PointF,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.AreaChart.#Draw3DSurface(System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Boolean,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.Matrix3D,System.Web.UI.DataVisualization.Charting.LightStyle,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Single,System.Single,System.Collections.ArrayList,System.Int32,System.Int32,System.Single,System.Web.UI.DataVisualization.Charting.DrawingOperationTypes,System.Web.UI.DataVisualization.Charting.LineSegmentType,System.Single,System.Single,System.Drawing.PointF,System.Drawing.PointF,System.Boolean,System.Boolean,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.AreaChart.#Draw3DSurface(System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.Matrix3D,System.Web.UI.DataVisualization.Charting.LightStyle,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Single,System.Single,System.Collections.ArrayList,System.Int32,System.Int32,System.Single,System.Web.UI.DataVisualization.Charting.DrawingOperationTypes,System.Single,System.Single,System.Drawing.PointF,System.Drawing.PointF,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.AreaChart.#DrawLine(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.DataPoint,System.Web.UI.DataVisualization.Charting.Series,System.Drawing.PointF[],System.Int32,System.Single)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Formulas.TimeSeriesAndForecasting.#PolynomialRegression(System.Web.UI.DataVisualization.Charting.Formulas.TimeSeriesAndForecasting+RegressionType,System.Double[][],System.Double[][]&,System.Int32,System.Int32,System.Double)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartImage.#DataBindCrossTab(System.Collections.IEnumerable,System.String,System.String,System.String,System.String,System.Boolean,System.Web.UI.DataVisualization.Charting.PointSortOrder)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartImage.#GetDataSourceMemberNames(System.Object,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartImage.#AlignDataPointsByAxisLabel(System.Collections.ArrayList,System.Boolean,System.Web.UI.DataVisualization.Charting.PointSortOrder)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartImage.#DataBind(System.Collections.IEnumerable,System.Collections.ArrayList)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.PolylineAnnotation.#Paint(System.Web.UI.DataVisualization.Charting.Chart,System.Web.UI.DataVisualization.Charting.ChartGraphics)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartHelper.#GetIntervalSize(System.Double,System.Double,System.Web.UI.DataVisualization.Charting.DateTimeIntervalType,System.Web.UI.DataVisualization.Charting.Series,System.Double,System.Web.UI.DataVisualization.Charting.DateTimeIntervalType,System.Boolean,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#Draw3DPolygon(System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Matrix3D,System.Web.UI.DataVisualization.Charting.SurfaceNames,System.Single,System.Drawing.Color,System.Drawing.Color,System.Int32,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Web.UI.DataVisualization.Charting.DrawingOperationTypes,System.Web.UI.DataVisualization.Charting.LineSegmentType,System.Web.UI.DataVisualization.Charting.SurfaceNames)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#ShouldDrawLineChartSurface(System.Web.UI.DataVisualization.Charting.ChartArea,System.Boolean,System.Web.UI.DataVisualization.Charting.SurfaceNames,System.Web.UI.DataVisualization.Charting.SurfaceNames,System.Drawing.Color,System.Collections.ArrayList,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Boolean,System.Web.UI.DataVisualization.Charting.LineSegmentType&)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#AddEllipseSegment(System.Drawing.Drawing2D.GraphicsPath,System.Drawing.Drawing2D.GraphicsPath,System.Drawing.Drawing2D.GraphicsPath,System.Boolean,System.Single,System.Drawing.PointF&,System.Drawing.PointF&)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#DrawRectangleBarStyle(System.Web.UI.DataVisualization.Charting.BarDrawingStyle,System.Boolean,System.Drawing.RectangleF)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#DrawLabelStringRel(System.Web.UI.DataVisualization.Charting.Axis,System.Int32,System.Web.UI.DataVisualization.Charting.LabelMarkStyle,System.Drawing.Color,System.String,System.String,System.Drawing.Color,System.Drawing.Font,System.Drawing.Brush,System.Drawing.RectangleF,System.Drawing.StringFormat,System.Int32,System.Drawing.RectangleF,System.Web.UI.DataVisualization.Charting.CustomLabel,System.Boolean,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#FillRectangleRel(System.Drawing.RectangleF,System.Drawing.Color,System.Web.UI.DataVisualization.Charting.ChartHatchStyle,System.String,System.Web.UI.DataVisualization.Charting.ChartImageWrapMode,System.Drawing.Color,System.Web.UI.DataVisualization.Charting.ChartImageAlignmentStyle,System.Web.UI.DataVisualization.Charting.GradientStyle,System.Drawing.Color,System.Drawing.Color,System.Int32,System.Web.UI.DataVisualization.Charting.ChartDashStyle,System.Drawing.Color,System.Int32,System.Drawing.Drawing2D.PenAlignment,System.Boolean,System.Int32,System.Boolean,System.Web.UI.DataVisualization.Charting.BarDrawingStyle,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#FillRectangleAbs(System.Drawing.RectangleF,System.Drawing.Color,System.Web.UI.DataVisualization.Charting.ChartHatchStyle,System.String,System.Web.UI.DataVisualization.Charting.ChartImageWrapMode,System.Drawing.Color,System.Web.UI.DataVisualization.Charting.ChartImageAlignmentStyle,System.Web.UI.DataVisualization.Charting.GradientStyle,System.Drawing.Color,System.Drawing.Color,System.Int32,System.Web.UI.DataVisualization.Charting.ChartDashStyle,System.Drawing.Drawing2D.PenAlignment)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#Draw3DSurface(System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Matrix3D,System.Web.UI.DataVisualization.Charting.LightStyle,System.Web.UI.DataVisualization.Charting.SurfaceNames,System.Single,System.Single,System.Drawing.Color,System.Drawing.Color,System.Int32,System.Web.UI.DataVisualization.Charting.ChartDashStyle,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Collections.ArrayList,System.Int32,System.Single,System.Web.UI.DataVisualization.Charting.DrawingOperationTypes,System.Web.UI.DataVisualization.Charting.LineSegmentType,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Int32,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#FillPieSides(System.Web.UI.DataVisualization.Charting.ChartArea,System.Single,System.Single,System.Single,System.Drawing.PointF[],System.Drawing.SolidBrush,System.Drawing.Pen,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#Fill3DRectangle(System.Drawing.RectangleF,System.Single,System.Single,System.Web.UI.DataVisualization.Charting.Matrix3D,System.Web.UI.DataVisualization.Charting.LightStyle,System.Drawing.Color,System.Single,System.Single,System.Drawing.Color,System.Int32,System.Web.UI.DataVisualization.Charting.ChartDashStyle,System.Web.UI.DataVisualization.Charting.BarDrawingStyle,System.Boolean,System.Web.UI.DataVisualization.Charting.DrawingOperationTypes)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#DrawMarker3D(System.Web.UI.DataVisualization.Charting.Matrix3D,System.Web.UI.DataVisualization.Charting.LightStyle,System.Single,System.Drawing.PointF,System.Web.UI.DataVisualization.Charting.MarkerStyle,System.Int32,System.Drawing.Color,System.Drawing.Color,System.Int32,System.String,System.Drawing.Color,System.Int32,System.Drawing.Color,System.Drawing.RectangleF,System.Web.UI.DataVisualization.Charting.DrawingOperationTypes)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#DrawBarStyleGradients(System.Web.UI.DataVisualization.Charting.Matrix3D,System.Web.UI.DataVisualization.Charting.BarDrawingStyle,System.Drawing.RectangleF,System.Single,System.Single,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#DrawMarkerAbs(System.Drawing.PointF,System.Web.UI.DataVisualization.Charting.MarkerStyle,System.Int32,System.Drawing.Color,System.Drawing.Color,System.Int32,System.String,System.Drawing.Color,System.Int32,System.Drawing.Color,System.Drawing.RectangleF,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#DrawPathAbs(System.Drawing.Drawing2D.GraphicsPath,System.Drawing.Color,System.Web.UI.DataVisualization.Charting.ChartHatchStyle,System.String,System.Web.UI.DataVisualization.Charting.ChartImageWrapMode,System.Drawing.Color,System.Web.UI.DataVisualization.Charting.ChartImageAlignmentStyle,System.Web.UI.DataVisualization.Charting.GradientStyle,System.Drawing.Color,System.Drawing.Color,System.Int32,System.Web.UI.DataVisualization.Charting.ChartDashStyle,System.Drawing.Drawing2D.PenAlignment)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#Fill3DRectangleAsCylinder(System.Drawing.RectangleF,System.Single,System.Single,System.Web.UI.DataVisualization.Charting.Matrix3D,System.Web.UI.DataVisualization.Charting.LightStyle,System.Drawing.Color,System.Single,System.Single,System.Drawing.Color,System.Int32,System.Web.UI.DataVisualization.Charting.ChartDashStyle,System.Boolean,System.Web.UI.DataVisualization.Charting.DrawingOperationTypes)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataPointCustomProperties.#SetDefault(System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.AxisScaleBreakStyle.#FillAxisSegmentCollection(System.Web.UI.DataVisualization.Charting.AxisScaleSegmentCollection)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Selection.#HitTest(System.Int32,System.Int32,System.Boolean,System.Web.UI.DataVisualization.Charting.ChartElementType[])")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Selection.#GetHitTestResult(System.String,System.Int32,System.Web.UI.DataVisualization.Charting.ChartElementType,System.Object,System.Object)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Selection.#GetHotRegions(System.Object,System.Web.UI.DataVisualization.Charting.ChartElementType)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Axis.#Resize(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.ElementPosition,System.Drawing.RectangleF,System.Single,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Axis.#CheckLabelsFit(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Single,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Collections.ArrayList)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Axis.#DrawAxis3DTitle(System.Web.UI.DataVisualization.Charting.ChartGraphics)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Axis.#GetRequiredLabelSize(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Single,System.Single&)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Axis.#ReduceLabelInterval(System.Double,System.Double,System.Web.UI.DataVisualization.Charting.DateTimeIntervalType&)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Axis.#DrawAxisTitle(System.Web.UI.DataVisualization.Charting.ChartGraphics)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Axis.#AdjustLabelFontAtSecondPass(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Axis.#CalcInterval(System.Double,System.Double,System.Boolean,System.Web.UI.DataVisualization.Charting.DateTimeIntervalType&,System.Web.UI.DataVisualization.Charting.ChartValueType)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Axis.#DrawAxisLine(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Axis.#EstimateNumberAxis(System.Double&,System.Double&,System.Boolean,System.Int32,System.Boolean,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Axis.#AdjustIntervalToFitLabels(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Boolean,System.Web.UI.DataVisualization.Charting.AxisScaleSegment,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Axis.#FillLabels(System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Axis.#Draw3DAxisLine(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Drawing.PointF,System.Drawing.PointF,System.Boolean,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Annotation.#SetPositionRelative(System.Drawing.RectangleF,System.Drawing.PointF,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Annotation.#PaintSelectionHandles(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Drawing.RectangleF,System.Drawing.Drawing2D.GraphicsPath)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Annotation.#GetRelativePosition(System.Drawing.PointF&,System.Drawing.SizeF&,System.Drawing.PointF&)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataPoint.#SetValueY(System.Object[])")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataPointCollection.#ConvertEnumerationItem(System.Object,System.String)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataPointCollection.#DataBindXY(System.Collections.IEnumerable,System.String,System.Collections.IEnumerable,System.String)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataPointCollection.#DataBindXY(System.Collections.IEnumerable,System.Collections.IEnumerable[])")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataPointCollection.#GetValueType(System.Collections.IEnumerator,System.String)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.LabelStyle.#Paint3D(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.LabelStyle.#PaintCircular(System.Web.UI.DataVisualization.Charting.ChartGraphics)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.LabelStyle.#Paint(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.SmartLabel.#IsSmartLabelCollide(System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.SmartLabelStyle,System.Drawing.PointF,System.Drawing.SizeF,System.Drawing.PointF,System.Drawing.StringFormat,System.Web.UI.DataVisualization.Charting.LabelAlignmentStyles,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.SmartLabel.#LineIntersectRectangle(System.Drawing.RectangleF,System.Drawing.PointF,System.Drawing.PointF)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Legend.#Paint(System.Web.UI.DataVisualization.Charting.ChartGraphics)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Legend.#FillLegendItemsCollection()")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Legend.#CheckLegendItemsFit(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Drawing.Size,System.Int32,System.Int32,System.Int32,System.Int32[],System.Int32[,]&,System.Int32[,]&,System.Int32&,System.Int32&)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Legend.#RecalcLegendInfo(System.Web.UI.DataVisualization.Charting.ChartGraphics)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Legend.#GetOptimalSize(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Drawing.SizeF)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Legend.#GetNumberOfRowsAndColumns(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Drawing.Size,System.Int32,System.Int32[]&,System.Int32&,System.Int32&,System.Int32&)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Legend.#DrawLegendHeader(System.Web.UI.DataVisualization.Charting.ChartGraphics)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.TextAnnotation.#DrawText(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Drawing.RectangleF,System.Boolean,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataManipulator.#GroupByAxisLabel(System.String,System.Web.UI.DataVisualization.Charting.Series[],System.Web.UI.DataVisualization.Charting.Series[])")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataManipulator.#ExportSeriesValues(System.Web.UI.DataVisualization.Charting.Series[])")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataManipulator.#Group(System.String,System.Double,System.Web.UI.DataVisualization.Charting.IntervalType,System.Double,System.Web.UI.DataVisualization.Charting.IntervalType,System.Web.UI.DataVisualization.Charting.Series[],System.Web.UI.DataVisualization.Charting.Series[])")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataManipulator.#ProcessPointValues(System.Web.UI.DataVisualization.Charting.DataManipulator+GroupingFunctionInfo[],System.Double[],System.Web.UI.DataVisualization.Charting.Series,System.Web.UI.DataVisualization.Charting.DataPoint,System.Int32,System.Int32,System.Int32,System.Boolean,System.Int32&)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartArea.#GetValuesFromData(System.Web.UI.DataVisualization.Charting.Axis,System.Double&,System.Double&)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartArea.#GetPointsInterval(System.Collections.Generic.List`1<System.String>,System.Boolean,System.Double,System.Boolean,System.Boolean&,System.Web.UI.DataVisualization.Charting.Series&)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartArea.#Resize(System.Web.UI.DataVisualization.Charting.ChartGraphics)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartArea.#GetArea3DSceneDepth()")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartArea.#SeriesDateTimeType(System.Web.UI.DataVisualization.Charting.AxisName,System.String)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartArea.#Paint(System.Web.UI.DataVisualization.Charting.ChartGraphics)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartArea.#SeriesIntegerType(System.Web.UI.DataVisualization.Charting.AxisName,System.String)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartArea.#SetDefaultFromData(System.Web.UI.DataVisualization.Charting.Axis)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartArea.#SetData(System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartArea.#SetData(System.Boolean,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartArea.#PreventTopBottomAxesLabelsOverlapping(System.Web.UI.DataVisualization.Charting.Axis)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Series.#PrepareData(System.ComponentModel.ISite,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Grid.#Paint(System.Web.UI.DataVisualization.Charting.ChartGraphics)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.LegendCell.#PaintCellSeriesSymbol(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Drawing.SizeF)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.TickMark.#Draw3DTickLine(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Drawing.PointF,System.Drawing.PointF,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.TickMark.#PaintCustom(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.TickMark.#Paint(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.StripLine.#PaintTitle(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Drawing.RectangleF)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.StripLine.#Paint(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Title.#Paint(System.Web.UI.DataVisualization.Charting.ChartGraphics)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.LegendAreaNameConverter.#GetStandardValues(System.ComponentModel.ITypeDescriptorContext)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartPicture.#Paint(System.Drawing.Graphics,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Utilities.BinaryFormatSerializer.#SerializeObject(System.Object,System.Object,System.String,System.IO.BinaryWriter)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Utilities.SerializerBase.#ResetObjectProperties(System.Object,System.Object,System.String)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Utilities.XmlFormatSerializer.#DeserializeObject(System.Object,System.Object,System.String,System.Xml.XmlNode,System.Xml.XmlDocument)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Utilities.XmlFormatSerializer.#SerializeObject(System.Object,System.Object,System.String,System.Xml.XmlNode,System.Xml.XmlDocument)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Utilities.ImageLoader.#LoadImage(System.String,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Utilities.SerializerBase.#FindConverterByType(System.ComponentModel.TypeConverterAttribute)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Series.#PrepareData(System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataPointCollection.#DataBind(System.Collections.IEnumerable,System.String,System.String,System.String)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.KagiChart.#DrawLine(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.DataPoint,System.Web.UI.DataVisualization.Charting.Series,System.Drawing.PointF[],System.Int32,System.Single)")]
+
+
+#endregion // CA1502:AvoidExcessiveComplexity
+
+
+#region CA1505:AvoidUnmaintainableCode
+
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.StackedColumnChart.#ProcessChartType3D(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Boolean,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.StackedColumnChart.#ProcessChartType(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Boolean,System.Boolean,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.FunnelChart.#DrawFunnelCircularSegment(System.Web.UI.DataVisualization.Charting.DataPoint,System.Int32,System.Single,System.Single,System.Single,System.Single,System.Boolean,System.Boolean,System.Boolean,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.ErrorBarChart.#ProcessChartType(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.ErrorBarChart.#ProcessChartType3D(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.BoxPlotChart.#ProcessChartType3D(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.BoxPlotChart.#ProcessChartType(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PointChart.#DrawLabels(System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Drawing.PointF,System.Int32,System.Web.UI.DataVisualization.Charting.DataPoint,System.Web.UI.DataVisualization.Charting.Series,System.Int32)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.StackedBarChart.#ProcessChartType3D(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Boolean,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.StackedBarChart.#ProcessChartType(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Boolean,System.Boolean,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.StackedAreaChart.#ProcessChartType(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.BarChart.#ProcessChartType3D(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.BarChart.#DrawLabelsAndMarkers(System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Drawing.RectangleF,System.Web.UI.DataVisualization.Charting.DataPoint,System.Web.UI.DataVisualization.Charting.Series,System.Double,System.Double,System.Double,System.Int32,System.Int32&)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.BarChart.#ProcessChartType(System.Boolean,System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.RangeChart.#Draw3DSurface(System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Boolean,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.Matrix3D,System.Web.UI.DataVisualization.Charting.LightStyle,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Single,System.Single,System.Collections.ArrayList,System.Int32,System.Int32,System.Single,System.Web.UI.DataVisualization.Charting.DrawingOperationTypes,System.Web.UI.DataVisualization.Charting.LineSegmentType,System.Single,System.Single,System.Drawing.PointF,System.Drawing.PointF,System.Boolean,System.Boolean,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.RangeChart.#DrawLine(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.DataPoint,System.Web.UI.DataVisualization.Charting.Series,System.Drawing.PointF[],System.Int32,System.Single)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart.#PointOrder(System.Web.UI.DataVisualization.Charting.Series,System.Web.UI.DataVisualization.Charting.ChartArea,System.Single[]&,System.Single[]&,System.Int32[]&,System.Boolean&)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart.#DrawLabels(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Drawing.PointF,System.Drawing.SizeF,System.Single,System.Single,System.Web.UI.DataVisualization.Charting.DataPoint,System.Single,System.Boolean,System.Web.UI.DataVisualization.Charting.ChartArea,System.Boolean,System.Int32,System.Drawing.Color)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart.#ProcessChartType(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Boolean,System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart+LabelsMode)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.FastLineChart.#Paint(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.RadarChart.#ProcessChartType(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.StockChart.#ProcessChartType3D(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.StockChart.#DrawOpenCloseMarks3D(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series,System.Web.UI.DataVisualization.Charting.DataPoint,System.Single,System.Single,System.Single,System.Single)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.LineChart.#ClipBottomPoints(System.Drawing.Drawing2D.GraphicsPath,System.Web.UI.DataVisualization.Charting.DataPoint3D&,System.Web.UI.DataVisualization.Charting.DataPoint3D&,System.Drawing.PointF&,System.Drawing.PointF&,System.Boolean,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.Matrix3D,System.Web.UI.DataVisualization.Charting.LightStyle,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Single,System.Single,System.Collections.ArrayList,System.Int32,System.Int32,System.Single,System.Web.UI.DataVisualization.Charting.DrawingOperationTypes,System.Web.UI.DataVisualization.Charting.LineSegmentType,System.Single,System.Single)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.LineChart.#ProcessChartType(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.LineChart.#ClipTopPoints(System.Drawing.Drawing2D.GraphicsPath,System.Web.UI.DataVisualization.Charting.DataPoint3D&,System.Web.UI.DataVisualization.Charting.DataPoint3D&,System.Boolean,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.Matrix3D,System.Web.UI.DataVisualization.Charting.LightStyle,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Single,System.Single,System.Collections.ArrayList,System.Int32,System.Int32,System.Single,System.Web.UI.DataVisualization.Charting.DrawingOperationTypes,System.Web.UI.DataVisualization.Charting.LineSegmentType,System.Single,System.Single)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.AreaChart.#Draw3DSurface(System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Boolean,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.Matrix3D,System.Web.UI.DataVisualization.Charting.LightStyle,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Single,System.Single,System.Collections.ArrayList,System.Int32,System.Int32,System.Single,System.Web.UI.DataVisualization.Charting.DrawingOperationTypes,System.Web.UI.DataVisualization.Charting.LineSegmentType,System.Single,System.Single,System.Drawing.PointF,System.Drawing.PointF,System.Boolean,System.Boolean,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#DrawRectangleBarStyle(System.Web.UI.DataVisualization.Charting.BarDrawingStyle,System.Boolean,System.Drawing.RectangleF)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#DrawLabelStringRel(System.Web.UI.DataVisualization.Charting.Axis,System.Int32,System.Web.UI.DataVisualization.Charting.LabelMarkStyle,System.Drawing.Color,System.String,System.String,System.Drawing.Color,System.Drawing.Font,System.Drawing.Brush,System.Drawing.RectangleF,System.Drawing.StringFormat,System.Int32,System.Drawing.RectangleF,System.Web.UI.DataVisualization.Charting.CustomLabel,System.Boolean,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#Draw3DSurface(System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Matrix3D,System.Web.UI.DataVisualization.Charting.LightStyle,System.Web.UI.DataVisualization.Charting.SurfaceNames,System.Single,System.Single,System.Drawing.Color,System.Drawing.Color,System.Int32,System.Web.UI.DataVisualization.Charting.ChartDashStyle,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Collections.ArrayList,System.Int32,System.Single,System.Web.UI.DataVisualization.Charting.DrawingOperationTypes,System.Web.UI.DataVisualization.Charting.LineSegmentType,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Int32,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#DrawBarStyleGradients(System.Web.UI.DataVisualization.Charting.Matrix3D,System.Web.UI.DataVisualization.Charting.BarDrawingStyle,System.Drawing.RectangleF,System.Single,System.Single,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#DrawMarkerAbs(System.Drawing.PointF,System.Web.UI.DataVisualization.Charting.MarkerStyle,System.Int32,System.Drawing.Color,System.Drawing.Color,System.Int32,System.String,System.Drawing.Color,System.Int32,System.Drawing.Color,System.Drawing.RectangleF,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#Fill3DRectangleAsCylinder(System.Drawing.RectangleF,System.Single,System.Single,System.Web.UI.DataVisualization.Charting.Matrix3D,System.Web.UI.DataVisualization.Charting.LightStyle,System.Drawing.Color,System.Single,System.Single,System.Drawing.Color,System.Int32,System.Web.UI.DataVisualization.Charting.ChartDashStyle,System.Boolean,System.Web.UI.DataVisualization.Charting.DrawingOperationTypes)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Axis.#Resize(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.ElementPosition,System.Drawing.RectangleF,System.Single,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Axis.#CheckLabelsFit(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Single,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Collections.ArrayList)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Axis.#FillLabels(System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Annotation.#GetRelativePosition(System.Drawing.PointF&,System.Drawing.SizeF&,System.Drawing.PointF&)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.LabelStyle.#Paint3D(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.LabelStyle.#Paint(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartArea.#Resize(System.Web.UI.DataVisualization.Charting.ChartGraphics)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.TickMark.#Paint(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Utilities.CustomPropertyRegistry.#RegisterProperties()")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Title.#Paint(System.Web.UI.DataVisualization.Charting.ChartGraphics)")]
+
+#endregion // CA1505:AvoidUnmaintainableCode
+
+
+#region CA1506:AvoidExcessiveClassCoupling
+
+[module: SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.StackedAreaChart.#ProcessChartType(System.Boolean,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartImage.#GetDataSourceMemberNames(System.Object,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Scope = "type", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Scope = "type", Target = "System.Web.UI.DataVisualization.Charting.Axis")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.LabelStyle.#Paint(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Scope = "type", Target = "System.Web.UI.DataVisualization.Charting.ChartArea")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Scope = "type", Target = "System.Web.UI.DataVisualization.Charting.Series")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Scope = "type", Target = "System.Web.UI.DataVisualization.Charting.Chart")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Chart.#.ctor()")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Scope = "type", Target = "System.Web.UI.DataVisualization.Charting.ChartPicture")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Utilities.SerializerBase.#FindConverterByType(System.ComponentModel.TypeConverterAttribute)")]
+[module: SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Scope = "type", Target = "System.Web.UI.DataVisualization.Charting.ChartImage")]
+
+#endregion // CA1506:AvoidExcessiveClassCoupling
+
+
+#region CA1702:CompoundWordsShouldBeCasedCorrectly
+
+[module: SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartColorPalette.#SemiTransparent", MessageId = "SemiTransparent")]
+[module: SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Gridlines", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartElementType.#Gridlines", Justification = "Gridlines are popular term in charting. Refer to excel chart.")]
+[module: SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Gridline", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.GridTickTypes.#Gridline", Justification = "Gridlines are popular term in charting. Refer to excel chart.")]
+[module: SuppressMessage("Microsoft.Naming", "CA1701:ResourceStringCompoundWordsShouldBeCasedCorrectly", MessageId = "Gridlines", Scope = "resource", Target = "System.Web.UI.DataVisualization.Charting.SR.resources", Justification = "Gridlines are popular term in charting. Refer to excel chart.")]
+
+#endregion // CA1702:CompoundWordsShouldBeCasedCorrectly
+
+
+#region CA1703:ResourceStringsShouldBeSpelledCorrectly
+
+[module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "System.Web.UI.DataVisualization.Charting.SR.resources", MessageId = "rror")]
+[module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "System.Web.UI.DataVisualization.Charting.SR.resources", MessageId = "Kagi")]
+[module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "System.Web.UI.DataVisualization.Charting.SR.resources", MessageId = "Renko")]
+[module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "System.Web.UI.DataVisualization.Charting.SR.resources", MessageId = "Polyline")]
+[module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "System.Web.UI.DataVisualization.Charting.SR.resources", MessageId = "uint")]
+[module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "System.Web.UI.DataVisualization.Charting.SR.resources", MessageId = "Unscaled")]
+[module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "System.Web.UI.DataVisualization.Charting.SR.resources", MessageId = "deserializer")]
+[module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "System.Web.UI.DataVisualization.Charting.SR.resources", MessageId = "ulong")]
+[module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "System.Web.UI.DataVisualization.Charting.SR.resources", MessageId = "ushort")]
+[module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "System.Web.UI.DataVisualization.Charting.SR.resources", MessageId = "megapixels")]
+
+#endregion // CA1703:ResourceStringsShouldBeSpelledCorrectly
+
+
+#region CA1805:DoNotInitializeUnnecessarily
+
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.BubbleChart.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.HundredPercentStackedBarChart.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart+LabelColumn.#.ctor(System.Drawing.RectangleF)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.StackedColumnChart.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.FunnelChart.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.ChartTypeRegistry.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.ErrorBarChart.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.BoxPlotChart.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PointChart.#.ctor(System.Boolean)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PointChart.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PointChart+Label3DInfo.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.HundredPercentStackedColumnChart.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PointAndFigureChart.#.cctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.StackedBarChart.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.StackedAreaChart.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.BarChart.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.ColumnChart.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.RangeChart.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.FunnelSegmentInfo.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.HundredPercentStackedAreaChart.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.FastLineChart.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.FastPointChart.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.StockChart.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.StockChart.#.ctor(System.Web.UI.DataVisualization.Charting.ChartTypes.StockOpenCloseMarkStyle)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.LineChart.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.KagiChart.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.AreaChart.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.FunnelPointLabelInfo.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.NamedImage.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartImage.#.ctor(System.ComponentModel.Design.IServiceContainer)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.HotRegion.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataFormula.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.CustomizeLegendEventArgs.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartHttpHandler.#.cctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.CustomLabel.#.ctor(System.Double,System.Double,System.String,System.Int32,System.Web.UI.DataVisualization.Charting.LabelMarkStyle)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.CustomLabel.#.ctor(System.Double,System.Double,System.String,System.Int32,System.Web.UI.DataVisualization.Charting.LabelMarkStyle,System.Web.UI.DataVisualization.Charting.GridTickTypes)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.CustomLabel.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.PolylineAnnotation.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.CalloutAnnotation.#.cctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataManipulator+GroupingFunctionInfo.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Point3D.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#.ctor(System.Web.UI.DataVisualization.Charting.CommonElements)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartArea+ChartTypeAndSeriesInfo.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartArea+ChartTypeAndSeriesInfo.#.ctor(System.String)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.CircularChartAreaAxis.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.FontCache+KeyInfo.#.ctor(System.Drawing.FontFamily,System.Single,System.Drawing.FontStyle)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.FontCache+KeyInfo.#.ctor(System.String,System.Single)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.FontCache+KeyInfo.#.ctor(System.Drawing.FontFamily,System.Single,System.Drawing.FontStyle,System.Drawing.GraphicsUnit)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartElement.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartElement.#.ctor(System.Web.UI.DataVisualization.Charting.IChartElement)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataPointCustomProperties.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataPointCustomProperties.#.ctor(System.Web.UI.DataVisualization.Charting.Series,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.AxisScaleSegmentCollection.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.AxisScaleSegmentCollection.#.ctor(System.Web.UI.DataVisualization.Charting.Axis)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.AxisScaleBreakStyle.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.AxisScaleBreakStyle.#.ctor(System.Web.UI.DataVisualization.Charting.Axis)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Selection.#.ctor(System.ComponentModel.Design.IServiceContainer)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.LegendItem.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.LegendItem.#.ctor(System.String,System.Drawing.Color,System.String)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Axis.#.ctor(System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.AxisName)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Axis.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartHttpHandlerSettings.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartHttpHandlerSettings.#.ctor(System.String)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Annotation.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataPoint.#.ctor(System.Web.UI.DataVisualization.Charting.Series)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.RingTimeTracker.#.ctor(System.TimeSpan,System.String)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.AnnotationPathPointCollection.#.ctor(System.Web.UI.DataVisualization.Charting.PolylineAnnotation)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.TTestResult.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.GdiGraphics.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.LabelStyle.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.LabelStyle.#.ctor(System.Web.UI.DataVisualization.Charting.Axis)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.LegendCellColumn.#.ctor(System.String,System.Web.UI.DataVisualization.Charting.LegendCellColumnType,System.String,System.Drawing.ContentAlignment)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.AxisScaleView.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.AxisScaleView.#.ctor(System.Web.UI.DataVisualization.Charting.Axis)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.LineAnnotation.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.AnovaResult.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Margins.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Margins.#.ctor(System.Int32,System.Int32,System.Int32,System.Int32)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.SmartLabel.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.SmartLabelStyle.#.ctor(System.Object)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.SmartLabelStyle.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ElementPosition.#.ctor(System.Single,System.Single,System.Single,System.Single)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ElementPosition.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ElementPosition.#.ctor(System.Web.UI.DataVisualization.Charting.IChartElement)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.CommonElements.#.ctor(System.ComponentModel.Design.IServiceContainer)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.CustomizeMapAreasEventArgs.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.AnnotationPathPoint.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Legend.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Legend.#.ctor(System.String)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.TextAnnotation.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.HotRegionsList.#.ctor(System.Web.UI.DataVisualization.Charting.CommonElements)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataManipulator.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartArea.#.ctor(System.String)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartArea.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartPaintEventArgs.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartPaintEventArgs.#.ctor(System.Object,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ElementPosition)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartPaintEventArgs.#.ctor(System.Object,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.ElementPosition)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataManipulator+PointElementFilter.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataManipulator+PointElementFilter.#.ctor(System.Web.UI.DataVisualization.Charting.DataManipulator,System.Web.UI.DataVisualization.Charting.DateRangeType,System.String)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.HitTestResult.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Series.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Series.#.ctor(System.String)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Series.#.ctor(System.String,System.Int32)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.FTestResult.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Grid.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Grid.#.ctor(System.Web.UI.DataVisualization.Charting.Axis,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartSerializer.#.ctor(System.ComponentModel.Design.IServiceContainer)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartSerializer.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.LegendCell.#.ctor(System.Web.UI.DataVisualization.Charting.LegendCellType,System.String)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.LegendCell.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.LegendCell.#.ctor(System.Web.UI.DataVisualization.Charting.LegendCellType,System.String,System.Drawing.ContentAlignment)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.LegendCell.#.ctor(System.String)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.StripLine.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataPoint3D.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.AxisScaleSegment.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Title.#.ctor(System.String)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Title.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Title.#.ctor(System.String,System.Web.UI.DataVisualization.Charting.Docking)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Title.#.ctor(System.String,System.Web.UI.DataVisualization.Charting.Docking,System.Drawing.Font,System.Drawing.Color)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Chart.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Chart.#.cctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.AnnotationCollection.#.ctor(System.Web.UI.DataVisualization.Charting.IChartElement)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartArea3DStyle.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartArea3DStyle.#.ctor(System.Web.UI.DataVisualization.Charting.ChartArea)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartPicture.#.ctor(System.ComponentModel.Design.IServiceContainer)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Borders3D.SunkenBorder.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Borders3D.BorderTypeRegistry.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Utilities.CustomPropertyInfo.#.ctor(System.String,System.Type,System.Object,System.String,System.Web.UI.DataVisualization.Charting.SeriesChartType[],System.Boolean,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Utilities.SerializerBase.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Utilities.ImageLoader.#.ctor(System.ComponentModel.Design.IServiceContainer)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Utilities.ImageLoader.#.ctor()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Utilities.SerializerBase+ItemInfo.#.ctor()")]
+
+#endregion // CA1805:DoNotInitializeUnnecessarily
+
+
+#region CA1814:PreferJaggedArraysOverMultidimensional
+
+[module: SuppressMessage("Microsoft.Performance", "CA1814:PreferJaggedArraysOverMultidimensional", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Legend.#_subColumnSizes", MessageId = "Member")]
+[module: SuppressMessage("Microsoft.Performance", "CA1814:PreferJaggedArraysOverMultidimensional", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Legend.#CheckLegendItemsFit(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Drawing.Size,System.Int32,System.Int32,System.Int32,System.Int32[],System.Int32[,]&,System.Int32[,]&,System.Int32&,System.Int32&)", MessageId = "Body")]
+[module: SuppressMessage("Microsoft.Performance", "CA1814:PreferJaggedArraysOverMultidimensional", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Legend.#_cellHeights", MessageId = "Member")]
+
+#endregion // CA1814:PreferJaggedArraysOverMultidimensional
+
+
+#region CA1822:MarkMembersAsStatic
+
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.FunnelChart.#GetCalloutLineColor(System.Web.UI.DataVisualization.Charting.DataPointCustomProperties)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PointChart.#SetHotRegions(System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.DataPoint,System.Drawing.SizeF,System.String,System.Int32,System.Web.UI.DataVisualization.Charting.MarkerStyle,System.Drawing.PointF)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.BarChart.#DrawMarkers3D(System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.CommonElements,System.Drawing.RectangleF,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Web.UI.DataVisualization.Charting.Series,System.Double,System.Double)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.BarChart.#SetHotRegions(System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.DataPoint,System.Drawing.SizeF,System.String,System.Int32,System.Web.UI.DataVisualization.Charting.MarkerStyle,System.Drawing.PointF)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.BarChart.#GetEmptyPointValue(System.Web.UI.DataVisualization.Charting.DataPoint,System.Int32,System.Int32)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.RangeChart.#Draw3DSplinePolygon(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.ChartArea,System.Single,System.Drawing.Color,System.Drawing.Color,System.Int32,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Collections.ArrayList,System.Single,System.Web.UI.DataVisualization.Charting.DrawingOperationTypes,System.Web.UI.DataVisualization.Charting.LineSegmentType,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart.#GetLabelRect(System.Drawing.PointF,System.Web.UI.DataVisualization.Charting.ChartArea,System.String,System.Drawing.StringFormat,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.DataPoint,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart.#GetPointLabel(System.Web.UI.DataVisualization.Charting.DataPoint)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart.#DrawDoughnutCurvesBigSlice(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.DataPoint,System.Single,System.Single,System.Drawing.PointF[],System.Drawing.Brush,System.Drawing.Pen,System.Boolean,System.Boolean,System.Int32)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart.#ReduceEmptySpace(System.Double[],System.Double[],System.Double)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart.#CheckPaleteColors(System.Web.UI.DataVisualization.Charting.DataPointCollection)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart.#Map(System.Web.UI.DataVisualization.Charting.CommonElements,System.Web.UI.DataVisualization.Charting.DataPoint,System.Single,System.Single,System.Drawing.RectangleF,System.Boolean,System.Single,System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Int32)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart.#SortIntervals(System.Double[],System.Double[],System.Int32[])")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart.#GetLabelStyle(System.Web.UI.DataVisualization.Charting.DataPoint)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart.#DrawPieCurvesBigSlice(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.DataPoint,System.Single,System.Single,System.Drawing.PointF[],System.Drawing.Brush,System.Drawing.Pen,System.Boolean,System.Boolean,System.Int32)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart.#SpreadInterval(System.Double[],System.Double[],System.Int32,System.Double)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart.#SwitchPoints(System.Int32,System.Web.UI.DataVisualization.Charting.DataPoint[]&,System.Single[]&,System.Single[]&,System.Int32[]&,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.PieChart.#ShiftIntervals(System.Double[],System.Double[],System.Double,System.Double)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.RadarChart.#GetEmptyPointValue(System.Web.UI.DataVisualization.Charting.DataPoint,System.Int32)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.RadarChart.#GetMiddlePoint(System.Drawing.PointF,System.Drawing.PointF)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.LineChart.#DrawTruncatedLine(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Drawing.Pen,System.Drawing.PointF,System.Drawing.PointF)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.LineChart.#DrawLine(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Web.UI.DataVisualization.Charting.DataPoint,System.Web.UI.DataVisualization.Charting.Series,System.Drawing.PointF,System.Drawing.PointF)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.LineChart.#GetCenterPointIndex(System.Collections.ArrayList)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartTypes.AreaChart.#GetAxisIntersection(System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Web.UI.DataVisualization.Charting.DataPoint3D,System.Single)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Formulas.TimeSeriesAndForecasting.#CopyDeterminant(System.Double[][])")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Formulas.TimeSeriesAndForecasting.#MakeSubDeterminant(System.Double[][],System.Int32)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Formulas.StatisticalAnalysis.#NormalDistributionInverse(System.Double)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Formulas.StatisticalAnalysis.#CheckNumOfPoints(System.Double[][])")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Formulas.StatisticalAnalysis.#GammLn(System.Double)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Formulas.StatisticalAnalysis.#NormalDistributionFunction(System.Double)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Formulas.StatisticalAnalysis.#BetaCF(System.Double,System.Double,System.Double)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Formulas.StatisticalAnalysis.#Mean(System.Double[])")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Formulas.StatisticalAnalysis.#Sort(System.Double[]&)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Formulas.PriceIndicators.#CheckNumOfValues(System.Double[][],System.Int32)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Formulas.PriceIndicators.#WeightedMovingAverage(System.Double[][],System.Double[][]&,System.String[],System.String[])")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Formulas.PriceIndicators.#ExponentialMovingAverage(System.Double[][],System.Double[][]&,System.String[],System.String[])")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Formulas.PriceIndicators.#MovingAverage(System.Double[][],System.Double[][]&,System.String[],System.String[])")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Data.DataManager.#IsPointSkipped(System.Web.UI.DataVisualization.Charting.DataPoint)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartImage.#AlignDataPointsByAxisLabel(System.Collections.ArrayList,System.Boolean,System.Web.UI.DataVisualization.Charting.PointSortOrder)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataFormula.#SplitParameters(System.String,System.String[]&)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataFormula.#DifferentNumberOfSeries(System.Double[][])")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataFormula.#RemoveEmptyValues(System.Double[][],System.Double[][]&)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataFormula.#CheckXValuesAlignment(System.Web.UI.DataVisualization.Charting.Series[])")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Matrix3D.#GetAngle(System.Web.UI.DataVisualization.Charting.Point3D,System.Web.UI.DataVisualization.Charting.Point3D)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Matrix3D.#GetBrightGradientColor(System.Drawing.Color,System.Double)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Matrix3D.#Set3DBarPoints(System.Single,System.Single,System.Single)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartHttpHandler.#GetHandler()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.CalloutAnnotation.#PathAddLineAsSegments(System.Drawing.Drawing2D.GraphicsPath,System.Single,System.Single,System.Single,System.Single,System.Int32)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#GetBrightGradientColor(System.Drawing.Color,System.Double)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#GetPieGradientBrush(System.Drawing.RectangleF,System.Drawing.Color,System.Drawing.Color)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#CreateRoundedRectPath(System.Drawing.RectangleF,System.Single[])")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#GetGradientBrush(System.Drawing.RectangleF,System.Drawing.Color,System.Drawing.Color,System.Web.UI.DataVisualization.Charting.GradientStyle)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#GetVisibleSurfacesWithPerspective(System.Web.UI.DataVisualization.Charting.Point3D[])")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#Round(System.Drawing.RectangleF)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#GetHatchBrush(System.Web.UI.DataVisualization.Charting.ChartHatchStyle,System.Drawing.Color,System.Drawing.Color)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#GetPolygonCirclePath(System.Drawing.RectangleF,System.Int32)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#GetPenStyle(System.Web.UI.DataVisualization.Charting.ChartDashStyle)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#AngleCorrection(System.Single,System.Double)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartGraphics.#CreateStarPolygon(System.Drawing.RectangleF,System.Int32)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataPointCustomProperties.#Invalidate(System.Boolean)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.AxisScaleBreakStyle.#IsExcludedSegment(System.Collections.ArrayList,System.Int32)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.AxisScaleBreakStyle.#GetLargestSequenseOfSegmentsWithNoPoints(System.Int32[],System.Int32&,System.Int32&)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Selection.#GetRegionMarkers(System.Drawing.Drawing2D.GraphicsPath)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Selection.#GetMarkers(System.Drawing.RectangleF,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Selection.#IsChartAreaCircular(System.Web.UI.DataVisualization.Charting.ChartArea)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.LegendItem.#Invalidate(System.Boolean)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Axis.#CalcYearInterval(System.Double)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Axis.#IsArrowInAxis(System.Web.UI.DataVisualization.Charting.ArrowOrientation,System.Web.UI.DataVisualization.Charting.AxisPosition)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Axis.#GetNumOfUnits(System.Double,System.Double,System.Web.UI.DataVisualization.Charting.DateTimeIntervalType)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Axis.#WordWrapLongestLabel(System.Web.UI.DataVisualization.Charting.CustomLabelsCollection)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Annotation.#GetAxisName(System.Web.UI.DataVisualization.Charting.Axis)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Annotation.#GetDataPointName(System.Web.UI.DataVisualization.Charting.DataPoint)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.CustomPropertiesTypeConverter+CustomAttributesPropertyDescriptor.#GetStringFromValue(System.Object)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataPoint.#ConvertValue(System.Object)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataPoint.#RemoveOneKeyword(System.String,System.String,System.String)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.CustomPropertiesTypeConverter.#GetSelectedSeries(System.Object)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.CustomPropertiesTypeConverter.#IsDataPoint(System.Object)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.CustomPropertiesTypeConverter.#GetPropertyAttributes(System.Web.UI.DataVisualization.Charting.Utilities.CustomPropertyInfo)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.LabelStyle.#GetLabelsPosition(System.Web.UI.DataVisualization.Charting.Axis)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.LabelStyle.#GetAllLabelsRect(System.Web.UI.DataVisualization.Charting.ChartArea,System.Web.UI.DataVisualization.Charting.AxisPosition,System.Drawing.StringFormat)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.LabelStyle.#Invalidate()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Margins.#Invalidate()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.SmartLabel.#CalculatePosition(System.Web.UI.DataVisualization.Charting.LabelAlignmentStyles,System.Drawing.PointF,System.Drawing.SizeF,System.Drawing.SizeF,System.Drawing.StringFormat&)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.SmartLabel.#GetLabelPosition(System.Web.UI.DataVisualization.Charting.ChartGraphics,System.Drawing.PointF,System.Drawing.SizeF,System.Drawing.StringFormat,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.SmartLabel.#LineIntersectRectangle(System.Drawing.RectangleF,System.Drawing.PointF,System.Drawing.PointF)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.AnnotationPathPoint.#Name")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Legend.#Invalidate(System.Boolean)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Legend.#GetMaximumNumberOfRows(System.Int32[])")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DefaultImageHandler.#NotSupportedStorageType(System.Web.UI.DataVisualization.Charting.ChartHttpHandlerSettings)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataManipulator.#CheckFilterElementCriteria(System.Web.UI.DataVisualization.Charting.DateRangeType,System.Int32[],System.Web.UI.DataVisualization.Charting.DataPoint)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataManipulator.#ConvertIntervalType(System.Web.UI.DataVisualization.Charting.IntervalType)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataManipulator.#ConvertElementIndexesToArray(System.String)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataManipulator.#ParseFormulaAndValueType(System.String,System.Int32&)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.DataManipulator.#CheckSeriesArrays(System.Web.UI.DataVisualization.Charting.Series[],System.Web.UI.DataVisualization.Charting.Series[])")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartArea.#IsMainSceneWallOnFront()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartArea.#GetDateInterval(System.Double,System.Double,System.Int32&,System.Int64&)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartArea.#Activate(System.Web.UI.DataVisualization.Charting.Axis,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ImageAnnotation.#GetImageAlignment(System.Drawing.ContentAlignment)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Series.#XSubAxisName")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Series.#YSubAxisName")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Series.#ReplaceOneKeyword(System.Web.UI.DataVisualization.Charting.Chart,System.Object,System.Object,System.Web.UI.DataVisualization.Charting.ChartElementType,System.String,System.String,System.Double,System.Web.UI.DataVisualization.Charting.ChartValueType,System.String)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Series.#Invalidate(System.Boolean,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Series.#CheckSupportedTypes(System.Type)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Grid.#Invalidate()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.ChartSerializer.#GetContentString(System.Web.UI.DataVisualization.Charting.SerializationContents,System.Boolean)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.StripLine.#Invalidate()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.StripLine.#Name")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Title.#Invalidate(System.Boolean)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Chart.#BeginInit()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Chart.#RenderingDpiX")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Chart.#RenderingDpiY")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Chart.#EndInit()")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Chart.#BuildNumber")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Chart.#CheckImageURLSeqFormat(System.String)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Utilities.BinaryFormatSerializer.#WritePropertyValue(System.Object,System.String,System.IO.BinaryWriter)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Utilities.BinaryFormatSerializer.#CheckPropertiesID(System.Collections.ArrayList)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Utilities.SerializerBase.#ShouldSerializeAsAttribute(System.Reflection.PropertyInfo,System.Object)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Utilities.SerializerBase.#GetObjectName(System.Object)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Utilities.SerializerBase.#IsChartBaseProperty(System.Object,System.Object,System.Reflection.PropertyInfo)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Utilities.SerializerBase.#CheckWildCars(System.Web.UI.DataVisualization.Charting.Utilities.SerializerBase+ItemInfo)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Utilities.SerializerBase.#SerializeICollAsAtribute(System.Reflection.PropertyInfo,System.Object)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Utilities.SerializerBase.#GetListNewItem(System.Collections.IList,System.String,System.String&,System.Boolean&)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Utilities.SerializerBase.#NameMatchMask(System.Web.UI.DataVisualization.Charting.Utilities.SerializerBase+ItemInfo,System.String,System.Int32&)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Utilities.SerializerBase.#ReadHashID(System.IO.BinaryReader)")]
+[module: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "System.Web.UI.DataVisualization.Charting.Utilities.ImageLoader.#LoadFromFile(System.String)")]
+
+#endregion // CA1822:MarkMembersAsStatic
+
+#region CA910:AlwaysSetViewStateUserKeyToUniqueValue
+[module: SuppressMessage("Microsoft.MSInternal", "CA910:AlwaysSetViewStateUserKeyToUniqueValue", Scope = "type", Target = "System.Web.UI.DataVisualization.Charting.ChartHttpHandler", Justification = "This page is actually http image handler and doesn't emit any viewstate")]
+#endregion //CA910:AlwaysSetViewStateUserKeyToUniqueValue \ No newline at end of file
diff --git a/mcs/class/referencesource/System.Web.DataVisualization/WebForm/General/ChartHttpHandler.cs b/mcs/class/referencesource/System.Web.DataVisualization/WebForm/General/ChartHttpHandler.cs
new file mode 100644
index 00000000000..dddf8dfb360
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.DataVisualization/WebForm/General/ChartHttpHandler.cs
@@ -0,0 +1,2158 @@
+
+//--------------------------------------------------------------------------------------------------------------------------
+// <copyright company=’Microsoft Corporation’>
+// Copyright © Microsoft Corporation. All Rights Reserved.
+// </copyright>
+//--------------------------------------------------------------------------------------------------------------------------
+// @owner=alexgor, deliant
+//==========================================================================================================================
+// File: ChartHttpHandler.cs
+//
+// Namespace: Microsoft.Reporting.Chart.WebForms
+//
+// Classes: ChartHttpHandler
+//
+// Purpose: ChartHttpHandler is a static class which is responsible to handle with
+// chart images, interactive images, scripts and other resources.
+//
+//
+// Reviewed: DT
+// Reviewed: deliant on 4/14/2011
+// MSRC#10470, VSTS#941768 http://vstfdevdiv:8080/web/wi.aspx?id=941768
+// Please review information associated with MSRC#10470 before making any changes to this file.
+// - Fixes:
+// - Fixed Directory Traversal/Arbitrary File Read, Delete with malformed image key.
+// - Honor HttpContext.Current.Trace.IsEnabled when generate and deliver chart trace info.
+// - Handle empty guid parameter ("?g=") as invalid when enforcing privacy.
+// - Replaced the privacy byte array comparison with custom check (otherwise posible EOS marker can return 0 length string).
+// - Added fixed string to session key to avoid direct session access.
+//
+// Added: deliant on 4/48/2011 fix for VSTS: 3593 - ASP.Net chart under web farm exhibit fast performace degradation
+// Summary: Under large web farm setup ( ~16 processes and up) chart control image handler
+// soon starts to show performace degradation up to denial of service, when a file system is used as storage.
+// Issues:
+// - The image files in count over 2000 in one single folder causes exponentially growing slow response,
+// especially on the remote server. The fix places the Image files in separate subfolders for each process.
+// - Private protection seeks and read several times in the image file istead reading the image at once
+// and then check for privacy marker. Separate small network reads are expensive.
+// - Due missing lock in initialization stage the chart lock files number can grow more that process max
+// number which can create abandon chart image files
+//==========================================================================================================================
+
+#region Namespaces
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Web;
+using System.Web.UI;
+using System.IO;
+using System.Web.Caching;
+using System.Collections;
+using System.Web.Configuration;
+using System.Resources;
+using System.Reflection;
+using System.Drawing;
+using System.Drawing.Imaging;
+using System.Threading;
+using System.Collections.Specialized;
+using System.Diagnostics;
+using System.Web.Hosting;
+using System.Web.SessionState;
+using System.Drawing.Drawing2D;
+using System.Runtime.InteropServices;
+using System.Globalization;
+using System.Diagnostics.CodeAnalysis;
+using System.Security.Permissions;
+using System.Security;
+using System.Security.Cryptography;
+using System.Collections.ObjectModel;
+using System.Web.UI.WebControls;
+
+#endregion //Namespaces
+
+namespace System.Web.UI.DataVisualization.Charting
+{
+ /// <summary>
+ /// ChartHttpHandler processes HTTP Web requests using, handles chart images, scripts and other resources.
+ /// </summary>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class ChartHttpHandler : Page, IRequiresSessionState, IHttpHandler
+ {
+
+ #region Fields
+
+ // flag that indicates whether this chart handler is installed
+ private static bool _installed = false;
+
+ // flag that indicates whether this chart handler is installed
+ private static bool _installChecked = false;
+
+ // storage settings
+ private static ChartHttpHandlerSettings _parameters = null;
+
+
+ // machine hash key which is part in chart image file name
+ private static string _machineHash = "_" + Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture) + "_";
+
+ // web gadren controller file. stays locked diring process lifetime.
+ private static FileStream _controllerFileStream = null;
+ private static string _controllerDirectory = null;
+ private static object _initHandlerLock = new object();
+ // used for storing Guid key in context;
+ internal static string ContextGuidKey = "{89FA5660-BD13-4f1b-8C7C-355CEC92CC7E}";
+
+ // web gadren controller file. stays locked diring process lifetime.
+ private const string handlerCheckQry = "check";
+
+ #endregion //Fields
+
+ #region Consts
+
+ internal const string ChartHttpHandlerName = "ChartImg.axd";
+ internal const string ChartHttpHandlerAppSection = "ChartImageHandler";
+ internal const string DefaultConfigSettings = @"storage=file;timeout=20;dir=c:\TempImageFiles\;";
+ internal const string WebDevServerUseConfigSettings = "WebDevServerUseConfigSettings";
+ #endregion //Consts
+
+ #region Constructors
+
+ /// <summary>
+ /// Ensures that the handler is initialized.
+ /// </summary>
+ /// <param name="hardCheck">if set to <c>true</c> then will be thrown all excepitons.</param>
+ private static void EnsureInitialized(bool hardCheck)
+ {
+ if (_installChecked)
+ {
+ return;
+ }
+ lock (_initHandlerLock)
+ {
+ if (_installChecked)
+ {
+ return;
+ }
+ if (HttpContext.Current != null)
+ {
+ try
+ {
+ using (TextWriter w = new StringWriter(CultureInfo.InvariantCulture))
+ {
+ HttpContext.Current.Server.Execute(ChartHttpHandlerName + "?" + handlerCheckQry + "=0", w);
+ }
+ _installed = true;
+ }
+ catch (HttpException)
+ {
+ if (hardCheck) throw;
+ }
+ catch (SecurityException)
+ {
+ // under minimal configuration we assume that the hanlder is installed if app settings are present.
+ _installed = !String.IsNullOrEmpty(WebConfigurationManager.AppSettings[ChartHttpHandlerAppSection]);
+ }
+ }
+ if (_installed || hardCheck)
+ {
+ InitializeControllerFile();
+ }
+ _installChecked = true;
+ }
+ }
+
+ /// <summary>
+ /// Initializes the storage settings
+ /// </summary>
+ //static ChartHttpHandler()
+ private static ChartHttpHandlerSettings InitializeParameters()
+ {
+
+ ChartHttpHandlerSettings result = new ChartHttpHandlerSettings();
+ if (HttpContext.Current != null)
+ {
+ // Read settings from config; use DefaultConfigSettings in case when setting is not found
+ string configSettings = WebConfigurationManager.AppSettings[ChartHttpHandlerAppSection];
+ if (String.IsNullOrEmpty(configSettings))
+ configSettings = DefaultConfigSettings;
+
+ result = new ChartHttpHandlerSettings(configSettings);
+ }
+ else
+ {
+ result.PrepareDesignTime();
+ }
+
+ return result;
+ }
+
+ private static void ResetControllerStream()
+ {
+ if (_controllerFileStream != null)
+ _controllerFileStream.Dispose();
+ _controllerFileStream = null;
+ _controllerDirectory = null;
+ }
+
+ private static void InitializeControllerFile()
+ {
+ if (Settings.StorageType == ChartHttpHandlerStorageType.File && _controllerFileStream == null)
+ {
+ byte[] data = System.Text.Encoding.UTF8.GetBytes("chart io controller file");
+ // 2048 processes max.
+ for (Int32 i = 0; i < 2048; i++)
+ {
+ try
+ {
+ ResetControllerStream();
+ string controllerFileName = String.Format(CultureInfo.InvariantCulture, "{0}msc_cntr_{1}.txt", Settings.Directory, i);
+ _controllerDirectory = String.Format(CultureInfo.InvariantCulture, "charts_{0}", i);
+ _controllerFileStream = new System.IO.FileStream(controllerFileName, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite);
+ _controllerFileStream.Lock(0, data.Length);
+ _controllerFileStream.Write(data, 0, data.Length);
+ _machineHash = "_" + i + "_";
+ if (!Directory.Exists(Settings.Directory + _controllerDirectory))
+ {
+ Directory.CreateDirectory(Settings.Directory + _controllerDirectory);
+ }
+ else
+ {
+ TimeSpan lastWrite = DateTime.Now - Directory.GetLastWriteTime(Settings.Directory + _controllerDirectory);
+ if (lastWrite.Seconds < Settings.Timeout.Seconds)
+ {
+ continue;
+ }
+ }
+ return;
+ }
+ catch (IOException)
+ {
+ continue;
+ }
+ catch (Exception)
+ {
+ ResetControllerStream();
+ throw;
+ }
+ }
+ ResetControllerStream();
+ throw new UnauthorizedAccessException(SR.ExceptionHttpHandlerTempDirectoryUnaccesible(Settings.Directory));
+ }
+ }
+
+ #endregion //Constructors
+
+ #region Methods
+
+ #region ChartImage
+
+ /// <summary>
+ /// Processes the saved image.
+ /// </summary>
+ /// <param name="context">The context.</param>
+ /// <returns>false if the image cannot be processed</returns>
+ private static bool ProcessSavedChartImage(HttpContext context)
+ {
+ // image delivery doesn't depend if handler is intitilzed or not.
+ String key = context.Request["i"];
+ CurrentGuidKey = context.Request["g"];
+ IChartStorageHandler handler = GetHandler();
+ try
+ {
+ Byte[] data = handler.Load(KeyToUnc(key));
+ if (data != null && data.Length > 0)
+ {
+ context.Response.Charset = "";
+ context.Response.ContentType = GetMime(key);
+ context.Response.BinaryWrite(data);
+ Diagnostics.TraceWrite(SR.DiagnosticChartImageServed(key), null);
+ if (Settings.StorageType == ChartHttpHandlerStorageType.Session || Settings.DeleteAfterServicing)
+ {
+ handler.Delete(key);
+ Diagnostics.TraceWrite(SR.DiagnosticChartImageDeleted(key), null);
+ }
+ return true;
+ }
+ if (!(handler is DefaultImageHandler))
+ {
+ // the default handler will write more detailed message
+ Diagnostics.TraceWrite(SR.DiagnosticChartImageServedFail(key, SR.DiagnosticChartImageServedFailNotFound), null);
+ }
+ }
+ catch (NullReferenceException nre)
+ {
+ Diagnostics.TraceWrite(SR.DiagnosticChartImageServedFail(key, String.Empty), nre);
+ throw;
+ }
+ catch (IOException ioe)
+ {
+ Diagnostics.TraceWrite(SR.DiagnosticChartImageServedFail(key, String.Empty), ioe);
+ throw;
+ }
+ catch (SecurityException se)
+ {
+ Diagnostics.TraceWrite(SR.DiagnosticChartImageServedFail(key, String.Empty), se);
+ throw;
+ }
+ return false;
+ }
+
+ #endregion //ChartImage
+
+ #region Utilities
+
+
+ /// <summary>
+ /// Gets or sets the current GUID key.
+ /// </summary>
+ /// <value>The current GUID key.</value>
+ internal static string CurrentGuidKey
+ {
+ get
+ {
+ if (HttpContext.Current != null)
+ {
+ return (string)HttpContext.Current.Items[ContextGuidKey];
+ }
+ return String.Empty;
+ }
+ set
+ {
+ if (HttpContext.Current != null)
+ {
+ if (String.IsNullOrEmpty(value))
+ {
+ HttpContext.Current.Items.Remove(ContextGuidKey);
+ }
+ else
+ {
+ HttpContext.Current.Items[ContextGuidKey] = value;
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets the chart image handler interface reference.
+ /// </summary>
+ /// <returns></returns>
+ private static IChartStorageHandler GetHandler()
+ {
+ return ChartHttpHandler.Settings.GetHandler();
+ }
+
+ /// <summary>
+ /// Determines whether this instance is installed.
+ /// </summary>
+ internal static void EnsureInstalled()
+ {
+ EnsureInitialized(true);
+ EnsureSessionIsClean();
+ }
+
+ /// <summary>
+ /// Gets the handler URL.
+ /// </summary>
+ /// <returns></returns>
+ private static String GetHandlerUrl()
+ {
+ // the handler have to be executed in current cxecution path in order to get proper user identity
+ String appDir = Path.GetDirectoryName(HttpContext.Current.Request.CurrentExecutionFilePath ?? "").Replace("\\","/");
+ if (!appDir.EndsWith("/", StringComparison.Ordinal))
+ {
+ appDir += "/";
+ }
+ return appDir + ChartHttpHandlerName + "?";
+ }
+
+
+ /// <summary>
+ /// Gets the MIME type by resource url.
+ /// </summary>
+ /// <param name="resourceUrl">The resource URL.</param>
+ /// <returns></returns>
+ [SuppressMessage("Microsoft.Globalization", "CA1308",
+ Justification = "No security decision is being made on the ToLowerInvariant() call. It is being used to ensure the file extension is lowercase")]
+ private static String GetMime(String resourceUrl)
+ {
+ String ext = Path.GetExtension(resourceUrl);
+
+ ext = ext.ToLowerInvariant();
+
+ if (ext == ".js")
+ {
+ return "text/javascript";
+ }
+ else if (ext == ".htm")
+ {
+ return "text/html";
+ }
+ else if (".css,.html,.xml".IndexOf(ext, StringComparison.Ordinal) != -1)
+ {
+ return "text/" + ext.Substring(1);
+ }
+ else if (".jpg;.jpeg;.gif;.png;.emf".IndexOf(ext, StringComparison.Ordinal) != -1)
+ {
+ string fmt = ext.Substring(1).Replace("jpg", "jpeg");
+ return "image/" + fmt;
+ }
+ return "text/plain";
+ }
+
+ /// <summary>
+ /// Generates the chart image file name (key).
+ /// </summary>
+ /// <param name="ext">The ext.</param>
+ /// <param name="fileName">Name of the file.</param>
+ /// <returns></returns>
+ private static String GenerateKey(String ext)
+ {
+ String fmtKey = "chart" + _machineHash + "{0}." + ext;
+ RingTimeTracker rt = RingTimeTrackerFactory.GetRingTracker(fmtKey);
+ if (!String.IsNullOrEmpty(_controllerDirectory) && String.IsNullOrEmpty(Settings.FolderName))
+ {
+ return _controllerDirectory + @"\" + rt.GetNextKey();
+ }
+ return Settings.FolderName + rt.GetNextKey();
+ }
+
+ private static String KeyToUnc(String key)
+ {
+ if (!String.IsNullOrEmpty(key))
+ {
+ return key.Replace("/", @"\");
+ }
+ return key;
+ }
+
+ private static String KeyFromUnc(String key)
+ {
+ if (!String.IsNullOrEmpty(key))
+ {
+ return key.Replace(@"\", "/");
+ }
+ return key;
+ }
+
+ /// <summary>
+ /// Gets a URL by specified request query, file key.
+ /// </summary>
+ /// <param name="query">The query.</param>
+ /// <param name="fileKey">The file key.</param>
+ /// <param name="currentGuid">The current GUID.</param>
+ /// <returns></returns>
+ private static String GetUrl(String query, String fileKey, string currentGuid)
+ {
+ return GetHandlerUrl() + query + "=" + KeyFromUnc(fileKey) + "&g=" + currentGuid;
+ }
+
+ /// <summary>
+ /// Gets the image url.
+ /// </summary>
+ /// <param name="stream">The stream.</param>
+ /// <param name="imageExt">The image extention.</param>
+ /// <returns>Generated the image source URL</returns>
+ [SuppressMessage("Microsoft.Globalization", "CA1308",
+ Justification="No security decision is being made on the ToLowerInvariant() call. It is being used to ensure the file extension is lowercase")]
+ internal static String GetChartImageUrl(MemoryStream stream, String imageExt)
+ {
+ EnsureInitialized(true);
+ // generates new guid
+ string guidKey = Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture);
+ // set new guid in context
+ CurrentGuidKey = guidKey;
+
+ Int32 tryCounts = 10;
+ while (tryCounts > 0)
+ {
+ tryCounts--;
+ try
+ {
+ String key = GenerateKey(imageExt.ToLowerInvariant());
+ IChartStorageHandler handler = Settings.GetHandler();
+ handler.Save(key, stream.ToArray());
+ if (!(handler is DefaultImageHandler))
+ {
+ Diagnostics.TraceWrite(SR.DiagnosticChartImageSaved(key), null);
+ }
+ Settings.FolderName = String.Empty;
+ // clear guid so is not accessable out of the scope;
+ CurrentGuidKey = String.Empty;
+ return ChartHttpHandler.GetUrl("i", key, guidKey);
+ }
+ catch (IOException) { }
+ catch { throw;}
+ }
+ throw new IOException(SR.ExceptionHttpHandlerCanNotSave);
+ }
+
+ /// <summary>
+ /// Ensures the session is clean.
+ /// </summary>
+ private static void EnsureSessionIsClean()
+ {
+ if (!_installed) return;
+ if (Settings.StorageType == ChartHttpHandlerStorageType.Session)
+ {
+ IChartStorageHandler handler = ChartHttpHandler.Settings.GetHandler();
+ foreach (RingTimeTracker tracker in RingTimeTrackerFactory.OpenedRingTimeTrackers())
+ {
+ tracker.ForEach(true, delegate(RingItem item)
+ {
+ if (item.InUse && String.CompareOrdinal(Settings.ReadSessionKey(), item.SessionID) == 0)
+ {
+ handler.Delete(tracker.GetKey(item));
+ Diagnostics.TraceWrite(SR.DiagnosticChartImageDeleted(tracker.GetKey(item)), null);
+ item.InUse = false;
+ }
+ }
+ );
+ }
+ }
+ }
+ #endregion //Utilities
+
+ #region Diagnostics
+
+ private static void DiagnosticWriteAll(HttpContext context)
+ {
+ HtmlTextWriter writer;
+ using (TextWriter w = new StringWriter(CultureInfo.CurrentCulture))
+ {
+
+ if (context.Request.Browser != null)
+ writer = context.Request.Browser.CreateHtmlTextWriter(w);
+ else
+ writer = new Html32TextWriter(w);
+ writer.Write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n\r<html xmlns=\"http://www.w3.org/1999/xhtml\" >\n\r");
+ writer.Write("<head>\r\n");
+ writer.Write("<style type=\"text/css\">\r\n body, span, table, td, th, div, caption {font-family: Tahoma, Arial, Helvetica, sans-serif;font-size: 10pt;} caption {background-color:Black; color: White; font-weight:bold; padding: 4px; text-align:left; } \r\n</style>\r\n");
+ writer.Write("</head>\r\n<body style=\"width:978px\">\r\n");
+ writer.Write("<h2>" + SR.DiagnosticHeader + "</h2>\r\n<hr/><br/>\n\r");
+ DiagnosticWriteSettings(writer);
+ writer.Write("<hr/>");
+ DiagnosticWriteActivity(writer);
+ writer.Write("<br/><hr/>\n\r<span>");
+ try
+ {
+ writer.Write(typeof(Chart).AssemblyQualifiedName);
+ }
+ catch ( SecurityException ) {}
+ writer.Write("</span></body>\r\n</html>\r\n");
+ context.Response.Write(w.ToString());
+ }
+ }
+
+ private static void DiagnosticWriteSettings(HtmlTextWriter writer)
+ {
+ writer.Write("<h4>" + SR.DiagnosticSettingsConfig(WebConfigurationManager.AppSettings[ChartHttpHandlerAppSection]) + "</h4>");
+ GridView grid = CreateGridView( true);
+ grid.Caption = SR.DiagnosticSettingsHeader;
+ BoundField field = new BoundField();
+ field.DataField = "Key";
+ field.HeaderText = SR.DiagnosticSettingsKey;
+ field.HeaderStyle.HorizontalAlign = HorizontalAlign.Left;
+ grid.Columns.Add(field);
+
+ field = new BoundField();
+ field.DataField = "Value";
+ field.HeaderText = SR.DiagnosticSettingsValue;
+ field.HeaderStyle.HorizontalAlign = HorizontalAlign.Left;
+
+ grid.Columns.Add(field);
+ Dictionary<String, String> settings = new Dictionary<String, String>();
+
+ settings.Add("StorageType", Settings.StorageType.ToString());
+ settings.Add("TimeOut", Settings.Timeout.ToString());
+ if (Settings.StorageType == ChartHttpHandlerStorageType.File)
+ {
+ settings.Add("Directory", Settings.Directory);
+ }
+ settings.Add("DeleteAfterServicing", Settings.DeleteAfterServicing.ToString());
+ settings.Add("PrivateImages", Settings.PrivateImages.ToString());
+ settings.Add("ImageOwnerKey", Settings.ImageOwnerKey.ToString());
+ settings.Add("CustomHandlerName", Settings.CustomHandlerName);
+ settings.Add(ChartHttpHandler.WebDevServerUseConfigSettings, String.Equals(Settings[ChartHttpHandler.WebDevServerUseConfigSettings], "true", StringComparison.OrdinalIgnoreCase).ToString());
+
+ grid.DataSource = settings;
+ grid.DataBind();
+
+ grid.RenderControl(writer);
+
+ }
+
+ private static void DiagnosticWriteActivity(HtmlTextWriter writer)
+ {
+ GridView grid = CreateGridView( true);
+ grid.Caption = SR.DiagnosticActivityHeader;
+ BoundField field = new BoundField();
+ field.DataField = "DateStamp";
+ field.ItemStyle.VerticalAlign = VerticalAlign.Top;
+ field.HeaderText = SR.DiagnosticActivityTime;
+ field.HeaderStyle.HorizontalAlign = HorizontalAlign.Left;
+ field.HeaderStyle.Width = 150;
+ grid.Columns.Add(field);
+
+ field = new BoundField();
+ field.DataField = "Url";
+ field.HeaderText = SR.DiagnosticActivityMessage;
+ field.HeaderStyle.HorizontalAlign = HorizontalAlign.Left;
+
+ grid.Columns.Add(field);
+
+ grid.RowDataBound += new GridViewRowEventHandler(DiagnosticActivityGrid_RowDataBound);
+
+ grid.DataSource = Diagnostics.Messages;
+ grid.DataBind();
+ grid.RenderControl(writer);
+
+ }
+
+ static void DiagnosticActivityGrid_RowDataBound(object sender, GridViewRowEventArgs e)
+ {
+ if (e.Row.RowType == DataControlRowType.DataRow)
+ {
+ Diagnostics.HandlerPageTraceInfo currentInfo = (Diagnostics.HandlerPageTraceInfo)e.Row.DataItem;
+ TableCell cell = e.Row.Cells[1];
+
+ cell.Controls.Add(new Label() { Text = currentInfo.Verb + "," + currentInfo.Url });
+
+ GridView grid = CreateGridView(false);
+ grid.Style[HtmlTextWriterStyle.MarginLeft] = "20px";
+
+ grid.ShowHeader = false;
+
+ BoundField field = new BoundField();
+ field.DataField = "Text";
+ field.HeaderStyle.HorizontalAlign = HorizontalAlign.Left;
+ grid.Columns.Add(field);
+
+ grid.DataSource = currentInfo.Events;
+ grid.DataBind();
+ cell.Controls.Add(grid);
+ }
+ }
+
+ private static GridView CreateGridView(bool withAlternateStyle)
+ {
+ GridView result = new GridView();
+
+ result.AutoGenerateColumns = false;
+ result.CellPadding = 4;
+ result.Font.Names = new string[] { "Tahoma", "Ariel" };
+ result.Font.Size = new FontUnit(10, UnitType.Point);
+ result.BorderWidth = 0;
+ result.GridLines = GridLines.None;
+ result.Width = new Unit(100, UnitType.Percentage);
+
+ if (withAlternateStyle)
+ {
+ result.AlternatingRowStyle.BackColor = Color.White;
+ result.RowStyle.BackColor = ColorTranslator.FromHtml("#efefef");
+ result.RowStyle.ForeColor = Color.Black;
+ result.AlternatingRowStyle.ForeColor = Color.Black;
+ }
+
+ result.HeaderStyle.BackColor = Color.Gray;
+ result.HeaderStyle.ForeColor = Color.White;
+ result.HeaderStyle.Font.Bold = true;
+ return result;
+ }
+
+ #endregion //Diagnostics
+
+ #endregion //Methods
+
+ #region Properties
+
+ /// <summary>
+ /// Gets the chart image storage settings registred in web.config file under ChartHttpHandler key.
+ /// </summary>
+ /// <value>The settings.</value>
+ public static ChartHttpHandlerSettings Settings
+ {
+ get
+ {
+ if (_parameters == null)
+ {
+ _parameters = InitializeParameters();
+ }
+ return _parameters;
+ }
+ }
+
+ #endregion //Properties
+
+ #region IHttpHandler Members
+
+ /// <summary>
+ /// Gets a value indicating whether the <see cref="T:System.Web.UI.Page"/> object can be reused.
+ /// </summary>
+ /// <value></value>
+ /// <returns>false in all cases. </returns>
+ bool IHttpHandler.IsReusable
+ {
+ get { return true; }
+ }
+
+ /// <summary>
+ /// Enables processing of HTTP Web requests by a custom HttpHandler that implements the <see cref="T:System.Web.IHttpHandler"></see> interface.
+ /// </summary>
+ /// <param name="context">An <see cref="T:System.Web.HttpContext"></see> object that provides references to the intrinsic server objects (for example, Request, Response, Session, and Server) used to service HTTP requests.</param>
+ void IHttpHandler.ProcessRequest(HttpContext context)
+ {
+ if (context.Request["i"] != null && ProcessSavedChartImage(context))
+ {
+ return;
+ }
+ else if (context.Request["trace"] != null && Diagnostics.IsTraceEnabled)
+ {
+ DiagnosticWriteAll(context);
+ return;
+ }
+ else if (context.Request[handlerCheckQry] != null)
+ {
+ // handler execute test - returns no errors.
+ return;
+ }
+ context.Response.StatusCode = 404;
+ context.Response.StatusDescription = SR.ExceptionHttpHandlerImageNotFound;
+ }
+
+ #endregion
+
+ }
+
+ #region Enumerations
+
+ /// <summary>
+ /// Determines chart image storage medium
+ /// </summary>
+ public enum ChartHttpHandlerStorageType
+ {
+ /// <summary>
+ /// Static into application memory
+ /// </summary>
+ InProcess,
+
+ /// <summary>
+ /// File system
+ /// </summary>
+ File,
+ /// <summary>
+ /// Using session as storage
+ /// </summary>
+ Session
+
+ }
+ /// <summary>
+ /// Determines the image owner key for privacy protection.
+ /// </summary>
+ internal enum ImageOwnerKeyType
+ {
+ /// <summary>
+ /// No privacy protection.
+ /// </summary>
+ None,
+ /// <summary>
+ /// The key will be automatically determined.
+ /// </summary>
+ Auto,
+ /// <summary>
+ /// The user name will be used as key.
+ /// </summary>
+ UserID,
+ /// <summary>
+ /// The AnonymousID will be used as key.
+ /// </summary>
+ AnonymousID,
+ /// <summary>
+ /// The SessionID will be used as key.
+ /// </summary>
+ SessionID
+ }
+
+ #endregion
+
+ #region IChartStorageHandler interface
+
+ /// <summary>
+ /// Defines methods to manage rendered chart images in a storage.
+ /// </summary>
+ public interface IChartStorageHandler
+ {
+ /// <summary>
+ /// Saves the data into external medium.
+ /// </summary>
+ /// <param name="key">Index key.</param>
+ /// <param name="data">Image data.</param>
+ void Save(String key, Byte[] data);
+
+
+ /// <summary>
+ /// Loads the data from external medium.
+ /// </summary>
+ /// <param name="key">Index key.</param>
+ /// <returns>A byte array with image data</returns>
+ Byte[] Load(String key);
+
+
+ /// <summary>
+ /// Deletes the data from external medium.
+ /// </summary>
+ /// <param name="key">Index key.</param>
+ void Delete(String key);
+
+ /// <summary>
+ /// Checks for existence of data under specified key.
+ /// </summary>
+ /// <param name="key">Index key.</param>
+ /// <returns>True if data exists under specified key</returns>
+ bool Exists(String key);
+ }
+
+ #endregion
+
+ #region ChartHttpHandlerSettings Class
+
+ /// <summary>
+ /// Enables access to the chart image storage settings.
+ /// </summary>
+#if ASPPERM_35
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
+ public class ChartHttpHandlerSettings
+ {
+ #region Fields
+
+ private StorageSettingsCollection _ssCollection = new StorageSettingsCollection();
+
+ private string _sesionKey = "chartKey-" + Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture);
+
+ #endregion //Fields
+
+ #region Properties
+
+ private ChartHttpHandlerStorageType _chartImageStorage = ChartHttpHandlerStorageType.File;
+
+ /// <summary>
+ /// Gets or sets the chart image storage type.
+ /// </summary>
+ /// <value>The chart image storage.</value>
+ public ChartHttpHandlerStorageType StorageType
+ {
+ get { return _chartImageStorage; }
+ set { _chartImageStorage = value; }
+ }
+
+ private TimeSpan _timeout = TimeSpan.FromSeconds(30);
+
+ /// <summary>
+ /// Gets or sets the timeout.
+ /// </summary>
+ /// <value>The timeout.</value>
+ public TimeSpan Timeout
+ {
+ get { return _timeout; }
+ set { _timeout = value; }
+ }
+
+ private String _url = "~/";
+ /// <summary>
+ /// Gets or sets the URL.
+ /// </summary>
+ /// <value>The URL.</value>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")]
+ public String Url
+ {
+ get { return _url; }
+ set { _url = value; }
+ }
+
+ private String _directory = String.Empty;
+ /// <summary>
+ /// Gets or sets the directory.
+ /// </summary>
+ /// <value>The directory.</value>
+ public String Directory
+ {
+ get { return _directory; }
+ set { _directory = value; }
+ }
+
+ private const String _folderKeyName = "{5FF3B636-70BA-4180-B7C5-FDD77D8FA525}";
+ /// <summary>
+ /// Gets or sets the folder which will be used for storing images under <see cref="Directory"/>.
+ /// </summary>
+ /// <value>The folder name.</value>
+ public String FolderName
+ {
+ get
+ {
+ if (HttpContext.Current != null && HttpContext.Current.Items.Contains(_folderKeyName))
+ {
+ return (string)HttpContext.Current.Items[_folderKeyName];
+ }
+ return String.Empty;
+ }
+ set
+ {
+ if (!String.IsNullOrEmpty(value))
+ {
+ if (!(value.EndsWith("/", StringComparison.Ordinal) || value.EndsWith("\\", StringComparison.Ordinal)))
+ {
+ value += "\\";
+ }
+ this.ValidateUri(value);
+ }
+ if (HttpContext.Current != null)
+ {
+ HttpContext.Current.Items[_folderKeyName] = value;
+ }
+ }
+ }
+
+ internal void ValidateUri(string key)
+ {
+ if (this.StorageType == ChartHttpHandlerStorageType.File)
+ {
+ FileInfo fi = new FileInfo(this.Directory + key);
+ Uri directory = new Uri(this.Directory);
+ Uri combinedDirectory = new Uri(fi.FullName);
+ if (directory.IsBaseOf(combinedDirectory))
+ {
+ // it is fine.
+ return;
+ }
+ throw new UnauthorizedAccessException(SR.ExceptionHttpHandlerInvalidLocation);
+ }
+ }
+
+ private String _customHandlerName = typeof(DefaultImageHandler).FullName;
+ /// <summary>
+ /// Gets or sets the name of the custom handler.
+ /// </summary>
+ /// <value>The name of the custom handler.</value>
+ public String CustomHandlerName
+ {
+ get { return _customHandlerName; }
+ set { _customHandlerName = value; }
+ }
+
+
+ private Type _customHandlerType = null;
+ /// <summary>
+ /// Gets the type of the custom handler.
+ /// </summary>
+ /// <value>The type of the custom handler.</value>
+ public Type HandlerType
+ {
+ get
+ {
+ if (this._customHandlerType == null)
+ {
+ this._customHandlerType = Type.GetType(this.CustomHandlerName, true);
+ }
+ return this._customHandlerType;
+ }
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether the handler will utilize private images.
+ /// </summary>
+ /// <value><c>true</c> if the handler will utilize private images; otherwise, <c>false</c>.</value>
+ /// <remarks>
+ /// When PrivateImages is set the handler will not return images out of session scope and
+ /// the client will not be able to download somebody else's images. This is default behavoiur.
+ /// </remarks>
+ public bool PrivateImages
+ {
+ get
+ {
+ return ImageOwnerKey != ImageOwnerKeyType.None;
+ }
+ }
+
+
+
+ /// <summary>
+ /// Gets a settings parameter with the specified name registred in web.config file under ChartHttpHandler key.
+ /// </summary>
+ /// <value></value>
+ public string this[string name]
+ {
+ get
+ {
+ return this._ssCollection[name];
+ }
+ }
+
+ #endregion //Properties
+
+ #region Constructors
+ /// <summary>
+ /// Initializes a new instance of the <see cref="T:StorageSettings"/> class.
+ /// </summary>
+ internal ChartHttpHandlerSettings()
+ {
+ ImageOwnerKey = ImageOwnerKeyType.Auto;
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="T:ChartHttpHandlerParameters"/> class.
+ /// </summary>
+ /// <param name="parameters">The parameters.</param>
+ internal ChartHttpHandlerSettings(String parameters) : this()
+ {
+ this.ParseParams(parameters);
+ this._ssCollection.SetReadOnly(true);
+ }
+
+ #endregion //Constructors
+
+ #region Methods
+
+ private ConstructorInfo _handlerConstructor = null;
+ IChartStorageHandler _storageHandler = null;
+ /// <summary>
+ /// Creates the handler instance.
+ /// </summary>
+ /// <returns></returns>
+ internal IChartStorageHandler GetHandler()
+ {
+ if (_storageHandler == null)
+ {
+ if (this._handlerConstructor == null)
+ {
+ this.InspectHandlerLoader();
+ }
+ _storageHandler = this._handlerConstructor.Invoke(new object[0]) as IChartStorageHandler;
+ }
+ return _storageHandler;
+ }
+
+ /// <summary>
+ /// Inspects the handler if it is valid.
+ /// </summary>
+ private void InspectHandlerLoader()
+ {
+ this._handlerConstructor = this.HandlerType.GetConstructor(
+ BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance,
+ null,
+ new Type[0],
+ new ParameterModifier[0]);
+ if (this._handlerConstructor == null)
+ {
+ throw new InvalidOperationException( SR.ExceptionHttpHandlerCanNotLoadType( this.HandlerType.FullName ));
+ }
+ if (this.GetHandler() == null)
+ {
+ throw new InvalidOperationException(SR.ExceptionHttpHandlerImageHandlerInterfaceUnsupported(ChartHttpHandler.Settings.HandlerType.FullName));
+ }
+ }
+
+ /// <summary>
+ /// Parses the params from web.config file key.
+ /// </summary>
+ /// <param name="parameters">The parameters.</param>
+ private void ParseParams(String parameters)
+ {
+ if (!String.IsNullOrEmpty(parameters))
+ {
+
+ String[] pairs = parameters.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
+ for (int index = 0; index < pairs.Length; index++)
+ {
+ String item = pairs[index].Trim();
+ int eqPositon = item.IndexOf('=');
+ if (eqPositon != -1)
+ {
+ String name = item.Substring(0, eqPositon).Trim();
+ String value = item.Substring(eqPositon + 1).Trim();
+ this._ssCollection.Add(name, value);
+ if (name.StartsWith("stor", StringComparison.OrdinalIgnoreCase))
+ {
+ if (value.StartsWith("inproc", StringComparison.OrdinalIgnoreCase) || value.StartsWith("memory", StringComparison.OrdinalIgnoreCase))
+ {
+ this.StorageType = ChartHttpHandlerStorageType.InProcess;
+ }
+ else if (value.StartsWith("file", StringComparison.OrdinalIgnoreCase))
+ {
+ this.StorageType = ChartHttpHandlerStorageType.File;
+ }
+ else if (value.StartsWith("session", StringComparison.OrdinalIgnoreCase))
+ {
+ this.StorageType = ChartHttpHandlerStorageType.Session;
+ }
+ else
+ {
+ throw new System.Configuration.SettingsPropertyWrongTypeException(SR.ExceptionHttpHandlerParameterUnknown(name, value));
+ }
+ }
+ else if (name.StartsWith("url", StringComparison.OrdinalIgnoreCase))
+ {
+ if (!value.EndsWith("/", StringComparison.Ordinal))
+ {
+ value += "/";
+ }
+ this.Url = value;
+ }
+ else if (name.StartsWith("dir", StringComparison.OrdinalIgnoreCase))
+ {
+ this.Directory = value;
+ }
+ else if (name.StartsWith("time", StringComparison.OrdinalIgnoreCase))
+ {
+ try
+ {
+ int seconds = Int32.Parse(value, CultureInfo.InvariantCulture);
+ if (seconds < -1)
+ {
+ throw new System.Configuration.SettingsPropertyWrongTypeException(SR.ExceptionHttpHandlerValueInvalid);
+ }
+ if (seconds == -1)
+ {
+ this.Timeout = TimeSpan.MaxValue;
+ }
+ else
+ {
+ this.Timeout = TimeSpan.FromSeconds(seconds);
+ }
+ }
+ catch (Exception exception)
+ {
+ throw new System.Configuration.SettingsPropertyWrongTypeException(SR.ExceptionHttpHandlerTimeoutParameterInvalid, exception);
+ }
+ }
+ else if (name.StartsWith("handler", StringComparison.OrdinalIgnoreCase))
+ {
+ this.CustomHandlerName = value;
+ }
+ else if (name.StartsWith("privateImages", StringComparison.OrdinalIgnoreCase))
+ {
+ bool privateImg = true;
+ if (Boolean.TryParse(value, out privateImg) && !privateImg)
+ {
+ ImageOwnerKey = ImageOwnerKeyType.None;
+ }
+ }
+ else if (name.StartsWith("imageOwnerKey", StringComparison.OrdinalIgnoreCase))
+ {
+ try
+ {
+ ImageOwnerKey = (ImageOwnerKeyType)Enum.Parse(typeof(ImageOwnerKeyType), value, true);
+ }
+ catch (ArgumentException)
+ {
+ throw new System.Configuration.SettingsPropertyWrongTypeException(SR.ExceptionHttpHandlerParameterInvalid(name, value));
+ }
+ }
+
+ }
+ }
+ }
+ this.Inspect();
+ }
+
+ /// <summary>
+ /// Determines whether web dev server is active.
+ /// </summary>
+ /// <returns>
+ /// <c>true</c> if web dev server active; otherwise, <c>false</c>.
+ /// </returns>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "GetCurrentProcess will fail if there is no access. This is by design. ")]
+ // VSTS: 5176 Security annotation violations in System.Web.DataVisualization.dll
+ [SecuritySafeCritical]
+ private static bool IsWebDevActive()
+ {
+ try
+ {
+ Process process = Process.GetCurrentProcess();
+ if (process.ProcessName.StartsWith("WebDev.WebServer", StringComparison.OrdinalIgnoreCase))
+ {
+ return true;
+ }
+ if (process.ProcessName.StartsWith("ii----press", StringComparison.OrdinalIgnoreCase))
+ {
+ return true;
+ }
+ }
+ catch (SecurityException)
+ {
+ }
+ return false;
+ }
+ /// <summary>
+ /// Inspects and validates this instance after loading params.
+ /// </summary>
+ internal void Inspect()
+ {
+ switch (this.StorageType)
+ {
+ case ChartHttpHandlerStorageType.InProcess:
+
+ break;
+
+ case ChartHttpHandlerStorageType.File:
+
+ if (IsWebDevActive() && !( String.Compare(this[ChartHttpHandler.WebDevServerUseConfigSettings], "true", StringComparison.OrdinalIgnoreCase) == 0))
+ {
+ this.StorageType = ChartHttpHandlerStorageType.InProcess;
+ break;
+ }
+
+ if (String.IsNullOrEmpty(this.Url))
+ {
+ throw new ArgumentException(SR.ExceptionHttpHandlerUrlMissing);
+ }
+
+ String fileDirectory = this.Directory;
+ if (String.IsNullOrEmpty(fileDirectory))
+ {
+ try
+ {
+ fileDirectory = HttpContext.Current.Server.MapPath(this.Url);
+ }
+ catch (Exception exception)
+ {
+ throw new InvalidOperationException(SR.ExceptionHttpHandlerUrlInvalid, exception);
+ }
+ }
+ fileDirectory = fileDirectory.Replace("/", "\\");
+ if (!fileDirectory.EndsWith("\\", StringComparison.Ordinal))
+ {
+ fileDirectory += "\\";
+ }
+
+ if (!System.IO.Directory.Exists(fileDirectory))
+ {
+ throw new DirectoryNotFoundException(SR.ExceptionHttpHandlerTempDirectoryInvalid(fileDirectory));
+ }
+ Exception thrown = null;
+ try
+ {
+ String testFileName = fileDirectory + Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture);
+ using (FileStream fileStream = File.Create(testFileName)) { }
+ File.Delete(testFileName);
+
+ }
+ catch (DirectoryNotFoundException exception)
+ {
+ thrown = exception;
+ }
+ catch (NotSupportedException exception)
+ {
+ thrown = exception;
+ }
+ catch (PathTooLongException exception)
+ {
+ thrown = exception;
+ }
+ catch (UnauthorizedAccessException exception)
+ {
+ thrown = exception;
+ }
+
+ if (thrown != null)
+ {
+ throw new UnauthorizedAccessException(SR.ExceptionHttpHandlerTempDirectoryUnaccesible(fileDirectory));
+ }
+
+ this.Directory = fileDirectory;
+ break;
+
+
+ }
+ if (!String.IsNullOrEmpty(this.CustomHandlerName))
+ {
+ this.InspectHandlerLoader();
+ }
+ }
+
+ /// <summary>
+ /// Prepares the design time params.
+ /// </summary>
+ internal void PrepareDesignTime()
+ {
+ this.StorageType = ChartHttpHandlerStorageType.File;
+ this.Timeout = TimeSpan.FromSeconds(3); ;
+ this.Url = Path.GetTempPath();
+ this.Directory = Path.GetTempPath();
+ }
+
+ internal string ReadSessionKey()
+ {
+ if (HttpContext.Current.Session != null)
+ {
+ // initialize session (if is empty any postsequent request will have different id);
+ if (HttpContext.Current.Session.IsNewSession)
+ {
+ if (HttpContext.Current.Session.IsReadOnly)
+ {
+ return string.Empty;
+ }
+ HttpContext.Current.Session[this._sesionKey] = 0;
+ }
+ return HttpContext.Current.Session.SessionID;
+ }
+ return String.Empty;
+ }
+
+ internal string GetPrivacyKey( out ImageOwnerKeyType keyType )
+ {
+ if (ImageOwnerKey == ImageOwnerKeyType.None)
+ {
+ keyType = ImageOwnerKeyType.None;
+ return String.Empty;
+ }
+ if (HttpContext.Current != null)
+ {
+ switch (ImageOwnerKey)
+ {
+ case ImageOwnerKeyType.Auto:
+ if (HttpContext.Current.User.Identity.IsAuthenticated)
+ {
+ keyType = ImageOwnerKeyType.UserID;
+ return HttpContext.Current.User.Identity.Name;
+ }
+ if (!String.IsNullOrEmpty(HttpContext.Current.Request.AnonymousID))
+ {
+ keyType = ImageOwnerKeyType.AnonymousID;
+ return HttpContext.Current.Request.AnonymousID;
+ }
+ string sessionId = ReadSessionKey();
+ keyType = String.IsNullOrEmpty(sessionId) ? ImageOwnerKeyType.None : ImageOwnerKeyType.SessionID;
+ return sessionId;
+
+ case ImageOwnerKeyType.UserID:
+ if (!HttpContext.Current.User.Identity.IsAuthenticated)
+ {
+ throw new InvalidOperationException(SR.ExceptionHttpHandlerPrivacyKeyInvalid("ImageOwnerKey", ImageOwnerKey.ToString()));
+ }
+ keyType = ImageOwnerKeyType.UserID;
+ return HttpContext.Current.User.Identity.Name;
+
+ case ImageOwnerKeyType.AnonymousID:
+ if (String.IsNullOrEmpty(HttpContext.Current.Request.AnonymousID))
+ {
+ throw new InvalidOperationException(SR.ExceptionHttpHandlerPrivacyKeyInvalid("ImageOwnerKey", ImageOwnerKey.ToString()));
+ }
+ keyType = ImageOwnerKeyType.AnonymousID;
+ return HttpContext.Current.Request.AnonymousID;
+
+ case ImageOwnerKeyType.SessionID:
+ if (HttpContext.Current.Session == null)
+ {
+ throw new InvalidOperationException(SR.ExceptionHttpHandlerPrivacyKeyInvalid("ImageOwnerKey", ImageOwnerKey.ToString()));
+ }
+ keyType = ImageOwnerKeyType.SessionID;
+ return ReadSessionKey();
+
+ default:
+ Debug.Fail("Unknown ImageOwnerKeyType.");
+ break;
+ }
+ }
+ keyType = ImageOwnerKeyType.None;
+ return string.Empty;
+ }
+
+ internal string PrivacyKey
+ {
+ get
+ {
+ ImageOwnerKeyType keyType;
+ return GetPrivacyKey(out keyType);
+ }
+ }
+
+ internal bool DeleteAfterServicing
+ {
+ get
+ {
+ // default, if is missing in config, is true.
+ return !(String.Compare(this["DeleteAfterServicing"], "false", StringComparison.OrdinalIgnoreCase) == 0);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the image owner key type.
+ /// </summary>
+ /// <value>The image owner key.</value>
+ internal ImageOwnerKeyType ImageOwnerKey { get; set; }
+
+ #endregion //Methods
+
+ #region SettingsCollection Class
+
+ private class StorageSettingsCollection : NameValueCollection
+ {
+ public StorageSettingsCollection()
+ : base(StringComparer.OrdinalIgnoreCase)
+ {
+ }
+ internal void SetReadOnly(bool flag)
+ {
+ this.IsReadOnly = flag;
+ }
+ }
+
+ #endregion //SettingsCollection Class
+ }
+
+ #endregion ChartHttpHandlerParameters
+
+ #region DefaultImageHandler Class
+
+ /// <summary>
+ /// Default implementation of ChartHttpHandler.IImageHandler interface
+ /// </summary>
+ internal class DefaultImageHandler : IChartStorageHandler
+ {
+
+ #region Fields
+ // Hashtable for storage
+ private static Hashtable _storageData = new Hashtable();
+ // lock object
+ private static ReaderWriterLock _rwl = new ReaderWriterLock();
+ // max access timeout
+ private const int accessTimeout = 10000;
+
+ static string _privacyKeyName = "_pk";
+ static byte[] _privacyMarker = (new Guid("332E3AB032904bceA82B249C25E65CB6")).ToByteArray();
+ static string _sessionKeyPrefix = "chart-3ece47b3-9481-4b22-ab45-ab669972eb79";
+
+ #endregion //Fields
+
+ #region Constructors
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="T:DefaultImageHandler"/> class.
+ /// </summary>
+ internal DefaultImageHandler()
+ {
+ }
+ #endregion //Constructors
+
+ #region Members
+ /// <summary>
+ /// Nots the type of the supported storage.
+ /// </summary>
+ /// <param name="settings">The settings.</param>
+ private void NotSupportedStorageType(ChartHttpHandlerSettings settings)
+ {
+ throw new NotSupportedException( SR.ExceptionHttpHandlerStorageTypeUnsupported( settings.StorageType.ToString() ));
+ }
+
+ #endregion //Members
+
+ #region Methods
+
+ /// <summary>
+ /// Returns privacy hash which will be save in the file.
+ /// </summary>
+ /// <returns>A byte array of hash data</returns>
+ private static byte[] GetHashData()
+ {
+ string currentGuid = ChartHttpHandler.CurrentGuidKey;
+ string sessionID = ChartHttpHandler.Settings.PrivacyKey;
+
+ if (String.IsNullOrEmpty(sessionID))
+ {
+ return new byte[0];
+ }
+
+ byte[] data = Encoding.UTF8.GetBytes(sessionID + "/" + currentGuid);
+
+ using (SHA1 sha = new SHA1CryptoServiceProvider())
+ {
+ return sha.ComputeHash(data);
+ }
+
+ }
+
+ private static bool CompareBytes(byte[] a, byte[] b)
+ {
+ if (a.Length != b.Length) return false;
+ for (int i = 0; i < a.Length; i++)
+ {
+ if (a[i] != b[i]) return false;
+ }
+ return true;
+ }
+
+ private static string GetSessionImageKey(string key)
+ {
+ // all session variables starts with _sessionKeyPrefix to avoid direct access to session by passing image key in Url query.
+ return _sessionKeyPrefix + key;
+ }
+
+ #endregion //Methods
+
+ #region ImageHandler Members
+
+ /// <summary>
+ /// Stores the data into external medium.
+ /// </summary>
+ /// <param name="key">The key.</param>
+ /// <param name="data">The data.</param>
+ void IChartStorageHandler.Save(String key, Byte[] data)
+ {
+ ChartHttpHandlerSettings settings = ChartHttpHandler.Settings;
+ ImageOwnerKeyType imageOwnerKeyType = ImageOwnerKeyType.None;
+ string privacyKey = settings.GetPrivacyKey(out imageOwnerKeyType);
+ if (settings.StorageType == ChartHttpHandlerStorageType.InProcess)
+ {
+ _rwl.AcquireWriterLock(accessTimeout);
+ try
+ {
+ _storageData[key] = data;
+ if (settings.PrivateImages && !String.IsNullOrEmpty(privacyKey))
+ {
+ _storageData[key + _privacyKeyName] = privacyKey;
+ Diagnostics.TraceWrite( SR.DiagnosticChartImageSavedPrivate(key, imageOwnerKeyType.ToString()), null);
+ }
+ else
+ Diagnostics.TraceWrite(SR.DiagnosticChartImageSaved(key), null);
+ }
+ finally
+ {
+ _rwl.ReleaseWriterLock();
+ }
+ }
+ else if (settings.StorageType == ChartHttpHandlerStorageType.File)
+ {
+ using (FileStream stream = File.Create(settings.Directory + key))
+ {
+ stream.Write(data, 0, data.Length);
+ if (settings.PrivateImages && !String.IsNullOrEmpty(privacyKey))
+ {
+ byte[] privacyData = GetHashData();
+ stream.Write(privacyData, 0, privacyData.Length);
+ // we will put a marker at the end of the file;
+ stream.Write(_privacyMarker, 0, _privacyMarker.Length);
+ Diagnostics.TraceWrite(SR.DiagnosticChartImageSavedPrivate(key, imageOwnerKeyType.ToString()), null);
+ }
+ else
+ Diagnostics.TraceWrite(SR.DiagnosticChartImageSaved(key), null);
+ }
+ }
+ else if (settings.StorageType == ChartHttpHandlerStorageType.Session)
+ {
+ HttpContext.Current.Session[GetSessionImageKey(key)] = data;
+ Diagnostics.TraceWrite(SR.DiagnosticChartImageSaved(key), null);
+ }
+ else this.NotSupportedStorageType(settings);
+ }
+
+
+ /// <summary>
+ /// Retrieves the data from external medium.
+ /// </summary>
+ /// <param name="key">The key.</param>
+ Byte[] IChartStorageHandler.Load( String key)
+ {
+ ChartHttpHandlerSettings settings = ChartHttpHandler.Settings;
+ ImageOwnerKeyType imageOwnerKeyType = ImageOwnerKeyType.None;
+ string privacyKey = settings.GetPrivacyKey(out imageOwnerKeyType);
+ Byte[] data = new Byte[0];
+ if (settings.StorageType == ChartHttpHandlerStorageType.InProcess)
+ {
+ _rwl.AcquireReaderLock(accessTimeout);
+ try
+ {
+ if (settings.PrivateImages)
+ {
+ if (!String.IsNullOrEmpty(privacyKey))
+ {
+ if (!String.Equals((string)_storageData[key + _privacyKeyName], privacyKey, StringComparison.Ordinal))
+ {
+ Diagnostics.TraceWrite(SR.DiagnosticChartImageServedFail(key, SR.DiagnosticChartImageServedFailPrivacyFail(imageOwnerKeyType.ToString())), null);
+ return data;
+ }
+ }
+ else
+ {
+ if (!String.IsNullOrEmpty((string)_storageData[key + _privacyKeyName]))
+ {
+ Diagnostics.TraceWrite(SR.DiagnosticChartImageServedFail(key, SR.DiagnosticChartImageServedFailPrivacyFail(imageOwnerKeyType.ToString())), null);
+ return data;
+ }
+ }
+ }
+ data = (Byte[])_storageData[key];
+ if (data == null)
+ {
+ Diagnostics.TraceWrite(SR.DiagnosticChartImageServedFail(key, SR.DiagnosticChartImageServedFailNotFound), null);
+ }
+ }
+ finally
+ {
+ _rwl.ReleaseReaderLock();
+ }
+ }
+ else if (settings.StorageType == ChartHttpHandlerStorageType.File)
+ {
+ settings.ValidateUri(key);
+ if (File.Exists(settings.Directory + key))
+ {
+ using (FileStream fileStream = File.OpenRead(settings.Directory + key))
+ {
+ byte[] fileData = new byte[fileStream.Length];
+ fileStream.Read(fileData, 0, fileData.Length);
+ using (MemoryStream stream = new MemoryStream(fileData))
+ {
+ int streamCut = 0;
+ if (settings.PrivateImages)
+ {
+ // read the marker first
+ byte[] privacyMarkerStream = new Byte[_privacyMarker.Length];
+
+ streamCut += _privacyMarker.Length;
+ stream.Seek(stream.Length - streamCut, SeekOrigin.Begin);
+ stream.Read(privacyMarkerStream, 0, privacyMarkerStream.Length);
+
+ if (!String.IsNullOrEmpty(privacyKey))
+ {
+ byte[] privacyData = GetHashData();
+ streamCut += privacyData.Length;
+ byte[] privacyDataFromStream = new Byte[privacyData.Length];
+ stream.Seek(stream.Length - streamCut, SeekOrigin.Begin);
+ stream.Read(privacyDataFromStream, 0, privacyDataFromStream.Length);
+
+ if (!CompareBytes(privacyDataFromStream, privacyData))
+ {
+ Diagnostics.TraceWrite(SR.DiagnosticChartImageServedFail(key, SR.DiagnosticChartImageServedFailPrivacyFail(imageOwnerKeyType.ToString())), null);
+ return data;
+ }
+ }
+ else
+ {
+ // this image is marked as private - check end return null if fails
+ if (String.Equals(
+ Encoding.Unicode.GetString(privacyMarkerStream),
+ Encoding.Unicode.GetString(_privacyMarker),
+ StringComparison.Ordinal))
+ {
+ Diagnostics.TraceWrite(SR.DiagnosticChartImageServedFail(key, SR.DiagnosticChartImageServedFailPrivacyFail(imageOwnerKeyType.ToString())), null);
+ return data;
+ }
+ // its fine ( no user is stored )
+ streamCut = 0;
+ }
+ }
+ stream.Seek(0, SeekOrigin.Begin);
+ data = new Byte[(int)stream.Length - streamCut];
+ stream.Read(data, 0, (int)data.Length);
+ }
+ }
+ }
+ else
+ Diagnostics.TraceWrite(SR.DiagnosticChartImageServedFail(key, SR.DiagnosticChartImageServedFailNotFound), null);
+ }
+ else if (settings.StorageType == ChartHttpHandlerStorageType.Session)
+ {
+ data = (Byte[])HttpContext.Current.Session[GetSessionImageKey(key)];
+ }
+ else this.NotSupportedStorageType(settings);
+ return data;
+
+ }
+
+
+ /// <summary>
+ /// Removes the data from external medium.
+ /// </summary>
+ /// <param name="key">The key.</param>
+ void IChartStorageHandler.Delete(String key)
+ {
+ ChartHttpHandlerSettings settings = ChartHttpHandler.Settings;
+ if (settings.StorageType == ChartHttpHandlerStorageType.InProcess)
+ {
+
+ _rwl.AcquireWriterLock(accessTimeout);
+ try
+ {
+ _storageData.Remove(key);
+ _storageData.Remove(key + _privacyKeyName);
+ }
+ finally
+ {
+ _rwl.ReleaseWriterLock();
+ }
+ }
+ else if (settings.StorageType == ChartHttpHandlerStorageType.File)
+ {
+ File.Delete(settings.Directory + key);
+ }
+ else if (settings.StorageType == ChartHttpHandlerStorageType.Session)
+ {
+ HttpContext.Current.Session.Remove(GetSessionImageKey(key));
+ }
+ else this.NotSupportedStorageType(settings);
+ }
+
+ /// <summary>
+ /// Checks for existence the specified key.
+ /// </summary>
+ /// <param name="key">The key.</param>
+ /// <returns></returns>
+ bool IChartStorageHandler.Exists(String key)
+ {
+ ChartHttpHandlerSettings settings = ChartHttpHandler.Settings;
+ if (settings.StorageType == ChartHttpHandlerStorageType.InProcess)
+ {
+ _rwl.AcquireReaderLock(accessTimeout);
+ try
+ {
+ return _storageData.Contains(key);
+ }
+ finally
+ {
+ _rwl.ReleaseReaderLock();
+ }
+ }
+ else if (settings.StorageType == ChartHttpHandlerStorageType.File)
+ {
+ return File.Exists(settings.Directory + key);
+ }
+ else if (settings.StorageType == ChartHttpHandlerStorageType.Session)
+ {
+ return HttpContext.Current.Session[GetSessionImageKey(key)] is Byte[];
+ }
+ else this.NotSupportedStorageType(settings);
+ return false;
+ }
+
+ #endregion
+
+ }
+
+ #endregion //DefaultImageHandler Class
+
+ #region RingTimeTracker class
+
+ /// <summary>
+ /// RingItem contains time span of creation timedate and index for key generation.
+ /// </summary>
+ internal class RingItem
+ {
+ internal Int32 Index;
+ internal DateTime Created = DateTime.Now;
+ internal string SessionID = String.Empty;
+ internal bool InUse;
+ /// <summary>
+ /// Initializes a new instance of the <see cref="T:RingItem"/> class.
+ /// </summary>
+ /// <param name="index">The index.</param>
+ internal RingItem( int index)
+ {
+ this.Index = index;
+ }
+ }
+ /// <summary>
+ /// RingTimeTracker is a helper class for generating keys and tracking RingItem.
+ /// Contains linked list queue and tracks exprired items.
+ /// </summary>
+ internal class RingTimeTracker
+ {
+ #region Fields
+ // the item life span
+ private TimeSpan _itemLifeTime = TimeSpan.FromSeconds(360);
+ // last requested RingItem
+ private LinkedListNode<RingItem> _current;
+ // default key format to format names
+ private String _keyFormat = String.Empty;
+ // LinkedList with ring items
+ private LinkedList<RingItem> _list = new LinkedList<RingItem>();
+ // Record session ID
+ private bool _recordSessionID = false;
+
+ #endregion //Fields
+
+ #region Constructors
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="T:RingTimeTracker"/> class.
+ /// </summary>
+ /// <param name="itemLifeTime">The item life time.</param>
+ /// <param name="keyFormat">The key format.</param>
+ /// <param name="recordSessionID">if set to <c>true</c> the session ID will be recorded.</param>
+ internal RingTimeTracker(TimeSpan itemLifeTime, String keyFormat, bool recordSessionID)
+ {
+ System.Diagnostics.Debug.Assert(!String.IsNullOrEmpty(keyFormat));
+ this._itemLifeTime = itemLifeTime;
+ this._keyFormat = keyFormat;
+ this._list.AddLast(new RingItem(_list.Count));
+ this._current = this._list.First;
+ this._current.Value.Created = DateTime.Now - this._itemLifeTime - TimeSpan.FromSeconds(1);
+ this._recordSessionID = recordSessionID;
+ }
+
+ #endregion //Constructors
+
+ #region Methods
+
+
+
+ /// <summary>
+ /// Determines whether the specified item is expired.
+ /// </summary>
+ /// <param name="item">The item.</param>
+ /// <param name="now">The now.</param>
+ /// <returns>
+ /// <c>true</c> if the specified item is expired; otherwise, <c>false</c>.
+ /// </returns>
+ internal bool IsExpired(RingItem item, DateTime now)
+ {
+ TimeSpan elapsed = (now - item.Created);
+ return elapsed > this._itemLifeTime;
+ }
+
+
+ /// <summary>
+ /// Gets the next key.
+ /// </summary>
+ /// <returns></returns>
+ internal String GetNextKey()
+ {
+ DateTime now = DateTime.Now;
+ lock (this)
+ {
+ if ( !this.IsExpired(this._current.Value, now))
+ {
+ if (this._current.Next == null)
+ {
+ if (!this.IsExpired(this._list.First.Value, now))
+ {
+ this._list.AddLast(new RingItem(_list.Count));
+ this._current = this._list.Last;
+ }
+ else
+ {
+ this._current = this._list.First;
+ }
+ }
+ else
+ {
+ if (!this.IsExpired(this._current.Next.Value, now))
+ {
+ this._list.AddAfter(this._current, new RingItem(_list.Count));
+ }
+ this._current = this._current.Next;
+ }
+ }
+ this._current.Value.Created = now;
+ if (this._recordSessionID)
+ {
+ this._current.Value.SessionID = ChartHttpHandler.Settings.ReadSessionKey();
+ this._current.Value.InUse = true;
+ }
+ return this.GetCurrentKey();
+ }
+ }
+
+ /// <summary>
+ /// Gets the current key.
+ /// </summary>
+ /// <returns></returns>
+ internal String GetCurrentKey()
+ {
+ return String.Format( CultureInfo.InvariantCulture, this._keyFormat, this._current.Value.Index);
+ }
+
+ /// <summary>
+ /// Gets the key.
+ /// </summary>
+ /// <param name="ringItem">The ring item.</param>
+ /// <returns></returns>
+ internal String GetKey(RingItem ringItem)
+ {
+ return String.Format(CultureInfo.InvariantCulture, this._keyFormat, ringItem.Index);
+ }
+
+ /// <summary>
+ /// Do Action for each item.
+ /// </summary>
+ /// <param name="onlyExpired">if set to <c>true</c> do action for only expired items.</param>
+ /// <param name="action">The action.</param>
+ public void ForEach(bool onlyExpired, Action<RingItem> action)
+ {
+ if (action == null)
+ {
+ throw new ArgumentNullException("action");
+ }
+ DateTime now = DateTime.Now;
+ lock (this)
+ {
+ foreach (RingItem item in this._list)
+ {
+ if (onlyExpired)
+ {
+ if (this.IsExpired(item, now))
+ {
+ action(item);
+ }
+ }
+ else
+ {
+ action(item);
+ }
+ }
+ }
+ }
+
+ #endregion //Methods
+
+ }
+ #endregion //RingTracker class
+
+ #region RingTimeTrackerFactory Class
+
+ /// <summary>
+ /// RingTimeTrackerFactory contains static list of RingTimeTracker for each key formats
+ /// </summary>
+ internal static class RingTimeTrackerFactory
+ {
+
+ private static ListDictionary _ringTrackers = new ListDictionary();
+ private static Object _lockObject = new Object();
+
+ /// <summary>
+ /// Gets the ring tracker by specified key format.
+ /// </summary>
+ /// <param name="keyFormat">The key format.</param>
+ /// <returns></returns>
+ internal static RingTimeTracker GetRingTracker(String keyFormat)
+ {
+ if (_ringTrackers.Contains(keyFormat))
+ {
+ return (RingTimeTracker)_ringTrackers[keyFormat];
+ }
+ lock (_lockObject)
+ {
+ if (_ringTrackers.Contains(keyFormat))
+ {
+ return (RingTimeTracker)_ringTrackers[keyFormat];
+ }
+ RingTimeTracker result = new RingTimeTracker(ChartHttpHandler.Settings.Timeout, keyFormat,ChartHttpHandler.Settings.StorageType == ChartHttpHandlerStorageType.Session);
+ _ringTrackers.Add(keyFormat, result);
+ return result;
+ }
+ }
+
+ internal static IList OpenedRingTimeTrackers()
+ {
+ lock (_lockObject)
+ {
+ return new ArrayList(_ringTrackers.Values);
+ }
+ }
+
+ }
+
+ #endregion //RingTimeTrackerFactory Class
+
+ #region Diagnostics class
+
+ /// <summary>
+ /// Contains helpres methods for diagnostics.
+ /// </summary>
+ internal static class Diagnostics
+ {
+ /// <summary>
+ /// Trace category
+ /// </summary>
+ const string ChartCategory = "chart.handler";
+ /// <summary>
+ /// Name of context item which contain the current trace item
+ /// </summary>
+ const string ContextID = "Trace-{89FA5660-BD13-4f1b-8C7C-355CEC92CC7E}";
+ /// <summary>
+ /// Used for syncronizing.
+ /// </summary>
+ static object _lockObject = new object();
+ /// <summary>
+ /// Limit of trace messages in the history.
+ /// </summary>
+ const int MessageLimit = 20;
+ /// <summary>
+ /// Collection of request messages.
+ /// </summary>
+ static List<HandlerPageTraceInfo> _messages = new List<HandlerPageTraceInfo>(MessageLimit);
+
+ /// <summary>
+ /// Contains request info
+ /// </summary>
+ public class HandlerPageTraceInfo
+ {
+ /// <summary>
+ /// Events collection in this request.
+ /// </summary>
+ private List<ChartHandlerEvents> _events = new List<ChartHandlerEvents>();
+ /// <summary>
+ /// Initializes a new instance of the <see cref="HandlerPageTraceInfo"/> class.
+ /// </summary>
+ public HandlerPageTraceInfo()
+ {
+ if (HttpContext.Current != null)
+ {
+ DateStamp = DateTime.Now;
+ if (HttpContext.Current.Request != null)
+ {
+ Url = HttpContext.Current.Request.Url.ToString();
+ Verb = HttpContext.Current.Request.HttpMethod;
+ }
+ }
+ }
+ /// <summary>
+ /// Gets or sets the date stamp.
+ /// </summary>
+ /// <value>The date stamp.</value>
+ public DateTime DateStamp { get; private set; }
+ /// <summary>
+ /// Gets or sets the URL.
+ /// </summary>
+ /// <value>The URL.</value>
+ public string Url { get; private set; }
+ /// <summary>
+ /// Gets or sets the verb.
+ /// </summary>
+ /// <value>The verb.</value>
+ public string Verb { get; private set; }
+ /// <summary>
+ /// Gets the events.
+ /// </summary>
+ /// <value>The events.</value>
+ public IList<ChartHandlerEvents> Events
+ {
+ get
+ {
+ return _events.AsReadOnly();
+ }
+ }
+ /// <summary>
+ /// Adds a trace info item.
+ /// </summary>
+ /// <param name="message">The message.</param>
+ /// <param name="errorInfo">The error info.</param>
+ internal void AddTraceInfo(string message, string errorInfo)
+ {
+ lock (_events)
+ {
+ _events.Add(new ChartHandlerEvents()
+ {
+ Message = message,
+ ErrorInfo = errorInfo
+ }
+ );
+ }
+ }
+ }
+
+ /// <summary>
+ /// Contains an event in particural request.
+ /// </summary>
+ public class ChartHandlerEvents
+ {
+ /// <summary>
+ /// Gets or sets the message.
+ /// </summary>
+ /// <value>The message.</value>
+ public string Message { get; set; }
+ /// <summary>
+ /// Gets or sets the error info.
+ /// </summary>
+ /// <value>The error info.</value>
+ public string ErrorInfo { get; set; }
+ /// <summary>
+ /// Gets the text.
+ /// </summary>
+ /// <value>The text.</value>
+ public string Text { get { return Message + ErrorInfo; } }
+ }
+
+ /// <summary>
+ /// Writes message in the trace.
+ /// </summary>
+ /// <param name="message">The message.</param>
+ /// <param name="errorInfo">The error info.</param>
+ internal static void TraceWrite( string message, Exception errorInfo)
+ {
+ if (IsTraceEnabled)
+ {
+ HttpContext.Current.Trace.Write(ChartCategory, message, errorInfo);
+ if (CurrentTraceInfo != null)
+ {
+ CurrentTraceInfo.AddTraceInfo(message, errorInfo != null ? errorInfo.ToString() : String.Empty);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets the current trace info.
+ /// </summary>
+ /// <value>The current trace info.</value>
+ private static HandlerPageTraceInfo CurrentTraceInfo
+ {
+ get
+ {
+ lock (_lockObject)
+ {
+ if (HttpContext.Current != null)
+ {
+ if (HttpContext.Current.Items[Diagnostics.ContextID] == null)
+ {
+ HandlerPageTraceInfo pageTrace = new HandlerPageTraceInfo();
+ _messages.Add(pageTrace);
+ if (_messages.Count > MessageLimit)
+ {
+ _messages.RemoveRange(0, _messages.Count - MessageLimit);
+ }
+ HttpContext.Current.Items[Diagnostics.ContextID] = pageTrace;
+ }
+ return (HandlerPageTraceInfo)HttpContext.Current.Items[Diagnostics.ContextID];
+ }
+ }
+ return null;
+ }
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether this instance is trace enabled.
+ /// </summary>
+ /// <value>
+ /// <c>true</c> if this instance is trace enabled; otherwise, <c>false</c>.
+ /// </value>
+ internal static bool IsTraceEnabled
+ {
+ get
+ {
+ return HttpContext.Current != null && HttpContext.Current.Trace.IsEnabled;
+ }
+ }
+
+ /// <summary>
+ /// Gets the messages collection.
+ /// </summary>
+ /// <value>The messages.</value>
+ internal static ReadOnlyCollection<HandlerPageTraceInfo> Messages
+ {
+ get
+ {
+ List<HandlerPageTraceInfo> result;
+ lock (_lockObject)
+ {
+ result = new List<HandlerPageTraceInfo>(_messages);
+ }
+ return result.AsReadOnly();
+ }
+ }
+ }
+
+ #endregion //Diagnostics class
+}
diff --git a/mcs/class/referencesource/System.Web.DynamicData/DynamicData/DynamicDataExtensions.cs b/mcs/class/referencesource/System.Web.DynamicData/DynamicData/DynamicDataExtensions.cs
index d7311de020f..765abf1c5d2 100644
--- a/mcs/class/referencesource/System.Web.DynamicData/DynamicData/DynamicDataExtensions.cs
+++ b/mcs/class/referencesource/System.Web.DynamicData/DynamicData/DynamicDataExtensions.cs
@@ -228,7 +228,7 @@ namespace System.Web.DynamicData {
}
/// <summary>
- /// Make the SelectedIndex [....] up with the PersistedSelection. Concretely, what it means is that
+ /// Make the SelectedIndex sync up with the PersistedSelection. Concretely, what it means is that
/// if you select a row and then page away (or sort), the selection remains on that row
/// even if it's not currently visible.
/// </summary>
diff --git a/mcs/class/referencesource/System.Web.DynamicData/DynamicData/DynamicDataManager.cs b/mcs/class/referencesource/System.Web.DynamicData/DynamicData/DynamicDataManager.cs
index f54d6521c67..2fcbbceb898 100644
--- a/mcs/class/referencesource/System.Web.DynamicData/DynamicData/DynamicDataManager.cs
+++ b/mcs/class/referencesource/System.Web.DynamicData/DynamicData/DynamicDataManager.cs
@@ -189,7 +189,7 @@ namespace System.Web.DynamicData {
internal static void EnablePersistedSelection(BaseDataBoundControl baseDataBoundControl, IMetaTable table) {
Debug.Assert(baseDataBoundControl != null, "NULL!");
- // Make the persisted selection [....] up with the selected index if possible
+ // Make the persisted selection sync up with the selected index if possible
if (!table.IsReadOnly) {
DynamicDataExtensions.EnablePersistedSelectionInternal(baseDataBoundControl);
}
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityConnectionStringBuilderItem.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityConnectionStringBuilderItem.cs
index 5598b5c6061..ba73d026878 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityConnectionStringBuilderItem.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityConnectionStringBuilderItem.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Data.EntityClient;
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceConfigureObjectContext.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceConfigureObjectContext.cs
index ceeca336731..24c9e3f49b0 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceConfigureObjectContext.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceConfigureObjectContext.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//
// Manages the properties that can be set on the first page of the wizard
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceConfigureObjectContextPanel.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceConfigureObjectContextPanel.cs
index fae30157a8d..ba12b645410 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceConfigureObjectContextPanel.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceConfigureObjectContextPanel.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceConfigureObjectContextPanel.designer.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceConfigureObjectContextPanel.designer.cs
index 8b78d5d1999..d0af6f0701c 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceConfigureObjectContextPanel.designer.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceConfigureObjectContextPanel.designer.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Windows.Forms;
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceContainerNameConverter.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceContainerNameConverter.cs
index b92970d9ed7..dddf08b8a92 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceContainerNameConverter.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceContainerNameConverter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceContainerNameItem.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceContainerNameItem.cs
index 561dbabb75b..1a470ab01c4 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceContainerNameItem.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceContainerNameItem.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Data.Metadata.Edm;
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDataSelection.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDataSelection.cs
index 68ca2a9632e..95c9411215c 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDataSelection.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDataSelection.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//
// Manages the properties that can be set on the second page of the wizard
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDataSelectionPanel.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDataSelectionPanel.cs
index a2d586e55c2..9deff40bb70 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDataSelectionPanel.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDataSelectionPanel.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDataSelectionPanel.designer.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDataSelectionPanel.designer.cs
index e5f04474496..b5854bbb0dd 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDataSelectionPanel.designer.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDataSelectionPanel.designer.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Windows.Forms;
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDesigner.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDesigner.cs
index b630b7594ef..babe193dcc9 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDesigner.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDesigner.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.ComponentModel;
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDesignerHelper.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDesignerHelper.cs
index 652acc58720..01fe1061460 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDesignerHelper.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDesignerHelper.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceEntitySetNameConverter.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceEntitySetNameConverter.cs
index fef0dc95f51..59ab452a5e2 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceEntitySetNameConverter.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceEntitySetNameConverter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceEntitySetNameItem.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceEntitySetNameItem.cs
index 4f522e7e5b8..e1fcec20251 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceEntitySetNameItem.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceEntitySetNameItem.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Data.Metadata.Edm;
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceEntityTypeFilterConverter.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceEntityTypeFilterConverter.cs
index f814d7516c9..9b5f5ed2d2e 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceEntityTypeFilterConverter.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceEntityTypeFilterConverter.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceEntityTypeFilterItem.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceEntityTypeFilterItem.cs
index d5029c50646..271ff0562a0 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceEntityTypeFilterItem.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceEntityTypeFilterItem.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Data.Metadata.Edm;
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceState.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceState.cs
index d0ab4f9f647..18982675357 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceState.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceState.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//
// Temporary storage for properties set via the wizard
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceStatementEditor.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceStatementEditor.cs
index da4ed87c9c6..4d135b88934 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceStatementEditor.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceStatementEditor.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
using System.ComponentModel;
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceStatementEditorForm.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceStatementEditorForm.cs
index 85f30115ba4..fd48f29e043 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceStatementEditorForm.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceStatementEditorForm.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//
// Enables a user to edit CommandText, OrderBy, Select, and
// Where properties and parameters
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceWizardForm.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceWizardForm.cs
index 4ae9440329d..83cd536ab50 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceWizardForm.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceWizardForm.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//
// Containing form for the wizard panels
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDesignerDataSourceView.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDesignerDataSourceView.cs
index 2206efbf87a..4e664aa3294 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDesignerDataSourceView.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDesignerDataSourceView.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System.Collections;
using System.Data;
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/DesignerForm.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/DesignerForm.cs
index fea3d8fac3b..3467d462140 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/DesignerForm.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/DesignerForm.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/RTLAwareMessageBox.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/RTLAwareMessageBox.cs
index 25d42e05031..fcd3e820f51 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/RTLAwareMessageBox.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/RTLAwareMessageBox.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/ResourceDescriptionAttribute.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/ResourceDescriptionAttribute.cs
index d61fc0f3a73..f7a25c7abfb 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/ResourceDescriptionAttribute.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/ResourceDescriptionAttribute.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/TaskFormBase.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/TaskFormBase.cs
index fbd461cd8d5..0ca68d843b0 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/TaskFormBase.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/TaskFormBase.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/UIHelper.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/UIHelper.cs
index a21300b6939..ca925042fc3 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/UIHelper.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/UIHelper.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//
// Helper methods for UI functionality like displaying dialogs
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/WizardForm.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/WizardForm.cs
index c8dadbce8ab..371f73057a8 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/WizardForm.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/WizardForm.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/WizardPanel.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/WizardPanel.cs
index 4374823c05f..6aecc439a4f 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/WizardPanel.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/WizardPanel.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/WizardPanelChangingEventArgs.cs b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/WizardPanelChangingEventArgs.cs
index a77f7e065bb..4e30056bf7c 100644
--- a/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/WizardPanelChangingEventArgs.cs
+++ b/mcs/class/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/Util/WizardPanelChangingEventArgs.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSource.cs b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSource.cs
index f0971e34d21..3114cbef763 100644
--- a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSource.cs
+++ b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSource.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceChangedEventArgs.cs b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceChangedEventArgs.cs
index c3ff8c1e14c..b5660791276 100644
--- a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceChangedEventArgs.cs
+++ b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceChangedEventArgs.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
// @backupOwner objsdev
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceChangingEventArgs.cs b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceChangingEventArgs.cs
index c19dbcb822b..c0fbdfb66d7 100644
--- a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceChangingEventArgs.cs
+++ b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceChangingEventArgs.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
// @backupOwner objsdev
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceColumn.cs b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceColumn.cs
index c89ec893dc2..09edc5e625f 100644
--- a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceColumn.cs
+++ b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceColumn.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceContextCreatedEventArgs.cs b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceContextCreatedEventArgs.cs
index 2e639d2c124..f92ab5ee5dd 100644
--- a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceContextCreatedEventArgs.cs
+++ b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceContextCreatedEventArgs.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
// @backupOwner objsdev
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceContextCreatingEventArgs.cs b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceContextCreatingEventArgs.cs
index a39034e814c..d0a9eb11961 100644
--- a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceContextCreatingEventArgs.cs
+++ b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceContextCreatingEventArgs.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
// @backupOwner objsdev
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceContextDisposingEventArgs.cs b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceContextDisposingEventArgs.cs
index e53faa0c241..913b1580082 100644
--- a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceContextDisposingEventArgs.cs
+++ b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceContextDisposingEventArgs.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
// @backupOwner objsdev
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceMemberPath.cs b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceMemberPath.cs
index a1f0cbc1ebc..c02df2400dc 100644
--- a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceMemberPath.cs
+++ b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceMemberPath.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceQueryBuilder.cs b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceQueryBuilder.cs
index 21cecb80459..ebca39ae434 100644
--- a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceQueryBuilder.cs
+++ b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceQueryBuilder.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Web.UI.WebControls
diff --git a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceReferenceGroup.cs b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceReferenceGroup.cs
index 065d0f80398..90033972dc2 100644
--- a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceReferenceGroup.cs
+++ b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceReferenceGroup.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceSelectedEventArgs.cs b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceSelectedEventArgs.cs
index 1b1f06ab3d4..132dc52f092 100644
--- a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceSelectedEventArgs.cs
+++ b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceSelectedEventArgs.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
// @backupOwner objsdev
//---------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceSelectingEventArgs.cs b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceSelectingEventArgs.cs
index 2e5c1656148..781a35ec02b 100644
--- a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceSelectingEventArgs.cs
+++ b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceSelectingEventArgs.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
// @backupOwner objsdev
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceUtil.cs b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceUtil.cs
index 2560d5e2ea6..315148ec4b6 100644
--- a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceUtil.cs
+++ b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceUtil.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceValidationException.cs b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceValidationException.cs
index 6b285402c0f..f8108d339c1 100644
--- a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceValidationException.cs
+++ b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceValidationException.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
diff --git a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceView.cs b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceView.cs
index 88460b1e61e..a6f45854e14 100644
--- a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceView.cs
+++ b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceView.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System.Collections;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceViewSchema.cs b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceViewSchema.cs
index 497db73023e..dfb3b251589 100644
--- a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceViewSchema.cs
+++ b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceViewSchema.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Web.UI.WebControls
diff --git a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceWrapper.cs b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceWrapper.cs
index 0660a995a69..00219e431d7 100644
--- a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceWrapper.cs
+++ b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceWrapper.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Data;
diff --git a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceWrapperCollection.cs b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceWrapperCollection.cs
index 1d8a270c4aa..97ac5510425 100644
--- a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceWrapperCollection.cs
+++ b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceWrapperCollection.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Data;
diff --git a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceWrapperPropertyDescriptor.cs b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceWrapperPropertyDescriptor.cs
index 8cc49ef33c6..e66c99544a8 100644
--- a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceWrapperPropertyDescriptor.cs
+++ b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/EntityDataSourceWrapperPropertyDescriptor.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Data;
diff --git a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/ResourceDescriptionAttribute.cs b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/ResourceDescriptionAttribute.cs
index 94b2b327ea7..218f1da608d 100644
--- a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/ResourceDescriptionAttribute.cs
+++ b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/ResourceDescriptionAttribute.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/ResourceDisplayNameAttribute.cs b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/ResourceDisplayNameAttribute.cs
index 529367d0482..ece6b3f2142 100644
--- a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/ResourceDisplayNameAttribute.cs
+++ b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/ResourceDisplayNameAttribute.cs
@@ -3,8 +3,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
-// @backupOwner [....]
+// @owner Microsoft
+// @backupOwner Microsoft
//------------------------------------------------------------------------------
using System;
using System.ComponentModel;
diff --git a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/WebControlParameterProxy.cs b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/WebControlParameterProxy.cs
index 1df13685dd3..cd03f842f21 100644
--- a/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/WebControlParameterProxy.cs
+++ b/mcs/class/referencesource/System.Web.Entity/System/Data/WebControls/WebControlParameterProxy.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
-// @owner [....]
+// @owner Microsoft
// @backupOwner objsdev
//---------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/Design/AppliedDeviceFiltersDialog.cs b/mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/Design/AppliedDeviceFiltersDialog.cs
index 7ef342bd429..36cd8f5632f 100644
--- a/mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/Design/AppliedDeviceFiltersDialog.cs
+++ b/mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/Design/AppliedDeviceFiltersDialog.cs
@@ -1115,7 +1115,7 @@ namespace System.Web.UI.Design.MobileControls
Debug.Assert(
(_choicePropertyFilter == null)
|| (_runtimeChoice == _choicePropertyFilter.RuntimeChoice),
- "Local runtime choice object out of [....]."
+ "Local runtime choice object out of sync."
);
return _runtimeChoice;
}
diff --git a/mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/Design/Util/GenericUI.cs b/mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/Design/Util/GenericUI.cs
index 86ee1f1ab2b..ca56237cd55 100644
--- a/mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/Design/Util/GenericUI.cs
+++ b/mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/Design/Util/GenericUI.cs
@@ -168,7 +168,7 @@ namespace System.Web.UI.Design.MobileControls.Util
}
}
- // Copied from ndp\fx\src\Designer\[....]\System\[....]\Design\RTLAwareMessageBox.cs
+ // Copied from ndp\fx\src\Designer\Microsoft\System\Microsoft\Design\RTLAwareMessageBox.cs
[Obsolete("The System.Web.Mobile.dll assembly has been deprecated and should no longer be used. For information about how to develop ASP.NET mobile applications, see http://go.microsoft.com/fwlink/?LinkId=157231.")]
internal sealed class RTLAwareMessageBox {
diff --git a/mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/Design/Util/MSHTMLHost.cs b/mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/Design/Util/MSHTMLHost.cs
index f8d091ccb54..c44549c4dd3 100644
--- a/mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/Design/Util/MSHTMLHost.cs
+++ b/mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/Design/Util/MSHTMLHost.cs
@@ -6,7 +6,7 @@
// MSHTMLHost.cs
//
-// 12/17/98: Created: [....]
+// 12/17/98: Created: Microsoft
//
namespace System.Web.UI.Design.MobileControls.Util {
@@ -210,7 +210,7 @@ namespace System.Web.UI.Design.MobileControls.Util {
}
public virtual void OnUIDeactivate(int fUndoable) {
- // NOTE, [....], 7/99: Don't return E_NOTIMPL. Somehow doing nothing and returning S_OK
+ // NOTE, Microsoft, 7/99: Don't return E_NOTIMPL. Somehow doing nothing and returning S_OK
// fixes trident hosting in Win2000.
}
@@ -245,7 +245,7 @@ namespace System.Web.UI.Design.MobileControls.Util {
}
public virtual void SetActiveObject(NativeMethods.IOleInPlaceActiveObject pActiveObject, string pszObjName) {
- // NOTE, [....], 7/99: Don't return E_NOTIMPL. Somehow doing nothing and returning S_OK
+ // NOTE, Microsoft, 7/99: Don't return E_NOTIMPL. Somehow doing nothing and returning S_OK
// fixes trident hosting in Win2000.
// throw new COMException(String.Empty, NativeMethods.E_NOTIMPL);
}
diff --git a/mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/MobilePage.cs b/mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/MobilePage.cs
index afa31dc9541..26d2ff6ddfe 100644
--- a/mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/MobilePage.cs
+++ b/mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/MobilePage.cs
@@ -1290,7 +1290,7 @@ namespace System.Web.UI.MobileControls
}
}
- // NOTE: Make sure this stays in [....] with Page.PageRegisteredControlsThatRequirePostBackKey
+ // NOTE: Make sure this stays in sync with Page.PageRegisteredControlsThatRequirePostBackKey
private const string PageRegisteredControlsThatRequirePostBackKey = "__ControlsRequirePostBackKey__";
private bool CheckEmptyViewState(Object viewState)
{
@@ -1441,7 +1441,7 @@ namespace System.Web.UI.MobileControls
private byte[] GetMacKeyModifier()
{
- //NOTE: duplicate of the version in objectstateformatter.cs, keep in [....]
+ //NOTE: duplicate of the version in objectstateformatter.cs, keep in sync
// Use the page's directory and class name as part of the key (ASURT 64044)
// We need to make sure that the hash is case insensitive, since the file system
diff --git a/mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/ObjectList.cs b/mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/ObjectList.cs
index 656537ad4d1..d0fae603e93 100644
--- a/mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/ObjectList.cs
+++ b/mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/ObjectList.cs
@@ -948,7 +948,7 @@ namespace System.Web.UI.MobileControls
if (IsTrackingViewState)
{
_items = null;
- // avoid view state being out of [....] with fields.
+ // avoid view state being out of sync with fields.
_ignoreFieldsItemsViewModeViewState = true;
if (fieldAddedOrRemoved)
{
diff --git a/mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/SessionViewState.cs b/mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/SessionViewState.cs
index faba8d30920..da3b9fbc600 100644
--- a/mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/SessionViewState.cs
+++ b/mcs/class/referencesource/System.Web.Mobile/UI/MobileControls/SessionViewState.cs
@@ -27,7 +27,7 @@ namespace System.Web.UI.MobileControls
* arise. The core issue behind most of these is how to handle the user
* clicking the Back button. When the user does this, there is no corresponding
* notification to the server, and the client and server session state are thrown
- * out of [....].
+ * out of sync.
*
* This class attempts to alleviate this by storing a small history of view states
* in session data.
diff --git a/mcs/class/referencesource/System.Web.Services/System.Web.Services.txt b/mcs/class/referencesource/System.Web.Services/System.Web.Services.txt
new file mode 100644
index 00000000000..f53942118e1
--- /dev/null
+++ b/mcs/class/referencesource/System.Web.Services/System.Web.Services.txt
@@ -0,0 +1,477 @@
+;
+; Resources for System.Web.Services component
+;
+; Copyright (c) 2000 Microsoft Corporation
+;
+
+;
+; Exceptions messages
+;
+NonClsCompliantException=A non-CLS Compliant Exception (i.e. an object that does not derive from System.Exception) was thrown.
+
+WebConfigInvalidExtensionPriority={0} is an invalid value for the extension priority. The priority must be nonnegative.
+ConfigKeyNotFoundInElementCollection=No elements matching the key {0} were found in the ConfigurationElementCollection.
+ConfigKeysDoNotMatch=The key does not match the indexer key. Key on element (expected value): {0}. Key provided to indexer: {1}.
+Invalid_priority_group_value=The Group attribute must be set to a valid PriorityGroup value.
+WebSchemaNotFound=Schema not found.
+WebReflectionError=Error reflecting {0}.{1}.
+WebInvalidMethodName={0} Web Service method name is not valid.
+WebInvalidMethodNameCase=Invalid method name '{0}', method names are case sensitive. The method name '{1}' with the same name but different casing was found.
+WebInvalidRequestFormat=Request format is invalid.
+WebInvalidRequestFormatDetails=Request format is invalid: {0}.
+WebMethodStatic=Web Service methods cannot be static.
+WebMethodMissingParams=The last two parameters of method {0}.{1} must be of type {2} and {3}.
+WebBadOutParameter=The {0} parameter of the {1}.{2} method must be an input-only parameter.
+WebInOutParameter=The {0} parameter of the {1}.{2} method must be an output-only parameter.
+WebAsyncMissingEnd=Asynchronous method {0}.{1} does not have a corresponding {2} method.
+WebMissingPath=Path property must be set before calling the Send method.
+WebResponseKnownError=The request failed with HTTP status {0}: {1}.
+WebResponseUnknownError=The request failed with the error message:
+WebResponseUnknownErrorEmptyBody=The request failed with an empty response.
+WebResponseContent=Client found response content type of '{0}', but expected '{1}'.
+WebBadStreamState=Properties and methods of the stream can't be accessed in the BeforeSerialize stage.
+WebResponseBadXml=Response is not well-formed XML.
+WebCannotUnderstandHeader=SOAP header {0} was not understood.
+WebMissingHeader=Missing required header '{0}'.
+WebNoReturnValue=There is no return value.
+WebCannotAccessValue=The value can not be accessed because there was an exception during message processing.
+WebCannotAccessValueStage=The value may not be accessed in message stage {0}.
+WebInvalidBindingPlacement=The Binding property of {0} may not be specified in this context.
+WebInvalidBindingName=The Binding property '{0}' does not match interface binding '{1}'.
+WebBothMethodAttrs=A web service method can't have both a SoapDocumentMethodAttribute and a SoapRpcMethodAttribute. Use one or the other.
+WebBothServiceAttrs=A web service can't have both a SoapDocumentServiceAttribute and a SoapRpcServiceAttribute. Use one or the other.
+WebOneWayOutParameters=One-way methods cannot have out or ref parameters.
+WebOneWayReturnValue=One-way methods cannot have return values.
+WebReflectionErrorMethod=Method {0}.{1} can not be reflected.
+WebMultiDimArray=Multi-dimensional arrays are not supported. Use a jagged array instead.
+WebHeaderMissing=The header property/field {0}.{1} is missing or not public.
+WebHeaderStatic=The header property/field {0}.{1} cannot be static.
+WebHeaderRead=The header property/field {0}.{1} could not be read.
+WebHeaderWrite=The header property/field {0}.{1} could not be written to.
+WebHeaderType=The header property/field {0}.{1} must be of type SoapHeader or a derived type, or an array of SoapHeader or SoapUnknownHeader.
+WebHeaderOneWayOut=The header property/field {0}.{1} cannot be an out header because the method is one-way.
+WebHeaderInvalidMustUnderstand='{0}' is not a valid value for the field EncodedMustUnderstand. Valid values are '0', '1', 'true', and 'false'.
+WebMultiplyDeclaredHeaderTypes=An operation can have only one in or out header of a given type. {0}.{1} conflicts with another header field of the same type and direction.
+WebHttpHeader=Server did not recognize the value of HTTP Header {0}: {1}.
+WebRequestContent=Server found request content type to be '{0}', but expected '{1}'.
+WebRequestUnableToRead=Server was unable to read request.
+WebRequestUnableToProcess=Server was unable to process request.
+WebMissingParameter=Missing parameter: {0}.
+WebUnrecognizedRequestFormat=Request format is unrecognized.
+WebUnrecognizedRequestFormatUrl=Request format is unrecognized for URL unexpectedly ending in '{0}'.
+WebTimeout=The timeout period expired before the response was received.
+WebMissingHelpContext=HttpContext is not available. This class can only be used in the context of an ASP.NET request.
+WebMissingCustomAttribute={0} must have the {1} custom attribute.
+WebMissingClientProtocol=ClientProtocol must be set first.
+WebResolveMissingClientProtocol=ClientProtocol property must be set before calling Resolve.
+WebPathNotFound=Path:{0} could not be found.
+WebMissingResource=The document at the url {0} was not recognized as a known document type.\r\nThe error message from each known type may help you fix the problem:
+WebContractReferenceName=WSDL Document
+WebShemaReferenceName=XML Schema
+WebDiscoveryDocumentReferenceName=DISCO Document
+WebMissingDocument=Discovery document at the URL {0} could not be found.
+WebInvalidContentType=The document format is not recognized (the content type is '{0}').
+WebInvalidFormat=The document format is not recognized.
+WebInvalidEnvelopeNamespace=Possible SOAP version mismatch: Envelope namespace {0} was unexpected. Expecting {1}.
+WebResultNotXml=Result was not XML.
+WebDescriptionMissingItem=Element {0} named {1} from namespace {2} is missing.
+WebDescriptionMissing=Cannot find definition for {0}. Service Description with namespace {1} is missing.
+WebDescriptionPartElementRequired=Part '{0}' from message '{1}' in namespace '{2}' is missing the element attribute. The element attribute is required for headers when Use=Literal.
+WebDescriptionPartTypeRequired=Part '{0}' from message '{1}' in namespace '{2}' is missing the type attribute. The type attribute is required for headers when Use=Encoded.
+WebDescriptionPartElementWarning=Part '{0}' from message '{1}' in namespace '{2}' defines both the element and type attributes. Only the element attribute is used for headers when Use=Literal.
+WebDescriptionPartTypeWarning=Part '{0}' from message '{1}' in namespace '{2}' defines both the element and type attributes. Only the type attribute is used for headers when Use=Encoded.
+WebDescriptionMissingBodyUseAttribute=Missing required 'use' attribute on 'soap:body' element.
+WebDescriptionTooManyMessages=No more than one input and one output message may be specified.
+WebDescriptionHeaderAndBodyUseMismatch=The value of use defined on the soap:header element must match that defined on the soap:body element.
+WebQNamePrefixUndefined=Namespace prefix '{0}' not defined
+WebNegativeValue=The value for '{0}' cannot be negative.
+WebEmptyRef=Invalid empty reference of type '{0}' encountered in the document at URI '{1}'.
+WebNullRef=Invalid null web reference encountered in the discovery document.
+WebRefInvalidAttribute=Invalid web reference encountered. Missing required '{0}' attribute.
+WebRefInvalidAttribute2=Invalid empty reference of type '{0}' encountered. Missing required '{1}' attribute.
+WebInvalidDocType=Invalid Document type. Expecting '{0}', got '{1}'.\r\nDocument URI is '{2}'.
+WebDiscoRefReport=Report from '{0}' is '{1}'.
+WebTextMatchMissingPattern=Each match element must have a pattern attribute containing a valid regular expression.
+WebTextMatchIgnoredTypeWarning=Optional attribute 'type' was ignored because the match does not contain sub-matches.
+WebTextMatchBadCaptureIndex={0} is not a valid capture index for match '{1}'. The highest valid capture index for this match is {2}.
+WebTextMatchBadGroupIndex={0} is not a valid group index for match '{1}'. The highest valid group index for this match is {2}.
+WebServiceDescriptionIgnoredOptional=The optional WSDL extension element '{0}' from namespace '{1}' was not handled.
+WebServiceDescriptionIgnoredRequired=The required WSDL extension element '{0}' from namespace '{1}' was not handled.
+WebDuplicateServiceDescription=More than one service description with targetNamespace '{0}' was specified.
+WebDuplicateFormatExtension=More than one format extension named '{0}' was specified. Each format extension must have a unique name.
+WebDuplicateOperationMessage=More than one operation message named '{0}' was specified. Each operation message must have a unique name.
+WebDuplicateImport=More than one import named '{0}' was specified. Each import must have a unique name.
+WebDuplicateMessage=More than one message named '{0}' was specified. Each message must have a unique name.
+WebDuplicatePort=More than one port named '{0}' was specified. Each port must have a unique name.
+WebDuplicatePortType=More than one port type named '{0}' was specified. Each port type must have a unique name.
+WebDuplicateBinding=More than one binding named '{0}' was specified. Each binding must have a unique name.
+WebDuplicateService=More than one service named '{0}' was specified. Each service must have a unique name.
+WebDuplicateMessagePart=More than one message part named '{0}' was specified. Each message part must have a unique name.
+WebDuplicateOperationBinding=More than one operation binding named '{0}' was specified. Each operation binding must have a unique name.
+WebDuplicateFaultBinding=More than one fault binding named '{0}' was specified. Each fault binding must have a unique name.
+WebDuplicateOperation=More than one operation named '{0}' was specified. Each operation must have a unique name.
+WebDuplicateOperationFault=More than one operation fault named '{0}' was specified. Each operation fault must have a unique name.
+WebDuplicateUnknownElement=More than one {0} named '{1}' was specified. Each {0} must have a unique name.
+WebUnknownEncodingStyle=The encoding style '{0}' is not supported.
+WebSoap11EncodingStyleNotSupported1=The SOAP 1.1 encoding style is not supported for operations that use SOAP 1.2. Use the URI '{0}' to refer to the SOAP 1.2 encoding style.
+WebNullAsyncResultInBegin=For server-side asynchronous method calls, your Begin method must return a valid IAsyncResult. Your Begin method cannot return null.
+WebNullAsyncResultInEnd=For asynchronous method calls, you must supply a non-null IAsyncResult instance when you call the End method.
+WebAsyncTransaction=Transactions are not supported for asynchronous method calls. Provide a synchronous version of the method or unset the TransactionOption property of the WebMethodAttribute.
+WebConfigExtensionError=There was an exception running the extensions specified in the config file.
+WebExtensionError=There was an exception running the extensions specified in the config file (or via an attribute).
+WebChangeTypeFailed=Cannot convert {0} to {1}.
+WebBadEnum=The value '{0}' was not found in the enum type '{1}'.
+WebBadHex=Invalid hex digit: '{0}'.
+WebClientBindingAttributeRequired=WebServiceBindingAttribute is required on proxy classes.
+WebHeaderInvalidRelay='{0}' is not a valid value for the 'relay' attribute. Valid values are '0', '1', 'true', and 'false'.
+WebVirtualDisoRoot=Web Directory '{0}' must be same or below to '{1}'.
+WebRefDuplicateSchema=Ignoring duplicate schema with TargetNamespace='{0}' from '{1}'.
+WebRefDuplicateService=Ignoring duplicate service description with TargetNamespace='{0}' from '{1}'.
+WebWsiContentTypeEncoding=Input message does not conform to Simple SOAP Binding Profile Version 1.0. Requirement R1012: A MESSAGE MUST serialize the envelope using either UTF-8 or UTF-16 character encoding.
+WebWsiViolation=Service '{0}' does not conform to WS-I Basic Profile v1.1. Please examine each of the normative statement violations below. To turn off conformance check set the ConformanceClaims property on corresponding WebServiceBinding attribute to WsiClaims.None.\r\n{1}
+WebNullReaderForMessage=The GetReaderForMessage method cannot return null.
+WebNullWriterForMessage=The GetWriterForMessage method cannot return null.
+NeedConcreteType=Cannot create an instance of an interface {0}. Please specify a concrete implementation of the interface instead.
+
+WebUnknownElement=The element was not expected in this context: {0}.
+WebUnknownElement1=An unexpected element was encountered: {0}. No elements were expected in this scope.
+WebUnknownElement2=The element was not expected in this context: {0}. Expected elements: {1}.
+WebUnknownAttribute=An unexpected attribute was encountered: {0}='{1}'.
+WebUnknownAttribute2=An unexpected attribute was encountered: {0}='{1}'. No attributes were expected in this scope.
+WebUnknownAttribute3=The attribute was not expected in this context: {0}='{1}'. Expected attributes: {2}.
+WebUnreferencedObject=Item id='{0}' was not referenced: {1}.
+WebSuppressedExceptionMessage=An error occurred on the server.
+
+CannotRunInPartialTrustOutsideAspNet=Cannot run in partial trust outside the ASP.NET environment.
+
+
+; DescriptionAttributes
+
+WebServiceContext=The ASP.NET context object for the current request.
+WebServiceSession=The ASP.NET session object for the current request.
+WebServiceServer=The ASP.NET utility object for the current request.
+WebServiceUser=The ASP.NET user object for the current request. The object is used for authorization.
+WebServiceSoapVersion=The version of the SOAP protocol used for the request.
+ClientProtocolAllowAutoRedirect=Enable automatic handling of server redirects.
+ClientProtocolCookieContainer=A container for all cookies received from servers in the current session.
+ClientProtocolPreAuthenticate=Enables pre authentication of the request.
+ClientProtocolClientCertificates=The client certificates that will be sent to the server, if the server requests them.
+ClientProtocolUrl=The base URL to the server to use for requests.
+ClientProtocolEncoding=The encoding to use for requests.
+ClientProtocolTimeout=Sets the timeout in milliseconds to be used for synchronous calls. The default of -1 means infinite.
+ClientProtocolUserAgent=Sets the user agent http header for the request.
+ClientProtocolUsername=The user name to be sent for basic and digest authentication.
+ClientProtocolPassword=The password to be used for basic and digest authentication.
+ClientProtocolDomain=The domain to be used for basic and digest authentication.
+ClientProtocolProxyName=The name of the proxy server to use for requests.
+ClientProtocolProxyPort=The port number of the proxy server to use for requests.
+ClientProtocolSoapVersion=The version of the SOAP protocol to use for requests. By default, SOAP 1.1 will be used.
+ClientProtocolEnableDecompression=This allows user to easily leverage HTTP compression that's built into IIS 6.
+
+; Soap localized text
+
+; this constant is Code for the representation of names of languages [ISO 639].
+; some of the values are
+; ar Arabic
+; cs Czech
+; da Danish
+; de German
+; el Greek
+; es Spanish
+; fa Persian
+; fi Finnish
+; fr French
+; he Hebrew (formerly iw)
+; hi Hindi
+; hu Hungarian
+; it Italian
+; ja Japanese
+; zh Chinese
+;
+; for the full list plase refer to http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt
+XmlLang=en
+
+; DefaultWsdlHelpGenerator.aspx localized text
+
+HelpGeneratorHttpGetTitle=HTTP GET
+HelpGeneratorHttpGetText=The following is a sample HTTP GET request and response. The <font class=value>placeholders</font> shown need to be replaced with actual values.
+HelpGeneratorHttpPostTitle=HTTP POST
+HelpGeneratorHttpPostText=The following is a sample HTTP POST request and response. The <font class=value>placeholders</font> shown need to be replaced with actual values.
+HelpGeneratorSoapTitle=SOAP 1.1
+HelpGeneratorSoap1_2Title=SOAP 1.2
+HelpGeneratorSoapText=The following is a sample SOAP 1.1 request and response. The <font class=value>placeholders</font> shown need to be replaced with actual values.
+HelpGeneratorSoap1_2Text=The following is a sample SOAP 1.2 request and response. The <font class=value>placeholders</font> shown need to be replaced with actual values.
+HelpGeneratorInvokeButton=Invoke
+HelpGeneratorParameter=Parameter
+HelpGeneratorValue=Value
+HelpGeneratorTestHeader=Test
+HelpGeneratorTestText=To test the operation using the HTTP POST protocol, click the 'Invoke' button.
+HelpGeneratorNoTestFormRemote=The test form is only available for requests from the local machine.
+HelpGeneratorLinkBack=Click <a href=\"{0}\">here</a> for a complete list of operations.
+HelpGeneratorEnableHttpPostHeader=Enabling http post protocol in configuration
+HelpGeneratorEnableHttpPostInstructions=To enable the http post protocol add the following to the web.config file in your application or site root directory.
+HelpGeneratorOperationsIntro=The following operations are supported. For a formal definition, please review the <a href=\"{0}\">Service Description</a>.
+HelpGeneratorWebService=Web Service
+HelpGeneratorNoHttpGetTest=No test form is available as this service or method does not support the HTTP GET protocol.
+HelpGeneratorNoHttpPostTest=No test form is available as this service or method does not support the HTTP POST protocol.
+HelpGeneratorNoTestNonPrimitive=The test form is only available for methods with primitive types as parameters.
+HelpGeneratorMethodNotFound=Method Not Found
+HelpGeneratorMethodNotFoundText=Method '{0}' was not found in service {1}.
+HelpGeneratorStyleBODY=color: #000000; background-color: white; font-family: Verdana; margin-left: 0px; margin-top: 0px;
+HelpGeneratorStylecontent=margin-left: 30px; font-size: .70em; padding-bottom: 2em;
+HelpGeneratorStyleAlink=color: #336699; font-weight: bold; text-decoration: underline;
+HelpGeneratorStyleAvisited=color: #6699cc; font-weight: bold; text-decoration: underline;
+HelpGeneratorStyleAactive=color: #336699; font-weight: bold; text-decoration: underline;
+HelpGeneratorStyleAhover=color: cc3300; font-weight: bold; text-decoration: underline;
+HelpGeneratorStyleP=color: #000000; margin-top: 0px; margin-bottom: 12px; font-family: Verdana;
+HelpGeneratorStylepre=background-color: #e5e5cc; padding: 5px; font-family: Courier New; font-size: x-small; margin-top: -5px; border: 1px #f0f0e0 solid;
+HelpGeneratorStyletd=color: #000000; font-family: Verdana; font-size: .7em;
+HelpGeneratorStyleh2=font-size: 1.5em; font-weight: bold; margin-top: 25px; margin-bottom: 10px; border-top: 1px solid #003366; margin-left: -15px; color: #003366;
+HelpGeneratorStyleh3=font-size: 1.1em; color: #000000; margin-left: -15px; margin-top: 10px; margin-bottom: 10px;
+HelpGeneratorStyleul=margin-top: 10px; margin-left: 20px;
+HelpGeneratorStyleol=margin-top: 10px; margin-left: 20px;
+HelpGeneratorStyleli=margin-top: 10px; color: #000000;
+HelpGeneratorStylefontvalue=color: darkblue; font: bold;
+HelpGeneratorStylefontkey=color: darkgreen; font: bold;
+HelpGeneratorStylefontError=color: darkred; font: bold;
+HelpGeneratorStyleheading1=color: #ffffff; font-family: Tahoma; font-size: 26px; font-weight: normal; background-color: #003366; margin-top: 0px; margin-bottom: 0px; margin-left: -30px; padding-top: 10px; padding-bottom: 3px; padding-left: 15px; width: 105%;
+HelpGeneratorStylebutton=background-color: #dcdcdc; font-family: Verdana; font-size: 1em; border-top: #cccccc 1px solid; border-bottom: #666666 1px solid; border-left: #cccccc 1px solid; border-right: #666666 1px solid;
+HelpGeneratorStylefrmheader=color: #000000; background: #dcdcdc; font-family: Verdana; font-size: .7em; font-weight: normal; border-bottom: 1px solid #dcdcdc; padding-top: 2px; padding-bottom: 2px;
+HelpGeneratorStylefrmtext=font-family: Verdana; font-size: .7em; margin-top: 8px; margin-bottom: 0px; margin-left: 32px;
+HelpGeneratorStylefrmInput=font-family: Verdana; font-size: 1em;
+HelpGeneratorStyleintro=margin-left: -15px;
+HelpGeneratorImplementation=implementation
+HelpGeneratorDefaultNamespaceWarning1=This web service is using http://tempuri.org/ as its default namespace.
+HelpGeneratorDefaultNamespaceWarning2=Recommendation: Change the default namespace before the XML Web service is made public.
+HelpGeneratorDefaultNamespaceHelp1=Each XML Web service needs a unique namespace in order for client applications to distinguish it from other services on the Web. http://tempuri.org/ is available for XML Web services that are under development, but published XML Web services should use a more permanent namespace.
+HelpGeneratorDefaultNamespaceHelp2=Your XML Web service should be identified by a namespace that you control. For example, you can use your company's Internet domain name as part of the namespace. Although many XML Web service namespaces look like URLs, they need not point to actual resources on the Web. (XML Web service namespaces are URIs.)
+HelpGeneratorDefaultNamespaceHelp3=For XML Web services creating using ASP.NET, the default namespace can be changed using the WebService attribute's Namespace property. The WebService attribute is an attribute applied to the class that contains the XML Web service methods. Below is a code example that sets the namespace to "http://microsoft.com/webservices/":
+HelpGeneratorDefaultNamespaceHelp4=For more details on XML namespaces, see the W3C recommendation on <a href="http://www.w3.org/TR/REC-xml-names/">Namespaces in XML</A>.
+HelpGeneratorDefaultNamespaceHelp5=For more details on WSDL, see the <a href="http://www.w3.org/TR/wsdl">WSDL Specification</a>.
+HelpGeneratorDefaultNamespaceHelp6=For more details on URIs, see <a href="http://www.ietf.org/rfc/rfc2396.txt">RFC 2396</a>.
+
+HelpGeneratorServiceConformance=This web service does not conform to WS-I Basic Profile v1.1.
+HelpGeneratorServiceConformanceDetails=Please examine each of the normative statement violations below. Follow the recommendations to remedy it, or add setting to the &lt;webServices&gt; config section to turn off BP 1.1 conformance warnings for the entire vroot.
+HelpGeneratorServiceConformanceConfig=To turn off BP 1.1 conformance warnings for the entire vroot remove the 'BP1.1' value from the &lt;conformanceWarnings&gt; section of the configuration file of your application:
+HelpGeneratorRecommendation=Recommendation
+
+Rxxxx=SOAP 1.1 binding was not found
+HelpGeneratorServiceConformanceRxxxx=WS-I's Basic Profile 1.1 consists of implementation guidelines that recommend how a set of core Web services specifications should be used together to develop interoperable Web services. For the 1.1 Profile, those specifications are SOAP 1.1, WSDL 1.1, UDDI 2.0, XML 1.0 and XML Schema.
+HelpGeneratorServiceConformanceRxxxx_r=Consider changing config settings in web.config file in your application or site root directory to enable SOAP 1.1 protocol for your Web service.
+HelpGeneratorServiceConformanceR2028=A DESCRIPTION using the WSDL namespace and the WSDL SOAP binding namespace MUST be valid according to the XML Schemas found at http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd and http://schemas.xmlsoap.org/wsdl/soap/2003-02-11.xsd.
+HelpGeneratorServiceConformanceR2026=A DESCRIPTION SHOULD NOT include extension elements with a wsdl:required attribute value of "true" on any WSDL construct (wsdl:binding, wsdl:portType, wsdl:message, wsdl:types or wsdl:import) that claims conformance to the Profile.
+HelpGeneratorServiceConformanceR2705=A DESCRIPTION MUST use the same value of, either 'rpc' or 'document' for the style attribute for all of its operations in a portType, in the SOAP Binding description.
+HelpGeneratorServiceConformanceR2705_r=To make binding conformant add explicit SoapRpcMethod or SoapDocumentMethod attribute to all WebMethods of this binding.
+HelpGeneratorServiceConformanceR2706=A wsdl:binding in a DESCRIPTION MUST use the value of "literal" for the use attribute in all soapbind:body, soapbind:fault, soapbind:header and soapbind:headerfault elements.
+HelpGeneratorServiceConformanceR2706_r=To make it conformant change the implementation of the service to use 'rpc-literal' or 'document-literal' SOAP messages. You need to add explicit <font class=value>Use=SoapBindingUse.Literal</font> property to all service and method level attributes: SoapRpcService, SoapRpcMethod, SoapDocumentService, SoapDocumentMethod.
+HelpGeneratorServiceConformanceR2007=A DESCRIPTION MUST specify a non-empty location attribute on the wsdl:import element. Although the wsdl:import statement is modeled after the xsd:import statement, the location attribute is required by wsdl:import while the corresponding attribute on xsd:import, schemaLocation is optional. Consistent with location being required, its content is not intended to be empty.
+HelpGeneratorServiceConformanceR2007_r=To make it conformant modify all import statements to include a non-empty location attribute.
+HelpGeneratorServiceConformanceR2803=In a DESCRIPTION, the namespace attribute of the wsdl:import MUST NOT be a relative URI.
+HelpGeneratorServiceConformanceR2803_r=To make it conformant modify all import statements to use an absolute URI for namespace attribute value.
+HelpGeneratorServiceConformanceR2105=All xsd:schema elements contained in a wsdl:types element of a DESCRIPTION MUST have a targetNamespace attribute with a valid and non-null value, UNLESS the xsd:schema element has xsd:import and/or xsd:annotation as its only child element(s).
+HelpGeneratorServiceConformanceR2105_r=Please examine your schema definitions and add explicit targetNamespace attribute. Requiring a targetNamespace on all xsd:schema elements that are children of wsdl:types is a good practice, places a minimal burden on authors of WSDL documents, and avoids the cases that are not as clearly defined as they might be.
+HelpGeneratorServiceConformanceR1014=The children of the soap:Body element in a ENVELOPE MUST be namespace qualified. The use of unqualified element names may cause naming conflicts, therefore qualified names must be used for the children of soap:Body.
+HelpGeneratorServiceConformanceR1014_r=To make binding conformant make sure that all response and request elements are namespace qualified. Use RequestNamespace and ResponseNamespace properties on the SoapDocumentMethod or SoapRpcMethod attribute to control the namespace.
+
+HelpGeneratorServiceConformanceR2201=A document-literal binding in a DESCRIPTION MUST, in each of its soapbind:body element(s), have at most one part listed in the parts attribute, if the parts attribute is specified.
+HelpGeneratorServiceConformanceR2210=If a document-literal binding in a DESCRIPTION does not specify the parts attribute on a soapbind:body element, the corresponding abstract wsdl:message MUST define zero or one wsdl:parts.
+HelpGeneratorServiceConformanceR2210_r=For Document-literal bindings, the Profile requires that at most one part, abstractly defined with the element attribute, be serialized into the soap:Body element. When using a Bare parameter style, a conformant method must have at most one parameter.
+HelpGeneratorServiceConformanceR2306=A wsdl:message in a DESCRIPTION MUST NOT specify both type and element attributes on the same wsdl:part.
+HelpGeneratorServiceConformanceR2203=An rpc-literal binding in a DESCRIPTION MUST refer, in its soapbind:body element(s), only to wsdl:part element(s) that have been defined using the type attribute.
+HelpGeneratorServiceConformanceR2204=A document-literal binding in a DESCRIPTION MUST refer, in each of its soapbind:body element(s), only to wsdl:part element(s) that have been defined using the element attribute.
+HelpGeneratorServiceConformanceR2205=A wsdl:binding in a DESCRIPTION MUST refer, in each of its soapbind:header, soapbind:headerfault and soapbind:fault elements, only to wsdl:part element(s) that have been defined using the element attribute. Because faults and headers do not contain parameters, soapbind:fault, soapbind:header and soapbind:headerfault assume, per WSDL 1.1, that the value of the style attribute is 'document'. R2204 requires that all wsdl:part elements with a style attribute whose value is 'document' that are bound to soapbind:body be defined using the element attribute. This requirement does the same for soapbind:fault, soapbind:header and soapbind:headerfault elements.
+HelpGeneratorServiceConformanceR2303=A DESCRIPTION MUST NOT use Solicit-Response and Notification type operations in a wsdl:portType definition. Solicit-Response and Notification operations are not well defined by WSDL 1.1; furthermore, WSDL 1.1 does not define bindings for them.
+HelpGeneratorServiceConformanceR2304=Operation name overloading in a wsdl:portType is disallowed by the Profile. A wsdl:portType in a DESCRIPTION MUST have operations with distinct values for their name attributes. Note that this requirement applies only to the wsdl:operations within a given wsdl:portType. A wsdl:portType may have wsdl:operations with names that are the same as those found in other wsdl:portTypes.
+HelpGeneratorServiceConformanceR2304_r=To make service conformant please make sure that all web methods belonging to the same binding have unique names.
+HelpGeneratorServiceConformanceR2701=The wsdl:binding element in a DESCRIPTION MUST be constructed so that its soapbind:binding child element specifies the transport attribute.
+HelpGeneratorServiceConformanceR2702=A wsdl:binding element in a DESCRIPTION MUST specify the HTTP transport protocol with SOAP binding. Specifically, the transport attribute of its soapbind:binding child MUST have the value "http://schemas.xmlsoap.org/soap/http". Note that this requirement does not prohibit the use of HTTPS; See R5000.
+HelpGeneratorServiceConformanceR2710=The operations in a wsdl:binding in a DESCRIPTION MUST result in wire signatures that are different from one another. An endpoint that supports multiple operations must unambiguously identify the operation being invoked based on the input message that it receives. This is only possible if all the operations specified in the wsdl:binding associated with an endpoint have a unique wire signature.
+HelpGeneratorServiceConformanceR2710_r=The Profile defines the "wire signature" of an operation in a wsdl:binding to be the fully qualified name of the child element of the soap:Body of the SOAP input message it describes. For the case of an empty soap:Body this name is an empty string. In the case of rpc-literal binding, the operation name is used as a wrapper for the part accessors. In the document-literal case, since a wrapper with the operation name is not present, the message signatures must be correctly designed so that they meet this requirement.
+HelpGeneratorServiceConformanceR2716=A document-literal binding in a DESCRIPTION MUST NOT have the namespace attribute specified on contained soapbind:body, soapbind:header, soapbind:headerfault and soapbind:fault elements.
+HelpGeneratorServiceConformanceR2717=An rpc-literal binding in a DESCRIPTION MUST have the namespace attribute specified, the value of which MUST be an absolute URI, on contained soapbind:body elements.
+HelpGeneratorServiceConformanceR2726=An rpc-literal binding in a DESCRIPTION MUST NOT have the namespace attribute specified on contained soapbind:header, soapbind:headerfault and soapbind:fault elements.
+HelpGeneratorServiceConformanceR2718=A wsdl:binding in a DESCRIPTION MUST have the same set of wsdl:operations as the wsdl:portType to which it refers.
+HelpGeneratorServiceConformanceR2720=A wsdl:binding in a DESCRIPTION MUST use the attribute named part with a schema type of "NMTOKEN" on all contained soapbind:header and soapbind:headerfault elements.
+HelpGeneratorServiceConformanceR2749=A wsdl:binding in a DESCRIPTION MUST NOT use the attribute named parts on contained soapbind:header and soapbind:headerfault elements.
+HelpGeneratorServiceConformanceR2721=A wsdl:binding in a DESCRIPTION MUST have the name attribute specified on all contained soapbind:fault elements.
+HelpGeneratorServiceConformanceR2754=In a DESCRIPTION, the value of the name attribute on a soapbind:fault element MUST match the value of the name attribute on its parent wsdl:fault element.
+HelpGeneratorServiceConformanceHelp=For more details on Basic Profile Version 1.1, see the <a href="http://www.ws-i.org/Profiles/BasicProfile-1.1.html"> Basic Profile Specification</a>.
+
+BindingMissingAttribute=Binding '{0}' from namespace '{1}' missing required '{2}' attribute.
+BindingInvalidAttribute=Binding '{0}' from namespace '{1}' has invalid attribute: {2}='{3}'.
+OperationFlowNotification=Operation '{0}' on portType '{1}' from namespace '{2}' defined as Notification.
+OperationFlowSolicitResponse=Operation '{0}' on portType '{1}' from namespace '{2}' defined as Solicit-Response.
+
+PortTypeOperationMissing=Operation '{0}' on binding '{1}' from namespace '{2}' has no matching operation on portType '{3}' from namespace '{4}'.
+BindingOperationMissing=Binding '{0}' from namespace '{1}' missing some operations defined on portType '{2}' from namespace '{3}'.
+BindingMultipleParts=One of the extensibility elements on Binding '{0}' from namespace '{1}' has more then one part listed in the '{2}' attribute.
+ElementEncodedExtension=Element '{0}' on Binding '{1}' from namespace '{2}' has invalid attribute {3}='{4}'.
+InputElement=Input element {0} of operation '{1}' on portType '{2}' from namespace '{3}'. {4}
+OutputElement=Output element {0} of operation '{1}' on portType '{2}' from namespace '{3}'. {4}
+Fault=soapbind:fault '{0}' on operation '{1}' on portType '{2}' from namespace '{3}'. {4}
+HeaderFault={0} on operation '{1}' on portType '{2}' from namespace '{3}'. {4}
+Binding=Binding '{0}' from namespace '{1}'.
+Operation=Operation '{0}' on portType '{1}' from namespace '{2}'.
+OperationBinding=Operation '{0}' on binding '{1}' from namespace '{2}'.
+FaultBinding=Fault '{0}' on operation '{1}' on binding '{2}' from namespace '{3}'.
+Description=Service description with targetNamespace='{0}'.
+Element={0} from service description with targetNamespace='{1}'.
+Port=Port '{0}' on service {1} from namespace='{2}'.
+Message=Message '{0}' from service description with targetNamespace='{1}'.
+Part=Part '{0}' of message '{1}' from service description with targetNamespace='{2}'.
+OperationMissingBinding=Operation '{0}' on portType '{1}' from namespace '{2}' has no matching binding.
+UriValueRelative=Value '{0}' is not an absolute URI.
+HelpGeneratorLanguageConfig=There is no CodeDom provider defined for the language '{0}'.
+HelpGeneratorInternalError=The XML Web service help page encountered an internal error.
+OperationOverload=Binding '{0}' from namespace '{1}' contains operations with matching wire signatures. Wire signature of message '{2}' matches message '{3}'.
+WireSignature=Input message '{0}' from namespace '{1}' has wire signature '{2}:{3}'.
+WireSignatureEmpty=Input message '{0}' from namespace '{1}' has no elements (empty wire signature)
+
+; wsdl validation
+WsdlInstanceValidation=Warning: {0}
+WsdlInstanceValidationDetails=Warning: {0} Line {1}, position {2}.
+
+WhenUsingAMessageStyleOfParametersAsDocument0=When using a Bare parameter style and a service RoutingStyle of RequestElement, the method must have exactly one parameter.
+UnsupportedMessageStyle1=Message style {0} is not supported.
+TheMethodsAndUseTheSameSoapActionWhenTheService3=The methods {0} and {1} use the same SOAPAction '{2}'. When the RoutingStyle of the XML Web service is SoapAction, SOAPAction values must be unique across methods on the XML Web service. You can change the SOAPAction with the Action parameter to the SoapDocumentMethod or SoapRpcMethod attributes, or you can specify a RoutingStyle of RequestElement on the XML Web service.
+TheMethodDoesNotHaveARequestElementEither1=The method {0} does not have a request element. You can use a RoutingStyle of SoapAction on the XML Web service, use the Wrapped parameter style on the method, or add a parameter to the method.
+TheMethodsAndUseTheSameRequestElementXmlns4=The methods {0} and {1} use the same request element <{2} xmlns='{3}'>. When the RoutingStyle of the XML Web service is RequestElement, request elements must be unique across methods on the XML Web service. If you are using the Rpc style, you can change the message name with the RequestElementName and RequestElementNamespace parameters to SoapRpcMethodAttribute. For document style using wrapped parameter style, use the RequestElementName and RequestElementNamespace parameters to SoapDocumentMethodAttribute. For the bare parameter style, you must change the element that represents the parameter. Alternatively, you can specify a RoutingStyle of SoapAction on the XML Web service.
+TheMethodsAndUseTheSameRequestElementAndSoapActionXmlns6=The methods {0} and {1} use the same request element <{2} xmlns='{3}'> and the methods {0} and {4} use the same SOAPAction '{5}'. Each method on the XML Web service must have a unique SOAPAction or request element. If you are using the Rpc style, you can change the message name with the RequestElementName and RequestElementNamespace parameters to SoapRpcMethodAttribute. For document style using wrapped parameter style, use the RequestElementName and RequestElementNamespace parameters to SoapDocumentMethodAttribute. For the bare parameter style, you must change the element that represents the parameter. Alternatively, you can specify a unique SoapAction for each method using the Action parameter to SoapRpcMethodAttribute or SoapDocumentMethodAttribute.
+TheRootElementForTheRequestCouldNotBeDetermined0=The root element for the request could not be determined. When RoutingStyle is set to RequestElement, SoapExtensions configured via an attribute on the method cannot modify the request stream before it is read. The extension must be configured via the SoapExtensionTypes element in web.config, or the request must arrive at the server as clear text.
+TheRequestElementXmlnsWasNotRecognized2=The request element <{0} xmlns='{1}'> was not recognized.
+ServiceDescriptionWasNotFound0=XML Web service description was not found.
+internalError0=An internal error occurred.
+DiscoveryIsNotPossibleBecauseTypeIsMissing1=Discovery is not possible because type '{0}' is missing a WebServiceBinding attribute.
+TheBindingNamedFromNamespaceWasNotFoundIn3=The binding named '{0}' from namespace '{1}' was not found in the discovery document found at '{2}'.
+Missing2=Missing {0}.{1}
+MissingHttpOperationElement0=Missing http:operation element.
+MessageHasNoParts1=Message '{0}' has no parts.
+DuplicateInputOutputNames0=Duplicate input/output names.
+MissingBinding0=The operation has no matching binding. Check if the operation, input and output names in the Binding section match with the corresponding names in the PortType section.
+MissingInputBinding0=Missing input binding.
+MissingOutputBinding0=Missing output binding.
+UnableToImportOperation1=Unable to import operation '{0}'.
+UnableToImportBindingFromNamespace2=Unable to import binding '{0}' from namespace '{1}'.
+TheOperationFromNamespaceHadInvalidSyntax3=The operation '{0}' on portType '{1}' from namespace '{2}' had the following syntax error: {3}
+TheOperationBindingFromNamespaceHadInvalid3=The operation binding '{0}' from namespace '{1}' had invalid syntax. {2}
+IfAppSettingBaseUrlArgumentIsSpecifiedThen0=If 'appSettingBaseUrl' argument is specified then 'url' argument must also be specified.
+MissingMessagePartForMessageFromNamespace3=Missing message part '{0}' for message '{1}' from namespace '{2}'.
+MissingMessage2=Missing message '{0}' from namespace '{1}'.
+OnlyXmlElementsOrTypesDerivingFromServiceDescriptionFormatExtension0=Only XmlElements or types deriving from ServiceDescriptionFormatExtension may be added.
+OnlyOperationInputOrOperationOutputTypes=Only objects of type OperationInput or OperationOutput may be added.
+ProtocolWithNameIsNotRecognized1=Protocol with name '{0}' is not recognized.
+BothAndUseTheMessageNameUseTheMessageName3=Both {0} and {1} use the message name '{2}'. Use the MessageName property of the WebMethod custom attribute to specify unique message names for the methods.
+MissingSoapOperationBinding0=Missing soap:operation binding.
+OnlyOneWebServiceBindingAttributeMayBeSpecified1=Only one WebServiceBinding attribute may be specified on type '{0}'.
+ContractOverride=Method {0} on type {1} is an implementation of the service contract interface {2}. Service Description altering attributes cannot be specified on service implementation. Please place custom attribute on the interface declaration: interface: {2}, method: {3}, attribute: {4}.
+TypeIsMissingWebServiceBindingAttributeThat2=Type '{0}' is missing WebServiceBinding attribute that defines a binding named '{1}'.
+MultipleBindingsWithSameName2=Type '{0}' has multiple WebServiceBinding attributes that define a binding named '{1}'.
+UnknownWebServicesProtocolInConfigFile1=Unknown XML Web services protocol '{0}' in config file.
+RequiredXmlFormatExtensionAttributeIsMissing1=Required XmlFormatExtension attribute is missing on class {0}.
+TheSyntaxOfTypeMayNotBeExtended1=The syntax of type {0} may not be extended.
+InternalConfigurationError0=Internal configuration error.
+ThereIsNoSoapTransportImporterThatUnderstands1=There is no SoapTransportImporter that understands the transport '{0}'.
+MissingSoapBodyInputBinding0=Missing soap:body input binding.
+MissingSoapBodyOutputBinding0=Missing soap:body output binding.
+TheOperationStyleRpcButBothMessagesAreNot0=The operation style=rpc but both messages are not use=encoded.
+TheCombinationOfStyleRpcWithUseLiteralIsNot0=The combination of style=rpc with use=literal is not supported.
+TheEncodingIsNotSupported1=The encoding '{0}' is not supported.
+SpecifyingAnElementForUseEncodedMessageParts0=Specifying an element for use=encoded message parts is not supported.
+EachMessagePartInAnUseEncodedMessageMustSpecify0=Each message part in an use=encoded message must specify a type.
+SpecifyingATypeForUseLiteralMessagesIs0=Specifying a type for use=literal messages is not supported.
+SpecifyingATypeForUseLiteralMessagesIsAny=Specifying a type for use=literal messages is not supported. Type name='{0}' from targetNamespace='{1}' cannot be used as top-level any element.
+EachMessagePartInAUseLiteralMessageMustSpecify0=Each message part in a use=literal message must specify an element.
+EachMessagePartInRpcUseLiteralMessageMustSpecify0=Each message part in a use=literal style=rpc message must specify a type.
+NoInputMIMEFormatsWereRecognized0=No input MIME formats were recognized.
+NoInputHTTPFormatsWereRecognized0=No input HTTP formats were recognized.
+NoOutputMIMEFormatsWereRecognized0=No output MIME formats were recognized.
+MissingMatchElement0=Missing match element.
+SolicitResponseIsNotSupported0=SolicitResponse is not supported.
+RequestResponseIsNotSupported0=RequestResponse is not supported.
+OneWayIsNotSupported0=OneWay is not supported.
+NotificationIsNotSupported0=Notification is not supported.
+SyntaxErrorInWSDLDocumentMessageDoesNotHave1=Syntax error in WSDL document: Message '{0}' does not have an operation associated with it in the portType.
+WebMissingBodyElement=Request format is invalid: Missing required soap:Body element.
+WebMissingEnvelopeElement=Request format is invalid: Missing required soap:Envelope element.
+UnableToHandleRequestActionNotRecognized1=Unable to handle request. The action '{0}' was not recognized.
+UnableToHandleRequestActionRequired0=Unable to handle request without a valid action parameter. Please supply a valid soap action.
+UnableToHandleRequest0=Unable to handle request.
+FailedToHandleRequest0=Failed to handle request.
+CodeGenSupportReferenceParameters=Declaring parameters to be 'out' or 'ref' is not supported by {0}.
+CodeGenSupportParameterAttributes=Custom attributes on parameter declarations are not supported by {0}.
+CodeGenSupportReturnTypeAttributes=Custom attributes on return value are not supported by {0}.
+
+TheBinding0FromNamespace1WasIgnored2=The binding '{0}' from namespace '{1}' was ignored. {2}
+TheOperation0FromNamespace1WasIgnored2=The operation '{0}' from namespace '{1}' was ignored. {2}
+TheOperationBinding0FromNamespace1WasIgnored=The operation binding '{0}' from namespace '{1}' was ignored. {2}
+NoMethodsWereFoundInTheWSDLForThisProtocol=No methods were found in the WSDL for this protocol.
+UnexpectedFlush=Unexpected flush
+ThereWasAnErrorDuringAsyncProcessing=There was an error during async processing.
+CanTCallTheEndMethodOfAnAsyncCallMoreThan=Can't call the end method of an async call more than once.
+AsyncDuplicateUserState=There was an error during asynchronous processing. Unique state object is required for multiple asynchronous simultaneous operations to be outstanding.
+StreamDoesNotSeek=This stream does not support seeking operations.
+StreamDoesNotRead=This stream does not support read operations.
+ElementTypeMustBeObjectOrSoapReflectedException=The elementType must be one of SoapReflectedExtension or Object.
+ElementTypeMustBeObjectOrSoapExtensionOrSoapReflectedException=The elementType must be one of SoapExtension, SoapReflectedExtension, or Object.
+ProtocolDoesNotAsyncSerialize=The protocol does not support async serialization.
+ThereWasAnErrorDownloading0=There was an error downloading '{0}'.
+TheHTMLDocumentDoesNotContainDiscoveryInformation=The HTML document does not contain Web service discovery information.
+TheDocumentWasNotRecognizedAsAKnownDocumentType=The document was not recognized as a known document type (WSDL, XML Schema, or Discovery document) for the following reason: \n - {0}
+TheDocumentWasUnderstoodButContainsErrors=The document was understood, but it could not be processed.
+TheWSDLDocumentContainsLinksThatCouldNotBeResolved=The WSDL document contains links that could not be resolved.
+TheSchemaDocumentContainsLinksThatCouldNotBeResolved=The XML schema document contains links that could not be resolved.
+CanTSpecifyElementOnEncodedMessagePartsPart=The element attribute is not allowed on encoded message parts. The erroneous part is named '{0}' in message '{1}'.
+CanTMergeMessage=Cannot add service description with targetNamespace='{0}': message with name='{1}' already present in the description collection.
+CanTMergePortType=Cannot add service description with targetNamespace='{0}': portType with name='{1}' already present in the description collection.
+CanTMergeBinding=Cannot add service description with targetNamespace='{0}': binding with name='{1}' already present in the description collection.
+CanTMergeTypes=Cannot add service description with targetNamespace='{0}': schema with targetNamespace='{1}' already present in the description collection.
+CanTMergeService=Cannot add service description with targetNamespace='{0}': service with name='{1}' already present in the description collection.
+indexMustBeBetweenAnd0Inclusive=index must be between 0 and {0}, inclusive.
+BPConformanceSoapEncodedMethod=WebMethod {0} on WebService {1} claims conformance, but use=encoded is non-conformant according to WS-I Basic Profile v1.1.
+BPConformanceHeaderFault=WebMethod {0} on WebService {1} claims conformance. Using SOAP header with {2}={3}.{4} is not allowed on conformant methods.
+WsdlGenRpcLitAnonimousType=Method {0}.{1} can not be reflected. Parameter '{2}' may not be used with Rpc\\Literal SOAP messages because it is declared using an anonymous schema type, only top-level named types can be used with rpc\\literal SOAP messages.
+WsdlGenRpcLitAccessorNamespace=Method {0}.{1} can not be reflected. Parameter '{2}' has invalid accessor: If you are using the Rpc\\Literal method, you can set the part's namespace.
+StackTraceEnd=--- End of inner exception stack trace ---
+CodeRemarks=<remarks/>
+CodegenWarningDetails=CODEGEN: {0}
+
+ValidationError=Error: {0} Line {1}, position {2}.
+SchemaValidationError=Schema validation error: {0}
+SchemaValidationWarning=Schema validation warning: {0}
+SchemaSyntaxErrorDetails=Schema with targetNamespace='{0}' has invalid syntax. {1} Line {2}, position {3}.
+SchemaSyntaxErrorItemDetails=Schema with targetNamespace='{0}' has invalid syntax. Check schema item '{1}' named '{2}': {3}
+InitFailed=Initialization failure. Please review input options and documents for validity.
+
+XmlSchemaElementReference=Element reference '{0}' declared in schema type '{1}' from namespace '{2}'.
+XmlSchemaAttributeReference=Attribute reference '{0}' declared in schema type '{1}' from namespace '{2}'.
+XmlSchemaItem=Schema item '{1}' from namespace '{0}'. {2}
+XmlSchemaNamedItem=Schema item '{1}' named '{2}' from namespace '{0}' is invalid. {3}
+XmlSchemaContentDef=Check content definition of schema type '{0}' from namespace '{1}'. {2}
+XmlSchema=Schema with targetNamespace='{0}' has invalid syntax. {1}
+
+;
+; Tracing messages
+;
+TraceCallEnter=Calling {0}\r\n Caller: {1}
+TraceCallEnterDetails=Calling {0}\r\n Method: {2}\r\n Caller: {1}
+TraceCallExit=Return from {0}\r\n Caller: {1}
+TraceExceptionThrown=Exception thrown in {0}.\r\n {1}: {2}
+TraceExceptionCought=Exception caught in {0}.\r\n {1}: {2}
+TraceExceptionIgnored=Exception ignored in {0}.\r\n {1}: {2}
+TraceExceptionDetails=Exception Details:\r\n{0}
+TracePostWorkItemIn=Calling WorkItem.Post({0})
+TracePostWorkItemOut=Return from WorkItem.Post({0})
+
+;Caller HttpRequest info
+TraceUserHostName=Request Host Name: {0}
+TraceUserHostAddress=Request Host Address: {0}
+TraceUrl=Request Url: [{0}] {1}
+TraceUrlReferrer=Http referrer: {0}
+
+TraceCreateSerializer=XmlSerializer [Create XmlSerializer]
+TraceWriteRequest=XmlSerializer [Write Request]
+TraceWriteResponse=XmlSerializer [Write Response]
+TraceWriteHeaders=XmlSerializer [Write SOAP Headers]
+TraceReadRequest=XmlSerializer [Read Request]
+TraceReadResponse=XmlSerializer [Read Response]
+TraceReadHeaders=XmlSerializer [Read SOAP Headers]
diff --git a/mcs/class/referencesource/System.Web.Services/System/Web/Services/Description/SoapProtocolImporter.cs b/mcs/class/referencesource/System.Web.Services/System/Web/Services/Description/SoapProtocolImporter.cs
index 687a920cf30..5ae94501893 100644
--- a/mcs/class/referencesource/System.Web.Services/System/Web/Services/Description/SoapProtocolImporter.cs
+++ b/mcs/class/referencesource/System.Web.Services/System/Web/Services/Description/SoapProtocolImporter.cs
@@ -374,7 +374,7 @@ namespace System.Web.Services.Description {
foreach (XmlMembersMapping member in soapMembers)
soapExporter.ExportMembersMapping(member);
- // NOTE, [....], we are sharing the SoapInclude and XmlInclude attributes of the
+ // NOTE, Microsoft, we are sharing the SoapInclude and XmlInclude attributes of the
// class among ALL classes generated, This is probably OK, since doing to per
// class would probably result in the same set of includes if the user
// has object as a return value (meaning 'all' types are OK).
@@ -1076,7 +1076,7 @@ namespace System.Web.Services.Description {
return true;
}
else if (soapBindingStyle == SoapBindingStyle.Document) {
- // NOTE, [....]. WSDL doesn't really let us figure out whether a document is
+ // NOTE, Microsoft. WSDL doesn't really let us figure out whether a document is
// in fact a struct containing parameters, so we apply a little heuristic here
// in order to produce the appropriate programming model.
hasWrapper = (parts.Length == 1 && string.Compare(parts[0].Name, "parameters", StringComparison.Ordinal) == 0);
diff --git a/mcs/class/referencesource/System.Web.Services/System/Web/Services/Discovery/DiscoveryDocument.cs b/mcs/class/referencesource/System.Web.Services/System/Web/Services/Discovery/DiscoveryDocument.cs
index 48bfca053d8..30527d5c5ad 100644
--- a/mcs/class/referencesource/System.Web.Services/System/Web/Services/Discovery/DiscoveryDocument.cs
+++ b/mcs/class/referencesource/System.Web.Services/System/Web/Services/Discovery/DiscoveryDocument.cs
@@ -36,7 +36,7 @@ namespace System.Web.Services.Discovery {
public DiscoveryDocument() {
}
- // NOTE, [....]: This property is not really ignored by the xml serializer. Instead,
+ // NOTE, Microsoft: This property is not really ignored by the xml serializer. Instead,
// the attributes that would go here are configured in WebServicesConfiguration's
// DiscoveryDocumentSerializer property.
/// <include file='doc\DiscoveryDocument.uex' path='docs/doc[@for="DiscoveryDocument.References"]/*' />
diff --git a/mcs/class/referencesource/System.Web.Services/System/Web/Services/Discovery/DiscoveryDocumentReference.cs b/mcs/class/referencesource/System.Web.Services/System/Web/Services/Discovery/DiscoveryDocumentReference.cs
index f97304c06c1..097e2133728 100644
--- a/mcs/class/referencesource/System.Web.Services/System/Web/Services/Discovery/DiscoveryDocumentReference.cs
+++ b/mcs/class/referencesource/System.Web.Services/System/Web/Services/Discovery/DiscoveryDocumentReference.cs
@@ -66,7 +66,7 @@ namespace System.Web.Services.Discovery {
public override string DefaultFilename {
get {
string filename = FilenameFromUrl(Url);
- return Path.ChangeExtension(filename, ".disco"); // [[....]] change default extension
+ return Path.ChangeExtension(filename, ".disco"); // [Microsoft] change default extension
}
}
diff --git a/mcs/class/referencesource/System.Web.Services/System/Web/Services/Discovery/DynamicVirtualDiscoSearcher.cs b/mcs/class/referencesource/System.Web.Services/System/Web/Services/Discovery/DynamicVirtualDiscoSearcher.cs
index 17f47054745..863998aafd3 100644
--- a/mcs/class/referencesource/System.Web.Services/System/Web/Services/Discovery/DynamicVirtualDiscoSearcher.cs
+++ b/mcs/class/referencesource/System.Web.Services/System/Web/Services/Discovery/DynamicVirtualDiscoSearcher.cs
@@ -140,7 +140,7 @@ namespace System.Web.Services.Discovery {
// -------------------------------------------------------------------------------
- // Calculate root ADSI virtual directory name (func by '[....]').
+ // Calculate root ADSI virtual directory name (func by 'Microsoft').
private string GetWebServerForUrl(string url) {
Uri uri = new Uri(url);
DirectoryEntry w3Service = new DirectoryEntry("IIS://" + uri.Host + "/W3SVC");
diff --git a/mcs/class/referencesource/System.Web.Services/System/Web/Services/Protocols/ClientProtocol.cs b/mcs/class/referencesource/System.Web.Services/System/Web/Services/Protocols/ClientProtocol.cs
index 671183a28c6..f06508a76d3 100644
--- a/mcs/class/referencesource/System.Web.Services/System/Web/Services/Protocols/ClientProtocol.cs
+++ b/mcs/class/referencesource/System.Web.Services/System/Web/Services/Protocols/ClientProtocol.cs
@@ -90,7 +90,7 @@ namespace System.Web.Services.Protocols {
/// <para>[To be supplied.]</para>
/// </devdoc>
protected WebClientProtocol() {
- this.timeout = 100000; // should be kept in [....] with HttpWebRequest.Timeout default (see private WebRequest.DefaultTimeout)
+ this.timeout = 100000; // should be kept in sync with HttpWebRequest.Timeout default (see private WebRequest.DefaultTimeout)
}
internal WebClientProtocol(WebClientProtocol protocol) {
diff --git a/mcs/class/referencesource/System.Web.Services/System/Web/Services/Protocols/LogicalMethodInfo.cs b/mcs/class/referencesource/System.Web.Services/System/Web/Services/Protocols/LogicalMethodInfo.cs
index 1b21ea69dcd..1e3cb1b68c4 100644
--- a/mcs/class/referencesource/System.Web.Services/System/Web/Services/Protocols/LogicalMethodInfo.cs
+++ b/mcs/class/referencesource/System.Web.Services/System/Web/Services/Protocols/LogicalMethodInfo.cs
@@ -20,7 +20,7 @@ namespace System.Web.Services.Protocols {
/// <para>[To be supplied.]</para>
/// </devdoc>
public enum LogicalMethodTypes {
- /// <include file='doc\LogicalMethodInfo.uex' path='docs/doc[@for="LogicalMethodTypes.[....]"]/*' />
+ /// <include file='doc\LogicalMethodInfo.uex' path='docs/doc[@for="LogicalMethodTypes.Sync"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
@@ -362,7 +362,7 @@ namespace System.Web.Services.Protocols {
/// <para>[To be supplied.]</para>
/// </devdoc>
public ICustomAttributeProvider CustomAttributeProvider {
- // Custom attributes are always on the XXX ([....]) or BeginXXX (async) method.
+ // Custom attributes are always on the XXX (sync) or BeginXXX (async) method.
get { return methodInfo; }
}
diff --git a/mcs/class/referencesource/System.Web.Services/System/Web/Services/Protocols/Scalars.cs b/mcs/class/referencesource/System.Web.Services/System/Web/Services/Protocols/Scalars.cs
index 846bd630e3d..0d388dd5e64 100644
--- a/mcs/class/referencesource/System.Web.Services/System/Web/Services/Protocols/Scalars.cs
+++ b/mcs/class/referencesource/System.Web.Services/System/Web/Services/Protocols/Scalars.cs
@@ -107,7 +107,7 @@ namespace System.Web.Services.Protocols {
}
/*
- // [....]: adapted from UrlEscapeStringUnicode below
+ // Microsoft: adapted from UrlEscapeStringUnicode below
internal static string EscapeStringUnicode(string s) {
int l = s.Length;
StringBuilder sb = new StringBuilder(l);
@@ -126,7 +126,7 @@ namespace System.Web.Services.Protocols {
}
*/
- // [....]: copied from System.Web.HttpUtility
+ // Microsoft: copied from System.Web.HttpUtility
internal static string UrlEscapeStringUnicode(string s) {
int l = s.Length;
StringBuilder sb = new StringBuilder(l);
diff --git a/mcs/class/referencesource/System.Web.Services/System/Web/Services/Protocols/SoapException.cs b/mcs/class/referencesource/System.Web.Services/System/Web/Services/Protocols/SoapException.cs
index 1e77558f94d..3b88b9e1676 100644
--- a/mcs/class/referencesource/System.Web.Services/System/Web/Services/Protocols/SoapException.cs
+++ b/mcs/class/referencesource/System.Web.Services/System/Web/Services/Protocols/SoapException.cs
@@ -59,7 +59,7 @@ namespace System.Web.Services.Protocols {
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
- // NOTE, [....]: The SOAP 1.1 is unclear on whether the detail element can or should be qualified.
+ // NOTE, Microsoft: The SOAP 1.1 is unclear on whether the detail element can or should be qualified.
// Based on consensus about the intent, we will not qualify it.
public static readonly XmlQualifiedName DetailElementName = new XmlQualifiedName(Soap.Element.FaultDetail, "");
diff --git a/mcs/class/referencesource/System.Web/AspNetEventSource.cs b/mcs/class/referencesource/System.Web/AspNetEventSource.cs
index 13648d0bf6c..2cfa8d059fd 100644
--- a/mcs/class/referencesource/System.Web/AspNetEventSource.cs
+++ b/mcs/class/referencesource/System.Web/AspNetEventSource.cs
@@ -91,7 +91,7 @@ namespace System.Web {
// Overload used only for deducing ETW parameters; use the public entry point instead.
//
// !! WARNING !!
- // The logic in RequestEnteredAspNetPipelineImpl must be kept in [....] with these parameters, otherwise
+ // The logic in RequestEnteredAspNetPipelineImpl must be kept in sync with these parameters, otherwise
// type safety violations could occur.
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "ETW looks at this method using reflection.")]
[Event((int)Events.RequestEnteredAspNetPipeline, Level = EventLevel.Informational, Task = (EventTask)Tasks.Request, Opcode = EventOpcode.Send, Version = 1)]
@@ -118,7 +118,7 @@ namespace System.Web {
fixed (char* pHttpVerb = httpVerb) {
// !! WARNING !!
- // This logic must be kept in [....] with the ETW-deduced parameters in RequestStarted,
+ // This logic must be kept in sync with the ETW-deduced parameters in RequestStarted,
// otherwise type safety violations could occur.
const int EVENTDATA_COUNT = 3;
EventData* pEventData = stackalloc EventData[EVENTDATA_COUNT];
@@ -145,7 +145,7 @@ namespace System.Web {
// Event attribute, but this causes a dependency between System.Web and mscorlib that breaks servicing.
//
// !! WARNING !!
- // The logic in RequestStartedImpl must be kept in [....] with these parameters, otherwise
+ // The logic in RequestStartedImpl must be kept in sync with these parameters, otherwise
// type safety violations could occur.
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "ETW looks at this method using reflection.")]
[Event((int)Events.RequestStarted, Level = EventLevel.Informational, Task = (EventTask)Tasks.Request, Opcode = EventOpcode.Start, Version = 1)]
diff --git a/mcs/class/referencesource/System.Web/Cache/CacheDependency.cs b/mcs/class/referencesource/System.Web/Cache/CacheDependency.cs
index 9e137fd5fcd..3bf632db8ae 100644
--- a/mcs/class/referencesource/System.Web/Cache/CacheDependency.cs
+++ b/mcs/class/referencesource/System.Web/Cache/CacheDependency.cs
@@ -26,10 +26,6 @@ namespace System.Web.Caching {
using System.Runtime.Caching;
#endif
- internal interface ICacheDependencyChanged {
- void DependencyChanged(Object sender, EventArgs e);
- }
-
/// <devdoc>
/// <para>The <see langword='CacheDependency'/> class tracks cache dependencies, which can be files,
@@ -50,7 +46,7 @@ namespace System.Web.Caching {
string _uniqueID; // used by HttpCachePolicy for the ETag
object _depFileInfos; // files to monitor for changes, either a DepFileInfo or array of DepFileInfos
object _entries; // cache entries we are dependent on, either a string or array of strings
- ICacheDependencyChanged _objNotify; // Associated object to notify when a change occurs
+ Action<Object, EventArgs> _objNotify; // Associated object to notify when a change occurs
SafeBitVector32 _bits; // status bits for ready, used, changed, disposed
DateTime _utcLastModified; // Time of last modified item
#if USE_MEMORY_CACHE
@@ -59,7 +55,7 @@ namespace System.Web.Caching {
#endif
static readonly string[] s_stringsEmpty;
- static readonly CacheEntry[] s_entriesEmpty;
+ static readonly DepCacheInfo[] s_entriesEmpty;
static readonly CacheDependency s_dependencyEmpty;
static readonly DepFileInfo[] s_depFileInfosEmpty;
@@ -78,9 +74,14 @@ namespace System.Web.Caching {
internal FileAttributesData _fad;
}
+ internal class DepCacheInfo {
+ internal CacheStoreProvider _cacheStore;
+ internal string _key;
+ }
+
static CacheDependency() {
s_stringsEmpty = new string[0];
- s_entriesEmpty = new CacheEntry[0];
+ s_entriesEmpty = new DepCacheInfo[0];
s_dependencyEmpty = new CacheDependency(0);
s_depFileInfosEmpty = new DepFileInfo[0];
}
@@ -205,7 +206,7 @@ namespace System.Web.Caching {
void InitForMemoryCache(bool isPublic, string[] filenamesArg, string[] cachekeysArg, CacheDependency dependency, DateTime utcStart) {
bool dispose = true;
try {
- MemCache memCache = HttpRuntime.CacheInternal as MemCache;
+ MemCache memCache = HttpRuntime.InternalCache as MemCache;
_bits = new SafeBitVector32(0);
_utcLastModified = DateTime.MinValue;
IList<String> files = filenamesArg;
@@ -308,9 +309,9 @@ namespace System.Web.Caching {
}
#endif
DepFileInfo[] depFileInfos = s_depFileInfosEmpty;
- CacheEntry[] depEntries = s_entriesEmpty;
+ DepCacheInfo[] depEntries = s_entriesEmpty;
string [] filenames, cachekeys;
- CacheInternal cacheInternal;
+ CacheStoreProvider cache;
_bits = new SafeBitVector32(0);
@@ -420,13 +421,13 @@ namespace System.Web.Caching {
// copy cache entries
if (d_entries != null) {
- if (d_entries is CacheEntry) {
- depEntries = new CacheEntry[1] {(CacheEntry) (d_entries)};
+ if (d_entries is DepCacheInfo) {
+ depEntries = new DepCacheInfo[1] { (DepCacheInfo)(d_entries) };
}
else {
- depEntries = (CacheEntry[]) (d_entries);
+ depEntries = (DepCacheInfo[])(d_entries);
// verify that the object was fully constructed
- foreach (CacheEntry entry in depEntries) {
+ foreach (DepCacheInfo entry in depEntries) {
if (entry == null) {
_bits[CHANGED] = true;
// There is nothing to dispose because we haven't started
@@ -501,41 +502,32 @@ namespace System.Web.Caching {
// Monitor other cache entries for changes
int lenMyEntries = depEntries.Length + cachekeys.Length;
+ DateTime lastUpdated;
if (lenMyEntries > 0 && !_bits[CHANGED]) {
- CacheEntry[] myEntries = new CacheEntry[lenMyEntries];
+ DepCacheInfo[] myEntries = new DepCacheInfo[lenMyEntries];
// Monitor entries from the existing cache dependency
int i = 0;
- foreach (CacheEntry entry in depEntries) {
- entry.AddCacheDependencyNotify(this);
+ foreach (DepCacheInfo entry in depEntries) {
+ entry._cacheStore.AddDependent(entry._key, this, out lastUpdated);
myEntries[i++] = entry;
}
// Monitor new entries specified for this depenedency
// Entries must be added to cache, and created before the startTime
- cacheInternal = HttpRuntime.CacheInternal;
+ cache = isPublic ? HttpRuntime.Cache.ObjectCache : HttpRuntime.Cache.InternalCache;
foreach (string k in cachekeys) {
- CacheEntry entry = (CacheEntry) cacheInternal.DoGet(isPublic, k, CacheGetOptions.ReturnCacheEntry);
- if (entry != null) {
- entry.AddCacheDependencyNotify(this);
- myEntries[i++] = entry;
+ if (cache.AddDependent(k, this, out lastUpdated)) {
+ myEntries[i++] = new DepCacheInfo() { _cacheStore = cache, _key = k };
- if (entry.UtcCreated > _utcLastModified) {
- _utcLastModified = entry.UtcCreated;
+ if (lastUpdated > _utcLastModified) {
+ _utcLastModified = lastUpdated;
}
- if ( entry.State != CacheEntry.EntryState.AddedToCache ||
- entry.UtcCreated > utcStart) {
-
+ if (lastUpdated > utcStart) { // Cache item has been updated since start, consider changed
#if DBG
- if (entry.State != CacheEntry.EntryState.AddedToCache) {
- Debug.Trace("CacheDependencyInit", "Entry is not in cache, considered changed:" + k);
- }
- else {
- Debug.Trace("CacheDependencyInit", "Changes occurred to entry since start time:" + k);
- }
+ Debug.Trace("CacheDependencyInit", "Changes occurred to entry since start time:" + k);
#endif
-
_bits[CHANGED] = true;
break;
}
@@ -583,7 +575,7 @@ namespace System.Web.Caching {
// Set this bit just in case our derived ctor forgot to call FinishInit()
_bits[DERIVED_INIT] = true;
- if (Use()) {
+ if (TakeOwnership()) {
// Do the dispose only if the cache has not already used us
DisposeInternal();
}
@@ -660,17 +652,17 @@ namespace System.Web.Caching {
// stop monitoring cache items
if (l_entries != null) {
- CacheEntry oneEntry = l_entries as CacheEntry;
+ DepCacheInfo oneEntry = l_entries as DepCacheInfo;
if (oneEntry != null) {
- oneEntry.RemoveCacheDependencyNotify(this);
+ oneEntry._cacheStore.RemoveDependent(oneEntry._key, this);
}
else {
- CacheEntry[] entries = (CacheEntry[]) l_entries;
- foreach (CacheEntry entry in entries) {
+ DepCacheInfo[] entries = (DepCacheInfo[])l_entries;
+ foreach (DepCacheInfo entry in entries) {
// ensure that we handle partially contructed
// objects by checking entry for null
if (entry != null) {
- entry.RemoveCacheDependencyNotify(this);
+ entry._cacheStore.RemoveDependent(entry._key, this);
}
}
}
@@ -686,8 +678,10 @@ namespace System.Web.Caching {
#endif
}
- // allow the first user to declare ownership
- internal bool Use() {
+ /// <devdoc>
+ /// <para>Allow the first user to declare exclusive ownership of this dependency.</para>
+ /// </devdoc>
+ public bool TakeOwnership() {
return _bits.ChangeValue(USED, true);
}
@@ -706,22 +700,38 @@ namespace System.Web.Caching {
}
}
-
protected void SetUtcLastModified(DateTime utcLastModified) {
_utcLastModified = utcLastModified;
}
- //
- // Add/remove an NotifyDependencyChanged notification.
- //
- internal void SetCacheDependencyChanged(ICacheDependencyChanged objNotify) {
+ public void KeepDependenciesAlive() {
+ if (_entries != null) {
+ // update the last access time of every cache item that depends on this dependency
+ DepCacheInfo oneEntry = _entries as DepCacheInfo;
+ if (oneEntry != null) {
+ oneEntry._cacheStore.Get(oneEntry._key);
+ return;
+ }
+
+ foreach (DepCacheInfo entry in (DepCacheInfo[])_entries) {
+ if (entry != null) {
+ object item = entry._cacheStore.Get(entry._key);
+ }
+ }
+ }
+ }
+
+ /// <devdoc>
+ /// <para>Add an Action to handle notifying interested party in changes to this dependency.</para>
+ /// </devdoc>
+ public void SetCacheDependencyChanged(Action<Object, EventArgs> dependencyChangedAction) {
Debug.Assert(_objNotify == null, "_objNotify == null");
// Set this bit just in case our derived ctor forgot to call FinishInit()
_bits[DERIVED_INIT] = true;
-
+
if (!_bits[BASE_DISPOSED]) {
- _objNotify = objNotify;
+ _objNotify = dependencyChangedAction;
}
}
@@ -768,23 +778,23 @@ namespace System.Web.Caching {
// get unique id from cache entries
l_entries = _entries;
if (l_entries != null) {
- CacheEntry oneEntry = l_entries as CacheEntry;
+ DepCacheInfo oneEntry = l_entries as DepCacheInfo;
if (oneEntry != null) {
if (sb == null)
sb = new StringBuilder();
- sb.Append(oneEntry.Key);
- sb.Append(oneEntry.UtcCreated.Ticks.ToString(CultureInfo.InvariantCulture));
+ sb.Append(oneEntry._key);
+ sb.Append(oneEntry.GetHashCode().ToString(CultureInfo.InvariantCulture));
}
else {
- CacheEntry[] entries = (CacheEntry[]) l_entries;
- foreach (CacheEntry entry in entries) {
+ DepCacheInfo[] entries = (DepCacheInfo[])l_entries;
+ foreach (DepCacheInfo entry in entries) {
// ensure that we handle partially contructed
// objects by checking entry for null
if (entry != null) {
if (sb == null)
sb = new StringBuilder();
- sb.Append(entry.Key);
- sb.Append(entry.UtcCreated.Ticks.ToString(CultureInfo.InvariantCulture));
+ sb.Append(entry._key);
+ sb.Append(entry.GetHashCode().ToString(CultureInfo.InvariantCulture));
}
}
}
@@ -806,24 +816,6 @@ namespace System.Web.Caching {
}
//
- // Return the cacheEntries monitored by this dependency
- //
- internal CacheEntry[] CacheEntries {
- get {
- if (_entries == null) {
- return null;
- }
-
- CacheEntry oneEntry = _entries as CacheEntry;
- if (oneEntry != null) {
- return new CacheEntry[1] {oneEntry};
- }
-
- return (CacheEntry[]) _entries;
- }
- }
-
- //
// This object has changed, so fire the NotifyDependencyChanged event.
// We only allow this event to be fired once.
//
@@ -832,20 +824,20 @@ namespace System.Web.Caching {
if (_bits.ChangeValue(CHANGED, true)) {
_utcLastModified = DateTime.UtcNow;
- ICacheDependencyChanged objNotify = _objNotify;
- if (objNotify != null && !_bits[BASE_DISPOSED]) {
+ Action<Object, EventArgs> action = _objNotify as Action<Object, EventArgs>;
+ if (action != null && !_bits[BASE_DISPOSED]) {
Debug.Trace("CacheDependencyNotifyDependencyChanged", "change occurred");
- objNotify.DependencyChanged(sender, e);
+ action(sender, e);
}
DisposeInternal();
}
}
- //
- // ItemRemoved is called when a cache entry we are monitoring has been removed.
- //
- internal void ItemRemoved() {
+ /// <devdoc>
+ /// <para>ItemRemoved should be called when an ICacheEntry we are monitoring has been removed.</para>
+ /// </devdoc>
+ public void ItemRemoved() {
NotifyDependencyChanged(this, EventArgs.Empty);
}
@@ -880,12 +872,12 @@ namespace System.Web.Caching {
// Check and see if we are dependent on any cache entries
l_entries = _entries;
if (l_entries != null) {
- CacheEntry oneEntry = l_entries as CacheEntry;
+ DepCacheInfo oneEntry = l_entries as DepCacheInfo;
if (oneEntry != null) {
return false;
}
else {
- CacheEntry[] entries = (CacheEntry[]) l_entries;
+ DepCacheInfo[] entries = (DepCacheInfo[]) l_entries;
if (entries != null && entries.Length > 0) {
return false;
}
@@ -952,7 +944,7 @@ namespace System.Web.Caching {
}
}
- public sealed class AggregateCacheDependency : CacheDependency, ICacheDependencyChanged {
+ public sealed class AggregateCacheDependency : CacheDependency {
ArrayList _dependencies;
bool _disposed;
@@ -979,10 +971,9 @@ namespace System.Web.Caching {
throw new ArgumentNullException("dependencies");
}
- if (!d.Use()) {
+ if (!d.TakeOwnership()) {
throw new InvalidOperationException(SR.GetString(SR.Cache_dependency_used_more_that_once));
- }
- }
+ } }
// add dependencies, and check if any have changed
bool hasChanged = false;
@@ -995,7 +986,9 @@ namespace System.Web.Caching {
_dependencies.AddRange(dependencies);
foreach (CacheDependency d in dependencies) {
- d.SetCacheDependencyChanged(this);
+ d.SetCacheDependencyChanged((Object sender, EventArgs args) => {
+ DependencyChanged(sender, args);
+ });
if (d.UtcLastModified > utcLastModified) {
utcLastModified = d.UtcLastModified;
@@ -1041,7 +1034,7 @@ namespace System.Web.Caching {
// Forward call from the aggregate to the CacheEntry
/// <internalonly/>
- void ICacheDependencyChanged.DependencyChanged(Object sender, EventArgs e) {
+ void DependencyChanged(Object sender, EventArgs e) {
NotifyDependencyChanged(sender, e);
}
@@ -1122,7 +1115,7 @@ namespace System.Web.Caching {
return true;
}
-
+
/// <summary>
/// This method will return only the file dependencies from this dependency
/// </summary>
diff --git a/mcs/class/referencesource/System.Web/Cache/CacheEntry.cs b/mcs/class/referencesource/System.Web/Cache/CacheEntry.cs
index ff86e2dec84..e7c2c42c434 100644
--- a/mcs/class/referencesource/System.Web/Cache/CacheEntry.cs
+++ b/mcs/class/referencesource/System.Web/Cache/CacheEntry.cs
@@ -50,8 +50,8 @@ namespace System.Web.Caching {
#endif
}
- internal String Key {
- get {return _key;}
+ internal String Key {
+ get { return _key; }
}
internal bool IsOutputCache {
@@ -81,9 +81,7 @@ namespace System.Web.Caching {
* An entry in the cache.
* Overhead is 68 bytes + object header.
*/
- internal sealed class CacheEntry : CacheKey, ICacheDependencyChanged {
- static readonly DateTime NoAbsoluteExpiration = DateTime.MaxValue;
- static readonly TimeSpan NoSlidingExpiration = TimeSpan.Zero;
+ internal sealed class CacheEntry : CacheKey {
const CacheItemPriority CacheItemPriorityMin = CacheItemPriority.Low;
const CacheItemPriority CacheItemPriorityMax = CacheItemPriority.NotRemovable;
static readonly TimeSpan OneYear = new TimeSpan(365, 0, 0, 0);
@@ -116,12 +114,13 @@ namespace System.Web.Caching {
byte _usageBucket; /* index of the usage list (== priority-1) */
UsageEntryRef _usageEntryRef; /* ref into the usage list */
DateTime _utcLastUpdate; /* time we last updated usage */
+ CacheInternal _cache;
// dependencies
CacheDependency _dependency; /* dependencies this item has */
object _onRemovedTargets; /* targets of OnRemove notification */
- /*
+ /*
* ctor.
*/
@@ -130,10 +129,11 @@ namespace System.Web.Caching {
Object value,
CacheDependency dependency,
CacheItemRemovedCallback onRemovedHandler,
- DateTime utcAbsoluteExpiration,
+ DateTime utcAbsoluteExpiration,
TimeSpan slidingExpiration,
CacheItemPriority priority,
- bool isPublic) :
+ bool isPublic,
+ CacheInternal cache) :
base(key, isPublic) {
@@ -176,6 +176,8 @@ namespace System.Web.Caching {
else {
_usageBucket = (byte) (priority - 1);
}
+
+ _cache = cache;
}
internal Object Value {
@@ -248,21 +250,23 @@ namespace System.Web.Caching {
// need to protect against the item being closed
CacheDependency dependency = _dependency;
if (dependency != null && State == EntryState.AddedToCache) {
- if (!dependency.Use()) {
+ if (!dependency.TakeOwnership()) {
throw new InvalidOperationException(
SR.GetString(SR.Cache_dependency_used_more_that_once));
}
- dependency.SetCacheDependencyChanged(this);
+ dependency.SetCacheDependencyChanged((Object sender, EventArgs args) => {
+ DependencyChanged(sender, args);
+ });
}
}
/*
* The entry has changed, so remove ourselves from the cache.
*/
- void ICacheDependencyChanged.DependencyChanged(Object sender, EventArgs e) {
+ void DependencyChanged(Object sender, EventArgs e) {
if (State == EntryState.AddedToCache) {
- HttpRuntime.CacheInternal.Remove(this, CacheItemRemovedReason.DependencyChanged);
+ _cache.Remove(this, CacheItemRemovedReason.DependencyChanged);
}
}
@@ -369,7 +373,7 @@ namespace System.Web.Caching {
}
#endif
- internal void AddCacheDependencyNotify(CacheDependency dependency) {
+ internal void AddDependent(CacheDependency dependency) {
lock (this) {
if (_onRemovedTargets == null) {
_onRemovedTargets = dependency;
@@ -387,16 +391,14 @@ namespace System.Web.Caching {
}
}
- internal void RemoveCacheDependencyNotify(CacheDependency dependency) {
+ internal void RemoveDependent(CacheDependency dependency) {
lock (this) {
if (_onRemovedTargets != null) {
if (_onRemovedTargets == dependency) {
_onRemovedTargets = null;
}
- else {
- // We assume the dependency must exist, so we don't need
- // to test for a cast.
- Hashtable h = (Hashtable) _onRemovedTargets;
+ else if (_onRemovedTargets is Hashtable) {
+ Hashtable h = (Hashtable)_onRemovedTargets;
h.Remove(dependency);
if (h.Count == 0) {
_onRemovedTargets = null;
diff --git a/mcs/class/referencesource/System.Web/Cache/OutputCache.cs b/mcs/class/referencesource/System.Web/Cache/OutputCache.cs
index f09d460dfb7..726f9801ac0 100644
--- a/mcs/class/referencesource/System.Web/Cache/OutputCache.cs
+++ b/mcs/class/referencesource/System.Web/Cache/OutputCache.cs
@@ -282,29 +282,17 @@ namespace System.Web.Caching {
//
- // helpers for accessing CacheInternal
+ // helpers for accessing InternalCache
//
// add CachedVary
private static CachedVary UtcAdd(String key, CachedVary cachedVary) {
- return (CachedVary) HttpRuntime.CacheInternal.UtcAdd(key,
- cachedVary,
- null /*dependencies*/,
- Cache.NoAbsoluteExpiration,
- Cache.NoSlidingExpiration,
- CacheItemPriority.Normal,
- null /*callback*/);
+ return (CachedVary) HttpRuntime.Cache.InternalCache.Add(key, cachedVary, null);
}
// add ControlCachedVary
private static ControlCachedVary UtcAdd(String key, ControlCachedVary cachedVary) {
- return (ControlCachedVary) HttpRuntime.CacheInternal.UtcAdd(key,
- cachedVary,
- null /*dependencies*/,
- Cache.NoAbsoluteExpiration,
- Cache.NoSlidingExpiration,
- CacheItemPriority.Normal,
- null /*callback*/);
+ return (ControlCachedVary) HttpRuntime.Cache.InternalCache.Add(key, cachedVary, null);
}
private static bool IsSubstBlockSerializable(HttpRawResponse rawResponse) {
@@ -391,7 +379,7 @@ namespace System.Web.Caching {
String kernelCacheUrl = cachedRawResponse._kernelCacheUrl;
// if it is kernel cached, the url will be non-null.
// if the entry was re-inserted, don't remove kernel entry since it will be updated
- if (kernelCacheUrl != null && HttpRuntime.CacheInternal.Get(key) == null) {
+ if (kernelCacheUrl != null && HttpRuntime.Cache.InternalCache.Get(key) == null) {
// invalidate kernel cache entry
if (HttpRuntime.UseIntegratedPipeline) {
UnsafeIISMethods.MgdFlushKernelCache(kernelCacheUrl);
@@ -462,7 +450,7 @@ namespace System.Web.Caching {
}
// is the file dependency already in the in-memory cache?
- if (HttpRuntime.CacheInternal.Get(depKey) != null) {
+ if (HttpRuntime.Cache.InternalCache.Get(depKey) != null) {
#if DBG
Debug.Trace("OutputCache", "HasDependencyChanged(" + depKey + ", ..., " + oceKey + ", ...) --> false");
#endif
@@ -480,9 +468,10 @@ namespace System.Web.Caching {
// have the file dependencies changed?
if (String.Compare(dep.GetUniqueID(), 0, depKey, idStartIndex, idLength, StringComparison.Ordinal) == 0) {
// file dependencies have not changed--cache them with callback to remove OutputCacheEntry if they change
- HttpRuntime.CacheInternal.UtcInsert(depKey, new DependencyCacheEntry(oceKey, kernelKey, providerName), dep,
- Cache.NoAbsoluteExpiration, Cache.NoSlidingExpiration,
- CacheItemPriority.Normal, callback);
+ HttpRuntime.Cache.InternalCache.Insert(depKey, new DependencyCacheEntry(oceKey, kernelKey, providerName), new CacheInsertOptions() {
+ Dependencies = dep,
+ OnRemovedCallback = callback
+ });
#if DBG
Debug.Trace("OutputCache", "HasDependencyChanged(" + depKey + ", ..., " + oceKey + ", ...) --> false, DEPENDENCY RE-INSERTED");
#endif
@@ -545,7 +534,7 @@ namespace System.Web.Caching {
}
}
if (result == null) {
- result = HttpRuntime.CacheInternal.Get(key);
+ result = HttpRuntime.Cache.InternalCache.Get(key);
#if DBG
string typeName = (result != null) ? result.GetType().Name : "null";
Debug.Trace("OutputCache", "Get(" + key + ") --> " + typeName + ", CacheInternal");
@@ -580,7 +569,7 @@ namespace System.Web.Caching {
}
if (result == null) {
- result = HttpRuntime.CacheInternal.Get(key);
+ result = HttpRuntime.Cache.InternalCache.Get(key);
#if DBG
string typeName = (result != null) ? result.GetType().Name : "null";
Debug.Trace("OutputCache", "GetFragment(" + key + "," + providerName + ") --> " + typeName + ", CacheInternal");
@@ -601,7 +590,7 @@ namespace System.Web.Caching {
// If the context is null, then we don't know which
// provider and we have to check all.
- HttpRuntime.CacheInternal.Remove(key);
+ HttpRuntime.Cache.InternalCache.Remove(key);
if (context == null) {
// remove from all providers since we don't know which one it's in.
@@ -654,7 +643,7 @@ namespace System.Web.Caching {
if (provider != null) {
provider.Remove(key);
}
- HttpRuntime.CacheInternal.Remove(key);
+ HttpRuntime.Cache.InternalCache.Remove(key);
#if DBG
Debug.Trace("OutputCache", "RemoveFragment(" + key + "," + providerName + ")");
#endif
@@ -708,7 +697,7 @@ namespace System.Web.Caching {
if (!cachedVary.Equals(cachedVaryInCache)) {
// overwrite existing cached vary
if (!useProvider) {
- HttpRuntime.CacheInternal.UtcInsert(cachedVaryKey, cachedVary);
+ HttpRuntime.Cache.InternalCache.Insert(cachedVaryKey, cachedVary, null);
}
else {
provider.Set(cachedVaryKey, cachedVary, Cache.NoAbsoluteExpiration);
@@ -733,11 +722,11 @@ namespace System.Web.Caching {
// Now insert into the cache (use cache provider if possible, otherwise use internal cache)
if (!useProvider) {
- HttpRuntime.CacheInternal.UtcInsert(fragmentKey, fragment,
- dependencies,
- absExp, slidingExp,
- CacheItemPriority.Normal,
- null);
+ HttpRuntime.Cache.InternalCache.Insert(fragmentKey, fragment, new CacheInsertOptions() {
+ Dependencies = dependencies,
+ AbsoluteExpiration = absExp,
+ SlidingExpiration = slidingExp
+ });
}
else {
string depKey = null;
@@ -749,10 +738,12 @@ namespace System.Web.Caching {
provider.Set(fragmentKey, fragment, absExp);
if (dependencies != null) {
// use Add and dispose dependencies if there's already one in the cache
- Object d = HttpRuntime.CacheInternal.UtcAdd(depKey, new DependencyCacheEntry(fragmentKey, null, provider.Name),
- dependencies,
- absExp, Cache.NoSlidingExpiration,
- CacheItemPriority.Normal, s_dependencyRemovedCallbackForFragment);
+ Object d = HttpRuntime.Cache.InternalCache.Add(depKey, new DependencyCacheEntry(fragmentKey, null, provider.Name),
+ new CacheInsertOptions() {
+ Dependencies = dependencies,
+ AbsoluteExpiration = absExp,
+ OnRemovedCallback = s_dependencyRemovedCallbackForFragment
+ });
if (d != null) {
dependencies.Dispose();
}
@@ -768,7 +759,7 @@ namespace System.Web.Caching {
+ fragmentKey + ", PartialCachingCacheEntry, ...) -->"
+ providerUsed);
#endif
- }
+ }
// insert cached vary or output cache entry
internal static void InsertResponse(String cachedVaryKey, CachedVary cachedVary,
@@ -820,7 +811,7 @@ namespace System.Web.Caching {
if (cachedVaryInCache != null) {
if (!cachedVary.Equals(cachedVaryInCache)) {
if (!useProvider) {
- HttpRuntime.CacheInternal.UtcInsert(cachedVaryKey, cachedVary);
+ HttpRuntime.Cache.InternalCache.Insert(cachedVaryKey, cachedVary, null);
}
else {
provider.Set(cachedVaryKey, cachedVary, Cache.NoAbsoluteExpiration);
@@ -845,11 +836,12 @@ namespace System.Web.Caching {
// Now insert into the cache (use cache provider if possible, otherwise use internal cache)
if (!useProvider) {
- HttpRuntime.CacheInternal.UtcInsert(rawResponseKey, rawResponse,
- dependencies,
- absExp, slidingExp,
- CacheItemPriority.Normal,
- s_entryRemovedCallback);
+ HttpRuntime.Cache.InternalCache.Insert(rawResponseKey, rawResponse, new CacheInsertOptions() {
+ Dependencies = dependencies,
+ AbsoluteExpiration = absExp,
+ SlidingExpiration = slidingExp,
+ OnRemovedCallback = s_entryRemovedCallback
+ });
IncrementCount();
@@ -867,10 +859,12 @@ namespace System.Web.Caching {
provider.Set(rawResponseKey, oce, absExp);
if (dependencies != null) {
// use Add and dispose dependencies if there's already one in the cache
- Object d = HttpRuntime.CacheInternal.UtcAdd(depKey, new DependencyCacheEntry(rawResponseKey, oce.KernelCacheUrl, provider.Name),
- dependencies,
- absExp, Cache.NoSlidingExpiration,
- CacheItemPriority.Normal, s_dependencyRemovedCallback);
+ Object d = HttpRuntime.Cache.InternalCache.Add(depKey, new DependencyCacheEntry(rawResponseKey, oce.KernelCacheUrl, provider.Name),
+ new CacheInsertOptions() {
+ Dependencies = dependencies,
+ AbsoluteExpiration = absExp,
+ OnRemovedCallback = s_dependencyRemovedCallbackForFragment
+ });
if (d != null) {
dependencies.Dispose();
}
diff --git a/mcs/class/referencesource/System.Web/Cache/SqlCacheDependency.cs b/mcs/class/referencesource/System.Web/Cache/SqlCacheDependency.cs
index 32b120a22eb..a80aba01a0f 100644
--- a/mcs/class/referencesource/System.Web/Cache/SqlCacheDependency.cs
+++ b/mcs/class/referencesource/System.Web/Cache/SqlCacheDependency.cs
@@ -69,7 +69,7 @@ namespace System.Web.Caching {
{
Debug.Trace("SqlCacheDependency",
"Depend on key=" + GetDependKey(databaseEntryName, tableName) + "; value=" +
- HttpRuntime.CacheInternal[GetDependKey(databaseEntryName, tableName)]);
+ HttpRuntime.Cache.InternalCache.Get(GetDependKey(databaseEntryName, tableName)));
// Permission checking is done in GetDependKey()
@@ -77,7 +77,7 @@ namespace System.Web.Caching {
_sql7DepInfo._database = databaseEntryName;
_sql7DepInfo._table = tableName;
- object o = HttpRuntime.CacheInternal[GetDependKey(databaseEntryName, tableName)];
+ object o = HttpRuntime.Cache.InternalCache.Get(GetDependKey(databaseEntryName, tableName));
if (o == null) {
// If the cache entry can't be found, this cache dependency will be set to CHANGED already.
_sql7ChangeId = -1;
@@ -756,7 +756,7 @@ namespace System.Web.Caching {
SqlCommand sqlCmd = null;
int changeId;
string tableName;
- CacheInternal cacheInternal = HttpRuntime.CacheInternal;
+ CacheStoreProvider cacheInternal = HttpRuntime.Cache.InternalCache;
string monitorKey;
object obj;
bool notifEnabled = false;
@@ -864,33 +864,28 @@ namespace System.Web.Caching {
"Database=" + dbState._database+ "; tableName=" + tableName + "; changeId=" + changeId);
monitorKey = GetMoniterKey(dbState._database, tableName);
- obj = cacheInternal[monitorKey];
+ obj = cacheInternal.Get(monitorKey);
if (obj == null) {
Debug.Assert(!dbState._tables.ContainsKey(tableName),
- "DatabaseNotifStae._tables and internal cache keys should be in-[....]");
+ "DatabaseNotifStae._tables and internal cache keys should be in-sync");
Debug.Trace("SqlCacheDependencyManagerPolling",
"Add Database=" + dbState._database+ "; tableName=" + tableName + "; changeId=" + changeId);
- cacheInternal.UtcAdd(monitorKey, changeId, null,
- Cache.NoAbsoluteExpiration, Cache.NoSlidingExpiration,
- CacheItemPriority.NotRemovable, null);
-
+ cacheInternal.Add(monitorKey, changeId, new CacheInsertOptions() { Priority = CacheItemPriority.NotRemovable });
dbState._tables.Add(tableName, null);
}
else if (changeId != (int)obj) {
Debug.Assert(dbState._tables.ContainsKey(tableName),
- "DatabaseNotifStae._tables and internal cache keys should be in-[....]");
+ "DatabaseNotifStae._tables and internal cache keys should be in-sync");
Debug.Trace("SqlCacheDependencyManagerPolling",
"Change Database=" + dbState._database+ "; tableName=" + tableName + "; old=" + (int)obj + "; new=" + changeId);
// ChangeId is different. It means some table changes have happened.
// Update local cache value
- cacheInternal.UtcInsert(monitorKey, changeId, null,
- Cache.NoAbsoluteExpiration, Cache.NoSlidingExpiration,
- CacheItemPriority.NotRemovable, null);
+ cacheInternal.Insert(monitorKey, changeId, new CacheInsertOptions() { Priority = CacheItemPriority.NotRemovable });
}
originalTables.Remove(tableName);
@@ -1001,8 +996,8 @@ namespace System.Web.Caching {
// for this table has successfully completed
Debug.Trace("SqlCacheDependencyManagerCheck",
"Check is called. Database=" + database+ "; table=" + table);
-
- if (HttpRuntime.CacheInternal[GetMoniterKey(database, table)] != null) {
+
+ if (HttpRuntime.Cache.InternalCache.Get(GetMoniterKey(database, table)) != null) {
return;
}
diff --git a/mcs/class/referencesource/System.Web/Cache/cache.cs b/mcs/class/referencesource/System.Web/Cache/cache.cs
index 0dd2f027e68..a597396f644 100644
--- a/mcs/class/referencesource/System.Web/Cache/cache.cs
+++ b/mcs/class/referencesource/System.Web/Cache/cache.cs
@@ -14,8 +14,10 @@ namespace System.Web.Caching {
using System.Collections;
using System.Collections.Specialized;
using System.Configuration;
+ using System.Configuration.Provider;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
+ using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
using System.Web.Util;
@@ -150,12 +152,6 @@ namespace System.Web.Caching {
DependencyChanged
}
- enum CacheGetOptions {
- None = 0,
- ReturnCacheEntry = 0x1,
- }
-
-
/// <devdoc>
/// <para>Implements the cache for a Web application. There is only one instance of
/// this class per application domain, and it remains valid only as long as the
@@ -165,9 +161,7 @@ namespace System.Web.Caching {
//
// Extra notes:
- // - The Cache object contains a CacheInternal object.
- // - The CacheInternal object is either a CacheSingle, or a CacheMultiple which contains mulitple
- // CacheSingle objects.
+ // - The Cache object contains a ICacheStore object and wraps it for public consumption.
//
public sealed class Cache : IEnumerable {
@@ -187,7 +181,8 @@ namespace System.Web.Caching {
/// </devdoc>
public static readonly TimeSpan NoSlidingExpiration = TimeSpan.Zero;
- CacheInternal _cacheInternal;
+ static CacheStoreProvider _objectCache = null;
+ static CacheStoreProvider _internalCache = null;
static CacheItemRemovedCallback s_sentinelRemovedCallback = new CacheItemRemovedCallback(SentinelEntry.OnCacheItemRemovedCallback);
/// <internalonly/>
@@ -204,10 +199,6 @@ namespace System.Web.Caching {
internal Cache(int dummy) {
}
- internal void SetCacheInternal(CacheInternal cacheInternal) {
- _cacheInternal = cacheInternal;
- }
-
/// <devdoc>
/// <para>Gets the number of items stored in the cache. This value can be useful when
@@ -216,14 +207,86 @@ namespace System.Web.Caching {
/// </devdoc>
public int Count {
get {
- return _cacheInternal.PublicCount;
+ return Convert.ToInt32(ObjectCache.ItemCount);
+ }
+ }
+
+
+ internal CacheStoreProvider GetInternalCache(bool createIfDoesNotExist) {
+ if (_internalCache == null && createIfDoesNotExist) {
+ lock (this) {
+ if (_internalCache == null) {
+ NameValueCollection cacheProviderSettings = HostingEnvironment.CacheStoreProviderSettings;
+
+ if (cacheProviderSettings != null) {
+ string providerName = (string)cacheProviderSettings["name"]; // Grab this now, as InstantiateProvider will remove it from settings
+ cacheProviderSettings["isPublic"] = "false";
+ _internalCache = (CacheStoreProvider)ProvidersHelper.InstantiateProvider(cacheProviderSettings, typeof(CacheStoreProvider));
+ _internalCache.Initialize(providerName, cacheProviderSettings);
+ }
+ else {
+ if (_objectCache is AspNetCache) {
+ _internalCache = new AspNetCache((AspNetCache)_objectCache, isPublic: false);
+ }
+ else {
+ _internalCache = new AspNetCache(isPublic: false);
+ }
+ _internalCache.Initialize(null, new NameValueCollection());
+ }
+ }
+ }
+ }
+
+ return _internalCache;
+ }
+
+ [PermissionSet(SecurityAction.Assert, Unrestricted = true)]
+ [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "We carefully control this method's callers.")]
+ internal CacheStoreProvider GetObjectCache(bool createIfDoesNotExist) {
+ if (_objectCache == null && createIfDoesNotExist) {
+ lock (this) {
+ if (_objectCache == null) {
+ NameValueCollection cacheProviderSettings = HostingEnvironment.CacheStoreProviderSettings;
+
+ if (cacheProviderSettings != null) {
+ string providerName = (string)cacheProviderSettings["name"]; // Grab this now, as InstantiateProvider will remove it from settings
+ cacheProviderSettings["isPublic"] = "true";
+ _objectCache = (CacheStoreProvider)ProvidersHelper.InstantiateProvider(cacheProviderSettings, typeof(CacheStoreProvider));
+ _objectCache.Initialize(providerName, cacheProviderSettings);
+ }
+ else {
+ if (_internalCache is AspNetCache) {
+ _objectCache = new AspNetCache((AspNetCache)_internalCache, isPublic: true);
+ }
+ else {
+ _objectCache = new AspNetCache(isPublic: true);
+ }
+ _objectCache.Initialize(null, new NameValueCollection());
+ }
+ }
+ }
}
+
+ return _objectCache;
+ }
+
+ /// <devdoc>
+ /// <para>Provides access to the cache store used by ASP.Net internals.</para>
+ /// </devdoc>
+ internal CacheStoreProvider InternalCache {
+ get { return GetInternalCache(createIfDoesNotExist: true); }
}
+ /// <devdoc>
+ /// <para>Provides access to the cache store that backs HttpRuntime.Cache.</para>
+ /// </devdoc>
+ internal CacheStoreProvider ObjectCache {
+ get { return GetObjectCache(createIfDoesNotExist: true); }
+ }
/// <internalonly/>
IEnumerator IEnumerable.GetEnumerator() {
- return ((IEnumerable)_cacheInternal).GetEnumerator();
+ return ObjectCache.GetEnumerator();
}
@@ -233,7 +296,7 @@ namespace System.Web.Caching {
/// while this method is enumerating through the cache items.</para>
/// </devdoc>
public IDictionaryEnumerator GetEnumerator() {
- return _cacheInternal.GetEnumerator();
+ return ObjectCache.GetEnumerator();
}
@@ -330,11 +393,7 @@ namespace System.Web.Caching {
/// <para>Retrieves an item from the cache.</para>
/// </devdoc>
public object Get(string key) {
- return _cacheInternal.DoGet(true, key, CacheGetOptions.None);
- }
-
- internal object Get(string key, CacheGetOptions getOptions) {
- return _cacheInternal.DoGet(true, key, getOptions);
+ return ObjectCache.Get(key);
}
@@ -342,16 +401,7 @@ namespace System.Web.Caching {
/// <para>Inserts an item into the Cache with default values.</para>
/// </devdoc>
public void Insert(string key, object value) {
- _cacheInternal.DoInsert(
- true,
- key,
- value,
- null,
- NoAbsoluteExpiration,
- NoSlidingExpiration,
- CacheItemPriority.Default,
- null,
- true);
+ ObjectCache.Insert(key, value, options: null);
}
@@ -360,16 +410,7 @@ namespace System.Web.Caching {
/// dependencies.</para>
/// </devdoc>
public void Insert(string key, object value, CacheDependency dependencies) {
- _cacheInternal.DoInsert(
- true,
- key,
- value,
- dependencies,
- NoAbsoluteExpiration,
- NoSlidingExpiration,
- CacheItemPriority.Default,
- null,
- true);
+ ObjectCache.Insert(key, value, new CacheInsertOptions() { Dependencies = dependencies });
}
@@ -379,16 +420,11 @@ namespace System.Web.Caching {
/// </devdoc>
public void Insert(string key, object value, CacheDependency dependencies, DateTime absoluteExpiration, TimeSpan slidingExpiration) {
DateTime utcAbsoluteExpiration = DateTimeUtil.ConvertToUniversalTime(absoluteExpiration);
- _cacheInternal.DoInsert(
- true,
- key,
- value,
- dependencies,
- utcAbsoluteExpiration,
- slidingExpiration,
- CacheItemPriority.Default,
- null,
- true);
+ ObjectCache.Insert(key, value, new CacheInsertOptions() {
+ Dependencies = dependencies,
+ AbsoluteExpiration = absoluteExpiration,
+ SlidingExpiration = slidingExpiration
+ });
}
@@ -402,16 +438,13 @@ namespace System.Web.Caching {
CacheItemRemovedCallback onRemoveCallback) {
DateTime utcAbsoluteExpiration = DateTimeUtil.ConvertToUniversalTime(absoluteExpiration);
- _cacheInternal.DoInsert(
- true,
- key,
- value,
- dependencies,
- utcAbsoluteExpiration,
- slidingExpiration,
- priority,
- onRemoveCallback,
- true);
+ ObjectCache.Insert(key, value, new CacheInsertOptions() {
+ Dependencies = dependencies,
+ AbsoluteExpiration = utcAbsoluteExpiration,
+ SlidingExpiration = slidingExpiration,
+ Priority = priority,
+ OnRemovedCallback = onRemoveCallback
+ });
}
// DevDiv Bugs 162763:
@@ -432,16 +465,8 @@ namespace System.Web.Caching {
}
DateTime utcAbsoluteExpiration = DateTimeUtil.ConvertToUniversalTime(absoluteExpiration);
// Insert updatable cache entry
- _cacheInternal.DoInsert (
- true,
- key,
- value,
- null,
- Cache.NoAbsoluteExpiration,
- Cache.NoSlidingExpiration,
- CacheItemPriority.NotRemovable,
- null,
- true);
+ ObjectCache.Insert(key, value, new CacheInsertOptions() { Priority = CacheItemPriority.NotRemovable });
+
// Ensure the sentinel depends on its updatable entry
string[] cacheKeys = { key };
CacheDependency expensiveObjectDep = new CacheDependency(null, cacheKeys);
@@ -453,17 +478,17 @@ namespace System.Web.Caching {
deps.Add(dependencies, expensiveObjectDep);
dependencies = deps;
}
- // Insert sentinel entry for the updatable cache entry
- _cacheInternal.DoInsert(
- false,
+ // Insert sentinel entry for the updatable cache entry
+ HttpRuntime.Cache.InternalCache.Insert(
CacheInternal.PrefixValidationSentinel + key,
new SentinelEntry(key, expensiveObjectDep, onUpdateCallback),
- dependencies,
- utcAbsoluteExpiration,
- slidingExpiration,
- CacheItemPriority.NotRemovable,
- Cache.s_sentinelRemovedCallback,
- true);
+ new CacheInsertOptions() {
+ Dependencies = dependencies,
+ AbsoluteExpiration = utcAbsoluteExpiration,
+ SlidingExpiration = slidingExpiration,
+ Priority = CacheItemPriority.NotRemovable,
+ OnRemovedCallback = Cache.s_sentinelRemovedCallback
+ });
}
@@ -477,16 +502,13 @@ namespace System.Web.Caching {
CacheItemRemovedCallback onRemoveCallback) {
DateTime utcAbsoluteExpiration = DateTimeUtil.ConvertToUniversalTime(absoluteExpiration);
- return _cacheInternal.DoInsert(
- true,
- key,
- value,
- dependencies,
- utcAbsoluteExpiration,
- slidingExpiration,
- priority,
- onRemoveCallback,
- false);
+ return ObjectCache.Add(key, value, new CacheInsertOptions() {
+ Dependencies = dependencies,
+ AbsoluteExpiration = utcAbsoluteExpiration,
+ SlidingExpiration = slidingExpiration,
+ Priority = priority,
+ OnRemovedCallback = onRemoveCallback
+ });
}
@@ -494,1555 +516,21 @@ namespace System.Web.Caching {
/// <para>Removes the specified item from the cache. </para>
/// </devdoc>
public object Remove(string key) {
- CacheKey cacheKey = new CacheKey(key, true);
- return _cacheInternal.DoRemove(cacheKey, CacheItemRemovedReason.Removed);
+ return ObjectCache.Remove(key, CacheItemRemovedReason.Removed);
}
public long EffectivePrivateBytesLimit {
get {
- return _cacheInternal.EffectivePrivateBytesLimit;
+ return AspNetMemoryMonitor.ProcessPrivateBytesLimit;
}
}
public long EffectivePercentagePhysicalMemoryLimit {
get {
- return _cacheInternal.EffectivePercentagePhysicalMemoryLimit;
- }
- }
- }
-
- class CacheCommon {
- const int MEMORYSTATUS_INTERVAL_5_SECONDS = 5 * Msec.ONE_SECOND;
- const int MEMORYSTATUS_INTERVAL_30_SECONDS = 30 * Msec.ONE_SECOND;
-
- internal CacheInternal _cacheInternal;
- internal Cache _cachePublic;
- internal protected CacheMemoryStats _cacheMemoryStats;
- private object _timerLock = new object();
- private DisposableGCHandleRef<Timer> _timerHandleRef;
- private int _currentPollInterval = MEMORYSTATUS_INTERVAL_30_SECONDS;
- internal int _inCacheManagerThread;
- internal bool _enableMemoryCollection;
- internal bool _enableExpiration;
- internal bool _internalConfigRead;
- internal SRefMultiple _srefMultiple;
- private int _disposed = 0;
-
- internal CacheCommon() {
- _cachePublic = new Cache(0);
- _srefMultiple = new SRefMultiple();
- _cacheMemoryStats = new CacheMemoryStats(_srefMultiple);
- _enableMemoryCollection = true;
- _enableExpiration = true;
- }
-
- internal void Dispose(bool disposing) {
- if (disposing) {
- // This method must be tolerant to multiple calls to Dispose on the same instance
- if (Interlocked.Exchange(ref _disposed, 1) == 0) {
- EnableCacheMemoryTimer(false);
- _cacheMemoryStats.Dispose();
- }
- }
- }
-
- internal void AddSRefTarget(object o) {
- _srefMultiple.AddSRefTarget(o);
- }
-
- internal void SetCacheInternal(CacheInternal cacheInternal) {
- _cacheInternal = cacheInternal;
- _cachePublic.SetCacheInternal(cacheInternal);
- }
-
- internal void ReadCacheInternalConfig(CacheSection cacheSection) {
- if (_internalConfigRead) {
- return;
- }
-
- lock (this) {
- if (_internalConfigRead) {
- return;
- }
-
- // Set it to true here so that even if we have to call ReadCacheInternalConfig
- // from the code below, we won't get into an infinite loop.
- _internalConfigRead = true;
-
- if (cacheSection != null) {
- _enableMemoryCollection = (!cacheSection.DisableMemoryCollection);
- _enableExpiration = (!cacheSection.DisableExpiration);
- _cacheMemoryStats.ReadConfig(cacheSection);
- _currentPollInterval = CacheMemorySizePressure.PollInterval;
- ResetFromConfigSettings();
- }
- }
- }
-
- internal void ResetFromConfigSettings() {
- EnableCacheMemoryTimer(_enableMemoryCollection);
- _cacheInternal.EnableExpirationTimer(_enableExpiration);
- }
-
- internal void EnableCacheMemoryTimer(bool enable) {
- lock (_timerLock) {
-#if DBG
- if (Debug.IsTagPresent("Timer") && !Debug.IsTagEnabled("Timer")) {
- enable = false;
- }
-
-#endif
-
- if (enable) {
-
- if (_timerHandleRef == null) {
- // <cache privateBytesPollTime> has not been read yet
- Timer timer = new Timer(new TimerCallback(this.CacheManagerTimerCallback), null, _currentPollInterval, _currentPollInterval);
- _timerHandleRef = new DisposableGCHandleRef<Timer>(timer);
- Debug.Trace("Cache", "Started CacheMemoryTimers");
- }
- else {
- _timerHandleRef.Target.Change(_currentPollInterval, _currentPollInterval);
- }
- }
- else {
- var timerHandleRef = _timerHandleRef;
- if (timerHandleRef != null && Interlocked.CompareExchange(ref _timerHandleRef, null, timerHandleRef) == timerHandleRef) {
- timerHandleRef.Dispose();
- Debug.Trace("Cache", "Stopped CacheMemoryTimers");
- }
- }
- }
-
- if (!enable) {
- // wait for CacheManagerTimerCallback to finish
- while(_inCacheManagerThread != 0) {
- Thread.Sleep(100);
- }
- }
- }
-
- void AdjustTimer() {
- lock (_timerLock) {
-
- if (_timerHandleRef == null)
- return;
-
- // the order of these if statements is important
-
- // When above the high pressure mark, interval should be 5 seconds or less
- if (_cacheMemoryStats.IsAboveHighPressure()) {
- if (_currentPollInterval > MEMORYSTATUS_INTERVAL_5_SECONDS) {
- _currentPollInterval = MEMORYSTATUS_INTERVAL_5_SECONDS;
- _timerHandleRef.Target.Change(_currentPollInterval, _currentPollInterval);
- }
- return;
- }
-
- // When above half the low pressure mark, interval should be 30 seconds or less
- if ((_cacheMemoryStats.CacheSizePressure.PressureLast > _cacheMemoryStats.CacheSizePressure.PressureLow/2)
- || (_cacheMemoryStats.TotalMemoryPressure.PressureLast > _cacheMemoryStats.TotalMemoryPressure.PressureLow/2)) {
- // DevDivBugs 104034: allow interval to fall back down when memory pressure goes away
- int newPollInterval = Math.Min(CacheMemorySizePressure.PollInterval, MEMORYSTATUS_INTERVAL_30_SECONDS);
- if (_currentPollInterval != newPollInterval) {
- _currentPollInterval = newPollInterval;
- _timerHandleRef.Target.Change(_currentPollInterval, _currentPollInterval);
- }
- return;
- }
-
- // there is no pressure, interval should be the value from config
- if (_currentPollInterval != CacheMemorySizePressure.PollInterval) {
- _currentPollInterval = CacheMemorySizePressure.PollInterval;
- _timerHandleRef.Target.Change(_currentPollInterval, _currentPollInterval);
- }
- }
- }
-
- void CacheManagerTimerCallback(object state) {
- CacheManagerThread(0);
- }
-
- internal long CacheManagerThread(int minPercent) {
- if (Interlocked.Exchange(ref _inCacheManagerThread, 1) != 0)
- return 0;
-#if DBG
- Debug.Trace("CacheMemory", "**BEG** CacheManagerThread " + HttpRuntime.AppDomainAppId + ", " + DateTime.Now.ToString("T", CultureInfo.InvariantCulture));
-#endif
- try {
- // Dev10 633335: if the timer has been disposed, return without doing anything
- if (_timerHandleRef == null)
- return 0;
-
- // The timer thread must always call Update so that the CacheManager
- // knows the size of the cache.
- _cacheMemoryStats.Update();
- AdjustTimer();
- int percent = Math.Max(minPercent, _cacheMemoryStats.GetPercentToTrim());
- long beginTotalCount = _cacheInternal.TotalCount;
- Stopwatch sw = Stopwatch.StartNew();
- long trimmedOrExpired = _cacheInternal.TrimIfNecessary(percent);
- sw.Stop();
- // 1) don't update stats if the trim happend because MAX_COUNT was exceeded
- // 2) don't update stats unless we removed at least one entry
- if (percent > 0 && trimmedOrExpired > 0) {
- _cacheMemoryStats.SetTrimStats(sw.Elapsed.Ticks, beginTotalCount, trimmedOrExpired);
- }
-
-#if DBG
- Debug.Trace("CacheMemory", "**END** CacheManagerThread: " + HttpRuntime.AppDomainAppId
- + ", percent=" + percent
- + ", beginTotalCount=" + beginTotalCount
- + ", trimmed=" + trimmedOrExpired
- + ", Milliseconds=" + sw.ElapsedMilliseconds);
-#endif
-
-#if PERF
- SafeNativeMethods.OutputDebugString("CacheCommon.CacheManagerThread:"
- + " minPercent= " + minPercent
- + ", percent= " + percent
- + ", beginTotalCount=" + beginTotalCount
- + ", trimmed=" + trimmedOrExpired
- + ", Milliseconds=" + sw.ElapsedMilliseconds + "\n");
-#endif
- return trimmedOrExpired;
- }
- finally {
- Interlocked.Exchange(ref _inCacheManagerThread, 0);
- }
- }
- }
-
- abstract class CacheInternal : IEnumerable, IDisposable {
- // cache key prefixes - they keep cache keys short and prevent conflicts
-
- // NOTE: Since we already used up all the lowercase letters from 'a' to 'z',
- // we are now using uppercase letters from 'A' to 'Z'
- internal const string PrefixFIRST = "A";
- internal const string PrefixResourceProvider = "A";
- internal const string PrefixMapPathVPPFile = "Bf";
- internal const string PrefixMapPathVPPDir = "Bd";
-
- // Next prefix goes here, until we get to 'Z'
-
- internal const string PrefixOutputCache = "a";
- internal const string PrefixSqlCacheDependency = "b";
- internal const string PrefixMemoryBuildResult = "c";
- internal const string PrefixPathData = "d";
- internal const string PrefixHttpCapabilities = "e";
- internal const string PrefixMapPath = "f";
- internal const string PrefixHttpSys = "g";
- internal const string PrefixFileSecurity = "h";
- internal const string PrefixInProcSessionState = "j";
- internal const string PrefixStateApplication = "k";
- internal const string PrefixPartialCachingControl = "l";
- internal const string UNUSED = "m";
- internal const string PrefixAdRotator = "n";
- internal const string PrefixWebServiceDataSource = "o";
- internal const string PrefixLoadXPath = "p";
- internal const string PrefixLoadXml = "q";
- internal const string PrefixLoadTransform = "r";
- internal const string PrefixAspCompatThreading = "s";
- internal const string PrefixDataSourceControl = "u";
- internal const string PrefixValidationSentinel = "w";
- internal const string PrefixWebEventResource = "x";
- internal const string PrefixAssemblyPath = "y";
- internal const string PrefixBrowserCapsHash = "z";
- internal const string PrefixLAST = "z";
-
- protected CacheCommon _cacheCommon;
- private int _disposed;
-
- // virtual methods requiring implementation
- internal abstract int PublicCount {get;}
-
- internal abstract long TotalCount {get;}
-
- internal abstract IDictionaryEnumerator CreateEnumerator();
-
- internal abstract CacheEntry UpdateCache(
- CacheKey cacheKey,
- CacheEntry newEntry,
- bool replace,
- CacheItemRemovedReason removedReason,
- out object valueOld);
-
- internal abstract long TrimIfNecessary(int percent);
-
- internal abstract void EnableExpirationTimer(bool enable);
-
- // If UseMemoryCache is true, we will direct all ASP.NET
- // cache usage into System.Runtime.Caching.dll. This allows
- // us to test System.Runtime.Caching.dll with all existing
- // ASP.NET test cases (functional, perf, and stress).
-#if USE_MEMORY_CACHE
- private static bool _useMemoryCache;
- private static volatile bool _useMemoryCacheInited;
- internal static bool UseMemoryCache {
- get {
- if (!_useMemoryCacheInited) {
- RegistryKey regKey = null;
- try {
- regKey = Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\ASP.NET");
- if (regKey != null) {
- if ((int)regKey.GetValue("UseMemoryCache", 0)== 1) {
- _useMemoryCache = true;
- }
- }
- }
- finally {
- if (regKey != null) {
- regKey.Close();
- }
- }
- _useMemoryCacheInited = true;
- }
- return _useMemoryCache;
- }
- }
-#endif
-
- // common implementation
- static internal CacheInternal Create() {
- CacheCommon cacheCommon = new CacheCommon();
- CacheInternal cacheInternal;
-#if USE_MEMORY_CACHE
- if (UseMemoryCache) {
- cacheInternal = new MemCache(cacheCommon);
- cacheCommon.AddSRefTarget(cacheInternal);
- }
- else {
-#endif
- int numSubCaches = 0;
- uint numCPUs = (uint) SystemInfo.GetNumProcessCPUs();
- // the number of subcaches is the minimal power of 2 greater
- // than or equal to the number of cpus
- numSubCaches = 1;
- numCPUs -= 1;
- while (numCPUs > 0) {
- numSubCaches <<= 1;
- numCPUs >>= 1;
- }
- if (numSubCaches == 1) {
- cacheInternal = new CacheSingle(cacheCommon, null, 0);
- }
- else {
- cacheInternal = new CacheMultiple(cacheCommon, numSubCaches);
- }
-#if USE_MEMORY_CACHE
- }
-#endif
- cacheCommon.SetCacheInternal(cacheInternal);
- cacheCommon.ResetFromConfigSettings();
-
- return cacheInternal;
- }
-
- protected CacheInternal(CacheCommon cacheCommon) {
- _cacheCommon = cacheCommon;
- }
-
- protected virtual void Dispose(bool disposing) {
- _cacheCommon.Dispose(disposing);
- }
-
- public void Dispose() {
- _disposed = 1;
- Dispose(true);
- // no destructor, don't need it.
- // System.GC.SuppressFinalize(this);
- }
-
- internal bool IsDisposed { get { return _disposed == 1; } }
-
- internal void ReadCacheInternalConfig(CacheSection cacheSection) {
- _cacheCommon.ReadCacheInternalConfig(cacheSection);
- }
-
- internal long TrimCache(int percent) {
- return _cacheCommon.CacheManagerThread(percent);
- }
-
- internal Cache CachePublic {
- get {return _cacheCommon._cachePublic;}
- }
-
- internal long EffectivePrivateBytesLimit {
- get { return _cacheCommon._cacheMemoryStats.CacheSizePressure.MemoryLimit; }
- }
-
- internal long EffectivePercentagePhysicalMemoryLimit {
- get { return _cacheCommon._cacheMemoryStats.TotalMemoryPressure.MemoryLimit; }
- }
-
- IEnumerator IEnumerable.GetEnumerator() {
- return CreateEnumerator();
- }
-
- public IDictionaryEnumerator GetEnumerator() {
- return CreateEnumerator();
- }
-
- internal object this[string key] {
- get {
- return Get(key);
+ return AspNetMemoryMonitor.PhysicalMemoryPercentageLimit;
}
}
-
- internal object Get(string key) {
- return DoGet(false, key, CacheGetOptions.None);
- }
-
- internal object Get(string key, CacheGetOptions getOptions) {
- return DoGet(false, key, getOptions);
- }
-
- internal object DoGet(bool isPublic, string key, CacheGetOptions getOptions) {
- CacheEntry entry;
- CacheKey cacheKey;
- object dummy;
-
- cacheKey = new CacheKey(key, isPublic);
- entry = UpdateCache(cacheKey, null, false, CacheItemRemovedReason.Removed, out dummy);
- if (entry != null) {
- if ((getOptions & CacheGetOptions.ReturnCacheEntry) != 0) {
- return entry;
- }
- else {
- return entry.Value;
- }
- }
- else {
- return null;
- }
- }
-
- internal void UtcInsert(string key, object value) {
- DoInsert(false,
- key,
- value,
- null,
- Cache.NoAbsoluteExpiration,
- Cache.NoSlidingExpiration,
- CacheItemPriority.Default,
- null,
- true);
-
- }
-
- internal void UtcInsert(string key, object value, CacheDependency dependencies) {
- DoInsert(false,
- key,
- value,
- dependencies,
- Cache.NoAbsoluteExpiration,
- Cache.NoSlidingExpiration,
- CacheItemPriority.Default,
- null,
- true);
- }
-
- internal void UtcInsert(
- string key,
- object value,
- CacheDependency dependencies,
- DateTime utcAbsoluteExpiration,
- TimeSpan slidingExpiration) {
-
- DoInsert(false,
- key,
- value,
- dependencies,
- utcAbsoluteExpiration,
- slidingExpiration,
- CacheItemPriority.Default,
- null,
- true);
- }
-
- internal void UtcInsert(
- string key,
- object value,
- CacheDependency dependencies,
- DateTime utcAbsoluteExpiration,
- TimeSpan slidingExpiration,
- CacheItemPriority priority,
- CacheItemRemovedCallback onRemoveCallback) {
-
- DoInsert(false,
- key,
- value,
- dependencies,
- utcAbsoluteExpiration,
- slidingExpiration,
- priority,
- onRemoveCallback,
- true);
- }
-
- internal object UtcAdd(
- string key,
- object value,
- CacheDependency dependencies,
- DateTime utcAbsoluteExpiration,
- TimeSpan slidingExpiration,
- CacheItemPriority priority,
- CacheItemRemovedCallback onRemoveCallback) {
-
- return DoInsert(
- false,
- key,
- value,
- dependencies,
- utcAbsoluteExpiration,
- slidingExpiration,
- priority,
- onRemoveCallback,
- false);
-
- }
-
- internal object DoInsert(
- bool isPublic,
- string key,
- object value,
- CacheDependency dependencies,
- DateTime utcAbsoluteExpiration,
- TimeSpan slidingExpiration,
- CacheItemPriority priority,
- CacheItemRemovedCallback onRemoveCallback,
- bool replace) {
-
-
- /*
- * If we throw an exception, prevent a leak by a user who
- * writes the following:
- *
- * Cache.Insert(key, value, new CacheDependency(file));
- */
- using (dependencies) {
- CacheEntry entry;
- object dummy;
-
- entry = new CacheEntry(
- key,
- value,
- dependencies,
- onRemoveCallback,
- utcAbsoluteExpiration,
- slidingExpiration,
- priority,
- isPublic);
-
- entry = UpdateCache(entry, entry, replace, CacheItemRemovedReason.Removed, out dummy);
-
- /*
- * N.B. A set can fail if two or more threads set the same key
- * at the same time.
- */
-#if DBG
- if (replace) {
- string yesno = (entry != null) ? "succeeded" : "failed";
- Debug.Trace("CacheAPIInsert", "Cache.Insert " + yesno + ": " + key);
- }
- else {
- if (entry == null) {
- Debug.Trace("CacheAPIAdd", "Cache.Add added new item: " + key);
- }
- else {
- Debug.Trace("CacheAPIAdd", "Cache.Add returned existing item: " + key);
- }
- }
-#endif
-
- if (entry != null) {
- return entry.Value;
- }
- else {
- return null;
- }
- }
- }
-
- internal object Remove(string key) {
- CacheKey cacheKey = new CacheKey(key, false);
- return DoRemove(cacheKey, CacheItemRemovedReason.Removed);
- }
-
- internal object Remove(CacheKey cacheKey, CacheItemRemovedReason reason) {
- return DoRemove(cacheKey, reason);
- }
-
- /*
- * Remove an item from the cache, with a specific reason.
- * This is package access so only the cache can specify
- * a reason other than REMOVED.
- *
- * @param key The key for the item.
- * @exception ArgumentException
- */
- internal object DoRemove(CacheKey cacheKey, CacheItemRemovedReason reason) {
- object valueOld;
-
- UpdateCache(cacheKey, null, true, reason, out valueOld);
-
-#if DBG
- if (valueOld != null) {
- Debug.Trace("CacheAPIRemove", "Cache.Remove succeeded, reason=" + reason + ": " + cacheKey);
- }
- else {
- Debug.Trace("CacheAPIRemove", "Cache.Remove failed, reason=" + reason + ": " + cacheKey);
- }
-#endif
-
- return valueOld;
- }
}
- sealed class CacheKeyComparer : IEqualityComparer {
- static CacheKeyComparer s_comparerInstance;
-
- static internal CacheKeyComparer GetInstance() {
- if (s_comparerInstance == null) {
- s_comparerInstance = new CacheKeyComparer();
- }
-
- return s_comparerInstance;
- }
-
- private CacheKeyComparer()
- {
- }
-
- bool IEqualityComparer.Equals(Object x, Object y)
- {
- return Compare(x, y) == 0;
- }
-
- // Compares two objects. An implementation of this method must return a
- // value less than zero if x is less than y, zero if x is equal to y, or a
- // value greater than zero if x is greater than y.
- private int Compare(Object x, Object y) {
- CacheKey a, b;
-
- Debug.Assert(x != null && x is CacheKey);
- Debug.Assert(y != null && y is CacheKey);
-
- a = (CacheKey) x;
- b = (CacheKey) y;
-
- if (a.IsPublic) {
- if (b.IsPublic) {
- return String.Compare(a.Key, b.Key, StringComparison.Ordinal);
- }
- else {
- return 1;
- }
- }
- else {
- if (!b.IsPublic) {
- return String.Compare(a.Key, b.Key, StringComparison.Ordinal);
- }
- else {
- return -1;
- }
- }
- }
- // Returns a hash code for the given object.
- //
- int IEqualityComparer.GetHashCode(Object obj) {
- Debug.Assert(obj != null && obj is CacheKey);
-
- CacheKey cacheKey = (CacheKey) obj;
-
- return cacheKey.GetHashCode();
- }
- }
-
- /*
- * The cache.
- */
- sealed class CacheSingle : CacheInternal {
- // cache stats
- static readonly TimeSpan INSERT_BLOCK_WAIT = new TimeSpan(0, 0, 10);
- const int MAX_COUNT = Int32.MaxValue / 2;
- const int MIN_COUNT = 10;
-
-
- Hashtable _entries; /* lookup table of entries */
- CacheExpires _expires; /* expires tables */
- CacheUsage _usage; /* usage tables */
- object _lock; /* read/write synchronization for _entries */
- int _disposed; /* disposed */
- int _totalCount; /* count of total entries */
- int _publicCount; /* count of public entries */
- ManualResetEvent _insertBlock; /* event to block inserts during high mem usage */
- bool _useInsertBlock; /* use insert block? */
- int _insertBlockCalls; /* number of callers using insert block */
- int _iSubCache; /* index of this cache */
- CacheMultiple _cacheMultiple; /* the CacheMultiple containing this cache */
-
- /*
- * Constructs a new Cache.
- */
- internal CacheSingle(CacheCommon cacheCommon, CacheMultiple cacheMultiple, int iSubCache) : base(cacheCommon) {
- _cacheMultiple = cacheMultiple;
- _iSubCache = iSubCache;
- _entries = new Hashtable(CacheKeyComparer.GetInstance());
- _expires = new CacheExpires(this);
- _usage = new CacheUsage(this);
- _lock = new object();
- _insertBlock = new ManualResetEvent(true);
- cacheCommon.AddSRefTarget(new { _entries, _expires, _usage });
- }
-
- /*
- * Dispose the cache.
- */
- protected override void Dispose(bool disposing) {
- if (disposing) {
- if (Interlocked.Exchange(ref _disposed, 1) == 0) {
- if (_expires != null) {
- _expires.EnableExpirationTimer(false);
- }
-
- // close all items
- CacheEntry[] entries = null;
-
- lock (_lock) {
- entries = new CacheEntry[_entries.Count];
- int i = 0;
- foreach (DictionaryEntry d in _entries) {
- entries[i++] = (CacheEntry) d.Value;
- }
- }
-
- foreach (CacheEntry entry in entries) {
- Remove(entry, CacheItemRemovedReason.Removed);
- }
-
- // force any waiters to complete their waits. Note
- // that the insert block cannot be reacquired, as UseInsertBlock
- // checks the _disposed field.
- _insertBlock.Set();
-
- // release the block, causing it to be disposed when there
- // are no more callers.
- ReleaseInsertBlock();
-
- Debug.Trace("CacheDispose", "Cache disposed");
- }
- }
-
- base.Dispose(disposing);
- }
-
- // Get the insert block manual reset event if it has not been disposed.
- ManualResetEvent UseInsertBlock() {
- for (;;) {
- if (_disposed == 1)
- return null;
-
- int n = _insertBlockCalls;
- if (n < 0) {
- return null;
- }
-
- if (Interlocked.CompareExchange(ref _insertBlockCalls, n + 1, n) == n) {
- return _insertBlock;
- }
- }
- }
-
- // Release the insert block event, and dispose it if it has been released
- // more times than it has been used
- void ReleaseInsertBlock() {
- if (Interlocked.Decrement(ref _insertBlockCalls) < 0) {
- ManualResetEvent e = _insertBlock;
- _insertBlock = null;
-
- // now close
- e.Close();
- }
- }
-
- // Set the insert block event.
- void SetInsertBlock() {
- ManualResetEvent e = null;
- try {
- e = UseInsertBlock();
- if (e != null) {
- e.Set();
- }
- }
- finally {
- if (e != null) {
- ReleaseInsertBlock();
- }
- }
- }
-
- // Reset the insert block event.
- void ResetInsertBlock() {
- ManualResetEvent e = null;
- try {
- e = UseInsertBlock();
- if (e != null) {
- e.Reset();
- }
- }
- finally {
- if (e != null) {
- ReleaseInsertBlock();
- }
- }
- }
-
- // Wait on the insert block event.
- bool WaitInsertBlock() {
- bool signaled = false;
- ManualResetEvent e = null;
- try {
- e = UseInsertBlock();
- if (e != null) {
- Debug.Trace("CacheMemoryTrimInsertBlock", "WaitInsertBlock: Cache " + _iSubCache + ": _useInsertBlock=true");
- signaled = e.WaitOne(INSERT_BLOCK_WAIT, false);
- Debug.Trace("CacheMemoryTrimInsertBlock", "Done waiting");
- }
- }
- finally {
- if (e != null) {
- ReleaseInsertBlock();
- }
- }
-
- return signaled;
- }
-
- internal void BlockInsertIfNeeded() {
- if (_cacheCommon._cacheMemoryStats.IsAboveHighPressure()) {
- Debug.Trace("CacheMemoryTrimInsertBlock", "BlockInsertIfNeeded: Cache " + _iSubCache + ": _useInsertBlock=true");
- _useInsertBlock = true;
- ResetInsertBlock();
- }
- }
-
- internal void UnblockInsert() {
- if (_useInsertBlock) {
- _useInsertBlock = false;
- SetInsertBlock();
- Debug.Trace("CacheMemoryTrimInsertBlock", "UnblockInsert: Cache " + _iSubCache + ": _useInsertBlock=false");
- }
- }
-
-
- internal override int PublicCount {
- get {return _publicCount;}
- }
-
- internal override long TotalCount {
- get {return _totalCount;}
- }
-
- internal override IDictionaryEnumerator CreateEnumerator() {
- Hashtable h = new Hashtable(_publicCount);
- DateTime utcNow = DateTime.UtcNow;
-
- lock (_lock) {
- foreach (DictionaryEntry d in _entries) {
- CacheEntry entry = (CacheEntry) d.Value;
-
- // note that ASP.NET does not use this enumerator internally,
- // so we just choose public items.
- if (entry.IsPublic &&
- entry.State == CacheEntry.EntryState.AddedToCache &&
- ((!_cacheCommon._enableExpiration) || (utcNow <= entry.UtcExpires))) {
- h[entry.Key] = entry.Value;
- }
- }
- }
-
- return h.GetEnumerator();
- }
-
- /*
- * Performs all operations on the cache, with the
- * exception of Clear. The arguments indicate the type of operation:
- *
- * @param key The key of the object.
- * @param newItem The new entry to be added to the cache.
- * @param replace Whether or not newEntry should replace an existing object in the cache.
- * @return The item requested. May be null.
- */
- internal override CacheEntry UpdateCache(
- CacheKey cacheKey,
- CacheEntry newEntry,
- bool replace,
- CacheItemRemovedReason removedReason,
- out object valueOld)
- {
- CacheEntry entry = null;
- CacheEntry oldEntry = null;
- bool expired = false;
- DateTime utcNow;
- CacheDependency newEntryDependency = null;
- bool isGet, isAdd;
- bool removeExpired = false;
- bool updateExpires = false;
- DateTime utcNewExpires = DateTime.MinValue;
- CacheEntry.EntryState entryState = CacheEntry.EntryState.NotInCache;
- bool newEntryNeedsClose = false;
- CacheItemRemovedReason newEntryRemovedReason = CacheItemRemovedReason.Removed;
-
- valueOld = null;
- isGet = !replace && newEntry == null;
- isAdd = !replace && newEntry != null;
-
- /*
- * Perform update of cache data structures in a series to
- * avoid overlapping locks.
- *
- * First, update the hashtable. The hashtable is the place
- * that guarantees what is in or out of the cache.
- *
- * Loop here to remove expired items in a Get or Add, where
- * we can't otherwise delete an item.
- */
- for (;;) {
- if (removeExpired) {
- Debug.Trace("CacheUpdate", "Removing expired item found in Get: " + cacheKey);
- UpdateCache(cacheKey, null, true, CacheItemRemovedReason.Expired, out valueOld);
- removeExpired = false;
- }
-
- entry = null;
- utcNow = DateTime.UtcNow;
-
- if (_useInsertBlock && newEntry != null && newEntry.HasUsage() /* HasUsage() means it's not NonRemovable */) {
- bool insertBlockReleased = WaitInsertBlock();
-
-#if DBG
- if (!insertBlockReleased) {
- Debug.Trace("CacheUpdateWaitFailed", "WaitInsertBlock failed.");
- }
-#endif
- }
-
- // the _entries hashtable supports multiple readers or one writer
- bool isLockEntered = false;
- if (!isGet) {
- Monitor.Enter(_lock, ref isLockEntered);
- }
- try {
- entry = (CacheEntry) _entries[cacheKey];
- Debug.Trace("CacheUpdate", "Entry " + ((entry != null) ? "found" : "not found") + "in hashtable: " + cacheKey);
-
- if (entry != null) {
- entryState = entry.State;
-
- // If isGet == true, we are not hold any lock and so entryState can be anything
- Debug.Assert(
- isGet ||
- entryState == CacheEntry.EntryState.AddingToCache ||
- entryState == CacheEntry.EntryState.AddedToCache,
- "entryState == CacheEntry.EntryState.AddingToCache || entryState == CacheEntry.EntryState.AddedToCache");
-
- expired = (_cacheCommon._enableExpiration) && (entry.UtcExpires < utcNow);
- if (expired) {
- if (isGet) {
- /*
- * If the expired item is Added to the cache, remove it now before
- * its expiration timer fires up to a minute in the future.
- * Otherwise, just return null to indicate the item is not available.
- */
- if (entryState == CacheEntry.EntryState.AddedToCache) {
- removeExpired = true;
- continue;
- }
-
- entry = null;
- }
- else {
- /*
- * If it's a call to Add, replace the item
- * when it has expired.
- */
- replace = true;
-
- /*
- * Change the removed reason.
- */
- removedReason = CacheItemRemovedReason.Expired;
- }
- }
- else {
- updateExpires = (_cacheCommon._enableExpiration) && (entry.SlidingExpiration > TimeSpan.Zero);
- }
- }
-
- /*
- * Avoid running unnecessary code in a Get request by this simple test:
- */
- if (!isGet) {
- /*
- * Remove an item from the hashtable.
- */
- if (replace && entry != null) {
- bool doRemove = (entryState != CacheEntry.EntryState.AddingToCache);
- if (doRemove) {
- oldEntry = entry;
-
- oldEntry.State = CacheEntry.EntryState.RemovingFromCache;
-
- _entries.Remove(oldEntry);
- Debug.Trace("CacheUpdate", "Entry removed from hashtable: " + cacheKey);
- }
- else {
- /*
- * If we're removing and couldn't remove the old item
- * because its state was AddingToCache, return null
- * to indicate failure.
- */
- if (newEntry == null) {
- Debug.Trace("CacheUpdate", "Removal from hashtable failed: " + cacheKey);
- entry = null;
- }
- }
- }
-
- /*
- * Add an item to the hashtable.
- */
- if (newEntry != null) {
- bool doAdd = true;
-
- if (entry != null) {
- if (oldEntry == null) {
- /*
- * We could not remove the existing entry,
- * either because it simply exists and replace == false,
- * or replace == true and it's state was AddingToCache when
- * we tried to remove it.
- */
- doAdd = false;
- newEntryRemovedReason = CacheItemRemovedReason.Removed;
- }
-
-#if DBG
- if (!doAdd) {
- Debug.Trace("CacheUpdate", "Insertion into hashtable failed because old entry was not removed: " + cacheKey);
- }
-#endif
- }
-
-
- if (doAdd) {
- /* non-definitive check */
- newEntryDependency = newEntry.Dependency;
- if (newEntryDependency != null) {
- if (newEntryDependency.HasChanged) {
- doAdd = false;
- newEntryRemovedReason = CacheItemRemovedReason.DependencyChanged;
- }
-
-#if DBG
- if (!doAdd) {
- Debug.Trace("CacheUpdate", "Insertion into hashtable failed because dependency changed: " + cacheKey);
- }
-#endif
- }
- }
-
- if (doAdd) {
- newEntry.State = CacheEntry.EntryState.AddingToCache;
- _entries.Add(newEntry, newEntry);
-
- /*
- * If this is an Add operation, indicate success
- * by returning null.
- */
- if (isAdd) {
- Debug.Assert(entry == null || expired, "entry == null || expired");
- entry = null;
- }
- else {
- /*
- * Indicate success by returning the inserted entry.
- */
- entry = newEntry;
- }
-
- Debug.Trace("CacheUpdate", "Entry added to hashtable: " + cacheKey);
- }
- else {
- if (!isAdd) {
- /*
- * If we failed for an Insert, indicate failure by returning null.
- */
- entry = null;
- newEntryNeedsClose = true;
- }
- else {
- /*
- * If we failed for an Add (e.g. Dependency has changed),
- * return the existing value. If existing value is null,
- * we have to close the newEntry ourselves. Otherwise, we'll
- * return non-null and the caller should close the item.
- */
- newEntryNeedsClose = (entry == null);
- }
-
- /*
- * If newEntry cannot be inserted, and it does not need to be
- * closed, set it to null so that we don't insert it later.
- * Leave it non-null when it needs to be closed that that we
- * can close it.
- */
- if (!newEntryNeedsClose) {
- newEntry = null;
- }
-
- }
- }
- }
-
- break;
- }
- finally {
- if (isLockEntered) {
- Monitor.Exit(_lock);
- }
- }
- }
-
- /*
- * Since we want Get to be fast, check here for a get without
- * alteration to cache.
- */
- if (isGet) {
- if (entry != null) {
- if (updateExpires) {
- utcNewExpires = utcNow + entry.SlidingExpiration;
- if (utcNewExpires - entry.UtcExpires >= CacheExpires.MIN_UPDATE_DELTA || utcNewExpires < entry.UtcExpires) {
- _expires.UtcUpdate(entry, utcNewExpires);
- }
- }
-
- UtcUpdateUsageRecursive(entry, utcNow);
- }
-
- if (cacheKey.IsPublic) {
- PerfCounters.IncrementCounter(AppPerfCounter.API_CACHE_RATIO_BASE);
- if (entry != null) {
- PerfCounters.IncrementCounter(AppPerfCounter.API_CACHE_HITS);
- }
- else {
- PerfCounters.IncrementCounter(AppPerfCounter.API_CACHE_MISSES);
- }
- }
-
- PerfCounters.IncrementCounter(AppPerfCounter.TOTAL_CACHE_RATIO_BASE);
- if (entry != null) {
- PerfCounters.IncrementCounter(AppPerfCounter.TOTAL_CACHE_HITS);
- }
- else {
- PerfCounters.IncrementCounter(AppPerfCounter.TOTAL_CACHE_MISSES);
- }
-
-#if DBG
- if (entry != null) {
- Debug.Trace("CacheUpdate", "Cache hit: " + cacheKey);
- }
- else {
- Debug.Trace("CacheUpdate", "Cache miss: " + cacheKey);
- }
-#endif
-
- }
- else {
- int totalDelta = 0;
- int publicDelta = 0;
- int totalTurnover = 0;
- int publicTurnover = 0;
-
- if (oldEntry != null) {
- if (oldEntry.InExpires()) {
- _expires.Remove(oldEntry);
- }
-
- if (oldEntry.InUsage()) {
- _usage.Remove(oldEntry);
- }
-
- Debug.Assert(oldEntry.State == CacheEntry.EntryState.RemovingFromCache, "oldEntry.State == CacheEntry.EntryState.RemovingFromCache");
- oldEntry.State = CacheEntry.EntryState.RemovedFromCache;
- valueOld = oldEntry.Value;
-
- totalDelta--;
- totalTurnover++;
- if (oldEntry.IsPublic) {
- publicDelta--;
- publicTurnover++;
- }
-
-#if DBG
- Debug.Trace("CacheUpdate", "Entry removed from cache, reason=" + removedReason + ": " + (CacheKey) oldEntry);
-#endif
- }
-
- if (newEntry != null) {
- if (newEntryNeedsClose) {
- // Call close if newEntry could not be added.
- newEntry.State = CacheEntry.EntryState.RemovedFromCache;
- newEntry.Close(newEntryRemovedReason);
- newEntry = null;
- }
- else {
- Debug.Assert(!newEntry.InExpires());
- Debug.Assert(!newEntry.InUsage());
-
- if (_cacheCommon._enableExpiration && newEntry.HasExpiration()) {
- _expires.Add(newEntry);
- }
-
- if ( _cacheCommon._enableMemoryCollection && newEntry.HasUsage() &&
- ( // Don't bother to set usage if it's going to expire very soon
- !newEntry.HasExpiration() ||
- newEntry.SlidingExpiration > TimeSpan.Zero ||
- newEntry.UtcExpires - utcNow >= CacheUsage.MIN_LIFETIME_FOR_USAGE)) {
-
- _usage.Add(newEntry);
- }
-
- newEntry.State = CacheEntry.EntryState.AddedToCache;
-
- Debug.Trace("CacheUpdate", "Entry added to cache: " + (CacheKey)newEntry);
-
- totalDelta++;
- totalTurnover++;
- if (newEntry.IsPublic) {
- publicDelta++;
- publicTurnover++;
- }
- }
- }
-
- // Call close after the newEntry has been fully added to the cache,
- // so the OnRemoveCallback can take a dependency on the newly inserted item.
- if (oldEntry != null) {
- oldEntry.Close(removedReason);
- }
-
- // Delay monitoring change events until the oldEntry has been completely removed
- // from the cache, and its OnRemoveCallback called. This way we won't call the
- // OnRemoveCallback for newEntry before doing so for oldEntry.
- if (newEntry != null) {
- // listen to change events
- newEntry.MonitorDependencyChanges();
-
- /*
- * NB: We have to check for dependency changes after we add the item
- * to cache, because otherwise we may not remove it if it changes
- * between the time we check for a dependency change and the time
- * we set the AddedToCache bit. The worst that will happen is that
- * a get can occur on an item that has changed, but that can happen
- * anyway. The important thing is that we always remove an item that
- * has changed.
- */
- if (newEntryDependency != null && newEntryDependency.HasChanged) {
- Remove(newEntry, CacheItemRemovedReason.DependencyChanged);
- }
- }
-
- // update counts and counters
- if (totalDelta == 1) {
- Interlocked.Increment(ref _totalCount);
- PerfCounters.IncrementCounter(AppPerfCounter.TOTAL_CACHE_ENTRIES);
- }
- else if (totalDelta == -1) {
- Interlocked.Decrement(ref _totalCount);
- PerfCounters.DecrementCounter(AppPerfCounter.TOTAL_CACHE_ENTRIES);
- }
-
- if (publicDelta == 1) {
- Interlocked.Increment(ref _publicCount);
- PerfCounters.IncrementCounter(AppPerfCounter.API_CACHE_ENTRIES);
- }
- else if (publicDelta == -1) {
- Interlocked.Decrement(ref _publicCount);
- PerfCounters.DecrementCounter(AppPerfCounter.API_CACHE_ENTRIES);
- }
-
- if (totalTurnover > 0) {
- PerfCounters.IncrementCounterEx(AppPerfCounter.TOTAL_CACHE_TURNOVER_RATE, totalTurnover);
- }
-
- if (publicTurnover > 0) {
- PerfCounters.IncrementCounterEx(AppPerfCounter.API_CACHE_TURNOVER_RATE, publicTurnover);
- }
- }
-
- return entry;
- }
-
- void UtcUpdateUsageRecursive(CacheEntry entry, DateTime utcNow) {
- CacheDependency dependency;
- CacheEntry[] entries;
-
- // Don't update if the last update is less than 1 sec away. This way we'll
- // avoid over updating the usage in the scenario where a cache makes several
- // update requests.
- if (utcNow - entry.UtcLastUsageUpdate > CacheUsage.CORRELATED_REQUEST_TIMEOUT || utcNow < entry.UtcLastUsageUpdate) {
- entry.UtcLastUsageUpdate = utcNow;
- if (entry.InUsage()) {
- CacheSingle cacheSingle;
- if (_cacheMultiple == null) {
- cacheSingle = this;
- }
- else {
- cacheSingle = _cacheMultiple.GetCacheSingle(entry.Key.GetHashCode());
- }
-
- cacheSingle._usage.Update(entry);
- }
-
- dependency = entry.Dependency;
- if (dependency != null) {
- entries = dependency.CacheEntries;
- if (entries != null) {
- foreach (CacheEntry dependent in entries) {
- UtcUpdateUsageRecursive(dependent, utcNow);
- }
- }
- }
- }
- }
-
- internal override long TrimIfNecessary(int percent) {
- Debug.Assert(_cacheCommon._inCacheManagerThread == 1, "Trim should only occur when we're updating memory statistics.");
- if (!_cacheCommon._enableMemoryCollection)
- return 0;
-
- int toTrim = 0;
- // do we need to drop a percentage of entries?
- if (percent > 0) {
- toTrim = (int)(((long)_totalCount * (long)percent) / 100L);
- }
- // would this leave us above MAX_COUNT?
- int minTrim = _totalCount - MAX_COUNT;
- if (toTrim < minTrim) {
- toTrim = minTrim;
- }
- // would this put us below MIN_COUNT?
- int maxTrim = _totalCount - MIN_COUNT;
- if (toTrim > maxTrim) {
- toTrim = maxTrim;
- }
- // do we need to trim?
- if (toTrim <= 0 || HostingEnvironment.ShutdownInitiated) {
- return 0;
- }
-
- int ocEntriesTrimmed = 0; // number of output cache entries trimmed
- int publicEntriesTrimmed = 0; // number of public entries trimmed
- int totalTrimmed = 0; // total number of entries trimmed
- int trimmedOrExpired = 0;
- int beginTotalCount = _totalCount;
-
- try {
- trimmedOrExpired = _expires.FlushExpiredItems(true);
- if (trimmedOrExpired < toTrim) {
- totalTrimmed = _usage.FlushUnderUsedItems(toTrim - trimmedOrExpired, ref publicEntriesTrimmed, ref ocEntriesTrimmed);
- trimmedOrExpired += totalTrimmed;
- }
-
- if (totalTrimmed > 0) {
- // Update values for perfcounters
- PerfCounters.IncrementCounterEx(AppPerfCounter.CACHE_TOTAL_TRIMS, totalTrimmed);
- PerfCounters.IncrementCounterEx(AppPerfCounter.CACHE_API_TRIMS, publicEntriesTrimmed);
- PerfCounters.IncrementCounterEx(AppPerfCounter.CACHE_OUTPUT_TRIMS, ocEntriesTrimmed);
- }
- }
- catch {
- }
-
-#if DBG
- Debug.Trace("CacheMemory", "TrimIfNecessary: _iSubCache= " + _iSubCache
- + ", beginTotalCount=" + beginTotalCount
- + ", endTotalCount=" + _totalCount
- + ", percent=" + percent
- + ", trimmed=" + totalTrimmed);
-#endif
- return trimmedOrExpired;
- }
-
- internal override void EnableExpirationTimer(bool enable) {
- if (_expires != null) {
- _expires.EnableExpirationTimer(enable);
- }
- }
- }
-
- class CacheMultiple : CacheInternal {
- int _disposed;
- DisposableGCHandleRef<CacheSingle>[] _cachesRefs;
- int _cacheIndexMask;
-
- internal CacheMultiple(CacheCommon cacheCommon, int numSingleCaches) : base(cacheCommon) {
- Debug.Assert(numSingleCaches > 1, "numSingleCaches is not greater than 1");
- Debug.Assert((numSingleCaches & (numSingleCaches - 1)) == 0, "numSingleCaches is not a power of 2");
- _cacheIndexMask = numSingleCaches - 1;
-
- // Each CacheSingle will have its own SRef reporting the size of the data it references.
- // Objects in this CacheSingle may have refs to the root Cache and therefore reference other instances of CacheSingle.
- // This leads to an unbalanced tree of SRefs and makes GC less efficient while calculating multiple SRefs on multiple cores.
- // Using DisposableGCHandleRef here prevents SRefs from calculating data that does not belong to other CacheSingle instances.
- _cachesRefs = new DisposableGCHandleRef<CacheSingle>[numSingleCaches];
- for (int i = 0; i < numSingleCaches; i++) {
- _cachesRefs[i] = new DisposableGCHandleRef<CacheSingle>(new CacheSingle(cacheCommon, this, i));
- }
- }
-
- protected override void Dispose(bool disposing) {
- if (disposing) {
- if (Interlocked.Exchange(ref _disposed, 1) == 0) {
- foreach (var cacheSingleRef in _cachesRefs) {
- // Unfortunately the application shutdown logic allows user to access cache even after its disposal.
- // We'll keep the GCHandle inside cacheSingleRef until it gets reclaimed during appdomain shutdown.
- // And we'll only dispose the Target to preserve the old behavior.
- cacheSingleRef.Target.Dispose();
- }
- }
- }
-
- base.Dispose(disposing);
- }
-
- internal override int PublicCount {
- get {
- int count = 0;
- foreach (var cacheSingleRef in _cachesRefs) {
- count += cacheSingleRef.Target.PublicCount;
- }
-
- return count;
- }
- }
-
- internal override long TotalCount {
- get {
- long count = 0;
- foreach (var cacheSingleRef in _cachesRefs) {
- count += cacheSingleRef.Target.TotalCount;
- }
-
- return count;
- }
- }
-
- internal override IDictionaryEnumerator CreateEnumerator() {
- IDictionaryEnumerator[] enumerators = new IDictionaryEnumerator[_cachesRefs.Length];
- for (int i = 0, c = _cachesRefs.Length; i < c; i++) {
- enumerators[i] = _cachesRefs[i].Target.CreateEnumerator();
- }
-
- return new AggregateEnumerator(enumerators);
- }
-
- internal CacheSingle GetCacheSingle(int hashCode) {
- Debug.Assert(_cachesRefs != null && _cachesRefs.Length != 0);
- // Dev10 865907: Math.Abs throws OverflowException for Int32.MinValue
- if (hashCode < 0) {
- hashCode = (hashCode == Int32.MinValue) ? 0 : -hashCode;
- }
- int index = (hashCode & _cacheIndexMask);
- Debug.Assert(_cachesRefs[index].Target != null);
- return _cachesRefs[index].Target;
- }
-
- internal override CacheEntry UpdateCache(
- CacheKey cacheKey,
- CacheEntry newEntry,
- bool replace,
- CacheItemRemovedReason removedReason,
- out object valueOld) {
-
- int hashCode = cacheKey.Key.GetHashCode();
- CacheSingle cacheSingle = GetCacheSingle(hashCode);
- return cacheSingle.UpdateCache(cacheKey, newEntry, replace, removedReason, out valueOld);
- }
-
- internal override long TrimIfNecessary(int percent) {
- long count = 0;
- foreach (var cacheSingleRef in _cachesRefs) {
- count += cacheSingleRef.Target.TrimIfNecessary(percent);
- }
- return count;
- }
-
- internal override void EnableExpirationTimer(bool enable) {
- foreach (var cacheSingleRef in _cachesRefs) {
- cacheSingleRef.Target.EnableExpirationTimer(enable);
- }
- }
- }
-
- class AggregateEnumerator : IDictionaryEnumerator {
- IDictionaryEnumerator [] _enumerators;
- int _iCurrent;
-
- internal AggregateEnumerator(IDictionaryEnumerator [] enumerators) {
- _enumerators = enumerators;
- }
-
- public bool MoveNext() {
- bool more;
-
- for (;;) {
- more = _enumerators[_iCurrent].MoveNext();
- if (more)
- break;
-
- if (_iCurrent == _enumerators.Length - 1)
- break;
-
- _iCurrent++;
- }
-
- return more;
- }
-
- public void Reset() {
- for (int i = 0; i <= _iCurrent; i++) {
- _enumerators[i].Reset();
- }
-
- _iCurrent = 0;
- }
-
- public Object Current {
- get {
- return _enumerators[_iCurrent].Current;
- }
- }
-
- public Object Key {
- get {
- return _enumerators[_iCurrent].Key;
- }
- }
-
- public Object Value {
- get {
- return _enumerators[_iCurrent].Value;
- }
- }
-
- public DictionaryEntry Entry {
- get {
- return _enumerators[_iCurrent].Entry;
- }
- }
- }
}
diff --git a/mcs/class/referencesource/System.Web/CachedPathData.cs b/mcs/class/referencesource/System.Web/CachedPathData.cs
index ad25b2d0ead..8171ee83dfa 100644
--- a/mcs/class/referencesource/System.Web/CachedPathData.cs
+++ b/mcs/class/referencesource/System.Web/CachedPathData.cs
@@ -196,7 +196,7 @@ namespace System.Web {
// the filesystem.
//
string key = CreateKey(configPath);
- CacheInternal cacheInternal = HttpRuntime.CacheInternal;
+ CacheStoreProvider cacheInternal = HttpRuntime.Cache.InternalCache;
CachedPathData data = (CachedPathData) cacheInternal.Get(key);
// if found, return the data
@@ -272,9 +272,12 @@ namespace System.Web {
try {
}
finally {
- data = (CachedPathData) cacheInternal.UtcAdd(key, dataAdd, dependency,
- Cache.NoAbsoluteExpiration, slidingExpiration,
- priority, s_callback);
+ data = (CachedPathData)cacheInternal.Add(key, dataAdd, new CacheInsertOptions() {
+ Dependencies = dependency,
+ SlidingExpiration = slidingExpiration,
+ Priority = priority,
+ OnRemovedCallback = s_callback
+ });
if (data == null) {
isDataCreator = true;
@@ -369,9 +372,11 @@ namespace System.Web {
}
using (dependency) {
- cacheInternal.UtcInsert(key, dataAdd, dependency,
- DateTime.UtcNow.AddSeconds(5), Cache.NoSlidingExpiration,
- CacheItemPriority.Normal, s_callback);
+ cacheInternal.Insert(key, dataAdd, new CacheInsertOptions() {
+ Dependencies = dependency,
+ AbsoluteExpiration = DateTime.UtcNow.AddSeconds(5),
+ OnRemovedCallback = s_callback
+ });
}
}
@@ -416,7 +421,7 @@ namespace System.Web {
// virtual files.
// An example of a 400 range error is "path not found".
static internal void RemoveBadPathData(CachedPathData pathData) {
- CacheInternal cacheInternal = HttpRuntime.CacheInternal;
+ CacheStoreProvider cacheInternal = HttpRuntime.Cache.InternalCache;
string configPath = pathData._configPath;
string key = CreateKey(configPath);
@@ -437,7 +442,7 @@ namespace System.Web {
// status outside the 400 range. We need to mark all data up the path to account for
// virtual files.
static internal void MarkCompleted(CachedPathData pathData) {
- CacheInternal cacheInternal = HttpRuntime.CacheInternal;
+ CacheStoreProvider cacheInternal = HttpRuntime.Cache.InternalCache;
string configPath = pathData._configPath;
do {
diff --git a/mcs/class/referencesource/System.Web/Compilation/BuildManager.cs b/mcs/class/referencesource/System.Web/Compilation/BuildManager.cs
index 65f0272002f..7ad0d9bd9c7 100644
--- a/mcs/class/referencesource/System.Web/Compilation/BuildManager.cs
+++ b/mcs/class/referencesource/System.Web/Compilation/BuildManager.cs
@@ -461,7 +461,7 @@ namespace System.Web.Compilation {
//
// Always try the memory cache first
- _memoryCache = new MemoryBuildResultCache(HttpRuntime.CacheInternal);
+ _memoryCache = new MemoryBuildResultCache();
// Use the standard disk cache for regular apps
_codeGenCache = new StandardDiskBuildResultCache(HttpRuntime.CodegenDirInternal);
@@ -479,7 +479,7 @@ namespace System.Web.Compilation {
//
// Always try the memory cache first
- _memoryCache = new MemoryBuildResultCache(HttpRuntime.CacheInternal);
+ _memoryCache = new MemoryBuildResultCache();
// Used the precomp cache for precompiled apps
BuildResultCache preCompCache = new PrecompiledSiteDiskBuildResultCache(
@@ -501,7 +501,7 @@ namespace System.Web.Compilation {
// We are precompiling an app
// Always try the memory cache first
- _memoryCache = new MemoryBuildResultCache(HttpRuntime.CacheInternal);
+ _memoryCache = new MemoryBuildResultCache();
// Create a regular disk cache, to take advantage of the fact that the app
// may already have been compiled (and to cause it to be if it wasn't)
diff --git a/mcs/class/referencesource/System.Web/Compilation/BuildResultCache.cs b/mcs/class/referencesource/System.Web/Compilation/BuildResultCache.cs
index 1e3bfd5a825..0d58da9ca21 100644
--- a/mcs/class/referencesource/System.Web/Compilation/BuildResultCache.cs
+++ b/mcs/class/referencesource/System.Web/Compilation/BuildResultCache.cs
@@ -67,15 +67,13 @@ internal abstract class BuildResultCache {
internal class MemoryBuildResultCache: BuildResultCache {
- private CacheInternal _cache;
private CacheItemRemovedCallback _onRemoveCallback;
// The keys are simple assembly names
// The values are ArrayLists containing the simple names of assemblies that depend on it
private Hashtable _dependentAssemblies = new Hashtable();
- internal MemoryBuildResultCache(CacheInternal cache) {
- _cache = cache;
+ internal MemoryBuildResultCache() {
// Register an AssemblyLoad event
AppDomain.CurrentDomain.AssemblyLoad += new AssemblyLoadEventHandler(OnAssemblyLoad);
@@ -121,7 +119,7 @@ internal class MemoryBuildResultCache: BuildResultCache {
Debug.Trace("BuildResultCache", "Looking for '" + cacheKey + "' in the memory cache");
string key = GetMemoryCacheKey(cacheKey);
- BuildResult result = (BuildResult) _cache.Get(key);
+ BuildResult result = (BuildResult) HttpRuntime.Cache.InternalCache.Get(key);
// Not found in the cache
if (result == null) {
@@ -137,9 +135,9 @@ internal class MemoryBuildResultCache: BuildResultCache {
Debug.Trace("BuildResultCache", "'" + cacheKey + "' was found but is out of date");
// Remove it from the cache
- _cache.Remove(key);
+ HttpRuntime.Cache.InternalCache.Remove(key);
- Debug.Assert(_cache.Get(key) == null);
+ Debug.Assert(HttpRuntime.Cache.InternalCache.Get(key) == null);
return null;
}
@@ -183,16 +181,11 @@ internal class MemoryBuildResultCache: BuildResultCache {
// Insert a new cache entry using the assembly path as the key
string assemblyKey = GetAssemblyCacheKey(compiledResult.ResultAssembly);
- Assembly a = (Assembly)_cache.Get(assemblyKey);
+ Assembly a = (Assembly) HttpRuntime.Cache.InternalCache.Get(assemblyKey);
if (a == null) {
Debug.Trace("BuildResultCache", "Adding marker cache entry " + compiledResult.ResultAssembly);
// VSWhidbey 500049 - add as NotRemovable to prevent the assembly from being prematurely deleted
- _cache.UtcInsert(assemblyKey, compiledResult.ResultAssembly,
- null,
- Cache.NoAbsoluteExpiration,
- Cache.NoSlidingExpiration,
- CacheItemPriority.NotRemovable,
- null);
+ HttpRuntime.Cache.InternalCache.Insert(assemblyKey, compiledResult.ResultAssembly, null);
}
else {
Debug.Assert(a == compiledResult.ResultAssembly);
@@ -237,11 +230,13 @@ internal class MemoryBuildResultCache: BuildResultCache {
onRemoveCallback = _onRemoveCallback;
}
- _cache.UtcInsert(key, result, cacheDependency,
- result.MemoryCacheExpiration,
- result.MemoryCacheSlidingExpiration,
- cachePriority,
- onRemoveCallback);
+ HttpRuntime.Cache.InternalCache.Insert(key, result, new CacheInsertOptions() {
+ Dependencies = cacheDependency,
+ AbsoluteExpiration = result.MemoryCacheExpiration,
+ SlidingExpiration = result.MemoryCacheSlidingExpiration,
+ Priority = cachePriority,
+ OnRemovedCallback = onRemoveCallback
+ });
}
// OnCacheItemRemoved can be invoked with user code on the stack, for example if someone
@@ -338,7 +333,7 @@ internal class MemoryBuildResultCache: BuildResultCache {
// If we have no cache entry for this assembly, there is nothing to do
string cacheKey = GetAssemblyCacheKeyFromName(assemblyName);
- Assembly assembly = (Assembly)_cache[cacheKey];
+ Assembly assembly = (Assembly)HttpRuntime.Cache.InternalCache.Get(cacheKey);
if (assembly == null)
return;
@@ -348,7 +343,7 @@ internal class MemoryBuildResultCache: BuildResultCache {
Debug.Trace("BuildResultCache", "removing cacheKey for assembly " + assemblyPath + " because of dependency change");
// Remove the cache entry in order to kick out all the pages that are in that batch
- _cache.Remove(cacheKey);
+ HttpRuntime.Cache.InternalCache.Remove(cacheKey);
// Now call recursively on all the dependent assemblies (VSWhidbey 577593)
ICollection dependentAssemblies = _dependentAssemblies[assemblyName] as ICollection;
@@ -532,7 +527,7 @@ internal abstract class DiskBuildResultCache: BuildResultCache {
// This is required otherwise new components can be compiled
// with obsolete build results whose assembly has been removed.
string assemblyKey = GetAssemblyCacheKey(f.FullName);
- HttpRuntime.CacheInternal.Remove(assemblyKey);
+ HttpRuntime.Cache.InternalCache.Remove(assemblyKey);
// Remove the assembly
RemoveAssembly(f);
diff --git a/mcs/class/referencesource/System.Web/Compilation/CompilationLock.cs b/mcs/class/referencesource/System.Web/Compilation/CompilationLock.cs
index 5872f0ea61c..6e271ae7022 100644
--- a/mcs/class/referencesource/System.Web/Compilation/CompilationLock.cs
+++ b/mcs/class/referencesource/System.Web/Compilation/CompilationLock.cs
@@ -188,7 +188,7 @@ internal static class CompilationLock {
// Always take the BuildManager lock *before* taking the mutex, to avoid possible
// deadlock situations (VSWhidbey 530732)
#pragma warning disable 0618
- //@TODO: This overload of Monitor.Enter is obsolete. Please change this to use Monitor.Enter(ref bool), and remove the pragmas -- [....]
+ //@TODO: This overload of Monitor.Enter is obsolete. Please change this to use Monitor.Enter(ref bool), and remove the pragmas -- Microsoft
Monitor.Enter(BuildManager.TheBuildManager);
#pragma warning restore 0618
_mutex.WaitOne();
diff --git a/mcs/class/referencesource/System.Web/Compilation/ResourceExpressionBuilder.cs b/mcs/class/referencesource/System.Web/Compilation/ResourceExpressionBuilder.cs
index a0cdf9eef61..162fcf09652 100644
--- a/mcs/class/referencesource/System.Web/Compilation/ResourceExpressionBuilder.cs
+++ b/mcs/class/referencesource/System.Web/Compilation/ResourceExpressionBuilder.cs
@@ -271,9 +271,9 @@ namespace System.Web.Compilation {
"." + classKey;
// If we have it cached, return it
- CacheInternal cacheInternal = System.Web.HttpRuntime.CacheInternal;
+ CacheStoreProvider cacheInternal = System.Web.HttpRuntime.Cache.InternalCache;
string cacheKey = CacheInternal.PrefixResourceProvider + fullClassName;
- IResourceProvider resourceProvider = cacheInternal[cacheKey] as IResourceProvider;
+ IResourceProvider resourceProvider = cacheInternal.Get(cacheKey) as IResourceProvider;
if (resourceProvider != null) {
return resourceProvider;
}
@@ -282,7 +282,7 @@ namespace System.Web.Compilation {
resourceProvider = s_resourceProviderFactory.CreateGlobalResourceProvider(classKey);
// Cache it
- cacheInternal.UtcInsert(cacheKey, resourceProvider);
+ cacheInternal.Insert(cacheKey, resourceProvider, null);
return resourceProvider;
}
@@ -296,9 +296,9 @@ namespace System.Web.Compilation {
internal static IResourceProvider GetLocalResourceProvider(VirtualPath virtualPath) {
// If we have it cached, return it (it may be null if there are no local resources)
- CacheInternal cacheInternal = System.Web.HttpRuntime.CacheInternal;
+ CacheStoreProvider cacheInternal = System.Web.HttpRuntime.Cache.InternalCache;
string cacheKey = CacheInternal.PrefixResourceProvider + virtualPath.VirtualPathString;
- IResourceProvider resourceProvider = cacheInternal[cacheKey] as IResourceProvider;
+ IResourceProvider resourceProvider = cacheInternal.Get(cacheKey) as IResourceProvider;
if (resourceProvider != null) {
return resourceProvider;
}
@@ -307,7 +307,7 @@ namespace System.Web.Compilation {
resourceProvider = s_resourceProviderFactory.CreateLocalResourceProvider(virtualPath.VirtualPathString);
// Cache it
- cacheInternal.UtcInsert(cacheKey, resourceProvider);
+ cacheInternal.Insert(cacheKey, resourceProvider, null);
return resourceProvider;
}
diff --git a/mcs/class/referencesource/System.Web/Configuration/CacheSection.cs b/mcs/class/referencesource/System.Web/Configuration/CacheSection.cs
index b422d405bb1..5a3261ddf46 100644
--- a/mcs/class/referencesource/System.Web/Configuration/CacheSection.cs
+++ b/mcs/class/referencesource/System.Web/Configuration/CacheSection.cs
@@ -19,14 +19,20 @@ namespace System.Web.Configuration {
/*
<!--
cache Attributes:
+ defaultProvider="name" - a name matching a provider in the provider list to use for Object and Internal cache.
cacheAPIEnabled="[true|false]" - Enable or disable the user Cache API
disableMemoryCollection="[true|false]" - Enable or disable the cache memory collection
disableExpiration="[true|false]" - Enable or disable the expiration of items from the cache
privateBytesLimit="number" - Represents maximum private bytes (in bytes) allowed. If it's zero, Cache will use an auto-generated limit. Cache will collect memory when the private bytes is near the limit. This works on top of other memory indexes monitored by Cache.
percentagePhysicalMemoryUsedLimit="number" - Represents percentage of physical memory process allowed. Cache will collect memory when the private bytes is near the limit. This works on top of other memory indexes monitored by Cache.
privateBytesPollTime="timespan" - How often we poll the process memory by calling NtQuerySystemInformation. Default is 2 min.
+
-->
- <cache cacheAPIEnabled="true" />
+ <cache cacheAPIEnabled="true" defaultProvider="name" >
+ <providers>
+ <add name="string" type="string" ... />
+ </providers>
+ </cache>
*/
public sealed class CacheSection : ConfigurationSection {
@@ -44,6 +50,9 @@ namespace System.Web.Configuration {
private static readonly ConfigurationProperty _propPercentagePhysicalMemoryUsedLimit;
private static readonly ConfigurationProperty _propPrivateBytesPollTime;
+ private static readonly ConfigurationProperty _propProviders;
+ private static readonly ConfigurationProperty _propDefaultProvider;
+
static CacheSection() {
// Property initialization
@@ -51,6 +60,14 @@ namespace System.Web.Configuration {
_propCacheAPIEnabled = new ConfigurationProperty("cacheAPIEnabled", typeof(bool), true, ConfigurationPropertyOptions.None);
_propDisableDependencies = new ConfigurationProperty("disableDependencies", typeof(bool), false, ConfigurationPropertyOptions.None);
#endif
+ _propProviders = new ConfigurationProperty("providers", typeof(ProviderSettingsCollection), null, ConfigurationPropertyOptions.None);
+ _propDefaultProvider =
+ new ConfigurationProperty("defaultProvider",
+ typeof(string),
+ null,
+ null,
+ StdValidatorsAndConverters.NonEmptyStringValidator,
+ ConfigurationPropertyOptions.None);
_propDisableMemoryCollection =
new ConfigurationProperty("disableMemoryCollection",
@@ -91,6 +108,8 @@ namespace System.Web.Configuration {
_properties.Add(_propDisableDependencies);
#endif
+ _properties.Add(_propProviders);
+ _properties.Add(_propDefaultProvider);
_properties.Add(_propDisableMemoryCollection);
_properties.Add(_propDisableExpiration);
_properties.Add(_propPrivateBytesLimit);
@@ -101,6 +120,24 @@ namespace System.Web.Configuration {
public CacheSection() {
}
+ [ConfigurationProperty("providers")]
+ public ProviderSettingsCollection Providers {
+ get {
+ return (ProviderSettingsCollection)base[_propProviders];
+ }
+ }
+
+ [ConfigurationProperty("defaultProvider", DefaultValue = null)]
+ [StringValidator(MinLength = 1)]
+ public string DefaultProvider {
+ get {
+ return (string)base[_propDefaultProvider];
+ }
+ set {
+ base[_propDefaultProvider] = value;
+ }
+ }
+
#if NOT_UNTIL_LATER
[ConfigurationProperty("cacheAPIEnabled", DefaultValue = true)]
public bool CacheAPIEnabled
diff --git a/mcs/class/referencesource/System.Web/Configuration/HandlerFactoryCache.cs b/mcs/class/referencesource/System.Web/Configuration/HandlerFactoryCache.cs
index b6fe76106fe..c4a5de247b9 100644
--- a/mcs/class/referencesource/System.Web/Configuration/HandlerFactoryCache.cs
+++ b/mcs/class/referencesource/System.Web/Configuration/HandlerFactoryCache.cs
@@ -15,6 +15,7 @@ namespace System.Web.Configuration {
using System.Web.Compilation;
using System.Security;
using System.Security.Permissions;
+ using System.Web;
/*
* An object to cache a factory
@@ -37,6 +38,7 @@ namespace System.Web.Configuration {
else {
throw new HttpException(SR.GetString(SR.Type_not_factory_or_handler, instance.GetType().FullName));
}
+ TelemetryLogger.LogHttpHandler(instance.GetType());
}
internal HandlerFactoryCache(HttpHandlerAction mapping) {
@@ -54,6 +56,7 @@ namespace System.Web.Configuration {
else {
throw new HttpException(SR.GetString(SR.Type_not_factory_or_handler, instance.GetType().FullName));
}
+ TelemetryLogger.LogHttpHandler(instance.GetType());
}
internal IHttpHandlerFactory Factory {
diff --git a/mcs/class/referencesource/System.Web/Configuration/HttpCapabilitiesEvaluator.cs b/mcs/class/referencesource/System.Web/Configuration/HttpCapabilitiesEvaluator.cs
index 16584711d1d..30e5d5999b9 100644
--- a/mcs/class/referencesource/System.Web/Configuration/HttpCapabilitiesEvaluator.cs
+++ b/mcs/class/referencesource/System.Web/Configuration/HttpCapabilitiesEvaluator.cs
@@ -211,7 +211,7 @@ namespace System.Web.Configuration {
private void CacheBrowserCapResult(ref HttpCapabilitiesBase result) {
// Use the previously cached browserCap object if an identical
// browserCap is found.
- CacheInternal cacheInternal = System.Web.HttpRuntime.CacheInternal;
+ CacheStoreProvider cacheInternal = System.Web.HttpRuntime.Cache.InternalCache;
if (result.Capabilities == null) {
return;
@@ -241,7 +241,7 @@ namespace System.Web.Configuration {
}
else {
// cache it and respect cachetime
- cacheInternal.UtcInsert(hashKey, result, null, Cache.NoAbsoluteExpiration, _cachetime);
+ cacheInternal.Insert(hashKey, result, new CacheInsertOptions() { SlidingExpiration = _cachetime });
}
}
@@ -255,7 +255,7 @@ namespace System.Web.Configuration {
internal HttpCapabilitiesBase Evaluate(HttpRequest request) {
HttpCapabilitiesBase result;
- CacheInternal cacheInternal = System.Web.HttpRuntime.CacheInternal;
+ CacheStoreProvider cacheInternal = System.Web.HttpRuntime.Cache.InternalCache;
//
// 1) grab UA and do optimistic cache lookup (if UA is in dependency list)
@@ -298,7 +298,7 @@ namespace System.Web.Configuration {
CacheBrowserCapResult(ref result);
// Cache the result using the optimisicCacheKey
- cacheInternal.UtcInsert(optimisticCacheKey, result, null, Cache.NoAbsoluteExpiration, _cachetime);
+ cacheInternal.Insert(optimisticCacheKey, result, new CacheInsertOptions() { SlidingExpiration = _cachetime });
return result;
}
@@ -363,9 +363,9 @@ namespace System.Web.Configuration {
CacheBrowserCapResult(ref result);
// cache it and respect _cachetime
- cacheInternal.UtcInsert(fullCacheKey, result, null, Cache.NoAbsoluteExpiration, _cachetime);
+ cacheInternal.Insert(fullCacheKey, result, new CacheInsertOptions() { SlidingExpiration = _cachetime });
if(optimisticCacheKey != null) {
- cacheInternal.UtcInsert(optimisticCacheKey, _disableOptimisticCachingSingleton, null, Cache.NoAbsoluteExpiration, _cachetime);
+ cacheInternal.Insert(optimisticCacheKey, _disableOptimisticCachingSingleton, new CacheInsertOptions() { SlidingExpiration = _cachetime });
}
return result;
diff --git a/mcs/class/referencesource/System.Web/Configuration/MetabaseServerConfig.cs b/mcs/class/referencesource/System.Web/Configuration/MetabaseServerConfig.cs
index d3727195d65..072e7c75cf8 100644
--- a/mcs/class/referencesource/System.Web/Configuration/MetabaseServerConfig.cs
+++ b/mcs/class/referencesource/System.Web/Configuration/MetabaseServerConfig.cs
@@ -226,7 +226,7 @@ namespace System.Web.Configuration {
else {
// Check if it's in the cache
String cacheKey = CacheInternal.PrefixMapPath + siteID + path.VirtualPathString;
- cacheInfo = (MapPathCacheInfo)HttpRuntime.CacheInternal.Get(cacheKey);
+ cacheInfo = (MapPathCacheInfo)HttpRuntime.Cache.InternalCache.Get(cacheKey);
// If not in cache, add it to the cache
if (cacheInfo == null) {
@@ -234,8 +234,7 @@ namespace System.Web.Configuration {
// Add to the cache.
// No need to have a lock here. UtcAdd will add the entry if it doesn't exist.
// If it does exist, the existing value will be returned (Dev10 Bug 755034).
- object existingEntry = HttpRuntime.CacheInternal.UtcAdd(
- cacheKey, cacheInfo, null, Cache.NoAbsoluteExpiration, slidingExpiration, CacheItemPriority.Default, null);
+ object existingEntry = HttpRuntime.Cache.InternalCache.Add(cacheKey, cacheInfo, new CacheInsertOptions() { SlidingExpiration = slidingExpiration });
if (existingEntry != null) {
cacheInfo = existingEntry as MapPathCacheInfo;
}
diff --git a/mcs/class/referencesource/System.Web/Configuration/ProcessHostMapPath.cs b/mcs/class/referencesource/System.Web/Configuration/ProcessHostMapPath.cs
index 39dccac1a52..c5de8cbbb46 100644
--- a/mcs/class/referencesource/System.Web/Configuration/ProcessHostMapPath.cs
+++ b/mcs/class/referencesource/System.Web/Configuration/ProcessHostMapPath.cs
@@ -224,7 +224,7 @@ namespace System.Web.Configuration {
else {
// Check if it's in the cache
String cacheKey = CacheInternal.PrefixMapPath + siteID + path.VirtualPathString;
- cacheInfo = (MapPathCacheInfo)HttpRuntime.CacheInternal.Get(cacheKey);
+ cacheInfo = (MapPathCacheInfo)HttpRuntime.Cache.InternalCache.Get(cacheKey);
// If not in cache, add it to the cache
if (cacheInfo == null) {
@@ -232,8 +232,7 @@ namespace System.Web.Configuration {
// Add to the cache.
// No need to have a lock here. UtcAdd will add the entry if it doesn't exist.
// If it does exist, the existing value will be returned (Dev10 Bug 755034).
- object existingEntry = HttpRuntime.CacheInternal.UtcAdd(
- cacheKey, cacheInfo, null, Cache.NoAbsoluteExpiration, slidingExpiration, CacheItemPriority.Default, null);
+ object existingEntry = HttpRuntime.Cache.InternalCache.Add(cacheKey, cacheInfo, new CacheInsertOptions() { SlidingExpiration = slidingExpiration });
if (existingEntry != null) {
cacheInfo = existingEntry as MapPathCacheInfo;
}
diff --git a/mcs/class/referencesource/System.Web/Configuration/ProvidersHelper.cs b/mcs/class/referencesource/System.Web/Configuration/ProvidersHelper.cs
index 6fdb01ed15c..4a1b0f4b629 100644
--- a/mcs/class/referencesource/System.Web/Configuration/ProvidersHelper.cs
+++ b/mcs/class/referencesource/System.Web/Configuration/ProvidersHelper.cs
@@ -47,11 +47,48 @@ namespace System.Web.Configuration
}
[AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Low)]
+ internal static ProviderBase InstantiateProvider(NameValueCollection providerSettings, Type providerType) {
+ ProviderBase provider = null;
+ try {
+ string pnName = GetAndRemoveStringValue(providerSettings, "name");
+ string pnType = GetAndRemoveStringValue(providerSettings, "type");
+ if (string.IsNullOrEmpty(pnType))
+ throw new ArgumentException(SR.GetString(SR.Provider_no_type_name));
+ Type t = ConfigUtil.GetType(pnType, "type", null, null, true, true);
+
+ if (!providerType.IsAssignableFrom(t))
+ throw new ArgumentException(SR.GetString(SR.Provider_must_implement_type, providerType.ToString()));
+ provider = (ProviderBase)HttpRuntime.CreatePublicInstance(t);
+
+ // Because providers modify the parameters collection (i.e. delete stuff), pass in a clone of the collection
+ NameValueCollection cloneParams = new NameValueCollection(providerSettings.Count, StringComparer.Ordinal);
+ foreach (string key in providerSettings)
+ cloneParams[key] = providerSettings[key];
+ provider.Initialize(pnName, cloneParams);
+ }
+ catch (Exception e) {
+ if (e is ConfigurationException)
+ throw;
+ throw new ConfigurationErrorsException(e.Message, e);
+ }
+
+ return provider;
+ }
+
+ [AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Low)]
public static void InstantiateProviders(ProviderSettingsCollection configProviders, ProviderCollection providers, Type providerType)
{
foreach (ProviderSettings ps in configProviders) {
providers.Add(InstantiateProvider(ps, providerType));
}
}
+
+ private static string GetAndRemoveStringValue(NameValueCollection collection, string key) {
+ string strValue = collection[key] as string;
+ if (!string.IsNullOrEmpty(strValue))
+ strValue = strValue.Trim();
+ collection.Remove(key);
+ return strValue;
+ }
}
}
diff --git a/mcs/class/referencesource/System.Web/Configuration/SessionStateSection.cs b/mcs/class/referencesource/System.Web/Configuration/SessionStateSection.cs
index c09da8b62e6..03df7959452 100644
--- a/mcs/class/referencesource/System.Web/Configuration/SessionStateSection.cs
+++ b/mcs/class/referencesource/System.Web/Configuration/SessionStateSection.cs
@@ -392,7 +392,7 @@ namespace System.Web.Configuration {
return (string)base[_propLockAttributes];
}
set {
- // base.LockedAttributes.SetFromList(value); // keep the internal list in [....]
+ // base.LockedAttributes.SetFromList(value); // keep the internal list in sync
base[_propLockAttributes] = value;
}
}
diff --git a/mcs/class/referencesource/System.Web/FileChangesMonitor.cs b/mcs/class/referencesource/System.Web/FileChangesMonitor.cs
index e4b03d4752a..f60acb0bc25 100644
--- a/mcs/class/referencesource/System.Web/FileChangesMonitor.cs
+++ b/mcs/class/referencesource/System.Web/FileChangesMonitor.cs
@@ -149,7 +149,7 @@ namespace System.Web {
}
[SuppressMessage("Microsoft.Interoperability", "CA1404:CallGetLastErrorImmediatelyAfterPInvoke",
- Justification="[....]: Call to GetLastWin32Error() does follow P/Invoke call that is outside the if/else block.")]
+ Justification="Microsoft: Call to GetLastWin32Error() does follow P/Invoke call that is outside the if/else block.")]
static internal byte[] GetDacl(string filename) {
// DevDiv #322858 - allow skipping DACL step for perf gain
if (HostingEnvironment.FcnSkipReadAndCacheDacls) {
@@ -305,7 +305,7 @@ namespace System.Web {
}
else {
#if DBG
- // Needs the lock to [....] with DebugDescription
+ // Needs the lock to sync with DebugDescription
lock (_targets) {
#endif
_targets.Add(callback.Target, new FileMonitorTarget(callback, alias));
@@ -330,7 +330,7 @@ namespace System.Web {
#endif
if (target != null && target.Release() == 0) {
#if DBG
- // Needs the lock to [....] with DebugDescription
+ // Needs the lock to sync with DebugDescription
lock (_targets) {
#endif
_targets.Remove(callbackTarget);
diff --git a/mcs/class/referencesource/System.Web/Hosting/ApplicationManager.cs b/mcs/class/referencesource/System.Web/Hosting/ApplicationManager.cs
index 9a24a5b37f2..344b260760a 100644
--- a/mcs/class/referencesource/System.Web/Hosting/ApplicationManager.cs
+++ b/mcs/class/referencesource/System.Web/Hosting/ApplicationManager.cs
@@ -9,7 +9,9 @@ namespace System.Web.Hosting {
using System;
using System.Collections;
using System.Collections.Generic;
+ using System.Collections.Specialized;
using System.Configuration;
+ using System.Configuration.Provider;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
@@ -88,9 +90,6 @@ namespace System.Web.Hosting {
// single instance of app manager
private static ApplicationManager _theAppManager;
- // single instance of cache manager
- private static CacheManager _cm;
-
// store fatal exception to assist debugging
private static Exception _fatalException = null;
@@ -105,52 +104,6 @@ namespace System.Web.Hosting {
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(OnUnhandledException);
}
- private void InitCacheManager(long privateBytesLimit) {
- if (_cm == null) {
- lock (_applicationManagerStaticLock) {
- if (_cm == null && !_shutdownInProgress) {
- _cm = new CacheManager(this, privateBytesLimit);
- }
- }
- }
- }
-
- private void DisposeCacheManager() {
- if (_cm != null) {
- lock (_applicationManagerStaticLock) {
- if (_cm != null) {
- _cm.Dispose();
- _cm = null;
- }
- }
- }
- }
-
- // Each cache must update the total with the difference between it's current size and it's previous size.
- // To reduce cross-domain costs, this also returns the updated total size.
- internal long GetUpdatedTotalCacheSize(long sizeUpdate) {
- CacheManager cm = _cm;
- return (cm != null) ? cm.GetUpdatedTotalCacheSize(sizeUpdate) : 0;
- }
-
- internal long TrimCaches(int percent) {
- long trimmedOrExpired = 0;
- Dictionary<string, LockableAppDomainContext> apps = CloneAppDomainsCollection();
- foreach (LockableAppDomainContext ac in apps.Values) {
- lock (ac) {
- HostingEnvironment env = ac.HostEnv;
- if (_shutdownInProgress) {
- break;
- }
- if (env == null) {
- continue;
- }
- trimmedOrExpired += env.TrimCache(percent);
- }
- }
- return trimmedOrExpired;
- }
-
internal bool ShutdownInProgress {
get {
return _shutdownInProgress;
@@ -468,6 +421,10 @@ namespace System.Web.Hosting {
return GetAppDomain(appID);
}
+ internal AppDomain GetDefaultAppDomain() {
+ return AppDomain.CurrentDomain;
+ }
+
[SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "This isn't a dangerous method.")]
private string CreateSimpleAppID(IApplicationHost appHost) {
if (appHost == null) {
@@ -565,8 +522,6 @@ namespace System.Web.Hosting {
_shutdownInProgress = true;
Dictionary <string, LockableAppDomainContext> oldTable = null;
- DisposeCacheManager();
-
lock (this) {
oldTable = _appDomains;
// don't keep references to hosting environments anymore
@@ -769,13 +724,8 @@ namespace System.Web.Hosting {
// communication with hosting environments
//
- internal void HostingEnvironmentActivated(long privateBytesLimit) {
+ internal void HostingEnvironmentActivated() {
int count = Interlocked.Increment(ref _activeHostingEnvCount);
-
- // initialize CacheManager once, without blocking
- if (count == 1) {
- InitCacheManager(privateBytesLimit);
- }
}
internal void HostingEnvironmentShutdownComplete(String appId, IApplicationHost appHost) {
@@ -1021,7 +971,7 @@ namespace System.Web.Hosting {
//Hosted by IIS, we already have an IISMap.
if (appHost is ISAPIApplicationHost) {
string cacheKey = System.Web.Caching.CacheInternal.PrefixMapPath + siteID + virtualPath.VirtualPathString;
- MapPathCacheInfo cacheInfo = (MapPathCacheInfo)HttpRuntime.CacheInternal.Remove(cacheKey);
+ MapPathCacheInfo cacheInfo = (MapPathCacheInfo)HttpRuntime.Cache.InternalCache.Remove(cacheKey);
appConfig = WebConfigurationManager.OpenWebConfiguration(appSegment, siteID);
}
// For non-IIS hosting scenarios, we need to get config map from application host in a generic way.
@@ -1117,6 +1067,25 @@ namespace System.Web.Hosting {
}
}
+ // Allow apps to use their own CacheStoreProvider implementations
+ CacheSection cacheConfig = (CacheSection)appConfig.GetSection("system.web/caching/cache");
+ if (cacheConfig != null && cacheConfig.DefaultProvider != null && !String.IsNullOrWhiteSpace(cacheConfig.DefaultProvider)) {
+ ProviderSettingsCollection cacheProviders = cacheConfig.Providers;
+ if (cacheProviders == null || cacheProviders.Count < 1) {
+ throw new ProviderException(SR.GetString(SR.Def_provider_not_found));
+ }
+
+ ProviderSettings cacheProviderSettings = cacheProviders[cacheConfig.DefaultProvider];
+ if (cacheProviderSettings == null) {
+ throw new ProviderException(SR.GetString(SR.Def_provider_not_found));
+ } else {
+ NameValueCollection settings = cacheProviderSettings.Parameters;
+ settings["name"] = cacheProviderSettings.Name;
+ settings["type"] = cacheProviderSettings.Type;
+ appDomainAdditionalData[".defaultObjectCacheProvider"] = settings;
+ }
+ }
+
// If we were launched from a development environment, we might want to enable the application to do things
// it otherwise wouldn't normally allow, such as enabling an administrative control panel. For security reasons,
// we only do this check if <deployment retail="false" /> [the default value] is specified, since the
diff --git a/mcs/class/referencesource/System.Web/Hosting/HostingEnvironment.cs b/mcs/class/referencesource/System.Web/Hosting/HostingEnvironment.cs
index 27ce613025e..8e2e7658edf 100644
--- a/mcs/class/referencesource/System.Web/Hosting/HostingEnvironment.cs
+++ b/mcs/class/referencesource/System.Web/Hosting/HostingEnvironment.cs
@@ -7,7 +7,10 @@
namespace System.Web.Hosting {
using System;
using System.Collections;
+ using System.Collections.Generic;
+ using System.Collections.Specialized;
using System.Configuration;
+ using System.Configuration.Provider;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
@@ -31,7 +34,6 @@ namespace System.Web.Hosting {
using System.Web.Util;
using System.Web.WebSockets;
using Microsoft.Win32;
- using System.Collections.Generic;
[Flags]
internal enum HostingEnvironmentFlags {
@@ -126,6 +128,7 @@ namespace System.Web.Hosting {
private bool _shutdownInProgress;
private String _shutDownStack;
+ private static NameValueCollection _cacheProviderSettings;
private int _inTrimCache;
private ObjectCacheHost _objectCacheHost;
@@ -135,6 +138,7 @@ namespace System.Web.Hosting {
// list of registered IRegisteredObject instances, suspend listeners, and background work items
private Hashtable _registeredObjects = new Hashtable();
private SuspendManager _suspendManager = new SuspendManager();
+ private ApplicationMonitors _applicationMonitors;
private BackgroundWorkScheduler _backgroundWorkScheduler = null; // created on demand
private static readonly Task<object> _completedTask = Task.FromResult<object>(null);
@@ -191,14 +195,29 @@ namespace System.Web.Hosting {
Thread.GetDomain().UnhandledException += new UnhandledExceptionEventHandler(ApplicationManager.OnUnhandledException);
}
- internal long TrimCache(int percent) {
+ internal static long TrimCache(int percent)
+ {
+ if (_theHostingEnvironment != null)
+ return _theHostingEnvironment.TrimCacheInternal(percent);
+ return 0;
+ }
+
+ private long TrimCacheInternal(int percent)
+ {
if (Interlocked.Exchange(ref _inTrimCache, 1) != 0)
return 0;
try {
long trimmedOrExpired = 0;
// do nothing if we're shutting down
if (!_shutdownInitiated) {
- trimmedOrExpired = HttpRuntime.CacheInternal.TrimCache(percent);
+ var iCache = HttpRuntime.Cache.GetInternalCache(createIfDoesNotExist: false);
+ var oCache = HttpRuntime.Cache.GetObjectCache(createIfDoesNotExist: false);
+ if (oCache != null) {
+ trimmedOrExpired = oCache.Trim(percent);
+ }
+ if (iCache != null && !iCache.Equals(oCache)) {
+ trimmedOrExpired += iCache.Trim(percent);
+ }
if (_objectCacheHost != null && !_shutdownInitiated) {
trimmedOrExpired += _objectCacheHost.TrimCache(percent);
}
@@ -330,7 +349,7 @@ namespace System.Web.Hosting {
// notify app manager
if (_appManager != null) {
- _appManager.HostingEnvironmentActivated(CacheMemorySizePressure.EffectiveProcessMemoryLimit);
+ _appManager.HostingEnvironmentActivated();
}
// make sure there is always app host
@@ -364,6 +383,8 @@ namespace System.Web.Hosting {
// get application identity (for explicit impersonation mode)
GetApplicationIdentity();
+ _applicationMonitors = new ApplicationMonitors();
+
// call AppInitialize, unless the flag says not to do it (e.g. CBM scenario).
// Also, don't call it if HostingInit failed (VSWhidbey 210495)
if(!HttpRuntime.HostingInitFailed) {
@@ -1260,6 +1281,19 @@ namespace System.Web.Hosting {
}
}
+ /// <devdoc>
+ /// <para>A group of repleacable monitor objects used by ASP.Net subsystems to maintain
+ /// application health.</para>
+ /// </devdoc>
+ public static ApplicationMonitors ApplicationMonitors {
+ get {
+ if (_theHostingEnvironment == null)
+ return null;
+
+ return _theHostingEnvironment._applicationMonitors;
+ }
+ }
+
internal static int BusyCount {
get {
if (_theHostingEnvironment == null)
@@ -1414,6 +1448,42 @@ namespace System.Web.Hosting {
get { return HttpRuntime.Cache; }
}
+ internal static NameValueCollection CacheStoreProviderSettings {
+ get {
+ if (_cacheProviderSettings == null) {
+ if (AppDomain.CurrentDomain.IsDefaultAppDomain()) {
+ Configuration webConfig = WebConfigurationManager.OpenWebConfiguration(null /* root web.config */);
+ CacheSection cacheConfig = (CacheSection)webConfig.GetSection("system.web/caching/cache");
+ if (cacheConfig != null && cacheConfig.DefaultProvider != null && !String.IsNullOrWhiteSpace(cacheConfig.DefaultProvider)) {
+ ProviderSettingsCollection cacheProviders = cacheConfig.Providers;
+ if (cacheProviders == null || cacheProviders.Count < 1) {
+ throw new ProviderException(SR.GetString(SR.Def_provider_not_found));
+ }
+
+ ProviderSettings cacheProviderSettings = cacheProviders[cacheConfig.DefaultProvider];
+ if (cacheProviderSettings == null) {
+ throw new ProviderException(SR.GetString(SR.Def_provider_not_found));
+ }
+
+ NameValueCollection settings = cacheProviderSettings.Parameters;
+ settings["name"] = cacheProviderSettings.Name;
+ settings["type"] = cacheProviderSettings.Type;
+ _cacheProviderSettings = settings;
+ }
+ }
+ else {
+ _cacheProviderSettings = AppDomain.CurrentDomain.GetData(".defaultObjectCacheProvider") as NameValueCollection;
+ }
+ }
+
+ // Return a copy, so the consumer can't mess with our copy of the settings
+ if (_cacheProviderSettings != null)
+ return new NameValueCollection(_cacheProviderSettings);
+
+ return null;
+ }
+ }
+
// count of all app domain from app manager
internal static int AppDomainsCount {
get {
diff --git a/mcs/class/referencesource/System.Web/Hosting/IIS7WorkerRequest.cs b/mcs/class/referencesource/System.Web/Hosting/IIS7WorkerRequest.cs
index 11db9517311..4db80847238 100644
--- a/mcs/class/referencesource/System.Web/Hosting/IIS7WorkerRequest.cs
+++ b/mcs/class/referencesource/System.Web/Hosting/IIS7WorkerRequest.cs
@@ -1380,7 +1380,7 @@ namespace System.Web.Hosting {
}
// send to unmanaged code
- // sends are always [....] now since they're buffered by IIS
+ // sends are always sync now since they're buffered by IIS
FlushCore(true,
numFragments,
fragments,
diff --git a/mcs/class/referencesource/System.Web/Hosting/ISAPIWorkerRequest.cs b/mcs/class/referencesource/System.Web/Hosting/ISAPIWorkerRequest.cs
index ce3d178ea98..c89ea82f2a0 100644
--- a/mcs/class/referencesource/System.Web/Hosting/ISAPIWorkerRequest.cs
+++ b/mcs/class/referencesource/System.Web/Hosting/ISAPIWorkerRequest.cs
@@ -1649,7 +1649,7 @@ internal class ISAPIWorkerRequestInProc : ISAPIWorkerRequest {
protected const int NUM_BASIC_SERVER_VARIABLES = 12; // needed on every request
protected const int NUM_ADDITIONAL_SERVER_VARIABLES = 23; // needed when HttpRequest.ServerVariables is populated
- // These constants must be kept in [....] with g_szServerVariables and g_szUnicodeServerVariables in ecbdirect.cxx
+ // These constants must be kept in sync with g_szServerVariables and g_szUnicodeServerVariables in ecbdirect.cxx
protected const int LOGON_USER = 0;
protected const int AUTH_TYPE = 1;
@@ -2407,7 +2407,7 @@ internal class ISAPIWorkerRequestInProcForIIS6 : ISAPIWorkerRequestInProc {
CallEndOfRequestCallbackOnceAfterAllIoComplete();
}
else if (rc != 0 && async) {
- // on async failure default to [....] path
+ // on async failure default to sync path
async = false;
if (!inAsyncFlush) {
diff --git a/mcs/class/referencesource/System.Web/Hosting/MapPathBasedVirtualPathProvider.cs b/mcs/class/referencesource/System.Web/Hosting/MapPathBasedVirtualPathProvider.cs
index d05bc42b607..4cc2b6b75ea 100644
--- a/mcs/class/referencesource/System.Web/Hosting/MapPathBasedVirtualPathProvider.cs
+++ b/mcs/class/referencesource/System.Web/Hosting/MapPathBasedVirtualPathProvider.cs
@@ -86,7 +86,7 @@ internal class MapPathBasedVirtualPathProvider: VirtualPathProvider {
// * null means it's not cached
// * true means it's cached and it exists
// * false means it's cached and it doesn't exist
- bool? cacheValue = HttpRuntime.CacheInternal[cacheKey] as bool?;
+ bool? cacheValue = HttpRuntime.Cache.InternalCache.Get(cacheKey) as bool?;
if (cacheValue != null) {
return cacheValue.Value;
}
@@ -108,7 +108,7 @@ internal class MapPathBasedVirtualPathProvider: VirtualPathProvider {
if (existingDir != null) {
dep = new CacheDependency(existingDir);
TimeSpan slidingExp = CachedPathData.UrlMetadataSlidingExpiration;
- HttpRuntime.CacheInternal.UtcInsert(cacheKey, exists, dep, Cache.NoAbsoluteExpiration, slidingExp);
+ HttpRuntime.Cache.InternalCache.Insert(cacheKey, exists, new CacheInsertOptions() { Dependencies = dep, SlidingExpiration = slidingExp });
}
return exists;
diff --git a/mcs/class/referencesource/System.Web/Hosting/ObjectCacheHost.cs b/mcs/class/referencesource/System.Web/Hosting/ObjectCacheHost.cs
index de6fb15cfa1..bb2dfdd1f7e 100644
--- a/mcs/class/referencesource/System.Web/Hosting/ObjectCacheHost.cs
+++ b/mcs/class/referencesource/System.Web/Hosting/ObjectCacheHost.cs
@@ -91,31 +91,20 @@ namespace System.Web.Hosting {
if (memoryCache == null) {
throw new ArgumentNullException("memoryCache");
}
- long delta = 0;
lock (_lock) {
if (_cacheInfos != null) {
MemoryCacheInfo info = null;
if (_cacheInfos.TryGetValue(memoryCache, out info)) {
- delta = 0 - info.Size;
_cacheInfos.Remove(memoryCache);
}
}
}
- if (delta != 0) {
- ApplicationManager appManager = HostingEnvironment.GetApplicationManager();
- if (appManager != null) {
- ExecutionContextUtil.RunInNullExecutionContext(delegate {
- appManager.GetUpdatedTotalCacheSize(delta);
- });
- }
- }
}
void IMemoryCacheManager.UpdateCacheSize(long size, MemoryCache memoryCache) {
if (memoryCache == null) {
throw new ArgumentNullException("memoryCache");
}
- long delta = 0;
lock (_lock) {
if (_cacheInfos == null) {
_cacheInfos = new Dictionary<MemoryCache, MemoryCacheInfo>();
@@ -126,15 +115,8 @@ namespace System.Web.Hosting {
info.Cache = memoryCache;
_cacheInfos[memoryCache] = info;
}
- delta = size - info.Size;
info.Size = size;
}
- ApplicationManager appManager = HostingEnvironment.GetApplicationManager();
- if (appManager != null) {
- ExecutionContextUtil.RunInNullExecutionContext(delegate {
- appManager.GetUpdatedTotalCacheSize(delta);
- });
- }
}
internal long TrimCache(int percent) {
diff --git a/mcs/class/referencesource/System.Web/Hosting/SuspendManager.cs b/mcs/class/referencesource/System.Web/Hosting/SuspendManager.cs
index 392ff89edd6..a39a682a487 100644
--- a/mcs/class/referencesource/System.Web/Hosting/SuspendManager.cs
+++ b/mcs/class/referencesource/System.Web/Hosting/SuspendManager.cs
@@ -78,9 +78,13 @@ namespace System.Web.Hosting {
HttpWriter.ReleaseAllPooledBuffers();
// Trim expired entries from the runtime cache
- var cache = HttpRuntime.GetCacheInternal(createIfDoesNotExist: false);
- if (cache != null) {
- cache.TrimCache(0);
+ var iCache = HttpRuntime.Cache.GetInternalCache(createIfDoesNotExist: false);
+ var oCache = HttpRuntime.Cache.GetObjectCache(createIfDoesNotExist: false);
+ if (iCache != null) {
+ iCache.Trim(0);
+ }
+ if (oCache != null && !oCache.Equals(iCache)) {
+ oCache.Trim(0);
}
// Trim all pooled HttpApplication instances
diff --git a/mcs/class/referencesource/System.Web/HttpApplication.cs b/mcs/class/referencesource/System.Web/HttpApplication.cs
index 41564928cce..1ec9a1266c7 100644
--- a/mcs/class/referencesource/System.Web/HttpApplication.cs
+++ b/mcs/class/referencesource/System.Web/HttpApplication.cs
@@ -789,7 +789,7 @@ namespace System.Web {
}
//
- // [....] event hookup
+ // Sync event hookup
//
@@ -1727,7 +1727,7 @@ namespace System.Web {
asyncHandler.CreateExecutionSteps(this, steps);
}
- // [....]
+ // sync
EventHandler handler = (EventHandler)Events[eventIndex];
if (handler != null) {
@@ -2418,7 +2418,7 @@ namespace System.Web {
Debug.Trace("PipelineRuntime", "RegisterEventSubscriptionsWithIIS: name=" + CurrentModuleCollectionKey
+ ", type=" + httpModule.GetType().FullName + "\n");
- // make sure collections are in [....]
+ // make sure collections are in sync
Debug.Assert(moduleInfo.Name == _currentModuleCollectionKey, "moduleInfo.Name == _currentModuleCollectionKey");
#endif
@@ -2566,7 +2566,7 @@ namespace System.Web {
hasEvents = true;
}
- // [....]
+ // sync
EventHandler handler = (EventHandler)Events[eventIndex];
if (handler != null) {
@@ -4107,7 +4107,7 @@ namespace System.Web {
break;
}
- // [....] case (we might be able to stay in managed code and execute another notification)
+ // sync case (we might be able to stay in managed code and execute another notification)
if (needToFinishRequest || UnsafeIISMethods.MgdGetNextNotification(wr.RequestContext, RequestNotificationStatus.Continue) != 1) {
isSynchronousCompletion = true;
needToComplete = true;
@@ -4171,14 +4171,14 @@ namespace System.Web {
if (threadContext != null) {
if (context.InIndicateCompletion) {
if (isSynchronousCompletion) {
- // this is a [....] completion on an IIS thread
+ // this is a sync completion on an IIS thread
threadContext.Synchronize();
// Note for DevDiv 482614 fix:
// If this threadContext is from IndicateCompletionContext (e.g. this thread called IndicateCompletion)
// then we continue reusing this thread and only undo impersonation before unwinding back to IIS.
//
// If this threadContext was created while another thread was and still is in IndicateCompletion call
- // (e.g. [....] or async flush on a background thread from native code, not managed since isReEnty==false)
+ // (e.g. sync or async flush on a background thread from native code, not managed since isReEnty==false)
// then we can not reuse this thread and this threadContext will be cleaned before we leave ResumeSteps
// (because needToDisassociateThreadContext was set to true when we created this threadContext)
@@ -4210,7 +4210,7 @@ namespace System.Web {
}
else if (isSynchronousCompletion) {
Debug.Assert(needToDisassociateThreadContext == true, "needToDisassociateThreadContext MUST BE true");
- // this is a [....] completion on an IIS thread
+ // this is a sync completion on an IIS thread
threadContext.Synchronize();
// get ready to call IndicateCompletion
context.IndicateCompletionContext = threadContext;
diff --git a/mcs/class/referencesource/System.Web/HttpBufferlessInputStream.cs b/mcs/class/referencesource/System.Web/HttpBufferlessInputStream.cs
index ea274006e94..dc3174c8fa8 100644
--- a/mcs/class/referencesource/System.Web/HttpBufferlessInputStream.cs
+++ b/mcs/class/referencesource/System.Web/HttpBufferlessInputStream.cs
@@ -164,7 +164,7 @@ namespace System.Web {
}
}
else {
- // perform a [....] read
+ // perform a sync read
return base.BeginRead(buffer, offset, count, callback, state);
}
}
diff --git a/mcs/class/referencesource/System.Web/HttpCachePolicy.cs b/mcs/class/referencesource/System.Web/HttpCachePolicy.cs
index 0e5efebd84f..abb20f8eb13 100644
--- a/mcs/class/referencesource/System.Web/HttpCachePolicy.cs
+++ b/mcs/class/referencesource/System.Web/HttpCachePolicy.cs
@@ -573,7 +573,9 @@ namespace System.Web {
int i, n;
string[] fields;
-
+
+ _utcTimestampRequest = utcTimestampRequest;
+
_varyByContentEncodings.SetContentEncodings(settings.VaryByContentEncodings);
_varyByHeaders.SetHeaders(settings.VaryByHeaders);
_varyByParams.SetParams(settings.VaryByParams);
@@ -1155,7 +1157,7 @@ namespace System.Web {
internal bool IsKernelCacheable(HttpRequest request, bool enableKernelCacheForVaryByStar) {
return _cacheability == HttpCacheability.Public
- && !_hasUserProvidedDependencies // Consider ([....]): rework dependency model to support user-provided dependencies
+ && !_hasUserProvidedDependencies // Consider (Microsoft): rework dependency model to support user-provided dependencies
&& !_hasSetCookieHeader
&& !_noServerCaching
&& HasExpirationPolicy()
diff --git a/mcs/class/referencesource/System.Web/HttpContext.cs b/mcs/class/referencesource/System.Web/HttpContext.cs
index 812c779064e..d8cc4fe8eb2 100644
--- a/mcs/class/referencesource/System.Web/HttpContext.cs
+++ b/mcs/class/referencesource/System.Web/HttpContext.cs
@@ -731,7 +731,7 @@ namespace System.Web {
// which doesn't fit our expected patterns and where that code likely has negative side effects.
//
// This flag is respected only by AspNetSynchronizationContext; it has no effect when the
- // legacy [....] context is in use.
+ // legacy sync context is in use.
[EditorBrowsable(EditorBrowsableState.Advanced)]
public bool AllowAsyncDuringSyncStages {
get {
@@ -1328,7 +1328,7 @@ namespace System.Web {
return _rootedObjects;
}
set {
- // [....] the Principal between the containers
+ // Sync the Principal between the containers
SwitchPrincipalContainer(value);
_rootedObjects = value;
}
diff --git a/mcs/class/referencesource/System.Web/HttpCookie.cs b/mcs/class/referencesource/System.Web/HttpCookie.cs
index 4d4fdf4678b..c5f127e60d6 100644
--- a/mcs/class/referencesource/System.Web/HttpCookie.cs
+++ b/mcs/class/referencesource/System.Web/HttpCookie.cs
@@ -106,7 +106,7 @@ namespace System.Web {
// DevID 251951 Cookie is getting duplicated by ASP.NET when they are added via a native module
// This flag is used to remember that this cookie came from an IIS Set-Header flag,
// so we don't duplicate it and send it back to IIS
- internal bool FromHeader {
+ internal bool IsInResponseHeader {
get;
set;
}
diff --git a/mcs/class/referencesource/System.Web/HttpCookieCollection.cs b/mcs/class/referencesource/System.Web/HttpCookieCollection.cs
index 8858577a9a7..7f1703173b3 100644
--- a/mcs/class/referencesource/System.Web/HttpCookieCollection.cs
+++ b/mcs/class/referencesource/System.Web/HttpCookieCollection.cs
@@ -53,7 +53,7 @@ namespace System.Web {
}
// This copy constructor is used by the granular request validation feature. The collections are mutable once
- // created, but nobody should ever be mutating them, so it's ok for these to be out of [....]. Additionally,
+ // created, but nobody should ever be mutating them, so it's ok for these to be out of sync. Additionally,
// we don't copy _response since this should only ever be called for the request cookies.
internal HttpCookieCollection(HttpCookieCollection col)
: base(StringComparer.OrdinalIgnoreCase) {
@@ -84,7 +84,7 @@ namespace System.Web {
if (append) {
// DevID 251951 Cookie is getting duplicated by ASP.NET when they are added via a native module
// Need to not double add response cookies from native modules
- if (!cookie.FromHeader) {
+ if (!cookie.IsInResponseHeader) {
// mark cookie as new
cookie.Added = true;
}
@@ -99,6 +99,17 @@ namespace System.Web {
}
}
+ // VSO bug #289778: when copying cookie from Response to Request, there is side effect
+ // which changes Added property and causes dup cookie in response header
+ // This method is meant to append cookie from one collection without changing cookie object
+ internal void Append(HttpCookieCollection cookies) {
+ for (int i = 0; i < cookies.Count; ++i) {
+ //BaseGet method doesn't trigger validation, while Get method does
+ HttpCookie cookie = (HttpCookie) cookies.BaseGet(i);
+ BaseAdd(cookie.Name, cookie);
+ }
+ }
+
// MSRC 12038: limit the maximum number of items that can be added to the collection,
// as a large number of items potentially can result in too many hash collisions that may cause DoS
private void ThrowIfMaxHttpCollectionKeysExceeded() {
diff --git a/mcs/class/referencesource/System.Web/HttpRequest.cs b/mcs/class/referencesource/System.Web/HttpRequest.cs
index 9ad5bc288ab..16163c205a9 100644
--- a/mcs/class/referencesource/System.Web/HttpRequest.cs
+++ b/mcs/class/referencesource/System.Web/HttpRequest.cs
@@ -769,11 +769,8 @@ namespace System.Web {
storedResponseCookies = Response.GetCookiesNoCreate();
}
- if (storedResponseCookies != null && storedResponseCookies.Count > 0) {
- HttpCookie[] responseCookieArray = new HttpCookie[storedResponseCookies.Count];
- storedResponseCookies.CopyTo(responseCookieArray, 0);
- for (int iCookie = 0; iCookie < responseCookieArray.Length; iCookie++)
- cookieCollection.AddCookie(responseCookieArray[iCookie], append: true);
+ if (storedResponseCookies != null) {
+ cookieCollection.Append(storedResponseCookies);
}
// release any stored reference to the response cookie collection
diff --git a/mcs/class/referencesource/System.Web/HttpResponse.cs b/mcs/class/referencesource/System.Web/HttpResponse.cs
index db4f721437c..b18ee02480d 100644
--- a/mcs/class/referencesource/System.Web/HttpResponse.cs
+++ b/mcs/class/referencesource/System.Web/HttpResponse.cs
@@ -279,9 +279,12 @@ namespace System.Web {
{
cookie = _cookies[c];
if (cookie.Added) {
- // if a cookie was added, we generate a Set-Cookie header for it
- cookieHeader = cookie.GetSetCookieHeader(_context);
- headers.SetHeader(cookieHeader.Name, cookieHeader.Value, false);
+ if (!cookie.IsInResponseHeader) {
+ // if a cookie was added, we generate a Set-Cookie header for it
+ cookieHeader = cookie.GetSetCookieHeader(_context);
+ headers.SetHeader(cookieHeader.Name, cookieHeader.Value, false);
+ cookie.IsInResponseHeader = true;
+ }
cookie.Added = false;
cookie.Changed = false;
}
@@ -308,6 +311,7 @@ namespace System.Web {
cookie = _cookies[c];
cookieHeader = cookie.GetSetCookieHeader(_context);
headers.SetHeader(cookieHeader.Name, cookieHeader.Value, false);
+ cookie.IsInResponseHeader = true;
cookie.Added = false;
cookie.Changed = false;
}
@@ -726,7 +730,7 @@ namespace System.Web {
return _wr.BeginFlush(callback, state);
}
- // perform a [....] flush since async is not supported
+ // perform a sync flush since async is not supported
FlushAsyncResult ar = new FlushAsyncResult(callback, state);
try {
Flush(false);
@@ -752,7 +756,7 @@ namespace System.Web {
return;
}
- // finish [....] flush since async is not supported
+ // finish sync flush since async is not supported
if (asyncResult == null)
throw new ArgumentNullException("asyncResult");
FlushAsyncResult ar = asyncResult as FlushAsyncResult;
@@ -1446,7 +1450,7 @@ namespace System.Web {
if (value != null) {
HttpCookie cookie = HttpRequest.CreateCookieFromString(value);
// do not write this cookie back to IIS
- cookie.FromHeader = true;
+ cookie.IsInResponseHeader = true;
Cookies.Set(cookie);
cookie.Changed = false;
cookie.Added = false;
diff --git a/mcs/class/referencesource/System.Web/HttpRuntime.cs b/mcs/class/referencesource/System.Web/HttpRuntime.cs
index 23b97ec0eef..8ea72359087 100644
--- a/mcs/class/referencesource/System.Web/HttpRuntime.cs
+++ b/mcs/class/referencesource/System.Web/HttpRuntime.cs
@@ -185,7 +185,6 @@ namespace System.Web {
private PolicyLevel _policyLevel;
private string _hostSecurityPolicyResolverType = null;
private FileChangesMonitor _fcm;
- private CacheInternal _cacheInternal;
private Cache _cachePublic;
private bool _isOnUNCShare;
private Profiler _profiler;
@@ -444,7 +443,6 @@ namespace System.Web {
// Note that we must do this after we start monitoring directory renames,
// as reading config will cause file monitoring on the application directory
// to occur.
- HttpRuntime.CacheInternal.ReadCacheInternalConfig(cacheSection);
// Set up the codegen directory for the app. This needs to be done before we process
// the policy file, because it needs to replace the $CodeGen$ token.
@@ -1744,7 +1742,7 @@ namespace System.Web {
}
/*
- * Finish processing request, [....] or async
+ * Finish processing request, sync or async
*/
private void FinishRequest(HttpWorkerRequest wr, HttpContext context, Exception e) {
HttpResponse response = context.Response;
@@ -2017,8 +2015,16 @@ namespace System.Web {
SqlCacheDependencyManager.Dispose((drainTimeoutSec * 1000) / 2);
#endif // !FEATURE_PAL
// cleanup cache (this ends all sessions)
- if (_cacheInternal != null) {
- _cacheInternal.Dispose();
+ HealthMonitoringManager.IsCacheDisposed = true; // HMM is the only place internally where we care if the Cache is disposed or not.
+ if (_cachePublic != null) {
+ var oCache = HttpRuntime.Cache.GetObjectCache(createIfDoesNotExist: false);
+ var iCache = HttpRuntime.Cache.GetInternalCache(createIfDoesNotExist: false);
+ if (oCache != null) {
+ oCache.Dispose();
+ }
+ if (iCache != null) {
+ iCache.Dispose();
+ }
}
// app on end, cleanup app instances
@@ -2792,53 +2798,22 @@ namespace System.Web {
throw new HttpException(SR.GetString(SR.Aspnet_not_installed, VersionInfo.SystemWebVersion));
}
- // In a web app, ReadCacheInternalConfig() is called from HttpRuntime.HostingInit.
- // However, if the cache is used by a non-http app, HttpRuntime.HostingInit won't
- // be called and we need to find a way to call ReadCacheInternalConfig().
- // The safe and inexpensive place to call it is when the non-http app accesses the
- // Cache thru HttpRuntime.Cache.
- //
- // ReadCacheInternalConfig() protects itself from being read multiple times.
- //
Cache cachePublic = _theRuntime._cachePublic;
if (cachePublic == null) {
- CacheInternal cacheInternal = CacheInternal;
- CacheSection cacheSection = RuntimeConfig.GetAppConfig().Cache;
- cacheInternal.ReadCacheInternalConfig(cacheSection);
- _theRuntime._cachePublic = cacheInternal.CachePublic;
- cachePublic = _theRuntime._cachePublic;
+ lock (_theRuntime) {
+ cachePublic = _theRuntime._cachePublic;
+ if (cachePublic == null) {
+ // Create the CACHE object
+ cachePublic = new Caching.Cache(0);
+ _theRuntime._cachePublic = cachePublic;
+ }
+ }
}
return cachePublic;
}
}
- private void CreateCache() {
- lock (this) {
- if (_cacheInternal == null) {
- _cacheInternal = CacheInternal.Create();
- }
- }
- }
-
- internal static CacheInternal GetCacheInternal(bool createIfDoesNotExist) {
- // Note that we only create the cache on first access,
- // not in HttpRuntime initialization.
- // This prevents cache timers from running when
- // the cache is not used.
- CacheInternal cacheInternal = _theRuntime._cacheInternal;
- if (cacheInternal == null && createIfDoesNotExist) {
- _theRuntime.CreateCache();
- cacheInternal = _theRuntime._cacheInternal;
- }
-
- return cacheInternal;
- }
-
- internal static CacheInternal CacheInternal {
- get { return GetCacheInternal(createIfDoesNotExist: true); }
- }
-
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
diff --git a/mcs/class/referencesource/System.Web/InternalApis/NDP_Common/inc/StrongNameHelpers.cs b/mcs/class/referencesource/System.Web/InternalApis/NDP_Common/inc/StrongNameHelpers.cs
index 262070c90be..eca2861417d 100644
--- a/mcs/class/referencesource/System.Web/InternalApis/NDP_Common/inc/StrongNameHelpers.cs
+++ b/mcs/class/referencesource/System.Web/InternalApis/NDP_Common/inc/StrongNameHelpers.cs
@@ -20,7 +20,7 @@ namespace Microsoft.Runtime.Hosting {
[ThreadStatic]
private static IClrStrongName s_StrongName;
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
private static IClrStrongName StrongName {
[System.Security.SecurityCritical]
get {
@@ -33,7 +33,7 @@ namespace Microsoft.Runtime.Hosting {
}
}
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
private static IClrStrongNameUsingIntPtr StrongNameUsingIntPtr {
[System.Security.SecurityCritical]
get {
@@ -42,20 +42,20 @@ namespace Microsoft.Runtime.Hosting {
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static int StrongNameErrorInfo() {
return ts_LastStrongNameHR;
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
[SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", MessageId = "Microsoft.Runtime.Hosting.IClrStrongNameUsingIntPtr.StrongNameFreeBuffer(System.IntPtr)", Justification = "StrongNameFreeBuffer returns void but the new runtime wrappers return an HRESULT.")]
public static void StrongNameFreeBuffer(IntPtr pbMemory) {
StrongNameUsingIntPtr.StrongNameFreeBuffer(pbMemory);
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameGetPublicKey(string pwzKeyContainer, IntPtr pbKeyBlob, int cbKeyBlob, out IntPtr ppbPublicKeyBlob, out int pcbPublicKeyBlob) {
int hr = StrongNameUsingIntPtr.StrongNameGetPublicKey(pwzKeyContainer, pbKeyBlob, cbKeyBlob, out ppbPublicKeyBlob, out pcbPublicKeyBlob);
if( hr < 0 )
@@ -70,7 +70,7 @@ namespace Microsoft.Runtime.Hosting {
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameKeyDelete(string pwzKeyContainer) {
int hr = StrongName.StrongNameKeyDelete(pwzKeyContainer);
if( hr < 0 )
@@ -82,7 +82,7 @@ namespace Microsoft.Runtime.Hosting {
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameKeyGen(string pwzKeyContainer, int dwFlags, out IntPtr ppbKeyBlob, out int pcbKeyBlob) {
int hr = StrongName.StrongNameKeyGen(pwzKeyContainer, dwFlags, out ppbKeyBlob, out pcbKeyBlob);
if( hr < 0 )
@@ -96,7 +96,7 @@ namespace Microsoft.Runtime.Hosting {
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameKeyInstall(string pwzKeyContainer, IntPtr pbKeyBlob, int cbKeyBlob) {
int hr = StrongNameUsingIntPtr.StrongNameKeyInstall(pwzKeyContainer, pbKeyBlob, cbKeyBlob);
if( hr < 0 )
@@ -108,7 +108,7 @@ namespace Microsoft.Runtime.Hosting {
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameSignatureGeneration(string pwzFilePath, string pwzKeyContainer, IntPtr pbKeyBlob, int cbKeyBlob) {
IntPtr ppbSignatureBlob = IntPtr.Zero;
int cbSignatureBlob = 0;
@@ -117,7 +117,7 @@ namespace Microsoft.Runtime.Hosting {
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameSignatureGeneration(string pwzFilePath, string pwzKeyContainer, IntPtr pbKeyBlob, int cbKeyBlob, ref IntPtr ppbSignatureBlob, out int pcbSignatureBlob) {
int hr = StrongNameUsingIntPtr.StrongNameSignatureGeneration(pwzFilePath, pwzKeyContainer, pbKeyBlob, cbKeyBlob, ppbSignatureBlob, out pcbSignatureBlob);
if( hr < 0 )
@@ -130,7 +130,7 @@ namespace Microsoft.Runtime.Hosting {
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameSignatureSize(IntPtr pbPublicKeyBlob, int cbPublicKeyBlob, out int pcbSize) {
int hr = StrongNameUsingIntPtr.StrongNameSignatureSize(pbPublicKeyBlob, cbPublicKeyBlob, out pcbSize);
if( hr < 0 )
@@ -143,7 +143,7 @@ namespace Microsoft.Runtime.Hosting {
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameSignatureVerification(string pwzFilePath, int dwInFlags, out int pdwOutFlags) {
int hr = StrongName.StrongNameSignatureVerification(pwzFilePath, dwInFlags, out pdwOutFlags);
if( hr < 0 )
@@ -156,7 +156,7 @@ namespace Microsoft.Runtime.Hosting {
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameSignatureVerificationEx(string pwzFilePath, bool fForceVerification, out bool pfWasVerified) {
int hr = StrongName.StrongNameSignatureVerificationEx(pwzFilePath, fForceVerification, out pfWasVerified);
if( hr < 0 )
@@ -169,7 +169,7 @@ namespace Microsoft.Runtime.Hosting {
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameTokenFromPublicKey(IntPtr pbPublicKeyBlob, int cbPublicKeyBlob, out IntPtr ppbStrongNameToken, out int pcbStrongNameToken) {
int hr = StrongNameUsingIntPtr.StrongNameTokenFromPublicKey(pbPublicKeyBlob, cbPublicKeyBlob, out ppbStrongNameToken, out pcbStrongNameToken);
if( hr < 0 )
@@ -183,7 +183,7 @@ namespace Microsoft.Runtime.Hosting {
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameSignatureSize(byte[] bPublicKeyBlob, int cbPublicKeyBlob, out int pcbSize) {
int hr = StrongName.StrongNameSignatureSize(bPublicKeyBlob, cbPublicKeyBlob, out pcbSize);
if( hr < 0 )
@@ -195,7 +195,7 @@ namespace Microsoft.Runtime.Hosting {
return true;
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameTokenFromPublicKey(byte[] bPublicKeyBlob, int cbPublicKeyBlob, out IntPtr ppbStrongNameToken, out int pcbStrongNameToken) {
int hr = StrongName.StrongNameTokenFromPublicKey(bPublicKeyBlob, cbPublicKeyBlob, out ppbStrongNameToken, out pcbStrongNameToken);
if( hr < 0 )
@@ -209,7 +209,7 @@ namespace Microsoft.Runtime.Hosting {
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameGetPublicKey(string pwzKeyContainer, byte[] bKeyBlob, int cbKeyBlob, out IntPtr ppbPublicKeyBlob, out int pcbPublicKeyBlob) {
int hr = StrongName.StrongNameGetPublicKey(pwzKeyContainer, bKeyBlob, cbKeyBlob, out ppbPublicKeyBlob, out pcbPublicKeyBlob);
if( hr < 0 )
@@ -223,7 +223,7 @@ namespace Microsoft.Runtime.Hosting {
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameKeyInstall(string pwzKeyContainer, byte[] bKeyBlob, int cbKeyBlob) {
int hr = StrongName.StrongNameKeyInstall(pwzKeyContainer, bKeyBlob, cbKeyBlob);
if( hr < 0 )
@@ -235,7 +235,7 @@ namespace Microsoft.Runtime.Hosting {
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameSignatureGeneration(string pwzFilePath, string pwzKeyContainer, byte[] bKeyBlob, int cbKeyBlob) {
IntPtr ppbSignatureBlob = IntPtr.Zero;
int cbSignatureBlob = 0;
@@ -243,7 +243,7 @@ namespace Microsoft.Runtime.Hosting {
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameSignatureGeneration(string pwzFilePath, string pwzKeyContainer, byte[] bKeyBlob, int cbKeyBlob, ref IntPtr ppbSignatureBlob, out int pcbSignatureBlob) {
int hr = StrongName.StrongNameSignatureGeneration(pwzFilePath, pwzKeyContainer, bKeyBlob, cbKeyBlob, ppbSignatureBlob, out pcbSignatureBlob);
if( hr < 0 )
diff --git a/mcs/class/referencesource/System.Web/LegacyAspNetSynchronizationContext.cs b/mcs/class/referencesource/System.Web/LegacyAspNetSynchronizationContext.cs
index 2bbdf1b4f3a..8a351793238 100644
--- a/mcs/class/referencesource/System.Web/LegacyAspNetSynchronizationContext.cs
+++ b/mcs/class/referencesource/System.Web/LegacyAspNetSynchronizationContext.cs
@@ -43,7 +43,7 @@ namespace System.Web {
private void CallCallback(SendOrPostCallback callback, Object state) {
CheckForRequestStateIfRequired();
- // don't take app lock for [....] caller to avoid deadlocks in case they poll for result
+ // don't take app lock for sync caller to avoid deadlocks in case they poll for result
if (_syncCaller) {
CallCallbackPossiblyUnderLock(callback, state);
}
@@ -72,7 +72,7 @@ namespace System.Web {
}
}
- // this property no-ops using the legacy [....] context
+ // this property no-ops using the legacy sync context
internal override bool AllowAsyncDuringSyncStages {
get;
set;
diff --git a/mcs/class/referencesource/System.Web/Management/WebEvents.cs b/mcs/class/referencesource/System.Web/Management/WebEvents.cs
index f7c17a34926..6dcaca837b5 100644
--- a/mcs/class/referencesource/System.Web/Management/WebEvents.cs
+++ b/mcs/class/referencesource/System.Web/Management/WebEvents.cs
@@ -893,15 +893,14 @@ namespace System.Web.Management {
}
internal static String FormatResourceStringWithCache(String key) {
- CacheInternal cacheInternal = HttpRuntime.CacheInternal;
-
// HealthMonitoring, in some scenarios, can call into the cache hundreds of
// times during shutdown, after the cache has been disposed. To improve
// shutdown performance, skip the cache when it is disposed.
- if (cacheInternal.IsDisposed) {
+ if (HealthMonitoringManager.IsCacheDisposed) {
return SR.Resources.GetString(key, CultureInfo.InstalledUICulture);
}
+ CacheStoreProvider cacheInternal = HttpRuntime.Cache.InternalCache;
string s;
string cacheKey = CreateWebEventResourceCacheKey(key);
@@ -913,7 +912,7 @@ namespace System.Web.Management {
s = SR.Resources.GetString(key, CultureInfo.InstalledUICulture);
if (s != null) {
- cacheInternal.UtcInsert(cacheKey, s);
+ cacheInternal.Insert(cacheKey, s, null);
}
return s;
@@ -2330,6 +2329,7 @@ namespace System.Web.Management {
static bool s_inited = false;
static bool s_initing = false;
static object s_lockObject = new object();
+ static bool s_isCacheDisposed = false;
// If this method returns null, it means we failed during configuration.
internal static HealthMonitoringManager Manager() {
@@ -2381,6 +2381,8 @@ namespace System.Web.Management {
}
}
+ internal static bool IsCacheDisposed { get { return s_isCacheDisposed; } set { s_isCacheDisposed = value; } }
+
internal static void StartHealthMonitoringHeartbeat() {
HealthMonitoringManager manager = Manager();
if (manager == null) {
diff --git a/mcs/class/referencesource/System.Web/PipelineModuleStepContainer.cs b/mcs/class/referencesource/System.Web/PipelineModuleStepContainer.cs
index fb8effd3dff..0d2b49071d8 100644
--- a/mcs/class/referencesource/System.Web/PipelineModuleStepContainer.cs
+++ b/mcs/class/referencesource/System.Web/PipelineModuleStepContainer.cs
@@ -130,7 +130,7 @@ namespace System.Web {
for (int i = 0; i < stepArray.Count; i++ ) {
// we don't support removing async event handlers
- // but the event syntax forces us to handle [....] events
+ // but the event syntax forces us to handle sync events
syncStep = stepArray[i] as HttpApplication.SyncEventExecutionStep;
if (null != syncStep) {
if (syncStep.Handler == (EventHandler)handler) {
diff --git a/mcs/class/referencesource/System.Web/Routing/Route.cs b/mcs/class/referencesource/System.Web/Routing/Route.cs
index 4e78e8ee3fb..04f33a9d6ae 100644
--- a/mcs/class/referencesource/System.Web/Routing/Route.cs
+++ b/mcs/class/referencesource/System.Web/Routing/Route.cs
@@ -80,7 +80,7 @@
}
set {
// The parser will throw for invalid routes. We don't have to worry
- // about _parsedRoute getting out of [....] with _url since the latter
+ // about _parsedRoute getting out of sync with _url since the latter
// won't get set unless we can parse the route.
_parsedRoute = RouteParser.Parse(value);
diff --git a/mcs/class/referencesource/System.Web/Routing/RouteCollection.cs b/mcs/class/referencesource/System.Web/Routing/RouteCollection.cs
index dc8b1d35404..0b6bf9cfd0e 100644
--- a/mcs/class/referencesource/System.Web/Routing/RouteCollection.cs
+++ b/mcs/class/referencesource/System.Web/Routing/RouteCollection.cs
@@ -81,6 +81,12 @@
if (!String.IsNullOrEmpty(name)) {
_namedMap[name] = item;
}
+
+ // RouteBase doesn't have handler info, so we only log Route.RouteHandler
+ var route = item as Route;
+ if (route != null && route.RouteHandler != null) {
+ TelemetryLogger.LogHttpHandler(route.RouteHandler.GetType());
+ }
}
[SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings",
diff --git a/mcs/class/referencesource/System.Web/Security/ADMembershipProvider.cs b/mcs/class/referencesource/System.Web/Security/ADMembershipProvider.cs
index 6fc96d5a483..046003984a7 100644
--- a/mcs/class/referencesource/System.Web/Security/ADMembershipProvider.cs
+++ b/mcs/class/referencesource/System.Web/Security/ADMembershipProvider.cs
@@ -378,6 +378,7 @@ namespace System.Web.Security
int clientSearchTimeout = SecUtility.GetIntValue(config, "clientSearchTimeout", -1, false, 0);
int serverSearchTimeout = SecUtility.GetIntValue(config, "serverSearchTimeout", -1, false, 0);
+ TimeUnit timeoutUnit = SecUtility.GetTimeoutUnit(config, "timeoutUnit", TimeUnit.Minutes);
passwordStrengthRegexTimeout = SecUtility.GetNullableIntValue(config, "passwordStrengthRegexTimeout");
enableSearchMethods = SecUtility.GetBooleanValue(config, "enableSearchMethods", false);
@@ -418,7 +419,7 @@ namespace System.Web.Security
// connectionprotection if necessary, make sure credentials are valid, container exists and the directory is
// either AD or ADAM)
//
- directoryInfo = new DirectoryInformation(adConnectionString, credential, connProtection, clientSearchTimeout, serverSearchTimeout, enablePasswordReset);
+ directoryInfo = new DirectoryInformation(adConnectionString, credential, connProtection, clientSearchTimeout, serverSearchTimeout, enablePasswordReset, timeoutUnit);
//
// initialize the syntaxes table
@@ -609,6 +610,7 @@ namespace System.Web.Security
config.Remove("connectionPassword");
config.Remove("clientSearchTimeout");
config.Remove("serverSearchTimeout");
+ config.Remove("timeoutUnit");
config.Remove("enableSearchMethods");
config.Remove("maxInvalidPasswordAttempts");
config.Remove("passwordAttemptWindow");
@@ -2021,9 +2023,9 @@ namespace System.Web.Security
searcher.PropertiesToLoad.Add(attributeMapUsername);
if (directoryInfo.ClientSearchTimeout != -1)
- searcher.ClientTimeout = new TimeSpan(0, directoryInfo.ClientSearchTimeout, 0);
+ searcher.ClientTimeout = DateTimeUtil.GetTimeoutFromTimeUnit(directoryInfo.ClientSearchTimeout, directoryInfo.TimeoutUnit);
if (directoryInfo.ServerSearchTimeout != -1)
- searcher.ServerPageTimeLimit = new TimeSpan(0, directoryInfo.ServerSearchTimeout, 0);
+ searcher.ServerPageTimeLimit = DateTimeUtil.GetTimeoutFromTimeUnit(directoryInfo.ServerSearchTimeout, directoryInfo.TimeoutUnit);
resCol = searcher.FindAll();
bool userFound = false;
@@ -2371,9 +2373,9 @@ namespace System.Web.Security
searcher.Filter = "(&(objectCategory=person)(objectClass=user)" + filter + ")";
if (directoryInfo.ClientSearchTimeout != -1)
- searcher.ClientTimeout = new TimeSpan(0, directoryInfo.ClientSearchTimeout, 0);
+ searcher.ClientTimeout = DateTimeUtil.GetTimeoutFromTimeUnit(directoryInfo.ClientSearchTimeout, directoryInfo.TimeoutUnit);
if (directoryInfo.ServerSearchTimeout != -1)
- searcher.ServerPageTimeLimit = new TimeSpan(0, directoryInfo.ServerSearchTimeout, 0);
+ searcher.ServerPageTimeLimit = DateTimeUtil.GetTimeoutFromTimeUnit(directoryInfo.ServerSearchTimeout, directoryInfo.TimeoutUnit);
if (retrieveSAMAccountName)
searcher.PropertiesToLoad.Add("sAMAccountName");
@@ -2413,9 +2415,9 @@ namespace System.Web.Security
searcher.Filter = "(&(objectCategory=person)(objectClass=user)" + filter + ")";
if (directoryInfo.ClientSearchTimeout != -1)
- searcher.ClientTimeout = new TimeSpan(0, directoryInfo.ClientSearchTimeout, 0);
+ searcher.ClientTimeout = DateTimeUtil.GetTimeoutFromTimeUnit(directoryInfo.ClientSearchTimeout, directoryInfo.TimeoutUnit);
if (directoryInfo.ServerSearchTimeout != -1)
- searcher.ServerPageTimeLimit = new TimeSpan(0, directoryInfo.ServerSearchTimeout, 0);
+ searcher.ServerPageTimeLimit = DateTimeUtil.GetTimeoutFromTimeUnit(directoryInfo.ServerSearchTimeout, directoryInfo.TimeoutUnit);
//
// load all the attributes needed to create a MembershipUser object
@@ -2483,9 +2485,9 @@ namespace System.Web.Security
searcher.Filter = "(&(objectCategory=person)(objectClass=user)" + filter + ")";
if (directoryInfo.ClientSearchTimeout != -1)
- searcher.ClientTimeout = new TimeSpan(0, directoryInfo.ClientSearchTimeout, 0);
+ searcher.ClientTimeout = DateTimeUtil.GetTimeoutFromTimeUnit(directoryInfo.ClientSearchTimeout, directoryInfo.TimeoutUnit);
if (directoryInfo.ServerSearchTimeout != -1)
- searcher.ServerPageTimeLimit = new TimeSpan(0, directoryInfo.ServerSearchTimeout, 0);
+ searcher.ServerPageTimeLimit = DateTimeUtil.GetTimeoutFromTimeUnit(directoryInfo.ServerSearchTimeout, directoryInfo.TimeoutUnit);
//
// load all the attributes needed to create a MembershipUser object
@@ -3059,9 +3061,9 @@ namespace System.Web.Security
searcher.SearchScope = System.DirectoryServices.SearchScope.Subtree;
if (directoryInfo.ClientSearchTimeout != -1)
- searcher.ClientTimeout = new TimeSpan(0, directoryInfo.ClientSearchTimeout, 0);
+ searcher.ClientTimeout = DateTimeUtil.GetTimeoutFromTimeUnit(directoryInfo.ClientSearchTimeout, directoryInfo.TimeoutUnit);
if (directoryInfo.ServerSearchTimeout != -1)
- searcher.ServerPageTimeLimit = new TimeSpan(0, directoryInfo.ServerSearchTimeout, 0);
+ searcher.ServerPageTimeLimit = DateTimeUtil.GetTimeoutFromTimeUnit(directoryInfo.ServerSearchTimeout, directoryInfo.TimeoutUnit);
bool result;
try
@@ -3099,9 +3101,9 @@ namespace System.Web.Security
searcher.SearchScope = System.DirectoryServices.SearchScope.Subtree;
if (directoryInfo.ClientSearchTimeout != -1)
- searcher.ClientTimeout = new TimeSpan(0, directoryInfo.ClientSearchTimeout, 0);
+ searcher.ClientTimeout = DateTimeUtil.GetTimeoutFromTimeUnit(directoryInfo.ClientSearchTimeout, directoryInfo.TimeoutUnit);
if (directoryInfo.ServerSearchTimeout != -1)
- searcher.ServerPageTimeLimit = new TimeSpan(0, directoryInfo.ServerSearchTimeout, 0);
+ searcher.ServerPageTimeLimit = DateTimeUtil.GetTimeoutFromTimeUnit(directoryInfo.ServerSearchTimeout, directoryInfo.TimeoutUnit);
bool result;
try
@@ -3434,6 +3436,7 @@ namespace System.Web.Security
private bool concurrentBindSupported = false;
private int clientSearchTimeout = -1;
private int serverSearchTimeout = -1;
+ private TimeUnit timeUnit = TimeUnit.Unknown;
private DirectoryEntry rootdse = null;
private NetworkCredential credentials = null;
private AuthenticationTypes authenticationType = AuthenticationTypes.None;
@@ -3471,7 +3474,8 @@ namespace System.Web.Security
string connProtection,
int clientSearchTimeout,
int serverSearchTimeout,
- bool enablePasswordReset)
+ bool enablePasswordReset,
+ TimeUnit timeUnit)
{
//
@@ -3482,6 +3486,7 @@ namespace System.Web.Security
this.credentials = credentials;
this.clientSearchTimeout = clientSearchTimeout;
this.serverSearchTimeout = serverSearchTimeout;
+ this.timeUnit = timeUnit;
Debug.Assert(adspath != null);
Debug.Assert(adspath.Length > 0);
@@ -3880,6 +3885,11 @@ namespace System.Web.Security
get { return serverSearchTimeout; }
}
+ internal TimeUnit TimeoutUnit
+ {
+ get { return timeUnit; }
+ }
+
internal string ADAMPartitionDN
{
get { return adamPartitionDN; }
diff --git a/mcs/class/referencesource/System.Web/Security/Cryptography/CryptoAlgorithms.cs b/mcs/class/referencesource/System.Web/Security/Cryptography/CryptoAlgorithms.cs
index a4147901f2e..aeb505adeab 100644
--- a/mcs/class/referencesource/System.Web/Security/Cryptography/CryptoAlgorithms.cs
+++ b/mcs/class/referencesource/System.Web/Security/Cryptography/CryptoAlgorithms.cs
@@ -12,7 +12,7 @@ namespace System.Web.Security.Cryptography {
// Utility class to provide the "one true way" of getting instances of
// cryptographic algorithms, like SymmetricAlgorithm and HashAlgorithm.
- // From discussions with [....] and the crypto board, we should prefer
+ // From discussions with Microsoft and the crypto board, we should prefer
// the CNG implementations of algorithms, then the CAPI implementations,
// then finally managed implementations if there are no CNG / CAPI
// implementations. The CNG / CAPI implementations are preferred for
diff --git a/mcs/class/referencesource/System.Web/Security/FileAuthorizationModule.cs b/mcs/class/referencesource/System.Web/Security/FileAuthorizationModule.cs
index 63c2efee1a5..7eb437ea86e 100644
--- a/mcs/class/referencesource/System.Web/Security/FileAuthorizationModule.cs
+++ b/mcs/class/referencesource/System.Web/Security/FileAuthorizationModule.cs
@@ -254,7 +254,7 @@ namespace System.Web.Security {
freeDescriptor = false;
string oCacheKey = CacheInternal.PrefixFileSecurity + fileName;
- FileSecurityDescriptorWrapper oSecDesc = HttpRuntime.CacheInternal.Get(oCacheKey) as FileSecurityDescriptorWrapper;
+ FileSecurityDescriptorWrapper oSecDesc = HttpRuntime.Cache.InternalCache.Get(oCacheKey) as FileSecurityDescriptorWrapper;
// If it's not present in the cache, then create it and add to the cache
if (oSecDesc == null) {
@@ -267,8 +267,11 @@ namespace System.Web.Security {
Debug.Trace("FAM", "GetFileSecurityDescriptorWrapper: inserting into cache with dependency on " + cacheDependencyPath);
CacheDependency dependency = new CacheDependency(0, cacheDependencyPath);
TimeSpan slidingExp = CachedPathData.UrlMetadataSlidingExpiration;
- HttpRuntime.CacheInternal.UtcInsert(oCacheKey, oSecDesc, dependency, Cache.NoAbsoluteExpiration, slidingExp,
- CacheItemPriority.Default, new CacheItemRemovedCallback(oSecDesc.OnCacheItemRemoved));
+ HttpRuntime.Cache.InternalCache.Insert(oCacheKey, oSecDesc, new CacheInsertOptions() {
+ Dependencies = dependency,
+ SlidingExpiration = slidingExp,
+ OnRemovedCallback = new CacheItemRemovedCallback(oSecDesc.OnCacheItemRemoved)
+ });
} catch (Exception e){
Debug.Trace("internal", e.ToString());
freeDescriptor = true;
@@ -303,7 +306,7 @@ namespace System.Web.Security {
oCacheKey = CacheInternal.PrefixFileSecurity + context.Request.PhysicalPathInternal;
- sec = HttpRuntime.CacheInternal.Get(oCacheKey);
+ sec = HttpRuntime.Cache.InternalCache.Get(oCacheKey);
// If it's not present in the cache, then return true
if (sec == null || !(sec is FileSecurityDescriptorWrapper))
diff --git a/mcs/class/referencesource/System.Web/Security/Membership.cs b/mcs/class/referencesource/System.Web/Security/Membership.cs
index 13b14cad60a..dfe0be3bc65 100644
--- a/mcs/class/referencesource/System.Web/Security/Membership.cs
+++ b/mcs/class/referencesource/System.Web/Security/Membership.cs
@@ -412,7 +412,27 @@ namespace System.Web.Security {
if (defaultProviderInitialized) {
s_InitializedDefaultProvider = true;
}
+ // VSO #265267 log warning in event log when using clear password and encrypted password in Membership provider
+ // VSO #366114 Move this to only after the initialization has fully completed.
+ if (s_Initialized && s_InitializedDefaultProvider) {
+ CheckedPasswordFormat(s_Providers);
+ }
+ }
+ }
+
+ // VSO #265267 we want to log a warning in the event log, whenever detect using clear password or encrypted password formats settings in Membership provider
+ private static void CheckedPasswordFormat(MembershipProviderCollection providers) {
+ //VSO #294931 Since this is an optional feature, we want to prevent any corner cases that were not able to return the password format. In those cases, we will just do nothing and not log any warnings.
+ try {
+
+ foreach (MembershipProvider p in providers) {
+ if (p != null && (p.PasswordFormat == MembershipPasswordFormat.Clear || p.PasswordFormat == MembershipPasswordFormat.Encrypted)) {
+ string providerName = p.Name ?? string.Empty;
+ WebBaseEvent.RaiseRuntimeError(new ConfigurationErrorsException(SR.GetString(SR.MembershipPasswordFormat_Obsoleted, providerName, p.PasswordFormat)), typeof(MembershipProvider));
+ }
+ }
}
+ catch { }
}
private static bool InitializeSettings(bool initializeGeneralSettings, RuntimeConfig appConfig, MembershipSection settings) {
diff --git a/mcs/class/referencesource/System.Web/Security/RoleClaimProvider.cs b/mcs/class/referencesource/System.Web/Security/RoleClaimProvider.cs
index ad8c9dc19e9..03563e9dc30 100644
--- a/mcs/class/referencesource/System.Web/Security/RoleClaimProvider.cs
+++ b/mcs/class/referencesource/System.Web/Security/RoleClaimProvider.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
// RoleClaimProvider.cs
diff --git a/mcs/class/referencesource/System.Web/State/InProcStateClientManager.cs b/mcs/class/referencesource/System.Web/State/InProcStateClientManager.cs
index 4e92fdfd98f..dc66a9cb265 100644
--- a/mcs/class/referencesource/System.Web/State/InProcStateClientManager.cs
+++ b/mcs/class/referencesource/System.Web/State/InProcStateClientManager.cs
@@ -118,7 +118,7 @@ namespace System.Web.SessionState {
// with SQL provider
SessionIDManager.CheckIdLength(id, true /* throwOnFail */);
- InProcSessionState state = (InProcSessionState) HttpRuntime.CacheInternal.Get(key);
+ InProcSessionState state = (InProcSessionState)HttpRuntime.Cache.InternalCache.Get(key);
if (state != null) {
bool lockedByOther; // True if the state is locked by another session
int initialFlags;
@@ -224,7 +224,7 @@ namespace System.Web.SessionState {
SessionIDManager.CheckIdLength(id, true /* throwOnFail */);
- InProcSessionState state = (InProcSessionState) HttpRuntime.CacheInternal.Get(key);
+ InProcSessionState state = (InProcSessionState)HttpRuntime.Cache.InternalCache.Get(key);
/* If the state isn't there, we probably took too long to run. */
if (state == null)
@@ -250,7 +250,7 @@ namespace System.Web.SessionState {
bool newItem) {
string key = CreateSessionStateCacheKey(id);
bool doInsert = true;
- CacheInternal cacheInternal = HttpRuntime.CacheInternal;
+ CacheStoreProvider cacheInternal = HttpRuntime.Cache.InternalCache;
int lockCookieForInsert = NewLockCookie;
ISessionStateItemCollection items = null;
HttpStaticObjectsCollection staticObjects = null;
@@ -312,7 +312,7 @@ namespace System.Web.SessionState {
Pleas note that an insert will cause the Session_End to be incorrectly raised.
Please note that the item itself should not expire between now and
- where we do UtcInsert below because CacheInternal.Get above have just
+ where we do UtcInsert below because cacheInternal.Get above have just
updated its expiry time.
*/
stateCurrent._flags |= (int)SessionStateItemFlags.IgnoreCacheItemRemoved;
@@ -346,9 +346,11 @@ namespace System.Web.SessionState {
}
finally {
// protected from ThreadAbortEx
- cacheInternal.UtcInsert(
- key, state, null, Cache.NoAbsoluteExpiration, new TimeSpan(0, state._timeout, 0),
- CacheItemPriority.NotRemovable, _callback);
+ cacheInternal.Insert(key, state, new CacheInsertOptions() {
+ SlidingExpiration = new TimeSpan(0, state._timeout, 0),
+ Priority = CacheItemPriority.NotRemovable,
+ OnRemovedCallback = _callback
+ });
PerfCounters.IncrementCounter(AppPerfCounter.SESSIONS_TOTAL);
PerfCounters.IncrementCounter(AppPerfCounter.SESSIONS_ACTIVE);
@@ -383,9 +385,11 @@ namespace System.Web.SessionState {
}
finally {
// protected from ThreadAbortEx
- object existingEntry = HttpRuntime.CacheInternal.UtcAdd(
- key, state, null, Cache.NoAbsoluteExpiration, new TimeSpan(0, timeout, 0),
- CacheItemPriority.NotRemovable, _callback);
+ object existingEntry = HttpRuntime.Cache.InternalCache.Add(key, state, new CacheInsertOptions() {
+ SlidingExpiration = new TimeSpan(0, timeout, 0),
+ Priority = CacheItemPriority.NotRemovable,
+ OnRemovedCallback = _callback
+ });
if (existingEntry == null) {
PerfCounters.IncrementCounter(AppPerfCounter.SESSIONS_TOTAL);
PerfCounters.IncrementCounter(AppPerfCounter.SESSIONS_ACTIVE);
@@ -402,7 +406,7 @@ namespace System.Web.SessionState {
Debug.Assert(lockId != null, "lockId != null");
string key = CreateSessionStateCacheKey(id);
- CacheInternal cacheInternal = HttpRuntime.CacheInternal;
+ CacheStoreProvider cacheInternal = HttpRuntime.Cache.InternalCache;
int lockCookie = (int)lockId;
SessionIDManager.CheckIdLength(id, true /* throwOnFail */);
@@ -438,7 +442,7 @@ namespace System.Web.SessionState {
string key = CreateSessionStateCacheKey(id);
SessionIDManager.CheckIdLength(id, true /* throwOnFail */);
- HttpRuntime.CacheInternal.Get(key);
+ HttpRuntime.Cache.InternalCache.Get(key);
}
// Create a new SessionStateStoreData.
diff --git a/mcs/class/referencesource/System.Web/State/SessionStateModule.cs b/mcs/class/referencesource/System.Web/State/SessionStateModule.cs
index 84b3d55a8ae..0915da99be5 100644
--- a/mcs/class/referencesource/System.Web/State/SessionStateModule.cs
+++ b/mcs/class/referencesource/System.Web/State/SessionStateModule.cs
@@ -31,6 +31,8 @@ namespace System.Web.SessionState {
using System.Web.Hosting;
using System.Web.Management;
using Microsoft.Win32;
+ using System.Collections.Concurrent;
+ using System.Collections.Generic;
public delegate void SessionStateItemExpireCallback(
string id, SessionStateStoreData item);
@@ -153,7 +155,8 @@ namespace System.Web.SessionState {
private static bool s_PollIntervalRegLookedUp = false;
private static object s_PollIntervalRegLock = new object();
-
+
+ private static ConcurrentDictionary<string, int> s_queuedRequestsNumPerSession = new ConcurrentDictionary<string, int>();
//
// Check if we can optmize for InProc case.
// Optimization details:
@@ -962,7 +965,7 @@ namespace System.Web.SessionState {
Debug.Assert(storedItem != null, "Must succeed in locking session state item.");
}
}
-
+
bool GetSessionStateItem() {
bool isCompleted = true;
bool locked;
@@ -1012,6 +1015,8 @@ namespace System.Web.SessionState {
}
void PollLockedSession() {
+ EnsureRequestTimeout();
+
if (_timerCallback == null) {
_timerCallback = new TimerCallback(this.PollLockedSessionCallback);
}
@@ -1019,6 +1024,9 @@ namespace System.Web.SessionState {
if (_timer == null) {
_timerId++;
+ // Only call this method once when setting up timer to poll the session item.
+ // It should not be called in timer's callback
+ QueueRef();
#if DBG
if (!Debug.IsTagPresent("Timer") || Debug.IsTagEnabled("Timer"))
#endif
@@ -1030,6 +1038,53 @@ namespace System.Web.SessionState {
}
}
+ private void EnsureRequestTimeout() {
+ // Request may be blocked in acquiring state longer than execution timeout.
+ // In that case, it will be timeout anyway after it gets the session item.
+ // So it makes sense to timeout it when waiting longer than executionTimeout.
+ if (_rqContext.HasTimeoutExpired) {
+ throw new HttpException(SR.GetString(SR.Request_timed_out));
+ }
+ }
+
+ private static bool IsRequestQueueEnabled {
+ get {
+ return (AppSettings.RequestQueueLimitPerSession != AppSettings.UnlimitedRequestsPerSession);
+ }
+ }
+
+ private void QueueRef() {
+ if (!IsRequestQueueEnabled || _rqId == null) {
+ return;
+ }
+
+ //
+ // Check the limit
+ int count = 0;
+ s_queuedRequestsNumPerSession.TryGetValue(_rqId, out count);
+
+ if (count >= AppSettings.RequestQueueLimitPerSession) {
+ throw new HttpException(SR.GetString(SR.Request_Queue_Limit_Per_Session_Exceeded));
+ }
+
+ //
+ // Add ref
+ s_queuedRequestsNumPerSession.AddOrUpdate(_rqId, 1, (key, value) => value + 1);
+ }
+
+ private void DequeRef() {
+ if (!IsRequestQueueEnabled || _rqId == null) {
+ return;
+ }
+
+ // Decrement the counter
+ if (s_queuedRequestsNumPerSession.AddOrUpdate(_rqId, 0, (key, value) => value - 1) == 0) {
+ //
+ // Remove the element when no more references
+ ((ICollection<KeyValuePair<string, int>>)s_queuedRequestsNumPerSession).Remove(new KeyValuePair<string,int>(_rqId, 0));
+ }
+ }
+
[RegistryPermission(SecurityAction.Assert, Unrestricted = true)]
private static void LookUpRegForPollInterval() {
lock (s_PollIntervalRegLock) {
@@ -1167,6 +1222,8 @@ namespace System.Web.SessionState {
}
if (isCompleted || error != null) {
+ DequeRef();
+
_rqAr.Complete(false, null, error);
}
}
diff --git a/mcs/class/referencesource/System.Web/State/StateRuntime.cs b/mcs/class/referencesource/System.Web/State/StateRuntime.cs
index de279f206dd..47d08fbea60 100644
--- a/mcs/class/referencesource/System.Web/State/StateRuntime.cs
+++ b/mcs/class/referencesource/System.Web/State/StateRuntime.cs
@@ -217,6 +217,7 @@ namespace System.Web.SessionState {
internal IntPtr _stateItem; // The pointer to the native memory that points to the psi
internal bool _locked;
internal DateTime _utcLockDate;
+ internal TimeSpan _slidingExpiration;
internal int _lockCookie;
internal int _extraFlags;
#pragma warning disable 0649
@@ -228,6 +229,7 @@ namespace System.Web.SessionState {
IntPtr stateItem,
bool locked,
DateTime utcLockDate,
+ TimeSpan slidingExpiration,
int lockCookie,
int extraFlags) {
@@ -235,6 +237,7 @@ namespace System.Web.SessionState {
_stateItem = stateItem;
_locked = locked;
_utcLockDate = utcLockDate;
+ _slidingExpiration = slidingExpiration;
_lockCookie = lockCookie;
_extraFlags = extraFlags;
}
@@ -413,19 +416,17 @@ namespace System.Web.SessionState {
string exclusiveAccess;
string key;
CachedContent content;
- CacheEntry entry;
int lockCookie;
int timeout;
key = CreateKey(request);
- entry = (CacheEntry) HttpRuntime.CacheInternal.Get(key, CacheGetOptions.ReturnCacheEntry);
- if (entry == null) {
+ content = (CachedContent) HttpRuntime.Cache.InternalCache.Get(key);
+ if (content == null) {
ReportNotFound(context);
return;
}
exclusiveAccess = request.Headers[StateHeaders.EXCLUSIVE_NAME];
- content = (CachedContent) entry.Value;
content._spinLock.AcquireWriterLock();
try {
if (content._content == null) {
@@ -483,7 +484,7 @@ namespace System.Web.SessionState {
response.AppendHeader(StateHeaders.LOCKCOOKIE_NAME_RAW, (content._lockCookie).ToString(CultureInfo.InvariantCulture));
}
- timeout = (int) (entry.SlidingExpiration.Ticks / TimeSpan.TicksPerMinute);
+ timeout = (int)(content._slidingExpiration.Ticks / TimeSpan.TicksPerMinute);
response.AppendHeader(StateHeaders.TIMEOUT_NAME_RAW, (timeout).ToString(CultureInfo.InvariantCulture));
responseStream = response.OutputStream;
buf = content._content;
@@ -520,7 +521,7 @@ namespace System.Web.SessionState {
int lockCookie;
int lockCookieNew = 1;
IntPtr stateItem;
- CacheInternal cacheInternal = HttpRuntime.CacheInternal;
+ CacheStoreProvider cacheInternal = HttpRuntime.Cache.InternalCache;
/* create the content */
requestStream = request.InputStream;
@@ -561,8 +562,8 @@ namespace System.Web.SessionState {
/* lookup current value */
key = CreateKey(request);
- CacheEntry entry = (CacheEntry) cacheInternal.Get(key, CacheGetOptions.ReturnCacheEntry);
- if (entry != null) {
+ contentCurrent = (CachedContent) cacheInternal.Get(key);
+ if (contentCurrent != null) {
// DevDivBugs 146875: Expired Session State race condition
// We make sure we do not overwrite an already existing item with an uninitialized item.
if (((int)SessionStateItemFlags.Uninitialized & extraFlags) == 1) {
@@ -573,7 +574,6 @@ namespace System.Web.SessionState {
return stateItem;
}
- contentCurrent = (CachedContent) entry.Value;
contentCurrent._spinLock.AcquireWriterLock();
try {
if (contentCurrent._content == null) {
@@ -587,7 +587,7 @@ namespace System.Web.SessionState {
return stateItem;
}
- if (entry.SlidingExpiration == timeout && contentCurrent._content != null) {
+ if (contentCurrent._slidingExpiration == timeout && contentCurrent._content != null) {
/* delete the old state item */
IntPtr stateItemOld = contentCurrent._stateItem;
@@ -619,12 +619,14 @@ namespace System.Web.SessionState {
}
}
- content = new CachedContent(buf, stateItem, false, DateTime.MinValue, lockCookieNew, extraFlags);
- cacheInternal.UtcInsert(
- key, content, null, Cache.NoAbsoluteExpiration, timeout,
- CacheItemPriority.NotRemovable, _removedHandler);
+ content = new CachedContent(buf, stateItem, false, DateTime.MinValue, timeout, lockCookieNew, extraFlags);
+ cacheInternal.Insert(key, content, new CacheInsertOptions() {
+ SlidingExpiration = timeout,
+ Priority = CacheItemPriority.NotRemovable,
+ OnRemovedCallback = _removedHandler
+ });
- if (entry == null) {
+ if (contentCurrent == null) {
IncrementStateServiceCounter(StateServicePerfCounter.STATE_SERVICE_SESSIONS_TOTAL);
IncrementStateServiceCounter(StateServicePerfCounter.STATE_SERVICE_SESSIONS_ACTIVE);
}
@@ -634,7 +636,7 @@ namespace System.Web.SessionState {
internal /*public*/ void DoDelete(HttpContext context) {
string key = CreateKey(context.Request);
- CacheInternal cacheInternal = HttpRuntime.CacheInternal;
+ CacheStoreProvider cacheInternal = HttpRuntime.Cache.InternalCache;
CachedContent content = (CachedContent) cacheInternal.Get(key);
/* If the item isn't there, we probably took too long to run. */
@@ -680,7 +682,7 @@ namespace System.Web.SessionState {
Object item;
key = CreateKey(context.Request);
- item = HttpRuntime.CacheInternal.Get(key);
+ item = HttpRuntime.Cache.InternalCache.Get(key);
if (item == null) {
ReportNotFound(context);
}
diff --git a/mcs/class/referencesource/System.Web/State/StateWorkerRequest.cs b/mcs/class/referencesource/System.Web/State/StateWorkerRequest.cs
index 385d054ebb5..8450d6d37b6 100644
--- a/mcs/class/referencesource/System.Web/State/StateWorkerRequest.cs
+++ b/mcs/class/referencesource/System.Web/State/StateWorkerRequest.cs
@@ -23,7 +23,7 @@ namespace System.Web.SessionState {
class StateHttpWorkerRequest : HttpWorkerRequest {
- /* long enough to hold the string representation of an IPv4 or IPv6 address; keep in [....] with tracker.cxx */
+ /* long enough to hold the string representation of an IPv4 or IPv6 address; keep in sync with tracker.cxx */
private const int ADDRESS_LENGTH_MAX = 64;
IntPtr _tracker;
diff --git a/mcs/class/referencesource/System.Web/System.Web.txt b/mcs/class/referencesource/System.Web/System.Web.txt
index a98718381d9..c7e6ceda08b 100644
--- a/mcs/class/referencesource/System.Web/System.Web.txt
+++ b/mcs/class/referencesource/System.Web/System.Web.txt
@@ -1,4 +1,4 @@
-;
+ ;
; ASP.NET managed resource file
;
; Copyright (c) 2000 Microsoft Corporation
@@ -324,6 +324,7 @@ Invalid_value_for_CacheControl=Property value for CacheControl is not valid. Val
OutputStream_NotAvail=OutputStream is not available when a custom TextWriter is used.
Information_Disclosure_Warning=This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using &lt;customErrors mode="Off"/&gt;. Consider using &lt;customErrors mode="On"/&gt; or &lt;customErrors mode="RemoteOnly"/&gt; in production environments.
InvalidOffsetOrCount=The sum of {0} and {1} is greater than the length of the buffer.
+Invalid_path_for_push_promise=Invalid path '{0}' for push promise. A virtual path is expected.
; Runtime
@@ -392,7 +393,7 @@ Hosting_Env_IdleTimeout=Idle timeout
Unhandled_Exception=An unhandled exception occurred and the process was terminated.
Provider_must_implement_the_interface=The provider class '{0}' must implement the class '{1}'.
Permission_set_not_found=Could not find permission set named '{0}'.
-Require_stable_string_hash_codes=ASP.NET cannot operate when String hash code randomization is enabled for the current machine. Please verify that the registry key HKEY_LOCAL_MACHINE\\Software\\Microsoft\\.NETFramework\\UseRandomizedStringHashAlgorithm does not exist or is set to [DWORD] 0.
+Require_stable_string_hash_codes=ASP.NET can operate with String hash code randomization only when enabled per application via AppSettings configuration. Registry key HKEY_LOCAL_MACHINE\\Software\\Microsoft\\.NETFramework\\UseRandomizedStringHashAlgorithm and <runtime/UseRandomizedStringHashAlgorithm> configuration are not supported.
; Server vars collection
Server_variable_cannot_be_modified=This server variable cannot be modified during request execution.
@@ -1304,7 +1305,11 @@ ModelDataSourceView_CannotCallMethodsWithOutOrRefParameters=Cannot call the meth
ModelDataSourceView_DataMethodNotFound=A public method with the name '{0}' was either not found or there were multiple methods with the same name on the type '{1}'.
ModelDataSourceView_DeleteNotSupported=Deleting is not supported unless the DeleteMethod is specified.
ModelDataSourceView_InvalidSelectReturnType=The Select Method must return one of "IQueryable<{0}>" or "IEnumerable<{0}>" or "{0}" when ItemType is set to "{0}".
+ModelDataSourceView_InvalidAsyncSelectReturnType=The Task-based Select Method must return one of "Task<IEnumerable<{0}>>" or "Task<System.Web.UI.WebControls.SelectResult>" or "Task<{0}>" when ItemType is set to "{0}".
+ModelDataSourceView_UseAsyncMethodMustBeUsingAsyncPage=When using a Task-based async method, the page must be marked as asynchronous using the <%@ Page Async="true" %> directive, and the web application must be targeting .NET 4.5 or higher via <httpRuntime targetFramework="4.5" />.
ModelDataSourceView_InvalidPagingParameters=When the DataBoundControl has paging enabled, either the SelectMethod should return an IQueryable<ItemType> or should have all these mandatory parameters : int startRowIndex, int maximumRows, out int totalRowCount
+ModelDataSourceView_InvalidAsyncPagingParameters=When the DataBoundControl has paging enabled, the SelectMethod should return "Task<System.Web.UI.WebControls.SelectResult>" and have all these mandatory parameters : int startRowIndex, int maximumRows
+ModelDataSourceView_MustUseSelectResultAsReturnType=When using custom paging with an async Select method, the Select method return type must be "Task<System.Web.UI.WebControls.SelectResult>".
ModelDataSourceView_InvalidSortingParameters=When the DataBoundControl has sorting enabled, either the SelectMethod should return an IQueryable<ItemType> or should have all these mandatory parameters : string sortByExpression
ModelDataSourceView_InsertNotSupported=Inserting is not supported unless the InsertMethod is specified.
ModelDataSourceView_MultipleModelMethodSources=The DataMethodsType and DataMethodsObject properties cannot both be specified at the same time.
@@ -1314,6 +1319,7 @@ ModelDataSourceView_SelectNotSupported=The Select operation is not supported unl
ModelDataSourceView_SortNotSupportedOnIEnumerable=The SelectMethod does not support sorting with IEnumerable data. Automatic sorting is only supported when the SelectMethod returns an IQueryable type.
ModelDataSourceView_ParameterCannotBeNull=A null value for parameter '{0}' of non-nullable type '{1}' for method '{2}' in '{3}'. An optional parameter must be a reference type or a nullable type.
ModelDataSourceView_ParameterValueHasWrongType=An invalid value for parameter '{0}' for method '{1}' in '{2}'. The value from model binding is of type '{3}', but the parameter requires a value of type '{4}'.
+ModelDataSourceView_CancellationTokenIsNotSupported=Parameters typed as CancellationToken are supported only in Task-returning methods.
ObjectDataSource_Description=Connect to a middle-tier business object or DataSet in the Bin or App_Code directory for the application.
ObjectDataSource_DisplayName=Object
ObjectDataSourceView_DeleteNotSupported=Deleting is not supported by ObjectDataSource '{0}' unless the DeleteMethod is specified.
@@ -3758,6 +3764,7 @@ AppVerifier_Subtitle=ASP.NET detected an error while invoking an asynchronous me
AppVerifier_BasicInfo_URL=Current URL: {0}
AppVerifier_BasicInfo_ErrorCode=Error code: {0}
AppVerifier_BasicInfo_Description=Description: {0}
+AppVerifier_BasicInfo_NotificationInfo=The assertion was triggered after processing notification {0}, isPostNotification = {1}, isReentry = {2}
AppVerifier_BasicInfo_ThreadInfo=The assertion was triggered on thread {0} at {1} with the following stack trace:
AppVerifier_BeginMethodInfo_EntryMethod=Entry point which triggered failure: {0}
AppVerifier_BeginMethodInfo_RequestNotification_Integrated=Request notification at time of entry: {0} [IsPostNotification = {1}]
@@ -3781,4 +3788,15 @@ AppVerifier_Errors_BeginHandlerReturnedNull=The entry point returned a null valu
AppVerifier_Errors_BeginHandlerReturnedAsyncResultMarkedCompletedSynchronouslyButWhichWasNotCompleted=The entry point returned an IAsyncResult instance that was marked 'CompletedSynchronously = true' and 'IsCompleted = false'. If the operation is completed, it must be marked 'IsCompleted = true'.
AppVerifier_Errors_BeginHandlerReturnedAsyncResultMarkedCompletedSynchronouslyButAsyncCallbackNeverCalled=The entry point returned an IAsyncResult instance that was marked 'CompletedSynchronously = true', but AsyncCallback was never invoked synchronously. If an operation completes synchronously and AsyncCallback is non-null, the callback must be invoked synchronously before the entry point returns to its caller.
AppVerifier_Errors_BeginHandlerReturnedUnexpectedAsyncResultAsyncState=The entry point returned an IAsyncResult instance with an invalid AsyncState property. The IAsyncResult's AsyncState property must match the state object parameter provided to the entry point.
-AppVerifier_Errors_SyncContextSendOrPostCalledAfterRequestCompleted=A thread attempted to call SynchronizationContext.Send or SynchronizationContext.Post after the request associated with the SynchronizationContext had already completed. \ No newline at end of file
+AppVerifier_Errors_SyncContextSendOrPostCalledAfterRequestCompleted=A thread attempted to call SynchronizationContext.Send or SynchronizationContext.Post after the request associated with the SynchronizationContext had already completed.
+AppVerifier_Errors_SyncContextSendOrPostCalledBetweenNotifications=A thread attempted to call SynchronizationContext.Send or SynchronizationContext.Post while ASP.NET is not processing any request pipeline notification.
+AppVerifier_Errors_SyncContextPostCalledInNestedNotification=A thread attempted to call SynchronizationContext.Post while processing a nested request notification. This may result in undefined behavior.
+AppVerifier_Errors_RequestNotificationCompletedSynchronouslyWithNotificationContextPending=An inconsistency was found after processing an integrated IIS request pipeline notification. Even though the notification completed synchronously it had left pending async completions.
+AppVerifier_Errors_NotificationContextHasChangedAfterSynchronouslyProcessingNotification=An inconsistency was found after processing an integrated IIS request pipeline notification. The NotificationContext has unexpectedly changed while synchronously processing a notification.
+AppVerifier_Errors_PendingProcessRequestNotificationStatusAfterCompletingNestedNotification=An inconsistency was found after processing an integrated IIS request pipeline notification. Nested notifications such as RQ_SEND_RESPONSE have to be processed synchronously and can not leave pending async work.
+
+Request_Queue_Limit_Per_Session_Exceeded=The request queue limit of the session is exceeded.
+
+MembershipPasswordFormat_Obsoleted=Unsecured Passwords Format Detected. The Membership Provider that contains the unsecure passwords format is: {0}. The obsoleted password format is: {1}. For more information, see https://go.microsoft.com/fwlink/?linkid=834784.
+
+Unhandled_Monitor_Exception=An unhandled exception occurred while executing '{0}' in '{1}'.
diff --git a/mcs/class/referencesource/System.Web/ThreadContext.cs b/mcs/class/referencesource/System.Web/ThreadContext.cs
index 2975040697e..bfd7b04d52b 100644
--- a/mcs/class/referencesource/System.Web/ThreadContext.cs
+++ b/mcs/class/referencesource/System.Web/ThreadContext.cs
@@ -61,7 +61,7 @@
/*
* !! IMPORTANT !!
- * Keep this logic in [....] with DisassociateFromCurrentThread and EnterExecutionContext.
+ * Keep this logic in sync with DisassociateFromCurrentThread and EnterExecutionContext.
*/
// attach http context to the call context
@@ -128,7 +128,7 @@
/*
* !! IMPORTANT !!
- * Keep this logic in [....] with AssociateWithCurrentThread and EnterExecutionContext.
+ * Keep this logic in sync with AssociateWithCurrentThread and EnterExecutionContext.
*/
Current = _originalThreadContextCurrent;
@@ -176,7 +176,7 @@
/*
* !! IMPORTANT !!
- * Keep this logic in [....] with AssociateWithCurrentThread and DisassociateFromCurrentThread.
+ * Keep this logic in sync with AssociateWithCurrentThread and DisassociateFromCurrentThread.
*/
// ExecutionContext.Run replaces the current impersonation token, so we need to impersonate
diff --git a/mcs/class/referencesource/System.Web/UI/DataSourceCache.cs b/mcs/class/referencesource/System.Web/UI/DataSourceCache.cs
index 6eae42a49a9..d88029dd96b 100644
--- a/mcs/class/referencesource/System.Web/UI/DataSourceCache.cs
+++ b/mcs/class/referencesource/System.Web/UI/DataSourceCache.cs
@@ -133,7 +133,7 @@ namespace System.Web.UI {
throw new InvalidOperationException(SR.GetString(SR.DataSourceCache_CacheMustBeEnabled));
}
- HttpRuntime.CacheInternal.Remove(key);
+ HttpRuntime.Cache.InternalCache.Remove(key);
}
@@ -151,7 +151,7 @@ namespace System.Web.UI {
throw new InvalidOperationException(SR.GetString(SR.DataSourceCache_CacheMustBeEnabled));
}
- return HttpRuntime.CacheInternal.Get(key);
+ return HttpRuntime.Cache.InternalCache.Get(key);
}
@@ -227,7 +227,11 @@ namespace System.Web.UI {
aggregateCacheDependency.Add(new CacheDependency[] { dependency });
}
- HttpRuntime.CacheInternal.UtcInsert(key, data, aggregateCacheDependency, utcAbsoluteExpiryTime, slidingExpiryTimeSpan);
+ HttpRuntime.Cache.InternalCache.Insert(key, data, new CacheInsertOptions() {
+ Dependencies = aggregateCacheDependency,
+ AbsoluteExpiration = utcAbsoluteExpiryTime,
+ SlidingExpiration = slidingExpiryTimeSpan
+ });
}
diff --git a/mcs/class/referencesource/System.Web/UI/HTMLTextWriter.cs b/mcs/class/referencesource/System.Web/UI/HTMLTextWriter.cs
index af76ac63b0e..b5c395a74f8 100644
--- a/mcs/class/referencesource/System.Web/UI/HTMLTextWriter.cs
+++ b/mcs/class/referencesource/System.Web/UI/HTMLTextWriter.cs
@@ -98,7 +98,7 @@ namespace System.Web.UI {
public const char StyleEqualsChar = ':';
public const string DefaultTabString = "\t";
- // The DesignerRegion attribute name must be kept in [....] with
+ // The DesignerRegion attribute name must be kept in sync with
// System.Web.UI.Design.DesignerRegion.DesignerRegionNameAttribute
internal const string DesignerRegionAttributeName = "_designerRegion";
diff --git a/mcs/class/referencesource/System.Web/UI/ObjectStateFormatter.cs b/mcs/class/referencesource/System.Web/UI/ObjectStateFormatter.cs
index 5eb66eae4cd..7e60b164e4a 100644
--- a/mcs/class/referencesource/System.Web/UI/ObjectStateFormatter.cs
+++ b/mcs/class/referencesource/System.Web/UI/ObjectStateFormatter.cs
@@ -189,7 +189,7 @@ namespace System.Web.UI {
return null;
}
- // Note: duplicated (somewhat) in GetMacKeyModifier, keep in [....]
+ // Note: duplicated (somewhat) in GetMacKeyModifier, keep in sync
// See that method for comments on why these modifiers are in place
List<string> specificPurposes = new List<string>() {
@@ -216,7 +216,7 @@ namespace System.Web.UI {
return null;
}
- // Note: duplicated (somewhat) in GetSpecificPurposes, keep in [....]
+ // Note: duplicated (somewhat) in GetSpecificPurposes, keep in sync
// Use the page's directory and class name as part of the key (ASURT 64044)
uint pageHashCode = _page.GetClientStateIdentifier();
diff --git a/mcs/class/referencesource/System.Web/UI/Page.cs b/mcs/class/referencesource/System.Web/UI/Page.cs
index 974680fd742..3fb98244712 100644
--- a/mcs/class/referencesource/System.Web/UI/Page.cs
+++ b/mcs/class/referencesource/System.Web/UI/Page.cs
@@ -195,7 +195,7 @@ public class Page: TemplateControl, IHttpHandler {
private const string PageSubmitScriptKey = "PageSubmitScript";
private const string PageReEnableControlsScriptKey = "PageReEnableControlsScript";
- // NOTE: Make sure this stays in [....] with MobilePage.PageRegisteredControlsThatRequirePostBackKey
+ // NOTE: Make sure this stays in sync with MobilePage.PageRegisteredControlsThatRequirePostBackKey
//
private const string PageRegisteredControlsThatRequirePostBackKey = "__ControlsRequirePostBackKey__";
@@ -3234,7 +3234,7 @@ window.onload = WebForm_RestoreScrollPosition;
bool changed;
// ListControl family controls call EnsureDataBound in consumer.LoadPostData, which could be an async call in 4.6.
- // LoadPostData, however, is a [....] method, which means we cannot await EnsureDataBound in the method.
+ // LoadPostData, however, is a sync method, which means we cannot await EnsureDataBound in the method.
// To workaround this, for ListControl family controls, we call EnsureDataBound before we call into LoadPostData.
if (AppSettings.EnableAsyncModelBinding && consumer is ListControl) {
var listControl = consumer as ListControl;
diff --git a/mcs/class/referencesource/System.Web/UI/WebControls/AdRotator.cs b/mcs/class/referencesource/System.Web/UI/WebControls/AdRotator.cs
index a5bd1f3890c..e69f94a310c 100644
--- a/mcs/class/referencesource/System.Web/UI/WebControls/AdRotator.cs
+++ b/mcs/class/referencesource/System.Web/UI/WebControls/AdRotator.cs
@@ -454,8 +454,8 @@ namespace System.Web.UI.WebControls {
// try to get it from the ASP.NET cache
string fileKey = CacheInternal.PrefixAdRotator + ((!String.IsNullOrEmpty(physicalPath)) ?
physicalPath : virtualPath.VirtualPathString);
- CacheInternal cacheInternal = System.Web.HttpRuntime.CacheInternal;
- AdRec [] adRecs = cacheInternal[fileKey] as AdRec[];
+ CacheStoreProvider cacheInternal = System.Web.HttpRuntime.Cache.InternalCache;
+ AdRec[] adRecs = cacheInternal.Get(fileKey) as AdRec[];
if (adRecs == null) {
// Otherwise load it
@@ -481,7 +481,7 @@ namespace System.Web.UI.WebControls {
if (dependency != null) {
using (dependency) {
// and store it in the cache, dependent on the file name
- cacheInternal.UtcInsert(fileKey, adRecs, dependency);
+ cacheInternal.Insert(fileKey, adRecs, new CacheInsertOptions() { Dependencies = dependency });
}
}
}
diff --git a/mcs/class/referencesource/System.Web/UI/WebControls/ChangePassword.cs b/mcs/class/referencesource/System.Web/UI/WebControls/ChangePassword.cs
index 4588444664e..cd906e11df0 100644
--- a/mcs/class/referencesource/System.Web/UI/WebControls/ChangePassword.cs
+++ b/mcs/class/referencesource/System.Web/UI/WebControls/ChangePassword.cs
@@ -1939,9 +1939,9 @@ namespace System.Web.UI.WebControls {
string cancelPageUrl = CancelDestinationPageUrl;
if (!String.IsNullOrEmpty(cancelPageUrl)) {
- // [....] suggested that we should not terminate execution of current page, to give
+ // Microsoft suggested that we should not terminate execution of current page, to give
// page a chance to cleanup its resources. This may be less performant though.
- // [....] suggested that we need to call ResolveClientUrl before redirecting.
+ // Microsoft suggested that we need to call ResolveClientUrl before redirecting.
// Example is this control inside user control, want redirect relative to user control dir.
Page.Response.Redirect(ResolveClientUrl(cancelPageUrl), false);
}
@@ -1993,9 +1993,9 @@ namespace System.Web.UI.WebControls {
string continuePageUrl = ContinueDestinationPageUrl;
if (!String.IsNullOrEmpty(continuePageUrl)) {
- // [....] suggested that we should not terminate execution of current page, to give
+ // Microsoft suggested that we should not terminate execution of current page, to give
// page a chance to cleanup its resources. This may be less performant though.
- // [....] suggested that we need to call ResolveClientUrl before redirecting.
+ // Microsoft suggested that we need to call ResolveClientUrl before redirecting.
// Example is this control inside user control, want redirect relative to user control dir.
Page.Response.Redirect(ResolveClientUrl(continuePageUrl), false);
}
@@ -2066,9 +2066,9 @@ namespace System.Web.UI.WebControls {
string successPageUrl = SuccessPageUrl;
if (!String.IsNullOrEmpty(successPageUrl)) {
- // [....] suggested that we should not terminate execution of current page, to give
+ // Microsoft suggested that we should not terminate execution of current page, to give
// page a chance to cleanup its resources. This may be less performant though.
- // [....] suggested that we need to call ResolveClientUrl before redirecting.
+ // Microsoft suggested that we need to call ResolveClientUrl before redirecting.
// Example is this control inside user control, want redirect relative to user control dir.
Page.Response.Redirect(ResolveClientUrl(successPageUrl), false);
}
diff --git a/mcs/class/referencesource/System.Web/UI/WebControls/DetailsView.cs b/mcs/class/referencesource/System.Web/UI/WebControls/DetailsView.cs
index c51c96272d6..268143d0896 100644
--- a/mcs/class/referencesource/System.Web/UI/WebControls/DetailsView.cs
+++ b/mcs/class/referencesource/System.Web/UI/WebControls/DetailsView.cs
@@ -2867,7 +2867,7 @@ namespace System.Web.UI.WebControls {
propertyChanged = true;
// since we can't go into insert mode in a callback, oldPageIndex should never be -1 and different from PageIndex
- Debug.Assert(oldPageIndex >= 0, "Page indeces are out of [....] from callback hidden field state");
+ Debug.Assert(oldPageIndex >= 0, "Page indeces are out of sync from callback hidden field state");
_pageIndex = oldPageIndex;
string oldDataKeyString = dataKey;
diff --git a/mcs/class/referencesource/System.Web/UI/WebControls/PasswordRecovery.cs b/mcs/class/referencesource/System.Web/UI/WebControls/PasswordRecovery.cs
index f75ce6aa4cd..a236ddde527 100644
--- a/mcs/class/referencesource/System.Web/UI/WebControls/PasswordRecovery.cs
+++ b/mcs/class/referencesource/System.Web/UI/WebControls/PasswordRecovery.cs
@@ -1569,9 +1569,9 @@ namespace System.Web.UI.WebControls {
private void PerformSuccessAction() {
string successPageUrl = SuccessPageUrl;
if (!String.IsNullOrEmpty(successPageUrl)) {
- // [....] suggested that we should not terminate execution of current page, to give
+ // Microsoft suggested that we should not terminate execution of current page, to give
// page a chance to cleanup its resources. This may be less performant though.
- // [....] suggested that we need to call ResolveClientUrl before redirecting.
+ // Microsoft suggested that we need to call ResolveClientUrl before redirecting.
// Example is this control inside user control, want redirect relative to user control dir.
Page.Response.Redirect(ResolveClientUrl(successPageUrl), false);
}
diff --git a/mcs/class/referencesource/System.Web/UI/WebControls/Wizard.cs b/mcs/class/referencesource/System.Web/UI/WebControls/Wizard.cs
index 4aa0a6f25b3..882c5adcec8 100644
--- a/mcs/class/referencesource/System.Web/UI/WebControls/Wizard.cs
+++ b/mcs/class/referencesource/System.Web/UI/WebControls/Wizard.cs
@@ -1876,9 +1876,9 @@ namespace System.Web.UI.WebControls {
string finishPageUrl = FinishDestinationPageUrl;
if (!String.IsNullOrEmpty(finishPageUrl)) {
- // [....] suggested that we should not terminate execution of current page, to give
+ // Microsoft suggested that we should not terminate execution of current page, to give
// page a chance to cleanup its resources. This may be less performant though.
- // [....] suggested that we need to call ResolveClientUrl before redirecting.
+ // Microsoft suggested that we need to call ResolveClientUrl before redirecting.
// Example is this control inside user control, want redirect relative to user control dir.
Page.Response.Redirect(ResolveClientUrl(finishPageUrl), false);
}
diff --git a/mcs/class/referencesource/System.Web/UI/WebControls/xml.cs b/mcs/class/referencesource/System.Web/UI/WebControls/xml.cs
index 93ec3e60d03..fd57f86d647 100644
--- a/mcs/class/referencesource/System.Web/UI/WebControls/xml.cs
+++ b/mcs/class/referencesource/System.Web/UI/WebControls/xml.cs
@@ -403,7 +403,7 @@ namespace System.Web.UI.WebControls {
string physicalPath;
ResolvePhysicalOrVirtualPath(_transformSource, out virtualPath, out physicalPath);
- CacheInternal cacheInternal = HttpRuntime.CacheInternal;
+ CacheStoreProvider cacheInternal = HttpRuntime.Cache.InternalCache;
string key = CacheInternal.PrefixLoadXPath + ((physicalPath != null) ?
physicalPath : virtualPath.VirtualPathString);
@@ -436,7 +436,8 @@ namespace System.Web.UI.WebControls {
// Cache it, but only if we got a dependency
if (dependency != null) {
using (dependency) {
- cacheInternal.UtcInsert(key, ((_compiledTransform == null) ? (object)_transform : (object)_compiledTransform), dependency);
+ cacheInternal.Insert(key, ((_compiledTransform == null) ? (object)_transform : (object)_compiledTransform),
+ new CacheInsertOptions() { Dependencies = dependency });
}
}
}
@@ -467,7 +468,7 @@ namespace System.Web.UI.WebControls {
// Make it absolute and check security
string physicalPath = MapPathSecure(_documentSource);
- CacheInternal cacheInternal = System.Web.HttpRuntime.CacheInternal;
+ CacheStoreProvider cacheInternal = System.Web.HttpRuntime.Cache.InternalCache;
string key = CacheInternal.PrefixLoadXml + physicalPath;
_document = (XmlDocument) cacheInternal.Get(key);
@@ -480,7 +481,7 @@ namespace System.Web.UI.WebControls {
_document = new XmlDocument();
_document.Load(XmlUtils.CreateXmlReader(stream, physicalPath));
- cacheInternal.UtcInsert(key, _document, dependency);
+ cacheInternal.Insert(key, _document, new CacheInsertOptions() { Dependencies = dependency });
}
}
else {
@@ -511,7 +512,7 @@ namespace System.Web.UI.WebControls {
string physicalPath;
ResolvePhysicalOrVirtualPath(_documentSource, out virtualPath, out physicalPath);
- CacheInternal cacheInternal = HttpRuntime.CacheInternal;
+ CacheStoreProvider cacheInternal = HttpRuntime.Cache.InternalCache;
string key = CacheInternal.PrefixLoadXPath + ((physicalPath != null) ?
physicalPath : virtualPath.VirtualPathString);
@@ -533,7 +534,7 @@ namespace System.Web.UI.WebControls {
// Cache it, but only if we got a dependency
if (dependency != null) {
using (dependency) {
- cacheInternal.UtcInsert(key, _xpathDocument, dependency);
+ cacheInternal.Insert(key, _xpathDocument, new CacheInsertOptions() { Dependencies = dependency });
}
}
}
diff --git a/mcs/class/referencesource/System.Web/UI/WebParts/CatalogZoneBase.cs b/mcs/class/referencesource/System.Web/UI/WebParts/CatalogZoneBase.cs
index 597b93fd564..46968b54da7 100644
--- a/mcs/class/referencesource/System.Web/UI/WebParts/CatalogZoneBase.cs
+++ b/mcs/class/referencesource/System.Web/UI/WebParts/CatalogZoneBase.cs
@@ -549,7 +549,7 @@ namespace System.Web.UI.WebControls.WebParts {
// Mozilla renders padding on an empty TD without this attribute
writer.AddStyleAttribute(HtmlTextWriterStyle.Padding, "0");
- // Add an extra row with height of 100%, to [....] up any extra space
+ // Add an extra row with height of 100%, to Microsoft up any extra space
// if the height of the zone is larger than its contents
// Mac IE needs height=100% set on <td> instead of <tr>
writer.AddStyleAttribute(HtmlTextWriterStyle.Height, "100%");
diff --git a/mcs/class/referencesource/System.Web/UI/WebParts/EditorPart.cs b/mcs/class/referencesource/System.Web/UI/WebParts/EditorPart.cs
index 66e4961126b..051143d5629 100644
--- a/mcs/class/referencesource/System.Web/UI/WebParts/EditorPart.cs
+++ b/mcs/class/referencesource/System.Web/UI/WebParts/EditorPart.cs
@@ -246,7 +246,7 @@ namespace System.Web.UI.WebControls.WebParts {
}
/// <devdoc>
- /// Called by the Zone when the EditorPart should [....] its values because other EditorParts
+ /// Called by the Zone when the EditorPart should sync its values because other EditorParts
/// may have changed control properties. This is only called after all the ApplyChanges have returned.
/// </devdoc>
public abstract void SyncChanges();
diff --git a/mcs/class/referencesource/System.Web/UI/WebParts/EditorZoneBase.cs b/mcs/class/referencesource/System.Web/UI/WebParts/EditorZoneBase.cs
index de13bd30076..ab7ee071b22 100644
--- a/mcs/class/referencesource/System.Web/UI/WebParts/EditorZoneBase.cs
+++ b/mcs/class/referencesource/System.Web/UI/WebParts/EditorZoneBase.cs
@@ -412,7 +412,7 @@ namespace System.Web.UI.WebControls.WebParts {
// Mozilla renders padding on an empty TD without this attribute
writer.AddStyleAttribute(HtmlTextWriterStyle.Padding, "0");
- // Add an extra row with height of 100%, to [....] up any extra space
+ // Add an extra row with height of 100%, to Microsoft up any extra space
// if the height of the zone is larger than its contents
// Mac IE needs height=100% set on <td> instead of <tr>
writer.AddStyleAttribute(HtmlTextWriterStyle.Height, "100%");
diff --git a/mcs/class/referencesource/System.Web/UI/WebParts/WebPartManager.cs b/mcs/class/referencesource/System.Web/UI/WebParts/WebPartManager.cs
index c5b3495230e..136ff0bf10f 100644
--- a/mcs/class/referencesource/System.Web/UI/WebParts/WebPartManager.cs
+++ b/mcs/class/referencesource/System.Web/UI/WebParts/WebPartManager.cs
@@ -2691,7 +2691,7 @@ if (zoneElement != null) {{
/// <devdoc>
/// Never throws except for null arguments. Returns an error message in the out parameter instead.
- /// [[....]] I investigated whether this could be refactored to share common code with
+ /// [Microsoft] I investigated whether this could be refactored to share common code with
/// LoadDynamicWebPart(), but it seems the methods are too different.
/// </devdoc>
public virtual WebPart ImportWebPart(XmlReader reader, out string errorMessage) {
diff --git a/mcs/class/referencesource/System.Web/UI/WebParts/WebPartZoneBase.cs b/mcs/class/referencesource/System.Web/UI/WebParts/WebPartZoneBase.cs
index 4fd1f72fd88..7dc790dc485 100644
--- a/mcs/class/referencesource/System.Web/UI/WebParts/WebPartZoneBase.cs
+++ b/mcs/class/referencesource/System.Web/UI/WebParts/WebPartZoneBase.cs
@@ -1261,7 +1261,7 @@ namespace System.Web.UI.WebControls.WebParts {
}
if (orientation == Orientation.Vertical) {
- // Add an extra row with height of 100%, to [....] up any extra space
+ // Add an extra row with height of 100%, to Microsoft up any extra space
// if the height of the zone is larger than its contents
writer.RenderBeginTag(HtmlTextWriterTag.Tr);
@@ -1276,7 +1276,7 @@ namespace System.Web.UI.WebControls.WebParts {
writer.RenderEndTag(); // Tr
}
else {
- // Add an extra cell with width of 100%, to [....] up any extra space
+ // Add an extra cell with width of 100%, to Microsoft up any extra space
// if the width of the zone is larger than its contents.
writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");
diff --git a/mcs/class/referencesource/System.Web/UnsafeNativeMethods.cs b/mcs/class/referencesource/System.Web/UnsafeNativeMethods.cs
index e6f4043758c..f31af9df330 100644
--- a/mcs/class/referencesource/System.Web/UnsafeNativeMethods.cs
+++ b/mcs/class/referencesource/System.Web/UnsafeNativeMethods.cs
@@ -663,7 +663,7 @@ namespace System.Web {
// List of functions supported by PMCallISAPI
//
// ATTENTION!!
- // If you change this list, make sure it is in [....] with the
+ // If you change this list, make sure it is in sync with the
// CallISAPIFunc enum in ecbdirect.h
//
internal enum CallISAPIFunc : int {
diff --git a/mcs/class/referencesource/System.Web/Util/AppSettings.cs b/mcs/class/referencesource/System.Web/Util/AppSettings.cs
index c0d44411004..d9a78e5da20 100644
--- a/mcs/class/referencesource/System.Web/Util/AppSettings.cs
+++ b/mcs/class/referencesource/System.Web/Util/AppSettings.cs
@@ -130,6 +130,9 @@ namespace System.Web.Util {
if (settings == null || !Boolean.TryParse(settings["aspnet:EnableAsyncModelBinding"], out _enableAsyncModelBinding))
_enableAsyncModelBinding = BinaryCompatibility.Current.TargetsAtLeastFramework46;
+ if (settings == null || !int.TryParse(settings["aspnet:RequestQueueLimitPerSession"], out _requestQueueLimitPerSession) || _requestQueueLimitPerSession < 0)
+ _requestQueueLimitPerSession = BinaryCompatibility.Current.TargetsAtLeastFramework463 ? DefaultRequestQueueLimitPerSession : UnlimitedRequestsPerSession;
+
_settingsInitialized = true;
}
}
@@ -492,5 +495,16 @@ namespace System.Web.Util {
return _enableAsyncModelBinding;
}
}
+
+ internal const int UnlimitedRequestsPerSession = Int32.MaxValue;
+ internal const int DefaultRequestQueueLimitPerSession = 50;
+ // Limit of queued requests per session
+ private static int _requestQueueLimitPerSession;
+ internal static int RequestQueueLimitPerSession {
+ get {
+ EnsureSettingsLoaded();
+ return _requestQueueLimitPerSession;
+ }
+ }
}
}
diff --git a/mcs/class/referencesource/System.Web/Util/AppVerifier.cs b/mcs/class/referencesource/System.Web/Util/AppVerifier.cs
index f45390c0d22..272ed3ee447 100644
--- a/mcs/class/referencesource/System.Web/Util/AppVerifier.cs
+++ b/mcs/class/referencesource/System.Web/Util/AppVerifier.cs
@@ -305,7 +305,7 @@
// BeginHandler hasn't yet returned, so this call may be synchronous or asynchronous.
// We can tell by comparing the current thread with the thread which called BeginHandler.
// From a correctness perspective, it is valid to invoke the AsyncCallback delegate either
- // synchronously or asynchronously. From [....]: if 'CompletedSynchronously = true', then
+ // synchronously or asynchronously. From Microsoft: if 'CompletedSynchronously = true', then
// AsyncCallback invocation can happen either on the same thread or on a different thread,
// just as long as BeginHandler hasn't yet returned (which in true in this case).
if (!asyncResult.CompletedSynchronously) {
diff --git a/mcs/class/referencesource/System.Web/Util/AspCompat.cs b/mcs/class/referencesource/System.Web/Util/AspCompat.cs
index 6a123dfbaf3..79343a26e07 100644
--- a/mcs/class/referencesource/System.Web/Util/AspCompat.cs
+++ b/mcs/class/referencesource/System.Web/Util/AspCompat.cs
@@ -300,7 +300,7 @@ internal class AspCompatApplicationStep : HttpApplication.IExecutionStep, IManag
return;
// try cache first
- CacheInternal cacheInternal = HttpRuntime.CacheInternal;
+ CacheStoreProvider cacheInternal = HttpRuntime.Cache.InternalCache;
String key = CacheInternal.PrefixAspCompatThreading + progidDisplayName;
String threadingModel = (String)cacheInternal.Get(key);
RegistryKey regKey = null;
@@ -321,7 +321,7 @@ internal class AspCompatApplicationStep : HttpApplication.IExecutionStep, IManag
if (threadingModel == null)
threadingModel = String.Empty;
- cacheInternal.UtcInsert(key, threadingModel);
+ cacheInternal.Insert(key, threadingModel, null);
}
if (StringUtil.EqualsIgnoreCase(threadingModel, "Apartment")) {
diff --git a/mcs/class/referencesource/System.Web/Util/BinaryCompatibility.cs b/mcs/class/referencesource/System.Web/Util/BinaryCompatibility.cs
index eabc339b8ee..f044f5af843 100644
--- a/mcs/class/referencesource/System.Web/Util/BinaryCompatibility.cs
+++ b/mcs/class/referencesource/System.Web/Util/BinaryCompatibility.cs
@@ -17,7 +17,13 @@ namespace System.Web.Util {
internal const string TargetFrameworkKey = "ASPNET_TARGETFRAMEWORK";
// quick accessor for the current AppDomain's instance
- public static readonly BinaryCompatibility Current = new BinaryCompatibility(AppDomain.CurrentDomain.GetData(TargetFrameworkKey) as FrameworkName);
+ public static readonly BinaryCompatibility Current;
+
+ static BinaryCompatibility() {
+ Current = new BinaryCompatibility(AppDomain.CurrentDomain.GetData(TargetFrameworkKey) as FrameworkName);
+
+ TelemetryLogger.LogTargetFramework(Current.TargetFramework);
+ }
public BinaryCompatibility(FrameworkName frameworkName) {
// parse version from FrameworkName, otherwise use a default value
@@ -32,6 +38,7 @@ namespace System.Web.Util {
TargetsAtLeastFramework452 = (version >= VersionUtil.Framework452);
TargetsAtLeastFramework46 = (version >= VersionUtil.Framework46);
TargetsAtLeastFramework461 = (version >= VersionUtil.Framework461);
+ TargetsAtLeastFramework463 = (version >= VersionUtil.Framework463);
}
public bool TargetsAtLeastFramework45 { get; private set; }
@@ -39,6 +46,7 @@ namespace System.Web.Util {
public bool TargetsAtLeastFramework452 { get; private set; }
public bool TargetsAtLeastFramework46 { get; private set; }
public bool TargetsAtLeastFramework461 { get; private set; }
+ public bool TargetsAtLeastFramework463 { get; private set; }
public Version TargetFramework { get; private set; }
diff --git a/mcs/class/referencesource/System.Web/Util/DateTimeUtil.cs b/mcs/class/referencesource/System.Web/Util/DateTimeUtil.cs
index 467907f3179..52335a1af15 100644
--- a/mcs/class/referencesource/System.Web/Util/DateTimeUtil.cs
+++ b/mcs/class/referencesource/System.Web/Util/DateTimeUtil.cs
@@ -8,9 +8,17 @@ namespace System.Web.Util {
using System;
+ internal enum TimeUnit {
+ Unknown = 0,
+ Days,
+ Hours,
+ Minutes,
+ Seconds,
+ Milliseconds
+ };
+
internal sealed class DateTimeUtil {
private DateTimeUtil() {}
-
const long FileTimeOffset = 504911232000000000;
static readonly DateTime MinValuePlusOneDay = DateTime.MinValue.AddDays(1);
static readonly DateTime MaxValueMinusOneDay = DateTime.MaxValue.AddDays(-1);
@@ -46,6 +54,26 @@ namespace System.Web.Util {
return utcTime.ToLocalTime();
}
+
+ static internal TimeSpan GetTimeoutFromTimeUnit(int timeoutValue, TimeUnit timeoutUnit) {
+ switch (timeoutUnit) {
+ case TimeUnit.Days:
+ return new TimeSpan(timeoutValue, 0, 0, 0);
+ case TimeUnit.Hours:
+ return new TimeSpan(timeoutValue, 0, 0);
+ case TimeUnit.Seconds:
+ return new TimeSpan(0, 0, timeoutValue);
+ case TimeUnit.Milliseconds:
+ return new TimeSpan(0, 0, 0, 0, timeoutValue);
+ case TimeUnit.Minutes:
+ return new TimeSpan(0, timeoutValue, 0);
+ case TimeUnit.Unknown:
+ default:
+ break;
+ }
+
+ throw new ArgumentException(SR.GetString(SR.InvalidArgumentValue, "timeoutUnit"));
+ }
}
}
diff --git a/mcs/class/referencesource/System.Web/Util/ParseHttpDate.cs b/mcs/class/referencesource/System.Web/Util/ParseHttpDate.cs
index f34ba5fcd78..0de88fe30ae 100644
--- a/mcs/class/referencesource/System.Web/Util/ParseHttpDate.cs
+++ b/mcs/class/referencesource/System.Web/Util/ParseHttpDate.cs
@@ -92,7 +92,7 @@ namespace System.Web.Util
} else if ( monthIndex == (sbyte) 'R' ) {
//
- // if s[1] is 'a' then [....], if 'p' then April
+ // if s[1] is 'a' then Microsoft, if 'p' then April
//
if ( s_monthIndexTable[(s[1 + startIndex]-0x40) & 0x3f] == (sbyte) 'A' ) {
diff --git a/mcs/class/referencesource/System.Web/Util/SecUtil.cs b/mcs/class/referencesource/System.Web/Util/SecUtil.cs
index 9a104eabbf5..db01aa65633 100644
--- a/mcs/class/referencesource/System.Web/Util/SecUtil.cs
+++ b/mcs/class/referencesource/System.Web/Util/SecUtil.cs
@@ -158,7 +158,7 @@ namespace System.Web.Util {
Hashtable values = new Hashtable(param.Length);
for (int i = param.Length - 1; i >= 0; i--) {
- SecUtility.CheckParameter(ref param[i], checkForNull, checkIfEmpty, checkForCommas, maxSize,
+ SecUtility.CheckParameter(ref param[i], checkForNull, checkIfEmpty, checkForCommas, maxSize,
paramName + "[ " + i.ToString(CultureInfo.InvariantCulture) + " ]");
if (values.Contains(param[i])) {
throw new ArgumentException(SR.GetString(SR.Parameter_duplicate_array_element, paramName), paramName);
@@ -215,6 +215,17 @@ namespace System.Web.Util {
return iValue;
}
+ internal static TimeUnit GetTimeoutUnit(NameValueCollection config, string valueName, TimeUnit defaultValue) {
+ TimeUnit unit;
+ string sValue = config[valueName];
+
+ if (sValue == null || !Enum.TryParse(sValue, out unit)) {
+ return defaultValue;
+ }
+
+ return unit;
+ }
+
internal static int? GetNullableIntValue(NameValueCollection config, string valueName) {
int iValue;
string sValue = config[valueName];
diff --git a/mcs/class/referencesource/System.Web/Util/VersionUtil.cs b/mcs/class/referencesource/System.Web/Util/VersionUtil.cs
index 5d485eabb75..36985525b76 100644
--- a/mcs/class/referencesource/System.Web/Util/VersionUtil.cs
+++ b/mcs/class/referencesource/System.Web/Util/VersionUtil.cs
@@ -24,6 +24,7 @@ namespace System.Web.Util {
public static readonly Version Framework452 = new Version(4, 5, 2);
public static readonly Version Framework46 = new Version(4, 6);
public static readonly Version Framework461 = new Version(4, 6, 1);
+ public static readonly Version Framework463 = new Version(4, 6, 3);
// Convenience accessor for the "default" framework version; various configuration
// switches can use this as a default value. This value must only be bumped during
diff --git a/mcs/class/referencesource/System.Web/cacheexpires.cspp b/mcs/class/referencesource/System.Web/cacheexpires.cspp
new file mode 100644
index 00000000000..fb5e3166500
--- /dev/null
+++ b/mcs/class/referencesource/System.Web/cacheexpires.cspp
@@ -0,0 +1,1328 @@
+//------------------------------------------------------------------------------
+// <copyright file="CacheExpires.cs" company="Microsoft">
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// </copyright>
+//------------------------------------------------------------------------------
+
+namespace System.Web.Caching {
+ using System.Runtime.InteropServices;
+ using System.Text;
+ using System.Threading;
+ using System.Web;
+ using System.Web.Util;
+ using System.Collections;
+
+
+ // ExpiresEntryRef defines a reference to a ExpiresEntry in the ExpiresBucket data structure.
+ // An entry is identified by its index into the ExpiresBucket._pages array, and its
+ // index into the ExpiresPage._entries array.
+ //
+ // Bytes 0-7 of the reference are for the index into the ExpiresPage._entries array.
+ // Bytes 8-31 of the reference are for the index into the ExpiresBucket._pages array.
+ //
+ struct ExpiresEntryRef {
+ // The invalid reference is 0.
+ static internal readonly ExpiresEntryRef INVALID = new ExpiresEntryRef(0, 0);
+
+ const uint ENTRY_MASK = 0x000000ffu;
+ const uint PAGE_MASK = 0xffffff00u;
+ const int PAGE_SHIFT = 8;
+
+ uint _ref;
+
+ internal ExpiresEntryRef(int pageIndex, int entryIndex) {
+ Debug.Assert((pageIndex & 0x00ffffff) == pageIndex, "(pageIndex & 0x00ffffff) == pageIndex");
+ Debug.Assert((entryIndex & ENTRY_MASK) == entryIndex, "(entryIndex & ENTRY_MASK) == entryIndex");
+ Debug.Assert(entryIndex != 0 || pageIndex == 0, "entryIndex != 0 || pageIndex == 0");
+
+ _ref = ( (((uint)pageIndex) << PAGE_SHIFT) | (((uint)(entryIndex)) & ENTRY_MASK) );
+ }
+
+ public override bool Equals(object value) {
+ if (value is ExpiresEntryRef) {
+ return _ref == ((ExpiresEntryRef)value)._ref;
+ }
+
+ return false;
+ }
+#if NOT_USED
+ public static bool Equals(ExpiresEntryRef r1, ExpiresEntryRef r2) {
+ return r1._ref == r2._ref;
+ }
+#endif
+ public static bool operator !=(ExpiresEntryRef r1, ExpiresEntryRef r2) {
+ return r1._ref != r2._ref;
+ }
+ public static bool operator ==(ExpiresEntryRef r1, ExpiresEntryRef r2) {
+ return r1._ref == r2._ref;
+ }
+
+ public override int GetHashCode() {
+ return (int) _ref;
+ }
+
+#if DBG
+ public override string ToString() {
+ return PageIndex + ":" + Index;
+ }
+#endif
+
+ // The index into the ExpiresBucket._pages array.
+ internal int PageIndex {
+ get {
+ int result = (int) (_ref >> PAGE_SHIFT);
+ return result;
+ }
+ }
+
+
+ // The index into the _entries array.
+ internal int Index {
+ get {
+ int result = (int) (_ref & ENTRY_MASK);
+ return result;
+ }
+ }
+
+ // Is the reference invalid?
+ internal bool IsInvalid {
+ get {
+ return _ref == 0;
+ }
+ }
+ }
+
+ // overhead is 12 bytes
+ [StructLayout(LayoutKind.Explicit)]
+ struct ExpiresEntry {
+ // _utcExpires holds the expiration time of the item.
+ // When an ExpiresEntry is not in use, _utcExpires is
+ // no longer needed, so we can use its memory to hold
+ // an index into the page's free list, and a count
+ // of free entries and whether or not it is on an expires list.
+ [FieldOffset(0)]
+ internal DateTime _utcExpires; // expires
+
+ [FieldOffset(0)]
+ internal ExpiresEntryRef _next; // free list
+
+ [FieldOffset(4)]
+ internal int _cFree; // count of free entries in list at expires[0]
+ // 1 if inFlush, 0 if free
+ [FieldOffset(8)]
+ internal CacheEntry _cacheEntry; // cache entry
+ }
+
+ // A page to hold the array of ExpiresEntry.
+ struct ExpiresPage {
+ internal ExpiresEntry[] _entries; // array of ExpiresEntry.
+ internal int _pageNext; // next page on the free page or free entry list
+ internal int _pagePrev; // prev page on the free page or free entry list
+ }
+
+ // A list of ExpiresPages.
+ struct ExpiresPageList {
+ internal int _head; // head of list
+ internal int _tail; // tail of list
+ }
+
+ //
+ // Class ExpiresBucket contains all the entries that expire within a given interval
+ // every cycle of buckets.
+ //
+ // For example, if the inverval length is 20 seconds, and there are 60 buckets,
+ // then bucket 4 will contain all items that expire between:
+ // 00:01:20 and 00:01:40
+ // 00:21:20 and 00:21:40
+ // 00:41:20 and 00:41:40
+ // 01:01:20 and 01:01:40
+ // ...
+ //
+ // When we flush expired items, we need to examine every item in every bucket to
+ // determine its expiration time. We potentially call FlushExpiredItems() every time
+ // we need to trim items from the cache when there is memory pressure, which can
+ // occur several times a second.
+ //
+ // To avoid a full scan on every call to FlushExpiredItems(), we maintain a count
+ // of the items that expire within the first interval since the last full scan, and
+ // only scan all entries in the bucket when there are items to flush. The first
+ // interval is split into smaller intervals, and counts are kept of all items that need to
+ // be flushed up to the time of that interval.
+ //
+ // Continuing with the example above, the first interval would be split into
+ // 4 intervals of 5 seconds:
+ //
+ // If the last full scan occurred at 00:01:20 ...
+ // _counts[0] contains the number of items expiring before 00:01:25
+ // _counts[1] contains the number of items expiring before 00:01:30
+ // _counts[2] contains the number of items expiring before 00:01:35
+ // _counts[3] contains the number of items expiring before 00:01:40
+ //
+ // If there were 3 items in this bucket expiring at 00:01:27, 00:01:31, and 00:01:34 ...
+ // _counts[0] == 0
+ // _counts[1] == 1
+ // _counts[2] == 3
+ // _counts[3] == 3
+ //
+ // We further reduce the number of scans by keeping the minimum expiration time
+ // of an item in the bucket. If FlushExpiredItems() is called before the minimum
+ // expiration time, we do not need to perform the scan. Note that if the item with the
+ // minimum expiration time is removed, we do not update the minimum expiration time,
+ // so it is only a heuristic.
+ //
+ sealed class ExpiresBucket {
+ // We use _entries[0] to hold the head of the free list, and the count of items in the free list.
+ internal const int NUM_ENTRIES = 127;
+ const int LENGTH_ENTRIES = 128;
+
+ const int MIN_PAGES_INCREMENT = 10;
+ const int MAX_PAGES_INCREMENT = 340; // (size of a page on x86) / (12 bytes per UsagePage)
+ const double MIN_LOAD_FACTOR = 0.5; // minimum ratio of used to total entries before we will reduce
+
+ const int COUNTS_LENGTH=4; // length of _counts array
+
+ // timespan represented by each count entry
+ static readonly TimeSpan COUNT_INTERVAL= new TimeSpan(CacheExpires._tsPerBucket.Ticks / COUNTS_LENGTH);
+
+ readonly CacheExpires _cacheExpires; // parent CacheExpires object
+ readonly byte _bucket; // index of this bucket
+
+ ExpiresPage[] _pages; // page array
+
+#if IA64
+ volatile
+#endif
+ int _cEntriesInUse; // count of ExpiresEntry's in use
+#if IA64
+ volatile
+#endif
+ int _cPagesInUse; // count of ExpiresPage's in use
+#if IA64
+ volatile
+#endif
+ int _cEntriesInFlush; // count of ExpiresEntry's in process of being flushed
+#if IA64
+ volatile
+#endif
+ int _minEntriesInUse; // minimum number of entries in use before we reduce
+
+ ExpiresPageList _freePageList; // list of free pages (_entries == null)
+ ExpiresPageList _freeEntryList; // list of pages with free entries (entry.FreeCountCount > 0)
+
+#if IA64
+ volatile
+#endif
+ bool _blockReduce; // block calls to Reduce() while in FlushExpiredItems
+
+ // Minimum expiration date of the items in this bucket.
+ // Note that it is only a heursitic - if an item that is
+ // the minimum is removed, the minimum will not be updated.
+ // The minimum is reset when the bucket is flushed.
+ DateTime _utcMinExpires;
+
+ // An exact count of the number of items that expire in the first period
+ // since the last full scan. We use this to determine whether or not to
+ // flush expired items when we are trimming items from the cache.
+ int[] _counts;
+
+ // The last time a flush occured, at which time we recalculate the counts.
+ DateTime _utcLastCountReset;
+
+ internal ExpiresBucket(CacheExpires cacheExpires, byte bucket, DateTime utcNow) {
+ _cacheExpires = cacheExpires;
+ _bucket = bucket;
+ _counts = new int[COUNTS_LENGTH];
+ ResetCounts(utcNow);
+ InitZeroPages();
+
+ Debug.Validate("CacheValidateExpires", this);
+ }
+
+ void InitZeroPages() {
+ Debug.Assert(_cPagesInUse == 0, "_cPagesInUse == 0");
+ Debug.Assert(_cEntriesInUse == 0, "_cEntriesInUse == 0");
+ Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0");
+
+ _pages = null;
+ _minEntriesInUse = -1;
+ _freePageList._head = -1;
+ _freePageList._tail = -1;
+ _freeEntryList._head = -1;
+ _freeEntryList._tail = -1;
+ }
+
+// Use macros so that the code is inlined in the function
+#define EntriesI(i) (_pages[(i)]._entries)
+
+#define EntriesR(entryRef) (_pages[(entryRef.PageIndex)]._entries)
+
+#define PagePrev(i) (_pages[(i)]._pagePrev)
+
+#define PageNext(i) (_pages[(i)]._pageNext)
+
+#define FreeEntryHead(entries) ((entries)[0]._next)
+
+#define FreeEntryCount(entries) ((entries)[0]._cFree)
+
+#if DBG
+ bool EntryIsFree(ExpiresEntryRef entryRef) {
+ return EntriesR(entryRef)[entryRef.Index]._cacheEntry == null;
+ }
+#endif
+
+ // Reset the counts array and min expiration time.
+ void ResetCounts(DateTime utcNow) {
+ _utcLastCountReset = utcNow;
+ _utcMinExpires = DateTime.MaxValue;
+
+ for (int i = 0; i < _counts.Length; i++) {
+ _counts[i] = 0;
+ }
+ }
+
+ // Return the index into the _counts array of all items that
+ // expire by the given expiration time. Note that the index
+ // may be larger than the length of the array.
+ int GetCountIndex(DateTime utcExpires) {
+ return Math.Max(0, (int) ((utcExpires - _utcLastCountReset).Ticks / COUNT_INTERVAL.Ticks));
+ }
+
+ // Add counts for the expiration time.
+ void AddCount(DateTime utcExpires) {
+ int ci = GetCountIndex(utcExpires);
+ for (int i = _counts.Length - 1; i >= ci; i--) {
+ _counts[i]++;
+ }
+
+ if (utcExpires < _utcMinExpires) {
+ _utcMinExpires = utcExpires;
+ }
+ }
+
+ // Remove counts for the expiration time
+ void RemoveCount(DateTime utcExpires) {
+ int ci = GetCountIndex(utcExpires);
+ for (int i = _counts.Length - 1; i >= ci; i--) {
+ _counts[i]--;
+ }
+ }
+
+ // Get the number of items that expire before utcExpires.
+ int GetExpiresCount(DateTime utcExpires) {
+ if (utcExpires < _utcMinExpires)
+ return 0;
+
+ int ci = GetCountIndex(utcExpires);
+ if (ci >= _counts.Length)
+ return _cEntriesInUse;
+
+ return _counts[ci];
+ }
+
+ // Add a page to the head of a list.
+ void AddToListHead(int pageIndex, ref ExpiresPageList list) {
+ Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)");
+
+ PagePrev(pageIndex) = -1;
+ PageNext(pageIndex) = list._head;
+ if (list._head != -1) {
+ Debug.Assert(PagePrev(list._head) == -1, "PagePrev(list._head) == -1");
+ PagePrev(list._head) = pageIndex;
+ }
+ else {
+ list._tail = pageIndex;
+ }
+
+ list._head = pageIndex;
+ }
+
+ // Add a page to the tail of a list.
+ void AddToListTail(int pageIndex, ref ExpiresPageList list) {
+ Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)");
+
+ PageNext(pageIndex) = -1;
+ PagePrev(pageIndex) = list._tail;
+ if (list._tail != -1) {
+ Debug.Assert(PageNext(list._tail) == -1, "PageNext(list._tail) == -1");
+ PageNext(list._tail) = pageIndex;
+ }
+ else {
+ list._head = pageIndex;
+ }
+
+ list._tail = pageIndex;
+ }
+
+ // Remove a page from the head of a list.
+ int RemoveFromListHead(ref ExpiresPageList list) {
+ Debug.Assert(list._head != -1, "list._head != -1");
+
+ int oldHead = list._head;
+ RemoveFromList(oldHead, ref list);
+ return oldHead;
+ }
+
+ // Remove a page from the list.
+ void RemoveFromList(int pageIndex, ref ExpiresPageList list) {
+ Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)");
+
+ if (PagePrev(pageIndex) != -1) {
+ Debug.Assert(PageNext(PagePrev(pageIndex)) == pageIndex, "PageNext(PagePrev(pageIndex)) == pageIndex");
+ PageNext(PagePrev(pageIndex)) = PageNext(pageIndex);
+ }
+ else {
+ Debug.Assert(list._head == pageIndex, "list._head == pageIndex");
+ list._head = PageNext(pageIndex);
+ }
+
+ if (PageNext(pageIndex) != -1) {
+ Debug.Assert(PagePrev(PageNext(pageIndex)) == pageIndex, "PagePrev(PageNext(pageIndex)) == pageIndex");
+ PagePrev(PageNext(pageIndex)) = PagePrev(pageIndex);
+ }
+ else {
+ Debug.Assert(list._tail == pageIndex, "list._tail == pageIndex");
+ list._tail = PagePrev(pageIndex);
+ }
+
+ PagePrev(pageIndex) = -1;
+ PageNext(pageIndex) = -1;
+ }
+
+ // Move a page to the head of the list
+ void MoveToListHead(int pageIndex, ref ExpiresPageList list) {
+ Debug.Assert(list._head != -1, "list._head != -1");
+ Debug.Assert(list._tail != -1, "list._tail != -1");
+
+ // already at head?
+ if (list._head == pageIndex)
+ return;
+
+ // remove from list
+ RemoveFromList(pageIndex, ref list);
+
+ // add to head
+ AddToListHead(pageIndex, ref list);
+ }
+
+ // Move to the tail of the list
+ void MoveToListTail(int pageIndex, ref ExpiresPageList list) {
+ Debug.Assert(list._head != -1, "list._head != -1");
+ Debug.Assert(list._tail != -1, "list._tail != -1");
+
+ // already at tail?
+ if (list._tail == pageIndex)
+ return;
+
+ // remove from list
+ RemoveFromList(pageIndex, ref list);
+
+ // add to head
+ AddToListTail(pageIndex, ref list);
+ }
+
+ // Update _minEntriesInUse when _cPagesInUse changes.
+ // When _cEntriesInUse falls below _minEntriesInUse,
+ // a call to Reduce() will consolidate entries onto fewer pages.
+ // If _minEntries == -1, then a call to Reduce() will never reduce the number of pages.
+ void UpdateMinEntries() {
+ if (_cPagesInUse <= 1) {
+ _minEntriesInUse = -1;
+ }
+ else {
+ int capacity = _cPagesInUse * NUM_ENTRIES;
+ Debug.Assert(capacity > 0, "capacity > 0");
+ Debug.Assert(MIN_LOAD_FACTOR < 1.0, "MIN_LOAD_FACTOR < 1.0");
+
+ _minEntriesInUse = (int) (capacity * MIN_LOAD_FACTOR);
+
+ // Don't allow a reduce if there are not enough free entries to
+ // remove a page.
+ if ((_minEntriesInUse - 1) > ((_cPagesInUse - 1) * NUM_ENTRIES)) {
+ _minEntriesInUse = -1;
+ }
+ }
+
+#if DBG
+ if (Debug.IsTagPresent("CacheExpiresNoReduce") && Debug.IsTagEnabled("CacheExpiresNoReduce")) {
+ _minEntriesInUse = -1;
+ }
+#endif
+
+ }
+
+ // Remove a ExpiresPage that is in use, and put in on the list of free pages.
+ void RemovePage(int pageIndex) {
+ Debug.Assert(FreeEntryCount(EntriesI(pageIndex)) == NUM_ENTRIES, "FreeEntryCount(EntriesI(pageIndex)) == NUM_ENTRIES");
+
+ // release the page from the free entries list
+ RemoveFromList(pageIndex, ref _freeEntryList);
+
+ // Add the page to the free pages list
+ AddToListHead(pageIndex, ref _freePageList);
+
+ // remove reference to page
+ Debug.Assert(EntriesI(pageIndex) != null, "EntriesI(pageIndex) != null");
+ EntriesI(pageIndex) = null;
+
+ // decrement count of pages and update _cMinEntriesInUse
+ _cPagesInUse--;
+ if (_cPagesInUse == 0) {
+ InitZeroPages();
+ }
+ else {
+ UpdateMinEntries();
+ }
+ }
+
+ // Get a free ExpiresEntry.
+ ExpiresEntryRef GetFreeExpiresEntry() {
+ // get the page of the free entry
+ Debug.Assert(_freeEntryList._head >= 0, "_freeEntryList._head >= 0");
+ int pageIndex = _freeEntryList._head;
+
+ // get a free entry from _entries
+ ExpiresEntry[] entries = EntriesI(pageIndex);
+ int entryIndex = FreeEntryHead(entries).Index;
+
+ // fixup free list and count
+ FreeEntryHead(entries) = entries[entryIndex]._next;
+ FreeEntryCount(entries)--;
+ if (FreeEntryCount(entries) == 0) {
+ // remove page from list of free pages
+ Debug.Assert(FreeEntryHead(entries).IsInvalid, "FreeEntryHead(entries).IsInvalid");
+ RemoveFromList(pageIndex, ref _freeEntryList);
+ }
+
+#if DBG
+ Debug.Assert(EntryIsFree(new ExpiresEntryRef(pageIndex, entryIndex)), "EntryIsFree(new ExpiresEntryRef(pageIndex, entryIndex))");
+ if (!FreeEntryHead(entries).IsInvalid) {
+ Debug.Assert(FreeEntryHead(entries).Index != entryIndex, "FreeEntryHead(entries).Index != entryIndex");
+ Debug.Assert(EntryIsFree(new ExpiresEntryRef(pageIndex, FreeEntryHead(entries).Index)), "EntryIsFree(new ExpiresEntryRef(pageIndex, FreeEntryHead(entries).Index))");
+ }
+#endif
+
+ return new ExpiresEntryRef(pageIndex, entryIndex);
+ }
+
+
+ // Add a ExpiresEntry to the free entry list.
+ void AddExpiresEntryToFreeList(ExpiresEntryRef entryRef) {
+ ExpiresEntry[] entries = EntriesR(entryRef);
+ int entryIndex = entryRef.Index;
+
+ Debug.Assert(entries[entryIndex]._cacheEntry == null, "entries[entryIndex]._cacheEntry == null");
+ entries[entryIndex]._cFree = 0;
+
+ entries[entryIndex]._next = FreeEntryHead(entries);
+ FreeEntryHead(entries) = entryRef;
+
+ _cEntriesInUse--;
+ int pageIndex = entryRef.PageIndex;
+ FreeEntryCount(entries)++;
+ if (FreeEntryCount(entries) == 1) {
+ // add page to head of list of free pages
+ AddToListHead(pageIndex, ref _freeEntryList);
+ }
+ else if (FreeEntryCount(entries) == NUM_ENTRIES) {
+ RemovePage(pageIndex);
+ }
+ }
+
+ // Expand the capacity of the ExpiresBucket to hold more CacheEntry's.
+ // We will need to allocate a new page, and perhaps expand the _pages array.
+ // Note that we never collapse the _pages array.
+ void Expand() {
+ Debug.Assert(_cPagesInUse * NUM_ENTRIES == _cEntriesInUse, "_cPagesInUse * NUM_ENTRIES == _cEntriesInUse");
+ Debug.Assert(_freeEntryList._head == -1, "_freeEntryList._head == -1");
+ Debug.Assert(_freeEntryList._tail == -1, "_freeEntryList._tail == -1");
+
+ // exapnd _pages if there are no more
+ if (_freePageList._head == -1) {
+ // alloc new pages array
+ int oldLength;
+ if (_pages == null) {
+ oldLength = 0;
+ }
+ else {
+ oldLength = _pages.Length;
+ }
+
+ Debug.Assert(_cPagesInUse == oldLength, "_cPagesInUse == oldLength");
+ Debug.Assert(_cEntriesInUse == oldLength * NUM_ENTRIES, "_cEntriesInUse == oldLength * ExpiresEntryRef.NUM_ENTRIES");
+
+ int newLength = oldLength * 2;
+ newLength = Math.Max(oldLength + MIN_PAGES_INCREMENT, newLength);
+ newLength = Math.Min(newLength, oldLength + MAX_PAGES_INCREMENT);
+ Debug.Assert(newLength > oldLength, "newLength > oldLength");
+
+ ExpiresPage[] newPages = new ExpiresPage[newLength];
+
+ // copy original pages
+ for (int i = 0; i < oldLength; i++) {
+ newPages[i] = _pages[i];
+ }
+
+ // setup free list of new pages
+ for (int i = oldLength; i < newPages.Length; i++) {
+ newPages[i]._pagePrev = i - 1;
+ newPages[i]._pageNext = i + 1;
+ }
+
+ newPages[oldLength]._pagePrev = -1;
+ newPages[newPages.Length - 1]._pageNext = -1;
+
+ // use new pages array
+ _freePageList._head = oldLength;
+ _freePageList._tail = newPages.Length - 1;
+
+ _pages = newPages;
+ }
+
+ // move from free page list to free entries list
+ int pageIndex = RemoveFromListHead(ref _freePageList);
+ AddToListHead(pageIndex, ref _freeEntryList);
+
+ // create the entries
+ ExpiresEntry[] entries = new ExpiresEntry[LENGTH_ENTRIES];
+ FreeEntryCount(entries) = NUM_ENTRIES;
+
+ // init free list
+ for (int i = 0; i < entries.Length - 1; i++) {
+ entries[i]._next = new ExpiresEntryRef(pageIndex, i + 1);
+ }
+ entries[entries.Length - 1]._next = ExpiresEntryRef.INVALID;
+
+ EntriesI(pageIndex) = entries;
+
+ // increment count of pages and update _minEntriesInUse
+ _cPagesInUse++;
+ UpdateMinEntries();
+ }
+
+ // Consolidate ExpiresEntry's onto fewer pages when there are too many
+ // free entries.
+ void Reduce() {
+ // Test if we need to consolidate.
+ if (_cEntriesInUse >= _minEntriesInUse || _blockReduce)
+ return;
+
+ Debug.Assert(_freeEntryList._head != -1, "_freeEntryList._head != -1");
+ Debug.Assert(_freeEntryList._tail != -1, "_freeEntryList._tail != -1");
+ Debug.Assert(_freeEntryList._head != _freeEntryList._tail, "_freeEntryList._head != _freeEntryList._tail");
+
+ // Rearrange free page list to put pages with more free entries at the tail
+ int meanFree = (int) (NUM_ENTRIES - (NUM_ENTRIES * MIN_LOAD_FACTOR));
+ int pageIndexLast = _freeEntryList._tail;
+ int pageIndexCurrent = _freeEntryList._head;
+ int pageIndexNext;
+ ExpiresEntry[] entries;
+
+ for (;;) {
+ pageIndexNext = PageNext(pageIndexCurrent);
+
+ // move pages with greater than mean number
+ // of free items to tail, move the others to head
+ if (FreeEntryCount(EntriesI(pageIndexCurrent)) > meanFree) {
+ MoveToListTail(pageIndexCurrent, ref _freeEntryList);
+ }
+ else {
+ MoveToListHead(pageIndexCurrent, ref _freeEntryList);
+ }
+
+ // check if entire list has been examined
+ if (pageIndexCurrent == pageIndexLast)
+ break;
+
+ // iterate
+ pageIndexCurrent = pageIndexNext;
+ }
+
+ // Move entries from the free pages at the tail to the
+ // free pages at the front, and release the free pages at the tail.
+ for (;;) {
+ // See if there is room left to move entries used by the page.
+ if (_freeEntryList._tail == -1)
+ break;
+
+ entries = EntriesI(_freeEntryList._tail);
+ Debug.Assert(FreeEntryCount(entries) > 0, "FreeEntryCount(entries) > 0");
+ int availableFreeEntries = (_cPagesInUse * NUM_ENTRIES) - FreeEntryCount(entries) - _cEntriesInUse;
+ if (availableFreeEntries < (NUM_ENTRIES - FreeEntryCount(entries)))
+ break;
+
+ // Move each entry from the page at the tail to a page at the head.
+ for (int i = 1; i < entries.Length; i++) {
+ // skip the free entries
+ if (entries[i]._cacheEntry == null)
+ continue;
+
+ // get a free ExpiresEntry from the head of the list.
+ Debug.Assert(_freeEntryList._head != _freeEntryList._tail, "_freeEntryList._head != _freeEntryList._tail");
+ ExpiresEntryRef newRef = GetFreeExpiresEntry();
+ Debug.Assert(newRef.PageIndex != _freeEntryList._tail, "newRef.PageIndex != _freeEntryList._tail");
+
+ // update the CacheEntry
+ CacheEntry cacheEntry = entries[i]._cacheEntry;
+
+#if DBG
+ ExpiresEntryRef oldRef = new ExpiresEntryRef(_freeEntryList._tail, i);
+ Debug.Assert(cacheEntry.ExpiresEntryRef == oldRef, "cacheEntry.ExpiresEntryRef == oldRef");
+#endif
+
+ cacheEntry.ExpiresEntryRef = newRef;
+
+ // copy old entry to new entry
+ ExpiresEntry[] newEntries = EntriesR(newRef);
+ newEntries[newRef.Index] = entries[i];
+
+ // Update free entry count for debugging. We don't bother
+ // to fix up the free entry list for this page as we are
+ // going to release the page.
+ FreeEntryCount(entries)++;
+ }
+
+ // now the page is free - release its memory
+ RemovePage(_freeEntryList._tail);
+
+ Debug.Validate("CacheValidateExpires", this);
+ }
+ }
+
+ // Add an entry to the bucket. This may occur the first time an item is added to the cache,
+ // or when the CacheEntry has a sliding expiration and is moved from one bucket to another.
+ internal void AddCacheEntry(CacheEntry cacheEntry) {
+ lock (this) {
+ // Test if the item is still added to the cache. When CacheExpires.UtcUpdate() is called,
+ // the item is removed from CacheExpires, and the CacheEntry could be removed by Cache.Remove()
+ // on another thread while we are in this function.
+ if ((cacheEntry.State & (CacheEntry.EntryState.AddedToCache | CacheEntry.EntryState.AddingToCache)) == 0)
+ return;
+
+ // If item is already added to a bucket, do nothing.
+ ExpiresEntryRef entryRef = cacheEntry.ExpiresEntryRef;
+ Debug.Assert((cacheEntry.ExpiresBucket == 0xff) == entryRef.IsInvalid, "(cacheEntry.ExpiresBucket == 0xff) == entryRef.IsInvalid");
+ if (cacheEntry.ExpiresBucket != 0xff || !entryRef.IsInvalid)
+ return;
+
+ // Expand if there are no free ExpiresEntry's available.
+ if (_freeEntryList._head == -1) {
+ Expand();
+ }
+
+ // get the free entry
+ ExpiresEntryRef freeRef = GetFreeExpiresEntry();
+ Debug.Assert(cacheEntry.ExpiresBucket == 0xff, "cacheEntry.ExpiresBucket == 0xff");
+ Debug.Assert(cacheEntry.ExpiresEntryRef.IsInvalid, "cacheEntry.ExpiresEntryRef.IsInvalid");
+ cacheEntry.ExpiresBucket = _bucket;
+ cacheEntry.ExpiresEntryRef = freeRef;
+
+ // initialize index
+ ExpiresEntry[] entries = EntriesR(freeRef);
+ int entryIndex = freeRef.Index;
+ entries[entryIndex]._cacheEntry = cacheEntry;
+ entries[entryIndex]._utcExpires = cacheEntry.UtcExpires;
+
+ // update the count
+ AddCount(cacheEntry.UtcExpires);
+
+ _cEntriesInUse++;
+
+#if DBG
+ {
+ Debug.Trace("CacheExpiresAdd",
+ "Added item=" + cacheEntry.Key +
+ ",_bucket=" + _bucket +
+ ",_ref=" + freeRef +
+ ",now=" + Debug.FormatLocalDate(DateTime.Now) +
+ ",expires=" + DateTimeUtil.ConvertToLocalTime(cacheEntry.UtcExpires));
+
+ Debug.Validate("CacheValidateExpires", this);
+ Debug.Dump("CacheExpiresAdd", this);
+ }
+#endif
+
+ // Test again if the item is still added to the cache. When an update occurs,
+ // the item is removed from CacheExpires, and the CacheEntry could be removed
+ // on another thread while we are in this function.
+ // Since we don't know whether or not CacheSingle.UpdateCache has called CacheExpires.Remove(),
+ // we remove the item ourselves. RemoveCacheEntryNoLock protects itself against more than
+ // one remove of the cache item.
+ if ((cacheEntry.State & (CacheEntry.EntryState.AddedToCache | CacheEntry.EntryState.AddingToCache)) == 0) {
+ RemoveCacheEntryNoLock(cacheEntry);
+ }
+ }
+ }
+
+ // Remove an item from the bucket. The caller must have a lock.
+ void RemoveCacheEntryNoLock(CacheEntry cacheEntry) {
+ ExpiresEntryRef entryRef = cacheEntry.ExpiresEntryRef;
+ if (cacheEntry.ExpiresBucket != _bucket || entryRef.IsInvalid)
+ return;
+
+ ExpiresEntry[] entries = EntriesR(entryRef);
+ int entryIndex = entryRef.Index;
+
+#if DBG
+ Debug.Assert(cacheEntry == entries[entryIndex]._cacheEntry, "cacheEntry == entries[entryIndex]._cacheEntry");
+#endif
+
+ // update Count
+ RemoveCount(entries[entryIndex]._utcExpires);
+
+ // update the cache entry
+ cacheEntry.ExpiresBucket = 0xff;
+ cacheEntry.ExpiresEntryRef = ExpiresEntryRef.INVALID;
+ entries[entryIndex]._cacheEntry = null;
+
+ // add to free list
+ AddExpiresEntryToFreeList(entryRef);
+
+ // reset count if able
+ if (_cEntriesInUse == 0) {
+ ResetCounts(DateTime.UtcNow);
+ }
+
+ // remove pages if necessary
+ Reduce();
+
+ Debug.Trace("CacheExpiresRemove",
+ "Removed item=" + cacheEntry.Key +
+ ",_bucket=" + _bucket +
+ ",ref=" + entryRef +
+ ",now=" + Debug.FormatLocalDate(DateTime.Now) +
+ ",expires=" + DateTimeUtil.ConvertToLocalTime(cacheEntry.UtcExpires));
+
+
+ Debug.Validate("CacheValidateExpires", this);
+ Debug.Dump("CacheExpiresRemove", this);
+ }
+
+ // Remove an item from the bucket.
+ internal void RemoveCacheEntry(CacheEntry cacheEntry) {
+ lock (this) {
+ RemoveCacheEntryNoLock(cacheEntry);
+ }
+ }
+
+ // Update the expiration time of a cache entry, and the count.
+ internal void UtcUpdateCacheEntry(CacheEntry cacheEntry, DateTime utcExpires) {
+ lock (this) {
+ ExpiresEntryRef entryRef = cacheEntry.ExpiresEntryRef;
+ if (cacheEntry.ExpiresBucket != _bucket || entryRef.IsInvalid)
+ return;
+
+ ExpiresEntry[] entries = EntriesR(entryRef);
+ int entryIndex = entryRef.Index;
+
+ Debug.Assert(cacheEntry == entries[entryIndex]._cacheEntry);
+
+ // update count
+ RemoveCount(entries[entryIndex]._utcExpires);
+ AddCount(utcExpires);
+
+ // update expires entry
+ entries[entryIndex]._utcExpires = utcExpires;
+
+ // update the cache entry
+ cacheEntry.UtcExpires = utcExpires;
+
+ Debug.Validate("CacheValidateExpires", this);
+ Debug.Trace("CacheExpiresUpdate", "Updated item " + cacheEntry.Key + " in bucket " + _bucket);
+ }
+ }
+
+ // Flush expired items from the cache.
+ internal int FlushExpiredItems(DateTime utcNow, bool useInsertBlock) {
+ // Check if there is something to flush
+ if (_cEntriesInUse == 0 || GetExpiresCount(utcNow) == 0)
+ return 0;
+
+ Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0");
+
+ // We create a list of ExpiresEntry's that we wish to flush. These entries
+ // are not considered free, so the page that holds them will not be removed.
+ ExpiresEntryRef inFlushHead = ExpiresEntryRef.INVALID;
+
+ ExpiresEntry[] entries;
+ int entryIndex;
+ CacheEntry cacheEntry;
+ int flushed = 0;
+
+ try {
+ if (useInsertBlock) {
+ // Block insertion into the Cache if we're under high memory pressure
+ _cacheExpires.CacheSingle.BlockInsertIfNeeded();
+ }
+
+ lock (this) {
+ Debug.Assert(_blockReduce == false, "_blockReduce == false");
+
+ // Recheck if there is something to flush.
+ if (_cEntriesInUse == 0 || GetExpiresCount(utcNow) == 0)
+ return 0;
+
+#if DBG
+ Debug.Trace("CacheExpiresFlush", "FlushExpiredItems ExpiresCount=" + GetExpiresCount(utcNow) +
+ " bucket=" + _bucket + "; Time=" + Debug.FormatLocalDate(DateTime.Now));
+#endif
+
+ // Walk through all ExpiresEntries, create a list of expired items,
+ // and recalculate count heuristics.
+ ResetCounts(utcNow);
+ int cPages = _cPagesInUse;
+ for (int i = 0; i < _pages.Length; i++) {
+ entries = _pages[i]._entries;
+ if (entries != null) {
+ int cEntries = NUM_ENTRIES - FreeEntryCount(entries);
+ for (int j = 1; j < entries.Length; j++) {
+ cacheEntry = entries[j]._cacheEntry;
+ if (cacheEntry != null) {
+ if (entries[j]._utcExpires > utcNow) {
+ AddCount(entries[j]._utcExpires);
+ }
+ else {
+ // Remove reference from CacheEntry. We must do this before we
+ // release the lock, otherwise the item would be corrupted if
+ // UpdateCacheEntry or RemoveCacheEntry were called.
+ cacheEntry.ExpiresBucket = 0xff;
+ cacheEntry.ExpiresEntryRef = ExpiresEntryRef.INVALID;
+
+ // distinguish between items on free list and inflush list for debugging
+ entries[j]._cFree = 1;
+
+ // add it to the inFlush list
+ entries[j]._next = inFlushHead;
+ inFlushHead = new ExpiresEntryRef(i, j);
+
+ flushed++;
+ _cEntriesInFlush++;
+ }
+
+ cEntries--;
+ if (cEntries == 0)
+ break;
+ }
+ }
+
+ cPages--;
+ if (cPages == 0)
+ break;
+ }
+ }
+
+ if (flushed == 0) {
+ Debug.Trace("CacheExpiresFlushTotal", "FlushExpiredItems flushed " + flushed +
+ " expired items, bucket=" + _bucket + "; Time=" + Debug.FormatLocalDate(DateTime.Now));
+
+ return 0;
+ }
+
+ // prevent pages from being moved by blocking Reduce().
+ _blockReduce = true;
+ }
+ }
+ finally {
+ if (useInsertBlock) {
+ // Don't hold any insertblock before we remove Cache items. If not, the following
+ // deadlock scenario may happen:
+ // - 3rd party code hold lock A, call Cache.Insert, which wait for the Cache insertblock
+ // - FlushExpiredItems holds the Cache insertBlock, call Cache.Remove, which call
+ // 3rd party CacheItemRemovedCallback, which then try to get lock A
+
+ _cacheExpires.CacheSingle.UnblockInsert();
+ }
+ }
+
+ Debug.Assert(!inFlushHead.IsInvalid, "!inFlushHead.IsInvalid");
+
+ // Remove items on the inFlush list from the rest of the cache.
+ CacheSingle cacheSingle = _cacheExpires.CacheSingle;
+ ExpiresEntryRef current = inFlushHead;
+ ExpiresEntryRef next;
+ while (!current.IsInvalid) {
+ entries = EntriesR(current);
+ entryIndex = current.Index;
+
+ next = entries[entryIndex]._next;
+
+ // remove the entry
+ cacheEntry = entries[entryIndex]._cacheEntry;
+ entries[entryIndex]._cacheEntry = null;
+ Debug.Assert(cacheEntry.ExpiresEntryRef.IsInvalid, "cacheEntry.ExpiresEntryRef.IsInvalid");
+ cacheSingle.Remove(cacheEntry, CacheItemRemovedReason.Expired);
+
+ //iterate
+ current = next;
+ }
+
+ try {
+ if (useInsertBlock) {
+ // Block insertion into the Cache if we're under high memory pressure
+ _cacheExpires.CacheSingle.BlockInsertIfNeeded();
+ }
+
+ lock (this) {
+ // add each ExpiresEntry to the free list
+ current = inFlushHead;
+ while (!current.IsInvalid) {
+ entries = EntriesR(current);
+ entryIndex = current.Index;
+
+ next = entries[entryIndex]._next;
+
+ _cEntriesInFlush--;
+ AddExpiresEntryToFreeList(current);
+
+ //iterate
+ current = next;
+ }
+
+ // try to reduce
+ Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0");
+ _blockReduce = false;
+ Reduce();
+
+ Debug.Trace("CacheExpiresFlushTotal", "FlushExpiredItems flushed " + flushed +
+ " expired items, bucket=" + _bucket + "; Time=" + Debug.FormatLocalDate(DateTime.Now));
+
+ Debug.Validate("CacheValidateExpires", this);
+ Debug.Dump("CacheExpiresFlush", this);
+ }
+ }
+ finally {
+ if (useInsertBlock) {
+ _cacheExpires.CacheSingle.UnblockInsert();
+ }
+ }
+
+ return flushed;
+ }
+
+#if DBG
+ internal void DebugValidate() {
+ int cFree = 0;
+ int cEntriesInUse = 0;
+ int cPagesInUse = 0;
+ int pagesLength;
+ int[] counts = new int[COUNTS_LENGTH];
+
+ if (_pages == null) {
+ pagesLength = 0;
+ }
+ else {
+ pagesLength = _pages.Length;
+ }
+
+ Debug.CheckValid(-1 <= _freePageList._head && _freePageList._head <= pagesLength, "-1 <= _freePageList._head && _freePageList._head <= pagesLength");
+ Debug.CheckValid(-1 <= _freeEntryList._head && _freeEntryList._head <= pagesLength, "-1 <= _freeEntryList._head && _freeEntryList._head <= pagesLength");
+ Debug.CheckValid(-1 <= _freeEntryList._tail && _freeEntryList._tail <= pagesLength, "-1 <= _freeEntryList._tail && _freeEntryList._tail <= pagesLength");
+ Debug.CheckValid((_freeEntryList._head == -1) == (_freeEntryList._tail == -1), "(_freeEntryList._head == -1) == (_freeEntryList._tail == -1)");
+ Debug.CheckValid(_minEntriesInUse >= -1, "_minEntriesInUse >= -1");
+ Debug.CheckValid(_cEntriesInFlush >= 0, "_cEntriesInFlush >= 0");
+
+ // check counts
+ for (int i = 0; i < pagesLength; i++) {
+ ExpiresEntry[] entries = _pages[i]._entries;
+ if (entries != null) {
+ cPagesInUse++;
+ cFree = 0;
+
+ Debug.CheckValid(entries[0]._cacheEntry == null, "entries[0]._cacheEntry == null");
+
+ for (int j = 1; j < entries.Length; j++) {
+ if (entries[j]._cacheEntry == null && entries[j]._cFree == 0) {
+ cFree++;
+ }
+ else {
+ cEntriesInUse++;
+ }
+
+ if (entries[j]._cacheEntry != null && entries[j]._cFree != 1) {
+ int ci = GetCountIndex(entries[j]._utcExpires);
+ for (int k = _counts.Length - 1; k >= ci; k--) {
+ counts[k]++;
+ }
+ }
+ }
+
+ Debug.CheckValid(cFree == FreeEntryCount(entries), "cFree == FreeEntryCount(entries)");
+
+ // walk the free list
+ cFree = 0;
+ if (!FreeEntryHead(entries).IsInvalid) {
+ int j = FreeEntryHead(entries).Index;
+ for (;;) {
+ cFree++;
+ Debug.CheckValid(cFree <= FreeEntryCount(entries), "cFree <= FreeEntryCount(entries)");
+
+ if (entries[j]._next.IsInvalid)
+ break;
+
+ j = entries[j]._next.Index;
+ }
+ }
+ Debug.CheckValid(cFree == FreeEntryCount(entries), "cFree == FreeEntryCount(entries)");
+ }
+ }
+
+ Debug.CheckValid(cPagesInUse == _cPagesInUse, "cPagesInUse == _cPagesInUse");
+ Debug.CheckValid(cEntriesInUse == _cEntriesInUse, "cEntriesInUse == _cEntriesInUse");
+
+ for (int i = 0; i < _counts.Length; i++) {
+ Debug.CheckValid(_counts[i] == counts[i], "_counts[i] == counts[i]");
+ }
+
+ // walk the free slot list
+ int cFreeSlots = 0;
+ if (_freePageList._head != -1) {
+ for (int i = _freePageList._head; i != -1; i = _pages[i]._pageNext) {
+ cFreeSlots++;
+ Debug.CheckValid(cFreeSlots <= pagesLength, "cFreeSlots <= pagesLength");
+ Debug.CheckValid(_pages[i]._entries == null, "_pages[i]._entries == null");
+ if (_freePageList._head != i) {
+ Debug.CheckValid(PageNext(PagePrev(i)) == i, "PageNext(PagePrev(i)) == i");
+ }
+
+ if (_freePageList._tail != i) {
+ Debug.CheckValid(PagePrev(PageNext(i)) == i, "PagePrev(PageNext(i)) == i");
+ }
+ }
+ }
+ Debug.CheckValid(cFreeSlots == pagesLength - _cPagesInUse, "cFreeSlots == pagesLength - _cPagesInUse");
+
+ // walk the free page list
+ int cFreeEntries = 0;
+ int cFreePages = 0;
+ if (_freeEntryList._head != -1) {
+ for (int i = _freeEntryList._head; i != -1; i = _pages[i]._pageNext) {
+ cFreePages++;
+ Debug.CheckValid(cFreePages <= pagesLength, "cFreePages < pagesLength");
+ ExpiresEntry[] entries = _pages[i]._entries;
+ Debug.CheckValid(entries != null, "entries != null");
+ cFreeEntries += FreeEntryCount(entries);
+ if (_freeEntryList._head != i) {
+ Debug.CheckValid(PageNext(PagePrev(i)) == i, "PageNext(PagePrev(i)) == i");
+ }
+
+ if (_freeEntryList._tail != i) {
+ Debug.CheckValid(PagePrev(PageNext(i)) == i, "PagePrev(PageNext(i)) == i");
+ }
+ }
+ }
+
+ Debug.CheckValid(cFreeEntries == (_cPagesInUse * NUM_ENTRIES) - _cEntriesInUse, "cFreeEntries == (_cPagesInUse * NUM_ENTRIES) - _cEntriesInUse");
+ }
+
+ internal string DebugDescription(string indent) {
+ StringBuilder sb = new StringBuilder();
+ string i2 = indent + " ";
+
+ sb.Append(indent +
+ "_bucket=" + _bucket +
+ ",_cEntriesInUse=" + _cEntriesInUse +
+ ",_cPagesInUse=" + _cPagesInUse +
+ ",_pages is " + (_pages == null ? "null" : "non-null") +
+ ",_minEntriesInUse=" + _minEntriesInUse +
+ ",_freePageList._head=" + _freePageList._head +
+ ",_freeEntryList._head=" + _freeEntryList._head +
+ ",_freeEntryList._tail=" + _freeEntryList._tail +
+ "\n");
+
+ return sb.ToString();
+ }
+#endif
+ }
+
+
+ /*
+ * Provides an expiration service for entries in the cache.
+ * Items with expiration times are placed into a configurable
+ * number of buckets. Each minute a bucket is examined for
+ * expired items.
+ */
+ sealed class CacheExpires {
+ internal static readonly TimeSpan MIN_UPDATE_DELTA = new TimeSpan(0, 0, 1);
+ internal static readonly TimeSpan MIN_FLUSH_INTERVAL = new TimeSpan(0, 0, 1);
+ internal static readonly TimeSpan _tsPerBucket = new TimeSpan(0, 0, 20);
+
+ const int NUMBUCKETS = 30;
+ static readonly TimeSpan _tsPerCycle = new TimeSpan(NUMBUCKETS * _tsPerBucket.Ticks);
+
+ readonly CacheSingle _cacheSingle;
+ readonly ExpiresBucket[] _buckets;
+ DisposableGCHandleRef<Timer> _timerHandleRef;
+ DateTime _utcLastFlush;
+ int _inFlush;
+
+
+ internal CacheExpires(CacheSingle cacheSingle) {
+ Debug.Assert(NUMBUCKETS < Byte.MaxValue);
+
+ DateTime utcNow = DateTime.UtcNow;
+
+ _cacheSingle = cacheSingle;
+ _buckets = new ExpiresBucket[NUMBUCKETS];
+ for (byte b = 0; b < _buckets.Length; b++) {
+ _buckets[b] = new ExpiresBucket(this, b, utcNow);
+ }
+ }
+
+ int UtcCalcExpiresBucket(DateTime utcDate) {
+ long ticksFromCycleStart = utcDate.Ticks % _tsPerCycle.Ticks;
+ int bucket = (int) (((ticksFromCycleStart / _tsPerBucket.Ticks) + 1) % NUMBUCKETS);
+
+ return bucket;
+ }
+
+ int FlushExpiredItems(bool checkDelta, bool useInsertBlock) {
+ int flushed = 0;
+
+ if (Interlocked.Exchange(ref _inFlush, 1) == 0) {
+ try {
+ // if the timer was disposed, return without doing anything
+ if (_timerHandleRef == null) {
+ return 0;
+ }
+ DateTime utcNow = DateTime.UtcNow;
+ if (!checkDelta || utcNow - _utcLastFlush >= MIN_FLUSH_INTERVAL || utcNow < _utcLastFlush) {
+ _utcLastFlush = utcNow;
+ foreach (ExpiresBucket bucket in _buckets) {
+ flushed += bucket.FlushExpiredItems(utcNow, useInsertBlock);
+ }
+
+ Debug.Trace("CacheExpiresFlushTotal", "FlushExpiredItems flushed a total of " + flushed + " items; Time=" + Debug.FormatLocalDate(DateTime.Now));
+ Debug.Dump("CacheExpiresFlush", this);
+ }
+
+ }
+ finally {
+ Interlocked.Exchange(ref _inFlush, 0);
+ }
+ }
+
+ return flushed;
+ }
+
+ internal int FlushExpiredItems(bool useInsertBlock) {
+ return FlushExpiredItems(true, useInsertBlock);
+ }
+
+ void TimerCallback(object state) {
+ FlushExpiredItems(false, false);
+ }
+
+ internal void EnableExpirationTimer(bool enable) {
+#if DBG
+ if (Debug.IsTagPresent("Timer") && !Debug.IsTagEnabled("Timer")) {
+ enable = false;
+ }
+#endif
+
+ if (enable) {
+ if (_timerHandleRef == null) {
+ DateTime utcNow = DateTime.UtcNow;
+ TimeSpan due = _tsPerBucket - (new TimeSpan(utcNow.Ticks % _tsPerBucket.Ticks));
+ Timer timer = new Timer(new TimerCallback(this.TimerCallback), null,
+ due.Ticks / TimeSpan.TicksPerMillisecond, _tsPerBucket.Ticks / TimeSpan.TicksPerMillisecond);
+ _timerHandleRef = new DisposableGCHandleRef<Timer>(timer);
+
+ Debug.Trace("Cache", "Cache expiration timer created.");
+ }
+ }
+ else {
+ DisposableGCHandleRef<Timer> timerHandleRef = _timerHandleRef;
+ if (timerHandleRef != null && Interlocked.CompareExchange(ref _timerHandleRef, null, timerHandleRef) == timerHandleRef) {
+ timerHandleRef.Dispose();
+ Debug.Trace("Cache", "Cache expiration timer disposed.");
+ while (_inFlush != 0) {
+ Thread.Sleep(100);
+ }
+ }
+ }
+ }
+
+ internal CacheSingle CacheSingle {
+ get {
+ return _cacheSingle;
+ }
+ }
+
+ /*
+ * Adds an entry to the expires list.
+ *
+ * @param entry The cache entry to add.
+ */
+ internal void Add(CacheEntry cacheEntry) {
+ DateTime utcNow = DateTime.UtcNow;
+ if (utcNow > cacheEntry.UtcExpires) {
+ cacheEntry.UtcExpires = utcNow;
+ }
+
+ int bucket = UtcCalcExpiresBucket(cacheEntry.UtcExpires);
+ _buckets[bucket].AddCacheEntry(cacheEntry);
+ }
+
+ /*
+ * Removes an entry from the expires list.
+ *
+ * @param entry The cache entry to remove.
+ */
+ internal void Remove(CacheEntry cacheEntry) {
+ byte bucket = cacheEntry.ExpiresBucket;
+ if (bucket != 0xff) {
+ _buckets[bucket].RemoveCacheEntry(cacheEntry);
+ }
+ }
+
+ /*
+ * Updates an entry.
+ *
+ */
+ internal void UtcUpdate(CacheEntry cacheEntry, DateTime utcNewExpires) {
+ int oldBucket = cacheEntry.ExpiresBucket;
+ int newBucket = UtcCalcExpiresBucket(utcNewExpires);
+
+ if (oldBucket != newBucket) {
+ Debug.Trace("CacheExpiresUpdate",
+ "Updating item " + cacheEntry.Key + " from bucket " + oldBucket + " to new bucket " + newBucket);
+
+ if (oldBucket != 0xff) {
+ _buckets[oldBucket].RemoveCacheEntry(cacheEntry);
+ cacheEntry.UtcExpires = utcNewExpires;
+ _buckets[newBucket].AddCacheEntry(cacheEntry);
+ }
+ } else {
+ if (oldBucket != 0xff) {
+ _buckets[oldBucket].UtcUpdateCacheEntry(cacheEntry, utcNewExpires);
+ }
+ }
+ }
+
+
+#if DBG
+ internal void DebugValidate() {
+ int i;
+
+ for (i = 0; i < _buckets.Length; i++) {
+ _buckets[i].DebugValidate();
+ }
+ }
+
+ internal string DebugDescription(string indent) {
+ int i;
+ StringBuilder sb = new StringBuilder();
+ string i2 = indent + " ";
+
+ sb.Append(indent);
+ sb.Append("Cache expires\n");
+
+ for (i = 0; i < _buckets.Length; i++) {
+ sb.Append(_buckets[i].DebugDescription(i2));
+ }
+
+ return sb.ToString();
+ }
+#endif
+ }
+}
+
diff --git a/mcs/class/referencesource/System.Web/cacheusage.cspp b/mcs/class/referencesource/System.Web/cacheusage.cspp
new file mode 100644
index 00000000000..601b034d092
--- /dev/null
+++ b/mcs/class/referencesource/System.Web/cacheusage.cspp
@@ -0,0 +1,1537 @@
+//------------------------------------------------------------------------------
+// <copyright file="CacheUsage.cs" company="Microsoft">
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// </copyright>
+//------------------------------------------------------------------------------
+
+//
+// This is the implementation of an LRU2 list for the cache, which is used
+// to flush the least frequently used items when memory pressure is low.
+//
+// LRU2 is similar to LRU (Least Recently Used), but it keeps track of the
+// second to last use of an item, thereby measuring the average interval
+// between references to an item. This has the advantage over LRU of keeping
+// items that are frequently used, but haven't been used just at the time that
+// we need to flush.
+//
+// Please note that when we insert a new item in the list, we treat the addition
+// as a reference by itself. So the 1st reference goes to the head,
+// and the 2nd reference goes to the head of the 2nd reference list.
+//
+// ...................................................
+// For example:
+// Action List (Head...Tail)
+// ------ ------------------
+// Insert A A1 A2
+// Insert B B1 A1 B2 A2
+// Insert C C1 B1 A1 C2 B2 A2
+// Ref B B1 C1 B2 A1 C2 A2
+// Ref A A1 B1 C1 B2 A2 C2
+// Ref B B1 A1 B2 C1 A2 C2
+// Ref C C1 B1 A1 B2 C2 A2
+// Ref A A1 C1 B1 A2 B2 C2
+//
+// When flushing, we will start scanning from the tail, and flush all 2nd references we find.
+// For example, if we want to flush 2 items, we will find C2 and B2,
+// and thus we will flush item B and C.
+// ...................................................
+//
+// An item in the LRU2 list is represented by a UsageEntry struct. This struct
+// contains the reference to the cache entry, and the linked list entries for
+// both the most recent first and second references to the entry. To distinguish
+// between a link to an item's first reference and its second reference, we use
+// a positive index for the first reference, and a negative index for the second
+// reference.
+//
+// ...................................................
+// For example:
+// Logically I have this list
+// Head Tail
+// A1 B1 C2 C1 B2 A2
+//
+// Physically, A, B and C are stored in an array, and their indexes are 1, 2 and 3.
+//
+// So their ref1 and ref2 values will be:
+//
+// Entry(index) Ref1.Prev Ref1.Next Ref2.Prev Ref2.Next
+// ----- --------- --------- --------- ---------
+// (Head == 1 (point to A1))
+// A(1) 0 2 (B1) -2 (B2) 0
+// B(2) 1 (A1) -3 (C2) 3 (C1) -1 (A2)
+// C(3) -3 (C2) -2 (B2) 2 (B1) 3 (C1)
+// ...................................................
+//
+// To efficiently store potentially millions of cache items in the LRU2,
+// we adopt a paging model. Each UsagePage contains an array of 127 UsageEntry
+// structs (whose size is slightly less than one x86 memory page). A reference
+// to a UsageEntry is thus defined by 2 index, the index of the page, and the
+// index in the page's array of UsageEntry's.
+//
+// When the number of free entries rises above a threshold, we reduce the number
+// of pages in use.
+//
+// In order to efficiently items in an array of arrays, we must use the C++ macro
+// preprocessor. The jitter will not inline small functions, and we cannot represent
+// access to a UsageEntry as a property, since the propery requires an index parameter.
+//
+
+namespace System.Web.Caching {
+ using System.Runtime.InteropServices;
+ using System.Text;
+ using System.Threading;
+ using System.Web;
+ using System.Web.Util;
+ using System.Collections;
+ using System;
+
+ // UsageEntryRef defines a reference to a UsageEntry in the UsageBucket data structure.
+ // An entry is identified by its index into the UsageBucket._pages array, and its
+ // index into the UsagePage._entries array.
+ //
+ // Bits 0-7 of the reference are for the index into the UsagePage._entries array.
+ // Bits 8-31 of the reference are for the index into the UsageBucket._pages array.
+ //
+ // A reference to a UsageEntry may be to either its first or second reference in
+ // the UsageBucket._lastRef list. The second reference will have a negative index.
+ //
+ struct UsageEntryRef {
+ // The invalid reference is 0.
+ static internal readonly UsageEntryRef INVALID = new UsageEntryRef(0, 0);
+
+ const uint ENTRY_MASK = 0x000000ffu;
+ const uint PAGE_MASK = 0xffffff00u;
+ const int PAGE_SHIFT = 8;
+
+ uint _ref;
+
+ internal UsageEntryRef(int pageIndex, int entryIndex) {
+ Debug.Assert((pageIndex & 0x00ffffff) == pageIndex, "(pageIndex & 0x00ffffff) == pageIndex");
+ Debug.Assert((Math.Abs(entryIndex) & ENTRY_MASK) == (Math.Abs(entryIndex)), "(Math.Abs(entryIndex) & ENTRY_MASK) == Math.Abs(entryIndex)");
+ Debug.Assert(entryIndex != 0 || pageIndex == 0, "entryIndex != 0 || pageIndex == 0");
+
+ // Please note that because the range of valid entryIndex is -127 to 127, so
+ // 1 byte is big enough to hold the value.
+
+ _ref = ( (((uint)pageIndex) << PAGE_SHIFT) | (((uint)(entryIndex)) & ENTRY_MASK) );
+ }
+
+ public override bool Equals(object value) {
+ if (value is UsageEntryRef) {
+ return _ref == ((UsageEntryRef)value)._ref;
+ }
+
+ return false;
+ }
+
+#if NOT_USED
+ public static bool Equals(UsageEntryRef r1, UsageEntryRef r2) {
+ return r1._ref == r2._ref;
+ }
+#endif
+ public static bool operator ==(UsageEntryRef r1, UsageEntryRef r2) {
+ return r1._ref == r2._ref;
+ }
+
+ public static bool operator !=(UsageEntryRef r1, UsageEntryRef r2) {
+ return r1._ref != r2._ref;
+ }
+
+ public override int GetHashCode() {
+ return (int) _ref;
+ }
+
+#if DBG
+ public override string ToString() {
+ if (IsRef1) {
+ return PageIndex + ":" + Ref1Index;
+ }
+ else if (IsRef2) {
+ return PageIndex + ":" + -Ref2Index;
+ }
+ else {
+ return "0";
+ }
+ }
+#endif
+
+ // The index into the UsageBucket._pages array.
+ internal int PageIndex {
+ get {
+ int result = (int) (_ref >> PAGE_SHIFT);
+ return result;
+ }
+ }
+
+
+ // The index for UsageEntry._ref1 in the UsagePage._entries array.
+ internal int Ref1Index {
+ get {
+ int result = (int) (sbyte) (_ref & ENTRY_MASK);
+ Debug.Assert(result > 0, "result > 0");
+ return result;
+ }
+ }
+
+ // The index for UsageEntry._ref2 in the UsagePage._entries array.
+ internal int Ref2Index {
+ get {
+ int result = (int) (sbyte) (_ref & ENTRY_MASK);
+ Debug.Assert(result < 0, "result < 0");
+ return -result;
+ }
+ }
+
+ // Is the reference for the first reference?
+ internal bool IsRef1 {
+ get {
+ return ((int) (sbyte) (_ref & ENTRY_MASK)) > 0;
+ }
+ }
+
+ // Is the reference for the second reference?
+ internal bool IsRef2 {
+ get {
+ return ((int) (sbyte) (_ref & ENTRY_MASK)) < 0;
+ }
+ }
+
+ // Is the reference invalid?
+ internal bool IsInvalid {
+ get {
+ return _ref == 0;
+ }
+ }
+ }
+
+ // A link to an item in the last references list.
+ struct UsageEntryLink {
+ internal UsageEntryRef _next;
+ internal UsageEntryRef _prev;
+ }
+
+ // A cache entry in the LRU2 list. It contains the pointer to the
+ // cache entry, the date it was added to the list, and the links
+ // to the first and second references to the item in the list.
+ [StructLayout(LayoutKind.Explicit)]
+ struct UsageEntry {
+ // The entry's first reference in the last reference list.
+ // _ref1._next is also used for the following purposes when
+ // the entry is not on the last reference list:
+ // * As a link in the free entry list for a page.
+ // * As a link in the list of items to flush in FlushUnderUsedItems.
+ //
+ [FieldOffset(0)]
+ internal UsageEntryLink _ref1;
+
+ // _entries[0]._ref1._next is used to hold the head of the free entries
+ // list. We use the space in _ref1._prev to hold the number
+ // of free entries in the list.
+ [FieldOffset(4)]
+ internal int _cFree;
+
+ // The entry's second reference in the last reference list.
+ [FieldOffset(8)]
+ internal UsageEntryLink _ref2;
+
+ // The date the entry was added to the list.
+ // If the date is 0 (DateTime.MinValue), the entry is free.
+ [FieldOffset(16)]
+ internal DateTime _utcDate;
+
+ // The cache entry.
+ [FieldOffset(24)]
+ internal CacheEntry _cacheEntry;
+ }
+
+ // A page to hold the array of UsageEntry.
+ struct UsagePage {
+ internal UsageEntry[] _entries; // array of UsagEntry.
+ internal int _pageNext; // next page on the free page or free entry list
+ internal int _pagePrev; // prev page on the free page or free entry list
+ }
+
+ // A list of UsagePages.
+ struct UsagePageList {
+ internal int _head; // head of list
+ internal int _tail; // tail of list
+ }
+
+ sealed class UsageBucket {
+ // We cannot use array index 0 for entries, because we need an array index to
+ // be different than its negation, and -0 = 0.
+ // We use _entries[0] to hold the head of the free list, and the size of the free list.
+ internal const int NUM_ENTRIES = 127;
+ const int LENGTH_ENTRIES = 128;
+
+ const int MIN_PAGES_INCREMENT = 10;
+ const int MAX_PAGES_INCREMENT = 340; // (size of a page on x86) / (12 bytes per UsagePage)
+ const double MIN_LOAD_FACTOR = 0.5; // minimum ratio of used to total entries before we will reduce
+
+ CacheUsage _cacheUsage; // parent usage object
+ byte _bucket; // priority of this bucket
+
+ UsagePage[] _pages; // list of pages
+ int _cEntriesInUse; // count of UsageEntry's in use
+ int _cPagesInUse; // count of UsagePage's in use
+ int _cEntriesInFlush; // count of UsageEntry's in process of being flushed
+ int _minEntriesInUse; // minimum number of entries in use before we reduce
+
+ UsagePageList _freePageList; // list of free pages (_entries == null)
+ UsagePageList _freeEntryList; // list of pages with free entries (entry.FreeCountCount > 0)
+
+ UsageEntryRef _lastRefHead; // head of list of last refs
+ UsageEntryRef _lastRefTail; // tail of list of last refs
+ UsageEntryRef _addRef2Head; // head of ref2 list
+
+ bool _blockReduce; // block calls to Reduce() while in FlushUnderUsedItems
+
+
+ internal UsageBucket(CacheUsage cacheUsage, byte bucket) {
+ _cacheUsage = cacheUsage;
+ _bucket = bucket;
+ InitZeroPages();
+ }
+
+ void InitZeroPages() {
+ Debug.Assert(_cPagesInUse == 0, "_cPagesInUse == 0");
+ Debug.Assert(_cEntriesInUse == 0, "_cEntriesInUse == 0");
+ Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0");
+ Debug.Assert(_lastRefHead.IsInvalid, "_lastRefHead.IsInvalid");
+ Debug.Assert(_lastRefTail.IsInvalid, "_lastRefTail.IsInvalid");
+ Debug.Assert(_addRef2Head.IsInvalid, "_addRef2Head.IsInvalid");
+
+ _pages = null;
+ _minEntriesInUse = -1;
+ _freePageList._head = -1;
+ _freePageList._tail = -1;
+ _freeEntryList._head = -1;
+ _freeEntryList._tail = -1;
+ }
+
+
+// Use macros so that the code is inlined in the function
+#define EntriesI(i) (_pages[(i)]._entries)
+
+#define EntriesR(entryRef) (_pages[(entryRef.PageIndex)]._entries)
+
+#define PagePrev(i) (_pages[(i)]._pagePrev)
+
+#define PageNext(i) (_pages[(i)]._pageNext)
+
+#define FreeEntryHead(entries) ((entries)[0]._ref1._next)
+
+#define FreeEntryCount(entries) ((entries)[0]._cFree)
+
+#define CreateRef1(entryRef) (new UsageEntryRef((entryRef).PageIndex, (entryRef).Ref2Index))
+
+#define CreateRef2(entryRef) (new UsageEntryRef((entryRef).PageIndex, -(entryRef).Ref1Index))
+
+
+#if DBG
+ bool EntryIsFree(UsageEntryRef entryRef) {
+ return EntriesR(entryRef)[entryRef.Ref1Index]._cacheEntry == null &&
+ EntriesR(entryRef)[entryRef.Ref1Index]._utcDate == DateTime.MinValue;
+ }
+
+ bool EntryIsUsed(UsageEntryRef entryRef) {
+ if (entryRef.IsRef1) {
+ return EntriesR(entryRef)[entryRef.Ref1Index]._cacheEntry != null &&
+ EntriesR(entryRef)[entryRef.Ref1Index]._utcDate != DateTime.MinValue;
+ }
+ else {
+ return EntriesR(entryRef)[entryRef.Ref2Index]._cacheEntry != null &&
+ EntriesR(entryRef)[entryRef.Ref2Index]._utcDate != DateTime.MinValue;
+ }
+ }
+#endif
+
+ // Add a page to the head of a list.
+ void AddToListHead(int pageIndex, ref UsagePageList list) {
+ Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)");
+
+ PagePrev(pageIndex) = -1;
+ PageNext(pageIndex) = list._head;
+ if (list._head != -1) {
+ Debug.Assert(PagePrev(list._head) == -1, "PagePrev(list._head) == -1");
+ PagePrev(list._head) = pageIndex;
+ }
+ else {
+ list._tail = pageIndex;
+ }
+
+ list._head = pageIndex;
+ }
+
+ // Add a page to the tail of a list.
+ void AddToListTail(int pageIndex, ref UsagePageList list) {
+ Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)");
+
+ PageNext(pageIndex) = -1;
+ PagePrev(pageIndex) = list._tail;
+ if (list._tail != -1) {
+ Debug.Assert(PageNext(list._tail) == -1, "PageNext(list._tail) == -1");
+ PageNext(list._tail) = pageIndex;
+ }
+ else {
+ list._head = pageIndex;
+ }
+
+ list._tail = pageIndex;
+ }
+
+ // Remove a page from the head of a list.
+ int RemoveFromListHead(ref UsagePageList list) {
+ Debug.Assert(list._head != -1, "list._head != -1");
+
+ int oldHead = list._head;
+ RemoveFromList(oldHead, ref list);
+ return oldHead;
+ }
+
+ // Remove a page from the list.
+ void RemoveFromList(int pageIndex, ref UsagePageList list) {
+ Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)");
+
+ if (PagePrev(pageIndex) != -1) {
+ Debug.Assert(PageNext(PagePrev(pageIndex)) == pageIndex, "PageNext(PagePrev(pageIndex)) == pageIndex");
+ PageNext(PagePrev(pageIndex)) = PageNext(pageIndex);
+ }
+ else {
+ Debug.Assert(list._head == pageIndex, "list._head == pageIndex");
+ list._head = PageNext(pageIndex);
+ }
+
+ if (PageNext(pageIndex) != -1) {
+ Debug.Assert(PagePrev(PageNext(pageIndex)) == pageIndex, "PagePrev(PageNext(pageIndex)) == pageIndex");
+ PagePrev(PageNext(pageIndex)) = PagePrev(pageIndex);
+ }
+ else {
+ Debug.Assert(list._tail == pageIndex, "list._tail == pageIndex");
+ list._tail = PagePrev(pageIndex);
+ }
+
+ PagePrev(pageIndex) = -1;
+ PageNext(pageIndex) = -1;
+ }
+
+ // Move a page to the head of the list
+ void MoveToListHead(int pageIndex, ref UsagePageList list) {
+ Debug.Assert(list._head != -1, "list._head != -1");
+ Debug.Assert(list._tail != -1, "list._tail != -1");
+
+ // already at head?
+ if (list._head == pageIndex)
+ return;
+
+ // remove from list
+ RemoveFromList(pageIndex, ref list);
+
+ // add to head
+ AddToListHead(pageIndex, ref list);
+ }
+
+ // Move to the tail of the list
+ void MoveToListTail(int pageIndex, ref UsagePageList list) {
+ Debug.Assert(list._head != -1, "list._head != -1");
+ Debug.Assert(list._tail != -1, "list._tail != -1");
+
+ // already at tail?
+ if (list._tail == pageIndex)
+ return;
+
+ // remove from list
+ RemoveFromList(pageIndex, ref list);
+
+ // add to head
+ AddToListTail(pageIndex, ref list);
+ }
+
+ // Update _minEntriesInUse when _cPagesInUse changes.
+ // When _cEntriesInUse falls below _minEntriesInUse,
+ // a call to Reduce() will consolidate entries onto fewer pages.
+ // If _minEntries == -1, then a call to Reduce() will never reduce the number of pages.
+ void UpdateMinEntries() {
+ if (_cPagesInUse <= 1) {
+ _minEntriesInUse = -1;
+ }
+ else {
+ int capacity = _cPagesInUse * NUM_ENTRIES;
+ Debug.Assert(capacity > 0, "capacity > 0");
+ Debug.Assert(MIN_LOAD_FACTOR < 1.0, "MIN_LOAD_FACTOR < 1.0");
+
+ _minEntriesInUse = (int) (capacity * MIN_LOAD_FACTOR);
+
+ // Don't allow a reduce if there are not enough free entries to
+ // remove a page.
+ // Note: _minEntriesInUse - 1 == max # of entries still in use when Reduce() happens
+ // (_cPagesInUse - 1) * NUM_ENTRIES == capacity after one page is freed
+ if ((_minEntriesInUse - 1) > ((_cPagesInUse - 1) * NUM_ENTRIES)) {
+ _minEntriesInUse = -1;
+ }
+ }
+
+#if DBG
+ if (Debug.IsTagPresent("CacheUsageNoReduce") && Debug.IsTagEnabled("CacheUsageNoReduce")) {
+ _minEntriesInUse = -1;
+ }
+#endif
+
+ }
+
+ // Remove a UsagePage that is in use, and put in on the list of free pages.
+ void RemovePage(int pageIndex) {
+ Debug.Assert(FreeEntryCount(EntriesI(pageIndex)) == NUM_ENTRIES, "FreeEntryCount(EntriesI(pageIndex)) == NUM_ENTRIES");
+
+ // release the page from the free entries list
+ RemoveFromList(pageIndex, ref _freeEntryList);
+
+ // Add the page to the free pages list
+ AddToListHead(pageIndex, ref _freePageList);
+
+ // remove reference to page
+ Debug.Assert(EntriesI(pageIndex) != null, "EntriesI(pageIndex) != null");
+ EntriesI(pageIndex) = null;
+
+ // decrement count of pages and update _cMinEntriesInUse
+ _cPagesInUse--;
+ if (_cPagesInUse == 0) {
+ InitZeroPages();
+ }
+ else {
+ UpdateMinEntries();
+ }
+ }
+
+#if DBG
+ UsageEntryRef GetLastRefNext(UsageEntryRef entryRef) {
+ if (entryRef.IsRef1) {
+ return EntriesR(entryRef)[entryRef.Ref1Index]._ref1._next;
+ }
+ else if (entryRef.IsRef2) {
+ return EntriesR(entryRef)[entryRef.Ref2Index]._ref2._next;
+ }
+ else {
+ return _lastRefHead;
+ }
+ }
+
+ UsageEntryRef GetLastRefPrev(UsageEntryRef entryRef) {
+ if (entryRef.IsRef1) {
+ return EntriesR(entryRef)[entryRef.Ref1Index]._ref1._prev;
+ }
+ else if (entryRef.IsRef2) {
+ return EntriesR(entryRef)[entryRef.Ref2Index]._ref2._prev;
+ }
+ else {
+ return _lastRefTail;
+ }
+ }
+#endif
+
+ // Set the _next reference in the last reference list.
+ // We must do this with a macro to force inlining.
+#define SetLastRefNext(entryRef, next) { \
+ if ((entryRef).IsRef1) { \
+ EntriesR((entryRef))[(entryRef).Ref1Index]._ref1._next = (next); \
+ } \
+ else if ((entryRef).IsRef2) { \
+ EntriesR((entryRef))[(entryRef).Ref2Index]._ref2._next = (next); \
+ } \
+ else { \
+ _lastRefHead = (next); \
+ } \
+ } \
+
+ // Set the _prev reference in the last reference list.
+ // We must do this with a macro to force inlining.
+#define SetLastRefPrev(entryRef, prev) { \
+ if ((entryRef).IsRef1) { \
+ EntriesR((entryRef))[(entryRef).Ref1Index]._ref1._prev = (prev); \
+ } \
+ else if ((entryRef).IsRef2) { \
+ EntriesR((entryRef))[(entryRef).Ref2Index]._ref2._prev = (prev); \
+ } \
+ else { \
+ _lastRefTail = (prev); \
+ } \
+ } \
+
+ // Get a free UsageEntry.
+ UsageEntryRef GetFreeUsageEntry() {
+ // get the page of the free entry
+ Debug.Assert(_freeEntryList._head >= 0, "_freeEntryList._head >= 0");
+ int pageIndex = _freeEntryList._head;
+
+ // get a free entry from _entries
+ UsageEntry[] entries = EntriesI(pageIndex);
+ int entryIndex = FreeEntryHead(entries).Ref1Index;
+
+ // fixup free list and count
+ FreeEntryHead(entries) = entries[entryIndex]._ref1._next;
+ FreeEntryCount(entries)--;
+ if (FreeEntryCount(entries) == 0) {
+ // remove page from list of free pages
+ Debug.Assert(FreeEntryHead(entries).IsInvalid, "FreeEntryHead(entries).IsInvalid");
+ RemoveFromList(pageIndex, ref _freeEntryList);
+ }
+
+#if DBG
+ Debug.Assert(EntryIsFree(new UsageEntryRef(pageIndex, entryIndex)), "EntryIsFree(new UsageEntryRef(pageIndex, entryIndex))");
+ if (!FreeEntryHead(entries).IsInvalid) {
+ Debug.Assert(FreeEntryHead(entries).Ref1Index != entryIndex, "FreeEntryHead(entries).Ref1Index != entryIndex");
+ Debug.Assert(EntryIsFree(new UsageEntryRef(pageIndex, FreeEntryHead(entries).Ref1Index)), "EntryIsFree(new UsageEntryRef(pageIndex, FreeEntryHead(entries).Ref1Index))");
+ }
+#endif
+
+ return new UsageEntryRef(pageIndex, entryIndex);
+ }
+
+ // Add a UsageEntry to the free entry list.
+ void AddUsageEntryToFreeList(UsageEntryRef entryRef) {
+ Debug.Assert(entryRef.IsRef1, "entryRef.IsRef1");
+
+ UsageEntry[] entries = EntriesR(entryRef);
+ int entryIndex = entryRef.Ref1Index;
+
+ Debug.Assert(entries[entryIndex]._cacheEntry == null, "entries[entryIndex]._cacheEntry == null");
+ entries[entryIndex]._utcDate = DateTime.MinValue;
+ entries[entryIndex]._ref1._prev = UsageEntryRef.INVALID;
+ entries[entryIndex]._ref2._next = UsageEntryRef.INVALID;
+ entries[entryIndex]._ref2._prev = UsageEntryRef.INVALID;
+
+ entries[entryIndex]._ref1._next = FreeEntryHead(entries);
+ FreeEntryHead(entries) = entryRef;
+
+ _cEntriesInUse--;
+ int pageIndex = entryRef.PageIndex;
+ FreeEntryCount(entries)++;
+ if (FreeEntryCount(entries) == 1) {
+ // add page to head of list of free pages
+ AddToListHead(pageIndex, ref _freeEntryList);
+ }
+ else if (FreeEntryCount(entries) == NUM_ENTRIES) {
+ RemovePage(pageIndex);
+ }
+ }
+
+ // Expand the capacity of the UsageBucket to hold more CacheEntry's.
+ // We will need to allocate a new page, and perhaps expand the _pages array.
+ // Note that we never collapse the _pages array.
+ void Expand() {
+ Debug.Assert(_cPagesInUse * NUM_ENTRIES == _cEntriesInUse, "_cPagesInUse * NUM_ENTRIES == _cEntriesInUse");
+ Debug.Assert(_freeEntryList._head == -1, "_freeEntryList._head == -1");
+ Debug.Assert(_freeEntryList._tail == -1, "_freeEntryList._tail == -1");
+
+ // exapnd _pages if there are no more
+ if (_freePageList._head == -1) {
+ // alloc new pages array
+ int oldLength;
+ if (_pages == null) {
+ oldLength = 0;
+ }
+ else {
+ oldLength = _pages.Length;
+ }
+
+ Debug.Assert(_cPagesInUse == oldLength, "_cPagesInUse == oldLength");
+ Debug.Assert(_cEntriesInUse == oldLength * NUM_ENTRIES, "_cEntriesInUse == oldLength * ExpiresEntryRef.NUM_ENTRIES");
+
+ int newLength = oldLength * 2;
+ newLength = Math.Max(oldLength + MIN_PAGES_INCREMENT, newLength);
+ newLength = Math.Min(newLength, oldLength + MAX_PAGES_INCREMENT);
+ Debug.Assert(newLength > oldLength, "newLength > oldLength");
+
+ UsagePage[] newPages = new UsagePage[newLength];
+
+ // copy original pages
+ for (int i = 0; i < oldLength; i++) {
+ newPages[i] = _pages[i];
+ }
+
+ // setup free list of new pages
+ for (int i = oldLength; i < newPages.Length; i++) {
+ newPages[i]._pagePrev = i - 1;
+ newPages[i]._pageNext = i + 1;
+ }
+
+ newPages[oldLength]._pagePrev = -1;
+ newPages[newPages.Length - 1]._pageNext = -1;
+
+ // use new pages array
+ _freePageList._head = oldLength;
+ _freePageList._tail = newPages.Length - 1;
+
+ _pages = newPages;
+ }
+
+ // move from free page list to free entries list
+ int pageIndex = RemoveFromListHead(ref _freePageList);
+ AddToListHead(pageIndex, ref _freeEntryList);
+
+ // create the entries
+ UsageEntry[] entries = new UsageEntry[LENGTH_ENTRIES];
+ FreeEntryCount(entries) = NUM_ENTRIES;
+
+ // init free list
+ for (int i = 0; i < entries.Length - 1; i++) {
+ entries[i]._ref1._next = new UsageEntryRef(pageIndex, i + 1);
+ }
+ entries[entries.Length - 1]._ref1._next = UsageEntryRef.INVALID;
+
+ EntriesI(pageIndex) = entries;
+
+ // increment count of pages and update _minEntriesInUse
+ _cPagesInUse++;
+ UpdateMinEntries();
+ }
+
+ // Consolidate UsageEntry's onto fewer pages when there are too many
+ // free entries.
+ void Reduce() {
+ // Test if we need to consolidate.
+ if (_cEntriesInUse >= _minEntriesInUse || _blockReduce)
+ return;
+
+ Debug.Assert(_freeEntryList._head != -1, "_freeEntryList._head != -1");
+ Debug.Assert(_freeEntryList._tail != -1, "_freeEntryList._tail != -1");
+ Debug.Assert(_freeEntryList._head != _freeEntryList._tail, "_freeEntryList._head != _freeEntryList._tail");
+
+ // Rearrange free page list to put pages with more free entries at the tail
+ int meanFree = (int) (NUM_ENTRIES - (NUM_ENTRIES * MIN_LOAD_FACTOR));
+ int pageIndexLast = _freeEntryList._tail;
+ int pageIndexCurrent = _freeEntryList._head;
+ int pageIndexNext;
+ UsageEntry[] entries;
+
+ for (;;) {
+ pageIndexNext = PageNext(pageIndexCurrent);
+
+ // move pages with greater than mean number
+ // of free items to tail, move the others to head
+ if (FreeEntryCount(EntriesI(pageIndexCurrent)) > meanFree) {
+ MoveToListTail(pageIndexCurrent, ref _freeEntryList);
+ }
+ else {
+ MoveToListHead(pageIndexCurrent, ref _freeEntryList);
+ }
+
+ // check if entire list has been examined
+ if (pageIndexCurrent == pageIndexLast)
+ break;
+
+ // iterate
+ pageIndexCurrent = pageIndexNext;
+ }
+
+ // Move entries from the free pages at the tail to the
+ // free pages at the front, and release the free pages at the tail.
+ for (;;) {
+ // See if there is room left to move entries used by the page.
+ if (_freeEntryList._tail == -1)
+ break;
+
+ entries = EntriesI(_freeEntryList._tail);
+ Debug.Assert(FreeEntryCount(entries) > 0, "FreeEntryCount(entries) > 0");
+ int availableFreeEntries = (_cPagesInUse * NUM_ENTRIES) - FreeEntryCount(entries) - _cEntriesInUse;
+ if (availableFreeEntries < (NUM_ENTRIES - FreeEntryCount(entries)))
+ break;
+
+ // Move each entry from the page at the tail to a page at the head.
+ for (int i = 1; i < entries.Length; i++) {
+ // skip the free entries
+ if (entries[i]._cacheEntry == null)
+ continue;
+
+ // get a free UsageEntry from the head of the list.
+ Debug.Assert(_freeEntryList._head != _freeEntryList._tail, "_freeEntryList._head != _freeEntryList._tail");
+ UsageEntryRef newRef1 = GetFreeUsageEntry();
+ UsageEntryRef newRef2 = CreateRef2(newRef1);
+ Debug.Assert(newRef1.PageIndex != _freeEntryList._tail, "newRef1.PageIndex != _freeEntryList._tail");
+
+ UsageEntryRef oldRef1 = new UsageEntryRef(_freeEntryList._tail, i);
+ UsageEntryRef oldRef2 = CreateRef2(oldRef1);
+
+ // update the CacheEntry
+ CacheEntry cacheEntry = entries[i]._cacheEntry;
+ Debug.Assert(cacheEntry.UsageEntryRef == oldRef1, "cacheEntry.UsageEntryRef == oldRef1");
+ cacheEntry.UsageEntryRef = newRef1;
+
+ // copy old entry to new entry
+ UsageEntry[] newEntries = EntriesR(newRef1);
+ newEntries[newRef1.Ref1Index] = entries[i];
+
+ // Update free entry count for debugging. We don't bother
+ // to fix up the free entry list for this page as we are
+ // going to release the page.
+ FreeEntryCount(entries)++;
+
+ // Update the last ref list. We need to be careful when
+ // references to the entry refer to the same entry.
+
+ // ref1
+ UsageEntryRef prev = newEntries[newRef1.Ref1Index]._ref1._prev;
+ Debug.Assert(prev != oldRef2, "prev != oldRef2");
+
+ UsageEntryRef next = newEntries[newRef1.Ref1Index]._ref1._next;
+ if (next == oldRef2) {
+ next = newRef2;
+ }
+
+#if DBG
+ Debug.Assert(GetLastRefNext(prev) == oldRef1, "GetLastRefNext(prev) == oldRef1");
+ Debug.Assert(GetLastRefPrev(next) == oldRef1, "GetLastRefPrev(next) == oldRef1");
+#endif
+
+ SetLastRefNext(prev, newRef1);
+ SetLastRefPrev(next, newRef1);
+
+ // ref2
+ prev = newEntries[newRef1.Ref1Index]._ref2._prev;
+ if (prev == oldRef1) {
+ prev = newRef1;
+ }
+
+ next = newEntries[newRef1.Ref1Index]._ref2._next;
+ Debug.Assert(next != oldRef1, "next != oldRef1");
+
+#if DBG
+ Debug.Assert(GetLastRefNext(prev) == oldRef2, "GetLastRefNext(prev) == oldRef2");
+ Debug.Assert(GetLastRefPrev(next) == oldRef2, "GetLastRefPrev(next) == oldRef2");
+#endif
+
+ SetLastRefNext(prev, newRef2);
+ SetLastRefPrev(next, newRef2);
+
+ // _addRef2Head
+ if (_addRef2Head == oldRef2) {
+ _addRef2Head = newRef2;
+ }
+ }
+
+ // now the page is free - release its memory
+ RemovePage(_freeEntryList._tail);
+
+ Debug.Validate("CacheValidateUsage", this);
+ }
+ }
+
+ // Add a new UsageEntry for a CacheEntry.
+ internal void AddCacheEntry(CacheEntry cacheEntry) {
+ lock (this) {
+ // Expand if there are no free UsageEntry's available.
+ if (_freeEntryList._head == -1) {
+ Expand();
+ }
+
+ // get the free entry
+ UsageEntryRef freeRef1 = GetFreeUsageEntry();
+ UsageEntryRef freeRef2 = CreateRef2(freeRef1);
+ Debug.Assert(cacheEntry.UsageEntryRef.IsInvalid, "cacheEntry.UsageEntryRef.IsInvalid");
+ cacheEntry.UsageEntryRef = freeRef1;
+
+ // initialize index
+ UsageEntry[] entries = EntriesR(freeRef1);
+ int entryIndex = freeRef1.Ref1Index;
+ entries[entryIndex]._cacheEntry = cacheEntry;
+ entries[entryIndex]._utcDate = DateTime.UtcNow;
+
+ // add ref1 to head of entire list, ref2 to head of new ref2 list
+#if DBG
+ Debug.Assert(!_addRef2Head.IsRef1, "!_addRef2Head.IsRef1");
+ Debug.Assert(!_lastRefTail.IsRef1, "!_lastRefTail.IsRef1");
+ Debug.Assert(!_lastRefHead.IsRef2, "!_lastRefHead.IsRef2");
+ Debug.Assert(_lastRefTail.IsInvalid == _lastRefHead.IsInvalid, "_lastRefTail.IsInvalid == _lastRefHead.IsInvalid");
+ Debug.Assert(!_lastRefTail.IsInvalid || _addRef2Head.IsInvalid, "!_lastRefTail.IsInvalid || _addRef2Head.IsInvalid");
+ Debug.Assert(GetLastRefNext(_lastRefTail).IsInvalid, "GetLastRefNext(_lastRefTail).IsInvalid");
+ Debug.Assert(GetLastRefPrev(_lastRefHead).IsInvalid, "GetLastRefPrev(_lastRefHead).IsInvalid");
+#endif
+
+ entries[entryIndex]._ref1._prev = UsageEntryRef.INVALID;
+ entries[entryIndex]._ref2._next = _addRef2Head;
+ if (_lastRefHead.IsInvalid) {
+ entries[entryIndex]._ref1._next = freeRef2;
+ entries[entryIndex]._ref2._prev = freeRef1;
+ _lastRefTail = freeRef2;
+ }
+ else {
+ entries[entryIndex]._ref1._next = _lastRefHead;
+ SetLastRefPrev(_lastRefHead, freeRef1);
+
+ UsageEntryRef next, prev;
+ if (_addRef2Head.IsInvalid) {
+ prev = _lastRefTail;
+ next = UsageEntryRef.INVALID;
+ }
+ else {
+ prev = EntriesR(_addRef2Head)[_addRef2Head.Ref2Index]._ref2._prev;
+ next = _addRef2Head;
+ }
+
+ entries[entryIndex]._ref2._prev = prev;
+ SetLastRefNext(prev, freeRef2);
+ SetLastRefPrev(next, freeRef2);
+ }
+
+ _lastRefHead = freeRef1;
+ _addRef2Head = freeRef2;
+
+ _cEntriesInUse++;
+
+ Debug.Trace("CacheUsageAdd",
+ "Added item=" + cacheEntry.Key +
+ ",_bucket=" + _bucket +
+ ",ref=" + freeRef1);
+
+ Debug.Validate("CacheValidateUsage", this);
+ Debug.Dump("CacheUsageAdd", this);
+ }
+ }
+
+ // Remove an entry from the last references list.
+ void RemoveEntryFromLastRefList(UsageEntryRef entryRef) {
+ Debug.Assert(entryRef.IsRef1, "entryRef.IsRef1");
+ UsageEntry[] entries = EntriesR(entryRef);
+ int entryIndex = entryRef.Ref1Index;
+
+ // remove ref1 from list
+ UsageEntryRef prev = entries[entryIndex]._ref1._prev;
+ UsageEntryRef next = entries[entryIndex]._ref1._next;
+
+#if DBG
+ Debug.Assert(GetLastRefNext(prev) == entryRef, "GetLastRefNext(prev) == entryRef");
+ Debug.Assert(GetLastRefPrev(next) == entryRef, "GetLastRefPrev(next) == entryRef");
+#endif
+
+ SetLastRefNext(prev, next);
+ SetLastRefPrev(next, prev);
+
+ // remove ref2 from list
+ prev = entries[entryIndex]._ref2._prev;
+ next = entries[entryIndex]._ref2._next;
+
+ UsageEntryRef entryRef2 = CreateRef2(entryRef);
+
+#if DBG
+ Debug.Assert(GetLastRefNext(prev) == entryRef2, "GetLastRefNext(prev) == entryRef2");
+ Debug.Assert(GetLastRefPrev(next) == entryRef2, "GetLastRefPrev(next) == entryRef2");
+#endif
+
+ SetLastRefNext(prev, next);
+ SetLastRefPrev(next, prev);
+
+ // fixup _addRef2Head
+ if (_addRef2Head == entryRef2) {
+ _addRef2Head = next;
+ }
+ }
+
+ // Remove a CacheEntry from the UsageBucket.
+ internal void RemoveCacheEntry(CacheEntry cacheEntry) {
+ lock (this) {
+ // The cache entry could have been removed from the cache while
+ // we are in the middle of FlushUnderUsedItems, after we have
+ // released the lock and before we ourselves call Cache.Remove().
+ // Guard against that here.
+ UsageEntryRef entryRef = cacheEntry.UsageEntryRef;
+ if (entryRef.IsInvalid)
+ return;
+
+ UsageEntry[] entries = EntriesR(entryRef);
+ int entryIndex = entryRef.Ref1Index;
+
+#if DBG
+ Debug.Assert(entryRef.IsRef1, "entryRef.IsRef1");
+ Debug.Assert(EntryIsUsed(entryRef), "EntryIsUsed(entryRef)");
+ Debug.Assert(cacheEntry == entries[entryIndex]._cacheEntry, "cacheEntry == entries[entryIndex]._cacheEntry");
+#endif
+
+ // update the cache entry
+ cacheEntry.UsageEntryRef = UsageEntryRef.INVALID;
+ entries[entryIndex]._cacheEntry = null;
+
+ // remove from last ref list
+ RemoveEntryFromLastRefList(entryRef);
+
+ // add to free list
+ AddUsageEntryToFreeList(entryRef);
+
+ // remove pages if necessary
+ Reduce();
+
+ Debug.Trace("CacheUsageRemove",
+ "Removed item=" + cacheEntry.Key +
+ ",_bucket=" + _bucket +
+ ",ref=" + entryRef);
+
+ Debug.Validate("CacheValidateUsage", this);
+ Debug.Dump("CacheUsageRemove", this);
+ }
+ }
+
+ // Update the CacheEntry in the last references list.
+ internal void UpdateCacheEntry(CacheEntry cacheEntry) {
+ lock (this) {
+ // The cache entry could have been retreived from the cache while
+ // we are in the middle of FlushUnderUsedItems, after we have
+ // released the lock and before we ourselves call Cache.Remove().
+ // Guard against that here.
+ UsageEntryRef entryRef = cacheEntry.UsageEntryRef;
+ if (entryRef.IsInvalid)
+ return;
+
+#if DBG
+ Debug.Assert(entryRef.IsRef1, "entryRef.IsRef1");
+ Debug.Assert(EntryIsUsed(entryRef), "EntryIsUsed(entryRef)");
+ Debug.Assert(!_lastRefHead.IsInvalid, "!_lastRefHead.IsInvalid");
+ Debug.Assert(!_lastRefTail.IsInvalid, "!_lastRefTail.IsInvalid");
+#endif
+
+ UsageEntry[] entries = EntriesR(entryRef);
+ int entryIndex = entryRef.Ref1Index;
+ UsageEntryRef entryRef2 = CreateRef2(entryRef);
+
+ // remove ref2 from list
+ UsageEntryRef prev = entries[entryIndex]._ref2._prev;
+ UsageEntryRef next = entries[entryIndex]._ref2._next;
+
+#if DBG
+ Debug.Assert(GetLastRefNext(prev) == entryRef2, "GetLastRefNext(prev) == entryRef2");
+ Debug.Assert(GetLastRefPrev(next) == entryRef2, "GetLastRefPrev(next) == entryRef2");
+#endif
+
+ SetLastRefNext(prev, next);
+ SetLastRefPrev(next, prev);
+
+ // fixup _addRef2Head
+ if (_addRef2Head == entryRef2) {
+ _addRef2Head = next;
+ }
+
+ // move ref1 to ref2
+ entries[entryIndex]._ref2 = entries[entryIndex]._ref1;
+ prev = entries[entryIndex]._ref2._prev;
+ next = entries[entryIndex]._ref2._next;
+
+#if DBG
+ Debug.Assert(GetLastRefNext(prev) == entryRef, "GetLastRefNext(prev) == entryRef");
+ Debug.Assert(GetLastRefPrev(next) == entryRef, "GetLastRefPrev(next) == entryRef");
+#endif
+
+ SetLastRefNext(prev, entryRef2);
+ SetLastRefPrev(next, entryRef2);
+
+ // put ref1 at head of list
+ entries[entryIndex]._ref1._prev = UsageEntryRef.INVALID;
+ entries[entryIndex]._ref1._next = _lastRefHead;
+
+#if DBG
+ Debug.Assert(GetLastRefPrev(_lastRefHead).IsInvalid, "GetLastRefPrev(_lastRefHead).IsInvalid");
+#endif
+
+ SetLastRefPrev(_lastRefHead, entryRef);
+ _lastRefHead = entryRef;
+
+ Debug.Trace("CacheUsageUpdate",
+ "Updated item=" + cacheEntry.Key +
+ ",_bucket=" + _bucket +
+ ",ref=" + entryRef);
+
+ Debug.Validate("CacheValidateUsage", this);
+ Debug.Dump("CacheUsageUpdate", this);
+ }
+ }
+
+ // Flush under used items from the cache.
+ // If force is false, then we will skip items that have not aged enough
+ // to accumulate history.
+ // publicEntriesFlushed keeps track of the number of public entries that are flushed
+ internal int FlushUnderUsedItems(int maxFlush, bool force, ref int publicEntriesFlushed, ref int ocEntriesFlushed) {
+#if DBG
+ if (Debug.IsTagPresent("CacheUsageNoFlush") && Debug.IsTagEnabled("CacheUsageNoFlush"))
+ return 0;
+#endif
+
+ // Check if there is something to flush
+ if (_cEntriesInUse == 0)
+ return 0;
+
+ Debug.Assert(maxFlush > 0, "maxFlush is not greater than 0, instead is " + maxFlush);
+ Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0");
+
+ // We create a list of UsageEntry's that we wish to flush. These entries
+ // are not considered free, so the page that holds them will not be removed.
+ // inFlushHead will point to the head of that list, while we use the same
+ // UsageEntry._ref1 to chain them together (after we remove them from
+ // the LastRef list.)
+ UsageEntryRef inFlushHead = UsageEntryRef.INVALID;
+
+ UsageEntryRef prev, prevNext;
+ DateTime utcDate;
+ UsageEntry[] entries;
+ int entryIndex;
+ CacheEntry cacheEntry;
+ int flushed = 0;
+
+ try {
+ // Block insertion into the Cache if we're under high memory pressure
+ _cacheUsage.CacheSingle.BlockInsertIfNeeded();
+
+ lock (this) {
+ Debug.Assert(_blockReduce == false, "_blockReduce == false");
+
+ // Recheck if there is something to flush.
+ if (_cEntriesInUse == 0)
+ return 0;
+
+ DateTime utcNow = DateTime.UtcNow;
+
+ // Walk the ref2 list backwards, as these are the items that have
+ // been used least.
+ for (prev = _lastRefTail; _cEntriesInFlush < maxFlush && !prev.IsInvalid; prev = prevNext) {
+ Debug.Assert(_cEntriesInUse > 0, "_cEntriesInUse > 0");
+
+ // Set prevNext before possibly freeing an item.
+ // Examine only at ref2 items so we don't enumerate an
+ // item twice.
+ prevNext = EntriesR(prev)[prev.Ref2Index]._ref2._prev;
+ while (prevNext.IsRef1) {
+ prevNext = EntriesR(prevNext)[prevNext.Ref1Index]._ref1._prev;
+ }
+
+#if DBG
+ Debug.Assert(prev.IsRef2, "prev.IsRef2");
+ Debug.Assert(EntryIsUsed(prev), "EntryIsUsed(prev)");
+ Debug.Assert(EntryIsUsed(prev), "EntryIsUsed(prev)");
+#endif
+
+ entries = EntriesR(prev);
+ entryIndex = prev.Ref2Index;
+
+ // Do not remove an item if it was recently added to the last references list,
+ // as it has not had enough time to accumulate usage history.
+ if (!force) {
+ utcDate = entries[entryIndex]._utcDate;
+ Debug.Assert(utcDate != DateTime.MinValue, "utcDate != DateTime.MinValue");
+
+ if (utcNow - utcDate <= CacheUsage.NEWADD_INTERVAL && utcNow >= utcDate)
+ continue;
+ }
+
+ UsageEntryRef prev1 = CreateRef1(prev);
+ cacheEntry = entries[entryIndex]._cacheEntry;
+ Debug.Assert(cacheEntry.UsageEntryRef == prev1, "cacheEntry.UsageEntryRef == prev1");
+ Debug.Trace("CacheUsageFlushUnderUsedItem", "Flushing underused items, item=" + cacheEntry.Key + ", bucket=" + _bucket);
+
+ // Remove reference from CacheEntry. We must do this before we
+ // release the lock, otherwise the item would be corrupted if
+ // UpdateCacheEntry or RemoveCacheEntry were called.
+ cacheEntry.UsageEntryRef = UsageEntryRef.INVALID;
+
+ // Keep track of how many public entries were flushed
+ if (cacheEntry.IsPublic) {
+ publicEntriesFlushed ++;
+ }
+ else if (cacheEntry.IsOutputCache) {
+ ocEntriesFlushed++;
+ }
+
+ // remove from lastref list
+ RemoveEntryFromLastRefList(prev1);
+
+ // add it to the inFlush list
+ entries[entryIndex]._ref1._next = inFlushHead;
+ inFlushHead = prev1;
+
+ flushed++;
+ _cEntriesInFlush++;
+ }
+
+ if (flushed == 0) {
+ Debug.Trace("CacheUsageFlushTotal", "Flush(" + maxFlush + "," + force + ") removed " + flushed +
+ " underused items; Time=" + Debug.FormatLocalDate(DateTime.Now));
+
+ return 0;
+ }
+
+
+ // We are about to leave the lock. However, we still have to use the
+ // locally created "inFlush list" after that. That's why we have to
+ // set _blockReduce to true to prevent Reduce() from moving the
+ // entries around.
+ _blockReduce = true;
+ }
+ }
+ finally {
+ // Don't hold any insertblock before we remove Cache items. If not, the following
+ // deadlock scenario may happen:
+ // - 3rd party code hold lock A, call Cache.Insert, which wait for the Cache insertblock
+ // - FlushUnderUsedItems holds the Cache insertBlock, call Cache.Remove, which call
+ // 3rd party CacheItemRemovedCallback, which then try to get lock A
+
+ _cacheUsage.CacheSingle.UnblockInsert();
+ }
+
+ // We need to release the lock because when we do remove below,
+ // some CacheRemoveCallback user code might run that might
+ // do a cache insert in another thread, and will cause
+ // a CacheUsage insert/remove/update, we will block
+ // that thread, which cause a deadlock if the user code is
+ // waiting for that thread to finish its job.
+
+ Debug.Assert(!inFlushHead.IsInvalid, "!inFlushHead.IsInvalid");
+
+ // Remove items on the inFlush list from the rest of the cache.
+ CacheSingle cacheSingle = _cacheUsage.CacheSingle;
+ UsageEntryRef current = inFlushHead;
+ UsageEntryRef next;
+ while (!current.IsInvalid) {
+ entries = EntriesR(current);
+ entryIndex = current.Ref1Index;
+
+ next = entries[entryIndex]._ref1._next;
+
+ // remove the entry
+ cacheEntry = entries[entryIndex]._cacheEntry;
+ entries[entryIndex]._cacheEntry = null;
+ Debug.Assert(cacheEntry.UsageEntryRef.IsInvalid, "cacheEntry.UsageEntryRef.IsInvalid");
+ cacheSingle.Remove(cacheEntry, CacheItemRemovedReason.Underused);
+
+ //iterate
+ current = next;
+ }
+
+ try {
+ // Block insertion into the Cache if we're under high memory pressure
+ _cacheUsage.CacheSingle.BlockInsertIfNeeded();
+
+ lock (this) {
+ // add each UsageEntry to the free list
+ current = inFlushHead;
+ while (!current.IsInvalid) {
+ entries = EntriesR(current);
+ entryIndex = current.Ref1Index;
+
+ next = entries[entryIndex]._ref1._next;
+
+ _cEntriesInFlush--;
+ AddUsageEntryToFreeList(current);
+
+ //iterate
+ current = next;
+ }
+
+ // try to reduce
+ Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0");
+ _blockReduce = false;
+ Reduce();
+
+ Debug.Trace("CacheUsageFlushTotal", "Flush(" + maxFlush + "," + force + ") removed " + flushed +
+ " underused items; Time=" + Debug.FormatLocalDate(DateTime.Now));
+
+ Debug.Validate("CacheValidateUsage", this);
+ Debug.Dump("CacheUsageFlush", this);
+ }
+ }
+ finally {
+ _cacheUsage.CacheSingle.UnblockInsert();
+ }
+
+ return flushed;
+ }
+
+#if DBG
+ internal void DebugValidate() {
+ int cFree = 0;
+ int cEntriesInUse = 0;
+ int cPagesInUse = 0;
+ int pagesLength;
+
+ if (_pages == null) {
+ pagesLength = 0;
+ }
+ else {
+ pagesLength = _pages.Length;
+ }
+
+ Debug.CheckValid(-1 <= _freePageList._head && _freePageList._head <= pagesLength, "-1 <= _freePageList._head && _freePageList._head <= pagesLength");
+ Debug.CheckValid(-1 <= _freeEntryList._head && _freeEntryList._head <= pagesLength, "-1 <= _freeEntryList._head && _freeEntryList._head <= pagesLength");
+ Debug.CheckValid(-1 <= _freeEntryList._tail && _freeEntryList._tail <= pagesLength, "-1 <= _freeEntryList._tail && _freeEntryList._tail <= pagesLength");
+ Debug.CheckValid((_freeEntryList._head == -1) == (_freeEntryList._tail == -1), "(_freeEntryList._head == -1) == (_freeEntryList._tail == -1)");
+ Debug.CheckValid(_minEntriesInUse >= -1, "_minEntriesInUse >= -1");
+ Debug.CheckValid(_lastRefHead.IsInvalid == _lastRefTail.IsInvalid, "_lastRefHead.IsInvalid == _lastRefTail.IsInvalid");
+ Debug.CheckValid(!_lastRefTail.IsInvalid || _addRef2Head.IsInvalid, "!_lastRefTail.IsInvalid || _addRef2Head.IsInvalid");
+ Debug.CheckValid(!_lastRefHead.IsRef2, "!_lastRefHead.IsRef2");
+ Debug.CheckValid(!_lastRefTail.IsRef1, "!_lastRefTail.IsRef1");
+ Debug.CheckValid(!_addRef2Head.IsRef1, "!_addRef2Head.IsRef1");
+ Debug.CheckValid(_cEntriesInFlush >= 0, "_cEntriesInFlush >= 0");
+
+ // check counts
+ for (int i = 0; i < pagesLength; i++) {
+ UsageEntry[] entries = _pages[i]._entries;
+ if (entries != null) {
+ cPagesInUse++;
+ cFree = 0;
+
+ Debug.CheckValid(entries[0]._cacheEntry == null, "entries[0]._cacheEntry == null");
+ Debug.CheckValid(entries[0]._utcDate == DateTime.MinValue, "entries[0]._utcDate == DateTime.MinValue");
+
+ for (int j = 1; j < entries.Length; j++) {
+ if (EntryIsFree(new UsageEntryRef(i, j))) {
+ cFree++;
+ }
+ else {
+ cEntriesInUse++;
+ }
+ }
+
+ Debug.CheckValid(cFree == FreeEntryCount(entries), "cFree == FreeEntryCount(entries)");
+
+ // walk the free list
+ cFree = 0;
+ if (!FreeEntryHead(entries).IsInvalid) {
+ int j = FreeEntryHead(entries).Ref1Index;
+ for (;;) {
+ cFree++;
+ Debug.CheckValid(cFree <= FreeEntryCount(entries), "cFree <= FreeEntryCount(entries)");
+
+ if (entries[j]._ref1._next.IsInvalid)
+ break;
+
+ j = entries[j]._ref1._next.Ref1Index;
+ }
+ }
+ Debug.CheckValid(cFree == FreeEntryCount(entries), "cFree == FreeEntryCount(entries)");
+ }
+ }
+
+ Debug.CheckValid(cPagesInUse == _cPagesInUse, "cPagesInUse == _cPagesInUse");
+ Debug.CheckValid(cEntriesInUse == _cEntriesInUse, "cEntriesInUse == _cEntriesInUse");
+
+ // walk the free slot list
+ int cFreeSlots = 0;
+ if (_freePageList._head != -1) {
+ for (int i = _freePageList._head; i != -1; i = _pages[i]._pageNext) {
+ cFreeSlots++;
+ Debug.CheckValid(cFreeSlots <= pagesLength, "cFreeSlots <= pagesLength");
+ Debug.CheckValid(_pages[i]._entries == null, "_pages[i]._entries == null");
+ if (_freePageList._head != i) {
+ Debug.CheckValid(PageNext(PagePrev(i)) == i, "PageNext(PagePrev(i)) == i");
+ }
+
+ if (_freePageList._tail != i) {
+ Debug.CheckValid(PagePrev(PageNext(i)) == i, "PagePrev(PageNext(i)) == i");
+ }
+ }
+ }
+ Debug.CheckValid(cFreeSlots == pagesLength - _cPagesInUse, "cFreeSlots == pagesLength - _cPagesInUse");
+
+ // walk the free page list
+ int cFreeEntries = 0;
+ int cFreePages = 0;
+ if (_freeEntryList._head != -1) {
+ for (int i = _freeEntryList._head; i != -1; i = _pages[i]._pageNext) {
+ cFreePages++;
+ Debug.CheckValid(cFreePages <= pagesLength, "cFreePages < pagesLength");
+ UsageEntry[] entries = _pages[i]._entries;
+ Debug.CheckValid(entries != null, "entries != null");
+ cFreeEntries += FreeEntryCount(entries);
+ if (_freeEntryList._head != i) {
+ Debug.CheckValid(PageNext(PagePrev(i)) == i, "PageNext(PagePrev(i)) == i");
+ }
+
+ if (_freeEntryList._tail != i) {
+ Debug.CheckValid(PagePrev(PageNext(i)) == i, "PagePrev(PageNext(i)) == i");
+ }
+ }
+ }
+
+ Debug.CheckValid(cFreeEntries == (_cPagesInUse * NUM_ENTRIES) - _cEntriesInUse, "cFreeEntries == (_cPagesInUse * NUM_ENTRIES) - _cEntriesInUse");
+
+ // walk last ref list forwards
+ int cTotalRefs = 2 * (_cEntriesInUse - _cEntriesInFlush);
+ int cRefs = 0;
+ UsageEntryRef last = UsageEntryRef.INVALID;
+ UsageEntryRef next = _lastRefHead;
+ while (!next.IsInvalid) {
+ cRefs++;
+ Debug.CheckValid(cRefs <= cTotalRefs, "cRefs <= cTotalRefs");
+ Debug.CheckValid(EntryIsUsed(next), "EntryIsUsed(next)");
+ Debug.CheckValid(GetLastRefPrev(next) == last, "GetLastRefPrev(next) == last");
+ last = next;
+ next = GetLastRefNext(next);
+ }
+
+ Debug.CheckValid(cRefs == cTotalRefs, "cRefs == cTotalRefs");
+
+ // walk list backwards
+ cRefs = 0;
+ last = UsageEntryRef.INVALID;
+ UsageEntryRef prev = _lastRefTail;
+ while (!prev.IsInvalid) {
+ cRefs++;
+ Debug.CheckValid(cRefs <= cTotalRefs, "cRefs <= cTotalRefs");
+ Debug.CheckValid(EntryIsUsed(prev), "EntryIsUsed(next)");
+ Debug.CheckValid(GetLastRefNext(prev) == last, "GetLastRefPrev(next) == last");
+ last = prev;
+ prev = GetLastRefPrev(prev);
+ }
+
+ Debug.CheckValid(cRefs == cTotalRefs, "cRefs == cTotalRefs");
+
+ // walk the add2ref list
+ cRefs = 0;
+ last = GetLastRefPrev(_addRef2Head);
+ next = _addRef2Head;
+ while (!next.IsInvalid) {
+ cRefs++;
+ Debug.CheckValid(cRefs <= (cTotalRefs / 2), "cRefs <= (cTotalRefs / 2)");
+ Debug.CheckValid(EntryIsUsed(next), "EntryIsUsed(next)");
+ Debug.CheckValid(GetLastRefPrev(next) == last, "GetLastRefPrev(next) == last");
+ Debug.CheckValid(!next.IsRef1, "!next.IsRef1");
+ last = next;
+ next = GetLastRefNext(next);
+ }
+
+ Debug.CheckValid(cRefs <= (cTotalRefs / 2), "cRefs <= (cTotalRefs / 2)");
+ }
+
+ internal string DebugDescription(string indent) {
+ StringBuilder sb = new StringBuilder();
+ string i2 = indent + " ";
+
+ sb.Append(indent +
+ "_bucket=" + _bucket +
+ ",_cEntriesInUse=" + _cEntriesInUse +
+ ",_cPagesInUse=" + _cPagesInUse +
+ ",_pages is " + (_pages == null ? "null" : "non-null") +
+ ",_minEntriesInUse=" + _minEntriesInUse +
+ ",_freePageList._head=" + _freePageList._head +
+ ",_freeEntryList._head=" + _freeEntryList._head +
+ ",_freeEntryList._tail=" + _freeEntryList._tail +
+ "\n");
+
+ sb.Append(indent + "Refs list, in order:\n");
+
+ UsageEntryRef next = _lastRefHead;
+ while (!next.IsInvalid) {
+ if (next.IsRef1) {
+ sb.Append(i2 + next.PageIndex + ":" + next.Ref1Index + " (1): " + EntriesR(next)[next.Ref1Index]._cacheEntry.Key + "\n");
+ }
+ else {
+ sb.Append(i2 + next.PageIndex + ":" + next.Ref2Index + " (2): " + EntriesR(next)[next.Ref2Index]._cacheEntry.Key + "\n");
+ }
+
+ next = GetLastRefNext(next);
+ }
+
+ return sb.ToString();
+ }
+#endif
+ }
+
+ class CacheUsage {
+ internal static readonly TimeSpan NEWADD_INTERVAL = new TimeSpan(0, 0, 10);
+ internal static readonly TimeSpan CORRELATED_REQUEST_TIMEOUT = new TimeSpan(0, 0, 1);
+ internal static readonly TimeSpan MIN_LIFETIME_FOR_USAGE = NEWADD_INTERVAL;
+ const byte NUMBUCKETS = (byte) (CacheItemPriority.High);
+ const int MAX_REMOVE = 1024; // one page of poiners to CacheEntry's
+
+ readonly CacheSingle _cacheSingle;
+ internal readonly UsageBucket[] _buckets;
+ int _inFlush;
+
+ internal CacheUsage(CacheSingle cacheSingle) {
+ Debug.Assert((int) CacheItemPriority.Low == 1, "(int) CacheItemPriority.Low == 1");
+
+ _cacheSingle = cacheSingle;
+ _buckets = new UsageBucket[NUMBUCKETS];
+ for (byte b = 0; b < _buckets.Length; b++) {
+ _buckets[b] = new UsageBucket(this, b);
+ }
+ }
+
+ internal CacheSingle CacheSingle {
+ get {
+ return _cacheSingle;
+ }
+ }
+
+ internal void Add(CacheEntry cacheEntry) {
+ byte bucket = cacheEntry.UsageBucket;
+ Debug.Assert(bucket != 0xff, "bucket != 0xff");
+ _buckets[bucket].AddCacheEntry(cacheEntry);
+ }
+
+ internal void Remove(CacheEntry cacheEntry) {
+ byte bucket = cacheEntry.UsageBucket;
+ if (bucket != 0xff) {
+ _buckets[bucket].RemoveCacheEntry(cacheEntry);
+ }
+ }
+
+ internal void Update(CacheEntry cacheEntry) {
+ byte bucket = cacheEntry.UsageBucket;
+ if (bucket != 0xff) {
+ _buckets[bucket].UpdateCacheEntry(cacheEntry);
+ }
+ }
+
+ // publicEntriesFlushed keeps track of the number of public entries that are flushed
+ internal int FlushUnderUsedItems(int toFlush, ref int publicEntriesFlushed, ref int ocEntriesFlushed) {
+ int flushed = 0;
+
+ if (Interlocked.Exchange(ref _inFlush, 1) == 0) {
+ try {
+ foreach (UsageBucket usageBucket in _buckets) {
+ int flushedOne = usageBucket.FlushUnderUsedItems(toFlush - flushed,
+ false,
+ ref publicEntriesFlushed,
+ ref ocEntriesFlushed);
+ flushed += flushedOne;
+ if (flushed >= toFlush)
+ break;
+ }
+
+ if (flushed < toFlush) {
+ foreach (UsageBucket usageBucket in _buckets) {
+ int flushedOne = usageBucket.FlushUnderUsedItems(toFlush - flushed,
+ true,
+ ref publicEntriesFlushed,
+ ref ocEntriesFlushed);
+ flushed += flushedOne;
+ if (flushed >= toFlush)
+ break;
+ }
+ }
+ }
+ finally {
+ Interlocked.Exchange(ref _inFlush, 0);
+ }
+ }
+
+ return flushed;
+ }
+
+#if DBG
+ internal void DebugValidate() {
+ foreach (UsageBucket usageBucket in _buckets) {
+ usageBucket.DebugValidate();
+ }
+ }
+
+ internal string DebugDescription(string indent) {
+ StringBuilder sb = new StringBuilder();
+ string i2 = indent + " ";
+
+ sb.Append(indent);
+ sb.Append("Cache Usage\n");
+
+ foreach (UsageBucket usageBucket in _buckets) {
+ sb.Append(usageBucket.DebugDescription(i2));
+ }
+
+ return sb.ToString();
+ }
+#endif
+ }
+}
diff --git a/mcs/class/referencesource/System.Web/httpserverutility.cs b/mcs/class/referencesource/System.Web/httpserverutility.cs
index 0b42996659a..54ea1bc1687 100644
--- a/mcs/class/referencesource/System.Web/httpserverutility.cs
+++ b/mcs/class/referencesource/System.Web/httpserverutility.cs
@@ -492,7 +492,7 @@ namespace System.Web {
targetPage.SmartNavigation = true;
#pragma warning restore 0618
- // If the target page is async need to save/restore [....] context
+ // If the target page is async need to save/restore sync context
if (targetPage is IHttpAsyncHandler) {
savedSyncContext = _context.InstallNewAspNetSynchronizationContext();
}
diff --git a/mcs/class/referencesource/System.Web/misc/SecurityUtils.cs b/mcs/class/referencesource/System.Web/misc/SecurityUtils.cs
index 76e02fafbaf..159dedbb6c6 100644
--- a/mcs/class/referencesource/System.Web/misc/SecurityUtils.cs
+++ b/mcs/class/referencesource/System.Web/misc/SecurityUtils.cs
@@ -8,11 +8,11 @@
*/
-#if WINFORMS_NAMESPACE
+#if Microsoft_NAMESPACE
namespace System.Windows.Forms
#elif DRAWING_NAMESPACE
namespace System.Drawing
-#elif WINFORMS_PUBLIC_GRAPHICS_LIBRARY
+#elif Microsoft_PUBLIC_GRAPHICS_LIBRARY
namespace System.Internal
#elif SYSTEM_NAMESPACE
namespace System
@@ -127,7 +127,7 @@ namespace System.Windows.Forms
return Activator.CreateInstance(type, flags, null, args, null);
}
-#if (!WINFORMS_NAMESPACE)
+#if (!Microsoft_NAMESPACE)
/// <devdoc>
/// This helper method provides safe access to Activator.CreateInstance.
diff --git a/mcs/class/referencesource/System.Workflow.Activities/Common/BasePropertyDescriptor.cs b/mcs/class/referencesource/System.Workflow.Activities/Common/BasePropertyDescriptor.cs
index edf00c3bb36..ce27594af14 100644
--- a/mcs/class/referencesource/System.Workflow.Activities/Common/BasePropertyDescriptor.cs
+++ b/mcs/class/referencesource/System.Workflow.Activities/Common/BasePropertyDescriptor.cs
@@ -22,7 +22,7 @@ using System.Workflow.ComponentModel.Design;
/*********************************************************************
* NOTE: A copy of this file exists at: WF\Common\Shared
- * The two files must be kept in [....]. Any change made here must also
+ * The two files must be kept in sync. Any change made here must also
* be made to WF\Common\Shared\BasePropertyDescriptor.cs
*********************************************************************/
diff --git a/mcs/class/referencesource/System.Workflow.Activities/Common/CompModHelpers.cs b/mcs/class/referencesource/System.Workflow.Activities/Common/CompModHelpers.cs
index cc6b22aba9e..755e13a69f8 100644
--- a/mcs/class/referencesource/System.Workflow.Activities/Common/CompModHelpers.cs
+++ b/mcs/class/referencesource/System.Workflow.Activities/Common/CompModHelpers.cs
@@ -9,7 +9,7 @@
/*********************************************************************
* NOTE: A copy of this file exists at: WF\Common\Shared
- * The two files must be kept in [....]. Any change made here must also
+ * The two files must be kept in sync. Any change made here must also
* be made to WF\Common\Shared\CompModHelpers.cs
*********************************************************************/
diff --git a/mcs/class/referencesource/System.Workflow.Activities/Common/CompilerHelpers.cs b/mcs/class/referencesource/System.Workflow.Activities/Common/CompilerHelpers.cs
index d02d9fe9138..27ec4c11f6d 100644
--- a/mcs/class/referencesource/System.Workflow.Activities/Common/CompilerHelpers.cs
+++ b/mcs/class/referencesource/System.Workflow.Activities/Common/CompilerHelpers.cs
@@ -10,7 +10,7 @@
/*********************************************************************
* NOTE: A copy of this file exists at: WF\Common\Shared
- * The two files must be kept in [....]. Any change made here must also
+ * The two files must be kept in sync. Any change made here must also
* be made to WF\Common\Shared\CompilerHelpers.cs
*********************************************************************/
diff --git a/mcs/class/referencesource/System.Workflow.Activities/Common/DelegateTypeInfo.cs b/mcs/class/referencesource/System.Workflow.Activities/Common/DelegateTypeInfo.cs
index c3667ac5b60..a7f911669f6 100644
--- a/mcs/class/referencesource/System.Workflow.Activities/Common/DelegateTypeInfo.cs
+++ b/mcs/class/referencesource/System.Workflow.Activities/Common/DelegateTypeInfo.cs
@@ -9,7 +9,7 @@
/*********************************************************************
* NOTE: A copy of this file exists at: WF\Common\Shared
- * The two files must be kept in [....]. Any change made here must also
+ * The two files must be kept in sync. Any change made here must also
* be made to WF\Common\Shared\DelegateTypeInfo.cs
*********************************************************************/
diff --git a/mcs/class/referencesource/System.Workflow.Activities/Common/NativeMethods.cs b/mcs/class/referencesource/System.Workflow.Activities/Common/NativeMethods.cs
index 38e72c5ab8c..8870aea0337 100644
--- a/mcs/class/referencesource/System.Workflow.Activities/Common/NativeMethods.cs
+++ b/mcs/class/referencesource/System.Workflow.Activities/Common/NativeMethods.cs
@@ -9,7 +9,7 @@
/*********************************************************************
* NOTE: A copy of this file exists at: WF\Common\Shared
- * The two files must be kept in [....]. Any change made here must also
+ * The two files must be kept in sync. Any change made here must also
* be made to WF\Common\Shared\NativeMethods.cs
*********************************************************************/
namespace System.Workflow.Activities.Common
diff --git a/mcs/class/referencesource/System.Workflow.Activities/Common/TypeSystemHelpers.cs b/mcs/class/referencesource/System.Workflow.Activities/Common/TypeSystemHelpers.cs
index caa3bbcf2bc..d8cc8d986e5 100644
--- a/mcs/class/referencesource/System.Workflow.Activities/Common/TypeSystemHelpers.cs
+++ b/mcs/class/referencesource/System.Workflow.Activities/Common/TypeSystemHelpers.cs
@@ -9,7 +9,7 @@
/*********************************************************************
* NOTE: A copy of this file exists at: WF\Common\Shared
- * The two files must be kept in [....]. Any change made here must also
+ * The two files must be kept in sync. Any change made here must also
* be made to WF\Common\Shared\TypeSystemHelpers.cs
*********************************************************************/
namespace System.Workflow.Activities.Common
diff --git a/mcs/class/referencesource/System.Workflow.Activities/Common/ValidationHelpers.cs b/mcs/class/referencesource/System.Workflow.Activities/Common/ValidationHelpers.cs
index b0ada5fd4c6..65a90259007 100644
--- a/mcs/class/referencesource/System.Workflow.Activities/Common/ValidationHelpers.cs
+++ b/mcs/class/referencesource/System.Workflow.Activities/Common/ValidationHelpers.cs
@@ -9,7 +9,7 @@
/*********************************************************************
* NOTE: A copy of this file exists at: WF\Common\Shared
- * The two files must be kept in [....]. Any change made here must also
+ * The two files must be kept in sync. Any change made here must also
* be made to WF\Common\Shared\ValidationHelpers.cs
*********************************************************************/
namespace System.Workflow.Activities.Common
diff --git a/mcs/class/referencesource/System.Workflow.Activities/Common/Walker.cs b/mcs/class/referencesource/System.Workflow.Activities/Common/Walker.cs
index 9bd77fe7ed7..7e450ac2b2f 100644
--- a/mcs/class/referencesource/System.Workflow.Activities/Common/Walker.cs
+++ b/mcs/class/referencesource/System.Workflow.Activities/Common/Walker.cs
@@ -9,7 +9,7 @@
/*********************************************************************
* NOTE: A copy of this file exists at: WF\Common\Shared
- * The two files must be kept in [....]. Any change made here must also
+ * The two files must be kept in sync. Any change made here must also
* be made to WF\Common\Shared\Walker.cs
*********************************************************************/
namespace System.Workflow.Activities.Common
diff --git a/mcs/class/referencesource/System.Workflow.Activities/Common/userdatakeys.cs b/mcs/class/referencesource/System.Workflow.Activities/Common/userdatakeys.cs
index 96aeacd9207..b2a5a7a3302 100644
--- a/mcs/class/referencesource/System.Workflow.Activities/Common/userdatakeys.cs
+++ b/mcs/class/referencesource/System.Workflow.Activities/Common/userdatakeys.cs
@@ -9,7 +9,7 @@
/*********************************************************************
* NOTE: A copy of this file exists at: WF\Common\Shared
- * The two files must be kept in [....]. Any change made here must also
+ * The two files must be kept in sync. Any change made here must also
* be made to WF\Common\Shared\userdatakeys.cs
*********************************************************************/
namespace System.Workflow.Activities.Common
diff --git a/mcs/class/referencesource/System.Workflow.Activities/LocalService/FollowerQueueCreator.cs b/mcs/class/referencesource/System.Workflow.Activities/LocalService/FollowerQueueCreator.cs
index a9088872fd4..3db7b1ea94a 100644
--- a/mcs/class/referencesource/System.Workflow.Activities/LocalService/FollowerQueueCreator.cs
+++ b/mcs/class/referencesource/System.Workflow.Activities/LocalService/FollowerQueueCreator.cs
@@ -1,4 +1,4 @@
-#region Using directives
+#region Using directives
using System;
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Compiler/TypeSystem/DesignTimeType.cs b/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Compiler/TypeSystem/DesignTimeType.cs
index 32eec08bf71..3b0c2765ac0 100644
--- a/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Compiler/TypeSystem/DesignTimeType.cs
+++ b/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Compiler/TypeSystem/DesignTimeType.cs
@@ -1120,7 +1120,7 @@ namespace System.Workflow.ComponentModel.Compiler
// add default constructors for classes unless they
// exist in the source code. Unfortunately, this cannot be easily
// fixed in the CodeDomParser because the code dom returned by that
- // class is expected to kept in [....] with the real source code.
+ // class is expected to kept in sync with the real source code.
// So we cannot "fabricate" a default constructor there without
// breaking lots of assumptions elsewhere in the code.
// Instead, we add a default constructor here, if necessary.
diff --git a/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/CommandSet.cs b/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/CommandSet.cs
index d621aec247d..27a55ac9886 100644
--- a/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/CommandSet.cs
+++ b/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/CommandSet.cs
@@ -80,7 +80,7 @@ namespace System.Workflow.ComponentModel.Design
// Properties
new CommandSetItem(new EventHandler(OnStatusAlways), new EventHandler(OnMenuDesignerProperties), WorkflowMenuCommands.DesignerProperties),
- // IMPORTANT: [....] does not handle this command, so VS.NET sends it to solution explorer
+ // IMPORTANT: Microsoft does not handle this command, so VS.NET sends it to solution explorer
// window, which enables this meu item on the for the current file node
new CommandSetItem(new EventHandler(OnStatusAlways), new EventHandler(OnViewCode), new CommandID(StandardCommands.Cut.Guid, 333)),
@@ -563,7 +563,7 @@ namespace System.Workflow.ComponentModel.Design
WorkflowView view = rootDesigner.GetView(ViewTechnology.Default) as WorkflowView;
if (view != null)
{
- //because the some key presses are not coming into the [....] OnKeyDown
+ //because the some key presses are not coming into the Microsoft OnKeyDown
//we need to do this work around to manually send the keypress into the designer
KeyEventArgs eventArgs = new KeyEventArgs(key);
diff --git a/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/Dialogs/ThemeConfigurationDialog.cs b/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/Dialogs/ThemeConfigurationDialog.cs
index aa9a5ced955..ad60d2bfc19 100644
--- a/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/Dialogs/ThemeConfigurationDialog.cs
+++ b/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/Dialogs/ThemeConfigurationDialog.cs
@@ -25,7 +25,7 @@ namespace System.Workflow.ComponentModel.Design
[Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")]
public sealed class ThemeConfigurationDialog : System.Windows.Forms.Form
{
- #region [....] Generated Members
+ #region Microsoft Generated Members
private System.Windows.Forms.Button button3;
private System.Windows.Forms.TreeView designerTreeView;
private System.Windows.Forms.Label themeNameLabel;
diff --git a/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/Dialogs/WorkflowPageSetupDialog.cs b/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/Dialogs/WorkflowPageSetupDialog.cs
index 57f8cb537bd..0c0d1897ee4 100644
--- a/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/Dialogs/WorkflowPageSetupDialog.cs
+++ b/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/Dialogs/WorkflowPageSetupDialog.cs
@@ -14,7 +14,7 @@ namespace System.Workflow.ComponentModel.Design
[Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")]
public sealed class WorkflowPageSetupDialog : System.Windows.Forms.Form
{
- #region [....] Desiger Generated Members
+ #region Microsoft Desiger Generated Members
private System.ComponentModel.Container components = null;
private System.Windows.Forms.TabControl tabs;
private System.Windows.Forms.PictureBox landscapePicture;
diff --git a/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/MenuCommands.cs b/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/MenuCommands.cs
index 9d07b2e1026..c8701dd8fdc 100644
--- a/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/MenuCommands.cs
+++ b/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/MenuCommands.cs
@@ -60,7 +60,7 @@ namespace System.Workflow.ComponentModel.Design
private const int cmdidWOEShowAll = 0x3107;
public const int FirstZoomCommand = cmdidWOEZoom400; //the first and last zoom commands
- public const int LastZoomCommand = cmdidWOEShowAll; //should be in [....] with the \private\Core\Tools\OrchestrationDesignerUI\PkgCmdID.h
+ public const int LastZoomCommand = cmdidWOEShowAll; //should be in sync with the \private\Core\Tools\OrchestrationDesignerUI\PkgCmdID.h
// page layout
private const int cmdidDefaultPage = 0x3110;
diff --git a/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/ReferenceService.cs b/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/ReferenceService.cs
index 14e64a3aebc..a2ca29c6aaa 100644
--- a/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/ReferenceService.cs
+++ b/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/ReferenceService.cs
@@ -64,7 +64,7 @@ namespace System.Workflow.ComponentModel.Design
{
// If the references are null, create them for the first time and connect
// up our events to listen to changes to the container. Otherwise, check to
- // see if the added or removed lists contain anything for us to [....] up.
+ // see if the added or removed lists contain anything for us to sync up.
//
if (this.references == null)
{
diff --git a/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/StructuredCompositeActivityDesigner.cs b/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/StructuredCompositeActivityDesigner.cs
index 0decc066f5e..ed7ed08ff4e 100644
--- a/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/StructuredCompositeActivityDesigner.cs
+++ b/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/StructuredCompositeActivityDesigner.cs
@@ -150,7 +150,7 @@ namespace System.Workflow.ComponentModel.Design
//activities with errors we want to reveal these activities
DesignerHelpers.RefreshDesignerActions(Activity.Site);
- //Keep the dynamic action and designer verbs in [....]
+ //Keep the dynamic action and designer verbs in sync
RefreshDesignerVerbs();
}
}
diff --git a/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/WorkflowView.cs b/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/WorkflowView.cs
index 1b8a6df8015..320e30b6d99 100644
--- a/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/WorkflowView.cs
+++ b/mcs/class/referencesource/System.Workflow.ComponentModel/AuthoringOM/Design/WorkflowView.cs
@@ -181,7 +181,7 @@ namespace System.Workflow.ComponentModel.Design
//Initialize the tooltip shown
this.workflowToolTip = new WorkflowToolTip(this);
- //[....] the global theme change event, which is fired by the theme infrastructure for theme change
+ //Sync the global theme change event, which is fired by the theme infrastructure for theme change
WorkflowTheme.ThemeChanged += new EventHandler(OnThemeChange);
//Create the core message filters
diff --git a/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/BasePropertyDescriptor.cs b/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/BasePropertyDescriptor.cs
index edb21a0ab4c..9a6b5209a03 100644
--- a/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/BasePropertyDescriptor.cs
+++ b/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/BasePropertyDescriptor.cs
@@ -21,7 +21,7 @@ using System.Workflow.ComponentModel.Compiler;
/*********************************************************************
* NOTE: A copy of this file exists at: WF\Activities\Common
- * The two files must be kept in [....]. Any change made here must also
+ * The two files must be kept in sync. Any change made here must also
* be made to WF\Activities\Common\BasePropertyDescriptor.cs
*********************************************************************/
diff --git a/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/CompModHelpers.cs b/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/CompModHelpers.cs
index 2183def5736..1b666c9e54b 100644
--- a/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/CompModHelpers.cs
+++ b/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/CompModHelpers.cs
@@ -9,7 +9,7 @@
/*********************************************************************
* NOTE: A copy of this file exists at: WF\Activities\Common
- * The two files must be kept in [....]. Any change made here must also
+ * The two files must be kept in sync. Any change made here must also
* be made to WF\Activities\Common\CompModHelpers.cs
*********************************************************************/
namespace System.Workflow.ComponentModel.Design
diff --git a/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/CompilerHelpers.cs b/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/CompilerHelpers.cs
index c6dceb5b0de..437248e7ea3 100644
--- a/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/CompilerHelpers.cs
+++ b/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/CompilerHelpers.cs
@@ -9,7 +9,7 @@
/*********************************************************************
* NOTE: A copy of this file exists at: WF\Activities\Common
- * The two files must be kept in [....]. Any change made here must also
+ * The two files must be kept in sync. Any change made here must also
* be made to WF\Activities\Common\CompilerHelpers.cs
*********************************************************************/
diff --git a/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/DelegateTypeInfo.cs b/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/DelegateTypeInfo.cs
index 01603ca7446..3539c96edfb 100644
--- a/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/DelegateTypeInfo.cs
+++ b/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/DelegateTypeInfo.cs
@@ -9,7 +9,7 @@
/*********************************************************************
* NOTE: A copy of this file exists at: WF\Activities\Common
- * The two files must be kept in [....]. Any change made here must also
+ * The two files must be kept in sync. Any change made here must also
* be made to WF\Activities\Common\DelegateTypeInfo.cs
*********************************************************************/
namespace System.Workflow.ComponentModel
diff --git a/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/NativeMethods.cs b/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/NativeMethods.cs
index f6e921b5fc0..cfd5e0e814a 100644
--- a/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/NativeMethods.cs
+++ b/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/NativeMethods.cs
@@ -9,7 +9,7 @@
/*********************************************************************
* NOTE: A copy of this file exists at: WF\Activities\Common
- * The two files must be kept in [....]. Any change made here must also
+ * The two files must be kept in sync. Any change made here must also
* be made to WF\Activities\Common\NativeMethods.cs
*********************************************************************/
namespace System.Workflow.Interop
diff --git a/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/TypeSystemHelpers.cs b/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/TypeSystemHelpers.cs
index 9b53df5eee3..896ddf1cd9f 100644
--- a/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/TypeSystemHelpers.cs
+++ b/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/TypeSystemHelpers.cs
@@ -9,7 +9,7 @@
/*********************************************************************
* NOTE: A copy of this file exists at: WF\Activities\Common
- * The two files must be kept in [....]. Any change made here must also
+ * The two files must be kept in sync. Any change made here must also
* be made to WF\Activities\Common\TypeSystemHelpers.cs
*********************************************************************/
namespace System.Workflow.ComponentModel.Compiler
diff --git a/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/ValidationHelpers.cs b/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/ValidationHelpers.cs
index a93a3d061f9..6f80c605636 100644
--- a/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/ValidationHelpers.cs
+++ b/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/ValidationHelpers.cs
@@ -9,7 +9,7 @@
/*********************************************************************
* NOTE: A copy of this file exists at: WF\Activities\Common
- * The two files must be kept in [....]. Any change made here must also
+ * The two files must be kept in sync. Any change made here must also
* be made to WF\Activities\Common\ValidationHelpers.cs
*********************************************************************/
namespace System.Workflow.ComponentModel.Compiler
diff --git a/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/Walker.cs b/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/Walker.cs
index e47e60f1c63..1a8c8858e17 100644
--- a/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/Walker.cs
+++ b/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/Walker.cs
@@ -9,7 +9,7 @@
/*********************************************************************
* NOTE: A copy of this file exists at: WF\Activities\Common
- * The two files must be kept in [....]. Any change made here must also
+ * The two files must be kept in sync. Any change made here must also
* be made to WF\Activities\Common\Walker.cs
*********************************************************************/
namespace System.Workflow.ComponentModel
diff --git a/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/userdatakeys.cs b/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/userdatakeys.cs
index 9812b64d268..3afb84b9600 100644
--- a/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/userdatakeys.cs
+++ b/mcs/class/referencesource/System.Workflow.ComponentModel/Shared/userdatakeys.cs
@@ -9,7 +9,7 @@
/*********************************************************************
* NOTE: A copy of this file exists at: WF\Activities\Common
- * The two files must be kept in [....]. Any change made here must also
+ * The two files must be kept in sync. Any change made here must also
* be made to WF\Activities\Common\UserDataKeys.cs
*********************************************************************/
namespace System.Workflow.ComponentModel
diff --git a/mcs/class/referencesource/System.Workflow.Runtime/ExecutorLocksHeldException.cs b/mcs/class/referencesource/System.Workflow.Runtime/ExecutorLocksHeldException.cs
index ba6ece5f1ec..2744a3bf95a 100644
--- a/mcs/class/referencesource/System.Workflow.Runtime/ExecutorLocksHeldException.cs
+++ b/mcs/class/referencesource/System.Workflow.Runtime/ExecutorLocksHeldException.cs
@@ -10,7 +10,7 @@
// REVISIONS
// Date Ver By Remarks
// ~~~~~~~~~~ ~~~ ~~~~~~~~ ~~~~~~~~~~~~~~
-// 03/08/01 1.0 [....] Created.
+// 03/08/01 1.0 Microsoft Created.
// ****************************************************************************
using System;
using System.Runtime.Serialization;
diff --git a/mcs/class/referencesource/System.Workflow.Runtime/Hosting/WorkflowWebHostingModule.cs b/mcs/class/referencesource/System.Workflow.Runtime/Hosting/WorkflowWebHostingModule.cs
index a5155c762e3..aa4a2675435 100644
--- a/mcs/class/referencesource/System.Workflow.Runtime/Hosting/WorkflowWebHostingModule.cs
+++ b/mcs/class/referencesource/System.Workflow.Runtime/Hosting/WorkflowWebHostingModule.cs
@@ -10,7 +10,7 @@
// REVISIONS
// Date Ver By Remarks
// ~~~~~~~~~~ ~~~ ~~~~~~~~ ~~~~~~~~~~~~~~
-// 02/22/05 1.0 [....] Implementation.
+// 02/22/05 1.0 Microsoft Implementation.
* ****************************************************************************/
#region Using directives
diff --git a/mcs/class/referencesource/System.Workflow.Runtime/System/Activities/Statements/Interop.cs b/mcs/class/referencesource/System.Workflow.Runtime/System/Activities/Statements/Interop.cs
index c45bac9f2ef..e82732e73c9 100644
--- a/mcs/class/referencesource/System.Workflow.Runtime/System/Activities/Statements/Interop.cs
+++ b/mcs/class/referencesource/System.Workflow.Runtime/System/Activities/Statements/Interop.cs
@@ -1453,7 +1453,7 @@ namespace System.Activities.Statements
}
}
- //This needs to be in [....] with the table in the spec
+ //This needs to be in sync with the table in the spec
//We use this internally to keep a hashset of validation data
enum InteropValidationEnum
{
diff --git a/mcs/class/referencesource/System.Workflow.Runtime/WorkflowEventArgs.cs b/mcs/class/referencesource/System.Workflow.Runtime/WorkflowEventArgs.cs
index 9e811599a58..a81dd7b359a 100644
--- a/mcs/class/referencesource/System.Workflow.Runtime/WorkflowEventArgs.cs
+++ b/mcs/class/referencesource/System.Workflow.Runtime/WorkflowEventArgs.cs
@@ -71,7 +71,7 @@ namespace System.Workflow.Runtime
if (this._workflowDefinition == null)
{
// Clone the original definition after locking the
- // definition's [....] object which was passed in
+ // definition's sync object which was passed in
// the constructor. This is so that the host cannot
// corrupt the shared definition
Activity tempDefinition = this._originalWorkflowDefinition.Clone();
diff --git a/mcs/class/referencesource/System.Workflow.Runtime/WorkflowExecutor.cs b/mcs/class/referencesource/System.Workflow.Runtime/WorkflowExecutor.cs
index 0d2d2daf4ff..9194516f9fb 100644
--- a/mcs/class/referencesource/System.Workflow.Runtime/WorkflowExecutor.cs
+++ b/mcs/class/referencesource/System.Workflow.Runtime/WorkflowExecutor.cs
@@ -961,7 +961,7 @@ namespace System.Workflow.Runtime
if (WorkflowExecutor.IsIrrecoverableException(e))
{
throw;
- } //@@undone: for [....]:- we should not be running exception handler, when we are unlocking.
+ } //@@undone: for Microsoft:- we should not be running exception handler, when we are unlocking.
else if (this.WorkflowStatus != WorkflowStatus.Suspended && this.IsInstanceValid)
{
// the persistence attempt threw an exception
@@ -1548,7 +1548,7 @@ namespace System.Workflow.Runtime
}
}
- // shutsdown the schedule instance [....]
+ // shutsdown the schedule instance sync
internal void Unload()
{
WorkflowTrace.Runtime.TraceEvent(TraceEventType.Information, 0, "Workflow Runtime: WorkflowExecutor: Got an unload request for instance {0}", this.InstanceIdString);
@@ -1612,7 +1612,7 @@ namespace System.Workflow.Runtime
#region Terminate
- // terminates the schedule instance [....]
+ // terminates the schedule instance sync
// must be called only from outside the instance... the thread running the instance must
// never call this method... it should call TerminateOnIdle instead.
internal void Terminate(string error)
@@ -1748,7 +1748,7 @@ namespace System.Workflow.Runtime
#region Abort
- // aborts the schedule instance [....]
+ // aborts the schedule instance sync
// must be called only from outside the instance... the thread running the instance must
// never call this method... it should call AbortOnIdle instead.
internal void Abort()
@@ -1860,7 +1860,7 @@ namespace System.Workflow.Runtime
#region Suspend
- // suspends the schedule instance [....]
+ // suspends the schedule instance sync
// must be called only from outside the instance... the thread running the instance must
// never call this method... it should call SuspendOnIdle instead.
internal bool Suspend(string error)
@@ -1966,7 +1966,7 @@ namespace System.Workflow.Runtime
#region Resume
- // resumes the schedule instance [....]
+ // resumes the schedule instance sync
// must be called only from outside the instance... the thread running the instance must
// never call this method... it should call ResumeOnIdle instead.
internal void Resume()
@@ -1996,7 +1996,7 @@ namespace System.Workflow.Runtime
//@@Undone-- bmalhi there is one test in bat
//which fails here. This check is right thing but im
//commenting it out for bat.
- // [....]: this fails because when we load an instance into memory it grabs
+ // Microsoft: this fails because when we load an instance into memory it grabs
// the scheduler lock and starts running. By the time the user Resume request
// gets the scheduler lock the instance is often done (the AbortBat test case scenario)
// Balinder is attempting a fix to separate rehydration from resuming execution.
diff --git a/mcs/class/referencesource/System.WorkflowServices/System/ServiceModel/WorkflowServiceHost.cs b/mcs/class/referencesource/System.WorkflowServices/System/ServiceModel/WorkflowServiceHost.cs
index 87b3b237840..f4610d89c99 100644
--- a/mcs/class/referencesource/System.WorkflowServices/System/ServiceModel/WorkflowServiceHost.cs
+++ b/mcs/class/referencesource/System.WorkflowServices/System/ServiceModel/WorkflowServiceHost.cs
@@ -64,7 +64,7 @@ namespace System.ServiceModel
// Based on prior art from WCF:
// ServiceModel.lst:System.ServiceModel.ServiceHost..ctor(System.Object,System.Uri[])
// |DoNotCallOverridableMethodsInConstructors
- // |[....]|By design, don't want to complicate ServiceHost state model
+ // |Microsoft|By design, don't want to complicate ServiceHost state model
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
internal WorkflowServiceHost(WorkflowDefinitionContext workflowDefinitionContext, params Uri[] baseAddress)
: base()
diff --git a/mcs/class/referencesource/System.WorkflowServices/System/Workflow/Activities/Design/OperationPickerDialog.cs b/mcs/class/referencesource/System.WorkflowServices/System/Workflow/Activities/Design/OperationPickerDialog.cs
index 81662844ade..4a7018c1d4b 100644
--- a/mcs/class/referencesource/System.WorkflowServices/System/Workflow/Activities/Design/OperationPickerDialog.cs
+++ b/mcs/class/referencesource/System.WorkflowServices/System/Workflow/Activities/Design/OperationPickerDialog.cs
@@ -303,7 +303,7 @@ namespace System.Workflow.Activities.Design
// This is to make the selected operation the selected item in the operationsListBox.
- // This needs to be done to work around the [....] bug causing selection events to not fire till form is loaded.
+ // This needs to be done to work around the Microsoft bug causing selection events to not fire till form is loaded.
if (this.selectedOperation != null)
{
SelectServiceOperation(this.selectedOperation);
diff --git a/mcs/class/referencesource/System.WorkflowServices/System/Workflow/Runtime/Hosting/SynchronizationContextWorkflowSchedulerService.cs b/mcs/class/referencesource/System.WorkflowServices/System/Workflow/Runtime/Hosting/SynchronizationContextWorkflowSchedulerService.cs
index 76380ee64a9..bae23fc0bb5 100644
--- a/mcs/class/referencesource/System.WorkflowServices/System/Workflow/Runtime/Hosting/SynchronizationContextWorkflowSchedulerService.cs
+++ b/mcs/class/referencesource/System.WorkflowServices/System/Workflow/Runtime/Hosting/SynchronizationContextWorkflowSchedulerService.cs
@@ -84,7 +84,7 @@ namespace System.Workflow.Runtime.Hosting
public static void Post(SynchronizationContext synchronizationContext, SendOrPostCallback callback, object state)
{
- Fx.Assert(synchronizationContext != null, "Null [....] Context");
+ Fx.Assert(synchronizationContext != null, "Null Sync Context");
Fx.Assert(callback != null, "Null Callback");
synchronizationContext.OperationStarted();
diff --git a/mcs/class/referencesource/System.Xml/InternalApis/NDP_Common/inc/Win8Helpers.cs b/mcs/class/referencesource/System.Xml/InternalApis/NDP_Common/inc/Win8Helpers.cs
index 065662f2ec8..b2508ba53f8 100644
--- a/mcs/class/referencesource/System.Xml/InternalApis/NDP_Common/inc/Win8Helpers.cs
+++ b/mcs/class/referencesource/System.Xml/InternalApis/NDP_Common/inc/Win8Helpers.cs
@@ -2,7 +2,7 @@
// <copyright file="Compilation.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace Microsoft.Win32 {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Base64Decoder.cs b/mcs/class/referencesource/System.Xml/System/Xml/Base64Decoder.cs
index 6fce5e708f4..700f0024765 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Base64Decoder.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Base64Decoder.cs
@@ -2,7 +2,7 @@
// <copyright file="Base64Decoder.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Base64Encoder.cs b/mcs/class/referencesource/System.Xml/System/Xml/Base64Encoder.cs
index 2e5db862d30..826dda14790 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Base64Encoder.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Base64Encoder.cs
@@ -3,7 +3,7 @@
// <copyright file="Base64Encoder.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Text;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/BinHexDecoder.cs b/mcs/class/referencesource/System.Xml/System/Xml/BinHexDecoder.cs
index a5b8c826abe..f0e3e37cbb0 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/BinHexDecoder.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/BinHexDecoder.cs
@@ -2,7 +2,7 @@
// <copyright file="BinHexDecoder.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/BinHexEncoder.cs b/mcs/class/referencesource/System.Xml/System/Xml/BinHexEncoder.cs
index 84af530c3a0..80aaef88553 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/BinHexEncoder.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/BinHexEncoder.cs
@@ -3,7 +3,7 @@
// <copyright file="BinHexEncoder.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/BinaryXml/SqlUtils.cs b/mcs/class/referencesource/System.Xml/System/Xml/BinaryXml/SqlUtils.cs
index ac782eede0d..f431af850c4 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/BinaryXml/SqlUtils.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/BinaryXml/SqlUtils.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlBinaryWriter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/BinaryXml/XmlBinaryReader.cs b/mcs/class/referencesource/System.Xml/System/Xml/BinaryXml/XmlBinaryReader.cs
index 7ec7d87c084..249bf8a70bb 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/BinaryXml/XmlBinaryReader.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/BinaryXml/XmlBinaryReader.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlBinaryWriter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/BinaryXml/XmlBinaryReaderAsync.cs b/mcs/class/referencesource/System.Xml/System/Xml/BinaryXml/XmlBinaryReaderAsync.cs
index c246cd780de..c5617d0bef0 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/BinaryXml/XmlBinaryReaderAsync.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/BinaryXml/XmlBinaryReaderAsync.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlBinaryWriter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/BitStack.cs b/mcs/class/referencesource/System.Xml/System/Xml/BitStack.cs
index 1a24b050303..af5df11c215 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/BitStack.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/BitStack.cs
@@ -2,7 +2,7 @@
// <copyright file="BitStack.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Bits.cs b/mcs/class/referencesource/System.Xml/System/Xml/Bits.cs
index c971932dace..e33134c3de0 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Bits.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Bits.cs
@@ -2,7 +2,7 @@
// <copyright file="Bits.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/ByteStack.cs b/mcs/class/referencesource/System.Xml/System/Xml/ByteStack.cs
index dad824cbba0..d1dac9ff8be 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/ByteStack.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/ByteStack.cs
@@ -2,7 +2,7 @@
// <copyright file="ByteStack.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathDocumentBuilder.cs b/mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathDocumentBuilder.cs
index 5ca0974015e..7282d54555c 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathDocumentBuilder.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathDocumentBuilder.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathDocumentBuilder.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Globalization;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathDocumentIterator.cs b/mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathDocumentIterator.cs
index 54d2808d16b..937c44a75c9 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathDocumentIterator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathDocumentIterator.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathDocumentIterator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Xml;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathDocumentNavigator.cs b/mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathDocumentNavigator.cs
index d5884ff333f..f46468ff6ab 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathDocumentNavigator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathDocumentNavigator.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathDocumentNavigator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.IO;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathNode.cs b/mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathNode.cs
index 1706a413b1f..9170badb6c4 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathNode.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathNode.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathNode.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathNodeHelper.cs b/mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathNodeHelper.cs
index d41386dc056..fbc150cb5c1 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathNodeHelper.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathNodeHelper.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathNodeHelper.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathNodeInfoAtom.cs b/mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathNodeInfoAtom.cs
index b2bd27cfc6f..f65ab8c144b 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathNodeInfoAtom.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Cache/XPathNodeInfoAtom.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathNodeInfoAtom.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections;
using System.Text;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/CharEntityEncoderFallback.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/CharEntityEncoderFallback.cs
index 9ada03fbdcb..00aad6ab915 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/CharEntityEncoderFallback.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/CharEntityEncoderFallback.cs
@@ -2,7 +2,7 @@
// <copyright file="CharEntitiesEncodingFallback.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Text;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/HtmlEncodedRawTextWriter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/HtmlEncodedRawTextWriter.cs
index 3e87a288024..aa90db35ce0 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/HtmlEncodedRawTextWriter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/HtmlEncodedRawTextWriter.cs
@@ -3,7 +3,7 @@
// <copyright file="HtmlRawTextWriterGenerator.cxx" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
// WARNING: This file is generated and should not be modified directly. Instead,
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/HtmlTernaryTree.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/HtmlTernaryTree.cs
index ea40a4b1774..67a2eb4e88d 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/HtmlTernaryTree.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/HtmlTernaryTree.cs
@@ -2,7 +2,7 @@
// <copyright file="TernaryTreeGenerator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
//
// This file is generated by TernaryTreeGenerator.cs,
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/HtmlUtf8RawTextWriter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/HtmlUtf8RawTextWriter.cs
index ce58ac04cef..6cca7607cfb 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/HtmlUtf8RawTextWriter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/HtmlUtf8RawTextWriter.cs
@@ -3,7 +3,7 @@
// <copyright file="HtmlRawTextWriterGenerator.cxx" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
// WARNING: This file is generated and should not be modified directly. Instead,
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/IncrementalReadDecoders.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/IncrementalReadDecoders.cs
index 75aa39c93e5..accabc8ae41 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/IncrementalReadDecoders.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/IncrementalReadDecoders.cs
@@ -2,7 +2,7 @@
// <copyright file="IncrementalReadDecoder.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/QueryOutputWriter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/QueryOutputWriter.cs
index 38d96cab293..b2eb04606f1 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/QueryOutputWriter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/QueryOutputWriter.cs
@@ -2,7 +2,7 @@
// <copyright file=QueryOutputWriter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/QueryOutputWriterV1.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/QueryOutputWriterV1.cs
index 7804b49e649..b8118da24a9 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/QueryOutputWriterV1.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/QueryOutputWriterV1.cs
@@ -2,7 +2,7 @@
// <copyright file=QueryOutputWriter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/ReadContentAsBinaryHelper.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/ReadContentAsBinaryHelper.cs
index 2279ac9d403..f901bb3b853 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/ReadContentAsBinaryHelper.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/ReadContentAsBinaryHelper.cs
@@ -3,7 +3,7 @@
// <copyright file="ReadContentAsBinaryHelper.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/ReadOnlyTernaryTree.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/ReadOnlyTernaryTree.cs
index c18e27b12c1..e2bdd673aa7 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/ReadOnlyTernaryTree.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/ReadOnlyTernaryTree.cs
@@ -2,7 +2,7 @@
// <copyright file="ReadOnlyTernaryTree.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
@@ -17,7 +17,7 @@ namespace System.Xml {
//
// XSL HTML output method properties
//
- // Keep the first four bits in [....], so that the element and attribute mask operation can be combined.
+ // Keep the first four bits in sync, so that the element and attribute mask operation can be combined.
internal enum ElementProperties : uint {DEFAULT = 0, URI_PARENT = 1, BOOL_PARENT = 2, NAME_PARENT = 4, EMPTY = 8, NO_ENTITIES = 16, HEAD = 32, BLOCK_WS = 64, HAS_NS = 128}
internal enum AttributeProperties : uint {DEFAULT = 0, URI = 1, BOOLEAN = 2, NAME = 4}
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/SecureStringHasher.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/SecureStringHasher.cs
index 95684b22d5b..a0e1260823e 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/SecureStringHasher.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/SecureStringHasher.cs
@@ -2,7 +2,7 @@
// <copyright file="SecureStringHasher.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/TextEncodedRawTextWriter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/TextEncodedRawTextWriter.cs
index d09ec778982..6565d5d3d54 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/TextEncodedRawTextWriter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/TextEncodedRawTextWriter.cs
@@ -3,7 +3,7 @@
// <copyright file="TextWriterGenerator.cxx" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
// WARNING: This file is generated and should not be modified directly. Instead,
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/TextUtf8RawTextWriter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/TextUtf8RawTextWriter.cs
index 1ed397e8fef..4192d32857c 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/TextUtf8RawTextWriter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/TextUtf8RawTextWriter.cs
@@ -3,7 +3,7 @@
// <copyright file="TextWriterGenerator.cxx" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
// WARNING: This file is generated and should not be modified directly. Instead,
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/ValidatingReaderNodeData.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/ValidatingReaderNodeData.cs
index 0220c3ac415..35ebb93441c 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/ValidatingReaderNodeData.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/ValidatingReaderNodeData.cs
@@ -2,7 +2,7 @@
// <copyright file="ValidatingReaderNodeData.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlAsyncCheckReader.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlAsyncCheckReader.cs
index acfc2641270..5c8e6dbfabf 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlAsyncCheckReader.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlAsyncCheckReader.cs
@@ -55,7 +55,7 @@ namespace System.Xml {
}
}
- #region [....] Methods, Properties Check
+ #region Sync Methods, Properties Check
public override XmlReaderSettings Settings {
get {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlAsyncCheckWriter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlAsyncCheckWriter.cs
index 9d3d1259ba6..2ec002e8862 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlAsyncCheckWriter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlAsyncCheckWriter.cs
@@ -28,7 +28,7 @@ namespace System.Xml {
}
}
- #region [....] Methods, Properties Check
+ #region Sync Methods, Properties Check
public override XmlWriterSettings Settings {
get {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlAutoDetectWriter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlAutoDetectWriter.cs
index be7bdf2f133..c36fceca031 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlAutoDetectWriter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlAutoDetectWriter.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlAutoDetectWriter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlCharCheckingReader.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlCharCheckingReader.cs
index e7494e219b1..4d57beeb332 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlCharCheckingReader.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlCharCheckingReader.cs
@@ -3,7 +3,7 @@
// <copyright file="XmlCharCheckingReader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlCharCheckingWriter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlCharCheckingWriter.cs
index d997aaf59d9..706383bbaba 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlCharCheckingWriter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlCharCheckingWriter.cs
@@ -4,7 +4,7 @@
// <copyright file="XmlCharCheckingWriter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlEncodedRawTextWriter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlEncodedRawTextWriter.cs
index 15d6839fbc2..ea644332bb0 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlEncodedRawTextWriter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlEncodedRawTextWriter.cs
@@ -3,7 +3,7 @@
// <copyright file="XmlRawTextWriterGenerator.cxx" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
// WARNING: This file is generated and should not be modified directly. Instead,
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlEventCache.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlEventCache.cs
index 2f9b8e7dc3b..b48dd010fe6 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlEventCache.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlEventCache.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlEventCache.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlParserContext.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlParserContext.cs
index c6427aa67ae..6b70e55b47a 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlParserContext.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlParserContext.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlParserContext.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Xml;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlRawWriter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlRawWriter.cs
index 0de56633883..6c05735bcb2 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlRawWriter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlRawWriter.cs
@@ -3,7 +3,7 @@
// <copyright file="XmlRawWriter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlReader.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlReader.cs
index 4449445424d..40379dd159e 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlReader.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlReader.cs
@@ -3,7 +3,7 @@
// <copyright file="XmlReader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.IO;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlReaderSettings.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlReaderSettings.cs
index 2b540345448..c570f19606a 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlReaderSettings.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlReaderSettings.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlReaderSettings.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.IO;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlSubtreeReader.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlSubtreeReader.cs
index c78e851ad3b..602e1acb370 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlSubtreeReader.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlSubtreeReader.cs
@@ -3,7 +3,7 @@
// <copyright file="XmlSubtreeReader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlTextEncoder.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlTextEncoder.cs
index 8c90585f940..7e4c58fd1b5 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlTextEncoder.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlTextEncoder.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlTextWriter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlTextReader.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlTextReader.cs
index 2ce8ee9b56f..096f9b5cbad 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlTextReader.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlTextReader.cs
@@ -3,7 +3,7 @@
// <copyright file="XmlTextReader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlTextReaderImpl.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlTextReaderImpl.cs
index 9d2ec66d8c8..19c9b948ec8 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlTextReaderImpl.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlTextReaderImpl.cs
@@ -3,7 +3,7 @@
// <copyright file="XmlTextReaderImpl.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlTextReaderImplHelpers.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlTextReaderImplHelpers.cs
index 3a031b70431..8d3dcd6f825 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlTextReaderImplHelpers.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlTextReaderImplHelpers.cs
@@ -3,7 +3,7 @@
// <copyright file="XmlTextReaderHelpers.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlTextWriter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlTextWriter.cs
index 731426702fc..4f6a768e7af 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlTextWriter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlTextWriter.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlTextWriter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlUtf8RawTextWriter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlUtf8RawTextWriter.cs
index 9267f3cf1db..02614e34802 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlUtf8RawTextWriter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlUtf8RawTextWriter.cs
@@ -3,7 +3,7 @@
// <copyright file="XmlRawTextWriterGenerator.cxx" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
// WARNING: This file is generated and should not be modified directly. Instead,
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlValidatingReader.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlValidatingReader.cs
index 5027da2ff84..9c997f14470 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlValidatingReader.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlValidatingReader.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlValidatingReader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlValidatingReaderImpl.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlValidatingReaderImpl.cs
index 7836c255bcf..55d38028802 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlValidatingReaderImpl.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlValidatingReaderImpl.cs
@@ -3,7 +3,7 @@
// <copyright file="XmlValidatingReaderImpl.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWellFormedWriter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWellFormedWriter.cs
index 30bf76c544b..e03913edc2a 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWellFormedWriter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWellFormedWriter.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlWellFormedWriter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWellFormedWriterHelpers.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWellFormedWriterHelpers.cs
index 6454136eac0..144d806e5a8 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWellFormedWriterHelpers.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWellFormedWriterHelpers.cs
@@ -3,7 +3,7 @@
// <copyright file="XmlWellFormedWriterHelpers.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWrappingReader.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWrappingReader.cs
index 5aba9d28d19..0bddf6c93c6 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWrappingReader.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWrappingReader.cs
@@ -3,7 +3,7 @@
// <copyright file="XmlWrappingReader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWrappingWriter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWrappingWriter.cs
index 6176c6dd547..f73c5eb902d 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWrappingWriter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWrappingWriter.cs
@@ -4,7 +4,7 @@
// <copyright file="XmlWrapingWriter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWriter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWriter.cs
index 64ce1c42920..f4ca61856cf 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWriter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWriter.cs
@@ -3,7 +3,7 @@
// <copyright file="XmlWriter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWriterAsync.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWriterAsync.cs
index bd18d0db051..e799402b01e 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWriterAsync.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWriterAsync.cs
@@ -263,7 +263,7 @@ namespace System.Xml {
// Copies the current node from the given reader to the writer (including child nodes), and if called on an element moves the XmlReader
// to the corresponding end element.
- //use [....] methods on the reader
+ //use sync methods on the reader
internal async Task WriteNodeAsync_CallSyncReader(XmlReader reader, bool defattr) {
bool canReadChunk = reader.CanReadValueChunk;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWriterSettings.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWriterSettings.cs
index 0e5d3e1b79b..d6da6521389 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWriterSettings.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWriterSettings.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlWriterSettings.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XsdCachingReader.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XsdCachingReader.cs
index eabe7e09aad..2775de956b3 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XsdCachingReader.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XsdCachingReader.cs
@@ -3,7 +3,7 @@
// <copyright file="XsdCachingReader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.IO;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Core/XsdValidatingReader.cs b/mcs/class/referencesource/System.Xml/System/Xml/Core/XsdValidatingReader.cs
index 78b479a94bf..1624db0c151 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Core/XsdValidatingReader.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Core/XsdValidatingReader.cs
@@ -3,7 +3,7 @@
// <copyright file="XsdValidatingReader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.IO;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/DiagnosticsSwitches.cs b/mcs/class/referencesource/System.Xml/System/Xml/DiagnosticsSwitches.cs
index 18e16e93e08..aa2a2be4f2d 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/DiagnosticsSwitches.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/DiagnosticsSwitches.cs
@@ -2,7 +2,7 @@
// <copyright file="DiagnosticsSwitches.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/DocumentSchemaValidator.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/DocumentSchemaValidator.cs
index 61467a7e28b..ad2afe144cb 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/DocumentSchemaValidator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/DocumentSchemaValidator.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlDocumentValidator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/DocumentXPathNavigator.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/DocumentXPathNavigator.cs
index 65156508850..519989144d3 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/DocumentXPathNavigator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/DocumentXPathNavigator.cs
@@ -2,7 +2,7 @@
// <copyright file="DocumentXPathNavigator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/DocumentXmlWriter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/DocumentXmlWriter.cs
index b81819b7f42..a593fc00fc2 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/DocumentXmlWriter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/DocumentXmlWriter.cs
@@ -2,7 +2,7 @@
// <copyright file="DocumentXmlWriter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/DomNameTable.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/DomNameTable.cs
index f804251dd2c..1887cf8fe5a 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/DomNameTable.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/DomNameTable.cs
@@ -2,7 +2,7 @@
// <copyright file="DomNameTable.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XPathNodeList.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XPathNodeList.cs
index 72cce94b6ad..375f9c645bc 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XPathNodeList.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XPathNodeList.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathNodeList.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlAttribute.cs
index 5a78890c518..e7296819619 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlAttribute.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlAttributeCollection.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlAttributeCollection.cs
index 5825e1d6b77..bfe86a97079 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlAttributeCollection.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlAttributeCollection.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlAttributeCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlCDataSection.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlCDataSection.cs
index 9879cf9e519..b1f2676b1c9 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlCDataSection.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlCDataSection.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlCDATASection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlCharacterData.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlCharacterData.cs
index 3744cd8bce8..6797b896be4 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlCharacterData.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlCharacterData.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlCharacterData.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlChildEnumerator.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlChildEnumerator.cs
index 41a25efe245..d17bffe83c0 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlChildEnumerator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlChildEnumerator.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlChildEnumerator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlChildNodes.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlChildNodes.cs
index 6450c64f66f..391b5666768 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlChildNodes.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlChildNodes.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlChildNodes.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
using System.Collections;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlComment.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlComment.cs
index 087c7546a47..8e7289c899a 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlComment.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlComment.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlComment.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlDeclaration.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlDeclaration.cs
index bd8ab0ef6df..8de8430a3dd 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlDeclaration.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlDeclaration.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlDeclaration.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlDocument.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlDocument.cs
index dff26fa7d6b..03d419b0dc7 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlDocument.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlDocument.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlDocument.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlDocumentFragment.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlDocumentFragment.cs
index 1ee01648cce..ef3e33eca40 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlDocumentFragment.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlDocumentFragment.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlDocumentFragment.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
// <code>DocumentFragment</code> is a "lightweight" or "minimal"
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlDocumentType.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlDocumentType.cs
index 27daa745e94..19ae68b987a 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlDocumentType.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlDocumentType.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlDocumentType.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlDomTextWriter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlDomTextWriter.cs
index 228d6ff1f9b..0369f5e1672 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlDomTextWriter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlDomTextWriter.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlDomTextWriter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlElement.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlElement.cs
index 66171a9177f..e2d979845c2 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlElement.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlElement.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlElement.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlElementList.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlElementList.cs
index d76e66c2a1c..ef190d83c10 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlElementList.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlElementList.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlElementList.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlEntity.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlEntity.cs
index 3576d03a7c7..0522631c150 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlEntity.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlEntity.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlEntity.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlEntityReference.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlEntityReference.cs
index d9ee2866b8c..4bb982a1645 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlEntityReference.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlEntityReference.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlEntityReference.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
// <code>EntityReference</code> objects may be inserted into the structure
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlImplementation.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlImplementation.cs
index 0082d7faf2f..13711af70ed 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlImplementation.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlImplementation.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlImplementation.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Globalization;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlLinkedNode.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlLinkedNode.cs
index 0c29d1527be..9e62d467490 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlLinkedNode.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlLinkedNode.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlLinkedNode.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlLoader.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlLoader.cs
index 988ab2d16b7..ca642eff400 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlLoader.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlLoader.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlLoader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlName.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlName.cs
index 0b972336130..dc217a6e60e 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlName.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlName.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlName.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNamedNodemap.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNamedNodemap.cs
index 5def2f6d2ea..aa1f05e2844 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNamedNodemap.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNamedNodemap.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlNamedNodeMap.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNode.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNode.cs
index cebe8708752..d814e3d238d 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNode.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNode.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlNode.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNodeChangedEventArgs.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNodeChangedEventArgs.cs
index 617f0b54c51..ac4c5097ee9 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNodeChangedEventArgs.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNodeChangedEventArgs.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlNodeChangedEventArgs.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNodeList.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNodeList.cs
index 697ae92649c..d19afba0bc5 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNodeList.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNodeList.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlNodeList.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNodeReader.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNodeReader.cs
index 514b79fb872..2ef079a486b 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNodeReader.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNodeReader.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlNodeReader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNotation.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNotation.cs
index 79be847a2ee..527bdcf6bf5 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNotation.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlNotation.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlNotation.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlProcessingInstruction.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlProcessingInstruction.cs
index c940944befb..04d09502a53 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlProcessingInstruction.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlProcessingInstruction.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlProcessingInstruction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlSignificantWhiteSpace.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlSignificantWhiteSpace.cs
index 70cd9498aab..d083222ae23 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlSignificantWhiteSpace.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlSignificantWhiteSpace.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSignificantWhiteSpace.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlText.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlText.cs
index 4d9e3dc10c7..52d74574103 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlText.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlText.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlText.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlUnspecifiedAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlUnspecifiedAttribute.cs
index c1a0974d0dd..fecd81cc57a 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlUnspecifiedAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlUnspecifiedAttribute.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlUnspecifiedAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlWhitespace.cs b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlWhitespace.cs
index ce4f166e8aa..3e0df6ab35e 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlWhitespace.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Dom/XmlWhitespace.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlWhitespace.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/EmptyEnumerator.cs b/mcs/class/referencesource/System.Xml/System/Xml/EmptyEnumerator.cs
index b9c7f41d8d9..5d9787f1248 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/EmptyEnumerator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/EmptyEnumerator.cs
@@ -2,7 +2,7 @@
// <copyright file="EmptyEnumerator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/HWStack.cs b/mcs/class/referencesource/System.Xml/System/Xml/HWStack.cs
index 9df2ad1656c..2f076f8c835 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/HWStack.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/HWStack.cs
@@ -2,7 +2,7 @@
// <copyright file="HWStack.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/IXmlLineInfo.cs b/mcs/class/referencesource/System.Xml/System/Xml/IXmlLineInfo.cs
index a5503a1775d..438840e1c1f 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/IXmlLineInfo.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/IXmlLineInfo.cs
@@ -2,7 +2,7 @@
// <copyright file="IXmlLineInfo.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/LineInfo.cs b/mcs/class/referencesource/System.Xml/System/Xml/LineInfo.cs
index 4095a490dfb..76afcce36bd 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/LineInfo.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/LineInfo.cs
@@ -2,7 +2,7 @@
// <copyright file="LineInfo.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/NameTable.cs b/mcs/class/referencesource/System.Xml/System/Xml/NameTable.cs
index debdacdd399..9ffc2ff5e5d 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/NameTable.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/NameTable.cs
@@ -2,7 +2,7 @@
// <copyright file="NameTable.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Ref.cs b/mcs/class/referencesource/System.Xml/System/Xml/Ref.cs
index f90790b1014..8df1dc31348 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Ref.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Ref.cs
@@ -2,7 +2,7 @@
// <copyright file="Ref.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Resolvers/XmlPreloadedResolver.cs b/mcs/class/referencesource/System.Xml/System/Xml/Resolvers/XmlPreloadedResolver.cs
index 69f9f41d753..e3b347a5174 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Resolvers/XmlPreloadedResolver.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Resolvers/XmlPreloadedResolver.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlPreloadedResolver.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.IO;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Resolvers/XmlPreloadedResolverAsync.cs b/mcs/class/referencesource/System.Xml/System/Xml/Resolvers/XmlPreloadedResolverAsync.cs
index 01cde42a300..109c6e6ad6d 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Resolvers/XmlPreloadedResolverAsync.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Resolvers/XmlPreloadedResolverAsync.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlPreloadedResolver.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.IO;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/Asttree.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/Asttree.cs
index 48074ea4573..31facd0a744 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/Asttree.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/Asttree.cs
@@ -2,7 +2,7 @@
// <copyright file="asttree.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/AutoValidator.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/AutoValidator.cs
index a18d39a6b1b..33231373d7d 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/AutoValidator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/AutoValidator.cs
@@ -2,7 +2,7 @@
// <copyright file="AutoValidator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/BaseProcessor.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/BaseProcessor.cs
index 287f39f7a7f..e6cf4bd1ed6 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/BaseProcessor.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/BaseProcessor.cs
@@ -2,7 +2,7 @@
// <copyright file="BaseProcessor.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/BaseValidator.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/BaseValidator.cs
index a41795d1868..7726307277a 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/BaseValidator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/BaseValidator.cs
@@ -2,7 +2,7 @@
// <copyright file="BaseValidator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/BitSet.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/BitSet.cs
index 564c593ce4a..f8573bbcf9d 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/BitSet.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/BitSet.cs
@@ -2,7 +2,7 @@
// <copyright file="BitSet.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/Chameleonkey.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/Chameleonkey.cs
index 2cf8040e573..b487289d78e 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/Chameleonkey.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/Chameleonkey.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaExternal.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/CompiledidEntityConstraint.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/CompiledidEntityConstraint.cs
index afe0acdf73e..d6bb8a5ea76 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/CompiledidEntityConstraint.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/CompiledidEntityConstraint.cs
@@ -2,7 +2,7 @@
// <copyright file="CompiledIdentityConstraint.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/ConstraintStruct.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/ConstraintStruct.cs
index 4e6cbfc1cd9..33c6391c8b4 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/ConstraintStruct.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/ConstraintStruct.cs
@@ -2,7 +2,7 @@
// <copyright file="ConstraintStruct.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/ContentValidator.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/ContentValidator.cs
index fcee874bde1..a2eb25b667e 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/ContentValidator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/ContentValidator.cs
@@ -2,7 +2,7 @@
// <copyright file="ContentValidator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/DataTypeImplementation.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/DataTypeImplementation.cs
index efeab36444b..2e85e186606 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/DataTypeImplementation.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/DataTypeImplementation.cs
@@ -2,7 +2,7 @@
// <copyright file="DatatypeImplementation.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
@@ -805,7 +805,7 @@ namespace System.Xml.Schema {
return 0;
}
-#if PRIYAL
+#if Microsoft
protected object GetValueToCheck(object value, IXmlNamespaceResolver nsmgr) {
object valueToCheck = value;
string resId;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/DtdParser.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/DtdParser.cs
index a9d85fc2028..c72fe649f08 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/DtdParser.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/DtdParser.cs
@@ -3,7 +3,7 @@
// <copyright file="DtdParser.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/DtdValidator.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/DtdValidator.cs
index f103e3da01f..086df1b395f 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/DtdValidator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/DtdValidator.cs
@@ -2,7 +2,7 @@
// <copyright file="DtdValidator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/FacetChecker.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/FacetChecker.cs
index 398a2aa5259..ea32d7099ff 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/FacetChecker.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/FacetChecker.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaFacet.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/Inference/Infer.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/Inference/Infer.cs
index 6fdbc73d6ab..49254264120 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/Inference/Infer.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/Inference/Infer.cs
@@ -2,8 +2,8 @@
// <copyright file="Infer.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/Inference/XmlSchemaInferenceException.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/Inference/XmlSchemaInferenceException.cs
index d41c45f148a..69a3156bffc 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/Inference/XmlSchemaInferenceException.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/Inference/XmlSchemaInferenceException.cs
@@ -2,8 +2,8 @@
// <copyright file="XmlSchemaInferenceException.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
-// <owner current="false" primary="false">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
+// <owner current="false" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/NamespaceList.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/NamespaceList.cs
index 7cb6a8a33bb..93ecf3f6045 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/NamespaceList.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/NamespaceList.cs
@@ -2,7 +2,7 @@
// <copyright file="NamespaceList.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/Parser.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/Parser.cs
index 4f38bf400c6..e296e7446af 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/Parser.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/Parser.cs
@@ -3,7 +3,7 @@
// <copyright file="Parser.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/Preprocessor.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/Preprocessor.cs
index e7dd3880acb..06af064697a 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/Preprocessor.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/Preprocessor.cs
@@ -2,7 +2,7 @@
// <copyright file="Preprocessor.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaAttDef.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaAttDef.cs
index 48becdf5bb6..0cd4d5757ad 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaAttDef.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaAttDef.cs
@@ -2,7 +2,7 @@
// <copyright file="SchemaAttDef.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaCollectionCompiler.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaCollectionCompiler.cs
index 314986435ec..e716aa30de4 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaCollectionCompiler.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaCollectionCompiler.cs
@@ -2,7 +2,7 @@
// <copyright file="Compiler.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaCollectionpreProcessor.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaCollectionpreProcessor.cs
index 82e40815021..f2fa40056ce 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaCollectionpreProcessor.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaCollectionpreProcessor.cs
@@ -2,7 +2,7 @@
// <copyright file="Preprocessor.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaDeclBase.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaDeclBase.cs
index 65c11d09ccd..22f1d1dc82f 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaDeclBase.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaDeclBase.cs
@@ -2,7 +2,7 @@
// <copyright file="SchemaDeclBase.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaElementDecl.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaElementDecl.cs
index 52d641f925a..345c89d131f 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaElementDecl.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaElementDecl.cs
@@ -2,7 +2,7 @@
// <copyright file="SchemaElementDecl.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaEntity.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaEntity.cs
index c0c96d0d9b3..f326c5bfee8 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaEntity.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaEntity.cs
@@ -2,7 +2,7 @@
// <copyright file="SchemaEntity.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaInfo.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaInfo.cs
index 6429bcad31a..294ef6a3525 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaInfo.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaInfo.cs
@@ -2,7 +2,7 @@
// <copyright file="SchemaInfo.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaNames.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaNames.cs
index 6ca87fd757b..69b23b05edb 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaNames.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaNames.cs
@@ -2,7 +2,7 @@
// <copyright file="SchemaNames.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaNamespacemanager.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaNamespacemanager.cs
index af750839a04..ee380b1c171 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaNamespacemanager.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaNamespacemanager.cs
@@ -2,7 +2,7 @@
// <copyright file="SchemaNamespaceManager.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaNotation.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaNotation.cs
index 2c9604ce581..e156aa006f1 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaNotation.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaNotation.cs
@@ -2,7 +2,7 @@
// <copyright file="SchemaNotation.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaSetCompiler.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaSetCompiler.cs
index d1dc9412e2b..348c2763c62 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaSetCompiler.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/SchemaSetCompiler.cs
@@ -2,7 +2,7 @@
// <copyright file="Compiler.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
@@ -591,7 +591,7 @@ namespace System.Xml.Schema {
}
//Now add the baseTypes that are defined inside the union itself
- XmlSchemaObjectCollection mainBaseTypes = mainUnion.BaseTypes; //TODO check for null
+ XmlSchemaObjectCollection mainBaseTypes = mainUnion.BaseTypes; //
if (mainBaseTypes != null) {
for (int i = 0; i < mainBaseTypes.Count; ++i) {
XmlSchemaSimpleType st = (XmlSchemaSimpleType)mainBaseTypes[i];
@@ -1365,7 +1365,7 @@ namespace System.Xml.Schema {
return true;
}
-#if PRIYAL
+#if Microsoft
private bool IsElementFromGroupBase(XmlSchemaElement derivedElement, XmlSchemaGroupBase baseGroupBase, bool skipEmptableOnly) {
if (!IsRangeSimple(baseGroupBase.MinOccurs, baseGroupBase.MaxOccurs) || !IsRangeSimple(derivedElement.MinOccurs, derivedElement.MaxOccurs)) {
return IsElementFromGroupBase(derivedElement, baseGroupBase); //SPEC COMPLIANT
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/ValidationEventArgs.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/ValidationEventArgs.cs
index 8cce19ff1e3..779280b7e56 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/ValidationEventArgs.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/ValidationEventArgs.cs
@@ -2,7 +2,7 @@
// <copyright file="ValidationEventArgs.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/ValidationState.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/ValidationState.cs
index 8d60154dbd8..8efbae5e523 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/ValidationState.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/ValidationState.cs
@@ -2,7 +2,7 @@
// <copyright file="validationstate.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XdrBuilder.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XdrBuilder.cs
index d19527ca7bf..fb5d270570c 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XdrBuilder.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XdrBuilder.cs
@@ -2,7 +2,7 @@
// <copyright file="XdrBuilder.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XdrValidator.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XdrValidator.cs
index 232088c901c..1f68d23b747 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XdrValidator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XdrValidator.cs
@@ -2,7 +2,7 @@
// <copyright file="XdrValidator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlAtomicValue.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlAtomicValue.cs
index b5f81386b5d..20356ef46d4 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlAtomicValue.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlAtomicValue.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlAtomicValue.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchema.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchema.cs
index 569b5bf53f8..58e4d475e4f 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchema.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchema.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchema.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAll.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAll.cs
index 2b84df839a5..049a900b69a 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAll.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAll.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaAll.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAnnotated.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAnnotated.cs
index 48c108af70d..836e430db5b 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAnnotated.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAnnotated.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaAnnotated.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAnnotation.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAnnotation.cs
index c3a052d0e9b..9fd7fd10fad 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAnnotation.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAnnotation.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaAnnotation.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAny.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAny.cs
index a57e92753e9..a811ed67ead 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAny.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAny.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaAny.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAnyAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAnyAttribute.cs
index c1fc904490e..8eb31c7318e 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAnyAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAnyAttribute.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaAnyAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAppInfo.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAppInfo.cs
index c738d792ab4..aba46e610ac 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAppInfo.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAppInfo.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaAppInfo.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAttribute.cs
index 30eebaaac9b..4920ccbbe76 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAttribute.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAttributeGroup.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAttributeGroup.cs
index f05e75f10d9..46ee40ef02a 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAttributeGroup.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAttributeGroup.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaAttributeGroup.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAttributeGroupref.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAttributeGroupref.cs
index d42202a8fd1..b69122fe37e 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAttributeGroupref.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaAttributeGroupref.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaAttributeGroupRef.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaChoice.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaChoice.cs
index db19ae6e296..9e4e15769c8 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaChoice.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaChoice.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaChoice.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaCollection.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaCollection.cs
index 38b1e024040..23f4a3c219d 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaCollection.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaCollection.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaCompilationSettings.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaCompilationSettings.cs
index babedcc1c1e..c0544a1627a 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaCompilationSettings.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaCompilationSettings.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaDerivationMethod.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaComplexContent.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaComplexContent.cs
index 87560df0c53..7fd72fb3964 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaComplexContent.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaComplexContent.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaComplexContent.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaComplexContentExtension.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaComplexContentExtension.cs
index 8404e53b5ca..ba4213a297c 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaComplexContentExtension.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaComplexContentExtension.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaComplexContentExtension.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaComplexContentRestriction.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaComplexContentRestriction.cs
index 522d6354430..1879a3b34f4 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaComplexContentRestriction.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaComplexContentRestriction.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaComplexContentRestriction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaComplexType.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaComplexType.cs
index 1db07809ced..0ce2f136c9a 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaComplexType.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaComplexType.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaComplexType.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaDataType.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaDataType.cs
index 164891340ec..28bd99b2d0e 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaDataType.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaDataType.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaDatatype.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections;
using System.Diagnostics;
@@ -337,7 +337,7 @@ namespace System.Xml.Schema {
return canonicalUri;
}
-#if PRIYAL
+#if Microsoft
private bool CanConvert(object value, System.Type inputType, System.Type defaultType, out string resId) {
resId = null;
decimal decimalValue;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaDocumentation.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaDocumentation.cs
index 8468b38d253..a3d46ffb9b4 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaDocumentation.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaDocumentation.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaDocumentation.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaElement.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaElement.cs
index fd7e91449db..52604d9313e 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaElement.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaElement.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaElement.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.ComponentModel;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaException.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaException.cs
index 508c058bbac..6f9aebccae7 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaException.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaException.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaException.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaExternal.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaExternal.cs
index 29f2d0d732a..b5e41e694c1 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaExternal.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaExternal.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaExternal.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaFacet.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaFacet.cs
index df6402047e8..1a54786975e 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaFacet.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaFacet.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaFacet.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaGroup.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaGroup.cs
index 0453e2f6d0d..df6049d0ce0 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaGroup.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaGroup.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaGroup.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaGroupRef.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaGroupRef.cs
index 8f6bfd74f6c..973cfbf60bf 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaGroupRef.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaGroupRef.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaGroupRef.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaIdEntityConstraint.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaIdEntityConstraint.cs
index 94ff513cdef..768a05dfb6d 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaIdEntityConstraint.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaIdEntityConstraint.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaIdentityConstraint.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaImport.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaImport.cs
index 4683a0a74ea..68aa2a3febb 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaImport.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaImport.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaImport.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaInclude.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaInclude.cs
index 143944e44b7..a7d9fc83822 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaInclude.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaInclude.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaInclude.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaInfo.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaInfo.cs
index 81d503a1354..e8a764df589 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaInfo.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaInfo.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaInfo.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Xml;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaNotation.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaNotation.cs
index 38178eccd12..cc14abe77f5 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaNotation.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaNotation.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaNotation.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaObject.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaObject.cs
index 7c42f39bca9..70c41758f02 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaObject.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaObject.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaObject.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaObjectCollection.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaObjectCollection.cs
index a3e46ec075b..aa392aea9cb 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaObjectCollection.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaObjectCollection.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaObjectCollection.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaObjectTable.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaObjectTable.cs
index 5277ce63985..ff82368dd7f 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaObjectTable.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaObjectTable.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaObjectTable.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaParticle.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaParticle.cs
index 7ed178dbe3f..4317b730247 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaParticle.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaParticle.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaParticle.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaRedefine.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaRedefine.cs
index baa659da8f4..1eb572a43bd 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaRedefine.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaRedefine.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaRedefine.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSequence.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSequence.cs
index 9ea17ae0942..73a32972555 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSequence.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSequence.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaSequence.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSet.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSet.cs
index ab9d27e27b7..978f3679308 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSet.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSet.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaSet.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Diagnostics;
using System.Collections;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleContent.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleContent.cs
index 72b8e838caf..09e12ca1d75 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleContent.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleContent.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaSimpleContent.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleContentExtension.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleContentExtension.cs
index bd843c6000e..518fc1a80bc 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleContentExtension.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleContentExtension.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaSimpleContentExtension.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleContentRestriction.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleContentRestriction.cs
index 44ba849574d..6d5572294ba 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleContentRestriction.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleContentRestriction.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaSimpleContentRestriction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleType.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleType.cs
index fc2d9a63660..7c5f4e01c9c 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleType.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleType.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaSimpleType.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleTypeList.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleTypeList.cs
index b61ad2ced9f..e4c1d46e3fd 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleTypeList.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleTypeList.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaSimpleTypeList.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleTypeRestriction.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleTypeRestriction.cs
index 00a50e25d25..ed297392f4c 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleTypeRestriction.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleTypeRestriction.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaSimpleTypeRestriction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleTypeUnion.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleTypeUnion.cs
index 7b0f5d209c1..b79aa843e8f 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleTypeUnion.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSimpleTypeUnion.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaSimpleTypeUnion.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSubstitutionGroup.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSubstitutionGroup.cs
index 57c12831054..8a9a38a1f63 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSubstitutionGroup.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaSubstitutionGroup.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaSubstitutionGroup.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaType.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaType.cs
index 033fa6c43a3..03330c7440b 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaType.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaType.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaType.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaValidationException.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaValidationException.cs
index 7f6719ef19b..855c9e0cb04 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaValidationException.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaValidationException.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaValidationException.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaValidator.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaValidator.cs
index acfd701d425..6d42c73a665 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaValidator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlSchemaValidator.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaValidator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlValueConverter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlValueConverter.cs
index 02ccfd06efd..10742ccec7a 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlValueConverter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XmlValueConverter.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlValueConverter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Xml;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XsdBuilder.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XsdBuilder.cs
index 21c0ddc0ef2..1b003a79e6c 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XsdBuilder.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XsdBuilder.cs
@@ -2,7 +2,7 @@
// <copyright file="XsdBuilder.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XsdDateTime.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XsdDateTime.cs
index 41b2d722397..923651d28f1 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XsdDateTime.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XsdDateTime.cs
@@ -2,7 +2,7 @@
// <copyright file="XsdDuration.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XsdDuration.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XsdDuration.cs
index cd8d5636463..8efe7a1fb04 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XsdDuration.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XsdDuration.cs
@@ -2,7 +2,7 @@
// <copyright file="XsdDuration.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XsdValidator.cs b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XsdValidator.cs
index 32f4e92753b..eeed4aecae0 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Schema/XsdValidator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Schema/XsdValidator.cs
@@ -2,7 +2,7 @@
// <copyright file="XsdValidator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Schema {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Advanced/SchemaImporterExtension.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Advanced/SchemaImporterExtension.cs
index 405b942ee9a..c619b6c7a35 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Advanced/SchemaImporterExtension.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Advanced/SchemaImporterExtension.cs
@@ -2,7 +2,7 @@
// <copyright file="IXmlSerializable.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization.Advanced {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/CodeExporter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/CodeExporter.cs
index 5084e376c45..4b1cfbc7ec0 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/CodeExporter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/CodeExporter.cs
@@ -2,7 +2,7 @@
// <copyright file="CodeExporter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/CodeGenerator.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/CodeGenerator.cs
index 3f933eebef6..a01f38828d5 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/CodeGenerator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/CodeGenerator.cs
@@ -2,7 +2,7 @@
// <copyright file="CodeGenerator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/CodeIdentifier.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/CodeIdentifier.cs
index 324f1af2129..c0dea737d73 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/CodeIdentifier.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/CodeIdentifier.cs
@@ -2,7 +2,7 @@
// <copyright file="CodeIdentifier.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/CodeIdentifiers.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/CodeIdentifiers.cs
index 1213c82f2b3..33c37fb941c 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/CodeIdentifiers.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/CodeIdentifiers.cs
@@ -2,7 +2,7 @@
// <copyright file="CodeIdentifiers.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Compilation.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Compilation.cs
index 8ca9ba646d1..b34385a1dff 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Compilation.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Compilation.cs
@@ -2,7 +2,7 @@
// <copyright file="Compilation.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Compiler.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Compiler.cs
index 0afae51f9d2..ea61c4b7c04 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Compiler.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Compiler.cs
@@ -2,7 +2,7 @@
// <copyright file="Compiler.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/ConfigurationStrings.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/ConfigurationStrings.cs
index 76688cdf0d5..34b7f45b42f 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/ConfigurationStrings.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/ConfigurationStrings.cs
@@ -2,7 +2,7 @@
// <copyright file="ConfigurationStrings.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization.Configuration
{
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/DateTimeSerializationSection.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/DateTimeSerializationSection.cs
index 88518da10ee..05f3d9bfcb3 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/DateTimeSerializationSection.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/DateTimeSerializationSection.cs
@@ -2,7 +2,7 @@
// <copyright file="DateTimeSerializationSection.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
#if CONFIGURATION_DEP
namespace System.Xml.Serialization.Configuration
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/SchemaImporterExtensionElement.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/SchemaImporterExtensionElement.cs
index 1d0e2f2b296..8a5c5b1dd1b 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/SchemaImporterExtensionElement.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/SchemaImporterExtensionElement.cs
@@ -2,7 +2,7 @@
// <copyright file="SchemaImporterExtensionElement.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
#if CONFIGURATION_DEP
namespace System.Xml.Serialization.Configuration
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/SchemaImporterExtensionElementCollection.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/SchemaImporterExtensionElementCollection.cs
index 1bfc52aadbf..c7eeb00c76f 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/SchemaImporterExtensionElementCollection.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/SchemaImporterExtensionElementCollection.cs
@@ -2,7 +2,7 @@
// <copyright file="SchemaImporterExtensionElementCollection.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
#if CONFIGURATION_DEP
namespace System.Xml.Serialization.Configuration
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/SchemaImporterExtensionsSection.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/SchemaImporterExtensionsSection.cs
index c8aad1da1f5..924ef8c6deb 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/SchemaImporterExtensionsSection.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/SchemaImporterExtensionsSection.cs
@@ -2,7 +2,7 @@
// <copyright file="SchemaImporterExtensionsSection.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
#if CONFIGURATION_DEP
namespace System.Xml.Serialization.Configuration
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/SerializationSectionGroup.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/SerializationSectionGroup.cs
index cd4a4d9ba1e..8dd0bc90735 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/SerializationSectionGroup.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Configuration/SerializationSectionGroup.cs
@@ -2,7 +2,7 @@
// <copyright file="SerializationSectionGroup.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
#if CONFIGURATION_DEP
namespace System.Xml.Serialization.Configuration
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/ImportContext.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/ImportContext.cs
index b4691e75a0f..3e32d3119cf 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/ImportContext.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/ImportContext.cs
@@ -2,7 +2,7 @@
// <copyright file="ImportContext.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Mappings.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Mappings.cs
index b1143fdd1a0..b8be09a3a88 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Mappings.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Mappings.cs
@@ -2,7 +2,7 @@
// <copyright file="Mappings.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Models.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Models.cs
index a555726ea07..adeb663175a 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Models.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Models.cs
@@ -2,7 +2,7 @@
// <copyright file="Models.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/NameTable.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/NameTable.cs
index eb9a3973a10..9df48e3668e 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/NameTable.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/NameTable.cs
@@ -2,7 +2,7 @@
// <copyright file="NameTable.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/PrimitiveXmlSerializers.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/PrimitiveXmlSerializers.cs
index 5915f59b108..d2df57b8168 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/PrimitiveXmlSerializers.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/PrimitiveXmlSerializers.cs
@@ -2,7 +2,7 @@
// <copyright file="PrimitiveXmlSerializers.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SchemaImporter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SchemaImporter.cs
index 07de77756f9..236f74f199c 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SchemaImporter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SchemaImporter.cs
@@ -2,7 +2,7 @@
// <copyright file="SchemaImporter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SchemaObjectWriter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SchemaObjectWriter.cs
index 0c356f8b492..c3cdc3dfa4e 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SchemaObjectWriter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SchemaObjectWriter.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaSerializer.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapAttributeAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapAttributeAttribute.cs
index c67b07494d3..b7d0b0173fc 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapAttributeAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapAttributeAttribute.cs
@@ -2,7 +2,7 @@
// <copyright file="SoapAttributeAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapAttributeOverrides.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapAttributeOverrides.cs
index 70e4578fd66..973efa75f96 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapAttributeOverrides.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapAttributeOverrides.cs
@@ -2,7 +2,7 @@
// <copyright file="SoapAttributeOverrides.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapAttributes.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapAttributes.cs
index 7e51c2ae249..1351c4f2411 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapAttributes.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapAttributes.cs
@@ -2,7 +2,7 @@
// <copyright file="SoapAttributes.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapCodeExporter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapCodeExporter.cs
index f7b9ed8785e..0f690389170 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapCodeExporter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapCodeExporter.cs
@@ -2,7 +2,7 @@
// <copyright file="SoapCodeExporter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapElementAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapElementAttribute.cs
index b30a00770cc..d1efc68ccf6 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapElementAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapElementAttribute.cs
@@ -2,7 +2,7 @@
// <copyright file="SoapElementAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapEnumAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapEnumAttribute.cs
index 28af677d6d0..badd54f86c9 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapEnumAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapEnumAttribute.cs
@@ -2,7 +2,7 @@
// <copyright file="SoapEnumAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapIgnoreAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapIgnoreAttribute.cs
index fbd44f76885..d4b6f158a4f 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapIgnoreAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapIgnoreAttribute.cs
@@ -2,7 +2,7 @@
// <copyright file="SoapIgnoreAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapIncludeAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapIncludeAttribute.cs
index 5c406d7f558..b94e97973a7 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapIncludeAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapIncludeAttribute.cs
@@ -2,7 +2,7 @@
// <copyright file="SoapIncludeAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapReflectionImporter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapReflectionImporter.cs
index 5c7fdae0cfb..89159cfe0e1 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapReflectionImporter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapReflectionImporter.cs
@@ -2,7 +2,7 @@
// <copyright file="SoapReflectionImporter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapSchemaExporter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapSchemaExporter.cs
index 17d6dfd5778..aaf94a6442a 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapSchemaExporter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapSchemaExporter.cs
@@ -2,7 +2,7 @@
// <copyright file="SoapSchemaExporter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapSchemaImporter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapSchemaImporter.cs
index 65a6e2a38ca..f36606e7bc3 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapSchemaImporter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapSchemaImporter.cs
@@ -2,7 +2,7 @@
// <copyright file="SoapSchemaImporter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapSchemamember.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapSchemamember.cs
index 09f0e10d724..eb710ad171d 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapSchemamember.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapSchemamember.cs
@@ -2,7 +2,7 @@
// <copyright file="SoapSchemaMember.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapTypeAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapTypeAttribute.cs
index 450f4ce5aac..51b16412cfb 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapTypeAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SoapTypeAttribute.cs
@@ -2,7 +2,7 @@
// <copyright file="SoapTypeAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SourceInfo.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SourceInfo.cs
index 1663c89a9ab..b0337dfe8c0 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SourceInfo.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/SourceInfo.cs
@@ -2,7 +2,7 @@
// <copyright file="SourceInfo.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Types.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Types.cs
index f924a4374a5..103b424f9fd 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Types.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Types.cs
@@ -2,7 +2,7 @@
// <copyright file="Types.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
@@ -476,7 +476,7 @@ namespace System.Xml.Serialization {
AddPrimitive(typeof(byte[]), "base64Binary", "ByteArrayBase64", TypeFlags.AmbiguousDataType | TypeFlags.CanBeAttributeValue | TypeFlags.CanBeElementValue | TypeFlags.HasCustomFormatter | TypeFlags.Reference | TypeFlags.IgnoreDefault | TypeFlags.XmlEncodingNotRequired | TypeFlags.HasDefaultConstructor);
AddPrimitive(typeof(byte[]), "hexBinary", "ByteArrayHex", TypeFlags.AmbiguousDataType | TypeFlags.CanBeAttributeValue | TypeFlags.CanBeElementValue | TypeFlags.HasCustomFormatter | TypeFlags.Reference | TypeFlags.IgnoreDefault | TypeFlags.XmlEncodingNotRequired | TypeFlags.HasDefaultConstructor);
- // NOTE, [....]: byte[] can also be used to mean array of bytes. That datatype is not a primitive, so we
+ // NOTE, Microsoft: byte[] can also be used to mean array of bytes. That datatype is not a primitive, so we
// can't use the AmbiguousDataType mechanism. To get an array of bytes in literal XML, apply [XmlArray] or
// [XmlArrayItem].
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAnyAttributeAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAnyAttributeAttribute.cs
index 87a78f38d64..aee71d513bf 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAnyAttributeAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAnyAttributeAttribute.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlAnyAttributeAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAnyElementAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAnyElementAttribute.cs
index d83ce1e407c..d9479840f30 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAnyElementAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAnyElementAttribute.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlAnyElementAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAnyElementAttributes.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAnyElementAttributes.cs
index 898934b9005..58a9fc1cc96 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAnyElementAttributes.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAnyElementAttributes.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlAnyElementAttributes.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlArrayAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlArrayAttribute.cs
index 6011b322f6c..f2f777ba416 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlArrayAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlArrayAttribute.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlArrayAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlArrayItemAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlArrayItemAttribute.cs
index a476a7edaca..e652fb697cd 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlArrayItemAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlArrayItemAttribute.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlArrayItemAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlArrayItemAttributes.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlArrayItemAttributes.cs
index b5fbde2b9ff..fb335d877b4 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlArrayItemAttributes.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlArrayItemAttributes.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlArrayItemAttributes.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAttributeAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAttributeAttribute.cs
index 07751a9b3b5..f7d59c32f0f 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAttributeAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAttributeAttribute.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlAttributeAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAttributeOverrides.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAttributeOverrides.cs
index af725a3320d..bdb8893ecf6 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAttributeOverrides.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAttributeOverrides.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlAttributeOverrides.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAttributes.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAttributes.cs
index 58437dabae8..31bb36612ed 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAttributes.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlAttributes.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlAttributes.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlChoiceIdentifierAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlChoiceIdentifierAttribute.cs
index c30af562a27..021d99d07b1 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlChoiceIdentifierAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlChoiceIdentifierAttribute.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlChoiceIdentifierAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlCodeExporter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlCodeExporter.cs
index 690a9d8e1c7..bb8d1e1771c 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlCodeExporter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlCodeExporter.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlCodeExporter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlElementAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlElementAttribute.cs
index cb302c652ce..bbe4dea2037 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlElementAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlElementAttribute.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlElementAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlElementAttributes.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlElementAttributes.cs
index a94e8215b17..d868493f227 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlElementAttributes.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlElementAttributes.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlElementAttributes.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlEnumAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlEnumAttribute.cs
index 3c658f592c4..969830dc0f7 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlEnumAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlEnumAttribute.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlEnumAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlIgnoreAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlIgnoreAttribute.cs
index 1205bb29f9f..3aafd13b76d 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlIgnoreAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlIgnoreAttribute.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlIgnoreAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlIncludeAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlIncludeAttribute.cs
index 54034c8e1b1..7616791ae34 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlIncludeAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlIncludeAttribute.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlIncludeAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlMapping.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlMapping.cs
index 6158e7773d9..33efdae68e7 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlMapping.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlMapping.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlMapping.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlMemberMapping.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlMemberMapping.cs
index 1636b004ab6..ee5af6c4d29 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlMemberMapping.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlMemberMapping.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlMemberMapping.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlMembersMapping.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlMembersMapping.cs
index cfda2925269..75331e3de27 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlMembersMapping.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlMembersMapping.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlMembersMapping.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlNamespaceDeclarationsAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlNamespaceDeclarationsAttribute.cs
index efe61e28415..ff139a06888 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlNamespaceDeclarationsAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlNamespaceDeclarationsAttribute.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlNamespaceDeclarationsAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlReflectionImporter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlReflectionImporter.cs
index 67ee9bc5426..67901745399 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlReflectionImporter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlReflectionImporter.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlReflectionImporter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlReflectionMember.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlReflectionMember.cs
index 2c9c0699d61..d3f36fe9293 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlReflectionMember.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlReflectionMember.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlReflectionMember.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlRootAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlRootAttribute.cs
index fd00efa5441..62253930333 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlRootAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlRootAttribute.cs
@@ -3,7 +3,7 @@
// <copyright file="XmlRootAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSchemaExporter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSchemaExporter.cs
index 8c0704b15a2..d8e6e131852 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSchemaExporter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSchemaExporter.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaExporter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSchemaImporter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSchemaImporter.cs
index 2f4309b4f24..1f7aa1d1a10 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSchemaImporter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSchemaImporter.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemaImporter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSchemaProviderAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSchemaProviderAttribute.cs
index ccdeec6bb4d..27c46a66269 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSchemaProviderAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSchemaProviderAttribute.cs
@@ -3,7 +3,7 @@
// <copyright file="XmlSchemaProviderAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSchemas.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSchemas.cs
index eef8682e727..1e3e27f8ea8 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSchemas.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSchemas.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSchemas.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationGeneratedCode.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationGeneratedCode.cs
index a46500689de..d3f83800163 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationGeneratedCode.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationGeneratedCode.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSerializationGeneratedCode.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationILGen.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationILGen.cs
index 564d888ef91..3460db55baf 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationILGen.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationILGen.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSerializationILGen.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationReader.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationReader.cs
index b6800a7f4e6..5a3d21642d4 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationReader.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationReader.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSerializationReader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
@@ -4185,7 +4185,7 @@ namespace System.Xml.Serialization {
memberMapping.TypeDesc = arrayMapping.TypeDesc;
memberMapping.ReadOnly = readOnly;
Member member = new Member(this, source, arrayName, 0, memberMapping, false);
- member.IsNullable = false;//Note, [....]: IsNullable is set to false since null condition (xsi:nil) is already handled by 'ReadNull()'
+ member.IsNullable = false;//Note, Microsoft: IsNullable is set to false since null condition (xsi:nil) is already handled by 'ReadNull()'
Member[] members = new Member[] { member };
WriteMemberBegin(members);
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationReaderILGen.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationReaderILGen.cs
index e7f2c1bef49..6ba4b2d7fb5 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationReaderILGen.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationReaderILGen.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSerializationReaderILGen.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
@@ -2881,7 +2881,7 @@ namespace System.Xml.Serialization {
memberMapping.MemberInfo = memberInfos[source.Substring(3)];
}
Member member = new Member(this, source, arrayName, elementIndex, memberMapping, false);
- member.IsNullable = false;//Note, [....]: IsNullable is set to false since null condition (xsi:nil) is already handled by 'ReadNull()'
+ member.IsNullable = false;//Note, Microsoft: IsNullable is set to false since null condition (xsi:nil) is already handled by 'ReadNull()'
Member[] members = new Member[] { member };
WriteMemberBegin(members);
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationWriter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationWriter.cs
index 69bbbd40862..d15b2bf9bf5 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationWriter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationWriter.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSerializationWriter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
@@ -3627,7 +3627,7 @@ namespace System.Xml.Serialization {
return "(("+typeDesc.CSharpName+")"+obj+").@"+memberName;
}
//throw GetReflectionVariableException(saveTypeDesc.CSharpName,memberName);
- // NOTE, [....]:Must never happen. If it does let the code
+ // NOTE, Microsoft:Must never happen. If it does let the code
// gen continue to help debugging what's gone wrong.
// Eventually the compilation will fail.
return "["+obj+"]";
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationWriterILGen.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationWriterILGen.cs
index 0884a6c7b5d..05e529ea2cc 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationWriterILGen.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializationWriterILGen.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSerializationWriterILGen.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializer.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializer.cs
index 9600e7603b2..eb11fe3b372 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializer.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializer.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSerializer.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializerAssemblyAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializerAssemblyAttribute.cs
index 677f7a15fae..d8b1a898d02 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializerAssemblyAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializerAssemblyAttribute.cs
@@ -3,7 +3,7 @@
// <copyright file="XmlSerializerAssemblyAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializerFactory.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializerFactory.cs
index 9163984f441..a4bf3a0a940 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializerFactory.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializerFactory.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSerializer.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializerNamespaces.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializerNamespaces.cs
index de689d2a564..ce3b533dcfc 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializerNamespaces.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializerNamespaces.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSerializerNamespaces.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializerVersionAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializerVersionAttribute.cs
index 4b5d05ee5c8..be04e89919e 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializerVersionAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlSerializerVersionAttribute.cs
@@ -3,7 +3,7 @@
// <copyright file="XmlSerializerVersionAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlTextAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlTextAttribute.cs
index 0d793ef7b6f..45fc96f741e 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlTextAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlTextAttribute.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlTextAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlTypeAttribute.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlTypeAttribute.cs
index 63619468773..59a472331b8 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlTypeAttribute.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlTypeAttribute.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlTypeAttribute.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlTypeMapping.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlTypeMapping.cs
index 4466a51600d..c8240f3a0b2 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlTypeMapping.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/XmlTypeMapping.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlTypeMapping.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Xmlcustomformatter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Xmlcustomformatter.cs
index 98038155948..90f3cad333e 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Xmlcustomformatter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/Xmlcustomformatter.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlCustomFormatter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/_Events.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/_Events.cs
index 491828807d0..ec9b3e78207 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/_Events.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/_Events.cs
@@ -2,7 +2,7 @@
// <copyright file="_Events.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/indentedWriter.cs b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/indentedWriter.cs
index 22dac15fdda..5c6867eafbe 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Serialization/indentedWriter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Serialization/indentedWriter.cs
@@ -2,7 +2,7 @@
// <copyright file="IndentedWriter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Serialization {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/ValidateNames.cs b/mcs/class/referencesource/System.Xml/System/Xml/ValidateNames.cs
index 34bc7327952..bf034e162b4 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/ValidateNames.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/ValidateNames.cs
@@ -2,7 +2,7 @@
// <copyright file="ValidateNames.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/AbsoluteQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/AbsoluteQuery.cs
index 7c126900c12..1dc479fe504 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/AbsoluteQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/AbsoluteQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="AbsoluteQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/AttributeQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/AttributeQuery.cs
index 93be0280437..052dfbc453e 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/AttributeQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/AttributeQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="AttributeQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Axis.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Axis.cs
index 658c08c7b1e..c64fb4307cf 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Axis.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Axis.cs
@@ -2,7 +2,7 @@
// <copyright file="Axis.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/BaseAxisQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/BaseAxisQuery.cs
index 83170d035d3..91c37b719a8 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/BaseAxisQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/BaseAxisQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="baseaxisquery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/BooleanExpr.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/BooleanExpr.cs
index a8af11f65c3..fb3b9f7be91 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/BooleanExpr.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/BooleanExpr.cs
@@ -2,7 +2,7 @@
// <copyright file="BooleanExpr.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/BooleanFunctions.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/BooleanFunctions.cs
index 4fa3553f230..b18ef609c91 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/BooleanFunctions.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/BooleanFunctions.cs
@@ -2,7 +2,7 @@
// <copyright file="BooleanFunctions.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/CacheAxisQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/CacheAxisQuery.cs
index 47dd13ee645..4a264f4e706 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/CacheAxisQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/CacheAxisQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="CacheAxisQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/CacheChildrenQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/CacheChildrenQuery.cs
index 53954396cb8..3ad2a6fb2b7 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/CacheChildrenQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/CacheChildrenQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="CacheChildrenQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/CacheOutputQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/CacheOutputQuery.cs
index 492358dbcef..e6331502c17 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/CacheOutputQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/CacheOutputQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="CacheOutputQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ChildrenQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ChildrenQuery.cs
index a088816ba7a..7784a5ff4b2 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ChildrenQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ChildrenQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="ChildrenQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ClonableStack.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ClonableStack.cs
index b2bc1773586..6181cd0d52c 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ClonableStack.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ClonableStack.cs
@@ -2,7 +2,7 @@
// <copyright file="ClonableStack.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/CompiledXPathExpr.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/CompiledXPathExpr.cs
index f5fd3854859..0f87cd36796 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/CompiledXPathExpr.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/CompiledXPathExpr.cs
@@ -2,7 +2,7 @@
// <copyright file="CompiledXpathExpr.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ContextQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ContextQuery.cs
index 98ccd0e783a..56d4661d77a 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ContextQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ContextQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="ContextQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/DescendantBaseQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/DescendantBaseQuery.cs
index b05f45174e7..3fa58383c38 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/DescendantBaseQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/DescendantBaseQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="DescendantQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/DescendantQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/DescendantQuery.cs
index 30920469762..317e0da51a3 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/DescendantQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/DescendantQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="DescendantQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/DescendantoverDescendantQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/DescendantoverDescendantQuery.cs
index 140f6afe046..4cc0776e065 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/DescendantoverDescendantQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/DescendantoverDescendantQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="DescendantOverDescendantQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/DocumentorderQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/DocumentorderQuery.cs
index 9f38f0c7f35..0093670b3ec 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/DocumentorderQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/DocumentorderQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="DocumentOrderQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/EmptyQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/EmptyQuery.cs
index 141206b5a78..4469a732c33 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/EmptyQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/EmptyQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="EmptyQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ExtensionQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ExtensionQuery.cs
index 6069968f22a..219afd68e64 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ExtensionQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ExtensionQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="ExtensionQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Filter.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Filter.cs
index 4dd89f4891f..b30bce34c1e 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Filter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Filter.cs
@@ -2,7 +2,7 @@
// <copyright file="Filter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/FilterQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/FilterQuery.cs
index 257d441e259..04b9e742746 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/FilterQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/FilterQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="FilterQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/FollowingQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/FollowingQuery.cs
index f6e8379884b..38235ba79c0 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/FollowingQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/FollowingQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="followingquery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/FollowingSibling.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/FollowingSibling.cs
index a50814efff8..c26df84de05 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/FollowingSibling.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/FollowingSibling.cs
@@ -2,7 +2,7 @@
// <copyright file="followingsibling.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ForwardPositionQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ForwardPositionQuery.cs
index eef25bcce75..34f5664b654 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ForwardPositionQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ForwardPositionQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="ForwardPositionQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Function.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Function.cs
index 1233c723594..027bc49f215 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Function.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Function.cs
@@ -2,7 +2,7 @@
// <copyright file="Function.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/FunctionQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/FunctionQuery.cs
index 26fc0f7e020..795c71a1d5d 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/FunctionQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/FunctionQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="FunctionQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Group.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Group.cs
index 454ffb263f4..578826b68e6 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Group.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Group.cs
@@ -2,7 +2,7 @@
// <copyright file="Group.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/GroupQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/GroupQuery.cs
index 597f939662f..087d3bafa45 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/GroupQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/GroupQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="GroupQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/IdQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/IdQuery.cs
index 5a6e292fd70..9f4c1589d74 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/IdQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/IdQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="IDQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/IteratorFilter.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/IteratorFilter.cs
index e0718275e44..09279e23933 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/IteratorFilter.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/IteratorFilter.cs
@@ -2,7 +2,7 @@
// <copyright file="IteratorFilter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/LogicalExpr.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/LogicalExpr.cs
index 8a59b0566c3..a0438225c6e 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/LogicalExpr.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/LogicalExpr.cs
@@ -2,7 +2,7 @@
// <copyright file="LogicalExpr.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/MergeFilterQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/MergeFilterQuery.cs
index 0b354f536aa..7412739210e 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/MergeFilterQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/MergeFilterQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="MergeFilterQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/NamespaceQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/NamespaceQuery.cs
index 36fd3fc1e1d..f3ad0049873 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/NamespaceQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/NamespaceQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="NamespaceQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/NodeFunctions.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/NodeFunctions.cs
index e7607376bc4..cf9566dfd5f 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/NodeFunctions.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/NodeFunctions.cs
@@ -2,7 +2,7 @@
// <copyright file="NodeFunctions.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/NumberFunctions.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/NumberFunctions.cs
index b824bca297d..72c11f9176d 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/NumberFunctions.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/NumberFunctions.cs
@@ -2,7 +2,7 @@
// <copyright file="NumberFunctions.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/NumericExpr.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/NumericExpr.cs
index ee2878f7745..4a2fd0da6d4 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/NumericExpr.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/NumericExpr.cs
@@ -2,7 +2,7 @@
// <copyright file="NumericExpr.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Operand.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Operand.cs
index 6240de8ab7d..aebbd8ef7a2 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Operand.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Operand.cs
@@ -2,7 +2,7 @@
// <copyright file="Operand.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/OperandQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/OperandQuery.cs
index 6cf3e30d87a..b88525410a0 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/OperandQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/OperandQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="OperandQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Operator.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Operator.cs
index c4d7481fc74..9739fb12758 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Operator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Operator.cs
@@ -2,7 +2,7 @@
// <copyright file="Operator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ParentQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ParentQuery.cs
index 8a0a6deba7a..b755fa5352d 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ParentQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ParentQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="ParentQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/PrecedingQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/PrecedingQuery.cs
index d56cac2bf02..bc925cc1c6b 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/PrecedingQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/PrecedingQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="precedingquery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/PrecedingSibling.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/PrecedingSibling.cs
index 75399c76a70..f690049c7dd 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/PrecedingSibling.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/PrecedingSibling.cs
@@ -2,7 +2,7 @@
// <copyright file="precedingsibling.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Query.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Query.cs
index 73eae5c5c5d..a70822ac732 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Query.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Query.cs
@@ -2,7 +2,7 @@
// <copyright file="Query.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/QueryBuilder.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/QueryBuilder.cs
index 19a56067a58..580491f0f49 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/QueryBuilder.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/QueryBuilder.cs
@@ -2,7 +2,7 @@
// <copyright file="querybuilder.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ResetableIterator.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ResetableIterator.cs
index 9943abe24df..e48a28e36fa 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ResetableIterator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ResetableIterator.cs
@@ -2,7 +2,7 @@
// <copyright file="ResetableIterator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ReversePositionQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ReversePositionQuery.cs
index 406ed7e5b46..35bd8eff288 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ReversePositionQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ReversePositionQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="ReversePositionQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Root.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Root.cs
index fbfee264668..ad0fa9c9186 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Root.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Root.cs
@@ -2,7 +2,7 @@
// <copyright file="Root.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/SortQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/SortQuery.cs
index 47e28a29143..4be9a067e2e 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/SortQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/SortQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="SortQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/StringFunctions.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/StringFunctions.cs
index 1d545b5e563..8b477ecf78f 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/StringFunctions.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/StringFunctions.cs
@@ -2,7 +2,7 @@
// <copyright file="StringFunctions.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/UnionExpr.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/UnionExpr.cs
index 79e24be6b05..b14786fc632 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/UnionExpr.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/UnionExpr.cs
@@ -2,7 +2,7 @@
// <copyright file="UnionExpr.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ValueQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ValueQuery.cs
index 41aa2e08731..ee50b81b7ea 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ValueQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/ValueQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="ValueQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Variable.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Variable.cs
index 1d6f50cf141..594b9c8aead 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Variable.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/Variable.cs
@@ -2,7 +2,7 @@
// <copyright file="Variable.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/VariableQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/VariableQuery.cs
index ce6b7132ccc..c2b6ee2e3e4 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/VariableQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/VariableQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="VariableQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathAncestorIterator.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathAncestorIterator.cs
index 5f839cdfe9b..d0709058bad 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathAncestorIterator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathAncestorIterator.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathAncestorIterator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathAncestorQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathAncestorQuery.cs
index 503d1f600af..1d2f04cc86c 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathAncestorQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathAncestorQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathAncestorQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathArrayIterator.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathArrayIterator.cs
index 724df0e3208..9f16db6db82 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathArrayIterator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathArrayIterator.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathArrayIterator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathAxisIterator.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathAxisIterator.cs
index 512e8618f23..c0aeb7005ba 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathAxisIterator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathAxisIterator.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathAxisIterator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathChildIterator.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathChildIterator.cs
index f87c9c7619c..2ea63b69459 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathChildIterator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathChildIterator.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathChildIterator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathDescendantIterator.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathDescendantIterator.cs
index 2cf77bef277..5879555dfaf 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathDescendantIterator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathDescendantIterator.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathDescendantIterator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathEmptyIterator.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathEmptyIterator.cs
index 6fa40453c26..7970452a31e 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathEmptyIterator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathEmptyIterator.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathEmptyIterator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathMultyIterator.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathMultyIterator.cs
index ef8cb5858d5..ac2f1fbecba 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathMultyIterator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathMultyIterator.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathMultyIterator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathParser.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathParser.cs
index c6a07aaa571..0192d80a606 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathParser.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathParser.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathParser.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathScanner.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathScanner.cs
index 76e15142ea4..3b78f4fadb6 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathScanner.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathScanner.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathScanner.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathSelectionIterator.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathSelectionIterator.cs
index f09f8acc010..deb89811455 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathSelectionIterator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathSelectionIterator.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathSelectionIterator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathSelfQuery.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathSelfQuery.cs
index e15cacaf7cf..33f932c26f7 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathSelfQuery.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathSelfQuery.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathSelfQuery.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathSingletonIterator.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathSingletonIterator.cs
index 6e32451a869..4528669ed86 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathSingletonIterator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/Internal/XPathSingletonIterator.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathSingletonIterator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathDocument.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathDocument.cs
index 3bb8e8ad5a0..e1d9bbe8eb4 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathDocument.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathDocument.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathDocument.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
@@ -231,7 +231,7 @@ namespace System.Xml.XPath {
case XmlNodeType.Whitespace:
// We intentionally ignore the reader.XmlSpace property here and blindly trust
- // the reported node type. If the reported information is not in [....]
+ // the reported node type. If the reported information is not in sync
// (in this case if the reader.XmlSpace == Preserve) then we make the choice
// to trust the reported node type. Since we have no control over the input reader
// we can't even assert here.
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathException.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathException.cs
index 533518ac83e..8eb02788a5a 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathException.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathException.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathException.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathExpr.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathExpr.cs
index 803907df7c1..195bf20b98a 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathExpr.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathExpr.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathExpr.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.XPath {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathItem.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathItem.cs
index ea954b05db5..85653c0dcef 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathItem.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathItem.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathItem.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathNavigator.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathNavigator.cs
index ae5ecbc9bc7..a1900faf08b 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathNavigator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathNavigator.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathNavigator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.ComponentModel;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathNavigatorKeyComparer.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathNavigatorKeyComparer.cs
index dc09acf2048..f6c83e1a493 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathNavigatorKeyComparer.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathNavigatorKeyComparer.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlNavigatorReader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.IO;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathNavigatorReader.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathNavigatorReader.cs
index beab98822b7..12226d2052b 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathNavigatorReader.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathNavigatorReader.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlNavigatorReader.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.IO;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathNodeIterator.cs b/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathNodeIterator.cs
index 3731627edae..2d60c854409 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathNodeIterator.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XPath/XPathNodeIterator.cs
@@ -2,7 +2,7 @@
// <copyright file="XPathNodeIterator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XmlCharType.cs b/mcs/class/referencesource/System.Xml/System/Xml/XmlCharType.cs
index 46237198c2f..17946153fc1 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XmlCharType.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XmlCharType.cs
@@ -6,7 +6,7 @@
// <copyright file="XmlCharType.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
//#define XMLCHARTYPE_USE_RESOURCE // load the character properties from resources (XmlCharType.bin must be linked to System.Xml.dll)
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XmlComplianceUtil.cs b/mcs/class/referencesource/System.Xml/System/Xml/XmlComplianceUtil.cs
index 3c204926ddf..c30f7263e52 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XmlComplianceUtil.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XmlComplianceUtil.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlComplianceUtil.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XmlConvert.cs b/mcs/class/referencesource/System.Xml/System/Xml/XmlConvert.cs
index e8bdbe63988..6942060d9cf 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XmlConvert.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XmlConvert.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlConvert.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XmlDownloadManager.cs b/mcs/class/referencesource/System.Xml/System/Xml/XmlDownloadManager.cs
index 305dee8b7de..e388818d1af 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XmlDownloadManager.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XmlDownloadManager.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlDownloadManager.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XmlEncoding.cs b/mcs/class/referencesource/System.Xml/System/Xml/XmlEncoding.cs
index c896a213686..012e1523d38 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XmlEncoding.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XmlEncoding.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlEncoding.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Text;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XmlException.cs b/mcs/class/referencesource/System.Xml/System/Xml/XmlException.cs
index 40594f7477b..2873952c65f 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XmlException.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XmlException.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlException.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XmlNamespacemanager.cs b/mcs/class/referencesource/System.Xml/System/Xml/XmlNamespacemanager.cs
index 7c825a1f38f..7cab6b1036d 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XmlNamespacemanager.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XmlNamespacemanager.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlNamespaceManager.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XmlNullResolver.cs b/mcs/class/referencesource/System.Xml/System/Xml/XmlNullResolver.cs
index 14dc8ded501..620bdc1c70d 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XmlNullResolver.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XmlNullResolver.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlNullResolver.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
#if !SILVERLIGHT
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XmlQualifiedName.cs b/mcs/class/referencesource/System.Xml/System/Xml/XmlQualifiedName.cs
index cb58af776e5..53fad1be61e 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XmlQualifiedName.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XmlQualifiedName.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlQualifiedName.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XmlResolver.cs b/mcs/class/referencesource/System.Xml/System/Xml/XmlResolver.cs
index 0576f38a828..2245d76d20a 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XmlResolver.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XmlResolver.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlResolver.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XmlSecureResolver.cs b/mcs/class/referencesource/System.Xml/System/Xml/XmlSecureResolver.cs
index 65d601c360f..8f0491dcd72 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XmlSecureResolver.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XmlSecureResolver.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlSecureResolver.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XmlUrlResolver.cs b/mcs/class/referencesource/System.Xml/System/Xml/XmlUrlResolver.cs
index e762f5e358d..7dc2e20afa5 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/XmlUrlResolver.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/XmlUrlResolver.cs
@@ -2,7 +2,7 @@
// <copyright file="XmlUrlResolver.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Threading;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XslCompiledTransform.cs b/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XslCompiledTransform.cs
index dda06980688..455e8912aaf 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XslCompiledTransform.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XslCompiledTransform.cs
@@ -2,7 +2,7 @@
// <copyright file="XslCompiledTransform.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <spec>http://webdata/xml/specs/XslCompiledTransform.xml</spec>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XslTransform.cs b/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XslTransform.cs
index 0faa1d89b6a..0e159768849 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XslTransform.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XslTransform.cs
@@ -2,7 +2,7 @@
// <copyright file="XslTransform.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
namespace System.Xml.Xsl {
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XsltArgumentList.cs b/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XsltArgumentList.cs
index d8f0c98b28f..bc33f89cb37 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XsltArgumentList.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XsltArgumentList.cs
@@ -2,7 +2,7 @@
// <copyright file="XsltArgumentList.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XsltContext.cs b/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XsltContext.cs
index 64bf74fbd97..ec37ade341d 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XsltContext.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XsltContext.cs
@@ -2,7 +2,7 @@
// <copyright file="XsltContext.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Collections;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XsltException.cs b/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XsltException.cs
index 1f4aaf2c678..d724bcb10d4 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XsltException.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XsltException.cs
@@ -2,7 +2,7 @@
// <copyright file="XsltException.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
using System.Globalization;
diff --git a/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XsltSettings.cs b/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XsltSettings.cs
index 94fcee6d2d9..d99fc067bab 100644
--- a/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XsltSettings.cs
+++ b/mcs/class/referencesource/System.Xml/System/Xml/Xslt/XsltSettings.cs
@@ -2,7 +2,7 @@
// <copyright file="XsltSettings.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <owner current="true" primary="true">[....]</owner>
+// <owner current="true" primary="true">Microsoft</owner>
// <spec>http://webdata/xml/specs/XslCompiledTransform.xml</spec>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/System.txt b/mcs/class/referencesource/System/System.txt
index 305950b3e8b..29ef0a40a33 100644
--- a/mcs/class/referencesource/System/System.txt
+++ b/mcs/class/referencesource/System/System.txt
@@ -122,6 +122,9 @@ Overflow_Int64=Value was either too large or too small for an Int64.
Overflow_UInt32=Value was either too large or too small for a UInt32.
Overflow_UInt64=Value was either too large or too small for a UInt64.
Overflow_Decimal=Value was either too large or too small for a Decimal.
+#
+#endif // !SILVERLIGHT
+#
#=------------------------------------------------------------------=
# Strings used by System.Runtime.Versioning
@@ -132,9 +135,6 @@ Argument_FrameworkNameInvalidVersion=FrameworkName version component is invalid.
Argument_FrameworkNameMissingVersion=FrameworkName version component is missing.
# Strings used by System.Collections
-#
-#endif // !SILVERLIGHT
-#
ArgumentNull_Key=Key cannot be null.
Argument_AddingDuplicate=An entry with the same key already exists.
Argument_InvalidValue=Argument {0} should be larger than {1}.
@@ -522,6 +522,7 @@ DirectoryObjectPathDescr=The fully qualified, or relative path to the directory
FileObjectDetectEncodingDescr=Determines whether the file will be parsed to see if it has a byte order mark indicating its encoding. If it does, this will be used rather than the current specified encoding.
FileObjectEncodingDescr=The encoding to use when reading the file. UTF-8 is the default.
FileObjectPathDescr=The fully qualified, or relative path to the file you wish to read from. E.g., "myfile.txt".
+#endif // !SILVERLIGHT
#=------------------------------------------------------------------=
# Security resources
@@ -536,9 +537,7 @@ Arg_EmptyOrNullString=String cannot be empty or null.
Arg_EmptyOrNullArray=Array cannot be empty or null.
Argument_InvalidClassAttribute=The value of "class" attribute is invalid.
Argument_InvalidNameType=The value of "nameType" is invalid.
-#endif // !SILVERLIGHT
InvalidOperation_EnumNotStarted=Enumeration has not started. Call MoveNext.
-#if !SILVERLIGHT
InvalidOperation_DuplicateItemNotAllowed=Duplicate items are not allowed in the collection.
Cryptography_Asn_MismatchedOidInCollection=The AsnEncodedData object does not have the same OID for the collection.
@@ -587,6 +586,7 @@ Security_InvalidValue=The {0} value was invalid.
Unknown_Error=Unknown error.
+#if !SILVERLIGHT
security_ServiceNameCollection_EmptyServiceName=A service name must not be null or empty.
security_ExtendedProtectionPolicy_UseDifferentConstructorForNever=To construct a policy with PolicyEnforcement.Never, the single-parameter constructor must be used.
security_ExtendedProtectionPolicy_NoEmptyServiceNameCollection=The ServiceNameCollection must contain at least one service name.
@@ -854,10 +854,10 @@ net_uri_BadUnicodeHostForIdn=An invalid Unicode character by IDN standards was s
net_uri_GenericAuthorityNotDnsSafe=The generic authority '{0}' is not a valid dns name.
net_uri_NotJustSerialization=UriComponents.SerializationInfoString must not be combined with other UriComponents.
+net_emptystringcall=The parameter '{0}' cannot be an empty string.
#if !SILVERLIGHT
net_emptystringset=This property cannot be set to an empty string.
-net_emptystringcall=The parameter '{0}' cannot be an empty string.
net_headers_req=This collection holds response headers and cannot contain the specified request header.
net_headers_rsp=This collection holds request headers and cannot contain the specified response header.
@@ -1333,6 +1333,9 @@ net_log_socket_connected=Created connection from {0} to {1}.
net_log_socket_accepted=Accepted connection from {0} to {1}.
net_log_socket_not_logged_file=Not logging data from file: {0}.
net_log_socket_connect_dnsendpoint=Connecting to a DnsEndPoint.
+net_log_set_socketoption_reuseport={0}#{1} - Setting SocketOptionName.ReuseUnicastPort option for socket.
+net_log_set_socketoption_reuseport_not_supported={0}#{1} - SocketOptionName.ReuseUnicastPort option not supported.
+net_log_set_socketoption_reuseport_default_on=Registry key activated to enable SocketOptionName.ReuseUnicastPort socket option by default for all ServicePoint TCP connections.
#=--------------------------
#= Email Strings
@@ -1699,6 +1702,7 @@ CantGetStandardError=StandardError has not been redirected.
CantMixSyncAsyncOperation= Cannot mix synchronous and asynchronous operation on process stream.
NoFileMappingSize=Cannot retrieve file mapping size while initializing configuration settings.
EnvironmentBlockTooLong=The environment block used to start a process cannot be longer than 65535 bytes. Your environment block is {0} bytes long. Remove some environment variables and try again.
+CantSetDuplicatePassword=ProcessStartInfo.Password and ProcessStartInfo.PasswordInClearText cannot both be set. Use only one of them.
#=------------------------------------------------------------------=
# Strings used by the Serial ports and other areas using IO error reporting
@@ -2130,6 +2134,13 @@ ResetActionRequiresNullItem=Reset action must be initialized with no changed ite
ResetActionRequiresIndexMinus1=Reset action must be initialized with index -1.
IndexCannotBeNegative=Index cannot be negative.
ObservableCollectionReentrancyNotAllowed=Cannot change ObservableCollection during a CollectionChanged event.
+
+InvalidOperation_HCCountOverflow=Handle collector count overflows or underflows.
+Argument_InvalidThreshold=maximumThreshold cannot be less than initialThreshold.
#endif // !FEATURE_NETCORE
#endif // INCLUDE_DEBUG
+
+#if !SILVERLIGHT
+net_ssl_io_already_shutdown=Write operations are not allowed after the channel was shutdown.
+#endif // !SILVERLIGHT
diff --git a/mcs/class/referencesource/System/compmod/microsoft/win32/UnsafeNativeMethods.cs b/mcs/class/referencesource/System/compmod/microsoft/win32/UnsafeNativeMethods.cs
index 95874022970..00d024ca8b2 100644
--- a/mcs/class/referencesource/System/compmod/microsoft/win32/UnsafeNativeMethods.cs
+++ b/mcs/class/referencesource/System/compmod/microsoft/win32/UnsafeNativeMethods.cs
@@ -367,19 +367,19 @@ namespace Microsoft.Win32 {
[DllImport(ExternDll.Advapi32, CharSet=System.Runtime.InteropServices.CharSet.Unicode, SetLastError=true)]
[ResourceExposure(ResourceScope.None)]
[return: MarshalAs(UnmanagedType.Bool)]
- [SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Justification = "[....]: EventLog is protected by EventLogPermission")]
+ [SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Justification = "Microsoft: EventLog is protected by EventLogPermission")]
public static extern bool GetOldestEventLogRecord(SafeHandle hEventLog, out int number);
[DllImport(ExternDll.Advapi32, CharSet=System.Runtime.InteropServices.CharSet.Unicode, SetLastError=true)]
[ResourceExposure(ResourceScope.Machine)]
[return: MarshalAs(UnmanagedType.Bool)]
- [SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Justification = "[....]: EventLog is protected by EventLogPermission")]
+ [SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Justification = "Microsoft: EventLog is protected by EventLogPermission")]
public static extern bool ReadEventLog(SafeHandle hEventLog, int dwReadFlags,
int dwRecordOffset, byte[] buffer, int numberOfBytesToRead, out int bytesRead,
out int minNumOfBytesNeeded);
[DllImport(ExternDll.Advapi32, CharSet=System.Runtime.InteropServices.CharSet.Unicode, SetLastError=true)]
[ResourceExposure(ResourceScope.None)]
[return: MarshalAs(UnmanagedType.Bool)]
- [SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Justification = "[....]: EventLog is protected by EventLogPermission")]
+ [SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Justification = "Microsoft: EventLog is protected by EventLogPermission")]
public static extern bool NotifyChangeEventLog(SafeHandle hEventLog, SafeWaitHandle hEvent);
[DllImport(ExternDll.Kernel32, EntryPoint="ReadDirectoryChangesW", CharSet=System.Runtime.InteropServices.CharSet.Auto, SetLastError=true)]
diff --git a/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeEventLogReadHandle.cs b/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeEventLogReadHandle.cs
index 56dad7b9e8f..9aa3130964b 100644
--- a/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeEventLogReadHandle.cs
+++ b/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeEventLogReadHandle.cs
@@ -7,7 +7,7 @@
**
** Class: SafeEventLogReadHandle
**
-** <EMAIL>Author: David Gutierrez ([....]) </EMAIL>
+** <EMAIL>Author: David Gutierrez (Microsoft) </EMAIL>
**
** A wrapper for event log handles
**
diff --git a/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeEventLogWriteHandle.cs b/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeEventLogWriteHandle.cs
index 55d5f8ed7cd..060594b0c8b 100644
--- a/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeEventLogWriteHandle.cs
+++ b/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeEventLogWriteHandle.cs
@@ -7,7 +7,7 @@
**
** Class: SafeEventLogWriteHandle
**
-** <EMAIL>Author: David Gutierrez ([....]) </EMAIL>
+** <EMAIL>Author: David Gutierrez (Microsoft) </EMAIL>
**
** A wrapper for event log handles
**
diff --git a/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeFileMapViewHandle.cs b/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeFileMapViewHandle.cs
index ba6ca911f83..72e064091ee 100644
--- a/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeFileMapViewHandle.cs
+++ b/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeFileMapViewHandle.cs
@@ -7,7 +7,7 @@
**
** Class: SafeFileMapViewHandle
**
-** <EMAIL>Author: Brian Grunkemeyer ([....]) </EMAIL>
+** <EMAIL>Author: Brian Grunkemeyer (Microsoft) </EMAIL>
**
** A wrapper for handles returned from MapViewOfFile, used
** for shared memory.
diff --git a/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeFileMappingHandle.cs b/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeFileMappingHandle.cs
index 35568910b42..6a7db6b1576 100644
--- a/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeFileMappingHandle.cs
+++ b/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeFileMappingHandle.cs
@@ -7,7 +7,7 @@
**
** Class: SafeFileMappingHandle
**
-** <EMAIL>Author: David Gutierrez ([....]) </EMAIL>
+** <EMAIL>Author: David Gutierrez (Microsoft) </EMAIL>
**
** A wrapper for handle to file mappings, returned by
** CreateFileMapping and OpenFileMapping. Used for shared
diff --git a/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeLibraryHandle.cs b/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeLibraryHandle.cs
index ef4a1bb60e1..55dc02ab90f 100644
--- a/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeLibraryHandle.cs
+++ b/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeLibraryHandle.cs
@@ -7,7 +7,7 @@
**
** Class: SafeLibraryHandle
**
-** <EMAIL>Author: David Gutierrez ([....]) </EMAIL>
+** <EMAIL>Author: David Gutierrez (Microsoft) </EMAIL>
**
** A wrapper for a library handles
**
diff --git a/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeLocalMemHandle.cs b/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeLocalMemHandle.cs
index 86df5599a7a..8f2c8f513fc 100644
--- a/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeLocalMemHandle.cs
+++ b/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeLocalMemHandle.cs
@@ -7,7 +7,7 @@
**
** Class: SafeLocalMemHandle
**
-** <EMAIL>Author: David Gutierrez ([....]) </EMAIL>
+** <EMAIL>Author: David Gutierrez (Microsoft) </EMAIL>
**
** A wrapper for handle to local memory
**
diff --git a/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeTimerHandle.cs b/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeTimerHandle.cs
index 65b3a0a10b5..68abca846ae 100644
--- a/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeTimerHandle.cs
+++ b/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeTimerHandle.cs
@@ -7,7 +7,7 @@
**
** Class: SafeTimerHandle
**
-** <EMAIL>Author: David Gutierrez ([....]) </EMAIL>
+** <EMAIL>Author: David Gutierrez (Microsoft) </EMAIL>
**
** A wrapper for a timer handle
**
diff --git a/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeUserTokenHandle.cs b/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeUserTokenHandle.cs
index 25fb6d62d00..f21aea760ec 100644
--- a/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeUserTokenHandle.cs
+++ b/mcs/class/referencesource/System/compmod/microsoft/win32/safehandles/SafeUserTokenHandle.cs
@@ -7,7 +7,7 @@
**
** Class: SafeUserTokenHandle
**
-** <EMAIL>Author: David Gutierrez ([....]) </EMAIL>
+** <EMAIL>Author: David Gutierrez (Microsoft) </EMAIL>
**
** A wrapper for a user token handle
**
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeArgumentReferenceExpression.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeArgumentReferenceExpression.cs
index 66eb9d755dc..7b074e0280c 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeArgumentReferenceExpression.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeArgumentReferenceExpression.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeArgumentReferenceExpression.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeArrayCreateExpression.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeArrayCreateExpression.cs
index e4517f1bed3..63e9b54e17d 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeArrayCreateExpression.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeArrayCreateExpression.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeArrayCreateExpression.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeArrayIndexerExpression.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeArrayIndexerExpression.cs
index efacd8e4ea4..85e97974683 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeArrayIndexerExpression.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeArrayIndexerExpression.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeArrayIndexerExpression.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeAssignStatement.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeAssignStatement.cs
index 1337fc7195e..2a5ccbe4c95 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeAssignStatement.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeAssignStatement.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeAssignStatement.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeAttachEventStatement.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeAttachEventStatement.cs
index 78003316f58..f3098a1a6a4 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeAttachEventStatement.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeAttachEventStatement.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeAttachEventStatement.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeAttributeArgument.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeAttributeArgument.cs
index 278ba1db530..218ff75b498 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeAttributeArgument.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeAttributeArgument.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeAttributeArgument.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeAttributeArgumentCollection.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeAttributeArgumentCollection.cs
index a7426cdfdcd..242803b581c 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeAttributeArgumentCollection.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeAttributeArgumentCollection.cs
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
// <copyright file="CodeAttributeArgumentCollection.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// ------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeAttributeDeclaration.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeAttributeDeclaration.cs
index 4216987dc83..b10284664fd 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeAttributeDeclaration.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeAttributeDeclaration.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeAttributeDeclaration.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeAttributeDeclarationCollection.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeAttributeDeclarationCollection.cs
index 2c14d78934e..e7a6baed543 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeAttributeDeclarationCollection.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeAttributeDeclarationCollection.cs
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
// <copyright file="CodeAttributeDeclarationCollection.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// ------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeBinaryOperatorExpression.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeBinaryOperatorExpression.cs
index ee21644fb74..e0c52434398 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeBinaryOperatorExpression.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeBinaryOperatorExpression.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeBinaryOperatorExpression.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeCastExpression.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeCastExpression.cs
index c001c5806b4..f136ff61794 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeCastExpression.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeCastExpression.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeCastExpression.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeCatchClause.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeCatchClause.cs
index 15ab8de228a..6f8034806b8 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeCatchClause.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeCatchClause.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeCatchClause.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeCatchClauseCollection.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeCatchClauseCollection.cs
index ceb3e70ea59..4d8b0b35c56 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeCatchClauseCollection.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeCatchClauseCollection.cs
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
// <copyright file="CodeCatchClauseCollection.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// ------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeChecksumPragma.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeChecksumPragma.cs
index a272b59d0c4..b18cb50f6c5 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeChecksumPragma.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeChecksumPragma.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeChecksumPragma.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeComment.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeComment.cs
index e639c377603..2b04dec5959 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeComment.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeComment.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeComment.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeCommentStatement.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeCommentStatement.cs
index bd7598eb8fe..7872eaf0316 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeCommentStatement.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeCommentStatement.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeCommentStatement.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeCommentStatementCollection.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeCommentStatementCollection.cs
index 9d0936dbf35..f2360b56464 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeCommentStatementCollection.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeCommentStatementCollection.cs
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
// <copyright file="CodeCommentStatementCollection.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// ------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeCompileUnit.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeCompileUnit.cs
index 7a4102e623a..24c0823e6ce 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeCompileUnit.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeCompileUnit.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeCompileUnit.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeConditionStatement.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeConditionStatement.cs
index f71df71452d..65cf684d894 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeConditionStatement.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeConditionStatement.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeConditionStatement.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeConstructor.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeConstructor.cs
index 79a4e990646..0a29e595957 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeConstructor.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeConstructor.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeConstructor.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeDefaultValueExpression.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeDefaultValueExpression.cs
index 7ab33e6ba42..d41abec56b5 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeDefaultValueExpression.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeDefaultValueExpression.cs
@@ -1,4 +1,4 @@
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
namespace System.CodeDom {
using System.Diagnostics;
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeDelegateCreateExpression.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeDelegateCreateExpression.cs
index d5f19dc7838..ada4bf15b81 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeDelegateCreateExpression.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeDelegateCreateExpression.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeDelegateCreateExpression.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeDelegateInvokeExpression.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeDelegateInvokeExpression.cs
index ccc099fbacd..c46bdf91e55 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeDelegateInvokeExpression.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeDelegateInvokeExpression.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeDelegateInvokeExpression.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeDirectionExpression.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeDirectionExpression.cs
index 12288ac596d..b6dcdc64def 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeDirectionExpression.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeDirectionExpression.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeDirectionExpression.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeDirectiveCollection.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeDirectiveCollection.cs
index 4a1decc69ae..c7f7b5a7a40 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeDirectiveCollection.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeDirectiveCollection.cs
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
// <copyright file="CodeDirectiveCollection.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// ------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeEntryPointMethod.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeEntryPointMethod.cs
index 74575ca3e4d..aa65416192b 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeEntryPointMethod.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeEntryPointMethod.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeEntryPointMethod.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeEventReferenceExpression.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeEventReferenceExpression.cs
index 1a34b90cad0..3eadd89bff6 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeEventReferenceExpression.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeEventReferenceExpression.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeEventReferenceExpression.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeExpressionCollection.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeExpressionCollection.cs
index 1af19ae87ae..6c0b04414d5 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeExpressionCollection.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeExpressionCollection.cs
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
// <copyright file="CodeExpressionCollection.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// ------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeExpressionStatement.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeExpressionStatement.cs
index 676ed98701c..7fa7f8bae5c 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeExpressionStatement.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeExpressionStatement.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeExpressionStatement.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeFieldReferenceExpression.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeFieldReferenceExpression.cs
index 52ad0e1018d..279a2b27b34 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeFieldReferenceExpression.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeFieldReferenceExpression.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeFieldReferenceExpression.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeGotoStatement.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeGotoStatement.cs
index a8b06a1ad84..fa1e7c963c5 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeGotoStatement.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeGotoStatement.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeGotoStatement.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeIndexerExpression.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeIndexerExpression.cs
index cb41ce7287a..bd71984b759 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeIndexerExpression.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeIndexerExpression.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeIndexerExpression.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeIterationStatement.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeIterationStatement.cs
index 65d988ada2f..bcabe1bee86 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeIterationStatement.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeIterationStatement.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeIterationStatement.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeLabeledStatement.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeLabeledStatement.cs
index e9d0a4d6756..d378c4041bf 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeLabeledStatement.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeLabeledStatement.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeLabeledStatement.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeLinePragma.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeLinePragma.cs
index e83322d7601..96064829f84 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeLinePragma.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeLinePragma.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeLinePragma.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeMemberEvent.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeMemberEvent.cs
index d8ed1cc15d6..e7a05f69b40 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeMemberEvent.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeMemberEvent.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeMemberEvent.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeMemberField.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeMemberField.cs
index a2d2877fc78..0a6d89bcfbc 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeMemberField.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeMemberField.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeMemberField.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeMemberMethod.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeMemberMethod.cs
index e7632f7ff98..1be22214417 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeMemberMethod.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeMemberMethod.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeMemberMethod.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeMemberProperty.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeMemberProperty.cs
index c07ce9643e3..8eded2271a7 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeMemberProperty.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeMemberProperty.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeMemberProperty.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeMethodInvokeExpression.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeMethodInvokeExpression.cs
index d1d5fe7eb36..b941059ead3 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeMethodInvokeExpression.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeMethodInvokeExpression.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeMethodInvokeExpression.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeMethodReturnStatement.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeMethodReturnStatement.cs
index 6bcb6a1abf4..3769a3a70e4 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeMethodReturnStatement.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeMethodReturnStatement.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeMethodReturnStatement.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeNamespace.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeNamespace.cs
index d1b0ab5f9eb..bc972367be4 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeNamespace.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeNamespace.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeNamespace.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeNamespaceCollection.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeNamespaceCollection.cs
index 81b5d119997..654eb1f8dee 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeNamespaceCollection.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeNamespaceCollection.cs
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
// <copyright file="CodeNamespaceCollection.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// ------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeNamespaceImport.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeNamespaceImport.cs
index aed07620ba6..21fb016d080 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeNamespaceImport.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeNamespaceImport.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeNamespaceImport.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeNamespaceImportCollection.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeNamespaceImportCollection.cs
index 9015a63bc1d..e4b8c72dfa3 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeNamespaceImportCollection.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeNamespaceImportCollection.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeNamespaceImportCollection.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeObject.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeObject.cs
index f8f0993c578..97813e052e3 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeObject.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeObject.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeObject.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeObjectCreateExpression.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeObjectCreateExpression.cs
index 9604e90baf8..6a09707e5f8 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeObjectCreateExpression.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeObjectCreateExpression.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeObjectCreateExpression.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeParameterDeclarationExpression.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeParameterDeclarationExpression.cs
index 9e970340962..5c3c1d58d56 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeParameterDeclarationExpression.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeParameterDeclarationExpression.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeParameterDeclarationExpression.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeParameterDeclarationExpressionCollection.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeParameterDeclarationExpressionCollection.cs
index 2bc781bae3e..dad8668f122 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeParameterDeclarationExpressionCollection.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeParameterDeclarationExpressionCollection.cs
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
// <copyright file="CodeParameterDeclarationExpressionCollection.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// ------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodePrimitiveExpression.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodePrimitiveExpression.cs
index b64496141f1..e8cb3b0f52b 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodePrimitiveExpression.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodePrimitiveExpression.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodePrimitiveExpression.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodePropertyReferenceExpression.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodePropertyReferenceExpression.cs
index 38ccf72ec0e..f61c1963490 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodePropertyReferenceExpression.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodePropertyReferenceExpression.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodePropertyReferenceExpression.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeRegionDirective.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeRegionDirective.cs
index 1ecfe2e9b33..058c64b2348 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeRegionDirective.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeRegionDirective.cs
@@ -1,5 +1,5 @@
//------------------------------------------------------------------------------
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// <copyright file="CodeChecksumPragma.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeRemoveEventStatement.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeRemoveEventStatement.cs
index c767800aef4..0f0c0f671ae 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeRemoveEventStatement.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeRemoveEventStatement.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeRemoveEventStatement.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeSnippetCompileUnit.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeSnippetCompileUnit.cs
index bdf6f35b052..df0b7eb0a0f 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeSnippetCompileUnit.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeSnippetCompileUnit.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeSnippetCompileUnit.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeSnippetExpression.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeSnippetExpression.cs
index 2e759abc826..18e87f7c61d 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeSnippetExpression.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeSnippetExpression.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeSnippetExpression.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeSnippetStatement.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeSnippetStatement.cs
index 4190a887680..8c0387fe46c 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeSnippetStatement.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeSnippetStatement.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeSnippetStatement.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeSnippetTypeMember.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeSnippetTypeMember.cs
index a2ae40489ac..a07dfa68ac3 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeSnippetTypeMember.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeSnippetTypeMember.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeSnippetTypeMember.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeStatement.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeStatement.cs
index cb56cfc083d..3cdbebdc80d 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeStatement.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeStatement.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeStatement.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeStatementCollection.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeStatementCollection.cs
index b9ee3df1167..d475921f4d7 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeStatementCollection.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeStatementCollection.cs
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
// <copyright file="CodeStatementCollection.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// ------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeThrowExceptionStatement.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeThrowExceptionStatement.cs
index 59a9b44aa30..f763c517c7a 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeThrowExceptionStatement.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeThrowExceptionStatement.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeThrowExceptionStatement.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeTryCatchFinallyStatement.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeTryCatchFinallyStatement.cs
index 13269122766..d79ff52b33f 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeTryCatchFinallyStatement.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeTryCatchFinallyStatement.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeTryCatchFinallyStatement.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeConstructor.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeConstructor.cs
index d2f737e9bf6..c9dd7346b7f 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeConstructor.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeConstructor.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeTypeConstructor.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeDeclaration.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeDeclaration.cs
index a4c49883432..c9c0c37697e 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeDeclaration.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeDeclaration.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeTypeDeclaration.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeDeclarationCollection.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeDeclarationCollection.cs
index 4d47a5afe7b..638ba5ff673 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeDeclarationCollection.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeDeclarationCollection.cs
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
// <copyright file="CodeTypeDeclarationCollection.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// ------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeDelegate.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeDelegate.cs
index a96b3b2246c..f0ad8368f8b 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeDelegate.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeDelegate.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeTypeDelegate.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeMember.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeMember.cs
index 060d76d8c0e..38f0c0d1c01 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeMember.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeMember.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeTypeMember.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeMemberCollection.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeMemberCollection.cs
index 58acc0bb192..b4fe0211f61 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeMemberCollection.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeMemberCollection.cs
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
// <copyright file="CodeTypeMemberCollection.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// ------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeOfExpression.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeOfExpression.cs
index a2ba738e4c0..dbd3498f76a 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeOfExpression.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeOfExpression.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeTypeOfExpression.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeParameter.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeParameter.cs
index d3acfd8c781..fd5e1164b06 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeParameter.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeParameter.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeTypeParameter.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeParameterCollection.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeParameterCollection.cs
index 42290c07bd4..9c03b81ab19 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeParameterCollection.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeParameterCollection.cs
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
// <copyright file="CodeTypeParameterCollection.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// ------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeReference.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeReference.cs
index ad8389d7eea..3ba435d53a6 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeReference.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeReference.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeTypeReference.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeReferenceCollection.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeReferenceCollection.cs
index 4787c56acd6..0324aff528a 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeReferenceCollection.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeReferenceCollection.cs
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
// <copyright file="CodeTypeReferenceCollection.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// ------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeReferenceExpression.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeReferenceExpression.cs
index 267323a8d47..3fdc0ebfc4f 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeReferenceExpression.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeTypeReferenceExpression.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeTypeReferenceExpression.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeVariableDeclarationStatement.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeVariableDeclarationStatement.cs
index 2569c3895a2..958a3386a2e 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeVariableDeclarationStatement.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeVariableDeclarationStatement.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeVariableDeclarationStatement.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/CodeVariableReferenceExpression.cs b/mcs/class/referencesource/System/compmod/system/codedom/CodeVariableReferenceExpression.cs
index 8ce7164697d..83bd33d4bcd 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/CodeVariableReferenceExpression.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/CodeVariableReferenceExpression.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeVariableReferenceExpression.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/codemethodreferenceexpression.cs b/mcs/class/referencesource/System/compmod/system/codedom/codemethodreferenceexpression.cs
index 96adf47cb09..1b8c54a77a3 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/codemethodreferenceexpression.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/codemethodreferenceexpression.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="codemethodreferenceexpression.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeCompiler.cs b/mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeCompiler.cs
index 7eaaa9aab34..45fb83a1ea7 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeCompiler.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeCompiler.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeCompiler.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeDOMProvider.cs b/mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeDOMProvider.cs
index 7fb7adce009..ff200413083 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeDOMProvider.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeDOMProvider.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeDOMProvider.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeDomConfigurationHandler.cs b/mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeDomConfigurationHandler.cs
index b72b1a989f2..e1633cc9241 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeDomConfigurationHandler.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeDomConfigurationHandler.cs
@@ -1,5 +1,5 @@
//------------------------------------------------------------------------------
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// <copyright file="CodeDomCompilationConfiguration.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeGenerator.cs b/mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeGenerator.cs
index 60cde1f2742..0e7062b0b12 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeGenerator.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeGenerator.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeGenerator.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeGeneratorOptions.cs b/mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeGeneratorOptions.cs
index d3a8dfb850e..80f6a3ba5fe 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeGeneratorOptions.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeGeneratorOptions.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CodeGeneratorOptions.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeValidator.cs b/mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeValidator.cs
index 6abf4c89d93..5164c804f68 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeValidator.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/compiler/CodeValidator.cs
@@ -1,5 +1,5 @@
//------------------------------------------------------------------------------
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// <copyright file="CodeGenerator.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/compiler/CompilerError.cs b/mcs/class/referencesource/System/compmod/system/codedom/compiler/CompilerError.cs
index 0e4f0a3bb78..c5c2661e377 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/compiler/CompilerError.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/compiler/CompilerError.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CompilerError.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/compiler/CompilerErrorCollection.cs b/mcs/class/referencesource/System/compmod/system/codedom/compiler/CompilerErrorCollection.cs
index 7b191fd9e62..f35d185fc60 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/compiler/CompilerErrorCollection.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/compiler/CompilerErrorCollection.cs
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
// <copyright file="CompilerErrorCollection.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// ------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/compiler/CompilerInfo.cs b/mcs/class/referencesource/System/compmod/system/codedom/compiler/CompilerInfo.cs
index 5e695adac39..0cd93987b52 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/compiler/CompilerInfo.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/compiler/CompilerInfo.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CompilerInfo.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/compiler/CompilerParameters.cs b/mcs/class/referencesource/System/compmod/system/codedom/compiler/CompilerParameters.cs
index c7d247c8de1..647fcc163a4 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/compiler/CompilerParameters.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/compiler/CompilerParameters.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CompilerParameters.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/compiler/CompilerResults.cs b/mcs/class/referencesource/System/compmod/system/codedom/compiler/CompilerResults.cs
index 5168410e59d..d2b7c231bfa 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/compiler/CompilerResults.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/compiler/CompilerResults.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="CompilerResults.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/compiler/Executor.cs b/mcs/class/referencesource/System/compmod/system/codedom/compiler/Executor.cs
index e9a97dad1e1..5fac36c6a02 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/compiler/Executor.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/compiler/Executor.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="Executor.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/compiler/GeneratedCodeAttribute.cs b/mcs/class/referencesource/System/compmod/system/codedom/compiler/GeneratedCodeAttribute.cs
index 0066e7363a3..fd30ac50c3a 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/compiler/GeneratedCodeAttribute.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/compiler/GeneratedCodeAttribute.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="GeneratedCodeAttribute.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/compiler/IndentTextWriter.cs b/mcs/class/referencesource/System/compmod/system/codedom/compiler/IndentTextWriter.cs
index 0d6d57942d3..be86a9c176b 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/compiler/IndentTextWriter.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/compiler/IndentTextWriter.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="IndentTextWriter.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/compiler/RedistVersionInfo.cs b/mcs/class/referencesource/System/compmod/system/codedom/compiler/RedistVersionInfo.cs
index bf8e4bf87a3..c3c0e970c9a 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/compiler/RedistVersionInfo.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/compiler/RedistVersionInfo.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="RedistVersionInfo.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/codedom/compiler/TempFiles.cs b/mcs/class/referencesource/System/compmod/system/codedom/compiler/TempFiles.cs
index da6925a113e..f966f26840e 100644
--- a/mcs/class/referencesource/System/compmod/system/codedom/compiler/TempFiles.cs
+++ b/mcs/class/referencesource/System/compmod/system/codedom/compiler/TempFiles.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <copyright file="TempFiles.cs" company="Microsoft">
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/collections/generic/stack.cs b/mcs/class/referencesource/System/compmod/system/collections/generic/stack.cs
index 2a88477ebb7..f92161addd1 100644
--- a/mcs/class/referencesource/System/compmod/system/collections/generic/stack.cs
+++ b/mcs/class/referencesource/System/compmod/system/collections/generic/stack.cs
@@ -32,7 +32,7 @@ namespace System.Collections.Generic {
IReadOnlyCollection<T> {
private T[] _array; // Storage for stack elements
private int _size; // Number of items in the stack.
- private int _version; // Used to keep enumerator in [....] w/ collection.
+ private int _version; // Used to keep enumerator in sync w/ collection.
#if !SILVERLIGHT
[NonSerialized]
#endif
diff --git a/mcs/class/referencesource/System/compmod/system/collections/objectmodel/observablecollection.cs b/mcs/class/referencesource/System/compmod/system/collections/objectmodel/observablecollection.cs
index 6252f39f0b2..38a13ddbddb 100644
--- a/mcs/class/referencesource/System/compmod/system/collections/objectmodel/observablecollection.cs
+++ b/mcs/class/referencesource/System/compmod/system/collections/objectmodel/observablecollection.cs
@@ -11,7 +11,7 @@
// See spec at http://avalon/connecteddata/Specs/Collection%20Interfaces.mht
//
// History:
-// 11/22/2004 : [....] - created
+// 11/22/2004 : Microsoft - created
//
//---------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/System/compmod/system/collections/specialized/marshalinghelpers.cs b/mcs/class/referencesource/System/compmod/system/collections/specialized/marshalinghelpers.cs
index 3bfa0b8374e..ed712071802 100644
--- a/mcs/class/referencesource/System/compmod/system/collections/specialized/marshalinghelpers.cs
+++ b/mcs/class/referencesource/System/compmod/system/collections/specialized/marshalinghelpers.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System.Security;
using System.Collections;
diff --git a/mcs/class/referencesource/System/compmod/system/componentmodel/AsyncOperation.cs b/mcs/class/referencesource/System/compmod/system/componentmodel/AsyncOperation.cs
index d3679b06ac7..7d596a07f6a 100644
--- a/mcs/class/referencesource/System/compmod/system/componentmodel/AsyncOperation.cs
+++ b/mcs/class/referencesource/System/compmod/system/componentmodel/AsyncOperation.cs
@@ -29,7 +29,7 @@ namespace System.ComponentModel
}
/// <summary>
- /// Destructor. Guarantees that [....] context will always get notified of completion.
+ /// Destructor. Guarantees that sync context will always get notified of completion.
/// </summary>
~AsyncOperation()
{
diff --git a/mcs/class/referencesource/System/compmod/system/componentmodel/MemberDescriptor.cs b/mcs/class/referencesource/System/compmod/system/componentmodel/MemberDescriptor.cs
index ebc36a83d4d..f6660d7aa10 100644
--- a/mcs/class/referencesource/System/compmod/system/componentmodel/MemberDescriptor.cs
+++ b/mcs/class/referencesource/System/compmod/system/componentmodel/MemberDescriptor.cs
@@ -444,7 +444,7 @@ namespace System.ComponentModel {
}
/// <devdoc>
- /// Try to keep this reasonable in [....] with Equals(). Specifically,
+ /// Try to keep this reasonable in sync with Equals(). Specifically,
/// if A.Equals(B) returns true, A & B should have the same hash code.
/// </devdoc>
public override int GetHashCode() {
diff --git a/mcs/class/referencesource/System/compmod/system/componentmodel/PropertyDescriptor.cs b/mcs/class/referencesource/System/compmod/system/componentmodel/PropertyDescriptor.cs
index ecfb46bc0c5..9915bcf85ba 100644
--- a/mcs/class/referencesource/System/compmod/system/componentmodel/PropertyDescriptor.cs
+++ b/mcs/class/referencesource/System/compmod/system/componentmodel/PropertyDescriptor.cs
@@ -347,7 +347,7 @@ namespace System.ComponentModel {
}
/// <devdoc>
- /// Try to keep this reasonable in [....] with Equals(). Specifically,
+ /// Try to keep this reasonable in sync with Equals(). Specifically,
/// if A.Equals(B) returns true, A & B should have the same hash code.
/// </devdoc>
public override int GetHashCode() {
diff --git a/mcs/class/referencesource/System/compmod/system/componentmodel/design/DesignerVerb.cs b/mcs/class/referencesource/System/compmod/system/componentmodel/design/DesignerVerb.cs
index d9840075c34..b10a8255aa6 100644
--- a/mcs/class/referencesource/System/compmod/system/componentmodel/design/DesignerVerb.cs
+++ b/mcs/class/referencesource/System/compmod/system/componentmodel/design/DesignerVerb.cs
@@ -30,7 +30,7 @@ namespace System.ComponentModel.Design {
/// </devdoc>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public DesignerVerb(string text, EventHandler handler) : base(handler, StandardCommands.VerbFirst) {
- // NOTICE!!! When you changed the regex here, please change it in Designer\[....]\System\[....]\Design\TableLayoutPanelDesigner.cs
+ // NOTICE!!! When you changed the regex here, please change it in Designer\Microsoft\System\Microsoft\Design\TableLayoutPanelDesigner.cs
// method "TrimText", too.
Properties["Text"] = text == null ? null : Regex.Replace(text, @"\(\&.\)", ""); // VSWHIDBEY 485835
}
diff --git a/mcs/class/referencesource/System/compmod/system/diagnostics/assertwrapper.cs b/mcs/class/referencesource/System/compmod/system/diagnostics/assertwrapper.cs
index c6f6385671d..e6938156e8f 100644
--- a/mcs/class/referencesource/System/compmod/system/diagnostics/assertwrapper.cs
+++ b/mcs/class/referencesource/System/compmod/system/diagnostics/assertwrapper.cs
@@ -61,9 +61,9 @@ namespace System.Diagnostics {
[DllImport(ExternDll.Fxassert, CharSet=System.Runtime.InteropServices.CharSet.Ansi, BestFitMapping=true)]
[ResourceExposure(ResourceScope.None)]
- [SuppressMessage("Microsoft.Globalization","CA2101:SpecifyMarshalingForPInvokeStringArguments", MessageId="0", Justification="[....]: VsAssert isn't making a security decision here and they don't provide Unicode versions, also it is internal to MS")]
- [SuppressMessage("Microsoft.Globalization","CA2101:SpecifyMarshalingForPInvokeStringArguments", MessageId="1", Justification="[....]: VsAssert isn't making a security decision here and they don't provide Unicode versions, also it is internal to MS")]
- [SuppressMessage("Microsoft.Globalization","CA2101:SpecifyMarshalingForPInvokeStringArguments", MessageId="2", Justification="[....]: VsAssert isn't making a security decision here and they don't provide Unicode versions, also it is internal to MS")]
+ [SuppressMessage("Microsoft.Globalization","CA2101:SpecifyMarshalingForPInvokeStringArguments", MessageId="0", Justification="Microsoft: VsAssert isn't making a security decision here and they don't provide Unicode versions, also it is internal to MS")]
+ [SuppressMessage("Microsoft.Globalization","CA2101:SpecifyMarshalingForPInvokeStringArguments", MessageId="1", Justification="Microsoft: VsAssert isn't making a security decision here and they don't provide Unicode versions, also it is internal to MS")]
+ [SuppressMessage("Microsoft.Globalization","CA2101:SpecifyMarshalingForPInvokeStringArguments", MessageId="2", Justification="Microsoft: VsAssert isn't making a security decision here and they don't provide Unicode versions, also it is internal to MS")]
public static extern int VsAssert(string message, string assert, string file, int line, [In, Out]int[] pfDisable);
[ResourceExposure(ResourceScope.None)]
@@ -203,7 +203,7 @@ namespace System.Diagnostics {
[ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)]
#endif
[SecuritySafeCritical]
- [SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", MessageId = "Microsoft.Win32.UnsafeNativeMethods.ReleaseDC(System.IntPtr,System.IntPtr)", Justification = "[....]: If the DC is not released there's not much we can do.")]
+ [SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", MessageId = "Microsoft.Win32.UnsafeNativeMethods.ReleaseDC(System.IntPtr,System.IntPtr)", Justification = "Microsoft: If the DC is not released there's not much we can do.")]
private static string TruncateMessageToFitScreen(string message) {
const int MaxCharsPerLine = 80;
diff --git a/mcs/class/referencesource/System/misc/ClientUtils.cs b/mcs/class/referencesource/System/misc/ClientUtils.cs
index d350b64b653..d42c1cdf673 100644
--- a/mcs/class/referencesource/System/misc/ClientUtils.cs
+++ b/mcs/class/referencesource/System/misc/ClientUtils.cs
@@ -6,11 +6,11 @@
/*
*/
-#if WINFORMS_NAMESPACE
+#if Microsoft_NAMESPACE
namespace System.Windows.Forms
#elif DRAWING_NAMESPACE
namespace System.Drawing
-#elif WINFORMS_PUBLIC_GRAPHICS_LIBRARY
+#elif Microsoft_PUBLIC_GRAPHICS_LIBRARY
namespace System.Internal
#elif SYSTEM_NAMESPACE
namespace System
@@ -274,7 +274,7 @@
/// -----------------------------------------------------------------
///
/// </devdoc>
-#if WINFORMS_NAMESPACE || WINFORMS_PUBLIC_GRAPHICS_LIBRARY || DRAWING_NAMESPACE
+#if Microsoft_NAMESPACE || Microsoft_PUBLIC_GRAPHICS_LIBRARY || DRAWING_NAMESPACE
internal class WeakRefCollection : IList {
private int refCheckThreshold = Int32.MaxValue; // this means this is disabled by default.
private ArrayList _innerList;
diff --git a/mcs/class/referencesource/System/misc/SecurityUtils.cs b/mcs/class/referencesource/System/misc/SecurityUtils.cs
index f4349335eec..9c025cf89eb 100644
--- a/mcs/class/referencesource/System/misc/SecurityUtils.cs
+++ b/mcs/class/referencesource/System/misc/SecurityUtils.cs
@@ -8,11 +8,11 @@
*/
-#if WINFORMS_NAMESPACE
+#if Microsoft_NAMESPACE
namespace System.Windows.Forms
#elif DRAWING_NAMESPACE
namespace System.Drawing
-#elif WINFORMS_PUBLIC_GRAPHICS_LIBRARY
+#elif Microsoft_PUBLIC_GRAPHICS_LIBRARY
namespace System.Internal
#elif SYSTEM_NAMESPACE
namespace System
@@ -131,7 +131,7 @@ namespace System.Windows.Forms
return Activator.CreateInstance(type, flags, null, args, null);
}
-#if (!WINFORMS_NAMESPACE)
+#if (!Microsoft_NAMESPACE)
/// <devdoc>
/// This helper method provides safe access to Activator.CreateInstance.
diff --git a/mcs/class/referencesource/System/misc/externdll.cs b/mcs/class/referencesource/System/misc/externdll.cs
index 367fe80cfcc..c62ebe45b2f 100644
--- a/mcs/class/referencesource/System/misc/externdll.cs
+++ b/mcs/class/referencesource/System/misc/externdll.cs
@@ -72,6 +72,7 @@ namespace System {
public const string Fxassert = "Fxassert.dll";
public const string Shlwapi = "shlwapi.dll";
public const string Crypt32 = "crypt32.dll";
+ public const string ShCore = "SHCore.dll";
// system.data specific
internal const string Odbc32 = "odbc32.dll";
diff --git a/mcs/class/referencesource/System/net/System/Net/Cache/HttpRequestCacheValidator.cs b/mcs/class/referencesource/System/net/System/Net/Cache/HttpRequestCacheValidator.cs
index 92dafc1f538..973e6b6214f 100644
--- a/mcs/class/referencesource/System/net/System/Net/Cache/HttpRequestCacheValidator.cs
+++ b/mcs/class/referencesource/System/net/System/Net/Cache/HttpRequestCacheValidator.cs
@@ -902,7 +902,7 @@ namespace System.Net.Cache {
// These if-else are two logically identical blocks that differ only in the way of how text search is done.
// The text search is done differently for 32 and X-bits platforms.
- // ATTN: You are responsible for keeping the rest of the logic in [....].
+ // ATTN: You are responsible for keeping the rest of the logic in sync.
if (IntPtr.Size == 4) {
// We are on 32-bits platform
diff --git a/mcs/class/referencesource/System/net/System/Net/Cache/IERequestCache.cs b/mcs/class/referencesource/System/net/System/Net/Cache/IERequestCache.cs
index fb4467486e0..d7421af8e03 100644
--- a/mcs/class/referencesource/System/net/System/Net/Cache/IERequestCache.cs
+++ b/mcs/class/referencesource/System/net/System/Net/Cache/IERequestCache.cs
@@ -51,7 +51,7 @@ namespace Microsoft.Win32 {
***********/
// Per VsWhidbey#88276 it was decided to not enforce any cache metadata limits for WinInet cache provider.
- // ([....] 7/17 made this a const to avoid threading issues)
+ // (Microsoft 7/17 made this a const to avoid threading issues)
//_MaximumResponseHeadersLength = Int32.MaxValue;
this.async = async;
diff --git a/mcs/class/referencesource/System/net/System/Net/Cache/RequestCachePolicy.cs b/mcs/class/referencesource/System/net/System/Net/Cache/RequestCachePolicy.cs
index f668069047e..704589af7bc 100644
--- a/mcs/class/referencesource/System/net/System/Net/Cache/RequestCachePolicy.cs
+++ b/mcs/class/referencesource/System/net/System/Net/Cache/RequestCachePolicy.cs
@@ -32,7 +32,7 @@ namespace System.Net.Cache {
BypassCache = 1,
// Only serve requests from cache, an exception is thrown if not found
CacheOnly = 2,
- // Serve from the cache, but will [....] up with the server if not found
+ // Serve from the cache, but will sync up with the server if not found
CacheIfAvailable = 3,
// Attempt to revalidate cache with the server, reload if unable to
Revalidate = 4,
@@ -105,7 +105,7 @@ namespace System.Net.Cache {
BypassCache = 1,
// Only serve requests from cache, an exception is thrown if not found
CacheOnly = 2,
- // Serve from the cache, but will [....] up with the server if not found
+ // Serve from the cache, but will sync up with the server if not found
CacheIfAvailable = 3,
// Validate cached data with the server even if it looks fresh
Revalidate = 4,
diff --git a/mcs/class/referencesource/System/net/System/Net/Configuration/DefaultProxySection.cs b/mcs/class/referencesource/System/net/System/Net/Configuration/DefaultProxySection.cs
index cee3b6b2eb8..769b456cc95 100644
--- a/mcs/class/referencesource/System/net/System/Net/Configuration/DefaultProxySection.cs
+++ b/mcs/class/referencesource/System/net/System/Net/Configuration/DefaultProxySection.cs
@@ -118,7 +118,7 @@ namespace System.Net.Configuration
// This allows us to prevent parent settings (machine.config) from propegating to higher config (app.config), unless
// the higher config doesn't contain the section at all. That is, overriding defaultProxy is all-or-nothing.
- // Template from [....].
+ // Template from Microsoft.
protected override void Reset(ConfigurationElement parentElement)
{
// Ignore the parentElement parameter by changing it to the default settings
diff --git a/mcs/class/referencesource/System/net/System/Net/Configuration/TimeoutValidationAttribute.cs b/mcs/class/referencesource/System/net/System/Net/Configuration/TimeoutValidationAttribute.cs
index 472273d81b9..0bc729b6a77 100644
--- a/mcs/class/referencesource/System/net/System/Net/Configuration/TimeoutValidationAttribute.cs
+++ b/mcs/class/referencesource/System/net/System/Net/Configuration/TimeoutValidationAttribute.cs
@@ -3,7 +3,7 @@ namespace System.Net {
using System.Configuration;
using System.ComponentModel;
- // NOTE [[....]]: The old validation attribute was removed from System.ll and is
+ // NOTE [Microsoft]: The old validation attribute was removed from System.ll and is
// replaced by more flexible and robust validation/conversion design.
// The change bellow is a simple fix to make things work with the least possible change ( it is an integration break )
// However, we already have a built-in support for configuration properties that store
@@ -32,7 +32,7 @@ namespace System.Net {
return;
if (timeout <= 0 && timeout != System.Threading.Timeout.Infinite) {
- // Note [[....]] : This is a lab integration fix. Old code did not have any error message at this point
+ // Note [Microsoft] : This is a lab integration fix. Old code did not have any error message at this point
// This code change accomplishes the same result. However its highly reccomended that a specific error message is givven
// to the user so they know what exaclty is the problem ( i.e. the value must be a positive integer or be Infinite )
// To accomplish this - an exception with the specific error message could be thrown ( ArgumentException is prefferred )
diff --git a/mcs/class/referencesource/System/net/System/Net/FtpWebRequest.cs b/mcs/class/referencesource/System/net/System/Net/FtpWebRequest.cs
index 8d6ae247f18..1e7c00c550d 100644
--- a/mcs/class/referencesource/System/net/System/Net/FtpWebRequest.cs
+++ b/mcs/class/referencesource/System/net/System/Net/FtpWebRequest.cs
@@ -1320,7 +1320,7 @@ namespace System.Net {
}
}
- // Return null only on [....] (if we're on the [....] thread). Otherwise throw if no context is available.
+ // Return null only on Sync (if we're on the Sync thread). Otherwise throw if no context is available.
//
//
@@ -1331,7 +1331,7 @@ namespace System.Net {
else if (m_WriteAsyncResult != null)
return m_WriteAsyncResult;
- // [....].
+ // Sync.
GlobalLog.ThreadContract(ThreadKinds.User | ThreadKinds.Sync, "FtpWebRequest#" + ValidationHelper.HashString(this) + "::GetWritingContext");
return null;
}
@@ -1339,7 +1339,7 @@ namespace System.Net {
//
// Provides an abstract way of having Async code callback into the request (saves a delegate)
//
- // ATTN this method is also called on [....] path when either command or data stream gets closed
+ // ATTN this method is also called on sync path when either command or data stream gets closed
// Consider: Revisit the design of ftp streams
//
internal override void RequestCallback(object obj)
@@ -1350,7 +1350,7 @@ namespace System.Net {
SyncRequestCallback(obj);
}
//
- // Only executed for [....] requests when the pipline is completed
+ // Only executed for Sync requests when the pipline is completed
//
private void SyncRequestCallback(object obj)
{
@@ -1389,7 +1389,7 @@ namespace System.Net {
isRevalidatedOrRetried =!m_CacheDone &&
(CacheProtocol.ProtocolStatus == CacheValidationStatus.Continue || CacheProtocol.ProtocolStatus == CacheValidationStatus.RetryResponseFromServer);
- // This is for [....] Upload commands that do not get chance hit GetResponse loop
+ // This is for sync Upload commands that do not get chance hit GetResponse loop
if (m_MethodInfo.IsUpload)
{
CheckCacheRetrieveOnResponse();
diff --git a/mcs/class/referencesource/System/net/System/Net/HttpListenerRequest.cs b/mcs/class/referencesource/System/net/System/Net/HttpListenerRequest.cs
index a789a6ea2be..96bbf5246c8 100644
--- a/mcs/class/referencesource/System/net/System/Net/HttpListenerRequest.cs
+++ b/mcs/class/referencesource/System/net/System/Net/HttpListenerRequest.cs
@@ -303,6 +303,8 @@ namespace System.Net {
// Note: RequestBuffer may get moved in memory. If you dereference a pointer from inside the RequestBuffer,
// you must use 'OriginalBlobAddress' below to adjust the location of the pointer to match the location of
// RequestBuffer.
+ //
+
internal byte[] RequestBuffer
{
get
@@ -1017,7 +1019,7 @@ namespace System.Net {
}
internal IEnumerable<TokenBinding> GetTlsTokenBindings() {
-
+
// Try to get the token binding if not created.
if (Volatile.Read(ref m_TokenBindings) == null)
{
@@ -1063,11 +1065,19 @@ namespace System.Net {
}
m_TokenBindings = new List<TokenBinding>();
-
UnsafeNclNativeMethods.HttpApi.HTTP_REQUEST_TOKEN_BINDING_INFO* pTokenBindingInfo = UnsafeNclNativeMethods.HttpApi.GetTlsTokenBindingRequestInfo(RequestBuffer, OriginalBlobAddress);
+ UnsafeNclNativeMethods.HttpApi.HTTP_REQUEST_TOKEN_BINDING_INFO_V1* pTokenBindingInfo_V1 = null;
+ bool useV1TokenBinding = false;
+ // Only try to collect the old binding information if there is no V2 binding information available
if (pTokenBindingInfo == null)
{
+ pTokenBindingInfo_V1 = UnsafeNclNativeMethods.HttpApi.GetTlsTokenBindingRequestInfo_V1(RequestBuffer, OriginalBlobAddress);
+ useV1TokenBinding = true;
+ }
+
+ if (pTokenBindingInfo == null && pTokenBindingInfo_V1 == null)
+ {
// The current request isn't over TLS or the client or server doesn't support the token binding
// protocol. This isn't an error; just return "nothing here".
return;
@@ -1075,13 +1085,35 @@ namespace System.Net {
UnsafeNclNativeMethods.HttpApi.HeapAllocHandle handle = null;
m_TokenBindingVerifyMessageStatus = -1;
- m_TokenBindingVerifyMessageStatus = UnsafeNclNativeMethods.HttpApi.TokenBindingVerifyMessage(
- pTokenBindingInfo->TokenBinding,
- pTokenBindingInfo->TokenBindingSize,
- pTokenBindingInfo->KeyType,
- pTokenBindingInfo->TlsUnique,
- pTokenBindingInfo->TlsUniqueSize,
- out handle);
+
+ fixed (byte* pMemoryBlob = RequestBuffer){
+ UnsafeNclNativeMethods.HttpApi.HTTP_REQUEST_V2* request = (UnsafeNclNativeMethods.HttpApi.HTTP_REQUEST_V2*)pMemoryBlob;
+ long fixup = pMemoryBlob - (byte*) OriginalBlobAddress;
+
+ if (useV1TokenBinding && pTokenBindingInfo_V1 != null)
+ {
+ // Old V1 Token Binding protocol is still being used, so we need to verify the binding message using the old API
+ m_TokenBindingVerifyMessageStatus = UnsafeNclNativeMethods.HttpApi.TokenBindingVerifyMessage_V1(
+ pTokenBindingInfo_V1->TokenBinding + fixup,
+ pTokenBindingInfo_V1->TokenBindingSize,
+ (IntPtr)((byte*)(pTokenBindingInfo_V1->KeyType) + fixup),
+ pTokenBindingInfo_V1->TlsUnique + fixup,
+ pTokenBindingInfo_V1->TlsUniqueSize,
+ out handle);
+ }
+ else
+ {
+ // Use the V2 token binding behavior
+ m_TokenBindingVerifyMessageStatus =
+ UnsafeNclNativeMethods.HttpApi.TokenBindingVerifyMessage(
+ pTokenBindingInfo->TokenBinding + fixup,
+ pTokenBindingInfo->TokenBindingSize,
+ pTokenBindingInfo->KeyType,
+ pTokenBindingInfo->TlsUnique + fixup,
+ pTokenBindingInfo->TlsUniqueSize,
+ out handle);
+ }
+ }
if (m_TokenBindingVerifyMessageStatus != 0)
{
@@ -1093,27 +1125,74 @@ namespace System.Net {
using (handle)
{
- UnsafeNclNativeMethods.HttpApi.TOKENBINDING_RESULT_LIST* pResultList = (UnsafeNclNativeMethods.HttpApi.TOKENBINDING_RESULT_LIST*)handle.DangerousGetHandle();
- for (int i = 0; i < pResultList->resultCount; i++)
+ // If we have an old binding, use the old binding behavior
+ if (useV1TokenBinding)
+ {
+ GenerateTokenBindings_V1(handle);
+ }
+ else
{
- UnsafeNclNativeMethods.HttpApi.TOKENBINDING_RESULT_DATA* pThisResultData = &pResultList->resultData[i];
+ GenerateTokenBindings(handle);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Method to allow current bindings to be returned
+ /// </summary>
+ /// <param name="handle"></param>
+ private void GenerateTokenBindings(UnsafeNclNativeMethods.HttpApi.HeapAllocHandle handle)
+ {
+ UnsafeNclNativeMethods.HttpApi.TOKENBINDING_RESULT_LIST* pResultList = (UnsafeNclNativeMethods.HttpApi.TOKENBINDING_RESULT_LIST*)handle.DangerousGetHandle();
+ for (int i = 0; i < pResultList->resultCount; i++)
+ {
+ UnsafeNclNativeMethods.HttpApi.TOKENBINDING_RESULT_DATA* pThisResultData = &pResultList->resultData[i];
- if (pThisResultData != null)
+ if (pThisResultData != null)
+ {
+ byte[] retVal = new byte[pThisResultData->identifierSize];
+ Marshal.Copy((IntPtr)(pThisResultData->identifierData), retVal, 0, retVal.Length);
+
+ if (pThisResultData->bindingType == UnsafeNclNativeMethods.HttpApi.TOKENBINDING_TYPE.TOKENBINDING_TYPE_PROVIDED)
+ {
+ m_TokenBindings.Add(new TokenBinding(TokenBindingType.Provided, retVal));
+ }
+ else if (pThisResultData->bindingType == UnsafeNclNativeMethods.HttpApi.TOKENBINDING_TYPE.TOKENBINDING_TYPE_REFERRED)
{
- // Per http://tools.ietf.org/html/draft-ietf-tokbind-protocol-00, Sec. 4,
- // We'll strip off the token binding type and return the remainder as an opaque blob.
- Debug.Assert((long)(&pThisResultData->identifierData->hashAlgorithm) == (long)(pThisResultData->identifierData) + 1);
- byte[] retVal = new byte[pThisResultData->identifierSize - 1];
- Marshal.Copy((IntPtr)(&pThisResultData->identifierData->hashAlgorithm), retVal, 0, retVal.Length);
+ m_TokenBindings.Add(new TokenBinding(TokenBindingType.Referred, retVal));
+ }
+ }
+ }
+ }
- if (pThisResultData->identifierData->bindingType == UnsafeNclNativeMethods.HttpApi.TOKENBINDING_TYPE.TOKENBINDING_TYPE_PROVIDED)
- {
- m_TokenBindings.Add(new TokenBinding(TokenBindingType.Provided, retVal));
- }
- else if (pThisResultData->identifierData->bindingType == UnsafeNclNativeMethods.HttpApi.TOKENBINDING_TYPE.TOKENBINDING_TYPE_REFERRED)
- {
- m_TokenBindings.Add(new TokenBinding(TokenBindingType.Referred, retVal));
- }
+ /// <summary>
+ /// Compat method to allow V1 bindings to be returned
+ /// </summary>
+ /// <param name="handle"></param>
+ private void GenerateTokenBindings_V1(UnsafeNclNativeMethods.HttpApi.HeapAllocHandle handle)
+ {
+ UnsafeNclNativeMethods.HttpApi.TOKENBINDING_RESULT_LIST_V1* pResultList = (UnsafeNclNativeMethods.HttpApi.TOKENBINDING_RESULT_LIST_V1*)handle.DangerousGetHandle();
+ for (int i = 0; i < pResultList->resultCount; i++)
+ {
+ UnsafeNclNativeMethods.HttpApi.TOKENBINDING_RESULT_DATA_V1* pThisResultData = &pResultList->resultData[i];
+
+ if (pThisResultData != null)
+ {
+ // Old V1 Token Binding protocol is still being used, so we need modify the binding message using the old behavior
+
+ // Per http://tools.ietf.org/html/draft-ietf-tokbind-protocol-00, Sec. 4,
+ // We'll strip off the token binding type and return the remainder as an opaque blob.
+ Debug.Assert((long)(&pThisResultData->identifierData->hashAlgorithm) == (long)(pThisResultData->identifierData) + 1 );
+ byte[] retVal = new byte[pThisResultData->identifierSize - 1];
+ Marshal.Copy((IntPtr)(&pThisResultData->identifierData->hashAlgorithm), retVal, 0, retVal.Length);
+
+ if (pThisResultData->identifierData->bindingType == UnsafeNclNativeMethods.HttpApi.TOKENBINDING_TYPE.TOKENBINDING_TYPE_PROVIDED)
+ {
+ m_TokenBindings.Add(new TokenBinding(TokenBindingType.Provided, retVal));
+ }
+ else if (pThisResultData->identifierData->bindingType == UnsafeNclNativeMethods.HttpApi.TOKENBINDING_TYPE.TOKENBINDING_TYPE_REFERRED)
+ {
+ m_TokenBindings.Add(new TokenBinding(TokenBindingType.Referred, retVal));
}
}
}
diff --git a/mcs/class/referencesource/System/net/System/Net/HttpWebRequest.cs b/mcs/class/referencesource/System/net/System/Net/HttpWebRequest.cs
index 7fe34ea4335..76e37ecea72 100644
--- a/mcs/class/referencesource/System/net/System/Net/HttpWebRequest.cs
+++ b/mcs/class/referencesource/System/net/System/Net/HttpWebRequest.cs
@@ -153,7 +153,7 @@ namespace System.Net {
// Used by our Connection to block on being able to Read from our Connection
private LazyAsyncResult _ConnectionReaderAResult;
- // Once set, the Request either works Async or [....] internally
+ // Once set, the Request either works Async or Sync internally
private TriState _RequestIsAsync;
// Delegate that can be called on Continue Response
@@ -406,7 +406,7 @@ namespace System.Net {
}
}
- // [....] code path only.
+ // Sync code path only.
// True if ProcessWriteCallDone Should read for an additional response.
// False if the 100Continue code will do the read in WriteHeaders.
internal bool NeedsToReadForResponse {
@@ -792,7 +792,7 @@ namespace System.Net {
}
// True, if the EndGetRequestStream or GetRequestStream call returned
- // codereview: Used ONLY by [....] code
+ // codereview: Used ONLY by Sync code
internal bool UserRetrievedWriteStream {
get {
return _WriteAResult != null && _WriteAResult.InternalPeekCompleted;
@@ -1555,7 +1555,7 @@ namespace System.Net {
CurrentMethod = _OriginVerb;
// Submit the Request, causes us to queue ourselves to a Connection and may block
- // It has happened that [....] path uses this loop the Retry memeber for handling resubmissions.
+ // It has happened that Sync path uses this loop the Retry memeber for handling resubmissions.
while (m_Retry && !_WriteAResult.InternalPeekCompleted) {
_OldSubmitWriteStream = null;
_SubmitWriteStream = null;
@@ -1825,7 +1825,7 @@ namespace System.Net {
{
GlobalLog.Print("HttpWebRequest#" + ValidationHelper.HashString(this) + "::DoSubmitRequestProcessing() resubmiting this request.");
- // Here is a little hack for [....] looping through BeginSubmitRequest.
+ // Here is a little hack for sync looping through BeginSubmitRequest.
// We want to unlock cache protocol only if this is NOT a retry.
if (CacheProtocol != null && _HttpResponse != null)
CacheProtocol.Reset();
@@ -1856,7 +1856,7 @@ namespace System.Net {
SubmitRequest(servicePoint);
}
else {
- // under [....] conditions, we let GetResponse() loop calling BeginSubmitRequest() until we're done
+ // under sync conditions, we let GetResponse() loop calling BeginSubmitRequest() until we're done
m_Retry = true;
}
result = HttpProcessingResult.WriteWait;
@@ -2181,7 +2181,7 @@ namespace System.Net {
Async = false;
- // Since we don't really allow switching between [....] and async, if the request is already async, this needs to
+ // Since we don't really allow switching between sync and async, if the request is already async, this needs to
// capture context for use in the ongoing async operations as if it were BeginGetResponse().
if (Async)
{
@@ -2206,7 +2206,7 @@ namespace System.Net {
if (!gotResponse)
{
- //The previous call may have been async. If we are now doing a [....] call, we should
+ //The previous call may have been async. If we are now doing a sync call, we should
//use the timeout
if (_Timer == null) {
_Timer = TimerQueue.CreateTimer(s_TimeoutCallback, this);
@@ -3369,7 +3369,7 @@ namespace System.Net {
//
// This line is needed ONLY if we got a connect failure (Abort can still happen at random time)
// CallDone will check for the write side response processing and this is what we want.
- // Note that [....] case already has a separate path to check for the response
+ // Note that Sync case already has a separate path to check for the response
//
if (Async && _CoreResponse != null && (object)_CoreResponse != (object)DBNull.Value)
{
@@ -3489,7 +3489,7 @@ namespace System.Net {
//
internal void CheckWriteSideResponseProcessing()
{
- // In [....] case never close the write side window
+ // In Sync case never close the write side window
// Definitions of _CoreResponse:
// - DBNull.Value - Uploading headers/body is in progress, but we haven't yet received a response.
@@ -3595,7 +3595,7 @@ namespace System.Net {
{
GlobalLog.Print("HttpWebRequest#" + ValidationHelper.HashString(this) + "::SetAndOrProcessResponse() - Write Thread will procees the response.");
//
- // Note for a [....] request a write side window is always open
+ // Note for a sync request a write side window is always open
//
if (!Async)
{
@@ -3991,7 +3991,7 @@ namespace System.Net {
}
}
- // Return null only on [....] (if we're on the [....] thread). Otherwise throw if no context is available.
+ // Return null only on Sync (if we're on the Sync thread). Otherwise throw if no context is available.
internal override ContextAwareResult GetConnectingContext()
{
if (!Async)
@@ -4014,7 +4014,7 @@ namespace System.Net {
return context;
}
- // Return null only on [....] (if we're on the [....] thread). Otherwise throw if no context is available.
+ // Return null only on Sync (if we're on the Sync thread). Otherwise throw if no context is available.
internal override ContextAwareResult GetWritingContext()
{
if (!Async)
@@ -4039,7 +4039,7 @@ namespace System.Net {
return context;
}
- // Return null only on [....] (if we're on the [....] thread). Otherwise throw if no context is available.
+ // Return null only on Sync (if we're on the Sync thread). Otherwise throw if no context is available.
internal override ContextAwareResult GetReadingContext()
{
if (!Async)
@@ -6025,12 +6025,12 @@ namespace System.Net {
// The second NTLM request is required to use the same connection, don't close it
if (ntlmFollowupRequest) {
- // We only want CallDone to do a [....] read now if 100Continue won't later
+ // We only want CallDone to do a sync read now if 100Continue won't later
NeedsToReadForResponse = !ShouldWaitFor100Continue();
_SubmitWriteStream.CallDone();
}
else if (!AllowWriteStreamBuffering) {
- // We only want CloseInternal to do a [....] read now if 100Continue won't later
+ // We only want CloseInternal to do a sync read now if 100Continue won't later
NeedsToReadForResponse = !ShouldWaitFor100Continue();
_SubmitWriteStream.CloseInternal(true);
}
@@ -6094,7 +6094,7 @@ namespace System.Net {
// Never throws
//
private Stream MakeMemoryStream(Stream stream) {
- // GlobalLog.ThreadContract(ThreadKinds.[....], "HttpWebRequest#" + ValidationHelper.HashString(this) + "::MakeMemoryStream");
+ // GlobalLog.ThreadContract(ThreadKinds.Sync, "HttpWebRequest#" + ValidationHelper.HashString(this) + "::MakeMemoryStream");
if (stream == null || stream is SyncMemoryStream)
return stream;
diff --git a/mcs/class/referencesource/System/net/System/Net/Internal.cs b/mcs/class/referencesource/System/net/System/Net/Internal.cs
index 16018faf77c..9ca1b3527cb 100644
--- a/mcs/class/referencesource/System/net/System/Net/Internal.cs
+++ b/mcs/class/referencesource/System/net/System/Net/Internal.cs
@@ -446,7 +446,7 @@ namespace System.Net {
}
//
- // A simple [....] point, useful for deferring work. Just an int value with helper methods.
+ // A simple sync point, useful for deferring work. Just an int value with helper methods.
// This is used by HttpWebRequest to syncronize Reads/Writes while waiting for a 100-Continue response.
//
internal struct InterlockedGate
diff --git a/mcs/class/referencesource/System/net/System/Net/SecureProtocols/NegotiateStream.cs b/mcs/class/referencesource/System/net/System/Net/SecureProtocols/NegotiateStream.cs
index 4cd3b383374..511cae21a80 100644
--- a/mcs/class/referencesource/System/net/System/Net/SecureProtocols/NegotiateStream.cs
+++ b/mcs/class/referencesource/System/net/System/Net/SecureProtocols/NegotiateStream.cs
@@ -93,7 +93,7 @@ using System.Security.Principal;
TokenImpersonationLevel allowedImpersonationLevel)
{
#if DEBUG
- using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.[....])) {
+ using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.Sync)) {
#endif
_NegoState.ValidateCreateContext(_Package, false, credential, targetName, binding, requiredProtectionLevel, allowedImpersonationLevel);
_NegoState.ProcessAuthentication(null);
@@ -199,7 +199,7 @@ using System.Security.Principal;
TokenImpersonationLevel requiredImpersonationLevel)
{
#if DEBUG
- using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.[....])) {
+ using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.Sync)) {
#endif
_NegoState.ValidateCreateContext(_Package, credential, string.Empty, policy, requiredProtectionLevel, requiredImpersonationLevel);
@@ -503,7 +503,7 @@ using System.Security.Principal;
// Should this not block?
public override void Flush() {
#if DEBUG
- using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.[....])) {
+ using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.Sync)) {
#endif
InnerStream.Flush();
#if DEBUG
@@ -531,7 +531,7 @@ using System.Security.Principal;
public override int Read(byte[] buffer, int offset, int count)
{
#if DEBUG
- using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.[....])) {
+ using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.Sync)) {
#endif
_NegoState.CheckThrow(true);
@@ -548,7 +548,7 @@ using System.Security.Principal;
public override void Write(byte[] buffer, int offset, int count)
{
#if DEBUG
- using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.[....])) {
+ using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.Sync)) {
#endif
_NegoState.CheckThrow(true);
diff --git a/mcs/class/referencesource/System/net/System/Net/SecureProtocols/SslEnumTypes.cs b/mcs/class/referencesource/System/net/System/Net/SecureProtocols/SslEnumTypes.cs
index 9d40acc751a..b88c44c2b27 100644
--- a/mcs/class/referencesource/System/net/System/Net/SecureProtocols/SslEnumTypes.cs
+++ b/mcs/class/referencesource/System/net/System/Net/SecureProtocols/SslEnumTypes.cs
@@ -76,7 +76,13 @@ using System.Net;
Md5 = (Alg.ClassHash | Alg.Any | Alg.NameMD5),
- Sha1 = (Alg.ClassHash | Alg.Any | Alg.NameSHA)
+ Sha1 = (Alg.ClassHash | Alg.Any | Alg.NameSHA),
+
+ Sha256 = (Alg.ClassHash | Alg.Any | Alg.NameSHA256),
+
+ Sha384 = (Alg.ClassHash | Alg.Any | Alg.NameSHA384),
+
+ Sha512 = (Alg.ClassHash | Alg.Any | Alg.NameSHA512)
}
}
diff --git a/mcs/class/referencesource/System/net/System/Net/SecureProtocols/SslStream.cs b/mcs/class/referencesource/System/net/System/Net/SecureProtocols/SslStream.cs
index 63954ba3ccd..49b08b7a326 100644
--- a/mcs/class/referencesource/System/net/System/Net/SecureProtocols/SslStream.cs
+++ b/mcs/class/referencesource/System/net/System/Net/SecureProtocols/SslStream.cs
@@ -120,24 +120,19 @@ using System.Net.Configuration;
return _userCertificateSelectionCallback(this, targetHost, localCertificates, remoteCertificate, acceptableIssuers);
}
- private SslProtocols DefaultProtocols()
- {
- SslProtocols protocols = SslProtocols.Tls12 | SslProtocols.Tls11 | SslProtocols.Tls;
- if (ServicePointManager.DisableStrongCrypto)
- {
- protocols = SslProtocols.Tls | SslProtocols.Ssl3;
- }
-
- return protocols;
- }
-
//
// Client side auth
//
public virtual void AuthenticateAsClient(string targetHost)
{
- AuthenticateAsClient(targetHost, new X509CertificateCollection(), DefaultProtocols(), false);
+ AuthenticateAsClient(targetHost, new X509CertificateCollection(), ServicePointManager.DefaultSslProtocols, false);
}
+
+ public virtual void AuthenticateAsClient(string targetHost, X509CertificateCollection clientCertificates, bool checkCertificateRevocation)
+ {
+ AuthenticateAsClient(targetHost, clientCertificates, ServicePointManager.DefaultSslProtocols, false);
+ }
+
//
public virtual void AuthenticateAsClient(string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
{
@@ -150,9 +145,18 @@ using System.Net.Configuration;
[HostProtection(ExternalThreading=true)]
public virtual IAsyncResult BeginAuthenticateAsClient(string targetHost, AsyncCallback asyncCallback, object asyncState)
{
- return BeginAuthenticateAsClient(targetHost, new X509CertificateCollection(), DefaultProtocols(), false,
+ return BeginAuthenticateAsClient(targetHost, new X509CertificateCollection(), ServicePointManager.DefaultSslProtocols, false,
asyncCallback, asyncState);
}
+
+ [HostProtection(ExternalThreading = true)]
+ public virtual IAsyncResult BeginAuthenticateAsClient(string targetHost, X509CertificateCollection clientCertificates,
+ bool checkCertificateRevocation, AsyncCallback asyncCallback,
+ object asyncState)
+ {
+ return BeginAuthenticateAsClient(targetHost, clientCertificates, ServicePointManager.DefaultSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
+ }
+
//
[HostProtection(ExternalThreading=true)]
@@ -168,7 +172,6 @@ using System.Net.Configuration;
}
//
-
public virtual void EndAuthenticateAsClient(IAsyncResult asyncResult)
{
_SslState.EndProcessAuthentication(asyncResult);
@@ -181,8 +184,15 @@ using System.Net.Configuration;
//
public virtual void AuthenticateAsServer(X509Certificate serverCertificate)
{
- AuthenticateAsServer(serverCertificate, false, DefaultProtocols(), false);
+ AuthenticateAsServer(serverCertificate, false, ServicePointManager.DefaultSslProtocols, false);
}
+
+ public virtual void AuthenticateAsServer(X509Certificate serverCertificate, bool clientCertificateRequired,
+ bool checkCertificateRevocation)
+ {
+ AuthenticateAsServer(serverCertificate, clientCertificateRequired, ServicePointManager.DefaultSslProtocols, checkCertificateRevocation);
+ }
+
//
public virtual void AuthenticateAsServer(X509Certificate serverCertificate, bool clientCertificateRequired,
SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
@@ -196,10 +206,19 @@ using System.Net.Configuration;
{
- return BeginAuthenticateAsServer(serverCertificate, false, DefaultProtocols(), false,
+ return BeginAuthenticateAsServer(serverCertificate, false, ServicePointManager.DefaultSslProtocols, false,
asyncCallback,
asyncState);
}
+
+ [HostProtection(ExternalThreading = true)]
+ public virtual IAsyncResult BeginAuthenticateAsServer(X509Certificate serverCertificate, bool clientCertificateRequired,
+ bool checkCertificateRevocation, AsyncCallback asyncCallback,
+ object asyncState)
+ {
+ return BeginAuthenticateAsServer(serverCertificate, clientCertificateRequired, ServicePointManager.DefaultSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
+ }
+
//
[HostProtection(ExternalThreading=true)]
public virtual IAsyncResult BeginAuthenticateAsServer(X509Certificate serverCertificate, bool clientCertificateRequired,
@@ -219,6 +238,16 @@ using System.Net.Configuration;
_SslState.EndProcessAuthentication(asyncResult);
}
+ internal virtual IAsyncResult BeginShutdown(AsyncCallback asyncCallback, object asyncState)
+ {
+ return _SslState.BeginShutdown(asyncCallback, asyncState);
+ }
+
+ internal virtual void EndShutdown(IAsyncResult asyncResult)
+ {
+ _SslState.EndShutdown(asyncResult);
+ }
+
public TransportContext TransportContext
{
get
@@ -244,6 +273,12 @@ using System.Net.Configuration;
}
[HostProtection(ExternalThreading = true)]
+ public virtual Task AuthenticateAsClientAsync(string targetHost, X509CertificateCollection clientCertificates, bool checkCertificateRevocation)
+ {
+ return AuthenticateAsClientAsync(targetHost, clientCertificates, ServicePointManager.DefaultSslProtocols, checkCertificateRevocation);
+ }
+
+ [HostProtection(ExternalThreading = true)]
public virtual Task AuthenticateAsClientAsync(string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
{
return Task.Factory.FromAsync((callback, state) => BeginAuthenticateAsClient(targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation, callback, state), EndAuthenticateAsClient, null);
@@ -256,11 +291,25 @@ using System.Net.Configuration;
}
[HostProtection(ExternalThreading = true)]
+ public virtual Task AuthenticateAsServerAsync(X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation)
+ {
+ return AuthenticateAsServerAsync(serverCertificate, clientCertificateRequired, ServicePointManager.DefaultSslProtocols, checkCertificateRevocation);
+ }
+
+ [HostProtection(ExternalThreading = true)]
public virtual Task AuthenticateAsServerAsync(X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
{
return Task.Factory.FromAsync((callback, state) => BeginAuthenticateAsServer(serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation, callback, state), EndAuthenticateAsServer, null);
}
+ [HostProtection(ExternalThreading = true)]
+ public virtual Task ShutdownAsync()
+ {
+ return Task.Factory.FromAsync(
+ (callback, state) => BeginShutdown(callback, state),
+ EndShutdown,
+ null);
+ }
//
//
@@ -393,7 +442,7 @@ using System.Net.Configuration;
//
public override bool CanWrite {
get {
- return _SslState.IsAuthenticated && InnerStream.CanWrite;
+ return _SslState.IsAuthenticated && InnerStream.CanWrite && !_SslState.IsShutdown;
}
}
//
diff --git a/mcs/class/referencesource/System/net/System/Net/SecureProtocols/_FixedSizeReader.cs b/mcs/class/referencesource/System/net/System/Net/SecureProtocols/_FixedSizeReader.cs
index db9d6aff13d..2d676f9fa12 100644
--- a/mcs/class/referencesource/System/net/System/Net/SecureProtocols/_FixedSizeReader.cs
+++ b/mcs/class/referencesource/System/net/System/Net/SecureProtocols/_FixedSizeReader.cs
@@ -8,7 +8,7 @@ Module Name:
Abstract:
The class is a simple wrapper on top of a read stream.
It will read the exact number of bytes requested.
- It operates either [....] or async.
+ It operates either sync or async.
Author:
@@ -76,7 +76,7 @@ namespace System.Net {
StartReading();
}
//
- // Loops while subsequest completions are [....]
+ // Loops while subsequest completions are sync
//
private void StartReading()
{
diff --git a/mcs/class/referencesource/System/net/System/Net/SecureProtocols/_NegoStream.cs b/mcs/class/referencesource/System/net/System/Net/SecureProtocols/_NegoStream.cs
index b8e698f07ed..91311238e9e 100644
--- a/mcs/class/referencesource/System/net/System/Net/SecureProtocols/_NegoStream.cs
+++ b/mcs/class/referencesource/System/net/System/Net/SecureProtocols/_NegoStream.cs
@@ -117,7 +117,7 @@ namespace System.Net.Security {
throw new ArgumentOutOfRangeException("count", SR.GetString(SR.net_offset_plus_count));
}
//
- // Combined [....]/async write method. For [....] requet asyncRequest==null
+ // Combined sync/async write method. For sync requet asyncRequest==null
//
private void ProcessWrite(byte[] buffer, int offset, int count, AsyncProtocolRequest asyncRequest)
{
@@ -198,9 +198,9 @@ namespace System.Net.Security {
}
}
//
- // Combined [....]/async read method. For [....] requet asyncRequest==null
- // There is a little overheader because we need to pass buffer/offset/count used only in [....].
- // Still the benefit is that we have a common [....]/async code path.
+ // Combined sync/async read method. For sync requet asyncRequest==null
+ // There is a little overheader because we need to pass buffer/offset/count used only in sync.
+ // Still the benefit is that we have a common sync/async code path.
//
private int ProcessRead(byte[] buffer, int offset, int count, AsyncProtocolRequest asyncRequest)
{
@@ -240,7 +240,7 @@ namespace System.Net.Security {
}
finally
{
- // if [....] request or exception
+ // if sync request or exception
if (asyncRequest == null || failed)
{
_NestedRead = 0;
@@ -330,7 +330,7 @@ namespace System.Net.Security {
}
readBytes = asyncRequest.Result;
}
- else //[....]
+ else //Sync
{
readBytes = _FrameReader.ReadPacket(InternalBuffer, 0, readBytes);
}
diff --git a/mcs/class/referencesource/System/net/System/Net/SecureProtocols/_SslState.cs b/mcs/class/referencesource/System/net/System/Net/SecureProtocols/_SslState.cs
index b5488d4a299..96d0345ee24 100644
--- a/mcs/class/referencesource/System/net/System/Net/SecureProtocols/_SslState.cs
+++ b/mcs/class/referencesource/System/net/System/Net/SecureProtocols/_SslState.cs
@@ -16,7 +16,7 @@ Author:
Revision History:
22-Aug-2003 Adopted for new Ssl feature design.
- 15-Sept-2003 Implemented concurent rehanshake
+ 15-Sept-2003 Implemented concurrent rehanshake
--*/
#if MONO_FEATURE_NEW_TLS && SECURITY_DEP
@@ -59,6 +59,7 @@ namespace System.Net.Security {
private bool _HandshakeCompleted;
private bool _CertValidationFailed;
+ private bool _Shutdown;
private SecurityStatus _SecurityStatus;
private Exception _Exception;
@@ -71,7 +72,7 @@ namespace System.Net.Security {
}
private CachedSessionStatus _CachedSession;
- // This block is used by rehandshake code to buffer data decryptred with the old key
+ // This block is used by rehandshake code to buffer data decrypted with the old key
private byte[] _QueuedReadData;
private int _QueuedReadCount;
private int _PendingReHandshake;
@@ -144,8 +145,8 @@ namespace System.Net.Security {
{
//
- // We don;t support SSL alerts right now, hence any exception is fatal and cannot be retried
- // Consider: make use if SSL alerts to re-[....] SslStream on both sides for retrying.
+ // We don't support SSL alerts right now, hence any exception is fatal and cannot be retried
+ // Consider: make use if SSL alerts to re-sync SslStream on both sides for retrying.
//
if (_Exception != null && !_CanRetryAuthentication) {
throw _Exception;
@@ -163,7 +164,6 @@ namespace System.Net.Security {
throw new ArgumentNullException("targetHost");
}
-
if (isServer ) {
enabledSslProtocols &= (SslProtocols)SchProtocols.ServerMask;
if (serverCertificate == null)
@@ -173,7 +173,7 @@ namespace System.Net.Security {
enabledSslProtocols &= (SslProtocols)SchProtocols.ClientMask;
}
- if ((int)enabledSslProtocols == 0) {
+ if (ServicePointManager.DisableSystemDefaultTlsVersions && ((int)enabledSslProtocols == 0)) {
throw new ArgumentException(SR.GetString(SR.net_invalid_enum, "SslProtocolType"), "sslProtocolType");
}
@@ -281,6 +281,14 @@ namespace System.Net.Security {
}
}
//
+ internal bool IsShutdown
+ {
+ get
+ {
+ return _Shutdown;
+ }
+ }
+ //
internal bool DataAvailable {
get {
return IsAuthenticated && (SecureStream.DataAvailable || _QueuedReadCount != 0);
@@ -455,14 +463,19 @@ namespace System.Net.Security {
//
//
- //
- internal void CheckThrow(bool authSucessCheck) {
+ //
+ internal void CheckThrow(bool authSuccessCheck, bool shutdownCheck = false) {
if (_Exception != null) {
throw _Exception;
}
- if (authSucessCheck && !IsAuthenticated) {
+
+ if (authSuccessCheck && !IsAuthenticated) {
throw new InvalidOperationException(SR.GetString(SR.net_auth_noauth));
}
+
+ if (shutdownCheck && _Shutdown && !LocalAppContextSwitches.DontEnableTlsAlerts) {
+ throw new InvalidOperationException(SR.net_ssl_io_already_shutdown);
+ }
}
//
internal void Flush()
@@ -648,7 +661,7 @@ namespace System.Net.Security {
// Async handshake is enqueued and will resume later
return;
}
- // Either [....] handshake is ready to go or async handshake won the ---- over write.
+ // Either Sync handshake is ready to go or async handshake won the ---- over write.
// This will tell that we don't know the framing yet (what SSL version is)
_Framing = Framing.None;
@@ -807,11 +820,14 @@ namespace System.Net.Security {
}
else if (message.Done && _PendingReHandshake == 0)
{
- if (!CompleteHandshake())
+ ProtocolToken alertToken = null;
+
+ if (!CompleteHandshake(ref alertToken))
{
- StartSendAuthResetSignal(null, asyncRequest, new AuthenticationException(SR.GetString(SR.net_ssl_io_cert_validation), null));
+ StartSendAuthResetSignal(alertToken, asyncRequest, new AuthenticationException(SR.GetString(SR.net_ssl_io_cert_validation), null));
return;
}
+
// Release waiting IO if any. Presumably it should not throw.
// Otheriwse application may get not expected type of the exception.
FinishHandshake(null, asyncRequest);
@@ -992,11 +1008,11 @@ namespace System.Net.Security {
//
// - Returns false if failed to verify the Remote Cert
//
- private bool CompleteHandshake() {
+ private bool CompleteHandshake(ref ProtocolToken alertToken) {
GlobalLog.Enter("CompleteHandshake");
Context.ProcessHandshakeSuccess();
- if (!Context.VerifyRemoteCertificate(_CertValidationDelegate))
+ if (!Context.VerifyRemoteCertificate(_CertValidationDelegate, ref alertToken))
{
_HandshakeCompleted = false;
_CertValidationFailed = true;
@@ -1315,7 +1331,7 @@ namespace System.Net.Security {
_QueuedWriteStateRequest = null;
if (obj is LazyAsyncResult)
{
- // [....] handshake is waiting on other thread.
+ // sync handshake is waiting on other thread.
((LazyAsyncResult)obj).InvokeCallback();
}
else
@@ -1326,6 +1342,23 @@ namespace System.Net.Security {
}
}
}
+
+ internal IAsyncResult BeginShutdown(AsyncCallback asyncCallback, object asyncState)
+ {
+ CheckThrow(authSuccessCheck: true, shutdownCheck: true);
+
+ ProtocolToken message = Context.CreateShutdownToken();
+ return InnerStream.BeginWrite(message.Payload, 0, message.Payload.Length, asyncCallback, asyncState);
+ }
+
+ internal void EndShutdown(IAsyncResult result)
+ {
+ CheckThrow(authSuccessCheck: true, shutdownCheck: true);
+
+ InnerStream.EndWrite(result);
+ _Shutdown = true;
+ }
+
// true - operation queued
// false - operation can proceed
private bool CheckEnqueueHandshake(byte[] buffer, AsyncProtocolRequest asyncRequest)
@@ -1391,7 +1424,7 @@ namespace System.Net.Security {
if (obj is LazyAsyncResult)
{
- // [....] write is waiting on other thread.
+ // sync write is waiting on other thread.
((LazyAsyncResult)obj).InvokeCallback();
}
else
@@ -1750,7 +1783,7 @@ namespace System.Net.Security {
FinishHandshake(exception, null);
}
}
-
+
#if TRAVE
[System.Diagnostics.Conditional("TRAVE")]
internal void DebugMembers() {
diff --git a/mcs/class/referencesource/System/net/System/Net/SecureProtocols/_SslStream.cs b/mcs/class/referencesource/System/net/System/Net/SecureProtocols/_SslStream.cs
index 4ac07c5d5c0..2e44febf85e 100644
--- a/mcs/class/referencesource/System/net/System/Net/SecureProtocols/_SslStream.cs
+++ b/mcs/class/referencesource/System/net/System/Net/SecureProtocols/_SslStream.cs
@@ -315,10 +315,12 @@ namespace System.Net.Security {
throw new ArgumentOutOfRangeException("count", SR.GetString(SR.net_offset_plus_count));
}
//
- // Combined [....]/async write method. For [....] case asyncRequest==null
+ // Combined sync/async write method. For sync case asyncRequest==null
//
private void ProcessWrite(BufferOffsetSize[] buffers, SplitWriteAsyncProtocolRequest asyncRequest)
{
+ _SslState.CheckThrow(authSuccessCheck: true, shutdownCheck: true);
+
foreach (BufferOffsetSize buffer in buffers)
{
ValidateParameters(buffer.Buffer, buffer.Offset, buffer.Size);
@@ -357,7 +359,7 @@ namespace System.Net.Security {
}
}
//
- // Combined [....]/async write method. For [....] case asyncRequest==null
+ // Combined sync/async write method. For sync case asyncRequest==null
//
private void ProcessWrite(byte[] buffer, int offset, int count, AsyncProtocolRequest asyncRequest)
{
@@ -376,6 +378,7 @@ namespace System.Net.Security {
}
ValidateParameters(buffer, offset, count);
+ _SslState.CheckThrow(authSuccessCheck: true, shutdownCheck: true);
if (Interlocked.Exchange(ref _NestedWrite, 1) == 1)
{
@@ -634,9 +637,9 @@ namespace System.Net.Security {
}
//
- // Combined [....]/async read method. For [....] requet asyncRequest==null
- // There is a little overheader because we need to pass buffer/offset/count used only in [....].
- // Still the benefit is that we have a common [....]/async code path.
+ // Combined sync/async read method. For sync requet asyncRequest==null
+ // There is a little overheader because we need to pass buffer/offset/count used only in sync.
+ // Still the benefit is that we have a common sync/async code path.
//
private int ProcessRead(byte[] buffer, int offset, int count, AsyncProtocolRequest asyncRequest)
{
@@ -678,7 +681,7 @@ namespace System.Net.Security {
}
finally
{
- // if [....] request or exception
+ // if sync request or exception
if (asyncRequest == null || failed)
{
_NestedRead = 0;
@@ -793,7 +796,7 @@ namespace System.Net.Security {
}
readBytes = asyncRequest.Result;
}
- else //[....]
+ else //Sync
{
readBytes = _Reader.ReadPacket(InternalBuffer, SecureChannel.ReadHeaderSize, readBytes);
}
diff --git a/mcs/class/referencesource/System/net/System/Net/ServicePoint.cs b/mcs/class/referencesource/System/net/System/Net/ServicePoint.cs
index fda7b1632e8..74ec0276739 100644
--- a/mcs/class/referencesource/System/net/System/Net/ServicePoint.cs
+++ b/mcs/class/referencesource/System/net/System/Net/ServicePoint.cs
@@ -253,7 +253,7 @@ namespace System.Net {
abortSocket6 = socket6;
//
- // Setup socket timeouts for [....] requests
+ // Setup socket timeouts for sync requests
//
//
diff --git a/mcs/class/referencesource/System/net/System/Net/ServicePointManager.cs b/mcs/class/referencesource/System/net/System/Net/ServicePointManager.cs
index 3de63c914d6..c1f4baea842 100644
--- a/mcs/class/referencesource/System/net/System/Net/ServicePointManager.cs
+++ b/mcs/class/referencesource/System/net/System/Net/ServicePointManager.cs
@@ -3,195 +3,18 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
-
+#if MONO_FEATURE_WEB_STACK
namespace System.Net {
+ using Diagnostics;
using System.Collections;
- using System.Collections.Generic;
- using System.Configuration;
- using System.IO;
+ using System.Diagnostics.CodeAnalysis;
+ using System.Globalization;
using System.Net.Configuration;
- using System.Net.Sockets;
using System.Net.Security;
- using System.Security;
- using System.Security.Permissions;
- using System.Security.Cryptography.X509Certificates;
- using System.Threading;
- using System.Globalization;
using System.Runtime.CompilerServices;
- using System.Diagnostics.CodeAnalysis;
- using Microsoft.Win32;
-
- // This turned to be a legacy type name that is simply forwarded to System.Security.Authentication.SslProtocols defined values.
-#if !FEATURE_PAL || MONO
- [Flags]
- public enum SecurityProtocolType
- {
- Ssl3 = System.Security.Authentication.SslProtocols.Ssl3,
- Tls = System.Security.Authentication.SslProtocols.Tls,
- Tls11 = System.Security.Authentication.SslProtocols.Tls11,
- Tls12 = System.Security.Authentication.SslProtocols.Tls12,
- }
-#endif
-#if !MONO && !FEATURE_PAL
- internal class CertPolicyValidationCallback
- {
- readonly ICertificatePolicy m_CertificatePolicy;
- readonly ExecutionContext m_Context;
-
- internal CertPolicyValidationCallback()
- {
- m_CertificatePolicy = new DefaultCertPolicy();
- m_Context = null;
- }
-
- internal CertPolicyValidationCallback(ICertificatePolicy certificatePolicy)
- {
- m_CertificatePolicy = certificatePolicy;
- m_Context = ExecutionContext.Capture();
- }
-
- internal ICertificatePolicy CertificatePolicy {
- get { return m_CertificatePolicy;}
- }
-
- internal bool UsesDefault {
- get { return m_Context == null;}
- }
-
- internal void Callback(object state)
- {
- CallbackContext context = (CallbackContext) state;
- context.result = context.policyWrapper.CheckErrors(context.hostName,
- context.certificate,
- context.chain,
- context.sslPolicyErrors);
- }
-
- internal bool Invoke(string hostName,
- ServicePoint servicePoint,
- X509Certificate certificate,
- WebRequest request,
- X509Chain chain,
- SslPolicyErrors sslPolicyErrors)
- {
- PolicyWrapper policyWrapper = new PolicyWrapper(m_CertificatePolicy,
- servicePoint,
- (WebRequest) request);
-
- if (m_Context == null)
- {
- return policyWrapper.CheckErrors(hostName,
- certificate,
- chain,
- sslPolicyErrors);
- }
- else
- {
- ExecutionContext execContext = m_Context.CreateCopy();
- CallbackContext callbackContext = new CallbackContext(policyWrapper,
- hostName,
- certificate,
- chain,
- sslPolicyErrors);
- ExecutionContext.Run(execContext, Callback, callbackContext);
- return callbackContext.result;
- }
- }
-
- private class CallbackContext
- {
- internal CallbackContext(PolicyWrapper policyWrapper,
- string hostName,
- X509Certificate certificate,
- X509Chain chain,
- SslPolicyErrors sslPolicyErrors)
- {
- this.policyWrapper = policyWrapper;
- this.hostName = hostName;
- this.certificate = certificate;
- this.chain = chain;
- this.sslPolicyErrors = sslPolicyErrors;
- }
-
- internal readonly PolicyWrapper policyWrapper;
- internal readonly string hostName;
- internal readonly X509Certificate certificate;
- internal readonly X509Chain chain;
- internal readonly SslPolicyErrors sslPolicyErrors;
-
- internal bool result;
- }
- }
-#elif MONO || !FEATURE_PAL
- internal class ServerCertValidationCallback
- {
- readonly RemoteCertificateValidationCallback m_ValidationCallback;
- readonly ExecutionContext m_Context;
-
- internal ServerCertValidationCallback(RemoteCertificateValidationCallback validationCallback)
- {
- m_ValidationCallback = validationCallback;
- m_Context = ExecutionContext.Capture();
- }
-
- internal RemoteCertificateValidationCallback ValidationCallback {
- get { return m_ValidationCallback;}
- }
-
- internal void Callback(object state)
- {
- CallbackContext context = (CallbackContext) state;
- context.result = m_ValidationCallback(context.request,
- context.certificate,
- context.chain,
- context.sslPolicyErrors);
- }
-
- internal bool Invoke(object request,
- X509Certificate certificate,
- X509Chain chain,
- SslPolicyErrors sslPolicyErrors)
- {
- if (m_Context == null)
- {
- return m_ValidationCallback(request, certificate, chain, sslPolicyErrors);
- }
- else
- {
- ExecutionContext execContext = m_Context.CreateCopy();
- CallbackContext callbackContext = new CallbackContext(request,
- certificate,
- chain,
- sslPolicyErrors);
- ExecutionContext.Run(execContext, Callback, callbackContext);
- return callbackContext.result;
- }
- }
-
- private class CallbackContext
- {
- internal readonly Object request;
- internal readonly X509Certificate certificate;
- internal readonly X509Chain chain;
- internal readonly SslPolicyErrors sslPolicyErrors;
-
- internal bool result;
-
- internal CallbackContext(Object request,
- X509Certificate certificate,
- X509Chain chain,
- SslPolicyErrors sslPolicyErrors)
- {
- this.request = request;
- this.certificate = certificate;
- this.chain = chain;
- this.sslPolicyErrors = sslPolicyErrors;
- }
- }
- }
-#endif // !FEATURE_PAL
+ using System.Security.Authentication;
+ using System.Threading;
-#if MONO_FEATURE_WEB_STACK
//
// The ServicePointManager class hands out ServicePoints (may exist or be created
// as needed) and makes sure they are garbage collected when they expire.
@@ -202,7 +25,7 @@ namespace System.Net {
/// <para>Manages the collection of <see cref='System.Net.ServicePoint'/> instances.</para>
/// </devdoc>
///
- public class ServicePointManager {
+ public partial class ServicePointManager {
/// <devdoc>
/// <para>
@@ -247,24 +70,18 @@ namespace System.Net {
private static volatile CertPolicyValidationCallback s_CertPolicyValidationCallback = new CertPolicyValidationCallback();
private static volatile ServerCertValidationCallback s_ServerCertValidationCallback = null;
- private const string sendAuxRecordValueName = "SchSendAuxRecord";
- private const string sendAuxRecordAppSetting = "System.Net.ServicePointManager.SchSendAuxRecord";
- private const string strongCryptoValueName = "SchUseStrongCrypto";
- private const string secureProtocolAppSetting = "System.Net.ServicePointManager.SecurityProtocol";
+ private static SecurityProtocolType s_SecurityProtocolType;
- private static object configurationLoadedLock = new object();
- private static volatile bool configurationLoaded = false;
- private static bool disableStrongCrypto = false;
- private static bool disableSendAuxRecord = false;
+ private static bool s_reusePort;
+ private static bool? s_reusePortSupported = null;
- private static SecurityProtocolType s_SecurityProtocolType = SecurityProtocolType.Tls | SecurityProtocolType.Ssl3;
+ private static bool s_disableStrongCrypto;
+ private static bool s_disableSendAuxRecord;
+ private static bool s_disableSystemDefaultTlsVersions;
+ private static SslProtocols s_defaultSslProtocols;
- private const string reusePortValueName = "HWRPortReuseOnSocketBind";
- private static object reusePortLock = new object();
- private static volatile bool reusePortSettingsInitialized = false;
- private static bool reusePort = false;
- private static bool? reusePortSupported = null;
#endif // !FEATURE_PAL
+
private static volatile Hashtable s_ConfigTable = null;
private static volatile int s_ConnectionLimit = PersistentConnectionLimit;
@@ -442,10 +259,16 @@ namespace System.Net {
private static void ValidateSecurityProtocol(SecurityProtocolType value)
{
- // Do not allow Ssl2 (and others) as explicit SSL version request
+ // Do not allow Ssl2 (and others) as explicit SSL version request.
SecurityProtocolType allowed = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls
| SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
+ Debug.Assert((int)SecurityProtocolType.SystemDefault == (int)SslProtocols.None);
+ Debug.Assert((int)SecurityProtocolType.Ssl3 == (int)SslProtocols.Ssl3);
+ Debug.Assert((int)SecurityProtocolType.Tls == (int)SslProtocols.Tls);
+ Debug.Assert((int)SecurityProtocolType.Tls11 == (int)SslProtocols.Tls11);
+ Debug.Assert((int)SecurityProtocolType.Tls12 == (int)SslProtocols.Tls12);
+
if ((value & ~allowed) != 0)
{
throw new NotSupportedException(SR.GetString(SR.net_securityprotocolnotsupported));
@@ -453,6 +276,42 @@ namespace System.Net {
}
#endif // !FEATURE_PAL
+ internal static bool DisableStrongCrypto
+ {
+ get
+ {
+ EnsureConfigurationLoaded();
+ return s_disableStrongCrypto;
+ }
+ }
+
+ internal static bool DisableSystemDefaultTlsVersions
+ {
+ get
+ {
+ EnsureConfigurationLoaded();
+ return s_disableSystemDefaultTlsVersions;
+ }
+ }
+
+ internal static bool DisableSendAuxRecord
+ {
+ get
+ {
+ EnsureConfigurationLoaded();
+ return s_disableSendAuxRecord;
+ }
+ }
+
+ internal static SslProtocols DefaultSslProtocols
+ {
+ get
+ {
+ EnsureConfigurationLoaded();
+ return s_defaultSslProtocols;
+ }
+ }
+
//
// accessors
//
@@ -641,171 +500,24 @@ namespace System.Net {
}
}
- internal static bool DisableStrongCrypto {
- get {
- EnsureConfigurationLoaded();
- return disableStrongCrypto;
- }
- }
-
- internal static bool DisableSendAuxRecord {
- get {
- EnsureConfigurationLoaded();
- return disableSendAuxRecord;
- }
- }
-
- private static void EnsureConfigurationLoaded() {
- if (configurationLoaded) {
- return;
- }
-
- lock (configurationLoadedLock) {
- if (configurationLoaded) {
- return;
- }
-
- LoadDisableStrongCryptoConfiguration();
- LoadDisableSendAuxRecordConfiguration();
-
- configurationLoaded = true;
- }
- }
-
- private static void LoadDisableStrongCryptoConfiguration() {
- try {
- bool disableStrongCryptoInternal = false;
- int schUseStrongCryptoKeyValue = 0;
-
- if (LocalAppContextSwitches.DontEnableSchUseStrongCrypto) {
- //.Net 4.5.2 and below will default to false unless the registry key is specifically set to 1.
- schUseStrongCryptoKeyValue =
- RegistryConfiguration.GlobalConfigReadInt(strongCryptoValueName, 0);
-
- disableStrongCryptoInternal = schUseStrongCryptoKeyValue != 1;
- }
- else {
- // .Net 4.6 and above will default to true unless the registry key is specifically set to 0.
- schUseStrongCryptoKeyValue =
- RegistryConfiguration.GlobalConfigReadInt(strongCryptoValueName, 1);
-
- disableStrongCryptoInternal = schUseStrongCryptoKeyValue == 0;
- }
-
- if (disableStrongCryptoInternal) {
- // Revert the SecurityProtocol selection to the legacy combination.
- s_SecurityProtocolType = SecurityProtocolType.Tls | SecurityProtocolType.Ssl3;
- }
- else {
- s_SecurityProtocolType =
- SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
-
- string appSetting = RegistryConfiguration.AppConfigReadString(secureProtocolAppSetting, null);
-
- SecurityProtocolType value;
- try {
- value = (SecurityProtocolType)Enum.Parse(typeof(SecurityProtocolType), appSetting);
- ValidateSecurityProtocol(value);
- s_SecurityProtocolType = value;
- }
- // Ignore all potential exceptions caused by Enum.Parse.
- catch (ArgumentNullException) { }
- catch (ArgumentException) { }
- catch (NotSupportedException) { }
- catch (OverflowException) { }
- }
-
- disableStrongCrypto = disableStrongCryptoInternal;
- }
- catch (Exception e)
- {
- if (e is ThreadAbortException || e is StackOverflowException || e is OutOfMemoryException)
- {
- throw;
- }
- }
- }
-
- private static void LoadDisableSendAuxRecordConfiguration() {
- try {
- if (LocalAppContextSwitches.DontEnableSchSendAuxRecord) {
- disableSendAuxRecord = true;
- return;
- }
-
- int schSendAuxRecordKeyValue = 1;
- schSendAuxRecordKeyValue = RegistryConfiguration.AppConfigReadInt(sendAuxRecordAppSetting, 1);
- if (schSendAuxRecordKeyValue == 0) {
- disableSendAuxRecord = true;
- return;
- }
-
- schSendAuxRecordKeyValue = RegistryConfiguration.GlobalConfigReadInt(sendAuxRecordValueName, 1);
- if (schSendAuxRecordKeyValue == 0) {
- disableSendAuxRecord = true;
- return;
- }
- }
- catch (Exception e)
- {
- if (e is ThreadAbortException || e is StackOverflowException || e is OutOfMemoryException)
- {
- throw;
- }
- }
- }
-
public static bool ReusePort {
get {
- EnsureReusePortSettingsInitialized();
- return reusePort;
+ return s_reusePort;
}
set {
- EnsureReusePortSettingsInitialized();
- reusePort = value;
- }
- }
-
- internal static bool? ReusePortSupported {
- get {
- return reusePortSupported;
- }
- set {
- reusePortSupported = value;
+ s_reusePort = value;
}
}
- private static void EnsureReusePortSettingsInitialized() {
-
- if (reusePortSettingsInitialized) {
- return;
+ internal static bool? ReusePortSupported
+ {
+ get
+ {
+ return s_reusePortSupported;
}
-
- lock (reusePortLock) {
- if (reusePortSettingsInitialized) {
- return;
- }
-
- int reusePortKeyValue = 0;
- try {
- reusePortKeyValue = RegistryConfiguration.GlobalConfigReadInt(reusePortValueName, 0);
- }
- catch (Exception e) {
- if (e is ThreadAbortException || e is StackOverflowException || e is OutOfMemoryException) {
- throw;
- }
- }
-
- bool reusePortInternal = false;
- if (reusePortKeyValue == 1) {
- if (Logging.On) {
- Logging.PrintInfo(Logging.Web, typeof(ServicePointManager), SR.GetString(SR.net_log_set_socketoption_reuseport_default_on));
- }
- reusePortInternal = true;
- }
-
- reusePort = reusePortInternal;
- reusePortSettingsInitialized = true;
+ set
+ {
+ s_reusePortSupported = value;
}
}
#endif // !FEATURE_PAL
@@ -1179,5 +891,6 @@ namespace System.Net {
GlobalLog.Leave("ServicePointManager::SetTcpKeepAlive()");
}
}
-#endif
}
+#endif
+
diff --git a/mcs/class/referencesource/System/net/System/Net/Sockets/NetworkStream.cs b/mcs/class/referencesource/System/net/System/Net/Sockets/NetworkStream.cs
index 7f46157be8c..cf21e9bfbf4 100644
--- a/mcs/class/referencesource/System/net/System/Net/Sockets/NetworkStream.cs
+++ b/mcs/class/referencesource/System/net/System/Net/Sockets/NetworkStream.cs
@@ -483,7 +483,7 @@ namespace System.Net.Sockets {
#if DEBUG
using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.Sync)) {
#endif
- bool canRead = CanRead; // Prevent race with Dispose.
+ bool canRead = CanRead; // Prevent ---- with Dispose.
if (m_CleanedUp){
throw new ObjectDisposedException(this.GetType().FullName);
}
@@ -557,7 +557,7 @@ namespace System.Net.Sockets {
#if DEBUG
using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.Sync)) {
#endif
- bool canWrite = CanWrite; // Prevent race with Dispose.
+ bool canWrite = CanWrite; // Prevent ---- with Dispose.
if (m_CleanedUp){
throw new ObjectDisposedException(this.GetType().FullName);
}
@@ -717,7 +717,7 @@ namespace System.Net.Sockets {
#if DEBUG
using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.Async)) {
#endif
- bool canRead = CanRead; // Prevent race with Dispose.
+ bool canRead = CanRead; // Prevent ---- with Dispose.
if (m_CleanedUp){
throw new ObjectDisposedException(this.GetType().FullName);
}
@@ -772,7 +772,7 @@ namespace System.Net.Sockets {
internal virtual IAsyncResult UnsafeBeginRead(byte[] buffer, int offset, int size, AsyncCallback callback, Object state)
{
- bool canRead = CanRead; // Prevent race with Dispose.
+ bool canRead = CanRead; // Prevent ---- with Dispose.
if (m_CleanedUp)
{
throw new ObjectDisposedException(GetType().FullName);
@@ -902,7 +902,7 @@ namespace System.Net.Sockets {
#if DEBUG
using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.Async)) {
#endif
- bool canWrite = CanWrite; // Prevent race with Dispose.
+ bool canWrite = CanWrite; // Prevent ---- with Dispose.
if (m_CleanedUp){
throw new ObjectDisposedException(this.GetType().FullName);
}
@@ -964,7 +964,7 @@ namespace System.Net.Sockets {
#if DEBUG
using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.Async)) {
#endif
- bool canWrite = CanWrite; // Prevent race with Dispose.
+ bool canWrite = CanWrite; // Prevent ---- with Dispose.
if (m_CleanedUp){
throw new ObjectDisposedException(this.GetType().FullName);
}
@@ -1061,7 +1061,7 @@ namespace System.Net.Sockets {
/// <devdoc>
/// <para>
- /// Performs a [....] Write of an array of buffers.
+ /// Performs a sync Write of an array of buffers.
/// </para>
/// </devdoc>
internal virtual void MultipleWrite(BufferOffsetSize[] buffers)
diff --git a/mcs/class/referencesource/System/net/System/Net/Sockets/Socket.cs b/mcs/class/referencesource/System/net/System/Net/Sockets/Socket.cs
index ee56c48eabc..16e4366036b 100644
--- a/mcs/class/referencesource/System/net/System/Net/Sockets/Socket.cs
+++ b/mcs/class/referencesource/System/net/System/Net/Sockets/Socket.cs
@@ -68,7 +68,7 @@ namespace System.Net.Sockets {
private SocketType socketType;
private ProtocolType protocolType;
- // These caches are one degree off of Socket since they're not used in the [....] case/when disabled in config.
+ // These caches are one degree off of Socket since they're not used in the sync case/when disabled in config.
private CacheSet m_Caches;
private class CacheSet
@@ -6470,7 +6470,7 @@ namespace System.Net.Sockets {
throw;
}
- // Keep the internal state in [....] if the user manually resets this
+ // Keep the internal state in sync if the user manually resets this
if (optionName == SocketOptionName.PacketInformation && optionValue == 0 &&
errorCode == SocketError.Success)
{
@@ -7696,7 +7696,7 @@ namespace System.Net.Sockets {
e.StartOperationAccept();
BindToCompletionPort();
- // Local variables for [....] completion.
+ // Local variables for sync completion.
int bytesTransferred;
SocketError socketError = SocketError.Success;
@@ -7963,7 +7963,7 @@ namespace System.Net.Sockets {
e.StartOperationReceive();
BindToCompletionPort();
- // Local vars for [....] completion of native call.
+ // Local vars for sync completion of native call.
SocketFlags flags = e.m_SocketFlags;
int bytesTransferred;
SocketError socketError;
@@ -8206,7 +8206,7 @@ namespace System.Net.Sockets {
BindToCompletionPort();
- // Local vars for [....] completion of native call.
+ // Local vars for sync completion of native call.
int bytesTransferred;
SocketError socketError;
@@ -8915,7 +8915,7 @@ namespace System.Net.Sockets {
- // Method to update internal state after [....] or async completion.
+ // Method to update internal state after sync or async completion.
internal void SetResults(SocketError socketError, int bytesTransferred, SocketFlags flags) {
m_SocketError = socketError;
m_ConnectByNameError = null;
diff --git a/mcs/class/referencesource/System/net/System/Net/UnsafeNativeMethods.cs b/mcs/class/referencesource/System/net/System/Net/UnsafeNativeMethods.cs
index 680ea981396..15e0dedae89 100644
--- a/mcs/class/referencesource/System/net/System/Net/UnsafeNativeMethods.cs
+++ b/mcs/class/referencesource/System/net/System/Net/UnsafeNativeMethods.cs
@@ -598,6 +598,12 @@ namespace System.Net {
[In, Out] SecurityBufferDescriptor inputBuffers
);
+ [DllImport(SECUR32, ExactSpelling = true, SetLastError = true)]
+ [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
+ internal unsafe static extern int ApplyControlToken(
+ [In] void* inContextPtr,
+ [In, Out] SecurityBufferDescriptor inputBuffers
+ );
}
#endif // !FEATURE_PAL
@@ -2184,10 +2190,20 @@ namespace System.Net {
internal static extern uint HttpCloseUrlGroup(ulong urlGroupId);
[SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Justification = "Implementation requires unmanaged code usage")]
- [DllImport(TOKENBINDING, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)]
+ [DllImport(TOKENBINDING, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall, EntryPoint="TokenBindingVerifyMessage")]
public static extern int TokenBindingVerifyMessage(
[In] byte* tokenBindingMessage,
[In] uint tokenBindingMessageSize,
+ [In] TOKENBINDING_KEY_PARAMETERS_TYPE keyType,
+ [In] byte* tlsUnique,
+ [In] uint tlsUniqueSize,
+ [Out] out HeapAllocHandle resultList);
+
+ [SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Justification = "Implementation requires unmanaged code usage")]
+ [DllImport(TOKENBINDING, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall, EntryPoint="TokenBindingVerifyMessage")]
+ public static extern int TokenBindingVerifyMessage_V1(
+ [In] byte* tokenBindingMessage,
+ [In] uint tokenBindingMessageSize,
[In] IntPtr keyType,
[In] byte* tlsUnique,
[In] uint tlsUniqueSize,
@@ -2236,6 +2252,7 @@ namespace System.Net {
HttpRequestInfoTypeAuth,
HttpRequestInfoTypeChannelBind,
HttpRequestInfoTypeSslProtocol,
+ HttpRequestInfoTypeSslTokenBindingDraft,
HttpRequestInfoTypeSslTokenBinding
}
@@ -2582,7 +2599,7 @@ namespace System.Net {
[StructLayout(LayoutKind.Sequential)]
internal struct HTTP_BINDING_INFO {
internal HTTP_FLAGS Flags;
- internal IntPtr RequestQueueHandle;
+ internal IntPtr RequestQueueHandle;
}
[StructLayout(LayoutKind.Sequential)]
@@ -2592,15 +2609,25 @@ namespace System.Net {
public uint TokenBindingSize;
public byte* TlsUnique;
public uint TlsUniqueSize;
+ public TOKENBINDING_KEY_PARAMETERS_TYPE KeyType;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal unsafe struct HTTP_REQUEST_TOKEN_BINDING_INFO_V1
+ {
+ public byte* TokenBinding;
+ public uint TokenBindingSize;
+ public byte* TlsUnique;
+ public uint TlsUniqueSize;
public IntPtr KeyType;
}
- internal enum TOKENBINDING_HASH_ALGORITHM : byte
+ internal enum TOKENBINDING_HASH_ALGORITHM_V1 : byte
{
TOKENBINDING_HASH_ALGORITHM_SHA256 = 4,
}
- internal enum TOKENBINDING_SIGNATURE_ALGORITHM : byte
+ internal enum TOKENBINDING_SIGNATURE_ALGORITHM_V1 : byte
{
TOKENBINDING_SIGNATURE_ALGORITHM_RSA = 1,
TOKENBINDING_SIGNATURE_ALGORITHM_ECDSAP256 = 3,
@@ -2617,17 +2644,31 @@ namespace System.Net {
TOKENBINDING_EXTENSION_FORMAT_UNDEFINED = 0,
}
+ internal enum TOKENBINDING_KEY_PARAMETERS_TYPE : byte
+ {
+ TOKENBINDING_KEY_PARAMETERS_TYPE_RSA_PKCS_SHA256 = 0,
+ TOKENBINDING_KEY_PARAMETERS_TYPE_RSA_PSS_SHA256 = 1,
+ TOKENBINDING_KEY_PARAMETERS_TYPE_ECDSA_SHA256 = 2,
+ }
+
[StructLayout(LayoutKind.Sequential)]
internal struct TOKENBINDING_IDENTIFIER
{
- public TOKENBINDING_TYPE bindingType;
- public TOKENBINDING_HASH_ALGORITHM hashAlgorithm;
- public TOKENBINDING_SIGNATURE_ALGORITHM signatureAlgorithm;
+ public TOKENBINDING_KEY_PARAMETERS_TYPE keyType;
}
[StructLayout(LayoutKind.Sequential)]
+ internal struct TOKENBINDING_IDENTIFIER_V1
+ {
+ public TOKENBINDING_TYPE bindingType;
+ public TOKENBINDING_HASH_ALGORITHM_V1 hashAlgorithm;
+ public TOKENBINDING_SIGNATURE_ALGORITHM_V1 signatureAlgorithm;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
internal unsafe struct TOKENBINDING_RESULT_DATA
{
+ public TOKENBINDING_TYPE bindingType;
public uint identifierSize;
public TOKENBINDING_IDENTIFIER* identifierData;
public TOKENBINDING_EXTENSION_FORMAT extensionFormat;
@@ -2636,11 +2677,28 @@ namespace System.Net {
}
[StructLayout(LayoutKind.Sequential)]
+ internal unsafe struct TOKENBINDING_RESULT_DATA_V1
+ {
+ public uint identifierSize;
+ public TOKENBINDING_IDENTIFIER_V1* identifierData;
+ public TOKENBINDING_EXTENSION_FORMAT extensionFormat;
+ public uint extensionSize;
+ public IntPtr extensionData;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
internal unsafe struct TOKENBINDING_RESULT_LIST
{
public uint resultCount;
public TOKENBINDING_RESULT_DATA* resultData;
}
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal unsafe struct TOKENBINDING_RESULT_LIST_V1
+ {
+ public uint resultCount;
+ public TOKENBINDING_RESULT_DATA_V1* resultData;
+ }
// see http.w for definitions
[Flags]
@@ -3148,11 +3206,19 @@ namespace System.Net {
return endpoint;
}
- internal static HTTP_REQUEST_TOKEN_BINDING_INFO* GetTlsTokenBindingRequestInfo(byte[] memoryBlob, IntPtr originalAddress){
-
+ /// <summary>
+ /// Method to acquire the V2 token binding
+ /// We tell the difference between a V1 binding and a V2 binding by looking at the HTTP_REQUEST_INFO_TYPE returned from the HTTP request blob
+ /// If we negotiated the new binding type, the value 'HttpRequestInfoTypeSslTokenBinding' will be returned.
+ /// </summary>
+ /// <param name="memoryBlob"></param>
+ /// <param name="originalAddress"></param>
+ /// <returns></returns>
+ internal static HTTP_REQUEST_TOKEN_BINDING_INFO* GetTlsTokenBindingRequestInfo(byte[] memoryBlob, IntPtr originalAddress)
+ {
fixed (byte* pMemoryBlob = memoryBlob)
{
- HTTP_REQUEST_V2* request = (HTTP_REQUEST_V2*)pMemoryBlob;
+ HTTP_REQUEST_V2* request = (HTTP_REQUEST_V2*)pMemoryBlob;
long fixup = pMemoryBlob - (byte*) originalAddress;
for (int i = 0; i < request->RequestInfoCount; i++)
@@ -3160,7 +3226,35 @@ namespace System.Net {
HTTP_REQUEST_INFO* pThisInfo = (HTTP_REQUEST_INFO*)(fixup + (byte*)&request->pRequestInfo[i]);
if (pThisInfo != null && pThisInfo->InfoType == HTTP_REQUEST_INFO_TYPE.HttpRequestInfoTypeSslTokenBinding)
{
- return (HTTP_REQUEST_TOKEN_BINDING_INFO*)pThisInfo->pInfo;
+ return (HTTP_REQUEST_TOKEN_BINDING_INFO*)((byte*)(pThisInfo->pInfo) + fixup);
+ }
+ }
+ }
+ return null;
+ }
+
+ /// <summary>
+ /// Compat method to acquire the old V1 token binding
+ /// We tell the difference between a V1 binding and a V2 binding by looking at the HTTP_REQUEST_INFO_TYPE returned from the HTTP request blob
+ /// If we negotiated the old binding type, the value 'HttpRequestInfoTypeSslTokenBindingDraft' will be returned.
+ /// </summary>
+ /// <param name="memoryBlob"></param>
+ /// <param name="originalAddress"></param>
+ /// <returns></returns>
+ internal static HTTP_REQUEST_TOKEN_BINDING_INFO_V1* GetTlsTokenBindingRequestInfo_V1(byte[] memoryBlob, IntPtr originalAddress)
+ {
+ fixed (byte* pMemoryBlob = memoryBlob)
+ {
+ HTTP_REQUEST_V2* request = (HTTP_REQUEST_V2*)pMemoryBlob;
+ long fixup = pMemoryBlob - (byte*)originalAddress;
+
+ for (int i = 0; i < request->RequestInfoCount; i++)
+ {
+ HTTP_REQUEST_INFO* pThisInfo = (HTTP_REQUEST_INFO*)(fixup + (byte*)&request->pRequestInfo[i]);
+ if (pThisInfo != null && pThisInfo->InfoType == HTTP_REQUEST_INFO_TYPE.HttpRequestInfoTypeSslTokenBindingDraft)
+ {
+ // Old V1 token binding protocol is being used, so we need to handle this data blob using the old behavior
+ return (HTTP_REQUEST_TOKEN_BINDING_INFO_V1*)((byte*)(pThisInfo->pInfo) + fixup);
}
}
}
diff --git a/mcs/class/referencesource/System/net/System/Net/WebRequest.cs b/mcs/class/referencesource/System/net/System/Net/WebRequest.cs
index 40f5fa6ba95..57b3274a090 100644
--- a/mcs/class/referencesource/System/net/System/Net/WebRequest.cs
+++ b/mcs/class/referencesource/System/net/System/Net/WebRequest.cs
@@ -1017,7 +1017,7 @@ namespace System.Net {
// GetRequestStream() and the reading phase to GetResponse(), but if there's no request body, both phases
// may happen inside GetResponse().
//
- // Return null only on [....] (if we're on the [....] thread). Otherwise throw if no context is available.
+ // Return null only on Sync (if we're on the Sync thread). Otherwise throw if no context is available.
internal virtual ContextAwareResult GetConnectingContext()
{
throw ExceptionHelper.MethodNotImplementedException;
diff --git a/mcs/class/referencesource/System/net/System/Net/WebSockets/WebSocketHttpListenerDuplexStream.cs b/mcs/class/referencesource/System/net/System/Net/WebSockets/WebSocketHttpListenerDuplexStream.cs
index da0acfe7932..a0bb4575dd1 100644
--- a/mcs/class/referencesource/System/net/System/Net/WebSockets/WebSocketHttpListenerDuplexStream.cs
+++ b/mcs/class/referencesource/System/net/System/Net/WebSockets/WebSocketHttpListenerDuplexStream.cs
@@ -203,8 +203,8 @@ namespace System.Net.WebSockets
return bytesRead;
}
- // return value indicates [....] vs async completion
- // false: [....] completion
+ // return value indicates sync vs async completion
+ // false: sync completion
// true: async completion
private unsafe bool ReadAsyncFast(HttpListenerAsyncEventArgs eventArgs)
{
@@ -480,8 +480,8 @@ namespace System.Net.WebSockets
}
}
- // return value indicates [....] vs async completion
- // false: [....] completion
+ // return value indicates sync vs async completion
+ // false: sync completion
// true: async completion
private bool WriteAsyncFast(HttpListenerAsyncEventArgs eventArgs)
{
@@ -649,7 +649,7 @@ namespace System.Net.WebSockets
}
// throw OperationCancelledException when canceled by the caller
- // otherwise ---- the exception
+ // otherwise swallow the exception
cancellationToken.ThrowIfCancellationRequested();
}
finally
@@ -1198,7 +1198,7 @@ namespace System.Net.WebSockets
}
}
- // Method to update internal state after [....] or async completion.
+ // Method to update internal state after sync or async completion.
private void SetResults(Exception exception, int bytesTransferred)
{
m_Exception = exception;
diff --git a/mcs/class/referencesource/System/net/System/Net/WebUtility.cs b/mcs/class/referencesource/System/net/System/Net/WebUtility.cs
index 96861857905..454ae4f3e72 100644
--- a/mcs/class/referencesource/System/net/System/Net/WebUtility.cs
+++ b/mcs/class/referencesource/System/net/System/Net/WebUtility.cs
@@ -343,7 +343,7 @@ namespace System.Net {
catch {
// DevDiv: 642025
// ASP.NET uses own ConfigurationManager which can throw in more situations than config errors (i.e. BadRequest)
- // It's ok to ---- the exception here and continue using the default value
+ // It's ok to swallow the exception here and continue using the default value
// Try to initialize again the next time
return defaultDecodeConformance;
}
@@ -382,7 +382,7 @@ namespace System.Net {
catch {
// DevDiv: 642025
// ASP.NET uses own ConfigurationManager which can throw in more situations than config errors (i.e. BadRequest)
- // It's ok to ---- the exception here and continue using the default value
+ // It's ok to swallow the exception here and continue using the default value
// Try to initialize again the next time
return defaultEncodeConformance;
}
diff --git a/mcs/class/referencesource/System/net/System/Net/_AuthenticationState.cs b/mcs/class/referencesource/System/net/System/Net/_AuthenticationState.cs
index 0c79291dac5..f019dd0183e 100644
--- a/mcs/class/referencesource/System/net/System/Net/_AuthenticationState.cs
+++ b/mcs/class/referencesource/System/net/System/Net/_AuthenticationState.cs
@@ -325,7 +325,7 @@ namespace System.Net {
internal void Update(HttpWebRequest httpWebRequest) {
//
// RAID#86753
- // [....]: this is just a fix for redirection & kerberos.
+ // Microsoft: this is just a fix for redirection & kerberos.
// we need to close the Context and call ISC() again with the final
// blob returned from the server. to do this in general
// we would probably need to change the IAuthenticationMdule interface and
diff --git a/mcs/class/referencesource/System/net/System/Net/_ChunkParser.cs b/mcs/class/referencesource/System/net/System/Net/_ChunkParser.cs
index 8b48cb8cac0..47b3d460452 100644
--- a/mcs/class/referencesource/System/net/System/Net/_ChunkParser.cs
+++ b/mcs/class/referencesource/System/net/System/Net/_ChunkParser.cs
@@ -12,7 +12,7 @@ using System.Threading;
namespace System.Net
{
- // This class is a helper for parsing chunked HTTP responses. Usage is to either call Read() ([....]) or ReadAsync()
+ // This class is a helper for parsing chunked HTTP responses. Usage is to either call Read() (sync) or ReadAsync()
// (async) methods to retrieve the response payload (without chunk metadata).
// The buffer passed to the .ctor is owned by the ChunkParser until the whole response is read (i.e. Read/
// ReadAsync return 0 bytes) or an error occurs.
diff --git a/mcs/class/referencesource/System/net/System/Net/_CommandStream.cs b/mcs/class/referencesource/System/net/System/Net/_CommandStream.cs
index 859f8764646..b98c090f2f9 100644
--- a/mcs/class/referencesource/System/net/System/Net/_CommandStream.cs
+++ b/mcs/class/referencesource/System/net/System/Net/_CommandStream.cs
@@ -271,7 +271,7 @@ namespace System.Net {
** I don;t see how this code can be still relevant, remove it of no problems observed **
//
- // This is a general race condition in [....] mode, if the server returns an error
+ // This is a general race condition in Sync mode, if the server returns an error
// after we open the data connection, we will be off reading the data connection,
// and not the control connection. The best we can do is try to poll, and in the
// the worst case, we will timeout on establishing the data connection.
@@ -300,7 +300,7 @@ namespace System.Net {
} catch {
// If we get an exception on the QUIT command (which is
// always the last command), ignore the final exception
- // and continue with the pipeline regardlss of [....]/async
+ // and continue with the pipeline regardlss of sync/async
if (index < 0 || index >= commands.Length ||
commands[index].Command != "QUIT\r\n")
throw;
@@ -423,7 +423,7 @@ namespace System.Net {
//
/// <summary>
- /// <para>Provides a wrapper for the async operations, so that the code can be shared with [....]</para>
+ /// <para>Provides a wrapper for the async operations, so that the code can be shared with sync</para>
/// </summary>
private static void ReadCallback(IAsyncResult asyncResult) {
ReceiveState state = (ReceiveState)asyncResult.AsyncState;
@@ -502,7 +502,7 @@ namespace System.Net {
}
/// <summary>
- /// Kicks off an asynchronous or [....] request to receive a response from the server.
+ /// Kicks off an asynchronous or sync request to receive a response from the server.
/// Uses the Encoding <code>encoding</code> to transform the bytes received into a string to be
/// returned in the GeneralResponseDescription's StatusDescription field.
/// </summary>
diff --git a/mcs/class/referencesource/System/net/System/Net/_ConnectStream.cs b/mcs/class/referencesource/System/net/System/Net/_ConnectStream.cs
index 0b06f934322..8ecd19cc46f 100644
--- a/mcs/class/referencesource/System/net/System/Net/_ConnectStream.cs
+++ b/mcs/class/referencesource/System/net/System/Net/_ConnectStream.cs
@@ -101,7 +101,7 @@ namespace System.Net {
private const string responseDrainTimeoutAppSetting = "responseDrainTimeout";
//
- // Timeout - timeout in ms for [....] reads & writes, passed in HttpWebRequest
+ // Timeout - timeout in ms for sync reads & writes, passed in HttpWebRequest
//
public override bool CanTimeout {
@@ -430,7 +430,7 @@ namespace System.Net {
if (returnResult == null) {
m_Connection.WriteStartNextRequest(m_Request, ref returnResult);
- // If the request is [....], then we do our Read here for data
+ // If the request is Sync, then we do our Read here for data
if (!m_Request.Async)
{
object syncReaderResult = m_Request.ConnectionReaderAsyncResult.InternalWaitForCompletion();
@@ -439,7 +439,7 @@ namespace System.Net {
//via poll when we handed back the request stream
if (syncReaderResult == null && m_Request.NeedsToReadForResponse)
#if DEBUG
- // Remove once mixed [....]/async requests are supported.
+ // Remove once mixed sync/async requests are supported.
using (GlobalLog.SetThreadKind(ThreadKinds.Sync))
#endif
{
@@ -891,7 +891,7 @@ namespace System.Net {
}
//
- // Handles either async or [....] Writing for *public* stream API
+ // Handles either async or sync Writing for *public* stream API
//
private IAsyncResult InternalWrite(bool async, byte[] buffer, int offset, int size, AsyncCallback callback, object state ) {
//
@@ -952,7 +952,7 @@ namespace System.Net {
m_BytesLeftToWrite -= size;
}
- GlobalLog.Print("ConnectStream#" + ValidationHelper.HashString(this) + "::InternalWrite() swallowing: size==0 || BufferOnly || IgnoreSocketErrors= " + (size==0) + BufferOnly + IgnoreSocketErrors);
+ GlobalLog.Print("ConnectStream#" + ValidationHelper.HashString(this) + "::InternalWrite() ----ing: size==0 || BufferOnly || IgnoreSocketErrors= " + (size==0) + BufferOnly + IgnoreSocketErrors);
if (async) {
asyncResult = new LazyAsyncResult(this, state, callback);
completeSync = true;
@@ -1006,7 +1006,7 @@ namespace System.Net {
// IgnoreSocketErrors can be set at any time - need to check it again.
if (IgnoreSocketErrors && !NclUtilities.IsFatal(exception))
{
- GlobalLog.Print("ConnectStream#" + ValidationHelper.HashString(this) + "::InternalWrite() swallowing: IgnoreSocketErrors set after throw.");
+ GlobalLog.Print("ConnectStream#" + ValidationHelper.HashString(this) + "::InternalWrite() ----ing: IgnoreSocketErrors set after throw.");
if (async)
{
completeSync = true;
@@ -1109,7 +1109,7 @@ namespace System.Net {
// IgnoreSocketErrors can be set at any time - need to check it again.
if (IgnoreSocketErrors && !NclUtilities.IsFatal(exception))
{
- GlobalLog.Print("ConnectStream#" + ValidationHelper.HashString(this) + "::InternalWrite() swallowing: IgnoreSocketErrors set after throw.");
+ GlobalLog.Print("ConnectStream#" + ValidationHelper.HashString(this) + "::InternalWrite() ----ing: IgnoreSocketErrors set after throw.");
if (async)
{
completeSync = true;
@@ -1577,7 +1577,7 @@ namespace System.Net {
GlobalLog.Print("m_ReadBytes = "+m_ReadBytes);
if (m_ReadBytes < 0)
- throw new InternalException(); // TODO consider changing on Assert or a user exception when stress gets stable-stable
+ throw new InternalException(); //
}
@@ -2596,7 +2596,7 @@ namespace System.Net {
SafeSetSocketTimeout(SocketShutdown.Send);
#if DEBUG
- // Until there is an async version of this, we have to assert [....] privileges here.
+ // Until there is an async version of this, we have to assert Sync privileges here.
using (GlobalLog.SetThreadKind(ThreadKinds.Sync)) {
#endif
m_Connection.Write(NclConstants.ChunkTerminator, 0, NclConstants.ChunkTerminator.Length);
diff --git a/mcs/class/referencesource/System/net/System/Net/_Connection.cs b/mcs/class/referencesource/System/net/System/Net/_Connection.cs
index d52fcbca150..73754ba834d 100644
--- a/mcs/class/referencesource/System/net/System/Net/_Connection.cs
+++ b/mcs/class/referencesource/System/net/System/Net/_Connection.cs
@@ -704,7 +704,7 @@ namespace System.Net {
if (startRequestResult != TriState.Unspecified) {
CompleteStartRequest(true, request, startRequestResult);
}
- // On [....], we wait for the Connection to be come availble here,
+ // On Sync, we wait for the Connection to be come availble here,
if (!request.Async)
{
object responseObject = request.ConnectionAsyncResult.InternalWaitForCompletion();
@@ -914,7 +914,7 @@ namespace System.Net {
//
// From now on the request.SetRequestSubmitDone must be called or it may hang
- // For a [....] request the write side reponse windowwas opened in HttpWebRequest.SubmitRequest
+ // For a sync request the write side reponse windowwas opened in HttpWebRequest.SubmitRequest
if (request.Async)
request.OpenWriteSideResponseWindow();
@@ -1080,7 +1080,7 @@ namespace System.Net {
WebExceptionStatus ws = WebExceptionStatus.ConnectFailure;
//
// From now on the request.SetRequestSubmitDone must be called or it may hang
- // For a [....] request the write side reponse windowwas opened in HttpWebRequest.SubmitRequest
+ // For a sync request the write side reponse windowwas opened in HttpWebRequest.SubmitRequest
if (request.Async)
request.OpenWriteSideResponseWindow();
@@ -1374,7 +1374,7 @@ namespace System.Net {
if (nextRequest != null )
{
// We cannot have HeadersCompleted on the request that was not placed yet on the write list
- if(nextRequest.HeadersCompleted) // TODO: change to be Assert but only when stress got stable-stable
+ if(nextRequest.HeadersCompleted) //
throw new InternalException();
// This codepath doesn't handle the case where the server has closed the
@@ -2126,7 +2126,7 @@ quit:
// IIS6 does not close the connection on 403 so all subsequent requests will fail to be authorized on THAT connection.
//-----------------------------------------------------------------------------------------------
//5/15/2006
- //[....]
+ //Microsoft
//The DTS Issue 595216 claims that we are unnecessarily closing the
//connection on 403 - even if it is a non SSL request. It seems
//that the original intention is to close the request for SSL requests
@@ -2155,7 +2155,7 @@ quit:
else
{
//QFE: 4599.
- //Author: [....]
+ //Author: Microsoft
//in v2.0, in case of SSL Requests through proxy that require NTLM authentication,
//we are not honoring the Proxy-Connection: Keep-Alive header and
//closing the connection.
@@ -2930,7 +2930,7 @@ quit:
{
if (m_Error == WebExceptionStatus.Success)
{
- throw new InternalException(); // TODO: replace it with a generic error for the product bits
+ throw new InternalException(); //
//m_Error = WebExceptionStatus.UnknownError;
}
@@ -3165,7 +3165,7 @@ quit:
}
}
//
- // Peforms a [....] Read and calls the ReadComplete to process the result
+ // Peforms a Sync Read and calls the ReadComplete to process the result
// The reads are done iteratively, until the Request has received enough
// data to contruct a response, or a 100-Continue is read, allowing the HttpWebRequest
// to return a write stream
@@ -3274,7 +3274,7 @@ quit:
if (probeRead)
{
- // [....] 100-Continue wait only
+ // Sync 100-Continue wait only
request.FinishContinueWait();
if (pollSuccess)
{
@@ -3470,7 +3470,7 @@ quit:
}
//
// Any exception is processed by HandleError() and ----ed to avoid throwing on a thread pool
- // In the [....] case the HandleError() will abort the request so the caller will pick up the result.
+ // In the sync case the HandleError() will abort the request so the caller will pick up the result.
//
catch (Exception exception) {
if (NclUtilities.IsFatal(exception)) throw;
diff --git a/mcs/class/referencesource/System/net/System/Net/_ContextAwareResult.cs b/mcs/class/referencesource/System/net/System/Net/_ContextAwareResult.cs
index c5c5dc42892..b94e26e4312 100644
--- a/mcs/class/referencesource/System/net/System/Net/_ContextAwareResult.cs
+++ b/mcs/class/referencesource/System/net/System/Net/_ContextAwareResult.cs
@@ -359,7 +359,7 @@ namespace System.Net {
// to avoid flowing context. Even if the operation completes before this call, the callback won't have been
// called.
//
- // Returns whether the operation completed [....] or not.
+ // Returns whether the operation completed sync or not.
//
private bool CaptureOrComplete(ref ExecutionContext cachedContext, bool returnContext)
{
diff --git a/mcs/class/referencesource/System/net/System/Net/_DigestClient.cs b/mcs/class/referencesource/System/net/System/Net/_DigestClient.cs
index 04cf4ffdfae..ae4d780262f 100644
--- a/mcs/class/referencesource/System/net/System/Net/_DigestClient.cs
+++ b/mcs/class/referencesource/System/net/System/Net/_DigestClient.cs
@@ -28,7 +28,7 @@ namespace System.Net {
private static PrefixLookup challengeCache = new PrefixLookup();
private static readonly char[] singleSpaceArray = new char[]{' '};
- // [....]: make sure WDigest fixes these bugs before we
+ // Microsoft: make sure WDigest fixes these bugs before we
// enable this code ("Windows OS" Product Studio database):
//
// 921024 1 Wdigest should support MD5, at least for explicit (non-default) credentials.
diff --git a/mcs/class/referencesource/System/net/System/Net/_HTTPDateParse.cs b/mcs/class/referencesource/System/net/System/Net/_HTTPDateParse.cs
index 666ccf9a39e..425f2422266 100644
--- a/mcs/class/referencesource/System/net/System/Net/_HTTPDateParse.cs
+++ b/mcs/class/referencesource/System/net/System/Net/_HTTPDateParse.cs
@@ -42,7 +42,7 @@ namespace System.Net {
private const int DATE_TOKEN_JANUARY = 1;
private const int DATE_TOKEN_FEBRUARY = 2;
- private const int DATE_TOKEN_MARCH = 3;
+ private const int DATE_TOKEN_Microsoft = 3;
private const int DATE_TOKEN_APRIL = 4;
private const int DATE_TOKEN_MAY = 5;
private const int DATE_TOKEN_JUNE = 6;
@@ -148,7 +148,7 @@ namespace System.Net {
case 'A':
switch (MAKE_UPPER(lpszDay[index+2])) {
case 'R':
- return DATE_TOKEN_MARCH;
+ return DATE_TOKEN_Microsoft;
case 'Y':
return DATE_TOKEN_MAY;
}
diff --git a/mcs/class/referencesource/System/net/System/Net/_LazyAsyncResult.cs b/mcs/class/referencesource/System/net/System/Net/_LazyAsyncResult.cs
index bbf9ab82202..17bd85e03d8 100644
--- a/mcs/class/referencesource/System/net/System/Net/_LazyAsyncResult.cs
+++ b/mcs/class/referencesource/System/net/System/Net/_LazyAsyncResult.cs
@@ -18,7 +18,7 @@ namespace System.Net
private const int c_ForceAsyncCount = 50;
#if !NET_PERF
- // This is to avoid user mistakes when they queue another async op from a callback the completes [....].
+ // This is to avoid user mistakes when they queue another async op from a callback the completes sync.
[ThreadStatic]
private static ThreadContext t_ThreadContext;
diff --git a/mcs/class/referencesource/System/net/System/Net/_ListenerResponseStream.cs b/mcs/class/referencesource/System/net/System/Net/_ListenerResponseStream.cs
index 61c5adc6fdf..db4ba258c78 100644
--- a/mcs/class/referencesource/System/net/System/Net/_ListenerResponseStream.cs
+++ b/mcs/class/referencesource/System/net/System/Net/_ListenerResponseStream.cs
@@ -463,7 +463,7 @@ namespace System.Net {
}
// The final Content-Length async write can only be cancelled by CancelIoEx.
- // [....] can only be cancelled by CancelSynchronousIo, but we don't attempt this right now.
+ // Sync can only be cancelled by CancelSynchronousIo, but we don't attempt this right now.
[SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", Justification =
"It is safe to ignore the return value on a cancel operation because the connection is being closed")]
internal void CancelLastWrite(CriticalHandle requestQueueHandle)
diff --git a/mcs/class/referencesource/System/net/System/Net/_NativeSSPI.cs b/mcs/class/referencesource/System/net/System/Net/_NativeSSPI.cs
index ec9b920dc62..2aeb68176d4 100644
--- a/mcs/class/referencesource/System/net/System/Net/_NativeSSPI.cs
+++ b/mcs/class/referencesource/System/net/System/Net/_NativeSSPI.cs
@@ -40,6 +40,7 @@ namespace System.Net {
int SetContextAttributes(SafeDeleteContext phContext, ContextAttribute attribute, byte[] buffer);
int QuerySecurityContextToken(SafeDeleteContext phContext, out SafeCloseHandle phToken);
int CompleteAuthToken(ref SafeDeleteContext refContext, SecurityBuffer[] inputBuffers);
+ int ApplyControlToken(ref SafeDeleteContext refContext, SecurityBuffer[] inputBuffers);
}
// For SSL connections:
@@ -196,6 +197,11 @@ namespace System.Net {
public int CompleteAuthToken(ref SafeDeleteContext refContext, SecurityBuffer[] inputBuffers) {
throw new NotSupportedException();
}
+
+ public int ApplyControlToken(ref SafeDeleteContext refContext, SecurityBuffer[] inputBuffers)
+ {
+ return SafeDeleteContext.ApplyControlToken(Library, ref refContext, inputBuffers);
+ }
}
@@ -416,6 +422,11 @@ namespace System.Net {
return SafeDeleteContext.CompleteAuthToken(Library, ref refContext, inputBuffers);
}
+ public int ApplyControlToken(ref SafeDeleteContext refContext, SecurityBuffer[] inputBuffers)
+ {
+ throw new NotSupportedException();
+ }
+
private static int GetSecurityContextToken(SafeDeleteContext phContext, out SafeCloseHandle safeHandle) {
int status = (int)SecurityStatus.InvalidHandle;
diff --git a/mcs/class/referencesource/System/net/System/Net/_SSPIWrapper.cs b/mcs/class/referencesource/System/net/System/Net/_SSPIWrapper.cs
index 6ea04a7d7d8..03ff307226d 100644
--- a/mcs/class/referencesource/System/net/System/Net/_SSPIWrapper.cs
+++ b/mcs/class/referencesource/System/net/System/Net/_SSPIWrapper.cs
@@ -237,6 +237,15 @@ namespace System.Net {
return errorCode;
}
+ internal static int ApplyControlToken(SSPIInterface SecModule, ref SafeDeleteContext context, SecurityBuffer[] inputBuffers)
+ {
+ int errorCode = SecModule.ApplyControlToken(ref context, inputBuffers);
+
+ if (Logging.On) Logging.PrintInfo(Logging.Web, SR.GetString(SR.net_log_operation_returned_something, "ApplyControlToken()", (SecurityStatus)errorCode));
+
+ return errorCode;
+ }
+
public static int QuerySecurityContextToken(SSPIInterface SecModule, SafeDeleteContext context, out SafeCloseHandle token) {
return SecModule.QuerySecurityContextToken(context, out token);
}
@@ -249,6 +258,52 @@ namespace System.Net {
return EncryptDecryptHelper(OP.Decrypt, secModule, context, input, sequenceNumber);
}
+ public static int ApplyAlertToken(
+ SSPIInterface secModule,
+ ref SafeFreeCredentials credentialsHandle,
+ SafeDeleteContext securityContext,
+ TlsAlertType alertType,
+ TlsAlertMessage alertMessage)
+ {
+ Interop.SChannel.SCHANNEL_ALERT_TOKEN alertToken;
+ alertToken.dwTokenType = Interop.SChannel.SCHANNEL_ALERT;
+ alertToken.dwAlertType = (uint)alertType;
+ alertToken.dwAlertNumber = (uint)alertMessage;
+
+ var bufferDesc = new SecurityBuffer[1];
+
+ int alertTokenByteSize = Marshal.SizeOf(typeof(Interop.SChannel.SCHANNEL_ALERT_TOKEN));
+ IntPtr p = Marshal.AllocHGlobal(alertTokenByteSize);
+
+ try
+ {
+ var buffer = new byte[alertTokenByteSize];
+ Marshal.StructureToPtr(alertToken, p, false);
+ Marshal.Copy(p, buffer, 0, alertTokenByteSize);
+
+ bufferDesc[0] = new SecurityBuffer(buffer, BufferType.Token);
+ return ApplyControlToken(secModule, ref securityContext, bufferDesc);
+ }
+ finally
+ {
+ Marshal.FreeHGlobal(p);
+ }
+ }
+
+ public static int ApplyShutdownToken(
+ SSPIInterface secModule,
+ ref SafeFreeCredentials credentialsHandle,
+ SafeDeleteContext securityContext)
+ {
+ int shutdownToken = Interop.SChannel.SCHANNEL_SHUTDOWN;
+
+ var bufferDesc = new SecurityBuffer[1];
+ var buffer = BitConverter.GetBytes(shutdownToken);
+
+ bufferDesc[0] = new SecurityBuffer(buffer, BufferType.Token);
+ return ApplyControlToken(secModule, ref securityContext, bufferDesc);
+ }
+
internal static int MakeSignature(SSPIInterface secModule, SafeDeleteContext context, SecurityBuffer[] input, uint sequenceNumber) {
return EncryptDecryptHelper(OP.MakeSignature, secModule, context, input, sequenceNumber);
}
@@ -711,6 +766,9 @@ namespace System.Net {
NameMD5 = 3,
NameSHA = 4,
+ NameSHA256 = 12,
+ NameSHA384 = 13,
+ NameSHA512 = 14,
NameDH_Ephem = 2,
}
diff --git a/mcs/class/referencesource/System/net/System/Net/_SafeNetHandles.cs b/mcs/class/referencesource/System/net/System/Net/_SafeNetHandles.cs
index 4d283be6874..ba657e3fde6 100644
--- a/mcs/class/referencesource/System/net/System/Net/_SafeNetHandles.cs
+++ b/mcs/class/referencesource/System/net/System/Net/_SafeNetHandles.cs
@@ -2121,6 +2121,127 @@ namespace System.Net {
return errorCode;
}
+
+ internal unsafe static int ApplyControlToken(
+ SecurDll dll,
+ ref SafeDeleteContext refContext,
+ SecurityBuffer[] inSecBuffers)
+ {
+ GlobalLog.Enter("SafeDeleteContext::ApplyControlToken");
+ GlobalLog.Print(" DLL = " + dll);
+ GlobalLog.Print(" refContext = " + ValidationHelper.ToString(refContext));
+#if TRAVE
+ GlobalLog.Print(" inSecBuffers[] = length:" + inSecBuffers.Length);
+// for (int index=0; index<inSecBuffers.Length; index++) { GlobalLog.Print(" inSecBuffers[" + index + "] = " + SecurityBuffer.ToString(inSecBuffers[index])); }
+#endif
+ GlobalLog.Assert(inSecBuffers != null, "SafeDeleteContext::ApplyControlToken()|inSecBuffers == null");
+ SecurityBufferDescriptor inSecurityBufferDescriptor = new SecurityBufferDescriptor(inSecBuffers.Length);
+
+ int errorCode = (int)SecurityStatus.InvalidHandle;
+
+ // these are pinned user byte arrays passed along with SecurityBuffers
+ GCHandle[] pinnedInBytes = null;
+
+ SecurityBufferStruct[] inUnmanagedBuffer = new SecurityBufferStruct[inSecurityBufferDescriptor.Count];
+ fixed (void* inUnmanagedBufferPtr = inUnmanagedBuffer)
+ {
+ // Fix Descriptor pointer that points to unmanaged SecurityBuffers
+ inSecurityBufferDescriptor.UnmanagedPointer = inUnmanagedBufferPtr;
+ pinnedInBytes = new GCHandle[inSecurityBufferDescriptor.Count];
+ SecurityBuffer securityBuffer;
+ for (int index = 0; index < inSecurityBufferDescriptor.Count; ++index)
+ {
+ securityBuffer = inSecBuffers[index];
+ if (securityBuffer != null)
+ {
+ inUnmanagedBuffer[index].count = securityBuffer.size;
+ inUnmanagedBuffer[index].type = securityBuffer.type;
+
+ // use the unmanaged token if it's not null; otherwise use the managed buffer
+ if (securityBuffer.unmanagedToken != null)
+ {
+ inUnmanagedBuffer[index].token = securityBuffer.unmanagedToken.DangerousGetHandle();
+ }
+ else if (securityBuffer.token == null || securityBuffer.token.Length == 0)
+ {
+ inUnmanagedBuffer[index].token = IntPtr.Zero;
+ }
+ else
+ {
+ pinnedInBytes[index] = GCHandle.Alloc(securityBuffer.token, GCHandleType.Pinned);
+ inUnmanagedBuffer[index].token = Marshal.UnsafeAddrOfPinnedArrayElement(securityBuffer.token, securityBuffer.offset);
+ }
+#if TRAVE
+ GlobalLog.Print("SecBuffer: cbBuffer:" + securityBuffer.size + " BufferType:" + securityBuffer.type);
+// securityBuffer.DebugDump();
+#endif
+ }
+ }
+
+ SSPIHandle contextHandle = new SSPIHandle();
+ if (refContext != null)
+ {
+ contextHandle = refContext._handle;
+ }
+ try
+ {
+ if (dll == SecurDll.SECURITY)
+ {
+ if (refContext == null || refContext.IsInvalid)
+ {
+ refContext = new SafeDeleteContext_SECURITY();
+ }
+
+ bool b = false;
+ RuntimeHelpers.PrepareConstrainedRegions();
+ try
+ {
+ refContext.DangerousAddRef(ref b);
+ }
+ catch (Exception e)
+ {
+ if (b)
+ {
+ refContext.DangerousRelease();
+ b = false;
+ }
+ if (!(e is ObjectDisposedException))
+ throw;
+ }
+ finally
+ {
+ if (b)
+ {
+ errorCode = UnsafeNclNativeMethods.SafeNetHandles_SECURITY.ApplyControlToken(contextHandle.IsZero ? null : &contextHandle, inSecurityBufferDescriptor);
+ refContext.DangerousRelease();
+ }
+ }
+
+ }
+ else
+ {
+ throw new ArgumentException(SR.GetString(SR.net_invalid_enum, "SecurDll"), "Dll");
+ }
+ }
+ finally
+ {
+ if (pinnedInBytes != null)
+ {
+ for (int index = 0; index < pinnedInBytes.Length; index++)
+ {
+ if (pinnedInBytes[index].IsAllocated)
+ {
+ pinnedInBytes[index].Free();
+ }
+ }
+ }
+ }
+ }
+
+ GlobalLog.Leave("SafeDeleteContext::ApplyControlToken() unmanaged ApplyControlToken()", "errorCode:0x" + errorCode.ToString("x8") + " refContext:" + ValidationHelper.ToString(refContext));
+
+ return errorCode;
+ }
}
//======================================================================
diff --git a/mcs/class/referencesource/System/net/System/Net/_SecureChannel.cs b/mcs/class/referencesource/System/net/System/Net/_SecureChannel.cs
index d89639b3457..1d3486d32e5 100644
--- a/mcs/class/referencesource/System/net/System/Net/_SecureChannel.cs
+++ b/mcs/class/referencesource/System/net/System/Net/_SecureChannel.cs
@@ -908,7 +908,7 @@ namespace System.Net.Security {
//
- // Security: we temporarily reset thread token to open the handle under process acount
+ // Security: we temporarily reset thread token to open the handle under process account
//
[SecurityPermissionAttribute(SecurityAction.Assert, Flags=SecurityPermissionFlag.ControlPrincipal)]
SafeFreeCredentials AcquireCredentialsHandle(CredentialUse credUsage, ref SecureCredential secureCredential)
@@ -948,7 +948,7 @@ namespace System.Net.Security {
}
/*++
- GenerateToken - Called after each sucessive state
+ GenerateToken - Called after each successive state
in the Client - Server handshake. This function
generates a set of bytes that will be sent next to
the server. The server responds, each response,
@@ -1000,8 +1000,8 @@ namespace System.Net.Security {
bool cachedCreds = false;
byte[] thumbPrint = null;
//
- // Looping through ASC or ISC with potenially cached credential that could have been
- // already disposed from a different thread before ISC or ASC dir increemnt a cred ref count.
+ // Looping through ASC or ISC with potentially cached credential that could have been
+ // already disposed from a different thread before ISC or ASC dir increment a cred ref count.
//
try
{
@@ -1271,7 +1271,7 @@ namespace System.Net.Security {
count = 0;
for (int i = 0; i < decspc.Length; i++) {
- // Sucessfully decoded data and placed it at the following position in the buffer.
+ // Successfully decoded data and placed it at the following position in the buffer.
if ((errorCode == SecurityStatus.OK && decspc[i].type == BufferType.Data)
// or we failed to decode the data, here is the encoded data
|| (errorCode != SecurityStatus.OK && decspc[i].type == BufferType.Extra)) {
@@ -1295,13 +1295,13 @@ namespace System.Net.Security {
--*/
//This method validates a remote certificate.
- //SECURITY: The scenario is allowed in semitrust StorePermission is asserted for Chain.Build
- // A user callback has unique signature so it is safe to call it under permisison assert.
+ //SECURITY: The scenario is allowed in semi-trust StorePermission is asserted for Chain.Build
+ // A user callback has unique signature so it is safe to call it under permission assert.
//
- #if MONO_FEATURE_CAS
+#if MONO_FEATURE_CAS
[StorePermission(SecurityAction.Assert, Unrestricted=true)]
- #endif
- internal bool VerifyRemoteCertificate(RemoteCertValidationCallback remoteCertValidationCallback)
+#endif
+ internal bool VerifyRemoteCertificate(RemoteCertValidationCallback remoteCertValidationCallback, ref ProtocolToken alertToken)
{
GlobalLog.Enter("SecureChannel#" + ValidationHelper.HashString(this) + "::VerifyRemoteCertificate");
SslPolicyErrors sslPolicyErrors = SslPolicyErrors.None;
@@ -1378,35 +1378,24 @@ namespace System.Net.Security {
success = SSPIWrapper.CheckRemoteCertificate(m_SecurityContext);
#endif
- if (Logging.On) {
- if (sslPolicyErrors != SslPolicyErrors.None)
- {
- Logging.PrintInfo(Logging.Web, this, SR.GetString(SR.net_log_remote_cert_has_errors));
- if ((sslPolicyErrors & SslPolicyErrors.RemoteCertificateNotAvailable) != 0)
- Logging.PrintInfo(Logging.Web, this, "\t" + SR.GetString(SR.net_log_remote_cert_not_available));
- if ((sslPolicyErrors & SslPolicyErrors.RemoteCertificateNameMismatch) != 0)
- Logging.PrintInfo(Logging.Web, this, "\t" + SR.GetString(SR.net_log_remote_cert_name_mismatch));
- if ((sslPolicyErrors & SslPolicyErrors.RemoteCertificateChainErrors) != 0)
- foreach (X509ChainStatus chainStatus in chain.ChainStatus)
- Logging.PrintInfo(Logging.Web, this, "\t" + chainStatus.StatusInformation);
- }
- if (success)
- {
- if (remoteCertValidationCallback != null)
- Logging.PrintInfo(Logging.Web, this, SR.GetString(SR.net_log_remote_cert_user_declared_valid));
- else
- Logging.PrintInfo(Logging.Web, this, SR.GetString(SR.net_log_remote_cert_has_no_errors));
- }
- else
- {
- if (remoteCertValidationCallback != null)
- Logging.PrintInfo(Logging.Web, this, SR.GetString(SR.net_log_remote_cert_user_declared_invalid));
- }
+ if (Logging.On)
+ {
+ LogCertificateValidation(remoteCertValidationCallback, sslPolicyErrors, success, chain);
}
+
GlobalLog.Print("Cert Validation, remote cert = " + (remoteCertificateEx == null? "<null>": remoteCertificateEx.ToString(true)));
+
+ if (LocalAppContextSwitches.DontEnableTlsAlerts)
+ {
+ alertToken = null;
+ }
+ else if (!success)
+ {
+ alertToken = CreateFatalHandshakeAlertToken(sslPolicyErrors, chain);
+ }
}
finally {
- // At least on Win2k server the chain is found to have dependancies on the original cert context.
+ // At least on Win2k server the chain is found to have dependencies on the original cert context.
// So it should be closed first.
if (chain != null) {
chain.Reset();
@@ -1418,6 +1407,140 @@ namespace System.Net.Security {
return success;
}
+ public ProtocolToken CreateFatalHandshakeAlertToken(SslPolicyErrors sslPolicyErrors, X509Chain chain)
+ {
+ GlobalLog.Enter("SecureChannel#" + ValidationHelper.HashString(this) + "::CreateFatalHandshakeAlertToken");
+ TlsAlertMessage alertMessage;
+
+ switch (sslPolicyErrors)
+ {
+ case SslPolicyErrors.RemoteCertificateChainErrors:
+ alertMessage = GetAlertMessageFromChain(chain);
+ break;
+ case SslPolicyErrors.RemoteCertificateNameMismatch:
+ alertMessage = TlsAlertMessage.BadCertificate;
+ break;
+ case SslPolicyErrors.RemoteCertificateNotAvailable:
+ default:
+ alertMessage = TlsAlertMessage.CertificateUnknown;
+ break;
+ }
+
+ GlobalLog.Print("SecureChannel#" + ValidationHelper.HashString(this) + "::CreateFatalHandshakeAlertToken() alertMessage: " + alertMessage.ToString());
+ var status = (SecurityStatus)SSPIWrapper.ApplyAlertToken(GlobalSSPI.SSPISecureChannel, ref m_CredentialsHandle, m_SecurityContext, TlsAlertType.Fatal, alertMessage);
+
+ if (status != SecurityStatus.OK)
+ {
+ GlobalLog.Print("SecureChannel#" + ValidationHelper.HashString(this) + "::ApplyAlertToken() returned " + status);
+ throw new Win32Exception((int)status);
+ }
+
+ ProtocolToken token = GenerateAlertToken();
+ GlobalLog.Leave("SecureChannel#" + ValidationHelper.HashString(this) + "::CreateFatalHandshakeAlertToken", token.ToString());
+ return token;
+ }
+
+ public ProtocolToken CreateShutdownToken()
+ {
+ GlobalLog.Enter("SecureChannel#" + ValidationHelper.HashString(this) + "::CreateShutdownToken");
+ var status = (SecurityStatus)SSPIWrapper.ApplyShutdownToken(GlobalSSPI.SSPISecureChannel, ref m_CredentialsHandle, m_SecurityContext);
+
+ if (status != SecurityStatus.OK)
+ {
+ GlobalLog.Print("SecureChannel#" + ValidationHelper.HashString(this) + "::ApplyAlertToken() returned " + status);
+ throw new Win32Exception((int)status);
+ }
+
+ ProtocolToken token = GenerateAlertToken();
+ GlobalLog.Leave("SecureChannel#" + ValidationHelper.HashString(this) + "::CreateShutdownToken", token.ToString());
+ return token;
+ }
+
+ private ProtocolToken GenerateAlertToken()
+ {
+ byte[] nextmsg = null;
+ SecurityStatus status = GenerateToken(null, 0, 0, ref nextmsg);
+ ProtocolToken token = new ProtocolToken(nextmsg, status);
+ return token;
+ }
+
+ private static TlsAlertMessage GetAlertMessageFromChain(X509Chain chain)
+ {
+ foreach (X509ChainStatus chainStatus in chain.ChainStatus)
+ {
+ if (chainStatus.Status == X509ChainStatusFlags.NoError)
+ {
+ continue;
+ }
+
+ if ((chainStatus.Status &
+ (X509ChainStatusFlags.UntrustedRoot | X509ChainStatusFlags.PartialChain |
+ X509ChainStatusFlags.Cyclic)) != 0)
+ {
+ return TlsAlertMessage.UnknownCA;
+ }
+
+ if ((chainStatus.Status &
+ (X509ChainStatusFlags.Revoked | X509ChainStatusFlags.OfflineRevocation)) != 0)
+ {
+ return TlsAlertMessage.CertificateRevoked;
+ }
+
+ if ((chainStatus.Status &
+ (X509ChainStatusFlags.CtlNotTimeValid | X509ChainStatusFlags.NotTimeNested |
+ X509ChainStatusFlags.NotTimeValid)) != 0)
+ {
+ return TlsAlertMessage.CertificateExpired;
+ }
+
+ if ((chainStatus.Status & X509ChainStatusFlags.CtlNotValidForUsage) != 0)
+ {
+ return TlsAlertMessage.UnsupportedCert;
+ }
+
+ if ((chainStatus.Status &
+ (X509ChainStatusFlags.CtlNotSignatureValid | X509ChainStatusFlags.InvalidExtension |
+ X509ChainStatusFlags.NotSignatureValid | X509ChainStatusFlags.InvalidPolicyConstraints) |
+ X509ChainStatusFlags.NoIssuanceChainPolicy | X509ChainStatusFlags.NotValidForUsage) != 0)
+ {
+ return TlsAlertMessage.BadCertificate;
+ }
+
+ // All other errors:
+ return TlsAlertMessage.CertificateUnknown;
+ }
+
+ Debug.Fail("GetAlertMessageFromChain was called but none of the chain elements had errors.");
+ return TlsAlertMessage.BadCertificate;
+ }
+
+ private void LogCertificateValidation(RemoteCertValidationCallback remoteCertValidationCallback, SslPolicyErrors sslPolicyErrors, bool success, X509Chain chain)
+ {
+ if (sslPolicyErrors != SslPolicyErrors.None)
+ {
+ Logging.PrintInfo(Logging.Web, this, SR.GetString(SR.net_log_remote_cert_has_errors));
+ if ((sslPolicyErrors & SslPolicyErrors.RemoteCertificateNotAvailable) != 0)
+ Logging.PrintInfo(Logging.Web, this, "\t" + SR.GetString(SR.net_log_remote_cert_not_available));
+ if ((sslPolicyErrors & SslPolicyErrors.RemoteCertificateNameMismatch) != 0)
+ Logging.PrintInfo(Logging.Web, this, "\t" + SR.GetString(SR.net_log_remote_cert_name_mismatch));
+ if ((sslPolicyErrors & SslPolicyErrors.RemoteCertificateChainErrors) != 0)
+ foreach (X509ChainStatus chainStatus in chain.ChainStatus)
+ Logging.PrintInfo(Logging.Web, this, "\t" + chainStatus.StatusInformation);
+ }
+ if (success)
+ {
+ if (remoteCertValidationCallback != null)
+ Logging.PrintInfo(Logging.Web, this, SR.GetString(SR.net_log_remote_cert_user_declared_valid));
+ else
+ Logging.PrintInfo(Logging.Web, this, SR.GetString(SR.net_log_remote_cert_has_no_errors));
+ }
+ else
+ {
+ if (remoteCertValidationCallback != null)
+ Logging.PrintInfo(Logging.Web, this, SR.GetString(SR.net_log_remote_cert_user_declared_invalid));
+ }
+ }
+
/*
From wincrypt.h
diff --git a/mcs/class/referencesource/System/net/System/Net/_TLSstream.cs b/mcs/class/referencesource/System/net/System/Net/_TLSstream.cs
index 3a418304fd6..50f5265f53d 100644
--- a/mcs/class/referencesource/System/net/System/Net/_TLSstream.cs
+++ b/mcs/class/referencesource/System/net/System/Net/_TLSstream.cs
@@ -106,7 +106,7 @@ namespace System.Net {
}
//
- // [....] Read version
+ // Sync Read version
//
public override int Read(byte[] buffer, int offset, int size) {
GlobalLog.Print("TlsStream#" + ValidationHelper.HashString(this) + "::Read() SecureWorker#" + ValidationHelper.HashString(m_Worker) + " offset:" + offset.ToString() + " size:" + size.ToString());
@@ -401,11 +401,11 @@ namespace System.Net {
//
// This methods ensures that IO is only issued when the handshake is completed in ether way
- // The very first coming IO will initiate the handshake and define it's flavor ([....]/async).
+ // The very first coming IO will initiate the handshake and define it's flavor (sync/async).
//
// Returns false if the handshake was already done.
// Returns true if the user IO is queued and the handshake is started.
- // Return value is not applicable in [....] case.
+ // Return value is not applicable in sync case.
//
private ArrayList m_PendingIO = new ArrayList();
internal bool ProcessAuthentication(LazyAsyncResult result)
@@ -483,7 +483,7 @@ namespace System.Net {
{
if(m_PendingIO.Count > 1)
{
- // It was a real [....] handshake (now completed) and another IO came in.
+ // It was a real sync handshake (now completed) and another IO came in.
// It's now waiting on us so resume.
ThreadPool.QueueUserWorkItem(new WaitCallback(StartWakeupPendingIO), null);
}
@@ -496,7 +496,7 @@ namespace System.Net {
}
else if (isSyncCall)
{
- GlobalLog.Assert(result != null, "TlsStream::ProcessAuthentication() this is a [....] call and it did not started the handshake hence null result must be wrapped into LazyAsyncResult");
+ GlobalLog.Assert(result != null, "TlsStream::ProcessAuthentication() this is a Sync call and it did not started the handshake hence null result must be wrapped into LazyAsyncResult");
Exception e = result.InternalWaitForCompletion() as Exception;
if (e != null)
throw e;
@@ -516,7 +516,7 @@ namespace System.Net {
}
// Here in the async case a user IO has been queued (and may be already completed)
- // For [....] case it does not matter since the caller will resume IO upon return
+ // For sync case it does not matter since the caller will resume IO upon return
return true;
}
//
@@ -581,7 +581,7 @@ namespace System.Net {
}
else
{
- //resume [....] IO waiting on other thread or signal waiting async handshake result.
+ //resume sync IO waiting on other thread or signal waiting async handshake result.
try {
lazyResult.InvokeCallback(exception);
}
diff --git a/mcs/class/referencesource/System/net/System/Net/_TimerThread.cs b/mcs/class/referencesource/System/net/System/Net/_TimerThread.cs
index c75a7136694..152fd109ec4 100644
--- a/mcs/class/referencesource/System/net/System/Net/_TimerThread.cs
+++ b/mcs/class/referencesource/System/net/System/Net/_TimerThread.cs
@@ -13,7 +13,7 @@ namespace System.Net {
using System.Runtime.InteropServices;
/// <summary>
- /// <para>Acts as countdown timer, used to measure elapsed time over a [....] operation.</para>
+ /// <para>Acts as countdown timer, used to measure elapsed time over a sync operation.</para>
/// </summary>
internal static class TimerThread {
/// <summary>
diff --git a/mcs/class/referencesource/System/net/System/Net/mail/MailHeaderInfo.cs b/mcs/class/referencesource/System/net/System/Net/mail/MailHeaderInfo.cs
index cde8b0b45d8..eabb5954e50 100644
--- a/mcs/class/referencesource/System/net/System/Net/mail/MailHeaderInfo.cs
+++ b/mcs/class/referencesource/System/net/System/Net/mail/MailHeaderInfo.cs
@@ -67,7 +67,7 @@ namespace System.Net.Mail {
// Table of well-known mail headers.
- // Keep the initializers in [....] with the enum above.
+ // Keep the initializers in sync with the enum above.
private static readonly HeaderInfo[] m_HeaderInfo = {
// ID NormalizedString IsSingleton IsUserSettable AllowsUnicode
new HeaderInfo(MailHeaderID.Bcc, "Bcc", true, false, true),
@@ -110,10 +110,10 @@ namespace System.Net.Mail {
static MailHeaderInfo() {
#if DEBUG
- // Check that enum and header info array are in [....]
+ // Check that enum and header info array are in sync
for(int i = 0; i < m_HeaderInfo.Length; i++) {
if((int)m_HeaderInfo[i].ID != i) {
- throw new Exception("Header info data structures are not in [....]");
+ throw new Exception("Header info data structures are not in sync");
}
}
#endif
diff --git a/mcs/class/referencesource/System/net/System/Net/mail/SmtpClient.cs b/mcs/class/referencesource/System/net/System/Net/mail/SmtpClient.cs
index 38ccf0a7f33..d1632685a60 100644
--- a/mcs/class/referencesource/System/net/System/Net/mail/SmtpClient.cs
+++ b/mcs/class/referencesource/System/net/System/Net/mail/SmtpClient.cs
@@ -872,7 +872,7 @@ namespace System.Net.Mail
try {
writer = transport.EndSendMail(result);
// If some recipients failed but not others, send the e-mail anyways, but then return the
- // "Non-fatal" exception reporting the failures. The [....] code path does it this way.
+ // "Non-fatal" exception reporting the failures. The sync code path does it this way.
// Fatal exceptions would have thrown above at transport.EndSendMail(...)
SendMailAsyncResult sendResult = (SendMailAsyncResult)result;
// Save these and throw them later in SendMessageCallback, after the message has sent.
diff --git a/mcs/class/referencesource/System/net/System/Net/mail/SmtpTransport.cs b/mcs/class/referencesource/System/net/System/Net/mail/SmtpTransport.cs
index 99c36b866d0..a6333e70e1e 100644
--- a/mcs/class/referencesource/System/net/System/Net/mail/SmtpTransport.cs
+++ b/mcs/class/referencesource/System/net/System/Net/mail/SmtpTransport.cs
@@ -235,7 +235,7 @@ namespace System.Net.Mail
catch(Exception innerException){
throw new SmtpException(SR.GetString(SR.MailHostNotFound), innerException);
}
- GlobalLog.Leave("SmtpTransport#" + ValidationHelper.HashString(this) + "::BeginConnect [....] Completion");
+ GlobalLog.Leave("SmtpTransport#" + ValidationHelper.HashString(this) + "::BeginConnect Sync Completion");
return result;
}
diff --git a/mcs/class/referencesource/System/net/System/Net/mail/smtpconnection.cs b/mcs/class/referencesource/System/net/System/Net/mail/smtpconnection.cs
index a553312e247..ff9bddc7737 100644
--- a/mcs/class/referencesource/System/net/System/Net/mail/smtpconnection.cs
+++ b/mcs/class/referencesource/System/net/System/Net/mail/smtpconnection.cs
@@ -417,7 +417,7 @@ namespace System.Net.Mail
for (int i = 0; i < authenticationModules.Length; i++)
{
- //only authenticate if the auth protocol is supported - [....]
+ //only authenticate if the auth protocol is supported - Microsoft
if (!AuthSupported(authenticationModules[i])) {
continue;
}
@@ -650,7 +650,7 @@ namespace System.Net.Mail
internal void GetConnection(bool synchronous)
{
- GlobalLog.Enter("ConnectAndHandshakeAsyncResult#" + ValidationHelper.HashString(this) + "::Connect: [....]=" + (synchronous ? "true" : "false"));
+ GlobalLog.Enter("ConnectAndHandshakeAsyncResult#" + ValidationHelper.HashString(this) + "::Connect: sync=" + (synchronous ? "true" : "false"));
if (connection.isConnected)
{
throw new InvalidOperationException(SR.GetString(SR.SmtpAlreadyConnected));
diff --git a/mcs/class/referencesource/System/net/System/URI.cs b/mcs/class/referencesource/System/net/System/URI.cs
index a757b5244fb..73e505d344e 100644
--- a/mcs/class/referencesource/System/net/System/URI.cs
+++ b/mcs/class/referencesource/System/net/System/URI.cs
@@ -2097,7 +2097,7 @@ namespace System {
++length;
}
- // [....] codereview:
+ // Microsoft codereview:
// Old Uri parser tries to figure out on a DosPath in all cases.
// Hence http://c:/ is treated as as DosPath without the host while it should be a host "c", port 80
//
@@ -2427,7 +2427,7 @@ namespace System {
// Note we already checked on general port syntax in ParseMinimal()
// If iri parsing is on with unicode chars then the end of parsed host
- // points to m_[....] string and not m_String
+ // points to m_orig string and not m_String
bool UseOrigUnicodeStrOffset = ((cF& Flags.UseOrigUncdStrOffset) != 0);
// This should happen only once. Reset it
@@ -2606,7 +2606,7 @@ namespace System {
break;
case Flags.IPv6HostType:
- //[....] codereview
+ //Microsoft codereview
// The helper will return [...] string that is not suited for Dns.Resolve()
host = IPv6AddressHelper.ParseCanonicalName(str, idx, ref loopback, ref scopeId);
break;
@@ -2749,7 +2749,7 @@ namespace System {
//
private string GetEscapedParts(UriComponents uriParts) {
// Which Uri parts are not escaped canonically ?
- // Notice that public UriPart and private Flags must me in [....] so below code can work
+ // Notice that public UriPart and private Flags must me in Sync so below code can work
//
ushort nonCanonical = (ushort)(((ushort)m_Flags & ((ushort)Flags.CannotDisplayCanonical<<7)) >> 6);
if (InFact(Flags.SchemeNotCanonical)) {
@@ -2779,7 +2779,7 @@ namespace System {
private string GetUnescapedParts(UriComponents uriParts, UriFormat formatAs) {
// Which Uri parts are not escaped canonically ?
- // Notice that public UriComponents and private Uri.Flags must me in [....] so below code can work
+ // Notice that public UriComponents and private Uri.Flags must me in Sync so below code can work
//
ushort nonCanonical = (ushort)((ushort)m_Flags & (ushort)Flags.CannotDisplayCanonical);
@@ -3360,7 +3360,7 @@ namespace System {
// Parsing the Path if any
//
- // For iri parsing if we found unicode the idx has offset into m_[....] string..
+ // For iri parsing if we found unicode the idx has offset into m_orig string..
// so restart parsing from there and make m_Info.Offset.Path as m_string.length
idx = m_Info.Offset.Path;
@@ -5353,7 +5353,7 @@ namespace System {
[Obsolete("The method has been deprecated. It is not used by the system. http://go.microsoft.com/fwlink/?linkid=14202")]
protected virtual void Parse()
{
- // [....] cr: In V1-Everett this method if suppressed by the derived class
+ // Microsoft cr: In V1-Everett this method if suppressed by the derived class
// would lead to an unconstructed Uri instance.
// It does not make any sense and violates Fxcop on calling a virtual method in the ctor.
// Should be deprecated and removed asap.
@@ -5362,7 +5362,7 @@ namespace System {
[Obsolete("The method has been deprecated. It is not used by the system. http://go.microsoft.com/fwlink/?linkid=14202")]
protected virtual void Canonicalize()
{
- // [....] cr: In V1-Everett this method if suppressed by the derived class
+ // Microsoft cr: In V1-Everett this method if suppressed by the derived class
// would lead to supressing of a path compression
// It does not make much sense and violates Fxcop on calling a virtual method in the ctor.
// Should be deprecated and removed asap.
@@ -5371,7 +5371,7 @@ namespace System {
[Obsolete("The method has been deprecated. It is not used by the system. http://go.microsoft.com/fwlink/?linkid=14202")]
protected virtual void Escape()
{
- // [....] cr: In V1-Everett this method if suppressed by the derived class
+ // Microsoft cr: In V1-Everett this method if suppressed by the derived class
// would lead to the same effect as dontEscape=true.
// It does not make much sense and violates Fxcop on calling a virtual method in the ctor.
// Should be deprecated and removed asap.
@@ -5387,7 +5387,7 @@ namespace System {
[Obsolete("The method has been deprecated. Please use GetComponents() or static UnescapeDataString() to unescape a Uri component or a string. http://go.microsoft.com/fwlink/?linkid=14202")]
protected virtual string Unescape(string path) {
- // [....] cr: This method is dangerous since it gives path unescaping control
+ // Microsoft cr: This method is dangerous since it gives path unescaping control
// to the derived class without any permission demand.
// Should be deprecated and removed asap.
@@ -5401,7 +5401,7 @@ namespace System {
[Obsolete("The method has been deprecated. Please use GetComponents() or static EscapeUriString() to escape a Uri component or a string. http://go.microsoft.com/fwlink/?linkid=14202")]
protected static string EscapeString(string str) {
- // [....] cr: This method just does not make sense sa protected
+ // Microsoft cr: This method just does not make sense sa protected
// It should go public static asap
if ((object)str == null) {
@@ -5424,7 +5424,7 @@ namespace System {
[Obsolete("The method has been deprecated. It is not used by the system. http://go.microsoft.com/fwlink/?linkid=14202")]
protected virtual void CheckSecurity() {
- // [....] cr: This method just does not make sense
+ // Microsoft cr: This method just does not make sense
// Should be deprecated and removed asap.
if (Scheme == "telnet") {
@@ -5448,7 +5448,7 @@ namespace System {
[Obsolete("The method has been deprecated. It is not used by the system. http://go.microsoft.com/fwlink/?linkid=14202")]
protected virtual bool IsReservedCharacter(char character) {
- // [....] cr: This method just does not make sense as virtual protected
+ // Microsoft cr: This method just does not make sense as virtual protected
// It should go public static asap
return (character == ';')
@@ -5476,7 +5476,7 @@ namespace System {
[Obsolete("The method has been deprecated. It is not used by the system. http://go.microsoft.com/fwlink/?linkid=14202")]
protected static bool IsExcludedCharacter(char character) {
- // [....] cr: This method just does not make sense sa protected
+ // Microsoft cr: This method just does not make sense sa protected
// It should go public static asap
//
@@ -5519,7 +5519,7 @@ namespace System {
[Obsolete("The method has been deprecated. It is not used by the system. http://go.microsoft.com/fwlink/?linkid=14202")]
protected virtual bool IsBadFileSystemCharacter(char character) {
- // [....] cr: This method just does not make sense sa protected virtual
+ // Microsoft cr: This method just does not make sense sa protected virtual
// It should go public static asap
return (character < 0x20)
diff --git a/mcs/class/referencesource/System/regex/system/text/regularexpressions/Regex.cs b/mcs/class/referencesource/System/regex/system/text/regularexpressions/Regex.cs
index a978e8e73ab..9a5a986a686 100644
--- a/mcs/class/referencesource/System/regex/system/text/regularexpressions/Regex.cs
+++ b/mcs/class/referencesource/System/regex/system/text/regularexpressions/Regex.cs
@@ -138,7 +138,7 @@ namespace System.Text.RegularExpressions {
#else
// desktop build still uses non-generic collections for AppCompat with .NET Framework 3.5 pre-compiled assemblies
protected internal Hashtable caps;
- protected internal Hashtable capnames;
+ protected internal Hashtable capnames;
#endif
protected internal String[] capslist; // if captures are sparse or named captures are used, this is the sorted list of names
protected internal int capsize; // the size of the capture array
@@ -445,7 +445,7 @@ namespace System.Text.RegularExpressions {
/// Unescapes any escaped characters in the input string.
/// </para>
/// </devdoc>
- [SuppressMessage("Microsoft.Naming","CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId="Unescape", Justification="[....]: already shipped since v1 - can't fix without causing a breaking change")]
+ [SuppressMessage("Microsoft.Naming","CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId="Unescape", Justification="Microsoft: already shipped since v1 - can't fix without causing a breaking change")]
public static String Unescape(String str) {
if (str==null)
throw new ArgumentNullException("str");
@@ -1255,7 +1255,7 @@ namespace System.Text.RegularExpressions {
#endif
[ResourceExposure(ResourceScope.Machine)] // The AssemblyName is interesting.
[ResourceConsumption(ResourceScope.Machine)]
- [SuppressMessage("Microsoft.Naming","CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId="assemblyname", Justification="[....]: already shipped since v1 - can't fix without causing a breaking change")]
+ [SuppressMessage("Microsoft.Naming","CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId="assemblyname", Justification="Microsoft: already shipped since v1 - can't fix without causing a breaking change")]
public static void CompileToAssembly(RegexCompilationInfo[] regexinfos, AssemblyName assemblyname) {
CompileToAssemblyInternal(regexinfos, assemblyname, null, null);
@@ -1268,7 +1268,7 @@ namespace System.Text.RegularExpressions {
#endif
[ResourceExposure(ResourceScope.Machine)] // The AssemblyName is interesting.
[ResourceConsumption(ResourceScope.Machine)]
- [SuppressMessage("Microsoft.Naming","CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId="assemblyname", Justification="[....]: already shipped since v1 - can't fix without causing a breaking change")]
+ [SuppressMessage("Microsoft.Naming","CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId="assemblyname", Justification="Microsoft: already shipped since v1 - can't fix without causing a breaking change")]
public static void CompileToAssembly(RegexCompilationInfo[] regexinfos, AssemblyName assemblyname, CustomAttributeBuilder[] attributes) {
CompileToAssemblyInternal(regexinfos, assemblyname, attributes, null);
}
@@ -1278,7 +1278,7 @@ namespace System.Text.RegularExpressions {
#endif
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
- [SuppressMessage("Microsoft.Naming","CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId="assemblyname", Justification="[....]: already shipped since v1 - can't fix without causing a breaking change")]
+ [SuppressMessage("Microsoft.Naming","CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId="assemblyname", Justification="Microsoft: already shipped since v1 - can't fix without causing a breaking change")]
public static void CompileToAssembly(RegexCompilationInfo[] regexinfos, AssemblyName assemblyname, CustomAttributeBuilder[] attributes, String resourceFile) {
CompileToAssemblyInternal(regexinfos, assemblyname, attributes, resourceFile);
}
diff --git a/mcs/class/referencesource/System/regex/system/text/regularexpressions/RegexCompiler.cs b/mcs/class/referencesource/System/regex/system/text/regularexpressions/RegexCompiler.cs
index 5a60311ee31..8658e1dd4fe 100644
--- a/mcs/class/referencesource/System/regex/system/text/regularexpressions/RegexCompiler.cs
+++ b/mcs/class/referencesource/System/regex/system/text/regularexpressions/RegexCompiler.cs
@@ -216,7 +216,7 @@ namespace System.Text.RegularExpressions {
*/
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
- [SuppressMessage("Microsoft.Security","CA2106:SecureAsserts", Justification="[....]: SECREVIEW : Regex only generates string manipulation, so this is OK")]
+ [SuppressMessage("Microsoft.Security","CA2106:SecureAsserts", Justification="Microsoft: SECREVIEW : Regex only generates string manipulation, so this is OK")]
internal static void CompileToAssembly(RegexCompilationInfo[] regexes, AssemblyName an, CustomAttributeBuilder[] attribs, String resourceFile) {
RegexTypeCompiler c = new RegexTypeCompiler(an, attribs, resourceFile);
@@ -3046,7 +3046,7 @@ namespace System.Text.RegularExpressions {
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
- [SuppressMessage("Microsoft.Security","CA2106:SecureAsserts", Justification="[....]: SECREVIEW : Regex only generates string manipulation, so this is OK")]
+ [SuppressMessage("Microsoft.Security","CA2106:SecureAsserts", Justification="Microsoft: SECREVIEW : Regex only generates string manipulation, so this is OK")]
internal RegexTypeCompiler(AssemblyName an, CustomAttributeBuilder[] attribs, String resourceFile) {
// SECREVIEW : Regex only generates string manipulation, so this is
// : ok.
diff --git a/mcs/class/referencesource/System/regex/system/text/regularexpressions/RegexGroup.cs b/mcs/class/referencesource/System/regex/system/text/regularexpressions/RegexGroup.cs
index a20e05cfd1f..0b24f4bcad5 100644
--- a/mcs/class/referencesource/System/regex/system/text/regularexpressions/RegexGroup.cs
+++ b/mcs/class/referencesource/System/regex/system/text/regularexpressions/RegexGroup.cs
@@ -10,6 +10,7 @@
namespace System.Text.RegularExpressions {
using System.Security.Permissions;
+ using System.Runtime.Serialization;
/// <devdoc>
/// Group
@@ -22,19 +23,24 @@ namespace System.Text.RegularExpressions {
#endif
public class Group : Capture {
// the empty group object
- internal static Group _emptygroup = new Group(String.Empty, new int[0], 0);
+ internal static Group _emptygroup = new Group(String.Empty, new int[0], 0, string.Empty);
internal int[] _caps;
internal int _capcount;
internal CaptureCollection _capcoll;
+#if !SILVERLIGHT
+ [OptionalField]
+#endif
+ internal string _name;
- internal Group(String text, int[] caps, int capcount)
+ internal Group(String text, int[] caps, int capcount, string name)
: base(text, capcount == 0 ? 0 : caps[(capcount - 1) * 2],
capcount == 0 ? 0 : caps[(capcount * 2) - 1]) {
_caps = caps;
_capcount = capcount;
+ _name = name;
}
/*
@@ -49,6 +55,17 @@ namespace System.Text.RegularExpressions {
}
}
+ /// <summary>
+ /// Provides the name of the group.
+ /// </summary>
+ public string Name
+ {
+ get
+ {
+ return _name;
+ }
+ }
+
/*
* The collection of all captures for this group
*/
diff --git a/mcs/class/referencesource/System/regex/system/text/regularexpressions/RegexGroupCollection.cs b/mcs/class/referencesource/System/regex/system/text/regularexpressions/RegexGroupCollection.cs
index c40858dcf58..c2caf125431 100644
--- a/mcs/class/referencesource/System/regex/system/text/regularexpressions/RegexGroupCollection.cs
+++ b/mcs/class/referencesource/System/regex/system/text/regularexpressions/RegexGroupCollection.cs
@@ -147,7 +147,8 @@ namespace System.Text.RegularExpressions {
if (_groups == null) {
_groups = new Group[_match._matchcount.Length - 1];
for (int i = 0; i < _groups.Length; i++) {
- _groups[i] = new Group(_match._text, _match._matches[i + 1], _match._matchcount[i + 1]);
+ string groupname = _match._regex.GroupNameFromNumber(i + 1);
+ _groups[i] = new Group(_match._text, _match._matches[i + 1], _match._matchcount[i + 1], groupname);
}
}
diff --git a/mcs/class/referencesource/System/regex/system/text/regularexpressions/RegexMatch.cs b/mcs/class/referencesource/System/regex/system/text/regularexpressions/RegexMatch.cs
index eedca2de00a..ac625057a7d 100644
--- a/mcs/class/referencesource/System/regex/system/text/regularexpressions/RegexMatch.cs
+++ b/mcs/class/referencesource/System/regex/system/text/regularexpressions/RegexMatch.cs
@@ -77,7 +77,7 @@ namespace System.Text.RegularExpressions {
*/
internal Match(Regex regex, int capcount, String text, int begpos, int len, int startpos)
- : base(text, new int[2], 0) {
+ : base(text, new int[2], 0, "0") {
_regex = regex;
_matchcount = new int[capcount];
diff --git a/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/EventLog.cs b/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/EventLog.cs
index faa25dd5ebe..1c8e71440db 100644
--- a/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/EventLog.cs
+++ b/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/EventLog.cs
@@ -150,8 +150,8 @@ namespace System.Diagnostics {
[MonitoringDescription(SR.LogLog)]
[DefaultValue("")]
[SettingsBindable(true)]
- [SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Justification = "[....]: Safe, oldLog.machineName doesn't change")]
- [SuppressMessage("Microsoft.Security", "CA2106:SecureAsserts", Justification = "[....]: By design, see justification above assert")]
+ [SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Justification = "Microsoft: Safe, oldLog.machineName doesn't change")]
+ [SuppressMessage("Microsoft.Security", "CA2106:SecureAsserts", Justification = "Microsoft: By design, see justification above assert")]
public string Log {
get {
return m_underlyingEventLog.Log;
@@ -181,7 +181,7 @@ namespace System.Diagnostics {
[MonitoringDescription(SR.LogMachineName)]
[DefaultValue(".")]
[SettingsBindable(true)]
- [SuppressMessage("Microsoft.Security", "CA2106:SecureAsserts", Justification = "[....]: By design, see justification above assert")]
+ [SuppressMessage("Microsoft.Security", "CA2106:SecureAsserts", Justification = "Microsoft: By design, see justification above assert")]
public string MachineName {
get {
return m_underlyingEventLog.MachineName;
@@ -292,8 +292,8 @@ namespace System.Diagnostics {
[MonitoringDescription(SR.LogSource)]
[DefaultValue("")]
[SettingsBindable(true)]
- [SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Justification = "[....]: Safe, oldLog.machineName doesn't change")]
- [SuppressMessage("Microsoft.Security", "CA2106:SecureAsserts", Justification = "[....]: By design, see justification above assert")]
+ [SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Justification = "Microsoft: Safe, oldLog.machineName doesn't change")]
+ [SuppressMessage("Microsoft.Security", "CA2106:SecureAsserts", Justification = "Microsoft: By design, see justification above assert")]
public string Source {
get {
return m_underlyingEventLog.Source;
@@ -1069,7 +1069,7 @@ namespace System.Diagnostics {
/// </devdoc>
[ResourceExposure(ResourceScope.None)]
[ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)]
- [SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Justification = "[....]: Safe, machineName doesn't change")]
+ [SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Justification = "Microsoft: Safe, machineName doesn't change")]
internal static bool SourceExists(string source, string machineName, bool wantToCreate) {
if (!SyntaxCheck.CheckMachineName(machineName)) {
throw new ArgumentException(SR.GetString(SR.InvalidParameter, "machineName", machineName));
diff --git a/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/EventLogEntry.cs b/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/EventLogEntry.cs
index 931faaa6aff..cd19c7cc6b7 100644
--- a/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/EventLogEntry.cs
+++ b/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/EventLogEntry.cs
@@ -426,7 +426,7 @@ namespace System.Diagnostics {
if ( percentIdx < 0 )
return msg; // no '%' at all
- int startCopyIdx = 0; // start idx of last [....] msg chars to copy
+ int startCopyIdx = 0; // start idx of last orig msg chars to copy
int msgLength = msg.Length;
StringBuilder buf = new StringBuilder();
string paramDLLNames = GetMessageLibraryNames("ParameterMessageFile");
diff --git a/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/EventLogEntryCollection.cs b/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/EventLogEntryCollection.cs
index 589a1d493f0..c095b36003a 100644
--- a/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/EventLogEntryCollection.cs
+++ b/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/EventLogEntryCollection.cs
@@ -9,7 +9,7 @@ namespace System.Diagnostics {
using System;
using System.Collections;
- //Consider, V2, [....]: Is there a way to implement Contains
+ //Consider, V2, Microsoft: Is there a way to implement Contains
//and IndexOf, can we live withouth this part of the ReadOnly
//collection pattern?
/// <devdoc>
diff --git a/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/EventLogInternal.cs b/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/EventLogInternal.cs
index 754ae4cb098..d43d0a8dfc3 100644
--- a/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/EventLogInternal.cs
+++ b/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/EventLogInternal.cs
@@ -160,7 +160,7 @@ namespace System.Diagnostics {
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
- [SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Justification = "[....]: Safe, oldLog.machineName doesn't change")]
+ [SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Justification = "Microsoft: Safe, oldLog.machineName doesn't change")]
public EventLogInternal(string logName, string machineName, string source, EventLog parent) {
//look out for invalid log names
if (logName == null)
@@ -316,7 +316,7 @@ namespace System.Diagnostics {
}
}
- [SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Justification = "[....]: Safe, machineName doesn't change")]
+ [SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Justification = "Microsoft: Safe, machineName doesn't change")]
private string GetLogName(string currentMachineName)
{
if ((logName == null || logName.Length == 0) && sourceName != null && sourceName.Length!=0) {
@@ -347,7 +347,7 @@ namespace System.Diagnostics {
}
[ComVisible(false)]
- [SuppressMessage("Microsoft.Usage", "CA2208:InstantiateArgumentExceptionsCorrectly", Justification = "[....]: MaximumKilobytes is the name of this property.")]
+ [SuppressMessage("Microsoft.Usage", "CA2208:InstantiateArgumentExceptionsCorrectly", Justification = "Microsoft: MaximumKilobytes is the name of this property.")]
public long MaximumKilobytes {
get {
string currentMachineName = this.machineName;
@@ -653,7 +653,7 @@ namespace System.Diagnostics {
Close(this.machineName);
}
- [SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Justification = "[....]: Safe, currentMachineName doesn't change")]
+ [SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Justification = "Microsoft: Safe, currentMachineName doesn't change")]
private void Close(string currentMachineName) {
EventLogPermission permission = new EventLogPermission(EventLogPermissionAccess.Write, currentMachineName);
permission.Demand();
@@ -730,7 +730,7 @@ namespace System.Diagnostics {
i = lastSeenCount;
}
- // NOTE, [....]: We have a double loop here so that we access the
+ // NOTE, Microsoft: We have a double loop here so that we access the
// EntryCount property as infrequently as possible. (It may be expensive
// to get the property.) Even though there are two loops, they will together
// only execute as many times as (final value of EntryCount) - lastSeenCount.
@@ -897,7 +897,7 @@ namespace System.Diagnostics {
oldestEntry+idx, buf, buf.Length, out bytesRead, out minBytesNeeded);
if (!success) {
error = Marshal.GetLastWin32Error();
- // NOTE, [....]: ERROR_PROC_NOT_FOUND used to get returned, but I think that
+ // NOTE, Microsoft: ERROR_PROC_NOT_FOUND used to get returned, but I think that
// was because I was calling GetLastError directly instead of GetLastWin32Error.
// Making the buffer bigger and trying again seemed to work. I've removed the check
// for ERROR_PROC_NOT_FOUND because I don't think it's necessary any more, but
@@ -1090,7 +1090,7 @@ namespace System.Diagnostics {
cache, cache.Length, out bytesRead, out minBytesNeeded);
if (!success) {
int error = Marshal.GetLastWin32Error();
- // NOTE, [....]: ERROR_PROC_NOT_FOUND used to get returned, but I think that
+ // NOTE, Microsoft: ERROR_PROC_NOT_FOUND used to get returned, but I think that
// was because I was calling GetLastError directly instead of GetLastWin32Error.
// Making the buffer bigger and trying again seemed to work. I've removed the check
// for ERROR_PROC_NOT_FOUND because I don't think it's necessary any more, but
@@ -1270,7 +1270,7 @@ namespace System.Diagnostics {
/// </devdoc>
[ResourceExposure(ResourceScope.None)]
[ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)]
- [SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Justification = "[....]: Safe, machineName doesn't change")]
+ [SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Justification = "Microsoft: Safe, machineName doesn't change")]
private void OpenForRead(string currentMachineName) {
Debug.WriteLineIf(CompModSwitches.EventLog.TraceVerbose, "EventLog::OpenForRead");
@@ -1286,13 +1286,13 @@ namespace System.Diagnostics {
if (logname == null || logname.Length==0)
throw new ArgumentException(SR.GetString(SR.MissingLogProperty));
- if (!EventLog.Exists(logname, currentMachineName) ) // do not open non-existing Log [[....]]
+ if (!EventLog.Exists(logname, currentMachineName) ) // do not open non-existing Log [Microsoft]
throw new InvalidOperationException( SR.GetString(SR.LogDoesNotExists, logname, currentMachineName) );
//Check environment before calling api
SharedUtils.CheckEnvironment();
// Clean up cache variables.
- // [[....]] The initilizing code is put here to guarantee, that first read of events
+ // [Microsoft] The initilizing code is put here to guarantee, that first read of events
// from log file will start by filling up the cache buffer.
lastSeenEntry = 0;
lastSeenPos = 0;
@@ -1506,7 +1506,7 @@ namespace System.Diagnostics {
[ResourceExposure(ResourceScope.None)]
[ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)]
- [SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Justification = "[....]: Safe, machineName doesn't change")]
+ [SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Justification = "Microsoft: Safe, machineName doesn't change")]
private void VerifyAndCreateSource(string sourceName, string currentMachineName) {
if (boolFlags[Flag_sourceVerified])
return;
diff --git a/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/ProcessManager.cs b/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/ProcessManager.cs
index 711debb3acb..9c9d5e9e41e 100644
--- a/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/ProcessManager.cs
+++ b/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/ProcessManager.cs
@@ -49,7 +49,7 @@ namespace System.Diagnostics {
if (NativeMethods.GetWindow(new HandleRef(this, handle), NativeMethods.GW_OWNER) != (IntPtr)0 || !NativeMethods.IsWindowVisible(new HandleRef(this, handle)))
return false;
- // [....]: should we use no window title to mean not a main window? (task man does)
+ // Microsoft: should we use no window title to mean not a main window? (task man does)
/*
int length = NativeMethods.GetWindowTextLength(handle) * 2;
diff --git a/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/SharedUtils.cs b/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/SharedUtils.cs
index b1c4a860195..5b664f60ca1 100644
--- a/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/SharedUtils.cs
+++ b/mcs/class/referencesource/System/services/monitoring/system/diagnosticts/SharedUtils.cs
@@ -112,7 +112,7 @@ namespace System.Diagnostics {
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
[SecurityPermission(SecurityAction.Assert, ControlPrincipal = true)]
- [SuppressMessage("Microsoft.Security", "CA2106:SecureAsserts", Justification = "[....]: We pass fixed data into sec.AddAccessRule")]
+ [SuppressMessage("Microsoft.Security", "CA2106:SecureAsserts", Justification = "Microsoft: We pass fixed data into sec.AddAccessRule")]
internal static void EnterMutexWithoutGlobal(string mutexName, ref Mutex mutex) {
bool createdNew;
MutexSecurity sec = new MutexSecurity();
diff --git a/mcs/class/referencesource/System/services/timers/system/timers/Timer.cs b/mcs/class/referencesource/System/services/timers/system/timers/Timer.cs
index 122d79c94b2..290f10ab21b 100644
--- a/mcs/class/referencesource/System/services/timers/system/timers/Timer.cs
+++ b/mcs/class/referencesource/System/services/timers/system/timers/Timer.cs
@@ -93,7 +93,7 @@ namespace System.Timers {
/// is able
/// to raise events at a defined interval.</para>
/// </devdoc>
- //[....] - The default value by design is false, don't change it.
+ //Microsoft - The default value by design is false, don't change it.
[Category("Behavior"), TimersDescription(SR.TimerEnabled), DefaultValue(false)]
public bool Enabled {
get {
diff --git a/mcs/class/referencesource/System/sys/AppContextDefaultValues.Defaults.cs b/mcs/class/referencesource/System/sys/AppContextDefaultValues.Defaults.cs
index da13e193026..f9f41dee1f2 100644
--- a/mcs/class/referencesource/System/sys/AppContextDefaultValues.Defaults.cs
+++ b/mcs/class/referencesource/System/sys/AppContextDefaultValues.Defaults.cs
@@ -32,6 +32,13 @@ namespace System
{
LocalAppContext.DefineSwitchDefault(LocalAppContextSwitches.MemberDescriptorEqualsReturnsFalseIfEquivalentName, true);
}
+
+ if (version <= 40602)
+ {
+ LocalAppContext.DefineSwitchDefault(LocalAppContextSwitches.DontEnableSystemDefaultTlsVersionsName, true);
+ LocalAppContext.DefineSwitchDefault(LocalAppContextSwitches.DontEnableTlsAlertsName, true);
+ }
+
break;
}
case "WindowsPhone":
@@ -39,7 +46,9 @@ namespace System
{
if (version <= 80100)
{
- LocalAppContext.DefineSwitchDefault(LocalAppContextSwitches.DontEnableSchUseStrongCryptoName, true);
+ LocalAppContext.DefineSwitchDefault(LocalAppContextSwitches.DontEnableSchUseStrongCryptoName, true);
+ LocalAppContext.DefineSwitchDefault(LocalAppContextSwitches.DontEnableSystemDefaultTlsVersionsName, true);
+ LocalAppContext.DefineSwitchDefault(LocalAppContextSwitches.DontEnableTlsAlertsName, true);
}
break;
}
diff --git a/mcs/class/referencesource/System/sys/LocalAppContextSwitches.cs b/mcs/class/referencesource/System/sys/LocalAppContextSwitches.cs
index 0d28af1593f..f1836071249 100644
--- a/mcs/class/referencesource/System/sys/LocalAppContextSwitches.cs
+++ b/mcs/class/referencesource/System/sys/LocalAppContextSwitches.cs
@@ -61,6 +61,31 @@ namespace System
return LocalAppContext.GetCachedSwitchValue(DontEnableSchSendAuxRecordName, ref _dontEnableSchSendAuxRecord);
}
}
+
+ private static int _dontEnableSystemSystemDefaultTlsVersions;
+ internal const string DontEnableSystemDefaultTlsVersionsName = @"Switch.System.Net.DontEnableSystemDefaultTlsVersions";
+
+ public static bool DontEnableSystemDefaultTlsVersions
+ {
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ get
+ {
+ return LocalAppContext.GetCachedSwitchValue(DontEnableSystemDefaultTlsVersionsName, ref _dontEnableSystemSystemDefaultTlsVersions);
+ }
+ }
+
+ private static int _dontEnableTlsAlerts;
+ internal const string DontEnableTlsAlertsName = @"Switch.System.Net.DontEnableTlsAlerts";
+
+ public static bool DontEnableTlsAlerts
+ {
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ get
+ {
+ return LocalAppContext.GetCachedSwitchValue(DontEnableTlsAlertsName, ref _dontEnableTlsAlerts);
+ }
+ }
#endregion
+
}
}
diff --git a/mcs/class/referencesource/System/sys/system/IO/ports/SerialStream.cs b/mcs/class/referencesource/System/sys/system/IO/ports/SerialStream.cs
index 02e2d444528..5848bb6103f 100644
--- a/mcs/class/referencesource/System/sys/system/IO/ports/SerialStream.cs
+++ b/mcs/class/referencesource/System/sys/system/IO/ports/SerialStream.cs
@@ -7,7 +7,7 @@
**
** Class: SerialStream
**
-** Purpose: Class for enabling low-level [....] and async control over a serial
+** Purpose: Class for enabling low-level sync and async control over a serial
** : communications resource.
**
** Date: August, 2002
@@ -809,7 +809,8 @@ namespace System.IO.Ports
// the SerialPort. A customer also reported seeing ERROR_BAD_COMMAND here.
// Do not throw an exception on the finalizer thread - that's just rude,
// since apps can't catch it and we may tear down the app.
- if ((hr == NativeMethods.ERROR_ACCESS_DENIED || hr == NativeMethods.ERROR_BAD_COMMAND) && !disposing) {
+ const int ERROR_DEVICE_REMOVED = 1617;
+ if ((hr == NativeMethods.ERROR_ACCESS_DENIED || hr == NativeMethods.ERROR_BAD_COMMAND || hr == ERROR_DEVICE_REMOVED) && !disposing) {
skipSPAccess = true;
}
else {
@@ -1736,8 +1737,9 @@ namespace System.IO.Ports
{
int hr = Marshal.GetLastWin32Error();
// When a device is disconnected unexpectedly from a serial port, there appear to be
- // at least two error codes Windows or drivers may return.
- if (hr == NativeMethods.ERROR_ACCESS_DENIED || hr == NativeMethods.ERROR_BAD_COMMAND) {
+ // at least three error codes Windows or drivers may return.
+ const int ERROR_DEVICE_REMOVED = 1617;
+ if (hr == NativeMethods.ERROR_ACCESS_DENIED || hr == NativeMethods.ERROR_BAD_COMMAND || hr == ERROR_DEVICE_REMOVED) {
doCleanup = true;
break;
}
diff --git a/mcs/class/referencesource/System/sys/system/Media/SoundPlayer.cs b/mcs/class/referencesource/System/sys/system/Media/SoundPlayer.cs
index 57e621ef4dc..03736293d0d 100644
--- a/mcs/class/referencesource/System/sys/system/Media/SoundPlayer.cs
+++ b/mcs/class/referencesource/System/sys/system/Media/SoundPlayer.cs
@@ -227,7 +227,7 @@ namespace System.Media {
/// <include file='doc\SoundPlayer.uex' path='docs/doc[@for="SoundPlayer.Load"]/*' />
public void Load() {
// if we have a file there is nothing to load - we just pass the file to the PlaySound function
- // if we have a stream, then we start loading the stream [....]
+ // if we have a stream, then we start loading the stream sync
//
if (uri != null && uri.IsFile){
Debug.Assert(stream == null, "we can't have a stream and a path at the same time");
diff --git a/mcs/class/referencesource/System/sys/system/collections/concurrent/BlockingCollection.cs b/mcs/class/referencesource/System/sys/system/collections/concurrent/BlockingCollection.cs
index ba8dac36669..d252dced5a5 100644
--- a/mcs/class/referencesource/System/sys/system/collections/concurrent/BlockingCollection.cs
+++ b/mcs/class/referencesource/System/sys/system/collections/concurrent/BlockingCollection.cs
@@ -7,7 +7,7 @@
//
// BlockingCollection.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// A class that implements the bounding and blocking functionality while abstracting away
// the underlying storage mechanism. This file also contains BlockingCollection's
diff --git a/mcs/class/referencesource/System/sys/system/collections/concurrent/ConcurrentBag.cs b/mcs/class/referencesource/System/sys/system/collections/concurrent/ConcurrentBag.cs
index 1f0d34927af..0eac2aa19e1 100644
--- a/mcs/class/referencesource/System/sys/system/collections/concurrent/ConcurrentBag.cs
+++ b/mcs/class/referencesource/System/sys/system/collections/concurrent/ConcurrentBag.cs
@@ -7,7 +7,7 @@
//
// ConcurrentBag.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
//An unordered collection that allows duplicates and that provides add and get operations.
diff --git a/mcs/class/referencesource/System/sys/system/threading/Barrier.cs b/mcs/class/referencesource/System/sys/system/threading/Barrier.cs
index 35db6d1f9c7..25c0ed599a6 100644
--- a/mcs/class/referencesource/System/sys/system/threading/Barrier.cs
+++ b/mcs/class/referencesource/System/sys/system/threading/Barrier.cs
@@ -7,7 +7,7 @@
//
// Barrier.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// A barrier allows multiple tasks to cooperatively work on some algorithm in parallel.
// A group of tasks cooperate by moving through a series of phases, where each in the group signals it has arrived at
diff --git a/mcs/class/referencesource/System/sys/system/windows/markup/ValueSerializerAttribute.cs b/mcs/class/referencesource/System/sys/system/windows/markup/ValueSerializerAttribute.cs
index 37f19b3aa8e..d5ab9a80d98 100644
--- a/mcs/class/referencesource/System/sys/system/windows/markup/ValueSerializerAttribute.cs
+++ b/mcs/class/referencesource/System/sys/system/windows/markup/ValueSerializerAttribute.cs
@@ -10,7 +10,7 @@
// an attached property by setting it on the static accessor
// for the attachable property).
//
-// Created: 04/28/2005 [....]
+// Created: 04/28/2005 Microsoft
//
//------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/mscorlib/InternalApis/NDP_Common/inc/StrongNameHelpers.cs b/mcs/class/referencesource/mscorlib/InternalApis/NDP_Common/inc/StrongNameHelpers.cs
index 262070c90be..eca2861417d 100644
--- a/mcs/class/referencesource/mscorlib/InternalApis/NDP_Common/inc/StrongNameHelpers.cs
+++ b/mcs/class/referencesource/mscorlib/InternalApis/NDP_Common/inc/StrongNameHelpers.cs
@@ -20,7 +20,7 @@ namespace Microsoft.Runtime.Hosting {
[ThreadStatic]
private static IClrStrongName s_StrongName;
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
private static IClrStrongName StrongName {
[System.Security.SecurityCritical]
get {
@@ -33,7 +33,7 @@ namespace Microsoft.Runtime.Hosting {
}
}
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
private static IClrStrongNameUsingIntPtr StrongNameUsingIntPtr {
[System.Security.SecurityCritical]
get {
@@ -42,20 +42,20 @@ namespace Microsoft.Runtime.Hosting {
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static int StrongNameErrorInfo() {
return ts_LastStrongNameHR;
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
[SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", MessageId = "Microsoft.Runtime.Hosting.IClrStrongNameUsingIntPtr.StrongNameFreeBuffer(System.IntPtr)", Justification = "StrongNameFreeBuffer returns void but the new runtime wrappers return an HRESULT.")]
public static void StrongNameFreeBuffer(IntPtr pbMemory) {
StrongNameUsingIntPtr.StrongNameFreeBuffer(pbMemory);
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameGetPublicKey(string pwzKeyContainer, IntPtr pbKeyBlob, int cbKeyBlob, out IntPtr ppbPublicKeyBlob, out int pcbPublicKeyBlob) {
int hr = StrongNameUsingIntPtr.StrongNameGetPublicKey(pwzKeyContainer, pbKeyBlob, cbKeyBlob, out ppbPublicKeyBlob, out pcbPublicKeyBlob);
if( hr < 0 )
@@ -70,7 +70,7 @@ namespace Microsoft.Runtime.Hosting {
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameKeyDelete(string pwzKeyContainer) {
int hr = StrongName.StrongNameKeyDelete(pwzKeyContainer);
if( hr < 0 )
@@ -82,7 +82,7 @@ namespace Microsoft.Runtime.Hosting {
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameKeyGen(string pwzKeyContainer, int dwFlags, out IntPtr ppbKeyBlob, out int pcbKeyBlob) {
int hr = StrongName.StrongNameKeyGen(pwzKeyContainer, dwFlags, out ppbKeyBlob, out pcbKeyBlob);
if( hr < 0 )
@@ -96,7 +96,7 @@ namespace Microsoft.Runtime.Hosting {
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameKeyInstall(string pwzKeyContainer, IntPtr pbKeyBlob, int cbKeyBlob) {
int hr = StrongNameUsingIntPtr.StrongNameKeyInstall(pwzKeyContainer, pbKeyBlob, cbKeyBlob);
if( hr < 0 )
@@ -108,7 +108,7 @@ namespace Microsoft.Runtime.Hosting {
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameSignatureGeneration(string pwzFilePath, string pwzKeyContainer, IntPtr pbKeyBlob, int cbKeyBlob) {
IntPtr ppbSignatureBlob = IntPtr.Zero;
int cbSignatureBlob = 0;
@@ -117,7 +117,7 @@ namespace Microsoft.Runtime.Hosting {
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameSignatureGeneration(string pwzFilePath, string pwzKeyContainer, IntPtr pbKeyBlob, int cbKeyBlob, ref IntPtr ppbSignatureBlob, out int pcbSignatureBlob) {
int hr = StrongNameUsingIntPtr.StrongNameSignatureGeneration(pwzFilePath, pwzKeyContainer, pbKeyBlob, cbKeyBlob, ppbSignatureBlob, out pcbSignatureBlob);
if( hr < 0 )
@@ -130,7 +130,7 @@ namespace Microsoft.Runtime.Hosting {
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameSignatureSize(IntPtr pbPublicKeyBlob, int cbPublicKeyBlob, out int pcbSize) {
int hr = StrongNameUsingIntPtr.StrongNameSignatureSize(pbPublicKeyBlob, cbPublicKeyBlob, out pcbSize);
if( hr < 0 )
@@ -143,7 +143,7 @@ namespace Microsoft.Runtime.Hosting {
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameSignatureVerification(string pwzFilePath, int dwInFlags, out int pdwOutFlags) {
int hr = StrongName.StrongNameSignatureVerification(pwzFilePath, dwInFlags, out pdwOutFlags);
if( hr < 0 )
@@ -156,7 +156,7 @@ namespace Microsoft.Runtime.Hosting {
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameSignatureVerificationEx(string pwzFilePath, bool fForceVerification, out bool pfWasVerified) {
int hr = StrongName.StrongNameSignatureVerificationEx(pwzFilePath, fForceVerification, out pfWasVerified);
if( hr < 0 )
@@ -169,7 +169,7 @@ namespace Microsoft.Runtime.Hosting {
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameTokenFromPublicKey(IntPtr pbPublicKeyBlob, int cbPublicKeyBlob, out IntPtr ppbStrongNameToken, out int pcbStrongNameToken) {
int hr = StrongNameUsingIntPtr.StrongNameTokenFromPublicKey(pbPublicKeyBlob, cbPublicKeyBlob, out ppbStrongNameToken, out pcbStrongNameToken);
if( hr < 0 )
@@ -183,7 +183,7 @@ namespace Microsoft.Runtime.Hosting {
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameSignatureSize(byte[] bPublicKeyBlob, int cbPublicKeyBlob, out int pcbSize) {
int hr = StrongName.StrongNameSignatureSize(bPublicKeyBlob, cbPublicKeyBlob, out pcbSize);
if( hr < 0 )
@@ -195,7 +195,7 @@ namespace Microsoft.Runtime.Hosting {
return true;
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameTokenFromPublicKey(byte[] bPublicKeyBlob, int cbPublicKeyBlob, out IntPtr ppbStrongNameToken, out int pcbStrongNameToken) {
int hr = StrongName.StrongNameTokenFromPublicKey(bPublicKeyBlob, cbPublicKeyBlob, out ppbStrongNameToken, out pcbStrongNameToken);
if( hr < 0 )
@@ -209,7 +209,7 @@ namespace Microsoft.Runtime.Hosting {
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameGetPublicKey(string pwzKeyContainer, byte[] bKeyBlob, int cbKeyBlob, out IntPtr ppbPublicKeyBlob, out int pcbPublicKeyBlob) {
int hr = StrongName.StrongNameGetPublicKey(pwzKeyContainer, bKeyBlob, cbKeyBlob, out ppbPublicKeyBlob, out pcbPublicKeyBlob);
if( hr < 0 )
@@ -223,7 +223,7 @@ namespace Microsoft.Runtime.Hosting {
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameKeyInstall(string pwzKeyContainer, byte[] bKeyBlob, int cbKeyBlob) {
int hr = StrongName.StrongNameKeyInstall(pwzKeyContainer, bKeyBlob, cbKeyBlob);
if( hr < 0 )
@@ -235,7 +235,7 @@ namespace Microsoft.Runtime.Hosting {
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameSignatureGeneration(string pwzFilePath, string pwzKeyContainer, byte[] bKeyBlob, int cbKeyBlob) {
IntPtr ppbSignatureBlob = IntPtr.Zero;
int cbSignatureBlob = 0;
@@ -243,7 +243,7 @@ namespace Microsoft.Runtime.Hosting {
}
[System.Security.SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "[....]: This file is included in a lot of projects some of which only use a subset of the functions.")]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Microsoft: This file is included in a lot of projects some of which only use a subset of the functions.")]
public static bool StrongNameSignatureGeneration(string pwzFilePath, string pwzKeyContainer, byte[] bKeyBlob, int cbKeyBlob, ref IntPtr ppbSignatureBlob, out int pcbSignatureBlob) {
int hr = StrongName.StrongNameSignatureGeneration(pwzFilePath, pwzKeyContainer, bKeyBlob, cbKeyBlob, ppbSignatureBlob, out pcbSignatureBlob);
if( hr < 0 )
diff --git a/mcs/class/referencesource/mscorlib/microsoft/win32/oavariantlib.cs b/mcs/class/referencesource/mscorlib/microsoft/win32/oavariantlib.cs
index 8b8d0b1cbe5..96525f5cdab 100644
--- a/mcs/class/referencesource/mscorlib/microsoft/win32/oavariantlib.cs
+++ b/mcs/class/referencesource/mscorlib/microsoft/win32/oavariantlib.cs
@@ -60,7 +60,7 @@ namespace Microsoft.Win32 {
typeof(DBNull),
};
- // Keep these numbers in [....] w/ the above array.
+ // Keep these numbers in sync w/ the above array.
private const int CV_OBJECT=0x12;
#endregion
diff --git a/mcs/class/referencesource/mscorlib/microsoft/win32/safehandles/saferegistryhandle.cs b/mcs/class/referencesource/mscorlib/microsoft/win32/safehandles/saferegistryhandle.cs
index e8473a436b7..4036eeb91b8 100644
--- a/mcs/class/referencesource/mscorlib/microsoft/win32/safehandles/saferegistryhandle.cs
+++ b/mcs/class/referencesource/mscorlib/microsoft/win32/safehandles/saferegistryhandle.cs
@@ -6,7 +6,7 @@
//
// File: SafeRegistryHandle.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Implements Microsoft.Win32.SafeHandles.SafeRegistryHandle
//
diff --git a/mcs/class/referencesource/mscorlib/mscorlib.txt b/mcs/class/referencesource/mscorlib/mscorlib.txt
index e95c7ad15fc..35fac908aaa 100644
--- a/mcs/class/referencesource/mscorlib/mscorlib.txt
+++ b/mcs/class/referencesource/mscorlib/mscorlib.txt
@@ -46,12 +46,7 @@ Exception_EndStackTraceFromPreviousThrow = --- End of stack trace from previous
Arg_ParamName_Name = Parameter name: {0}
ArgumentOutOfRange_ActualValue = Actual value was {0}.
-#if PLATFORM_UNIX
-NoDebugResources = [{0}]\nArguments: {1}\nDebugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version={2}&File={3}&Key={4}
-#endif
-#if !PLATFORM_UNIX
NoDebugResources = [{0}]\r\nArguments: {1}\r\nDebugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version={2}&File={3}&Key={4}
-#endif // PLATFORM_UNIX else
#endif // INCLUDE_RUNTIME
#if !FEATURE_CORECLR
@@ -73,12 +68,7 @@ PostconditionOnExceptionFailed = Postcondition failed after throwing an exceptio
PostconditionOnExceptionFailed_Cnd = Postcondition failed after throwing an exception: {0}
InvariantFailed = Invariant failed.
InvariantFailed_Cnd = Invariant failed: {0}
-#if PLATFORM_UNIX
-StackTrace_Stack = Stack trace: \n{0}
-#endif
-#if !PLATFORM_UNIX
StackTrace_Stack = Stack trace: \r\n{0}
-#endif // PLATFORM_UNIX else
MustUseCCRewrite = An assembly (probably "{1}") must be rewritten using the code contracts binary rewriter (CCRewrite) because it is calling Contract.{0} and the CONTRACTS_FULL symbol is defined. Remove any explicit definitions of the CONTRACTS_FULL symbol from your project and rebuild. CCRewrite can be downloaded from http://go.microsoft.com/fwlink/?LinkID=169180. \r\nAfter the rewriter is installed, it can be enabled in Visual Studio from the project's Properties page on the Code Contracts pane. Ensure that "Perform Runtime Contract Checking" is enabled, which will define CONTRACTS_FULL.
; Access Control
@@ -319,7 +309,7 @@ Arg_EmptyOrNullArray = Array may not be empty or null.
Arg_EmptyCollection = Collection must not be empty.
Arg_EmptyOrNullString = String may not be empty or null.
Argument_ItemNotExist = The specified item does not exist in this KeyedCollection.
-Argument_EncodingNotSupported = '{0}' is not a supported encoding name.
+Argument_EncodingNotSupported = '{0}' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.
Argument_FallbackBufferNotEmpty = Cannot change fallback when buffer is not empty. Previous Convert() call left data in the fallback buffer.
Argument_InvalidCodePageConversionIndex = Unable to translate Unicode character \\u{0:X4} at index {1} to specified code page.
Argument_InvalidCodePageBytesIndex = Unable to translate bytes {0} at index {1} from specified code page to Unicode.
@@ -951,6 +941,7 @@ Cryptography_CSP_NoPrivateKey = Object contains only the public half of a key pa
Cryptography_CSP_OFBNotSupported = Output feedback mode (OFB) is not supported by this implementation.
Cryptography_CSP_WrongKeySpec = The specified cryptographic service provider (CSP) does not support this key algorithm.
Cryptography_HashNameSet = Hash name cannot be changed after the first write to the stream.
+Cryptography_HashAlgorithmNameNullOrEmpty = The hash algorithm name cannot be null or empty.
Cryptography_InvalidHashSize = {0} algorithm hash size is {1} bytes.
Cryptography_InvalidKey_Weak = Specified key is a known weak key for '{0}' and cannot be used.
Cryptography_InvalidKey_SemiWeak = Specified key is a known semi-weak key for '{0}' and cannot be used.
@@ -1008,6 +999,46 @@ EventSource_NeedGuid = The Guid of an EventSource must be non zero.
EventSource_NeedName = The name of an EventSource must not be null.
EventSource_EtwAlreadyRegistered = The provider has already been registered with the operating system.
EventSource_ListenerWriteFailure = An error occurred when writing to a listener.
+EventSource_TypeMustDeriveFromEventSource = Event source types must derive from EventSource.
+EventSource_TypeMustBeSealedOrAbstract = Event source types must be sealed or abstract.
+EventSource_TaskOpcodePairReused = Event {0} (with ID {1}) has the same task/opcode pair as event {2} (with ID {3}).
+EventSource_EventMustHaveTaskIfNonDefaultOpcode = Event {0} (with ID {1}) has a non-default opcode but not a task.
+EventSource_EventNameDoesNotEqualTaskPlusOpcode = Event {0} (with ID {1}) has a name that is not the concatenation of its task name and opcode.
+EventSource_PeriodIllegalInProviderName = Period character ('.') is illegal in an ETW provider name ({0}).
+EventSource_IllegalOpcodeValue = Opcode {0} has a value of {1} which is outside the legal range (11-238).
+EventSource_OpcodeCollision = Opcodes {0} and {1} are defined with the same value ({2}).
+EventSource_IllegalTaskValue = Task {0} has a value of {1} which is outside the legal range (1-65535).
+EventSource_TaskCollision = Tasks {0} and {1} are defined with the same value ({2}).
+EventSource_IllegalKeywordsValue = Keyword {0} has a value of {1} which is outside the legal range (0-0x0000080000000000).
+EventSource_KeywordCollision = Keywords {0} and {1} are defined with the same value ({2}).
+EventSource_EventChannelOutOfRange = Channel {0} has a value of {1} which is outside the legal range (16-254).
+EventSource_ChannelTypeDoesNotMatchEventChannelValue = Channel {0} does not match event channel value {1}.
+EventSource_MaxChannelExceeded = Attempt to define more than the maximum limit of 8 channels for a provider.
+EventSource_DuplicateStringKey = Multiple definitions for string "{0}".
+EventSource_EventWithAdminChannelMustHaveMessage = Event {0} specifies an Admin channel {1}. It must specify a Message property.
+EventSource_UnsupportedMessageProperty = Event {0} specifies an illegal or unsupported formatting message ("{1}").
+EventSource_AbstractMustNotDeclareKTOC = Abstract event source must not declare {0} nested type.
+EventSource_AbstractMustNotDeclareEventMethods = Abstract event source must not declare event methods ({0} with ID {1}).
+EventSource_EventMustNotBeExplicitImplementation = Event method {0} (with ID {1}) is an explicit interface method implementation. Re-write method as implicit implementation.
+EventSource_EventParametersMismatch = Event {0} was called with {1} argument(s) , but it is defined with {2} paramenter(s).
+EventSource_InvalidCommand = Invalid command value.
+EventSource_InvalidEventFormat = Can't specify both etw event format flags.
+EventSource_AddScalarOutOfRange = Getting out of bounds during scalar addition.
+EventSource_PinArrayOutOfRange = Pins are out of range.
+EventSource_DataDescriptorsOutOfRange = Data descriptors are out of range.
+EventSource_NotSupportedArrayOfNil = Arrays of Nil are not supported.
+EventSource_NotSupportedArrayOfBinary = Arrays of Binary are not supported.
+EventSource_NotSupportedArrayOfNullTerminatedString = Arrays of null-terminated string are not supported.
+EventSource_TooManyFields = Too many fields in structure.
+EventSource_RecursiveTypeDefinition = Recursive type definition is not supported.
+EventSource_NotSupportedEnumType = Enum type {0} underlying type {1} is not supported for serialization.
+EventSource_NonCompliantTypeError = The API supports only anonymous types or types decorated with the EventDataAttribute. Non-compliant type: {0} dataType.
+EventSource_NotSupportedNestedArraysEnums = Nested arrays/enumerables are not supported.
+EventSource_IncorrentlyAuthoredTypeInfo = Incorrectly-authored TypeInfo - a type should be serialized as one field or as one group
+EventSource_NotSupportedCustomSerializedData = Enumerables of custom-serialized data are not supported
+EventSource_StopsFollowStarts = An event with stop suffix must follow a corresponding event with a start suffix.
+EventSource_NoRelatedActivityId = EventSource expects the first parameter of the Event method to be of type Guid and to be named "relatedActivityId" when calling WriteEventWithRelatedActivityId.
+EventSource_VarArgsParameterMismatch = The parameters to the Event method do not match the parameters to the WriteEvent method. This may cause the event to be displayed incorrectly.
; ExecutionEngineException
ExecutionEngine_InvalidAttribute = Attribute cannot have multiple definitions.
@@ -1015,6 +1046,7 @@ ExecutionEngine_MissingSecurityDescriptor = Unable to retrieve security descript
;;ExecutionContext
ExecutionContext_UndoFailed = Undo operation on a component context threw an exception
+ExecutionContext_ExceptionInAsyncLocalNotification = An exception was not handled in an AsyncLocal<T> notification callback.
; FieldAccessException
@@ -1094,8 +1126,6 @@ InvalidOperation_AddContextFrozen = Attempted to add properties to a frozen cont
InvalidOperation_AppDomainSandboxAPINeedsExplicitAppBase = This API requires the ApplicationBase to be specified explicitly in the AppDomainSetup parameter.
InvalidOperation_CantCancelCtrlBreak = Applications may not prevent control-break from terminating their process.
InvalidOperation_CalledTwice = The method cannot be called twice on the same instance.
-;InvalidOperation_CancellationRegionLeak = A nested cancellation region was not disposed of correctly. The thread's cancellation regions are now potentially invalid.
-;InvalidOperation_CancellationSignalReuse = Cannot reuse a cancellation signal while it is still in use.
InvalidOperation_CollectionCorrupted = A prior operation on this collection was interrupted by an exception. Collection's state is no longer trusted.
InvalidOperation_CriticalTransparentAreMutuallyExclusive = SecurityTransparent and SecurityCritical attributes cannot be applied to the assembly scope at the same time.
InvalidOperation_SubclassedObject = Cannot set sub-classed {0} object to {1} object.
@@ -1192,7 +1222,6 @@ InvalidOperation_PIAMustBeStrongNamed = Primary interop assemblies must be stron
InvalidOperation_HashInsertFailed = Hashtable insert failed. Load factor too high. The most common cause is multiple threads writing to the Hashtable simultaneously.
InvalidOperation_UnknownEnumType = Unknown enum type.
InvalidOperation_GetVersion = OSVersion's call to GetVersionEx failed.
-InvalidOperation_InvalidPlatformID = Unrecognized OS PlatformId.
InvalidOperation_DateTimeParsing = Internal Error in DateTime and Calendar operations.
InvalidOperation_UserDomainName = UserDomainName native call failed.
InvalidOperation_WaitOnTransparentProxy = Cannot wait on a transparent proxy.
@@ -1379,7 +1408,7 @@ NotSupported_CreateInstanceWithTypeBuilder = CreateInstance cannot be used with
NotSupported_NonUrlAttrOnMBR = UrlAttribute is the only attribute supported for MarshalByRefObject.
NotSupported_ActivAttrOnNonMBR = Activation Attributes are not supported for types not deriving from MarshalByRefObject.
NotSupported_ActivForCom = Activation Attributes not supported for COM Objects.
-NotSupported_NoCodepageData = No data is available for encoding {0}.
+NotSupported_NoCodepageData = No data is available for encoding {0}. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.
NotSupported_CodePage50229 = The ISO-2022-CN Encoding (Code page 50229) is not supported.
NotSupported_DynamicAssemblyNoRunAccess = Cannot execute code on a dynamic assembly without run access.
NotSupported_IDispInvokeDefaultMemberWithNamedArgs = Invoking default method with named arguments is not supported.
@@ -1852,12 +1881,7 @@ PrivilegeNotHeld_Named = The process does not possess the '{0}' privilege which
; General strings used in the IO package
IO_UnknownFileName = [Unknown]
-#if PLATFORM_UNIX
-IO_StreamWriterBufferedDataLost = A StreamWriter was not closed and all buffered data within that StreamWriter was not flushed to the underlying stream. (This was detected when the StreamWriter was finalized with data in its buffer.) A portion of the data was lost. Consider one of calling Close(), Flush(), setting the StreamWriter's AutoFlush property to true, or allocating the StreamWriter with a "using" statement. Stream type: {0}\nFile name: {1}\nAllocated from:\n {2}
-#endif
-#if !PLATFORM_UNIX
IO_StreamWriterBufferedDataLost = A StreamWriter was not closed and all buffered data within that StreamWriter was not flushed to the underlying stream. (This was detected when the StreamWriter was finalized with data in its buffer.) A portion of the data was lost. Consider one of calling Close(), Flush(), setting the StreamWriter's AutoFlush property to true, or allocating the StreamWriter with a "using" statement. Stream type: {0}\r\nFile name: {1}\r\nAllocated from:\r\n {2}
-#endif // PLATFORM_UNIX else
IO_StreamWriterBufferedDataLostCaptureAllocatedFromCallstackNotEnabled = callstack information is not captured by default for performance reasons. Please enable captureAllocatedCallStack config switch for streamWriterBufferedDataLost MDA (refer to MSDN MDA documentation for how to do this).
;
@@ -2217,6 +2241,10 @@ Loader_ContextPolicies = Context Policies:
AppDomain_RequireApplicationName = ApplicationName must be set before the DynamicBase can be set.
AppDomain_AppBaseNotSet = The ApplicationBase must be set before retrieving this property.
+#if FEATURE_HOST_ASSEMBLY_RESOLVER
+AppDomain_BindingModelIsLocked = Binding model is already locked for the AppDomain and cannot be reset.
+Argument_CustomAssemblyLoadContextRequestedNameMismatch = Resolved assembly's simple name should be the same as of the requested assembly.
+#endif // FEATURE_HOST_ASSEMBLY_RESOLVER
;
; XMLSyntaxExceptions
XMLSyntax_UnexpectedEndOfFile = Unexpected end of file.
@@ -2320,7 +2348,7 @@ TimeZoneNotFound_MissingRegistryData = The time zone ID '{0}' was not found on t
; Tuple
ArgumentException_TupleIncorrectType=Argument must be of type {0}.
ArgumentException_TupleNonIComparableElement=The tuple contains an element of type {0} which does not implement the IComparable interface.
-ArgumentException_TupleLastArgumentNotATuple=The last element of an eight element tuple must be a Tuple.
+ArgumentException_TupleLastArgumentNotATuple=The last element of an eight element Tuple must be a Tuple.
ArgumentException_OtherNotArrayOfCorrectLength=Object is not a array with the same number of elements as the array to compare it to.
; WinRT collection adapters
@@ -2339,60 +2367,106 @@ InvalidOperation_CannotRemoveLastFromEmptyCollection=Cannot remove the last elem
Globalization.LegacyModifier = Legacy
;
-;Total items: 393
+;Total items: 809
;
Globalization.ci_ = Invariant Language (Invariant Country)
+Globalization.ci_aa = Afar
+Globalization.ci_aa-DJ = Afar (Djibouti)
+Globalization.ci_aa-ER = Afar (Eritrea)
+Globalization.ci_aa-ET = Afar (Ethiopia)
Globalization.ci_af = Afrikaans
+Globalization.ci_af-NA = Afrikaans (Namibia)
Globalization.ci_af-ZA = Afrikaans (South Africa)
+Globalization.ci_agq = Aghem
+Globalization.ci_agq-CM = Aghem (Cameroon)
+Globalization.ci_ak = Akan
+Globalization.ci_ak-GH = Akan (Ghana)
Globalization.ci_am = Amharic
Globalization.ci_am-ET = Amharic (Ethiopia)
Globalization.ci_ar = Arabic
+Globalization.ci_ar-001 = Arabic (World)
Globalization.ci_ar-AE = Arabic (U.A.E.)
Globalization.ci_ar-BH = Arabic (Bahrain)
+Globalization.ci_ar-DJ = Arabic (Djibouti)
Globalization.ci_ar-DZ = Arabic (Algeria)
Globalization.ci_ar-EG = Arabic (Egypt)
+Globalization.ci_ar-ER = Arabic (Eritrea)
+Globalization.ci_ar-IL = Arabic (Israel)
Globalization.ci_ar-IQ = Arabic (Iraq)
Globalization.ci_ar-JO = Arabic (Jordan)
+Globalization.ci_ar-KM = Arabic (Comoros)
Globalization.ci_ar-KW = Arabic (Kuwait)
Globalization.ci_ar-LB = Arabic (Lebanon)
Globalization.ci_ar-LY = Arabic (Libya)
Globalization.ci_ar-MA = Arabic (Morocco)
+Globalization.ci_ar-MR = Arabic (Mauritania)
Globalization.ci_ar-OM = Arabic (Oman)
+Globalization.ci_ar-PS = Arabic (Palestinian Authority)
Globalization.ci_ar-QA = Arabic (Qatar)
Globalization.ci_ar-SA = Arabic (Saudi Arabia)
+Globalization.ci_ar-SD = Arabic (Sudan)
+Globalization.ci_ar-SO = Arabic (Somalia)
+Globalization.ci_ar-SS = Arabic (South Sudan)
Globalization.ci_ar-SY = Arabic (Syria)
+Globalization.ci_ar-TD = Arabic (Chad)
Globalization.ci_ar-TN = Arabic (Tunisia)
Globalization.ci_ar-YE = Arabic (Yemen)
Globalization.ci_arn = Mapudungun
Globalization.ci_arn-CL = Mapudungun (Chile)
Globalization.ci_as = Assamese
Globalization.ci_as-IN = Assamese (India)
-Globalization.ci_az = Azeri
-Globalization.ci_az-Cyrl = Azeri (Cyrillic)
-Globalization.ci_az-Cyrl-AZ = Azeri (Cyrillic, Azerbaijan)
-Globalization.ci_az-Latn = Azeri (Latin)
-Globalization.ci_az-Latn-AZ = Azeri (Latin, Azerbaijan)
+Globalization.ci_asa = Asu
+Globalization.ci_asa-TZ = Asu (Tanzania)
+Globalization.ci_ast = Asturian
+Globalization.ci_ast-ES = Asturian (Spain)
+Globalization.ci_az = Azerbaijani
+Globalization.ci_az-Cyrl = Azerbaijani (Cyrillic)
+Globalization.ci_az-Cyrl-AZ = Azerbaijani (Cyrillic, Azerbaijan)
+Globalization.ci_az-Latn = Azerbaijani (Latin)
+Globalization.ci_az-Latn-AZ = Azerbaijani (Latin, Azerbaijan)
Globalization.ci_ba = Bashkir
Globalization.ci_ba-RU = Bashkir (Russia)
+Globalization.ci_bas = Basaa
+Globalization.ci_bas-CM = Basaa (Cameroon)
Globalization.ci_be = Belarusian
Globalization.ci_be-BY = Belarusian (Belarus)
+Globalization.ci_bem = Bemba
+Globalization.ci_bem-ZM = Bemba (Zambia)
+Globalization.ci_bez = Bena
+Globalization.ci_bez-TZ = Bena (Tanzania)
Globalization.ci_bg = Bulgarian
Globalization.ci_bg-BG = Bulgarian (Bulgaria)
-Globalization.ci_bn = Bengali
-Globalization.ci_bn-BD = Bengali (Bangladesh)
-Globalization.ci_bn-IN = Bengali (India)
+Globalization.ci_bin = Edo
+Globalization.ci_bin-NG = Edo (Nigeria)
+Globalization.ci_bm = Bambara
+Globalization.ci_bm-Latn = Bambara (Latin)
+Globalization.ci_bm-Latn-ML = Bambara (Latin, Mali)
+Globalization.ci_bm-ML = Bamanankan (Latin, Mali)
+Globalization.ci_bn = Bangla
+Globalization.ci_bn-BD = Bangla (Bangladesh)
+Globalization.ci_bn-IN = Bangla (India)
Globalization.ci_bo = Tibetan
Globalization.ci_bo-CN = Tibetan (PRC)
+Globalization.ci_bo-IN = Tibetan (India)
Globalization.ci_br = Breton
Globalization.ci_br-FR = Breton (France)
+Globalization.ci_brx = Bodo
+Globalization.ci_brx-IN = Bodo (India)
Globalization.ci_bs = Bosnian
Globalization.ci_bs-Cyrl = Bosnian (Cyrillic)
Globalization.ci_bs-Cyrl-BA = Bosnian (Cyrillic, Bosnia and Herzegovina)
Globalization.ci_bs-Latn = Bosnian (Latin)
Globalization.ci_bs-Latn-BA = Bosnian (Latin, Bosnia and Herzegovina)
+Globalization.ci_byn = Blin
+Globalization.ci_byn-ER = Blin (Eritrea)
Globalization.ci_ca = Catalan
+Globalization.ci_ca-AD = Catalan (Andorra)
Globalization.ci_ca-ES = Catalan (Catalan)
Globalization.ci_ca-ES-valencia = Valencian (Spain)
+Globalization.ci_ca-FR = Catalan (France)
+Globalization.ci_ca-IT = Catalan (Italy)
+Globalization.ci_cgg = Chiga
+Globalization.ci_cgg-UG = Chiga (Uganda)
Globalization.ci_chr = Cherokee
Globalization.ci_chr-Cher = Cherokee (Cherokee)
Globalization.ci_chr-Cher-US = Cherokee (Cherokee)
@@ -2404,52 +2478,154 @@ Globalization.ci_cy = Welsh
Globalization.ci_cy-GB = Welsh (United Kingdom)
Globalization.ci_da = Danish
Globalization.ci_da-DK = Danish (Denmark)
+Globalization.ci_da-GL = Danish (Greenland)
+Globalization.ci_dav = Taita
+Globalization.ci_dav-KE = Taita (Kenya)
Globalization.ci_de = German
Globalization.ci_de-AT = German (Austria)
+Globalization.ci_de-BE = German (Belgium)
Globalization.ci_de-CH = German (Switzerland)
Globalization.ci_de-DE = German (Germany)
Globalization.ci_de-DE_phoneb = German (Germany)
Globalization.ci_de-LI = German (Liechtenstein)
Globalization.ci_de-LU = German (Luxembourg)
+Globalization.ci_dje = Zarma
+Globalization.ci_dje-NE = Zarma (Niger)
Globalization.ci_dsb = Lower Sorbian
Globalization.ci_dsb-DE = Lower Sorbian (Germany)
+Globalization.ci_dua = Duala
+Globalization.ci_dua-CM = Duala (Cameroon)
Globalization.ci_dv = Divehi
Globalization.ci_dv-MV = Divehi (Maldives)
+Globalization.ci_dyo = Jola-Fonyi
+Globalization.ci_dyo-SN = Jola-Fonyi (Senegal)
+Globalization.ci_dz = Dzongkha
+Globalization.ci_dz-BT = Dzongkha (Bhutan)
+Globalization.ci_ebu = Embu
+Globalization.ci_ebu-KE = Embu (Kenya)
+Globalization.ci_ee = Ewe
+Globalization.ci_ee-GH = Ewe (Ghana)
+Globalization.ci_ee-TG = Ewe (Togo)
Globalization.ci_el = Greek
+Globalization.ci_el-CY = Greek (Cyprus)
Globalization.ci_el-GR = Greek (Greece)
Globalization.ci_en = English
+Globalization.ci_en-001 = English (World)
Globalization.ci_en-029 = English (Caribbean)
+Globalization.ci_en-150 = English (Europe)
+Globalization.ci_en-AG = English (Antigua and Barbuda)
+Globalization.ci_en-AI = English (Anguilla)
+Globalization.ci_en-AS = English (American Samoa)
Globalization.ci_en-AU = English (Australia)
+Globalization.ci_en-BB = English (Barbados)
+Globalization.ci_en-BE = English (Belgium)
+Globalization.ci_en-BM = English (Bermuda)
+Globalization.ci_en-BS = English (Bahamas)
+Globalization.ci_en-BW = English (Botswana)
Globalization.ci_en-BZ = English (Belize)
Globalization.ci_en-CA = English (Canada)
+Globalization.ci_en-CC = English (Cocos [Keeling] Islands)
+Globalization.ci_en-CK = English (Cook Islands)
+Globalization.ci_en-CM = English (Cameroon)
+Globalization.ci_en-CX = English (Christmas Island)
+Globalization.ci_en-DM = English (Dominica)
+Globalization.ci_en-ER = English (Eritrea)
+Globalization.ci_en-FJ = English (Fiji)
+Globalization.ci_en-FK = English (Falkland Islands)
+Globalization.ci_en-FM = English (Micronesia)
Globalization.ci_en-GB = English (United Kingdom)
+Globalization.ci_en-GD = English (Grenada)
+Globalization.ci_en-GG = English (Guernsey)
+Globalization.ci_en-GH = English (Ghana)
+Globalization.ci_en-GI = English (Gibraltar)
+Globalization.ci_en-GM = English (Gambia)
+Globalization.ci_en-GU = English (Guam)
+Globalization.ci_en-GY = English (Guyana)
+Globalization.ci_en-HK = English (Hong Kong SAR)
+Globalization.ci_en-ID = English (Indonesia)
Globalization.ci_en-IE = English (Ireland)
+Globalization.ci_en-IM = English (Isle of Man)
Globalization.ci_en-IN = English (India)
+Globalization.ci_en-IO = English (British Indian Ocean Territory)
+Globalization.ci_en-JE = English (Jersey)
Globalization.ci_en-JM = English (Jamaica)
+Globalization.ci_en-KE = English (Kenya)
+Globalization.ci_en-KI = English (Kiribati)
+Globalization.ci_en-KN = English (Saint Kitts and Nevis)
+Globalization.ci_en-KY = English (Cayman Islands)
+Globalization.ci_en-LC = English (Saint Lucia)
+Globalization.ci_en-LR = English (Liberia)
+Globalization.ci_en-LS = English (Lesotho)
+Globalization.ci_en-MG = English (Madagascar)
+Globalization.ci_en-MH = English (Marshall Islands)
+Globalization.ci_en-MO = English (Macao SAR)
+Globalization.ci_en-MP = English (Northern Mariana Islands)
+Globalization.ci_en-MS = English (Montserrat)
+Globalization.ci_en-MT = English (Malta)
+Globalization.ci_en-MU = English (Mauritius)
+Globalization.ci_en-MW = English (Malawi)
Globalization.ci_en-MY = English (Malaysia)
+Globalization.ci_en-NA = English (Namibia)
+Globalization.ci_en-NF = English (Norfolk Island)
+Globalization.ci_en-NG = English (Nigeria)
+Globalization.ci_en-NR = English (Nauru)
+Globalization.ci_en-NU = English (Niue)
Globalization.ci_en-NZ = English (New Zealand)
+Globalization.ci_en-PG = English (Papua New Guinea)
Globalization.ci_en-PH = English (Republic of the Philippines)
+Globalization.ci_en-PK = English (Pakistan)
+Globalization.ci_en-PN = English (Pitcairn Islands)
+Globalization.ci_en-PR = English (Puerto Rico)
+Globalization.ci_en-PW = English (Palau)
+Globalization.ci_en-RW = English (Rwanda)
+Globalization.ci_en-SB = English (Solomon Islands)
+Globalization.ci_en-SC = English (Seychelles)
+Globalization.ci_en-SD = English (Sudan)
Globalization.ci_en-SG = English (Singapore)
+Globalization.ci_en-SH = English (St Helena, Ascension, Tristan da Cunha)
+Globalization.ci_en-SL = English (Sierra Leone)
+Globalization.ci_en-SS = English (South Sudan)
+Globalization.ci_en-SX = English (Sint Maarten)
+Globalization.ci_en-SZ = English (Swaziland)
+Globalization.ci_en-TC = English (Turks and Caicos Islands)
+Globalization.ci_en-TK = English (Tokelau)
+Globalization.ci_en-TO = English (Tonga)
Globalization.ci_en-TT = English (Trinidad and Tobago)
+Globalization.ci_en-TV = English (Tuvalu)
+Globalization.ci_en-TZ = English (Tanzania)
+Globalization.ci_en-UG = English (Uganda)
+Globalization.ci_en-UM = English (US Minor Outlying Islands)
Globalization.ci_en-US = English (United States)
+Globalization.ci_en-VC = English (Saint Vincent and the Grenadines)
+Globalization.ci_en-VG = English (British Virgin Islands)
+Globalization.ci_en-VI = English (US Virgin Islands)
+Globalization.ci_en-VU = English (Vanuatu)
+Globalization.ci_en-WS = English (Samoa)
Globalization.ci_en-ZA = English (South Africa)
+Globalization.ci_en-ZM = English (Zambia)
Globalization.ci_en-ZW = English (Zimbabwe)
+Globalization.ci_eo = Esperanto
+Globalization.ci_eo-001 = Esperanto (World)
Globalization.ci_es = Spanish
+Globalization.ci_es-419 = Spanish (Latin America)
Globalization.ci_es-AR = Spanish (Argentina)
Globalization.ci_es-BO = Spanish (Bolivia)
Globalization.ci_es-CL = Spanish (Chile)
Globalization.ci_es-CO = Spanish (Colombia)
Globalization.ci_es-CR = Spanish (Costa Rica)
+Globalization.ci_es-CU = Spanish (Cuba)
Globalization.ci_es-DO = Spanish (Dominican Republic)
Globalization.ci_es-EC = Spanish (Ecuador)
Globalization.ci_es-ES = Spanish (Spain)
Globalization.ci_es-ES_tradnl = Spanish (Spain)
+Globalization.ci_es-GQ = Spanish (Equatorial Guinea)
Globalization.ci_es-GT = Spanish (Guatemala)
Globalization.ci_es-HN = Spanish (Honduras)
Globalization.ci_es-MX = Spanish (Mexico)
Globalization.ci_es-NI = Spanish (Nicaragua)
Globalization.ci_es-PA = Spanish (Panama)
Globalization.ci_es-PE = Spanish (Peru)
+Globalization.ci_es-PH = Spanish (Philippines)
Globalization.ci_es-PR = Spanish (Puerto Rico)
Globalization.ci_es-PY = Spanish (Paraguay)
Globalization.ci_es-SV = Spanish (El Salvador)
@@ -2460,11 +2636,18 @@ Globalization.ci_et = Estonian
Globalization.ci_et-EE = Estonian (Estonia)
Globalization.ci_eu = Basque
Globalization.ci_eu-ES = Basque (Basque)
+Globalization.ci_ewo = Ewondo
+Globalization.ci_ewo-CM = Ewondo (Cameroon)
Globalization.ci_fa = Persian
-Globalization.ci_fa-IR = Persian
+Globalization.ci_fa-AF = Persian (Afghanistan)
+Globalization.ci_fa-IR = Persian (Iran)
Globalization.ci_ff = Fulah
+Globalization.ci_ff-CM = Fulah (Cameroon)
+Globalization.ci_ff-GN = Fulah (Guinea)
Globalization.ci_ff-Latn = Fulah (Latin)
Globalization.ci_ff-Latn-SN = Fulah (Latin, Senegal)
+Globalization.ci_ff-MR = Fulah (Mauritania)
+Globalization.ci_ff-NG = Fulah (Nigeria)
Globalization.ci_fi = Finnish
Globalization.ci_fi-FI = Finnish (Finland)
Globalization.ci_fil = Filipino
@@ -2472,12 +2655,55 @@ Globalization.ci_fil-PH = Filipino (Philippines)
Globalization.ci_fo = Faroese
Globalization.ci_fo-FO = Faroese (Faroe Islands)
Globalization.ci_fr = French
+Globalization.ci_fr-029 = French (Caribbean)
Globalization.ci_fr-BE = French (Belgium)
+Globalization.ci_fr-BF = French (Burkina Faso)
+Globalization.ci_fr-BI = French (Burundi)
+Globalization.ci_fr-BJ = French (Benin)
+Globalization.ci_fr-BL = French (Saint Barthélemy)
Globalization.ci_fr-CA = French (Canada)
+Globalization.ci_fr-CD = French (Congo DRC)
+Globalization.ci_fr-CF = French (Central African Republic)
+Globalization.ci_fr-CG = French (Congo)
Globalization.ci_fr-CH = French (Switzerland)
+Globalization.ci_fr-CI = French (Côte d’Ivoire)
+Globalization.ci_fr-CM = French (Cameroon)
+Globalization.ci_fr-DJ = French (Djibouti)
+Globalization.ci_fr-DZ = French (Algeria)
Globalization.ci_fr-FR = French (France)
+Globalization.ci_fr-GA = French (Gabon)
+Globalization.ci_fr-GF = French (French Guiana)
+Globalization.ci_fr-GN = French (Guinea)
+Globalization.ci_fr-GP = French (Guadeloupe)
+Globalization.ci_fr-GQ = French (Equatorial Guinea)
+Globalization.ci_fr-HT = French (Haiti)
+Globalization.ci_fr-KM = French (Comoros)
Globalization.ci_fr-LU = French (Luxembourg)
+Globalization.ci_fr-MA = French (Morocco)
Globalization.ci_fr-MC = French (Monaco)
+Globalization.ci_fr-MF = French (Saint Martin)
+Globalization.ci_fr-MG = French (Madagascar)
+Globalization.ci_fr-ML = French (Mali)
+Globalization.ci_fr-MQ = French (Martinique)
+Globalization.ci_fr-MR = French (Mauritania)
+Globalization.ci_fr-MU = French (Mauritius)
+Globalization.ci_fr-NC = French (New Caledonia)
+Globalization.ci_fr-NE = French (Niger)
+Globalization.ci_fr-PF = French (French Polynesia)
+Globalization.ci_fr-PM = French (Saint Pierre and Miquelon)
+Globalization.ci_fr-RE = French (Reunion)
+Globalization.ci_fr-RW = French (Rwanda)
+Globalization.ci_fr-SC = French (Seychelles)
+Globalization.ci_fr-SN = French (Senegal)
+Globalization.ci_fr-SY = French (Syria)
+Globalization.ci_fr-TD = French (Chad)
+Globalization.ci_fr-TG = French (Togo)
+Globalization.ci_fr-TN = French (Tunisia)
+Globalization.ci_fr-VU = French (Vanuatu)
+Globalization.ci_fr-WF = French (Wallis and Futuna)
+Globalization.ci_fr-YT = French (Mayotte)
+Globalization.ci_fur = Friulian
+Globalization.ci_fur-IT = Friulian (Italy)
Globalization.ci_fy = Frisian
Globalization.ci_fy-NL = Frisian (Netherlands)
Globalization.ci_ga = Irish
@@ -2486,12 +2712,22 @@ Globalization.ci_gd = Scottish Gaelic
Globalization.ci_gd-GB = Scottish Gaelic (United Kingdom)
Globalization.ci_gl = Galician
Globalization.ci_gl-ES = Galician (Galician)
+Globalization.ci_gn = Guarani
+Globalization.ci_gn-PY = Guarani (Paraguay)
Globalization.ci_gsw = Alsatian
+Globalization.ci_gsw-CH = Alsatian (Switzerland)
Globalization.ci_gsw-FR = Alsatian (France)
+Globalization.ci_gsw-LI = Alsatian (Liechtenstein)
Globalization.ci_gu = Gujarati
Globalization.ci_gu-IN = Gujarati (India)
+Globalization.ci_guz = Gusii
+Globalization.ci_guz-KE = Gusii (Kenya)
+Globalization.ci_gv = Manx
+Globalization.ci_gv-IM = Manx (Isle of Man)
Globalization.ci_ha = Hausa
Globalization.ci_ha-Latn = Hausa (Latin)
+Globalization.ci_ha-Latn-GH = Hausa (Latin, Ghana)
+Globalization.ci_ha-Latn-NE = Hausa (Latin, Niger)
Globalization.ci_ha-Latn-NG = Hausa (Latin, Nigeria)
Globalization.ci_haw = Hawaiian
Globalization.ci_haw-US = Hawaiian (United States)
@@ -2509,6 +2745,11 @@ Globalization.ci_hu-HU = Hungarian (Hungary)
Globalization.ci_hu-HU_technl = Hungarian (Hungary)
Globalization.ci_hy = Armenian
Globalization.ci_hy-AM = Armenian (Armenia)
+Globalization.ci_ia = Interlingua
+Globalization.ci_ia-001 = Interlingua (World)
+Globalization.ci_ia-FR = Interlingua (France)
+Globalization.ci_ibb = Ibibio
+Globalization.ci_ibb-NG = Ibibio (Nigeria)
Globalization.ci_id = Indonesian
Globalization.ci_id-ID = Indonesian (Indonesia)
Globalization.ci_ig = Igbo
@@ -2520,6 +2761,7 @@ Globalization.ci_is-IS = Icelandic (Iceland)
Globalization.ci_it = Italian
Globalization.ci_it-CH = Italian (Switzerland)
Globalization.ci_it-IT = Italian (Italy)
+Globalization.ci_it-SM = Italian (San Marino)
Globalization.ci_iu = Inuktitut
Globalization.ci_iu-Cans = Inuktitut (Syllabics)
Globalization.ci_iu-Cans-CA = Inuktitut (Syllabics, Canada)
@@ -2528,13 +2770,38 @@ Globalization.ci_iu-Latn-CA = Inuktitut (Latin, Canada)
Globalization.ci_ja = Japanese
Globalization.ci_ja-JP = Japanese (Japan)
Globalization.ci_ja-JP_radstr = Japanese (Japan)
+Globalization.ci_jgo = Ngomba
+Globalization.ci_jgo-CM = Ngomba (Cameroon)
+Globalization.ci_jmc = Machame
+Globalization.ci_jmc-TZ = Machame (Tanzania)
+Globalization.ci_jv = Javanese
+Globalization.ci_jv-Java = Javanese (Javanese)
+Globalization.ci_jv-Java-ID = Javanese (Javanese, Indonesia)
+Globalization.ci_jv-Latn = Javanese
+Globalization.ci_jv-Latn-ID = Javanese (Indonesia)
Globalization.ci_ka = Georgian
Globalization.ci_ka-GE = Georgian (Georgia)
Globalization.ci_ka-GE_modern = Georgian (Georgia)
+Globalization.ci_kab = Kabyle
+Globalization.ci_kab-DZ = Kabyle (Algeria)
+Globalization.ci_kam = Kamba
+Globalization.ci_kam-KE = Kamba (Kenya)
+Globalization.ci_kde = Makonde
+Globalization.ci_kde-TZ = Makonde (Tanzania)
+Globalization.ci_kea = Kabuverdianu
+Globalization.ci_kea-CV = Kabuverdianu (Cabo Verde)
+Globalization.ci_khq = Koyra Chiini
+Globalization.ci_khq-ML = Koyra Chiini (Mali)
+Globalization.ci_ki = Kikuyu
+Globalization.ci_ki-KE = Kikuyu (Kenya)
Globalization.ci_kk = Kazakh
Globalization.ci_kk-KZ = Kazakh (Kazakhstan)
+Globalization.ci_kkj = Kako
+Globalization.ci_kkj-CM = Kako (Cameroon)
Globalization.ci_kl = Greenlandic
Globalization.ci_kl-GL = Greenlandic (Greenland)
+Globalization.ci_kln = Kalenjin
+Globalization.ci_kln-KE = Kalenjin (Kenya)
Globalization.ci_km = Khmer
Globalization.ci_km-KH = Khmer (Cambodia)
Globalization.ci_kn = Kannada
@@ -2543,19 +2810,66 @@ Globalization.ci_ko = Korean
Globalization.ci_ko-KR = Korean (Korea)
Globalization.ci_kok = Konkani
Globalization.ci_kok-IN = Konkani (India)
+Globalization.ci_kr = Kanuri
+Globalization.ci_kr-NG = Kanuri (Nigeria)
+Globalization.ci_ks = Kashmiri
+Globalization.ci_ks-Arab = Kashmiri (Perso-Arabic)
+Globalization.ci_ks-Arab-IN = Kashmiri (Perso-Arabic)
+Globalization.ci_ks-Deva = Kashmiri (Devanagari)
+Globalization.ci_ks-Deva-IN = Kashmiri (Devanagari, India)
+Globalization.ci_ksb = Shambala
+Globalization.ci_ksb-TZ = Shambala (Tanzania)
+Globalization.ci_ksf = Bafia
+Globalization.ci_ksf-CM = Bafia (Cameroon)
+Globalization.ci_ksh = Colognian
+Globalization.ci_ksh-DE = Ripuarian (Germany)
Globalization.ci_ku = Central Kurdish
Globalization.ci_ku-Arab = Central Kurdish (Arabic)
Globalization.ci_ku-Arab-IQ = Central Kurdish (Iraq)
+Globalization.ci_kw = Cornish
+Globalization.ci_kw-GB = Cornish (United Kingdom)
Globalization.ci_ky = Kyrgyz
Globalization.ci_ky-KG = Kyrgyz (Kyrgyzstan)
+Globalization.ci_la = Latin
+Globalization.ci_la-001 = Latin (World)
+Globalization.ci_lag = Langi
+Globalization.ci_lag-TZ = Langi (Tanzania)
Globalization.ci_lb = Luxembourgish
Globalization.ci_lb-LU = Luxembourgish (Luxembourg)
+Globalization.ci_lg = Ganda
+Globalization.ci_lg-UG = Ganda (Uganda)
+Globalization.ci_lkt = Lakota
+Globalization.ci_lkt-US = Lakota (United States)
+Globalization.ci_ln = Lingala
+Globalization.ci_ln-AO = Lingala (Angola)
+Globalization.ci_ln-CD = Lingala (Congo DRC)
+Globalization.ci_ln-CF = Lingala (Central African Republic)
+Globalization.ci_ln-CG = Lingala (Congo)
Globalization.ci_lo = Lao
Globalization.ci_lo-LA = Lao (Lao P.D.R.)
Globalization.ci_lt = Lithuanian
Globalization.ci_lt-LT = Lithuanian (Lithuania)
+Globalization.ci_lu = Luba-Katanga
+Globalization.ci_lu-CD = Luba-Katanga (Congo DRC)
+Globalization.ci_luo = Luo
+Globalization.ci_luo-KE = Luo (Kenya)
+Globalization.ci_luy = Luyia
+Globalization.ci_luy-KE = Luyia (Kenya)
Globalization.ci_lv = Latvian
Globalization.ci_lv-LV = Latvian (Latvia)
+Globalization.ci_mas = Masai
+Globalization.ci_mas-KE = Masai (Kenya)
+Globalization.ci_mas-TZ = Masai (Tanzania)
+Globalization.ci_mer = Meru
+Globalization.ci_mer-KE = Meru (Kenya)
+Globalization.ci_mfe = Morisyen
+Globalization.ci_mfe-MU = Morisyen (Mauritius)
+Globalization.ci_mg = Malagasy
+Globalization.ci_mg-MG = Malagasy (Madagascar)
+Globalization.ci_mgh = Makhuwa-Meetto
+Globalization.ci_mgh-MZ = Makhuwa-Meetto (Mozambique)
+Globalization.ci_mgo = Meta'
+Globalization.ci_mgo-CM = Meta' (Cameroon)
Globalization.ci_mi = Maori
Globalization.ci_mi-NZ = Maori (New Zealand)
Globalization.ci_mk = Macedonian (FYROM)
@@ -2567,6 +2881,9 @@ Globalization.ci_mn-Cyrl = Mongolian (Cyrillic)
Globalization.ci_mn-MN = Mongolian (Cyrillic, Mongolia)
Globalization.ci_mn-Mong = Mongolian (Traditional Mongolian)
Globalization.ci_mn-Mong-CN = Mongolian (Traditional Mongolian, PRC)
+Globalization.ci_mn-Mong-MN = Mongolian (Traditional Mongolian, Mongolia)
+Globalization.ci_mni = Manipuri
+Globalization.ci_mni-IN = Manipuri (India)
Globalization.ci_moh = Mohawk
Globalization.ci_moh-CA = Mohawk (Mohawk)
Globalization.ci_mr = Marathi
@@ -2574,28 +2891,65 @@ Globalization.ci_mr-IN = Marathi (India)
Globalization.ci_ms = Malay
Globalization.ci_ms-BN = Malay (Brunei Darussalam)
Globalization.ci_ms-MY = Malay (Malaysia)
+Globalization.ci_ms-SG = Malay (Latin, Singapore)
Globalization.ci_mt = Maltese
Globalization.ci_mt-MT = Maltese (Malta)
+Globalization.ci_mua = Mundang
+Globalization.ci_mua-CM = Mundang (Cameroon)
+Globalization.ci_my = Burmese
+Globalization.ci_my-MM = Burmese (Myanmar)
+Globalization.ci_naq = Nama
+Globalization.ci_naq-NA = Nama (Namibia)
Globalization.ci_nb = Norwegian (Bokmål)
Globalization.ci_nb-NO = Norwegian, Bokmål (Norway)
+Globalization.ci_nb-SJ = Norwegian, Bokmål (Svalbard and Jan Mayen)
+Globalization.ci_nd = North Ndebele
+Globalization.ci_nd-ZW = North Ndebele (Zimbabwe)
Globalization.ci_ne = Nepali
+Globalization.ci_ne-IN = Nepali (India)
Globalization.ci_ne-NP = Nepali (Nepal)
Globalization.ci_nl = Dutch
+Globalization.ci_nl-AW = Dutch (Aruba)
Globalization.ci_nl-BE = Dutch (Belgium)
+Globalization.ci_nl-BQ = Dutch (Bonaire, Sint Eustatius and Saba)
+Globalization.ci_nl-CW = Dutch (Curaçao)
Globalization.ci_nl-NL = Dutch (Netherlands)
+Globalization.ci_nl-SR = Dutch (Suriname)
+Globalization.ci_nl-SX = Dutch (Sint Maarten)
+Globalization.ci_nmg = Kwasio
+Globalization.ci_nmg-CM = Kwasio (Cameroon)
Globalization.ci_nn = Norwegian (Nynorsk)
Globalization.ci_nn-NO = Norwegian, Nynorsk (Norway)
+Globalization.ci_nnh = Ngiemboon
+Globalization.ci_nnh-CM = Ngiemboon (Cameroon)
Globalization.ci_no = Norwegian
+Globalization.ci_nqo = N'ko
+Globalization.ci_nqo-GN = N'ko (Guinea)
+Globalization.ci_nr = South Ndebele
+Globalization.ci_nr-ZA = South Ndebele (South Africa)
Globalization.ci_nso = Sesotho sa Leboa
Globalization.ci_nso-ZA = Sesotho sa Leboa (South Africa)
+Globalization.ci_nus = Nuer
+Globalization.ci_nus-SD = Nuer (Sudan)
+Globalization.ci_nus-SS = Nuer (South Sudan)
+Globalization.ci_nyn = Nyankole
+Globalization.ci_nyn-UG = Nyankole (Uganda)
Globalization.ci_oc = Occitan
Globalization.ci_oc-FR = Occitan (France)
-Globalization.ci_or = Oriya
-Globalization.ci_or-IN = Oriya (India)
+Globalization.ci_om = Oromo
+Globalization.ci_om-ET = Oromo (Ethiopia)
+Globalization.ci_om-KE = Oromo (Kenya)
+Globalization.ci_or = Odia
+Globalization.ci_or-IN = Odia (India)
+Globalization.ci_os = Ossetic
+Globalization.ci_os-GE = Ossetian (Cyrillic, Georgia)
+Globalization.ci_os-RU = Ossetian (Cyrillic, Russia)
Globalization.ci_pa = Punjabi
-Globalization.ci_oa-Arab = Punjabi (Arabic)
+Globalization.ci_pa-Arab = Punjabi (Arabic)
Globalization.ci_pa-Arab-PK = Punjabi (Islamic Republic of Pakistan)
Globalization.ci_pa-IN = Punjabi (India)
+Globalization.ci_pap = Papiamento
+Globalization.ci_pap-029 = Papiamento (Caribbean)
Globalization.ci_pl = Polish
Globalization.ci_pl-PL = Polish (Poland)
Globalization.ci_prs = Dari
@@ -2603,11 +2957,25 @@ Globalization.ci_prs-AF = Dari (Afghanistan)
Globalization.ci_ps = Pashto
Globalization.ci_ps-AF = Pashto (Afghanistan)
Globalization.ci_pt = Portuguese
+Globalization.ci_pt-AO = Portuguese (Angola)
Globalization.ci_pt-BR = Portuguese (Brazil)
+Globalization.ci_pt-CV = Portuguese (Cabo Verde)
+Globalization.ci_pt-GW = Portuguese (Guinea-Bissau)
+Globalization.ci_pt-MO = Portuguese (Macao SAR)
+Globalization.ci_pt-MZ = Portuguese (Mozambique)
Globalization.ci_pt-PT = Portuguese (Portugal)
+Globalization.ci_pt-ST = Portuguese (São Tomé and Príncipe)
+Globalization.ci_pt-TL = Portuguese (Timor-Leste)
Globalization.ci_qps-ploc = Pseudo Language (Pseudo)
Globalization.ci_qps-ploca = Pseudo Language (Pseudo Asia)
Globalization.ci_qps-plocm = Pseudo Language (Pseudo Mirrored)
+Globalization.ci_qu = Quechua
+Globalization.ci_qu-BO = Quechua (Bolivia)
+Globalization.ci_qu-EC = Quechua (Ecuador)
+Globalization.ci_qu-PE = Quechua (Peru)
+Globalization.ci_quc = K'iche'
+Globalization.ci_quc-Latn = K'iche'
+Globalization.ci_quc-Latn-GT = K'iche' (Guatemala)
Globalization.ci_qut = K'iche
Globalization.ci_qut-GT = K'iche (Guatemala)
Globalization.ci_quz = Quechua
@@ -2616,23 +2984,52 @@ Globalization.ci_quz-EC = Quechua (Ecuador)
Globalization.ci_quz-PE = Quechua (Peru)
Globalization.ci_rm = Romansh
Globalization.ci_rm-CH = Romansh (Switzerland)
+Globalization.ci_rn = Rundi
+Globalization.ci_rn-BI = Rundi (Burundi)
Globalization.ci_ro = Romanian
+Globalization.ci_ro-MD = Romanian (Moldova)
Globalization.ci_ro-RO = Romanian (Romania)
+Globalization.ci_rof = Rombo
+Globalization.ci_rof-TZ = Rombo (Tanzania)
Globalization.ci_ru = Russian
+Globalization.ci_ru-BY = Russian (Belarus)
+Globalization.ci_ru-KG = Russian (Kyrgyzstan)
+Globalization.ci_ru-KZ = Russian (Kazakhstan)
+Globalization.ci_ru-MD = Russian (Moldova)
Globalization.ci_ru-RU = Russian (Russia)
+Globalization.ci_ru-UA = Russian (Ukraine)
Globalization.ci_rw = Kinyarwanda
Globalization.ci_rw-RW = Kinyarwanda (Rwanda)
+Globalization.ci_rwk = Rwa
+Globalization.ci_rwk-TZ = Rwa (Tanzania)
Globalization.ci_sa = Sanskrit
Globalization.ci_sa-IN = Sanskrit (India)
Globalization.ci_sah = Sakha
Globalization.ci_sah-RU = Sakha (Russia)
+Globalization.ci_saq = Samburu
+Globalization.ci_saq-KE = Samburu (Kenya)
+Globalization.ci_sbp = Sangu
+Globalization.ci_sbp-TZ = Sangu (Tanzania)
+Globalization.ci_sd = Sindhi
+Globalization.ci_sd-Arab = Sindhi (Arabic)
+Globalization.ci_sd-Arab-PK = Sindhi (Islamic Republic of Pakistan)
+Globalization.ci_sd-Deva = Sindhi (Devanagari)
+Globalization.ci_sd-Deva-IN = Sindhi (Devanagari, India)
Globalization.ci_se = Sami (Northern)
Globalization.ci_se-FI = Sami, Northern (Finland)
Globalization.ci_se-NO = Sami, Northern (Norway)
Globalization.ci_se-SE = Sami, Northern (Sweden)
-Globalization.ci_sd = Sindhi
-Globalization.ci_sd-Arab = Sindhi (Arabic)
-Globalization.ci_sd-Arab-PK = Sindhi (Islamic Republic of Pakistan)
+Globalization.ci_seh = Sena
+Globalization.ci_seh-MZ = Sena (Mozambique)
+Globalization.ci_ses = Koyraboro Senni
+Globalization.ci_ses-ML = Koyraboro Senni (Mali)
+Globalization.ci_sg = Sango
+Globalization.ci_sg-CF = Sango (Central African Republic)
+Globalization.ci_shi = Tachelhit
+Globalization.ci_shi-Latn = Tachelhit (Latin)
+Globalization.ci_shi-Latn-MA = Tachelhit (Latin, Morocco)
+Globalization.ci_shi-Tfng = Tachelhit (Tifinagh)
+Globalization.ci_shi-Tfng-MA = Tachelhit (Tifinagh, Morocco)
Globalization.ci_si = Sinhala
Globalization.ci_si-LK = Sinhala (Sri Lanka)
Globalization.ci_sk = Slovak
@@ -2649,8 +3046,19 @@ Globalization.ci_smn = Sami (Inari)
Globalization.ci_smn-FI = Sami, Inari (Finland)
Globalization.ci_sms = Sami (Skolt)
Globalization.ci_sms-FI = Sami, Skolt (Finland)
+Globalization.ci_sn = Shona
+Globalization.ci_sn-Latn = Shona (Latin)
+Globalization.ci_sn-Latn-ZW = Shona (Latin, Zimbabwe)
+Globalization.ci_so = Somali
+Globalization.ci_so-DJ = Somali (Djibouti)
+Globalization.ci_so-ET = Somali (Ethiopia)
+Globalization.ci_so-KE = Somali (Kenya)
+Globalization.ci_so-SO = Somali (Somalia)
Globalization.ci_sq = Albanian
Globalization.ci_sq-AL = Albanian (Albania)
+Globalization.ci_sq-MK = Albanian (Macedonia, FYRO)
+Globalization.ci_sq-XK = Albanian (Kosovo)
+Globalization.ci_sr-Cyrl-XK = Serbian (Cyrillic, Kosovo)
Globalization.ci_sr = Serbian
Globalization.ci_sr-Cyrl = Serbian (Cyrillic)
Globalization.ci_sr-Cyrl-BA = Serbian (Cyrillic, Bosnia and Herzegovina)
@@ -2662,18 +3070,38 @@ Globalization.ci_sr-Latn-BA = Serbian (Latin, Bosnia and Herzegovina)
Globalization.ci_sr-Latn-CS = Serbian (Latin, Serbia and Montenegro (Former))
Globalization.ci_sr-Latn-ME = Serbian (Latin, Montenegro)
Globalization.ci_sr-Latn-RS = Serbian (Latin, Serbia)
+Globalization.ci_sr-Latn-XK = Serbian (Latin, Kosovo)
+Globalization.ci_ss = Swati
+Globalization.ci_ss-SZ = Swati (Swaziland)
+Globalization.ci_ss-ZA = Swati (South Africa)
+Globalization.ci_ssy = Saho
+Globalization.ci_ssy-ER = Saho (Eritrea)
+Globalization.ci_st = Southern Sotho
+Globalization.ci_st-LS = Sesotho (Lesotho)
+Globalization.ci_st-ZA = Southern Sotho (South Africa)
Globalization.ci_sv = Swedish
+Globalization.ci_sv-AX = Swedish (Ã…land Islands)
Globalization.ci_sv-FI = Swedish (Finland)
Globalization.ci_sv-SE = Swedish (Sweden)
Globalization.ci_sw = Kiswahili
+Globalization.ci_sw-CD = Kiswahili (Congo DRC)
Globalization.ci_sw-KE = Kiswahili (Kenya)
+Globalization.ci_sw-TZ = Kiswahili (Tanzania)
+Globalization.ci_sw-UG = Kiswahili (Uganda)
+Globalization.ci_swc = Congo Swahili
+Globalization.ci_swc-CD = Congo Swahili (Congo DRC)
Globalization.ci_syr = Syriac
Globalization.ci_syr-SY = Syriac (Syria)
Globalization.ci_ta = Tamil
Globalization.ci_ta-IN = Tamil (India)
Globalization.ci_ta-LK = Tamil (Sri Lanka)
+Globalization.ci_ta-MY = Tamil (Malaysia)
+Globalization.ci_ta-SG = Tamil (Singapore)
Globalization.ci_te = Telugu
Globalization.ci_te-IN = Telugu (India)
+Globalization.ci_teo = Teso
+Globalization.ci_teo-KE = Teso (Kenya)
+Globalization.ci_teo-UG = Teso (Uganda)
Globalization.ci_tg = Tajik
Globalization.ci_tg-Cyrl = Tajik (Cyrillic)
Globalization.ci_tg-Cyrl-TJ = Tajik (Cyrillic, Tajikistan)
@@ -2682,18 +3110,30 @@ Globalization.ci_th-TH = Thai (Thailand)
Globalization.ci_ti = Tigrinya
Globalization.ci_ti-ER = Tigrinya (Eritrea)
Globalization.ci_ti-ET = Tigrinya (Ethiopia)
+Globalization.ci_tig = Tigre
+Globalization.ci_tig-ER = Tigre (Eritrea)
Globalization.ci_tk = Turkmen
Globalization.ci_tk-TM = Turkmen (Turkmenistan)
Globalization.ci_tn = Setswana
Globalization.ci_tn-BW = Setswana (Botswana)
Globalization.ci_tn-ZA = Setswana (South Africa)
+Globalization.ci_to = Tongan
+Globalization.ci_to-TO = Tongan (Tonga)
Globalization.ci_tr = Turkish
+Globalization.ci_tr-CY = Turkish (Cyprus)
Globalization.ci_tr-TR = Turkish (Turkey)
+Globalization.ci_ts = Tsonga
+Globalization.ci_ts-ZA = Tsonga (South Africa)
Globalization.ci_tt = Tatar
Globalization.ci_tt-RU = Tatar (Russia)
+Globalization.ci_twq = Tasawaq
+Globalization.ci_twq-NE = Tasawaq (Niger)
Globalization.ci_tzm = Tamazight
+Globalization.ci_tzm-Arab = Central Atlas Tamazight (Arabic)
+Globalization.ci_tzm-Arab-MA = Central Atlas Tamazight (Arabic, Morocco)
Globalization.ci_tzm-Latn = Tamazight (Latin)
Globalization.ci_tzm-Latn-DZ = Tamazight (Latin, Algeria)
+Globalization.ci_tzm-Latn-MA = Central Atlas Tamazight (Latin, Morocco)
Globalization.ci_tzm-Tfng = Tamazight (Tifinagh)
Globalization.ci_tzm-Tfng-MA = Central Atlas Tamazight (Tifinagh, Morocco)
Globalization.ci_ug = Uyghur
@@ -2701,31 +3141,61 @@ Globalization.ci_ug-CN = Uyghur (PRC)
Globalization.ci_uk = Ukrainian
Globalization.ci_uk-UA = Ukrainian (Ukraine)
Globalization.ci_ur = Urdu
+Globalization.ci_ur-IN = Urdu (India)
Globalization.ci_ur-PK = Urdu (Islamic Republic of Pakistan)
Globalization.ci_uz = Uzbek
+Globalization.ci_uz-Arab = Uzbek (Perso-Arabic)
+Globalization.ci_uz-Arab-AF = Uzbek (Perso-Arabic, Afghanistan)
Globalization.ci_uz-Cyrl = Uzbek (Cyrillic)
Globalization.ci_uz-Cyrl-UZ = Uzbek (Cyrillic, Uzbekistan)
Globalization.ci_uz-Latn = Uzbek (Latin)
Globalization.ci_uz-Latn-UZ = Uzbek (Latin, Uzbekistan)
+Globalization.ci_vai = Vai
+Globalization.ci_vai-Latn = Vai (Latin)
+Globalization.ci_vai-Latn-LR = Vai (Latin, Liberia)
+Globalization.ci_vai-Vaii = Vai (Vai)
+Globalization.ci_vai-Vaii-LR = Vai (Vai, Liberia)
+Globalization.ci_ve = Venda
+Globalization.ci_ve-ZA = Venda (South Africa)
Globalization.ci_vi = Vietnamese
Globalization.ci_vi-VN = Vietnamese (Vietnam)
+Globalization.ci_vo = Volapük
+Globalization.ci_vo-001 = Volapük (World)
+Globalization.ci_vun = Vunjo
+Globalization.ci_vun-TZ = Vunjo (Tanzania)
+Globalization.ci_wae = Walser
+Globalization.ci_wae-CH = Walser (Switzerland)
+Globalization.ci_wal = Wolaytta
+Globalization.ci_wal-ET = Wolaytta (Ethiopia)
Globalization.ci_wo = Wolof
Globalization.ci_wo-SN = Wolof (Senegal)
Globalization.ci_x-IV = Invariant Language (Invariant Country)
Globalization.ci_x-IV_mathan = Invariant Language (Invariant Country)
Globalization.ci_xh = isiXhosa
Globalization.ci_xh-ZA = isiXhosa (South Africa)
+Globalization.ci_xog = Soga
+Globalization.ci_xog-UG = Soga (Uganda)
+Globalization.ci_yav = Yangben
+Globalization.ci_yav-CM = Yangben (Cameroon)
+Globalization.ci_yi = Yiddish
+Globalization.ci_yi-001 = Yiddish (World)
Globalization.ci_yo = Yoruba
+Globalization.ci_yo-BJ = Yoruba (Benin)
Globalization.ci_yo-NG = Yoruba (Nigeria)
+Globalization.ci_zgh = Standard Moroccan Tamazight
+Globalization.ci_zgh-Tfng = Standard Moroccan Tamazight (Tifinagh)
+Globalization.ci_zgh-Tfng-MA = Standard Moroccan Tamazight (Tifinagh, Morocco)
Globalization.ci_zh = Chinese
Globalization.ci_zh-CHS = Chinese (Simplified) Legacy
Globalization.ci_zh-CHT = Chinese (Traditional) Legacy
Globalization.ci_zh-CN = Chinese (Simplified, PRC)
Globalization.ci_zh-CN_stroke = Chinese (Simplified, PRC)
-Globalization.ci_zh-HK = Chinese (Traditional, Hong Kong S.A.R.)
-Globalization.ci_zh-HK_radstr = Chinese (Traditional, Hong Kong S.A.R.)
Globalization.ci_zh-Hans = Chinese (Simplified)
+Globalization.ci_zh-Hans-HK = Chinese (Simplified Han, Hong Kong SAR)
+Globalization.ci_zh-Hans-MO = Chinese (Simplified Han, Macao SAR)
Globalization.ci_zh-Hant = Chinese (Traditional)
+Globalization.ci_zh-HK = Chinese (Traditional, Hong Kong S.A.R.)
+Globalization.ci_zh-HK_radstr = Chinese (Traditional, Hong Kong S.A.R.)
Globalization.ci_zh-MO = Chinese (Traditional, Macao S.A.R.)
Globalization.ci_zh-MO_radstr = Chinese (Traditional, Macao S.A.R.)
Globalization.ci_zh-MO_stroke = Chinese (Traditional, Macao S.A.R.)
@@ -2740,35 +3210,69 @@ Globalization.ci_zu-ZA = isiZulu (South Africa)
;
;Total items: 129
;
+Globalization.ri_001 = World
Globalization.ri_029 = Caribbean
+Globalization.ri_150 = Europe
+Globalization.ri_419 = Latin America
+Globalization.ri_AD = Andorra
Globalization.ri_AE = U.A.E.
Globalization.ri_AF = Afghanistan
+Globalization.ri_AG = Antigua and Barbuda
+Globalization.ri_AI = Anguilla
Globalization.ri_AL = Albania
Globalization.ri_AM = Armenia
+Globalization.ri_AO = Angola
Globalization.ri_AR = Argentina
+Globalization.ri_AS = American Samoa
Globalization.ri_AT = Austria
Globalization.ri_AU = Australia
+Globalization.ri_AW = Aruba
+Globalization.ri_AX = Ã…land Islands
Globalization.ri_AZ = Azerbaijan
Globalization.ri_BA = Bosnia and Herzegovina
+Globalization.ri_BB = Barbados
Globalization.ri_BD = Bangladesh
Globalization.ri_BE = Belgium
+Globalization.ri_BF = Burkina Faso
Globalization.ri_BG = Bulgaria
Globalization.ri_BH = Bahrain
+Globalization.ri_BI = Burundi
+Globalization.ri_BJ = Benin
+Globalization.ri_BL = Saint Barthélemy
+Globalization.ri_BM = Bermuda
Globalization.ri_BN = Brunei Darussalam
Globalization.ri_BO = Bolivia
+Globalization.ri_BQ = Bonaire, Sint Eustatius and Saba
Globalization.ri_BR = Brazil
+Globalization.ri_BS = Bahamas
+Globalization.ri_BT = Bhutan
+Globalization.ri_BW = Botswana
Globalization.ri_BY = Belarus
Globalization.ri_BZ = Belize
Globalization.ri_CA = Canada
+Globalization.ri_CC = Cocos (Keeling) Islands
+Globalization.ri_CD = Congo (DRC)
+Globalization.ri_CF = Central African Republic
+Globalization.ri_CG = Congo
Globalization.ri_CH = Switzerland
+Globalization.ri_CI = Côte d’Ivoire
+Globalization.ri_CK = Cook Islands
Globalization.ri_CL = Chile
+Globalization.ri_CM = Cameroon
Globalization.ri_CN = People's Republic of China
Globalization.ri_CO = Colombia
Globalization.ri_CR = Costa Rica
Globalization.ri_CS = Serbia and Montenegro (Former)
+Globalization.ri_CU = Cuba
+Globalization.ri_CV = Cabo Verde
+Globalization.ri_CW = Curaçao
+Globalization.ri_CX = Christmas Island
+Globalization.ri_CY = Cyprus
Globalization.ri_CZ = Czech Republic
Globalization.ri_DE = Germany
+Globalization.ri_DJ = Djibouti
Globalization.ri_DK = Denmark
+Globalization.ri_DM = Dominica
Globalization.ri_DO = Dominican Republic
Globalization.ri_DZ = Algeria
Globalization.ri_EC = Ecuador
@@ -2778,96 +3282,181 @@ Globalization.ri_ER = Eritrea
Globalization.ri_ES = Spain
Globalization.ri_ET = Ethiopia
Globalization.ri_FI = Finland
+Globalization.ri_FJ = Fiji
+Globalization.ri_FK = Falkland Islands
+Globalization.ri_FM = Micronesia
Globalization.ri_FO = Faroe Islands
Globalization.ri_FR = France
+Globalization.ri_GA = Gabon
Globalization.ri_GB = United Kingdom
+Globalization.ri_GD = Grenada
Globalization.ri_GE = Georgia
+Globalization.ri_GF = French Guiana
+Globalization.ri_GG = Guernsey
+Globalization.ri_GH = Ghana
+Globalization.ri_GI = Gibraltar
Globalization.ri_GL = Greenland
+Globalization.ri_GM = Gambia
+Globalization.ri_GN = Guinea
+Globalization.ri_GP = Guadeloupe
+Globalization.ri_GQ = Equatorial Guinea
Globalization.ri_GR = Greece
Globalization.ri_GT = Guatemala
+Globalization.ri_GU = Guam
+Globalization.ri_GW = Guinea-Bissau
+Globalization.ri_GY = Guyana
Globalization.ri_HK = Hong Kong S.A.R.
Globalization.ri_HN = Honduras
Globalization.ri_HR = Croatia
+Globalization.ri_HT = Haiti
Globalization.ri_HU = Hungary
Globalization.ri_ID = Indonesia
Globalization.ri_IE = Ireland
Globalization.ri_IL = Israel
Globalization.ri_IN = India
+Globalization.ri_IM = Isle of Man
+Globalization.ri_IO = British Indian Ocean Territory
Globalization.ri_IQ = Iraq
Globalization.ri_IR = Iran
Globalization.ri_IS = Iceland
Globalization.ri_IT = Italy
Globalization.ri_IV = Invariant Country
+Globalization.ri_JE = Jersey
Globalization.ri_JM = Jamaica
Globalization.ri_JO = Jordan
Globalization.ri_JP = Japan
Globalization.ri_KE = Kenya
Globalization.ri_KG = Kyrgyzstan
Globalization.ri_KH = Cambodia
+Globalization.ri_KI = Kiribati
+Globalization.ri_KM = Comoros
+Globalization.ri_KN = Saint Kitts and Nevis
Globalization.ri_KR = Korea
Globalization.ri_KW = Kuwait
+Globalization.ri_KY = Cayman Islands
Globalization.ri_KZ = Kazakhstan
Globalization.ri_LA = Lao P.D.R.
Globalization.ri_LB = Lebanon
+Globalization.ri_LC = Saint Lucia
Globalization.ri_LI = Liechtenstein
Globalization.ri_LK = Sri Lanka
+Globalization.ri_LR = Liberia
+Globalization.ri_LS = Lesotho
Globalization.ri_LT = Lithuania
Globalization.ri_LU = Luxembourg
Globalization.ri_LV = Latvia
Globalization.ri_LY = Libya
Globalization.ri_MA = Morocco
Globalization.ri_MC = Principality of Monaco
+Globalization.ri_MD = Moldova
Globalization.ri_ME = Montenegro
+Globalization.ri_MF = Saint Martin
+Globalization.ri_MG = Madagascar
+Globalization.ri_MH = Marshall Islands
Globalization.ri_MK = Macedonia (FYROM)
+Globalization.ri_ML = Mali
+Globalization.ri_MM = Myanmar
Globalization.ri_MN = Mongolia
Globalization.ri_MO = Macao S.A.R.
+Globalization.ri_MP = Northern Mariana Islands
+Globalization.ri_MQ = Martinique
+Globalization.ri_MR = Mauritania
+Globalization.ri_MS = Montserrat
Globalization.ri_MT = Malta
+Globalization.ri_MU = Mauritius
Globalization.ri_MV = Maldives
+Globalization.ri_MW = Malawi
Globalization.ri_MX = Mexico
Globalization.ri_MY = Malaysia
+Globalization.ri_MZ = Mozambique
+Globalization.ri_NA = Namibia
+Globalization.ri_NC = New Caledonia
+Globalization.ri_NE = Niger
+Globalization.ri_NF = Norfolk Island
Globalization.ri_NG = Nigeria
Globalization.ri_NI = Nicaragua
Globalization.ri_NL = Netherlands
Globalization.ri_NO = Norway
Globalization.ri_NP = Nepal
+Globalization.ri_NR = Nauru
+Globalization.ri_NU = Niue
Globalization.ri_NZ = New Zealand
Globalization.ri_OM = Oman
Globalization.ri_PA = Panama
Globalization.ri_PE = Peru
+Globalization.ri_PF = French Polynesia
+Globalization.ri_PG = Papua New Guinea
Globalization.ri_PH = Philippines
Globalization.ri_PK = Islamic Republic of Pakistan
Globalization.ri_PL = Poland
+Globalization.ri_PM = Saint Pierre and Miquelon
+Globalization.ri_PN = Pitcairn Islands
Globalization.ri_PR = Puerto Rico
+Globalization.ri_PS = Palestinian Authority
Globalization.ri_PT = Portugal
+Globalization.ri_PW = Palau
Globalization.ri_PY = Paraguay
Globalization.ri_QA = Qatar
+Globalization.ri_RE = Réunion
Globalization.ri_RO = Romania
Globalization.ri_RS = Serbia
Globalization.ri_RU = Russia
Globalization.ri_RW = Rwanda
Globalization.ri_SA = Saudi Arabia
+Globalization.ri_SB = Solomon Islands
+Globalization.ri_SC = Seychelles
+Globalization.ri_SD = Sudan
Globalization.ri_SE = Sweden
Globalization.ri_SG = Singapore
+Globalization.ri_SH = St Helena, Ascension, Tristan da Cunha
Globalization.ri_SI = Slovenia
+Globalization.ri_SJ = Svalbard and Jan Mayen
Globalization.ri_SK = Slovakia
+Globalization.ri_SL = Sierra Leone
+Globalization.ri_SM = San Marino
Globalization.ri_SN = Senegal
+Globalization.ri_SO = Somalia
+Globalization.ri_SR = Suriname
+Globalization.ri_SS = South Sudan
+Globalization.ri_ST = São Tomé and Príncipe
Globalization.ri_SV = El Salvador
+Globalization.ri_SX = Sint Maarten
Globalization.ri_SY = Syria
+Globalization.ri_SZ = Swaziland
+Globalization.ri_TC = Turks and Caicos Islands
+Globalization.ri_TD = Chad
+Globalization.ri_TG = Togo
Globalization.ri_TH = Thailand
Globalization.ri_TJ = Tajikistan
+Globalization.ri_TK = Tokelau
+Globalization.ri_TL = Timor-Leste
Globalization.ri_TM = Turkmenistan
Globalization.ri_TN = Tunisia
+Globalization.ri_TO = Tonga
Globalization.ri_TR = Turkey
Globalization.ri_TT = Trinidad and Tobago
+Globalization.ri_TV = Tuvalu
Globalization.ri_TW = Taiwan
+Globalization.ri_TZ = Tanzania
Globalization.ri_UA = Ukraine
+Globalization.ri_UG = Uganda
+Globalization.ri_UM = U.S. Outlying Islands
Globalization.ri_US = United States
Globalization.ri_UY = Uruguay
Globalization.ri_UZ = Uzbekistan
+Globalization.ri_VC = Saint Vincent and the Grenadines
Globalization.ri_VE = Bolivarian Republic of Venezuela
+Globalization.ri_VG = British Virgin Islands
+Globalization.ri_VI = U.S. Virgin Islands
Globalization.ri_VN = Vietnam
+Globalization.ri_VU = Vanuatu
+Globalization.ri_WF = Wallis and Futuna
+Globalization.ri_WS = Samoa
+Globalization.ri_XK = Kosovo
Globalization.ri_YE = Yemen
+Globalization.ri_YT = Mayotte
Globalization.ri_ZA = South Africa
+Globalization.ri_ZM = Zambia
Globalization.ri_ZW = Zimbabwe
#endif //!FEATURE_CORECLR
@@ -2879,6 +3468,12 @@ Globalization.ri_ZW = Zimbabwe
Globalization.cp_1200 = Unicode
Globalization.cp_1201 = Unicode (Big-Endian)
Globalization.cp_65001 = Unicode (UTF-8)
+Globalization.cp_65000 = Unicode (UTF-7)
+Globalization.cp_12000 = Unicode (UTF-32)
+Globalization.cp_12001 = Unicode (UTF-32 Big-Endian)
+Globalization.cp_20127 = US-ASCII
+Globalization.cp_28591 = Western European (ISO)
+
#if FEATURE_NON_UNICODE_CODE_PAGES
Globalization.cp_37 = IBM EBCDIC (US-Canada)
Globalization.cp_437 = OEM United States
@@ -2945,8 +3540,6 @@ Globalization.cp_10029 = Central European (Mac)
Globalization.cp_10079 = Icelandic (Mac)
Globalization.cp_10081 = Turkish (Mac)
Globalization.cp_10082 = Croatian (Mac)
-Globalization.cp_12000 = Unicode (UTF-32)
-Globalization.cp_12001 = Unicode (UTF-32 Big-Endian)
Globalization.cp_20000 = Chinese Traditional (CNS)
Globalization.cp_20001 = TCA Taiwan
Globalization.cp_20002 = Chinese Traditional (Eten)
@@ -2957,7 +3550,6 @@ Globalization.cp_20105 = Western European (IA5)
Globalization.cp_20106 = German (IA5)
Globalization.cp_20107 = Swedish (IA5)
Globalization.cp_20108 = Norwegian (IA5)
-Globalization.cp_20127 = US-ASCII
Globalization.cp_20261 = T.61
Globalization.cp_20269 = ISO-6937
Globalization.cp_20273 = IBM EBCDIC (Germany)
@@ -2984,7 +3576,6 @@ Globalization.cp_20949 = Korean Wansung
Globalization.cp_21025 = IBM EBCDIC (Cyrillic Serbian-Bulgarian)
Globalization.cp_21027 = Ext Alpha Lowercase
Globalization.cp_21866 = Cyrillic (KOI8-U)
-Globalization.cp_28591 = Western European (ISO)
Globalization.cp_28592 = Central European (ISO)
Globalization.cp_28593 = Latin 3 (ISO)
Globalization.cp_28594 = Baltic (ISO)
@@ -3025,9 +3616,12 @@ Globalization.cp_57008 = ISCII Kannada
Globalization.cp_57009 = ISCII Malayalam
Globalization.cp_57010 = ISCII Gujarati
Globalization.cp_57011 = ISCII Punjabi
-Globalization.cp_65000 = Unicode (UTF-7)
#endif // FEATURE_NON_UNICODE_CODE_PAGES
#endif // INCLUDE_DEBUG
;------------------
+; ValueTuple
+ArgumentException_ValueTupleIncorrectType=Argument must be of type {0}.
+ArgumentException_ValueTupleLastArgumentNotAValueTuple=The last element of an eight element ValueTuple must be a ValueTuple.
+
diff --git a/mcs/class/referencesource/mscorlib/system/AggregateException.cs b/mcs/class/referencesource/mscorlib/system/AggregateException.cs
index 2a2561b05e8..5b442f2549e 100644
--- a/mcs/class/referencesource/mscorlib/system/AggregateException.cs
+++ b/mcs/class/referencesource/mscorlib/system/AggregateException.cs
@@ -7,7 +7,7 @@
//
// AggregateException.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Public type to communicate multiple failures to an end-user.
//
diff --git a/mcs/class/referencesource/mscorlib/system/AppContext/AppContext.cs b/mcs/class/referencesource/mscorlib/system/AppContext/AppContext.cs
index a2fec93aa83..2dbd155f782 100644
--- a/mcs/class/referencesource/mscorlib/system/AppContext/AppContext.cs
+++ b/mcs/class/referencesource/mscorlib/system/AppContext/AppContext.cs
@@ -8,6 +8,19 @@ using System.Collections.Generic;
namespace System
{
+
+ //
+ // The AppContext class consists of a collection of APIs that applications can use to reason about the context
+ // in which they are running.
+ //
+ // One of the APIs that are available to the application (and the framework) are the ones related to the
+ // configuration switches (SetSwitch, TryGetSwitch). Those APIs are used to set and retrieve the value of a switch.
+ //
+ // Inside the framework we use those APIs to provide backward compatibility for our in-place updates. In order for
+ // that to work in as many cases as possible we have intentionally coded the APIs to use very low level concepts.
+ // For instance, we are directly P/Invoking into the Registry calls and so that we don't initialize the infrastructure
+ // for accessing registry. Doing that would allow us to use AppContext switches inside the Registry code.
+ //
public static class AppContext
{
[Flags]
@@ -18,7 +31,13 @@ namespace System
HasLookedForOverride = 0x4,
UnknownValue = 0x8 // Has no default and could not find an override
}
+
+ // The Dictionary is intentionally left without specifying the comparer. StringComparer.Ordinal for instance will
+ // end up pulling in Globalization since all StringComparers are initialized in the static constructor (including the
+ // ones that use CultureInfo).
+ // Not specifying a comparer means that the dictionary will end up with a GenericEqualityComparer<string> comparer
private static readonly Dictionary<string, SwitchValueState> s_switchMap = new Dictionary<string, SwitchValueState>();
+ private static volatile bool s_defaultsInitialized = false;
public static string BaseDirectory
{
@@ -37,23 +56,38 @@ namespace System
{
get
{
- throw new NotImplementedException();
+ // Forward the value that is set on the current domain.
+ return AppDomain.CurrentDomain.SetupInformation.TargetFrameworkName;
}
}
- public static object GetData (string name)
+#if FEATURE_CORECLR
+ [System.Security.SecuritySafeCritical]
+#endif
+ public static object GetData(string name)
{
- throw new NotImplementedException();
+ return AppDomain.CurrentDomain.GetData(name);
}
#region Switch APIs
-#if !MONO
- static AppContext()
+
+ private static void InitializeDefaultSwitchValues()
{
- // populate the AppContext with the default set of values
- AppContextDefaultValues.PopulateDefaultValues();
- }
+ // To save a method call into this method, we are first checking
+ // the value of s_defaultsInitialized in the caller.
+ lock (s_switchMap)
+ {
+ if (s_defaultsInitialized == false)
+ {
+#if !MONO
+ // populate the AppContext with the default set of values
+ AppContextDefaultValues.PopulateDefaultValues();
#endif
+ s_defaultsInitialized = true;
+ }
+ }
+ }
+
/// <summary>
/// Try to get the value of the switch.
/// </summary>
@@ -67,6 +101,14 @@ namespace System
if (switchName.Length == 0)
throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), "switchName");
+ if (s_defaultsInitialized == false)
+ {
+ InitializeDefaultSwitchValues();
+ }
+#if DEBUG
+ BCLDebug.Assert(s_defaultsInitialized == true, "AppContext defaults should have been initialized.");
+#endif
+
// By default, the switch is not enabled.
isEnabled = false;
@@ -163,6 +205,14 @@ namespace System
if (switchName.Length == 0)
throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), "switchName");
+ if (s_defaultsInitialized == false)
+ {
+ InitializeDefaultSwitchValues();
+ }
+#if DEBUG
+ BCLDebug.Assert(s_defaultsInitialized == true, "AppContext defaults should have been initialized.");
+#endif
+
SwitchValueState switchValue = (isEnabled ? SwitchValueState.HasTrueValue : SwitchValueState.HasFalseValue)
| SwitchValueState.HasLookedForOverride;
lock (s_switchMap)
@@ -174,13 +224,30 @@ namespace System
/// <summary>
/// This method is going to be called from the AppContextDefaultValues class when setting up the
- /// default values for the switches. !!!! This method is called during the static constructor so it does not
- /// take a lock !!!! If you are planning to use this outside of that, please ensure proper locking.
+ /// default values for the switches.
/// </summary>
internal static void DefineSwitchDefault(string switchName, bool isEnabled)
{
+#if DEBUG
+ BCLDebug.Assert(System.Threading.Monitor.IsEntered(s_switchMap), "Expected the method to be called within a lock");
+#endif
+
s_switchMap[switchName] = isEnabled ? SwitchValueState.HasTrueValue : SwitchValueState.HasFalseValue;
}
+
+ /// <summary>
+ /// This method is going to be called from the AppContextDefaultValues class when setting up the
+ /// override default values for the switches.
+ /// </summary>
+ internal static void DefineSwitchOverride(string switchName, bool isEnabled)
+ {
+#if DEBUG
+ BCLDebug.Assert(System.Threading.Monitor.IsEntered(s_switchMap), "Expected the method to be called within a lock");
+#endif
+
+ s_switchMap[switchName] = (isEnabled ? SwitchValueState.HasTrueValue : SwitchValueState.HasFalseValue)
+ | SwitchValueState.HasLookedForOverride;
+ }
#endregion
}
}
diff --git a/mcs/class/referencesource/mscorlib/system/AppContext/AppContextDefaultValues.Defaults.cs b/mcs/class/referencesource/mscorlib/system/AppContext/AppContextDefaultValues.Defaults.cs
index d934f6ac188..90819c4c8ac 100644
--- a/mcs/class/referencesource/mscorlib/system/AppContext/AppContextDefaultValues.Defaults.cs
+++ b/mcs/class/referencesource/mscorlib/system/AppContext/AppContextDefaultValues.Defaults.cs
@@ -1,4 +1,4 @@
-// ==++==
+// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
@@ -15,9 +15,9 @@ namespace System
internal static readonly string SwitchPreserveEventListnerObjectIdentity = "Switch.System.Diagnostics.EventSource.PreserveEventListnerObjectIdentity";
internal static readonly string SwitchUseLegacyPathHandling = "Switch.System.IO.UseLegacyPathHandling";
internal static readonly string SwitchBlockLongPaths = "Switch.System.IO.BlockLongPaths";
+ internal static readonly string SwitchDoNotAddrOfCspParentWindowHandle = "Switch.System.Security.Cryptography.DoNotAddrOfCspParentWindowHandle";
internal static readonly string SwitchSetActorAsReferenceWhenCopyingClaimsIdentity = "Switch.System.Security.ClaimsIdentity.SetActorAsReferenceWhenCopyingClaimsIdentity";
-
// This is a partial method. Platforms can provide an implementation of it that will set override values
// from whatever mechanism is available on that platform. If no implementation is provided, the compiler is going to remove the calls
// to it from the code
@@ -52,6 +52,11 @@ namespace System
AppContext.DefineSwitchDefault(SwitchSetActorAsReferenceWhenCopyingClaimsIdentity, true);
}
+ if (version <= 40602)
+ {
+ AppContext.DefineSwitchDefault(SwitchDoNotAddrOfCspParentWindowHandle, true);
+ }
+
break;
}
case "WindowsPhone":
@@ -63,6 +68,7 @@ namespace System
AppContext.DefineSwitchDefault(SwitchThrowExceptionIfDisposedCancellationTokenSource, true);
AppContext.DefineSwitchDefault(SwitchUseLegacyPathHandling, true);
AppContext.DefineSwitchDefault(SwitchBlockLongPaths, true);
+ AppContext.DefineSwitchDefault(SwitchDoNotAddrOfCspParentWindowHandle, true);
}
break;
}
diff --git a/mcs/class/referencesource/mscorlib/system/AppContext/AppContextDefaultValues.DesktopOverrides.cs b/mcs/class/referencesource/mscorlib/system/AppContext/AppContextDefaultValues.DesktopOverrides.cs
index 56e7e787369..2b5055ddc97 100644
--- a/mcs/class/referencesource/mscorlib/system/AppContext/AppContextDefaultValues.DesktopOverrides.cs
+++ b/mcs/class/referencesource/mscorlib/system/AppContext/AppContextDefaultValues.DesktopOverrides.cs
@@ -5,6 +5,7 @@
// ==--==
using Microsoft.Win32;
+using Microsoft.Win32.SafeHandles;
using System;
using System.Collections.Generic;
using System.Diagnostics;
@@ -55,7 +56,7 @@ namespace System
if (bool.TryParse(value, out switchValue))
{
// If multiple switches have the same name, the last value that we find will win.
- AppContext.SetSwitch(name, switchValue);
+ AppContext.DefineSwitchOverride(name, switchValue);
}
}
previousSemicolonPos = currentPos;
@@ -96,10 +97,10 @@ namespace System
overrideFound = false;
// Read the value from the registry if we can (ie. the key exists)
- if (s_switchesRegKey != null)
+ if (s_errorReadingRegistry != true)
{
// try to read it from the registry key and return null if the switch name is not found
- valueFromConfig = s_switchesRegKey.GetValue(switchName, (string)null) as string;
+ valueFromConfig = GetSwitchValueFromRegistry(switchName);
}
// Note: valueFromConfig will be null only if the key is not found.
@@ -118,19 +119,44 @@ namespace System
}
}
- // Cached registry key used to read value overrides from the registry
- private static RegistryKey s_switchesRegKey = OpenRegKeyNoThrow();
-
- /// <summary>
- /// Opens the registry key where the switches are stored and returns null if there is an issue opening the key
- /// </summary>
- private static RegistryKey OpenRegKeyNoThrow()
+ private volatile static bool s_errorReadingRegistry;
+ [SecuritySafeCritical]
+ private static string GetSwitchValueFromRegistry(string switchName)
{
+ //
+ // We are using P/Invokes directly instead of using the RegistryKey class to avoid pulling in the
+ // globalization stack that is required by RegistryKey.
+ //
+ const string REG_KEY_APPCONTEXT = @"SOFTWARE\Microsoft\.NETFramework\AppContext";
try
{
- return Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\.NETFramework\AppContext");
+ using (SafeRegistryHandle hklm = new SafeRegistryHandle((IntPtr)RegistryHive.LocalMachine, true))
+ {
+ SafeRegistryHandle hkey = null;
+
+ if (Win32Native.RegOpenKeyEx(hklm, REG_KEY_APPCONTEXT, 0, Win32Native.KEY_READ, out hkey) == 0)
+ {
+ int size = 6; // "false".Length+1
+ int type = 0;
+ System.Text.StringBuilder keyBuffer = new System.Text.StringBuilder((int)size);
+ if (Win32Native.RegQueryValueEx(hkey, switchName, null, ref type, keyBuffer, ref size) == 0)
+ {
+ return keyBuffer.ToString();
+ }
+ }
+ else
+ {
+ // If we could not open the AppContext key, don't try it again.
+ s_errorReadingRegistry = true;
+ }
+ }
}
- catch { return null; }
+ catch
+ {
+ // If there was an error, flag it so that we don't try this again.
+ s_errorReadingRegistry = true;
+ }
+ return null;
}
}
}
diff --git a/mcs/class/referencesource/mscorlib/system/AppContext/AppContextSwitches.cs b/mcs/class/referencesource/mscorlib/system/AppContext/AppContextSwitches.cs
index 72eb1cccb11..8a4018b3983 100644
--- a/mcs/class/referencesource/mscorlib/system/AppContext/AppContextSwitches.cs
+++ b/mcs/class/referencesource/mscorlib/system/AppContext/AppContextSwitches.cs
@@ -83,6 +83,16 @@ namespace System
}
}
+ private static int _doNotAddrOfCspParentWindowHandle;
+ public static bool DoNotAddrOfCspParentWindowHandle
+ {
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ get
+ {
+ return GetCachedSwitchValue(AppContextDefaultValues.SwitchDoNotAddrOfCspParentWindowHandle, ref _doNotAddrOfCspParentWindowHandle);
+ }
+ }
+
//
// Implementation details
//
diff --git a/mcs/class/referencesource/mscorlib/system/Lazy.cs b/mcs/class/referencesource/mscorlib/system/Lazy.cs
index 41de248149a..edb3f9e9368 100644
--- a/mcs/class/referencesource/mscorlib/system/Lazy.cs
+++ b/mcs/class/referencesource/mscorlib/system/Lazy.cs
@@ -8,7 +8,7 @@
//
// Lazy.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// --------------------------------------------------------------------------------------
//
@@ -431,7 +431,7 @@ namespace System
}
else if (factory == ALREADY_INVOKED_SENTINEL)
{
- // Another thread ----d with us and beat us to successfully invoke the factory.
+ // Another thread raced with us and beat us to successfully invoke the factory.
return null;
}
boxed = new Boxed(factory());
diff --git a/mcs/class/referencesource/mscorlib/system/appdomain.cs b/mcs/class/referencesource/mscorlib/system/appdomain.cs
index 2a704e83006..0b475ce301b 100644
--- a/mcs/class/referencesource/mscorlib/system/appdomain.cs
+++ b/mcs/class/referencesource/mscorlib/system/appdomain.cs
@@ -7,7 +7,7 @@
**
** Class: AppDomain
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Domains represent an application within the runtime. Objects can
@@ -643,6 +643,16 @@ namespace System {
return targetFrameworkName;
}
+ [SecuritySafeCritical]
+ private void SetTargetFrameworkName(string targetFrameworkName)
+ {
+ if (!_FusionStore.CheckedForTargetFrameworkName)
+ {
+ _FusionStore.TargetFrameworkName = targetFrameworkName;
+ _FusionStore.CheckedForTargetFrameworkName = true;
+ }
+ }
+
/// <summary>
/// Returns the setting of the corresponding compatibility config switch (see CreateAppDomainManager for the impact).
/// </summary>
@@ -3503,6 +3513,10 @@ namespace System {
{
Contract.Requires(info != null);
+ // Setup the fusion store so that further calls can use the information stored there
+ // Changes to info should persist to _FusionStore as this is a reference assignment
+ _FusionStore = info;
+
#if FEATURE_FUSION
if (oldInfo == null) {
@@ -3565,11 +3579,6 @@ namespace System {
if (info.LoaderOptimization != LoaderOptimization.NotSpecified || (oldInfo != null && info.LoaderOptimization != oldInfo.LoaderOptimization))
UpdateLoaderOptimization(info.LoaderOptimization);
#endif
-
-
-
- // This must be the last action taken
- _FusionStore = info;
}
// used to package up evidence, so it can be serialized
@@ -3740,7 +3749,7 @@ namespace System {
for (int i=0; i<propertyNames.Length; i++)
{
- if(propertyNames[i]=="APPBASE") // make sure in [....] with Fusion
+ if(propertyNames[i]=="APPBASE") // make sure in sync with Fusion
{
if(propertyValues[i]==null)
throw new ArgumentNullException("APPBASE");
@@ -4171,7 +4180,7 @@ namespace System {
// in via the default domain properties. That restriction could be lifted
// in a future release, at which point this assert should be removed.
//
- // This should be kept in [....] with the real externally facing filter code
+ // This should be kept in sync with the real externally facing filter code
// in CorHost2::SetPropertiesForDefaultAppDomain
BCLDebug.Assert(false, "Unexpected default domain property");
}
diff --git a/mcs/class/referencesource/mscorlib/system/appdomainattributes.cs b/mcs/class/referencesource/mscorlib/system/appdomainattributes.cs
index 52abb4ce80c..ec913e79703 100644
--- a/mcs/class/referencesource/mscorlib/system/appdomainattributes.cs
+++ b/mcs/class/referencesource/mscorlib/system/appdomainattributes.cs
@@ -7,7 +7,7 @@
**
** File: AppDomainAttributes
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: For AppDomain-related custom attributes.
diff --git a/mcs/class/referencesource/mscorlib/system/appdomainunloadedexception.cs b/mcs/class/referencesource/mscorlib/system/appdomainunloadedexception.cs
index 6c21cf0bad0..b0518f6edfc 100644
--- a/mcs/class/referencesource/mscorlib/system/appdomainunloadedexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/appdomainunloadedexception.cs
@@ -7,7 +7,7 @@
**
** Class: AppDomainUnloadedException
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Exception class for attempt to access an unloaded AppDomain
diff --git a/mcs/class/referencesource/mscorlib/system/argiterator.cs b/mcs/class/referencesource/mscorlib/system/argiterator.cs
index 9edb731f19e..56b67d05cb7 100644
--- a/mcs/class/referencesource/mscorlib/system/argiterator.cs
+++ b/mcs/class/referencesource/mscorlib/system/argiterator.cs
@@ -13,7 +13,7 @@ namespace System {
// This class will not be marked serializable
// Note: This type must have the same layout as the CLR's VARARGS type in CLRVarArgs.h.
- // It also contains an inline SigPointer data structure - must keep those fields in [....].
+ // It also contains an inline SigPointer data structure - must keep those fields in sync.
[StructLayout(LayoutKind.Sequential)]
public struct ArgIterator
{
diff --git a/mcs/class/referencesource/mscorlib/system/array.cs b/mcs/class/referencesource/mscorlib/system/array.cs
index 7c767692fef..3c678360dfc 100644
--- a/mcs/class/referencesource/mscorlib/system/array.cs
+++ b/mcs/class/referencesource/mscorlib/system/array.cs
@@ -618,7 +618,7 @@ namespace System {
// We impose limits on maximum array lenght in each dimension to allow efficient
// implementation of advanced range check elimination in future.
- // Keep in [....] with vm\gcscan.cpp and HashHelpers.MaxPrimeArrayLength.
+ // Keep in sync with vm\gcscan.cpp and HashHelpers.MaxPrimeArrayLength.
// The constants are defined in this method: inline SIZE_T MaxArrayLength(SIZE_T componentSize) from gcscan
// We have different max sizes for arrays with elements of size 1 for backwards compatibility
internal const int MaxArrayLength = 0X7FEFFFFF;
diff --git a/mcs/class/referencesource/mscorlib/system/badimageformatexception.cs b/mcs/class/referencesource/mscorlib/system/badimageformatexception.cs
index 442639c09b4..19783eb44a9 100644
--- a/mcs/class/referencesource/mscorlib/system/badimageformatexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/badimageformatexception.cs
@@ -12,7 +12,7 @@
**
**
===========================================================*/
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
namespace System {
diff --git a/mcs/class/referencesource/mscorlib/system/cannotunloadappdomainexception.cs b/mcs/class/referencesource/mscorlib/system/cannotunloadappdomainexception.cs
index 1f3b6ff3758..6c9df903f78 100644
--- a/mcs/class/referencesource/mscorlib/system/cannotunloadappdomainexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/cannotunloadappdomainexception.cs
@@ -7,7 +7,7 @@
**
** Class: CannotUnloadAppDomainException
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Exception class for failed attempt to unload an AppDomain.
diff --git a/mcs/class/referencesource/mscorlib/system/collections/Concurrent/CDSCollectionETWBCLProvider.cs b/mcs/class/referencesource/mscorlib/system/collections/Concurrent/CDSCollectionETWBCLProvider.cs
index 318794b7fb8..793a0d9f1c4 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/Concurrent/CDSCollectionETWBCLProvider.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/Concurrent/CDSCollectionETWBCLProvider.cs
@@ -7,7 +7,7 @@
//
// CDSCollectionETWBCLProvider.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// A helper class for firing ETW events related to the Coordination Data Structure
// collection types. This provider is used by CDS collections in both mscorlib.dll
diff --git a/mcs/class/referencesource/mscorlib/system/collections/Concurrent/ConcurrentDictionary.cs b/mcs/class/referencesource/mscorlib/system/collections/Concurrent/ConcurrentDictionary.cs
index df32ff729b0..997f2871b93 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/Concurrent/ConcurrentDictionary.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/Concurrent/ConcurrentDictionary.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
/*============================================================
**
** Class: ConcurrentDictionary
diff --git a/mcs/class/referencesource/mscorlib/system/collections/Concurrent/ConcurrentQueue.cs b/mcs/class/referencesource/mscorlib/system/collections/Concurrent/ConcurrentQueue.cs
index eb7aeb2d781..9a17c443642 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/Concurrent/ConcurrentQueue.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/Concurrent/ConcurrentQueue.cs
@@ -9,7 +9,7 @@
//
// ConcurrentQueue.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// A lock-free, concurrent queue primitive, and its associated debugger view type.
//
diff --git a/mcs/class/referencesource/mscorlib/system/collections/Concurrent/ConcurrentStack.cs b/mcs/class/referencesource/mscorlib/system/collections/Concurrent/ConcurrentStack.cs
index dbadcc311e8..8e5821f55c6 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/Concurrent/ConcurrentStack.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/Concurrent/ConcurrentStack.cs
@@ -9,7 +9,7 @@
//
// ConcurrentStack.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// A lock-free, concurrent stack primitive, and its associated debugger view type.
//
diff --git a/mcs/class/referencesource/mscorlib/system/collections/Concurrent/IProducerConsumerCollection.cs b/mcs/class/referencesource/mscorlib/system/collections/Concurrent/IProducerConsumerCollection.cs
index d8b1a0bf1c2..6ed2935c881 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/Concurrent/IProducerConsumerCollection.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/Concurrent/IProducerConsumerCollection.cs
@@ -7,7 +7,7 @@
//
// IProducerConsumerCollection.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// A common interface for all concurrent collections.
//
diff --git a/mcs/class/referencesource/mscorlib/system/collections/Concurrent/OrderablePartitioner.cs b/mcs/class/referencesource/mscorlib/system/collections/Concurrent/OrderablePartitioner.cs
index 82419f629b6..aaf92c0fc19 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/Concurrent/OrderablePartitioner.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/Concurrent/OrderablePartitioner.cs
@@ -7,7 +7,7 @@
//
// OrderablePartitioner.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/collections/Concurrent/Partitioner.cs b/mcs/class/referencesource/mscorlib/system/collections/Concurrent/Partitioner.cs
index 7b683d2473f..095777506e4 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/Concurrent/Partitioner.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/Concurrent/Partitioner.cs
@@ -7,7 +7,7 @@
//
// Partitioner.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Represents a particular way of splitting a collection into multiple partitions.
//
diff --git a/mcs/class/referencesource/mscorlib/system/collections/Concurrent/PartitionerStatic.cs b/mcs/class/referencesource/mscorlib/system/collections/Concurrent/PartitionerStatic.cs
index d53dd4b8043..232f75d54d8 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/Concurrent/PartitionerStatic.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/Concurrent/PartitionerStatic.cs
@@ -8,7 +8,7 @@
//
// PartitionerStatic.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// A class of default partitioners for Partitioner<TSource>
//
diff --git a/mcs/class/referencesource/mscorlib/system/collections/arraylist.cs b/mcs/class/referencesource/mscorlib/system/collections/arraylist.cs
index 0e7b25c8eec..4118c5d5567 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/arraylist.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/arraylist.cs
@@ -7,7 +7,7 @@
**
** Class: ArrayList
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Implements a dynamically sized List as an array,
diff --git a/mcs/class/referencesource/mscorlib/system/collections/bitarray.cs b/mcs/class/referencesource/mscorlib/system/collections/bitarray.cs
index dfe421f3102..67acd6a0726 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/bitarray.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/bitarray.cs
@@ -7,7 +7,7 @@
**
** Class: BitArray
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: The BitArray class manages a compact array of bit values.
diff --git a/mcs/class/referencesource/mscorlib/system/collections/caseinsensitivecomparer.cs b/mcs/class/referencesource/mscorlib/system/collections/caseinsensitivecomparer.cs
index c6d46c10900..9e584ea823c 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/caseinsensitivecomparer.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/caseinsensitivecomparer.cs
@@ -7,7 +7,7 @@
**
** Class: CaseInsensitiveComparer
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
**
diff --git a/mcs/class/referencesource/mscorlib/system/collections/caseinsensitivehashcodeprovider.cs b/mcs/class/referencesource/mscorlib/system/collections/caseinsensitivehashcodeprovider.cs
index c9a9fd5c9eb..e9d24edc98d 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/caseinsensitivehashcodeprovider.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/caseinsensitivehashcodeprovider.cs
@@ -7,7 +7,7 @@
**
** Class: CaseInsensitiveHashCodeProvider
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Designed to support hashtables which require
diff --git a/mcs/class/referencesource/mscorlib/system/collections/collectionbase.cs b/mcs/class/referencesource/mscorlib/system/collections/collectionbase.cs
index 52355ea4c40..02ea374d2c3 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/collectionbase.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/collectionbase.cs
@@ -5,7 +5,7 @@
// ==--==
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Collections {
diff --git a/mcs/class/referencesource/mscorlib/system/collections/comparer.cs b/mcs/class/referencesource/mscorlib/system/collections/comparer.cs
index 89a67deff9f..4509457f85b 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/comparer.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/comparer.cs
@@ -7,7 +7,7 @@
**
** Class: Comparer
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Default IComparer implementation.
diff --git a/mcs/class/referencesource/mscorlib/system/collections/compatiblecomparer.cs b/mcs/class/referencesource/mscorlib/system/collections/compatiblecomparer.cs
index a19337c90bf..92760855bd1 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/compatiblecomparer.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/compatiblecomparer.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
using System.Diagnostics.Contracts;
diff --git a/mcs/class/referencesource/mscorlib/system/collections/dictionarybase.cs b/mcs/class/referencesource/mscorlib/system/collections/dictionarybase.cs
index 022cc7355c3..a8bfc680cfb 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/dictionarybase.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/dictionarybase.cs
@@ -5,7 +5,7 @@
// ==--==
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Collections {
diff --git a/mcs/class/referencesource/mscorlib/system/collections/dictionaryentry.cs b/mcs/class/referencesource/mscorlib/system/collections/dictionaryentry.cs
index fe2e341487a..34ccbc28c0a 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/dictionaryentry.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/dictionaryentry.cs
@@ -7,7 +7,7 @@
**
** Interface: DictionaryEntry
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Return Value for IDictionaryEnumerator::GetEntry
diff --git a/mcs/class/referencesource/mscorlib/system/collections/emptyreadonlydictionaryinternal.cs b/mcs/class/referencesource/mscorlib/system/collections/emptyreadonlydictionaryinternal.cs
index da84bb45fd6..5fab81ba40c 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/emptyreadonlydictionaryinternal.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/emptyreadonlydictionaryinternal.cs
@@ -7,7 +7,7 @@
**
** Class: EmptyReadOnlyDictionaryInternal
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: List for exceptions.
diff --git a/mcs/class/referencesource/mscorlib/system/collections/generic/arraysorthelper.cs b/mcs/class/referencesource/mscorlib/system/collections/generic/arraysorthelper.cs
index 961482b6515..6fa9b12e3dc 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/generic/arraysorthelper.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/generic/arraysorthelper.cs
@@ -7,7 +7,7 @@
**
** Class: ArraySortHelper
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: class to sort arrays
diff --git a/mcs/class/referencesource/mscorlib/system/collections/generic/comparer.cs b/mcs/class/referencesource/mscorlib/system/collections/generic/comparer.cs
index 3e79915d249..46ce4866cc8 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/generic/comparer.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/generic/comparer.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
using System;
diff --git a/mcs/class/referencesource/mscorlib/system/collections/generic/debugview.cs b/mcs/class/referencesource/mscorlib/system/collections/generic/debugview.cs
index e82dda98c3b..ac847ec06f9 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/generic/debugview.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/generic/debugview.cs
@@ -9,7 +9,7 @@
**
** Purpose: DebugView class for generic collections
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
=============================================================================*/
diff --git a/mcs/class/referencesource/mscorlib/system/collections/generic/dictionary.cs b/mcs/class/referencesource/mscorlib/system/collections/generic/dictionary.cs
index 74859fa7f48..92b7c2ac587 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/generic/dictionary.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/generic/dictionary.cs
@@ -7,7 +7,7 @@
**
** Class: Dictionary
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
** Purpose: Generic hash table implementation
**
diff --git a/mcs/class/referencesource/mscorlib/system/collections/generic/equalitycomparer.cs b/mcs/class/referencesource/mscorlib/system/collections/generic/equalitycomparer.cs
index 859bca7c684..e8cb4b2e126 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/generic/equalitycomparer.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/generic/equalitycomparer.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
using System;
diff --git a/mcs/class/referencesource/mscorlib/system/collections/generic/keynotfoundexception.cs b/mcs/class/referencesource/mscorlib/system/collections/generic/keynotfoundexception.cs
index 10477931a15..c8afceb3081 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/generic/keynotfoundexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/generic/keynotfoundexception.cs
@@ -7,7 +7,7 @@
**
** Class: KeyNotFoundException
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Exception class for Hashtable and Dictionary.
diff --git a/mcs/class/referencesource/mscorlib/system/collections/generic/keyvaluepair.cs b/mcs/class/referencesource/mscorlib/system/collections/generic/keyvaluepair.cs
index 24baeb3f2a5..d6e298ee524 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/generic/keyvaluepair.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/generic/keyvaluepair.cs
@@ -7,7 +7,7 @@
**
** Interface: KeyValuePair
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Generic key-value pair for dictionary enumerators.
diff --git a/mcs/class/referencesource/mscorlib/system/collections/generic/list.cs b/mcs/class/referencesource/mscorlib/system/collections/generic/list.cs
index c1a043d04b0..f7d606e22ef 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/generic/list.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/generic/list.cs
@@ -7,7 +7,7 @@
**
** Class: List
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
** Purpose: Implements a generic, dynamically sized list as an
** array.
diff --git a/mcs/class/referencesource/mscorlib/system/collections/hashtable.cs b/mcs/class/referencesource/mscorlib/system/collections/hashtable.cs
index 6998dde77a9..162d92172ed 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/hashtable.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/hashtable.cs
@@ -7,7 +7,7 @@
**
** Class: Hashtable
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Hash table implementation
diff --git a/mcs/class/referencesource/mscorlib/system/collections/keyvaluepairs.cs b/mcs/class/referencesource/mscorlib/system/collections/keyvaluepairs.cs
index 345e2b506f4..06aeb09750c 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/keyvaluepairs.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/keyvaluepairs.cs
@@ -7,7 +7,7 @@
**
** Class: KeyValuePairs
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: KeyValuePairs to display items in collection class under debugger
diff --git a/mcs/class/referencesource/mscorlib/system/collections/listdictionaryinternal.cs b/mcs/class/referencesource/mscorlib/system/collections/listdictionaryinternal.cs
index db4fe1d05ac..b24b03ba769 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/listdictionaryinternal.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/listdictionaryinternal.cs
@@ -8,7 +8,7 @@ using System.Diagnostics.Contracts;
**
** Class: ListDictionaryInternal
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: List for exceptions.
diff --git a/mcs/class/referencesource/mscorlib/system/collections/objectmodel/collection.cs b/mcs/class/referencesource/mscorlib/system/collections/objectmodel/collection.cs
index 6f8b53c88ce..81eda7eda84 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/objectmodel/collection.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/objectmodel/collection.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Collections.ObjectModel
diff --git a/mcs/class/referencesource/mscorlib/system/collections/objectmodel/keyedcollection.cs b/mcs/class/referencesource/mscorlib/system/collections/objectmodel/keyedcollection.cs
index 014d889c47e..6fb1579254a 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/objectmodel/keyedcollection.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/objectmodel/keyedcollection.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Collections.ObjectModel
diff --git a/mcs/class/referencesource/mscorlib/system/collections/objectmodel/readonlycollection.cs b/mcs/class/referencesource/mscorlib/system/collections/objectmodel/readonlycollection.cs
index 760349f817f..30ab5372fc6 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/objectmodel/readonlycollection.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/objectmodel/readonlycollection.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Collections.ObjectModel
diff --git a/mcs/class/referencesource/mscorlib/system/collections/queue.cs b/mcs/class/referencesource/mscorlib/system/collections/queue.cs
index ba67a2a3154..edfcd087341 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/queue.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/queue.cs
@@ -7,7 +7,7 @@
**
** Class: Queue
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
** Purpose: A circular-array implementation of a queue.
**
diff --git a/mcs/class/referencesource/mscorlib/system/collections/readonlycollectionbase.cs b/mcs/class/referencesource/mscorlib/system/collections/readonlycollectionbase.cs
index cf07d664e8f..c83271d24b9 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/readonlycollectionbase.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/readonlycollectionbase.cs
@@ -5,7 +5,7 @@
// ==--==
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Collections {
diff --git a/mcs/class/referencesource/mscorlib/system/collections/sortedlist.cs b/mcs/class/referencesource/mscorlib/system/collections/sortedlist.cs
index 011f33b5fb2..8cc406baf02 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/sortedlist.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/sortedlist.cs
@@ -7,7 +7,7 @@
**
** Class: SortedList
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
** Purpose: A sorted dictionary.
**
diff --git a/mcs/class/referencesource/mscorlib/system/collections/stack.cs b/mcs/class/referencesource/mscorlib/system/collections/stack.cs
index 158089a6216..de575ffbdae 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/stack.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/stack.cs
@@ -7,7 +7,7 @@
**
** Class: Stack
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
** Purpose: An array implementation of a stack.
**
@@ -30,7 +30,7 @@ namespace System.Collections {
private Object[] _array; // Storage for stack elements
[ContractPublicPropertyName("Count")]
private int _size; // Number of items in the stack.
- private int _version; // Used to keep enumerator in [....] w/ collection.
+ private int _version; // Used to keep enumerator in sync w/ collection.
[NonSerialized]
private Object _syncRoot;
diff --git a/mcs/class/referencesource/mscorlib/system/collections/structuralcomparisons.cs b/mcs/class/referencesource/mscorlib/system/collections/structuralcomparisons.cs
index 4d4252aaa22..e5a1aa5563b 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/structuralcomparisons.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/structuralcomparisons.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
using System;
diff --git a/mcs/class/referencesource/mscorlib/system/delegate.cs b/mcs/class/referencesource/mscorlib/system/delegate.cs
index 998b13fbd9c..3bc7e77bd0e 100644
--- a/mcs/class/referencesource/mscorlib/system/delegate.cs
+++ b/mcs/class/referencesource/mscorlib/system/delegate.cs
@@ -796,7 +796,7 @@ namespace System {
}
// These flags effect the way BindToMethodInfo and BindToMethodName are allowed to bind a delegate to a target method. Their
- // values must be kept in [....] with the definition in vm\comdelegate.h.
+ // values must be kept in sync with the definition in vm\comdelegate.h.
internal enum DelegateBindingFlags
{
StaticMethodOnly = 0x00000001, // Can only bind to static target methods
diff --git a/mcs/class/referencesource/mscorlib/system/diagnostics/contracts/contracts.cs b/mcs/class/referencesource/mscorlib/system/diagnostics/contracts/contracts.cs
index fe943007d0b..e2fc7888f42 100644
--- a/mcs/class/referencesource/mscorlib/system/diagnostics/contracts/contracts.cs
+++ b/mcs/class/referencesource/mscorlib/system/diagnostics/contracts/contracts.cs
@@ -7,7 +7,7 @@
**
** Class: Contract
**
-** <OWNER>[....],mbarnett</OWNER>
+** <OWNER>Microsoft,mbarnett</OWNER>
**
** Purpose: The contract class allows for expressing preconditions,
** postconditions, and object invariants about methods in source
diff --git a/mcs/class/referencesource/mscorlib/system/diagnostics/contracts/contractsbcl.cs b/mcs/class/referencesource/mscorlib/system/diagnostics/contracts/contractsbcl.cs
index 8e7ff0170e4..64659166499 100644
--- a/mcs/class/referencesource/mscorlib/system/diagnostics/contracts/contractsbcl.cs
+++ b/mcs/class/referencesource/mscorlib/system/diagnostics/contracts/contractsbcl.cs
@@ -7,7 +7,7 @@
**
** Class: Contract
**
-** <OWNER>maf,mbarnett,[....]</OWNER>
+** <OWNER>maf,mbarnett,Microsoft</OWNER>
**
** Implementation details of CLR Contracts.
**
diff --git a/mcs/class/referencesource/mscorlib/system/diagnostics/eventing/TraceLogging/EventPayload.cs b/mcs/class/referencesource/mscorlib/system/diagnostics/eventing/TraceLogging/EventPayload.cs
index 3240a8d738d..d3f21680ce4 100644
--- a/mcs/class/referencesource/mscorlib/system/diagnostics/eventing/TraceLogging/EventPayload.cs
+++ b/mcs/class/referencesource/mscorlib/system/diagnostics/eventing/TraceLogging/EventPayload.cs
@@ -95,7 +95,10 @@ namespace System.Diagnostics.Tracing
public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
{
- throw new System.NotSupportedException();
+ for (int i = 0; i < Keys.Count; i++)
+ {
+ yield return new KeyValuePair<string, object>(this.m_names[i], this.m_values[i]);
+ }
}
IEnumerator IEnumerable.GetEnumerator()
diff --git a/mcs/class/referencesource/mscorlib/system/diagnostics/eventing/activitytracker.cs b/mcs/class/referencesource/mscorlib/system/diagnostics/eventing/activitytracker.cs
index bdfa364fe10..22be307d6ee 100644
--- a/mcs/class/referencesource/mscorlib/system/diagnostics/eventing/activitytracker.cs
+++ b/mcs/class/referencesource/mscorlib/system/diagnostics/eventing/activitytracker.cs
@@ -549,7 +549,7 @@ namespace System.Diagnostics.Tracing
}
// This callback is used to initialize the m_current AsyncLocal Variable.
- // Its job is to keep the ETW Activity ID (part of thread local storage) in [....]
+ // Its job is to keep the ETW Activity ID (part of thread local storage) in sync
// with m_current.ActivityID
void ActivityChanging(AsyncLocalValueChangedArgs<ActivityInfo> args)
{
diff --git a/mcs/class/referencesource/mscorlib/system/diagnostics/eventing/eventdescriptor.cs b/mcs/class/referencesource/mscorlib/system/diagnostics/eventing/eventdescriptor.cs
index f8f4afe9536..60eae4d2d7d 100644
--- a/mcs/class/referencesource/mscorlib/system/diagnostics/eventing/eventdescriptor.cs
+++ b/mcs/class/referencesource/mscorlib/system/diagnostics/eventing/eventdescriptor.cs
@@ -2,7 +2,7 @@
// <copyright file="etwprovider.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//------------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
diff --git a/mcs/class/referencesource/mscorlib/system/diagnostics/eventing/eventsource.cs b/mcs/class/referencesource/mscorlib/system/diagnostics/eventing/eventsource.cs
index 9ae56693725..6bc1f76856f 100644
--- a/mcs/class/referencesource/mscorlib/system/diagnostics/eventing/eventsource.cs
+++ b/mcs/class/referencesource/mscorlib/system/diagnostics/eventing/eventsource.cs
@@ -1207,7 +1207,7 @@ namespace System.Diagnostics.Tracing
}
#if FEATURE_ACTIVITYSAMPLING
- // this code should be kept in [....] with WriteEventVarargs().
+ // this code should be kept in sync with WriteEventVarargs().
SessionMask etwSessions = SessionMask.All;
// only compute etwSessions if there are *any* ETW filters enabled...
if ((ulong)m_curLiveSessions != 0)
@@ -1938,7 +1938,7 @@ namespace System.Diagnostics.Tracing
}
#if FEATURE_ACTIVITYSAMPLING
- // this code should be kept in [....] with WriteEventWithRelatedActivityIdCore().
+ // this code should be kept in sync with WriteEventWithRelatedActivityIdCore().
SessionMask etwSessions = SessionMask.All;
// only compute etwSessions if there are *any* ETW filters enabled...
if ((ulong)m_curLiveSessions != 0)
@@ -1968,7 +1968,7 @@ namespace System.Diagnostics.Tracing
m_eventData[eventId].Descriptor.Level,
m_eventData[eventId].Descriptor.Opcode,
m_eventData[eventId].Descriptor.Task,
- unchecked((long)(ulong)etwSessions | origKwd));
+ unchecked((long)etwSessions.ToEventKeywords() | origKwd));
if (!m_provider.WriteEvent(ref desc, pActivityId, childActivityID, args))
ThrowEventSourceException(m_eventData[eventId].Name);
@@ -1989,7 +1989,7 @@ namespace System.Diagnostics.Tracing
//
EventSourceOptions opt = new EventSourceOptions
{
- Keywords = (EventKeywords)unchecked((long)(ulong)etwSessions | origKwd),
+ Keywords = (EventKeywords)unchecked((long)etwSessions.ToEventKeywords() | origKwd),
Level = (EventLevel)m_eventData[eventId].Descriptor.Level,
Opcode = (EventOpcode)m_eventData[eventId].Descriptor.Opcode
};
@@ -3109,6 +3109,11 @@ namespace System.Diagnostics.Tracing
dataLeft -= chunkSize;
dataDescrs[1].Ptr += (uint)chunkSize;
envelope.ChunkNumber++;
+
+ // For large manifests we want to not overflow any receiver's buffer. Most manifests will fit within
+ // 5 chunks, so only the largest manifests will hit the pause.
+ if((envelope.ChunkNumber % 5) == 0)
+ Thread.Sleep(15);
}
}
#endif
@@ -4330,6 +4335,15 @@ namespace System.Diagnostics.Tracing
}
/// <summary>
+ /// EventSourceIndex is small non-negative integer (suitable for indexing in an array)
+ /// identifying EventSource. It is unique per-appdomain. Some EventListeners might find
+ /// it useful to store additional information about each eventSource connected to it,
+ /// and EventSourceIndex allows this extra information to be efficiently stored in a
+ /// (growable) array (eg List(T)).
+ /// </summary>
+ public static int EventSourceIndex(EventSource eventSource) { return eventSource.m_id; }
+
+ /// <summary>
/// This method is called whenever a new eventSource is 'attached' to the dispatcher.
/// This can happen for all existing EventSources when the EventListener is created
/// as well as for any EventSources that come into existence after the EventListener
@@ -4367,15 +4381,6 @@ namespace System.Diagnostics.Tracing
}
}
- /// <summary>
- /// EventSourceIndex is small non-negative integer (suitable for indexing in an array)
- /// identifying EventSource. It is unique per-appdomain. Some EventListeners might find
- /// it useful to store additional information about each eventSource connected to it,
- /// and EventSourceIndex allows this extra information to be efficiently stored in a
- /// (growable) array (eg List(T)).
- /// </summary>
- static protected int EventSourceIndex(EventSource eventSource) { return eventSource.m_id; }
-
#region private
/// <summary>
/// This routine adds newEventSource to the global list of eventSources, it also assigns the
diff --git a/mcs/class/referencesource/mscorlib/system/diagnostics/eventing/frameworkeventsource.cs b/mcs/class/referencesource/mscorlib/system/diagnostics/eventing/frameworkeventsource.cs
index fbd51c70fa1..f20eaa19b11 100644
--- a/mcs/class/referencesource/mscorlib/system/diagnostics/eventing/frameworkeventsource.cs
+++ b/mcs/class/referencesource/mscorlib/system/diagnostics/eventing/frameworkeventsource.cs
@@ -6,8 +6,8 @@
//
// ResourcesEtwProvider.cs
//
-// <OWNER>[....]</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Managed event source for things that can version with MSCORLIB.
//
diff --git a/mcs/class/referencesource/mscorlib/system/exception.cs b/mcs/class/referencesource/mscorlib/system/exception.cs
index c23bc452847..a539756ee16 100644
--- a/mcs/class/referencesource/mscorlib/system/exception.cs
+++ b/mcs/class/referencesource/mscorlib/system/exception.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// ==--==
/*=============================================================================
diff --git a/mcs/class/referencesource/mscorlib/system/executionengineexception.cs b/mcs/class/referencesource/mscorlib/system/executionengineexception.cs
index 49322834614..6e928d5170b 100644
--- a/mcs/class/referencesource/mscorlib/system/executionengineexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/executionengineexception.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
/*=============================================================================
**
diff --git a/mcs/class/referencesource/mscorlib/system/globalization/Persiancalendar.cs b/mcs/class/referencesource/mscorlib/system/globalization/Persiancalendar.cs
index cdcbe04a2da..5eb368bacf6 100644
--- a/mcs/class/referencesource/mscorlib/system/globalization/Persiancalendar.cs
+++ b/mcs/class/referencesource/mscorlib/system/globalization/Persiancalendar.cs
@@ -13,7 +13,7 @@ namespace System.Globalization {
//
////////////////////////////////////////////////////////////////////////////
// Modern Persian calendar is a solar observation based calendar. Each new year begins on the day when the vernal equinox occurs before noon.
- // The epoch is the date of the vernal equinox prior to the epoch of the Islamic calendar ([....] 19, 622 Julian or [....] 22, 622 Gregorian)
+ // The epoch is the date of the vernal equinox prior to the epoch of the Islamic calendar (Microsoft 19, 622 Julian or Microsoft 22, 622 Gregorian)
// There is no Persian year 0. Ordinary years have 365 days. Leap years have 366 days with the last month (Esfand) gaining the extra day.
/*
diff --git a/mcs/class/referencesource/mscorlib/system/globalization/calendar.cs b/mcs/class/referencesource/mscorlib/system/globalization/calendar.cs
index 44840fdca6f..9b0ca90b55f 100644
--- a/mcs/class/referencesource/mscorlib/system/globalization/calendar.cs
+++ b/mcs/class/referencesource/mscorlib/system/globalization/calendar.cs
@@ -19,7 +19,7 @@ namespace System.Globalization {
// , 46, 8, 20, 3, 1999) in the Gregorian calendar. An implementation of
// Calendar can map any DateTime value to such an n-tuple and vice versa. The
// DateTimeFormat class can map between such n-tuples and a textual
- // representation such as "8:46 AM [....] 20th 1999 AD".
+ // representation such as "8:46 AM Microsoft 20th 1999 AD".
//
// Most calendars identify a year which begins the current era. There may be any
// number of previous eras. The Calendar class identifies the eras as enumerated
diff --git a/mcs/class/referencesource/mscorlib/system/globalization/calendardata.cs b/mcs/class/referencesource/mscorlib/system/globalization/calendardata.cs
index dbeaab726be..31fb7d6d256 100644
--- a/mcs/class/referencesource/mscorlib/system/globalization/calendardata.cs
+++ b/mcs/class/referencesource/mscorlib/system/globalization/calendardata.cs
@@ -24,7 +24,7 @@ namespace System.Globalization
// properties are available without locales using CalendarData.GetCalendar(int)
// StructLayout is needed here otherwise compiler can re-arrange the fields.
- // We have to keep this in-[....] with the definition in calendardata.h
+ // We have to keep this in-sync with the definition in calendardata.h
//
// WARNING WARNING WARNING
//
diff --git a/mcs/class/referencesource/mscorlib/system/globalization/culturedata.cs b/mcs/class/referencesource/mscorlib/system/globalization/culturedata.cs
index b128980d053..ee166fccb9a 100644
--- a/mcs/class/referencesource/mscorlib/system/globalization/culturedata.cs
+++ b/mcs/class/referencesource/mscorlib/system/globalization/culturedata.cs
@@ -55,7 +55,7 @@ namespace System.Globalization
//
// StructLayout is needed here otherwise compiler can re-arrange the fields.
- // We have to keep this in-[....] with the definition in comnlsinfo.h
+ // We have to keep this in-sync with the definition in comnlsinfo.h
//
// WARNING WARNING WARNING
//
diff --git a/mcs/class/referencesource/mscorlib/system/globalization/cultureinfo.cs b/mcs/class/referencesource/mscorlib/system/globalization/cultureinfo.cs
index 07c0f14721d..b3cf1c0cb2e 100644
--- a/mcs/class/referencesource/mscorlib/system/globalization/cultureinfo.cs
+++ b/mcs/class/referencesource/mscorlib/system/globalization/cultureinfo.cs
@@ -14,7 +14,7 @@
// as well as methods for common operations such as printing
// dates and sorting strings.
//
-// Date: [....] 31, 1999
+// Date: Microsoft 31, 1999
//
//
// !!!! NOTE WHEN CHANGING THIS CLASS !!!!
diff --git a/mcs/class/referencesource/mscorlib/system/globalization/datetimeparse.cs b/mcs/class/referencesource/mscorlib/system/globalization/datetimeparse.cs
index 991ac511702..fae16b956da 100644
--- a/mcs/class/referencesource/mscorlib/system/globalization/datetimeparse.cs
+++ b/mcs/class/referencesource/mscorlib/system/globalization/datetimeparse.cs
@@ -5059,7 +5059,7 @@ Start:
YearNumberToken = 2, // The number which is considered as year number, which has 3 or more digits. E.g. "2003"
Am = 3, // AM timemark. E.g. "AM"
Pm = 4, // PM timemark. E.g. "PM"
- MonthToken = 5, // A word (or words) that represents a month name. E.g. "[....]"
+ MonthToken = 5, // A word (or words) that represents a month name. E.g. "Microsoft"
EndOfString = 6, // End of string
DayOfWeekToken = 7, // A word (or words) that represents a day of week name. E.g. "Monday" or "Mon"
TimeZoneToken = 8, // A word that represents a timezone name. E.g. "GMT"
diff --git a/mcs/class/referencesource/mscorlib/system/globalization/eastasianlunisolarcalendar.cs b/mcs/class/referencesource/mscorlib/system/globalization/eastasianlunisolarcalendar.cs
index cab202119c2..893503413c9 100644
--- a/mcs/class/referencesource/mscorlib/system/globalization/eastasianlunisolarcalendar.cs
+++ b/mcs/class/referencesource/mscorlib/system/globalization/eastasianlunisolarcalendar.cs
@@ -303,7 +303,7 @@ namespace System.Globalization {
// convert solar day into lunar day.
// subtract off the beginning part of the solar year which is not
// part of the lunar year. since this part is always in Jan or Feb,
- // we don't need to handle Leap Year (LY only affects [....]
+ // we don't need to handle Leap Year (LY only affects Microsoft
// and later).
nLunarDay -= DaysToMonth365[nJan1Month-1];
nLunarDay -= (nJan1Date - 1);
diff --git a/mcs/class/referencesource/mscorlib/system/globalization/hebrewnumber.cs b/mcs/class/referencesource/mscorlib/system/globalization/hebrewnumber.cs
index 8c96b12e3ea..4bb6202e695 100644
--- a/mcs/class/referencesource/mscorlib/system/globalization/hebrewnumber.cs
+++ b/mcs/class/referencesource/mscorlib/system/globalization/hebrewnumber.cs
@@ -140,7 +140,7 @@ namespace System.Globalization {
cTens = '\x05db'; // Hebrew Letter Kaf
break;
case ( 3 ) :
- cTens = '\x05dc'; // Hebrew Letter ----d
+ cTens = '\x05dc'; // Hebrew Letter Lamed
break;
case ( 4 ) :
cTens = '\x05de'; // Hebrew Letter Mem
@@ -256,7 +256,7 @@ namespace System.Globalization {
new HebrewValue(HebrewToken.Digit10, 10) , // '\x05d9; // Hebrew Letter Yod
new HebrewValue(HebrewToken.Invalid, -1) , // '\x05da;
new HebrewValue(HebrewToken.Digit10, 20) , // '\x05db; // Hebrew Letter Kaf
- new HebrewValue(HebrewToken.Digit10, 30) , // '\x05dc; // Hebrew Letter ----d
+ new HebrewValue(HebrewToken.Digit10, 30) , // '\x05dc; // Hebrew Letter Lamed
new HebrewValue(HebrewToken.Invalid, -1) , // '\x05dd;
new HebrewValue(HebrewToken.Digit10, 40) , // '\x05de; // Hebrew Letter Mem
new HebrewValue(HebrewToken.Invalid, -1) , // '\x05df;
diff --git a/mcs/class/referencesource/mscorlib/system/globalization/regioninfo.cs b/mcs/class/referencesource/mscorlib/system/globalization/regioninfo.cs
index c27177b8eeb..16503897c75 100644
--- a/mcs/class/referencesource/mscorlib/system/globalization/regioninfo.cs
+++ b/mcs/class/referencesource/mscorlib/system/globalization/regioninfo.cs
@@ -14,7 +14,7 @@
// preferences of the user and does not depend on the user's
// language or culture.
//
-// Date: [....] 31, 1999
+// Date: Microsoft 31, 1999
//
////////////////////////////////////////////////////////////////////////////
diff --git a/mcs/class/referencesource/mscorlib/system/globalization/stringinfo.cs b/mcs/class/referencesource/mscorlib/system/globalization/stringinfo.cs
index efd5cada4f9..f39ac8c43e0 100644
--- a/mcs/class/referencesource/mscorlib/system/globalization/stringinfo.cs
+++ b/mcs/class/referencesource/mscorlib/system/globalization/stringinfo.cs
@@ -11,7 +11,7 @@
// A writing system is the collection of scripts and
// orthographic rules required to represent a language as text.
//
-// Date: [....] 31, 1999
+// Date: Microsoft 31, 1999
//
////////////////////////////////////////////////////////////////////////////
diff --git a/mcs/class/referencesource/mscorlib/system/globalization/taiwancalendar.cs b/mcs/class/referencesource/mscorlib/system/globalization/taiwancalendar.cs
index e2f2f3055e5..6ba1a392982 100644
--- a/mcs/class/referencesource/mscorlib/system/globalization/taiwancalendar.cs
+++ b/mcs/class/referencesource/mscorlib/system/globalization/taiwancalendar.cs
@@ -21,7 +21,7 @@ namespace System.Globalization {
** Gregorian 1912/01/01 9999/12/31
** Taiwan 01/01/01 8088/12/31
============================================================================*/
-
+
[System.Runtime.InteropServices.ComVisible(true)]
[Serializable] public class TaiwanCalendar: Calendar {
diff --git a/mcs/class/referencesource/mscorlib/system/globalization/textelementenumerator.cs b/mcs/class/referencesource/mscorlib/system/globalization/textelementenumerator.cs
index 503a249dfd3..57b17ae0704 100644
--- a/mcs/class/referencesource/mscorlib/system/globalization/textelementenumerator.cs
+++ b/mcs/class/referencesource/mscorlib/system/globalization/textelementenumerator.cs
@@ -9,7 +9,7 @@
//
// Purpose:
//
-// Date: [....] 31, 1999
+// Date: Microsoft 31, 1999
//
////////////////////////////////////////////////////////////////////////////
diff --git a/mcs/class/referencesource/mscorlib/system/globalization/textinfo.cs b/mcs/class/referencesource/mscorlib/system/globalization/textinfo.cs
index 67085e4ecbf..e2d5391f974 100644
--- a/mcs/class/referencesource/mscorlib/system/globalization/textinfo.cs
+++ b/mcs/class/referencesource/mscorlib/system/globalization/textinfo.cs
@@ -11,7 +11,7 @@
// A writing system is the collection of scripts and
// orthographic rules required to represent a language as text.
//
-// Date: [....] 31, 1999
+// Date: Microsoft 31, 1999
//
////////////////////////////////////////////////////////////////////////////
diff --git a/mcs/class/referencesource/mscorlib/system/globalization/timespanformat.cs b/mcs/class/referencesource/mscorlib/system/globalization/timespanformat.cs
index ae14266ab72..23928c8e24d 100644
--- a/mcs/class/referencesource/mscorlib/system/globalization/timespanformat.cs
+++ b/mcs/class/referencesource/mscorlib/system/globalization/timespanformat.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Globalization {
using System.Text;
diff --git a/mcs/class/referencesource/mscorlib/system/globalization/timespanparse.cs b/mcs/class/referencesource/mscorlib/system/globalization/timespanparse.cs
index 5ff183b7c04..3e15ad9407d 100644
--- a/mcs/class/referencesource/mscorlib/system/globalization/timespanparse.cs
+++ b/mcs/class/referencesource/mscorlib/system/globalization/timespanparse.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
////////////////////////////////////////////////////////////////////////////
//
diff --git a/mcs/class/referencesource/mscorlib/system/globalization/umalquracalendar.cs b/mcs/class/referencesource/mscorlib/system/globalization/umalquracalendar.cs
index d7ca8056aba..7e8a4dde5d3 100644
--- a/mcs/class/referencesource/mscorlib/system/globalization/umalquracalendar.cs
+++ b/mcs/class/referencesource/mscorlib/system/globalization/umalquracalendar.cs
@@ -43,7 +43,7 @@ namespace System.Globalization {
static DateMapping[] InitDateMapping()
{
short[] rawData = new short[] {
-//These data is taken from Tables/Excel/UmAlQura.xls please make sure that the two places are in [....]
+//These data is taken from Tables/Excel/UmAlQura.xls please make sure that the two places are in sync
/* DaysPerM GY GM GD D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11 D12
1318*/0x02EA, 1900, 4, 30,/* 0 1 0 1 0 1 1 1 0 1 0 0 4/30/1900
1319*/0x06E9, 1901, 4, 19,/* 1 0 0 1 0 1 1 1 0 1 1 0 4/19/1901
diff --git a/mcs/class/referencesource/mscorlib/system/io/__consolestream.cs b/mcs/class/referencesource/mscorlib/system/io/__consolestream.cs
index 505f30675c9..a877feabd30 100644
--- a/mcs/class/referencesource/mscorlib/system/io/__consolestream.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/__consolestream.cs
@@ -5,7 +5,7 @@
// ==--==
/*============================================================
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
** Class: ConsoleStream
**
diff --git a/mcs/class/referencesource/mscorlib/system/io/__error.cs b/mcs/class/referencesource/mscorlib/system/io/__error.cs
index 253ab9e4dab..e57e6aeddf9 100644
--- a/mcs/class/referencesource/mscorlib/system/io/__error.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/__error.cs
@@ -7,7 +7,7 @@
**
** Class: __Error
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Centralized error methods for the IO package.
diff --git a/mcs/class/referencesource/mscorlib/system/io/bufferedstream.cs b/mcs/class/referencesource/mscorlib/system/io/bufferedstream.cs
index 9e77077a564..0b22c9bd843 100644
--- a/mcs/class/referencesource/mscorlib/system/io/bufferedstream.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/bufferedstream.cs
@@ -395,7 +395,7 @@ public sealed class BufferedStream : Stream {
// Reading is done in blocks, but someone could read 1 byte from the buffer then write.
- // At that point, the underlying stream's pointer is out of [....] with this stream's position.
+ // At that point, the underlying stream's pointer is out of sync with this stream's position.
// All write functions should call this function to ensure that the buffered data is not lost.
private void FlushRead() {
@@ -1158,7 +1158,7 @@ public sealed class BufferedStream : Stream {
try {
// The buffer might have been changed by another async task while we were waiting on the semaphore.
- // However, note that if we recalculate the [....] completion condition to TRUE, then useBuffer will also be TRUE.
+ // However, note that if we recalculate the sync completion condition to TRUE, then useBuffer will also be TRUE.
if (_writePos == 0)
ClearReadBufferBeforeWrite();
diff --git a/mcs/class/referencesource/mscorlib/system/io/directory.cs b/mcs/class/referencesource/mscorlib/system/io/directory.cs
index 429e2f6efbd..e2b2011388f 100644
--- a/mcs/class/referencesource/mscorlib/system/io/directory.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/directory.cs
@@ -7,7 +7,7 @@
**
** Class: Directory
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Exposes routines for enumerating through a
@@ -103,53 +103,70 @@ namespace System.IO {
[System.Security.SecurityCritical]
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
- internal static DirectoryInfo InternalCreateDirectoryHelper(String path, bool checkHost)
+ internal static DirectoryInfo InternalCreateDirectoryHelper(string path, bool checkHost)
{
Contract.Requires(path != null);
Contract.Requires(path.Length != 0);
+ string fullPath = GetFullPathAndCheckPermissions(path, checkHost: checkHost);
+
+ InternalCreateDirectory(fullPath, path, dirSecurityObj: null, checkHost: checkHost);
+
+ // Call the internal DirectoryInfo constructor
+ return new DirectoryInfo(fullPath, junk: false);
+ }
+
+ internal static string GetFullPathAndCheckPermissions(string path, bool checkHost, FileSecurityStateAccess access = FileSecurityStateAccess.Read)
+ {
String fullPath = Path.GetFullPathInternal(path);
+ CheckPermissions(path, fullPath, checkHost: checkHost, access: access);
+ return fullPath;
+ }
+ [SecuritySafeCritical]
+ internal static void CheckPermissions(string displayPath, string fullPath, bool checkHost, FileSecurityStateAccess access = FileSecurityStateAccess.Read)
+ {
// You need read access to the directory to be returned back and write access to all the directories
// that you need to create. If we fail any security checks we will not create any directories at all.
// We attempt to create directories only after all the security checks have passed. This is avoid doing
// a demand at every level.
- String demandDir = GetDemandDir(fullPath, true);
#if FEATURE_CORECLR
if (checkHost)
{
- FileSecurityState state = new FileSecurityState(FileSecurityStateAccess.Read, path, demandDir);
- state.EnsureState(); // do the check on the AppDomainManager to make sure this is allowed
+ FileSecurityState state = new FileSecurityState(
+ access,
+ path: displayPath,
+ canonicalizedPath: GetDemandDir(fullPath, thisDirOnly: true));
+ state.EnsureState(); // do the check on the AppDomainManager to make sure this is allowed
}
#else
- FileIOPermission.QuickDemand(FileIOPermissionAccess.Read, demandDir, false, false);
+ // In full trust we want to avoid allocating another string via GetDemandDir()
+ if (CodeAccessSecurityEngine.QuickCheckForAllDemands())
+ FileIOPermission.EmulateFileIOPermissionChecks(fullPath);
+ else
+ FileIOPermission.QuickDemand(
+ (FileIOPermissionAccess)access,
+ GetDemandDir(fullPath, thisDirOnly: true),
+ checkForDuplicates: false,
+ needFullPath: false);
#endif
-
- InternalCreateDirectory(fullPath, path, null, checkHost);
-
- return new DirectoryInfo(fullPath, false);
}
+
#if FEATURE_MACL
[System.Security.SecuritySafeCritical] // auto-generated
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
- public static DirectoryInfo CreateDirectory(String path, DirectorySecurity directorySecurity) {
+ public static DirectoryInfo CreateDirectory(String path, DirectorySecurity directorySecurity)
+ {
if (path==null)
throw new ArgumentNullException("path");
if (path.Length == 0)
throw new ArgumentException(Environment.GetResourceString("Argument_PathEmpty"));
Contract.EndContractBlock();
-
- String fullPath = Path.GetFullPathInternal(path);
- // You need read access to the directory to be returned back and write access to all the directories
- // that you need to create. If we fail any security checks we will not create any directories at all.
- // We attempt to create directories only after all the security checks have passed. This is avoid doing
- // a demand at every level.
- String demandDir = GetDemandDir(fullPath, true);
- FileIOPermission.QuickDemand(FileIOPermissionAccess.Read, demandDir, false, false );
+ string fullPath = GetFullPathAndCheckPermissions(path, checkHost: true);
InternalCreateDirectory(fullPath, path, directorySecurity);
@@ -323,21 +340,16 @@ namespace System.IO {
// fail because the target does exist, but is a file.
if (currentError != Win32Native.ERROR_ALREADY_EXISTS)
firstError = currentError;
- else {
+ else
+ {
// If there's a file in this directory's place, or if we have ERROR_ACCESS_DENIED when checking if the directory already exists throw.
- if (File.InternalExists(name) || (!InternalExists(name, out currentError) && currentError == Win32Native.ERROR_ACCESS_DENIED)) {
+ if (File.InternalExists(name) || (!InternalExists(name, out currentError) && currentError == Win32Native.ERROR_ACCESS_DENIED))
+ {
firstError = currentError;
// Give the user a nice error message, but don't leak path information.
- try {
-#if FEATURE_CORECLR
- if (checkHost)
- {
- FileSecurityState state = new FileSecurityState(FileSecurityStateAccess.PathDiscovery, String.Empty, GetDemandDir(name, true));
- state.EnsureState();
- }
-#else
- FileIOPermission.QuickDemand(FileIOPermissionAccess.PathDiscovery, GetDemandDir(name, true));
-#endif // FEATURE_CORECLR
+ try
+ {
+ CheckPermissions(string.Empty, name, checkHost: checkHost, access: FileSecurityStateAccess.PathDiscovery);
errorString = name;
}
catch(SecurityException) {}
@@ -375,7 +387,7 @@ namespace System.IO {
[ResourceConsumption(ResourceScope.Machine)]
public static bool Exists(String path)
{
- return InternalExistsHelper(path, true);
+ return InternalExistsHelper(path, checkHost: true);
}
[System.Security.SecurityCritical]
@@ -383,36 +395,22 @@ namespace System.IO {
[ResourceConsumption(ResourceScope.Machine)]
internal static bool UnsafeExists(String path)
{
- return InternalExistsHelper(path, false);
+ return InternalExistsHelper(path, checkHost: false);
}
[System.Security.SecurityCritical]
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
- internal static bool InternalExistsHelper(String path, bool checkHost) {
+ internal static bool InternalExistsHelper(String path, bool checkHost)
+ {
+ if (path == null || path.Length == 0)
+ return false;
+
try
{
- if (path == null)
- return false;
- if (path.Length == 0)
- return false;
-
- // Get fully qualified file name ending in \* for security check
-
- String fullPath = Path.GetFullPathInternal(path);
- String demandPath = GetDemandDir(fullPath, true);
-
-#if FEATURE_CORECLR
- if (checkHost)
- {
- FileSecurityState state = new FileSecurityState(FileSecurityStateAccess.Read, path, demandPath);
- state.EnsureState();
- }
-#else
- FileIOPermission.QuickDemand(FileIOPermissionAccess.Read, demandPath, false, false);
-#endif
-
-
+ // This could be further optimized- there is no need to get the full path if we aren't checking our
+ // own permissions- Windows will normalize it when we get the attributes.
+ string fullPath = GetFullPathAndCheckPermissions(path, checkHost: checkHost);
return InternalExists(fullPath);
}
catch (ArgumentException) { }
@@ -422,7 +420,7 @@ namespace System.IO {
catch (UnauthorizedAccessException)
{
#if !FEATURE_PAL
- Contract.Assert(false, "Ignore this assert and send a repro to [....]. This assert was tracking purposes only.");
+ Contract.Assert(false, "Ignore this assert and send a repro to Microsoft. This assert was tracking purposes only.");
#endif //!FEATURE_PAL
}
return false;
@@ -1051,27 +1049,23 @@ namespace System.IO {
[System.Security.SecuritySafeCritical]
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
- public static String GetDirectoryRoot(String path) {
+ public static string GetDirectoryRoot(string path)
+ {
if (path==null)
throw new ArgumentNullException("path");
Contract.EndContractBlock();
-
- String fullPath = Path.GetFullPathInternal(path);
- String root = fullPath.Substring(0, Path.GetRootLength(fullPath));
- String demandPath = GetDemandDir(root, true);
-#if FEATURE_CORECLR
- FileSecurityState state = new FileSecurityState(FileSecurityStateAccess.PathDiscovery, path, demandPath);
- state.EnsureState();
-#else
- FileIOPermission.QuickDemand(FileIOPermissionAccess.PathDiscovery, demandPath, false, false);
-#endif
-
+ string fullPath = Path.GetFullPathInternal(path);
+ string root = fullPath.Substring(0, Path.GetRootLength(fullPath));
+
+ CheckPermissions(path, root, checkHost: true, access: FileSecurityStateAccess.PathDiscovery);
+
return root;
}
- internal static String InternalGetDirectoryRoot(String path) {
- if (path == null) return null;
+ internal static string InternalGetDirectoryRoot(string path)
+ {
+ if (path == null) return null;
return path.Substring(0, Path.GetRootLength(path));
}
@@ -1104,17 +1098,9 @@ namespace System.IO {
private static string InternalGetCurrentDirectory(bool checkHost)
{
string currentDirectory = AppContextSwitches.UseLegacyPathHandling ? LegacyGetCurrentDirectory() : NewGetCurrentDirectory();
- string demandPath = GetDemandDir(currentDirectory, true);
-#if FEATURE_CORECLR
- if (checkHost)
- {
- FileSecurityState state = new FileSecurityState(FileSecurityStateAccess.PathDiscovery, String.Empty, demandPath);
- state.EnsureState();
- }
-#else
- FileIOPermission.QuickDemand(FileIOPermissionAccess.PathDiscovery, demandPath, false, false);
-#endif
+ CheckPermissions(string.Empty, currentDirectory, checkHost: true, access: FileSecurityStateAccess.PathDiscovery);
+
return currentDirectory;
}
@@ -1328,11 +1314,11 @@ namespace System.IO {
internal static void Delete(String fullPath, String userPath, bool recursive, bool checkHost)
{
String demandPath;
-
+
// If not recursive, do permission check only on this directory
// else check for the whole directory structure rooted below
- demandPath = GetDemandDir(fullPath, !recursive);
-
+ demandPath = GetDemandDir(fullPath, thisDirOnly: !recursive);
+
#if FEATURE_CORECLR
if (checkHost)
{
@@ -1506,7 +1492,6 @@ namespace System.IO {
}
}
- // WinNT only. Win9x this code will not work.
[System.Security.SecurityCritical] // auto-generated
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
diff --git a/mcs/class/referencesource/mscorlib/system/io/directoryinfo.cs b/mcs/class/referencesource/mscorlib/system/io/directoryinfo.cs
index 4a5d733a5fc..b53c60893e2 100644
--- a/mcs/class/referencesource/mscorlib/system/io/directoryinfo.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/directoryinfo.cs
@@ -7,7 +7,7 @@
**
** Class: DirectoryInfo
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Exposes routines for enumerating through a
@@ -33,14 +33,19 @@ using System.Runtime.Serialization;
using System.Runtime.Versioning;
using System.Diagnostics.Contracts;
-namespace System.IO {
+namespace System.IO
+{
[Serializable]
[ComVisible(true)]
- public sealed class DirectoryInfo : FileSystemInfo {
- private String[] demandDir;
+ public sealed class DirectoryInfo : FileSystemInfo
+ {
+#pragma warning disable CS0169
+ // This member isn't used anymore but must be maintained for binary serialization compatibility
+ private string[] demandDir;
+#pragma warning restore CS0169
#if FEATURE_CORECLR
- // Migrating InheritanceDemands requires this default ctor, so we can annotate it.
+ // Migrating InheritanceDemands requires this default ctor, so we can annotate it.
#if FEATURE_CORESYSTEM
[System.Security.SecurityCritical]
#else
@@ -79,7 +84,7 @@ namespace System.IO {
[System.Security.SecurityCritical]
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
- private void Init(String path, bool checkHost)
+ private void Init(string path, bool checkHost)
{
// Special case "<DriveLetter>:" to point to "<CurrentDirectory>" instead
if ((path.Length == 2) && (path[1] == ':'))
@@ -92,18 +97,7 @@ namespace System.IO {
}
// Must fully qualify the path for the security check
- String fullPath = Path.GetFullPathInternal(path);
-
- demandDir = new String[] {Directory.GetDemandDir(fullPath, true)};
-#if FEATURE_CORECLR
- if (checkHost)
- {
- FileSecurityState state = new FileSecurityState(FileSecurityStateAccess.Read, OriginalPath, fullPath);
- state.EnsureState();
- }
-#else
- FileIOPermission.QuickDemand(FileIOPermissionAccess.Read, demandDir, false, false);
-#endif
+ string fullPath = Directory.GetFullPathAndCheckPermissions(path, checkHost: checkHost);
FullPath = fullPath;
DisplayPath = GetDisplayName(OriginalPath, FullPath);
@@ -122,20 +116,17 @@ namespace System.IO {
FullPath = fullPath;
DisplayPath = GetDisplayName(OriginalPath, FullPath);
- demandDir = new String[] {Directory.GetDemandDir(fullPath, true)};
}
[System.Security.SecurityCritical] // auto-generated
private DirectoryInfo(SerializationInfo info, StreamingContext context) : base(info, context)
{
-#if !FEATURE_CORECLR
- demandDir = new String[] {Directory.GetDemandDir(FullPath, true)};
- FileIOPermission.QuickDemand(FileIOPermissionAccess.Read, demandDir, false, false );
-#endif
+ Directory.CheckPermissions(string.Empty, FullPath, checkHost: false);
DisplayPath = GetDisplayName(OriginalPath, FullPath);
}
- public override String Name {
+ public override string Name
+ {
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
get
@@ -150,32 +141,49 @@ namespace System.IO {
}
}
- public DirectoryInfo Parent {
+ public override string FullName
+ {
+ [SecuritySafeCritical]
+ get
+ {
+ Directory.CheckPermissions(string.Empty, FullPath, checkHost: true, access: FileSecurityStateAccess.PathDiscovery);
+ return FullPath;
+ }
+ }
+
+ internal override string UnsafeGetFullName
+ {
+ [SecurityCritical]
+ get
+ {
+ Directory.CheckPermissions(string.Empty, FullPath, checkHost: false, access: FileSecurityStateAccess.PathDiscovery);
+ return FullPath;
+ }
+ }
+
+ public DirectoryInfo Parent
+ {
[System.Security.SecuritySafeCritical]
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
- get {
- String parentName;
+ get
+ {
+ string parentName;
// FullPath might be either "c:\bar" or "c:\bar\". Handle
// those cases, as well as avoiding mangling "c:\".
- String s = FullPath;
+ string s = FullPath;
if (s.Length > 3 && s.EndsWith(Path.DirectorySeparatorChar))
- s = FullPath.Substring(0, FullPath.Length - 1);
+ s = FullPath.Substring(0, FullPath.Length - 1);
parentName = Path.GetDirectoryName(s);
if (parentName==null)
return null;
- DirectoryInfo dir = new DirectoryInfo(parentName,false);
-#if FEATURE_CORECLR
- FileSecurityState state = new FileSecurityState(FileSecurityStateAccess.PathDiscovery | FileSecurityStateAccess.Read, String.Empty, dir.demandDir[0]);
- state.EnsureState();
-#else
- FileIOPermission.QuickDemand(FileIOPermissionAccess.PathDiscovery | FileIOPermissionAccess.Read, dir.demandDir, false, false);
-#endif
+
+ DirectoryInfo dir = new DirectoryInfo(parentName, false);
+ Directory.CheckPermissions(string.Empty, dir.FullPath, checkHost: true, access: FileSecurityStateAccess.PathDiscovery | FileSecurityStateAccess.Read);
return dir;
}
}
-
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
#if FEATURE_CORECLR
@@ -618,38 +626,28 @@ namespace System.IO {
[System.Security.SecuritySafeCritical]
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
- public void MoveTo(String destDirName) {
+ public void MoveTo(string destDirName)
+ {
if (destDirName==null)
throw new ArgumentNullException("destDirName");
if (destDirName.Length==0)
throw new ArgumentException(Environment.GetResourceString("Argument_EmptyFileName"), "destDirName");
Contract.EndContractBlock();
-
-#if FEATURE_CORECLR
- FileSecurityState sourceState = new FileSecurityState(FileSecurityStateAccess.Write | FileSecurityStateAccess.Read, DisplayPath, Directory.GetDemandDir(FullPath, true));
- sourceState.EnsureState();
-#else
- FileIOPermission.QuickDemand(FileIOPermissionAccess.Write | FileIOPermissionAccess.Read, demandDir, false, false);
-#endif
- String fullDestDirName = Path.GetFullPathInternal(destDirName);
- String demandPath;
+
+ Directory.CheckPermissions(DisplayPath, FullPath, checkHost: true, access: FileSecurityStateAccess.Write | FileSecurityStateAccess.Read);
+
+ string fullDestDirName = Path.GetFullPathInternal(destDirName);
if (!fullDestDirName.EndsWith(Path.DirectorySeparatorChar))
fullDestDirName = fullDestDirName + Path.DirectorySeparatorChar;
- demandPath = fullDestDirName + '.';
-
// Demand read & write permission to destination. The reason is
// we hand back a DirectoryInfo to the destination that would allow
// you to read a directory listing from that directory. Sure, you
// had the ability to read the file contents in the old location,
// but you technically also need read permissions to the new
// location as well, and write is not a true superset of read.
-#if FEATURE_CORECLR
- FileSecurityState destState = new FileSecurityState(FileSecurityStateAccess.Write, destDirName, demandPath);
- destState.EnsureState();
-#else
- FileIOPermission.QuickDemand(FileIOPermissionAccess.Write | FileIOPermissionAccess.Read, demandPath);
-#endif
+
+ Directory.CheckPermissions(destDirName, fullDestDirName, checkHost: true, access: FileSecurityStateAccess.Write | FileSecurityStateAccess.Read);
String fullSourcePath;
if (FullPath.EndsWith(Path.DirectorySeparatorChar))
@@ -674,16 +672,15 @@ namespace System.IO {
hr = Win32Native.ERROR_PATH_NOT_FOUND;
__Error.WinIOError(hr, DisplayPath);
}
-
+
if (hr == Win32Native.ERROR_ACCESS_DENIED) // We did this for Win9x. We can't change it for backcomp.
throw new IOException(Environment.GetResourceString("UnauthorizedAccess_IODenied_Path", DisplayPath));
-
- __Error.WinIOError(hr,String.Empty);
+
+ __Error.WinIOError(hr, string.Empty);
}
FullPath = fullDestDirName;
OriginalPath = destDirName;
DisplayPath = GetDisplayName(OriginalPath, FullPath);
- demandDir = new String[] { Directory.GetDemandDir(FullPath, true) };
// Flush any cached information about the directory.
_dataInitialised = -1;
diff --git a/mcs/class/referencesource/mscorlib/system/io/directorynotfoundexception.cs b/mcs/class/referencesource/mscorlib/system/io/directorynotfoundexception.cs
index 93e9437ad8c..97c5dcc6b7e 100644
--- a/mcs/class/referencesource/mscorlib/system/io/directorynotfoundexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/directorynotfoundexception.cs
@@ -7,7 +7,7 @@
**
** Class: DirectoryNotFoundException
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Exception for accessing a path that doesn't exist.
diff --git a/mcs/class/referencesource/mscorlib/system/io/driveinfo.cs b/mcs/class/referencesource/mscorlib/system/io/driveinfo.cs
index 5f78933871d..7dd7a3bc3f1 100644
--- a/mcs/class/referencesource/mscorlib/system/io/driveinfo.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/driveinfo.cs
@@ -7,7 +7,7 @@
**
** Class: DriveInfo
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Exposes routines for exploring a drive.
diff --git a/mcs/class/referencesource/mscorlib/system/io/drivenotfoundexception.cs b/mcs/class/referencesource/mscorlib/system/io/drivenotfoundexception.cs
index cfc543f3093..0361c2908a3 100644
--- a/mcs/class/referencesource/mscorlib/system/io/drivenotfoundexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/drivenotfoundexception.cs
@@ -7,7 +7,7 @@
//
// Class: DriveNotFoundException
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Purpose: Exception for accessing a drive that is not available.
//
diff --git a/mcs/class/referencesource/mscorlib/system/io/endofstreamexception.cs b/mcs/class/referencesource/mscorlib/system/io/endofstreamexception.cs
index aa07bc4c7f7..b0cd0d1c9ea 100644
--- a/mcs/class/referencesource/mscorlib/system/io/endofstreamexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/endofstreamexception.cs
@@ -7,7 +7,7 @@
**
** Class: EndOfStreamException
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Exception to be thrown when reading past end-of-file.
diff --git a/mcs/class/referencesource/mscorlib/system/io/file.cs b/mcs/class/referencesource/mscorlib/system/io/file.cs
index 8a36be7ee78..8bba7c17ca6 100644
--- a/mcs/class/referencesource/mscorlib/system/io/file.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/file.cs
@@ -7,7 +7,7 @@
**
** Class: File
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: A collection of methods for manipulating Files.
diff --git a/mcs/class/referencesource/mscorlib/system/io/fileinfo.cs b/mcs/class/referencesource/mscorlib/system/io/fileinfo.cs
index fa273972ca2..3a653bce1be 100644
--- a/mcs/class/referencesource/mscorlib/system/io/fileinfo.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/fileinfo.cs
@@ -5,7 +5,7 @@
// ==--==
/*============================================================
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
** Class: File
**
diff --git a/mcs/class/referencesource/mscorlib/system/io/fileloadexception.cs b/mcs/class/referencesource/mscorlib/system/io/fileloadexception.cs
index 2a7b803bed7..06b2ab35e81 100644
--- a/mcs/class/referencesource/mscorlib/system/io/fileloadexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/fileloadexception.cs
@@ -7,8 +7,8 @@
**
** Class: FileLoadException
**
-** <OWNER>[....]</OWNER>
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Exception for failure to load a file that was successfully found.
diff --git a/mcs/class/referencesource/mscorlib/system/io/filenotfoundexception.cs b/mcs/class/referencesource/mscorlib/system/io/filenotfoundexception.cs
index 088ef61170f..985d9e1a1c3 100644
--- a/mcs/class/referencesource/mscorlib/system/io/filenotfoundexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/filenotfoundexception.cs
@@ -7,8 +7,8 @@
**
** Class: FileNotFoundException
**
-** <OWNER>[....]</OWNER>
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Exception for accessing a file that doesn't exist.
diff --git a/mcs/class/referencesource/mscorlib/system/io/filestream.cs b/mcs/class/referencesource/mscorlib/system/io/filestream.cs
index 7e47b8bedec..4276a6b2cb9 100644
--- a/mcs/class/referencesource/mscorlib/system/io/filestream.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/filestream.cs
@@ -7,7 +7,7 @@
**
** Class: FileStream
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Exposes a Stream around a file, with full
@@ -39,11 +39,11 @@ using System.Diagnostics.Tracing;
/*
* FileStream supports different modes of accessing the disk - async mode
- * and [....] mode. They are two completely different codepaths in the
- * [....] & async methods (ie, Read/Write vs. BeginRead/BeginWrite). File
- * handles in NT can be opened in only [....] or overlapped (async) mode,
+ * and sync mode. They are two completely different codepaths in the
+ * sync & async methods (ie, Read/Write vs. BeginRead/BeginWrite). File
+ * handles in NT can be opened in only sync or overlapped (async) mode,
* and we have to deal with this pain. Stream has implementations of
- * the [....] methods in terms of the async ones, so we'll
+ * the sync methods in terms of the async ones, so we'll
* call through to our base class to get those methods when necessary.
*
* Also buffering is added into FileStream as well. Folded in the
@@ -1226,7 +1226,7 @@ namespace System.IO {
Contract.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), "We're either reading or writing, but not both.");
- // Verify that internal position is in [....] with the handle
+ // Verify that internal position is in sync with the handle
if (_exposedHandle)
VerifyOSHandlePosition();
@@ -1355,7 +1355,7 @@ namespace System.IO {
// Reading is done by blocks from the file, but someone could read
// 1 byte from the buffer then write. At that point, the OS's file
- // pointer is out of [....] with the stream's position. All write
+ // pointer is out of sync with the stream's position. All write
// functions should call this function to preserve the position in the file.
private void FlushRead() {
Contract.Assert(_writePos == 0, "FileStream: Write buffer must be empty in FlushRead!");
@@ -1630,7 +1630,7 @@ namespace System.IO {
offset -= (_readLen - _readPos);
}
- // Verify that internal position is in [....] with the handle
+ // Verify that internal position is in sync with the handle
if (_exposedHandle)
VerifyOSHandlePosition();
@@ -1947,7 +1947,7 @@ namespace System.IO {
// (either synchronously or asynchronously) before the first one
// returns. This would involve some sort of complex buffer locking
// that we probably don't want to get into, at least not in V1.
- // If we did a [....] read to fill the buffer, we could avoid the
+ // If we did a sync read to fill the buffer, we could avoid the
// problem, and any async read less than 64K gets turned into a
// synchronous read by NT anyways... --
@@ -2515,7 +2515,7 @@ namespace System.IO {
if (r==0) {
hr = Marshal.GetLastWin32Error();
- // We should never silently ---- an error here without some
+ // We should never silently swallow an error here without some
// extra work. We must make sure that BeginReadCore won't return an
// IAsyncResult that will cause EndRead to block, since the OS won't
// call AsyncFSCallback for us.
@@ -2572,7 +2572,7 @@ namespace System.IO {
if (r==0) {
hr = Marshal.GetLastWin32Error();
- // We should never silently ---- an error here without some
+ // We should never silently swallow an error here without some
// extra work. We must make sure that BeginWriteCore won't return an
// IAsyncResult that will cause EndWrite to block, since the OS won't
// call AsyncFSCallback for us.
diff --git a/mcs/class/referencesource/mscorlib/system/io/filesystemenumerable.cs b/mcs/class/referencesource/mscorlib/system/io/filesystemenumerable.cs
index 4fb11990051..145bbb5424b 100644
--- a/mcs/class/referencesource/mscorlib/system/io/filesystemenumerable.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/filesystemenumerable.cs
@@ -7,7 +7,7 @@
**
** Class: FileSystemEnumerable
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Enumerates files and dirs
diff --git a/mcs/class/referencesource/mscorlib/system/io/filesysteminfo.cs b/mcs/class/referencesource/mscorlib/system/io/filesysteminfo.cs
index 946f26a82a6..e777115220b 100644
--- a/mcs/class/referencesource/mscorlib/system/io/filesysteminfo.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/filesysteminfo.cs
@@ -7,7 +7,7 @@
**
** Class: FileSystemInfo
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose:
@@ -35,9 +35,11 @@ namespace System.IO {
#endif
[ComVisible(true)]
#if FEATURE_REMOTING || MONO
- public abstract class FileSystemInfo : MarshalByRefObject, ISerializable {
+ public abstract class FileSystemInfo : MarshalByRefObject, ISerializable
+ {
#else // FEATURE_REMOTING
- public abstract class FileSystemInfo : ISerializable {
+ public abstract class FileSystemInfo : ISerializable
+ {
#endif //FEATURE_REMOTING
#if MONO
internal MonoIOStat _data;
@@ -97,44 +99,31 @@ namespace System.IO {
}
// Full path of the direcory/file
- public virtual String FullName {
- [System.Security.SecuritySafeCritical]
- get
+ public virtual string FullName
+ {
+ [SecuritySafeCritical]
+ get
{
-#pragma warning disable 219
- String demandDir;
-#pragma warning restore
- if (this is DirectoryInfo)
- demandDir = Directory.GetDemandDir(FullPath, true);
- else
- demandDir = FullPath;
#if MONO_FEATURE_CAS
#if FEATURE_CORECLR
- FileSecurityState sourceState = new FileSecurityState(FileSecurityStateAccess.PathDiscovery, String.Empty, demandDir);
+ FileSecurityState sourceState = new FileSecurityState(FileSecurityStateAccess.PathDiscovery, String.Empty, FullPath);
sourceState.EnsureState();
#else
- FileIOPermission.QuickDemand(FileIOPermissionAccess.PathDiscovery, demandDir);
+ FileIOPermission.QuickDemand(FileIOPermissionAccess.PathDiscovery, FullPath);
#endif
#endif
return FullPath;
}
}
- internal virtual String UnsafeGetFullName
+ internal virtual string UnsafeGetFullName
{
- [System.Security.SecurityCritical]
+ [SecurityCritical]
get
{
-#pragma warning disable 219
- String demandDir;
-#pragma warning restore
- if (this is DirectoryInfo)
- demandDir = Directory.GetDemandDir(FullPath, true);
- else
- demandDir = FullPath;
#if MONO_FEATURE_CAS
#if !FEATURE_CORECLR
- FileIOPermission.QuickDemand(FileIOPermissionAccess.PathDiscovery, demandDir);
+ FileIOPermission.QuickDemand(FileIOPermissionAccess.PathDiscovery, FullPath);
#endif
#endif
return FullPath;
diff --git a/mcs/class/referencesource/mscorlib/system/io/ioexception.cs b/mcs/class/referencesource/mscorlib/system/io/ioexception.cs
index 795ccabed01..725acfc8e82 100644
--- a/mcs/class/referencesource/mscorlib/system/io/ioexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/ioexception.cs
@@ -7,7 +7,7 @@
**
** Class: IOException
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Exception for a generic IO error.
diff --git a/mcs/class/referencesource/mscorlib/system/io/isolatedstorage/isolatedstorage.cs b/mcs/class/referencesource/mscorlib/system/io/isolatedstorage/isolatedstorage.cs
index 1249595b5bd..4d384f1d050 100644
--- a/mcs/class/referencesource/mscorlib/system/io/isolatedstorage/isolatedstorage.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/isolatedstorage/isolatedstorage.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
/*============================================================
@@ -331,7 +331,7 @@ namespace System.IO.IsolatedStorage {
private static SecurityPermission GetControlEvidencePermission()
{
- // Don't [....]. OK to create this object more than once.
+ // Don't sync. OK to create this object more than once.
if (s_PermControlEvidence == null)
s_PermControlEvidence = new SecurityPermission(
SecurityPermissionFlag.ControlEvidence);
@@ -341,7 +341,7 @@ namespace System.IO.IsolatedStorage {
private static PermissionSet GetUnrestricted()
{
- // Don't [....]. OK to create this object more than once.
+ // Don't sync. OK to create this object more than once.
if (s_PermUnrestricted == null)
s_PermUnrestricted = new PermissionSet(
PermissionState.Unrestricted);
diff --git a/mcs/class/referencesource/mscorlib/system/io/isolatedstorage/isolatedstorageexception.cs b/mcs/class/referencesource/mscorlib/system/io/isolatedstorage/isolatedstorageexception.cs
index e02e83a75b5..175991615bc 100644
--- a/mcs/class/referencesource/mscorlib/system/io/isolatedstorage/isolatedstorageexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/isolatedstorage/isolatedstorageexception.cs
@@ -7,7 +7,7 @@
*
* Class: IsolatedStorageException
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
*
*
* Purpose: The exceptions in IsolatedStorage
diff --git a/mcs/class/referencesource/mscorlib/system/io/isolatedstorage/isolatedstoragefile.cs b/mcs/class/referencesource/mscorlib/system/io/isolatedstorage/isolatedstoragefile.cs
index 932a4ee9f1d..73931122124 100644
--- a/mcs/class/referencesource/mscorlib/system/io/isolatedstorage/isolatedstoragefile.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/isolatedstorage/isolatedstoragefile.cs
@@ -8,8 +8,8 @@
*
* Class: IsolatedStorageFile
//
-// <OWNER>[....]</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
+// <OWNER>Microsoft</OWNER>
*
*
* Purpose: Provides access to Application files and folders
@@ -2304,7 +2304,7 @@ namespace System.IO.IsolatedStorage {
{
if (IsRoaming(scope))
{
- // no [....] needed, ok to create multiple instances.
+ // no sync needed, ok to create multiple instances.
if (s_PermRoaming == null)
{
s_PermRoaming = new FileIOPermission(
@@ -2316,7 +2316,7 @@ namespace System.IO.IsolatedStorage {
if (IsMachine(scope))
{
- // no [....] needed, ok to create multiple instances.
+ // no sync needed, ok to create multiple instances.
if (s_PermMachine == null)
{
s_PermMachine = new FileIOPermission(
@@ -2325,7 +2325,7 @@ namespace System.IO.IsolatedStorage {
return s_PermMachine;
}
- // no [....] needed, ok to create multiple instances.
+ // no sync needed, ok to create multiple instances.
if (s_PermUser == null)
{
s_PermUser = new FileIOPermission(
@@ -2338,7 +2338,7 @@ namespace System.IO.IsolatedStorage {
[System.Security.SecurityCritical] // auto-generated
private static void DemandAdminPermission()
{
- // Ok if more than one instance is created, no need to [....].
+ // Ok if more than one instance is created, no need to sync.
if (s_PermAdminUser == null)
{
s_PermAdminUser = new IsolatedStorageFilePermission(
diff --git a/mcs/class/referencesource/mscorlib/system/io/isolatedstorage/isolatedstoragefilestream.cs b/mcs/class/referencesource/mscorlib/system/io/isolatedstorage/isolatedstoragefilestream.cs
index c6d0b55415d..caa5cfe5e3d 100644
--- a/mcs/class/referencesource/mscorlib/system/io/isolatedstorage/isolatedstoragefilestream.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/isolatedstorage/isolatedstoragefilestream.cs
@@ -7,7 +7,7 @@
*
* Class: IsolatedStorageFileStream
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
*
*
* Purpose: Provides access to files using the same interface as FileStream
diff --git a/mcs/class/referencesource/mscorlib/system/io/longpath.cs b/mcs/class/referencesource/mscorlib/system/io/longpath.cs
index 7b863b95c8d..408048f5e80 100644
--- a/mcs/class/referencesource/mscorlib/system/io/longpath.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/longpath.cs
@@ -7,7 +7,7 @@
**
** Class: File
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Long paths
diff --git a/mcs/class/referencesource/mscorlib/system/io/memorystream.cs b/mcs/class/referencesource/mscorlib/system/io/memorystream.cs
index 5f5d7b73e0d..b8e6d5e12af 100644
--- a/mcs/class/referencesource/mscorlib/system/io/memorystream.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/memorystream.cs
@@ -7,7 +7,7 @@
**
** Class: MemoryStream
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: A Stream whose backing store is memory. Great
@@ -422,7 +422,7 @@ namespace System.IO {
// This implementation offers beter performance compared to the base class version.
- // The parameter checks must be in [....] with the base version:
+ // The parameter checks must be in sync with the base version:
if (destination == null)
throw new ArgumentNullException("destination");
diff --git a/mcs/class/referencesource/mscorlib/system/io/path.cs b/mcs/class/referencesource/mscorlib/system/io/path.cs
index 3927d52da07..26a00f1a3db 100644
--- a/mcs/class/referencesource/mscorlib/system/io/path.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/path.cs
@@ -7,7 +7,7 @@
**
** Class: Path
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: A collection of path manipulation methods.
@@ -441,8 +441,26 @@ namespace System.IO {
if (PathInternal.IsPathTooLong(normalized) || PathInternal.AreSegmentsTooLong(normalized))
throw new PathTooLongException();
- if (!PathInternal.IsDevice(normalized) && PathInternal.HasInvalidVolumeSeparator(path))
- throw new ArgumentException(Environment.GetResourceString("Arg_PathIllegal"));
+ // Under old logic certain subsets of paths containing colons were rejected. Some portion of that comes
+ // indirectly from FileIOPermissions, the rest comes from the section in LegacyNormalizePath below:
+ //
+ // // To reject strings like "C:...\foo" and "C :\foo"
+ // if (firstSegment && currentChar == VolumeSeparatorChar)
+ //
+ // The superset of this now is PathInternal.HasInvalidVolumeSeparator().
+ //
+ // Unfortunately a side effect of the old split logic is that some "bad" colon paths slip through when
+ // fullChecks=false. Notably this means that GetDirectoryName and GetPathRoot would allow URIs (although
+ // it would mangle them). A user could pass a "file://..." uri to GetDirectoryName(), get "file:\..." back,
+ // then pass it to Uri which fixes up the bad URI. One particular user code path for this is calling
+ // Assembly.CodePath and trying to get the directory before passing to the Uri class.
+ //
+ // To ease transitioning code forward we'll allow all "bad" colon paths through when we are doing
+ // limited checks. If we want to add this back (under a quirk perhaps), we would need to conditionalize
+ // for Device paths as follows:
+ //
+ // if (!PathInternal.IsDevice(normalized) && PathInternal.HasInvalidVolumeSeparator(path))
+ // throw new ArgumentException(Environment.GetResourceString("Arg_PathIllegal"));
if (expandShortPaths && normalized.IndexOf('~') != -1)
{
diff --git a/mcs/class/referencesource/mscorlib/system/io/pathinternal.cs b/mcs/class/referencesource/mscorlib/system/io/pathinternal.cs
new file mode 100644
index 00000000000..1c99959e0d7
--- /dev/null
+++ b/mcs/class/referencesource/mscorlib/system/io/pathinternal.cs
@@ -0,0 +1,645 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using Microsoft.Win32;
+using System;
+using System.Diagnostics.Contracts;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Security;
+using System.Text;
+
+namespace System.IO
+{
+ /// <summary>Contains internal path helpers that are shared between many projects.</summary>
+ internal static class PathInternal
+ {
+ internal const string ExtendedPathPrefix = @"\\?\";
+ internal const string UncPathPrefix = @"\\";
+ internal const string UncExtendedPrefixToInsert = @"?\UNC\";
+ internal const string UncExtendedPathPrefix = @"\\?\UNC\";
+ internal const string DevicePathPrefix = @"\\.\";
+ internal const int DevicePrefixLength = 4;
+ internal const int MaxShortPath = 260;
+ internal const int MaxShortDirectoryPath = 248;
+
+ // Windows is limited in long paths by the max size of its internal representation of a unicode string.
+ // UNICODE_STRING has a max length of USHORT in _bytes_ without a trailing null.
+ // https://msdn.microsoft.com/en-us/library/windows/hardware/ff564879.aspx
+ internal const int MaxLongPath = short.MaxValue;
+ internal static readonly int MaxComponentLength = 255;
+
+ internal static readonly char[] InvalidPathChars =
+ {
+ '\"', '<', '>', '|', '\0',
+ (char)1, (char)2, (char)3, (char)4, (char)5, (char)6, (char)7, (char)8, (char)9, (char)10,
+ (char)11, (char)12, (char)13, (char)14, (char)15, (char)16, (char)17, (char)18, (char)19, (char)20,
+ (char)21, (char)22, (char)23, (char)24, (char)25, (char)26, (char)27, (char)28, (char)29, (char)30,
+ (char)31
+ };
+
+ /// <summary>
+ /// Validates volume separator only occurs as C: or \\?\C:. This logic is meant to filter out Alternate Data Streams.
+ /// </summary>
+ /// <returns>True if the path has an invalid volume separator.</returns>
+ internal static bool HasInvalidVolumeSeparator(string path)
+ {
+ // Toss out paths with colons that aren't a valid drive specifier.
+ // Cannot start with a colon and can only be of the form "C:" or "\\?\C:".
+ // (Note that we used to explicitly check "http:" and "file:"- these are caught by this check now.)
+
+ // We don't care about skipping starting space for extended paths. Assume no knowledge of extended paths if we're forcing old path behavior.
+ bool isExtended = !AppContextSwitches.UseLegacyPathHandling && IsExtended(path);
+ int startIndex = isExtended ? ExtendedPathPrefix.Length : PathStartSkip(path);
+
+ // If we start with a colon
+ if ((path.Length > startIndex && path[startIndex] == Path.VolumeSeparatorChar)
+ // Or have an invalid drive letter and colon
+ || (path.Length >= startIndex + 2 && path[startIndex + 1] == Path.VolumeSeparatorChar && !IsValidDriveChar(path[startIndex]))
+ // Or have any colons beyond the drive colon
+ || (path.Length > startIndex + 2 && path.IndexOf(Path.VolumeSeparatorChar, startIndex + 2) != -1))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ /// <summary>
+ /// Returns true if the given StringBuilder starts with the given value.
+ /// </summary>
+ /// <param name="value">The string to compare against the start of the StringBuilder.</param>
+ internal static bool StartsWithOrdinal(StringBuilder builder, string value, bool ignoreCase = false)
+ {
+ if (value == null || builder.Length < value.Length)
+ return false;
+
+ if (ignoreCase)
+ {
+ for (int i = 0; i < value.Length; i++)
+ if (char.ToUpperInvariant(builder[i]) != char.ToUpperInvariant(value[i])) return false;
+ }
+ else
+ {
+ for (int i = 0; i < value.Length; i++)
+ if (builder[i] != value[i]) return false;
+ }
+
+ return true;
+ }
+
+ /// <summary>
+ /// Returns true if the given character is a valid drive letter
+ /// </summary>
+ internal static bool IsValidDriveChar(char value)
+ {
+ return ((value >= 'A' && value <= 'Z') || (value >= 'a' && value <= 'z'));
+ }
+
+ /// <summary>
+ /// Returns true if the path is too long
+ /// </summary>
+ internal static bool IsPathTooLong(string fullPath)
+ {
+ // We'll never know precisely what will fail as paths get changed internally in Windows and
+ // may grow beyond / shrink below exceed MaxLongPath.
+ if (AppContextSwitches.BlockLongPaths)
+ {
+ // We allow paths of any length if extended (and not in compat mode)
+ if (AppContextSwitches.UseLegacyPathHandling || !IsExtended(fullPath))
+ return fullPath.Length >= MaxShortPath;
+ }
+
+ return fullPath.Length >= MaxLongPath;
+ }
+
+ /// <summary>
+ /// Return true if any path segments are too long
+ /// </summary>
+ internal static bool AreSegmentsTooLong(string fullPath)
+ {
+ int length = fullPath.Length;
+ int lastSeparator = 0;
+
+ for (int i = 0; i < length; i++)
+ {
+ if (IsDirectorySeparator(fullPath[i]))
+ {
+ if (i - lastSeparator > MaxComponentLength)
+ return true;
+ lastSeparator = i;
+ }
+ }
+
+ if (length - 1 - lastSeparator > MaxComponentLength)
+ return true;
+
+ return false;
+ }
+
+ /// <summary>
+ /// Returns true if the directory is too long
+ /// </summary>
+ internal static bool IsDirectoryTooLong(string fullPath)
+ {
+ if (AppContextSwitches.BlockLongPaths)
+ {
+ // We allow paths of any length if extended (and not in compat mode)
+ if (AppContextSwitches.UseLegacyPathHandling || !IsExtended(fullPath))
+ return (fullPath.Length >= MaxShortDirectoryPath);
+ }
+
+ return IsPathTooLong(fullPath);
+ }
+
+ /// <summary>
+ /// Adds the extended path prefix (\\?\) if not relative or already a device path.
+ /// </summary>
+ internal static string EnsureExtendedPrefix(string path)
+ {
+ // Putting the extended prefix on the path changes the processing of the path. It won't get normalized, which
+ // means adding to relative paths will prevent them from getting the appropriate current directory inserted.
+
+ // If it already has some variant of a device path (\??\, \\?\, \\.\, //./, etc.) we don't need to change it
+ // as it is either correct or we will be changing the behavior. When/if Windows supports long paths implicitly
+ // in the future we wouldn't want normalization to come back and break existing code.
+
+ // In any case, all internal usages should be hitting normalize path (Path.GetFullPath) before they hit this
+ // shimming method. (Or making a change that doesn't impact normalization, such as adding a filename to a
+ // normalized base path.)
+ if (IsPartiallyQualified(path) || IsDevice(path))
+ return path;
+
+ // Given \\server\share in longpath becomes \\?\UNC\server\share
+ if (path.StartsWith(UncPathPrefix, StringComparison.OrdinalIgnoreCase))
+ return path.Insert(2, UncExtendedPrefixToInsert);
+
+ return ExtendedPathPrefix + path;
+ }
+
+ /// <summary>
+ /// Removes the extended path prefix (\\?\) if present.
+ /// </summary>
+ internal static string RemoveExtendedPrefix(string path)
+ {
+ if (!IsExtended(path))
+ return path;
+
+ // Given \\?\UNC\server\share we return \\server\share
+ if (IsExtendedUnc(path))
+ return path.Remove(2, 6);
+
+ return path.Substring(DevicePrefixLength);
+ }
+
+ /// <summary>
+ /// Removes the extended path prefix (\\?\) if present.
+ /// </summary>
+ internal static StringBuilder RemoveExtendedPrefix(StringBuilder path)
+ {
+ if (!IsExtended(path))
+ return path;
+
+ // Given \\?\UNC\server\share we return \\server\share
+ if (IsExtendedUnc(path))
+ return path.Remove(2, 6);
+
+ return path.Remove(0, DevicePrefixLength);
+ }
+
+ /// <summary>
+ /// Returns true if the path uses any of the DOS device path syntaxes. ("\\.\", "\\?\", or "\??\")
+ /// </summary>
+ internal static bool IsDevice(string path)
+ {
+ // If the path begins with any two separators it will be recognized and normalized and prepped with
+ // "\??\" for internal usage correctly. "\??\" is recognized and handled, "/??/" is not.
+ return IsExtended(path)
+ ||
+ (
+ path.Length >= DevicePrefixLength
+ && IsDirectorySeparator(path[0])
+ && IsDirectorySeparator(path[1])
+ && (path[2] == '.' || path[2] == '?')
+ && IsDirectorySeparator(path[3])
+ );
+ }
+
+ /// <summary>
+ /// Returns true if the path uses any of the DOS device path syntaxes. ("\\.\", "\\?\", or "\??\")
+ /// </summary>
+ internal static bool IsDevice(StringBuffer path)
+ {
+ // If the path begins with any two separators it will be recognized and normalized and prepped with
+ // "\??\" for internal usage correctly. "\??\" is recognized and handled, "/??/" is not.
+ return IsExtended(path)
+ ||
+ (
+ path.Length >= DevicePrefixLength
+ && IsDirectorySeparator(path[0])
+ && IsDirectorySeparator(path[1])
+ && (path[2] == '.' || path[2] == '?')
+ && IsDirectorySeparator(path[3])
+ );
+ }
+
+ /// <summary>
+ /// Returns true if the path uses the canonical form of extended syntax ("\\?\" or "\??\"). If the
+ /// path matches exactly (cannot use alternate directory separators) Windows will skip normalization
+ /// and path length checks.
+ /// </summary>
+ internal static bool IsExtended(string path)
+ {
+ // While paths like "//?/C:/" will work, they're treated the same as "\\.\" paths.
+ // Skipping of normalization will *only* occur if back slashes ('\') are used.
+ return path.Length >= DevicePrefixLength
+ && path[0] == '\\'
+ && (path[1] == '\\' || path[1] == '?')
+ && path[2] == '?'
+ && path[3] == '\\';
+ }
+
+ /// <summary>
+ /// Returns true if the path uses the canonical form of extended syntax ("\\?\" or "\??\"). If the
+ /// path matches exactly (cannot use alternate directory separators) Windows will skip normalization
+ /// and path length checks.
+ /// </summary>
+ internal static bool IsExtended(StringBuilder path)
+ {
+ // While paths like "//?/C:/" will work, they're treated the same as "\\.\" paths.
+ // Skipping of normalization will *only* occur if back slashes ('\') are used.
+ return path.Length >= DevicePrefixLength
+ && path[0] == '\\'
+ && (path[1] == '\\' || path[1] == '?')
+ && path[2] == '?'
+ && path[3] == '\\';
+ }
+
+ /// <summary>
+ /// Returns true if the path uses the canonical form of extended syntax ("\\?\" or "\??\"). If the
+ /// path matches exactly (cannot use alternate directory separators) Windows will skip normalization
+ /// and path length checks.
+ /// </summary>
+ internal static bool IsExtended(StringBuffer path)
+ {
+ // While paths like "//?/C:/" will work, they're treated the same as "\\.\" paths.
+ // Skipping of normalization will *only* occur if back slashes ('\') are used.
+ return path.Length >= DevicePrefixLength
+ && path[0] == '\\'
+ && (path[1] == '\\' || path[1] == '?')
+ && path[2] == '?'
+ && path[3] == '\\';
+ }
+
+ /// <summary>
+ /// Returns true if the path uses the extended UNC syntax (\\?\UNC\ or \??\UNC\)
+ /// </summary>
+ internal static bool IsExtendedUnc(string path)
+ {
+ return path.Length >= UncExtendedPathPrefix.Length
+ && IsExtended(path)
+ && char.ToUpper(path[4]) == 'U'
+ && char.ToUpper(path[5]) == 'N'
+ && char.ToUpper(path[6]) == 'C'
+ && path[7] == '\\';
+ }
+
+ /// <summary>
+ /// Returns true if the path uses the extended UNC syntax (\\?\UNC\ or \??\UNC\)
+ /// </summary>
+ internal static bool IsExtendedUnc(StringBuilder path)
+ {
+ return path.Length >= UncExtendedPathPrefix.Length
+ && IsExtended(path)
+ && char.ToUpper(path[4]) == 'U'
+ && char.ToUpper(path[5]) == 'N'
+ && char.ToUpper(path[6]) == 'C'
+ && path[7] == '\\';
+ }
+
+ /// <summary>
+ /// Returns a value indicating if the given path contains invalid characters (", &lt;, &gt;, |
+ /// NUL, or any ASCII char whose integer representation is in the range of 1 through 31).
+ /// Does not check for wild card characters ? and *.
+ ///
+ /// Will not check if the path is a device path and not in Legacy mode as many of these
+ /// characters are valid for devices (pipes for example).
+ /// </summary>
+ internal static bool HasIllegalCharacters(string path, bool checkAdditional = false)
+ {
+ if (!AppContextSwitches.UseLegacyPathHandling && IsDevice(path))
+ {
+ return false;
+ }
+
+ return AnyPathHasIllegalCharacters(path, checkAdditional: checkAdditional);
+ }
+
+ /// <summary>
+ /// Version of HasIllegalCharacters that checks no AppContextSwitches. Only use if you know you need to skip switches and don't care
+ /// about proper device path handling.
+ /// </summary>
+ internal static bool AnyPathHasIllegalCharacters(string path, bool checkAdditional = false)
+ {
+ return path.IndexOfAny(InvalidPathChars) >= 0 || (checkAdditional && AnyPathHasWildCardCharacters(path));
+ }
+
+ /// <summary>
+ /// Check for ? and *.
+ /// </summary>
+ internal static bool HasWildCardCharacters(string path)
+ {
+ // Question mark is part of some device paths
+ int startIndex = AppContextSwitches.UseLegacyPathHandling ? 0 : IsDevice(path) ? ExtendedPathPrefix.Length : 0;
+ return AnyPathHasWildCardCharacters(path, startIndex: startIndex);
+ }
+
+ /// <summary>
+ /// Version of HasWildCardCharacters that checks no AppContextSwitches. Only use if you know you need to skip switches and don't care
+ /// about proper device path handling.
+ /// </summary>
+ internal static bool AnyPathHasWildCardCharacters(string path, int startIndex = 0)
+ {
+ char currentChar;
+ for (int i = startIndex; i < path.Length; i++)
+ {
+ currentChar = path[i];
+ if (currentChar == '*' || currentChar == '?') return true;
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// Gets the length of the root of the path (drive, share, etc.).
+ /// </summary>
+ [System.Security.SecuritySafeCritical]
+ internal unsafe static int GetRootLength(string path)
+ {
+ fixed (char* value = path)
+ {
+ return (int)GetRootLength(value, (ulong)path.Length);
+ }
+ }
+
+ /// <summary>
+ /// Gets the length of the root of the path (drive, share, etc.).
+ /// </summary>
+ [System.Security.SecuritySafeCritical]
+ internal unsafe static uint GetRootLength(StringBuffer path)
+ {
+ if (path.Length == 0) return 0;
+ return GetRootLength(path.CharPointer, path.Length);
+ }
+
+ [System.Security.SecurityCritical]
+ private unsafe static uint GetRootLength(char* path, ulong pathLength)
+ {
+ uint i = 0;
+ uint volumeSeparatorLength = 2; // Length to the colon "C:"
+ uint uncRootLength = 2; // Length to the start of the server name "\\"
+
+ bool extendedSyntax = StartsWithOrdinal(path, pathLength, ExtendedPathPrefix);
+ bool extendedUncSyntax = StartsWithOrdinal(path, pathLength, UncExtendedPathPrefix);
+ if (extendedSyntax)
+ {
+ // Shift the position we look for the root from to account for the extended prefix
+ if (extendedUncSyntax)
+ {
+ // "\\" -> "\\?\UNC\"
+ uncRootLength = (uint)UncExtendedPathPrefix.Length;
+ }
+ else
+ {
+ // "C:" -> "\\?\C:"
+ volumeSeparatorLength += (uint)ExtendedPathPrefix.Length;
+ }
+ }
+
+ if ((!extendedSyntax || extendedUncSyntax) && pathLength > 0 && IsDirectorySeparator(path[0]))
+ {
+ // UNC or simple rooted path (e.g. "\foo", NOT "\\?\C:\foo")
+
+ i = 1; // Drive rooted (\foo) is one character
+ if (extendedUncSyntax || (pathLength > 1 && IsDirectorySeparator(path[1])))
+ {
+ // UNC (\\?\UNC\ or \\), scan past the next two directory separators at most
+ // (e.g. to \\?\UNC\Server\Share or \\Server\Share\)
+ i = uncRootLength;
+ int n = 2; // Maximum separators to skip
+ while (i < pathLength && (!IsDirectorySeparator(path[i]) || --n > 0)) i++;
+ }
+ }
+ else if (pathLength >= volumeSeparatorLength && path[volumeSeparatorLength - 1] == Path.VolumeSeparatorChar)
+ {
+ // Path is at least longer than where we expect a colon, and has a colon (\\?\A:, A:)
+ // If the colon is followed by a directory separator, move past it
+ i = volumeSeparatorLength;
+ if (pathLength >= volumeSeparatorLength + 1 && IsDirectorySeparator(path[volumeSeparatorLength])) i++;
+ }
+ return i;
+ }
+
+ [System.Security.SecurityCritical]
+ private unsafe static bool StartsWithOrdinal(char* source, ulong sourceLength, string value)
+ {
+ if (sourceLength < (ulong)value.Length) return false;
+ for (int i = 0; i < value.Length; i++)
+ {
+ if (value[i] != source[i]) return false;
+ }
+ return true;
+ }
+
+ /// <summary>
+ /// Returns true if the path specified is relative to the current drive or working directory.
+ /// Returns false if the path is fixed to a specific drive or UNC path. This method does no
+ /// validation of the path (URIs will be returned as relative as a result).
+ /// </summary>
+ /// <remarks>
+ /// Handles paths that use the alternate directory separator. It is a frequent mistake to
+ /// assume that rooted paths (Path.IsPathRooted) are not relative. This isn't the case.
+ /// "C:a" is drive relative- meaning that it will be resolved against the current directory
+ /// for C: (rooted, but relative). "C:\a" is rooted and not relative (the current directory
+ /// will not be used to modify the path).
+ /// </remarks>
+ internal static bool IsPartiallyQualified(string path)
+ {
+ if (path.Length < 2)
+ {
+ // It isn't fixed, it must be relative. There is no way to specify a fixed
+ // path with one character (or less).
+ return true;
+ }
+
+ if (IsDirectorySeparator(path[0]))
+ {
+ // There is no valid way to specify a relative path with two initial slashes or
+ // \? as ? isn't valid for drive relative paths and \??\ is equivalent to \\?\
+ return !(path[1] == '?' || IsDirectorySeparator(path[1]));
+ }
+
+ // The only way to specify a fixed path that doesn't begin with two slashes
+ // is the drive, colon, slash format- i.e. C:\
+ return !((path.Length >= 3)
+ && (path[1] == Path.VolumeSeparatorChar)
+ && IsDirectorySeparator(path[2])
+ // To match old behavior we'll check the drive character for validity as the path is technically
+ // not qualified if you don't have a valid drive. "=:\" is the "=" file's default data stream.
+ && IsValidDriveChar(path[0]));
+ }
+
+ /// <summary>
+ /// Returns true if the path specified is relative to the current drive or working directory.
+ /// Returns false if the path is fixed to a specific drive or UNC path. This method does no
+ /// validation of the path (URIs will be returned as relative as a result).
+ /// </summary>
+ /// <remarks>
+ /// Handles paths that use the alternate directory separator. It is a frequent mistake to
+ /// assume that rooted paths (Path.IsPathRooted) are not relative. This isn't the case.
+ /// "C:a" is drive relative- meaning that it will be resolved against the current directory
+ /// for C: (rooted, but relative). "C:\a" is rooted and not relative (the current directory
+ /// will not be used to modify the path).
+ /// </remarks>
+ internal static bool IsPartiallyQualified(StringBuffer path)
+ {
+ if (path.Length < 2)
+ {
+ // It isn't fixed, it must be relative. There is no way to specify a fixed
+ // path with one character (or less).
+ return true;
+ }
+
+ if (IsDirectorySeparator(path[0]))
+ {
+ // There is no valid way to specify a relative path with two initial slashes or
+ // \? as ? isn't valid for drive relative paths and \??\ is equivalent to \\?\
+ return !(path[1] == '?' || IsDirectorySeparator(path[1]));
+ }
+
+ // The only way to specify a fixed path that doesn't begin with two slashes
+ // is the drive, colon, slash format- i.e. C:\
+ return !((path.Length >= 3)
+ && (path[1] == Path.VolumeSeparatorChar)
+ && IsDirectorySeparator(path[2])
+ // To match old behavior we'll check the drive character for validity as the path is technically
+ // not qualified if you don't have a valid drive. "=:\" is the "=" file's default data stream.
+ && IsValidDriveChar(path[0]));
+ }
+
+ /// <summary>
+ /// Returns the characters to skip at the start of the path if it starts with space(s) and a drive or directory separator.
+ /// (examples are " C:", " \")
+ /// This is a legacy behavior of Path.GetFullPath().
+ /// </summary>
+ /// <remarks>
+ /// Note that this conflicts with IsPathRooted() which doesn't (and never did) such a skip.
+ /// </remarks>
+ internal static int PathStartSkip(string path)
+ {
+ int startIndex = 0;
+ while (startIndex < path.Length && path[startIndex] == ' ') startIndex++;
+
+ if (startIndex > 0 && (startIndex < path.Length && IsDirectorySeparator(path[startIndex]))
+ || (startIndex + 1 < path.Length && path[startIndex + 1] == Path.VolumeSeparatorChar && IsValidDriveChar(path[startIndex])))
+ {
+ // Go ahead and skip spaces as we're either " C:" or " \"
+ return startIndex;
+ }
+
+ return 0;
+ }
+
+ /// <summary>
+ /// True if the given character is a directory separator.
+ /// </summary>
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ internal static bool IsDirectorySeparator(char c)
+ {
+ return c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar;
+ }
+
+ /// <summary>
+ /// Normalize separators in the given path. Converts forward slashes into back slashes and compresses slash runs, keeping initial 2 if present.
+ /// Also trims initial whitespace in front of "rooted" paths (see PathStartSkip).
+ ///
+ /// This effectively replicates the behavior of the legacy NormalizePath when it was called with fullCheck=false and expandShortpaths=false.
+ /// The current NormalizePath gets directory separator normalization from Win32's GetFullPathName(), which will resolve relative paths and as
+ /// such can't be used here (and is overkill for our uses).
+ ///
+ /// Like the current NormalizePath this will not try and analyze periods/spaces within directory segments.
+ /// </summary>
+ /// <remarks>
+ /// The only callers that used to use Path.Normalize(fullCheck=false) were Path.GetDirectoryName() and Path.GetPathRoot(). Both usages do
+ /// not need trimming of trailing whitespace here.
+ ///
+ /// GetPathRoot() could technically skip normalizing separators after the second segment- consider as a future optimization.
+ ///
+ /// For legacy desktop behavior with ExpandShortPaths:
+ /// - It has no impact on GetPathRoot() so doesn't need consideration.
+ /// - It could impact GetDirectoryName(), but only if the path isn't relative (C:\ or \\Server\Share).
+ ///
+ /// In the case of GetDirectoryName() the ExpandShortPaths behavior was undocumented and provided inconsistent results if the path was
+ /// fixed/relative. For example: "C:\PROGRA~1\A.TXT" would return "C:\Program Files" while ".\PROGRA~1\A.TXT" would return ".\PROGRA~1". If you
+ /// ultimately call GetFullPath() this doesn't matter, but if you don't or have any intermediate string handling could easily be tripped up by
+ /// this undocumented behavior.
+ /// </remarks>
+ internal static string NormalizeDirectorySeparators(string path)
+ {
+ if (string.IsNullOrEmpty(path)) return path;
+
+ char current;
+ int start = PathStartSkip(path);
+
+ if (start == 0)
+ {
+ // Make a pass to see if we need to normalize so we can potentially skip allocating
+ bool normalized = true;
+
+ for (int i = 0; i < path.Length; i++)
+ {
+ current = path[i];
+ if (IsDirectorySeparator(current)
+ && (current != Path.DirectorySeparatorChar
+ // Check for sequential separators past the first position (we need to keep initial two for UNC/extended)
+ || (i > 0 && i + 1 < path.Length && IsDirectorySeparator(path[i + 1]))))
+ {
+ normalized = false;
+ break;
+ }
+ }
+
+ if (normalized) return path;
+ }
+
+ StringBuilder builder = StringBuilderCache.Acquire(path.Length);
+
+ if (IsDirectorySeparator(path[start]))
+ {
+ start++;
+ builder.Append(Path.DirectorySeparatorChar);
+ }
+
+ for (int i = start; i < path.Length; i++)
+ {
+ current = path[i];
+
+ // If we have a separator
+ if (IsDirectorySeparator(current))
+ {
+ // If the next is a separator, skip adding this
+ if (i + 1 < path.Length && IsDirectorySeparator(path[i + 1]))
+ {
+ continue;
+ }
+
+ // Ensure it is the primary separator
+ current = Path.DirectorySeparatorChar;
+ }
+
+ builder.Append(current);
+ }
+
+ return StringBuilderCache.GetStringAndRelease(builder);
+ }
+ }
+}
diff --git a/mcs/class/referencesource/mscorlib/system/io/pathtoolongexception.cs b/mcs/class/referencesource/mscorlib/system/io/pathtoolongexception.cs
index aebd4c30dac..048e734acc5 100644
--- a/mcs/class/referencesource/mscorlib/system/io/pathtoolongexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/pathtoolongexception.cs
@@ -7,7 +7,7 @@
**
** Class: PathTooLongException
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Exception for paths and/or filenames that are
diff --git a/mcs/class/referencesource/mscorlib/system/io/pinnedbuffermemorystream.cs b/mcs/class/referencesource/mscorlib/system/io/pinnedbuffermemorystream.cs
index 7b45756c70a..fda409ae8cd 100644
--- a/mcs/class/referencesource/mscorlib/system/io/pinnedbuffermemorystream.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/pinnedbuffermemorystream.cs
@@ -7,7 +7,7 @@
**
** Class: PinnedBufferMemoryStream
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Pins a byte[], exposing it as an unmanaged memory
diff --git a/mcs/class/referencesource/mscorlib/system/io/stringreader.cs b/mcs/class/referencesource/mscorlib/system/io/stringreader.cs
index d4d92c05f2c..1db58849afe 100644
--- a/mcs/class/referencesource/mscorlib/system/io/stringreader.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/stringreader.cs
@@ -7,7 +7,7 @@
**
** Class: StringReader
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
** Purpose: For reading text from strings
**
diff --git a/mcs/class/referencesource/mscorlib/system/io/stringwriter.cs b/mcs/class/referencesource/mscorlib/system/io/stringwriter.cs
index 6f41279ca1c..f464f5c1a33 100644
--- a/mcs/class/referencesource/mscorlib/system/io/stringwriter.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/stringwriter.cs
@@ -7,7 +7,7 @@
**
** Class: StringWriter
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
** Purpose: For writing text to a string
**
diff --git a/mcs/class/referencesource/mscorlib/system/io/textreader.cs b/mcs/class/referencesource/mscorlib/system/io/textreader.cs
index 9023902cbfc..2a026f203f4 100644
--- a/mcs/class/referencesource/mscorlib/system/io/textreader.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/textreader.cs
@@ -7,7 +7,7 @@
**
** Class: TextReader
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Abstract base class for all Text-only Readers.
diff --git a/mcs/class/referencesource/mscorlib/system/io/textwriter.cs b/mcs/class/referencesource/mscorlib/system/io/textwriter.cs
index 3f484ffaddb..8b0c7b5a61f 100644
--- a/mcs/class/referencesource/mscorlib/system/io/textwriter.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/textwriter.cs
@@ -7,7 +7,7 @@
**
** Class: TextWriter
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Abstract base class for Text-only Writers.
diff --git a/mcs/class/referencesource/mscorlib/system/io/unmanagedmemoryaccessor.cs b/mcs/class/referencesource/mscorlib/system/io/unmanagedmemoryaccessor.cs
index 70e100c6e17..3d4c571bc6d 100644
--- a/mcs/class/referencesource/mscorlib/system/io/unmanagedmemoryaccessor.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/unmanagedmemoryaccessor.cs
@@ -7,7 +7,7 @@
**
** Class: UnmanagedMemoryAccessor
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
** Purpose: Provides a fast, AV free, cross-language way of
** accessing unmanaged memory in a random fashion.
diff --git a/mcs/class/referencesource/mscorlib/system/io/unmanagedmemorystream.cs b/mcs/class/referencesource/mscorlib/system/io/unmanagedmemorystream.cs
index d283428109c..362e5c885cb 100644
--- a/mcs/class/referencesource/mscorlib/system/io/unmanagedmemorystream.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/unmanagedmemorystream.cs
@@ -7,7 +7,7 @@
**
** Class: UnmanagedMemoryStream
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
** Purpose: Create a stream over unmanaged memory, mostly
** useful for memory-mapped files.
@@ -401,7 +401,7 @@ namespace System.IO {
throw new ArgumentOutOfRangeException("count", Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
if (buffer.Length - offset < count)
throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
- Contract.EndContractBlock(); // Keep this in [....] with contract validation in ReadAsync
+ Contract.EndContractBlock(); // Keep this in sync with contract validation in ReadAsync
if (!_isOpen) __Error.StreamIsClosed();
if (!CanRead) __Error.ReadNotSupported();
@@ -580,7 +580,7 @@ namespace System.IO {
throw new ArgumentOutOfRangeException("count", Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
if (buffer.Length - offset < count)
throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
- Contract.EndContractBlock(); // Keep contract validation in [....] with WriteAsync(..)
+ Contract.EndContractBlock(); // Keep contract validation in sync with WriteAsync(..)
if (!_isOpen) __Error.StreamIsClosed();
if (!CanWrite) __Error.WriteNotSupported();
diff --git a/mcs/class/referencesource/mscorlib/system/io/unmanagedmemorystreamwrapper.cs b/mcs/class/referencesource/mscorlib/system/io/unmanagedmemorystreamwrapper.cs
index 20535e7022c..613241bab17 100644
--- a/mcs/class/referencesource/mscorlib/system/io/unmanagedmemorystreamwrapper.cs
+++ b/mcs/class/referencesource/mscorlib/system/io/unmanagedmemorystreamwrapper.cs
@@ -7,7 +7,7 @@
**
** Class: UnmanagedMemoryStreamWrapper
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
** Purpose: Create a Memorystream over an UnmanagedMemoryStream
**
@@ -152,7 +152,7 @@ namespace System.IO {
public override Task CopyToAsync(Stream destination, Int32 bufferSize, CancellationToken cancellationToken) {
- // The parameter checks must be in [....] with the base version:
+ // The parameter checks must be in sync with the base version:
if (destination == null)
throw new ArgumentNullException("destination");
diff --git a/mcs/class/referencesource/mscorlib/system/object.cs b/mcs/class/referencesource/mscorlib/system/object.cs
index 2d9f91e839b..6c27df75d51 100644
--- a/mcs/class/referencesource/mscorlib/system/object.cs
+++ b/mcs/class/referencesource/mscorlib/system/object.cs
@@ -86,7 +86,7 @@ public class Object
// Based on the contents of the object, the hash function will return a suitable
// value with a relatively random distribution over the various inputs.
//
- // The default implementation returns the [....] block index for this instance.
+ // The default implementation returns the sync block index for this instance.
// Calling it on the same object multiple times will return the same value, so
// it will technically meet the needs of a hash function, but it's less than ideal.
// Objects (& especially value classes) should override this method.
diff --git a/mcs/class/referencesource/mscorlib/system/progress.cs b/mcs/class/referencesource/mscorlib/system/progress.cs
index 6b273c894a4..a85eeeb7305 100644
--- a/mcs/class/referencesource/mscorlib/system/progress.cs
+++ b/mcs/class/referencesource/mscorlib/system/progress.cs
@@ -7,7 +7,7 @@
**
** Class: Progress<T>
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Event-based implementation of IProgress<T>.
@@ -46,8 +46,8 @@ namespace System
public Progress()
{
// Capture the current synchronization context. "current" is determined by CurrentNoFlow,
- // which doesn't consider the [....] ctx flown with an ExecutionContext, avoiding
- // [....] ctx reference identity issues where the [....] ctx for one thread could be Current on another.
+ // which doesn't consider the sync ctx flown with an ExecutionContext, avoiding
+ // sync ctx reference identity issues where the sync ctx for one thread could be Current on another.
// If there is no current context, we use a default instance targeting the ThreadPool.
m_synchronizationContext = SynchronizationContext.CurrentNoFlow ?? ProgressStatics.DefaultContext;
Contract.Assert(m_synchronizationContext != null);
@@ -80,14 +80,14 @@ namespace System
/// <param name="value">The value of the updated progress.</param>
protected virtual void OnReport(T value)
{
- // If there's no handler, don't bother going through the [....] context.
+ // If there's no handler, don't bother going through the sync context.
// Inside the callback, we'll need to check again, in case
// an event handler is removed between now and then.
Action<T> handler = m_handler;
EventHandler<T> changedEvent = ProgressChanged;
if (handler != null || changedEvent != null)
{
- // Post the processing to the [....] context.
+ // Post the processing to the sync context.
// (If T is a value type, it will get boxed here.)
m_synchronizationContext.Post(m_invokeHandlers, value);
}
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/Associates.cs b/mcs/class/referencesource/mscorlib/system/reflection/Associates.cs
index 3f9c8e5596c..e2a1842a494 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/Associates.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/Associates.cs
@@ -3,7 +3,7 @@
// Copyright(c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/ConstructorInfo.cs b/mcs/class/referencesource/mscorlib/system/reflection/ConstructorInfo.cs
index 6704bd53fe0..dfc2d64d8ee 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/ConstructorInfo.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/ConstructorInfo.cs
@@ -3,7 +3,7 @@
// Copyright(c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/__filters.cs b/mcs/class/referencesource/mscorlib/system/reflection/__filters.cs
index 951881c29d2..b4f92594884 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/__filters.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/__filters.cs
@@ -6,7 +6,7 @@
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// This class defines the delegate methods for the COM+ implemented filters.
// This is the reflection version of these. There is also a _Filters class in
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/ambiguousmatchexception.cs b/mcs/class/referencesource/mscorlib/system/reflection/ambiguousmatchexception.cs
index b6f715ae29d..cfff77d6685 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/ambiguousmatchexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/ambiguousmatchexception.cs
@@ -8,7 +8,7 @@
//
// AmbiguousMatchException is thrown when binding to a method results in more
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// than one method matching the binding criteria. This exception is thrown in
// general when something is Ambiguous.
//
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/assembly.cs b/mcs/class/referencesource/mscorlib/system/reflection/assembly.cs
index 24bd7365124..2f0a22723b3 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/assembly.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/assembly.cs
@@ -1146,7 +1146,7 @@ namespace System.Reflection
}
- // Keep this in [....] with LOADCTX_TYPE defined in fusionpriv.idl
+ // Keep this in sync with LOADCTX_TYPE defined in fusionpriv.idl
internal enum LoadContext
{
DEFAULT,
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/assemblyattributes.cs b/mcs/class/referencesource/mscorlib/system/reflection/assemblyattributes.cs
index b3fec0ba1cb..d222ee51a8f 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/assemblyattributes.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/assemblyattributes.cs
@@ -7,7 +7,7 @@
**
** File: AssemblyAttributes
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: For Assembly-related custom attributes.
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/assemblyname.cs b/mcs/class/referencesource/mscorlib/system/reflection/assemblyname.cs
index a7e5857d067..802414cc091 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/assemblyname.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/assemblyname.cs
@@ -7,8 +7,8 @@
**
** File: AssemblyName
**
-** <OWNER>[....]</OWNER>
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Used for binding and retrieving info about an assembly
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/assemblynameproxy.cs b/mcs/class/referencesource/mscorlib/system/reflection/assemblynameproxy.cs
index dc844de4151..5be9bc495bd 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/assemblynameproxy.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/assemblynameproxy.cs
@@ -7,8 +7,8 @@
**
** File: AssemblyNameProxy
**
-** <OWNER>[....]</OWNER>
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Remotable version the AssemblyName
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/customattribute.cs b/mcs/class/referencesource/mscorlib/system/reflection/customattribute.cs
index 4dfeb2679fd..46ee3f08fe9 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/customattribute.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/customattribute.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
using System;
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/customattributeformatexception.cs b/mcs/class/referencesource/mscorlib/system/reflection/customattributeformatexception.cs
index 093314aba8f..1d158db809d 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/customattributeformatexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/customattributeformatexception.cs
@@ -8,11 +8,11 @@
//
// CustomAttributeFormatException is thrown when the binary format of a
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// custom attribute is invalid.
//
// <EMAIL>Author: darylo</EMAIL>
-// Date: [....] 98
+// Date: Microsoft 98
//
namespace System.Reflection {
using System;
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/defaultmemberattribute.cs b/mcs/class/referencesource/mscorlib/system/reflection/defaultmemberattribute.cs
index 00d6ab38ed0..28af33c9dc6 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/defaultmemberattribute.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/defaultmemberattribute.cs
@@ -8,7 +8,7 @@
//
// DefaultMemberAttribute is defines the Member of a Type that is the "default"
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// member used by Type.InvokeMember. The default member is simply a name given
// to a type.
//
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/aqnbuilder.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/aqnbuilder.cs
index 35c267da67d..e715f583673 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/aqnbuilder.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/aqnbuilder.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/assemblybuilder.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/assemblybuilder.cs
index 22161806123..f8099ccd815 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/assemblybuilder.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/assemblybuilder.cs
@@ -23,7 +23,7 @@
// "internal" and "external" ModuleBuilders are similar
//*************************************************************************************************************
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
namespace System.Reflection.Emit
{
using System;
@@ -475,7 +475,7 @@ namespace System.Reflection.Emit
// The name in the underlying metadata will be set when the
// manifest module is created during nCreateDynamicAssembly.
- // This name needs to stay in [....] with that used in
+ // This name needs to stay in sync with that used in
// Assembly::Init to call ReflectionModule::Create (in VM)
m_manifestModuleBuilder.Init(AssemblyBuilder.MANIFEST_MODULE_NAME, null, 0);
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/assemblybuilderdata.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/assemblybuilderdata.cs
index cc02531a65c..fbce6487b66 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/assemblybuilderdata.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/assemblybuilderdata.cs
@@ -5,7 +5,7 @@
// ==--==
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection.Emit {
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/constructorbuilder.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/constructorbuilder.cs
index 3a1435b907b..ec850ba4d40 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/constructorbuilder.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/constructorbuilder.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection.Emit
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/customattributebuilder.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/customattributebuilder.cs
index cb0aa8cacef..c4cc7d29991 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/customattributebuilder.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/customattributebuilder.cs
@@ -5,7 +5,7 @@
// ==--==
/*============================================================
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
** Class: CustomAttrbuteBuilder
**
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/dynamicilgenerator.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/dynamicilgenerator.cs
index f26816471f5..6f86bcd1f2a 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/dynamicilgenerator.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/dynamicilgenerator.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection.Emit
@@ -799,7 +799,7 @@ namespace System.Reflection.Emit
}
}
- // Keep in [....] with vm/dynamicmethod.h
+ // Keep in sync with vm/dynamicmethod.h
[Flags]
internal enum SecurityControlFlags
{
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/dynamicmethod.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/dynamicmethod.cs
index 23a7baa1f73..71ee85706c7 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/dynamicmethod.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/dynamicmethod.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection.Emit
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/enumbuilder.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/enumbuilder.cs
index 7cea00bdcd4..f6be53addaa 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/enumbuilder.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/enumbuilder.cs
@@ -7,7 +7,7 @@
**
** Class: EnumBuilder
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** EnumBuilder is a helper class to build Enum ( a special type ).
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/eventbuilder.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/eventbuilder.cs
index 0fea09464b6..e6bd4327f42 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/eventbuilder.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/eventbuilder.cs
@@ -7,7 +7,7 @@
**
** Class: EventBuilder
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Eventbuilder is for client to define eevnts for a class
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/eventtoken.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/eventtoken.cs
index a12e442aa6c..737c95c3d2d 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/eventtoken.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/eventtoken.cs
@@ -7,7 +7,7 @@
**
** Class: EventToken
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Propertybuilder is for client to define properties for a class
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/fieldbuilder.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/fieldbuilder.cs
index c38cc21d3df..43cf5ceddae 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/fieldbuilder.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/fieldbuilder.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection.Emit
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/fieldtoken.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/fieldtoken.cs
index 1684ef054f4..e043c0f7f91 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/fieldtoken.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/fieldtoken.cs
@@ -7,7 +7,7 @@
**
** Class: FieldToken
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Represents a Field to the ILGenerator Class
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/generictypeparameterbuilder.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/generictypeparameterbuilder.cs
index 8a6f6e540a5..f9e701e4c22 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/generictypeparameterbuilder.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/generictypeparameterbuilder.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection.Emit
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/ilgenerator.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/ilgenerator.cs
index 475fc3d0f9c..44f61a5dd84 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/ilgenerator.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/ilgenerator.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection.Emit
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/label.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/label.cs
index 577f1960d74..d0ee014f0f8 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/label.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/label.cs
@@ -7,7 +7,7 @@
**
** Class: Label
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
**
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/localbuilder.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/localbuilder.cs
index 51f6f15bb8d..77352947ca4 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/localbuilder.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/localbuilder.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Reflection;
using System.Security.Permissions;
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/methodbuilder.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/methodbuilder.cs
index 41edc340202..99650b1da06 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/methodbuilder.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/methodbuilder.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection.Emit
@@ -1405,7 +1405,7 @@ namespace System.Reflection.Emit
[ComVisible(false)]
public struct ExceptionHandler : IEquatable<ExceptionHandler>
{
- // Keep in [....] with unmanged structure.
+ // Keep in sync with unmanged structure.
internal readonly int m_exceptionClass;
internal readonly int m_tryStartOffset;
internal readonly int m_tryEndOffset;
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/methodbuilderinstantiation.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/methodbuilderinstantiation.cs
index 1a7db5cecbe..3b73e1b2492 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/methodbuilderinstantiation.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/methodbuilderinstantiation.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection.Emit
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/methodrental.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/methodrental.cs
index e54ffa50620..c4e980c9549 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/methodrental.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/methodrental.cs
@@ -7,7 +7,7 @@
**
** Class: MethodRental
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** MethodRental class is to provide a fast way to swap method body implementation
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/methodtoken.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/methodtoken.cs
index 92d2c9d9f30..18c050acc20 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/methodtoken.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/methodtoken.cs
@@ -7,7 +7,7 @@
**
** Class: MethodToken
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Represents a Method to the ILGenerator class.
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/modulebuilder.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/modulebuilder.cs
index e64bd9bd954..c872fa06510 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/modulebuilder.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/modulebuilder.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection.Emit
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/modulebuilderdata.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/modulebuilderdata.cs
index 36f17022ed2..0252f9dbace 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/modulebuilderdata.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/modulebuilderdata.cs
@@ -5,7 +5,7 @@
// ==--==
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection.Emit
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/opcode.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/opcode.cs
index b0110f5f859..477b3595eb7 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/opcode.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/opcode.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
namespace System.Reflection.Emit {
using System;
using System.Threading;
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/opcodes.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/opcodes.cs
index f7b85f8159f..0b0cb66a046 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/opcodes.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/opcodes.cs
@@ -2,7 +2,7 @@
**
**Class: OpCodes
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**Purpose: Exposes all of the il instructions supported by the runtime.
**
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/parameterbuilder.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/parameterbuilder.cs
index 840e8bdcb22..fbcb9cad9ab 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/parameterbuilder.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/parameterbuilder.cs
@@ -7,7 +7,7 @@
**
** Class: ParameterBuilder
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** ParameterBuilder is used to create/associate parameter information
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/parametertoken.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/parametertoken.cs
index b4fa891db15..109641ef248 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/parametertoken.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/parametertoken.cs
@@ -7,7 +7,7 @@
**
** Class: ParameterToken
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: metadata tokens for a parameter
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/propertybuilder.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/propertybuilder.cs
index 57cd6df97cb..b3a73689f88 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/propertybuilder.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/propertybuilder.cs
@@ -7,7 +7,7 @@
**
** Class: PropertyBuilder
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Propertybuilder is for client to define properties for a class
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/propertytoken.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/propertytoken.cs
index db59f5d80ec..a29d4c6f42a 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/propertytoken.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/propertytoken.cs
@@ -7,7 +7,7 @@
**
** Class: PropertyToken
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Propertybuilder is for client to define properties for a class
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/signaturehelper.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/signaturehelper.cs
index 9c61d53dd7f..05b2d9f402b 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/signaturehelper.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/signaturehelper.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection.Emit
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/signaturetoken.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/signaturetoken.cs
index 2ae4c1eecde..a41b2d2925c 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/signaturetoken.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/signaturetoken.cs
@@ -7,7 +7,7 @@
**
** Signature: SignatureToken
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Represents a Signature to the ILGenerator signature.
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/stringtoken.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/stringtoken.cs
index b568cef114b..ad7216a4636 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/stringtoken.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/stringtoken.cs
@@ -7,7 +7,7 @@
**
** Class: StringToken
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Represents a String to the ILGenerator class.
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/symbolmethod.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/symbolmethod.cs
index 1367894419b..8bca9063d78 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/symbolmethod.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/symbolmethod.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection.Emit
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/symboltype.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/symboltype.cs
index d376bcd2e9e..7116ab43580 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/symboltype.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/symboltype.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
#if !FULL_AOT_RUNTIME
namespace System.Reflection.Emit
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/typebuilder.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/typebuilder.cs
index 7833c8f6a49..9cf13f212c1 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/typebuilder.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/typebuilder.cs
@@ -4,7 +4,7 @@
// Copyright(c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection.Emit {
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/typebuilderinstantiation.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/typebuilderinstantiation.cs
index 0db7978dfbc..61101139eb6 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/typebuilderinstantiation.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/typebuilderinstantiation.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection.Emit
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/typetoken.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/typetoken.cs
index bfc3c16114d..da4b521d18c 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/typetoken.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/typetoken.cs
@@ -7,7 +7,7 @@
**
** Class: TypeToken
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Represents a Class to the ILGenerator class.
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/unmanagedmarshal.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/unmanagedmarshal.cs
index 1d2ab106384..5951fc9f51e 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/unmanagedmarshal.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/unmanagedmarshal.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
namespace System.Reflection.Emit
{
using System.Runtime.InteropServices;
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/emit/xxxontypebuilderinstantiation.cs b/mcs/class/referencesource/mscorlib/system/reflection/emit/xxxontypebuilderinstantiation.cs
index 59ae15e5fe4..71a3b53ddd3 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/emit/xxxontypebuilderinstantiation.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/emit/xxxontypebuilderinstantiation.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection.Emit
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/eventinfo.cs b/mcs/class/referencesource/mscorlib/system/reflection/eventinfo.cs
index c81f87593b6..34f32419992 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/eventinfo.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/eventinfo.cs
@@ -3,7 +3,7 @@
// Copyright(c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/fieldinfo.cs b/mcs/class/referencesource/mscorlib/system/reflection/fieldinfo.cs
index 3a7bdfc19d5..9f7f9494b4a 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/fieldinfo.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/fieldinfo.cs
@@ -3,7 +3,7 @@
// Copyright(c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/introspectionextensions.cs b/mcs/class/referencesource/mscorlib/system/reflection/introspectionextensions.cs
index 4d393c99bd3..95ba5279970 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/introspectionextensions.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/introspectionextensions.cs
@@ -7,7 +7,7 @@
**
** Class: TypeInfoExtension
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: go from type to type info
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/invalidfiltercriteriaexception.cs b/mcs/class/referencesource/mscorlib/system/reflection/invalidfiltercriteriaexception.cs
index 8c73653195d..c7ae1c8a114 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/invalidfiltercriteriaexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/invalidfiltercriteriaexception.cs
@@ -8,7 +8,7 @@
//
// InvalidFilterCriteriaException is thrown in FindMembers when the
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// filter criteria is not valid for the type of filter being used.
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/loaderallocator.cs b/mcs/class/referencesource/mscorlib/system/reflection/loaderallocator.cs
index 4b35f9fdd45..d8ff5d79d16 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/loaderallocator.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/loaderallocator.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
using System;
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/manifestresourceinfo.cs b/mcs/class/referencesource/mscorlib/system/reflection/manifestresourceinfo.cs
index 496012a528b..6026f53d8e3 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/manifestresourceinfo.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/manifestresourceinfo.cs
@@ -7,7 +7,7 @@
**
** Class: ManifestResourceInfo
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: For info regarding a manifest resource's topology.
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/mdconstant.cs b/mcs/class/referencesource/mscorlib/system/reflection/mdconstant.cs
index f78dc8fb231..3f69c080c39 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/mdconstant.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/mdconstant.cs
@@ -3,7 +3,7 @@
// Copyright(c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/mdimport.cs b/mcs/class/referencesource/mscorlib/system/reflection/mdimport.cs
index 5bcbaf33693..f2f0c70edce 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/mdimport.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/mdimport.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
using System;
@@ -190,7 +190,7 @@ namespace System.Reflection
}
}
- // Keep the definition in [....] with vm\ManagedMdImport.hpp
+ // Keep the definition in sync with vm\ManagedMdImport.hpp
internal int m_length;
internal IntPtr m_constArray;
}
@@ -256,7 +256,7 @@ namespace System.Reflection
internal unsafe struct MetadataEnumResult
{
- // Keep the definition in [....] with vm\ManagedMdImport.hpp
+ // Keep the definition in sync with vm\ManagedMdImport.hpp
private int[] largeResult;
private int length;
private fixed int smallResult[16];
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/memberinfo.cs b/mcs/class/referencesource/mscorlib/system/reflection/memberinfo.cs
index 89d9023538d..9b7ba894b6f 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/memberinfo.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/memberinfo.cs
@@ -3,7 +3,7 @@
// Copyright(c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/memberinfoserializationholder.cs b/mcs/class/referencesource/mscorlib/system/reflection/memberinfoserializationholder.cs
index ee3e0e31bd5..772cccd6ed8 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/memberinfoserializationholder.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/memberinfoserializationholder.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
using System;
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/methodbase.cs b/mcs/class/referencesource/mscorlib/system/reflection/methodbase.cs
index db85136a5a0..a38586d0865 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/methodbase.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/methodbase.cs
@@ -3,7 +3,7 @@
// Copyright(c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/methodbody.cs b/mcs/class/referencesource/mscorlib/system/reflection/methodbody.cs
index 428aded37a4..15bacb6824f 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/methodbody.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/methodbody.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
using System;
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/methodinfo.cs b/mcs/class/referencesource/mscorlib/system/reflection/methodinfo.cs
index d82cc177e4e..662f30b917f 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/methodinfo.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/methodinfo.cs
@@ -3,7 +3,7 @@
// Copyright(c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/missing.cs b/mcs/class/referencesource/mscorlib/system/reflection/missing.cs
index d203d31aaa7..7b310ebfa05 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/missing.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/missing.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/module.cs b/mcs/class/referencesource/mscorlib/system/reflection/module.cs
index fb10e18a089..b318b39014d 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/module.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/module.cs
@@ -4,8 +4,8 @@
//
// ==--==
////////////////////////////////////////////////////////////////////////////////
-// <OWNER>[....]</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/obfuscateassemblyattribute.cs b/mcs/class/referencesource/mscorlib/system/reflection/obfuscateassemblyattribute.cs
index 287a19a76d5..4c38baf4b9f 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/obfuscateassemblyattribute.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/obfuscateassemblyattribute.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
using System;
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/obfuscationattribute.cs b/mcs/class/referencesource/mscorlib/system/reflection/obfuscationattribute.cs
index 3bede5deabd..5e9a137cd99 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/obfuscationattribute.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/obfuscationattribute.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
using System;
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/parameterinfo.cs b/mcs/class/referencesource/mscorlib/system/reflection/parameterinfo.cs
index 8f6739f1d01..0494899bcc1 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/parameterinfo.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/parameterinfo.cs
@@ -3,7 +3,7 @@
// Copyright(c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/parametermodifier.cs b/mcs/class/referencesource/mscorlib/system/reflection/parametermodifier.cs
index 545ea83ebce..ee168adddc3 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/parametermodifier.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/parametermodifier.cs
@@ -4,7 +4,7 @@ using System.Diagnostics.Contracts;
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/pointer.cs b/mcs/class/referencesource/mscorlib/system/reflection/pointer.cs
index ec703d95e16..636795024a3 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/pointer.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/pointer.cs
@@ -7,7 +7,7 @@
//
// This is a wrapper class for Pointers
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/propertyinfo.cs b/mcs/class/referencesource/mscorlib/system/reflection/propertyinfo.cs
index f105a9ce38a..2ea511c43dd 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/propertyinfo.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/propertyinfo.cs
@@ -3,7 +3,7 @@
// Copyright(c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Reflection
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/reflectioncontext.cs b/mcs/class/referencesource/mscorlib/system/reflection/reflectioncontext.cs
index d559a661f4b..3b853973201 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/reflectioncontext.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/reflectioncontext.cs
@@ -7,7 +7,7 @@
**
** Class: ReflectionContext
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: For Assembly-related stuff.
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/reflectiontypeloadexception.cs b/mcs/class/referencesource/mscorlib/system/reflection/reflectiontypeloadexception.cs
index 07baefda606..df95e64a25c 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/reflectiontypeloadexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/reflectiontypeloadexception.cs
@@ -8,7 +8,7 @@
//
// ReflectionTypeLoadException is thrown when multiple TypeLoadExceptions may occur.
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// Specifically, when you call Module.GetTypes() this causes multiple class loads to occur.
// If there are failures, we continue to load classes and build an array of the successfully
// loaded classes. We also build an array of the errors that occur. Then we throw this exception
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/strongnamekeypair.cs b/mcs/class/referencesource/mscorlib/system/reflection/strongnamekeypair.cs
index b4a736415fa..6734a4850d1 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/strongnamekeypair.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/strongnamekeypair.cs
@@ -7,7 +7,7 @@
**
** File: StrongNameKeyPair.cs
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Encapsulate access to a public/private key pair
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/targetexception.cs b/mcs/class/referencesource/mscorlib/system/reflection/targetexception.cs
index caba5efd123..c3e51193f8e 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/targetexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/targetexception.cs
@@ -8,7 +8,7 @@
//
// TargetException is thrown when the target to an Invoke is invalid. This may
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// occur because the caller doesn't have access to the member, or the target doesn't
// define the member, etc.
//
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/targetinvocationexception.cs b/mcs/class/referencesource/mscorlib/system/reflection/targetinvocationexception.cs
index 0df1faa9d6c..dbe11f215b3 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/targetinvocationexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/targetinvocationexception.cs
@@ -8,7 +8,7 @@
//
// TargetInvocationException is used to report an exception that was thrown
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// by the target of an invocation.
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/targetparametercountexception.cs b/mcs/class/referencesource/mscorlib/system/reflection/targetparametercountexception.cs
index d350a07c2ea..60007d1cd25 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/targetparametercountexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/targetparametercountexception.cs
@@ -8,7 +8,7 @@
//
// TargetParameterCountException is thrown when the number of parameter to an
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// invocation doesn't match the number expected.
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/typedelegator.cs b/mcs/class/referencesource/mscorlib/system/reflection/typedelegator.cs
index 0cb24e82691..226eb47884b 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/typedelegator.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/typedelegator.cs
@@ -5,7 +5,7 @@
// ==--==
// TypeDelegator
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
// This class wraps a Type object and delegates all methods to that Type.
namespace System.Reflection {
diff --git a/mcs/class/referencesource/mscorlib/system/reflection/typeinfo.cs b/mcs/class/referencesource/mscorlib/system/reflection/typeinfo.cs
index 842f9e3065b..098b0add8dc 100644
--- a/mcs/class/referencesource/mscorlib/system/reflection/typeinfo.cs
+++ b/mcs/class/referencesource/mscorlib/system/reflection/typeinfo.cs
@@ -7,7 +7,7 @@
**
** Class: TypeInfo
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Notion of a type definition
diff --git a/mcs/class/referencesource/mscorlib/system/resources/__fastresourcecomparer.cs b/mcs/class/referencesource/mscorlib/system/resources/__fastresourcecomparer.cs
index 9b315a100b6..e04fca6aa38 100644
--- a/mcs/class/referencesource/mscorlib/system/resources/__fastresourcecomparer.cs
+++ b/mcs/class/referencesource/mscorlib/system/resources/__fastresourcecomparer.cs
@@ -5,7 +5,7 @@
// ==--==
/*============================================================
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
** Class: FastResourceComparer
**
diff --git a/mcs/class/referencesource/mscorlib/system/resources/filebasedresourcegroveler.cs b/mcs/class/referencesource/mscorlib/system/resources/filebasedresourcegroveler.cs
index bf8ede79742..18915fb4b16 100644
--- a/mcs/class/referencesource/mscorlib/system/resources/filebasedresourcegroveler.cs
+++ b/mcs/class/referencesource/mscorlib/system/resources/filebasedresourcegroveler.cs
@@ -7,7 +7,7 @@
**
** Class: FileBasedResourceGroveler
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Searches for resources on disk, used for file-
diff --git a/mcs/class/referencesource/mscorlib/system/resources/manifestbasedresourcegroveler.cs b/mcs/class/referencesource/mscorlib/system/resources/manifestbasedresourcegroveler.cs
index df2870092b0..7e98959bfea 100644
--- a/mcs/class/referencesource/mscorlib/system/resources/manifestbasedresourcegroveler.cs
+++ b/mcs/class/referencesource/mscorlib/system/resources/manifestbasedresourcegroveler.cs
@@ -7,7 +7,7 @@
**
** Class: ManifestBasedResourceGroveler
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Searches for resources in Assembly manifest, used
diff --git a/mcs/class/referencesource/mscorlib/system/resources/missingmanifestresourceexception.cs b/mcs/class/referencesource/mscorlib/system/resources/missingmanifestresourceexception.cs
index 5230ce273d0..2baaaf3228f 100644
--- a/mcs/class/referencesource/mscorlib/system/resources/missingmanifestresourceexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/resources/missingmanifestresourceexception.cs
@@ -7,7 +7,7 @@
**
** Class: MissingManifestResourceException
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Exception for a missing assembly-level resource
diff --git a/mcs/class/referencesource/mscorlib/system/resources/missingsatelliteassemblyexception.cs b/mcs/class/referencesource/mscorlib/system/resources/missingsatelliteassemblyexception.cs
index 66de05a64a6..e9099224a4b 100644
--- a/mcs/class/referencesource/mscorlib/system/resources/missingsatelliteassemblyexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/resources/missingsatelliteassemblyexception.cs
@@ -7,7 +7,7 @@
**
** Class: MissingSatelliteAssemblyException
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Exception for a missing satellite assembly needed
diff --git a/mcs/class/referencesource/mscorlib/system/resources/neutralresourceslanguageattribute.cs b/mcs/class/referencesource/mscorlib/system/resources/neutralresourceslanguageattribute.cs
index 9ab5e027cf4..e22f68833e0 100644
--- a/mcs/class/referencesource/mscorlib/system/resources/neutralresourceslanguageattribute.cs
+++ b/mcs/class/referencesource/mscorlib/system/resources/neutralresourceslanguageattribute.cs
@@ -7,7 +7,7 @@
**
** Class: NeutralResourcesLanguageAttribute
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Tells the ResourceManager what language your main
diff --git a/mcs/class/referencesource/mscorlib/system/resources/resourcefallbackmanager.cs b/mcs/class/referencesource/mscorlib/system/resources/resourcefallbackmanager.cs
index 1b5ce87f617..81390965515 100644
--- a/mcs/class/referencesource/mscorlib/system/resources/resourcefallbackmanager.cs
+++ b/mcs/class/referencesource/mscorlib/system/resources/resourcefallbackmanager.cs
@@ -7,7 +7,7 @@
**
** Class: ResourceFallbackManager
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Encapsulates CultureInfo fallback for resource
@@ -67,7 +67,7 @@ namespace System.Resources
return GetEnumerator();
}
- // WARING: This function must be kept in [....] with ResourceManager.GetFirstResourceSet()
+ // WARING: This function must be kept in sync with ResourceManager.GetFirstResourceSet()
public IEnumerator<CultureInfo> GetEnumerator()
{
bool reachedNeutralResourcesCulture = false;
diff --git a/mcs/class/referencesource/mscorlib/system/resources/resourcemanager.cs b/mcs/class/referencesource/mscorlib/system/resources/resourcemanager.cs
index 9f8870cb266..f1e563e085d 100644
--- a/mcs/class/referencesource/mscorlib/system/resources/resourcemanager.cs
+++ b/mcs/class/referencesource/mscorlib/system/resources/resourcemanager.cs
@@ -66,7 +66,7 @@ namespace System.Resources {
}
[FriendAccessAllowed]
- // [[....] 3/9/2012] This class should be named PRIErrorInfo.
+ // [Microsoft 3/9/2012] This class should be named PRIErrorInfo.
//
// During Dev11 CLR RC Ask mode, the Windows Modern Resource Manager
// made a breaking change such that ResourceMap.GetSubtree returns null when a subtree is
@@ -651,7 +651,7 @@ namespace System.Resources {
return sb.ToString();
}
- // WARNING: This function must be kept in [....] with ResourceFallbackManager.GetEnumerator()
+ // WARNING: This function must be kept in sync with ResourceFallbackManager.GetEnumerator()
// Return the first ResourceSet, based on the first culture ResourceFallbackManager would return
internal ResourceSet GetFirstResourceSet(CultureInfo culture)
{
diff --git a/mcs/class/referencesource/mscorlib/system/resources/resourcereader.cs b/mcs/class/referencesource/mscorlib/system/resources/resourcereader.cs
index 33c341eb4f7..03bebb8e07e 100644
--- a/mcs/class/referencesource/mscorlib/system/resources/resourcereader.cs
+++ b/mcs/class/referencesource/mscorlib/system/resources/resourcereader.cs
@@ -7,7 +7,7 @@
**
** Class: ResourceReader
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Default way to read streams of resources on
@@ -843,7 +843,7 @@ namespace System.Resources {
// types which do demand serialization permission in their
// deserialization .cctors will fail.
// Also, use a serialization binder to limit bind requests to
- // our allowed list of [....] types.
+ // our allowed list of Microsoft types.
_objFormatter.Binder = _typeLimitingBinder;
_typeLimitingBinder.ExpectingToDeserialize(type);
graph = _objFormatter.UnsafeDeserialize(_store.BaseStream, null);
@@ -1017,8 +1017,7 @@ namespace System.Resources {
// The hexadecimal E translates to binary 1110
// So, with this & condition we are checking that none of the highest 3 bits are
// set before multiplying, as that would cause an overflow.
- if ((_numResources & 0xE0000000) != 0){
-
+ if ((_numResources & 0xE0000000) != 0) {
throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesHeaderCorrupted"));
}
@@ -1054,7 +1053,7 @@ namespace System.Resources {
// The hexadecimal E translates to binary 1110
// So, with this & condition we are checking that none of the highest 3 bits are
// set before multiplying, as that would cause an overflow.
- if ((_numResources & 0xE0000000) != 0){
+ if ((_numResources & 0xE0000000) != 0) {
throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesHeaderCorrupted"));
}
@@ -1149,7 +1148,7 @@ namespace System.Resources {
}
else {
// Enums should be safe to deserialize, and this helps out
- // partially trusted, localized [....] apps.
+ // partially trusted, localized Microsoft apps.
if (resourceType.BaseType == typeof(Enum)) {
_safeToDeserialize[i] = true;
continue;
@@ -1324,7 +1323,7 @@ namespace System.Resources {
}
}
- // [....] types may internally use some enums that aren't
+ // Microsoft types may internally use some enums that aren't
// on our safe to deserialize list, like Font using FontStyle.
Type t = ObjectReader.FastBindToType(assemblyName, typeName);
if (t.IsEnum)
@@ -1335,7 +1334,7 @@ namespace System.Resources {
// Throw instead of returning null.
// If you're looking at this in a debugger, you've either
- // got a hacked .resources file on your hands, or [....]
+ // got a hacked .resources file on your hands, or Microsoft
// types have taken a new dependency on another type. Check
// whether assemblyName & typeName refer to a trustworthy type,
// & consider adding it to the TypesSafeToDeserialize list.
@@ -1421,7 +1420,7 @@ namespace System.Resources {
value = _reader.LoadObject(_dataPosition);
// If enumeration and subsequent lookups happen very
// frequently in the same process, add a ResourceLocator
- // to _resCache here. But [....] enumerates and
+ // to _resCache here. But Microsoft enumerates and
// just about everyone else does lookups. So caching
// here may bloat working set.
}
diff --git a/mcs/class/referencesource/mscorlib/system/resources/resourceset.cs b/mcs/class/referencesource/mscorlib/system/resources/resourceset.cs
index c722cfb3602..0d1234cb617 100644
--- a/mcs/class/referencesource/mscorlib/system/resources/resourceset.cs
+++ b/mcs/class/referencesource/mscorlib/system/resources/resourceset.cs
@@ -7,7 +7,7 @@
**
** Class: ResourceSet
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Culture-specific collection of resources.
diff --git a/mcs/class/referencesource/mscorlib/system/resources/resourcewriter.cs b/mcs/class/referencesource/mscorlib/system/resources/resourcewriter.cs
index c80ee838d40..15b835c71f3 100644
--- a/mcs/class/referencesource/mscorlib/system/resources/resourcewriter.cs
+++ b/mcs/class/referencesource/mscorlib/system/resources/resourcewriter.cs
@@ -7,7 +7,7 @@
**
** Class: ResourceWriter
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Default way to write strings to a CLR resource
diff --git a/mcs/class/referencesource/mscorlib/system/resources/runtimeresourceset.cs b/mcs/class/referencesource/mscorlib/system/resources/runtimeresourceset.cs
index d9cdd07df56..0c51f6039c1 100644
--- a/mcs/class/referencesource/mscorlib/system/resources/runtimeresourceset.cs
+++ b/mcs/class/referencesource/mscorlib/system/resources/runtimeresourceset.cs
@@ -7,7 +7,7 @@
**
** Class: RuntimeResourceSet
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: CultureInfo-specific collection of resources.
diff --git a/mcs/class/referencesource/mscorlib/system/resources/satellitecontractversionattribute.cs b/mcs/class/referencesource/mscorlib/system/resources/satellitecontractversionattribute.cs
index 4987dc9e6cf..c0c0045683a 100644
--- a/mcs/class/referencesource/mscorlib/system/resources/satellitecontractversionattribute.cs
+++ b/mcs/class/referencesource/mscorlib/system/resources/satellitecontractversionattribute.cs
@@ -7,7 +7,7 @@
**
** Class: SatelliteContractVersionAttribute
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Specifies which version of a satellite assembly
diff --git a/mcs/class/referencesource/mscorlib/system/rttype.cs b/mcs/class/referencesource/mscorlib/system/rttype.cs
index 097e2cfe1ce..61b46433b34 100644
--- a/mcs/class/referencesource/mscorlib/system/rttype.cs
+++ b/mcs/class/referencesource/mscorlib/system/rttype.cs
@@ -6,7 +6,7 @@
//
// File: RtType.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Implements System.RuntimeType
//
@@ -58,7 +58,7 @@ namespace System
internal delegate void CtorDelegate(Object instance);
- // Keep this in [....] with FormatFlags defined in typestring.h
+ // Keep this in sync with FormatFlags defined in typestring.h
internal enum TypeNameFormatFlags
{
FormatBasic = 0x00000000, // Not a bitmask, simply the tersest flag settings possible
@@ -5892,7 +5892,7 @@ namespace System
[Flags]
private enum DispatchWrapperType : int
{
- // This enum must stay in [....] with the DispatchWrapperType enum defined in MLInfo.h
+ // This enum must stay in sync with the DispatchWrapperType enum defined in MLInfo.h
Unknown = 0x00000001,
Dispatch = 0x00000002,
Record = 0x00000004,
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs b/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs
index 7e0ed8e8932..b2d762d0cab 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs
@@ -7,7 +7,7 @@
//
// AsyncMethodBuilder.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Compiler-targeted types that build tasks for use as the return types of asynchronous methods.
//
@@ -49,7 +49,7 @@ namespace System.Runtime.CompilerServices
/// <returns>The initialized <see cref="AsyncVoidMethodBuilder"/>.</returns>
public static AsyncVoidMethodBuilder Create()
{
- // Capture the current [....] context. If there isn't one, use the dummy s_noContextCaptured
+ // Capture the current sync context. If there isn't one, use the dummy s_noContextCaptured
// instance; this allows us to tell the state of no captured context apart from the state
// of an improperly constructed builder instance.
SynchronizationContext sc = SynchronizationContext.CurrentNoFlow;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/ConditionalWeakTable.cs b/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/ConditionalWeakTable.cs
index bae239feaad..2f7814328d4 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/ConditionalWeakTable.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/ConditionalWeakTable.cs
@@ -6,7 +6,7 @@
/*============================================================
** Class: ConditionalWeakTable
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
** Description: Compiler support for runtime-generated "object fields."
**
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs b/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs
index 08d8d7a8774..64327a99ea4 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs
@@ -7,7 +7,7 @@
//
// TaskAwaiter.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Types for awaiting Task and Task<T>. These types are emitted from Task{<T>}.GetAwaiter
// and Task{<T>}.ConfigureAwait. They are meant to be used only by the compiler, e.g.
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/YieldAwaitable.cs b/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/YieldAwaitable.cs
index e37f4b985d6..9a0d1f5aed9 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/YieldAwaitable.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/YieldAwaitable.cs
@@ -7,7 +7,7 @@
//
// YieldAwaitable.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Compiler-targeted type for switching back into the current execution context, e.g.
//
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/compilationrelaxations.cs b/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/compilationrelaxations.cs
index 73d60208676..cce631b1c3a 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/compilationrelaxations.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/compilationrelaxations.cs
@@ -11,7 +11,7 @@ namespace System.Runtime.CompilerServices
using System;
- /// IMPORTANT: Keep this in [....] with corhdr.h
+ /// IMPORTANT: Keep this in sync with corhdr.h
[Serializable]
[Flags]
[System.Runtime.InteropServices.ComVisible(true)]
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/runtimehelpers.cs b/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/runtimehelpers.cs
index c9cc8f42fc5..a6d4f8a8a8d 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/runtimehelpers.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/runtimehelpers.cs
@@ -169,7 +169,7 @@ namespace System.Runtime.CompilerServices {
// a String to the first 16-bit character in the String. Skip
// over the MethodTable pointer, & String
// length. Of course, the String reference points to the memory
- // after the [....] block, so don't count that.
+ // after the sync block, so don't count that.
// This property allows C#'s fixed statement to work on Strings.
// On 64 bit platforms, this should be 12 (8+4) and on 32 bit 8 (4+4).
#if WIN32
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/corruptingexceptioncommon.cs b/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/corruptingexceptioncommon.cs
index 13b30a0f29f..7cc021dbdc1 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/corruptingexceptioncommon.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/corruptingexceptioncommon.cs
@@ -13,7 +13,7 @@
**
** Created: 06/20/2008
**
-** <owner>[....]</owner>
+** <owner>Microsoft</owner>
**
=============================================================================*/
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionnotification.cs b/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionnotification.cs
index acda22b5d26..57ea2c178c5 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionnotification.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionnotification.cs
@@ -13,7 +13,7 @@
**
** Created: 10/07/2008
**
-** <owner>[....]</owner>
+** <owner>Microsoft</owner>
**
=============================================================================*/
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs b/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs
index 2947f387780..4bb82b7c728 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs
@@ -13,7 +13,7 @@
**
** Created: 11/2/2010
**
-** <owner>[....]</owner>
+** <owner>Microsoft</owner>
**
=============================================================================*/
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/attributes.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/attributes.cs
index 83a6c0b161d..a970216007b 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/attributes.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/attributes.cs
@@ -444,7 +444,7 @@ namespace System.Runtime.InteropServices{
[Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
- // Note that this enum should remain in-[....] with the CorNativeType enum in corhdr.h
+ // Note that this enum should remain in-sync with the CorNativeType enum in corhdr.h
public enum UnmanagedType
{
Bool = 0x2, // 4 byte boolean value (true != 0, false == 0)
@@ -523,9 +523,9 @@ namespace System.Runtime.InteropServices{
[System.Runtime.InteropServices.ComVisible(false)]
HString = 0x2f, // Windows Runtime HSTRING
- [System.Runtime.InteropServices.ComVisible(false)]
+ [System.Runtime.InteropServices.ComVisible(false)]
LPUTF8Str = 0x30, // UTF8 string
- }
+}
#if !MONO
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.ReturnValue, Inherited = false)]
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/gchandle.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/gchandle.cs
index 5480f22e98b..5fcee00f2c4 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/gchandle.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/gchandle.cs
@@ -44,7 +44,7 @@ namespace System.Runtime.InteropServices
[System.Runtime.InteropServices.ComVisible(true)]
public struct GCHandle
{
- // IMPORTANT: This must be kept in [....] with the GCHandleType enum.
+ // IMPORTANT: This must be kept in sync with the GCHandleType enum.
private const GCHandleType MaxHandleType = GCHandleType.Pinned;
#if MDA_SUPPORTED
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/attributes.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/attributes.cs
index 8be810c5641..8dfd4c70ca5 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/attributes.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/attributes.cs
@@ -4,9 +4,9 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
-// <OWNER>[....]</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
+// <OWNER>Microsoft</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/bindablevectortocollectionadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/bindablevectortocollectionadapter.cs
index ad818c93acb..248643a3c15 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/bindablevectortocollectionadapter.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/bindablevectortocollectionadapter.cs
@@ -5,7 +5,7 @@
// ==--==
//
// <OWNER>GPaperin</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Runtime;
@@ -85,7 +85,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
throw new ArgumentOutOfRangeException("arrayIndex");
// Does the dimension in question have sufficient space to copy the expected number of entries?
- // We perform this check before valid index check to ensure the exception message is in [....] with
+ // We perform this check before valid index check to ensure the exception message is in sync with
// the following snippet that uses regular framework code:
//
// ArrayList list = new ArrayList();
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/bindablevectortolistadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/bindablevectortolistadapter.cs
index f86568feb1c..e8aa7ecb1fb 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/bindablevectortolistadapter.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/bindablevectortolistadapter.cs
@@ -5,7 +5,7 @@
// ==--==
//
// <OWNER>GPaperin</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Runtime;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clrikeyvaluepairimpl.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clrikeyvaluepairimpl.cs
index 25c3184066d..44b63f91154 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clrikeyvaluepairimpl.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clrikeyvaluepairimpl.cs
@@ -4,8 +4,8 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clripropertyvalueimpl.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clripropertyvalueimpl.cs
index c7781abf070..3dc29580b28 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clripropertyvalueimpl.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clripropertyvalueimpl.cs
@@ -4,9 +4,9 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
-// <OWNER>[....]</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
+// <OWNER>Microsoft</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Diagnostics.Contracts;
@@ -475,7 +475,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
return (T)(object)ipv.GetDouble();
}
else {
- BCLDebug.Assert(false, "T in coersion function wasn't understood as a type that can be coerced - make sure that CoerceScalarValue and NumericScalarTypes are in [....]");
+ BCLDebug.Assert(false, "T in coersion function wasn't understood as a type that can be coerced - make sure that CoerceScalarValue and NumericScalarTypes are in sync");
}
}
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clrireferenceimpl.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clrireferenceimpl.cs
index edb419c91d9..8c240e580f4 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clrireferenceimpl.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clrireferenceimpl.cs
@@ -4,9 +4,9 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
-// <OWNER>[....]</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
+// <OWNER>Microsoft</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/custompropertyimpl.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/custompropertyimpl.cs
index 82e901d71db..bf762dbefe9 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/custompropertyimpl.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/custompropertyimpl.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Security;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/dictionarytomapadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/dictionarytomapadapter.cs
index db7e014764b..94a0d9e60c5 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/dictionarytomapadapter.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/dictionarytomapadapter.cs
@@ -5,7 +5,7 @@
// ==--==
//
// <OWNER>GPaperin</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Security;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/enumeratortoiteratoradapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/enumeratortoiteratoradapter.cs
index a4ee4b1ed8a..60e229954f0 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/enumeratortoiteratoradapter.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/enumeratortoiteratoradapter.cs
@@ -4,9 +4,9 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
-// <OWNER>[....]</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
+// <OWNER>Microsoft</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/eventregistrationtoken.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/eventregistrationtoken.cs
index 5f96a90e75d..092e43a2bcc 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/eventregistrationtoken.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/eventregistrationtoken.cs
@@ -4,9 +4,9 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
-// <OWNER>[....]</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
+// <OWNER>Microsoft</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/eventregistrationtokentable.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/eventregistrationtokentable.cs
index 2de657df7f7..152e46f3403 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/eventregistrationtokentable.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/eventregistrationtokentable.cs
@@ -4,9 +4,9 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
-// <OWNER>[....]</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
+// <OWNER>Microsoft</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/icustompropertyprovider.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/icustompropertyprovider.cs
index 5ef1d8c06e1..d505dfac3bb 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/icustompropertyprovider.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/icustompropertyprovider.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.StubHelpers;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/imapviewtoireadonlydictionaryadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/imapviewtoireadonlydictionaryadapter.cs
index 4817cbcf25c..40deccb0566 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/imapviewtoireadonlydictionaryadapter.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/imapviewtoireadonlydictionaryadapter.cs
@@ -5,7 +5,7 @@
// ==--==
//
// <OWNER>GPaperin</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Security;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ireadonlydictionarytoimapviewadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ireadonlydictionarytoimapviewadapter.cs
index 32433c99c73..9a9c98ab416 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ireadonlydictionarytoimapviewadapter.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ireadonlydictionarytoimapviewadapter.cs
@@ -5,7 +5,7 @@
// ==--==
//
// <OWNER>GPaperin</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Security;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ireadonlylisttoivectorviewadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ireadonlylisttoivectorviewadapter.cs
index bec4e3e70d0..1bf26b164de 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ireadonlylisttoivectorviewadapter.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ireadonlylisttoivectorviewadapter.cs
@@ -5,7 +5,7 @@
// ==--==
//
// <OWNER>GPaperin</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Security;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iteratortoenumeratoradapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iteratortoenumeratoradapter.cs
index 08d11e672b7..e1460806c42 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iteratortoenumeratoradapter.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iteratortoenumeratoradapter.cs
@@ -4,8 +4,8 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ivectorviewtoireadonlylistadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ivectorviewtoireadonlylistadapter.cs
index 2e0631196df..14e43b37e0a 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ivectorviewtoireadonlylistadapter.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ivectorviewtoireadonlylistadapter.cs
@@ -5,7 +5,7 @@
// ==--==
//
// <OWNER>GPaperin</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Security;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtobindablevectoradapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtobindablevectoradapter.cs
index 7212db3e4f3..fa9e01eb236 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtobindablevectoradapter.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtobindablevectoradapter.cs
@@ -5,7 +5,7 @@
// ==--==
//
// <OWNER>GPaperin</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Security;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtobindablevectorviewadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtobindablevectorviewadapter.cs
index 80cd46fb64d..08e99c52631 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtobindablevectorviewadapter.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtobindablevectorviewadapter.cs
@@ -5,7 +5,7 @@
// ==--==
//
// <OWNER>GPaperin</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Security;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtovectoradapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtovectoradapter.cs
index 7f5e9cf83fa..a093837c5af 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtovectoradapter.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtovectoradapter.cs
@@ -5,7 +5,7 @@
// ==--==
//
// <OWNER>GPaperin</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Security;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/managedactivationfactory.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/managedactivationfactory.cs
index e676a47a5aa..dd963c54a2b 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/managedactivationfactory.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/managedactivationfactory.cs
@@ -4,9 +4,9 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
-// <OWNER>[....]</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
+// <OWNER>Microsoft</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Diagnostics.Contracts;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/maptocollectionadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/maptocollectionadapter.cs
index ecaedd87be0..c04a9a0cf63 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/maptocollectionadapter.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/maptocollectionadapter.cs
@@ -5,7 +5,7 @@
// ==--==
//
// <OWNER>GPaperin</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Security;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/maptodictionaryadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/maptodictionaryadapter.cs
index 320397249b3..8b68eca2b56 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/maptodictionaryadapter.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/maptodictionaryadapter.cs
@@ -5,7 +5,7 @@
// ==--==
//
// <OWNER>GPaperin</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Security;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/mapviewtoreadonlycollectionadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/mapviewtoreadonlycollectionadapter.cs
index d9ea83ecbe7..8854c87e36f 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/mapviewtoreadonlycollectionadapter.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/mapviewtoreadonlycollectionadapter.cs
@@ -5,7 +5,7 @@
// ==--==
//
// <OWNER>GPaperin</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Security;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectortocollectionadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectortocollectionadapter.cs
index af4674c3a0d..0443ed2d142 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectortocollectionadapter.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectortocollectionadapter.cs
@@ -5,7 +5,7 @@
// ==--==
//
// <OWNER>GPaperin</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Security;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectortolistadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectortolistadapter.cs
index edc20f2b6ba..51858b00038 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectortolistadapter.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectortolistadapter.cs
@@ -5,7 +5,7 @@
// ==--==
//
// <OWNER>GPaperin</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Security;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectorviewtoreadonlycollectionadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectorviewtoreadonlycollectionadapter.cs
index b704460e7f9..f1e95611b3a 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectorviewtoreadonlycollectionadapter.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectorviewtoreadonlycollectionadapter.cs
@@ -5,7 +5,7 @@
// ==--==
//
// <OWNER>GPaperin</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Security;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/windowsruntimemarshal.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/windowsruntimemarshal.cs
index 79d8a97c4db..15a0c70d64d 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/windowsruntimemarshal.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/windowsruntimemarshal.cs
@@ -4,9 +4,9 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
-// <OWNER>[....]</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
+// <OWNER>Microsoft</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/windowsruntimemetadata.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/windowsruntimemetadata.cs
index 137a190b607..ff320ed95cd 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/windowsruntimemetadata.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/windowsruntimemetadata.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
namespace System.Runtime.InteropServices.WindowsRuntime
{
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/winrtclassactivator.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/winrtclassactivator.cs
index 3de33410c57..0aa99ce421f 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/winrtclassactivator.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/winrtclassactivator.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Security;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/remoting/activationservices.cs b/mcs/class/referencesource/mscorlib/system/runtime/remoting/activationservices.cs
index 74b3c580444..4e57e1e55b9 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/remoting/activationservices.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/remoting/activationservices.cs
@@ -1745,7 +1745,7 @@ namespace System.Runtime.Remoting.Activation {
// Need to grow our arrays ... this will be exceedingly rare
Object[] newTypes = new Object[activationTypes.Length * 2];
Object[] newAttr = new Object[activationAttributes.Length * 2];
- Contract.Assert(newAttr.Length == newTypes.Length,"These should be in [....]!");
+ Contract.Assert(newAttr.Length == newTypes.Length,"These should be in sync!");
Array.Copy(activationTypes, newTypes, activationTypes.Length);
Array.Copy(activationAttributes, newAttr, activationAttributes.Length);
activationTypes = newTypes;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/remoting/channelservices.cs b/mcs/class/referencesource/mscorlib/system/runtime/remoting/channelservices.cs
index 0b17b247563..cc38933cfe8 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/remoting/channelservices.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/remoting/channelservices.cs
@@ -6,7 +6,7 @@ using System.Diagnostics.Contracts;
// ==--==
//* File: Channel.cs
//*
-//* <EMAIL>Author: Tarun Anand ([....])</EMAIL>
+//* <EMAIL>Author: Tarun Anand (Microsoft)</EMAIL>
//*
//* Purpose: Defines the general purpose remoting proxy
//*
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/remoting/channelsinkstacks.cs b/mcs/class/referencesource/mscorlib/system/runtime/remoting/channelsinkstacks.cs
index 20709a5bd9c..95d3b542f76 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/remoting/channelsinkstacks.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/remoting/channelsinkstacks.cs
@@ -453,7 +453,7 @@ namespace System.Runtime.Remoting.Channels {
} // ServerChannelSinkStack
- // helper class for transforming [....] message parameter lists into its
+ // helper class for transforming sync message parameter lists into its
// async counterparts
internal static class AsyncMessageHelper
{
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/remoting/clientsponsor.cs b/mcs/class/referencesource/mscorlib/system/runtime/remoting/clientsponsor.cs
index 07758b1775b..d20b7b9ef9c 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/remoting/clientsponsor.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/remoting/clientsponsor.cs
@@ -7,9 +7,9 @@
//
// File: ClientSponsor.cs
//
-// Contents: Agent for keeping Server Object's lifetime in [....] with a client's lifetime
+// Contents: Agent for keeping Server Object's lifetime in sync with a client's lifetime
//
-// History: 8/9/00 <EMAIL>[....]</EMAIL> Created
+// History: 8/9/00 <EMAIL>Microsoft</EMAIL> Created
//
//+----------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/remoting/configuration.cs b/mcs/class/referencesource/mscorlib/system/runtime/remoting/configuration.cs
index 5eb0831302c..dc299d0898e 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/remoting/configuration.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/remoting/configuration.cs
@@ -844,7 +844,7 @@ namespace System.Runtime.Remoting {
lock (Info)
{
// We make an entry in our config tables so as to keep
- // both the file-based and programmatic config in [....].
+ // both the file-based and programmatic config in sync.
Info.AddWellKnownEntry(entry);
}
} // RegisterWellKnownServiceType
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/remoting/context.cs b/mcs/class/referencesource/mscorlib/system/runtime/remoting/context.cs
index 91d0bbecfd1..7ee42e4f6ac 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/remoting/context.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/remoting/context.cs
@@ -436,7 +436,7 @@ namespace System.Runtime.Remoting.Contexts {
}
iSink++;
}
- // now check if we ----d and set appropriately
+ // now check if we raced and set appropriately
lock (this)
{
if (_clientContextChain==null)
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/remoting/crossappdomainchannel.cs b/mcs/class/referencesource/mscorlib/system/runtime/remoting/crossappdomainchannel.cs
index 010996b9ea8..a6c628de3dd 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/remoting/crossappdomainchannel.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/remoting/crossappdomainchannel.cs
@@ -284,7 +284,7 @@ namespace System.Runtime.Remoting.Channels {
// warning in CrossAppDomainSink::.ctor above
//
lock(staticSyncObject) {
- // Note: keep this in [....] with DomainUnloaded below
+ // Note: keep this in sync with DomainUnloaded below
int key = xadData.DomainID;
if (_sinks == null)
{
@@ -321,7 +321,7 @@ namespace System.Runtime.Remoting.Channels {
{
return;
}
- // Note: keep this in [....] with FindOrCreateSink
+ // Note: keep this in sync with FindOrCreateSink
int i = 0;
int remove = -1;
while (_sinks[i] != null)
@@ -476,7 +476,7 @@ namespace System.Runtime.Remoting.Channels {
[System.Security.SecurityCritical] // auto-generated
public virtual IMessage SyncProcessMessage(IMessage reqMsg)
{
- Message.DebugOut("\n::::::::::::::::::::::::: CrossAppDomain Channel: [....] call starting");
+ Message.DebugOut("\n::::::::::::::::::::::::: CrossAppDomain Channel: Sync call starting");
IMessage errMsg = InternalSink.ValidateMessage(reqMsg);
if (errMsg != null)
{
@@ -520,7 +520,7 @@ namespace System.Runtime.Remoting.Channels {
// will terminate the security stackwalk caused when
// serialization checks for the correct permissions at the
// remoting stack frame so the check won't continue on to
- // the user and fail. <EMAIL>[from [....]]</EMAIL>
+ // the user and fail. <EMAIL>[from Microsoft]</EMAIL>
// We will hold off from doing this for x-process channels
// until the big picture of distributed security is finalized.
@@ -560,7 +560,7 @@ namespace System.Runtime.Remoting.Channels {
if (responseBytes != null) {
retStm = new MemoryStream(responseBytes);
- Message.DebugOut("::::::::::::::::::::::::::: CrossAppDomain Channel: [....] call returning!!\n");
+ Message.DebugOut("::::::::::::::::::::::::::: CrossAppDomain Channel: Sync call returning!!\n");
//*********************** DESERIALIZE RET-MSG **************
desRetMsg = CrossAppDomainSerializer.DeserializeMessage(retStm, reqMsg as IMethodCallMessage);
}
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/remoting/crosscontextchannel.cs b/mcs/class/referencesource/mscorlib/system/runtime/remoting/crosscontextchannel.cs
index 154fc9839c5..52aaf451e8f 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/remoting/crosscontextchannel.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/remoting/crosscontextchannel.cs
@@ -133,7 +133,7 @@ namespace System.Runtime.Remoting.Channels {
try
{
- Message.DebugOut("\n::::::::::::::::::::::::: CrossContext Channel: [....] call starting");
+ Message.DebugOut("\n::::::::::::::::::::::::: CrossContext Channel: Sync call starting");
IMessage errMsg = ValidateMessage(reqMsg);
if (errMsg != null)
{
@@ -163,7 +163,7 @@ namespace System.Runtime.Remoting.Channels {
}
}
- Message.DebugOut("::::::::::::::::::::::::::: CrossContext Channel: [....] call returning!!\n");
+ Message.DebugOut("::::::::::::::::::::::::::: CrossContext Channel: Sync call returning!!\n");
return replyMsg;
}
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/remoting/identityholder.cs b/mcs/class/referencesource/mscorlib/system/runtime/remoting/identityholder.cs
index 3e3650d85d0..6959edaf974 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/remoting/identityholder.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/remoting/identityholder.cs
@@ -449,7 +449,7 @@ namespace System.Runtime.Remoting {
if (takeAndRelease)
rwlock.AcquireWriterLock(INFINITE);
- // SetIdentity will give the correct Id if we ----d
+ // SetIdentity will give the correct Id if we raced
// between the ResolveIdentity call above and now.
// (we are unmarshaling, and the server should guarantee
// that the uri is unique, so we will use an existing identity
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/remoting/lease.cs b/mcs/class/referencesource/mscorlib/system/runtime/remoting/lease.cs
index a0884ce4e52..cafb08d7099 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/remoting/lease.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/remoting/lease.cs
@@ -10,7 +10,7 @@
//
// Contents: Lease class
//
-// History: 1/5/00 <EMAIL>[....]</EMAIL> Created
+// History: 1/5/00 <EMAIL>Microsoft</EMAIL> Created
//
//+----------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/remoting/leasemanager.cs b/mcs/class/referencesource/mscorlib/system/runtime/remoting/leasemanager.cs
index 464f27515f1..8acbeb04933 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/remoting/leasemanager.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/remoting/leasemanager.cs
@@ -10,7 +10,7 @@
//
// Contents: Administers the leases in an appdomain
//
-// History: 1/5/00 <EMAIL>[....]</EMAIL> Created
+// History: 1/5/00 <EMAIL>Microsoft</EMAIL> Created
//
//+----------------------------------------------------------------------------
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/remoting/message.cs b/mcs/class/referencesource/mscorlib/system/runtime/remoting/message.cs
index 4cba7cf9b12..dda57505bcc 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/remoting/message.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/remoting/message.cs
@@ -48,7 +48,7 @@ namespace System.Runtime.Remoting.Messaging {
{
// *** NOTE ***
- // Keep these in [....] with the flags in Message.h
+ // Keep these in sync with the flags in Message.h
// flags
internal const int Sync = 0; // Synchronous call
internal const int BeginAsync = 1; // Async Begin call
@@ -2018,7 +2018,7 @@ namespace System.Runtime.Remoting.Messaging {
}
return null;
}
- [System.Security.SecuritySafeCritical] // TODO: review - implements transparent public method
+ [System.Security.SecuritySafeCritical] //
set
{
if (ContainsSpecialKey(key))
@@ -5502,7 +5502,7 @@ namespace System.Runtime.Remoting.Messaging {
//
// Helper methods for expanding and contracting argument lists
- // when translating from async methods to [....] methods and back.
+ // when translating from async methods to sync methods and back.
//
internal static Object[] ExpandAsyncEndArgsToSyncArgs(RemotingMethodCachedData syncMethod,
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/remoting/objref.cs b/mcs/class/referencesource/mscorlib/system/runtime/remoting/objref.cs
index a822b3afe3d..a88d0220a0d 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/remoting/objref.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/remoting/objref.cs
@@ -642,21 +642,21 @@ namespace System.Runtime.Remoting {
String urlToBash = bashInfo[0];
String replacementUrl = bashInfo[1];
- // Copy channel info and go [....] urls.
+ // Copy channel info and go Microsoft urls.
ChannelInfo newChInfo = new ChannelInfo();
newChInfo.ChannelData = new Object[oldChannelData.Length];
for (int co = 0; co < oldChannelData.Length; co++)
{
newChInfo.ChannelData[co] = oldChannelData[co];
- // see if this is one of the ones that we need to [....]
+ // see if this is one of the ones that we need to Microsoft
ChannelDataStore channelDataStore = newChInfo.ChannelData[co] as ChannelDataStore;
if (channelDataStore != null)
{
String[] urls = channelDataStore.ChannelUris;
if ((urls != null) && (urls.Length == 1) && urls[0].Equals(urlToBash))
{
- // We want to [....] just the url, so we do a shallow copy
+ // We want to Microsoft just the url, so we do a shallow copy
// and replace the url array with the replacementUrl.
ChannelDataStore newChannelDataStore = channelDataStore.InternalShallowCopy();
newChannelDataStore.ChannelUris = new String[1];
@@ -1023,7 +1023,7 @@ namespace System.Runtime.Remoting {
Object[] channelData = chan.ChannelData;
int channelDataLength = channelData.Length;
Object[] newChannelData = new Object[channelDataLength];
- // Clone the data so that we dont [....] the current appdomain data which is stored
+ // Clone the data so that we dont Microsoft the current appdomain data which is stored
// as a static
Array.Copy(channelData, newChannelData, channelDataLength);
for (int i = 0; i < channelDataLength; i++)
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/remoting/realproxy.cs b/mcs/class/referencesource/mscorlib/system/runtime/remoting/realproxy.cs
index b58d140e276..c574c932796 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/remoting/realproxy.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/remoting/realproxy.cs
@@ -35,7 +35,7 @@ namespace System.Runtime.Remoting.Proxies {
using System.Diagnostics.Contracts;
- // NOTE: Keep this in [....] with unmanaged enum definition in Remoting.h
+ // NOTE: Keep this in sync with unmanaged enum definition in Remoting.h
[Serializable]
internal enum CallType
{
@@ -52,7 +52,7 @@ namespace System.Runtime.Remoting.Proxies {
Initialized = 0x2
};
- // NOTE: Keep this in [....] with unmanaged struct "messageData" in Remoting.h
+ // NOTE: Keep this in sync with unmanaged struct "messageData" in Remoting.h
[System.Runtime.InteropServices.StructLayout(LayoutKind.Sequential)]
internal struct MessageData
{
@@ -742,7 +742,7 @@ namespace System.Runtime.Remoting.Proxies {
// but the constructormessage hasn't been setup.
// so let us just bail out..
// this is currently used by ServicedComponent's for cross appdomain
- // pooling: <EMAIL>[....]</EMAIL>
+ // pooling: <EMAIL>Microsoft</EMAIL>
//
ctorMsg = new ConstructorCallMessage(null, null, null, (RuntimeType)GetProxiedType());
// Set the constructor frame info in the CCM
@@ -834,7 +834,7 @@ namespace System.Runtime.Remoting.Proxies {
{
// This was a begin-async on a non-Remoting Proxy. For V-1 they
- // cannot support Async and end up doing a [....] call. We need
+ // cannot support Async and end up doing a Sync call. We need
// to fill up here to make the call look like async to
// the caller.
// Create the async result to return
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/remoting/remotingattributes.cs b/mcs/class/referencesource/mscorlib/system/runtime/remoting/remotingattributes.cs
index 244006ea4d7..a11ffd983c5 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/remoting/remotingattributes.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/remoting/remotingattributes.cs
@@ -258,7 +258,7 @@ namespace System.Runtime.Remoting.Metadata
// parameter maps
// NOTE: these fields are all initialized at the same time however access to
// the internal property of each field is locked only on that specific field
- // having been initialized. - [....]
+ // having been initialized. - Microsoft
private int[] _inRefArgMap = null; // parameter map of input and ref parameters
private int[] _outRefArgMap = null; // parameter map of out and ref parameters (exactly all byref parameters)
private int[] _outOnlyArgMap = null; // parameter map of only output parameters
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/remoting/remotingproxy.cs b/mcs/class/referencesource/mscorlib/system/runtime/remoting/remotingproxy.cs
index c91d228974d..3898b45afc6 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/remoting/remotingproxy.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/remoting/remotingproxy.cs
@@ -233,7 +233,7 @@ namespace System.Runtime.Remoting.Proxies {
// This is called for all remoted calls on a TP except Ctors
- // The method called may be [....], Async or OneWay(special case of Async)
+ // The method called may be Sync, Async or OneWay(special case of Async)
// In the Async case we come here for both BeginInvoke & EndInvoke
internal virtual IMessage InternalInvoke(
IMethodCallMessage reqMcmMsg, bool useDispatchMessage, int callType)
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/remoting/remotingservices.cs b/mcs/class/referencesource/mscorlib/system/runtime/remoting/remotingservices.cs
index 13b799dbbfe..679d4eff45a 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/remoting/remotingservices.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/remoting/remotingservices.cs
@@ -6,7 +6,7 @@
//
// File: RemotingServices.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Author(s): <EMAIL>Gopal Kakivaya (GopalK)</EMAIL>
//
@@ -616,7 +616,7 @@ namespace System.Runtime.Remoting {
{
int channelDataLength = channelData.Length;
Object[] newChannelData = new Object[channelDataLength];
- // Clone the data so that we dont [....] the current appdomain data which is stored
+ // Clone the data so that we dont Microsoft the current appdomain data which is stored
// as a static
Array.Copy(channelData, newChannelData, channelDataLength);
for (int i = 0; i < channelDataLength; i++)
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/remoting/soapinteroptypes.cs b/mcs/class/referencesource/mscorlib/system/runtime/remoting/soapinteroptypes.cs
index 07d820acf83..21de0d6cd08 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/remoting/soapinteroptypes.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/remoting/soapinteroptypes.cs
@@ -231,7 +231,7 @@ namespace System.Runtime.Remoting.Metadata.W3cXsd2001
{
// Convert from ISO/xsd TimeDuration to urt TimeSpan
// The form of the time duration is PxxYxxDTxxHxxMxx.xxxS or PxxYxxDTxxHxxMxxS
- // Keep in [....] with Message.cs
+ // Keep in sync with Message.cs
public static String XsdType
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/remoting/synchronizeddispatch.cs b/mcs/class/referencesource/mscorlib/system/runtime/remoting/synchronizeddispatch.cs
index dc03e3ee70c..7ade238a044 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/remoting/synchronizeddispatch.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/remoting/synchronizeddispatch.cs
@@ -271,7 +271,7 @@ namespace System.Runtime.Remoting.Contexts {
/*
* Call back function -- executed for each work item that
* was enqueued. This is invoked by a thread-pool thread for
- * async work items and the caller thread for [....] items.
+ * async work items and the caller thread for sync items.
*/
private void DispatcherCallBack(Object stateIgnored, bool ignored)
{
@@ -356,7 +356,7 @@ namespace System.Runtime.Remoting.Contexts {
// See if we found a non-signaled work item at the head.
if (bNotify)
{
- // In both [....] and async cases we just hand off the _locked state to
+ // In both sync and async cases we just hand off the _locked state to
// the next thread which will execute.
if (nextWork.IsAsync())
{
@@ -366,7 +366,7 @@ namespace System.Runtime.Remoting.Contexts {
}
else
{
- // [....]-WorkItem: notify the waiting [....]-thread.
+ // Sync-WorkItem: notify the waiting sync-thread.
lock(nextWork)
{
Monitor.Pulse(nextWork);
@@ -419,7 +419,7 @@ namespace System.Runtime.Remoting.Contexts {
}
else
{
- // [....] work is queued only if there are other items
+ // Sync work is queued only if there are other items
// already in the queue.
lock(work)
{
@@ -434,7 +434,7 @@ namespace System.Runtime.Remoting.Contexts {
}
else
{
- //DBGConsole.WriteLine(Thread.CurrentThread.GetHashCode()+"] ~~~ ENQUEUE [....]!" + (work.IsDummy()?" DUMMY ":" REAL ") + work._thread);
+ //DBGConsole.WriteLine(Thread.CurrentThread.GetHashCode()+"] ~~~ ENQUEUE Sync!" + (work.IsDummy()?" DUMMY ":" REAL ") + work._thread);
bQueued = true;
work.SetWaiting();
_workItemQueue.Enqueue(work);
@@ -514,7 +514,7 @@ namespace System.Runtime.Remoting.Contexts {
// This returns TRUE only if it is a non-reEntrant context
// AND
// (the LCID of the reqMsg matches that of
- // the top level [....] call lcid associated with the context.
+ // the top level sync call lcid associated with the context.
// OR
// it matches one of the async call out lcids)
@@ -668,7 +668,7 @@ namespace System.Runtime.Remoting.Contexts {
//*************************************** WORK ITEM ********************************//
/*
- * A work item holds the info about a call to [....] or
+ * A work item holds the info about a call to Sync or
* Async-ProcessMessage.
*/
internal class WorkItem
@@ -681,9 +681,9 @@ namespace System.Runtime.Remoting.Contexts {
internal int _flags;
internal IMessage _reqMsg;
internal IMessageSink _nextSink;
- // ReplySink will be null for an [....] work item.
+ // ReplySink will be null for an sync work item.
internal IMessageSink _replySink;
- // ReplyMsg is set once the [....] call is completed
+ // ReplyMsg is set once the sync call is completed
internal IMessage _replyMsg;
// Context in which the work should execute.
@@ -778,14 +778,14 @@ namespace System.Runtime.Remoting.Contexts {
}
/*
- * Execute is called to complete a work item ([....] or async).
+ * Execute is called to complete a work item (sync or async).
* Execute assumes that the context is set correctly and the lock
* is taken (i.e. it makes no policy decisions)
*
* It is called from the following 3 points:
* 1. thread pool thread executing the callback for an async item
- * 2. calling thread executing the callback for a queued [....] item
- * 3. calling thread directly calling Execute for a non-queued [....] item
+ * 2. calling thread executing the callback for a queued sync item
+ * 3. calling thread directly calling Execute for a non-queued sync item
*/
[System.Security.SecurityCritical] // auto-generated
internal virtual void Execute()
@@ -842,20 +842,20 @@ namespace System.Runtime.Remoting.Contexts {
// Notify the property that we are leaving
_property.HandleThreadExit();
- //DBGConsole.WriteLine(Thread.CurrentThread.GetHashCode()+"] R: [....] call-out");
+ //DBGConsole.WriteLine(Thread.CurrentThread.GetHashCode()+"] R: Sync call-out");
replyMsg = _nextSink.SyncProcessMessage(reqMsg);
// We will just block till we are given permission to re-enter
// Notify the property that we wish to re-enter the domain.
// This will block the thread here if someone is in the domain.
- //DBGConsole.WriteLine(Thread.CurrentThread.GetHashCode()+"] R: [....] call-out returned, waiting for lock");
+ //DBGConsole.WriteLine(Thread.CurrentThread.GetHashCode()+"] R: Sync call-out returned, waiting for lock");
_property.HandleThreadReEntry();
Contract.Assert(_property.Locked == true,"_property.Locked == true");
}
else
{
// In the non-reentrant case we are just a pass-through sink
- //DBGConsole.WriteLine(Thread.CurrentThread.GetHashCode()+"] NR: [....] call-out (pass through)");
+ //DBGConsole.WriteLine(Thread.CurrentThread.GetHashCode()+"] NR: Sync call-out (pass through)");
// We should mark the domain with our LCID so that call-backs are allowed to enter..
LogicalCallContext cctx =
(LogicalCallContext) reqMsg.Properties[Message.CallContextKey];
@@ -868,7 +868,7 @@ namespace System.Runtime.Remoting.Contexts {
// start of each Invoke. As an optimization we now do it
// here in a delayed fashion... since currently only
// Synchronization needs it
- // Note that for [....]-calls we would just inherit an LCID
+ // Note that for Sync-calls we would just inherit an LCID
// if the call has one, if not we create one. However for
// async calls we always generate a new LCID.
lcid = Identity.GetNewLogicalCallID();
@@ -896,7 +896,7 @@ namespace System.Runtime.Remoting.Contexts {
{
_property.SyncCallOutLCID = null;
- // The [....] callOut is done, we do not need the lcid
+ // The sync callOut is done, we do not need the lcid
// that was associated with the call any more.
// (clear it only if we added one to the reqMsg)
if (bClear)
@@ -914,7 +914,7 @@ namespace System.Runtime.Remoting.Contexts {
}
}
- //DBGConsole.WriteLine(Thread.CurrentThread.GetHashCode()+"] NR: [....] call-out returned");
+ //DBGConsole.WriteLine(Thread.CurrentThread.GetHashCode()+"] NR: Sync call-out returned");
}
return replyMsg;
}
@@ -952,7 +952,7 @@ namespace System.Runtime.Remoting.Contexts {
Contract.Assert(
_property.SyncCallOutLCID == null,
- "Cannot handle async call outs when already in a top-level [....] call out");
+ "Cannot handle async call outs when already in a top-level sync call out");
//DBGConsole.WriteLine(Thread.CurrentThread.GetHashCode()+"] NR: Async CallOut: adding to lcidList: " + lcid);
_property.AsyncCallOutLCIDList.Add(lcid);
}
@@ -1012,7 +1012,7 @@ namespace System.Runtime.Remoting.Contexts {
public virtual IMessage SyncProcessMessage(IMessage reqMsg)
{
- // We handle this as a regular new [....] workItem
+ // We handle this as a regular new Sync workItem
// 1. Create a work item
WorkItem work = new WorkItem(reqMsg,
_nextSink,
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/remoting/urlattribute.cs b/mcs/class/referencesource/mscorlib/system/runtime/remoting/urlattribute.cs
index 37f9d0f7a4d..d900c52225d 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/remoting/urlattribute.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/remoting/urlattribute.cs
@@ -7,12 +7,12 @@
**
** File: UrlAttribute.cs
**
-** <EMAIL>Author: Tarun Anand ([....])</EMAIL>
+** <EMAIL>Author: Tarun Anand (Microsoft)</EMAIL>
**
** Purpose: Defines an attribute which can be used at the callsite to
** specify the URL at which the activation will happen.
**
-** Date: [....] 30, 2000
+** Date: Microsoft 30, 2000
**
===========================================================*/
namespace System.Runtime.Remoting.Activation {
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/serialization/formatters/soapfault.cs b/mcs/class/referencesource/mscorlib/system/runtime/serialization/formatters/soapfault.cs
index d3ef1e362b8..8fe12ccefc0 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/serialization/formatters/soapfault.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/serialization/formatters/soapfault.cs
@@ -7,7 +7,7 @@
**
** Class: SoapFault
**
- ** <EMAIL>Author: Peter de Jong ([....])</EMAIL>
+ ** <EMAIL>Author: Peter de Jong (Microsoft)</EMAIL>
**
** Purpose: Specifies information for a Soap Fault
**
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/serialization/formatterservices.cs b/mcs/class/referencesource/mscorlib/system/runtime/serialization/formatterservices.cs
index ded0c4bfb71..649231c2453 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/serialization/formatterservices.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/serialization/formatterservices.cs
@@ -18,6 +18,7 @@ namespace System.Runtime.Serialization {
using System;
using System.Reflection;
using System.Collections;
+ using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Security;
using System.Security.Permissions;
@@ -34,28 +35,13 @@ namespace System.Runtime.Serialization {
[System.Runtime.InteropServices.ComVisible(true)]
public static class FormatterServices {
#if FEATURE_SERIALIZATION
- internal static Dictionary<MemberHolder, MemberInfo[]> m_MemberInfoTable = new Dictionary<MemberHolder, MemberInfo[]>(32);
+ internal static ConcurrentDictionary<MemberHolder, MemberInfo[]> m_MemberInfoTable = new ConcurrentDictionary<MemberHolder, MemberInfo[]>();
[System.Security.SecurityCritical]
private static bool unsafeTypeForwardersIsEnabled = false;
[System.Security.SecurityCritical]
private static volatile bool unsafeTypeForwardersIsEnabledInitialized = false;
- private static Object s_FormatterServicesSyncObject = null;
-
- private static Object formatterServicesSyncObject
- {
- get
- {
- if (s_FormatterServicesSyncObject == null)
- {
- Object o = new Object();
- Interlocked.CompareExchange<Object>(ref s_FormatterServicesSyncObject, o, null);
- }
- return s_FormatterServicesSyncObject;
- }
- }
-
[SecuritySafeCritical]
static FormatterServices()
{
@@ -197,9 +183,7 @@ namespace System.Runtime.Serialization {
// non-transient, non-static fields. If we are cloning, include the transient fields as well since
// we know that we're going to live inside of the same context.
[System.Security.SecurityCritical] // auto-generated_required
- public static MemberInfo[] GetSerializableMembers(Type type, StreamingContext context) {
- MemberInfo[] members;
-
+ public static MemberInfo[] GetSerializableMembers(Type type, StreamingContext context) {
if ((object)type==null) {
throw new ArgumentNullException("type");
}
@@ -210,25 +194,13 @@ namespace System.Runtime.Serialization {
}
MemberHolder mh = new MemberHolder(type, context);
-
- //If we've already gathered the members for this type, just return them.
- if (m_MemberInfoTable.ContainsKey(mh)) {
- return m_MemberInfoTable[mh];
- }
-
- lock (formatterServicesSyncObject) {
- //If we've already gathered the members for this type, just return them.
- if (m_MemberInfoTable.ContainsKey(mh)) {
- return m_MemberInfoTable[mh];
- }
-
- members = InternalGetSerializableMembers((RuntimeType)type);
- m_MemberInfoTable[mh] = members;
- }
-
+ //If we've already gathered the members for this type, just return them.
+ MemberInfo[] members = m_MemberInfoTable.GetOrAdd(mh,
+ _ => InternalGetSerializableMembers((RuntimeType)type));
+
return members;
- }
+ }
static readonly Type[] advancedTypes = new Type[]{
typeof(System.DelegateSerializationHolder),
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/serialization/safeserializationmanager.cs b/mcs/class/referencesource/mscorlib/system/runtime/serialization/safeserializationmanager.cs
index 8dbe02ab77b..5f1b03000b4 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/serialization/safeserializationmanager.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/serialization/safeserializationmanager.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Collections;
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/serialization/streamingcontext.cs b/mcs/class/referencesource/mscorlib/system/runtime/serialization/streamingcontext.cs
index 0f223e74b22..978d9ce78c6 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/serialization/streamingcontext.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/serialization/streamingcontext.cs
@@ -56,7 +56,7 @@ namespace System.Runtime.Serialization {
}
// **********************************************************
- // Keep these in [....] with the version in vm\runtimehandles.h
+ // Keep these in sync with the version in vm\runtimehandles.h
// **********************************************************
[Serializable]
[Flags]
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/versioning/binarycompatibility.cs b/mcs/class/referencesource/mscorlib/system/runtime/versioning/binarycompatibility.cs
index 441988f3058..e9f6817ab48 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/versioning/binarycompatibility.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/versioning/binarycompatibility.cs
@@ -7,7 +7,7 @@
**
** Class: BinaryCompatibility
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: This class is used to determine which binary compatibility
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/versioning/multitargetinghelpers.cs b/mcs/class/referencesource/mscorlib/system/runtime/versioning/multitargetinghelpers.cs
index 51f68edb96e..4d6f0b3ffb4 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/versioning/multitargetinghelpers.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/versioning/multitargetinghelpers.cs
@@ -7,7 +7,7 @@
**
** Class: MultitargetingHelpers
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Central repository for helpers supporting
diff --git a/mcs/class/referencesource/mscorlib/system/runtimehandles.cs b/mcs/class/referencesource/mscorlib/system/runtimehandles.cs
index 05cecb7b10e..5d5818e306f 100644
--- a/mcs/class/referencesource/mscorlib/system/runtimehandles.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtimehandles.cs
@@ -2149,7 +2149,7 @@ namespace System
#region Private Data Members
//
- // Keep the layout in [....] with SignatureNative in the VM
+ // Keep the layout in sync with SignatureNative in the VM
//
internal RuntimeType[] m_arguments;
internal RuntimeType m_declaringType;
diff --git a/mcs/class/referencesource/mscorlib/system/security/accesscontrol/acl.cs b/mcs/class/referencesource/mscorlib/system/security/accesscontrol/acl.cs
index 674cdd48519..a32e35b6cc5 100644
--- a/mcs/class/referencesource/mscorlib/system/security/accesscontrol/acl.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/accesscontrol/acl.cs
@@ -1787,7 +1787,7 @@ namespace System.Security.AccessControl
if ( ace == null )
{
//
- // <[....]-9/19/2004> Afraid to yank this statement now
+ // <Microsoft-9/19/2004> Afraid to yank this statement now
// for fear of destabilization, so adding an assert instead
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/accesscontrol/securitydescriptor.cs b/mcs/class/referencesource/mscorlib/system/security/accesscontrol/securitydescriptor.cs
index 099ebdec156..cf75b4a7dba 100644
--- a/mcs/class/referencesource/mscorlib/system/security/accesscontrol/securitydescriptor.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/accesscontrol/securitydescriptor.cs
@@ -913,7 +913,7 @@ namespace System.Security.AccessControl
ControlFlags actualFlags = flags | ControlFlags.DiscretionaryAclPresent;
//
- // Keep SACL and the flag bit in [....].
+ // Keep SACL and the flag bit in sync.
//
if (systemAcl == null)
@@ -1263,7 +1263,7 @@ namespace System.Security.AccessControl
//
// These two add/remove method must be called with great care (and thus it is internal)
- // The caller is responsible for keeping the SaclPresent and DaclPresent bits in [....]
+ // The caller is responsible for keeping the SaclPresent and DaclPresent bits in sync
// with the actual SACL and DACL.
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/attributes.cs b/mcs/class/referencesource/mscorlib/system/security/attributes.cs
index 090998e0a51..5b92f289cf1 100644
--- a/mcs/class/referencesource/mscorlib/system/security/attributes.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/attributes.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System.Runtime.InteropServices;
namespace System.Security
diff --git a/mcs/class/referencesource/mscorlib/system/security/builtinpermissionsets.cs b/mcs/class/referencesource/mscorlib/system/security/builtinpermissionsets.cs
index be1d10fdce6..b3f65637603 100644
--- a/mcs/class/referencesource/mscorlib/system/security/builtinpermissionsets.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/builtinpermissionsets.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
using System;
diff --git a/mcs/class/referencesource/mscorlib/system/security/claims/Claim.cs b/mcs/class/referencesource/mscorlib/system/security/claims/Claim.cs
index decc52ecfa2..9a49bc497d4 100644
--- a/mcs/class/referencesource/mscorlib/system/security/claims/Claim.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/claims/Claim.cs
@@ -7,7 +7,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/claims/ClaimsIdentity.cs b/mcs/class/referencesource/mscorlib/system/security/claims/ClaimsIdentity.cs
index 68af0d6ef3f..115a5b663b0 100644
--- a/mcs/class/referencesource/mscorlib/system/security/claims/ClaimsIdentity.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/claims/ClaimsIdentity.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/claims/ClaimsPrincipal.cs b/mcs/class/referencesource/mscorlib/system/security/claims/ClaimsPrincipal.cs
index a8b807d69ec..3512df9da93 100644
--- a/mcs/class/referencesource/mscorlib/system/security/claims/ClaimsPrincipal.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/claims/ClaimsPrincipal.cs
@@ -7,7 +7,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/claims/RoleClaimProvider.cs b/mcs/class/referencesource/mscorlib/system/security/claims/RoleClaimProvider.cs
index 3a061e99c19..3664f914222 100644
--- a/mcs/class/referencesource/mscorlib/system/security/claims/RoleClaimProvider.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/claims/RoleClaimProvider.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
// RoleClaimProvider.cs
diff --git a/mcs/class/referencesource/mscorlib/system/security/codeaccesspermission.cs b/mcs/class/referencesource/mscorlib/system/security/codeaccesspermission.cs
index 98fb570b48e..e1d1bb12ce3 100644
--- a/mcs/class/referencesource/mscorlib/system/security/codeaccesspermission.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/codeaccesspermission.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
namespace System.Security
{
using System.IO;
diff --git a/mcs/class/referencesource/mscorlib/system/security/codeaccesssecurityengine.cs b/mcs/class/referencesource/mscorlib/system/security/codeaccesssecurityengine.cs
index 45b3eccba21..804cc50b1af 100644
--- a/mcs/class/referencesource/mscorlib/system/security/codeaccesssecurityengine.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/codeaccesssecurityengine.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security {
@@ -20,7 +20,7 @@ namespace System.Security {
using System.Diagnostics.Contracts;
// Used in DemandInternal, to remember the result of previous demands
- // KEEP IN [....] WITH DEFINITIONS IN SECURITYPOLICY.H
+ // KEEP IN SYNC WITH DEFINITIONS IN SECURITYPOLICY.H
[Serializable]
internal enum PermissionType
{
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/asymmetricalgorithm.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/asymmetricalgorithm.cs
index 175a6386041..45cdaa749e6 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/asymmetricalgorithm.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/asymmetricalgorithm.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/asymmetrickeyexchangedeformatter.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/asymmetrickeyexchangedeformatter.cs
index f9272ee23e6..1492e46ba29 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/asymmetrickeyexchangedeformatter.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/asymmetrickeyexchangedeformatter.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/asymmetrickeyexchangeformatter.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/asymmetrickeyexchangeformatter.cs
index 1da8d9b89a3..5dca811ed20 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/asymmetrickeyexchangeformatter.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/asymmetrickeyexchangeformatter.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/asymmetricsignaturedeformatter.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/asymmetricsignaturedeformatter.cs
index 232e711da08..df836d2b039 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/asymmetricsignaturedeformatter.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/asymmetricsignaturedeformatter.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/asymmetricsignatureformatter.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/asymmetricsignatureformatter.cs
index 6911141f48a..37f1d65f64c 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/asymmetricsignatureformatter.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/asymmetricsignatureformatter.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/base64transforms.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/base64transforms.cs
index 91ffbd4f42b..05efe3c3e4a 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/base64transforms.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/base64transforms.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/crypto.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/crypto.cs
index 8315aefb43c..0e9cc0fa86d 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/crypto.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/crypto.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
@@ -20,7 +20,7 @@ namespace System.Security.Cryptography {
// and ciphertext-stealing (CTS). Not all implementations will support all modes.
[Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
- public enum CipherMode { // Please keep in [....] with wincrypt.h
+ public enum CipherMode { // Please keep in sync with wincrypt.h
CBC = 1,
ECB = 2,
OFB = 3,
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/cryptoapitransform.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/cryptoapitransform.cs
index ecbc4c4141e..89ddba5b8f9 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/cryptoapitransform.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/cryptoapitransform.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/cryptoconfig.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/cryptoconfig.cs
index 667369d2dd6..2b790de29e0 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/cryptoconfig.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/cryptoconfig.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/cryptostream.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/cryptostream.cs
index efbe8b77384..71cd2fd18ea 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/cryptostream.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/cryptostream.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/derivebytes.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/derivebytes.cs
index c7ed830c8da..ee2265e727b 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/derivebytes.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/derivebytes.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/des.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/des.cs
index 1ee88690879..56d89ed2ee4 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/des.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/des.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/descryptoserviceprovider.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/descryptoserviceprovider.cs
index 43e779d8731..bb01d69877b 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/descryptoserviceprovider.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/descryptoserviceprovider.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/dsa.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/dsa.cs
index af2db6e5303..53a024a9757 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/dsa.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/dsa.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/dsacryptoserviceprovider.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/dsacryptoserviceprovider.cs
index df23a26af10..cf1ab5fc2b2 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/dsacryptoserviceprovider.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/dsacryptoserviceprovider.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/dsasignaturedeformatter.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/dsasignaturedeformatter.cs
index 3f8d457d9df..bf57d241cac 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/dsasignaturedeformatter.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/dsasignaturedeformatter.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/dsasignatureformatter.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/dsasignatureformatter.cs
index 8bc61b1c355..260113a9e12 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/dsasignatureformatter.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/dsasignatureformatter.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/hashalgorithm.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/hashalgorithm.cs
index b7efe1961df..479a0b68d79 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/hashalgorithm.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/hashalgorithm.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/hmac.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/hmac.cs
index 6c00533d3e5..32b61120db2 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/hmac.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/hmac.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/hmacmd5.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/hmacmd5.cs
index da536c01f03..0a3347113d7 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/hmacmd5.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/hmacmd5.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/hmacripemd160.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/hmacripemd160.cs
index 991d877ff7e..8b2aabebda8 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/hmacripemd160.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/hmacripemd160.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/hmacsha1.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/hmacsha1.cs
index 1d0b4e75d6b..f31252e2745 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/hmacsha1.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/hmacsha1.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/hmacsha256.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/hmacsha256.cs
index 72e2b56e67d..ef7986240e3 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/hmacsha256.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/hmacsha256.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/hmacsha384.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/hmacsha384.cs
index 1e7418a89f1..e1a973c1c3d 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/hmacsha384.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/hmacsha384.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/hmacsha512.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/hmacsha512.cs
index e8af775a36c..f252b7f53b4 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/hmacsha512.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/hmacsha512.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/icspasymmetricalgorithm.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/icspasymmetricalgorithm.cs
index f726d36a05f..d5b501ce558 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/icspasymmetricalgorithm.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/icspasymmetricalgorithm.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/keyedhashalgorithm.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/keyedhashalgorithm.cs
index 0cb2075cc53..6fb7dccd1aa 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/keyedhashalgorithm.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/keyedhashalgorithm.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/mactripledes.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/mactripledes.cs
index a0d4e7d9255..19d8be12240 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/mactripledes.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/mactripledes.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/md5.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/md5.cs
index 2d4bdb70ff9..1029764fd01 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/md5.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/md5.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/md5cryptoserviceprovider.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/md5cryptoserviceprovider.cs
index 33c71335eba..bbd42c334cd 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/md5cryptoserviceprovider.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/md5cryptoserviceprovider.cs
@@ -4,7 +4,7 @@ using System.Diagnostics.Contracts;
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/passwordderivebytes.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/passwordderivebytes.cs
index cb23f7bd7a9..ce0eb079b09 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/passwordderivebytes.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/passwordderivebytes.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/pkcs1maskgenerationmethod.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/pkcs1maskgenerationmethod.cs
index cb2d19469e4..c88a2811b2d 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/pkcs1maskgenerationmethod.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/pkcs1maskgenerationmethod.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security.Cryptography {
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/randomnumbergenerator.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/randomnumbergenerator.cs
index fcd684ad95b..bd78f5ea4d8 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/randomnumbergenerator.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/randomnumbergenerator.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/rc2.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/rc2.cs
index e8542464bc3..a33eb7255d1 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/rc2.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/rc2.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/rc2cryptoserviceprovider.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/rc2cryptoserviceprovider.cs
index 89877e0add7..59b456fb5ec 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/rc2cryptoserviceprovider.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/rc2cryptoserviceprovider.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/rfc2898derivebytes.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/rfc2898derivebytes.cs
index 63bbb53d3b1..f716e32aa61 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/rfc2898derivebytes.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/rfc2898derivebytes.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/rijndael.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/rijndael.cs
index 1c7a9f75c2a..46211eb3074 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/rijndael.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/rijndael.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/rijndaelmanaged.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/rijndaelmanaged.cs
index b12bdfbece7..c394cec048a 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/rijndaelmanaged.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/rijndaelmanaged.cs
@@ -4,7 +4,7 @@ using System.Diagnostics.Contracts;
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/rijndaelmanagedtransform.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/rijndaelmanagedtransform.cs
index 79829fac683..dc93a6317d8 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/rijndaelmanagedtransform.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/rijndaelmanagedtransform.cs
@@ -4,7 +4,7 @@ using System.Diagnostics.Contracts;
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/ripemd160.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/ripemd160.cs
index a75deb9a76d..094a3319b04 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/ripemd160.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/ripemd160.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/ripemd160managed.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/ripemd160managed.cs
index bf13aabcddb..4196bd8de20 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/ripemd160managed.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/ripemd160managed.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/rngcryptoserviceprovider.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/rngcryptoserviceprovider.cs
index 073f6680f31..226632e81e2 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/rngcryptoserviceprovider.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/rngcryptoserviceprovider.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/rsa.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/rsa.cs
index 095144e7e8f..f196b12ba77 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/rsa.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/rsa.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/rsacryptoserviceprovider.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/rsacryptoserviceprovider.cs
index 1cab13c87b3..2bbd0f6559c 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/rsacryptoserviceprovider.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/rsacryptoserviceprovider.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/rsaoaepkeyexchangedeformatter.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/rsaoaepkeyexchangedeformatter.cs
index 674cdf23f61..82e1b3aa1fe 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/rsaoaepkeyexchangedeformatter.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/rsaoaepkeyexchangedeformatter.cs
@@ -4,7 +4,7 @@ using System.Diagnostics.Contracts;
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security.Cryptography {
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/rsaoaepkeyexchangeformatter.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/rsaoaepkeyexchangeformatter.cs
index a931c154cde..24b52346715 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/rsaoaepkeyexchangeformatter.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/rsaoaepkeyexchangeformatter.cs
@@ -4,7 +4,7 @@ using System.Diagnostics.Contracts;
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security.Cryptography {
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/rsapkcs1keyexchangedeformatter.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/rsapkcs1keyexchangedeformatter.cs
index ccd8570ada5..fff253e48f5 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/rsapkcs1keyexchangedeformatter.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/rsapkcs1keyexchangedeformatter.cs
@@ -4,7 +4,7 @@ using System.Diagnostics.Contracts;
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security.Cryptography {
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/rsapkcs1keyexchangeformatter.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/rsapkcs1keyexchangeformatter.cs
index 188e55ce1c4..d226f40d480 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/rsapkcs1keyexchangeformatter.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/rsapkcs1keyexchangeformatter.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security.Cryptography {
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/rsapkcs1signaturedeformatter.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/rsapkcs1signaturedeformatter.cs
index 28ee8738639..d6bb3914371 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/rsapkcs1signaturedeformatter.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/rsapkcs1signaturedeformatter.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/rsapkcs1signatureformatter.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/rsapkcs1signatureformatter.cs
index 97912425610..647d84dbd1b 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/rsapkcs1signatureformatter.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/rsapkcs1signatureformatter.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/safecryptohandles.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/safecryptohandles.cs
index 19b8885deef..e7dc76c0944 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/safecryptohandles.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/safecryptohandles.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/sha1.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/sha1.cs
index 772e725d66a..c1a4b21232c 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/sha1.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/sha1.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/sha1cryptoserviceprovider.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/sha1cryptoserviceprovider.cs
index ed886250ff9..0b25472e251 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/sha1cryptoserviceprovider.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/sha1cryptoserviceprovider.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/sha1managed.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/sha1managed.cs
index ef07a4b17c8..863cea2e183 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/sha1managed.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/sha1managed.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/sha256.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/sha256.cs
index e403045f332..5230a1eaebc 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/sha256.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/sha256.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/sha256managed.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/sha256managed.cs
index 41711c80843..242bfff1b17 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/sha256managed.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/sha256managed.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/sha384.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/sha384.cs
index 268be7eae9b..64036523daa 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/sha384.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/sha384.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/sha384managed.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/sha384managed.cs
index d17eaaa5301..c10ab52f6d6 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/sha384managed.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/sha384managed.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/sha512.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/sha512.cs
index cfff7e2bb3a..a5e1a9f80b4 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/sha512.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/sha512.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/sha512managed.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/sha512managed.cs
index 31641440b60..20ec6a6b7b7 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/sha512managed.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/sha512managed.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/signaturedescription.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/signaturedescription.cs
index 330a0222f09..8a78c9e784d 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/signaturedescription.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/signaturedescription.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/symmetricalgorithm.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/symmetricalgorithm.cs
index ac39b88cffb..d2c2a022b20 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/symmetricalgorithm.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/symmetricalgorithm.cs
@@ -4,7 +4,7 @@ using System.Diagnostics.Contracts;
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/tripledes.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/tripledes.cs
index 2481830012f..c26517093e3 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/tripledes.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/tripledes.cs
@@ -4,7 +4,7 @@ using System.Diagnostics.Contracts;
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/tripledescryptoserviceprovider.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/tripledescryptoserviceprovider.cs
index aaa5948e46b..25e63a78a89 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/tripledescryptoserviceprovider.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/tripledescryptoserviceprovider.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/cryptography/utils.cs b/mcs/class/referencesource/mscorlib/system/security/cryptography/utils.cs
index cc08a62a059..13de89cd097 100644
--- a/mcs/class/referencesource/mscorlib/system/security/cryptography/utils.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/cryptography/utils.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
@@ -373,8 +373,20 @@ namespace System.Security.Cryptography
#if FEATURE_X509_SECURESTRINGS
// If the user wanted to specify a PIN or HWND for a smart card CSP, apply those settings now.
- if (parameters.ParentWindowHandle != IntPtr.Zero)
- SetProviderParameter(TempFetchedProvHandle, parameters.KeyNumber, Constants.CLR_PP_CLIENT_HWND, parameters.ParentWindowHandle);
+ if (parameters.ParentWindowHandle != IntPtr.Zero) {
+ // Copy the value onto the stack.
+ // Then, for versions beyond 4.6.2 take the address of that copy, since &hwnd is what the API wants.
+ IntPtr parentWindowHandle = parameters.ParentWindowHandle;
+ IntPtr pHwnd = parentWindowHandle;
+
+ if (!AppContextSwitches.DoNotAddrOfCspParentWindowHandle) {
+ unsafe {
+ pHwnd = new IntPtr(&parentWindowHandle);
+ }
+ }
+
+ SetProviderParameter(TempFetchedProvHandle, parameters.KeyNumber, Constants.CLR_PP_CLIENT_HWND, pHwnd);
+ }
else if (parameters.KeyPassword != null) {
IntPtr szPassword = Marshal.SecureStringToCoTaskMemAnsi(parameters.KeyPassword);
try {
diff --git a/mcs/class/referencesource/mscorlib/system/security/framesecuritydescriptor.cs b/mcs/class/referencesource/mscorlib/system/security/framesecuritydescriptor.cs
index 906443274a6..92f4f22dfa3 100644
--- a/mcs/class/referencesource/mscorlib/system/security/framesecuritydescriptor.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/framesecuritydescriptor.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
namespace System.Security {
using System.Text;
using System.Runtime.CompilerServices;
diff --git a/mcs/class/referencesource/mscorlib/system/security/hostprotectionexception.cs b/mcs/class/referencesource/mscorlib/system/security/hostprotectionexception.cs
index 638ddf75b44..ee480cb7f62 100644
--- a/mcs/class/referencesource/mscorlib/system/security/hostprotectionexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/hostprotectionexception.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
/*=============================================================================
diff --git a/mcs/class/referencesource/mscorlib/system/security/hostsecuritymanager.cs b/mcs/class/referencesource/mscorlib/system/security/hostsecuritymanager.cs
index 113a75e1fc3..4d90a44fc55 100644
--- a/mcs/class/referencesource/mscorlib/system/security/hostsecuritymanager.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/hostsecuritymanager.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/namedpermissionset.cs b/mcs/class/referencesource/mscorlib/system/security/namedpermissionset.cs
index d2baa4899db..24629138dd9 100644
--- a/mcs/class/referencesource/mscorlib/system/security/namedpermissionset.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/namedpermissionset.cs
@@ -5,7 +5,7 @@
// ==--==
// NamedPermissionSet.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Extends PermissionSet to allow an associated name and description
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/permissionlistset.cs b/mcs/class/referencesource/mscorlib/system/security/permissionlistset.cs
index fa855d0fae0..27cf6cd5aa0 100644
--- a/mcs/class/referencesource/mscorlib/system/security/permissionlistset.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/permissionlistset.cs
@@ -7,8 +7,8 @@
**
** Class: PermissionListSet.cs
**
-** <OWNER>[....]</OWNER>
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
+** <OWNER>Microsoft</OWNER>
**
** Purpose: Holds state about A/G/R permissionsets in a callstack or appdomain
** (Replacement for PermissionListSet)
diff --git a/mcs/class/referencesource/mscorlib/system/security/permissions/environmentpermission.cs b/mcs/class/referencesource/mscorlib/system/security/permissions/environmentpermission.cs
index 5da4d1999f3..9b86f00aaa8 100644
--- a/mcs/class/referencesource/mscorlib/system/security/permissions/environmentpermission.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/permissions/environmentpermission.cs
@@ -5,7 +5,7 @@
// ==--==
// EnvironmentPermission.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security.Permissions {
diff --git a/mcs/class/referencesource/mscorlib/system/security/permissions/filedialogpermission.cs b/mcs/class/referencesource/mscorlib/system/security/permissions/filedialogpermission.cs
index a46bc0dc8ff..55308ce4e81 100644
--- a/mcs/class/referencesource/mscorlib/system/security/permissions/filedialogpermission.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/permissions/filedialogpermission.cs
@@ -5,7 +5,7 @@
// ==--==
// FileDialogPermission.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security.Permissions {
diff --git a/mcs/class/referencesource/mscorlib/system/security/permissions/fileiopermission.cs b/mcs/class/referencesource/mscorlib/system/security/permissions/fileiopermission.cs
index db35ac502b0..6287f3f07ac 100644
--- a/mcs/class/referencesource/mscorlib/system/security/permissions/fileiopermission.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/permissions/fileiopermission.cs
@@ -5,7 +5,7 @@
// ==--==
// FileIOPermission.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security.Permissions {
@@ -210,6 +210,7 @@ namespace System.Security.Permissions {
{
throw new ArgumentException(Environment.GetResourceString("Argument_EmptyPath"));
}
+
Contract.EndContractBlock();
// @
@@ -551,13 +552,10 @@ namespace System.Security.Permissions {
{
for (int i = 0; i < str.Length; ++i)
{
- // FileIOPermission doesn't allow for normalizing across various volume names. This means "C:\" and
- // "\\?\C:\" won't be considered correctly. In addition there are many other aliases for the volume
- // besides "C:" such as (in one concrete example) "\\?\Harddisk0Partition2\", "\\?\HarddiskVolume6\",
- // "\\?\Volume{d1655348-0000-0000-0000-f01500000000}\", etc.
- //
- // We'll continue to explicitly block extended syntax here by disallowing wildcards no matter where
- // they occur in the string (e.g. \\?\ isn't ok)
+ // Fail out nulls as CheckInvalidPathChars would (to match historical behavior)
+ if (str[i] == null) throw new ArgumentNullException("path");
+
+ // Looking for wildcard characters, etc.
if (CheckExtraPathCharacters(str[i]))
throw new ArgumentException(Environment.GetResourceString("Argument_InvalidPathChars"));
@@ -570,10 +568,27 @@ namespace System.Security.Permissions {
/// Check for ?,* and null, ignoring extended syntax.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [SecuritySafeCritical]
private unsafe static bool CheckExtraPathCharacters(string path)
{
+ // FileIOPermission doesn't allow for normalizing across various volume names. This means "C:\" and
+ // "\\?\C:\" won't be considered correctly. In addition there are many other aliases for the volume
+ // besides "C:" such as (in one concrete example) "\\?\Harddisk0Partition2\", "\\?\HarddiskVolume6\",
+ // "\\?\Volume{d1655348-0000-0000-0000-f01500000000}\", etc.
+ //
+ // This was never completely correct due to \\.\ paths. We'll allow \\?\ now if two conditions are met:
+ // (1) We are in full trust and (2) we _aren't_ under the LegacyPathHandling switch.
+
+ bool skipPrefix =
+#if FEATURE_CAS_POLICY
+ CodeAccessSecurityEngine.QuickCheckForAllDemands() &&
+#endif
+ !AppContextSwitches.UseLegacyPathHandling;
+
+ int startIndex = !skipPrefix ? 0 : PathInternal.IsDevice(path) ? PathInternal.DevicePrefixLength : 0;
+
char currentChar;
- for (int i = 0; i < path.Length; i++)
+ for (int i = startIndex; i < path.Length; i++)
{
currentChar = path[i];
diff --git a/mcs/class/referencesource/mscorlib/system/security/permissions/gacidentitypermission.cs b/mcs/class/referencesource/mscorlib/system/security/permissions/gacidentitypermission.cs
index 0f130ad1339..df59f63a298 100644
--- a/mcs/class/referencesource/mscorlib/system/security/permissions/gacidentitypermission.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/permissions/gacidentitypermission.cs
@@ -5,7 +5,7 @@
// ==--==
// GacIdentityPermission.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security.Permissions
diff --git a/mcs/class/referencesource/mscorlib/system/security/permissions/hostprotectionpermission.cs b/mcs/class/referencesource/mscorlib/system/security/permissions/hostprotectionpermission.cs
index 8679f29b9ee..837cac3c1e0 100644
--- a/mcs/class/referencesource/mscorlib/system/security/permissions/hostprotectionpermission.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/permissions/hostprotectionpermission.cs
@@ -5,7 +5,7 @@
// ==--==
// HostProtectionPermission.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security.Permissions
@@ -22,7 +22,7 @@ namespace System.Security.Permissions
using System.Globalization;
using System.Diagnostics.Contracts;
- // Keep this enum in [....] with tools\ngen\ngen.cpp and inc\mscoree.idl
+ // Keep this enum in sync with tools\ngen\ngen.cpp and inc\mscoree.idl
[Serializable]
[Flags]
diff --git a/mcs/class/referencesource/mscorlib/system/security/permissions/isolatedstoragefilepermission.cs b/mcs/class/referencesource/mscorlib/system/security/permissions/isolatedstoragefilepermission.cs
index 031cf0983c5..e52c1caf1ef 100644
--- a/mcs/class/referencesource/mscorlib/system/security/permissions/isolatedstoragefilepermission.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/permissions/isolatedstoragefilepermission.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Purpose : This permission is used to controls/administer access to
// IsolatedStorageFile
diff --git a/mcs/class/referencesource/mscorlib/system/security/permissions/isolatedstoragepermission.cs b/mcs/class/referencesource/mscorlib/system/security/permissions/isolatedstoragepermission.cs
index 7fad3c55ed3..69c7f743a89 100644
--- a/mcs/class/referencesource/mscorlib/system/security/permissions/isolatedstoragepermission.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/permissions/isolatedstoragepermission.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security.Permissions {
diff --git a/mcs/class/referencesource/mscorlib/system/security/permissions/keycontainerpermission.cs b/mcs/class/referencesource/mscorlib/system/security/permissions/keycontainerpermission.cs
index a606bf2ca0e..0afd60558c8 100644
--- a/mcs/class/referencesource/mscorlib/system/security/permissions/keycontainerpermission.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/permissions/keycontainerpermission.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/permissions/permissionattributes.cs b/mcs/class/referencesource/mscorlib/system/security/permissions/permissionattributes.cs
index 09f2ae38647..1e36a44ecb4 100644
--- a/mcs/class/referencesource/mscorlib/system/security/permissions/permissionattributes.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/permissions/permissionattributes.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
namespace System.Security.Permissions
{
diff --git a/mcs/class/referencesource/mscorlib/system/security/permissions/principalpermission.cs b/mcs/class/referencesource/mscorlib/system/security/permissions/principalpermission.cs
index 7598e6286ef..4ed6ff549dd 100644
--- a/mcs/class/referencesource/mscorlib/system/security/permissions/principalpermission.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/permissions/principalpermission.cs
@@ -5,7 +5,7 @@
// ==--==
// PrincipalPermission.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security.Permissions
diff --git a/mcs/class/referencesource/mscorlib/system/security/permissions/publisheridentitypermission.cs b/mcs/class/referencesource/mscorlib/system/security/permissions/publisheridentitypermission.cs
index 7c41b3be1cd..5f78b238df5 100644
--- a/mcs/class/referencesource/mscorlib/system/security/permissions/publisheridentitypermission.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/permissions/publisheridentitypermission.cs
@@ -5,7 +5,7 @@
// ==--==
// PublisherIdentityPermission.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security.Permissions
diff --git a/mcs/class/referencesource/mscorlib/system/security/permissions/reflectionpermission.cs b/mcs/class/referencesource/mscorlib/system/security/permissions/reflectionpermission.cs
index 00e79a1ee0c..7e0d2fd2762 100644
--- a/mcs/class/referencesource/mscorlib/system/security/permissions/reflectionpermission.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/permissions/reflectionpermission.cs
@@ -5,7 +5,7 @@
// ==--==
// ReflectionPermission.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security.Permissions
diff --git a/mcs/class/referencesource/mscorlib/system/security/permissions/registrypermission.cs b/mcs/class/referencesource/mscorlib/system/security/permissions/registrypermission.cs
index 0805d55ac21..1f7cfddeb89 100644
--- a/mcs/class/referencesource/mscorlib/system/security/permissions/registrypermission.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/permissions/registrypermission.cs
@@ -5,7 +5,7 @@
// ==--==
// RegistryPermission.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security.Permissions
diff --git a/mcs/class/referencesource/mscorlib/system/security/permissions/securitypermission.cs b/mcs/class/referencesource/mscorlib/system/security/permissions/securitypermission.cs
index 18b328f88fb..1e501c5997e 100644
--- a/mcs/class/referencesource/mscorlib/system/security/permissions/securitypermission.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/permissions/securitypermission.cs
@@ -5,7 +5,7 @@
// ==--==
// SecurityPermission.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security.Permissions
diff --git a/mcs/class/referencesource/mscorlib/system/security/permissions/siteidentitypermission.cs b/mcs/class/referencesource/mscorlib/system/security/permissions/siteidentitypermission.cs
index d08ccce13ca..a6c530be87e 100644
--- a/mcs/class/referencesource/mscorlib/system/security/permissions/siteidentitypermission.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/permissions/siteidentitypermission.cs
@@ -5,7 +5,7 @@
// ==--==
// SiteIdentityPermission.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security.Permissions
diff --git a/mcs/class/referencesource/mscorlib/system/security/permissions/strongnameidentitypermission.cs b/mcs/class/referencesource/mscorlib/system/security/permissions/strongnameidentitypermission.cs
index 31cbc12167b..1ab3804bdc1 100644
--- a/mcs/class/referencesource/mscorlib/system/security/permissions/strongnameidentitypermission.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/permissions/strongnameidentitypermission.cs
@@ -6,7 +6,7 @@
// ==--==
// StrongNameIdentityPermission.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security.Permissions
diff --git a/mcs/class/referencesource/mscorlib/system/security/permissions/strongnamepublickeyblob.cs b/mcs/class/referencesource/mscorlib/system/security/permissions/strongnamepublickeyblob.cs
index 2367f8ba842..ac3cac3e2c0 100644
--- a/mcs/class/referencesource/mscorlib/system/security/permissions/strongnamepublickeyblob.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/permissions/strongnamepublickeyblob.cs
@@ -5,7 +5,7 @@
// ==--==
// StrongNamePublicKeyBlob.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security.Permissions
diff --git a/mcs/class/referencesource/mscorlib/system/security/permissions/uipermission.cs b/mcs/class/referencesource/mscorlib/system/security/permissions/uipermission.cs
index dea740ad6f7..6e34b862759 100644
--- a/mcs/class/referencesource/mscorlib/system/security/permissions/uipermission.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/permissions/uipermission.cs
@@ -5,7 +5,7 @@
// ==--==
// UIPermission.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security.Permissions
diff --git a/mcs/class/referencesource/mscorlib/system/security/permissions/urlidentitypermission.cs b/mcs/class/referencesource/mscorlib/system/security/permissions/urlidentitypermission.cs
index ce61fad8493..bab282e8893 100644
--- a/mcs/class/referencesource/mscorlib/system/security/permissions/urlidentitypermission.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/permissions/urlidentitypermission.cs
@@ -5,7 +5,7 @@
// ==--==
// UrlIdentityPermission.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security.Permissions
diff --git a/mcs/class/referencesource/mscorlib/system/security/permissions/zoneidentitypermission.cs b/mcs/class/referencesource/mscorlib/system/security/permissions/zoneidentitypermission.cs
index 6b3f6c56be3..13574f3f265 100644
--- a/mcs/class/referencesource/mscorlib/system/security/permissions/zoneidentitypermission.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/permissions/zoneidentitypermission.cs
@@ -5,7 +5,7 @@
// ==--==
// ZoneIdentityPermission.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security.Permissions
diff --git a/mcs/class/referencesource/mscorlib/system/security/permissionset.cs b/mcs/class/referencesource/mscorlib/system/security/permissionset.cs
index 1edd3c8ad16..b7118829962 100644
--- a/mcs/class/referencesource/mscorlib/system/security/permissionset.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/permissionset.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security {
diff --git a/mcs/class/referencesource/mscorlib/system/security/permissionsetenumerator.cs b/mcs/class/referencesource/mscorlib/system/security/permissionsetenumerator.cs
index e65e24d5040..c8f04173903 100644
--- a/mcs/class/referencesource/mscorlib/system/security/permissionsetenumerator.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/permissionsetenumerator.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security
diff --git a/mcs/class/referencesource/mscorlib/system/security/permissionsettriple.cs b/mcs/class/referencesource/mscorlib/system/security/permissionsettriple.cs
index f319aa37114..170cd203378 100644
--- a/mcs/class/referencesource/mscorlib/system/security/permissionsettriple.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/permissionsettriple.cs
@@ -7,7 +7,7 @@
**
** Class: PermissionSetTriple
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
** Purpose: Container class for holding an AppDomain's Grantset and Refused sets.
** Also used for CompressedStacks which brings in the third PermissionSet.
diff --git a/mcs/class/referencesource/mscorlib/system/security/permissiontoken.cs b/mcs/class/referencesource/mscorlib/system/security/permissiontoken.cs
index bb328a7e669..92051b8ee6e 100644
--- a/mcs/class/referencesource/mscorlib/system/security/permissiontoken.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/permissiontoken.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
namespace System.Security {
using System;
using System.Security.Util;
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/allmembershipcondition.cs b/mcs/class/referencesource/mscorlib/system/security/policy/allmembershipcondition.cs
index 9b517b50349..e6d327d14f2 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/allmembershipcondition.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/allmembershipcondition.cs
@@ -5,7 +5,7 @@
// ==--==
// AllMembershipCondition.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Simple IMembershipCondition implementation that always passes
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/applicationdirectory.cs b/mcs/class/referencesource/mscorlib/system/security/policy/applicationdirectory.cs
index b521a618d22..3b568460ecd 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/applicationdirectory.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/applicationdirectory.cs
@@ -5,7 +5,7 @@
// ==--==
// ApplicationDirectory.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// ApplicationDirectory is an evidence type representing the directory the assembly
// was loaded from.
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/applicationdirectorymembershipcondition.cs b/mcs/class/referencesource/mscorlib/system/security/policy/applicationdirectorymembershipcondition.cs
index 97194d1142c..5bc3e8dffa8 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/applicationdirectorymembershipcondition.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/applicationdirectorymembershipcondition.cs
@@ -5,7 +5,7 @@
// ==--==
// ApplicationDirectoryMembershipCondition.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Implementation of membership condition for "application directories"
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/applicationsecurityinfo.cs b/mcs/class/referencesource/mscorlib/system/security/policy/applicationsecurityinfo.cs
index 825d6b02787..477b44575ea 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/applicationsecurityinfo.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/applicationsecurityinfo.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/applicationsecuritymanager.cs b/mcs/class/referencesource/mscorlib/system/security/policy/applicationsecuritymanager.cs
index 07c3d8267df..d3bbfbd9cd4 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/applicationsecuritymanager.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/applicationsecuritymanager.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/applicationtrust.cs b/mcs/class/referencesource/mscorlib/system/security/policy/applicationtrust.cs
index 11092a47e25..c93e68a367a 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/applicationtrust.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/applicationtrust.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
@@ -55,11 +55,11 @@ namespace System.Security.Policy {
private IList<StrongName> m_fullTrustAssemblies;
// Permission special flags for the default grant set in this ApplicationTrust. This should be
- // updated in [....] with any updates to the default grant set.
+ // updated in sync with any updates to the default grant set.
//
// In the general case, these values cannot be trusted - we only store a reference to the
// DefaultGrantSet, and return the reference directly, which means that code can update the
- // permission set without our knowledge. That would lead to the flags getting out of [....] with the
+ // permission set without our knowledge. That would lead to the flags getting out of sync with the
// grant set.
//
// However, we only care about these flags when we're creating a homogenous AppDomain, and in that
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/assemblyevidencefactory.cs b/mcs/class/referencesource/mscorlib/system/security/policy/assemblyevidencefactory.cs
index cdd0434f7b7..df5f539e8af 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/assemblyevidencefactory.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/assemblyevidencefactory.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
using System;
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/codegroup.cs b/mcs/class/referencesource/mscorlib/system/security/policy/codegroup.cs
index d7e9a65339d..a6439b55253 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/codegroup.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/codegroup.cs
@@ -5,7 +5,7 @@
// ==--==
// CodeGroup.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Representation for code groups used for the policy mechanism
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/evidence.cs b/mcs/class/referencesource/mscorlib/system/security/policy/evidence.cs
index 41cc55871e6..a3e9ab07c25 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/evidence.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/evidence.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security.Policy
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/evidencebase.cs b/mcs/class/referencesource/mscorlib/system/security/policy/evidencebase.cs
index daf220938f1..30a8fbee735 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/evidencebase.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/evidencebase.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
using System;
@@ -166,7 +166,7 @@ namespace System.Security.Policy
{
Contract.Assert(evidence != null);
Contract.Assert(m_legacyEvidenceList.Count == 0 || EvidenceType == evidence.GetType() || (evidence is LegacyEvidenceWrapper && (evidence as LegacyEvidenceWrapper).EvidenceType == EvidenceType),
- "LegacyEvidenceList must be ----geonous");
+ "LegacyEvidenceList must be homogeonous");
Contract.Assert(evidence.GetType() != typeof(LegacyEvidenceList),
"Attempt to add a legacy evidence list to another legacy evidence list");
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/evidencetypedescriptor.cs b/mcs/class/referencesource/mscorlib/system/security/policy/evidencetypedescriptor.cs
index b45c5411321..ce063253c3e 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/evidencetypedescriptor.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/evidencetypedescriptor.cs
@@ -2,7 +2,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
using System;
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/filecodegroup.cs b/mcs/class/referencesource/mscorlib/system/security/policy/filecodegroup.cs
index e3a2bb4879a..d36c6402a74 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/filecodegroup.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/filecodegroup.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/firstmatchcodegroup.cs b/mcs/class/referencesource/mscorlib/system/security/policy/firstmatchcodegroup.cs
index 4700bbbe705..0afbd3c4c66 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/firstmatchcodegroup.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/firstmatchcodegroup.cs
@@ -5,7 +5,7 @@
// ==--==
// FirstMatchCodeGroup.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Representation for code groups used for the policy mechanism
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/gac.cs b/mcs/class/referencesource/mscorlib/system/security/policy/gac.cs
index 78f0eea16dd..a6abea898e4 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/gac.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/gac.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/gacmembershipcondition.cs b/mcs/class/referencesource/mscorlib/system/security/policy/gacmembershipcondition.cs
index fc96793581a..84d65e5e3f7 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/gacmembershipcondition.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/gacmembershipcondition.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/hash.cs b/mcs/class/referencesource/mscorlib/system/security/policy/hash.cs
index 9bd73cf25b3..184faec0ee7 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/hash.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/hash.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/hashmembershipcondition.cs b/mcs/class/referencesource/mscorlib/system/security/policy/hashmembershipcondition.cs
index befd3261ff2..690034bc65c 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/hashmembershipcondition.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/hashmembershipcondition.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/iapplicationtrustmanager.cs b/mcs/class/referencesource/mscorlib/system/security/policy/iapplicationtrustmanager.cs
index 46990db4863..194bfbdce7a 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/iapplicationtrustmanager.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/iapplicationtrustmanager.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/netcodegroup.cs b/mcs/class/referencesource/mscorlib/system/security/policy/netcodegroup.cs
index 17fe906c481..5916875e672 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/netcodegroup.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/netcodegroup.cs
@@ -5,7 +5,7 @@
// ==--==
// NetCodeGroup.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Representation for code groups used for the policy mechanism
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/pefileevidencefactory.cs b/mcs/class/referencesource/mscorlib/system/security/policy/pefileevidencefactory.cs
index 266e7b5f9ca..b70b1d262c2 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/pefileevidencefactory.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/pefileevidencefactory.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
using System;
@@ -25,7 +25,7 @@ using Microsoft.Win32.SafeHandles;
namespace System.Security.Policy
{
/// <summary>
- /// Arguments to the ETW evidence generation event. This enumeration should be kept in [....] with
+ /// Arguments to the ETW evidence generation event. This enumeration should be kept in sync with
/// the VM enumeration EvidenceType in SecurityPolicy.h.
/// </summary>
internal enum EvidenceTypeGenerated
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/permissionrequestevidence.cs b/mcs/class/referencesource/mscorlib/system/security/policy/permissionrequestevidence.cs
index e4826330f82..ed71bdab120 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/permissionrequestevidence.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/permissionrequestevidence.cs
@@ -5,7 +5,7 @@
// ==--==
// PermissionRequestEvidence.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Encapsulation of permission request as an evidence type.
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/policyexception.cs b/mcs/class/referencesource/mscorlib/system/security/policy/policyexception.cs
index c0716d3c61a..11ef230b648 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/policyexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/policyexception.cs
@@ -5,7 +5,7 @@
// ==--==
// PolicyException.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Use this class to throw a PolicyException
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/policylevel.cs b/mcs/class/referencesource/mscorlib/system/security/policy/policylevel.cs
index 5a766ce01fb..10def8e6810 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/policylevel.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/policylevel.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/policystatement.cs b/mcs/class/referencesource/mscorlib/system/security/policy/policystatement.cs
index 35e7033408c..9dbb1239fe2 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/policystatement.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/policystatement.cs
@@ -6,7 +6,7 @@ using System.Diagnostics.Contracts;
// ==--==
// PolicyStatement.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Represents the policy associated with some piece of evidence
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/publisher.cs b/mcs/class/referencesource/mscorlib/system/security/policy/publisher.cs
index b28e9c13bbb..1234d776ca7 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/publisher.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/publisher.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/publishermembershipcondition.cs b/mcs/class/referencesource/mscorlib/system/security/policy/publishermembershipcondition.cs
index 3c6dda1f414..c3da15b832c 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/publishermembershipcondition.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/publishermembershipcondition.cs
@@ -5,7 +5,7 @@
// ==--==
// PublisherMembershipCondition.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Implementation of membership condition for X509 certificate based publishers
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/site.cs b/mcs/class/referencesource/mscorlib/system/security/policy/site.cs
index 86ef1763ada..c18dc21604c 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/site.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/site.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/sitemembershipcondition.cs b/mcs/class/referencesource/mscorlib/system/security/policy/sitemembershipcondition.cs
index 4dc9af6f3a0..067d63f24c1 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/sitemembershipcondition.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/sitemembershipcondition.cs
@@ -6,7 +6,7 @@ using System.Diagnostics.Contracts;
// ==--==
// SiteMembershipCondition.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Implementation of membership condition for zones
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/strongname.cs b/mcs/class/referencesource/mscorlib/system/security/policy/strongname.cs
index 775d5d75d96..4714828772d 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/strongname.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/strongname.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/strongnamemembershipcondition.cs b/mcs/class/referencesource/mscorlib/system/security/policy/strongnamemembershipcondition.cs
index afd302a4950..c6470c861c6 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/strongnamemembershipcondition.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/strongnamemembershipcondition.cs
@@ -5,7 +5,7 @@
// ==--==
// StrongNameMembershipCondition.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Implementation of membership condition for zones
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/unioncodegroup.cs b/mcs/class/referencesource/mscorlib/system/security/policy/unioncodegroup.cs
index 4d6570786dd..470d0fb8a6e 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/unioncodegroup.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/unioncodegroup.cs
@@ -5,7 +5,7 @@
// ==--==
// UnionCodeGroup.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Representation for code groups used for the policy mechanism
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/url.cs b/mcs/class/referencesource/mscorlib/system/security/policy/url.cs
index b41f2cfe580..632d2ce3d7a 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/url.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/url.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/urlmembershipcondition.cs b/mcs/class/referencesource/mscorlib/system/security/policy/urlmembershipcondition.cs
index 2891234f930..a8745a5cbb9 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/urlmembershipcondition.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/urlmembershipcondition.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/zone.cs b/mcs/class/referencesource/mscorlib/system/security/policy/zone.cs
index 74f60e5ce9a..9942af9f271 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/zone.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/zone.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policy/zonemembershipcondition.cs b/mcs/class/referencesource/mscorlib/system/security/policy/zonemembershipcondition.cs
index 329ef5e6401..a9afd303393 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policy/zonemembershipcondition.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policy/zonemembershipcondition.cs
@@ -6,7 +6,7 @@ using System.Diagnostics.Contracts;
// ==--==
// ZoneMembershipCondition.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Implementation of membership condition for zones
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/policymanager.cs b/mcs/class/referencesource/mscorlib/system/security/policymanager.cs
index ff35a450c87..814c460eed5 100644
--- a/mcs/class/referencesource/mscorlib/system/security/policymanager.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/policymanager.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
@@ -414,7 +414,7 @@ namespace System.Security {
{
if (FullTrustMap == null)
{
- // This mapping must stay in [....] with the SecurityZone enumeration in SecurityZone.cs
+ // This mapping must stay in sync with the SecurityZone enumeration in SecurityZone.cs
FullTrustMap = new QuickCacheEntryType[]
{
QuickCacheEntryType.FullTrustZoneMyComputer,
diff --git a/mcs/class/referencesource/mscorlib/system/security/principal/genericidentity.cs b/mcs/class/referencesource/mscorlib/system/security/principal/genericidentity.cs
index 02037c6391b..b771a70180f 100644
--- a/mcs/class/referencesource/mscorlib/system/security/principal/genericidentity.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/principal/genericidentity.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/principal/genericprincipal.cs b/mcs/class/referencesource/mscorlib/system/security/principal/genericprincipal.cs
index f2f6cacc626..af04dddc4b3 100644
--- a/mcs/class/referencesource/mscorlib/system/security/principal/genericprincipal.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/principal/genericprincipal.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/principal/identitynotmappedexception.cs b/mcs/class/referencesource/mscorlib/system/security/principal/identitynotmappedexception.cs
index 8985f087ee9..f5f9bbabe9a 100644
--- a/mcs/class/referencesource/mscorlib/system/security/principal/identitynotmappedexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/principal/identitynotmappedexception.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
using System;
diff --git a/mcs/class/referencesource/mscorlib/system/security/principal/identityreference.cs b/mcs/class/referencesource/mscorlib/system/security/principal/identityreference.cs
index 3be7e0e96de..727c8ea733f 100644
--- a/mcs/class/referencesource/mscorlib/system/security/principal/identityreference.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/principal/identityreference.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
using System;
diff --git a/mcs/class/referencesource/mscorlib/system/security/principal/ircollection.cs b/mcs/class/referencesource/mscorlib/system/security/principal/ircollection.cs
index 979704be569..8c00f13230f 100644
--- a/mcs/class/referencesource/mscorlib/system/security/principal/ircollection.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/principal/ircollection.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
namespace System.Security.Principal
{
using System;
diff --git a/mcs/class/referencesource/mscorlib/system/security/principal/ntaccount.cs b/mcs/class/referencesource/mscorlib/system/security/principal/ntaccount.cs
index 291d56499dd..19b7ec76408 100644
--- a/mcs/class/referencesource/mscorlib/system/security/principal/ntaccount.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/principal/ntaccount.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
using Microsoft.Win32;
diff --git a/mcs/class/referencesource/mscorlib/system/security/principal/sid.cs b/mcs/class/referencesource/mscorlib/system/security/principal/sid.cs
index bfc99ecf311..e8558b29568 100644
--- a/mcs/class/referencesource/mscorlib/system/security/principal/sid.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/principal/sid.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
using System;
diff --git a/mcs/class/referencesource/mscorlib/system/security/principal/win32.cs b/mcs/class/referencesource/mscorlib/system/security/principal/win32.cs
index bac02ffb621..2aedb26bc2d 100644
--- a/mcs/class/referencesource/mscorlib/system/security/principal/win32.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/principal/win32.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
using Microsoft.Win32;
diff --git a/mcs/class/referencesource/mscorlib/system/security/principal/windowsidentity.cs b/mcs/class/referencesource/mscorlib/system/security/principal/windowsidentity.cs
index e045de8e253..ca0b03886d9 100644
--- a/mcs/class/referencesource/mscorlib/system/security/principal/windowsidentity.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/principal/windowsidentity.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
@@ -46,7 +46,7 @@ namespace System.Security.Principal
Anonymous = 3
}
- // Keep in [....] with vm\comprincipal.h
+ // Keep in sync with vm\comprincipal.h
internal enum WinSecurityContext {
Thread = 1, // OpenAsSelf = false
Process = 2, // OpenAsSelf = true
diff --git a/mcs/class/referencesource/mscorlib/system/security/principal/windowsimpersonationcontext.cs b/mcs/class/referencesource/mscorlib/system/security/principal/windowsimpersonationcontext.cs
index 311c3b3d4f2..5315ae7ba39 100644
--- a/mcs/class/referencesource/mscorlib/system/security/principal/windowsimpersonationcontext.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/principal/windowsimpersonationcontext.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/principal/windowsprincipal.cs b/mcs/class/referencesource/mscorlib/system/security/principal/windowsprincipal.cs
index d954f9f9700..6e60e7de374 100644
--- a/mcs/class/referencesource/mscorlib/system/security/principal/windowsprincipal.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/principal/windowsprincipal.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/readonlypermissionset.cs b/mcs/class/referencesource/mscorlib/system/security/readonlypermissionset.cs
index 1b9e0ae98ed..8bb357870dd 100644
--- a/mcs/class/referencesource/mscorlib/system/security/readonlypermissionset.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/readonlypermissionset.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
using System;
diff --git a/mcs/class/referencesource/mscorlib/system/security/safesecurityhandles.cs b/mcs/class/referencesource/mscorlib/system/security/safesecurityhandles.cs
index 8161a3be2a0..d07a042d8f3 100644
--- a/mcs/class/referencesource/mscorlib/system/security/safesecurityhandles.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/safesecurityhandles.cs
@@ -1,4 +1,4 @@
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
namespace Microsoft.Win32.SafeHandles {
using System;
using System.Runtime.CompilerServices;
diff --git a/mcs/class/referencesource/mscorlib/system/security/securestring.cs b/mcs/class/referencesource/mscorlib/system/security/securestring.cs
index 54d66afce26..ca2e8aea6c1 100644
--- a/mcs/class/referencesource/mscorlib/system/security/securestring.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/securestring.cs
@@ -1,4 +1,4 @@
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
namespace System.Security {
using System.Security.Cryptography;
using System.Runtime.InteropServices;
diff --git a/mcs/class/referencesource/mscorlib/system/security/securitycontext.cs b/mcs/class/referencesource/mscorlib/system/security/securitycontext.cs
index 76dd997bd3b..2f3268e234c 100644
--- a/mcs/class/referencesource/mscorlib/system/security/securitycontext.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/securitycontext.cs
@@ -6,7 +6,7 @@
**
** Class: SecurityContext
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Capture security context for a thread
@@ -32,7 +32,7 @@ namespace System.Security
using System.Runtime.Versioning;
using System.Diagnostics.Contracts;
- // This enum must be kept in [....] with the SecurityContextSource enum in the VM
+ // This enum must be kept in sync with the SecurityContextSource enum in the VM
public enum SecurityContextSource
{
CurrentAppDomain = 0,
diff --git a/mcs/class/referencesource/mscorlib/system/security/securitydocument.cs b/mcs/class/referencesource/mscorlib/system/security/securitydocument.cs
index fffcf0cbfdb..f0c95e2abab 100644
--- a/mcs/class/referencesource/mscorlib/system/security/securitydocument.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/securitydocument.cs
@@ -7,7 +7,7 @@
//
// CLASS: SecurityDocument.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// PURPOSE: Represent an XML document
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/securityelement.cs b/mcs/class/referencesource/mscorlib/system/security/securityelement.cs
index 8715f42ce95..e238ae5d77b 100644
--- a/mcs/class/referencesource/mscorlib/system/security/securityelement.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/securityelement.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security
diff --git a/mcs/class/referencesource/mscorlib/system/security/securityexception.cs b/mcs/class/referencesource/mscorlib/system/security/securityexception.cs
index 4b3a571a88d..d5fe3578526 100644
--- a/mcs/class/referencesource/mscorlib/system/security/securityexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/securityexception.cs
@@ -7,7 +7,7 @@
**
** Class: SecurityException
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** Purpose: Exception class for security
diff --git a/mcs/class/referencesource/mscorlib/system/security/securitymanager.cs b/mcs/class/referencesource/mscorlib/system/security/securitymanager.cs
index 1a60f9bc4d2..777eb6ebfb4 100644
--- a/mcs/class/referencesource/mscorlib/system/security/securitymanager.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/securitymanager.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/securityruntime.cs b/mcs/class/referencesource/mscorlib/system/security/securityruntime.cs
index 1c874c24365..7989ee4dbd5 100644
--- a/mcs/class/referencesource/mscorlib/system/security/securityruntime.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/securityruntime.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security {
diff --git a/mcs/class/referencesource/mscorlib/system/security/securitystate.cs b/mcs/class/referencesource/mscorlib/system/security/securitystate.cs
index 3097eb250d8..0670730089d 100644
--- a/mcs/class/referencesource/mscorlib/system/security/securitystate.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/securitystate.cs
@@ -2,7 +2,7 @@
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Security;
diff --git a/mcs/class/referencesource/mscorlib/system/security/util/config.cs b/mcs/class/referencesource/mscorlib/system/security/util/config.cs
index 135979dce40..3ddf27c3cfc 100644
--- a/mcs/class/referencesource/mscorlib/system/security/util/config.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/util/config.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/util/hex.cs b/mcs/class/referencesource/mscorlib/system/security/util/hex.cs
index 9a7d22d4d5b..c072698526b 100644
--- a/mcs/class/referencesource/mscorlib/system/security/util/hex.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/util/hex.cs
@@ -6,7 +6,7 @@
/*
* Hex.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
*
* Operations to convert to and from Hex
*
diff --git a/mcs/class/referencesource/mscorlib/system/security/util/parser.cs b/mcs/class/referencesource/mscorlib/system/security/util/parser.cs
index 10b7aa70259..ef53c555fe4 100644
--- a/mcs/class/referencesource/mscorlib/system/security/util/parser.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/util/parser.cs
@@ -7,7 +7,7 @@
**
** CLASS: Parser
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** PURPOSE: Parse "Elementary XML", that is, XML without
diff --git a/mcs/class/referencesource/mscorlib/system/security/util/sitestring.cs b/mcs/class/referencesource/mscorlib/system/security/util/sitestring.cs
index 7e705d7cbd4..f78b85ba71b 100644
--- a/mcs/class/referencesource/mscorlib/system/security/util/sitestring.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/util/sitestring.cs
@@ -5,7 +5,7 @@
// ==--==
// SiteString
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security.Util {
diff --git a/mcs/class/referencesource/mscorlib/system/security/util/stringexpressionset.cs b/mcs/class/referencesource/mscorlib/system/security/util/stringexpressionset.cs
index 698f76f02e5..a670674378d 100644
--- a/mcs/class/referencesource/mscorlib/system/security/util/stringexpressionset.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/util/stringexpressionset.cs
@@ -5,7 +5,7 @@
// ==--==
// StringExpressionSet
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security.Util {
diff --git a/mcs/class/referencesource/mscorlib/system/security/util/tokenbasedset.cs b/mcs/class/referencesource/mscorlib/system/security/util/tokenbasedset.cs
index 6f7fe1de29d..cbbb43c6398 100644
--- a/mcs/class/referencesource/mscorlib/system/security/util/tokenbasedset.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/util/tokenbasedset.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/util/tokenbasedsetenumerator.cs b/mcs/class/referencesource/mscorlib/system/security/util/tokenbasedsetenumerator.cs
index 4c18c5bcee5..a9dd114ddb9 100644
--- a/mcs/class/referencesource/mscorlib/system/security/util/tokenbasedsetenumerator.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/util/tokenbasedsetenumerator.cs
@@ -5,7 +5,7 @@
// ==--==
// TokenBasedSetEnumerator.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security.Util
diff --git a/mcs/class/referencesource/mscorlib/system/security/util/tokenizer.cs b/mcs/class/referencesource/mscorlib/system/security/util/tokenizer.cs
index 3a9ab669422..f942b027ca3 100644
--- a/mcs/class/referencesource/mscorlib/system/security/util/tokenizer.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/util/tokenizer.cs
@@ -7,7 +7,7 @@
**
** CLASS: Tokenizer.cs
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
**
** PURPOSE: Tokenize "Elementary XML", that is, XML without
diff --git a/mcs/class/referencesource/mscorlib/system/security/util/urlstring.cs b/mcs/class/referencesource/mscorlib/system/security/util/urlstring.cs
index c629fb4f695..9178585f19e 100644
--- a/mcs/class/referencesource/mscorlib/system/security/util/urlstring.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/util/urlstring.cs
@@ -5,7 +5,7 @@
// ==--==
// URLString
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Implementation of membership condition for zones
//
diff --git a/mcs/class/referencesource/mscorlib/system/security/util/xmlutil.cs b/mcs/class/referencesource/mscorlib/system/security/util/xmlutil.cs
index 936eaff9e40..ad0a9cb25a4 100644
--- a/mcs/class/referencesource/mscorlib/system/security/util/xmlutil.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/util/xmlutil.cs
@@ -7,7 +7,7 @@
**
** CLASS: XMLUtil
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
** PURPOSE: Helpers for XML input & output
**
diff --git a/mcs/class/referencesource/mscorlib/system/security/verificationexception.cs b/mcs/class/referencesource/mscorlib/system/security/verificationexception.cs
index 2e799519b29..90fc2eb72d6 100644
--- a/mcs/class/referencesource/mscorlib/system/security/verificationexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/verificationexception.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security {
diff --git a/mcs/class/referencesource/mscorlib/system/security/xmlsyntaxexception.cs b/mcs/class/referencesource/mscorlib/system/security/xmlsyntaxexception.cs
index 0ec69646c8a..2c64008ef87 100644
--- a/mcs/class/referencesource/mscorlib/system/security/xmlsyntaxexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/security/xmlsyntaxexception.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
namespace System.Security {
diff --git a/mcs/class/referencesource/mscorlib/system/string.cs b/mcs/class/referencesource/mscorlib/system/string.cs
index e8fe32e54d1..79e71f969cd 100644
--- a/mcs/class/referencesource/mscorlib/system/string.cs
+++ b/mcs/class/referencesource/mscorlib/system/string.cs
@@ -61,7 +61,7 @@ namespace System {
//private static readonly char FmtMsgMarkerChar='%';
//private static readonly char FmtMsgFmtCodeChar='!';
- //These are defined in Com99/src/vm/COMStringCommon.h and must be kept in [....].
+ //These are defined in Com99/src/vm/COMStringCommon.h and must be kept in sync.
private const int TrimHead = 0;
private const int TrimTail = 1;
private const int TrimBoth = 2;
@@ -1404,6 +1404,16 @@ namespace System {
#if !MONO
[System.Security.SecuritySafeCritical] // auto-generated
+ unsafe internal int GetBytesFromEncoding(byte* pbNativeBuffer, int cbNativeBuffer,Encoding encoding)
+ {
+ // encoding == Encoding.UTF8
+ fixed (char* pwzChar = &this.m_firstChar)
+ {
+ return encoding.GetBytes(pwzChar, m_stringLength, pbNativeBuffer, cbNativeBuffer);
+ }
+ }
+
+ [System.Security.SecuritySafeCritical] // auto-generated
unsafe internal int ConvertToAnsi(byte *pbNativeBuffer, int cbNativeBuffer, bool fBestFit, bool fThrowOnUnmappableChar)
{
Contract.Assert(cbNativeBuffer >= (Length + 1) * Marshal.SystemMaxDBCSCharSize, "Insufficient buffer length passed to ConvertToAnsi");
diff --git a/mcs/class/referencesource/mscorlib/system/stubhelpers.cs b/mcs/class/referencesource/mscorlib/system/stubhelpers.cs
index 3f6f6fcfbdf..56a6975641d 100644
--- a/mcs/class/referencesource/mscorlib/system/stubhelpers.cs
+++ b/mcs/class/referencesource/mscorlib/system/stubhelpers.cs
@@ -127,6 +127,117 @@ namespace System.StubHelpers {
} // class CSTRMarshaler
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
+ internal static class UTF8Marshaler
+ {
+ const int MAX_UTF8_CHAR_SIZE = 3;
+ [System.Security.SecurityCritical]
+ static internal unsafe IntPtr ConvertToNative(int flags, string strManaged, IntPtr pNativeBuffer)
+ {
+ if (null == strManaged)
+ {
+ return IntPtr.Zero;
+ }
+ StubHelpers.CheckStringLength(strManaged.Length);
+
+ int nb;
+ byte* pbNativeBuffer = (byte*)pNativeBuffer;
+
+ // If we are marshaling into a stack buffer allocated by the ILStub
+ // we will use a "1-pass" mode where we convert the string directly into the unmanaged buffer.
+ // else we will allocate the precise native heap memory.
+ if (pbNativeBuffer != null)
+ {
+ // this is the number of bytes allocated by the ILStub.
+ nb = (strManaged.Length + 1) * MAX_UTF8_CHAR_SIZE;
+
+ // nb is the actual number of bytes written by Encoding.GetBytes.
+ // use nb to de-limit the string since we are allocating more than
+ // required on stack
+ nb = strManaged.GetBytesFromEncoding(pbNativeBuffer, nb, Encoding.UTF8);
+ }
+ // required bytes > 260 , allocate required bytes on heap
+ else
+ {
+ nb = Encoding.UTF8.GetByteCount(strManaged);
+ // + 1 for the null character.
+ pbNativeBuffer = (byte*)Marshal.AllocCoTaskMem(nb + 1);
+ strManaged.GetBytesFromEncoding(pbNativeBuffer, nb, Encoding.UTF8);
+ }
+ pbNativeBuffer[nb] = 0x0;
+ return (IntPtr)pbNativeBuffer;
+ }
+
+ [System.Security.SecurityCritical]
+ static internal unsafe string ConvertToManaged(IntPtr cstr)
+ {
+ if (IntPtr.Zero == cstr)
+ return null;
+ int nbBytes = StubHelpers.strlen((sbyte*)cstr);
+ return String.CreateStringFromEncoding((byte*)cstr, nbBytes, Encoding.UTF8);
+ }
+
+ [System.Security.SecurityCritical]
+ static internal void ClearNative(IntPtr pNative)
+ {
+ if (pNative != IntPtr.Zero)
+ {
+ Win32Native.CoTaskMemFree(pNative);
+ }
+ }
+ }
+
+ [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
+ internal static class UTF8BufferMarshaler
+ {
+ [System.Security.SecurityCritical]
+ static internal unsafe IntPtr ConvertToNative(StringBuilder sb, IntPtr pNativeBuffer, int flags)
+ {
+ if (null == sb)
+ {
+ return IntPtr.Zero;
+ }
+
+ // Convert to string first
+ string strManaged = sb.ToString();
+
+ // Get byte count
+ int nb = Encoding.UTF8.GetByteCount(strManaged);
+
+ // EmitConvertSpaceCLRToNative allocates memory
+ byte* pbNativeBuffer = (byte*)pNativeBuffer;
+ nb = strManaged.GetBytesFromEncoding(pbNativeBuffer, nb, Encoding.UTF8);
+
+ pbNativeBuffer[nb] = 0x0;
+ return (IntPtr)pbNativeBuffer;
+ }
+
+ [System.Security.SecurityCritical]
+ static internal unsafe void ConvertToManaged(StringBuilder sb, IntPtr pNative)
+ {
+ if (pNative == null)
+ return;
+
+ int nbBytes = StubHelpers.strlen((sbyte*)pNative);
+ int numChar = Encoding.UTF8.GetCharCount((byte*)pNative, nbBytes);
+
+ // +1 GetCharCount return 0 if the pNative points to a
+ // an empty buffer.We still need to allocate an empty
+ // buffer with a '\0' to distingiush it from null.
+ // Note that pinning on (char *pinned = new char[0])
+ // return null and Encoding.UTF8.GetChars do not like
+ // null argument.
+ char[] cCharBuffer = new char[numChar + 1];
+ cCharBuffer[numChar] = '\0';
+ fixed (char* pBuffer = cCharBuffer)
+ {
+ numChar = Encoding.UTF8.GetChars((byte*)pNative, nbBytes, pBuffer, numChar);
+ // replace string builder internal buffer
+ sb.ReplaceBufferInternal(pBuffer, numChar);
+ }
+ }
+ }
+
+ [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
internal static class BSTRMarshaler
{
[System.Security.SecurityCritical] // auto-generated
@@ -147,7 +258,7 @@ namespace System.StubHelpers {
if (hasTrailByte)
{
- // this is an odd-sized string with a trailing byte stored in its [....] block
+ // this is an odd-sized string with a trailing byte stored in its sync block
lengthInBytes++;
}
@@ -231,7 +342,7 @@ namespace System.StubHelpers {
if ((length & 1) == 1)
{
- // odd-sized strings need to have the trailing byte saved in their [....] block
+ // odd-sized strings need to have the trailing byte saved in their sync block
ret.SetTrailByte(((byte *)bstr.ToPointer())[length - 1]);
}
diff --git a/mcs/class/referencesource/mscorlib/system/text/asciiencoding.cs b/mcs/class/referencesource/mscorlib/system/text/asciiencoding.cs
index 471635e01dc..9c6e967206c 100644
--- a/mcs/class/referencesource/mscorlib/system/text/asciiencoding.cs
+++ b/mcs/class/referencesource/mscorlib/system/text/asciiencoding.cs
@@ -44,7 +44,7 @@ namespace System.Text
//
// The following methods are copied from EncodingNLS.cs.
// Unfortunately EncodingNLS.cs is internal and we're public, so we have to reimpliment them here.
- // These should be kept in [....] for the following classes:
+ // These should be kept in sync for the following classes:
// EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding
//
diff --git a/mcs/class/referencesource/mscorlib/system/text/encoding.cs b/mcs/class/referencesource/mscorlib/system/text/encoding.cs
index 05705748b54..3180f250c2e 100644
--- a/mcs/class/referencesource/mscorlib/system/text/encoding.cs
+++ b/mcs/class/referencesource/mscorlib/system/text/encoding.cs
@@ -109,7 +109,7 @@ namespace System.Text
//
// The following values are from mlang.idl. These values
- // should be in [....] with those in mlang.idl.
+ // should be in sync with those in mlang.idl.
//
private const int MIMECONTF_MAILNEWS = 0x00000001;
private const int MIMECONTF_BROWSER = 0x00000002;
diff --git a/mcs/class/referencesource/mscorlib/system/text/iso2022encoding.cs b/mcs/class/referencesource/mscorlib/system/text/iso2022encoding.cs
index 6443a665fbf..39c6e68ba70 100644
--- a/mcs/class/referencesource/mscorlib/system/text/iso2022encoding.cs
+++ b/mcs/class/referencesource/mscorlib/system/text/iso2022encoding.cs
@@ -11,7 +11,7 @@
// Abstract:
//
// Managed implimentation of ISO 2022 code pages, ported from the implimentation in c_is2022.dll
-// This code should be kept in [....] with the other implimentations
+// This code should be kept in sync with the other implimentations
// This encoding wraps the basic encodings in code that adds the shift in/out wrapper methods
//
// Notes:
diff --git a/mcs/class/referencesource/mscorlib/system/text/unicodeencoding.cs b/mcs/class/referencesource/mscorlib/system/text/unicodeencoding.cs
index a5124cf0eb3..a4854fdb7a8 100644
--- a/mcs/class/referencesource/mscorlib/system/text/unicodeencoding.cs
+++ b/mcs/class/referencesource/mscorlib/system/text/unicodeencoding.cs
@@ -84,7 +84,7 @@ namespace System.Text
//
// The following methods are copied from EncodingNLS.cs.
// Unfortunately EncodingNLS.cs is internal and we're public, so we have to reimpliment them here.
- // These should be kept in [....] for the following classes:
+ // These should be kept in sync for the following classes:
// EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding
//
diff --git a/mcs/class/referencesource/mscorlib/system/text/utf32encoding.cs b/mcs/class/referencesource/mscorlib/system/text/utf32encoding.cs
index 6b6eaa06a59..3a80fa65d86 100644
--- a/mcs/class/referencesource/mscorlib/system/text/utf32encoding.cs
+++ b/mcs/class/referencesource/mscorlib/system/text/utf32encoding.cs
@@ -85,7 +85,7 @@ namespace System.Text
//
// The following methods are copied from EncodingNLS.cs.
// Unfortunately EncodingNLS.cs is internal and we're public, so we have to reimpliment them here.
- // These should be kept in [....] for the following classes:
+ // These should be kept in sync for the following classes:
// EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding
//
diff --git a/mcs/class/referencesource/mscorlib/system/text/utf7encoding.cs b/mcs/class/referencesource/mscorlib/system/text/utf7encoding.cs
index 9da1fcb524b..b8d6403c2d6 100644
--- a/mcs/class/referencesource/mscorlib/system/text/utf7encoding.cs
+++ b/mcs/class/referencesource/mscorlib/system/text/utf7encoding.cs
@@ -149,7 +149,7 @@ namespace System.Text
//
// The following methods are copied from EncodingNLS.cs.
// Unfortunately EncodingNLS.cs is internal and we're public, so we have to reimpliment them here.
- // These should be kept in [....] for the following classes:
+ // These should be kept in sync for the following classes:
// EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding
//
diff --git a/mcs/class/referencesource/mscorlib/system/text/utf8encoding.cs b/mcs/class/referencesource/mscorlib/system/text/utf8encoding.cs
index fca5a790fed..02e89abd0e6 100644
--- a/mcs/class/referencesource/mscorlib/system/text/utf8encoding.cs
+++ b/mcs/class/referencesource/mscorlib/system/text/utf8encoding.cs
@@ -107,7 +107,7 @@ namespace System.Text
//
// The following methods are copied from EncodingNLS.cs.
// Unfortunately EncodingNLS.cs is internal and we're public, so we have to reimpliment them here.
- // These should be kept in [....] for the following classes:
+ // These should be kept in sync for the following classes:
// EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding
//
diff --git a/mcs/class/referencesource/mscorlib/system/threading/CDSsyncETWBCLProvider.cs b/mcs/class/referencesource/mscorlib/system/threading/CDSsyncETWBCLProvider.cs
index c6ec27a1370..6038171c503 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/CDSsyncETWBCLProvider.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/CDSsyncETWBCLProvider.cs
@@ -7,12 +7,12 @@
//
// CdsSyncEtwBCLProvider.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// A helper class for firing ETW events related to the Coordination Data Structure
-// [....] primitives. This provider is used by CDS [....] primitives in both mscorlib.dll
+// sync primitives. This provider is used by CDS sync primitives in both mscorlib.dll
// and system.dll. The purpose of sharing the provider class is to be able to enable
-// ETW tracing on all CDS [....] types with a single ETW provider GUID, and to minimize
+// ETW tracing on all CDS sync types with a single ETW provider GUID, and to minimize
// the number of providers in use.
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
@@ -36,8 +36,8 @@ namespace System.Threading
internal sealed class CdsSyncEtwBCLProvider : EventSource
{
/// <summary>
- /// Defines the singleton instance for the CDS [....] ETW provider.
- /// The CDS [....] Event provider GUID is {EC631D38-466B-4290-9306-834971BA0217}.
+ /// Defines the singleton instance for the CDS Sync ETW provider.
+ /// The CDS Sync Event provider GUID is {EC631D38-466B-4290-9306-834971BA0217}.
/// </summary>
public static CdsSyncEtwBCLProvider Log = new CdsSyncEtwBCLProvider();
/// <summary>Prevent external instantiation. All logging should go through the Log instance.</summary>
diff --git a/mcs/class/referencesource/mscorlib/system/threading/CancellationToken.cs b/mcs/class/referencesource/mscorlib/system/threading/CancellationToken.cs
index 565577f0bd7..5367d15d323 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/CancellationToken.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/CancellationToken.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
////////////////////////////////////////////////////////////////////////////////
#pragma warning disable 0420 // turn off 'a reference to a volatile field will not be treated as volatile' during CAS.
@@ -334,8 +334,8 @@ namespace System.Threading
return new CancellationTokenRegistration(); // nothing to do for tokens than can never reach the canceled state. Give them a dummy registration.
}
- // Capture [....]/execution contexts if required.
- // Note: Only capture [....]/execution contexts if IsCancellationRequested = false
+ // Capture sync/execution contexts if required.
+ // Note: Only capture sync/execution contexts if IsCancellationRequested = false
// as we know that if it is true that the callback will just be called synchronously.
SynchronizationContext capturedSyncContext = null;
diff --git a/mcs/class/referencesource/mscorlib/system/threading/CancellationTokenRegistration.cs b/mcs/class/referencesource/mscorlib/system/threading/CancellationTokenRegistration.cs
index a340d721ca0..11dbf0bd3c1 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/CancellationTokenRegistration.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/CancellationTokenRegistration.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
////////////////////////////////////////////////////////////////////////////////
using System.Diagnostics.Contracts;
diff --git a/mcs/class/referencesource/mscorlib/system/threading/CancellationTokenSource.cs b/mcs/class/referencesource/mscorlib/system/threading/CancellationTokenSource.cs
index 3f2e5f60811..8c4ef0216bb 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/CancellationTokenSource.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/CancellationTokenSource.cs
@@ -5,7 +5,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
////////////////////////////////////////////////////////////////////////////////
using System;
@@ -826,7 +826,7 @@ namespace System.Threading
m_executingCallback = currArrayFragment[i];
if (m_executingCallback != null)
{
- //Transition to the target [....] context (if necessary), and continue our work there.
+ //Transition to the target sync context (if necessary), and continue our work there.
CancellationCallbackCoreWorkArguments args = new CancellationCallbackCoreWorkArguments(currArrayFragment, i);
// marshal exceptions: either aggregate or perform an immediate rethrow
@@ -892,7 +892,7 @@ namespace System.Threading
{
if (callback.TargetExecutionContext != null)
{
- // we are running via a custom [....] context, so update the executing threadID
+ // we are running via a custom sync context, so update the executing threadID
callback.CancellationTokenSource.ThreadIDExecutingCallbacks = Thread.CurrentThread.ManagedThreadId;
}
callback.ExecuteCallback();
@@ -988,7 +988,7 @@ namespace System.Threading
// ----------------------------------------------------------
// -- CancellationCallbackCoreWorkArguments --
// ----------------------------------------------------------
- // Helper struct for passing data to the target [....] context
+ // Helper struct for passing data to the target sync context
internal struct CancellationCallbackCoreWorkArguments
{
internal SparselyPopulatedArrayFragment<CancellationCallbackInfo> m_currArrayFragment;
diff --git a/mcs/class/referencesource/mscorlib/system/threading/CountdownEvent.cs b/mcs/class/referencesource/mscorlib/system/threading/CountdownEvent.cs
index 4e1addf985a..1f1e95ee3a5 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/CountdownEvent.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/CountdownEvent.cs
@@ -7,7 +7,7 @@
//
// CountdownEvent.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// A simple coordination data structure that we use for fork/join style parallelism.
//
@@ -115,7 +115,7 @@ namespace System.Threading
// The latch is "completed" if its current count has reached 0. Note that this is NOT
// the same thing is checking the event's IsCompleted property. There is a tiny window
// of time, after the final decrement of the current count to 0 and before setting the
- // event, where the two values are out of [....].
+ // event, where the two values are out of sync.
return (m_currentCount <= 0);
}
}
diff --git a/mcs/class/referencesource/mscorlib/system/threading/LazyInitializer.cs b/mcs/class/referencesource/mscorlib/system/threading/LazyInitializer.cs
index 7be5f6a1a6c..f34e183d051 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/LazyInitializer.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/LazyInitializer.cs
@@ -7,7 +7,7 @@
//
// LazyInitializer.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// a set of lightweight static helpers for lazy initialization.
//
diff --git a/mcs/class/referencesource/mscorlib/system/threading/ManualResetEventSlim.cs b/mcs/class/referencesource/mscorlib/system/threading/ManualResetEventSlim.cs
index 7d9e15d1084..2d1278ab9be 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/ManualResetEventSlim.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/ManualResetEventSlim.cs
@@ -8,7 +8,7 @@
//
// SlimManualResetEvent.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// An manual-reset event that mixes a little spinning with a true Win32 event.
//
@@ -281,7 +281,7 @@ namespace System.Threading
// guarantee only one event is actually stored in this field.
if (Interlocked.CompareExchange(ref m_eventObj, newEventObj, null) != null)
{
- // We ----d with someone else and lost. Destroy the garbage event.
+ // We raced with someone else and lost. Destroy the garbage event.
newEventObj.Close();
return false;
diff --git a/mcs/class/referencesource/mscorlib/system/threading/SemaphoreSlim.cs b/mcs/class/referencesource/mscorlib/system/threading/SemaphoreSlim.cs
index f97d1ccc833..ddda1718769 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/SemaphoreSlim.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/SemaphoreSlim.cs
@@ -7,7 +7,7 @@
//
// SemaphoreSlim.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// A lightweight semahore class that contains the basic semaphore functions plus some useful functions like interrupt
// and wait handle exposing to allow waiting on multiple semaphores.
diff --git a/mcs/class/referencesource/mscorlib/system/threading/SpinLock.cs b/mcs/class/referencesource/mscorlib/system/threading/SpinLock.cs
index 6dd635a31df..78e7968eb12 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/SpinLock.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/SpinLock.cs
@@ -11,7 +11,7 @@
// repeatedly checking until the lock becomes available. As the thread remains active performing a non-useful task,
// the use of such a lock is a kind of busy waiting and consumes CPU resources without performing real work.
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
using System;
diff --git a/mcs/class/referencesource/mscorlib/system/threading/SpinWait.cs b/mcs/class/referencesource/mscorlib/system/threading/SpinWait.cs
index 3fb4a1fdc81..596f9885a41 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/SpinWait.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/SpinWait.cs
@@ -7,7 +7,7 @@
//
// SpinWait.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Central spin logic used across the entire code-base.
//
diff --git a/mcs/class/referencesource/mscorlib/system/threading/Tasks/BeginEndAwaitableAdapter.cs b/mcs/class/referencesource/mscorlib/system/threading/Tasks/BeginEndAwaitableAdapter.cs
index 68b89d53aa9..73d21b566d3 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/Tasks/BeginEndAwaitableAdapter.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/Tasks/BeginEndAwaitableAdapter.cs
@@ -3,7 +3,7 @@
/// Copyright (c) Microsoft Corporation. All rights reserved.
/// </copyright>
///
-/// <owner>[....]</owner>
+/// <owner>Microsoft</owner>
/// <owner>gpaperin</owner>
///----------- ----------- ----------- ----------- ----------- -----------
diff --git a/mcs/class/referencesource/mscorlib/system/threading/Tasks/ConcurrentExclusiveSchedulerPair.cs b/mcs/class/referencesource/mscorlib/system/threading/Tasks/ConcurrentExclusiveSchedulerPair.cs
index 50e9a8122e8..ec8b1be4cb9 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/Tasks/ConcurrentExclusiveSchedulerPair.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/Tasks/ConcurrentExclusiveSchedulerPair.cs
@@ -7,7 +7,7 @@
//
// ConcurrentExclusiveSchedulerPair.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// A pair of schedulers that together support concurrent (reader) / exclusive (writer)
// task scheduling. Using just the exclusive scheduler can be used to simulate a serial
@@ -70,7 +70,7 @@ namespace System.Threading.Tasks
/// <summary>Default MaxConcurrencyLevel is the processor count if not otherwise specified.</summary>
private static Int32 DefaultMaxConcurrencyLevel { get { return Environment.ProcessorCount; } }
- /// <summary>Gets the [....] obj used to protect all state on this instance.</summary>
+ /// <summary>Gets the sync obj used to protect all state on this instance.</summary>
private object ValueLock { get { return m_threadProcessingMapping; } }
/// <summary>
@@ -763,7 +763,7 @@ namespace System.Threading.Tasks
/// <param name="isReplacementReplica">If this task is being created to replace another.</param>
/// <remarks>
/// These options should be used for all tasks that have the potential to run user code or
- /// that are repeatedly spawned and thus need a modi---- of fair treatment.
+ /// that are repeatedly spawned and thus need a modicum of fair treatment.
/// </remarks>
/// <returns>The options to use.</returns>
internal static TaskCreationOptions GetCreationOptionsForTask(bool isReplacementReplica = false)
diff --git a/mcs/class/referencesource/mscorlib/system/threading/Tasks/Future.cs b/mcs/class/referencesource/mscorlib/system/threading/Tasks/Future.cs
index f8011808bfa..b04813409d8 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/Tasks/Future.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/Tasks/Future.cs
@@ -7,7 +7,7 @@
//
// Future.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// A task that produces a value.
//
diff --git a/mcs/class/referencesource/mscorlib/system/threading/Tasks/FutureFactory.cs b/mcs/class/referencesource/mscorlib/system/threading/Tasks/FutureFactory.cs
index 21ec1d7b834..4c11ddf08d9 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/Tasks/FutureFactory.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/Tasks/FutureFactory.cs
@@ -7,7 +7,7 @@
//
// FutureFactory.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// As with TaskFactory, TaskFactory<TResult> encodes common factory patterns into helper methods.
//
diff --git a/mcs/class/referencesource/mscorlib/system/threading/Tasks/Parallel.cs b/mcs/class/referencesource/mscorlib/system/threading/Tasks/Parallel.cs
index 89ae7f7d20e..3622447b1d3 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/Tasks/Parallel.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/Tasks/Parallel.cs
@@ -7,7 +7,7 @@
//
// Parallel.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// A helper class that contains parallel versions of various looping constructs. This
// internally uses the task parallel library, but takes care to expose very little
diff --git a/mcs/class/referencesource/mscorlib/system/threading/Tasks/ParallelLoopState.cs b/mcs/class/referencesource/mscorlib/system/threading/Tasks/ParallelLoopState.cs
index d37a6e7c1b5..a8f03b1dad9 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/Tasks/ParallelLoopState.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/Tasks/ParallelLoopState.cs
@@ -7,7 +7,7 @@
//
// ParallelState.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// A non-generic and generic parallel state class, used by the Parallel helper class
// for parallel loop management.
diff --git a/mcs/class/referencesource/mscorlib/system/threading/Tasks/ParallelRangeManager.cs b/mcs/class/referencesource/mscorlib/system/threading/Tasks/ParallelRangeManager.cs
index 89d3b65b40e..7c625cf2292 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/Tasks/ParallelRangeManager.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/Tasks/ParallelRangeManager.cs
@@ -7,7 +7,7 @@
//
// ParallelRangeManager.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Implements the algorithm for distributing loop indices to parallel loop workers
//
diff --git a/mcs/class/referencesource/mscorlib/system/threading/Tasks/ProducerConsumerQueues.cs b/mcs/class/referencesource/mscorlib/system/threading/Tasks/ProducerConsumerQueues.cs
index 50febfcbcf4..b0b8db284d5 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/Tasks/ProducerConsumerQueues.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/Tasks/ProducerConsumerQueues.cs
@@ -7,7 +7,7 @@
//
// ProducerConsumerQueues.cs
//
-// <OWNER>[....], [....]</OWNER>
+// <OWNER>Microsoft, Microsoft</OWNER>
//
// Specialized producer/consumer queues.
//
@@ -58,7 +58,7 @@ namespace System.Threading.Tasks
int Count { get; }
/// <summary>A thread-safe way to get the number of items in the collection. May synchronize access by locking the provided synchronization object.</summary>
- /// <param name="syncObj">The [....] object used to lock</param>
+ /// <param name="syncObj">The sync object used to lock</param>
/// <returns>The collection count</returns>
int GetCountSafe(object syncObj);
}
diff --git a/mcs/class/referencesource/mscorlib/system/threading/Tasks/TPLETWProvider.cs b/mcs/class/referencesource/mscorlib/system/threading/Tasks/TPLETWProvider.cs
index aed9c00a5b3..005e7d3854c 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/Tasks/TPLETWProvider.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/Tasks/TPLETWProvider.cs
@@ -7,7 +7,7 @@
//
// TplEtwProvider.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// EventSource for TPL.
//
diff --git a/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs b/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs
index 6ee970a08ef..0ca6568e9fb 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs
@@ -7,7 +7,7 @@
//
// Task.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// A schedulable unit of work.
//
diff --git a/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskCanceledException.cs b/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskCanceledException.cs
index fe647cdb3d6..256bd029487 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskCanceledException.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskCanceledException.cs
@@ -7,7 +7,7 @@
//
// TaskCanceledException.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// An exception for task cancellations.
//
diff --git a/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskCompletionSource.cs b/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskCompletionSource.cs
index 8c5edf09723..7d1487a7c99 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskCompletionSource.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskCompletionSource.cs
@@ -7,7 +7,7 @@
//
// TaskCompletionSource.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// TaskCompletionSource<TResult> is the producer end of an unbound future. Its
// Task member may be distributed as the consumer end of the future.
diff --git a/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskContinuation.cs b/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskContinuation.cs
index 6b11de5616f..ec681026394 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskContinuation.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskContinuation.cs
@@ -7,7 +7,7 @@
//
// TaskContinuation.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Implementation of task continuations, TaskContinuation, and its descendants.
//
@@ -223,7 +223,7 @@ namespace System.Threading.Tasks
// - StandardTaskContinuation: wraps a task,options,and scheduler, and overrides Run to process the task with that configuration
// - AwaitTaskContinuation: base for continuations created through TaskAwaiter; targets default scheduler by default
// - TaskSchedulerAwaitTaskContinuation: awaiting with a non-default TaskScheduler
- // - SynchronizationContextAwaitTaskContinuation: awaiting with a "current" [....] ctx
+ // - SynchronizationContextAwaitTaskContinuation: awaiting with a "current" sync ctx
/// <summary>Represents a continuation.</summary>
internal abstract class TaskContinuation
diff --git a/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskExceptionHolder.cs b/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskExceptionHolder.cs
index 8be36b654ba..c078b633601 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskExceptionHolder.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskExceptionHolder.cs
@@ -7,7 +7,7 @@
//
// TaskExceptionHolder.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// An abstraction for holding and aggregating exceptions.
//
diff --git a/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskFactory.cs b/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskFactory.cs
index 3c8e798e031..b15df277ab4 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskFactory.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskFactory.cs
@@ -7,7 +7,7 @@
//
// TaskFactory.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// There are a plethora of common patterns for which Tasks are created. TaskFactory encodes
// these patterns into helper methods. These helpers also pick up default configuration settings
diff --git a/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskScheduler.cs b/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskScheduler.cs
index 083f9e1509e..b2474fc1bb2 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskScheduler.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskScheduler.cs
@@ -7,7 +7,7 @@
//
// TaskScheduler.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// This file contains the primary interface and management of tasks and queues.
//
@@ -281,8 +281,8 @@ namespace System.Threading.Tasks
// Member variables
//
- // The global container that keeps track of TaskScheduler instances. s_activeTaskSchedulers must be initialized before s_defaultTaskScheduler.
- private static readonly ConditionalWeakTable<TaskScheduler, object> s_activeTaskSchedulers = new ConditionalWeakTable<TaskScheduler,object>();
+ // The global container that keeps track of TaskScheduler instances for debugging purposes.
+ private static ConditionalWeakTable<TaskScheduler, object> s_activeTaskSchedulers;
// An AppDomain-wide default manager.
private static readonly TaskScheduler s_defaultTaskScheduler = new ThreadPoolTaskScheduler();
@@ -299,16 +299,32 @@ namespace System.Threading.Tasks
//
// Constructors and public properties
//
-
+
/// <summary>
/// Initializes the <see cref="System.Threading.Tasks.TaskScheduler"/>.
/// </summary>
protected TaskScheduler()
{
- // Protected constructor. It's here to ensure all user implemented TaskSchedulers will be
- // registered in the active schedulers list.
- Contract.Assert(s_activeTaskSchedulers != null, "Expected non-null s_activeTaskSchedulers");
- s_activeTaskSchedulers.Add(this, null);
+ // Register the scheduler in the active scheduler list. This is only relevant when debugging,
+ // so we only pay the cost if the debugger is attached when the scheduler is created. This
+ // means that the internal TaskScheduler.GetTaskSchedulersForDebugger() will only include
+ // schedulers created while the debugger is attached.
+ if (Debugger.IsAttached)
+ {
+ AddToActiveTaskSchedulers();
+ }
+ }
+
+ /// <summary>Adds this scheduler ot the active schedulers tracking collection for debugging purposes.</summary>
+ private void AddToActiveTaskSchedulers()
+ {
+ ConditionalWeakTable<TaskScheduler, object> activeTaskSchedulers = s_activeTaskSchedulers;
+ if (activeTaskSchedulers == null)
+ {
+ Interlocked.CompareExchange(ref s_activeTaskSchedulers, new ConditionalWeakTable<TaskScheduler, object>(), null);
+ activeTaskSchedulers = s_activeTaskSchedulers;
+ }
+ activeTaskSchedulers.Add(this, null);
}
/// <summary>
@@ -566,9 +582,20 @@ namespace System.Threading.Tasks
[SecurityCritical]
internal static TaskScheduler[] GetTaskSchedulersForDebugger()
{
- Contract.Assert(s_activeTaskSchedulers != null, "Expected non-null s_activeTaskSchedulers");
+ if (s_activeTaskSchedulers == null)
+ {
+ // No schedulers were tracked. Just give back the default.
+ return new TaskScheduler[] { s_defaultTaskScheduler };
+ }
ICollection<TaskScheduler> schedulers = s_activeTaskSchedulers.Keys;
+ if (!schedulers.Contains(s_defaultTaskScheduler))
+ {
+ // Make sure the default is included, in case the debugger attached
+ // after it was created.
+ schedulers.Add(s_defaultTaskScheduler);
+ }
+
var arr = new TaskScheduler[schedulers.Count];
schedulers.CopyTo(arr, 0);
foreach (var scheduler in arr)
@@ -590,13 +617,13 @@ namespace System.Threading.Tasks
m_taskScheduler = scheduler;
}
- // returns the scheduler’s Id
+ // returns the scheduler’s Id
public Int32 Id
{
get { return m_taskScheduler.Id; }
}
- // returns the scheduler’s GetScheduledTasks
+ // returns the scheduler’s GetScheduledTasks
public IEnumerable<Task> ScheduledTasks
{
[SecurityCritical]
diff --git a/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskSchedulerException.cs b/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskSchedulerException.cs
index 61b75ea7fc0..5d2f9ad79e0 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskSchedulerException.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskSchedulerException.cs
@@ -7,7 +7,7 @@
//
// TaskSchedulerException.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// An exception for task schedulers.
//
diff --git a/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskToApm.cs b/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskToApm.cs
index 952d539a73a..e518055ee05 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskToApm.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskToApm.cs
@@ -7,7 +7,7 @@
//
// TaskToApm.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Helper methods for using Tasks to implement the APM pattern.
//
diff --git a/mcs/class/referencesource/mscorlib/system/threading/Tasks/ThreadPoolTaskScheduler.cs b/mcs/class/referencesource/mscorlib/system/threading/Tasks/ThreadPoolTaskScheduler.cs
index 0da78181961..bf5b063dfb3 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/Tasks/ThreadPoolTaskScheduler.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/Tasks/ThreadPoolTaskScheduler.cs
@@ -1,4 +1,4 @@
-// ==++==
+// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
@@ -7,7 +7,7 @@
//
// TaskScheduler.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// This file contains the primary interface and management of tasks and queues.
//
@@ -34,6 +34,7 @@ namespace System.Threading.Tasks
/// </summary>
internal ThreadPoolTaskScheduler()
{
+ int id = base.Id; // force ID creation of the default scheduler
}
// static delegate for threads allocated to handle LongRunning tasks.
diff --git a/mcs/class/referencesource/mscorlib/system/threading/ThreadLocal.cs b/mcs/class/referencesource/mscorlib/system/threading/ThreadLocal.cs
index 6bc6d2b6fba..916a7751c2f 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/ThreadLocal.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/ThreadLocal.cs
@@ -8,7 +8,7 @@
//
// ThreadLocal.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// A class that provides a simple, lightweight implementation of thread-local lazy-initialization, where a value is initialized once per accessing
// thread; this provides an alternative to using a ThreadStatic static variable and having
diff --git a/mcs/class/referencesource/mscorlib/system/threading/abandonedmutexexception.cs b/mcs/class/referencesource/mscorlib/system/threading/abandonedmutexexception.cs
index d32f45303b5..593f215f14b 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/abandonedmutexexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/abandonedmutexexception.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// AbandonedMutexException
// Thrown when a wait completes because one or more mutexes was abandoned.
diff --git a/mcs/class/referencesource/mscorlib/system/threading/asynclocal.cs b/mcs/class/referencesource/mscorlib/system/threading/asynclocal.cs
index 600a4b0ee03..3e1f5f9f69e 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/asynclocal.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/asynclocal.cs
@@ -2,7 +2,7 @@
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Collections.Generic;
diff --git a/mcs/class/referencesource/mscorlib/system/threading/autoresetevent.cs b/mcs/class/referencesource/mscorlib/system/threading/autoresetevent.cs
index e7506554e42..1ed58d271af 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/autoresetevent.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/autoresetevent.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
/*=============================================================================
**
** Class: AutoResetEvent
diff --git a/mcs/class/referencesource/mscorlib/system/threading/compressedstack.cs b/mcs/class/referencesource/mscorlib/system/threading/compressedstack.cs
index d6c584d8276..5c18afbbb1d 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/compressedstack.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/compressedstack.cs
@@ -7,8 +7,8 @@
**
** Class: CompressedStack
**
-** <OWNER>[....]</OWNER>
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
+** <OWNER>Microsoft</OWNER>
**
** Purpose: Managed wrapper for the security stack compression implementation
**
diff --git a/mcs/class/referencesource/mscorlib/system/threading/eventwaithandle.cs b/mcs/class/referencesource/mscorlib/system/threading/eventwaithandle.cs
index 2d602aac343..5acd3c78692 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/eventwaithandle.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/eventwaithandle.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
/*=============================================================================
**
** Class: EventWaitHandle
diff --git a/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs b/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs
index f45448b9771..fb7a53c429e 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs
@@ -6,7 +6,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
/*============================================================
**
** Class: ExecutionContext
@@ -450,7 +450,7 @@ namespace System.Threading
public override int GetHashCode()
{
- // review - [....]
+ // review - Microsoft
return _thread == null ? ToString().GetHashCode() : _thread.GetHashCode();
}
@@ -1237,7 +1237,7 @@ namespace System.Threading
if (!ecCurrent.IsNull)
{
- // capture the [....] context
+ // capture the sync context
if (0 == (options & CaptureOptions.IgnoreSyncCtx))
syncCtxNew = (ecCurrent.SynchronizationContext == null) ? null : ecCurrent.SynchronizationContext.CreateCopy();
diff --git a/mcs/class/referencesource/mscorlib/system/threading/hostexecutioncontextmanager.cs b/mcs/class/referencesource/mscorlib/system/threading/hostexecutioncontextmanager.cs
index 981b2889b52..2f5ccc66761 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/hostexecutioncontextmanager.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/hostexecutioncontextmanager.cs
@@ -4,7 +4,7 @@ using System.Diagnostics.Contracts;
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
/*============================================================
**
** Class: ExecutionContext
diff --git a/mcs/class/referencesource/mscorlib/system/threading/interlocked.cs b/mcs/class/referencesource/mscorlib/system/threading/interlocked.cs
index fad5b4625c2..441460b70a5 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/interlocked.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/interlocked.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
namespace System.Threading
{
using System;
diff --git a/mcs/class/referencesource/mscorlib/system/threading/lockcookie.cs b/mcs/class/referencesource/mscorlib/system/threading/lockcookie.cs
index 86f8182221d..32c9760976f 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/lockcookie.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/lockcookie.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
/*============================================================
**
** Class: LockCookie
@@ -29,7 +29,7 @@ namespace System.Threading {
public override int GetHashCode()
{
- // review - [....]!
+ // review - Microsoft!
return _dwFlags + _dwWriterSeqNum + _wReaderAndWriterLevel + _dwThreadID;
}
diff --git a/mcs/class/referencesource/mscorlib/system/threading/lockrecursionexception.cs b/mcs/class/referencesource/mscorlib/system/threading/lockrecursionexception.cs
index f9c999135f7..392c72cc8a8 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/lockrecursionexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/lockrecursionexception.cs
@@ -13,8 +13,8 @@
// acquire a lock, because the particular lock kind doesn't
// support it in its current state.
//
-// <OWNER>[....]</OWNER>
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
+// <OWNER>Microsoft</OWNER>
//
============================================================*/
diff --git a/mcs/class/referencesource/mscorlib/system/threading/manualresetevent.cs b/mcs/class/referencesource/mscorlib/system/threading/manualresetevent.cs
index 40db6655c7f..1586fb44ac9 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/manualresetevent.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/manualresetevent.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
/*=============================================================================
**
** Class: ManualResetEvent
diff --git a/mcs/class/referencesource/mscorlib/system/threading/monitor.cs b/mcs/class/referencesource/mscorlib/system/threading/monitor.cs
index 2bb82ed520e..fbf264dad25 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/monitor.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/monitor.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
/*=============================================================================
**
** Class: Monitor
diff --git a/mcs/class/referencesource/mscorlib/system/threading/mutex.cs b/mcs/class/referencesource/mscorlib/system/threading/mutex.cs
index bfd5458ca91..9e403c08a8d 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/mutex.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/mutex.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
/*=============================================================================
**
** Class: Mutex
diff --git a/mcs/class/referencesource/mscorlib/system/threading/overlapped.cs b/mcs/class/referencesource/mscorlib/system/threading/overlapped.cs
index eb22b0a8c16..2a19f42f086 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/overlapped.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/overlapped.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
/*
* This files defines the following types:
diff --git a/mcs/class/referencesource/mscorlib/system/threading/readerwriterlock.cs b/mcs/class/referencesource/mscorlib/system/threading/readerwriterlock.cs
index cc5a736be4a..50f61b25fae 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/readerwriterlock.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/readerwriterlock.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
/*============================================================
**
** Class: RWLock
diff --git a/mcs/class/referencesource/mscorlib/system/threading/semaphorefullexception.cs b/mcs/class/referencesource/mscorlib/system/threading/semaphorefullexception.cs
index 19b0632ca47..5a61c8f793d 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/semaphorefullexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/semaphorefullexception.cs
@@ -7,7 +7,7 @@
**
** Class: SemaphoreFullException
**
-** <OWNER>[....]</OWNER>
+** <OWNER>Microsoft</OWNER>
**
=============================================================================*/
namespace System.Threading {
diff --git a/mcs/class/referencesource/mscorlib/system/threading/synchronizationcontext.cs b/mcs/class/referencesource/mscorlib/system/threading/synchronizationcontext.cs
index 3f47268c99c..98e2f3fb73e 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/synchronizationcontext.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/synchronizationcontext.cs
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
/*============================================================
**
** Class: SynchronizationContext
@@ -81,7 +81,7 @@ namespace System.Threading
static Type s_cachedPreparedType4;
static Type s_cachedPreparedType5;
- // protected so that only the derived [....] context class can enable these flags
+ // protected so that only the derived sync context class can enable these flags
[System.Security.SecuritySafeCritical] // auto-generated
[SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "We never dereference s_cachedPreparedType*, so ordering is unimportant")]
protected void SetWaitNotificationRequired()
@@ -95,7 +95,7 @@ namespace System.Threading
// So we keep track of a few types we've already prepared in this AD. It is uncommon to have more than
// a few SynchronizationContext implementations, so we only cache the first five we encounter; this lets
// our cache be much faster than a more general cache might be. This is important, because this
- // is a *very* hot code path for many WPF and [....] apps.
+ // is a *very* hot code path for many WPF and Microsoft apps.
//
Type type = this.GetType();
if (s_cachedPreparedType1 != type &&
diff --git a/mcs/class/referencesource/mscorlib/system/threading/synchronizationlockexception.cs b/mcs/class/referencesource/mscorlib/system/threading/synchronizationlockexception.cs
index 884005d214b..91d4ac3639c 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/synchronizationlockexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/synchronizationlockexception.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
/*=============================================================================
**
** Class: SynchronizationLockException
diff --git a/mcs/class/referencesource/mscorlib/system/threading/thread.cs b/mcs/class/referencesource/mscorlib/system/threading/thread.cs
index d85cf9fb976..0c6462309ff 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/thread.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/thread.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
/*=============================================================================
**
** Class: Thread
diff --git a/mcs/class/referencesource/mscorlib/system/threading/threadabortexception.cs b/mcs/class/referencesource/mscorlib/system/threading/threadabortexception.cs
index 3063b06aed6..2c8003d021f 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/threadabortexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/threadabortexception.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
/*=============================================================================
**
** Class: ThreadAbortException
diff --git a/mcs/class/referencesource/mscorlib/system/threading/threadinterruptedexception.cs b/mcs/class/referencesource/mscorlib/system/threading/threadinterruptedexception.cs
index 28e1eed10d3..af9a03dc36b 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/threadinterruptedexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/threadinterruptedexception.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
/*=============================================================================
**
** Class: ThreadInterruptedException
diff --git a/mcs/class/referencesource/mscorlib/system/threading/threadpool.cs b/mcs/class/referencesource/mscorlib/system/threading/threadpool.cs
index 79ca731df46..b51c8755e74 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/threadpool.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/threadpool.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
/*=============================================================================
**
** Class: ThreadPool
@@ -131,7 +131,7 @@ namespace System.Threading
}
else if (i == array.Length - 1)
{
- // Must resize. If we ----d and lost, we start over again.
+ // Must resize. If we raced and lost, we start over again.
if (array != m_array)
continue;
diff --git a/mcs/class/referencesource/mscorlib/system/threading/threadstartexception.cs b/mcs/class/referencesource/mscorlib/system/threading/threadstartexception.cs
index a04134946c9..99163d89bd7 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/threadstartexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/threadstartexception.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
namespace System.Threading
{
diff --git a/mcs/class/referencesource/mscorlib/system/threading/threadstateexception.cs b/mcs/class/referencesource/mscorlib/system/threading/threadstateexception.cs
index 3fa634c2396..fecd34441cc 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/threadstateexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/threadstateexception.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
/*=============================================================================
**
** Class: ThreadStateException
diff --git a/mcs/class/referencesource/mscorlib/system/threading/timeout.cs b/mcs/class/referencesource/mscorlib/system/threading/timeout.cs
index bf070e1d328..9b7d3562a09 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/timeout.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/timeout.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
namespace System.Threading {
using System.Threading;
diff --git a/mcs/class/referencesource/mscorlib/system/threading/timer.cs b/mcs/class/referencesource/mscorlib/system/threading/timer.cs
index eae1ca60fd9..f9f51d03c0f 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/timer.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/timer.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using Microsoft.Win32;
using Microsoft.Win32.SafeHandles;
@@ -72,7 +72,7 @@ namespace System.Threading
// We need to keep our notion of time synchronized with the calls to SleepEx that drive
// the underlying native timer. In Win8, SleepEx does not count the time the machine spends
// sleeping/hibernating. Environment.TickCount (GetTickCount) *does* count that time,
- // so we will get out of [....] with SleepEx if we use that method.
+ // so we will get out of sync with SleepEx if we use that method.
//
// So, on Win8, we use QueryUnbiasedInterruptTime instead; this does not count time spent
// in sleep/hibernate mode.
diff --git a/mcs/class/referencesource/mscorlib/system/threading/volatile.cs b/mcs/class/referencesource/mscorlib/system/threading/volatile.cs
index abf6cb7cc31..5682b2973fc 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/volatile.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/volatile.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
using System;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
diff --git a/mcs/class/referencesource/mscorlib/system/threading/waithandle.cs b/mcs/class/referencesource/mscorlib/system/threading/waithandle.cs
index e1f436b6bc7..1dfaac3e7dc 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/waithandle.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/waithandle.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
/*=============================================================================
**
** Class: WaitHandle (this name is NOT definitive)
@@ -113,7 +113,7 @@ namespace System.Threading
// ideally do these things:
// *) Expose a settable SafeHandle property on WaitHandle.
// *) Expose a settable OwnsHandle property on SafeHandle.
- // We're looking into this. -- [....]
+ // We're looking into this. -- Microsoft
if (safeWaitHandle != null)
{
safeWaitHandle.SetHandleAsInvalid();
diff --git a/mcs/class/referencesource/mscorlib/system/threading/waithandlecannotbeopenedexception.cs b/mcs/class/referencesource/mscorlib/system/threading/waithandlecannotbeopenedexception.cs
index b7b80e060ea..06c941d6e62 100644
--- a/mcs/class/referencesource/mscorlib/system/threading/waithandlecannotbeopenedexception.cs
+++ b/mcs/class/referencesource/mscorlib/system/threading/waithandlecannotbeopenedexception.cs
@@ -4,7 +4,7 @@
//
// ==--==
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
namespace System.Threading
{
using System;
diff --git a/mcs/class/referencesource/mscorlib/system/type.cs b/mcs/class/referencesource/mscorlib/system/type.cs
index 929fb43097f..ef7472f5016 100644
--- a/mcs/class/referencesource/mscorlib/system/type.cs
+++ b/mcs/class/referencesource/mscorlib/system/type.cs
@@ -6,7 +6,7 @@
//
// File: Type.cs
//
-// <OWNER>[....]</OWNER>
+// <OWNER>Microsoft</OWNER>
//
// Implements System.Type
//